Dataset Preview
Duplicate
The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
The dataset generation failed
Error code:   DatasetGenerationError
Exception:    TypeError
Message:      Couldn't cast array of type
struct<content_hash: string, timestamp: string, source: string, line_count: int64, max_line_length: int64, avg_line_length: double, alnum_prop: double, repo_name: string, id: string, size: string, binary: bool, copies: string, ref: string, path: string, mode: string, license: string, language: list<item: struct<name: string, bytes: string>>, symlink_target: string>
to
{'content_hash': Value(dtype='string', id=None), 'timestamp': Value(dtype='string', id=None), 'source': Value(dtype='string', id=None), 'line_count': Value(dtype='int64', id=None), 'max_line_length': Value(dtype='int64', id=None), 'avg_line_length': Value(dtype='float64', id=None), 'alnum_prop': Value(dtype='float64', id=None), 'repo_name': Value(dtype='string', id=None), 'id': Value(dtype='string', id=None), 'size': Value(dtype='string', id=None), 'binary': Value(dtype='bool', id=None), 'copies': Value(dtype='string', id=None), 'ref': Value(dtype='string', id=None), 'path': Value(dtype='string', id=None), 'mode': Value(dtype='string', id=None), 'license': Value(dtype='string', id=None), 'language': [{'name': Value(dtype='string', id=None), 'bytes': Value(dtype='string', id=None)}]}
Traceback:    Traceback (most recent call last):
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 2011, in _prepare_split_single
                  writer.write_table(table)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/arrow_writer.py", line 585, in write_table
                  pa_table = table_cast(pa_table, self._schema)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 2302, in table_cast
                  return cast_table_to_schema(table, schema)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 2261, in cast_table_to_schema
                  arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 2261, in <listcomp>
                  arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 1802, in wrapper
                  return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 1802, in <listcomp>
                  return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 2122, in cast_array_to_feature
                  raise TypeError(f"Couldn't cast array of type\n{_short_str(array.type)}\nto\n{_short_str(feature)}")
              TypeError: Couldn't cast array of type
              struct<content_hash: string, timestamp: string, source: string, line_count: int64, max_line_length: int64, avg_line_length: double, alnum_prop: double, repo_name: string, id: string, size: string, binary: bool, copies: string, ref: string, path: string, mode: string, license: string, language: list<item: struct<name: string, bytes: string>>, symlink_target: string>
              to
              {'content_hash': Value(dtype='string', id=None), 'timestamp': Value(dtype='string', id=None), 'source': Value(dtype='string', id=None), 'line_count': Value(dtype='int64', id=None), 'max_line_length': Value(dtype='int64', id=None), 'avg_line_length': Value(dtype='float64', id=None), 'alnum_prop': Value(dtype='float64', id=None), 'repo_name': Value(dtype='string', id=None), 'id': Value(dtype='string', id=None), 'size': Value(dtype='string', id=None), 'binary': Value(dtype='bool', id=None), 'copies': Value(dtype='string', id=None), 'ref': Value(dtype='string', id=None), 'path': Value(dtype='string', id=None), 'mode': Value(dtype='string', id=None), 'license': Value(dtype='string', id=None), 'language': [{'name': Value(dtype='string', id=None), 'bytes': Value(dtype='string', id=None)}]}
              
              The above exception was the direct cause of the following exception:
              
              Traceback (most recent call last):
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1529, in compute_config_parquet_and_info_response
                  parquet_operations = convert_to_parquet(builder)
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1154, in convert_to_parquet
                  builder.download_and_prepare(
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1027, in download_and_prepare
                  self._download_and_prepare(
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1122, in _download_and_prepare
                  self._prepare_split(split_generator, **prepare_split_kwargs)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1882, in _prepare_split
                  for job_id, done, content in self._prepare_split_single(
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 2038, in _prepare_split_single
                  raise DatasetGenerationError("An error occurred while generating the dataset") from e
              datasets.exceptions.DatasetGenerationError: An error occurred while generating the dataset

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

text
string
meta
dict
<?php namespace FzyCommon\Service\Search; use FzyCommon\Service\Base as BaseService; /** * Class SearchResult * @package FzyCommon\Service\Search * Service Key: result */ class Result extends BaseService { public function generatePageResult(ResultProviderInterface $provider) { return array( 'data' => $provider->getResults(), 'meta' => array( 'total' => $provider->getTotal(), 'limit' => $provider->getLimit(), 'offset' => $provider->getOffset(), 'tag' => $provider->getResultTag(), ), 'draw' => $provider->getDrawNumber(), 'recordsTotal' => $provider->getTotal(), 'recordsFiltered' => $provider->getTotal(), ); } public function __invoke(ResultProviderInterface $provider) { return $this->generatePageResult($provider); } }
{ "content_hash": "7becfaf4eec5986a711e6c9900de0bfb", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 73, "avg_line_length": 27, "alnum_prop": 0.5718954248366013, "repo_name": "fousheezy/common", "id": "dc774589c7a9870360fc24d585e9a30900755a4e", "size": "918", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "module/FzyCommon/src/FzyCommon/Service/Search/Result.php", "mode": "33188", "license": "mit", "language": [ { "name": "PHP", "bytes": "102198" }, { "name": "Shell", "bytes": "662" } ] }
/* * @(#)RFC822DATA.java 1.6 05/08/29 * * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved. */ package com.sun.mail.imap.protocol; import java.io.ByteArrayInputStream; import com.sun.mail.iap.*; import com.sun.mail.util.ASCIIUtility; /** * This class * * @version 1.6, 05/08/29 * @author John Mani */ public class RFC822DATA implements Item { public static char [] name = {'R','F','C','8','2','2'}; public int msgno; public ByteArray data; /** * Constructor * @param port portnumber to connect to */ public RFC822DATA(FetchResponse r) throws ParsingException { msgno = r.getNumber(); r.skipSpaces(); data = r.readByteArray(); } public ByteArray getByteArray() { return data; } public ByteArrayInputStream getByteArrayInputStream() { if (data != null) return data.toByteArrayInputStream(); else return null; } }
{ "content_hash": "964527ed5ac999e48c8fa205202915fe", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 66, "avg_line_length": 19.1875, "alnum_prop": 0.6482084690553745, "repo_name": "cran/rkafkajars", "id": "979894fe49f648ac8432b2a4d8872bb8e0514df2", "size": "1757", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "java/com/sun/mail/imap/protocol/RFC822DATA.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C++", "bytes": "8027" }, { "name": "HTML", "bytes": "53621" }, { "name": "Java", "bytes": "5533914" }, { "name": "Perl", "bytes": "17" }, { "name": "R", "bytes": "302" }, { "name": "Rebol", "bytes": "1002" }, { "name": "Scala", "bytes": "3739355" }, { "name": "Shell", "bytes": "18" } ] }
import os import shutil from retry import retry from selenium.common.exceptions import ( NoSuchElementException, StaleElementReferenceException, TimeoutException, WebDriverException, ) from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support.ui import WebDriverWait from config import config from tests.pages.element import ( BasePageElement, EmailInputElement, FileInputElement, MobileInputElement, NameInputElement, NewPasswordInputElement, PasswordInputElement, ServiceInputElement, SmsInputElement, SubjectInputElement, TemplateContentElement, ) from tests.pages.locators import ( AddServicePageLocators, ApiIntegrationPageLocators, ChangeNameLocators, CommonPageLocators, EditTemplatePageLocators, EmailReplyToLocators, InviteUserPageLocators, LetterPreviewPageLocators, MainPageLocators, NavigationLocators, ServiceSettingsLocators, SignInPageLocators, SingleRecipientLocators, SmsSenderLocators, TeamMembersPageLocators, TemplatePageLocators, UploadCsvLocators, VerifyPageLocators, ViewTemplatePageLocators, ) class RetryException(Exception): pass class AntiStale: def __init__(self, driver, locator, webdriverwait_func): """ webdriverwait_func is a function that takes in a locator and returns an element. Probably a webdriverwait. """ self.driver = driver self.webdriverwait_func = webdriverwait_func self.locator = locator # kick it off self.element = self.webdriverwait_func(self.locator) @retry(RetryException, tries=5) def retry_on_stale(self, callable): try: return callable() except StaleElementReferenceException: self.reset_element() def reset_element(self): self.element = self.webdriverwait_func(self.locator) raise RetryException("StaleElement {}".format(self.locator)) class AntiStaleElement(AntiStale): def click(self): def _click(): # an element might be hidden underneath other elements (eg sticky nav items). To counter this, we can use # the scrollIntoView function to bring it to the top of the page self.driver.execute_script( "arguments[0].scrollIntoViewIfNeeded()", self.element ) try: self.element.click() except WebDriverException: self.driver.execute_script( "arguments[0].scrollIntoView()", self.element ) self.element.click() return self.retry_on_stale(_click) def __getattr__(self, attr): return self.retry_on_stale(lambda: getattr(self.element, attr)) class AntiStaleElementList(AntiStale): def __getitem__(self, index): class AntiStaleListItem: def click(item_self): return self.retry_on_stale(lambda: self.element[index].click()) def __getattr__(item_self, attr): return self.retry_on_stale(lambda: getattr(self.element[index], attr)) return AntiStaleListItem() def __len__(self): return len(self.element) class BasePage(object): sign_out_link = NavigationLocators.SIGN_OUT_LINK def __init__(self, driver): self.base_url = config["notify_admin_url"] self.driver = driver def get(self, url=None): if url: self.driver.get(url) else: self.driver.get(self.base_url) @property def current_url(self): return self.driver.current_url def wait_for_invisible_element(self, locator): return AntiStaleElement( self.driver, locator, lambda locator: WebDriverWait(self.driver, 10).until( EC.presence_of_element_located(locator) ), ) def wait_for_element(self, locator, time=10): return AntiStaleElement( self.driver, locator, lambda locator: WebDriverWait(self.driver, time).until( EC.visibility_of_element_located(locator), EC.presence_of_element_located(locator), ), ) def wait_for_elements(self, locator): return AntiStaleElementList( self.driver, locator, lambda locator: WebDriverWait(self.driver, 10).until( EC.visibility_of_all_elements_located(locator), EC.presence_of_all_elements_located(locator), ), ) def sign_out(self): element = self.wait_for_element(BasePage.sign_out_link) element.click() self.driver.delete_all_cookies() def wait_until_url_is(self, url): return WebDriverWait(self.driver, 10).until(self.url_contains(url)) def url_contains(self, url): def check_contains_url(driver): return url in self.driver.current_url return check_contains_url def select_checkbox_or_radio(self, element=None, value=None): if not element and value: locator = (By.CSS_SELECTOR, f"[value={value}]") element = self.wait_for_invisible_element(locator) if not element.get_attribute("checked"): element.click() assert element.get_attribute("checked") def unselect_checkbox(self, element): if element.get_attribute("checked"): element.click() assert not element.get_attribute("checked") def click_templates(self): element = self.wait_for_element(NavigationLocators.TEMPLATES_LINK) element.click() def click_settings(self): element = self.wait_for_element(NavigationLocators.SETTINGS_LINK) element.click() def click_save(self, time=10): element = self.wait_for_element(CommonPageLocators.CONTINUE_BUTTON, time=time) element.click() def click_continue(self): element = self.wait_for_element(CommonPageLocators.CONTINUE_BUTTON) element.click() def is_page_title(self, expected_page_title): element = self.wait_for_element(CommonPageLocators.H1) return element.text == expected_page_title def is_text_present_on_page(self, search_text): normalized_page_source = " ".join(self.driver.page_source.split()) return search_text in normalized_page_source def get_template_id(self): # e.g. # http://localhost:6012/services/237dd966-b092-42ab-b406-0a00187d007f/templates/4808eb34-5225-492b-8af2-14b232f05b8e/edit # circle back and do better return self.driver.current_url.split("/templates/")[1].split("/")[0] def click_element_by_link_text(self, link_text): element = self.wait_for_element((By.LINK_TEXT, link_text)) element.click() def get_errors(self): error_message = (By.CSS_SELECTOR, ".banner-dangerous") errors = self.wait_for_element(error_message) return errors.text.strip() class PageWithStickyNavMixin: def scrollToRevealElement(self, selector=None, xpath=None, stuckToBottom=True): namespace = "window.GOVUK.stickAtBottomWhenScrolling" if stuckToBottom is False: namespace = "window.GOVUK.stickAtTopWhenScrolling" if selector is not None: js_str = ( f"if ('scrollToRevealElement' in {namespace})" f"{namespace}.scrollToRevealElement($('{selector}').eq(0))" ) self.driver.execute_script(js_str) elif xpath is not None: js_str = f"""(function (document) {{ if ('scrollToRevealElement' in {namespace}) {{ var matches = document.evaluate("{xpath}", document, null, XPathResult.ANY_TYPE, null); if (matches) {{ {namespace}.scrollToRevealElement($(matches.iterateNext())); }} }} }}(document));""" self.driver.execute_script(js_str) class HomePage(BasePage): def accept_cookie_warning(self): # if the cookie warning isn't present, this does nothing try: self.wait_for_element( CommonPageLocators.ACCEPT_COOKIE_BUTTON, time=1 ).click() except (NoSuchElementException, TimeoutException): return class MainPage(BasePage): set_up_account_button = MainPageLocators.SETUP_ACCOUNT_BUTTON def click_set_up_account(self): element = self.wait_for_element(MainPage.set_up_account_button) element.click() class RegistrationPage(BasePage): name_input = NameInputElement() email_input = EmailInputElement() mobile_input = MobileInputElement() password_input = PasswordInputElement() def is_current(self): return self.wait_until_url_is(self.base_url + "/register") def register(self): self.name_input = config["user"]["name"] self.email_input = config["user"]["email"] self.mobile_input = config["user"]["mobile"] self.password_input = config["user"]["password"] self.click_continue() class AddServicePage(BasePage): service_input = ServiceInputElement() org_type_input = AddServicePageLocators.ORG_TYPE_INPUT add_service_button = AddServicePageLocators.ADD_SERVICE_BUTTON def is_current(self): return self.wait_until_url_is(self.base_url + "/add-service?first=first") def add_service(self, name): self.service_input = name try: self.click_org_type_input() except NoSuchElementException: pass self.click_add_service_button() def click_add_service_button(self): element = self.wait_for_element(AddServicePage.add_service_button) element.click() def click_org_type_input(self): try: element = self.wait_for_invisible_element(AddServicePage.org_type_input) element.click() except TimeoutException: pass class ForgotPasswordPage(BasePage): email_input = EmailInputElement() def input_email_address(self, email_address): self.email_input = email_address class NewPasswordPage(BasePage): new_password_input = NewPasswordInputElement() def input_new_password(self, password): self.new_password_input = password class SignInPage(BasePage): email_input = EmailInputElement() password_input = PasswordInputElement() forgot_password_link = SignInPageLocators.FORGOT_PASSWORD_LINK def get(self): self.driver.get(self.base_url + "/sign-in") def is_current(self): return self.wait_until_url_is(self.base_url + "/sign-in") def fill_login_form(self, email, password): self.email_input = email self.password_input = password def click_forgot_password_link(self): element = self.wait_for_element(SignInPage.forgot_password_link) element.click() def login(self, email, password): self.fill_login_form(email, password) self.click_continue() class VerifyPage(BasePage): sms_input = SmsInputElement() def verify(self, code): element = self.wait_for_element(VerifyPageLocators.SMS_INPUT) element.clear() self.sms_input = code self.click_continue() class DashboardPage(BasePage): h2 = (By.CLASS_NAME, "navigation-service-name") sms_templates_link = (By.LINK_TEXT, "Text message templates") email_templates_link = (By.LINK_TEXT, "Email templates") team_members_link = (By.LINK_TEXT, "Team members") api_keys_link = (By.LINK_TEXT, "API integration") total_email_div = (By.CSS_SELECTOR, "#total-email .big-number-number") total_sms_div = (By.CSS_SELECTOR, "#total-sms .big-number-number") total_letter_div = (By.CSS_SELECTOR, "#total-letters .big-number-number") inbox_link = (By.CSS_SELECTOR, "#total-received") navigation = (By.CLASS_NAME, "navigation") def _message_count_for_template_div(self, template_id): return (By.ID, template_id) def is_current(self, service_id): expected = "{}/services/{}/dashboard".format(self.base_url, service_id) return self.driver.current_url == expected def get_service_name(self): element = self.wait_for_element(DashboardPage.h2) return element.text def click_sms_templates(self): element = self.wait_for_element(DashboardPage.sms_templates_link) element.click() def click_email_templates(self): element = self.wait_for_element(DashboardPage.email_templates_link) element.click() def click_team_members_link(self): element = self.wait_for_element(DashboardPage.team_members_link) element.click() def click_inbox_link(self): element = self.wait_for_element(DashboardPage.inbox_link) element.click() def get_service_id(self): return self.driver.current_url.split("/services/")[1].split("/")[0] def get_navigation_list(self): element = self.wait_for_element(DashboardPage.navigation) return element.text def get_notification_id(self): return self.driver.current_url.split("notification/")[1].split("?")[0] def go_to_dashboard_for_service(self, service_id=None): if not service_id: service_id = self.get_service_id() url = "{}/services/{}/dashboard".format(self.base_url, service_id) self.driver.get(url) def get_total_message_count(self, message_type): if message_type == "email": target_div = DashboardPage.total_email_div elif message_type == "letter": target_div = DashboardPage.total_letter_div else: target_div = DashboardPage.total_sms_div element = self.wait_for_element(target_div) return int(element.text) def get_template_message_count(self, template_id): messages_sent_count_for_template_div = self._message_count_for_template_div( template_id ) element = self.wait_for_element(messages_sent_count_for_template_div) return int(element.text) class ShowTemplatesPage(PageWithStickyNavMixin, BasePage): add_new_template_link = (By.CSS_SELECTOR, "button[value='add-new-template']") add_new_folder_link = (By.CSS_SELECTOR, "button[value='add-new-folder']") add_to_new_folder_link = (By.CSS_SELECTOR, "button[value='move-to-new-folder']") move_to_existing_folder_link = ( By.CSS_SELECTOR, "button[value='move-to-existing-folder']", ) email_filter_link = (By.LINK_TEXT, "Email") email_radio = (By.CSS_SELECTOR, "input[type='radio'][value='email']") text_message_radio = (By.CSS_SELECTOR, "input[type='radio'][value='sms']") letter_radio = (By.CSS_SELECTOR, "input[type='radio'][value='letter']") add_new_folder_textbox = BasePageElement(name="add_new_folder_name") add_to_new_folder_textbox = BasePageElement(name="move_to_new_folder_name") root_template_folder_radio = ( By.CSS_SELECTOR, "input[type='radio'][value='__NONE__']", ) @staticmethod def template_link_text(link_text): return ( By.XPATH, "//div[contains(@id,'template-list')]//a/span[contains(normalize-space(.), '{}')]".format( link_text ), ) @staticmethod def template_checkbox(template_id): return ( By.CSS_SELECTOR, "input[type='checkbox'][value='{}']".format(template_id), ) def click_add_new_template(self): element = self.wait_for_element(self.add_new_template_link) element.click() def click_add_new_folder(self, folder_name): element = self.wait_for_element(self.add_new_folder_link) element.click() self.add_new_folder_textbox = folder_name # green submit button element = self.wait_for_element(self.add_new_folder_link) element.click() def click_template_by_link_text(self, link_text): element = self.wait_for_element(self.template_link_text(link_text)) self.scrollToRevealElement(xpath=self.template_link_text(link_text)[1]) element.click() def _select_template_type(self, type): # wait for continue button to be displayed - sticky nav has rendered properly # we've seen issues radio_element = self.wait_for_invisible_element(type) self.select_checkbox_or_radio(radio_element) self.click_continue() def select_email(self): self._select_template_type(self.email_radio) def select_text_message(self): self._select_template_type(self.text_message_radio) def select_template_checkbox(self, template_id): element = self.wait_for_invisible_element(self.template_checkbox(template_id)) self.select_checkbox_or_radio(element) def add_to_new_folder(self, folder_name): # grey button to go to the name input box element = self.wait_for_element(self.add_to_new_folder_link) element.click() self.add_to_new_folder_textbox = folder_name # green submit button element = self.wait_for_element(self.add_to_new_folder_link) element.click() def move_to_root_template_folder(self): move_button = self.wait_for_element(self.move_to_existing_folder_link) move_button.click() # wait for continue button to be displayed - sticky nav has rendered properly # we've seen issues radio_element = self.wait_for_invisible_element(self.root_template_folder_radio) self.select_checkbox_or_radio(radio_element) self.click_continue() def get_folder_by_name(self, folder_name): try: return self.wait_for_invisible_element(self.template_link_text(folder_name)) except TimeoutException: return None class SendSmsTemplatePage(BasePage): new_sms_template_link = TemplatePageLocators.ADD_NEW_TEMPLATE_LINK edit_sms_template_link = TemplatePageLocators.EDIT_TEMPLATE_LINK def click_add_new_template(self): element = self.wait_for_element(SendSmsTemplatePage.new_sms_template_link) element.click() class EditSmsTemplatePage(BasePage): name_input = NameInputElement() template_content_input = TemplateContentElement() save_button = EditTemplatePageLocators.SAVE_BUTTON def click_save(self): element = self.wait_for_element(EditSmsTemplatePage.save_button) element.click() def create_template(self, name="Test sms template", content=None): self.name_input = name if content: self.template_content_input = content else: self.template_content_input = "The quick brown fox jumped over the lazy dog. Jenkins job id: ((build_id))" self.click_save() class EditBroadcastTemplatePage(EditSmsTemplatePage): pass class SendEmailTemplatePage(BasePage): add_a_new_email_template_link = TemplatePageLocators.ADD_A_NEW_TEMPLATE_LINK add_new_email_template_link = TemplatePageLocators.ADD_NEW_TEMPLATE_LINK edit_email_template_link = TemplatePageLocators.EDIT_TEMPLATE_LINK def click_add_a_new_template(self): element = self.wait_for_element( SendEmailTemplatePage.add_a_new_email_template_link ) element.click() def click_add_new_template(self): element = self.wait_for_element( SendEmailTemplatePage.add_new_email_template_link ) element.click() class ViewTemplatePage(BasePage): def click_send(self): element = self.wait_for_element(ViewTemplatePageLocators.SEND_BUTTON) element.click() class EditEmailTemplatePage(BasePage): name_input = NameInputElement() subject_input = SubjectInputElement() template_content_input = TemplateContentElement() save_button = EditTemplatePageLocators.SAVE_BUTTON delete_button = EditTemplatePageLocators.DELETE_BUTTON confirm_delete_button = EditTemplatePageLocators.CONFIRM_DELETE_BUTTON @staticmethod def folder_path_item(folder_name): return ( By.XPATH, "//a[contains(@class,'folder-heading-folder') and contains(text(), '{}')]".format( folder_name ), ) def click_save(self): element = self.wait_for_element(EditEmailTemplatePage.save_button) element.click() def click_delete(self): element = self.wait_for_element(EditEmailTemplatePage.delete_button) element.click() element = self.wait_for_element(EditEmailTemplatePage.confirm_delete_button) element.click() def create_template(self, name="Test email template", content=None): self.name_input = name self.subject_input = "Test email from functional tests" if content: self.template_content_input = content else: self.template_content_input = "The quick brown fox jumped over the lazy dog. Jenkins job id: ((build_id))" self.click_save() def click_folder_path(self, folder_name): element = self.wait_for_element(self.folder_path_item(folder_name)) element.click() class UploadCsvPage(BasePage): file_input_element = FileInputElement() send_button = UploadCsvLocators.SEND_BUTTON first_notification = UploadCsvLocators.FIRST_NOTIFICATION_AFTER_UPLOAD def click_send(self): element = self.wait_for_element(UploadCsvPage.send_button) element.click() def upload_csv(self, directory, path): file_path = os.path.join(directory, path) self.file_input_element = file_path self.click_send() shutil.rmtree(directory, ignore_errors=True) # we've been having issues with celery short polling causing notifications to take a long time. @retry(RetryException, tries=10, delay=10) def get_notification_id_after_upload(self): try: element = self.wait_for_element(UploadCsvPage.first_notification) notification_id = element.get_attribute("id") if not notification_id: raise RetryException( "No notification id yet {}".format(notification_id) ) else: return notification_id except StaleElementReferenceException: raise RetryException("Could not find element...") def go_to_upload_csv_for_service_and_template(self, service_id, template_id): url = "{}/services/{}/send/{}/csv".format( self.base_url, service_id, template_id ) self.driver.get(url) class TeamMembersPage(BasePage): h1 = TeamMembersPageLocators.H1 invite_team_member_button = TeamMembersPageLocators.INVITE_TEAM_MEMBER_BUTTON edit_team_member_link = TeamMembersPageLocators.EDIT_TEAM_MEMBER_LINK def get_edit_link_for_member_name(self, email): return self.wait_for_element( ( By.XPATH, "//h2[@title='{}']/ancestor::div[contains(@class, 'user-list-item')]//a".format( email ), ) ) def h1_is_team_members(self): element = self.wait_for_element(TeamMembersPage.h1) return element.text == "Team members" def click_invite_user(self): element = self.wait_for_element(TeamMembersPage.invite_team_member_button) element.click() def click_edit_team_member(self, email): element = self.get_edit_link_for_member_name(email) element.click() class InviteUserPage(BasePage): email_input = EmailInputElement() see_dashboard_check_box = InviteUserPageLocators.SEE_DASHBOARD_CHECKBOX choose_folders_button = InviteUserPageLocators.CHOOSE_FOLDERS_BUTTON send_messages_checkbox = InviteUserPageLocators.SEND_MESSAGES_CHECKBOX manage_services_checkbox = InviteUserPageLocators.MANAGE_SERVICES_CHECKBOX manage_templates_checkbox = InviteUserPageLocators.MANAGE_TEMPLATES_CHECKBOX manage_api_keys_checkbox = InviteUserPageLocators.MANAGE_API_KEYS_CHECKBOX choose_folders_button = InviteUserPageLocators.CHOOSE_FOLDERS_BUTTON send_invitation_button = InviteUserPageLocators.SEND_INVITATION_BUTTON def get_folder_checkbox(self, folder_name): label = self.driver.find_elements( By.XPATH, f"//label[contains(text(), '{folder_name}')]" ) return (By.ID, label[0].get_attribute("for")) def fill_invitation_form(self, email, send_messages_only): self.email_input = email if send_messages_only: element = self.wait_for_invisible_element( InviteUserPage.send_messages_checkbox ) self.select_checkbox_or_radio(element) else: element = self.wait_for_invisible_element( InviteUserPage.see_dashboard_check_box ) self.select_checkbox_or_radio(element) element = self.wait_for_invisible_element( InviteUserPage.send_messages_checkbox ) self.select_checkbox_or_radio(element) element = self.wait_for_invisible_element( InviteUserPage.manage_templates_checkbox ) self.select_checkbox_or_radio(element) element = self.wait_for_invisible_element( InviteUserPage.manage_services_checkbox ) self.select_checkbox_or_radio(element) element = self.wait_for_invisible_element( InviteUserPage.manage_api_keys_checkbox ) self.select_checkbox_or_radio(element) def send_invitation(self): element = self.wait_for_element(InviteUserPage.send_invitation_button) element.click() # support variants of this page with a 'Save' button instead of 'Send invitation' (both use the same locator) def click_save(self): self.send_invitation() def uncheck_folder_permission_checkbox(self, folder_name): try: choose_folders_button = self.wait_for_invisible_element( InviteUserPage.choose_folders_button ) choose_folders_button.click() except (NoSuchElementException, TimeoutException): pass checkbox = self.wait_for_invisible_element( self.get_folder_checkbox(folder_name) ) self.unselect_checkbox(checkbox) def is_checkbox_checked(self, folder_name): try: choose_folders_button = self.wait_for_invisible_element( InviteUserPage.choose_folders_button ) choose_folders_button.click() except (NoSuchElementException, TimeoutException): pass checkbox = self.wait_for_invisible_element( self.get_folder_checkbox(folder_name) ) return checkbox.get_attribute("checked") class RegisterFromInvite(BasePage): name_input = NameInputElement() mobile_input = MobileInputElement() password_input = PasswordInputElement() def fill_registration_form(self, name): self.name_input = name self.mobile_input = config["user"]["mobile"] self.password_input = config["user"]["password"] class ApiIntegrationPage(BasePage): message_log = ApiIntegrationPageLocators.MESSAGE_LOG heading_button = ApiIntegrationPageLocators.HEADING_BUTTON client_reference = ApiIntegrationPageLocators.CLIENT_REFERENCE message_list = ApiIntegrationPageLocators.MESSAGE_LIST status = ApiIntegrationPageLocators.STATUS view_letter_link = ApiIntegrationPageLocators.VIEW_LETTER_LINK def get_notification_id(self): element = self.wait_for_elements(ApiIntegrationPage.message_list)[0] return element.text def expand_all_messages(self): buttons = self.wait_for_elements(ApiIntegrationPage.heading_button) for index in range(len(buttons)): buttons[index].click() def get_client_reference(self): element = self.wait_for_elements(ApiIntegrationPage.client_reference)[1] return element.text def go_to_api_integration_for_service(self, service_id): url = "{}/services/{}/api".format(self.base_url, service_id) self.driver.get(url) def get_status_from_message(self): element = self.wait_for_elements(ApiIntegrationPage.status)[0] return element.text def get_view_letter_link(self): link = self.wait_for_elements(ApiIntegrationPage.view_letter_link)[0] return link.get_attribute("href") def go_to_preview_letter(self): link = self.wait_for_elements(ApiIntegrationPage.view_letter_link)[0] self.driver.get(link.get_attribute("href")) class PreviewLetterPage(BasePage): download_pdf_link = LetterPreviewPageLocators.DOWNLOAD_PDF_LINK pdf_image = LetterPreviewPageLocators.PDF_IMAGE def get_download_pdf_link(self): link = self.wait_for_element(PreviewLetterPage.download_pdf_link) return link.get_attribute("href") def get_image_src(self): link = self.wait_for_element(PreviewLetterPage.pdf_image) return link.get_attribute("src") class SendOneRecipient(BasePage): def is_placeholder_a_recipient_field(self, message_type): element = self.wait_for_element(SingleRecipientLocators.PLACEHOLDER_NAME) if message_type == "email": return element.text.strip() == "email address" else: return element.text.strip() == "phone number" def get_placeholder_name(self): element = self.wait_for_element(SingleRecipientLocators.PLACEHOLDER_NAME) return element.text.strip() def enter_placeholder_value(self, placeholder_value): element = self.wait_for_element(SingleRecipientLocators.PLACEHOLDER_VALUE_INPUT) element.send_keys(placeholder_value) def get_preview_contents(self): table = self.wait_for_element(SingleRecipientLocators.PREVIEW_TABLE) rows = table.find_elements( By.TAG_NAME, "tr" ) # get all of the rows in the table return rows def choose_alternative_sender(self): radio = self.wait_for_invisible_element( SingleRecipientLocators.ALTERNATIVE_SENDER_RADIO ) radio.click() def send_to_myself(self, message_type): if message_type == "email": element = self.wait_for_element(SingleRecipientLocators.USE_MY_EMAIL) else: element = self.wait_for_element(SingleRecipientLocators.USE_MY_NUMBER) element.click() class ServiceSettingsPage(BasePage): def check_service_name(self, expected_name): name = self.wait_for_element(ServiceSettingsLocators.SERVICE_NAME) if name.element.text == expected_name: return True else: raise ValueError("Service name not changed succesfully") class ChangeName(BasePage): def go_to_change_service_name(self, service_id): url = "{}/services/{}/service-settings/name".format(self.base_url, service_id) self.driver.get(url) def enter_new_name(self, new_name): element = self.wait_for_element(ChangeNameLocators.CHANGE_NAME_FIELD) element.clear() element.send_keys(new_name) class EmailReplyTo(BasePage): def go_to_add_email_reply_to_address(self, service_id): url = "{}/services/{}/service-settings/email-reply-to/add".format( self.base_url, service_id ) self.driver.get(url) def click_add_email_reply_to(self): element = self.wait_for_element(EmailReplyToLocators.ADD_EMAIL_REPLY_TO_BUTTON) element.click() def click_continue_button(self, time=120): element = self.wait_for_element(EmailReplyToLocators.CONTINUE_BUTTON, time=time) element.click() def insert_email_reply_to_address(self, email_address): element = self.wait_for_element(EmailReplyToLocators.EMAIL_ADDRESS_FIELD) element.send_keys(email_address) def get_reply_to_email_addresses(self): elements = self.wait_for_element(EmailReplyToLocators.REPLY_TO_ADDRESSES) return elements def go_to_edit_email_reply_to_address(self, service_id, email_reply_to_id): url = "{}/services/{}/service-settings/email-reply-to/{}/edit".format( self.base_url, service_id, email_reply_to_id ) self.driver.get(url) def check_is_default_check_box(self): radio = self.wait_for_invisible_element( EmailReplyToLocators.IS_DEFAULT_CHECKBOX ) radio.click() class SmsSenderPage(BasePage): def go_to_text_message_senders(self, service_id): url = "{}/services/{}/service-settings/sms-sender".format( self.base_url, service_id ) self.driver.get(url) def go_to_add_text_message_sender(self, service_id): url = "{}/services/{}/service-settings/sms-sender/add".format( self.base_url, service_id ) self.driver.get(url) def insert_sms_sender(self, sender): element = self.wait_for_element(SmsSenderLocators.SMS_SENDER_FIELD) element.clear() element.send_keys(sender) def click_save_sms_sender(self): element = self.wait_for_element(SmsSenderLocators.SAVE_SMS_SENDER_BUTTON) element.click() def get_sms_senders(self): elements = self.wait_for_element(SmsSenderLocators.ALL_SMS_SENDERS) return elements def click_change_link_for_first_sms_sender(self): change_link = self.wait_for_element(SmsSenderLocators.FIRST_CHANGE_LINK) change_link.click() def get_sms_sender(self): return self.wait_for_element(SmsSenderLocators.SMS_SENDER) def get_sms_recipient(self): return self.wait_for_element(SmsSenderLocators.SMS_RECIPIENT) class OrganisationDashboardPage(BasePage): h1 = (By.CSS_SELECTOR, "h1") team_members_link = (By.LINK_TEXT, "Team members") service_list = (By.CSS_SELECTOR, "main .browse-list-item") def is_current(self, org_id): expected = "{}/organisations/{}".format(self.base_url, org_id) return self.driver.current_url == expected def click_team_members_link(self): element = self.wait_for_element(DashboardPage.team_members_link) element.click() def go_to_dashboard_for_org(self, org_id): url = "{}/organisations/{}".format(self.base_url, org_id) self.driver.get(url) class InviteUserToOrgPage(BasePage): email_input = EmailInputElement() send_invitation_button = InviteUserPageLocators.SEND_INVITATION_BUTTON def fill_invitation_form(self, email): self.email_input = email def send_invitation(self): element = self.wait_for_element(self.send_invitation_button) element.click() class InboxPage(BasePage): def is_current(self, service_id): expected = "{}/services/{}/inbox".format(self.base_url, service_id) return self.driver.current_url == expected def go_to_conversation(self, user_number): # link looks like "07123 456789". because i don't know if user_number starts with +44, just get the last 10 # digits. (so this'll look for partial link text of "123 456789") formatted_phone_number = "{} {}".format(user_number[-10:-6], user_number[-6:]) element = self.wait_for_element((By.PARTIAL_LINK_TEXT, formatted_phone_number)) element.click() class ConversationPage(BasePage): sms_message = (By.CSS_SELECTOR, ".sms-message-wrapper") def get_message(self, content): elements = self.wait_for_elements(self.sms_message) return next((el for el in elements if content in el.text), None) class DocumentDownloadBasePage(BasePage): def get_errors(self): # these are diff to notify admin which has the class .banner-dangerous for its error messages error_message = (By.CSS_SELECTOR, ".govuk-error-summary") errors = self.wait_for_element(error_message) return errors.text.strip() class DocumentDownloadLandingPage(DocumentDownloadBasePage): continue_button = (By.CSS_SELECTOR, "a.govuk-button") def get_service_name(self): element = self.wait_for_element((By.CSS_SELECTOR, "main p:first-of-type")) return element.text.partition(" sent you ")[0] def go_to_download_page(self): button = self.wait_for_element(self.continue_button) button.click() class DocumentDownloadPage(DocumentDownloadBasePage): download_link = (By.PARTIAL_LINK_TEXT, "Download this ") def _get_download_link_element(self): link = self.wait_for_element(self.download_link) return link.element def click_download_link(self): return self._get_download_link_element().click() def get_download_link(self): return self._get_download_link_element().get_attribute("href") class DocumentDownloadConfirmEmailPage(DocumentDownloadBasePage): continue_button = CommonPageLocators.CONTINUE_BUTTON email_input = EmailInputElement() def input_email_address(self, email_address): self.email_input = email_address class ViewFolderPage(ShowTemplatesPage): manage_link = (By.CSS_SELECTOR, ".folder-heading-manage-link") template_path_and_name = (By.TAG_NAME, "h1") def click_manage_folder(self): link = self.wait_for_element(self.manage_link) link.click() def assert_name_equals(self, expected_name): h1 = self.wait_for_element(self.template_path_and_name) assert expected_name in h1.text class ManageFolderPage(BasePage): delete_link = (By.LINK_TEXT, "Delete this folder") name_input = NameInputElement() delete_button = (By.NAME, "delete") save_button = ( By.CSS_SELECTOR, "form button.govuk-button:not(.govuk-button--secondary)", ) def set_name(self, new_name): self.name_input = new_name button = self.wait_for_element(self.save_button) button.click() def delete_folder(self): link = self.wait_for_element(self.delete_link) link.click() def confirm_delete_folder(self): link = self.wait_for_element(self.delete_button) link.click() class BroadcastFreeformPage(BasePage): title_input = NameInputElement() content_input = TemplateContentElement() def create_broadcast_content(self, title, content): self.title_input = title self.content_input = content class GovUkAlertsPage(BasePage): def __init__(self, driver): self.gov_uk_alerts_url = config["govuk_alerts_url"] self.driver = driver def get(self): self.driver.get(self.gov_uk_alerts_url) @retry( RetryException, tries=config["govuk_alerts_wait_retry_times"], delay=config["govuk_alerts_wait_retry_interval"], ) def check_alert_is_published(self, broadcast_content): if not self.is_text_present_on_page(broadcast_content): self.driver.refresh() raise RetryException( f'Could not find alert with content "{broadcast_content}"' )
{ "content_hash": "199ac5a0f3872273a6e4652a90a90039", "timestamp": "", "source": "github", "line_count": 1156, "max_line_length": 129, "avg_line_length": 34.215397923875436, "alnum_prop": 0.6511010542815968, "repo_name": "alphagov/notifications-functional-tests", "id": "79ed556399546fa59a1deb54abc7b6f1d006333b", "size": "39553", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "tests/pages/pages.py", "mode": "33188", "license": "mit", "language": [ { "name": "Dockerfile", "bytes": "115" }, { "name": "Makefile", "bytes": "660" }, { "name": "Python", "bytes": "330773" }, { "name": "Shell", "bytes": "2237" } ] }
<?php /* Template Name: Contact */ ?> <?php while (have_posts()) : the_post(); ?> <?php get_template_part('templates/page', 'header'); ?> <?php get_template_part('templates/content', 'page'); ?> <?php endwhile; ?>
{ "content_hash": "6394f027f6677c6d0df42737f7f5e39e", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 58, "avg_line_length": 21.9, "alnum_prop": 0.6027397260273972, "repo_name": "ben-holden/sewells.com", "id": "fb443ebdb2bce2d018f11f143865f73760772095", "size": "219", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "template-contact.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "99547" }, { "name": "Gettext Catalog", "bytes": "5133" }, { "name": "HTML", "bytes": "9003" }, { "name": "JavaScript", "bytes": "154836" }, { "name": "PHP", "bytes": "98258" } ] }
package pl.touk.nussknacker.ui.security.oidc import com.typesafe.config.Config import pl.touk.nussknacker.ui.security.api.AuthenticationProvider import pl.touk.nussknacker.ui.security.oauth2.OAuth2AuthenticationResources import sttp.client.{NothingT, SttpBackend} import scala.concurrent.{ExecutionContext, Future} class OidcAuthenticationProvider extends AuthenticationProvider { import net.ceedubs.ficus.readers.ArbitraryTypeReader._ import pl.touk.nussknacker.engine.util.config.CustomFicusInstances._ import pl.touk.nussknacker.ui.security.api.AuthenticationConfiguration.authenticationConfigPath def name: String = "Oidc" override def createAuthenticationResources(config: Config, classLoader: ClassLoader)(implicit ec: ExecutionContext, sttpBackend: SttpBackend[Future, Nothing, NothingT]): OAuth2AuthenticationResources = { new OidcAuthenticationResources( name, realm, config.as[OidcAuthenticationConfiguration](authenticationConfigPath).withDiscovery ) } }
{ "content_hash": "63b131f404755020328f0cfb93760862", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 205, "avg_line_length": 38.88461538461539, "alnum_prop": 0.8189910979228486, "repo_name": "TouK/nussknacker", "id": "9d444c14df52aed2ebf6433bfcb2a46771b32d45", "size": "1011", "binary": false, "copies": "1", "ref": "refs/heads/staging", "path": "security/src/main/scala/pl/touk/nussknacker/ui/security/oidc/OidcAuthenticationProvider.scala", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "3757" }, { "name": "Dockerfile", "bytes": "597" }, { "name": "HTML", "bytes": "3573" }, { "name": "Java", "bytes": "240995" }, { "name": "JavaScript", "bytes": "189903" }, { "name": "PLSQL", "bytes": "269" }, { "name": "Scala", "bytes": "5323010" }, { "name": "Shell", "bytes": "42521" }, { "name": "Stylus", "bytes": "60452" }, { "name": "TypeScript", "bytes": "991644" } ] }
using System; using FluentAssertions; using Paramore.Brighter.MessagingGateway.RMQ; using Xunit; namespace Paramore.Brighter.RMQ.Tests.MessagingGateway { public class RmqAssumeExistingInfrastructureTests : IDisposable { private readonly IAmAMessageProducerSync _messageProducer; private readonly IAmAMessageConsumer _messageConsumer; private readonly Message _message; public RmqAssumeExistingInfrastructureTests() { _message = new Message( new MessageHeader(Guid.NewGuid(), Guid.NewGuid().ToString(), MessageType.MT_COMMAND), new MessageBody("test content")); var rmqConnection = new RmqMessagingGatewayConnection { AmpqUri = new AmqpUriSpecification(new Uri("amqp://guest:guest@localhost:5672/%2f")), Exchange = new Exchange(Guid.NewGuid().ToString()) }; _messageProducer = new RmqMessageProducer(rmqConnection, new RmqPublication{MakeChannels = OnMissingChannel.Assume}); _messageConsumer = new RmqMessageConsumer( connection:rmqConnection, queueName:_message.Header.Topic, routingKey:_message.Header.Topic, isDurable: false, highAvailability:false, makeChannels: OnMissingChannel.Assume); //This creates the infrastructure we want new QueueFactory(rmqConnection, _message.Header.Topic).Create(3000); } [Fact] public void When_infrastructure_exists_can_assume_producer() { var exceptionThrown = false; try { //As we validate and don't create, this would throw due to lack of infrastructure if not already created _messageProducer.Send(_message); _messageConsumer.Receive(10000); } catch (ChannelFailureException) { exceptionThrown = true; } exceptionThrown.Should().BeFalse(); } public void Dispose() { _messageProducer.Dispose(); _messageConsumer.Dispose(); } } }
{ "content_hash": "c3a41e52b06a9d3945517cc5d59da703", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 129, "avg_line_length": 34.87692307692308, "alnum_prop": 0.5941773268636965, "repo_name": "BrighterCommand/Brighter", "id": "3497dc0adc96349777eb7241ff2edde5f1da5b3e", "size": "2269", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tests/Paramore.Brighter.RMQ.Tests/MessagingGateway/When_infrastructure_exists_can_assert.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "3203209" }, { "name": "Dockerfile", "bytes": "553" }, { "name": "HTML", "bytes": "10992506" }, { "name": "PowerShell", "bytes": "7471" }, { "name": "Shell", "bytes": "3732" }, { "name": "TSQL", "bytes": "2957" } ] }
ghch ======= [![Test Status](https://github.com/Songmu/ghch/workflows/test/badge.svg?branch=main)][actions] [![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)][license] [![PkgGoDev](https://pkg.go.dev/badge/github.com/Songmu/ghch)](https://pkg.go.dev/github.com/Songmu/ghch) [actions]: https://github.com/Songmu/ghch/actions?workflow=test [coveralls]: https://coveralls.io/r/Songmu/ghch?branch=main [license]: https://github.com/Songmu/ghch/blob/main/LICENSE [pkggodev]: https://pkg.go.dev/github.com/Songmu/ghch ## Description Generate changelog from git history, tags and merged pull requests ## Installation % go install github.com/Songmu/ghch/cmd/ghch@latest ## Synopsis % ghch -r /path/to/repo [--format markdown] ## Options ``` -r, --repo= git repository path (default: .) -f, --from= git commit revision range start from -t, --to= git commit revision range end to --latest output changes between latest two semantic versioned tags -v, --verbose -F, --format= json or markdown (default: json) -A, --all output all changes -N, --next-version= -g, --git= git path (default: git) --token= github token --remote= default remote name (default: origin) ``` ## GITHUB Token When github's api token is required in private repository etc., it is used in the following order of priority. - command line option `--token` - enviroment variable `GITHUB_TOKEN` - `git config github.token` ## GitHub Enterprise You can use `ghch` for GitHub Enterprise. Change API endpoint via the enviromental variable. $ export GITHUB_API=http://github.company.com/api/v3 ## Requirements git 1.8.5 or newer is required. ## Examples ### display changes from last versioned tag % ghch { "pull_requests": [ { "html_url": "https://github.com/mackerelio/mackerel-agent/pull/221", "title": "Fix typo", "number": 221, "state": "closed", "user": { "login": "yukiyan", "avatar_url": "https://avatars.githubusercontent.com/u/7304122?v=3", "type": "User" }, "body": "Just fixing a typo 😄 ", "created_at": "2016-04-19T08:27:30Z", "updated_at": "2016-04-25T01:51:15Z", "merged_at": "2016-04-25T01:51:11Z", ... "merged_by": { "login": "stefafafan", "avatar_url": "https://avatars.githubusercontent.com/u/3520520?v=3", "type": "User" } }, ... ], "from_revision": "v0.30.2", "to_revision": "", "changed_at": "2016-04-27T19:05:49+09:00", "owner": "mackerelio", "repo": "mackerel-agent" } ### display changes from last versioned tag in markdown % ghch --format=markdown --next-version=v0.30.3 ## [v0.30.3](https://github.com/mackerelio/mackerel-agent/releases/tag/v0.30.3) (2016-04-27) * retry retirement when api request failed [#224](https://github.com/mackerelio/mackerel-agent/pull/224) ([Songmu](https://github.com/Songmu)) * Fix comments [#222](https://github.com/mackerelio/mackerel-agent/pull/222) ([stefafafan](https://github.com/stefafafan)) * Remove go get cmd/vet [#223](https://github.com/mackerelio/mackerel-agent/pull/223) ([itchyny](https://github.com/itchyny)) * [nit] [plugin.checks.foo ] is valid toml now [#225](https://github.com/mackerelio/mackerel-agent/pull/225) ([Songmu](https://github.com/Songmu)) * Remove usr local bin again [#217](https://github.com/mackerelio/mackerel-agent/pull/217) ([Songmu](https://github.com/Songmu)) * Fix typo [#221](https://github.com/mackerelio/mackerel-agent/pull/221) ([yukiyan](https://github.com/yukiyan)) ### display changes between two tags semantic versioned in markdown % ghch -F markdown --latest ## [v0.2.0](https://github.com/Songmu/ghch/compare/v0.1.3...v0.2.0) (2018-01-01) * introduce goxz for releasing and drop goxc dependency [#17](https://github.com/Songmu/ghch/pull/17) ([Songmu](https://github.com/Songmu)) * add --latest option for output changes between latest two semantic versioned tags [#16](https://github.com/Songmu/ghch/pull/16) ([Songmu](https://github.com/Songmu)) * fill oldest commit hash when from ref is empty [#15](https://github.com/Songmu/ghch/pull/15) ([Songmu](https://github.com/Songmu)) ### display all changes % ghch --format=markdown --next-version=v0.30.3 --all ... ### display changes between specified two revisions % ghch --from v0.9.0 --to v0.9.1 ... ## Author [Songmu](https://github.com/Songmu)
{ "content_hash": "42407e671a606491ba0d3f12e286a854", "timestamp": "", "source": "github", "line_count": 129, "max_line_length": 171, "avg_line_length": 36.25581395348837, "alnum_prop": 0.6401539448364336, "repo_name": "Songmu/ghch", "id": "a27c7a1a494ceca6717959a055dcc56941a22416", "size": "4680", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "Go", "bytes": "44110" }, { "name": "Makefile", "bytes": "1009" } ] }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Rybird.Framework { public class NavigationCommand<TViewModel> : DelegateCommand where TViewModel : FrameworkPageViewModel { public NavigationCommand(INavigationProvider navigation) : base(() => navigation.NavigateAsync<TViewModel>()) { } } }
{ "content_hash": "e5f17cec70945300199a31bef85e21b3", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 68, "avg_line_length": 28.6, "alnum_prop": 0.6946386946386947, "repo_name": "ryanhorath/Rybird.Framework", "id": "60815b20b4216d58a876b6fc02a77b19dc93aeb7", "size": "431", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Core/Framework/Commands/NavigationCommand.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "445256" }, { "name": "Smalltalk", "bytes": "7" } ] }
package net.myanmarhub.collabra.provider; import android.app.Service; import android.content.Intent; import android.os.IBinder; /** * Tin Htoo Aung (Myanmar Hub) on 24/10/13. */ public class AuthenticatorService extends Service { // Instance field that stores the authenticator object private Authenticator mAuthenticator; @Override public void onCreate() { // Create a new authenticator object mAuthenticator = new Authenticator(this); } /* * When the system binds to this Service to make the RPC call * return the authenticator's IBinder. */ @Override public IBinder onBind(Intent intent) { return mAuthenticator.getIBinder(); } }
{ "content_hash": "021974999f88f675f3fe7752aa4db1b2", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 65, "avg_line_length": 24.655172413793103, "alnum_prop": 0.6923076923076923, "repo_name": "Myanmar-Hub/collabra-devcon", "id": "609141c13dbffc44cd40e6195649b9f5bcac4c60", "size": "715", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Collabra/src/main/java/net/myanmarhub/collabra/provider/AuthenticatorService.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "10478" }, { "name": "Groovy", "bytes": "1434" }, { "name": "Java", "bytes": "202900" }, { "name": "Shell", "bytes": "7394" } ] }
from . import keops from .additive_structure_kernel import AdditiveStructureKernel from .arc_kernel import ArcKernel from .cosine_kernel import CosineKernel from .cylindrical_kernel import CylindricalKernel from .distributional_input_kernel import DistributionalInputKernel from .gaussian_symmetrized_kl_kernel import GaussianSymmetrizedKLKernel from .grid_interpolation_kernel import GridInterpolationKernel from .grid_kernel import GridKernel from .index_kernel import IndexKernel from .inducing_point_kernel import InducingPointKernel from .kernel import AdditiveKernel, Kernel, ProductKernel from .lcm_kernel import LCMKernel from .linear_kernel import LinearKernel from .matern_kernel import MaternKernel from .multi_device_kernel import MultiDeviceKernel from .multitask_kernel import MultitaskKernel from .newton_girard_additive_kernel import NewtonGirardAdditiveKernel from .periodic_kernel import PeriodicKernel from .polynomial_kernel import PolynomialKernel from .polynomial_kernel_grad import PolynomialKernelGrad from .product_structure_kernel import ProductStructureKernel from .rbf_kernel import RBFKernel from .rbf_kernel_grad import RBFKernelGrad from .rff_kernel import RFFKernel from .rq_kernel import RQKernel from .scale_kernel import ScaleKernel from .spectral_delta_kernel import SpectralDeltaKernel from .spectral_mixture_kernel import SpectralMixtureKernel __all__ = [ "keops", "Kernel", "ArcKernel", "AdditiveKernel", "AdditiveStructureKernel", "CylindricalKernel", "MultiDeviceKernel", "CosineKernel", "DistributionalInputKernel", "GaussianSymmetrizedKLKernel", "GridKernel", "GridInterpolationKernel", "IndexKernel", "InducingPointKernel", "LCMKernel", "LinearKernel", "MaternKernel", "MultitaskKernel", "NewtonGirardAdditiveKernel", "PeriodicKernel", "PolynomialKernel", "PolynomialKernelGrad", "ProductKernel", "ProductStructureKernel", "RBFKernel", "RFFKernel", "RBFKernelGrad", "RQKernel", "ScaleKernel", "SpectralDeltaKernel", "SpectralMixtureKernel", ]
{ "content_hash": "feb272b8336e215429b99d967db108d6", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 71, "avg_line_length": 33.523809523809526, "alnum_prop": 0.7869318181818182, "repo_name": "jrg365/gpytorch", "id": "e0af721e3b719c2e41dba8de48ebb513d2e75e96", "size": "2135", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "gpytorch/kernels/__init__.py", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "6005" }, { "name": "C++", "bytes": "242" }, { "name": "Python", "bytes": "338860" } ] }
<?php class NotificationConfigurationValueQuery extends PluginNotificationConfigurationValueQuery { }
{ "content_hash": "cff061f1dad8b800f675af3c14b20370", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 91, "avg_line_length": 17.333333333333332, "alnum_prop": 0.875, "repo_name": "havvg/sfNotificationsPlugin", "id": "e4bc59fcb5e2a2e8917ebba218d4d215137bfa97", "size": "104", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/model/NotificationConfigurationValueQuery.php", "mode": "33188", "license": "mit", "language": [ { "name": "PHP", "bytes": "37061" } ] }
% Test bench script for 'myEchoPlugin'. % Generated by Audio Test Bench on 30-Mar-2019 09:00:24 +0100. % Create test bench input and output fileReader = dsp.AudioFileReader('Filename','SoftGuitar-44p1_mono-10mins.ogg', ... 'PlayCount',1, ... 'SamplesPerFrame',512); deviceWriter = audioDeviceWriter('Device','Default', ... 'SampleRate',fileReader.SampleRate); % Create scopes timeScope = dsp.TimeScope('SampleRate',44100, ... 'TimeSpan',1, ... 'TimeSpanOverrunAction','Scroll', ... 'AxesScaling','Manual', ... 'BufferLength',176400, ... 'ShowLegend',true, ... 'ChannelNames',{'Input channel 1','Output channel 1'}, ... 'ShowGrid',true, ... 'YLimits',[-1 1]); specScope = dsp.SpectrumAnalyzer('SampleRate',44100, ... 'PlotAsTwoSidedSpectrum',false, ... 'FrequencyScale','Log', ... 'ShowLegend',true, ... 'ChannelNames',{'Input channel 1','Output channel 1'}, ... 'YLimits',[-215.8713145430647 33.544187563831926]); % Set up the system under test sut = myEchoPlugin; setSampleRate(sut,fileReader.SampleRate); sut.Gain = 1.48747; % Open parameterTuner for interactive tuning during simulation tuner = parameterTuner(sut); % Stream processing loop nUnderruns = 0; while ~isDone(fileReader) % Read from input, process, and write to output in = fileReader(); in = repmat(in,1,2); out = process(sut,in); nUnderruns = nUnderruns + deviceWriter(out); % Visualize input and ouput data in scopes timeScope([in(:,1),out(:,1)]); specScope([in(:,1),out(:,1)]); % Process parameterTuner callbacks drawnow limitrate end % Clean up release(fileReader) release(deviceWriter) release(timeScope) release(specScope)
{ "content_hash": "3aed14333a944ab562da6cf18cfe1b96", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 82, "avg_line_length": 29.10169491525424, "alnum_prop": 0.6732673267326733, "repo_name": "cerkut/wpAudioPlugin", "id": "e7d624d63cb8f7fe13b24c668bfb25f0569b993d", "size": "1717", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "01-Basics/myEchoTestBenchScript.m", "mode": "33188", "license": "mit", "language": [ { "name": "MATLAB", "bytes": "29456" } ] }
/* * pwm_17xx_40xx.h * * Created on: Apr 17, 2014 * Author: Özen Özkaya */ #ifndef PWM_17XX_40XX_H_ #define PWM_17XX_40XX_H_ #ifdef __cplusplus extern "C" { #endif #include "core_cm3.h" typedef struct { /*!< TIMERn Structure */ __IO uint32_t IR; /*!< Interrupt Register. The IR can be written to clear interrupts. The IR can be read to identify which of eight possible interrupt sources are pending. */ __IO uint32_t TCR; /*!< Timer Control Register. The TCR is used to control the Timer Counter functions. The Timer Counter can be disabled or reset through the TCR. */ __IO uint32_t TC; /*!< Timer Counter. The 32 bit TC is incremented every PR+1 cycles of PCLK. The TC is controlled through the TCR. */ __IO uint32_t PR; /*!< Prescale Register. The Prescale Counter (below) is equal to this value, the next clock increments the TC and clears the PC. */ __IO uint32_t PC; /*!< Prescale Counter. The 32 bit PC is a counter which is incremented to the value stored in PR. When the value in PR is reached, the TC is incremented and the PC is cleared. The PC is observable and controllable through the bus interface. */ __IO uint32_t MCR; /*!< Match Control Register. The MCR is used to control if an interrupt is generated and if the TC is reset when a Match occurs. */ __IO uint32_t MR0; /*!< Match Register. MR can be enabled through the MCR to reset the TC, stop both the TC and PC, and/or generate an interrupt every time MR matches the TC. */ __IO uint32_t MR1; /*!< Match Register. MR can be enabled through the MCR to reset the TC, stop both the TC and PC, and/or generate an interrupt every time MR matches the TC. */ __IO uint32_t MR2; /*!< Match Register. MR can be enabled through the MCR to reset the TC, stop both the TC and PC, and/or generate an interrupt every time MR matches the TC. */ __IO uint32_t MR3; /*!< Match Register. MR can be enabled through the MCR to reset the TC, stop both the TC and PC, and/or generate an interrupt every time MR matches the TC. */ __IO uint32_t CCR; /*!< Capture Control Register. The CCR controls which edges of the capture inputs are used to load the Capture Registers and whether or not an interrupt is generated when a capture takes place. */ __IO uint32_t CR[3]; /*!< Capture Register. CR is loaded with the value of TC when there is an event on the CAPn.0 input. */ __IO uint32_t RESERVED0[2]; __IO uint32_t MR4; /*!< Match Register. MR can be enabled through the MCR to reset the TC, stop both the TC and PC, and/or generate an interrupt every time MR matches the TC. */ __IO uint32_t MR5; /*!< Match Register. MR can be enabled through the MCR to reset the TC, stop both the TC and PC, and/or generate an interrupt every time MR matches the TC. */ __IO uint32_t MR6; /*!< Match Register. MR can be enabled through the MCR to reset the TC, stop both the TC and PC, and/or generate an interrupt every time MR matches the TC. */ __IO uint32_t PCR; __IO uint32_t LER; __IO uint32_t RESERVED1[7]; __IO uint32_t CTCR; } LPC_PWM_T; /** Macro to clear interrupt pending */ #define PWM_IR_CLR(n) _BIT(n) /** Macro for getting a timer match interrupt bit */ #define PWM_MATCH_INT(n) (_BIT((n) & 0x0F)) /** Macro for getting a capture event interrupt bit */ #define PWM_CAP_INT(n) (_BIT((((n) & 0x0F) + 4))) /** Timer/counter enable bit */ #define PWM_TIM_ENABLE ((uint32_t) (1 << 0)) /** Timer/counter reset bit */ #define PWM_TIM_RESET ((uint32_t) (1 << 1)) /** Timer/counter enable bit */ #define PWM_ENABLE ((uint32_t) (1 << 3)) /** Timer/counter reset bit */ #define PWM_RESET ((uint32_t) (1 << 3)) /** Bit location for interrupt on MRx match, n = 0 to 3 */ #define PWM_INT_ON_MATCH(n) (_BIT(((n) * 3))) /** Bit location for reset on MRx match, n = 0 to 3 */ #define PWM_RESET_ON_MATCH(n) (_BIT((((n) * 3) + 1))) /** Bit location for stop on MRx match, n = 0 to 3 */ #define PWM_STOP_ON_MATCH(n) (_BIT((((n) * 3) + 2))) /** Bit location for CAP.n on CRx rising edge, n = 0 to 3 */ #define PWM_CAP_RISING(n) (_BIT(((n) * 3))) /** Bit location for CAP.n on CRx falling edge, n = 0 to 3 */ #define PWM_CAP_FALLING(n) (_BIT((((n) * 3) + 1))) /** Bit location for CAP.n on CRx interrupt enable, n = 0 to 3 */ #define PWM_INT_ON_CAP(n) (_BIT((((n) * 3) + 2))) #define PWM_APPEND_MR_MATCH(x) (pTMR->MR##x) typedef enum { PWM_SINGLE_EDGE_CONTROL_MODE=0, PWM_DOUBLE_EDGE_CONTROL_MODE=1, }PWM_EDGE_CONTROL_MODE; typedef enum { PWM_OUT_DISABLED=0, PWM_OUT_ENABLED=1, }PWM_OUT_CMD; /** * @brief Initialize a pwm * @param pTMR : Pointer to pwm IP register address * @return Nothing */ void Chip_PWM_Init(LPC_PWM_T *pTMR); /** * @brief Shutdown a pwm * @param pTMR : Pointer to pwm IP register address * @return Nothing */ void Chip_PWM_DeInit(LPC_PWM_T *pTMR); /** * @brief Determine if a match interrupt is pending * @param pTMR : Pointer to pwm IP register address * @param matchnum : Match interrupt number to check * @return false if the interrupt is not pending, otherwise true * @note Determine if the match interrupt for the passed timer and match * counter is pending. */ STATIC INLINE bool Chip_PWM_MatchPending(LPC_PWM_T *pTMR, int8_t matchnum) { return (bool) ((pTMR->IR & PWM_MATCH_INT(matchnum)) != 0); } /** * @brief Determine if a capture interrupt is pending * @param pTMR : Pointer to pwm IP register address * @param capnum : Capture interrupt number to check * @return false if the interrupt is not pending, otherwise true * @note Determine if the capture interrupt for the passed capture pin is * pending. */ STATIC INLINE bool Chip_PWM_CapturePending(LPC_PWM_T *pTMR, int8_t capnum) { return (bool) ((pTMR->IR & PWM_CAP_INT(capnum)) != 0); } /** * @brief Clears a (pending) match interrupt * @param pTMR : Pointer to pwm IP register address * @param matchnum : Match interrupt number to clear * @return Nothing * @note Clears a pending timer match interrupt. */ STATIC INLINE void Chip_PWM_ClearMatch(LPC_PWM_T *pTMR, int8_t matchnum) { pTMR->IR = PWM_IR_CLR(matchnum); } /** * @brief Clears a (pending) capture interrupt * @param pTMR : Pointer to pwm IP register address * @param capnum : Capture interrupt number to clear * @return Nothing * @note Clears a pending timer capture interrupt. */ STATIC INLINE void Chip_PWM_ClearCapture(LPC_PWM_T *pTMR, int8_t capnum) { pTMR->IR = (0x10 << capnum); } /** * @brief Enables the timer (starts count) * @param pTMR : Pointer to timer IP register address * @return Nothing * @note Enables the timer to start counting. */ STATIC INLINE void Chip_PWM_Enable(LPC_PWM_T *pTMR) { pTMR->TCR |= PWM_TIM_ENABLE; pTMR->TCR |= PWM_ENABLE; } /** * @brief Disables the timer (stops count) * @param pTMR : Pointer to timer IP register address * @return Nothing * @note Disables the timer to stop counting. */ STATIC INLINE void Chip_PWM_Disable(LPC_PWM_T *pTMR) { pTMR->TCR &= ~PWM_ENABLE; pTMR->TCR &=~PWM_TIM_ENABLE; } /** * @brief Returns the current timer count * @param pTMR : Pointer to timer IP register address * @return Current timer terminal count value * @note Returns the current timer terminal count. */ STATIC INLINE uint32_t Chip_PWM_ReadCount(LPC_PWM_T *pTMR) { return pTMR->TC; } /** * @brief Returns the current prescale count * @param pTMR : Pointer to pwm IP register address * @return Current timer prescale count value * @note Returns the current prescale count. */ STATIC INLINE uint32_t Chip_PWM_ReadPrescale(LPC_PWM_T *pTMR) { return pTMR->PC; } /** * @brief Sets the prescaler value * @param pTMR : Pointer to pwm IP register address * @param prescale : Prescale value to set the prescale register to * @return Nothing * @note Sets the prescale count value. */ STATIC INLINE void Chip_PWM_PrescaleSet(LPC_PWM_T *pTMR, uint32_t prescale) { pTMR->PR = prescale; } /** * @brief Sets a timer match value * @param pTMR : Pointer to timer IP register address * @param matchnum : Match timer to set match count for * @param matchval : Match value for the selected match count * @return Nothing * @note Sets one of the timer match values. */ STATIC INLINE void Chip_PWM_SetMatch(LPC_PWM_T *pTMR, int8_t matchnum, uint32_t matchval) { // pTMR->MR[matchnum] = matchval; switch (matchnum) { case 0: pTMR->MR0=matchval; break; case 1: pTMR->MR1=matchval; break; case 2: pTMR->MR2=matchval; break; case 3: pTMR->MR3=matchval; break; case 4: pTMR->MR4=matchval; break; case 5: pTMR->MR5=matchval; break; case 6: pTMR->MR6=matchval; break; default: break; } // PWM_APPEND_MR_MATCH(matchnum) =matchval; } /** * @brief Reads a capture register * @param pTMR : Pointer to timer IP register address * @param capnum : Capture register to read * @return The selected capture register value * @note Returns the selected capture register value. */ STATIC INLINE uint32_t Chip_PWM_ReadCapture(LPC_PWM_T *pTMR, int8_t capnum) { return pTMR->CR[capnum]; } /** * @brief Resets the timer terminal and prescale counts to 0 * @param pTMR : Pointer to timer IP register address * @return Nothing */ void Chip_PWM_Reset(LPC_PWM_T *pTMR); /** * @brief Enables a match interrupt that fires when the terminal count * matches the match counter value. * @param pTMR : Pointer to timer IP register address * @param matchnum : Match timer, 0 to 3 * @return Nothing */ STATIC INLINE void Chip_PWM_MatchEnableInt(LPC_PWM_T *pTMR, int8_t matchnum) { pTMR->MCR |= PWM_INT_ON_MATCH(matchnum); } /** * @brief Disables a match interrupt for a match counter. * @param pTMR : Pointer to timer IP register address * @param matchnum : Match timer, 0 to 3 * @return Nothing */ STATIC INLINE void Chip_PWM_MatchDisableInt(LPC_PWM_T *pTMR, int8_t matchnum) { pTMR->MCR &= ~PWM_INT_ON_MATCH(matchnum); } /** * @brief For the specific match counter, enables reset of the terminal count register when a match occurs * @param pTMR : Pointer to timer IP register address * @param matchnum : Match timer, 0 to 3 * @return Nothing */ STATIC INLINE void Chip_PWM_ResetOnMatchEnable(LPC_PWM_T *pTMR, int8_t matchnum) { pTMR->MCR |= PWM_RESET_ON_MATCH(matchnum); } /** * @brief For the specific match counter, disables reset of the terminal count register when a match occurs * @param pTMR : Pointer to timer IP register address * @param matchnum : Match timer, 0 to 3 * @return Nothing */ STATIC INLINE void Chip_PWM_ResetOnMatchDisable(LPC_PWM_T *pTMR, int8_t matchnum) { pTMR->MCR &= ~PWM_RESET_ON_MATCH(matchnum); } /** * @brief Enable a match timer to stop the terminal count when a * match count equals the terminal count. * @param pTMR : Pointer to timer IP register address * @param matchnum : Match timer, 0 to 3 * @return Nothing */ STATIC INLINE void Chip_PWM_StopOnMatchEnable(LPC_PWM_T *pTMR, int8_t matchnum) { pTMR->MCR |= PWM_STOP_ON_MATCH(matchnum); } /** * @brief Disable stop on match for a match timer. Disables a match timer * to stop the terminal count when a match count equals the terminal count. * @param pTMR : Pointer to timer IP register address * @param matchnum : Match timer, 0 to 3 * @return Nothing */ STATIC INLINE void Chip_PWM_StopOnMatchDisable(LPC_PWM_T *pTMR, int8_t matchnum) { pTMR->MCR &= ~PWM_STOP_ON_MATCH(matchnum); } /** * @brief Enables capture on on rising edge of selected CAP signal for the * selected capture register, enables the selected CAPn.capnum signal to load * the capture register with the terminal coount on a rising edge. * @param pTMR : Pointer to timer IP register address * @param capnum : Capture signal/register to use * @return Nothing */ STATIC INLINE void Chip_PWM_CaptureRisingEdgeEnable(LPC_PWM_T *pTMR, int8_t capnum) { pTMR->CCR |= PWM_CAP_RISING(capnum); } /** * @brief Disables capture on on rising edge of selected CAP signal. For the * selected capture register, disables the selected CAPn.capnum signal to load * the capture register with the terminal coount on a rising edge. * @param pTMR : Pointer to timer IP register address * @param capnum : Capture signal/register to use * @return Nothing */ STATIC INLINE void Chip_PWM_CaptureRisingEdgeDisable(LPC_PWM_T *pTMR, int8_t capnum) { pTMR->CCR &= ~PWM_CAP_RISING(capnum); } /** * @brief Enables capture on on falling edge of selected CAP signal. For the * selected capture register, enables the selected CAPn.capnum signal to load * the capture register with the terminal coount on a falling edge. * @param pTMR : Pointer to timer IP register address * @param capnum : Capture signal/register to use * @return Nothing */ STATIC INLINE void Chip_PWM_CaptureFallingEdgeEnable(LPC_PWM_T *pTMR, int8_t capnum) { pTMR->CCR |= PWM_CAP_FALLING(capnum); } /** * @brief Disables capture on on falling edge of selected CAP signal. For the * selected capture register, disables the selected CAPn.capnum signal to load * the capture register with the terminal coount on a falling edge. * @param pTMR : Pointer to timer IP register address * @param capnum : Capture signal/register to use * @return Nothing */ STATIC INLINE void Chip_PWM_CaptureFallingEdgeDisable(LPC_PWM_T *pTMR, int8_t capnum) { pTMR->CCR &= ~PWM_CAP_FALLING(capnum); } /** * @brief Enables interrupt on capture of selected CAP signal. For the * selected capture register, an interrupt will be generated when the enabled * rising or falling edge on CAPn.capnum is detected. * @param pTMR : Pointer to timer IP register address * @param capnum : Capture signal/register to use * @return Nothing */ STATIC INLINE void Chip_PWM_CaptureEnableInt(LPC_PWM_T *pTMR, int8_t capnum) { pTMR->CCR |= PWM_INT_ON_CAP(capnum); } /** * @brief Disables interrupt on capture of selected CAP signal * @param pTMR : Pointer to timer IP register address * @param capnum : Capture signal/register to use * @return Nothing */ STATIC INLINE void Chip_PWM_CaptureDisableInt(LPC_PWM_T *pTMR, int8_t capnum) { pTMR->CCR &= ~PWM_INT_ON_CAP(capnum); } /** * @brief Standard timer initial match pin state and change state */ typedef enum IP_PWM_PIN_MATCH_STATE { PWM_EXTMATCH_DO_NOTHING = 0, /*!< Timer match state does nothing on match pin */ PWM_EXTMATCH_CLEAR = 1, /*!< Timer match state sets match pin low */ PWM_EXTMATCH_SET = 2, /*!< Timer match state sets match pin high */ PWM_EXTMATCH_TOGGLE = 3 /*!< Timer match state toggles match pin */ } PWM_PIN_MATCH_STATE_T; /** * @brief Sets external match control (MATn.matchnum) pin control. For the pin * selected with matchnum, sets the function of the pin that occurs on * a terminal count match for the match count. * @param pTMR : Pointer to timer IP register address * @param initial_state : Initial state of the pin, high(1) or low(0) * @param matchState : Selects the match state for the pin * @param matchnum : MATn.matchnum signal to use * @return Nothing * @note For the pin selected with matchnum, sets the function of the pin that occurs on * a terminal count match for the match count. */ void Chip_PWM_ExtMatchControlSet(LPC_PWM_T *pTMR, int8_t initial_state, PWM_PIN_MATCH_STATE_T matchState, int8_t matchnum); /** * @brief Standard timer clock and edge for count source */ typedef enum IP_PWM_CAP_SRC_STATE { PWM_CAPSRC_RISING_PCLK = 0, /*!< Timer ticks on PCLK rising edge */ PWM_CAPSRC_RISING_CAPN = 1, /*!< Timer ticks on CAPn.x rising edge */ PWM_CAPSRC_FALLING_CAPN = 2, /*!< Timer ticks on CAPn.x falling edge */ PWM_CAPSRC_BOTH_CAPN = 3 /*!< Timer ticks on CAPn.x both edges */ } PWM_CAP_SRC_STATE_T; /** * @brief Sets timer count source and edge with the selected passed from CapSrc. * If CapSrc selected a CAPn pin, select the specific CAPn pin with the capnum value. * @param pTMR : Pointer to timer IP register address * @param capSrc : timer clock source and edge * @param capnum : CAPn.capnum pin to use (if used) * @return Nothing * @note If CapSrc selected a CAPn pin, select the specific CAPn pin with the capnum value. */ STATIC INLINE void Chip_PWM_SetCountClockSrc(LPC_PWM_T *pTMR,PWM_CAP_SRC_STATE_T capSrc,int8_t capnum) { pTMR->CTCR = (uint32_t) capSrc | ((uint32_t) capnum) << 2; } void Chip_PWM_SetControlMode(LPC_PWM_T *pTMR, uint8_t pwmChannel,PWM_EDGE_CONTROL_MODE pwmEdgeMode, PWM_OUT_CMD pwmCmd ); void Chip_PWM_LatchEnable(LPC_PWM_T *pTMR, uint8_t pwmChannel); #ifdef __cplusplus } #endif #endif /* PWM_17XX_40XX_H_ */
{ "content_hash": "af46c58facfde33e96ccd914a45d3be9", "timestamp": "", "source": "github", "line_count": 505, "max_line_length": 283, "avg_line_length": 37.855445544554456, "alnum_prop": 0.6049589370717162, "repo_name": "m4v/Proyecto-final", "id": "47134b9fb51be50b68c779290c4387e55c0b8334", "size": "19123", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "firmware/lpc_chip_175x_6x/inc/pwm_17xx_40xx.h", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "1341822" }, { "name": "C++", "bytes": "81650" }, { "name": "Gnuplot", "bytes": "31763" }, { "name": "KiCad", "bytes": "266714" }, { "name": "Matlab", "bytes": "11801" } ] }
import React, { Component } from 'react'; import BodyClassName from 'react-body-classname'; import { Redirect } from 'react-router-dom'; import { Field, reduxForm } from 'redux-form'; import logo from '../images/eo-logo.png'; class LoginForm extends Component { constructor(props){ super(props); this.state = { loginSuccess: false, loginFailure: false }; this.authenticate = this.authenticate.bind(this); } authenticate(formData) { fetch("/login", { headers: { 'Accept': 'application/json', 'Content-Type': 'application/json' }, method: 'POST', body: JSON.stringify(formData) }) .then((res)=> { return res.json(); }) .then((login) => { if(login.success){ localStorage.setItem("token", login.token); this.setState({ loginSuccess: true, }); } else { this.setState({ loginFailure: true }) } }) }; render() { const { handleSubmit, pristine, submitting } = this.props; return ( <BodyClassName className="login-page"> <div className="login-form"> <div className="logo-wrapper"> <img src={logo} alt="Employment Options"/> </div> <form className="form-horizontal" onSubmit={handleSubmit(this.authenticate)}> <div className="form-group"> <label className="col-sm-2 control-label">Username: </label> <div className="col-sm-6"> <Field type="text" component="input" name="username" className="form-control col-sm-10"/> </div> </div> <div className="form-group"> <label className="col-sm-2 control-label">Password: </label> <div className="col-sm-6"> <Field type="password" component="input" name="password" className="form-control"/> </div> </div> <div className="button-wrapper"> <button className="btn btn-default" type="submit" disabled={pristine || submitting}>Submit </button> </div> </form> {this.state.loginSuccess && <Redirect to="/clients" push />} {this.state.loginFailure && <Redirect to="/" />} </div> </BodyClassName> ) } } export default reduxForm({form: 'login'})(LoginForm);
{ "content_hash": "fd019f9ff7a656807fc9cd452b8ead8c", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 97, "avg_line_length": 25.976744186046513, "alnum_prop": 0.5962399283795882, "repo_name": "teamcrux/EmploymentOptions", "id": "d6d65018a7f6c297dcf26dc470af63c5fe4073e3", "size": "2234", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "client/src/Components/LoginForm.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "16732" }, { "name": "HTML", "bytes": "1441" }, { "name": "JavaScript", "bytes": "266913" } ] }
import numpy as np from rl.memory.linear import LinearMemory from rl.util import log_self import math class HighLowMemory(LinearMemory): ''' Memory divided into two: good and bad experiences As with RankedMemory experiences are grouped episodically Episodes with a total reward > threshold are assigned to good memory The threshold is recomputed every n episodes and episodes are reassigned accordingly. Memories are sampled from good experiences with a self.prob_high Memories are sampled from bad experiences with a 1 - self.prob_high Experiences are sampled from a maximum of 3 randomly selected episodes, per minibatch for each of the high and low memories TODO improvement: do a more natural continuous range to sort high low by self.epi_memory.sort(key=lambda epi_exp: epi_exp['total_rewards']) ''' # absorb generic param without breaking def __init__(self, env_spec, **kwargs): super(HighLowMemory, self).__init__(env_spec) # use the old self.exp as buffer, remember to clear self.last_exp = self.exp self.epi_memory_high = [] self.epi_memory_low = [] self.max_reward = -math.inf self.min_reward = math.inf # 1st 5 epis goes into bad half, recompute every 5 epis self.threshold = math.inf self.threshold_history = [] self.epi_num = 0 self.prob_high = 0.66 self.num_epis_to_sample = 3 self.max_epis_in_mem = 15 self.recompute_freq = 10 log_self(self) def reassign_episodes(self): new_high, new_low = [] for mem in (self.epi_memory_high, self.epi_memory_low): for epi_exp in mem: if (epi_exp['total_rewards'] > self.threshold): new_high.append(epi_exp) else: new_low.append(epi_exp) self.epi_memory_high = new_high self.epi_memory_low = new_low def compute_threshold(self): self.threshold_history.append([self.threshold, self.max_reward, self.min_reward]) if (len(self.threshold_history) > 1): # Scaled because this threshold seems too severe based on trial # runs self.threshold = \ max(self.threshold, (self.max_reward + self.min_reward) / 2.0 * 0.75) else: self.threshold = (self.max_reward + self.min_reward) / 2.0 * 0.75 self.reassign_episodes() self.max_reward = -math.inf self.min_reward = math.inf def add_exp(self, action, reward, next_state, terminal): super(HighLowMemory, self).add_exp( action, reward, next_state, terminal) if terminal: epi_exp = { 'exp': self.exp, 'total_rewards': np.sum(self.exp['rewards']), 'epi_num': self.epi_num } if (epi_exp['total_rewards'] <= self.threshold): self.epi_memory_low.append(epi_exp) else: self.epi_memory_high.append(epi_exp) if (self.epi_num > 0 and self.epi_num % self.recompute_freq == 0): self.compute_threshold() if (epi_exp['total_rewards'] > self.max_reward): self.max_reward = epi_exp['total_rewards'] if (epi_exp['total_rewards'] < self.min_reward): self.min_reward = epi_exp['total_rewards'] self.last_exp = self.exp self.exp = {k: [] for k in self.exp_keys} self.epi_num += 1 # print("THRESHOLD HISTORY") # print(self.threshold_history) # print("HIGH MEM") # for epi in self.epi_memory_high: # print(str(epi['total_rewards'])+ " ,", end=" ") # print() # print("LOW MEM") # for epi in self.epi_memory_low: # print(str(epi['total_rewards'] )+ " ,", end=" ") # print() def pop(self): '''convenient method to get exp at [last_ind]''' buffer_exp = self.exp # store for restore later self.exp = self.last_exp res = super(HighLowMemory, self).pop() self.exp = buffer_exp return res def rand_minibatch(self, size): # base case, early exit high_samples = np.int(np.ceil(size * self.prob_high)) low_samples = size - high_samples if (len(self.epi_memory_high) == 0 and len(self.epi_memory_low) == 0): return super(HighLowMemory, self).rand_minibatch(size) if (len(self.epi_memory_high) == 0): high_samples = 0 low_samples = size high_samples_per_epi = np.int( np.ceil(high_samples / self.num_epis_to_sample)) low_samples_per_epi = np.int( np.ceil(low_samples / self.num_epis_to_sample)) buffer_exp = self.exp minibatch_as_list = [] if high_samples > 0: for _i in range(4): idx = np.random.randint(0, len(self.epi_memory_high)) epi_exp = self.epi_memory_high[idx]['exp'] self.exp = epi_exp epi_minibatch = super(HighLowMemory, self).rand_minibatch( high_samples_per_epi) minibatch_as_list.append(epi_minibatch) if low_samples > 0: for _i in range(4): idx = np.random.randint(0, len(self.epi_memory_low)) epi_exp = self.epi_memory_low[idx]['exp'] self.exp = epi_exp epi_minibatch = super(HighLowMemory, self).rand_minibatch( low_samples_per_epi) minibatch_as_list.append(epi_minibatch) # set buffer back to original self.exp = buffer_exp # merge all minibatches from best_epi_memory into a minibatch minibatch = {} for k in self.exp_keys: k_exp = np.concatenate( [epi_exp[k] for epi_exp in minibatch_as_list] )[-size:] minibatch[k] = k_exp assert len( minibatch['rewards']) == size, 'minibatch has the wrong size' return minibatch def update(self, updates): pass class HighLowMemoryWithForgetting(HighLowMemory): ''' Like HighLowMemory but also has forgetting capability Controlled by max_epis_in_mem param ''' # absorb generic param without breaking def __init__(self, env_spec, **kwargs): super(HighLowMemoryWithForgetting, self).__init__(env_spec) self.max_epis_in_mem = 250 log_self(self) def reassign_episodes(self): new_high, new_low = [] for mem in (self.epi_memory_high, self.epi_memory_low): for epi_exp in mem: if (self.epi_num - epi_exp['epi_num'] <= self.max_epis_in_mem): if (epi_exp['total_rewards'] > self.threshold): new_high.append(epi_exp) else: new_low.append(epi_exp) self.epi_memory_high = new_high self.epi_memory_low = new_low
{ "content_hash": "e4a40fa6a0cfaae78074bb14bab84256", "timestamp": "", "source": "github", "line_count": 194, "max_line_length": 79, "avg_line_length": 37.329896907216494, "alnum_prop": 0.5544048605357637, "repo_name": "kengz/openai_gym", "id": "86999da9117d232b10a1c6cc5a055bd82ddf3fa7", "size": "7242", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "rl/memory/ranked.py", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "1912" }, { "name": "Python", "bytes": "106972" }, { "name": "Shell", "bytes": "3391" } ] }
package com.odoo.calendar.listeners; import com.odoo.calendar.utils.DateInfo; public interface OnMonthChangeListener { void onMonthChange(DateInfo dateInfo); }
{ "content_hash": "2fe4b1142d84a36375e621dc58b6ecd1", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 42, "avg_line_length": 23.714285714285715, "alnum_prop": 0.8072289156626506, "repo_name": "odoomobile/week-calendar", "id": "97b70d76d04462d04bb2ee49adf41335bb66086b", "size": "166", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "week-calendar/src/main/java/com/odoo/calendar/listeners/OnMonthChangeListener.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "29976" } ] }
package com.xinfan.blueblue.activity.rev; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.EditText; import android.widget.Spinner; import com.xinfan.blueblue.activity.R; import com.xinfan.blueblue.util.ToastUtil; public class RevReport extends Activity { private EditText rev_report_title;// 文本编辑框 private Button rev_report_btn; private Spinner rev_report_type; private static String[] m = { "黄色", "暴力", "违法", "其它" }; private ArrayAdapter<String> adapter; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.rev_report); rev_report_title = (EditText) findViewById(R.id.rev_report_title); rev_report_btn = (Button) findViewById(R.id.rev_report_btn); rev_report_type = (Spinner) findViewById(R.id.rev_report_type); m = this.getResources().getStringArray(R.array.rev_report_list); adapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, m); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); // 将adapter 添加到spinner中 rev_report_type.setAdapter(adapter); rev_report_type.setPrompt(this.getResources().getString(R.string.rev_report_tip)); } public void submit(View v) { Object id = rev_report_type.getSelectedItem(); String typeStr = m[rev_report_type.getSelectedItemPosition()]; String title = rev_report_title.getText().toString(); if (title == null || title.length() == 0) { ToastUtil.showMessage(this, "请输入举报内容"); return; } if (title.length() > 100) { ToastUtil.showMessage(this, "举报内容过长"); return; } RevMessageVo vo = RevSeeMessageActivity.instance.vo; ToastUtil.showMessage(this, "举报成功:" + typeStr); this.finish(); } public void back(View v) { // 返回 this.finish(); } }
{ "content_hash": "e35a1e0a421fb435d626c5ea3d62fc91", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 84, "avg_line_length": 29.742424242424242, "alnum_prop": 0.7106469689251146, "repo_name": "sodoa/mbox", "id": "48c7a98085d052d2e218bf2c2d41cf03693eda83", "size": "2039", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "blueblue/src/com/xinfan/blueblue/activity/rev/RevReport.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "292424" } ] }
function Build-ErrorMessage { param( [parameter(Mandatory = $true)] [string]$BaseMessage, [string]$Message ) if($Message) { $BaseMessage += ". $Message" } $BaseMessage } function Get-AssertError { param( [parameter(Mandatory = $true)] [string]$BaseMessage, [string]$Message ) $Message = Build-ErrorMessage $BaseMessage $Message # Get the last non assert call $lastCall = Get-PSCallStack | Select -Skip 1 | ?{ !$_.Command.StartsWith('Assert') } | Select -First 1 "$Message. At $($lastCall.Location)" } function Assert-Fail { param( [parameter(Mandatory = $true)] [string]$Message ) Write-Error (Get-AssertError "Failed" $Message) } function Assert-True { param( $Value, [string]$Message ) if($Value -eq $false) { Write-Error (Get-AssertError "Value is not true" $Message) } } function Assert-False { param( $Value, [string]$Message ) if($Value -eq $true) { Write-Error (Get-AssertError "Value is not false" $Message) } } function Assert-NotNull { param( $Value, [string]$Message ) if(!$Value) { Write-Error (Get-AssertError "Value is null" $Message) } } function Assert-Null { param( $Value, [string]$Message ) if($Value) { Write-Error (Get-AssertError "Value is not null" $Message) } } function Assert-AreEqual { param( [parameter(Mandatory = $true)] $Expected, [parameter(Mandatory = $true)] $Actual, [string]$Message ) if($Expected -ne $Actual) { Write-Error (Get-AssertError "Expected <$Expected> but got <$Actual>" $Message) } } function Assert-PathExists { param( [parameter(Mandatory = $true)] [string]$Path, [string]$Message ) if(!(Test-Path $Path)) { Write-Error (Get-AssertError "The path `"$Path`" does not exist" $Message) } } function Assert-PathNotExists { param( [parameter(Mandatory = $true)] [string]$Path, [string]$Message ) if((Test-Path $Path)) { Write-Error (Get-AssertError "The path `"$Path`" DOES exist" $Message) } } function Assert-Reference { param( [parameter(Mandatory = $true)] $Project, [parameter(Mandatory = $true)] [string]$Reference, [string]$Version ) $assemblyReference = Get-AssemblyReference $Project $Reference Assert-NotNull $assemblyReference "Reference `"$Reference`" does not exist" $path = $assemblyReference.Path # Support for websites if(!$path) { $path = $assemblyReference.FullPath } Assert-NotNull $path "Reference `"$Reference`" exists but is broken" Assert-PathExists $path "Reference `"$Reference`" exists but is broken" if($Version) { $assemblyVersion = $assemblyReference.Version if(!$assemblyVersion) { $assemblyVersion = [System.Reflection.AssemblyName]::GetAssemblyName($path).Version } $actualVersion = [Version]::Parse($Version) Assert-AreEqual $actualVersion $assemblyVersion } } function Assert-Build { param( [parameter(Mandatory = $true)] $Project, [string]$Configuration ) Build-Project $Project $Configuration # Get the errors from the error list $errors = Get-Errors Assert-AreEqual 0 $errors.Count "Failed to build `"$($Project.Name)`. There were errors in the list." } function Assert-Throws { param( [parameter(Mandatory = $true)] [scriptblock]$Action, [parameter(Mandatory = $true)] [string]$ExceptionMessage ) $exceptionThrown = $false try { & $Action } catch { Assert-AreEqual $ExceptionMessage $_.Exception.Message $exceptionThrown = $true } if(!$exceptionThrown) { Write-Error (Get-AssertError "Expected exception was not thrown") } } function Assert-BindingRedirect { param( [parameter(Mandatory = $true)] $Project, [parameter(Mandatory = $true)] $ConfigPath, [parameter(Mandatory = $true)] $Name, [parameter(Mandatory = $true)] $OldVersion, [parameter(Mandatory = $true)] $NewVersion ) $config = [xml](Get-Content (Get-ProjectItemPath $Project $ConfigPath)) Assert-NotNull $config.configuration.runtime Assert-NotNull $config.configuration.runtime.assemblyBinding Assert-NotNull $config.configuration.runtime.assemblyBinding.dependentAssembly $bindings = @($config.configuration.runtime.assemblyBinding.dependentAssembly | ?{ $_.assemblyIdentity.name -eq $Name -and $_.bindingRedirect.oldVersion -eq $OldVersion -and $_.bindingRedirect.newVersion -eq $NewVersion }) Assert-True ($bindings.Count -eq 1) "Unable to find binding redirect matching $Name, $OldVersion, $NewVersion" } function Assert-NoBindingRedirect { param( [parameter(Mandatory = $true)] $Project, [parameter(Mandatory = $true)] $ConfigPath, [parameter(Mandatory = $true)] $Name, [parameter(Mandatory = $true)] $OldVersion, [parameter(Mandatory = $true)] $NewVersion ) $itemPath = (Get-ProjectItemPath $Project $ConfigPath) if (!$itemPath) { return } $config = [xml](Get-Content $itemPath) if (!$config.configuration.runtime -or !$config.configuration.runtime.assemblyBinding -or !$config.configuration.runtime.assemblyBinding.dependentAssembly) { return } $bindings = @($config.configuration.runtime.assemblyBinding.dependentAssembly | ?{ $_.assemblyIdentity.name -eq $Name -and $_.bindingRedirect.oldVersion -eq $OldVersion -and $_.bindingRedirect.newVersion -eq $NewVersion }) Assert-True ($bindings.Count -eq 0) "Binding redirect matching $Name, $OldVersion, $NewVersion found in project $($Project.Name)" }
{ "content_hash": "02e6b02102e86a6eedfa57e8f5b28b64", "timestamp": "", "source": "github", "line_count": 248, "max_line_length": 134, "avg_line_length": 26.483870967741936, "alnum_prop": 0.5707978075517661, "repo_name": "AArnott/NuGet.VisualStudioExtension", "id": "8335521f223ee6e2fac7642b531ca8ccc7ab6229", "size": "6587", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "test/EndToEnd/assert.ps1", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ASP", "bytes": "15543" }, { "name": "C", "bytes": "418" }, { "name": "C#", "bytes": "1195011" }, { "name": "C++", "bytes": "174249" }, { "name": "CSS", "bytes": "373373" }, { "name": "F#", "bytes": "298" }, { "name": "GLSL", "bytes": "48" }, { "name": "HTML", "bytes": "9616" }, { "name": "JavaScript", "bytes": "1773321" }, { "name": "PowerShell", "bytes": "315718" }, { "name": "Shell", "bytes": "102" }, { "name": "Visual Basic", "bytes": "11743" } ] }
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.appcontainers.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.resourcemanager.appcontainers.models.ConnectedEnvironmentProvisioningState; import com.azure.resourcemanager.appcontainers.models.CustomDomainConfiguration; import com.fasterxml.jackson.annotation.JsonProperty; /** ConnectedEnvironment resource specific properties. */ @Fluent public final class ConnectedEnvironmentProperties { /* * Provisioning state of the Kubernetes Environment. */ @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ConnectedEnvironmentProvisioningState provisioningState; /* * Any errors that occurred during deployment or deployment validation */ @JsonProperty(value = "deploymentErrors", access = JsonProperty.Access.WRITE_ONLY) private String deploymentErrors; /* * Default Domain Name for the cluster */ @JsonProperty(value = "defaultDomain", access = JsonProperty.Access.WRITE_ONLY) private String defaultDomain; /* * Static IP of the connectedEnvironment */ @JsonProperty(value = "staticIp") private String staticIp; /* * Application Insights connection string used by Dapr to export Service to Service communication telemetry */ @JsonProperty(value = "daprAIConnectionString") private String daprAIConnectionString; /* * Custom domain configuration for the environment */ @JsonProperty(value = "customDomainConfiguration") private CustomDomainConfiguration customDomainConfiguration; /** Creates an instance of ConnectedEnvironmentProperties class. */ public ConnectedEnvironmentProperties() { } /** * Get the provisioningState property: Provisioning state of the Kubernetes Environment. * * @return the provisioningState value. */ public ConnectedEnvironmentProvisioningState provisioningState() { return this.provisioningState; } /** * Get the deploymentErrors property: Any errors that occurred during deployment or deployment validation. * * @return the deploymentErrors value. */ public String deploymentErrors() { return this.deploymentErrors; } /** * Get the defaultDomain property: Default Domain Name for the cluster. * * @return the defaultDomain value. */ public String defaultDomain() { return this.defaultDomain; } /** * Get the staticIp property: Static IP of the connectedEnvironment. * * @return the staticIp value. */ public String staticIp() { return this.staticIp; } /** * Set the staticIp property: Static IP of the connectedEnvironment. * * @param staticIp the staticIp value to set. * @return the ConnectedEnvironmentProperties object itself. */ public ConnectedEnvironmentProperties withStaticIp(String staticIp) { this.staticIp = staticIp; return this; } /** * Get the daprAIConnectionString property: Application Insights connection string used by Dapr to export Service to * Service communication telemetry. * * @return the daprAIConnectionString value. */ public String daprAIConnectionString() { return this.daprAIConnectionString; } /** * Set the daprAIConnectionString property: Application Insights connection string used by Dapr to export Service to * Service communication telemetry. * * @param daprAIConnectionString the daprAIConnectionString value to set. * @return the ConnectedEnvironmentProperties object itself. */ public ConnectedEnvironmentProperties withDaprAIConnectionString(String daprAIConnectionString) { this.daprAIConnectionString = daprAIConnectionString; return this; } /** * Get the customDomainConfiguration property: Custom domain configuration for the environment. * * @return the customDomainConfiguration value. */ public CustomDomainConfiguration customDomainConfiguration() { return this.customDomainConfiguration; } /** * Set the customDomainConfiguration property: Custom domain configuration for the environment. * * @param customDomainConfiguration the customDomainConfiguration value to set. * @return the ConnectedEnvironmentProperties object itself. */ public ConnectedEnvironmentProperties withCustomDomainConfiguration( CustomDomainConfiguration customDomainConfiguration) { this.customDomainConfiguration = customDomainConfiguration; return this; } /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (customDomainConfiguration() != null) { customDomainConfiguration().validate(); } } }
{ "content_hash": "50f64a522c03f73900b1d35add839146", "timestamp": "", "source": "github", "line_count": 155, "max_line_length": 120, "avg_line_length": 33.08387096774194, "alnum_prop": 0.7102184087363494, "repo_name": "Azure/azure-sdk-for-java", "id": "28adb95807b1c31e30101cc486727a049367c379", "size": "5128", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ConnectedEnvironmentProperties.java", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "8762" }, { "name": "Bicep", "bytes": "15055" }, { "name": "CSS", "bytes": "7676" }, { "name": "Dockerfile", "bytes": "2028" }, { "name": "Groovy", "bytes": "3237482" }, { "name": "HTML", "bytes": "42090" }, { "name": "Java", "bytes": "432409546" }, { "name": "JavaScript", "bytes": "36557" }, { "name": "Jupyter Notebook", "bytes": "95868" }, { "name": "PowerShell", "bytes": "737517" }, { "name": "Python", "bytes": "240542" }, { "name": "Scala", "bytes": "1143898" }, { "name": "Shell", "bytes": "18488" }, { "name": "XSLT", "bytes": "755" } ] }
<?php /** * @license GPL 2 (http://www.gnu.org/licenses/gpl.html) * * @author Katerina Katapodi <extragold1234@hotmail.com> * @author Vasileios Karavasilis <vasileioskaravasilis@gmail.com> */ $lang['domain'] = 'Logon Domain'; $lang['authpwdexpire'] = 'Ο κωδικός πρόσβασης θα λήξει σε %d ημέρες. Προτείνουμε να τον αλλάξετε σύντομα.'; $lang['passchangefail'] = 'Ο κωδικός πρόσβασης δεν μπόρεσε να αλλάξει. Μήπως δεν ακολουθήθηκαν οι κατάλληλες οδηγίες της πολιτικής κωδικού πρόσβασης?'; $lang['userchangefail'] = 'Αποτυχία αλλαγής των στοιχείων του χρήστη. Μπορεί ο λογαριασμός σας να μην έχει άδεια να κάνει αλλαγές. '; $lang['connectfail'] = 'Δεν μπόρεσε να συνδέσει στον διακομιστή Active Directory (Ενεργή Λίστα διευθύνσεων).';
{ "content_hash": "585da7be0201f09cfb7cd27398b3c677", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 158, "avg_line_length": 60.53846153846154, "alnum_prop": 0.7039390088945362, "repo_name": "duangao/duangao.github.io", "id": "2728d016376097fd557ffec07a4d93399c32ac7d", "size": "1095", "binary": false, "copies": "9", "ref": "refs/heads/master", "path": "lib/plugins/authad/lang/el/lang.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "44164" }, { "name": "HTML", "bytes": "104714" }, { "name": "JavaScript", "bytes": "133226" }, { "name": "Ruby", "bytes": "1400" } ] }
<?xml version="1.0" encoding="UTF-8"?> <!-- Copyright 2005-2014 The Kuali Foundation Licensed under the Educational Community License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.opensource.org/licenses/ecl2.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.kuali.rice</groupId> <artifactId>rice-config</artifactId> <version>2.3.6</version> </parent> <artifactId>rice-checkstyle</artifactId> <packaging>jar</packaging> <name>Rice Checkstyle</name> <properties> <kuali.testjar.phase>none</kuali.testjar.phase> </properties> </project>
{ "content_hash": "3488d0a7450fda33a0c8f2f92d763ad4", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 201, "avg_line_length": 38.59375, "alnum_prop": 0.7230769230769231, "repo_name": "ua-eas/ksd-kc5.2.1-rice2.3.6-ua", "id": "7b6d8d19b0b9c825f6c6e29178a3e924c3ebfb64", "size": "1235", "binary": false, "copies": "1", "ref": "refs/heads/development", "path": "config/checkstyle/pom.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "542248" }, { "name": "Groovy", "bytes": "2403552" }, { "name": "HTML", "bytes": "3275928" }, { "name": "Java", "bytes": "30805440" }, { "name": "JavaScript", "bytes": "2486893" }, { "name": "PHP", "bytes": "15766" }, { "name": "PLSQL", "bytes": "108325" }, { "name": "SQLPL", "bytes": "51212" }, { "name": "Shell", "bytes": "1808" }, { "name": "XSLT", "bytes": "109576" } ] }
<!DOCTYPE HTML> <html lang="en"> <head> <meta charset="utf-8"> <title>Demo: Dijit Buttons</title> <link rel="stylesheet" href="../../_common/demo.css" media="screen"> <link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/dojo/1.10.4/dijit/themes/claro/claro.css" media="screen"> </head> <body class="claro"> <h1>Demo: dijit/form/Button</h1> <p> Below, we see <code>dijit/form/Button</code> in two forms: as a standard button, and using an icon with no label. Be sure to open the console to see messages when clicking the buttons! </p> <div> <button id="btn"></button> <button id="btn2"></button> </div> <!-- load dojo and provide config via data attribute --> <script src="//ajax.googleapis.com/ajax/libs/dojo/1.10.4/dojo/dojo.js" data-dojo-config="isDebug: true, async: true"></script> <script> require(["dijit/form/Button", "dojo/domReady!"], function(Button) { var button = new Button({ label: "Click Me!", onClick: function(){ console.log("First button was clicked!"); } }, "btn"); button.startup(); var button2 = new Button({ iconClass:"dijitIconNewTask", showLabel:false, label: "Click Me!", // analogous to title when showLabel is false onClick: function(){ console.log("Second button was clicked!"); } }, "btn2"); button2.startup(); }); </script> </body> </html>
{ "content_hash": "870198a5aa76539055efa698194f7d76", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 126, "avg_line_length": 30.790697674418606, "alnum_prop": 0.6714501510574018, "repo_name": "SitePen/dojo-tutorials", "id": "a0026bf89608cf7396ff788af6128f2f24f03a4f", "size": "1325", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "themes_buttons_textboxes/demo/ProgButton.html", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "CSS", "bytes": "16587" }, { "name": "HTML", "bytes": "572854" }, { "name": "JavaScript", "bytes": "91140" }, { "name": "PHP", "bytes": "8216" } ] }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_24) on Tue Apr 26 20:40:27 CST 2011 --> <TITLE> com.numericalmethod.suanshu.number.big (SuanShu 1.3.1 API Documentation) </TITLE> <META NAME="date" CONTENT="2011-04-26"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style"> </HEAD> <BODY BGCOLOR="white"> <FONT size="+1" CLASS="FrameTitleFont"> <A HREF="../../../../../com/numericalmethod/suanshu/number/big/package-summary.html" target="classFrame">com.numericalmethod.suanshu.number.big</A></FONT> <TABLE BORDER="0" WIDTH="100%" SUMMARY=""> <TR> <TD NOWRAP><FONT size="+1" CLASS="FrameHeadingFont"> Classes</FONT>&nbsp; <FONT CLASS="FrameItemFont"> <BR> <A HREF="BigDecimalUtils.html" title="class in com.numericalmethod.suanshu.number.big" target="classFrame">BigDecimalUtils</A> <BR> <A HREF="BigIntegerUtils.html" title="class in com.numericalmethod.suanshu.number.big" target="classFrame">BigIntegerUtils</A></FONT></TD> </TR> </TABLE> </BODY> </HTML>
{ "content_hash": "7e142091abbaa3fbb9a3b1341fc40347", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 154, "avg_line_length": 34.05882352941177, "alnum_prop": 0.6753022452504318, "repo_name": "Aliced3645/DataCenterMarketing", "id": "9464b14a7ec1360e9437cf6747abdfdbf77221a0", "size": "1158", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "suanshu-javadoc-1.3.1/com/numericalmethod/suanshu/number/big/package-frame.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "416319" }, { "name": "C++", "bytes": "35604" }, { "name": "Java", "bytes": "2960915" }, { "name": "JavaScript", "bytes": "49600" }, { "name": "Python", "bytes": "5068482" }, { "name": "Shell", "bytes": "15606" } ] }
@class GADRewardedAdBeta; /// A block to be executed when the ad request operation completes. On success, /// rewardedAd is non-nil and |error| is nil. On failure, rewardedAd is nil /// and |error| is non-nil. typedef void (^GADRewardedAdBetaLoadCompletionHandler)(GADRewardedAdBeta *_Nullable rewardedAd, NSError *_Nullable error); /// A rewarded ad. Rewarded ads are ads that users have the option of interacting with in exchange /// for in-app rewards. @interface GADRewardedAdBeta : NSObject <GADAdMetadataProvider, GADFullScreenPresentingAd> /// The ad unit ID. @property(nonatomic, readonly, nonnull) NSString *adUnitID; /// Information about the ad response that returned the ad. @property(nonatomic, readonly, nonnull) GADResponseInfo *responseInfo; /// The reward earned by the user for interacting with the ad. @property(nonatomic, readonly, nonnull) GADAdReward *adReward; /// Options specified for server-side user reward verification. Must be set before presenting this /// ad. @property(nonatomic, copy, nullable) GADServerSideVerificationOptions *serverSideVerificationOptions; /// Delegate for handling full screen content messages. @property(nonatomic, weak, nullable) id<GADFullScreenContentDelegate> fullScreenContentDelegate; /// Called when the ad is estimated to have earned money. Available for allowlisted accounts only. @property(nonatomic, nullable, copy) GADPaidEventHandler paidEventHandler; /// Loads a rewarded ad. /// /// @param adUnitID An ad unit ID created in the AdMob or Ad Manager UI. /// @param request An ad request object. If nil, a default ad request object is used. /// @param completionHandler A handler to execute when the load operation finishes or times out. + (void)loadWithAdUnitID:(nonnull NSString *)adUnitID request:(nullable GADRequest *)request completionHandler:(nonnull GADRewardedAdBetaLoadCompletionHandler)completionHandler; /// Returns whether the rewarded ad can be presented from the provided root view /// controller. Sets the error out parameter if the ad can't be presented. Must be called on the /// main thread. - (BOOL)canPresentFromRootViewController:(nonnull UIViewController *)rootViewController error:(NSError *_Nullable __autoreleasing *_Nullable)error; /// Presents the rewarded ad. Must be called on the main thread. /// /// @param rootViewController A view controller to present the ad. /// @param userDidEarnRewardHandler A handler to execute when the user earns a reward. - (void)presentFromRootViewController:(nonnull UIViewController *)rootViewController userDidEarnRewardHandler:(nonnull GADUserDidEarnRewardHandler)userDidEarnRewardHandler; @end
{ "content_hash": "a3fce58058eec9fa9fc605e7698fb066", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 100, "avg_line_length": 50.36363636363637, "alnum_prop": 0.7563176895306859, "repo_name": "firebase/firebase-cpp-sdk", "id": "84e6cb56d7ca2c64a8ac5b253c8cb4f035a46313", "size": "3264", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "admob/admob_resources/ios_headers/GoogleMobileAds/GADRewardedAdBeta.h", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "3734" }, { "name": "C", "bytes": "84626" }, { "name": "C++", "bytes": "7496469" }, { "name": "CMake", "bytes": "402069" }, { "name": "Java", "bytes": "403250" }, { "name": "Kotlin", "bytes": "3278" }, { "name": "Objective-C", "bytes": "673832" }, { "name": "Objective-C++", "bytes": "659778" }, { "name": "Python", "bytes": "463609" }, { "name": "Ruby", "bytes": "16155" }, { "name": "Shell", "bytes": "77075" }, { "name": "Swift", "bytes": "16598" } ] }
package org.apache.camel.processor; import org.apache.camel.Exchange; import org.apache.camel.Processor; import org.apache.camel.RollbackExchangeException; import org.apache.camel.Traceable; /** * Processor for marking an {@link org.apache.camel.Exchange} to rollback. * * @version */ public class RollbackProcessor implements Processor, Traceable { private boolean markRollbackOnly; private boolean markRollbackOnlyLast; private String message; public RollbackProcessor() { } public RollbackProcessor(String message) { this.message = message; } public void process(Exchange exchange) throws Exception { if (isMarkRollbackOnlyLast()) { // only mark the last route (current) as rollback // this is needed when you have multiple transactions in play exchange.setProperty(Exchange.ROLLBACK_ONLY_LAST, Boolean.TRUE); } else { // default to mark the entire route as rollback exchange.setProperty(Exchange.ROLLBACK_ONLY, Boolean.TRUE); } if (markRollbackOnly || markRollbackOnlyLast) { // do not do anything more as we should only mark the rollback return; } // throw exception to rollback if (message != null) { throw new RollbackExchangeException(message, exchange); } else { throw new RollbackExchangeException(exchange); } } @Override public String toString() { if (message != null) { return "Rollback[" + message + "]"; } else { return "Rollback"; } } public String getTraceLabel() { return "rollback"; } public boolean isMarkRollbackOnly() { return markRollbackOnly; } public void setMarkRollbackOnly(boolean markRollbackOnly) { this.markRollbackOnly = markRollbackOnly; } public boolean isMarkRollbackOnlyLast() { return markRollbackOnlyLast; } public void setMarkRollbackOnlyLast(boolean markRollbackOnlyLast) { this.markRollbackOnlyLast = markRollbackOnlyLast; } }
{ "content_hash": "d58b7d74694d558cf30601041516338d", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 76, "avg_line_length": 27.58974358974359, "alnum_prop": 0.6468401486988847, "repo_name": "cexbrayat/camel", "id": "73799c863d83db26dcd79dbededc2b5cedb7eb4d", "size": "2955", "binary": false, "copies": "1", "ref": "refs/heads/trunk", "path": "camel-core/src/main/java/org/apache/camel/processor/RollbackProcessor.java", "mode": "33188", "license": "apache-2.0", "language": [] }
// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // ** This file is automatically generated by gapic-generator-typescript. ** // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** 'use strict'; function main(model, updateMask) { // [START automl_v1_generated_AutoMl_UpdateModel_async] /** * This snippet has been automatically generated and should be regarded as a code template only. * It will require modifications to work. * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** * Required. The model which replaces the resource on the server. */ // const model = {} /** * Required. The update mask applies to the resource. */ // const updateMask = {} // Imports the Automl library const {AutoMlClient} = require('@google-cloud/automl').v1; // Instantiates a client const automlClient = new AutoMlClient(); async function callUpdateModel() { // Construct request const request = { model, updateMask, }; // Run request const response = await automlClient.updateModel(request); console.log(response); } callUpdateModel(); // [END automl_v1_generated_AutoMl_UpdateModel_async] } process.on('unhandledRejection', err => { console.error(err.message); process.exitCode = 1; }); main(...process.argv.slice(2));
{ "content_hash": "35caf7a43c863cd1869b435d4d1b3429", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 98, "avg_line_length": 30.515151515151516, "alnum_prop": 0.7010923535253227, "repo_name": "googleapis/nodejs-automl", "id": "ba07e4c601d8082e1a93a1c451720751f0573a4b", "size": "2014", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "samples/generated/v1/auto_ml.update_model.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "JavaScript", "bytes": "5795" }, { "name": "Python", "bytes": "828" }, { "name": "TypeScript", "bytes": "817390" } ] }
define(['underscore', 'text'], function (_, text) { 'use strict'; var buildMap = {}; var tpl = { version: '0.1.0', load: function (name, req, onLoadNative, config) { var onLoad = function (content) { // Merge settings _.extend(_.templateSettings, config.underscoreTemplateSettings || {}) // compile the template content = _.template(content); if (config.isBuild) { content = buildMap[name] = content.source; } else { content = new Function('obj', 'return ' + content.source)(); } onLoadNative(content); }; // load template using the text plugin text.load(name, req, onLoad, config); }, write: function (pluginName, moduleName, write) { if (buildMap.hasOwnProperty(moduleName)) { write('define("' + pluginName + '!' + moduleName + '", ["underscore"], function(_) { ' + 'return ' + buildMap[moduleName] + ';' + '});\n' ); } } }; return tpl; });
{ "content_hash": "5b490af18a844e02fe840fe24b658326", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 96, "avg_line_length": 23.11111111111111, "alnum_prop": 0.5365384615384615, "repo_name": "dciccale/requirejs-underscore-tpl", "id": "c238a38d51b811f3b8fa7f06f768a06f844cd0d2", "size": "1461", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "underscore-tpl.js", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "1461" } ] }
package com.prokarma.pkmst.controller; import com.prokarma.pkmst.model.ComputerSet; import com.prokarma.pkmst.model.FreeStyleBuild; import com.prokarma.pkmst.model.FreeStyleProject; import com.prokarma.pkmst.model.Hudson; import com.prokarma.pkmst.model.ListView; import com.prokarma.pkmst.model.Queue; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; import org.springframework.web.multipart.MultipartFile; import org.springframework.beans.factory.annotation.Autowired; import java.util.List; import com.fasterxml.jackson.databind.ObjectMapper; import java.io.IOException; /** * Api implementation * @author pkmst * */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaPKMSTServerCodegen", date = "2022-06-04T08:08:30.217930Z[Etc/UTC]") @Controller public class RemoteAccessApiController implements RemoteAccessApi { private final ObjectMapper objectMapper; @Autowired public RemoteAccessApiController(ObjectMapper objectMapper) { this.objectMapper = objectMapper; } public ResponseEntity<ComputerSet> getComputer(@ApiParam(value = "Recursion depth in response model", required = true) @RequestParam(value = "depth", required = true) Integer depth, @RequestHeader(value = "Accept", required = false) String accept) throws Exception { // do some magic! if (accept != null && accept.contains("application/json")) { return new ResponseEntity<ComputerSet>(objectMapper.readValue("", ComputerSet.class), HttpStatus.OK); } return new ResponseEntity<ComputerSet>(HttpStatus.OK); } public ResponseEntity<Hudson> getJenkins(@RequestHeader(value = "Accept", required = false) String accept) throws Exception { // do some magic! if (accept != null && accept.contains("application/json")) { return new ResponseEntity<Hudson>(objectMapper.readValue("", Hudson.class), HttpStatus.OK); } return new ResponseEntity<Hudson>(HttpStatus.OK); } public ResponseEntity<FreeStyleProject> getJob(@ApiParam(value = "Name of the job",required=true ) @PathVariable("name") String name, @RequestHeader(value = "Accept", required = false) String accept) throws Exception { // do some magic! if (accept != null && accept.contains("application/json")) { return new ResponseEntity<FreeStyleProject>(objectMapper.readValue("", FreeStyleProject.class), HttpStatus.OK); } return new ResponseEntity<FreeStyleProject>(HttpStatus.OK); } public ResponseEntity<String> getJobConfig(@ApiParam(value = "Name of the job",required=true ) @PathVariable("name") String name, @RequestHeader(value = "Accept", required = false) String accept) throws Exception { // do some magic! return new ResponseEntity<String>(HttpStatus.OK); } public ResponseEntity<FreeStyleBuild> getJobLastBuild(@ApiParam(value = "Name of the job",required=true ) @PathVariable("name") String name, @RequestHeader(value = "Accept", required = false) String accept) throws Exception { // do some magic! if (accept != null && accept.contains("application/json")) { return new ResponseEntity<FreeStyleBuild>(objectMapper.readValue("", FreeStyleBuild.class), HttpStatus.OK); } return new ResponseEntity<FreeStyleBuild>(HttpStatus.OK); } public ResponseEntity<Void> getJobProgressiveText(@ApiParam(value = "Name of the job",required=true ) @PathVariable("name") String name, @ApiParam(value = "Build number",required=true ) @PathVariable("number") String number, @ApiParam(value = "Starting point of progressive text output", required = true) @RequestParam(value = "start", required = true) String start, @RequestHeader(value = "Accept", required = false) String accept) throws Exception { // do some magic! return new ResponseEntity<Void>(HttpStatus.OK); } public ResponseEntity<Queue> getQueue(@RequestHeader(value = "Accept", required = false) String accept) throws Exception { // do some magic! if (accept != null && accept.contains("application/json")) { return new ResponseEntity<Queue>(objectMapper.readValue("", Queue.class), HttpStatus.OK); } return new ResponseEntity<Queue>(HttpStatus.OK); } public ResponseEntity<Queue> getQueueItem(@ApiParam(value = "Queue number",required=true ) @PathVariable("number") String number, @RequestHeader(value = "Accept", required = false) String accept) throws Exception { // do some magic! if (accept != null && accept.contains("application/json")) { return new ResponseEntity<Queue>(objectMapper.readValue("", Queue.class), HttpStatus.OK); } return new ResponseEntity<Queue>(HttpStatus.OK); } public ResponseEntity<ListView> getView(@ApiParam(value = "Name of the view",required=true ) @PathVariable("name") String name, @RequestHeader(value = "Accept", required = false) String accept) throws Exception { // do some magic! if (accept != null && accept.contains("application/json")) { return new ResponseEntity<ListView>(objectMapper.readValue("", ListView.class), HttpStatus.OK); } return new ResponseEntity<ListView>(HttpStatus.OK); } public ResponseEntity<String> getViewConfig(@ApiParam(value = "Name of the view",required=true ) @PathVariable("name") String name, @RequestHeader(value = "Accept", required = false) String accept) throws Exception { // do some magic! return new ResponseEntity<String>(HttpStatus.OK); } public ResponseEntity<Void> headJenkins(@RequestHeader(value = "Accept", required = false) String accept) throws Exception { // do some magic! return new ResponseEntity<Void>(HttpStatus.OK); } public ResponseEntity<Void> postCreateItem(@ApiParam(value = "Name of the new job", required = true) @RequestParam(value = "name", required = true) String name, @ApiParam(value = "Existing job to copy from") @RequestParam(value = "from", required = false) String from, @ApiParam(value = "Set to 'copy' for copying an existing job") @RequestParam(value = "mode", required = false) String mode, @ApiParam(value = "CSRF protection token" ) @RequestHeader(value="Jenkins-Crumb", required=false) String jenkinsCrumb, @ApiParam(value = "Content type header application/xml" ) @RequestHeader(value="Content-Type", required=false) String contentType, @ApiParam(value = "Job configuration in config.xml format" ) @RequestBody String body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception { // do some magic! return new ResponseEntity<Void>(HttpStatus.OK); } public ResponseEntity<Void> postCreateView(@ApiParam(value = "Name of the new view", required = true) @RequestParam(value = "name", required = true) String name, @ApiParam(value = "CSRF protection token" ) @RequestHeader(value="Jenkins-Crumb", required=false) String jenkinsCrumb, @ApiParam(value = "Content type header application/xml" ) @RequestHeader(value="Content-Type", required=false) String contentType, @ApiParam(value = "View configuration in config.xml format" ) @RequestBody String body, @RequestHeader(value = "Accept", required = false) String accept) throws Exception { // do some magic! return new ResponseEntity<Void>(HttpStatus.OK); } public ResponseEntity<Void> postJobBuild(@ApiParam(value = "Name of the job",required=true ) @PathVariable("name") String name, @ApiParam(value = "", required = true) @RequestParam(value = "json", required = true) String json, @ApiParam(value = "") @RequestParam(value = "token", required = false) String token, @ApiParam(value = "CSRF protection token" ) @RequestHeader(value="Jenkins-Crumb", required=false) String jenkinsCrumb, @RequestHeader(value = "Accept", required = false) String accept) throws Exception { // do some magic! return new ResponseEntity<Void>(HttpStatus.OK); } public ResponseEntity<Void> postJobConfig(@ApiParam(value = "Name of the job",required=true ) @PathVariable("name") String name, @ApiParam(value = "Job configuration in config.xml format" ,required=true ) @RequestBody String body, @ApiParam(value = "CSRF protection token" ) @RequestHeader(value="Jenkins-Crumb", required=false) String jenkinsCrumb, @RequestHeader(value = "Accept", required = false) String accept) throws Exception { // do some magic! return new ResponseEntity<Void>(HttpStatus.OK); } public ResponseEntity<Void> postJobDelete(@ApiParam(value = "Name of the job",required=true ) @PathVariable("name") String name, @ApiParam(value = "CSRF protection token" ) @RequestHeader(value="Jenkins-Crumb", required=false) String jenkinsCrumb, @RequestHeader(value = "Accept", required = false) String accept) throws Exception { // do some magic! return new ResponseEntity<Void>(HttpStatus.OK); } public ResponseEntity<Void> postJobDisable(@ApiParam(value = "Name of the job",required=true ) @PathVariable("name") String name, @ApiParam(value = "CSRF protection token" ) @RequestHeader(value="Jenkins-Crumb", required=false) String jenkinsCrumb, @RequestHeader(value = "Accept", required = false) String accept) throws Exception { // do some magic! return new ResponseEntity<Void>(HttpStatus.OK); } public ResponseEntity<Void> postJobEnable(@ApiParam(value = "Name of the job",required=true ) @PathVariable("name") String name, @ApiParam(value = "CSRF protection token" ) @RequestHeader(value="Jenkins-Crumb", required=false) String jenkinsCrumb, @RequestHeader(value = "Accept", required = false) String accept) throws Exception { // do some magic! return new ResponseEntity<Void>(HttpStatus.OK); } public ResponseEntity<Void> postJobLastBuildStop(@ApiParam(value = "Name of the job",required=true ) @PathVariable("name") String name, @ApiParam(value = "CSRF protection token" ) @RequestHeader(value="Jenkins-Crumb", required=false) String jenkinsCrumb, @RequestHeader(value = "Accept", required = false) String accept) throws Exception { // do some magic! return new ResponseEntity<Void>(HttpStatus.OK); } public ResponseEntity<Void> postViewConfig(@ApiParam(value = "Name of the view",required=true ) @PathVariable("name") String name, @ApiParam(value = "View configuration in config.xml format" ,required=true ) @RequestBody String body, @ApiParam(value = "CSRF protection token" ) @RequestHeader(value="Jenkins-Crumb", required=false) String jenkinsCrumb, @RequestHeader(value = "Accept", required = false) String accept) throws Exception { // do some magic! return new ResponseEntity<Void>(HttpStatus.OK); } }
{ "content_hash": "dcda2842c4d233cfd1b9807a2007c8b7", "timestamp": "", "source": "github", "line_count": 213, "max_line_length": 186, "avg_line_length": 54.20657276995305, "alnum_prop": 0.7012818292049194, "repo_name": "cliffano/swaggy-jenkins", "id": "45ea1de7214d93d53a47c2a1440cfb034062a9a2", "size": "11546", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "clients/java-pkmst/generated/src/main/java/com/prokarma/pkmst/controller/RemoteAccessApiController.java", "mode": "33188", "license": "mit", "language": [ { "name": "Ada", "bytes": "569823" }, { "name": "Apex", "bytes": "741346" }, { "name": "Batchfile", "bytes": "14792" }, { "name": "C", "bytes": "971274" }, { "name": "C#", "bytes": "5131336" }, { "name": "C++", "bytes": "7799032" }, { "name": "CMake", "bytes": "20609" }, { "name": "CSS", "bytes": "4873" }, { "name": "Clojure", "bytes": "129018" }, { "name": "Crystal", "bytes": "864941" }, { "name": "Dart", "bytes": "876777" }, { "name": "Dockerfile", "bytes": "7385" }, { "name": "Eiffel", "bytes": "424642" }, { "name": "Elixir", "bytes": "139252" }, { "name": "Elm", "bytes": "187067" }, { "name": "Emacs Lisp", "bytes": "191" }, { "name": "Erlang", "bytes": "373074" }, { "name": "F#", "bytes": "556012" }, { "name": "Gherkin", "bytes": "951" }, { "name": "Go", "bytes": "345227" }, { "name": "Groovy", "bytes": "89524" }, { "name": "HTML", "bytes": "2367424" }, { "name": "Haskell", "bytes": "680841" }, { "name": "Java", "bytes": "12164874" }, { "name": "JavaScript", "bytes": "1959006" }, { "name": "Kotlin", "bytes": "1280953" }, { "name": "Lua", "bytes": "322316" }, { "name": "Makefile", "bytes": "11882" }, { "name": "Nim", "bytes": "65818" }, { "name": "OCaml", "bytes": "94665" }, { "name": "Objective-C", "bytes": "464903" }, { "name": "PHP", "bytes": "4383673" }, { "name": "Perl", "bytes": "743304" }, { "name": "PowerShell", "bytes": "678274" }, { "name": "Python", "bytes": "5529523" }, { "name": "QMake", "bytes": "6915" }, { "name": "R", "bytes": "840841" }, { "name": "Raku", "bytes": "10945" }, { "name": "Ruby", "bytes": "328360" }, { "name": "Rust", "bytes": "1735375" }, { "name": "Scala", "bytes": "1387368" }, { "name": "Shell", "bytes": "407167" }, { "name": "Swift", "bytes": "342562" }, { "name": "TypeScript", "bytes": "3060093" } ] }
package apsu.demo.rocks.components.collision /** * Destruction * * @author david */ case class Destruction()
{ "content_hash": "bdcd1937530a03da29dd8b299d79f3f5", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 44, "avg_line_length": 14.25, "alnum_prop": 0.7105263157894737, "repo_name": "chronodm/apsu-demo-scala", "id": "b8033eb7eb0e6ef14a3ce058a595056fd29a2ae9", "size": "114", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/scala/apsu/demo/rocks/components/collision/Destruction.scala", "mode": "33188", "license": "mit", "language": [ { "name": "Scala", "bytes": "41956" } ] }
End of preview.

No dataset card yet

Downloads last month
5