content
stringlengths
7
1.05M
def route_login_required(): """ Decorates a function to indicate the requirement for a logged-in session. :return: The decorated function. """ def decorator(fn): fn.route_login_required = True return fn return decorator def is_route_login_required(fn): """ Determine if a function is decorated to require a logged-in session. :param fn: The function to check. :return: True if this function requires a logged-in session, False otherwise. """ return hasattr(fn, "route_login_required") and fn.route_login_required def route_security_required(): pass def get_route_security_required(): pass def route_business_logic(logicFn): """ Decorates a function to indicate the business logic that should be executed after security checks pass. :param logicFn: The business logic function to assign. :return: The decorated function. """ def decorator(fn): fn.route_business_logic = logicFn return fn return decorator def get_route_business_logic(fn): """ Returns the business logic function associated with an endpoint. :param fn: The endpoint whose logic to return. :return: A function pointer to the business logic for an endpoint, or None if no such logic exists. """ if not hasattr(fn, "route_business_logic"): return None return fn.route_business_logic def route_vm_logic(logicFn): """ Decorates a function to indicate the viewmodel logic that should be executed after security checks and business logic passes. :param logicFn: The viewmodel logic function to assign. :return: The decorated function. """ def decorator(fn): fn.route_vm_logic = logicFn return fn return decorator def get_route_vm_logic(fn): """ Returns the viewmodel logic function associated with an endpoint. :param fn: The endpoint whose logic to return. :return: A function pointer to the viewmodel logic for an endpoint, or None if no such logic exists. """ if not hasattr(fn, "route_vm_logic"): return None return fn.route_vm_logic
# # @lc app=leetcode id=741 lang=python3 # # [741] Cherry Pickup # # @lc code=start class Solution: def cherryPickup(self, grid: List[List[int]]) -> int: if grid[-1][-1] == -1: return 0 # set up cache self.grid = grid self.memo = {} self.N = len(grid) return max(self.dp(0, 0, 0, 0), 0) def dp(self, i1, j1, i2, j2): # already stored: return if (i1, j1, i2, j2) in self.memo: return self.memo[(i1, j1, i2, j2)] # end states: 1. out of grid 2. at the right bottom corner 3. hit a thorn N = self.N if i1 == N or j1 == N or i2 == N or j2 == N: return -1 if i1 == N-1 and j1 == N-1 and i2 == N-1 and j2 == N-1: return self.grid[-1][-1] if self.grid[i1][j1] == -1 or self.grid[i2][j2] == -1: return -1 # now can take a step in two directions at each end, which amounts to 4 combinations in total dd = self.dp(i1+1, j1, i2+1, j2) dr = self.dp(i1+1, j1, i2, j2+1) rd = self.dp(i1, j1+1, i2+1, j2) rr = self.dp(i1, j1+1, i2, j2+1) maxComb = max([dd, dr, rd, rr]) # find if there is a way to reach the end if maxComb == -1: out = -1 else: # same cell, can only count this cell once if i1 == i2 and j1 == j2: out = maxComb + self.grid[i1][j1] # different cell, can collect both else: out = maxComb + self.grid[i1][j1] + self.grid[i2][j2] # cache result self.memo[(i1, j1, i2, j2)] = out self.memo[(i2, j2, i1, j1)] = out return out # @lc code=end
class BaseDatasetFactory: def get_dataset(self, data, postprocessors=None, **kwargs): raise NotImplementedError def get_label_mapper(self, data=None, postprocessors=None, **kwargs): raise NotImplementedError def get_scorers(self): raise NotImplementedError
def main(): # input N = int(input()) # compute l_0, l_1 = 2, 1 if N == 1: print(l_1) else: for _ in range(N-1): l_i = l_0 + l_1 l_0, l_1 = l_1, l_i print(l_i) # output if __name__ == '__main__': main()
{ "id": "ac256b", "title": "Some Small Useful Features of GitHub Actions", "date": "2021-05-18", "tags": ['github', 'QuTiP'], }
USA = [ '%b %d %Y', '%b %-d %Y', '%b %d, %Y', '%b %-d, %Y', '%B %d, %Y', '%B %-d, %Y', '%B %d %Y', '%B %-d %Y', '%m/%d/%Y', '%m/%-d/%Y', '%m/%d/%y', '%m/%-d/%y', '%o of %B, %Y', '%B %o, %Y' ] EU = [ '%b %d %Y', '%b %-d %Y', '%b %d, %Y', '%b %-d, %Y', '%B %d, %Y', '%B %-d, %Y', '%B %d %Y', '%B %-d %Y', '%d/%m/%Y', '%-d/%m/%Y', '%d/%m/%y', '%-d/%m/%y', '%o of %B, %Y', '%B %o, %Y' ]
def count_inversions(arr): start_index = 0 end_index = len(arr) - 1 output = inversion_count_func(arr, start_index, end_index) return output def inversion_count_func(arr, start_index, end_index): if start_index >= end_index: return 0 mid_index = start_index + (end_index - start_index) // 2 # find number of inversions in left-half left_answer = inversion_count_func(arr, start_index, mid_index) # find number of inversions in right-half right_answer = inversion_count_func(arr, mid_index + 1, end_index) output = left_answer + right_answer # merge two sorted halves and count inversions while merging output += merge_two_sorted_halves(arr, start_index, mid_index, mid_index + 1, end_index) return output def merge_two_sorted_halves(arr, start_one, end_one, start_two, end_two): count = 0 left_index = start_one right_index = start_two output_length = (end_two - start_two + 1) + (end_one - start_one + 1) output_list = [0 for _ in range(output_length)] index = 0 while index < output_length: # if left <= right, it's not an inversion if arr[left_index] <= arr[right_index]: output_list[index] = arr[left_index] left_index += 1 else: count = count + (end_one - left_index + 1) # left > right hence it's an inversion output_list[index] = arr[right_index] right_index += 1 index = index + 1 if left_index > end_one: for i in range(right_index, end_two + 1): output_list[index] = arr[i] index += 1 break elif right_index > end_two: for i in range(left_index, end_one + 1): output_list[index] = arr[i] index += 1 break index = start_one for i in range(output_length): arr[index] = output_list[i] index += 1 return count
# -*- coding: utf-8 -*- """ Vendored versions of required libraries. """
# 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 # # http://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. #*** nmeta - Network Metadata - API definition file # Records of flows that have been removed by switches # (generally due to idle timeout) # Not deduplicated for multiple switches flows_removed_schema = { 'dpid': { 'type': 'integer' }, 'removal_time': { 'type': 'datetime' }, 'cookie': { 'type': 'string' }, 'priority': { 'type': 'integer' }, 'reason': { 'type': 'string' }, 'table_id': { 'type': 'integer' }, 'duration_sec': { 'type': 'string' }, 'idle_timeout': { 'type': 'string' }, 'hard_timeout': { 'type': 'string' }, 'packet_count': { 'type': 'integer' }, 'byte_count': { 'type': 'integer' }, 'eth_A': { 'type': 'string' }, 'eth_B': { 'type': 'string' }, 'eth_type': { 'type': 'string' }, 'ip_A': { 'type': 'string' }, 'ip_B': { 'type': 'string' }, 'ip_proto': { 'type': 'string' }, 'tp_A': { 'type': 'string' }, 'tp_B': { 'type': 'string' }, 'flow_hash': { 'type': 'string' }, 'direction': { 'type': 'string' } } flows_removed_settings = { 'url': 'flows_removed', 'item_title': 'Flows Removed', 'schema': flows_removed_schema, 'datasource': { 'source': 'flow_rems' } } #*** Removed flows count (does not deduplicate for multiple switches): flows_removed_stats_count_schema = { 'flows_removed_count': { 'type': 'integer' } } flows_removed_stats_count_settings = { 'url': 'flows_removed/stats/count', 'item_title': 'Count of Removed Flows', 'schema': flows_removed_stats_count_schema } #*** Removed flows bytes sent by source IP (dedup for multiple switches): flows_removed_src_bytes_sent_schema = { '_items': { '_id': 'string', 'identity': 'string', 'total_bytes_sent': 'integer' } } flows_removed_src_bytes_sent_settings = { 'url': 'flows_removed/stats/src_bytes_sent', 'item_title': 'Removed Flows Bytes Sent by Source IP', 'schema': flows_removed_src_bytes_sent_schema } #*** Removed flows bytes received by source IP (dedup for multiple switches): flows_removed_src_bytes_received_schema = { '_items': { '_id': 'string', 'identity': 'string', 'total_bytes_received': 'integer' } } flows_removed_src_bytes_received_settings = { 'url': 'flows_removed/stats/src_bytes_received', 'item_title': 'Removed Flows Bytes Received by Source IP', 'schema': flows_removed_src_bytes_received_schema } #*** Removed flows bytes sent by destination IP (dedup for multiple switches): flows_removed_dst_bytes_sent_schema = { '_items': { '_id': 'string', 'identity': 'string', 'total_bytes_sent': 'integer' } } flows_removed_dst_bytes_sent_settings = { 'url': 'flows_removed/stats/dst_bytes_sent', 'item_title': 'Removed Flows Bytes Sent by Source IP', 'schema': flows_removed_dst_bytes_sent_schema } #*** Removed flows bytes received by destination IP (dedup for multiple switches): flows_removed_dst_bytes_received_schema = { '_items': { '_id': 'string', 'identity': 'string', 'total_bytes_received': 'integer' } } flows_removed_dst_bytes_received_settings = { 'url': 'flows_removed/stats/dst_bytes_received', 'item_title': 'Removed Flows Bytes Received by Source IP', 'schema': flows_removed_dst_bytes_received_schema }
print('Vamos analisar três números inteiros de sua preferência!') n1 = int(input('1º número: ')) n2 = int(input('2º número: ')) n3 = int(input('3º número: ')) lista = [n1, n2, n3] lista.sort() print('O menor número digitado foi {}, enquanto o maior foi {}.'.format(lista[0], lista[2]))
"""convert pretrained models""" def key_transformation(old_key): # print(old_key) if '.' in old_key: a, b = old_key.split('.', 1) if a == "cnn": return f"body.{b}" return old_key # body.0.weight", "cnn.1.weight rename_state_dict_keys(e['NoRoIPoolModel'].path/'models'/'bestmodel.pth', key_transformation)
# string = str(input()) # str1 = str(input()) # str2 = str(input()) # print(string.replace(str1,str2)) #num = int(input()) row =1;ct=1 for ctr in range(int(input())): for ctr1 in range(row): print(ct,end=' ') ct +=1 row +=1 print("\n")
filename = "ch10\programming.txt" with open(filename, 'w') as file_object: file_object.write("I love programming.\n") file_object.write("I want to be a great programmer.\n") #Concatenando novas informações (append) with open(filename, 'a') as file_object: file_object.write("May i construct some career and became famous.\n") file_object.write("Make a lot of money.\n") file_object.write("Be an important person to the world.\n") #Condição para abrir um arquivo document_path = "ch10/arquivo_teste.txt" try: document_file = open(document_path) except FileNotFoundError: document_file = open(document_path, 'w')
def MakeClass(impF: dict): class X: RawFunctions = impF GeneratedFunctions = dict() def __init__(self): self.x = 1 return def cc(self, name) -> callable: if name in X.GeneratedFunctions: return X.GeneratedFunctions[name] raise NotImplementedError return X def main(): def X(this): return 1 TEST = MakeClass({"Test": X}) TX = TEST() e = TX.cc("Test")() return if __name__ == "__main__": main()
# Auto-generated file (see get_api_items.py) def get_mapped_items(): mapped_wiki_inline_code = dict() mapped_wiki_inline_code['*emscripten_get_preloaded_image_data'] = ':c:func:`*emscripten_get_preloaded_image_data`' mapped_wiki_inline_code['*emscripten_get_preloaded_image_data()'] = ':c:func:`*emscripten_get_preloaded_image_data`' mapped_wiki_inline_code['*emscripten_get_preloaded_image_data_from_FILE'] = ':c:func:`*emscripten_get_preloaded_image_data_from_FILE`' mapped_wiki_inline_code['*emscripten_get_preloaded_image_data_from_FILE()'] = ':c:func:`*emscripten_get_preloaded_image_data_from_FILE`' mapped_wiki_inline_code['*emscripten_run_script_string'] = ':c:func:`*emscripten_run_script_string`' mapped_wiki_inline_code['*emscripten_run_script_string()'] = ':c:func:`*emscripten_run_script_string`' mapped_wiki_inline_code[':'] = ':cpp:class:`:`' mapped_wiki_inline_code['AsciiToString'] = ':js:func:`AsciiToString`' mapped_wiki_inline_code['AsciiToString()'] = ':js:func:`AsciiToString`' mapped_wiki_inline_code['DOM_DELTA_LINE'] = ':c:macro:`DOM_DELTA_LINE`' mapped_wiki_inline_code['DOM_DELTA_PAGE'] = ':c:macro:`DOM_DELTA_PAGE`' mapped_wiki_inline_code['DOM_DELTA_PIXEL'] = ':c:macro:`DOM_DELTA_PIXEL`' mapped_wiki_inline_code['DOM_KEY_LOCATION'] = ':c:macro:`DOM_KEY_LOCATION`' mapped_wiki_inline_code['EMSCRIPTEN_BINDINGS'] = ':cpp:func:`EMSCRIPTEN_BINDINGS`' mapped_wiki_inline_code['EMSCRIPTEN_BINDINGS()'] = ':cpp:func:`EMSCRIPTEN_BINDINGS`' mapped_wiki_inline_code['EMSCRIPTEN_EVENT_BATTERYCHARGINGCHANGE'] = ':c:macro:`EMSCRIPTEN_EVENT_BATTERYCHARGINGCHANGE`' mapped_wiki_inline_code['EMSCRIPTEN_EVENT_BEFOREUNLOAD'] = ':c:macro:`EMSCRIPTEN_EVENT_BEFOREUNLOAD`' mapped_wiki_inline_code['EMSCRIPTEN_EVENT_BLUR'] = ':c:macro:`EMSCRIPTEN_EVENT_BLUR`' mapped_wiki_inline_code['EMSCRIPTEN_EVENT_CLICK'] = ':c:macro:`EMSCRIPTEN_EVENT_CLICK`' mapped_wiki_inline_code['EMSCRIPTEN_EVENT_DEVICEMOTION'] = ':c:macro:`EMSCRIPTEN_EVENT_DEVICEMOTION`' mapped_wiki_inline_code['EMSCRIPTEN_EVENT_DEVICEORIENTATION'] = ':c:macro:`EMSCRIPTEN_EVENT_DEVICEORIENTATION`' mapped_wiki_inline_code['EMSCRIPTEN_EVENT_FULLSCREENCHANGE'] = ':c:macro:`EMSCRIPTEN_EVENT_FULLSCREENCHANGE`' mapped_wiki_inline_code['EMSCRIPTEN_EVENT_GAMEPADCONNECTED'] = ':c:macro:`EMSCRIPTEN_EVENT_GAMEPADCONNECTED`' mapped_wiki_inline_code['EMSCRIPTEN_EVENT_KEYPRESS'] = ':c:macro:`EMSCRIPTEN_EVENT_KEYPRESS`' mapped_wiki_inline_code['EMSCRIPTEN_EVENT_ORIENTATIONCHANGE'] = ':c:macro:`EMSCRIPTEN_EVENT_ORIENTATIONCHANGE`' mapped_wiki_inline_code['EMSCRIPTEN_EVENT_POINTERLOCKCHANGE'] = ':c:macro:`EMSCRIPTEN_EVENT_POINTERLOCKCHANGE`' mapped_wiki_inline_code['EMSCRIPTEN_EVENT_POINTERLOCKERROR'] = ':c:macro:`EMSCRIPTEN_EVENT_POINTERLOCKERROR`' mapped_wiki_inline_code['EMSCRIPTEN_EVENT_RESIZE'] = ':c:macro:`EMSCRIPTEN_EVENT_RESIZE`' mapped_wiki_inline_code['EMSCRIPTEN_EVENT_TOUCHSTART'] = ':c:macro:`EMSCRIPTEN_EVENT_TOUCHSTART`' mapped_wiki_inline_code['EMSCRIPTEN_EVENT_VISIBILITYCHANGE'] = ':c:macro:`EMSCRIPTEN_EVENT_VISIBILITYCHANGE`' mapped_wiki_inline_code['EMSCRIPTEN_EVENT_WEBGLCONTEXTLOST'] = ':c:macro:`EMSCRIPTEN_EVENT_WEBGLCONTEXTLOST`' mapped_wiki_inline_code['EMSCRIPTEN_EVENT_WHEEL'] = ':c:macro:`EMSCRIPTEN_EVENT_WHEEL`' mapped_wiki_inline_code['EMSCRIPTEN_FULLSCREEN_CANVAS_SCALE'] = ':c:macro:`EMSCRIPTEN_FULLSCREEN_CANVAS_SCALE`' mapped_wiki_inline_code['EMSCRIPTEN_FULLSCREEN_CANVAS_SCALE_HIDEF'] = ':c:macro:`EMSCRIPTEN_FULLSCREEN_CANVAS_SCALE_HIDEF`' mapped_wiki_inline_code['EMSCRIPTEN_FULLSCREEN_CANVAS_SCALE_NONE'] = ':c:macro:`EMSCRIPTEN_FULLSCREEN_CANVAS_SCALE_NONE`' mapped_wiki_inline_code['EMSCRIPTEN_FULLSCREEN_CANVAS_SCALE_STDDEF'] = ':c:macro:`EMSCRIPTEN_FULLSCREEN_CANVAS_SCALE_STDDEF`' mapped_wiki_inline_code['EMSCRIPTEN_FULLSCREEN_FILTERING'] = ':c:macro:`EMSCRIPTEN_FULLSCREEN_FILTERING`' mapped_wiki_inline_code['EMSCRIPTEN_FULLSCREEN_FILTERING_BILINEAR'] = ':c:macro:`EMSCRIPTEN_FULLSCREEN_FILTERING_BILINEAR`' mapped_wiki_inline_code['EMSCRIPTEN_FULLSCREEN_FILTERING_DEFAULT'] = ':c:macro:`EMSCRIPTEN_FULLSCREEN_FILTERING_DEFAULT`' mapped_wiki_inline_code['EMSCRIPTEN_FULLSCREEN_FILTERING_NEAREST'] = ':c:macro:`EMSCRIPTEN_FULLSCREEN_FILTERING_NEAREST`' mapped_wiki_inline_code['EMSCRIPTEN_FULLSCREEN_SCALE'] = ':c:macro:`EMSCRIPTEN_FULLSCREEN_SCALE`' mapped_wiki_inline_code['EMSCRIPTEN_FULLSCREEN_SCALE_ASPECT'] = ':c:macro:`EMSCRIPTEN_FULLSCREEN_SCALE_ASPECT`' mapped_wiki_inline_code['EMSCRIPTEN_FULLSCREEN_SCALE_DEFAULT'] = ':c:macro:`EMSCRIPTEN_FULLSCREEN_SCALE_DEFAULT`' mapped_wiki_inline_code['EMSCRIPTEN_FULLSCREEN_SCALE_STRETCH'] = ':c:macro:`EMSCRIPTEN_FULLSCREEN_SCALE_STRETCH`' mapped_wiki_inline_code['EMSCRIPTEN_KEEPALIVE'] = ':c:macro:`EMSCRIPTEN_KEEPALIVE`' mapped_wiki_inline_code['EMSCRIPTEN_ORIENTATION_LANDSCAPE_PRIMARY'] = ':c:macro:`EMSCRIPTEN_ORIENTATION_LANDSCAPE_PRIMARY`' mapped_wiki_inline_code['EMSCRIPTEN_ORIENTATION_LANDSCAPE_SECONDARY'] = ':c:macro:`EMSCRIPTEN_ORIENTATION_LANDSCAPE_SECONDARY`' mapped_wiki_inline_code['EMSCRIPTEN_ORIENTATION_PORTRAIT_PRIMARY'] = ':c:macro:`EMSCRIPTEN_ORIENTATION_PORTRAIT_PRIMARY`' mapped_wiki_inline_code['EMSCRIPTEN_ORIENTATION_PORTRAIT_SECONDARY'] = ':c:macro:`EMSCRIPTEN_ORIENTATION_PORTRAIT_SECONDARY`' mapped_wiki_inline_code['EMSCRIPTEN_RESULT'] = ':c:macro:`EMSCRIPTEN_RESULT`' mapped_wiki_inline_code['EMSCRIPTEN_VISIBILITY_HIDDEN'] = ':c:macro:`EMSCRIPTEN_VISIBILITY_HIDDEN`' mapped_wiki_inline_code['EMSCRIPTEN_VISIBILITY_PRERENDER'] = ':c:macro:`EMSCRIPTEN_VISIBILITY_PRERENDER`' mapped_wiki_inline_code['EMSCRIPTEN_VISIBILITY_UNLOADED'] = ':c:macro:`EMSCRIPTEN_VISIBILITY_UNLOADED`' mapped_wiki_inline_code['EMSCRIPTEN_VISIBILITY_VISIBLE'] = ':c:macro:`EMSCRIPTEN_VISIBILITY_VISIBLE`' mapped_wiki_inline_code['EMSCRIPTEN_WEBGL_CONTEXT_HANDLE'] = ':c:type:`EMSCRIPTEN_WEBGL_CONTEXT_HANDLE`' mapped_wiki_inline_code['EMSCRIPTEN_WRAPPER'] = ':cpp:func:`EMSCRIPTEN_WRAPPER`' mapped_wiki_inline_code['EMSCRIPTEN_WRAPPER()'] = ':cpp:func:`EMSCRIPTEN_WRAPPER`' mapped_wiki_inline_code['EM_ASM'] = ':c:macro:`EM_ASM`' mapped_wiki_inline_code['EM_ASM_INT'] = ':c:macro:`EM_ASM_INT`' mapped_wiki_inline_code['EM_BOOL'] = ':c:macro:`EM_BOOL`' mapped_wiki_inline_code['EM_JS'] = ':c:macro:`EM_JS`' mapped_wiki_inline_code['EM_LOG_CONSOLE'] = ':c:macro:`EM_LOG_CONSOLE`' mapped_wiki_inline_code['EM_LOG_C_STACK'] = ':c:macro:`EM_LOG_C_STACK`' mapped_wiki_inline_code['EM_LOG_ERROR'] = ':c:macro:`EM_LOG_ERROR`' mapped_wiki_inline_code['EM_LOG_FUNC_PARAMS'] = ':c:macro:`EM_LOG_FUNC_PARAMS`' mapped_wiki_inline_code['EM_LOG_JS_STACK'] = ':c:macro:`EM_LOG_JS_STACK`' mapped_wiki_inline_code['EM_LOG_NO_PATHS'] = ':c:macro:`EM_LOG_NO_PATHS`' mapped_wiki_inline_code['EM_LOG_WARN'] = ':c:macro:`EM_LOG_WARN`' mapped_wiki_inline_code['EM_LOG_INFO'] = ':c:macro:`EM_LOG_INFO`' mapped_wiki_inline_code['EM_LOG_DEBUG'] = ':c:macro:`EM_LOG_DEBUG`' mapped_wiki_inline_code['EM_UTF8'] = ':c:macro:`EM_UTF8`' mapped_wiki_inline_code['EmscriptenBatteryEvent'] = ':c:type:`EmscriptenBatteryEvent`' mapped_wiki_inline_code['EmscriptenDeviceMotionEvent'] = ':c:type:`EmscriptenDeviceMotionEvent`' mapped_wiki_inline_code['EmscriptenDeviceOrientationEvent'] = ':c:type:`EmscriptenDeviceOrientationEvent`' mapped_wiki_inline_code['EmscriptenFocusEvent'] = ':c:type:`EmscriptenFocusEvent`' mapped_wiki_inline_code['EmscriptenFullscreenChangeEvent'] = ':c:type:`EmscriptenFullscreenChangeEvent`' mapped_wiki_inline_code['EmscriptenFullscreenStrategy'] = ':c:type:`EmscriptenFullscreenStrategy`' mapped_wiki_inline_code['EmscriptenGamepadEvent'] = ':c:type:`EmscriptenGamepadEvent`' mapped_wiki_inline_code['EmscriptenKeyboardEvent'] = ':c:type:`EmscriptenKeyboardEvent`' mapped_wiki_inline_code['EmscriptenMouseEvent'] = ':c:type:`EmscriptenMouseEvent`' mapped_wiki_inline_code['EmscriptenOrientationChangeEvent'] = ':c:type:`EmscriptenOrientationChangeEvent`' mapped_wiki_inline_code['EmscriptenPointerlockChangeEvent'] = ':c:type:`EmscriptenPointerlockChangeEvent`' mapped_wiki_inline_code['EmscriptenTouchEvent'] = ':c:type:`EmscriptenTouchEvent`' mapped_wiki_inline_code['EmscriptenTouchPoint'] = ':c:type:`EmscriptenTouchPoint`' mapped_wiki_inline_code['EmscriptenUiEvent'] = ':c:type:`EmscriptenUiEvent`' mapped_wiki_inline_code['EmscriptenVisibilityChangeEvent'] = ':c:type:`EmscriptenVisibilityChangeEvent`' mapped_wiki_inline_code['EmscriptenWebGLContextAttributes'] = ':c:type:`EmscriptenWebGLContextAttributes`' mapped_wiki_inline_code['EmscriptenWheelEvent'] = ':c:type:`EmscriptenWheelEvent`' mapped_wiki_inline_code['FS.chmod'] = ':js:func:`FS.chmod`' mapped_wiki_inline_code['FS.chmod()'] = ':js:func:`FS.chmod`' mapped_wiki_inline_code['FS.chown'] = ':js:func:`FS.chown`' mapped_wiki_inline_code['FS.chown()'] = ':js:func:`FS.chown`' mapped_wiki_inline_code['FS.close'] = ':js:func:`FS.close`' mapped_wiki_inline_code['FS.close()'] = ':js:func:`FS.close`' mapped_wiki_inline_code['FS.createLazyFile'] = ':js:func:`FS.createLazyFile`' mapped_wiki_inline_code['FS.createLazyFile()'] = ':js:func:`FS.createLazyFile`' mapped_wiki_inline_code['FS.createPreloadedFile'] = ':js:func:`FS.createPreloadedFile`' mapped_wiki_inline_code['FS.createPreloadedFile()'] = ':js:func:`FS.createPreloadedFile`' mapped_wiki_inline_code['FS.cwd'] = ':js:func:`FS.cwd`' mapped_wiki_inline_code['FS.cwd()'] = ':js:func:`FS.cwd`' mapped_wiki_inline_code['FS.fchmod'] = ':js:func:`FS.fchmod`' mapped_wiki_inline_code['FS.fchmod()'] = ':js:func:`FS.fchmod`' mapped_wiki_inline_code['FS.fchown'] = ':js:func:`FS.fchown`' mapped_wiki_inline_code['FS.fchown()'] = ':js:func:`FS.fchown`' mapped_wiki_inline_code['FS.ftruncate'] = ':js:func:`FS.ftruncate`' mapped_wiki_inline_code['FS.ftruncate()'] = ':js:func:`FS.ftruncate`' mapped_wiki_inline_code['FS.getMode'] = ':js:func:`FS.getMode`' mapped_wiki_inline_code['FS.getMode()'] = ':js:func:`FS.getMode`' mapped_wiki_inline_code['FS.getPath'] = ':js:func:`FS.getPath`' mapped_wiki_inline_code['FS.getPath()'] = ':js:func:`FS.getPath`' mapped_wiki_inline_code['FS.init'] = ':js:func:`FS.init`' mapped_wiki_inline_code['FS.init()'] = ':js:func:`FS.init`' mapped_wiki_inline_code['FS.isBlkdev'] = ':js:func:`FS.isBlkdev`' mapped_wiki_inline_code['FS.isBlkdev()'] = ':js:func:`FS.isBlkdev`' mapped_wiki_inline_code['FS.isChrdev'] = ':js:func:`FS.isChrdev`' mapped_wiki_inline_code['FS.isChrdev()'] = ':js:func:`FS.isChrdev`' mapped_wiki_inline_code['FS.isDir'] = ':js:func:`FS.isDir`' mapped_wiki_inline_code['FS.isDir()'] = ':js:func:`FS.isDir`' mapped_wiki_inline_code['FS.isFile'] = ':js:func:`FS.isFile`' mapped_wiki_inline_code['FS.isFile()'] = ':js:func:`FS.isFile`' mapped_wiki_inline_code['FS.isLink'] = ':js:func:`FS.isLink`' mapped_wiki_inline_code['FS.isLink()'] = ':js:func:`FS.isLink`' mapped_wiki_inline_code['FS.isSocket'] = ':js:func:`FS.isSocket`' mapped_wiki_inline_code['FS.isSocket()'] = ':js:func:`FS.isSocket`' mapped_wiki_inline_code['FS.lchmod'] = ':js:func:`FS.lchmod`' mapped_wiki_inline_code['FS.lchmod()'] = ':js:func:`FS.lchmod`' mapped_wiki_inline_code['FS.lchown'] = ':js:func:`FS.lchown`' mapped_wiki_inline_code['FS.lchown()'] = ':js:func:`FS.lchown`' mapped_wiki_inline_code['FS.llseek'] = ':js:func:`FS.llseek`' mapped_wiki_inline_code['FS.llseek()'] = ':js:func:`FS.llseek`' mapped_wiki_inline_code['FS.lookupPath'] = ':js:func:`FS.lookupPath`' mapped_wiki_inline_code['FS.lookupPath()'] = ':js:func:`FS.lookupPath`' mapped_wiki_inline_code['FS.lstat'] = ':js:func:`FS.lstat`' mapped_wiki_inline_code['FS.lstat()'] = ':js:func:`FS.lstat`' mapped_wiki_inline_code['FS.makedev'] = ':js:func:`FS.makedev`' mapped_wiki_inline_code['FS.makedev()'] = ':js:func:`FS.makedev`' mapped_wiki_inline_code['FS.mkdev'] = ':js:func:`FS.mkdev`' mapped_wiki_inline_code['FS.mkdev()'] = ':js:func:`FS.mkdev`' mapped_wiki_inline_code['FS.mkdir'] = ':js:func:`FS.mkdir`' mapped_wiki_inline_code['FS.mkdir()'] = ':js:func:`FS.mkdir`' mapped_wiki_inline_code['FS.mount'] = ':js:func:`FS.mount`' mapped_wiki_inline_code['FS.mount()'] = ':js:func:`FS.mount`' mapped_wiki_inline_code['FS.open'] = ':js:func:`FS.open`' mapped_wiki_inline_code['FS.open()'] = ':js:func:`FS.open`' mapped_wiki_inline_code['FS.read'] = ':js:func:`FS.read`' mapped_wiki_inline_code['FS.read()'] = ':js:func:`FS.read`' mapped_wiki_inline_code['FS.readFile'] = ':js:func:`FS.readFile`' mapped_wiki_inline_code['FS.readFile()'] = ':js:func:`FS.readFile`' mapped_wiki_inline_code['FS.readlink'] = ':js:func:`FS.readlink`' mapped_wiki_inline_code['FS.readlink()'] = ':js:func:`FS.readlink`' mapped_wiki_inline_code['FS.registerDevice'] = ':js:func:`FS.registerDevice`' mapped_wiki_inline_code['FS.registerDevice()'] = ':js:func:`FS.registerDevice`' mapped_wiki_inline_code['FS.rename'] = ':js:func:`FS.rename`' mapped_wiki_inline_code['FS.rename()'] = ':js:func:`FS.rename`' mapped_wiki_inline_code['FS.rmdir'] = ':js:func:`FS.rmdir`' mapped_wiki_inline_code['FS.rmdir()'] = ':js:func:`FS.rmdir`' mapped_wiki_inline_code['FS.stat'] = ':js:func:`FS.stat`' mapped_wiki_inline_code['FS.stat()'] = ':js:func:`FS.stat`' mapped_wiki_inline_code['FS.symlink'] = ':js:func:`FS.symlink`' mapped_wiki_inline_code['FS.symlink()'] = ':js:func:`FS.symlink`' mapped_wiki_inline_code['FS.syncfs'] = ':js:func:`FS.syncfs`' mapped_wiki_inline_code['FS.syncfs()'] = ':js:func:`FS.syncfs`' mapped_wiki_inline_code['FS.truncate'] = ':js:func:`FS.truncate`' mapped_wiki_inline_code['FS.truncate()'] = ':js:func:`FS.truncate`' mapped_wiki_inline_code['FS.unlink'] = ':js:func:`FS.unlink`' mapped_wiki_inline_code['FS.unlink()'] = ':js:func:`FS.unlink`' mapped_wiki_inline_code['FS.unmount'] = ':js:func:`FS.unmount`' mapped_wiki_inline_code['FS.unmount()'] = ':js:func:`FS.unmount`' mapped_wiki_inline_code['FS.utime'] = ':js:func:`FS.utime`' mapped_wiki_inline_code['FS.utime()'] = ':js:func:`FS.utime`' mapped_wiki_inline_code['FS.write'] = ':js:func:`FS.write`' mapped_wiki_inline_code['FS.write()'] = ':js:func:`FS.write`' mapped_wiki_inline_code['FS.writeFile'] = ':js:func:`FS.writeFile`' mapped_wiki_inline_code['FS.writeFile()'] = ':js:func:`FS.writeFile`' mapped_wiki_inline_code['HEAP16'] = ':js:data:`HEAP16`' mapped_wiki_inline_code['HEAP32'] = ':js:data:`HEAP32`' mapped_wiki_inline_code['HEAP8'] = ':js:data:`HEAP8`' mapped_wiki_inline_code['HEAPF32'] = ':js:data:`HEAPF32`' mapped_wiki_inline_code['HEAPF64'] = ':js:data:`HEAPF64`' mapped_wiki_inline_code['HEAPU16'] = ':js:data:`HEAPU16`' mapped_wiki_inline_code['HEAPU32'] = ':js:data:`HEAPU32`' mapped_wiki_inline_code['HEAPU8'] = ':js:data:`HEAPU8`' mapped_wiki_inline_code['Module.arguments'] = ':js:attribute:`Module.arguments`' mapped_wiki_inline_code['Module.destroy'] = ':js:func:`Module.destroy`' mapped_wiki_inline_code['Module.destroy()'] = ':js:func:`Module.destroy`' mapped_wiki_inline_code['Module.getPreloadedPackage'] = ':js:func:`Module.getPreloadedPackage`' mapped_wiki_inline_code['Module.getPreloadedPackage()'] = ':js:func:`Module.getPreloadedPackage`' mapped_wiki_inline_code['Module.instantiateWasm'] = ':js:func:`Module.instantiateWasm`' mapped_wiki_inline_code['Module.instantiateWasm()'] = ':js:func:`Module.instantiateWasm`' mapped_wiki_inline_code['Module.locateFile'] = ':js:attribute:`Module.locateFile`' mapped_wiki_inline_code['Module.logReadFiles'] = ':js:attribute:`Module.logReadFiles`' mapped_wiki_inline_code['Module.noExitRuntime'] = ':js:attribute:`Module.noExitRuntime`' mapped_wiki_inline_code['Module.noInitialRun'] = ':js:attribute:`Module.noInitialRun`' mapped_wiki_inline_code['Module.onAbort'] = ':js:attribute:`Module.onAbort`' mapped_wiki_inline_code['Module.onCustomMessage'] = ':js:func:`Module.onCustomMessage`' mapped_wiki_inline_code['Module.onCustomMessage()'] = ':js:func:`Module.onCustomMessage`' mapped_wiki_inline_code['Module.onRuntimeInitialized'] = ':js:attribute:`Module.onRuntimeInitialized`' mapped_wiki_inline_code['Module.preInit'] = ':js:attribute:`Module.preInit`' mapped_wiki_inline_code['Module.preRun'] = ':js:attribute:`Module.preRun`' mapped_wiki_inline_code['Module.preinitializedWebGLContext'] = ':js:attribute:`Module.preinitializedWebGLContext`' mapped_wiki_inline_code['Module.print'] = ':js:attribute:`Module.print`' mapped_wiki_inline_code['Module.printErr'] = ':js:attribute:`Module.printErr`' mapped_wiki_inline_code['PointeeType>'] = ':cpp:type:`PointeeType>`' mapped_wiki_inline_code['UTF16ToString'] = ':js:func:`UTF16ToString`' mapped_wiki_inline_code['UTF16ToString()'] = ':js:func:`UTF16ToString`' mapped_wiki_inline_code['UTF32ToString'] = ':js:func:`UTF32ToString`' mapped_wiki_inline_code['UTF32ToString()'] = ':js:func:`UTF32ToString`' mapped_wiki_inline_code['UTF8ToString'] = ':js:func:`UTF8ToString`' mapped_wiki_inline_code['UTF8ToString()'] = ':js:func:`UTF8ToString`' mapped_wiki_inline_code['V>>'] = ':cpp:func:`V>>`' mapped_wiki_inline_code['V>>()'] = ':cpp:func:`V>>`' mapped_wiki_inline_code['VRDisplayCapabilities'] = ':c:type:`VRDisplayCapabilities`' mapped_wiki_inline_code['VREyeParameters'] = ':c:type:`VREyeParameters`' mapped_wiki_inline_code['VRFrameData'] = ':c:type:`VRFrameData`' mapped_wiki_inline_code['VRLayerInit'] = ':c:type:`VRLayerInit`' mapped_wiki_inline_code['VRPose'] = ':c:type:`VRPose`' mapped_wiki_inline_code['VRQuaternion'] = ':c:type:`VRQuaternion`' mapped_wiki_inline_code['VRVector3'] = ':c:type:`VRVector3`' mapped_wiki_inline_code['VR_EYE_LEFT'] = ':c:macro:`VR_EYE_LEFT`' mapped_wiki_inline_code['VR_LAYER_DEFAULT_LEFT_BOUNDS'] = ':c:macro:`VR_LAYER_DEFAULT_LEFT_BOUNDS`' mapped_wiki_inline_code['VR_POSE_POSITION'] = ':c:macro:`VR_POSE_POSITION`' mapped_wiki_inline_code['__getDynamicPointerType'] = ':cpp:func:`__getDynamicPointerType`' mapped_wiki_inline_code['__getDynamicPointerType()'] = ':cpp:func:`__getDynamicPointerType`' mapped_wiki_inline_code['addRunDependency'] = ':js:func:`addRunDependency`' mapped_wiki_inline_code['addRunDependency()'] = ':js:func:`addRunDependency`' mapped_wiki_inline_code['allocate'] = ':js:func:`allocate`' mapped_wiki_inline_code['allocate()'] = ':js:func:`allocate`' mapped_wiki_inline_code['allow_raw_pointer'] = ':cpp:type:`allow_raw_pointer`' mapped_wiki_inline_code['allow_raw_pointers'] = ':cpp:type:`allow_raw_pointers`' mapped_wiki_inline_code['arg'] = ':cpp:type:`arg`' mapped_wiki_inline_code['base'] = ':cpp:type:`base`' mapped_wiki_inline_code['ccall'] = ':js:func:`ccall`' mapped_wiki_inline_code['ccall()'] = ':js:func:`ccall`' mapped_wiki_inline_code['char*'] = ':c:func:`char*`' mapped_wiki_inline_code['char*()'] = ':c:func:`char*`' mapped_wiki_inline_code['class_'] = ':cpp:class:`class_`' mapped_wiki_inline_code['constant'] = ':cpp:func:`constant`' mapped_wiki_inline_code['constant()'] = ':cpp:func:`constant`' mapped_wiki_inline_code['constructor'] = ':cpp:type:`constructor`' mapped_wiki_inline_code['cwrap'] = ':js:func:`cwrap`' mapped_wiki_inline_code['cwrap()'] = ':js:func:`cwrap`' mapped_wiki_inline_code['default_smart_ptr_trait'] = ':cpp:type:`default_smart_ptr_trait`' mapped_wiki_inline_code['em_arg_callback_func'] = ':c:type:`em_arg_callback_func`' mapped_wiki_inline_code['em_async_wget2_data_onerror_func'] = ':c:type:`em_async_wget2_data_onerror_func`' mapped_wiki_inline_code['em_async_wget2_data_onload_func'] = ':c:type:`em_async_wget2_data_onload_func`' mapped_wiki_inline_code['em_async_wget2_data_onprogress_func'] = ':c:type:`em_async_wget2_data_onprogress_func`' mapped_wiki_inline_code['em_async_wget2_onload_func'] = ':c:type:`em_async_wget2_onload_func`' mapped_wiki_inline_code['em_async_wget2_onstatus_func'] = ':c:type:`em_async_wget2_onstatus_func`' mapped_wiki_inline_code['em_async_wget_onload_func'] = ':c:type:`em_async_wget_onload_func`' mapped_wiki_inline_code['em_battery_callback_func'] = ':c:type:`em_battery_callback_func`' mapped_wiki_inline_code['em_beforeunload_callback'] = ':c:type:`em_beforeunload_callback`' mapped_wiki_inline_code['em_callback_func'] = ':c:type:`em_callback_func`' mapped_wiki_inline_code['em_devicemotion_callback_func'] = ':c:type:`em_devicemotion_callback_func`' mapped_wiki_inline_code['em_deviceorientation_callback_func'] = ':c:type:`em_deviceorientation_callback_func`' mapped_wiki_inline_code['em_focus_callback_func'] = ':c:type:`em_focus_callback_func`' mapped_wiki_inline_code['em_fullscreenchange_callback_func'] = ':c:type:`em_fullscreenchange_callback_func`' mapped_wiki_inline_code['em_gamepad_callback_func'] = ':c:type:`em_gamepad_callback_func`' mapped_wiki_inline_code['em_key_callback_func'] = ':c:type:`em_key_callback_func`' mapped_wiki_inline_code['em_mouse_callback_func'] = ':c:type:`em_mouse_callback_func`' mapped_wiki_inline_code['em_orientationchange_callback_func'] = ':c:type:`em_orientationchange_callback_func`' mapped_wiki_inline_code['em_pointerlockchange_callback_func'] = ':c:type:`em_pointerlockchange_callback_func`' mapped_wiki_inline_code['em_pointerlockerror_callback_func'] = ':c:type:`em_pointerlockerror_callback_func`' mapped_wiki_inline_code['em_run_preload_plugins_data_onload_func'] = ':c:type:`em_run_preload_plugins_data_onload_func`' mapped_wiki_inline_code['em_socket_callback'] = ':c:type:`em_socket_callback`' mapped_wiki_inline_code['em_socket_error_callback'] = ':c:type:`em_socket_error_callback`' mapped_wiki_inline_code['em_str_callback_func'] = ':c:type:`em_str_callback_func`' mapped_wiki_inline_code['em_touch_callback_func'] = ':c:type:`em_touch_callback_func`' mapped_wiki_inline_code['em_ui_callback_func'] = ':c:type:`em_ui_callback_func`' mapped_wiki_inline_code['em_visibilitychange_callback_func'] = ':c:type:`em_visibilitychange_callback_func`' mapped_wiki_inline_code['em_webgl_context_callback'] = ':c:type:`em_webgl_context_callback`' mapped_wiki_inline_code['em_wheel_callback_func'] = ':c:type:`em_wheel_callback_func`' mapped_wiki_inline_code['em_worker_callback_func'] = ':c:type:`em_worker_callback_func`' mapped_wiki_inline_code['emscripten'] = ':cpp:namespace:`emscripten`' mapped_wiki_inline_code['emscripten::val'] = ':cpp:class:`emscripten::val`' mapped_wiki_inline_code['emscripten_align1_short'] = ':c:type:`emscripten_align1_short`' mapped_wiki_inline_code['emscripten_async_call'] = ':c:func:`emscripten_async_call`' mapped_wiki_inline_code['emscripten_async_call()'] = ':c:func:`emscripten_async_call`' mapped_wiki_inline_code['emscripten_async_load_script'] = ':c:func:`emscripten_async_load_script`' mapped_wiki_inline_code['emscripten_async_load_script()'] = ':c:func:`emscripten_async_load_script`' mapped_wiki_inline_code['emscripten_async_run_script'] = ':c:func:`emscripten_async_run_script`' mapped_wiki_inline_code['emscripten_async_run_script()'] = ':c:func:`emscripten_async_run_script`' mapped_wiki_inline_code['emscripten_async_wget'] = ':c:func:`emscripten_async_wget`' mapped_wiki_inline_code['emscripten_async_wget()'] = ':c:func:`emscripten_async_wget`' mapped_wiki_inline_code['emscripten_async_wget2'] = ':c:func:`emscripten_async_wget2`' mapped_wiki_inline_code['emscripten_async_wget2()'] = ':c:func:`emscripten_async_wget2`' mapped_wiki_inline_code['emscripten_async_wget2_abort'] = ':c:func:`emscripten_async_wget2_abort`' mapped_wiki_inline_code['emscripten_async_wget2_abort()'] = ':c:func:`emscripten_async_wget2_abort`' mapped_wiki_inline_code['emscripten_async_wget2_data'] = ':c:func:`emscripten_async_wget2_data`' mapped_wiki_inline_code['emscripten_async_wget2_data()'] = ':c:func:`emscripten_async_wget2_data`' mapped_wiki_inline_code['emscripten_async_wget_data'] = ':c:func:`emscripten_async_wget_data`' mapped_wiki_inline_code['emscripten_async_wget_data()'] = ':c:func:`emscripten_async_wget_data`' mapped_wiki_inline_code['emscripten_call_worker'] = ':c:func:`emscripten_call_worker`' mapped_wiki_inline_code['emscripten_call_worker()'] = ':c:func:`emscripten_call_worker`' mapped_wiki_inline_code['emscripten_cancel_animation_frame'] = ':c:func:`emscripten_cancel_animation_frame`' mapped_wiki_inline_code['emscripten_cancel_animation_frame()'] = ':c:func:`emscripten_cancel_animation_frame`' mapped_wiki_inline_code['emscripten_cancel_main_loop'] = ':c:func:`emscripten_cancel_main_loop`' mapped_wiki_inline_code['emscripten_cancel_main_loop()'] = ':c:func:`emscripten_cancel_main_loop`' mapped_wiki_inline_code['emscripten_clear_immediate'] = ':c:func:`emscripten_clear_immediate`' mapped_wiki_inline_code['emscripten_clear_immediate()'] = ':c:func:`emscripten_clear_immediate`' mapped_wiki_inline_code['emscripten_clear_interval'] = ':c:func:`emscripten_clear_interval`' mapped_wiki_inline_code['emscripten_clear_interval()'] = ':c:func:`emscripten_clear_interval`' mapped_wiki_inline_code['emscripten_clear_timeout'] = ':c:func:`emscripten_clear_timeout`' mapped_wiki_inline_code['emscripten_clear_timeout()'] = ':c:func:`emscripten_clear_timeout`' mapped_wiki_inline_code['emscripten_console_error'] = ':c:func:`emscripten_console_error`' mapped_wiki_inline_code['emscripten_console_error()'] = ':c:func:`emscripten_console_error`' mapped_wiki_inline_code['emscripten_console_log'] = ':c:func:`emscripten_console_log`' mapped_wiki_inline_code['emscripten_console_log()'] = ':c:func:`emscripten_console_log`' mapped_wiki_inline_code['emscripten_console_warn'] = ':c:func:`emscripten_console_warn`' mapped_wiki_inline_code['emscripten_console_warn()'] = ':c:func:`emscripten_console_warn`' mapped_wiki_inline_code['emscripten_coroutine'] = ':c:type:`emscripten_coroutine`' mapped_wiki_inline_code['emscripten_coroutine_create'] = ':c:func:`emscripten_coroutine_create`' mapped_wiki_inline_code['emscripten_coroutine_create()'] = ':c:func:`emscripten_coroutine_create`' mapped_wiki_inline_code['emscripten_coroutine_next'] = ':c:func:`emscripten_coroutine_next`' mapped_wiki_inline_code['emscripten_coroutine_next()'] = ':c:func:`emscripten_coroutine_next`' mapped_wiki_inline_code['emscripten_create_worker'] = ':c:func:`emscripten_create_worker`' mapped_wiki_inline_code['emscripten_create_worker()'] = ':c:func:`emscripten_create_worker`' mapped_wiki_inline_code['emscripten_date_now'] = ':c:func:`emscripten_date_now`' mapped_wiki_inline_code['emscripten_date_now()'] = ':c:func:`emscripten_date_now`' mapped_wiki_inline_code['emscripten_debugger'] = ':c:func:`emscripten_debugger`' mapped_wiki_inline_code['emscripten_debugger()'] = ':c:func:`emscripten_debugger`' mapped_wiki_inline_code['emscripten_destroy_worker'] = ':c:func:`emscripten_destroy_worker`' mapped_wiki_inline_code['emscripten_destroy_worker()'] = ':c:func:`emscripten_destroy_worker`' mapped_wiki_inline_code['emscripten_enter_soft_fullscreen'] = ':c:func:`emscripten_enter_soft_fullscreen`' mapped_wiki_inline_code['emscripten_enter_soft_fullscreen()'] = ':c:func:`emscripten_enter_soft_fullscreen`' mapped_wiki_inline_code['emscripten_exit_fullscreen'] = ':c:func:`emscripten_exit_fullscreen`' mapped_wiki_inline_code['emscripten_exit_fullscreen()'] = ':c:func:`emscripten_exit_fullscreen`' mapped_wiki_inline_code['emscripten_exit_pointerlock'] = ':c:func:`emscripten_exit_pointerlock`' mapped_wiki_inline_code['emscripten_exit_pointerlock()'] = ':c:func:`emscripten_exit_pointerlock`' mapped_wiki_inline_code['emscripten_exit_soft_fullscreen'] = ':c:func:`emscripten_exit_soft_fullscreen`' mapped_wiki_inline_code['emscripten_exit_soft_fullscreen()'] = ':c:func:`emscripten_exit_soft_fullscreen`' mapped_wiki_inline_code['emscripten_exit_with_live_runtime'] = ':c:func:`emscripten_exit_with_live_runtime`' mapped_wiki_inline_code['emscripten_exit_with_live_runtime()'] = ':c:func:`emscripten_exit_with_live_runtime`' mapped_wiki_inline_code['emscripten_force_exit'] = ':c:func:`emscripten_force_exit`' mapped_wiki_inline_code['emscripten_force_exit()'] = ':c:func:`emscripten_force_exit`' mapped_wiki_inline_code['emscripten_get_battery_status'] = ':c:func:`emscripten_get_battery_status`' mapped_wiki_inline_code['emscripten_get_battery_status()'] = ':c:func:`emscripten_get_battery_status`' mapped_wiki_inline_code['emscripten_get_callstack'] = ':c:func:`emscripten_get_callstack`' mapped_wiki_inline_code['emscripten_get_callstack()'] = ':c:func:`emscripten_get_callstack`' mapped_wiki_inline_code['emscripten_get_canvas_element_size'] = ':c:func:`emscripten_get_canvas_element_size`' mapped_wiki_inline_code['emscripten_get_canvas_element_size()'] = ':c:func:`emscripten_get_canvas_element_size`' mapped_wiki_inline_code['emscripten_get_compiler_setting'] = ':c:func:`emscripten_get_compiler_setting`' mapped_wiki_inline_code['emscripten_get_compiler_setting()'] = ':c:func:`emscripten_get_compiler_setting`' mapped_wiki_inline_code['emscripten_get_device_pixel_ratio'] = ':c:func:`emscripten_get_device_pixel_ratio`' mapped_wiki_inline_code['emscripten_get_device_pixel_ratio()'] = ':c:func:`emscripten_get_device_pixel_ratio`' mapped_wiki_inline_code['emscripten_get_devicemotion_status'] = ':c:func:`emscripten_get_devicemotion_status`' mapped_wiki_inline_code['emscripten_get_devicemotion_status()'] = ':c:func:`emscripten_get_devicemotion_status`' mapped_wiki_inline_code['emscripten_get_deviceorientation_status'] = ':c:func:`emscripten_get_deviceorientation_status`' mapped_wiki_inline_code['emscripten_get_deviceorientation_status()'] = ':c:func:`emscripten_get_deviceorientation_status`' mapped_wiki_inline_code['emscripten_get_element_css_size'] = ':c:func:`emscripten_get_element_css_size`' mapped_wiki_inline_code['emscripten_get_element_css_size()'] = ':c:func:`emscripten_get_element_css_size`' mapped_wiki_inline_code['emscripten_get_fullscreen_status'] = ':c:func:`emscripten_get_fullscreen_status`' mapped_wiki_inline_code['emscripten_get_fullscreen_status()'] = ':c:func:`emscripten_get_fullscreen_status`' mapped_wiki_inline_code['emscripten_get_gamepad_status'] = ':c:func:`emscripten_get_gamepad_status`' mapped_wiki_inline_code['emscripten_get_gamepad_status()'] = ':c:func:`emscripten_get_gamepad_status`' mapped_wiki_inline_code['emscripten_get_main_loop_timing'] = ':c:func:`emscripten_get_main_loop_timing`' mapped_wiki_inline_code['emscripten_get_main_loop_timing()'] = ':c:func:`emscripten_get_main_loop_timing`' mapped_wiki_inline_code['emscripten_get_mouse_status'] = ':c:func:`emscripten_get_mouse_status`' mapped_wiki_inline_code['emscripten_get_mouse_status()'] = ':c:func:`emscripten_get_mouse_status`' mapped_wiki_inline_code['emscripten_get_now'] = ':c:func:`emscripten_get_now`' mapped_wiki_inline_code['emscripten_get_now()'] = ':c:func:`emscripten_get_now`' mapped_wiki_inline_code['emscripten_get_num_gamepads'] = ':c:func:`emscripten_get_num_gamepads`' mapped_wiki_inline_code['emscripten_get_num_gamepads()'] = ':c:func:`emscripten_get_num_gamepads`' mapped_wiki_inline_code['emscripten_get_orientation_status'] = ':c:func:`emscripten_get_orientation_status`' mapped_wiki_inline_code['emscripten_get_orientation_status()'] = ':c:func:`emscripten_get_orientation_status`' mapped_wiki_inline_code['emscripten_get_pointerlock_status'] = ':c:func:`emscripten_get_pointerlock_status`' mapped_wiki_inline_code['emscripten_get_pointerlock_status()'] = ':c:func:`emscripten_get_pointerlock_status`' mapped_wiki_inline_code['emscripten_get_visibility_status'] = ':c:func:`emscripten_get_visibility_status`' mapped_wiki_inline_code['emscripten_get_visibility_status()'] = ':c:func:`emscripten_get_visibility_status`' mapped_wiki_inline_code['emscripten_get_worker_queue_size'] = ':c:func:`emscripten_get_worker_queue_size`' mapped_wiki_inline_code['emscripten_get_worker_queue_size()'] = ':c:func:`emscripten_get_worker_queue_size`' mapped_wiki_inline_code['emscripten_hide_mouse'] = ':c:func:`emscripten_hide_mouse`' mapped_wiki_inline_code['emscripten_hide_mouse()'] = ':c:func:`emscripten_hide_mouse`' mapped_wiki_inline_code['emscripten_idb_async_delete'] = ':c:func:`emscripten_idb_async_delete`' mapped_wiki_inline_code['emscripten_idb_async_delete()'] = ':c:func:`emscripten_idb_async_delete`' mapped_wiki_inline_code['emscripten_idb_async_exists'] = ':c:func:`emscripten_idb_async_exists`' mapped_wiki_inline_code['emscripten_idb_async_exists()'] = ':c:func:`emscripten_idb_async_exists`' mapped_wiki_inline_code['emscripten_idb_async_load'] = ':c:func:`emscripten_idb_async_load`' mapped_wiki_inline_code['emscripten_idb_async_load()'] = ':c:func:`emscripten_idb_async_load`' mapped_wiki_inline_code['emscripten_idb_async_store'] = ':c:func:`emscripten_idb_async_store`' mapped_wiki_inline_code['emscripten_idb_async_store()'] = ':c:func:`emscripten_idb_async_store`' mapped_wiki_inline_code['emscripten_idb_delete'] = ':c:func:`emscripten_idb_delete`' mapped_wiki_inline_code['emscripten_idb_delete()'] = ':c:func:`emscripten_idb_delete`' mapped_wiki_inline_code['emscripten_idb_exists'] = ':c:func:`emscripten_idb_exists`' mapped_wiki_inline_code['emscripten_idb_exists()'] = ':c:func:`emscripten_idb_exists`' mapped_wiki_inline_code['emscripten_idb_load'] = ':c:func:`emscripten_idb_load`' mapped_wiki_inline_code['emscripten_idb_load()'] = ':c:func:`emscripten_idb_load`' mapped_wiki_inline_code['emscripten_idb_store'] = ':c:func:`emscripten_idb_store`' mapped_wiki_inline_code['emscripten_idb_store()'] = ':c:func:`emscripten_idb_store`' mapped_wiki_inline_code['emscripten_is_webgl_context_lost'] = ':c:func:`emscripten_is_webgl_context_lost`' mapped_wiki_inline_code['emscripten_is_webgl_context_lost()'] = ':c:func:`emscripten_is_webgl_context_lost`' mapped_wiki_inline_code['emscripten_lock_orientation'] = ':c:func:`emscripten_lock_orientation`' mapped_wiki_inline_code['emscripten_lock_orientation()'] = ':c:func:`emscripten_lock_orientation`' mapped_wiki_inline_code['emscripten_log'] = ':c:func:`emscripten_log`' mapped_wiki_inline_code['emscripten_log()'] = ':c:func:`emscripten_log`' mapped_wiki_inline_code['emscripten_pause_main_loop'] = ':c:func:`emscripten_pause_main_loop`' mapped_wiki_inline_code['emscripten_pause_main_loop()'] = ':c:func:`emscripten_pause_main_loop`' mapped_wiki_inline_code['emscripten_performance_now'] = ':c:func:`emscripten_performance_now`' mapped_wiki_inline_code['emscripten_performance_now()'] = ':c:func:`emscripten_performance_now`' mapped_wiki_inline_code['emscripten_print_double'] = ':c:func:`emscripten_print_double`' mapped_wiki_inline_code['emscripten_print_double()'] = ':c:func:`emscripten_print_double`' mapped_wiki_inline_code['emscripten_push_main_loop_blocker'] = ':c:func:`emscripten_push_main_loop_blocker`' mapped_wiki_inline_code['emscripten_push_main_loop_blocker()'] = ':c:func:`emscripten_push_main_loop_blocker`' mapped_wiki_inline_code['emscripten_random'] = ':c:func:`emscripten_random`' mapped_wiki_inline_code['emscripten_random()'] = ':c:func:`emscripten_random`' mapped_wiki_inline_code['emscripten_request_animation_frame'] = ':c:func:`emscripten_request_animation_frame`' mapped_wiki_inline_code['emscripten_request_animation_frame()'] = ':c:func:`emscripten_request_animation_frame`' mapped_wiki_inline_code['emscripten_request_animation_frame_loop'] = ':c:func:`emscripten_request_animation_frame_loop`' mapped_wiki_inline_code['emscripten_request_animation_frame_loop()'] = ':c:func:`emscripten_request_animation_frame_loop`' mapped_wiki_inline_code['emscripten_request_fullscreen'] = ':c:func:`emscripten_request_fullscreen`' mapped_wiki_inline_code['emscripten_request_fullscreen()'] = ':c:func:`emscripten_request_fullscreen`' mapped_wiki_inline_code['emscripten_request_fullscreen_strategy'] = ':c:func:`emscripten_request_fullscreen_strategy`' mapped_wiki_inline_code['emscripten_request_fullscreen_strategy()'] = ':c:func:`emscripten_request_fullscreen_strategy`' mapped_wiki_inline_code['emscripten_request_pointerlock'] = ':c:func:`emscripten_request_pointerlock`' mapped_wiki_inline_code['emscripten_request_pointerlock()'] = ':c:func:`emscripten_request_pointerlock`' mapped_wiki_inline_code['emscripten_run_preload_plugins'] = ':c:func:`emscripten_run_preload_plugins`' mapped_wiki_inline_code['emscripten_run_preload_plugins()'] = ':c:func:`emscripten_run_preload_plugins`' mapped_wiki_inline_code['emscripten_run_preload_plugins_data'] = ':c:func:`emscripten_run_preload_plugins_data`' mapped_wiki_inline_code['emscripten_run_preload_plugins_data()'] = ':c:func:`emscripten_run_preload_plugins_data`' mapped_wiki_inline_code['emscripten_run_script'] = ':c:func:`emscripten_run_script`' mapped_wiki_inline_code['emscripten_run_script()'] = ':c:func:`emscripten_run_script`' mapped_wiki_inline_code['emscripten_run_script_int'] = ':c:func:`emscripten_run_script_int`' mapped_wiki_inline_code['emscripten_run_script_int()'] = ':c:func:`emscripten_run_script_int`' mapped_wiki_inline_code['emscripten_sample_gamepad_data'] = ':c:func:`emscripten_sample_gamepad_data`' mapped_wiki_inline_code['emscripten_sample_gamepad_data()'] = ':c:func:`emscripten_sample_gamepad_data`' mapped_wiki_inline_code['emscripten_set_batterychargingchange_callback'] = ':c:func:`emscripten_set_batterychargingchange_callback`' mapped_wiki_inline_code['emscripten_set_batterychargingchange_callback()'] = ':c:func:`emscripten_set_batterychargingchange_callback`' mapped_wiki_inline_code['emscripten_set_beforeunload_callback'] = ':c:func:`emscripten_set_beforeunload_callback`' mapped_wiki_inline_code['emscripten_set_beforeunload_callback()'] = ':c:func:`emscripten_set_beforeunload_callback`' mapped_wiki_inline_code['emscripten_set_blur_callback'] = ':c:func:`emscripten_set_blur_callback`' mapped_wiki_inline_code['emscripten_set_blur_callback()'] = ':c:func:`emscripten_set_blur_callback`' mapped_wiki_inline_code['emscripten_set_canvas_element_size'] = ':c:func:`emscripten_set_canvas_element_size`' mapped_wiki_inline_code['emscripten_set_canvas_element_size()'] = ':c:func:`emscripten_set_canvas_element_size`' mapped_wiki_inline_code['emscripten_set_click_callback'] = ':c:func:`emscripten_set_click_callback`' mapped_wiki_inline_code['emscripten_set_click_callback()'] = ':c:func:`emscripten_set_click_callback`' mapped_wiki_inline_code['emscripten_set_devicemotion_callback'] = ':c:func:`emscripten_set_devicemotion_callback`' mapped_wiki_inline_code['emscripten_set_devicemotion_callback()'] = ':c:func:`emscripten_set_devicemotion_callback`' mapped_wiki_inline_code['emscripten_set_deviceorientation_callback'] = ':c:func:`emscripten_set_deviceorientation_callback`' mapped_wiki_inline_code['emscripten_set_deviceorientation_callback()'] = ':c:func:`emscripten_set_deviceorientation_callback`' mapped_wiki_inline_code['emscripten_set_element_css_size'] = ':c:func:`emscripten_set_element_css_size`' mapped_wiki_inline_code['emscripten_set_element_css_size()'] = ':c:func:`emscripten_set_element_css_size`' mapped_wiki_inline_code['emscripten_set_fullscreenchange_callback'] = ':c:func:`emscripten_set_fullscreenchange_callback`' mapped_wiki_inline_code['emscripten_set_fullscreenchange_callback()'] = ':c:func:`emscripten_set_fullscreenchange_callback`' mapped_wiki_inline_code['emscripten_set_gamepadconnected_callback'] = ':c:func:`emscripten_set_gamepadconnected_callback`' mapped_wiki_inline_code['emscripten_set_gamepadconnected_callback()'] = ':c:func:`emscripten_set_gamepadconnected_callback`' mapped_wiki_inline_code['emscripten_set_immediate'] = ':c:func:`emscripten_set_immediate`' mapped_wiki_inline_code['emscripten_set_immediate()'] = ':c:func:`emscripten_set_immediate`' mapped_wiki_inline_code['emscripten_set_immediate_loop'] = ':c:func:`emscripten_set_immediate_loop`' mapped_wiki_inline_code['emscripten_set_immediate_loop()'] = ':c:func:`emscripten_set_immediate_loop`' mapped_wiki_inline_code['emscripten_set_interval'] = ':c:func:`emscripten_set_interval`' mapped_wiki_inline_code['emscripten_set_interval()'] = ':c:func:`emscripten_set_interval`' mapped_wiki_inline_code['emscripten_set_keypress_callback'] = ':c:func:`emscripten_set_keypress_callback`' mapped_wiki_inline_code['emscripten_set_keypress_callback()'] = ':c:func:`emscripten_set_keypress_callback`' mapped_wiki_inline_code['emscripten_set_main_loop'] = ':c:func:`emscripten_set_main_loop`' mapped_wiki_inline_code['emscripten_set_main_loop()'] = ':c:func:`emscripten_set_main_loop`' mapped_wiki_inline_code['emscripten_set_main_loop_arg'] = ':c:func:`emscripten_set_main_loop_arg`' mapped_wiki_inline_code['emscripten_set_main_loop_arg()'] = ':c:func:`emscripten_set_main_loop_arg`' mapped_wiki_inline_code['emscripten_set_main_loop_expected_blockers'] = ':c:func:`emscripten_set_main_loop_expected_blockers`' mapped_wiki_inline_code['emscripten_set_main_loop_expected_blockers()'] = ':c:func:`emscripten_set_main_loop_expected_blockers`' mapped_wiki_inline_code['emscripten_set_main_loop_timing'] = ':c:func:`emscripten_set_main_loop_timing`' mapped_wiki_inline_code['emscripten_set_main_loop_timing()'] = ':c:func:`emscripten_set_main_loop_timing`' mapped_wiki_inline_code['emscripten_set_orientationchange_callback'] = ':c:func:`emscripten_set_orientationchange_callback`' mapped_wiki_inline_code['emscripten_set_orientationchange_callback()'] = ':c:func:`emscripten_set_orientationchange_callback`' mapped_wiki_inline_code['emscripten_set_pointerlockchange_callback'] = ':c:func:`emscripten_set_pointerlockchange_callback`' mapped_wiki_inline_code['emscripten_set_pointerlockchange_callback()'] = ':c:func:`emscripten_set_pointerlockchange_callback`' mapped_wiki_inline_code['emscripten_set_pointerlockerror_callback'] = ':c:func:`emscripten_set_pointerlockerror_callback`' mapped_wiki_inline_code['emscripten_set_pointerlockerror_callback()'] = ':c:func:`emscripten_set_pointerlockerror_callback`' mapped_wiki_inline_code['emscripten_set_resize_callback'] = ':c:func:`emscripten_set_resize_callback`' mapped_wiki_inline_code['emscripten_set_resize_callback()'] = ':c:func:`emscripten_set_resize_callback`' mapped_wiki_inline_code['emscripten_set_socket_close_callback'] = ':c:func:`emscripten_set_socket_close_callback`' mapped_wiki_inline_code['emscripten_set_socket_close_callback()'] = ':c:func:`emscripten_set_socket_close_callback`' mapped_wiki_inline_code['emscripten_set_socket_connection_callback'] = ':c:func:`emscripten_set_socket_connection_callback`' mapped_wiki_inline_code['emscripten_set_socket_connection_callback()'] = ':c:func:`emscripten_set_socket_connection_callback`' mapped_wiki_inline_code['emscripten_set_socket_error_callback'] = ':c:func:`emscripten_set_socket_error_callback`' mapped_wiki_inline_code['emscripten_set_socket_error_callback()'] = ':c:func:`emscripten_set_socket_error_callback`' mapped_wiki_inline_code['emscripten_set_socket_listen_callback'] = ':c:func:`emscripten_set_socket_listen_callback`' mapped_wiki_inline_code['emscripten_set_socket_listen_callback()'] = ':c:func:`emscripten_set_socket_listen_callback`' mapped_wiki_inline_code['emscripten_set_socket_message_callback'] = ':c:func:`emscripten_set_socket_message_callback`' mapped_wiki_inline_code['emscripten_set_socket_message_callback()'] = ':c:func:`emscripten_set_socket_message_callback`' mapped_wiki_inline_code['emscripten_set_socket_open_callback'] = ':c:func:`emscripten_set_socket_open_callback`' mapped_wiki_inline_code['emscripten_set_socket_open_callback()'] = ':c:func:`emscripten_set_socket_open_callback`' mapped_wiki_inline_code['emscripten_set_timeout'] = ':c:func:`emscripten_set_timeout`' mapped_wiki_inline_code['emscripten_set_timeout()'] = ':c:func:`emscripten_set_timeout`' mapped_wiki_inline_code['emscripten_set_timeout_loop'] = ':c:func:`emscripten_set_timeout_loop`' mapped_wiki_inline_code['emscripten_set_timeout_loop()'] = ':c:func:`emscripten_set_timeout_loop`' mapped_wiki_inline_code['emscripten_set_touchstart_callback'] = ':c:func:`emscripten_set_touchstart_callback`' mapped_wiki_inline_code['emscripten_set_touchstart_callback()'] = ':c:func:`emscripten_set_touchstart_callback`' mapped_wiki_inline_code['emscripten_set_visibilitychange_callback'] = ':c:func:`emscripten_set_visibilitychange_callback`' mapped_wiki_inline_code['emscripten_set_visibilitychange_callback()'] = ':c:func:`emscripten_set_visibilitychange_callback`' mapped_wiki_inline_code['emscripten_set_webglcontextlost_callback'] = ':c:func:`emscripten_set_webglcontextlost_callback`' mapped_wiki_inline_code['emscripten_set_webglcontextlost_callback()'] = ':c:func:`emscripten_set_webglcontextlost_callback`' mapped_wiki_inline_code['emscripten_set_wheel_callback'] = ':c:func:`emscripten_set_wheel_callback`' mapped_wiki_inline_code['emscripten_set_wheel_callback()'] = ':c:func:`emscripten_set_wheel_callback`' mapped_wiki_inline_code['emscripten_sleep'] = ':c:func:`emscripten_sleep`' mapped_wiki_inline_code['emscripten_sleep()'] = ':c:func:`emscripten_sleep`' mapped_wiki_inline_code['emscripten_sleep_with_yield'] = ':c:func:`emscripten_sleep_with_yield`' mapped_wiki_inline_code['emscripten_sleep_with_yield()'] = ':c:func:`emscripten_sleep_with_yield`' mapped_wiki_inline_code['emscripten_throw_number'] = ':c:func:`emscripten_throw_number`' mapped_wiki_inline_code['emscripten_throw_number()'] = ':c:func:`emscripten_throw_number`' mapped_wiki_inline_code['emscripten_throw_string'] = ':c:func:`emscripten_throw_string`' mapped_wiki_inline_code['emscripten_throw_string()'] = ':c:func:`emscripten_throw_string`' mapped_wiki_inline_code['emscripten_trace_annotate_address_type'] = ':c:func:`emscripten_trace_annotate_address_type`' mapped_wiki_inline_code['emscripten_trace_annotate_address_type()'] = ':c:func:`emscripten_trace_annotate_address_type`' mapped_wiki_inline_code['emscripten_trace_associate_storage_size'] = ':c:func:`emscripten_trace_associate_storage_size`' mapped_wiki_inline_code['emscripten_trace_associate_storage_size()'] = ':c:func:`emscripten_trace_associate_storage_size`' mapped_wiki_inline_code['emscripten_trace_close'] = ':c:func:`emscripten_trace_close`' mapped_wiki_inline_code['emscripten_trace_close()'] = ':c:func:`emscripten_trace_close`' mapped_wiki_inline_code['emscripten_trace_configure'] = ':c:func:`emscripten_trace_configure`' mapped_wiki_inline_code['emscripten_trace_configure()'] = ':c:func:`emscripten_trace_configure`' mapped_wiki_inline_code['emscripten_trace_configure_for_google_wtf'] = ':c:func:`emscripten_trace_configure_for_google_wtf`' mapped_wiki_inline_code['emscripten_trace_configure_for_google_wtf()'] = ':c:func:`emscripten_trace_configure_for_google_wtf`' mapped_wiki_inline_code['emscripten_trace_enter_context'] = ':c:func:`emscripten_trace_enter_context`' mapped_wiki_inline_code['emscripten_trace_enter_context()'] = ':c:func:`emscripten_trace_enter_context`' mapped_wiki_inline_code['emscripten_trace_exit_context'] = ':c:func:`emscripten_trace_exit_context`' mapped_wiki_inline_code['emscripten_trace_exit_context()'] = ':c:func:`emscripten_trace_exit_context`' mapped_wiki_inline_code['emscripten_trace_log_message'] = ':c:func:`emscripten_trace_log_message`' mapped_wiki_inline_code['emscripten_trace_log_message()'] = ':c:func:`emscripten_trace_log_message`' mapped_wiki_inline_code['emscripten_trace_mark'] = ':c:func:`emscripten_trace_mark`' mapped_wiki_inline_code['emscripten_trace_mark()'] = ':c:func:`emscripten_trace_mark`' mapped_wiki_inline_code['emscripten_trace_record_allocation'] = ':c:func:`emscripten_trace_record_allocation`' mapped_wiki_inline_code['emscripten_trace_record_allocation()'] = ':c:func:`emscripten_trace_record_allocation`' mapped_wiki_inline_code['emscripten_trace_record_frame_end'] = ':c:func:`emscripten_trace_record_frame_end`' mapped_wiki_inline_code['emscripten_trace_record_frame_end()'] = ':c:func:`emscripten_trace_record_frame_end`' mapped_wiki_inline_code['emscripten_trace_record_frame_start'] = ':c:func:`emscripten_trace_record_frame_start`' mapped_wiki_inline_code['emscripten_trace_record_frame_start()'] = ':c:func:`emscripten_trace_record_frame_start`' mapped_wiki_inline_code['emscripten_trace_record_free'] = ':c:func:`emscripten_trace_record_free`' mapped_wiki_inline_code['emscripten_trace_record_free()'] = ':c:func:`emscripten_trace_record_free`' mapped_wiki_inline_code['emscripten_trace_record_reallocation'] = ':c:func:`emscripten_trace_record_reallocation`' mapped_wiki_inline_code['emscripten_trace_record_reallocation()'] = ':c:func:`emscripten_trace_record_reallocation`' mapped_wiki_inline_code['emscripten_trace_report_error'] = ':c:func:`emscripten_trace_report_error`' mapped_wiki_inline_code['emscripten_trace_report_error()'] = ':c:func:`emscripten_trace_report_error`' mapped_wiki_inline_code['emscripten_trace_report_memory_layout'] = ':c:func:`emscripten_trace_report_memory_layout`' mapped_wiki_inline_code['emscripten_trace_report_memory_layout()'] = ':c:func:`emscripten_trace_report_memory_layout`' mapped_wiki_inline_code['emscripten_trace_report_off_heap_data'] = ':c:func:`emscripten_trace_report_off_heap_data`' mapped_wiki_inline_code['emscripten_trace_report_off_heap_data()'] = ':c:func:`emscripten_trace_report_off_heap_data`' mapped_wiki_inline_code['emscripten_trace_set_enabled'] = ':c:func:`emscripten_trace_set_enabled`' mapped_wiki_inline_code['emscripten_trace_set_enabled()'] = ':c:func:`emscripten_trace_set_enabled`' mapped_wiki_inline_code['emscripten_trace_set_session_username'] = ':c:func:`emscripten_trace_set_session_username`' mapped_wiki_inline_code['emscripten_trace_set_session_username()'] = ':c:func:`emscripten_trace_set_session_username`' mapped_wiki_inline_code['emscripten_trace_task_associate_data'] = ':c:func:`emscripten_trace_task_associate_data`' mapped_wiki_inline_code['emscripten_trace_task_associate_data()'] = ':c:func:`emscripten_trace_task_associate_data`' mapped_wiki_inline_code['emscripten_trace_task_end'] = ':c:func:`emscripten_trace_task_end`' mapped_wiki_inline_code['emscripten_trace_task_end()'] = ':c:func:`emscripten_trace_task_end`' mapped_wiki_inline_code['emscripten_trace_task_resume'] = ':c:func:`emscripten_trace_task_resume`' mapped_wiki_inline_code['emscripten_trace_task_resume()'] = ':c:func:`emscripten_trace_task_resume`' mapped_wiki_inline_code['emscripten_trace_task_start'] = ':c:func:`emscripten_trace_task_start`' mapped_wiki_inline_code['emscripten_trace_task_start()'] = ':c:func:`emscripten_trace_task_start`' mapped_wiki_inline_code['emscripten_trace_task_suspend'] = ':c:func:`emscripten_trace_task_suspend`' mapped_wiki_inline_code['emscripten_trace_task_suspend()'] = ':c:func:`emscripten_trace_task_suspend`' mapped_wiki_inline_code['emscripten_unlock_orientation'] = ':c:func:`emscripten_unlock_orientation`' mapped_wiki_inline_code['emscripten_unlock_orientation()'] = ':c:func:`emscripten_unlock_orientation`' mapped_wiki_inline_code['emscripten_vibrate'] = ':c:func:`emscripten_vibrate`' mapped_wiki_inline_code['emscripten_vibrate()'] = ':c:func:`emscripten_vibrate`' mapped_wiki_inline_code['emscripten_vibrate_pattern'] = ':c:func:`emscripten_vibrate_pattern`' mapped_wiki_inline_code['emscripten_vibrate_pattern()'] = ':c:func:`emscripten_vibrate_pattern`' mapped_wiki_inline_code['emscripten_vr_cancel_display_render_loop'] = ':c:func:`emscripten_vr_cancel_display_render_loop`' mapped_wiki_inline_code['emscripten_vr_cancel_display_render_loop()'] = ':c:func:`emscripten_vr_cancel_display_render_loop`' mapped_wiki_inline_code['emscripten_vr_count_displays'] = ':c:func:`emscripten_vr_count_displays`' mapped_wiki_inline_code['emscripten_vr_count_displays()'] = ':c:func:`emscripten_vr_count_displays`' mapped_wiki_inline_code['emscripten_vr_deinit'] = ':c:func:`emscripten_vr_deinit`' mapped_wiki_inline_code['emscripten_vr_deinit()'] = ':c:func:`emscripten_vr_deinit`' mapped_wiki_inline_code['emscripten_vr_display_connected'] = ':c:func:`emscripten_vr_display_connected`' mapped_wiki_inline_code['emscripten_vr_display_connected()'] = ':c:func:`emscripten_vr_display_connected`' mapped_wiki_inline_code['emscripten_vr_display_presenting'] = ':c:func:`emscripten_vr_display_presenting`' mapped_wiki_inline_code['emscripten_vr_display_presenting()'] = ':c:func:`emscripten_vr_display_presenting`' mapped_wiki_inline_code['emscripten_vr_exit_present'] = ':c:func:`emscripten_vr_exit_present`' mapped_wiki_inline_code['emscripten_vr_exit_present()'] = ':c:func:`emscripten_vr_exit_present`' mapped_wiki_inline_code['emscripten_vr_get_display_capabilities'] = ':c:func:`emscripten_vr_get_display_capabilities`' mapped_wiki_inline_code['emscripten_vr_get_display_capabilities()'] = ':c:func:`emscripten_vr_get_display_capabilities`' mapped_wiki_inline_code['emscripten_vr_get_display_handle'] = ':c:func:`emscripten_vr_get_display_handle`' mapped_wiki_inline_code['emscripten_vr_get_display_handle()'] = ':c:func:`emscripten_vr_get_display_handle`' mapped_wiki_inline_code['emscripten_vr_get_eye_parameters'] = ':c:func:`emscripten_vr_get_eye_parameters`' mapped_wiki_inline_code['emscripten_vr_get_eye_parameters()'] = ':c:func:`emscripten_vr_get_eye_parameters`' mapped_wiki_inline_code['emscripten_vr_get_frame_data'] = ':c:func:`emscripten_vr_get_frame_data`' mapped_wiki_inline_code['emscripten_vr_get_frame_data()'] = ':c:func:`emscripten_vr_get_frame_data`' mapped_wiki_inline_code['emscripten_vr_init'] = ':c:func:`emscripten_vr_init`' mapped_wiki_inline_code['emscripten_vr_init()'] = ':c:func:`emscripten_vr_init`' mapped_wiki_inline_code['emscripten_vr_ready'] = ':c:func:`emscripten_vr_ready`' mapped_wiki_inline_code['emscripten_vr_ready()'] = ':c:func:`emscripten_vr_ready`' mapped_wiki_inline_code['emscripten_vr_request_present'] = ':c:func:`emscripten_vr_request_present`' mapped_wiki_inline_code['emscripten_vr_request_present()'] = ':c:func:`emscripten_vr_request_present`' mapped_wiki_inline_code['emscripten_vr_set_display_render_loop'] = ':c:func:`emscripten_vr_set_display_render_loop`' mapped_wiki_inline_code['emscripten_vr_set_display_render_loop()'] = ':c:func:`emscripten_vr_set_display_render_loop`' mapped_wiki_inline_code['emscripten_vr_set_display_render_loop_arg'] = ':c:func:`emscripten_vr_set_display_render_loop_arg`' mapped_wiki_inline_code['emscripten_vr_set_display_render_loop_arg()'] = ':c:func:`emscripten_vr_set_display_render_loop_arg`' mapped_wiki_inline_code['emscripten_vr_submit_frame'] = ':c:func:`emscripten_vr_submit_frame`' mapped_wiki_inline_code['emscripten_vr_submit_frame()'] = ':c:func:`emscripten_vr_submit_frame`' mapped_wiki_inline_code['emscripten_vr_version_major'] = ':c:func:`emscripten_vr_version_major`' mapped_wiki_inline_code['emscripten_vr_version_major()'] = ':c:func:`emscripten_vr_version_major`' mapped_wiki_inline_code['emscripten_vr_version_minor'] = ':c:func:`emscripten_vr_version_minor`' mapped_wiki_inline_code['emscripten_vr_version_minor()'] = ':c:func:`emscripten_vr_version_minor`' mapped_wiki_inline_code['emscripten_webgl_commit_frame'] = ':c:func:`emscripten_webgl_commit_frame`' mapped_wiki_inline_code['emscripten_webgl_commit_frame()'] = ':c:func:`emscripten_webgl_commit_frame`' mapped_wiki_inline_code['emscripten_webgl_create_context'] = ':c:func:`emscripten_webgl_create_context`' mapped_wiki_inline_code['emscripten_webgl_create_context()'] = ':c:func:`emscripten_webgl_create_context`' mapped_wiki_inline_code['emscripten_webgl_destroy_context'] = ':c:func:`emscripten_webgl_destroy_context`' mapped_wiki_inline_code['emscripten_webgl_destroy_context()'] = ':c:func:`emscripten_webgl_destroy_context`' mapped_wiki_inline_code['emscripten_webgl_enable_extension'] = ':c:func:`emscripten_webgl_enable_extension`' mapped_wiki_inline_code['emscripten_webgl_enable_extension()'] = ':c:func:`emscripten_webgl_enable_extension`' mapped_wiki_inline_code['emscripten_webgl_get_context_attributes'] = ':c:func:`emscripten_webgl_get_context_attributes`' mapped_wiki_inline_code['emscripten_webgl_get_context_attributes()'] = ':c:func:`emscripten_webgl_get_context_attributes`' mapped_wiki_inline_code['emscripten_webgl_get_current_context'] = ':c:func:`emscripten_webgl_get_current_context`' mapped_wiki_inline_code['emscripten_webgl_get_current_context()'] = ':c:func:`emscripten_webgl_get_current_context`' mapped_wiki_inline_code['emscripten_webgl_get_drawing_buffer_size'] = ':c:func:`emscripten_webgl_get_drawing_buffer_size`' mapped_wiki_inline_code['emscripten_webgl_get_drawing_buffer_size()'] = ':c:func:`emscripten_webgl_get_drawing_buffer_size`' mapped_wiki_inline_code['emscripten_webgl_init_context_attributes'] = ':c:func:`emscripten_webgl_init_context_attributes`' mapped_wiki_inline_code['emscripten_webgl_init_context_attributes()'] = ':c:func:`emscripten_webgl_init_context_attributes`' mapped_wiki_inline_code['emscripten_webgl_make_context_current'] = ':c:func:`emscripten_webgl_make_context_current`' mapped_wiki_inline_code['emscripten_webgl_make_context_current()'] = ':c:func:`emscripten_webgl_make_context_current`' mapped_wiki_inline_code['emscripten_wget'] = ':c:func:`emscripten_wget`' mapped_wiki_inline_code['emscripten_wget()'] = ':c:func:`emscripten_wget`' mapped_wiki_inline_code['emscripten_wget_data'] = ':c:func:`emscripten_wget_data`' mapped_wiki_inline_code['emscripten_wget_data()'] = ':c:func:`emscripten_wget_data`' mapped_wiki_inline_code['emscripten_worker_respond'] = ':c:func:`emscripten_worker_respond`' mapped_wiki_inline_code['emscripten_worker_respond()'] = ':c:func:`emscripten_worker_respond`' mapped_wiki_inline_code['emscripten_yield'] = ':c:func:`emscripten_yield`' mapped_wiki_inline_code['emscripten_yield()'] = ':c:func:`emscripten_yield`' mapped_wiki_inline_code['enum_'] = ':cpp:class:`enum_`' mapped_wiki_inline_code['function'] = ':cpp:func:`function`' mapped_wiki_inline_code['function()'] = ':cpp:func:`function`' mapped_wiki_inline_code['getValue'] = ':js:func:`getValue`' mapped_wiki_inline_code['getValue()'] = ':js:func:`getValue`' mapped_wiki_inline_code['intArrayFromString'] = ':js:func:`intArrayFromString`' mapped_wiki_inline_code['intArrayFromString()'] = ':js:func:`intArrayFromString`' mapped_wiki_inline_code['intArrayToString'] = ':js:func:`intArrayToString`' mapped_wiki_inline_code['intArrayToString()'] = ':js:func:`intArrayToString`' mapped_wiki_inline_code['internal::CalculateLambdaSignature<LambdaType>::type'] = ':cpp:func:`internal::CalculateLambdaSignature<LambdaType>::type`' mapped_wiki_inline_code['internal::CalculateLambdaSignature<LambdaType>::type()'] = ':cpp:func:`internal::CalculateLambdaSignature<LambdaType>::type`' mapped_wiki_inline_code['internal::MemberFunctionType<ClassType,'] = ':cpp:func:`internal::MemberFunctionType<ClassType,`' mapped_wiki_inline_code['internal::MemberFunctionType<ClassType,()'] = ':cpp:func:`internal::MemberFunctionType<ClassType,`' mapped_wiki_inline_code['pure_virtual'] = ':cpp:type:`pure_virtual`' mapped_wiki_inline_code['register_vector'] = ':cpp:func:`register_vector`' mapped_wiki_inline_code['register_vector()'] = ':cpp:func:`register_vector`' mapped_wiki_inline_code['removeRunDependency'] = ':js:func:`removeRunDependency`' mapped_wiki_inline_code['removeRunDependency()'] = ':js:func:`removeRunDependency`' mapped_wiki_inline_code['ret_val'] = ':cpp:type:`ret_val`' mapped_wiki_inline_code['select_const'] = ':cpp:func:`select_const`' mapped_wiki_inline_code['select_const()'] = ':cpp:func:`select_const`' mapped_wiki_inline_code['setValue'] = ':js:func:`setValue`' mapped_wiki_inline_code['setValue()'] = ':js:func:`setValue`' mapped_wiki_inline_code['sharing_policy'] = ':cpp:type:`sharing_policy`' mapped_wiki_inline_code['smart_ptr_trait'] = ':cpp:type:`smart_ptr_trait`' mapped_wiki_inline_code['stackTrace'] = ':js:func:`stackTrace`' mapped_wiki_inline_code['stackTrace()'] = ':js:func:`stackTrace`' mapped_wiki_inline_code['std::add_pointer<Signature>::type'] = ':cpp:func:`std::add_pointer<Signature>::type`' mapped_wiki_inline_code['std::add_pointer<Signature>::type()'] = ':cpp:func:`std::add_pointer<Signature>::type`' mapped_wiki_inline_code['stringToUTF16'] = ':js:func:`stringToUTF16`' mapped_wiki_inline_code['stringToUTF16()'] = ':js:func:`stringToUTF16`' mapped_wiki_inline_code['stringToUTF32'] = ':js:func:`stringToUTF32`' mapped_wiki_inline_code['stringToUTF32()'] = ':js:func:`stringToUTF32`' mapped_wiki_inline_code['stringToUTF8'] = ':js:func:`stringToUTF8`' mapped_wiki_inline_code['stringToUTF8()'] = ':js:func:`stringToUTF8`' mapped_wiki_inline_code['worker_handle'] = ':c:var:`worker_handle`' mapped_wiki_inline_code['writeArrayToMemory'] = ':js:func:`writeArrayToMemory`' mapped_wiki_inline_code['writeArrayToMemory()'] = ':js:func:`writeArrayToMemory`' mapped_wiki_inline_code['writeAsciiToMemory'] = ':js:func:`writeAsciiToMemory`' mapped_wiki_inline_code['writeAsciiToMemory()'] = ':js:func:`writeAsciiToMemory`' mapped_wiki_inline_code['writeStringToMemory'] = ':js:func:`writeStringToMemory`' mapped_wiki_inline_code['writeStringToMemory()'] = ':js:func:`writeStringToMemory`' return mapped_wiki_inline_code
# 模拟请求头 HEADERS = {'Host': 'wx.qq.com', 'Referer': 'https://wx.qq.com/?&lang=zh_CN', 'Origin': 'https://wx.qq.com', 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3534.4 Safari/537.36'} UUID_URL = 'https://login.wx.qq.com/jslogin?appid=wx782c26e4c19acffb' # 获取二维码 QR_URL = 'https://login.weixin.qq.com/qrcode/{uuid}' LOGIN_URL = 'https://login.wx.qq.com/cgi-bin/mmwebwx-bin/login?loginicon=true&uuid={uuid}&tip=0' KEY_URL = 'https://wx.qq.com/cgi-bin/mmwebwx-bin/webwxinit?pass_ticket={pass_ticket}&lang=ch_ZN' # 接收信息 REC_URL = 'https://wx.qq.com/cgi-bin/mmwebwx-bin/webwxsync?sid={sid}&skey={skey}&lang=zh_CN&pass_ticket={pass_ticket}' # 心跳包 SYNC_URL = 'https://webpush.wx.qq.com/cgi-bin/mmwebwx-bin/synccheck?r={r}&skey={skey}&sid={sid}&uin={uin}&deviceid={deviceid}&synckey={synckey}&_={_}' # 开启通知 N_URL = 'https://wx.qq.com/cgi-bin/mmwebwx-bin/webwxstatusnotify?lang=zh_CN&pass_ticket={pass_ticket}' # send SEND_URL = 'https://wx.qq.com/cgi-bin/mmwebwx-bin/webwxsendmsg?lang=zh_CN&pass_ticket={pass_ticket}' # 获取联系人 CONTACT_URL = 'https://wx.qq.com/cgi-bin/mmwebwx-bin/webwxgetcontact?pass_ticket={pass_ticket}&r={r}&seq=0&skey={skey}' # 图灵机器人接口 TULING_URL = 'http://www.tuling123.com/openapi/api?key={key}&info={info}'
# strings message = 'hi, how are you?' # integer # number = 776765757 # print(number) # print(type(number)) a = 'hello' # print(type(a)) # print(a) # floating pi = 3.14 e = 2.71828 a = 10.0 # print(type(a)) # print(a) # boolean (1/0 True/False) isBooked = False has_passed_exam = True print(has_passed_exam) print(type(has_passed_exam))
class my_Pow_Three: def __init__(self, mymax = 0): self.mymax = mymax def __iter__(self): self.num = 0 return self def __next__(self): if self.num > self.mymax: raise StopIteration myresult = 3 ** self.num self.num += 1 return myresult num1 = my_Pow_Three(5) for loop in num1: print(loop)
x,y=map(int,input().split()) a=[];r='' for _ in range(x): a.append(list(input())) for k in range(y): for _ in range(x): for i in range(x-1): t=a[i][k];z=a[i+1][k] if t=='o' and z=='.': a[i][k]=z a[i+1][k]=t for i in range(x): for j in range(y): r+=a[i][j] r+='\n' print(r,end="")
EXTERNAL_DATA_FILE = "../data/external/basketball.sqlite" RAW_DATA_OUTPUT = "../data/raw/" RAW_DATA_FILE = "../data/raw/plays_total.csv" INTERIM_DATA_OUTPUT = "../data/interim/" PROCESSED_DATA_OUTPUT = "../data/processed/" TRAINING_FILE = "../data/processed/train_proc_labeled_folds.csv" TESTING_FILE = "../data/processed/test_proc.csv" MODEL_OUTPUT = "../models/" MODEL_IN_USE = "../models/log_res.bin"
gb = GearsBuilder("StreamReader") gb.foreach( lambda x: execute("HMSET", x["id"], *sum([[k, v] for k, v in x.items()], [])) ) # write to Redis Hash gb.register("mystream")
device = "cpu" teacher_forcing_ratio = 1.0 clip = 50.0 learning_rate = 0.0001 decoder_learning_ratio = 5.0 n_iteration = 5000 print_every = 1 save_every = 500 model_name = 'cb_model' hidden_size = 500 encoder_n_layers = 2 decoder_n_layers = 2 dropout = 0.1 batch_size = 64
# print(1) # print(2) # print(3) # print(4) # print(5) # contador = 1 # print(contador) # while contador < 1000: # contador = contador + 1 # contador += 1 # con esta linea estamos diciendo que contador es igual a contador + 1, igual a la linea que tenemos arriba # print(contador) # a = list(range(1000)) # print(a) # for contador in range(1, 1001): #para el contador que va del rango del 0 al 1000 la variable contador en el ciclo va ir tomando los valores del rango # print(contador) #aqui vamos a imprimir el valor del contador en cada vuelta del ciclo for i in range(10): print(11 * i)
# Question 7 # Level 2 # # Question: # Write a program which takes 2 digits, X,Y as input and generates a 2-dimensional array. The element value in the i-th row and j-th column of the array should be i*j. # Example # Suppose the following inputs are given to the program: # 3,5 # Then, the output of the program should be: # [[0, 0, 0, 0, 0], [0, 1, 2, 3, 4], [0, 2, 4, 6, 8]] # # Hints: # Note: In case of input data being supplied to the question, it should be assumed to be a console input in a comma-separated form. l = input("Write dimensions of array: ") l = l.split(",") l = list(map(int, l)) arr = [] for i in range(l[0]): arr.append([]) for j in range(l[1]): arr[i].append(i*j) print(arr)
# Definition for a binary tree node. # class TreeNode(object): # def __init__(self, val=0, left=None, right=None): # self.val = val # self.left = left # self.right = right class Solution(object): def minDepth(self, root): """ :type root: TreeNode :rtype: int """ if root is None: return 0 if root.left is None and root.right is None: return 1 if root.right is None: return self.minDepth(root.left) + 1 if root.left is None: return self.minDepth(root.right) + 1 return min(self.minDepth(root.left) + 1, self.minDepth(root.right) + 1)
# Databricks notebook source # MAGIC %md-sandbox # MAGIC # MAGIC <div style="text-align: center; line-height: 0; padding-top: 9px;"> # MAGIC <img src="https://databricks.com/wp-content/uploads/2018/03/db-academy-rgb-1200px.png" alt="Databricks Learning" style="width: 600px"> # MAGIC </div> # COMMAND ---------- # MAGIC %md # MAGIC # Demo: Navigating Databricks SQL # COMMAND ---------- # MAGIC %run ./Includes/Classroom-Setup # COMMAND ---------- step = DA.publisher.add_step(False, instructions=""" <h2><img class="image-icon-inline" src="https://s3.us-west-2.amazonaws.com/files.training.databricks.com/images/step-icon_small.png" alt="heading-icon" /> Lesson Objective</h2> <div class="instructions-div"> <p>At the end of this lesson, you will be able to:</p> <ul> <li>Distinguish between Databricks SQL pages and their purposes</li> <li>Run a simple query in Databricks SQL</li> </ul></div> """, statements=None) step.render(DA.username) step.execute(DA.username) # COMMAND ---------- step = DA.publisher.add_step(False, instructions=""" <h2><img class="image-icon-inline" src="https://s3.us-west-2.amazonaws.com/files.training.databricks.com/images/step-icon_small.png" alt="heading-icon" /> The Landing Page</h2> <div class="instructions-div"> <p>The landing page is the main page for Databricks SQL. Note the following features of the landing page:</p> <ul> <li>Shortcuts</li> <li>Recents</li> <li>Documentation Links</li> <li>Links to Release Notes</li> <li>Links to Blog Posts</li> </ul></div>""", statements=None) step.render(DA.username) step.execute(DA.username) # COMMAND ---------- step = DA.publisher.add_step(False, instructions="""<h2><img class="image-icon-inline" src="https://s3.us-west-2.amazonaws.com/files.training.databricks.com/images/step-icon_small.png" alt="heading-icon" /> The Sidebar Menu and App Switcher</h2> <div class="instructions-div"> <p>On the left side of the landing page is the sidebar menu and app switcher. </p> <ol> <li>Roll your mouse over the sidebar menu</li> </ol> <p>The menu expands. You can change this behavior using the "Menu Options" at the bottom of the menu.</p> <p>The app switcher allows you to change between Databricks SQL and the other apps available to you in Databricks. Your ability to access these apps is configured by your Databricks Administrator. Note that you can pin Databricks SQL as the default app when you login to Databricks.</p> </div>""", statements=None) step.render(DA.username) step.execute(DA.username) # COMMAND ---------- step = DA.publisher.add_step(False, instructions=""" <h2> <img class="image-icon-inline" src="https://s3.us-west-2.amazonaws.com/files.training.databricks.com/images/step-icon_small.png" alt="heading-icon" /> SQL Endpoints</h2> <div class="instructions-div"> <p>In order to work with data in Databricks SQL, you will need to have access to a SQL Endpoint</p> <ol start="2"> <li>Click "SQL Endpoints" in the sidebar menu</li> </ol> <p>There should be at least one endpoint in the list. (If not, you will need to have a Databricks Administrator configure an endpoint for you). Note the following features of the "SQL Endpoints" page:</p> <ul> <li>Endpoint Name</li> <li>State</li> <li>Size</li> <li>Active/Max</li> <li>Start/Stop Button</li> <li>Actions Menu</li> </ul> <ol start="3"> <li>Click the name of the endpoint</li> </ol> <p>Note the following features on the Endpoint's detail page:</p> <ul> <li>Overview</li> <li>Connection Details</li> </ul> </div> """, statements=None) step.render(DA.username) step.execute(DA.username) # COMMAND ---------- step = DA.publisher.add_step(False, instructions=""" <h2> <img class="image-icon-inline" src="https://s3.us-west-2.amazonaws.com/files.training.databricks.com/images/step-icon_small.png" alt="heading-icon" /> The Query Editor</h2> <div class="instructions-div"> <ol start="4"> <li>Click Create --> Query in the sidebar menu</li> </ol> <p>This is the Query Editor in Databricks SQL. Note the following features of the Query Editor:</p> <ul> <li>Schema Browser</li> <li>Tabbed Interface</li> <li>Results View</li> </ul> <p>To run a query, double-check that you have an endpoint selected, type the query into the editor and click Run.</p> <p>We are going to run a simple query that will display our username</p> <ol start="5"> <li>Paste the code below into the Query Editor, and click Run:</li> </ol> <p>We are going to use this username in future queries in a <span class="monofont">USE</span> statement.</p> </div> """, statements=""" SELECT current_user() AS Username; """) step.render(DA.username) step.execute(DA.username) # COMMAND ---------- step = DA.publisher.add_step(False, instructions=""" <h2> <img class="image-icon-inline" src="https://s3.us-west-2.amazonaws.com/files.training.databricks.com/images/step-icon_small.png" alt="heading-icon" /> Query Results</h2> <div class="instructions-div"> <p>The query we executed above is pulling from a schema created just for you as part of this course. In the results window, we can see the data pulled from our schema.</p> <p>Note the following features of the results window:</p> <ul> <li>Number of Results Received</li> <li>Refreshed Time</li> <li>"Add Visualization" button</li> </ul> <p>When visualizations are added to your queries, they will also show up in the results window.</p> </div> """, statements=None) step.render(DA.username) step.execute(DA.username) # COMMAND ---------- step = DA.publisher.add_step(False, instructions=""" <h2> <img class="image-icon-inline" src="https://s3.us-west-2.amazonaws.com/files.training.databricks.com/images/step-icon_small.png" alt="heading-icon" /> Query History</h2> <div class="instructions-div"> <p>To see a list of queries that have been run, we can access Query History.</p> <ol start="6"> <li>In the sidebar menu, click "Query History"</li> </ol> <p>Query History shows a list of all queries that have been run.</p> <ul> <li>Toolbar for changing user, time span, endpoint, and status filters</li> <li>"Refresh" button and scheduler</li> <li>Query list with informative columns</li> </ul> <p>We can get more detailed information by clicking a query.</p> <ol start="7"> <li>Click a query in the list</li> </ol> <p>A drawer opens that provides more detailed information about the selected query. If we want to view the query profile, we can do that, too.</p> <ol start="8"> <li>Click "View query profile"</li> </ol> <p>This information can be used to help troubleshoot queries or to improve query performance.</p> </div> """, statements=None) step.render(DA.username) step.execute(DA.username) # COMMAND ---------- DA.validate_datasets() html = DA.publisher.publish(include_inputs=False) displayHTML(html) # COMMAND ---------- # MAGIC %md-sandbox # MAGIC &copy; 2022 Databricks, Inc. All rights reserved.<br/> # MAGIC Apache, Apache Spark, Spark and the Spark logo are trademarks of the <a href="https://www.apache.org/">Apache Software Foundation</a>.<br/> # MAGIC <br/> # MAGIC <a href="https://databricks.com/privacy-policy">Privacy Policy</a> | <a href="https://databricks.com/terms-of-use">Terms of Use</a> | <a href="https://help.databricks.com/">Support</a>
''' Basic operation with Python Pierre Baudin 2018-10-16 ''' # define list student_names = ['James', 'Kat', 'Jess', 'Mark', 'Bort', 'Frank Grimes', 'Max Power', 'Homer'] for name in student_names: if name == 'Bort': print("Found him!\n" + name) break print("Currently testing " + name) # Dictionary example student = { "name": "Mark", "student_id": 15163, "feedback": None } student["last_name"] = "Kowalski" # exception handling try: last_name = student["last_name"] numbered_last_name = 3 + last_name except KeyError: print("Error finding last_name") except TypeError as error: print("I cannot add these two together!") print(error) print("This code executes!")
class Nikola: __Nikola = "Николай" def __init__(self, name, age): self.age = age if not name.upper() == "НИКОЛАЙ": self.name = f"Я не {name}, я - Император и самодержец Всеройскийский Николай II" else: self.name = "Николай" Petya = Nikola("Петя", 19) print(Petya.name) Petya = Nikola("нИколАй", 19) print(Petya.name)
# 1295. Find Numbers with Even Number of Digits def findNumbers(self, nums): """ :type nums: List[int] :rtype: int 61% fast 46% less mem """ count = 0 for num in nums: if(len(str(num))%2 == 0): count +=1 return count
""" Function get_list() Takes a list of dictionaries as an argument and returns a list of all the unique dictionaries in the input list. """ def get_list(dictionary_list): unique_list = [] for dictionary in dictionary_list: if dictionary not in unique_list: unique_list.append(dictionary) return unique_list if __name__ == "__main__": dict_list=[{'name': 'affirm', 'confidence': 0.9448149204254}, {'name': 'affirm', 'confidence': 0.944814920425415}, {'name': 'inform', 'confidence': 0.9842240810394287}, {'name': 'inform', 'confidence': 0.9842240810394287}] print(get_list(dict_list))
name = "br_loterias" __version__ = "0.0.1"
''' Probem Task : This program will find volume of inner sphere Problem Link : https://edabit.com/challenge/iBqJcagS56wmDpe4x ''' def vol_shell(r1, r2): # function for finding volume pi = 3.1415926536 if r1 < r2: # Checking is r1 is greater than r2, if r1 is less than r2, if case works r1, r2 = r2, r1 volume = 4 / 3 * pi * (int(r1) ** 3 - int(r2) ** 3) # main formulae print(round(volume, 3)) # Printing the value, # round is Used for rounding the digits of volume to 3 digits from decimal point else: # if r1 is greater than r2, this case executes volume = 4 / 3 * pi * (int(r1) ** 3 - int(r2) ** 3) # main formulae print(round(volume, 3)) # Printing the value, # round is Used for rounding the digits of volume to 3 digits from decimal point if __name__ == '__main__': # Main Function r1 = input("Input Inner/Outer radius of the sphere: ") r2 = input("Input Inner/Outer radius of the sphere: ") vol_shell(r1, r2)
''' Created on 17 Jul 2015 @author: philipkershaw ''' def keyword_parser(obj, prefix='', **kw): '''Parse config items delimited by dots into corresponding objects and members variables ''' for param_name, val in list(kw.items()): if prefix: _param_name = param_name.rsplit(prefix)[-1] else: _param_name = param_name if '.' in _param_name: # Further nesting found - split and access corresponding object obj_name, obj_attr_name = _param_name.split('.', 1) child_obj = getattr(obj, obj_name) keyword_parser(child_obj, **{obj_attr_name: val}) else: # Reached the end of nested items - set value and return setattr(obj, _param_name, val) return
T = int(input()) for t in range(T): skipBlank = input() N = int(input()) sum = 0 for n in range(N): sum+= int(input()) if (sum % N == 0): print("YES") else: print("NO")
# coding=utf8 # Copyright 2018 JDCLOUD.COM # # 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 # # http://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. # # NOTE: This class is auto generated by the jdcloud code generator program. class ChangeSet(object): def __init__(self, action=None, changeInfo=None, changeMap=None, createTime=None, describe=None, id=None, isRun=None, name=None, region=None, runTime=None, stackId=None, status=None, statusReason=None, templateId=None): """ :param action: (Optional) 更改集操作 :param changeInfo: (Optional) 更改信息 :param changeMap: (Optional) changeset的详细信息 :param createTime: (Optional) 创建时间 :param describe: (Optional) 更改集描述 :param id: (Optional) :param isRun: (Optional) 是否执行 :param name: (Optional) 更改集名称 :param region: (Optional) 地域信息 :param runTime: (Optional) 执行时间 :param stackId: (Optional) 对应资源栈ID :param status: (Optional) 状态 :param statusReason: (Optional) 状态原因 :param templateId: (Optional) 对应模板ID """ self.action = action self.changeInfo = changeInfo self.changeMap = changeMap self.createTime = createTime self.describe = describe self.id = id self.isRun = isRun self.name = name self.region = region self.runTime = runTime self.stackId = stackId self.status = status self.statusReason = statusReason self.templateId = templateId
class StatisticsCollector: def __init__(self, collectors: list, report_interval): self.collectors = collectors self.report_interval = report_interval def add_result(self, server_time, client_time, bytes_received): for collector in self.collectors: collector.add_result(server_time, client_time, bytes_received)
# # Este arquivo é parte do programa multi_agenda # # Esta obra está licenciada com uma # Licença Creative Commons Atribuição 4.0 Internacional. # (CC BY 4.0 Internacional) # # Para ver uma cópia da licença, visite # https://creativecommons.org/licenses/by/4.0/legalcode # # WELLINGTON SAMPAIO - wsampaio@yahoo.com # https://www.linkedin.com/in/wellsampaio/ # """ CREATE TABLE [ORIGENS_REGISTRO] ( [COD_ORIGEM_REGISTRO] INTEGER, [ORIGEM_REGISTRO] TEXT); """ class OrigemRegistro: __codOrigemRegistro = 0 __origemRegistro = "" def __init__(self): pass def povoarObj(self, array): self.setCodOrigemRegistro(array[0]) self.setOrigemRegistro(array[1]) return self def getCodOrigemRegistro(self): return self.__codOrigemRegistro def setCodOrigemRegistro(self, codOrigemRegistro): try: self.__codOrigemRegistro = int(codOrigemRegistro) except ValueError: self.__codOrigemRegistro = self.getCodOrigemRegistro() def getOrigemRegistro(self): return self.__origemRegistro def setOrigemRegistro(self, origemRegistro): self.__origemRegistro = str(origemRegistro)
n = int(input()) for i in range(n): print('+___', end=' ') print() for i in range(n): print(f'|{i + 1} /', end=' ') print() for i in range(n): print('|__\\', end=' ') print() for i in range(n): print('| ', end=' ') print()
# write your solution here sentence = input("Write text: ") check_list = [] with open("wordlist.txt") as new_file: for line in new_file: line = line.replace("\n", "") check_list.append(line) text = "" word_list = sentence.split() #print(word_list) for word in word_list: lcs_word = word.lower() if lcs_word in check_list: text += f" {word}" else: text += f" *{word}*" print(text)
def convert(base_10_number, new_base): convert_string = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" if base_10_number < new_base: return convert_string[base_10_number] else: return convert(base_10_number // new_base, new_base) + convert_string[base_10_number % new_base] print(convert(100, 10)) print(convert(100, 2)) print(convert(100, 36)) # print(unconvert("100", 10)) # print(unconvert("1100100", 2)) # print(unconvert("2S", 36))
x = 10 > 15 y = 15 > 10 print(x and y) print(x or y) print(not (x and y))
# -*- coding: utf-8 -*- """ pyltsv.benchmark.ltsv ~~~~~~~~~~~~~~~~~~~~~ Python script implementation. :copyright: (c) 2013 Shinya Ohyanagi, All rights reserved. :license: BSD, see LICENSE for more details. """ def parse_line(string): line = string.decode('utf-8').rstrip() return dict([x.split(':', 1) for x in line.split("\t")]) def parse_file(file_name): with open(file_name, 'r') as f: lines = f.readlines() return [parse_line(line) for line in lines]
class Featurizer(): """Class used to extract features from objects.""" def extract_raw_features(self, astronomical_object): """Extract raw features from an object Featurizing is slow, so the idea here is to extract a lot of different things, and then in `select_features` these features are postprocessed to select the ones that are actually fed into the classifier. This allows for rapid iteration of training on different feature sets. Note that the features produced by this method are often unsuitable for classification, and may include data leaks. Make sure that you understand what features can be used for real classification before making any changes. For now, there is no generic featurizer, so this must be implemented in survey-specific subclasses. Parameters ---------- astronomical_object : :class:`AstronomicalObject` The astronomical object to featurize. Returns ------- raw_features : dict The raw extracted features for this object. """ return NotImplementedError def select_features(self, raw_features): """Select features to use for classification This method should take a DataFrame or dictionary of raw features, produced by `featurize`, and output a list of processed features that can be fed to a classifier. Parameters ---------- raw_features : pandas.DataFrame or dict The raw features extracted using `featurize`. Returns ------- features : pandas.DataFrame or dict The processed features that can be fed to a classifier. """ return NotImplementedError def extract_features(self, astronomical_object): """Extract features from an object. This method extracts raw features with `extract_raw_features`, and then selects the ones that should be used for classification with `select_features`. This method is just a wrapper around those two methods and is intended to be used as a shortcut for feature extraction on individual objects. Parameters ---------- astronomical_object : :class:`AstronomicalObject` The astronomical object to featurize. Returns ------- features : pandas.DataFrame or dict The processed features that can be fed to a classifier. """ raw_features = self.extract_raw_features(astronomical_object) features = self.select_features(raw_features) return features
def if_none_this(list, index, substitute): """Return *substitute* if *list* is None else returns *list[index]* (NVL type function)""" if list is None: return substitute else: return list[index]
############################################################################ # # Copyright (c) Mamba Developers. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # ############################################################################ class Empty: pass
#!/usr/bin/python3 age = int(input("请输入你家狗狗的年龄: ")) print("") if age < 0: print("傻逼,不对") elif age == 1: print("相当于12岁的人") elif age == 2: print("aaaa") elif age > 2: human = 22 + (age - 2) * 5 print("对应人类",human) else: print("adadfa") ### 退出提示 input("点击 enter 键退出") ##!/usr/bin/python3 # #age = int(input("请输入你家狗狗的年龄: ")) #print("") #if age < 0: # print("你是在逗我吧!") #elif age == 1: # print("相当于 14 岁的人。") #elif age == 2: # print("相当于 22 岁的人。") #elif age > 2: # human = 22 + (age -2)*5 # print("对应人类年龄: ", human) # #### 退出提示 #input("点击 enter 键退出")
# -*- coding: utf-8 -*- class Calculator(object): """ 四則演算を行う。 """ @staticmethod def addition(x, y): """ 加算を行う。 :param x: 左辺 :param y: 右辺 :return: 計算結果 """ result = x + y return result @staticmethod def subtraction(x, y): """ 減算を行う。 :param x: 左辺 :param y: 右辺 :return: 計算結果 """ result = x - y return result @staticmethod def multiplication(x, y): """ 乗算を行う。 :param x: 左辺 :param y: 右辺 :return: 計算結果 """ result = x + y return result @staticmethod def division(x, y): """ 割算を行う。 :param x: 左辺 :param y: 右辺 :return: 計算結果 """ result = x / y return result
""" 35. Encontrar números primos é uma tarefa difícil. Faça um programa que gera uma lista dos números primos existentes entre 1 e um número inteiro informado pelo usuário. """ numero = int(input("Informe um número: ")) tot = 0 div = 0 for j in range(1, numero + 1): tot = 0 div = 0 for c in range(1, numero + 1): if j % c == 0: tot += 1 if tot <= 2: div += 1 if tot == 2: print("O número {} é primo e teve {} divisões até ser encontrado." .format(j, div))
''' Description: Given a balanced parentheses string S, compute the score of the string based on the following rule: () has score 1 AB has score A + B, where A and B are balanced parentheses strings. (A) has score 2 * A, where A is a balanced parentheses string. Example 1: Input: "()" Output: 1 Example 2: Input: "(())" Output: 2 Example 3: Input: "()()" Output: 2 Example 4: Input: "(()(()))" Output: 6 Note: S is a balanced parentheses string, containing only ( and ). 2 <= S.length <= 50 ''' class Solution: def scoreOfParentheses(self, S: str) -> int: score_stack = [] # record previous character prev = '' for ch in S: if ch == '(': # push 0 as occurrence of '(' score_stack.append( 0 ) else: if prev == ')': # contiguous of ')', double the score summation = 0 while score_stack[-1] != 0: summation += score_stack.pop() # pop latest 0 also known as lastest left brace ( score_stack.pop() score_stack.append( 2*summation ) else: # single pair of (), add score by 1 # pop latest 0 also known as lastest left brace ( score_stack.pop() score_stack.append(1) # update previous character prev = ch # summation of all the scores in stack return sum(score_stack) # n : the length of input string, S. ## Time Complexity: O( n ) # # The overhead in time is the for loop iterating on ch, which is of O( n ), ## Space Complexity: O( n ) # # The overhead in space is the storage for score_stack, which is of O( n ). def test_bench(): test_data = [ '()', '(())', '()()', '(()(()))' ] # expected output: ''' 1 2 2 6 ''' for test_case in test_data: print( Solution().scoreOfParentheses(test_case) ) return if __name__ == '__main__': test_bench()
owlfile = open("blob.owl") parsed_owlfile = open("a.owl","w") weinclass=0 for line in owlfile: parsed_owlfile.write(line) if line.strip()[0:10]=="<owl:Class": weinclass=1 if line.strip()[6:11]=="label" and weinclass==1: parsed_owlfile.write(' <oboInOwl:inSubset rdf:resource="&oboOther;edam#topics"/>\n') weinclass=0 if line.strip()[0:12]=="</owl:Class>": #sometimes there are no labels so we still need to put it at 0 weinclass=0 print(line.strip()[6:11]) print(line) """ <owl:Class rdf:about="http://purl.org/pan-science/PaNET/PaNET01325"> <rdfs:subClassOf rdf:resource="http://purl.org/pan-science/PaNET/PaNET01023"/> <rdfs:subClassOf rdf:resource="http://purl.org/pan-science/PaNET/PaNET01029"/> <rdfs:subClassOf rdf:resource="http://purl.org/pan-science/PaNET/PaNET01173"/> <obo:IAO_0000119 rdf:datatype="http://www.w3.org/2001/XMLSchema#string">https://en.wikipedia.org/wiki/Borrmann_effect</obo:IAO_0000119> <rdfs:label rdf:datatype="http://www.w3.org/2001/XMLSchema#string">borrmann effect</rdfs:label> </owl:Class> """
def pars2dict(init_file): """ It reads parameters `init_file` and returns a dictionary """ init_dict = {} with open(init_file) as f: lines = f.readlines() for line in lines: # if the line start with #, it is a comment if line[0] == "#": continue # check the line contains a comment comment = line.find("#") # strip the comment if comment != -1: line = line[0:comment] # skip the empty line if line == "\n": continue # stored :: list stored = line.rstrip("\n").strip().split() # update stored value as a dictionary init_dict[stored[0]] = stored[1] return init_dict def dict2file(init_dict): """ Take parameters as a dictionary and write it as a file `slug.init`. """ f = open("slug.init", "w") for key, value in init_dict.items(): line = str(key) + " " + str(value) + "\n" f.write(line)
def part_one(input): return sum([max_difference(line) for line in parse(input)]) def max_difference(numbers): return max(numbers) - min(numbers) def parse(input): return [to_number_list(line) for line in input.splitlines()] def to_number_list(string): return list(map(int, string.split())) def part_two(input): return sum([max_even_division_result(all_pairs(line)) for line in parse(input)]) def max_even_division_result(pairs): return max([even_division_result(left, right) for left, right in pairs]) def even_division_result(left, right): smallest = min(left, right) largest = max(left, right) if largest % smallest == 0: return largest // smallest return 0 def all_pairs(list): length = len(list) result = [] for i in range(length): for j in range(i + 1, length): result.append((list[i], list[j])) return result if __name__ == "__main__": input = """86 440 233 83 393 420 228 491 159 13 110 135 97 238 92 396 3646 3952 3430 145 1574 2722 3565 125 3303 843 152 1095 3805 134 3873 3024 2150 257 237 2155 1115 150 502 255 1531 894 2309 1982 2418 206 307 2370 1224 343 1039 126 1221 937 136 1185 1194 1312 1217 929 124 1394 1337 168 1695 2288 224 2667 2483 3528 809 263 2364 514 3457 3180 2916 239 212 3017 827 3521 127 92 2328 3315 1179 3240 695 3144 3139 533 132 82 108 854 1522 2136 1252 1049 207 2821 2484 413 2166 1779 162 2154 158 2811 164 2632 95 579 1586 1700 79 1745 1105 89 1896 798 1511 1308 1674 701 60 2066 1210 325 98 56 1486 1668 64 1601 1934 1384 69 1725 992 619 84 167 4620 2358 2195 4312 168 1606 4050 102 2502 138 135 4175 1477 2277 2226 1286 5912 6261 3393 431 6285 3636 4836 180 6158 6270 209 3662 5545 204 6131 230 170 2056 2123 2220 2275 139 461 810 1429 124 1470 2085 141 1533 1831 518 193 281 2976 3009 626 152 1750 1185 3332 715 1861 186 1768 3396 201 3225 492 1179 154 1497 819 2809 2200 2324 157 2688 1518 168 2767 2369 2583 173 286 2076 243 939 399 451 231 2187 2295 453 1206 2468 2183 230 714 681 3111 2857 2312 3230 149 3082 408 1148 2428 134 147 620 128 157 492 2879""" print(part_one(input)) print(part_two(input))
''' Extracted from ZED-F9P - Interface Description, section 3 ''' UBX_CLASS = { b"\x01": "NAV", # Navigation solution messages b"\x02": "RXM", # Status from the receiver manager b"\x27": "SEC", # Security features of the receiver }
# 3.13 Convert the following code to an if-elif-else statement: number = 4 if number == 1: print('One') else: if number == 2: print('Two') else: if number == 3: print('Three') else: print('Unkown') # ANSWER if number == 1: print('One') elif number == 2: print('Two') elif number == 3: print('Three') else: print('Unkown')
# --- # jupyter: # jupytext: # formats: ipynb,py:percent # text_representation: # extension: .py # format_name: percent # format_version: '1.3' # jupytext_version: 1.13.7 # kernelspec: # display_name: Python [conda env:idp_bandit] # language: python # name: conda-env-idp_bandit-py # --- # %% # Parameters dprst_depth_avg = 57.9203 dprst_frac = 0.051539 dprst_frac_init = 0.093112 dprst_frac_open = 1.0 hru_area = 149514.25399 hru_percent_imperv = 0.000018 op_flow_thres = 0.9264 va_open_exp = 0.001 va_clos_exp = 0.001 soil_moist_init = 1.0 soil_moist_init_frac = 0.370547 soil_moist_max = 2.904892 soil_rechr_init = 0.5 soil_rechr_init_frac = 0.371024 soil_rechr_max_frac = 0.994335 # The variables... imperv_frac_flag = 1 dprst_frac_flag = 1 dprst_depth_flag = 1 check_imperv = False check_dprst_frac = False dprst_flag = 1 dprst_clos_flag = True dprst_open_flag = True soil_moist = soil_moist_init_frac * soil_moist_max soil_rechr = soil_rechr_max_frac * soil_moist_max soil_moist_tmp = 0.0 soil_rechr_tmp = 0.0 dprst_area_max = 7705.81513639 dprst_vol_clos = 0.0 dprst_vol_open = 41558.0387633 hru_area_imperv = 2.69125657182 hru_area_perv = 141805.747597 hru_frac_perv = 0.948443 imperv_stor = 0.1 hru_area_perv_NEW = 0.0 hru_percent_imperv_new = 0.000017 dprst_frac_NEW = 0.06 dprst_area_max_tmp = 0.0 # %% [markdown] # ### Deal with hru_percent_imperv first # %% hru_area_imperv = hru_percent_imperv * hru_area # NOTE: dprst_area_max is not handled yet hru_area_perv = hru_area - hru_area_imperv hru_frac_perv = hru_area_perv / hru_area # NOTE: need to deal with lakes # %% # Some scratch junk hru_percent_imperv_OLD = 0.000018 hru_percent_imperv_NEW = 0.0 hru_percent_imperv_CHG = 0.0 if hru_percent_imperv_NEW > 0.0: hru_percent_imperv_CHG = hru_percent_imperv_OLD / hru_percent_imperv_NEW hru_percent_imperv_EXIST_CHG = hru_percent_imperv_OLD / hru_frac_perv if hru_percent_imperv_NEW > 0.999: print('ERROR') elif imperv_stor > 0.0: if hru_percent_imperv_NEW > 0.0: imperv_stor *= hru_percent_imperv_CHG else: print('WARNING') tmp_stor = imperv_stor * hru_percent_imperv_EXIST_CHG print('tmp_stor = {}'.format(tmp_stor)) print('imperv_stor = {}'.format(imperv_stor)) print('_OLD = {}'.format(hru_percent_imperv_OLD)) print('_NEW = {}'.format(hru_percent_imperv_NEW)) print('_CHG = {}'.format(hru_percent_imperv_CHG)) print('_EXI = {}'.format(hru_percent_imperv_EXIST_CHG)) # %% [markdown] # ### Handle changes to imperv_stor_max # %% # Read in imperv_stor_max updates for current timestep # %% [markdown] # ### Handle changes to dprst_depth_avg and dprst_frac # %% dprst_area_max = dprst_frac * hru_area hru_area_perv -= dprst_area_max hru_frac_perv = hru_area_perv / hru_area # where active and dprst_area_max > 0 dprst_area_open_max = dprst_area_max * dprst_frac_open dprst_area_clos_max = dprst_area_max - dprst_area_open_max dprst_frac_clos = 1.0 - dprst_frac_open if hru_percent_imperv + dprst_frac > 0.999: print('ERROR: impervious plus depression fraction > 0.999') # Dynread is wrong has_closed_dprst = dprst_area_clos_max > 0.0 has_open_dprst = dprst_area_open_max > 0.0 # For all the active HRUs... if has_closed_dprst and dprst_area_max > 0.0: dprst_vol_clos_max = dprst_area_clos_max * dprst_depth_avg if has_open_dprst and dprst_area_max > 0.0: dprst_vol_open_max = dprst_area_open_max * dprst_depth_avg if has_closed_dprst and dprst_area_max > 0.0: dprst_vol_clos = dprst_frac_init * dprst_vol_clos_max if has_open_dprst and dprst_area_max > 0.0: dprst_vol_open = dprst_frac_init * dprst_vol_open_max if dprst_area_max > 0.0: dprst_vol_thres_open = op_flow_thres * dprst_vol_open_max if dprst_vol_open > 0.0 and dprst_area_max > 0.0: pass # dprst_area_open = depression_surface_area(dprst_vol_open, dprst_vol_open_max, dprst_area_open_max, va_open_exp) if dprst_vol_clos > 0.0 and dprst_area_max > 0.0: pass # dprst_area_clos = depression_surface_area(dprst_vol_clos, dprst_vol_clos_max, dprst_area_clos_max, va_clos_exp) if dprst_vol_clos_max > 0.0: dprst_vol_clos_frac = dprst_vol_clos / dprst_vol_clos_max if dprst_vol_open_max > 0.0: dprst_vol_open_frac = dprst_vol_open / dprst_vol_open_max if dprst_area_max > 0.0: dprst_vol_frac = (dprst_vol_open + dprst_vol_clos) / (dprst_vol_open_max + dprst_vol_clos_max) dprst_stor_hru = (dprst_vol_open + dprst_vol_clos) / hru_area # %% # %% # %% # %% soil_moist_tmp = soil_moist soil_rechr_tmp = soil_rechr print('------- BEFORE --------') print('dprst_area_max = {}'.format(dprst_area_max)) print('soil_moist = {}'.format(soil_moist)) print('soil_rechr = {}'.format(soil_rechr)) print('hru_area_imperv = {}'.format(hru_area_imperv)) print('hru_area_perv = {}'.format(hru_area_perv)) print('hru_frac_perv = {}'.format(hru_frac_perv)) print('hru_percent_imperv = {}'.format(hru_percent_imperv)) print('imperv_stor = {}'. format(imperv_stor)) dprst_frac_flag = 1 check_imperv = True if dprst_frac_flag == 1: # ??? Why is this done? We already have dprst_area_max from the prior timestep. dprst_area_max = dprst_frac * hru_area print('UPDATE: dprst_area_max = {}'.format(dprst_area_max)) if check_imperv: # frac_imperv could be a new or updated value frac_imperv = hru_percent_imperv_new print('frac_imperv = {}'.format(frac_imperv)) if frac_imperv > 0.999: print('ERROR: Dynamic value of the hru_percent_imperv > 0.999') elif imperv_stor > 0.0: if frac_imperv > 0.0: imperv_stor *= hru_percent_imperv / frac_imperv else: print('WARNING: Dynamic impervious changed to 0 when impervious storage > 0') tmp = imperv_stor * hru_percent_imperv / hru_frac_perv soil_moist_tmp += tmp soil_rechr_tmp += tmp imperv_stor = 0.0 hru_percent_imperv = frac_imperv hru_area_imperv = hru_area * frac_imperv print('------- AFTER --------') print('dprst_area_max = {}'.format(dprst_area_max)) print('soil_moist = {}'.format(soil_moist)) print('soil_rechr = {}'.format(soil_rechr)) print('soil_moist_tmp = {}'.format(soil_moist_tmp)) print('soil_rechr_tmp = {}'.format(soil_rechr_tmp)) print('hru_area_imperv = {}'.format(hru_area_imperv)) print('hru_area_perv = {}'.format(hru_area_perv)) print('hru_frac_perv = {}'.format(hru_frac_perv)) print('hru_percent_imperv = {}'.format(hru_percent_imperv)) print('imperv_stor = {}'. format(imperv_stor)) # %% check_dprst_frac = False if dprst_frac_flag == 1: dprst_area_max_tmp = dprst_area_max if check_dprst_frac: dprst_area_max_tmp = dprst_frac_NEW * hru_area if dprst_area_max_tmp > 0.0: if hru_percent_imperv + dprst_area_max_tmp > 0.999: if 0.999 - hru_percent_imperv < 0.001: print('ERROR: Fraction impervious + fraction dprst > 0.999 for HRU') tmp = dprst_vol_open + dprst_vol_clos if dprst_area_max_tmp == 0.0 and tmp > 0.0: print('WARNING: dprst_area reduced to 0 with storage > 0') new_storage = tmp / dprst_area_max_tmp / hru_frac_perv soil_moist_tmp += new_storage soil_rechr_tmp += new_storage dprst_vol_open = 0.0 dprst_vol_clos = 0.0 print('UPDATE: soil_moist_tmp = {}'.format(soil_moist_tmp)) print('UPDATE: soil_rechr_tmp = {}'.format(soil_rechr_tmp)) print('UPDATE: dprst_vol_clos = {}'.format(dprst_vol_clos)) print('UPDATE: dprst_vol_open = {}'.format(dprst_vol_open)) print(' OLD: dprst_area_max = {}'. format(dprst_area_max)) dprst_area_open_max = dprst_area_max_tmp * dprst_frac_open dprst_area_clos_max = dprst_area_max_tmp - dprst_area_open_max dprst_area_max = dprst_area_max_tmp print('UPDATE: dprst_area_open_max = {}'.format(dprst_area_open_max)) print('UPDATE: dprst_area_clos_max = {}'.format(dprst_area_clos_max)) print('UPDATE: dprst_area_max = {}'. format(dprst_area_max)) if dprst_area_clos_max > 0.0: dprst_clos_flag = False if dprst_area_open_max > 0.0: dprst_open_flag = False print(' OLD: dprst_frac = {}'.format(dprst_frac)) dprst_frac = dprst_area_max / hru_area dprst_vol_clos_max = dprst_area_clos_max * dprst_depth_avg dprst_vol_open_max = dprst_area_open_max * dprst_depth_avg dprst_vol_thres_open = dprst_vol_open_max * op_flow_thres print('UPDATE: dprst_frac = {}'.format(dprst_frac)) print('UPDATE: dprst_vol_clos_max = {}'.format(dprst_vol_clos_max)) print('UPDATE: dprst_vol_open_max = {}'.format(dprst_vol_open_max)) print('UPDATE: dprst_vol_thres_open = {}'.format(dprst_vol_thres_open)) if check_imperv or dprst_frac_flag == 1: hru_area_perv_NEW = hru_area - hru_area_imperv print('UPDATE: hru_area_perv_NEW = {}'.format(hru_area_perv_NEW)) if dprst_flag == 1: hru_area_perv_NEW -= dprst_area_max print('UPDATE: hru_area_perv_NEW = {}'.format(hru_area_perv_NEW)) if dprst_area_max + hru_area_imperv > 0.999 * hru_area: print('ERROR: Impervious + depression area > 0.99 * hru_area') if hru_area_perv != hru_area_perv_NEW: print('========= hru_area_perv != hru_area_perv_NEW =============') if hru_area_perv_NEW < 0.0000001: print('ERROR: Pervious area error for dynamic parameter') tmp = hru_area_perv / hru_area_perv_NEW print(' TEMP: tmp = {}'.format(tmp)) soil_moist_tmp *= tmp soil_rechr_tmp *= tmp print('UPDATE: soil_moist_tmp = {}'.format(soil_moist_tmp)) print('UPDATE: soil_rechr_tmp = {}'.format(soil_rechr_tmp)) print(' OLD: hru_area_perv = {}'.format(hru_area_perv)) print(' OLD: hru_frac_perv = {}'.format(hru_frac_perv)) hru_area_perv = hru_area_perv_NEW hru_frac_perv = hru_area_perv / hru_area print('UPDATE: hru_area_perv = {}'.format(hru_area_perv)) print('UPDATE: hru_frac_perv = {}'.format(hru_frac_perv)) # %% if dprst_depth_flag == 1: # Update dprst_depth_avg with any new values for timestep if dprst_area_max > 0.0: dprst_vol_clos_max = dprst_area_clos_max * dprst_depth_avg dprst_vol_open_max = dprst_area_open_max * dprst_depth_avg if dprst_vol_open_max > 0.0: dprst_vol_open_frac = dprst_vol_open / dprst_vol_open_max if dprst_vol_clos_max > 0.0: dprst_vol_clos_frac =dprst_vol_clos / dprst_vol_clos_max dprst_vol_frac = (dprst_vol_open + dprst_vol_clos) / (dprst_vol_open_max + dprst_vol_clos_max) # %% soil_moist = 566.0 soil_adj1 = soil_moist soil_adj2 = 1.0 imperv_stor = 0.1 hru_area = 149514.25399 hru_percent_imperv = 0.000018 hru_area_imperv = hru_percent_imperv * hru_area hru_area_perv = hru_area - hru_area_imperv hru_frac_perv = 1.0 - hru_percent_imperv hru_percent_imperv_OLD = 0.000017 hru_area_imperv_OLD = hru_percent_imperv_OLD * hru_area hru_area_perv_OLD = hru_area - hru_area_imperv_OLD hru_frac_perv_OLD = 1.0 - hru_percent_imperv_OLD adj = imperv_stor * hru_percent_imperv_OLD / hru_frac_perv_OLD print(adj) print('soil_adj1 = {}'.format(soil_adj1)) print('soil_adj2 = {}'.format(soil_adj2)) soil_adj1 += adj soil_adj2 += adj print('UPDATE: soil_adj1 = {}'.format(soil_adj1)) print('UPDATE: soil_adj2 = {}'.format(soil_adj2)) # adj = this%imperv_stor(chru) * hru_percent_imperv_old(chru) / hru_frac_perv_old(chru) # soil_moist_chg(chru) = soil_moist_chg(chru) + adj # soil_rechr_chg(chru) = soil_rechr_chg(chru) + adj # %% adj2 = hru_area_perv_OLD / hru_area_perv print(adj2) soil_adj1 *= adj2 soil_adj2 *= adj2 print('UPDATE: soil_adj1 = {}'.format(soil_adj1)) print('UPDATE: soil_adj2 = {}'.format(soil_adj2)) # adj = hru_area_perv_old(chru) / this%hru_area_perv(chru) # soil_moist_chg(chru) = soil_moist_chg(chru) * adj # soil_rechr_chg(chru) = soil_rechr_chg(chru) * adj # %% dprst_depth_avg = 57.9203 dprst_frac = 0.051539 # dprst_frac = 0.0 dprst_frac_init = 0.093112 dprst_frac_open = 0.9 dprst_area_max = dprst_frac * hru_area dprst_area_open_max = dprst_area_max * dprst_frac_open dprst_area_clos_max = dprst_area_max - dprst_area_open_max dprst_vol_clos_max = dprst_area_clos_max * dprst_depth_avg dprst_vol_open_max = dprst_area_open_max * dprst_depth_avg dprst_vol_clos = dprst_frac_init * dprst_vol_clos_max dprst_vol_open = dprst_frac_init * dprst_vol_open_max tmp = dprst_vol_open + dprst_vol_clos print(hru_frac_perv_OLD) adj3 = tmp / hru_frac_perv_OLD print(adj3) soil_adj1 += adj3 soil_adj2 += adj3 print('UPDATE: soil_adj1 = {}'.format(soil_adj1)) print('UPDATE: soil_adj2 = {}'.format(soil_adj2)) # tmp = this%dprst_vol_open(chru) + this%dprst_vol_clos(chru) # if (tmp > 0.0) then # write(output_unit, *) 'WARNING: dprst_area_max reduced to 0 with storage > 0' # write(output_unit, *) ' Storage was added to soil_moist and soil_rechr' # adj = tmp / hru_frac_perv_old(chru) # soil_moist_chg(chru) = soil_moist_chg(chru) + adj # soil_rechr_chg(chru) = soil_rechr_chg(chru) + adj # %% soil_moist + soil_adj2 # %%
''' Problem Someone just won the Code Jam lottery, and we owe them N jamcoins! However, when we tried to print out an oversized check, we encountered a problem. The value of N, which is an integer, includes at least one digit that is a 4... and the 4 key on the keyboard of our oversized check printer is broken. Fortunately, we have a workaround: we will send our winner two checks for positive integer amounts A and B, such that neither A nor B contains any digit that is a 4, and A + B = N. Please help us find any pair of values A and B that satisfy these conditions. Input The first line of the input gives the number of test cases, T. T test cases follow; each consists of one line with an integer N. Output For each test case, output one line containing Case #x: A B, where x is the test case number (starting from 1), and A and B are positive integers as described above. It is guaranteed that at least one solution exists. If there are multiple solutions, you may output any one of them. (See "What if a test case has multiple correct solutions?" in the Competing section of the FAQ. This information about multiple solutions will not be explicitly stated in the remainder of the 2019 contest.) Limits 1 ≤ T ≤ 100. Time limit: 10 seconds per test set. Memory limit: 1GB. At least one of the digits of N is a 4. Test set 1 (Visible) 1 < N < 105. Test set 2 (Visible) 1 < N < 109. Solving the first two test sets for this problem should get you a long way toward advancing. The third test set is worth only 1 extra point, for extra fun and bragging rights! Test set 3 (Hidden) 1 < N < 10100. Sample Input Output 3 4 940 4444 Case #1: 2 2 Case #2: 852 88 Case #3: 667 3777 In Sample Case #1, notice that A and B can be the same. The only other possible answers are 1 3 and 3 1. ''' for _ in range(int(input())): n = list(input()) a = '' b = '' for i in n: if i=='4': a = a + '3' b = b + '1' else: a = a + i b = b + '0' try: firstone = b.index('1') b = b[firstone:] except: b = '0' print('Case #{}: {} {}'.format(_+1,a,b))
seller_name = str(input()) salary = float(input()) sales_made = float(input()) bonus = sales_made * 15 / 100 total_salary = salary + bonus print("TOTAL = R$ {:.2f}".format(total_salary))
class Solution: def reverse(self, x: int) -> int: MAX = 2 ** 31 - 1 MIN = -(2 ** 31) rev = 0 abs_x = abs(x) while abs_x != 0: pop = abs_x % 10 abs_x //= 10 if rev > MAX / 10 or rev < MIN / 10: return 0 rev = rev * 10 + pop return rev if x > 0 else -rev if __name__ == '__main__': print(Solution().reverse(-123)) print(Solution().reverse(123)) print(Solution().reverse(-0)) print(Solution().reverse(1563847412))
# Copyright 2019 Erik Maciejewski # # 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 # # http://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. load("@debian_buster_amd64//debs:deb_packages.bzl", "debian_buster_amd64") load("@debian_buster_arm64//debs:deb_packages.bzl", "debian_buster_arm64") load("@debian_buster_armhf//debs:deb_packages.bzl", "debian_buster_armhf") load("@debian_buster_noarch//debs:deb_packages.bzl", "debian_buster_noarch") load("@debian_buster_security_amd64//debs:deb_packages.bzl", "debian_buster_security_amd64") load("@debian_buster_security_arm64//debs:deb_packages.bzl", "debian_buster_security_arm64") load("@debian_buster_security_armhf//debs:deb_packages.bzl", "debian_buster_security_armhf") load("@debian_buster_security_noarch//debs:deb_packages.bzl", "debian_buster_security_noarch") debian_buster = { "amd64": debian_buster_amd64, "arm64": debian_buster_arm64, "arm": debian_buster_armhf, "noarch": debian_buster_noarch, } debian_buster_security = { "amd64": debian_buster_security_amd64, "arm64": debian_buster_security_arm64, "arm": debian_buster_security_armhf, "noarch": debian_buster_security_noarch, }
def write_ts(ts,fname,dateformat="%Y-%m-%d %H:%M",fmt="%.2f",header=None,sep=','): """ Estimate missing values within a time series by interpolation. Parameters ---------- ts: :class:`~vtools.data.timeseries.TimeSeries` The time series to be stored fname: string Output file name or path dateformat: string Date format compatible with datetime.datetime.strftime fmt: string Value format compatible withy numpy.savetxt header: string Header to add to top of file sep: string Delimieter for fields, often a space or comma Returns ------- Examples -------- Writing csv format with date format 2009-03-15 21:00 and space separated values >>> write_ts(ts,"test.csv","%Y-%m-%d %H:%M","%.2f,%.2f","Datetime,u,v",",") Write vtide format with same format and space separated values, this time taking advantage of defaults >>> write_ts(ts,"test_vtide.dat",sep = " ") Writing cdec format, with csv values and date and time separated. The header is generated with the cdec_header helper function >>> head = cdec_header("practice.csv",ts,"PST","Wind Vel","m/s") >>> write_ts(ts,"test_cdec.csv",CDECDATEFMT,"%.2f",header=head) """ with open(fname,'w') as f: if not header is None: head = header if header.endswith('\n') else header + '\n' f.write(header+'\n') v0 = ts[0].value fmtval = lambda x: fmt % x try: test = fmtval(v0) except: try: fmtval = lambda x: fmt % tuple(x) except: fmtval = lambda z: sep.join([fmt % x for x in z]) try: fmtval(v0) except: raise ValueError("Can't use supplied format %s to format value: %s" % (fmt,v0)) for el in ts: dstring = el.time.strftime(dateformat) vstring = fmtval(el.value) f.write("%s%s%s\n" % (dstring,sep,vstring)) def cdec_header(fname,ts,tz,var=None,unit=None): """ Helper function to create a cdec-like header Requres some metadata like time zone, variable name and unit which will be pulled from series if omitted from input. Parameters ---------- fname: str Output file name or path ts: :class:`~vtools.data.timeseries.TimeSeries` The time series to be stored tz: string Time zone of data var: string Variable name unit: string Unit of the time series Returns ------- head: string CDEC-style header """ title = "Title: \"%s\"\n" % fname.upper() if var is None: var = ts.props[VARIABLE] unit = ts.props[UNIT] line2 = "0000,%s,\'%s (%s)\'" % (tz,var,unit) return title+line2 CDECDATEFMT = "%Y%m%d,%H%M" #write_ts(ts,"test.csv","%Y-%m-%d %H:%M","%.2f,%.2f","Datetime,u,v",",") #header=cdec_header("practice.csv","UTC","Wind Vel","m/s") #write_ts(ts,"test_cdec.csv",CDECDATEFMT,"%.2f",header=cdec_header("practice.csv","UTC","Wind Vel","m/s")) #write_ts(ts,"test_vtide.dat",sep = " ")
def getProtocol(url): ret = url.split("://") return ret[0] def getDomain(url): ret = url.split("://") ret2 = ret[1].split("/") full_domain = ret2[0] sub_domain = getSubD(url) if sub_domain is None: return full_domain else: return full_domain.replace(sub_domain + ".", "") def getSubD(url): ret = url.split("://") ret2 = ret[1].split(".") if len(ret2) == 3 and ret2[-1] == "br/algumacoisa": return None elif len(ret2) > 2: return ret2[0] else: return None # ret = url.split("://") # ret2 = ret[1].split(".") # ret3 = ret2[1].split("/") # return ret3[0] def parserUrl(url): return {"protocol": getProtocol(url), "domain": getDomain(url)} def main(): return True
""" Simhash Source: http://bibliographie-trac.ub.rub.de/browser/simhash.py """ # Implementation of Charikar simhashes in Python # See: http://dsrg.mff.cuni.cz/~holub/sw/shash/#a1 class Simhash(): def __init__(self, tokens='', hashbits=128): self.hashbits = hashbits self.hash = self.simhash(tokens) def __str__(self): return str(self.hash) def __float__(self): return float(self.hash) def simhash(self, tokens): # Returns a Charikar simhash with appropriate bitlength v = [0] * self.hashbits for t in [self._string_hash(x) for x in tokens]: bitmask = 0 for i in range(self.hashbits): bitmask = 1 << i if t & bitmask: v[i] += 1 else: v[i] -= 1 fingerprint = 0 for i in range(self.hashbits): if v[i] >= 0: fingerprint += 1 << i return fingerprint def _string_hash(self, v): # A variable-length version of Python's builtin hash if v == "": return 0 else: x = ord(v[0])<<7 m = 1000003 mask = 2**self.hashbits-1 for c in v: x = ((x*m)^ord(c)) & mask x ^= len(v) if x == -1: x = -2 return x def hamming_distance(self, other_hash): x = (self.hash ^ other_hash.hash) & ((1 << self.hashbits) - 1) tot = 0 while x: tot += 1 x &= x-1 return tot def similarity(self, other_hash): a = float(self.hash) b = float(other_hash) if a > b: return b/a return a/b
async def is_document_exists(collection, id): """Determine if a document with a specific id exist in a collection or not""" return await collection.count_documents({'_id': id}, limit=1) async def get_guild(guilds_collection, guild_id): """Get a guild from db.""" return await guilds_collection.find_one({'_id': guild_id}) async def add_guild(guilds_collection, guild): """Add a guild to db.""" await guilds_collection.insert_one({ '_id': guild.id, 'guild_name': guild.name, 'guild_owner_id': guild.owner_id, 'bot_prefix': '+' }) async def remove_guild(guilds_collection, guild_id): """Remove a guild from db.""" await guilds_collection.delete_one({'_id': guild_id}) async def get_custom_prefix(guilds_collection, guild_id): """Gets a custom prefix from guild document of a guild.""" doc = await get_guild(guilds_collection, guild_id) return doc['bot_prefix'] async def set_custom_prefix(guilds_collection, guild_id, bot_prefix): """Sets custom prefix for a guild.""" await guilds_collection.update_one( {'_id': guild_id}, {'$set': {'bot_prefix': bot_prefix}} ) async def set_config_value(config_collection, guild_id, config_type, config_value): """Set a config value for a specific type and guild.""" await config_collection.insert_one({ 'guild_id': guild_id, 'config_type': config_type, 'config_value': config_value }) async def delete_config_value(config_collection, guild_id, config_type): """Delete a config value for a specific type and guild.""" await config_collection.delete_one({ 'guild_id': guild_id, 'config_type': config_type }) async def delete_guild_config_values(config_collection, guild_id): """Delete all the config values associated to a guild.""" await config_collection.delete_many({'guild_id': guild_id}) async def update_config_value(config_collection, guild_id, config_type, config_value): """Update a config value of a specific type and guild.""" await config_collection.update_one( {'guild_id': guild_id, 'config_type': config_type}, {'$set': {'config_value': config_value}} ) async def is_config_value_set(config_collection, guild_id, config_type): """Check if a config_value is set or not.""" return await config_collection.count_documents( {'guild_id': guild_id, 'config_type': config_type}, limit=1 ) async def get_config_value(config_collection, guild_id, config_type): """Get a config value for a specific type and guild.""" doc = await config_collection.find_one({ 'guild_id': guild_id, 'config_type': config_type }) if not doc: return None return doc['config_value']
D = DiGraph({ 0: [1, 10, 19], 1: [8, 2], 2: [3, 6], 3: [19, 4], 4: [17, 5], 5: [6, 15], 6: [7], 7: [8, 14], 8: [9], 9: [10, 13], 10: [11], 11: [12, 18], 12: [16, 13], 13: [14], 14: [15], 15: [16], 16: [17], 17: [18], 18: [19], 19: []}) for u, v, l in D.edges(): D.set_edge_label(u, v, f'({u},{v})') sphinx_plot(D.graphplot(edge_labels=True, layout='circular'))
URL = 'https://dogsearch.moag.gov.il/#/pages/pets' ELEMENT_LIST = ['name', 'gender', 'breed', 'birthDate', 'owner', 'address', 'city', 'phone1', 'phone2', 'neutering', 'rabies-vaccine', 'rabies-vaccine-date', 'vet', 'viewReport', 'license', 'license-date-start', 'domain', 'license-latest-update', 'status'] OUTPUT_FILE = 'outputs/dogs.csv' DELAY_SEC = 5
''' Creating A function to group the sample based on the accession split the sample name based on '-' and store it into variable called 'accession_group' ''' def string_split (dataframe) : column_name = list(dataframe) sample_ID = column_name[0] accession_group = [] for word in dataframe[sample_ID] : split = word.split('-') accession_group.append(split[0]) return accession_group
def solution(X, Y, A): N = len(A) result = -1 v = 0 k = 0 nX = 0 nY = 0 for i in range(N): if A[i] == X: nX += 1 if A[i] == Y: nY += 1 #if nX == nY > 1: #result = i if nX == nY : #v += 1 k = i #return result print(k) print(solution(1, 50, [3, 2, 1, 50]))
class Solution: def isHappy(self, n: 'int') -> 'bool': happies = set() def powers(n): result = 0 while n: result += (n % 10) ** 2 n //= 10 return result power = n while True: power = powers(power) if power // 10 == 0 and power % 10 == 1: return True if power in happies: return False happies.add(power)
megabytesMonthly = int(input()) megabyteCount = 0 months = int(input()) monthlyUsage = [] for every in range(months): megabyteCount += megabytesMonthly megabyteCount -= int(input()) print(megabyteCount + megabytesMonthly)
numero = int(input('Número: ')) print(f'{numero} x {1} = {numero * 1}') print(f'{numero} x {2} = {numero * 2}') print(f'{numero} x {3} = {numero * 3}') print(f'{numero} x {4} = {numero * 4}') print(f'{numero} x {5} = {numero * 5}') print(f'{numero} x {6} = {numero * 6}') print(f'{numero} x {7} = {numero * 7}') print(f'{numero} x {8} = {numero * 8}') print(f'{numero} x {9} = {numero * 9}') print(f'{numero} x {10} = {numero * 10}')
def safedivide( numerator: float, denominator: float, valueonfailure: float = float("nan") ) -> float: try: return numerator / denominator except ZeroDivisionError: return valueonfailure
number = int(input("Enter number: ")) for num in range(1111, 9999 + 1): is_special = True for digit in str(num): digit = int(digit) if (digit == 0) or (number % digit !=0): is_special = False break if is_special: print(num)
#!/usr/bin/python3 def shift(text): return text[1:] + text[0] t = input() s = input() found = False for i in range(len(s)): if t.find(s) != -1: found = True break s = shift(s) if found == True: print("yes") else: print("no")
def grep(pattern): print("Start coroutine") try: while True: line = yield if pattern in line: print(line) except GeneratorExit: print("Stop coroutine") def grep_python(): g = grep("Python") yield from g g = grep_python() # generator next(g) g.send("Is Go better?") g.send("Python is not simple")
""" Symlet 7 wavelet """ class Symlet7: """ Properties ---------- near symmetric, orthogonal, biorthogonal All values are from http://wavelets.pybytes.com/wavelet/sym7/ """ __name__ = "Symlet Wavelet 7" __motherWaveletLength__ = 14 # length of the mother wavelet __transformWaveletLength__ = 2 # minimum wavelength of input signal # decomposition filter # low-pass decompositionLowFilter = [ 0.002681814568257878, -0.0010473848886829163, -0.01263630340325193, 0.03051551316596357, 0.0678926935013727, -0.049552834937127255, 0.017441255086855827, 0.5361019170917628, 0.767764317003164, 0.2886296317515146, -0.14004724044296152, -0.10780823770381774, 0.004010244871533663, 0.010268176708511255, ] # high-pass decompositionHighFilter = [ -0.010268176708511255, 0.004010244871533663, 0.10780823770381774, -0.14004724044296152, -0.2886296317515146, 0.767764317003164, -0.5361019170917628, 0.017441255086855827, 0.049552834937127255, 0.0678926935013727, -0.03051551316596357, -0.01263630340325193, 0.0010473848886829163, 0.002681814568257878, ] # reconstruction filters # low pass reconstructionLowFilter = [ 0.010268176708511255, 0.004010244871533663, -0.10780823770381774, -0.14004724044296152, 0.2886296317515146, 0.767764317003164, 0.5361019170917628, 0.017441255086855827, -0.049552834937127255, 0.0678926935013727, 0.03051551316596357, -0.01263630340325193, -0.0010473848886829163, 0.002681814568257878, ] # high-pass reconstructionHighFilter = [ 0.002681814568257878, 0.0010473848886829163, -0.01263630340325193, -0.03051551316596357, 0.0678926935013727, 0.049552834937127255, 0.017441255086855827, -0.5361019170917628, 0.767764317003164, -0.2886296317515146, -0.14004724044296152, 0.10780823770381774, 0.004010244871533663, -0.010268176708511255, ]
class Solution(object): self.prev = None def flatten(self, root): """ :type root: TreeNode :rtype: void Do not return anything, modify root in-place instead. """ if not root: return None self.flatten(root.right) self.flatten(root.left) root.right = self.prev root.left = None self.prev = root
class A: def foo(self): pass async def bar(self): pass
def clamp(floatnum, floatmin, floatmax): if floatnum < floatmin: floatnum = floatmin if floatnum > floatmax: floatnum = floatmax return floatnum def smootherstep(edge0, edge1, x): # Scale, bias and saturate x to 0..1 range x = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0) # Evaluate polynomial # Standard smoothstep version if needed: x * x * (3 - 2 - x) return x * x * x * (x * (x * 6 - 15) + 10)
ar = [float(i) for i in input().split()] ar_sq = [] for i in range(len(ar)): ar_sq.append(ar[i]**2) ar_sq = sorted(ar_sq) print(ar_sq[0], end = ' ') for i in range(1, len(ar_sq)): if ar_sq[i] != ar_sq[i-1]: print(ar_sq[i], end = ' ')
# https://docs.python.org/3/library/functions.html#open # Obs: 'w+' cria um arquivo do zero # Obs: 'a+' vai add mais coisas ao arquivo # Obs: 'r' vai ler o arquivo # Começo do codigo # file = open('abc.txt', 'w+') # file.write('linha 1\n') # file.write('linha 2\n') # file.write('linha 3\n') # # file.seek(0, 0) # Mostra tudo # print('Lendo Linhas') # print(file.read()) # print('#' * 20) # # file.seek(0, 0) # print(file.readline(), end='') # print(file.readline(), end='') # print(file.readline(), end='') # # file.seek(0, 0) # # print('#' * 20) # for linha in file.readlines(): # print(linha, end='') # file.close() # Começo do codigo # try: # file = open('abc.txt', 'w+') # file.write('Linha') # file.seek(0, 0) # print(file.read()) # finally: # file.close() # Comeco do codigo melhor jeito de fazer # with open('abc.txt', 'w+') as file: # file.write('linha 1 ') # file.write('linha 2 ') # file.write('linha 3') # file.seek(0) # print(file.read()) # comeco do codigo # with open('abc.txt', 'r') as file: # 'r' Vai apenas ler o arquivo # print(file.read()) # Comeco do codigo with open('abc.txt', 'a+') as file: # 'a+' Vai adicionar sem apagar ele file.write(' Outra linha') file.seek(0) print(file.read())
#!/usr/bin/python # -*- coding: utf-8 -*- ################################################################################ # Copyright (c) 2019 University of Utah Student Computing Labs. # All Rights Reserved. # # Author: Thackery Archuletta # Creation Date: Oct 2018 # Last Updated: March 2019 # # Permission to use, copy, modify, and distribute this software and # its documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appears in all copies and # that both that copyright notice and this permission notice appear # in supporting documentation, and that the name of The University # of Utah not be used in advertising or publicity pertaining to # distribution of the software without specific, written prior # permission. This software is supplied as is without expressed or # implied warranties of any kind. ################################################################################ class Controller(object): """Parent class for controller objects.""" def _set_to_middle(self, window): """Sets a Tkinter window to the center of the screen. Args: window: Tkinter window. Returns: void """ # <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><> # Updates window info to current window state window.update_idletasks() # <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><> # Gets computer screen width and height screen_width = window.winfo_screenwidth() screen_height = window.winfo_screenheight() x = int(screen_width / 2 - window.winfo_width()/2) y = int(screen_height / 4) # <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><> # Sets window position window.geometry('+{}+{}'.format(x, y))
# # PySNMP MIB module DISMAN-EXPRESSION-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/DISMAN-EXPRESSION-MIB # Produced by pysmi-0.3.4 at Wed May 1 12:47:14 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ConstraintsUnion, ConstraintsIntersection, ValueRangeConstraint, SingleValueConstraint, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsUnion", "ConstraintsIntersection", "ValueRangeConstraint", "SingleValueConstraint", "ValueSizeConstraint") SnmpAdminString, = mibBuilder.importSymbols("SNMP-FRAMEWORK-MIB", "SnmpAdminString") ObjectGroup, NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "ObjectGroup", "NotificationGroup", "ModuleCompliance") sysUpTime, = mibBuilder.importSymbols("SNMPv2-MIB", "sysUpTime") MibScalar, MibTable, MibTableRow, MibTableColumn, Integer32, Unsigned32, mib_2, zeroDotZero, IpAddress, NotificationType, MibIdentifier, ModuleIdentity, Gauge32, Bits, Counter32, TimeTicks, iso, Counter64, ObjectIdentity = mibBuilder.importSymbols("SNMPv2-SMI", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Integer32", "Unsigned32", "mib-2", "zeroDotZero", "IpAddress", "NotificationType", "MibIdentifier", "ModuleIdentity", "Gauge32", "Bits", "Counter32", "TimeTicks", "iso", "Counter64", "ObjectIdentity") DisplayString, TruthValue, RowStatus, TextualConvention, TimeStamp = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TruthValue", "RowStatus", "TextualConvention", "TimeStamp") dismanExpressionMIB = ModuleIdentity((1, 3, 6, 1, 2, 1, 90)) dismanExpressionMIB.setRevisions(('2000-10-16 00:00',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: dismanExpressionMIB.setRevisionsDescriptions(('This is the initial version of this MIB. Published as RFC 2982',)) if mibBuilder.loadTexts: dismanExpressionMIB.setLastUpdated('200010160000Z') if mibBuilder.loadTexts: dismanExpressionMIB.setOrganization('IETF Distributed Management Working Group') if mibBuilder.loadTexts: dismanExpressionMIB.setContactInfo('Ramanathan Kavasseri Cisco Systems, Inc. 170 West Tasman Drive, San Jose CA 95134-1706. Phone: +1 408 527 2446 Email: ramk@cisco.com') if mibBuilder.loadTexts: dismanExpressionMIB.setDescription('The MIB module for defining expressions of MIB objects for management purposes.') dismanExpressionMIBObjects = MibIdentifier((1, 3, 6, 1, 2, 1, 90, 1)) expResource = MibIdentifier((1, 3, 6, 1, 2, 1, 90, 1, 1)) expDefine = MibIdentifier((1, 3, 6, 1, 2, 1, 90, 1, 2)) expValue = MibIdentifier((1, 3, 6, 1, 2, 1, 90, 1, 3)) expResourceDeltaMinimum = MibScalar((1, 3, 6, 1, 2, 1, 90, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(-1, -1), ValueRangeConstraint(1, 600), ))).setUnits('seconds').setMaxAccess("readwrite") if mibBuilder.loadTexts: expResourceDeltaMinimum.setStatus('current') if mibBuilder.loadTexts: expResourceDeltaMinimum.setDescription("The minimum expExpressionDeltaInterval this system will accept. A system may use the larger values of this minimum to lessen the impact of constantly computing deltas. For larger delta sampling intervals the system samples less often and suffers less overhead. This object provides a way to enforce such lower overhead for all expressions created after it is set. The value -1 indicates that expResourceDeltaMinimum is irrelevant as the system will not accept 'deltaValue' as a value for expObjectSampleType. Unless explicitly resource limited, a system's value for this object should be 1, allowing as small as a 1 second interval for ongoing delta sampling. Changing this value will not invalidate an existing setting of expObjectSampleType.") expResourceDeltaWildcardInstanceMaximum = MibScalar((1, 3, 6, 1, 2, 1, 90, 1, 1, 2), Unsigned32()).setUnits('instances').setMaxAccess("readwrite") if mibBuilder.loadTexts: expResourceDeltaWildcardInstanceMaximum.setStatus('current') if mibBuilder.loadTexts: expResourceDeltaWildcardInstanceMaximum.setDescription("For every instance of a deltaValue object, one dynamic instance entry is needed for holding the instance value from the previous sample, i.e. to maintain state. This object limits maximum number of dynamic instance entries this system will support for wildcarded delta objects in expressions. For a given delta expression, the number of dynamic instances is the number of values that meet all criteria to exist times the number of delta values in the expression. A value of 0 indicates no preset limit, that is, the limit is dynamic based on system operation and resources. Unless explicitly resource limited, a system's value for this object should be 0. Changing this value will not eliminate or inhibit existing delta wildcard instance objects but will prevent the creation of more such objects. An attempt to allocate beyond the limit results in expErrorCode being tooManyWildcardValues for that evaluation attempt.") expResourceDeltaWildcardInstances = MibScalar((1, 3, 6, 1, 2, 1, 90, 1, 1, 3), Gauge32()).setUnits('instances').setMaxAccess("readonly") if mibBuilder.loadTexts: expResourceDeltaWildcardInstances.setStatus('current') if mibBuilder.loadTexts: expResourceDeltaWildcardInstances.setDescription('The number of currently active instance entries as defined for expResourceDeltaWildcardInstanceMaximum.') expResourceDeltaWildcardInstancesHigh = MibScalar((1, 3, 6, 1, 2, 1, 90, 1, 1, 4), Gauge32()).setUnits('instances').setMaxAccess("readonly") if mibBuilder.loadTexts: expResourceDeltaWildcardInstancesHigh.setStatus('current') if mibBuilder.loadTexts: expResourceDeltaWildcardInstancesHigh.setDescription('The highest value of expResourceDeltaWildcardInstances that has occurred since initialization of the managed system.') expResourceDeltaWildcardInstanceResourceLacks = MibScalar((1, 3, 6, 1, 2, 1, 90, 1, 1, 5), Counter32()).setUnits('instances').setMaxAccess("readonly") if mibBuilder.loadTexts: expResourceDeltaWildcardInstanceResourceLacks.setStatus('current') if mibBuilder.loadTexts: expResourceDeltaWildcardInstanceResourceLacks.setDescription('The number of times this system could not evaluate an expression because that would have created a value instance in excess of expResourceDeltaWildcardInstanceMaximum.') expExpressionTable = MibTable((1, 3, 6, 1, 2, 1, 90, 1, 2, 1), ) if mibBuilder.loadTexts: expExpressionTable.setStatus('current') if mibBuilder.loadTexts: expExpressionTable.setDescription('A table of expression definitions.') expExpressionEntry = MibTableRow((1, 3, 6, 1, 2, 1, 90, 1, 2, 1, 1), ).setIndexNames((0, "DISMAN-EXPRESSION-MIB", "expExpressionOwner"), (0, "DISMAN-EXPRESSION-MIB", "expExpressionName")) if mibBuilder.loadTexts: expExpressionEntry.setStatus('current') if mibBuilder.loadTexts: expExpressionEntry.setDescription("Information about a single expression. New expressions can be created using expExpressionRowStatus. To create an expression first create the named entry in this table. Then use expExpressionName to populate expObjectTable. For expression evaluation to succeed all related entries in expExpressionTable and expObjectTable must be 'active'. If these conditions are not met the corresponding values in expValue simply are not instantiated. Deleting an entry deletes all related entries in expObjectTable and expErrorTable. Because of the relationships among the multiple tables for an expression (expExpressionTable, expObjectTable, and expValueTable) and the SNMP rules for independence in setting object values, it is necessary to do final error checking when an expression is evaluated, that is, when one of its instances in expValueTable is read or a delta interval expires. Earlier checking need not be done and an implementation may not impose any ordering on the creation of objects related to an expression. To maintain security of MIB information, when creating a new row in this table, the managed system must record the security credentials of the requester. These security credentials are the parameters necessary as inputs to isAccessAllowed from the Architecture for Describing SNMP Management Frameworks. When obtaining the objects that make up the expression, the system must (conceptually) use isAccessAllowed to ensure that it does not violate security. The evaluation of the expression takes place under the security credentials of the creator of its expExpressionEntry. Values of read-write objects in this table may be changed at any time.") expExpressionOwner = MibTableColumn((1, 3, 6, 1, 2, 1, 90, 1, 2, 1, 1, 1), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))) if mibBuilder.loadTexts: expExpressionOwner.setStatus('current') if mibBuilder.loadTexts: expExpressionOwner.setDescription('The owner of this entry. The exact semantics of this string are subject to the security policy defined by the security administrator.') expExpressionName = MibTableColumn((1, 3, 6, 1, 2, 1, 90, 1, 2, 1, 1, 2), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))) if mibBuilder.loadTexts: expExpressionName.setStatus('current') if mibBuilder.loadTexts: expExpressionName.setDescription('The name of the expression. This is locally unique, within the scope of an expExpressionOwner.') expExpression = MibTableColumn((1, 3, 6, 1, 2, 1, 90, 1, 2, 1, 1, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 1024))).setMaxAccess("readcreate") if mibBuilder.loadTexts: expExpression.setStatus('current') if mibBuilder.loadTexts: expExpression.setDescription("The expression to be evaluated. This object is the same as a DisplayString (RFC 1903) except for its maximum length. Except for the variable names the expression is in ANSI C syntax. Only the subset of ANSI C operators and functions listed here is allowed. Variables are expressed as a dollar sign ('$') and an integer that corresponds to an expObjectIndex. An example of a valid expression is: ($1-$5)*100 Expressions must not be recursive, that is although an expression may use the results of another expression, it must not contain any variable that is directly or indirectly a result of its own evaluation. The managed system must check for recursive expressions. The only allowed operators are: ( ) - (unary) + - * / % & | ^ << >> ~ ! && || == != > >= < <= Note the parentheses are included for parenthesizing the expression, not for casting data types. The only constant types defined are: int (32-bit signed) long (64-bit signed) unsigned int unsigned long hexadecimal character string oid The default type for a positive integer is int unless it is too large in which case it is long. All but oid are as defined for ANSI C. Note that a hexadecimal constant may end up as a scalar or an array of 8-bit integers. A string constant is enclosed in double quotes and may contain back-slashed individual characters as in ANSI C. An oid constant comprises 32-bit, unsigned integers and at least one period, for example: 0. .0 1.3.6.1 No additional leading or trailing subidentifiers are automatically added to an OID constant. The constant is taken as expressed. Integer-typed objects are treated as 32- or 64-bit, signed or unsigned integers, as appropriate. The results of mixing them are as for ANSI C, including the type of the result. Note that a 32-bit value is thus promoted to 64 bits only in an operation with a 64-bit value. There is no provision for larger values to handle overflow. Relative to SNMP data types, a resulting value becomes unsigned when calculating it uses any unsigned value, including a counter. To force the final value to be of data type counter the expression must explicitly use the counter32() or counter64() function (defined below). OCTET STRINGS and OBJECT IDENTIFIERs are treated as one-dimensioned arrays of unsigned 8-bit integers and unsigned 32-bit integers, respectively. IpAddresses are treated as 32-bit, unsigned integers in network byte order, that is, the hex version of 255.0.0.0 is 0xff000000. Conditional expressions result in a 32-bit, unsigned integer of value 0 for false or 1 for true. When an arbitrary value is used as a boolean 0 is false and non-zero is true. Rules for the resulting data type from an operation, based on the operator: For << and >> the result is the same as the left hand operand. For &&, ||, ==, !=, <, <=, >, and >= the result is always Unsigned32. For unary - the result is always Integer32. For +, -, *, /, %, &, |, and ^ the result is promoted according to the following rules, in order from most to least preferred: If left hand and right hand operands are the same type, use that. If either side is Counter64, use that. If either side is IpAddress, use that. If either side is TimeTicks, use that. If either side is Counter32, use that. Otherwise use Unsigned32. The following rules say what operators apply with what data types. Any combination not explicitly defined does not work. For all operators any of the following can be the left hand or right hand operand: Integer32, Counter32, Unsigned32, Counter64. The operators +, -, *, /, %, <, <=, >, and >= work with TimeTicks. The operators &, |, and ^ work with IpAddress. The operators << and >> work with IpAddress but only as the left hand operand. The + operator performs a concatenation of two OCTET STRINGs or two OBJECT IDENTIFIERs. The operators &, | perform bitwise operations on OCTET STRINGs. If the OCTET STRING happens to be a DisplayString the results may be meaningless, but the agent system does not check this as some such systems do not have this information. The operators << and >> perform bitwise operations on OCTET STRINGs appearing as the left hand operand. The only functions defined are: counter32 counter64 arraySection stringBegins stringEnds stringContains oidBegins oidEnds oidContains average maximum minimum sum exists The following function definitions indicate their parameters by naming the data type of the parameter in the parameter's position in the parameter list. The parameter must be of the type indicated and generally may be a constant, a MIB object, a function, or an expression. counter32(integer) - wrapped around an integer value counter32 forces Counter32 as a data type. counter64(integer) - similar to counter32 except that the resulting data type is 'counter64'. arraySection(array, integer, integer) - selects a piece of an array (i.e. part of an OCTET STRING or OBJECT IDENTIFIER). The integer arguments are in the range 0 to 4,294,967,295. The first is an initial array index (one-dimensioned) and the second is an ending array index. A value of 0 indicates first or last element, respectively. If the first element is larger than the array length the result is 0 length. If the second integer is less than or equal to the first, the result is 0 length. If the second is larger than the array length it indicates last element. stringBegins/Ends/Contains(octetString, octetString) - looks for the second string (which can be a string constant) in the first and returns the one-dimensioned arrayindex where the match began. A return value of 0 indicates no match (i.e. boolean false). oidBegins/Ends/Contains(oid, oid) - looks for the second OID (which can be an OID constant) in the first and returns the the one-dimensioned index where the match began. A return value of 0 indicates no match (i.e. boolean false). average/maximum/minimum(integer) - calculates the average, minimum, or maximum value of the integer valued object over multiple sample times. If the object disappears for any sample period, the accumulation and the resulting value object cease to exist until the object reappears at which point the calculation starts over. sum(integerObject*) - sums all available values of the wildcarded integer object, resulting in an integer scalar. Must be used with caution as it wraps on overflow with no notification. exists(anyTypeObject) - verifies the object instance exists. A return value of 0 indicates NoSuchInstance (i.e. boolean false).") expExpressionValueType = MibTableColumn((1, 3, 6, 1, 2, 1, 90, 1, 2, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8))).clone(namedValues=NamedValues(("counter32", 1), ("unsigned32", 2), ("timeTicks", 3), ("integer32", 4), ("ipAddress", 5), ("octetString", 6), ("objectId", 7), ("counter64", 8))).clone('counter32')).setMaxAccess("readcreate") if mibBuilder.loadTexts: expExpressionValueType.setStatus('current') if mibBuilder.loadTexts: expExpressionValueType.setDescription('The type of the expression value. One and only one of the value objects in expValueTable will be instantiated to match this type. If the result of the expression can not be made into this type, an invalidOperandType error will occur.') expExpressionComment = MibTableColumn((1, 3, 6, 1, 2, 1, 90, 1, 2, 1, 1, 5), SnmpAdminString().clone(hexValue="")).setMaxAccess("readcreate") if mibBuilder.loadTexts: expExpressionComment.setStatus('current') if mibBuilder.loadTexts: expExpressionComment.setDescription('A comment to explain the use or meaning of the expression.') expExpressionDeltaInterval = MibTableColumn((1, 3, 6, 1, 2, 1, 90, 1, 2, 1, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 86400))).setUnits('seconds').setMaxAccess("readcreate") if mibBuilder.loadTexts: expExpressionDeltaInterval.setStatus('current') if mibBuilder.loadTexts: expExpressionDeltaInterval.setDescription("Sampling interval for objects in this expression with expObjectSampleType 'deltaValue'. This object has no effect if the the expression has no deltaValue objects. A value of 0 indicates no automated sampling. In this case the delta is the difference from the last time the expression was evaluated. Note that this is subject to unpredictable delta times in the face of retries or multiple managers. A value greater than zero is the number of seconds between automated samples. Until the delta interval has expired once the delta for the object is effectively not instantiated and evaluating the expression has results as if the object itself were not instantiated. Note that delta values potentially consume large amounts of system CPU and memory. Delta state and processing must continue constantly even if the expression is not being used. That is, the expression is being evaluated every delta interval, even if no application is reading those values. For wildcarded objects this can be substantial overhead. Note that delta intervals, external expression value sampling intervals and delta intervals for expressions within other expressions can have unusual interactions as they are impossible to synchronize accurately. In general one interval embedded below another must be enough shorter that the higher sample sees relatively smooth, predictable behavior. So, for example, to avoid the higher level getting the same sample twice, the lower level should sample at least twice as fast as the higher level does.") expExpressionPrefix = MibTableColumn((1, 3, 6, 1, 2, 1, 90, 1, 2, 1, 1, 7), ObjectIdentifier()).setMaxAccess("readonly") if mibBuilder.loadTexts: expExpressionPrefix.setStatus('current') if mibBuilder.loadTexts: expExpressionPrefix.setDescription('An object prefix to assist an application in determining the instance indexing to use in expValueTable, relieving the application of the need to scan the expObjectTable to determine such a prefix. See expObjectTable for information on wildcarded objects. If the expValueInstance portion of the value OID may be treated as a scalar (that is, normally, 0) the value of expExpressionPrefix is zero length, that is, no OID at all. Note that zero length implies a null OID, not the OID 0.0. Otherwise, the value of expExpressionPrefix is the expObjectID value of any one of the wildcarded objects for the expression. This is sufficient, as the remainder, that is, the instance fragment relevant to instancing the values, must be the same for all wildcarded objects in the expression.') expExpressionErrors = MibTableColumn((1, 3, 6, 1, 2, 1, 90, 1, 2, 1, 1, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: expExpressionErrors.setStatus('current') if mibBuilder.loadTexts: expExpressionErrors.setDescription('The number of errors encountered while evaluating this expression. Note that an object in the expression not being accessible, is not considered an error. An example of an inaccessible object is when the object is excluded from the view of the user whose security credentials are used in the expression evaluation. In such cases, it is a legitimate condition that causes the corresponding expression value not to be instantiated.') expExpressionEntryStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 90, 1, 2, 1, 1, 9), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: expExpressionEntryStatus.setStatus('current') if mibBuilder.loadTexts: expExpressionEntryStatus.setDescription('The control that allows creation and deletion of entries.') expErrorTable = MibTable((1, 3, 6, 1, 2, 1, 90, 1, 2, 2), ) if mibBuilder.loadTexts: expErrorTable.setStatus('current') if mibBuilder.loadTexts: expErrorTable.setDescription('A table of expression errors.') expErrorEntry = MibTableRow((1, 3, 6, 1, 2, 1, 90, 1, 2, 2, 1), ).setIndexNames((0, "DISMAN-EXPRESSION-MIB", "expExpressionOwner"), (0, "DISMAN-EXPRESSION-MIB", "expExpressionName")) if mibBuilder.loadTexts: expErrorEntry.setStatus('current') if mibBuilder.loadTexts: expErrorEntry.setDescription('Information about errors in processing an expression. Entries appear in this table only when there is a matching expExpressionEntry and then only when there has been an error for that expression as reflected by the error codes defined for expErrorCode.') expErrorTime = MibTableColumn((1, 3, 6, 1, 2, 1, 90, 1, 2, 2, 1, 1), TimeStamp()).setMaxAccess("readonly") if mibBuilder.loadTexts: expErrorTime.setStatus('current') if mibBuilder.loadTexts: expErrorTime.setDescription('The value of sysUpTime the last time an error caused a failure to evaluate this expression.') expErrorIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 90, 1, 2, 2, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: expErrorIndex.setStatus('current') if mibBuilder.loadTexts: expErrorIndex.setDescription('The one-dimensioned character array index into expExpression for where the error occurred. The value zero indicates irrelevance.') expErrorCode = MibTableColumn((1, 3, 6, 1, 2, 1, 90, 1, 2, 2, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11))).clone(namedValues=NamedValues(("invalidSyntax", 1), ("undefinedObjectIndex", 2), ("unrecognizedOperator", 3), ("unrecognizedFunction", 4), ("invalidOperandType", 5), ("unmatchedParenthesis", 6), ("tooManyWildcardValues", 7), ("recursion", 8), ("deltaTooShort", 9), ("resourceUnavailable", 10), ("divideByZero", 11)))).setMaxAccess("readonly") if mibBuilder.loadTexts: expErrorCode.setStatus('current') if mibBuilder.loadTexts: expErrorCode.setDescription("The error that occurred. In the following explanations the expected timing of the error is in parentheses. 'S' means the error occurs on a Set request. 'E' means the error occurs on the attempt to evaluate the expression either due to Get from expValueTable or in ongoing delta processing. invalidSyntax the value sent for expExpression is not valid Expression MIB expression syntax (S) undefinedObjectIndex an object reference ($n) in expExpression does not have a matching instance in expObjectTable (E) unrecognizedOperator the value sent for expExpression held an unrecognized operator (S) unrecognizedFunction the value sent for expExpression held an unrecognized function name (S) invalidOperandType an operand in expExpression is not the right type for the associated operator or result (SE) unmatchedParenthesis the value sent for expExpression is not correctly parenthesized (S) tooManyWildcardValues evaluating the expression exceeded the limit set by expResourceDeltaWildcardInstanceMaximum (E) recursion through some chain of embedded expressions the expression invokes itself (E) deltaTooShort the delta for the next evaluation passed before the system could evaluate the present sample (E) resourceUnavailable some resource, typically dynamic memory, was unavailable (SE) divideByZero an attempt to divide by zero occurred (E) For the errors that occur when the attempt is made to set expExpression Set request fails with the SNMP error code 'wrongValue'. Such failures refer to the most recent failure to Set expExpression, not to the present value of expExpression which must be either unset or syntactically correct. Errors that occur during evaluation for a Get* operation return the SNMP error code 'genErr' except for 'tooManyWildcardValues' and 'resourceUnavailable' which return the SNMP error code 'resourceUnavailable'.") expErrorInstance = MibTableColumn((1, 3, 6, 1, 2, 1, 90, 1, 2, 2, 1, 4), ObjectIdentifier()).setMaxAccess("readonly") if mibBuilder.loadTexts: expErrorInstance.setStatus('current') if mibBuilder.loadTexts: expErrorInstance.setDescription('The expValueInstance being evaluated when the error occurred. A zero-length indicates irrelevance.') expObjectTable = MibTable((1, 3, 6, 1, 2, 1, 90, 1, 2, 3), ) if mibBuilder.loadTexts: expObjectTable.setStatus('current') if mibBuilder.loadTexts: expObjectTable.setDescription('A table of object definitions for each expExpression. Wildcarding instance IDs: It is legal to omit all or part of the instance portion for some or all of the objects in an expression. (See the DESCRIPTION of expObjectID for details. However, note that if more than one object in the same expression is wildcarded in this way, they all must be objects where that portion of the instance is the same. In other words, all objects may be in the same SEQUENCE or in different SEQUENCEs but with the same semantic index value (e.g., a value of ifIndex) for the wildcarded portion.') expObjectEntry = MibTableRow((1, 3, 6, 1, 2, 1, 90, 1, 2, 3, 1), ).setIndexNames((0, "DISMAN-EXPRESSION-MIB", "expExpressionOwner"), (0, "DISMAN-EXPRESSION-MIB", "expExpressionName"), (0, "DISMAN-EXPRESSION-MIB", "expObjectIndex")) if mibBuilder.loadTexts: expObjectEntry.setStatus('current') if mibBuilder.loadTexts: expObjectEntry.setDescription('Information about an object. An application uses expObjectEntryStatus to create entries in this table while in the process of defining an expression. Values of read-create objects in this table may be changed at any time.') expObjectIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 90, 1, 2, 3, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 4294967295))) if mibBuilder.loadTexts: expObjectIndex.setStatus('current') if mibBuilder.loadTexts: expObjectIndex.setDescription("Within an expression, a unique, numeric identification for an object. Prefixed with a dollar sign ('$') this is used to reference the object in the corresponding expExpression.") expObjectID = MibTableColumn((1, 3, 6, 1, 2, 1, 90, 1, 2, 3, 1, 2), ObjectIdentifier()).setMaxAccess("readcreate") if mibBuilder.loadTexts: expObjectID.setStatus('current') if mibBuilder.loadTexts: expObjectID.setDescription('The OBJECT IDENTIFIER (OID) of this object. The OID may be fully qualified, meaning it includes a complete instance identifier part (e.g., ifInOctets.1 or sysUpTime.0), or it may not be fully qualified, meaning it may lack all or part of the instance identifier. If the expObjectID is not fully qualified, then expObjectWildcard must be set to true(1). The value of the expression will be multiple values, as if done for a GetNext sweep of the object. An object here may itself be the result of an expression but recursion is not allowed. NOTE: The simplest implementations of this MIB may not allow wildcards.') expObjectIDWildcard = MibTableColumn((1, 3, 6, 1, 2, 1, 90, 1, 2, 3, 1, 3), TruthValue().clone('false')).setMaxAccess("readcreate") if mibBuilder.loadTexts: expObjectIDWildcard.setStatus('current') if mibBuilder.loadTexts: expObjectIDWildcard.setDescription('A true value indicates the expObjecID of this row is a wildcard object. False indicates that expObjectID is fully instanced. If all expObjectWildcard values for a given expression are FALSE, expExpressionPrefix will reflect a scalar object (i.e. will be 0.0). NOTE: The simplest implementations of this MIB may not allow wildcards.') expObjectSampleType = MibTableColumn((1, 3, 6, 1, 2, 1, 90, 1, 2, 3, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("absoluteValue", 1), ("deltaValue", 2), ("changedValue", 3))).clone('absoluteValue')).setMaxAccess("readcreate") if mibBuilder.loadTexts: expObjectSampleType.setStatus('current') if mibBuilder.loadTexts: expObjectSampleType.setDescription("The method of sampling the selected variable. An 'absoluteValue' is simply the present value of the object. A 'deltaValue' is the present value minus the previous value, which was sampled expExpressionDeltaInterval seconds ago. This is intended primarily for use with SNMP counters, which are meaningless as an 'absoluteValue', but may be used with any integer-based value. A 'changedValue' is a boolean for whether the present value is different from the previous value. It is applicable to any data type and results in an Unsigned32 with value 1 if the object's value is changed and 0 if not. In all other respects it is as a 'deltaValue' and all statements and operation regarding delta values apply to changed values. When an expression contains both delta and absolute values the absolute values are obtained at the end of the delta period.") sysUpTimeInstance = MibIdentifier((1, 3, 6, 1, 2, 1, 1, 3, 0)) expObjectDeltaDiscontinuityID = MibTableColumn((1, 3, 6, 1, 2, 1, 90, 1, 2, 3, 1, 5), ObjectIdentifier().clone((1, 3, 6, 1, 2, 1, 1, 3, 0))).setMaxAccess("readcreate") if mibBuilder.loadTexts: expObjectDeltaDiscontinuityID.setStatus('current') if mibBuilder.loadTexts: expObjectDeltaDiscontinuityID.setDescription("The OBJECT IDENTIFIER (OID) of a TimeTicks, TimeStamp, or DateAndTime object that indicates a discontinuity in the value at expObjectID. This object is instantiated only if expObjectSampleType is 'deltaValue' or 'changedValue'. The OID may be for a leaf object (e.g. sysUpTime.0) or may be wildcarded to match expObjectID. This object supports normal checking for a discontinuity in a counter. Note that if this object does not point to sysUpTime discontinuity checking must still check sysUpTime for an overall discontinuity. If the object identified is not accessible no discontinuity check will be made.") expObjectDiscontinuityIDWildcard = MibTableColumn((1, 3, 6, 1, 2, 1, 90, 1, 2, 3, 1, 6), TruthValue().clone('false')).setMaxAccess("readcreate") if mibBuilder.loadTexts: expObjectDiscontinuityIDWildcard.setStatus('current') if mibBuilder.loadTexts: expObjectDiscontinuityIDWildcard.setDescription("A true value indicates the expObjectDeltaDiscontinuityID of this row is a wildcard object. False indicates that expObjectDeltaDiscontinuityID is fully instanced. This object is instantiated only if expObjectSampleType is 'deltaValue' or 'changedValue'. NOTE: The simplest implementations of this MIB may not allow wildcards.") expObjectDiscontinuityIDType = MibTableColumn((1, 3, 6, 1, 2, 1, 90, 1, 2, 3, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("timeTicks", 1), ("timeStamp", 2), ("dateAndTime", 3))).clone('timeTicks')).setMaxAccess("readcreate") if mibBuilder.loadTexts: expObjectDiscontinuityIDType.setStatus('current') if mibBuilder.loadTexts: expObjectDiscontinuityIDType.setDescription("The value 'timeTicks' indicates the expObjectDeltaDiscontinuityID of this row is of syntax TimeTicks. The value 'timeStamp' indicates syntax TimeStamp. The value 'dateAndTime indicates syntax DateAndTime. This object is instantiated only if expObjectSampleType is 'deltaValue' or 'changedValue'.") expObjectConditional = MibTableColumn((1, 3, 6, 1, 2, 1, 90, 1, 2, 3, 1, 8), ObjectIdentifier().clone((0, 0))).setMaxAccess("readcreate") if mibBuilder.loadTexts: expObjectConditional.setStatus('current') if mibBuilder.loadTexts: expObjectConditional.setDescription('The OBJECT IDENTIFIER (OID) of an object that overrides whether the instance of expObjectID is to be considered usable. If the value of the object at expObjectConditional is 0 or not instantiated, the object at expObjectID is treated as if it is not instantiated. In other words, expObjectConditional is a filter that controls whether or not to use the value at expObjectID. The OID may be for a leaf object (e.g. sysObjectID.0) or may be wildcarded to match expObjectID. If expObject is wildcarded and expObjectID in the same row is not, the wild portion of expObjectConditional must match the wildcarding of the rest of the expression. If no object in the expression is wildcarded but expObjectConditional is, use the lexically first instance (if any) of expObjectConditional. If the value of expObjectConditional is 0.0 operation is as if the value pointed to by expObjectConditional is a non-zero (true) value. Note that expObjectConditional can not trivially use an object of syntax TruthValue, since the underlying value is not 0 or 1.') expObjectConditionalWildcard = MibTableColumn((1, 3, 6, 1, 2, 1, 90, 1, 2, 3, 1, 9), TruthValue().clone('false')).setMaxAccess("readcreate") if mibBuilder.loadTexts: expObjectConditionalWildcard.setStatus('current') if mibBuilder.loadTexts: expObjectConditionalWildcard.setDescription('A true value indicates the expObjectConditional of this row is a wildcard object. False indicates that expObjectConditional is fully instanced. NOTE: The simplest implementations of this MIB may not allow wildcards.') expObjectEntryStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 90, 1, 2, 3, 1, 10), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: expObjectEntryStatus.setStatus('current') if mibBuilder.loadTexts: expObjectEntryStatus.setDescription('The control that allows creation/deletion of entries. Objects in this table may be changed while expObjectEntryStatus is in any state.') expValueTable = MibTable((1, 3, 6, 1, 2, 1, 90, 1, 3, 1), ) if mibBuilder.loadTexts: expValueTable.setStatus('current') if mibBuilder.loadTexts: expValueTable.setDescription('A table of values from evaluated expressions.') expValueEntry = MibTableRow((1, 3, 6, 1, 2, 1, 90, 1, 3, 1, 1), ).setIndexNames((0, "DISMAN-EXPRESSION-MIB", "expExpressionOwner"), (0, "DISMAN-EXPRESSION-MIB", "expExpressionName"), (1, "DISMAN-EXPRESSION-MIB", "expValueInstance")) if mibBuilder.loadTexts: expValueEntry.setStatus('current') if mibBuilder.loadTexts: expValueEntry.setDescription("A single value from an evaluated expression. For a given instance, only one 'Val' object in the conceptual row will be instantiated, that is, the one with the appropriate type for the value. For values that contain no objects of expObjectSampleType 'deltaValue' or 'changedValue', reading a value from the table causes the evaluation of the expression for that value. For those that contain a 'deltaValue' or 'changedValue' the value read is as of the last sampling interval. If in the attempt to evaluate the expression one or more of the necessary objects is not available, the corresponding entry in this table is effectively not instantiated. To maintain security of MIB information, when creating a new row in this table, the managed system must record the security credentials of the requester. These security credentials are the parameters necessary as inputs to isAccessAllowed from [RFC2571]. When obtaining the objects that make up the expression, the system must (conceptually) use isAccessAllowed to ensure that it does not violate security. The evaluation of that expression takes place under the security credentials of the creator of its expExpressionEntry. To maintain security of MIB information, expression evaluation must take place using security credentials for the implied Gets of the objects in the expression as inputs (conceptually) to isAccessAllowed from the Architecture for Describing SNMP Management Frameworks. These are the security credentials of the creator of the corresponding expExpressionEntry.") expValueInstance = MibTableColumn((1, 3, 6, 1, 2, 1, 90, 1, 3, 1, 1, 1), ObjectIdentifier()) if mibBuilder.loadTexts: expValueInstance.setStatus('current') if mibBuilder.loadTexts: expValueInstance.setDescription("The final instance portion of a value's OID according to the wildcarding in instances of expObjectID for the expression. The prefix of this OID fragment is 0.0, leading to the following behavior. If there is no wildcarding, the value is 0.0.0. In other words, there is one value which standing alone would have been a scalar with a 0 at the end of its OID. If there is wildcarding, the value is 0.0 followed by a value that the wildcard can take, thus defining one value instance for each real, possible value of the wildcard. So, for example, if the wildcard worked out to be an ifIndex, there is an expValueInstance for each applicable ifIndex.") expValueCounter32Val = MibTableColumn((1, 3, 6, 1, 2, 1, 90, 1, 3, 1, 1, 2), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: expValueCounter32Val.setStatus('current') if mibBuilder.loadTexts: expValueCounter32Val.setDescription("The value when expExpressionValueType is 'counter32'.") expValueUnsigned32Val = MibTableColumn((1, 3, 6, 1, 2, 1, 90, 1, 3, 1, 1, 3), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: expValueUnsigned32Val.setStatus('current') if mibBuilder.loadTexts: expValueUnsigned32Val.setDescription("The value when expExpressionValueType is 'unsigned32'.") expValueTimeTicksVal = MibTableColumn((1, 3, 6, 1, 2, 1, 90, 1, 3, 1, 1, 4), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: expValueTimeTicksVal.setStatus('current') if mibBuilder.loadTexts: expValueTimeTicksVal.setDescription("The value when expExpressionValueType is 'timeTicks'.") expValueInteger32Val = MibTableColumn((1, 3, 6, 1, 2, 1, 90, 1, 3, 1, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: expValueInteger32Val.setStatus('current') if mibBuilder.loadTexts: expValueInteger32Val.setDescription("The value when expExpressionValueType is 'integer32'.") expValueIpAddressVal = MibTableColumn((1, 3, 6, 1, 2, 1, 90, 1, 3, 1, 1, 6), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: expValueIpAddressVal.setStatus('current') if mibBuilder.loadTexts: expValueIpAddressVal.setDescription("The value when expExpressionValueType is 'ipAddress'.") expValueOctetStringVal = MibTableColumn((1, 3, 6, 1, 2, 1, 90, 1, 3, 1, 1, 7), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 65536))).setMaxAccess("readonly") if mibBuilder.loadTexts: expValueOctetStringVal.setStatus('current') if mibBuilder.loadTexts: expValueOctetStringVal.setDescription("The value when expExpressionValueType is 'octetString'.") expValueOidVal = MibTableColumn((1, 3, 6, 1, 2, 1, 90, 1, 3, 1, 1, 8), ObjectIdentifier()).setMaxAccess("readonly") if mibBuilder.loadTexts: expValueOidVal.setStatus('current') if mibBuilder.loadTexts: expValueOidVal.setDescription("The value when expExpressionValueType is 'objectId'.") expValueCounter64Val = MibTableColumn((1, 3, 6, 1, 2, 1, 90, 1, 3, 1, 1, 9), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: expValueCounter64Val.setStatus('current') if mibBuilder.loadTexts: expValueCounter64Val.setDescription("The value when expExpressionValueType is 'counter64'.") dismanExpressionMIBConformance = MibIdentifier((1, 3, 6, 1, 2, 1, 90, 3)) dismanExpressionMIBCompliances = MibIdentifier((1, 3, 6, 1, 2, 1, 90, 3, 1)) dismanExpressionMIBGroups = MibIdentifier((1, 3, 6, 1, 2, 1, 90, 3, 2)) dismanExpressionMIBCompliance = ModuleCompliance((1, 3, 6, 1, 2, 1, 90, 3, 1, 1)).setObjects(("DISMAN-EXPRESSION-MIB", "dismanExpressionResourceGroup"), ("DISMAN-EXPRESSION-MIB", "dismanExpressionDefinitionGroup"), ("DISMAN-EXPRESSION-MIB", "dismanExpressionValueGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): dismanExpressionMIBCompliance = dismanExpressionMIBCompliance.setStatus('current') if mibBuilder.loadTexts: dismanExpressionMIBCompliance.setDescription('The compliance statement for entities which implement the Expression MIB.') dismanExpressionResourceGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 90, 3, 2, 1)).setObjects(("DISMAN-EXPRESSION-MIB", "expResourceDeltaMinimum"), ("DISMAN-EXPRESSION-MIB", "expResourceDeltaWildcardInstanceMaximum"), ("DISMAN-EXPRESSION-MIB", "expResourceDeltaWildcardInstances"), ("DISMAN-EXPRESSION-MIB", "expResourceDeltaWildcardInstancesHigh"), ("DISMAN-EXPRESSION-MIB", "expResourceDeltaWildcardInstanceResourceLacks")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): dismanExpressionResourceGroup = dismanExpressionResourceGroup.setStatus('current') if mibBuilder.loadTexts: dismanExpressionResourceGroup.setDescription('Expression definition resource management.') dismanExpressionDefinitionGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 90, 3, 2, 2)).setObjects(("DISMAN-EXPRESSION-MIB", "expExpression"), ("DISMAN-EXPRESSION-MIB", "expExpressionValueType"), ("DISMAN-EXPRESSION-MIB", "expExpressionComment"), ("DISMAN-EXPRESSION-MIB", "expExpressionDeltaInterval"), ("DISMAN-EXPRESSION-MIB", "expExpressionPrefix"), ("DISMAN-EXPRESSION-MIB", "expExpressionErrors"), ("DISMAN-EXPRESSION-MIB", "expExpressionEntryStatus"), ("DISMAN-EXPRESSION-MIB", "expErrorTime"), ("DISMAN-EXPRESSION-MIB", "expErrorIndex"), ("DISMAN-EXPRESSION-MIB", "expErrorCode"), ("DISMAN-EXPRESSION-MIB", "expErrorInstance"), ("DISMAN-EXPRESSION-MIB", "expObjectID"), ("DISMAN-EXPRESSION-MIB", "expObjectIDWildcard"), ("DISMAN-EXPRESSION-MIB", "expObjectSampleType"), ("DISMAN-EXPRESSION-MIB", "expObjectDeltaDiscontinuityID"), ("DISMAN-EXPRESSION-MIB", "expObjectDiscontinuityIDWildcard"), ("DISMAN-EXPRESSION-MIB", "expObjectDiscontinuityIDType"), ("DISMAN-EXPRESSION-MIB", "expObjectConditional"), ("DISMAN-EXPRESSION-MIB", "expObjectConditionalWildcard"), ("DISMAN-EXPRESSION-MIB", "expObjectEntryStatus")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): dismanExpressionDefinitionGroup = dismanExpressionDefinitionGroup.setStatus('current') if mibBuilder.loadTexts: dismanExpressionDefinitionGroup.setDescription('Expression definition.') dismanExpressionValueGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 90, 3, 2, 3)).setObjects(("DISMAN-EXPRESSION-MIB", "expValueCounter32Val"), ("DISMAN-EXPRESSION-MIB", "expValueUnsigned32Val"), ("DISMAN-EXPRESSION-MIB", "expValueTimeTicksVal"), ("DISMAN-EXPRESSION-MIB", "expValueInteger32Val"), ("DISMAN-EXPRESSION-MIB", "expValueIpAddressVal"), ("DISMAN-EXPRESSION-MIB", "expValueOctetStringVal"), ("DISMAN-EXPRESSION-MIB", "expValueOidVal"), ("DISMAN-EXPRESSION-MIB", "expValueCounter64Val")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): dismanExpressionValueGroup = dismanExpressionValueGroup.setStatus('current') if mibBuilder.loadTexts: dismanExpressionValueGroup.setDescription('Expression value.') mibBuilder.exportSymbols("DISMAN-EXPRESSION-MIB", expErrorTime=expErrorTime, expObjectConditional=expObjectConditional, expValueIpAddressVal=expValueIpAddressVal, expExpressionValueType=expExpressionValueType, expValueOctetStringVal=expValueOctetStringVal, expExpression=expExpression, expValueInteger32Val=expValueInteger32Val, expObjectSampleType=expObjectSampleType, expObjectConditionalWildcard=expObjectConditionalWildcard, expExpressionTable=expExpressionTable, expObjectTable=expObjectTable, expErrorTable=expErrorTable, expObjectID=expObjectID, expObjectDiscontinuityIDWildcard=expObjectDiscontinuityIDWildcard, dismanExpressionDefinitionGroup=dismanExpressionDefinitionGroup, expValue=expValue, expExpressionEntry=expExpressionEntry, expValueTimeTicksVal=expValueTimeTicksVal, expValueEntry=expValueEntry, dismanExpressionResourceGroup=dismanExpressionResourceGroup, dismanExpressionMIBGroups=dismanExpressionMIBGroups, expErrorInstance=expErrorInstance, expValueOidVal=expValueOidVal, expExpressionErrors=expExpressionErrors, expResourceDeltaWildcardInstanceResourceLacks=expResourceDeltaWildcardInstanceResourceLacks, expObjectDiscontinuityIDType=expObjectDiscontinuityIDType, expObjectEntryStatus=expObjectEntryStatus, expErrorIndex=expErrorIndex, expObjectIndex=expObjectIndex, dismanExpressionValueGroup=dismanExpressionValueGroup, dismanExpressionMIBObjects=dismanExpressionMIBObjects, expDefine=expDefine, expObjectDeltaDiscontinuityID=expObjectDeltaDiscontinuityID, expValueInstance=expValueInstance, PYSNMP_MODULE_ID=dismanExpressionMIB, expResource=expResource, expExpressionOwner=expExpressionOwner, expErrorEntry=expErrorEntry, expValueCounter64Val=expValueCounter64Val, expResourceDeltaWildcardInstanceMaximum=expResourceDeltaWildcardInstanceMaximum, expResourceDeltaMinimum=expResourceDeltaMinimum, expExpressionName=expExpressionName, expErrorCode=expErrorCode, expObjectIDWildcard=expObjectIDWildcard, expValueUnsigned32Val=expValueUnsigned32Val, dismanExpressionMIBCompliance=dismanExpressionMIBCompliance, expValueCounter32Val=expValueCounter32Val, dismanExpressionMIB=dismanExpressionMIB, expResourceDeltaWildcardInstancesHigh=expResourceDeltaWildcardInstancesHigh, dismanExpressionMIBCompliances=dismanExpressionMIBCompliances, sysUpTimeInstance=sysUpTimeInstance, expExpressionComment=expExpressionComment, expExpressionEntryStatus=expExpressionEntryStatus, expExpressionPrefix=expExpressionPrefix, expResourceDeltaWildcardInstances=expResourceDeltaWildcardInstances, expExpressionDeltaInterval=expExpressionDeltaInterval, dismanExpressionMIBConformance=dismanExpressionMIBConformance, expObjectEntry=expObjectEntry, expValueTable=expValueTable)
def floatToBin(valor): f = str(valor) inteira, deci = f.split(".") print(inteira, deci) bint = bin(int(inteira)) deci = list(deci) deci.insert(0,'.') print(bint) print(deci) # inteira print('parte inteira') if inteira.startswith("-"): print('negativo') if not len(bint) == 3: bint = list(bint[3:]) else: bint = list('0') bint.insert(0, "1") bint = ''.join(bint) else: print('positivo') if not len(bint) == 2: # obs: decimais negativos sao considerados positivos bint = list(bint[2:]) else: bint = list('0') bint.insert(0, "0") bint = ''.join(bint) bint = list (bint) print(bint, type(bint)) # decimal print('parte decimal') multiplicacao = 0 deci_aux = float(''.join(deci)) bdeci = [] while not multiplicacao == 1: multiplicacao = (deci_aux * 2) a, b = str(multiplicacao).split(".") bdeci.append(a) # ajuste para decimal b = list(b) b.insert(0, '.') b = str(''.join(b)) b = float(b) deci_aux = b print(bdeci, type(bdeci)) b = bint + bdeci print('binario final: ', b) return b, [bint, bdeci] valor = 2.78125 floatToBin(valor)
times_dict = { "A": 51, "B": 23, "C": 67, "D": 83, "E": 77, } directions = { 0: "north", 1: "west", 2: "south", 3: "east", } for name in times_dict: times = times_dict[name] circles = times // 4 direction_index = times % 4 direction = directions[direction_index] print('%s faces %s, turns %s circles.'%(name, direction, circles))
def bstutil(root,min_v,max_v): if root is None: return True if root.data>=min_v and root.data<max_v and bstutil(root.left,min_v,root.data) and bstutil(root.right,root.data,max_v): return True return False def isBST(root): return bstutil(root,-float("inf"),float("inf"))
class KMP(object): def __init__(self, keyword): ''' KMP 알고리즘 이니셜 함수로 string match에 사용될 keyword를 입력받고 Pi 배열을 생성 :param keyword: 패턴으로 사용될 키워드 ''' self.keyword = keyword self.pi = self._generate_pi(keyword) def __call__(self, text): ''' String match를 할 텍스트를 입력받고 결과를 반환 :param text: 매칭할 텍스트 :return: 매칭이 일어난 시작, 끝 위치와 매칭된 키워드의 튜플 배열, [(INT start, INT end, STRING keyword), ...] ''' keyword_len = len(self.keyword) ret = [] position = 0 for idx in range(len(text)): while position > 0 and text[idx] != self.keyword[position]: position = self.pi[position-1] if text[idx] == self.keyword[position]: if position == len(self.keyword) - 1: start = idx - position + 1 end = start + keyword_len ret.append((start, end, self.keyword)) position = self.pi[position] else: position += 1 return ret def step(self, char, position): ''' 기존 KMP 알고리즘을 이용하여 한단계씩 나누어 계산을 하기 위해 구현된 함수 :param char: 매칭을 확인할 문자 :param position: 지금까지 진행된 매칭 위치 :return: 매칭 결과로 움직여야할 위치 (true=다음위치, false면 failue Pi위치) ''' while position > 0 and char != self.keyword[position]: position = self.pi[position-1] if char == self.keyword[position]: position += 1 return position def _generate_pi(self, keyword): ''' 키워드를 입력받아 Pi 배열을 생성하는 함수 :param keyword: Pi 배열을 생성할 키워드 :return: Pi 배열 ''' pi = [0, ] * len(keyword) position = 0 for idx in range(1, len(keyword)): while position > 0 and keyword[idx] != keyword[position]: position = pi[position - 1] if keyword[idx] == keyword[position]: position += 1 pi[idx] = position return pi if __name__ == "__main__": kmp = KMP("jeeseung") print(kmp("Hi my name is jeeseung han. jeeseung!"))
class Scene(object): MAIN = None setup = False destroyed = False handles = [] handleFunc = {} def __init__(self, MainObj): self.MAIN = MainObj self.createHandleFunctions() def createHandleFunctions(self): pass def setUp(self): self.setup = True def mainLoop(self): pass def destroy(self): self.destroyed = True def isSetUp(self): return self.setup def isDestroyed(self): return self.destroyed def handlesCall(self, call): return call in self.handles def handleCall(self, call, args): return self.handleFunc[call](*args) def canChangeChar(self): return False def canLeaveGame(self): return False
class Solution: def checkNeedle(self, h: str, n: str) -> bool: if len(h) < len(n): return False for idx, hc in enumerate(h): if hc != n[idx]: return False else: if len(n) == idx + 1: return True return True def strStr(self, haystack: str, needle: str) -> int: if len(needle) == 0: return 0 if len(haystack) == 0: return -1 if len(haystack) < len(needle): return -1 needle_idx = 0 for idx, c in enumerate(haystack): if c == needle[needle_idx]: if len(needle) == 1 or self.checkNeedle(haystack[idx + 1:], needle[1:]): return idx return -1
d = '\033[34mDesconsiderando o fleg\033[31m' print(f'\033[31m{d:=^60}\033[31m') s = i = 0 while True: n = int(input('Digite um número [999 pra parar]: ')) if n == 999: break i += 1 s += n print(f'\033[34mA soma dos {i} valores foi {s}!')
""" @author: yuhao.he @contact: <hawl.yuhao.he@gmail.com> @version: 0.0.1 @file: __init__.py.py @time: 2021/10/27 14:11 """
__author__ = 'Michel Llorens' __email__ = "mllorens@dcc.uchile.cl" class Stack: def __init__(self, delta): self.stack = list() self.DELTA = delta return def push(self, face): self.stack.append(face) return def pop(self): if not self.empty(): return self.stack.pop() else: return False def multi_pop(self, point): faces = list() for face in self.stack: if point in face: faces.append(face) for face in faces: self.stack.remove(face) return faces def empty(self): if len(self.stack) == 0: return True return False def get_all_points(self): all_points = list() for face in self.stack: all_points.extend(face.get_points()) return self.delete_duplicated_points(all_points) def delete_duplicated_points(self, points): final_points = list() while len(points) != 0: p = points.pop() to_delete = list() duplicated = False for pp in points: if (p[0] <= pp[0]+self.DELTA) & (p[0] >= pp[0]-self.DELTA): if (p[1] <= pp[1]+self.DELTA) & (p[1] >= pp[1]-self.DELTA): if (p[2] <= pp[2]+self.DELTA) & (p[1] >= pp[1]-self.DELTA): duplicated = True to_delete.append(pp) final_points.append(p) if duplicated: for ptd in to_delete: if ptd in points: points.remove(ptd) return final_points def __str__(self): string = "Stack:\n" for f in self.stack: string = string + str(f) + "\n" string = string + "End Stack\n" return string def size(self): return len(self.stack)
def build_chrome_options(): chrome_options = webdriver.ChromeOptions() chrome_options.accept_untrusted_certs = True chrome_options.assume_untrusted_cert_issuer = True # chrome configuration # More: https://github.com/SeleniumHQ/docker-selenium/issues/89 # And: https://github.com/SeleniumHQ/docker-selenium/issues/87 chrome_options.add_argument("--no-sandbox") chrome_options.add_argument("--disable-impl-side-painting") chrome_options.add_argument("--disable-setuid-sandbox") chrome_options.add_argument("--disable-seccomp-filter-sandbox") chrome_options.add_argument("--disable-breakpad") chrome_options.add_argument("--disable-client-side-phishing-detection") chrome_options.add_argument("--disable-cast") chrome_options.add_argument("--disable-cast-streaming-hw-encoding") chrome_options.add_argument("--disable-cloud-import") chrome_options.add_argument("--disable-popup-blocking") chrome_options.add_argument("--ignore-certificate-errors") chrome_options.add_argument("--disable-session-crashed-bubble") chrome_options.add_argument("--disable-ipv6") chrome_options.add_argument("--allow-http-screen-capture") chrome_options.add_argument("--start-maximized") chrome_options.add_argument( '--user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36') return chrome_options
myset = {1,2,3,4,5,6} print(myset) myset = {1,1,1,2,3,4,5,5} print(myset) myset = set([1,2,3,4,5,5]) myset2 = set('hello') print(myset) print(myset2) myset = {} myset2 = set() print(type(myset)) print(type(myset2)) myset2.add(1) print(myset2) myset2.add(1) print(myset2) myset2.add(2) print(myset2) myset2.add(3) myset2.add(4) print(myset2) myset2.remove(2) print(myset2) myset2 = {1,2,3,4,5,6} # myset2.remove(8) # print(myset2) myset2.discard(8) print(myset2) print(myset2.pop()) print(myset2) for x in myset2: print(x) if 1 in myset2: print('yes') else: print('no') # union & intersection odds = {1,3,5,7} evens = {0,2,4,6,8} primes = {2,3,5,7} u = odds.union(evens) print(u) i = odds.intersection(evens) print(i) j = odds.intersection(primes) print(odds) print(j) h = evens.intersection(primes) print(evens) print(h) setA = {1,2,3,4,5,6,7,8,9,10} setB = {1,2,3,11,12,13} diff = setA.difference(setB) print(diff) diff = setB.difference(setA) print(diff) diff = setB.symmetric_difference(setA) print(diff) diff = setA.symmetric_difference(setB) print(diff) setA.update(setB) print(setA) setA = {1,2,3,4,5,6,7,8,9,10} setB = {1,2,3,11,12,13} setA.intersection_update(setB) print(setA) setA = {1,2,3,4,5,6,7,8,9,10} setB = {1,2,3,11,12,13} setA.difference_update(setB) print(setA) setA = {1,2,3,4,5,6,7,8,9,10} setB = {1,2,3,11,12,13} setA.symmetric_difference_update(setB) print(setA) setA = {1,2,3,4,5,6} setB = {1,2,3} setC = {7,8} print(setA.issubset(setB)) print(setA.issuperset(setB)) print(setA.isdisjoint(setB)) print(setA.isdisjoint(setC)) myset = {1,2,3,4,5} myset.add(6) myset2 = myset print(myset) print(myset2) myset = {1,2,3,4,5} myset.add(6) myset2 = myset.copy() print(myset) print(myset2) myset = {1,2,3,4,5} myset.add(6) myset2 = set(myset) print(myset) print(myset2) a = frozenset([1,2,3,4]) ## not work # a.add() # a.remove()
CONFIG = { 'log': { 'level': 'DEBUG', # 与log库的level一致,包括DEBUG, INFO, ERROR # DEBUG - Enable stdout, file, mail (如果在dest中启用) # INFO - Enable file, mail (如果在dest中启用) # ERROR - Enable mail (如果在dest中启用) 'dest': { 'stdout': 1, 'file': 1, 'mail': 1 # 0 - 不使用; # 1 - 使用,收件人使用mail中设置的to; # 字符串 - 直接指定收件人, Ex. : 'Henry TIAN <chariothy@gmail.com>' }, 'sql': 1 }, 'mail': { 'from': 'Henry TIAN <15050506668@163.com>', 'to': 'Henry TIAN <6314849@qq.com>' }, 'smtp': { 'host': 'smtp.163.com', 'port': 25, 'user': '15050506668@163.com', 'pwd': '123456' }, 'port': 8000, 'timeout': 3600, 'interval': 10, 'tmp_dir': '/tmp' }
# Reading files # Example 1 - Open and closing files. nerd_file = open("nerd_names.txt") nerd_file.close() # Example 2 - Is the file readable? nerd_file = open("nerd_names.txt") print(nerd_file.readable()) nerd_file.close() # Example 3 - Read the file, with readlines() nerd_file = open("nerd_names.txt") print(nerd_file.readlines()) nerd_file.close() # Example 4 - Read the first line of a file nerd_file = open("nerd_names.txt") print(nerd_file.readline()) nerd_file.close() # Example 5 - Read the first two lines nerd_file = open("nerd_names.txt") print(nerd_file.readline()) print(nerd_file.readline()) nerd_file.close() # Example 6 - Read and print out hte 3rd line or item in the file nerd_file = open("nerd_names.txt") print(nerd_file.readlines()[2]) nerd_file.close() # Example 7 - As is, read nerd_file = open("nerd_names.txt") print(nerd_file.read()) nerd_file.close() nerd_file = open("nerd_names.txt") # Example 8 - Read vs Readlines # With Readlines nerd_file = open("nerd_names.txt") nerds = nerd_file.readlines() nerd_file.close() print("Example 8 - with readlines()") print(f'Data type is: {type(nerds)}') print(nerds) for name in nerds: name = name.rstrip() + " is a Nerd." print(name) print("----Readlines() Example Done----") # With Read nerd_file_read = open("nerd_names.txt") nerds_read = nerd_file_read.read() nerd_file_read.close() print("Example 8 - with read()") print(f'Data type is: {type(nerds_read)}') print(nerds_read) for name in nerds_read: name = name.rstrip() + " is a Nerd." print(name) print("----read() Example Done----")
# creates or updates a file with the given text def write_file(file_path,text_to_write): with open(file_path,'w') as f: f.write(text_to_write) return
class Card: """Standard playing card. Attributes: suit: string spades,hearts,diamonds,clubs rank: string 1-10,jack,queen,king """ def __init__(self, rank, suit): """Initializes the object Card""" self.rank = rank self.suit = suit def __repr__(self): """Returns a string of Card with rank and suit""" return str(f'{self.rank} of {self.suit}') class Deck: """Class for a regular decks""" suit = ["Spades", "Hearts", "Diamonds", "Clubs"] rank = ["Ace", "Two(2)", "Three(3)", "Four(4)", "Five(5)", "Six(6)", "Seven(7)", "Eight(8)", "Nine(9)", "Ten(10)", "Jack", "Queen", "King"] def __init__(self): """Initializes the object Deck""" self.cards = [Card(r, s) for r in Deck.rank for s in Deck.suit] self.counter = 0 def __getitem__(self, position): """Returns sliced object""" return self.cards[position] def __len__(self): """Counts the element inside the object""" return len(self.cards) def __iter__(self): """Returns an iterator object""" return self def __next__(self): """Returns the next element""" if self.counter >= len(self.cards): raise StopIteration current = self.cards[self.counter] self.counter += 1 return current def __repr__(self): """Returns a string of cards in a string list""" return str(self.cards)
""" 26 - Faça um programa que leia uma frase pelo teclado e mostre quantas vezes aparece a letra 'A', em que posição ela aparece da primeira vez e em que posição ela aparece da última vez. """ frase = str(input('Digite uma frase a sua escolha: ')).strip().upper() print(f"A letra A aparece {frase.count('A')} vezes na frase.") print(f"A primeira letra A apareceu na posição {frase.find('A') + 1}.") print(f"A última letra A apareceu na posição {frase.rfind('A') + 1}")
class Solution(object): def getRow(self, rowIndex): """ :type rowIndex: int :rtype: List[int] """ res = [[1 for j in range(i + 1)] for i in range(rowIndex + 1)] for i in range(2, rowIndex + 1): for j in range(1, i): res[i][j] = res[i - 1][j - 1] + res[i - 1][j] return res[-1]
# caso queira testar os programas separadamente, adicione # comentários de apóstofos simples ''' e ''' ENTRE um programa e outro. # Exemplo abaixo: ''' print('Programa X') código ''' print('Programa 01\n') remedio = 'Dorflex' dosagem = 5 duracao = 4.5 instrucoes = '{} - Tome {} ML pela boca a cada {} horas'.format( remedio, dosagem, duracao) print(instrucoes) instrucoes = '{2} - Tome {1} ML pela boca a cada {0} horas'.format( remedio, dosagem, duracao) print(instrucoes) instrucoes = '{remedio} - Tome {dosagem} ML pela boca a cada {duracao} horas'.format( remedio='Dipirona', dosagem=10, duracao=6) print(instrucoes) print('\n') print('Programa 02\n') nome = 'mundo' mensagem = f'Olá, {nome}.' print(mensagem) contagem = 10 valor = 3.14 mensagem = f'Contagem até {contagem}. Multiplique por {valor}.' print(mensagem) print('\n') print('Programa 03\n') width = 5 height = 10 print( f'O perímetro é {(2 * width) + (2 * height)} e a área é {width * height}.') print('\n') print('Programa 04\n') valor = 'Olá' print(f'.{valor:<50}.') print(f'.{valor:>50}.') print(f'.{valor:^50}.') print(f'.{valor:_^50}.') print('\n')