text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="start_text_1">Bạn muốn tham gia sự kiện tại đâu?</string>
    <string name="events">Sự Kiện</string>
    <string name="profile">Cá Nhân</string>
    <string name="likes">Yêu Thích</string>
    <string name="location_hint">Nhập một địa điểm</string>
    <string name="see_more">Xem thêm</string>
    <string name="see_less">Rút gọn</string>
    <string name="location">Địa Điểm</string>
    <string name="organizer">Người Tổ Chức</string>
    <string name="whats_good">Sự kiện thú vị tại</string>
    <string name="where">Ở đâu?</string>
    <string name="no_internet_message">Ứng dụng gặp sự cố kĩ thuật. Xin hãy kiểm tra lại kết nối hoặc thử lại</string>
    <string name="error_fetching_events">Chúng tôi đang gặp khó khăn khi tìm nạp sự kiện. Thử lại sau.</string>
    <string name="tickets_sold_out">Xin lỗi, sự kiện đã bán hết vé!</string>
    <string name="retry">Thử Lại</string>
    <string name="more_like_this">Sự kiện tương tự</string>
    <string name="favorite_event">Sự Kiện Yêu Thích</string>
    <string name="refund_Policy">Chính sách hoàn trả</string>
    <string name="no_events_message">Thật đáng tiếc, không có sự kiện nào tại đây.</string>
    <string name="search">Tìm Kiếm</string>
    <string name="search_hint">Tìm kiếm...</string>
    <string name="go_out">Tôi muốn tham gia sự kiện</string>
    <string name="anywhere">Bất cứ đâu</string>
    <string name="anytime">Bất cứ lúc nào</string>
    <string name="today">Hôm nay</string>
    <string name="tomorrow">Ngày mai</string>
    <string name="weekend">Cuối tuần nà</string>
    <string name="month">Trong tháng tới</string>
    <string name="what_time">Thời gian phù hợp?</string>
    <string name="pick_date">Hãy lựa chọn ngày...</string>
    <string name="no_search_results">Hmmm, chúng tôi không tìm được kết quả nào. Xin tìm kiếm bằng từ khóa khác</string>
    <string name="event_details">Chi tiết sự kiện</string>
    <string name="see_maps">Xem bản đồ</string>
    <string name="in">Tại</string>
    <string name="logout">Đăng Xuất</string>
    <string name="settings">Cài Đặt</string>
    <string name="login">Đăng Nhập</string>
    <string name="forgot_password">Tôi quên mất mật khẩu</string>
    <string name="email_sent_alert">Hãy kiểm tra email</string>
    <string name="email_sent_message">Một email đã được gửi tới bạn để đặt lại mật khẩu</string>
    <string name="sign_up">Đăng Ký Tài Khoản</string>
    <string name="password">Mật Khẩu</string>
    <string name="edit_profile">Chỉnh Sửa Thông Tin</string>
    <string name="ticket_issues">Vấn đề về Vé</string>
    <string name="confirm_password">Xác Nhận Mật Khẩu</string>
    <string name="first_name_optional">"Tên "</string>
    <string name="last_name_optional">Tên Họ</string>
    <string name="welcome_back">Chào mừng trở lại!</string>
    <string name="update">Cập Nhập</string>
    <string name="starts_on">Ngày Bắt Đầu:</string>
    <string name="ends_on">Ngày Kết Thúc:</string>
    <string name="start_time">Thời Gian Bắt Đầu:</string>
    <string name="end_time">Thời Gian Kết Thúc:</string>
    <string name="event_link">Link Sự Kiện:</string>
    <string name="event_description">Thông Tin Sự Kiện:</string>
    <string name="event_name">Tên Sự Kiện:</string>
    <string name="event_location">Địa Điểm Sự Kiện:</string>
    <string name="share">Chia Sẻ</string>
    <string name="add_to_calendar">Ghi Chú Vào Lịch</string>
    <string name="tickets">Vé</string>
    <string name="register">Đăng Kí</string>
    <string name="ticket_name">Tên Vé</string>
    <string name="price">Giá</string>
    <string name="your_info">Thông Tin Của Bạn</string>
    <string name="first_name">Tên</string>
    <string name="last_name">Tên Họ</string>
    <string name="email">Email</string>
    <string name="no_ticket_message">Không tìm thấy vé của bạn? Tìm hiểu về cách để lấy vé</string>
    <string name="find_my_tickets">Tìm vé của tôi</string>
    <string name="card_number">Số Thẻ</string>
    <string name="expiration_date">Ngày Hết Hạn</string>
    <string name="postal_code">Mã Bưu Điện</string>
    <string name="payment_info">Thông Tin Thanh Toán</string>
    <string name="not_you">Không phải bạn?</string>
    <string name="sign_out">Đăng xuất</string>
    <string name="all_fees">Mọi chi phí đã được đính kèm trong vé</string>
    <string name="order_completed">ĐẶT VÉ THÀNH CÔNG</string>
    <string name="add">+ THÊM</string>
    <string name="invite">MỜI</string>
    <string name="name">Tên</string>
    <string name="event">Sự Kiện</string>
    <string name="date">Ngày</string>
    <string name="order_identifier">Mã số vé</string>
    <string name="event_summary">Tóm Tắt Sự Kiện</string>
    <string name="event_summary_preview">Rất tốt</string>
    <string name="version_settings">Phiên Bản</string>
    <string name="key_version">phiên bản</string>
    <string name="key_about">Thông tin</string>
    <string name="key_rating">đánh giá</string>
    <string name="rating_settings">Đánh Giá Chúng Tôi</string>
    <string name="suggestion_settings">Gợi Ý Cải Thiện</string>
    <string name="key_suggestion">gợi ý</string>
    <string name="key_profile">thông tin</string>
    <string name="logged_in_account">Tài Khoản</string>
    <string name="privacy">Bảo Mật</string>
    <string name="key_privacy">bảo mật</string>
    <string name="cookie_policy">Chính Sách Cookie</string>
    <string name="title_terms_of_service">Điều Khoản Dịch Vụ</string>
    <string name="legal">Hợp pháp</string>
    <string name="message">Bạn có muốn đăng xuất?</string>
    <string name="cancel">Hủy</string>
    <string name="find_something_to_do">Tìm kiếm hoạt động để tham gia!!</string>
    <string name="current_location">Sự dụng địa điểm hiện tại</string>
    <string name="attendee_details">Thông Tin Người Tham Dự</string>
    <string name="start_text">Tôi xác nhận</string>
    <string name="terms_text">điều khoản dịch vụ</string>
    <string name="middle_text">và đã đọc</string>
    <string name="privacy_text">chính sách bảo mật</string>
    <string name="logged_in_automatically">Đăng Nhập Tự Động</string>
    <string name="log_in_first">Trước tiên, bạn cần đăng nhập!</string>
    <string name="sign_in_canceled">Đăng nhập đã bị hủy!</string>
    <string name="cannot_fetch_location">Không thể tải địa điểm!</string>
    <string name="start_text_2">Chúng tôi sẽ đề xuất một số sự kiện thú vị gần bạn</string>
    <string name="pick_a_city">Lựa chọn một thành phố</string>
    <string name="report_event">Gửi Phản Hồi</string>
    <string name="about">Chi Tiết</string>
    <string name="event_host_details">Thông Tin Người Tổ Chức</string>
    <string name="manage_events">Quản Lý Sự Kiện</string>
    <string name="qty">Qty</string>
    <string name="item">Mục</string>
    <string name="subtotal">Tổng Phụ</string>
    <string name="no_tickets_message">Số lượng không phù hợp. Hãy nhập ít nhất 1 vé</string>
    <string name="whoops">Xin Lỗi!</string>
    <string name="ok">ok</string>
    <string name="view_ticket">Xem</string>
    <string name="view">(xem)</string>
    <string name="invalid_email_message">Email không hợp lệ!</string>
    <string name="invalid_password_message">Mật khẩu quá ngắn!</string>
    <string name="invalid_confirm_password_message">Mật khẩu xác nhận lần hai không trùng với lần đầu!</string>
    <string name="timeZone_title">Sử dụng múi giờ của sự kiện.</string>
    <string name="timeZone_summary">Múi giờ của bạn sẽ được sử dụng khi khóa lại.</string>
    <string name="hide">(giấu)</string>
    <string name="country">Quốc Gia</string>
    <string name="visit_website">truy cập trang web</string>
    <string name="key_visit_website">truy cập trang web</string>
    <string name="accept_terms_and_conditions">Vui lòng chấp nhận các điều khoản và điều kiện!</string>
    <string name="no_internet_connection_message">Mất kết nối Internet!</string>
    <string name="term_and_conditions">Vui lòng chấp thuận các điều khoản!</string>
    <string name="invalid_email_address_message">Email không hợp lệ</string>
    <string name="invalid_card_data_message">Thẻ tài khoản không hợp lệ</string>
    <string name="month_string">Tháng</string>
    <string name="january">Tháng 1</string>
    <string name="february">Tháng 2</string>
    <string name="march">Tháng 3</string>
    <string name="april">Tháng 4</string>
    <string name="may">Tháng 5</string>
    <string name="june">Tháng 6</string>
    <string name="july">Tháng 7</string>
    <string name="august">Tháng 8</string>
    <string name="september">Tháng 9</string>
    <string name="october">Tháng 10</string>
    <string name="november">Tháng 11</string>
    <string name="december">Tháng 12</string>
    <string name="create_attendee_success_message">Tạo lập người tham gia thành công!</string>
    <string name="create_attendee_fail_message">Không thể tạo lập người tham gia</string>
    <string name="fill_all_fields_message">Vui lòng nhập mọi ô thông tin</string>
    <string name="free">miễn phí</string>
    <string name="order_success_message">Đặt vé thành công</string>
    <string name="order_fail_message">Đặt vé không thành công!</string>
    <string name="payment_not_complete_message">Thanh toán chưa hoàn thành!</string>
    <string name="error_fetching_attendee_details_message">Không thể tải thông tin người tham dự</string>
    <string name="error_fetching_event_message">Không thể tải sự kiện</string>
    <string name="error_fetching_events_message">Không thể tải sự kiện</string>
    <string name="error">Lỗi</string>
    <string name="fetch_favorite_events_error_message">Không thể tải các sự kiện được yêu thích</string>
    <string name="list_orders_fail_message">Không thể tải vé của người dùng</string>
    <string name="list_events_fail_message">Không thể tải sự kiện của người dùng</string>
    <string name="error_adding_favorite_message">Lỗi thêm vào yêu thích</string>
    <string name="error_fetching_tickets_message">Không thể tải vé</string>
    <string name="select_image">Lựa chọn hình ảnh</string>
    <string name="changes_not_saved">Thay đổi của bạn chưa được lưu lại</string>
    <string name="discard">Hủy</string>
    <string name="save">Lưu</string>
    <string name="image_upload_success_message">Ảnh được tải lên thành công!</string>
    <string name="image_upload_error_message">Ảnh được tải lên thất bại!</string>
    <string name="provide_name_message">Xin hãy nhập tên của bạn!</string>
    <string name="user_update_error_message">Lỗi cập nhập thông tin người dùng</string>
    <string name="user_update_success_message">Cập nhập thông tin người dùng thành công!</string>
    <string name="failure">Thất Bại</string>
    <string name="sign_up_fail_email_exist_message">Không thể đăng ký: Email đã tồn tài!</string>
    <string name="sign_up_fail_email_invalid_message">Không thể đăng ký: Email không hợp lệ!</string>
    <string name="sign_up_fail_message">Không thể đăng ký!</string>
    <string name="login_automatically_fail_message">Không thể đăng nhập tự động</string>
    <string name="login_fail_message">Không thể đăng nhập. Xin hãy kiểm tra tài khoản</string>
    <string name="email_not_in_server_message">Email không có trong server. Xin hãy kiểm tra lại email</string>
    <string name="email_sent">Email đã được gửi</string>
    <string name="download_ticket">Lưu vé sự kiện</string>
    <string name="undo">Hoàn tác</string>
    <string name="removed_from_liked">Rời %1$s khỏi sự kiện yêu thích</string>

    <!--Notification Fragment-->
    <string name="no_notification_result">Bạn không có bất kỳ thông báo nào..</string>
    <string name="add_speaker">Thêm diễn giả</string>
    <string name="address">Địa Chỉ</string>
    <string name="all">Tất cả</string>
    <string name="and_i_m_up_for">Tôi hứng thú với</string>
    <string name="anything">Bất cứ điều gì</string>
    <string name="apply">Xác nhận</string>
    <string name="apply_discount_code">Xác nhận mã giảm giá</string>
    <string name="auth_subtitle">Đăng kí hoặc đăng nhập để tìm kiếm sự kiện</string>
    <string name="auth_title">Hãy bắt đầu</string>
    <string name="be_the_first_to_write_a_review">Bắt đầu viết đánh giá sự kiện</string>
    <string name="billing_address">Địa Chỉ Thanh Toán</string>
    <string name="bank_transfer">Chuyển điện báo/Chuyển khoản ngân hàng</string>
    <string name="billing_information">Thông Tin Thanh Toán</string>
    <string name="blog">Blog</string>
    <string name="call_for_speakers">Tìm Kiếm Diễn Giả</string>
    <string name="camera">Máy Ảnh</string>
    <string name="cancel_order">Hủy Đơn Vé</string>
    <string name="cancel_order_message">Xác nhận hủy đơn vé này?</string>
    <string name="category">Thể Loại</string>
    <string name="change">Thay Đổi</string>
    <string name="check_in_times">Thời gian check-in</string>
    <string name="checkbox_message">Thông tin người cầm vé giống với thông tin người đặt đơn vé</string>
    <string name="checked_in">Đã được check in</string>
    <string name="checked_out">Đã được check out</string>
    <string name="checkin_status">Thông tin Check In</string>
    <string name="choose_preferred_location_message">Lựa chọn địa điểm yêu thích của bạn</string>
    <string name="city">Thành Phố</string>
    <string name="cheque">Hóa Đơn Trên Giấy</string>
    <string name="already_registered_message">Đi tới vé của bạn</string>
    <string name="code_of_conduct">Quy Tắc Sự Kiện</string>
    <string name="company">Công Ty</string>
    <string name="completed_orders">Đơn vé Hoàn Thiện</string>
    <string name="confirm_new_password">Xác Nhận Mật Khẩu Mới</string>
    <string name="continue_string">Tiếp Tục</string>
    <string name="create_edit_speaker">"Tạo/Chỉnh Sửa "</string>
    <string name="write_feedback">Viết Phản Hồi</string>
    <string name="work_phone">Điện Thoại Nơi Làm</string>
    <string name="work_address">Địa Chỉ Nơi Làm</string>
    <string name="what_type">Điều Gì Hấp Dẫn?</string>
    <string name="website">Trang web</string>
    <string name="verified">Đã Xác Nhận</string>
    <string name="verification_error_message">Lỗi xác nhận email</string>
    <string name="used_eventyay_before">Đã sử dụng Eventyay trước đó?</string>
    <string name="update_speaker_fail_message">Lỗi cập nhập thông tin diễn giả</string>
    <string name="unread">Chưa Đọc</string>
    <string name="title_notifications">Thông Báo</string>
    <string name="title_change_password">Đổi Mật Khẩu</string>
    <string name="ticket_timeout_message">Bạn đã vượt quá thời gian giới hạn và đơn vé của bạn đã bị hủy. Mục đích của thời gian giới hạn là để đảm bảo thủ tục đăng kí vé được có hiệu lực với nhiều người nhất có thể. Xin lỗi vì sự bất tiện này.</string>
    <string name="ticket_timeout_info_message">Sau %1$s phút, đơn vé sẽ bị hủy.</string>
    <string name="ticket_details">Thông Tin Vé</string>
    <string name="tax_id">Mã Thuế hoặc Mã Doanh Nghiệp</string>
    <string name="tax_business_info">Thông tin Thuế</string>
    <string name="take_image">Chụp Ảnh</string>
    <string name="submit_proposal">Xác Nhận Đề Xuất Bài Nói</string>
    <string name="submit_feedback">Xác nhận phản hồi</string>
    <string name="submit">Xác Nhận</string>
    <string name="state">Tiểu Bang</string>
    <string name="sponsors">Nhà Tài Trợ</string>
    <string name="similar_events">Sự Kiện Tương Tự</string>
    <string name="skip">Bỏ qua</string>
    <string name="skip_for_now">Bỏ qua</string>
    <string name="social_links">Liên Kết Xã Hội</string>
    <string name="sort_by">Sắp Xếp Theo</string>
    <string name="sort_by_date">bắt đầu lúc</string>
    <string name="sort_by_name">Tên</string>
    <string name="speaker_details">Thông Tin Diễn Giả Của Tôi</string>
    <string name="speakers">Diễn Giả</string>
    <string name="speakers_call">Lời Mời Diễn Giả</string>
    <string name="sign_in_to_order_ticket">Xin hãy đăng nhập để đặt vé</string>
    <string name="sign_in_order_text">để đặt vé một cách nhanh chóng</string>
    <string name="sign_in">Đăng Nhập</string>
    <string name="short_bio">Tóm Tắt Thông Tin</string>
    <string name="shipping_address">Địa Chỉ Chuyển Hàng</string>
    <string name="share_ticket">Chia Sẻ Vé</string>
    <string name="sessions_and_speakers">Bài Nói Và Diễn Giả</string>
    <string name="sessions">Bài Nói</string>
    <string name="session_proposal_detail">Nội Dung Bài Nói</string>
    <string name="session">Bài Nói</string>
    <string name="see_your_ticket">Xem vé</string>
    <string name="see_all_feedback">Xem tất cả phản hồi</string>
    <string name="sales_end">Vé bán hết lúc:</string>
    <string name="replace_image">Đổi Ảnh</string>
    <string name="remove_image">Bỏ Ảnh</string>
    <string name="remember_like">Hãy rút gọn những sự kiện để không bỏ lỡ điều bạn yêu thích!</string>
    <string name="recent_locations">Địa Điểm Tra Cứu Gần Đây</string>
    <string name="rate_eventyay_dialog_message">Nếu bạn tận hưởng sử dụng Eventyay, hãy dành đôi chút thời gian để đánh giá app? Cảm ơn vì sự hỗ trợ của bạn!</string>
    <string name="rate_eventyay">Đánh Giá Eventyay</string>
    <string name="proposal_speaker">"Thông tin Diễn Giả "</string>
    <string name="profile_settings">Cài Đặt Cá Nhân</string>
    <string name="proposal">Đề Xuất Bài Nói</string>
    <string name="profile_photo">Hình Ảnh Cá Nhân</string>
    <string name="position">Vị Trí</string>
    <string name="popular_locations">Địa Điểm Nổi Tiếng</string>
    <string name="placed_orders">Đơn vé Đã Đặt</string>
    <string name="phone">Điện Thoại</string>
    <string name="permission_granted_message">Quyền truy cập %1$s được cấp!</string>
    <string name="permission_denied_message">Quyền truy cập %1$s bị từ chối:(</string>
    <string name="pending_orders">Đơn vé Đang Chờ</string>
    <string name="paypal_payment_not_available">Thanh toán bằng Paypal chưa được cập nhập trong ứng dựng!</string>
    <string name="payment">Thanh Toán</string>
    <string name="past_tickets">Vé Đã Sử Dụng</string>
    <string name="past">Đã Sử Dụng ></string>
    <string name="organization">Tổ Chức</string>
    <string name="order_status">Trạng Thái Đơn Vé</string>
    <string name="open_external_event_url">Mở Liên Kết Sự Kiện</string>
    <string name="on_site">Tại Địa Điểm</string>
    <string name="old_password">Mật Khẩu Cũ</string>
    <string name="not_verified">Tài khoản chưa được xác nhận. Nhấn để xác nhận</string>
    <string name="not_open">Chưa Mở</string>
    <string name="not_logged_in">Tài khoản chưa được đăng nhập</string>
    <string name="not_checked_in">Chưa được check in</string>
    <string name="not_available">Không có sẵn</string>
    <string name="no_tickets_available">Không còn vé!</string>
    <string name="no_thanks">Không, Cảm Ơn</string>
    <string name="no_speakers_call_message">Sự kiện này không có lời mời diễn giả!</string>
    <string name="no_speaker_profile_created_message">Bạn chưa tạo ra lập ra tài khoản diễn giả cho sự kiện</string>
    <string name="no_speaker_info">Bạn chưa có thông tin diễn giả của mình</string>
    <string name="no_past_tickets">Không có vé đã dùng.</string>
    <string name="no_feedback_message">Không có phản hồi cho sự kiện này</string>
    <string name="no_faq_message">Không có Các Câu Hỏi Thường Gặp cho sự kiện này</string>
    <string name="new_password">Mật Khẩu Mới</string>
    <string name="msg_failed_to_load_notification">Lỗi tải thông báo</string>
    <string name="maybe_later">Có lẽ lúc khác</string>
    <string name="loading_tickets">Đang tải vé...</string>
    <string name="loading_speaker_profile_message">Đang tải thông tin diễn giả của bạn</string>
    <string name="loading_message">Đang tải...</string>
    <string name="job_title">Chức Danh Công Việc</string>
    <string name="invalid_url_message">Đây không phải một liên kết URL hợp lệ</string>
    <string name="invalid_discount_code">Mã giảm giá không hợp lệ</string>
    <string name="invalid_card_number_message">Số thẻ không hợp lệ</string>
    <string name="home_address">Địa Chỉ Nhà</string>
    <string name="get_started">Bắt Đầu</string>
    <string name="gender">Giới Tính</string>
    <string name="frequently_asked_questions">Những Câu Hỏi Thường Gặp</string>
    <string name="free_stuff">Sự Kiễn Miễn Phí</string>
    <string name="filter_orders">Bộ Lọc Đơn Vé</string>
    <string name="filter">Bộ Lọc Tìm Kiếm</string>
    <string name="fill_required_fields_message">Hãy điền vào những mục được yêu cầu</string>
    <string name="feedback">Phản Hồi</string>
    <string name="feedback_submitted">Phản hồi được viết thành công</string>
    <string name="fail_sharing_ticket">Lỗi chia sẻ vé</string>
    <string name="external_storage">Bộ Nhớ Ngoài</string>
    <string name="error_submitting_feedback">Lỗi nhập phản hổi</string>
    <string name="error_fetching_speakers_for_session">Lỗi tải thông tin diễn giả cho bài nói này</string>
    <string name="error_fetching_feedback_message">Lỗi tải phản hồi cho sự kiện này</string>
    <string name="error_fetching_event_section_message">Lỗi tải %1$s cho sự kiện này</string>
    <string name="error_fetching_discount_code">Lỗi tải vé giảm giá cho sự kiện này</string>
    <string name="error_fetching_attendees">Lỗi tải thông tin người cẩm vé</string>
    <string name="error_editting_image_message">Xin lỗi, một lỗi vừa xuất hiện. Hình ảnh hiện tại không thể chỉnh sửa</string>
    <string name="error_cropping_image_message">Lỗi cắt hình ảnh đại diện</string>
    <string name="enter_location">Nhập Địa Điểm</string>
    <string name="enter_donation">Nhập số tiền</string>
    <string name="ended">Đã Kết Thúc</string>
    <string name="empty_password_message">Mật khẩu không thể để trống</string>
    <string name="empty_field_error_message">Mục này không thể để trống</string>
    <string name="empty_email_message">Địa chỉ email không thể để trống</string>
    <string name="empty_confirm_password_message">Xin hãy xác nhận mật khẩu của bạn</string>
    <string name="edit_speaker">Chỉnh Sửa Diễn Giả</string>
    <string name="edit_image">Chỉnh Sửa Hình Ảnh</string>
    <string name="download_invoice">Tải Hóa Đơn</string>
    <string name="donation">Quyên Góp</string>
    <string name="discount_code_applied">Mã giảm giá được xác nhận</string>
    <string name="details_of_the_user">Thông tin người dùng</string>
    <string name="creating_order_message">Đang tạo đơn vé...</string>
    <string name="create_speaker_profile_message">Bạn chưa tạo thông tin diễn giả cho sự kiện này</string>
    <string name="create_speaker_fail_message">Lỗi tạo thông tin tài khoản</string>
    <string name="create_speaker">Tạo Thông Tin Diễn Giả</string>
    <string name="create_proposal_message">Tạo bài nói cho sự kiện hoặc chỉnh sửa thông tin diễn giả</string>
    <string name="create_proposal">Tạo Bài Nói</string>
</resources>


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Channels;
using MediaBrowser.Model.Logging;
using MediaBrowser.Model.Serialization;

namespace MediaBrowser.Channels.iPlayer
{
    internal class MenuSystem
    {
        private String feedURL = "http://feeds.bbc.co.uk";
        private readonly IHttpClient _httpClient;
        private readonly ILogger _logger;
        private readonly IJsonSerializer _jsonSerializer;
        public MenuSystem(IHttpClient httpClient, IJsonSerializer jsonSerializer, ILogger logger)
        {
            _httpClient = httpClient;
            _logger = logger;
            _jsonSerializer = jsonSerializer;
        }

        public async Task<ChannelItemResult> GetMainMenu(CancellationToken cancellationToken)
        {
            var items = new List<ChannelItemInfo>
            {
                CreateMenu("Highlights", "video", feedURL + "/iplayer/highlights/tv"),
                CreateMenu("Most Popular", "video", feedURL + "/iplayer/popular/tv"),
                CreateMenu("TV Channels", "tvChannels", ""),
                CreateMenu("Categories", "categories", ""),
                CreateMenu("Formats", "formats", ""),
                CreateMenu("A-Z", "a-z", "")
            };

            return new ChannelItemResult
            {
                Items = items.ToList()
            };
        }

        public async Task<ChannelItemResult> GetTVChannels(CancellationToken cancellationToken)
        {
            var data = new Data();
            var channels = data.Channels;

            // Add more items here.
            var items = new List<ChannelItemInfo>();

            foreach (var c in channels)
            {
                items.Add(CreateMenu(c.title, "channel", c.id, c.thumb));
            }

            return new ChannelItemResult
            {
                Items = items.ToList()
            };
        }

        public async Task<ChannelItemResult> GetAToZ(CancellationToken cancellationToken)
        {
            var letters = new[]
            {
                "a", "b", "c", "d", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v",
                "w", "x", "y", "z"
            };
            // Add more items here.
            var items = new List<ChannelItemInfo>();

            foreach (var l in letters)
            {
                items.Add(CreateMenu(l.ToUpper(), "video", feedURL + "/iplayer/atoz/" + l + "/list/tv"));
            }

            return new ChannelItemResult
            {
                Items = items.ToList()
            };
        }

        public async Task<ChannelItemResult> GetCategories(String channelID, String thumb, CancellationToken cancellationToken)
        {
            var data = new Data();
            var categories = data.Categories;

            // Add more items here.
            var items = new List<ChannelItemInfo>();

            foreach (var c in categories)
            {
                items.Add(CreateMenu(c.title, "category", c.id + "_" + channelID, thumb));
            }

            return new ChannelItemResult
            {
                Items = items.ToList()
            };
        }

        public async Task<ChannelItemResult> GetCategory(String categoryID, String channelID, CancellationToken cancellationToken)
        {
            var items = new List<ChannelItemInfo>();
            var data = new Data();
            var categories = data.Categories;

            var category = categories.Find(i => i.id == categoryID);

            if (channelID != "")
            {
                // return videos
            }
            else
            {
                items.Add(CreateMenu(category.title + " Highlights", "video", category.highlights_url()));
                items.Add(CreateMenu(category.title + " Popular", "video", category.popular_url()));
                items.Add(CreateMenu("All programmes", "video", feedURL + "/iplayer/highlights/tv"));

                foreach (var subCat in category.subCategories)
                {
                    _logger.Debug("URL : " + category.subcategory_url(subCat.id));
                    items.Add(CreateMenu(subCat.title, "video", category.subcategory_url(subCat.id)));
                }
            }

            return new ChannelItemResult
            {
                Items = items.ToList()
            };
        }

        // Create Menu Entry
        private ChannelItemInfo CreateMenu(String title, String menu, String id, String thumb = "")
        {
            return new ChannelItemInfo
            {
                Name = title,
                Type = ChannelItemType.Folder,
                Id = menu + "_" + id,
                ImageUrl = thumb
            };
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
$projectDir = Join-Path (Split-Path $MyInvocation.MyCommand.Path -Parent) '..\TfsCmdlets' -Resolve
$modulePath = Join-Path $projectDir 'bin\Release\TfsCmdlets\TfsCmdlets.psd1'
$hasBuild = Test-Path $modulePath

if (-not $hasBuild) {
    throw "Module TfsCmdlets not found at $modulePath. Build project TfsCmdlets.Build prior to running tests."
}

Get-Module TfsCmdlets | Remove-Module
Import-Module $modulePath


text:
bool PluginInstallDialog::Initialize(PluginInstallerImpl* plugin_impl,
                                     const std::wstring& plugin_name) {
  if (!plugin_impl) {
    NOTREACHED();
    return false;
  }

  plugin_impl_ = plugin_impl;
  plugin_name_ = plugin_name;
  return true;
}

HWND PluginInstallDialog::Create(HWND parent_window, LPARAM init_param) {
  // Most of the code here is based on CDialogImpl<T>::Create.
  DCHECK(m_hWnd == NULL);

  // Allocate the thunk structure here, where we can fail
  // gracefully.
  BOOL thunk_inited = m_thunk.Init(NULL, NULL);
  if (thunk_inited == FALSE) {
    SetLastError(ERROR_OUTOFMEMORY);
    return NULL;
  }

  _AtlWinModule.AddCreateWndData(&m_thunk.cd, this);

#ifdef _DEBUG
  m_bModal = false;
#endif // _DEBUG

  HINSTANCE instance_handle = _AtlBaseModule.GetResourceInstance();

  HRSRC dialog_resource = FindResource(instance_handle,
                                       MAKEINTRESOURCE(IDD), RT_DIALOG);
  if (!dialog_resource) {
    NOTREACHED();
    return NULL;
  }

  HGLOBAL dialog_template = LoadResource(instance_handle,
                                         dialog_resource);
  if (!dialog_template) {
    NOTREACHED();
    return NULL;
  }

  _DialogSplitHelper::DLGTEMPLATEEX* dialog_template_struct =
      reinterpret_cast<_DialogSplitHelper::DLGTEMPLATEEX *>(
          ::LockResource(dialog_template));
  DCHECK(dialog_template_struct != NULL);

  unsigned long dialog_template_size =
      SizeofResource(instance_handle, dialog_resource);

  HGLOBAL rtl_layout_dialog_template = NULL;

  if (IsRTLLayout()) {
    rtl_layout_dialog_template = GlobalAlloc(GPTR, dialog_template_size);
    DCHECK(rtl_layout_dialog_template != NULL);

    _DialogSplitHelper::DLGTEMPLATEEX* rtl_layout_dialog_template_struct =
        reinterpret_cast<_DialogSplitHelper::DLGTEMPLATEEX*>(
            ::GlobalLock(rtl_layout_dialog_template));
    DCHECK(rtl_layout_dialog_template_struct != NULL);

    memcpy(rtl_layout_dialog_template_struct, dialog_template_struct,
           dialog_template_size);

    rtl_layout_dialog_template_struct->exStyle |=
        (WS_EX_LAYOUTRTL | WS_EX_RTLREADING);

    dialog_template_struct = rtl_layout_dialog_template_struct;
  }

  HWND dialog_window =
      CreateDialogIndirectParam(
          instance_handle,
          reinterpret_cast<DLGTEMPLATE*>(dialog_template_struct),
          parent_window, StartDialogProc, init_param);

  DCHECK(m_hWnd == dialog_window);

  if (rtl_layout_dialog_template) {
    GlobalUnlock(rtl_layout_dialog_template);
    GlobalFree(rtl_layout_dialog_template);
  }

  return dialog_window;
}

LRESULT PluginInstallDialog::OnInitDialog(UINT message, WPARAM wparam,
                                          LPARAM lparam, BOOL& handled) {
  std::wstring dialog_title =
      PluginInstallerImpl::ReplaceStringForPossibleEmptyReplacement(
          IDS_DEFAULT_PLUGIN_CONFIRMATION_DIALOG_TITLE,
          IDS_DEFAULT_PLUGIN_CONFIRMATION_DIALOG_TITLE_NO_PLUGIN_NAME,
          plugin_name_);
  AdjustTextDirectionality(&dialog_title);
  SetWindowText(dialog_title.c_str());

  std::wstring get_the_plugin_btn_msg =
      webkit_glue::GetLocalizedString(
          IDS_DEFAULT_PLUGIN_GET_THE_PLUGIN_BTN_MSG);
  AdjustTextDirectionality(&get_the_plugin_btn_msg);
  SetDlgItemText(IDB_GET_THE_PLUGIN, get_the_plugin_btn_msg.c_str());

  std::wstring cancel_plugin_download_msg =
      webkit_glue::GetLocalizedString(
          IDS_DEFAULT_PLUGIN_CANCEL_PLUGIN_DOWNLOAD_MSG);
  AdjustTextDirectionality(&cancel_plugin_download_msg);
  SetDlgItemText(IDCANCEL, cancel_plugin_download_msg.c_str());

  std::wstring plugin_user_action_msg =
      PluginInstallerImpl::ReplaceStringForPossibleEmptyReplacement(
          IDS_DEFAULT_PLUGIN_USER_OPTION_MSG,
          IDS_DEFAULT_PLUGIN_USER_OPTION_MSG_NO_PLUGIN_NAME,
          plugin_name_);
  AdjustTextDirectionality(&plugin_user_action_msg);
  SetDlgItemText(IDC_PLUGIN_INSTALL_CONFIRMATION_LABEL,
                 plugin_user_action_msg.c_str());
  return 0;
}

LRESULT PluginInstallDialog::OnGetPlugin(WORD notify_code, WORD id,
                                         HWND wnd_ctl, BOOL &handled) {
  if (!plugin_impl_) {
    NOTREACHED();
    return 0;
  }

  DestroyWindow();
  plugin_impl_->DownloadPlugin();
  return 0;
}

LRESULT PluginInstallDialog::OnCancel(WORD notify_code, WORD id, HWND wnd_ctl,
                                      BOOL &handled) {
  DestroyWindow();
  plugin_impl_->DownloadCancelled();
  return 0;
}

bool PluginInstallDialog::IsRTLLayout() const {
  return plugin_impl_ ? plugin_impl_->IsRTLLayout() : false;
}

// TODO(idana) bug# 1246452: use the library l10n_util once it is moved from
// the Chrome module into the Base module. For now, we simply copy/paste the
// same code.
void PluginInstallDialog::AdjustTextDirectionality(std::wstring* text) const {
  if (IsRTLLayout()) {
    // Inserting an RLE (Right-To-Left Embedding) mark as the first character.
    text->insert(0, L"\x202B");

    // Inserting a PDF (Pop Directional Formatting) mark as the last character.
    text->append(L"\x202C");
  }
}


text:
package edu.uofk.eeese.eeese.data.source;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;

import java.util.Collections;
import java.util.List;

import edu.uofk.eeese.eeese.data.Project;
import io.reactivex.Completable;
import io.reactivex.Single;

import static org.mockito.ArgumentMatchers.anyList;
import static org.mockito.Mockito.any;
import static org.mockito.Mockito.anyBoolean;
import static org.mockito.Mockito.anyInt;
import static org.mockito.Mockito.anyString;
import static org.mockito.Mockito.atMost;
import static org.mockito.Mockito.eq;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.reset;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

@SuppressWarnings("WrongConstant")
public class DataRepositoryTest {
    @Mock
    private BaseDataRepository local;

    @Mock
    private BaseDataRepository remote;

    private DataRepository source;
    private final Project project = new Project.Builder("ID", "name", "head", Project.POWER).build();

    @Before
    public void setupMocks() {
        MockitoAnnotations.initMocks(this);
        source = new DataRepository(local, remote);

        when(local.setProjects(anyList())).thenReturn(Completable.complete());
        when(local.setProjects(anyList(), anyInt())).thenReturn(Completable.complete());
    }

    @After
    public void resetMocks() {
        reset(local, remote);
    }

    @Test
    public void whenInsertProjectCalled_thenOnlyUseLocal() {
        when(local.insertProject(any(Project.class))).thenReturn(Completable.complete());
        source.insertProject(project)
                .test()
                .assertComplete();
        verify(local).insertProject(project);
        verifyZeroInteractions(remote);
    }

    @Test
    public void whenInsertProjectsCalled_thenOnlyUseLocal() {
        when(local.insertProjects(anyList())).thenReturn(Completable.complete());

        List<Project> projects = Collections.emptyList();
        source.insertProjects(projects)
                .test()
                .assertComplete();

        verify(local).insertProjects(projects);
        verifyNoMoreInteractions(local);
        verifyZeroInteractions(remote);
    }

    @Test
    public void whenClearProjectsCalled_thenOnlyUseLocal() {
        when(local.clearProjects()).thenReturn(Completable.complete());

        source.clearProjects()
                .test()
                .assertComplete();

        verify(local).clearProjects();
        verifyNoMoreInteractions(local);
        verifyZeroInteractions(remote);
    }

    @Test
    public void whenGetProjectsForced_thenOnlyUseRemote() {
        final List<Project> projects = Collections.emptyList();
        when(remote.getProjects(true)).thenReturn(Single.just(projects));

        source.getProjects(true)
                .test()
                .assertValue(returnedProjects -> returnedProjects == projects)
                .assertComplete();

        verify(remote).getProjects(true);
        verify(local, never()).getProjects(anyBoolean());
        verify(local, never()).getProjectsWithCategory(anyBoolean(), anyInt());
        verify(local, never()).getProject(anyString(), anyBoolean());
    }

    @Test
    public void givenLocalContainsData_whenGetProjectsNotForces_thenUseLocal() {
        List<Project> localProjects = Collections.singletonList(project);
        when(
                local.getProjects(anyBoolean())
        ).thenReturn(
                Single.just(localProjects)
        );
        when(
                remote.getProjects(anyBoolean())
        ).thenReturn(
                Single.error(new Exception("The remote repo is not expected to be used"))
        );

        source.getProjects(false)
                .test()
                .assertValue(returnedProjects ->
                        returnedProjects == localProjects)
                .assertComplete();

        verify(local).getProjects(eq(false));
        verifyNoMoreInteractions(local);
    }

    @Test
    public void givenLocalDoesNotContainData_WhenGetProjectsNotForces_thenUseRemoteAndSaveToLocal() {
        List<Project> remoteProjects = Collections.singletonList(project);
        when(local.getProjects(anyBoolean())).thenReturn(Single.just(Collections.emptyList()));
        when(remote.getProjects(anyBoolean())).thenReturn(Single.just(remoteProjects));

        source.getProjects(false)
                .test()
                .assertValue(returnedProjects -> returnedProjects == remoteProjects)
                .assertComplete();

        verify(local).getProjects(eq(false));
        verify(local).setProjects(eq(remoteProjects));
        verifyNoMoreInteractions(local);
        verify(remote).getProjects(anyBoolean());
        verifyNoMoreInteractions(remote);
    }

    @Test
    public void whenGetProjectsCalledMultipleTimes_thenUseCache() {
        final List<Project> localProjects = Collections.singletonList(project);
        final List<Project> remoteProjects = Collections.singletonList(project);

        when(remote.getProjects(anyBoolean())).thenReturn(Single.just(remoteProjects));
        when(local.getProjects(anyBoolean())).thenReturn(Single.just(localProjects));

        source.getProjects(false)
                .flatMap(projects -> source.getProjects(false))
                .test()
                .assertValue(projects -> projects.size() == 1)
                .assertValue(projects -> {
                    return projects.get(0).equals(project);
                })
                .assertComplete();

        verify(local, atMost(1)).getProjects(anyBoolean());
        verify(remote, atMost(1)).getProjects(anyBoolean());
    }

    @Test
    public void whenGetProjectsWithCategoryForced_thenOnlyUseRemote() {
        final List<Project> remoteProjects = Collections.singletonList(project);
        when(remote.getProjectsWithCategory(eq(true), eq(project.getCategory())))
                .thenReturn(Single.just(remoteProjects));

        source.getProjectsWithCategory(true, project.getCategory())
                .test()
                .assertValue(returnedProjects -> returnedProjects == remoteProjects)
                .assertComplete();

        verify(remote).getProjectsWithCategory(true, project.getCategory());
        verifyNoMoreInteractions(remote);
        verify(local, never()).getProjects(anyBoolean());
        verify(local, never()).getProjectsWithCategory(anyBoolean(), anyInt());
        verify(local, never()).getProject(anyString(), anyBoolean());
    }

    @Test
    public void givenLocalContainsData_whenGetProjectsWithCategoryNotForced_thenUseLocal() {
        final List<Project> localProjects = Collections.singletonList(project);
        when(
                local.getProjectsWithCategory(anyBoolean(), eq(project.getCategory()))
        ).thenReturn(Single.just(localProjects));
        when(
                remote.getProjectsWithCategory(anyBoolean(), anyInt())
        ).thenReturn(
                Single.error(new Exception("The remote repo is not expected to be used"))
        );

        source.getProjectsWithCategory(false, project.getCategory())
                .test()
                .assertValue(returnedProjects -> returnedProjects == localProjects)
                .assertComplete();

        verify(local).getProjectsWithCategory(anyBoolean(), eq(project.getCategory()));
    }

    @Test
    public void whenGetProjectsWithCategoryCalledMultipleTimes_thenUseCache() {
        final List<Project> localProjects = Collections.singletonList(project);
        final List<Project> remoteProjects = Collections.singletonList(project);

        when(
                remote.getProjectsWithCategory(anyBoolean(), eq(project.getCategory()))
        ).thenReturn(Single.just(remoteProjects));

        when(
                local.getProjectsWithCategory(anyBoolean(), eq(project.getCategory()))
        ).thenReturn(Single.just(localProjects));

        source.getProjectsWithCategory(false, project.getCategory())
                .flatMap(projects -> source.getProjectsWithCategory(false, project.getCategory()))
                .test()
                .assertValue(projects -> projects.size() == 1)
                .assertValue(projects -> {
                    return projects.get(0).equals(project);
                })
                .assertComplete();

        verify(local, atMost(1))
                .getProjectsWithCategory(anyBoolean(), eq(project.getCategory()));
        verify(remote, atMost(1))
                .getProjectsWithCategory(anyBoolean(), eq(project.getCategory()));
    }

}


text:
from __future__ import absolute_import, division, print_function
__metaclass__ = type

ANSIBLE_METADATA = {'metadata_version': '1.1',
                    'status': ['preview'],
                    'supported_by': 'community'}

DOCUMENTATION = '''
---
module: logstash_plugin
short_description: Manage Logstash plugins
description:
    - Manages Logstash plugins.
version_added: "2.3"
author: Loic Blot (@nerzhul)
options:
    name:
        description:
            - Install plugin with that name.
        required: True
    state:
        description:
            - Apply plugin state.
        required: False
        choices: ["present", "absent"]
        default: present
    plugin_bin:
        description:
            - Specify logstash-plugin to use for plugin management.
        required: False
        default: /usr/share/logstash/bin/logstash-plugin
    proxy_host:
        description:
            - Proxy host to use during plugin installation.
        required: False
        default: None
    proxy_port:
        description:
            - Proxy port to use during plugin installation.
        required: False
        default: None
    version:
        description:
            - Specify plugin Version of the plugin to install.
              If plugin exists with previous version, it will NOT be updated.
        required: False
        default: None
'''

EXAMPLES = '''
- name: Install Logstash beats input plugin
  logstash_plugin:
    state: present
    name: logstash-input-beats

- name: Install specific version of a plugin
  logstash_plugin:
    state: present
    name: logstash-input-syslog
    version: '3.2.0'

- name: Uninstall Logstash plugin
  logstash_plugin:
    state: absent
    name: logstash-filter-multiline
'''

from ansible.module_utils.basic import AnsibleModule

PACKAGE_STATE_MAP = dict(
    present="install",
    absent="remove"
)

def is_plugin_present(module, plugin_bin, plugin_name):
    cmd_args = [plugin_bin, "list", plugin_name]
    rc, out, err = module.run_command(" ".join(cmd_args))
    return rc == 0

def parse_error(string):
    reason = "reason: "
    try:
        return string[string.index(reason) + len(reason):].strip()
    except ValueError:
        return string

def install_plugin(module, plugin_bin, plugin_name, version, proxy_host, proxy_port):
    cmd_args = [plugin_bin, PACKAGE_STATE_MAP["present"], plugin_name]

    if version:
        cmd_args.append("--version %s" % version)

    if proxy_host and proxy_port:
        cmd_args.append("-DproxyHost=%s -DproxyPort=%s" % (proxy_host, proxy_port))

    cmd = " ".join(cmd_args)

    if module.check_mode:
        rc, out, err = 0, "check mode", ""
    else:
        rc, out, err = module.run_command(cmd)

    if rc != 0:
        reason = parse_error(out)
        module.fail_json(msg=reason)

    return True, cmd, out, err

def remove_plugin(module, plugin_bin, plugin_name):
    cmd_args = [plugin_bin, PACKAGE_STATE_MAP["absent"], plugin_name]

    cmd = " ".join(cmd_args)

    if module.check_mode:
        rc, out, err = 0, "check mode", ""
    else:
        rc, out, err = module.run_command(cmd)

    if rc != 0:
        reason = parse_error(out)
        module.fail_json(msg=reason)

    return True, cmd, out, err

def main():
    module = AnsibleModule(
        argument_spec=dict(
            name=dict(required=True),
            state=dict(default="present", choices=PACKAGE_STATE_MAP.keys()),
            plugin_bin=dict(default="/usr/share/logstash/bin/logstash-plugin", type="path"),
            proxy_host=dict(default=None),
            proxy_port=dict(default=None),
            version=dict(default=None)
        ),
        supports_check_mode=True
    )

    name = module.params["name"]
    state = module.params["state"]
    plugin_bin = module.params["plugin_bin"]
    proxy_host = module.params["proxy_host"]
    proxy_port = module.params["proxy_port"]
    version = module.params["version"]

    present = is_plugin_present(module, plugin_bin, name)

    # skip if the state is correct
    if (present and state == "present") or (state == "absent" and not present):
        module.exit_json(changed=False, name=name, state=state)

    if state == "present":
        changed, cmd, out, err = install_plugin(module, plugin_bin, name, version, proxy_host, proxy_port)
    elif state == "absent":
        changed, cmd, out, err = remove_plugin(module, plugin_bin, name)

    module.exit_json(changed=changed, cmd=cmd, name=name, state=state, stdout=out, stderr=err)

if __name__ == '__main__':
    main()


text:
const exports = {};
import dart from "./dart/_runtime";
import core from "./dart/core";
let dartx = dart.dartx;
const Callback = dart.typedef('Callback', () => dart.functionType(dart.void, [], {i: core.int}));
class A extends core.Object {}
class _A extends core.Object {}
const B$ = dart.generic(function(T) {
  class B extends core.Object {}
  return B;
});
let B = B$();
const _B$ = dart.generic(function(T) {
  class _B extends core.Object {}
  return _B;
});
let _B = _B$();
function f() {
}
dart.fn(f);
function _f() {
}
dart.fn(_f);
const constant = "abc";
exports.finalConstant = "abc";
dart.defineLazyProperties(exports, {
  get lazy() {
    return dart.as(dart.fn(() => {
      core.print('lazy');
      return "abc";
    })(), core.String);
  }
});
exports.mutable = "abc";
dart.defineLazyProperties(exports, {
  get lazyMutable() {
    return dart.as(dart.fn(() => {
      core.print('lazyMutable');
      return "abc";
    })(), core.String);
  },
  set lazyMutable(_) {}
});
// Exports:
exports.Callback = Callback;
exports.A = A;
exports.B$ = B$;
exports.B = B;
exports.f = f;
exports.constant = constant;
export default exports;


text:
import logging
import json
import subprocess
import os
import shutil

# Set up logging
logging.basicConfig()
logger = logging.getLogger()
logger.setLevel(logging.INFO)

# Only in tmp you can run executables for lambda
BIN_DIR = '/tmp/bin'
ENV_DEBUG = 'DEBUG'
ENV_GO_EXE = 'GO_EXE'

GO_EXE = os.path.join(BIN_DIR, os.getenv(ENV_GO_EXE))

# Make sure we have go executable ready to use
# This will be only run once. Subsequent calls
# will go through handler directly
if not os.path.exists(BIN_DIR):
    os.makedirs(BIN_DIR)

shutil.copy2(os.getenv('GO_EXE'), GO_EXE)
os.chmod(GO_EXE, 0775)

def dump(obj):
    """Dumping context"""
    if hasattr(obj, '__slots__'):
        return {slot: getattr(obj, slot) for slot in obj.__slots__}
    return obj.__dict__

def handler(event, context):
    error_msg = {'error': True}

    # debug mode
    debug = False
    if os.getenv(ENV_DEBUG, 'False').lower() == 'true':
        debug = True

    if debug:
        logger.info(event)

    if not os.getenv(ENV_GO_EXE):
        logger.error('No handler executable found from the environment variable {}'.format(ENV_GO_EXE))
        return error_msg

    # Run go executable
    cmd = [GO_EXE, json.dumps(event), json.dumps(context, default=dump)]
    output, error = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()

    if error:
        logger.error(error)
        return error_msg

    try:
        json_obj = json.loads(output)

        if debug:
            logger.info(json_obj)

        return json_obj
    except ValueError:
        if debug:
            logger.info(output)

        return output


text:
using namespace std;

int main(int nargs, char** argv) {
    return 0;
}


text:
'use strict';

var Address      = require('address-rfc2821');
var fixtures     = require('haraka-test-fixtures');

var Connection   = fixtures.connection;

var Body         = require('../../mailbody').Body;
var Header       = require('../../mailheader').Header;

var _set_up = function (done) {

    this.plugin = new fixtures.plugin('bounce');
    this.plugin.cfg = {
        main: { },
        check: {
            reject_all: false,
            single_recipient: true,
            empty_return_path: true,
            bad_rcpt: true,
            non_local_msgid: true,
        },
        reject: {
            single_recipient:true,
            empty_return_path:true,
            non_local_msgid:true,
        },
        invalid_addrs: { 'test@bad1.com': true, 'test@bad2.com': true },
    };

    this.connection = Connection.createConnection();
    this.connection.remote.ip = '8.8.8.8';
    this.connection.transaction = {
        header: new Header(),
        results: new fixtures.results(this.plugin),
    };

    done();
};

exports.load_configs = {
    setUp : _set_up,
    'load_bounce_ini': function (test) {
        test.expect(3);
        this.plugin.load_bounce_ini();
        test.ok(this.plugin.cfg.main);
        test.ok(this.plugin.cfg.check);
        test.ok(this.plugin.cfg.reject);
        test.done();
    },
    'load_bounce_bad_rcpt': function (test) {
        test.expect(3);
        this.plugin.load_bounce_bad_rcpt();
        test.ok(this.plugin.cfg.main);
        test.ok(this.plugin.cfg.check);
        test.ok(this.plugin.cfg.reject);
        test.done();
    },
};

exports.reject_all = {
    setUp : _set_up,
    'disabled': function (test) {
        test.expect(1);
        this.connection.transaction.mail_from= new Address.Address('<matt@example.com>');
        this.connection.transaction.rcpt_to= [ new Address.Address('test@any.com') ];
        var cb = function () {
            test.equal(undefined, arguments[0]);
        };
        this.plugin.cfg.check.reject_all=false;
        this.plugin.reject_all(cb, this.connection, new Address.Address('<matt@example.com>'));
        test.done();
    },
    'not bounce ok': function (test) {
        test.expect(1);
        this.connection.transaction.mail_from= new Address.Address('<matt@example.com>');
        this.connection.transaction.rcpt_to= [ new Address.Address('test@any.com') ];
        var cb = function () {
            test.equal(undefined, arguments[0]);
        };
        this.plugin.cfg.check.reject_all=true;
        this.plugin.reject_all(cb, this.connection, new Address.Address('<matt@example.com>'));
        test.done();
    },
    'bounce rejected': function (test) {
        test.expect(1);
        this.connection.transaction.mail_from= new Address.Address('<>');
        this.connection.transaction.rcpt_to= [ new Address.Address('test@any.com') ];
        var cb = function () {
            test.equal(DENY, arguments[0]);
        };
        this.plugin.cfg.check.reject_all=true;
        this.plugin.reject_all(cb, this.connection, new Address.Address('<>'));
        test.done();
    },
};

exports.empty_return_path = {
    setUp : _set_up,
    'none': function (test) {
        test.expect(1);
        this.connection.transaction.mail_from= new Address.Address('<>');
        this.connection.transaction.rcpt_to= [ new Address.Address('test@good.com') ];
        var cb = function () {
            test.equal(undefined, arguments[0]);
        };
        this.plugin.empty_return_path(cb, this.connection);
        test.done();
    },
    'has': function (test) {
        test.expect(1);
        this.connection.transaction.mail_from= new Address.Address('<>');
        this.connection.transaction.rcpt_to= [ new Address.Address('test@good.com') ];
        this.connection.transaction.header.add('Return-Path', "Content doesn't matter");
        var cb = function () {
            test.equal(DENY, arguments[0]);
        };
        this.plugin.empty_return_path(cb, this.connection);
        test.done();
    },
};

exports.non_local_msgid = {
    setUp: _set_up,
    'no_msgid_in_headers': function (test) {
        test.expect(1);
        this.connection.transaction.mail_from= new Address.Address('<>');
        this.connection.transaction.rcpt_to= [ new Address.Address('test@good.com') ];
        this.connection.transaction.body = new Body();
        this.connection.transaction.body.bodytext = '';
        var cb = function () {
            test.equal(DENY, arguments[0]);
        }
        this.plugin.non_local_msgid(cb, this.connection);
        test.done();
    },
    'no_domains_in_msgid': function (test) {
        test.expect(1);
        this.connection.transaction.mail_from= new Address.Address('<>');
        this.connection.transaction.rcpt_to= [ new Address.Address('test@good.com') ];
        this.connection.transaction.body = new Body();
        this.connection.transaction.body.bodytext = 'Message-ID:<blah>';
        var cb = function () {
            test.equal(DENY, arguments[0]);
        }
        this.plugin.non_local_msgid(cb, this.connection);
        test.done();
    },
    'invalid_domain': function (test) {
        test.expect(2);
        this.connection.transaction.mail_from= new Address.Address('<>');
        this.connection.transaction.rcpt_to= [ new Address.Address('test@good.com') ];
        this.connection.transaction.body = new Body();
        this.connection.transaction.body.bodytext = 'Message-ID: <blah@foo.cooooooom>';
        var cb = function () {
            test.equal(DENY, arguments[0]);
            test.ok(/without valid domain/.test(arguments[1]));
        }
        this.plugin.non_local_msgid(cb, this.connection);
        test.done();
    },
    /* - commented out because the code looks bogus to me - see comment in plugins/bounce.js - @baudehlo
    'non-local': function (test) {
        test.expect(2);
        this.connection.transaction.mail_from= new Address.Address('<>');
        this.connection.transaction.rcpt_to= [ new Address.Address('test@good.com') ];
        this.connection.transaction.body = new Body();
        this.connection.transaction.body.bodytext = 'Message-ID: <blah@foo.com>';
        var cb = function () {
            test.equal(DENY, arguments[0]);
            test.ok(/non-local Message-ID/.test(arguments[1]));
        }
        this.plugin.non_local_msgid(cb, this.connection);
        test.done();
    },
    */
}

exports.single_recipient = {
    setUp : _set_up,
    'valid': function (test) {
        test.expect(1);
        this.connection.transaction.mail_from= new Address.Address('<>');
        this.connection.transaction.rcpt_to= [ new Address.Address('test@good.com') ];
        var cb = function () {
            test.equal(undefined, arguments[0]);
        };
        this.plugin.single_recipient(cb, this.connection);
        test.done();
    },
    'invalid': function (test) {
        test.expect(1);
        this.connection.transaction.mail_from= new Address.Address('<>');
        this.connection.transaction.rcpt_to= [
            new Address.Address('test@good.com'),
            new Address.Address('test2@good.com')
        ];
        var cb = function () {
            console.log(arguments[0]);
            test.equal(DENY, arguments[0]);
        };
        this.plugin.single_recipient(cb, this.connection);
        test.done();
    },
    'test@example.com': function (test) {
        test.expect(1);
        this.connection.transaction.mail_from= new Address.Address('<>');
        this.connection.transaction.rcpt_to= [ new Address.Address('test@example.com') ];
        var cb = function () {
            test.equal(undefined, arguments[0]);
        };
        this.plugin.single_recipient(cb, this.connection);
        test.done();
    },
    'test@example.com,test2@example.com': function (test) {
        test.expect(1);
        this.connection.transaction.mail_from= new Address.Address('<>');
        this.connection.transaction.rcpt_to= [
            new Address.Address('test1@example.com'),
            new Address.Address('test2@example.com'),
        ];
        var cb = function () {
            test.equal(DENY, arguments[0]);
        };
        this.plugin.single_recipient(cb, this.connection);
        test.done();
    },
};

exports.bad_rcpt = {
    setUp : _set_up,
    'test@good.com': function (test) {
        test.expect(1);
        this.connection.transaction.mail_from= new Address.Address('<>');
        this.connection.transaction.rcpt_to= [ new Address.Address('test@good.com') ];
        var cb = function (rc) {
            test.equal(undefined, rc);
        };
        this.plugin.bad_rcpt(cb, this.connection);
        test.done();
    },
    'test@bad1.com': function (test) {
        test.expect(1);
        this.connection.transaction.mail_from= new Address.Address('<>');
        this.connection.transaction.rcpt_to= [ new Address.Address('test@bad1.com') ];
        var cb = function (rc) {
            test.equal(DENY, rc);
        };
        this.plugin.cfg.invalid_addrs = {'test@bad1.com': true, 'test@bad2.com': true };
        this.plugin.bad_rcpt(cb, this.connection);
        test.done();
    },
    'test@bad1.com, test@bad2.com': function (test) {
        test.expect(1);
        this.connection.transaction.mail_from= new Address.Address('<>');
        this.connection.transaction.rcpt_to= [
            new Address.Address('test@bad1.com'),
            new Address.Address('test@bad2.com')
        ];
        var cb = function (rc) {
            test.equal(DENY, rc);
        };
        this.plugin.cfg.invalid_addrs = {'test@bad1.com': true, 'test@bad2.com': true };
        this.plugin.bad_rcpt(cb, this.connection);
        test.done();
    },
    'test@good.com, test@bad2.com': function (test) {
        test.expect(1);
        this.connection.transaction.mail_from= new Address.Address('<>');
        this.connection.transaction.rcpt_to= [
            new Address.Address('test@good.com'),
            new Address.Address('test@bad2.com')
        ];
        var cb = function (rc) {
            test.equal(DENY, rc);
        };
        this.plugin.cfg.invalid_addrs = {'test@bad1.com': true, 'test@bad2.com': true };
        this.plugin.bad_rcpt(cb, this.connection);
        test.done();
    },
};

exports.has_null_sender = {
    setUp : _set_up,
    '<>': function (test) {
        test.expect(1);
        this.connection.transaction.mail_from= new Address.Address('<>');
        test.equal(true, this.plugin.has_null_sender(this.connection));
        test.done();
    },
    ' ': function (test) {
        test.expect(1);
        this.connection.transaction.mail_from= new Address.Address('');
        test.equal(true, this.plugin.has_null_sender(this.connection));
        test.done();
    },
    'user@example': function (test) {
        test.expect(1);
        this.connection.transaction.mail_from= new Address.Address('user@example');
        test.equal(false, this.plugin.has_null_sender(this.connection));
        test.done();
    },
    'user@example.com': function (test) {
        test.expect(1);
        this.connection.transaction.mail_from= new Address.Address('user@example.com');
        test.equal(false, this.plugin.has_null_sender(this.connection));
        test.done();
    },
};


text:
import { Component, ViewEncapsulation } from '@angular/core';
import { ActivatedRoute, Params } from '@angular/router'
import { BaThemeConfigProvider } from '../../../../theme';

import { LossTypeService } from '../../../../services/lossType.service';
import { ChartService } from '../../chart.service';

@Component({
  selector: 'breakdown-chart',
  encapsulation: ViewEncapsulation.None,
  styleUrls: ['./breakdownChart.scss'],
  templateUrl: './breakdownChart.html',
})
export class BreakdownChart {

  layoutColors = this.baConfig.get().colors;
  graphColor = this.baConfig.get().colors.custom.dashboardBreakdownChart;

  section = '0';
  startDate = '';
  endDate = '';
  categoryTitle = 'Category';
  selectedDay: any;

  amChart: any;
  amMttrChart: any;
  amMdtChart: any;
  dataProvider = [];

  chartData: Object = {
    'type': 'serial',
    'addClassNames': true,
    'theme': 'blur',
    'depth3D': 20,
    'angle': 30,
    'balloon': {
      'adjustBorderColor': false,
      'horizontalPadding': 10,
      'verticalPadding': 8,
      'color': '#ffffff'
    },

    'dataProvider': this.dataProvider,
    'valueAxes': [{
      'axisAlpha': 0,
      'position': 'left'
    }],
    'startDuration': 1,
    'graphs': [{
      'alphaField': 'alpha',
      'balloonText': '[[title]] in [[category]]:
[[mtbf]] [[additional]]',
      'fillAlphas': 1,
      'title': 'mtbf',
      'type': 'column',
      'valueField': 'mtbf',
      'labelText': '[[mtbf]]'
    }, {
      'id': 'graph2',
      'balloonText': '[[title]] in [[category]]:
[[value]] [[additional]]',
      'bullet': 'round',
      'lineThickness': 3,
      'bulletSize': 7,
      'bulletBorderAlpha': 1,
      'bulletColor': '#FFFFFF',
      'useLineColorForBulletBorder': true,
      'bulletBorderThickness': 3,
      'fillAlphas': 0,
      'lineAlpha': 1,
      'title': 'mtbfTarget',
      'valueField': 'mtbfTarget',
      'dashLengthField': 'dashLengthLine',
      'labelText': '[[mtbfTarget]]',
      'labelPosition': 'top'
    }],
    'categoryField': 'section',
    'categoryAxis': {
      'gridPosition': 'start',
      'axisAlpha': 0,
      'tickLength': 0
    },
    'export': {
      'enabled': true
    }
  };
  mttrChartData: Object = {
    'type': 'serial',
    'addClassNames': true,
    'theme': 'blur',
    'depth3D': 20,
    'angle': 30,
    'balloon': {
      'adjustBorderColor': false,
      'horizontalPadding': 10,
      'verticalPadding': 8,
      'color': '#ffffff'
    },

    'dataProvider': this.dataProvider,
    'valueAxes': [{
      'axisAlpha': 0,
      'position': 'left'
    }],
    'startDuration': 1,
    'graphs': [{
      'alphaField': 'alpha',
      'balloonText': '[[title]] in [[category]]:
[[mttr]] [[additional]]',
      'fillAlphas': 1,
      'title': 'mttr',
      'type': 'column',
      'valueField': 'mttr',
      'labelText': '[[mttr]]'
    }, {
      'id': 'graph2',
      'balloonText': '[[title]] in [[category]]:
[[value]] [[additional]]',
      'bullet': 'round',
      'lineThickness': 3,
      'bulletSize': 7,
      'bulletBorderAlpha': 1,
      'bulletColor': '#FFFFFF',
      'useLineColorForBulletBorder': true,
      'bulletBorderThickness': 3,
      'fillAlphas': 0,
      'lineAlpha': 1,
      'title': 'mttrTarget',
      'valueField': 'mttrTarget',
      'dashLengthField': 'dashLengthLine',
      'labelText': '[[mttrTarget]]',
      'labelPosition': 'top'
    }],
    'categoryField': 'section',
    'categoryAxis': {
      'gridPosition': 'start',
      'axisAlpha': 0,
      'tickLength': 0
    },
    'export': {
      'enabled': true
    }
  };

  mdtChartData: Object = {
    'type': 'serial',
    'addClassNames': true,
    'theme': 'blur',
    'depth3D': 20,
    'angle': 30,
    'balloon': {
      'adjustBorderColor': false,
      'horizontalPadding': 10,
      'verticalPadding': 8,
      'color': '#ffffff'
    },

    'dataProvider': this.dataProvider,
    'valueAxes': [{
      'axisAlpha': 0,
      'position': 'left'
    }],
    'startDuration': 1,
    'graphs': [{
      'alphaField': 'alpha',
      'balloonText': '[[title]] in [[category]]:
[[mdt]] [[additional]]',
      'fillAlphas': 1,
      'title': 'mdt',
      'type': 'column',
      'valueField': 'mdt',
      'labelText': '[[mdt]]'
    }, {
      'id': 'graph2',
      'balloonText': '[[title]] in [[category]]:
[[value]] [[additional]]',
      'bullet': 'round',
      'lineThickness': 3,
      'bulletSize': 7,
      'bulletBorderAlpha': 1,
      'bulletColor': '#FFFFFF',
      'useLineColorForBulletBorder': true,
      'bulletBorderThickness': 3,
      'fillAlphas': 0,
      'lineAlpha': 1,
      'title': 'mdtTarget',
      'valueField': 'mdtTarget',
      'dashLengthField': 'dashLengthLine',
      'labelText': '[[mdtTarget]]',
      'labelPosition': 'top'
    }],
    'categoryField': 'section',
    'categoryAxis': {
      'gridPosition': 'start',
      'axisAlpha': 0,
      'tickLength': 0
    },
    'export': {
      'enabled': true
    }
  };

  constructor(private baConfig: BaThemeConfigProvider, private route: ActivatedRoute, private chartService: ChartService) {
  }

  fillCharts(): void {

    if (this.section == '0') {

      this.categoryTitle = 'Section';

      this.chartService.getBreakdown(this.startDate, this.endDate).subscribe((data) => {
        this.setData(data);
      });

    } else {
      this.categoryTitle = 'Date';
      this.chartService.getBreakdownBySection(this.startDate, this.endDate, this.section).subscribe((data) => {
        this.setData(data);
      });
    }
  }

  ngOnInit(): void {
    this.route.params.subscribe(
      (params: Params) => {
        this.startDate = params['startDate'];
        this.endDate = params['endDate'];
        this.section = params['section'];
        this.fillCharts();
      }
    );
  }

  setData(data: any): void {
    this.dataProvider = data;

    this.amChart.dataProvider = data;
    this.amChart.validateData();

    this.amMttrChart.dataProvider = data;
    this.amMttrChart.validateData();

    this.amMdtChart.dataProvider = data;
    this.amMdtChart.validateData();
  }

  initChart(chart: any) {
    this.amChart = chart;
  }
  initMttrChart(chart: any) {
    this.amMttrChart = chart;
  }
  initMdtChart(chart: any) {
    this.amMdtChart = chart;
  }

}


text:
using System;
using System.IO;
using System.Threading.Tasks;
using DineroPortableClientSDK.Mailouts;
using DineroPortableClientSDK.ResponseModels;

namespace DineroPortableClientSDK.Sales.CreditNotes
{
    public sealed class DineroSalesCreditNotes : DineroLibaryBase
    {
        internal DineroSalesCreditNotes(Dinero dinero) : base(dinero)
        {
            BaseEndpoint = "sales/creditnotes";
        }

        /// <summary>
        /// Add the credit note to the organization's credit notes.
        /// </summary>
        /// <param name="modelToCreate">The credit note to create</param>
        public Task<CreatedResponse> AddAsync(SalesCreditNoteCreate modelToCreate)
        {
            if (modelToCreate == null) throw new ArgumentNullException("modelToCreate");
            return PostAsync<CreatedResponse>(modelToCreate);
        }

        /// <summary>
        /// Add the credit note to the organization's credit notes.
        /// </summary>
        /// <param name="modelToCreate">The credit note to create</param>
        public CreatedResponse Add(SalesCreditNoteCreate modelToCreate)
        {
            return TaskHelper.ExecuteSync(() => AddAsync(modelToCreate));
        }

        /// <summary>
        /// Delete credit note.
        /// </summary>
        /// <param name="guid">The credit note guid</param>
        /// <param name="timestamp">optional timestamp to verify version before deletion</param>
        public Task DeleteAsync(Guid guid, string timestamp = null)
        {
            return DeleteWithGuid<EmptyDineroResult>(guid, timestamp);
        }

        /// <summary>
        /// Delete credit note.
        /// </summary>
        /// <param name="guid">The credit note guid</param>
        /// <param name="timestamp">optional timestamp to verify version before deletion</param>
        public void Delete(Guid guid, string timestamp = null)
        {
            TaskHelper.ExecuteSync(() => DeleteAsync(guid, timestamp));
        }

        /// <summary>
        /// Book the organization's credit note with the given guid.
        /// </summary>
        /// <param name="timestamp">Timestamp to prevent concurrency problems</param>
        /// <param name="guid">The credit note guid</param>
        public Task<UpdatedResponse> BookAsync(Guid guid, string timestamp)
        {
            if (string.IsNullOrWhiteSpace(timestamp)) throw new ArgumentNullException("timestamp");

            return PostWithTimestamp<UpdatedResponse>(guid, timestamp, "book");
        }

        /// <summary>
        /// Posts an credit note and return it simplified read model (CreditNoteFetch), where Dinero has filled out line sums, total, payment and contact details.
        /// The credit note will not be saved. This is intended to facilitate a user friendly editing mode.
        /// </summary>
        /// <param name="createModel">the credit note</param>
        public SalesCreditNoteFetch Fetch(SalesCreditNoteCreate createModel)
        {
            return TaskHelper.ExecuteSync(() => FetchAsync(createModel));
        }

        /// <summary>
        /// Posts an credit note and return it simplified read model (CreditNoteFetch), where Dinero has filled out line sums, total, payment and contact details.
        /// The credit note will not be saved. This is intended to facilitate a user friendly editing mode.
        /// </summary>
        /// <param name="createModel">the credit note</param>
        public Task<SalesCreditNoteFetch> FetchAsync(SalesCreditNoteCreate createModel)
        {
            if (createModel == null) throw new ArgumentNullException("createModel");
            return PostAsync<SalesCreditNoteFetch>(createModel, "fetch");
        }

        /// <summary>
        /// Book the organization's credit note with the given guid.
        /// </summary>
        /// <param name="timestamp">Timestamp to prevent concurrency problems</param>
        /// <param name="guid">The credit note guid</param>
        public UpdatedResponse Book(Guid guid, string timestamp)
        {
            return TaskHelper.ExecuteSync(() => BookAsync(guid, timestamp));
        }

        /// <summary>
        /// Gets the organization's credit note with the given guid.
        /// </summary>
        /// <param name="guid">The credit note guid</param>
        public Task<SalesCreditNote> GetAsync(Guid guid)
        {
            return GetWithGuid<SalesCreditNote>(guid);
        }

        /// <summary>
        /// Gets the organization's credit note with the given guid.
        /// </summary>
        /// <param name="guid">The credit note guid</param>
        public SalesCreditNote Get(Guid guid)
        {
            return TaskHelper.ExecuteSync(() => GetAsync(guid));
        }

        /// <summary>
        /// Get a stream of the credit note pdf. This endpoint is not available for API partners yet.
        /// </summary>
        /// <param name="guid">Guid of the credit note</param>
        /// <returns></returns>
        public Task<Stream> DownloadPdfAsync(Guid guid)
        {
            return GetStream(guid, "pdf");
        }

        /// <summary>
        /// Get a stream of the credit note pdf. This endpoint is not available for API partners yet.
        /// </summary>
        /// <param name="guid">Guid of the credit note</param>
        /// <returns></returns>
        public Stream DownloadPdf(Guid guid)
        {
            //throw new DineroException("This endpoint is not available for API partners yet.");

            return TaskHelper.ExecuteSync(() => DownloadPdfAsync(guid));
        }

        /// <summary>
        /// Send an email with a link to the credit note
        /// </summary>
        /// <param name="guid">Guid of the credit note</param>
        /// <param name="mailoutModel">Model with data to send email of the credit note</param>
        /// <returns></returns>
        public Task SendEmailAsync(Guid guid, MailOut mailoutModel = null)
        {
            return PostAsyncWithGuid<EmptyDineroResult>(guid, mailoutModel, "email");
        }

        /// <summary>
        /// Send an email with a link to the credit note
        /// </summary>
        /// <param name="guid"></param>
        /// <param name="mailoutModel">Model with data to send email of the credit note</param>
        /// <returns></returns>
        public void SendEmail(Guid guid, MailOut mailoutModel = null)
        {
            TaskHelper.ExecuteSync(() => SendEmailAsync(guid, mailoutModel));
        }

        /// <summary>
        /// Send e-credit note
        /// </summary>
        /// <param name="guid">credit note guid</param>
        /// <param name="timestamp">credit note timestamp of latest version</param>
        /// <returns></returns>
        public Task SendECreditNoteAsync(Guid guid, string timestamp = null)
        {
            return PostWithTimestamp<EmptyDineroResult>(guid, timestamp, "e-creditnote");
        }

        /// <summary>
        /// Send e-credit note
        /// </summary>
        /// <param name="guid">credit note guid</param>
        /// <param name="timestamp">credit note timestamp of latest version</param>
        /// <returns></returns>
        public void SendECreditNote(Guid guid, string timestamp = null)
        {
            TaskHelper.ExecuteSync(() => SendECreditNoteAsync(guid, timestamp));
        }

        /// <summary>
        /// Update the organization's credit note.
        /// </summary>
        /// <param name="guid">The guid of the credit note to update</param>
        /// <param name="updatedModel">The updated credit note</param>
        public Task<UpdatedResponse> UpdateAsync(Guid guid, SalesCreditNoteUpdate updatedModel)
        {
            if (updatedModel == null) throw new ArgumentNullException(nameof(updatedModel));
            return PutAsyncWithGuid<UpdatedResponse>(guid, updatedModel, version: "1.2");
        }

        /// <summary>
        /// Update the organization's credit note.
        /// </summary>
        /// <param name="guid">The guid of the credit note to update</param>
        /// <param name="updatedModel">The updated credit note</param>
        public UpdatedResponse Update(Guid guid, SalesCreditNoteUpdate updatedModel)
        {
            return TaskHelper.ExecuteSync(() => UpdateAsync(guid, updatedModel));
        }

        /// <summary>
        /// Retrieve a list of credit notes for the organization.
        /// </summary>
        /// <param name="page">The 0-based page number</param>
        /// <param name="pageSize">The maximum number of items to include in a page. Maximum 1000.</param>
        /// <param name="fields">A comma separated list of fields to include in the response.
        /// Possible values are:
        /// Number, Guid, ContactName, Date, PaymentDate, Description, Currency, Status, MailOutStatus,
        /// TotalExclVatInDkk, TotalInclVatInDkk, TotalExclVat, TotalInclVat, CreatedAt, UpdatedAt and DeletedAt.
        /// If null, defaults to Guid,ContactName,Date,Description.
        /// Notice that it's not case sensitive, the property name will be returned the way you request it.
        /// </param>
        /// <param name="deletedOnly">[Generic Filter Option] Only select deleted credit notes. If left empty, will defaults to false.</param>
        /// <param name="freeTextSearch">A free text search performed on Number, ContactName, Description and TotalInclTax</param>
        /// <param name="statusFilter">Filter on Status. You can choose Draft, Booked, Paid, OverPaid or Overdue. You can only filter on one status. If left empty no filter is applied.</param>
        /// <param name="changesSince">[Generic Filter Option] Only return credit notes that was created, deleted or updated at or after given time.
        /// If left empty, this filter will not be applied, and credit notes will be returned regardless of change history.
        /// The time must be UTC and in the format 'YYYY-MM-DDTHH:mm:ssZ' example: '2015-08-18T06:36:22Z'. </param>
        /// <param name="startDate">Start date. If you define a start date, you also need to define an end date.</param>
        /// <param name="endDate">End date. If you define an end date, you also need to define a start date.</param>
        /// <param name="sort">A comma separated list of fields to sort on. Possible values are: VoucherNumber, VoucherDate and Status.</param>
        /// <param name="sortOrder">Sort order. Valid values are ascending and descending. Field Status is always sorted in the order Draft, Overdue, Booked, OverPaid and Paid.</param>
        /// <returns>200 (OK) Returns a collection of credit notes (with only the requested fields).</returns>
        public Task<SalesVoucherCollection> GetListAsync(DateTime? startDate = null, DateTime? endDate = null, string fields = null,
                 string freeTextSearch = null, string statusFilter = null, DateTime? changesSince = null, bool? deletedOnly = null, int? page = null, int? pageSize = null, string sort = null, string sortOrder = null)
        {
            return GetFilterCreditNoteListAsync<SalesVoucherCollection>(startDate, endDate, fields, freeTextSearch, statusFilter, changesSince, deletedOnly, page, pageSize, sort, sortOrder);
        }

        /// <summary>
        /// Retrieve a list of credit notes for the organization.
        /// </summary>
        /// <param name="page">The 0-based page number</param>
        /// <param name="pageSize">The maximum number of items to include in a page. Maximum 1000.</param>
        /// <param name="fields">A comma separated list of fields to include in the response.
        /// Possible values are:
        /// Number, Guid, ContactName, Date, PaymentDate, Description, Currency, Status, MailOutStatus,
        /// TotalExclVatInDkk, TotalInclVatInDkk, TotalExclVat, TotalInclVat, CreatedAt, UpdatedAt and DeletedAt.
        /// If null, defaults to Guid,ContactName,Date,Description.
        /// Notice that it's not case sensitive, the property name will be returned the way you request it.
        /// </param>
        /// <param name="deletedOnly">[Generic Filter Option] Only select deleted credit notes. If left empty, will defaults to false.</param>
        /// <param name="freeTextSearch">A free text search performed on Number, ContactName, Description and TotalInclTax</param>
        /// <param name="statusFilter">Filter on Status. You can choose Draft, Booked, Paid, OverPaid or Overdue. You can only filter on one status. If left empty no filter is applied.</param>
        /// <param name="changesSince">[Generic Filter Option] Only return credit notes that was created, deleted or updated at or after given time.
        /// If left empty, this filter will not be applied, and credit notes will be returned regardless of change history.
        /// The time must be UTC and in the format 'YYYY-MM-DDTHH:mm:ssZ' example: '2015-08-18T06:36:22Z'. </param>
        /// <param name="startDate">Start date. If you define a start date, you also need to define an end date.</param>
        /// <param name="endDate">End date. If you define an end date, you also need to define a start date.</param>
        /// <param name="sort">A comma separated list of fields to sort on. Possible values are: VoucherNumber, VoucherDate and Status.</param>
        /// <param name="sortOrder">Sort order. Valid values are ascending and descending. Field Status is always sorted in the order Draft, Overdue, Booked, OverPaid and Paid.</param>
        /// <returns>200 (OK) Returns a collection of credit notes (with only the requested fields).</returns>
        public SalesVoucherCollection GetList(DateTime? startDate = null, DateTime? endDate = null, string fields = null,
                 string freeTextSearch = null, string statusFilter = null, DateTime? changesSince = null, bool? deletedOnly = null, int? page = null, int? pageSize = null, string sort = null, string sortOrder = null)
        {
            return TaskHelper.ExecuteSync(() => GetListAsync(startDate, endDate, fields, freeTextSearch, statusFilter, changesSince, deletedOnly, page, pageSize, sort, sortOrder));
        }

        private Task<T> GetFilterCreditNoteListAsync<T>(DateTime? startDate, DateTime? endDate, string fields, string freeTextSearch, string statusFilter, DateTime? changesSince, bool? deletedOnly, int? page, int? pageSize, string sort = null, string sortOrder = null) where T : IDineroParsable, new()
        {
            var parameters = CreateListParameters(fields, changesSince, deletedOnly, page, pageSize);

            if (startDate.HasValue)
                parameters.Add(DineroApiParameterName.StartDate, startDate.Value.ToString("yyyy-MM-dd"));

            if (endDate.HasValue)
                parameters.Add(DineroApiParameterName.EndDate, endDate.Value.ToString("yyyy-MM-dd"));

            if (!string.IsNullOrWhiteSpace(freeTextSearch))
                parameters.Add(DineroApiParameterName.FreeTextSearch, freeTextSearch);

            if (!string.IsNullOrWhiteSpace(statusFilter))
                parameters.Add(DineroApiParameterName.StatusFilter, statusFilter);

            if (!string.IsNullOrWhiteSpace(sort))
                parameters.Add(DineroApiParameterName.Sort, sort);

            if (!string.IsNullOrWhiteSpace(sortOrder))
                parameters.Add(DineroApiParameterName.SortOrder, sortOrder);

            return Dinero.GetAsync<T>(parameters);
        }
    }
}


text:
module Phaxio
  module Resources
    module Public
      class Country < Resource
        SUPPORTED_COUNTRIES_PATH = 'public/countries'.freeze
        private_constant :SUPPORTED_COUNTRIES_PATH

        # @return [String] the name of the country.
        # @!attribute name

        # @return [String] the alpha2 representation of the country.
        # @!attribute alpha2

        # @return [Integer] the E.164 country code for the country.
        # @!attribute country_code

        # @return [Integer] the price per page for the country, in cents.
        # @!attribute price_per_page

        # @return [String] the level of send support provided for this country.
        # @!attribute send_support

        # @return [String] the level of receive support provided for this country.
        # @!attribute receive_support

        has_normal_attributes %w[
          name alpha2 country_code price_per_page send_support receive_support
        ]

        class << self
          # @macro paging
          # Get a list of supported countries for sending faxes.
          # @param params [Hash]
          #   A hash of parameters to send to Phaxio. This action has no unique
          #   parameters.
          # @return [Phaxio::Resource::Collection<Phaxio::Resources::Country>]
          #   A collection of supported countries.
          # @raise Phaxio::Error::PhaxioError
          # @see https://www.phaxio.com/docs/api/v2/public/list_countries
          def list params = {}
            response = Client.request :get, supported_countries_endpoint, params
            Country.response_collection response
          end

          private

          def supported_countries_endpoint
            SUPPORTED_COUNTRIES_PATH
          end
        end
      end
    end
  end
end


text:
package tech.devcodetest.ecommerce.model;

import javax.persistence.Column;
import javax.persistence.MappedSuperclass;

@MappedSuperclass
public class NamedEntity extends BaseEntity {

    @Column(name = "name")
    private String name;

    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return this.getName();
    }

}


text:
namespace chromeos {

ScreenLockServiceProvider::ScreenLockServiceProvider()
    : weak_ptr_factory_(this) {
}

ScreenLockServiceProvider::~ScreenLockServiceProvider() {}

void ScreenLockServiceProvider::Start(
    scoped_refptr<dbus::ExportedObject> exported_object) {
  exported_object->ExportMethod(
      kLibCrosServiceInterface,
      kLockScreen,
      base::Bind(&ScreenLockServiceProvider::LockScreen,
                 weak_ptr_factory_.GetWeakPtr()),
      base::Bind(&ScreenLockServiceProvider::OnExported,
                 weak_ptr_factory_.GetWeakPtr()));
}

void ScreenLockServiceProvider::OnExported(const std::string& interface_name,
                                           const std::string& method_name,
                                           bool success) {
  if (!success) {
    LOG(ERROR) << "Failed to export " << interface_name << "."
               << method_name;
  }
}

void ScreenLockServiceProvider::LockScreen(
    dbus::MethodCall* method_call,
    dbus::ExportedObject::ResponseSender response_sender) {
  // Please add any additional logic to ScreenLocker::HandleLockScreenRequest()
  // instead of placing it here.
  ScreenLocker::HandleLockScreenRequest();
  response_sender.Run(dbus::Response::FromMethodCall(method_call));
}

}  // namespace chromeos


text:
This tutorial shows the basics for building a Semantic Web-based application by guiding you through some of the typical steps involved. This means:

* Styling your webpage using CSS
* Using client side scripting for manipulating the webpage
* Using server side scripting for mediating between your own triple store and others
* Posting information to your triple store
* Using reasoning facilities of your triple store

### Requirements

To get this thing up and running on a local machine, you need the following:

* Python 2.7
* Virtualenv (`pip install virtualenv`)
* Setup the virtualenv in the directory of this repository (`virtualenv .`)
* Activate the virtualenv (`source bin/activate` on linux-like systems)
* Install the necessary packages (install using `pip install -r requirements.txt`)
* A recent Stardog installation
	* The script assumes a Stardog database with the name 'tutorial' running at <http://localhost:5820/tutorial> (security disabled).
	* The database should have resoning enabled, and "SameAs" reasoning should be set to "Full".
	* If you want to use a different name or location (i.e. not running on localhost, port 5820) you need to set the `TUTORIAL_REPOSITORY` variable in `src/tutorial.py`

Once everything is ready:

* start your Stardog server with `stardog-admin server start --disable-security`,
* change dir into the `src` directory, and
* run `python tutorial.py`.

The tutorial is then running at <http://localhost:5000> .