idx int64 0 251k | question stringlengths 53 3.53k | target stringlengths 5 1.23k | len_question int64 20 893 | len_target int64 3 238 |
|---|---|---|---|---|
247,400 | def daily_occurrences ( self , dt = None , event = None ) : dt = dt or datetime . now ( ) start = datetime ( dt . year , dt . month , dt . day ) end = start . replace ( hour = 23 , minute = 59 , second = 59 ) qs = self . filter ( models . Q ( start_time__gte = start , start_time__lte = end , ) | models . Q ( end_time__gte = start , end_time__lte = end , ) | models . Q ( start_time__lt = start , end_time__gt = end ) ) return qs . filter ( event = event ) if event else qs | Returns a queryset of for instances that have any overlap with a particular day . | 160 | 17 |
247,401 | def event_listing ( request , template = 'swingtime/event_list.html' , events = None , * * extra_context ) : events = events or Event . objects . all ( ) extra_context [ 'events' ] = events return render ( request , template , extra_context ) | View all events . | 64 | 4 |
247,402 | def event_view ( request , pk , template = 'swingtime/event_detail.html' , event_form_class = forms . EventForm , recurrence_form_class = forms . MultipleOccurrenceForm ) : event = get_object_or_404 ( Event , pk = pk ) event_form = recurrence_form = None if request . method == 'POST' : if '_update' in request . POST : event_form = event_form_class ( request . POST , instance = event ) if event_form . is_valid ( ) : event_form . save ( event ) return http . HttpResponseRedirect ( request . path ) elif '_add' in request . POST : recurrence_form = recurrence_form_class ( request . POST ) if recurrence_form . is_valid ( ) : recurrence_form . save ( event ) return http . HttpResponseRedirect ( request . path ) else : return http . HttpResponseBadRequest ( 'Bad Request' ) data = { 'event' : event , 'event_form' : event_form or event_form_class ( instance = event ) , 'recurrence_form' : recurrence_form or recurrence_form_class ( initial = { 'dtstart' : datetime . now ( ) } ) } return render ( request , template , data ) | View an Event instance and optionally update either the event or its occurrences . | 298 | 14 |
247,403 | def occurrence_view ( request , event_pk , pk , template = 'swingtime/occurrence_detail.html' , form_class = forms . SingleOccurrenceForm ) : occurrence = get_object_or_404 ( Occurrence , pk = pk , event__pk = event_pk ) if request . method == 'POST' : form = form_class ( request . POST , instance = occurrence ) if form . is_valid ( ) : form . save ( ) return http . HttpResponseRedirect ( request . path ) else : form = form_class ( instance = occurrence ) return render ( request , template , { 'occurrence' : occurrence , 'form' : form } ) | View a specific occurrence and optionally handle any updates . | 154 | 10 |
247,404 | def add_event ( request , template = 'swingtime/add_event.html' , event_form_class = forms . EventForm , recurrence_form_class = forms . MultipleOccurrenceForm ) : dtstart = None if request . method == 'POST' : event_form = event_form_class ( request . POST ) recurrence_form = recurrence_form_class ( request . POST ) if event_form . is_valid ( ) and recurrence_form . is_valid ( ) : event = event_form . save ( ) recurrence_form . save ( event ) return http . HttpResponseRedirect ( event . get_absolute_url ( ) ) else : if 'dtstart' in request . GET : try : dtstart = parser . parse ( request . GET [ 'dtstart' ] ) except ( TypeError , ValueError ) as exc : # TODO: A badly formatted date is passed to add_event logging . warning ( exc ) dtstart = dtstart or datetime . now ( ) event_form = event_form_class ( ) recurrence_form = recurrence_form_class ( initial = { 'dtstart' : dtstart } ) return render ( request , template , { 'dtstart' : dtstart , 'event_form' : event_form , 'recurrence_form' : recurrence_form } ) | Add a new Event instance and 1 or more associated Occurrence s . | 302 | 14 |
247,405 | def _datetime_view ( request , template , dt , timeslot_factory = None , items = None , params = None ) : timeslot_factory = timeslot_factory or utils . create_timeslot_table params = params or { } return render ( request , template , { 'day' : dt , 'next_day' : dt + timedelta ( days = + 1 ) , 'prev_day' : dt + timedelta ( days = - 1 ) , 'timeslots' : timeslot_factory ( dt , items , * * params ) } ) | Build a time slot grid representation for the given datetime dt . See utils . create_timeslot_table documentation for items and params . | 132 | 30 |
247,406 | def month_view ( request , year , month , template = 'swingtime/monthly_view.html' , queryset = None ) : year , month = int ( year ) , int ( month ) cal = calendar . monthcalendar ( year , month ) dtstart = datetime ( year , month , 1 ) last_day = max ( cal [ - 1 ] ) dtend = datetime ( year , month , last_day ) # TODO Whether to include those occurrences that started in the previous # month but end in this month? queryset = queryset . _clone ( ) if queryset is not None else Occurrence . objects . select_related ( ) occurrences = queryset . filter ( start_time__year = year , start_time__month = month ) def start_day ( o ) : return o . start_time . day by_day = dict ( [ ( dt , list ( o ) ) for dt , o in itertools . groupby ( occurrences , start_day ) ] ) data = { 'today' : datetime . now ( ) , 'calendar' : [ [ ( d , by_day . get ( d , [ ] ) ) for d in row ] for row in cal ] , 'this_month' : dtstart , 'next_month' : dtstart + timedelta ( days = + last_day ) , 'last_month' : dtstart + timedelta ( days = - 1 ) , } return render ( request , template , data ) | Render a tradional calendar grid view with temporal navigation variables . | 332 | 12 |
247,407 | def cast ( self , value , custom_formatters = None , strict = True ) : if value is None : if not self . nullable : raise InvalidSchemaValue ( "Null value for non-nullable schema" , value , self . type ) return self . default cast_mapping = self . get_cast_mapping ( custom_formatters = custom_formatters , strict = strict ) if self . type is not SchemaType . STRING and value == '' : return None cast_callable = cast_mapping [ self . type ] try : return cast_callable ( value ) except ValueError : raise InvalidSchemaValue ( "Failed to cast value {value} to type {type}" , value , self . type ) | Cast value to schema type | 160 | 5 |
247,408 | def unmarshal ( self , value , custom_formatters = None , strict = True ) : if self . deprecated : warnings . warn ( "The schema is deprecated" , DeprecationWarning ) casted = self . cast ( value , custom_formatters = custom_formatters , strict = strict ) if casted is None and not self . required : return None if self . enum and casted not in self . enum : raise InvalidSchemaValue ( "Value {value} not in enum choices: {type}" , value , self . enum ) return casted | Unmarshal parameter from the value . | 120 | 9 |
247,409 | def get_operation_pattern ( server_url , request_url_pattern ) : if server_url [ - 1 ] == "/" : # operations have to start with a slash, so do not remove it server_url = server_url [ : - 1 ] if is_absolute ( server_url ) : return request_url_pattern . replace ( server_url , "" , 1 ) return path_qs ( request_url_pattern ) . replace ( server_url , "" , 1 ) | Return an updated request URL pattern with the server URL removed . | 105 | 12 |
247,410 | def check ( definition , data , * args , * * kwargs ) : checker = checker_factory ( definition ) return checker ( data , * args , * * kwargs ) | Checks if the input follows the definition | 43 | 8 |
247,411 | def check ( self , data ) : if isinstance ( data , Iterable ) : data = "" . join ( str ( x ) for x in data ) try : data = str ( data ) except UnicodeDecodeError : return False return bool ( data and self . __regexp . match ( data ) ) | returns True if any match any regexp | 66 | 9 |
247,412 | def _build_item_closure ( itemset , productionset ) : #For every item inside current itemset, if we have the following rule: # xxx <cursor><nonterminalSymbol> xxx append every rule from self._productionruleset that begins with that NonTerminalSymbol if not isinstance ( itemset , LR0ItemSet ) : raise TypeError import copy resultset = copy . copy ( itemset ) changed = True while changed : changed = False for currentitem in resultset . itemlist : nextsymbol = currentitem . next_symbol ( ) if nextsymbol is None : break for rule in productionset . productions : newitem = LR0Item ( rule ) if rule . leftside [ 0 ] == nextsymbol and newitem not in resultset . itemlist : resultset . append_item ( newitem ) changed = True return resultset | Build input itemset closure | 189 | 5 |
247,413 | def item_set_goto ( itemset , inputsymbol , productionset ) : resultset = LR0ItemSet ( ) for item in itemset . itemlist : if item . next_symbol ( ) == inputsymbol : newitem = LR0Item ( item . rule , item . position + 1 ) resultset . append_item ( newitem ) return _build_item_closure ( resultset , productionset ) | returns an itemset locate inside itemset every element with inputsymbol following cursor for every located item append its itemclosure | 92 | 25 |
247,414 | def _slr_build_parser_table ( productionset ) : result = ParserTable ( ) statesset = build_states_sets ( productionset ) for itemindex , itemset in enumerate ( statesset ) : LOG . debug ( "_slr_build_parser_table: Evaluating itemset:" + str ( itemset ) ) for symbol in productionset . getSymbols ( ) + [ EndSymbol ( ) ] : numberoptions = 0 for lritem in itemset . itemlist : #if cursor is before a terminal, and there is a transition to another itemset with the following terminal, append shift rule if isinstance ( symbol , TerminalSymbol ) and lritem . next_symbol ( ) == symbol and itemset . has_transition ( symbol ) : destinationstate = statesset . index ( itemset . get_transition ( symbol ) ) result . append ( itemindex , symbol , "Shift" , destinationstate ) numberoptions += 1 if isinstance ( symbol , NonTerminalSymbol ) and lritem . next_symbol ( ) == symbol and itemset . has_transition ( symbol ) : destinationstate = statesset . index ( itemset . get_transition ( symbol ) ) result . append_goto ( itemindex , symbol , destinationstate ) #if cursor is at the end of the rule, then append reduce rule and go transition if lritem . previous_symbol ( ) == symbol and lritem . is_last_position ( ) and symbol != Extended_S : for x in productionset . next_lookup ( symbol ) : if isinstance ( x , Grammar ) : result . append ( itemindex , TerminalSymbol ( x ) , "Reduce" , None , lritem . rule ) elif isinstance ( x , Symbol ) : result . append ( itemindex , x , "Reduce" , None , lritem . rule ) else : raise TypeError ( x ) numberoptions += 1 #if cursor is at the end of main rule, and current symbol is end, then append accept rule if symbol == EndSymbol ( ) and lritem . previous_symbol ( ) == productionset . initialsymbol and lritem . next_symbol ( ) == EndSymbol ( ) : result . append ( itemindex , symbol , "Accept" , None ) numberoptions += 1 if not numberoptions : LOG . info ( "No rule found to generate a new parsertable entry " ) LOG . debug ( "symbol: " + str ( symbol ) ) LOG . debug ( "itemset: " + str ( itemset ) ) elif numberoptions > 1 : #FIXME can it count duplicated entries? raise Exception ( "LR Conflict %s" % symbol ) return result | SLR method to build parser table | 598 | 7 |
247,415 | def append ( self , state , symbol , action , destinationstate , production = None ) : if action not in ( None , "Accept" , "Shift" , "Reduce" ) : raise TypeError rule = { "action" : action , "dest" : destinationstate } if action == "Reduce" : if rule is None : raise TypeError ( "Expected production parameter" ) rule [ "rule" ] = production while isinstance ( symbol , TerminalSymbol ) and isinstance ( symbol . gd , Iterable ) and len ( symbol . gd ) == 1 and isinstance ( list ( symbol . gd ) [ 0 ] , Grammar ) : symbol = TerminalSymbol ( list ( symbol . gd ) [ 0 ] ) #Reduces symbol if its gd is a Sequence/Choice of 1 element if not isinstance ( symbol , Symbol ) : raise TypeError ( "Expected symbol, got %s" % symbol ) self [ state ] [ symbol ] = rule | Appends a new rule | 210 | 5 |
247,416 | def insert ( self , state , token ) : if token == EndSymbol ( ) : return self [ state ] [ EndSymbol ( ) ] from pydsl . check import check symbol_list = [ x for x in self [ state ] if isinstance ( x , TerminalSymbol ) and check ( x . gd , [ token ] ) ] if not symbol_list : return { "action" : "Fail" } if len ( symbol_list ) > 1 : raise Exception ( "Multiple symbols matches input" ) symbol = symbol_list [ 0 ] return self [ state ] [ symbol ] | change internal state return action | 127 | 5 |
247,417 | def append_item ( self , item ) : if not isinstance ( item , LR0Item ) : raise TypeError self . itemlist . append ( item ) | Append new item to set | 34 | 6 |
247,418 | def append_transition ( self , symbol , targetset ) : if symbol in self . transitions : return self . transitions [ symbol ] = targetset | Appends a transition | 31 | 4 |
247,419 | def __parse ( self , tokenlist ) : #empty stack #iterate over symbollist tokenlist = [ x for x in tokenlist ] if not isinstance ( tokenlist , list ) : raise TypeError ( "Expected list, got %s" % tokenlist . __class__ . __name__ ) LOG . debug ( "get_trees: checking list: " + str ( tokenlist ) ) stack = [ ( 0 , Extended_S ) ] while True : state = stack [ - 1 ] [ 0 ] if len ( tokenlist ) : #FIXME: tokenlist with one element is reported as false token = tokenlist [ 0 ] else : token = EndSymbol ( ) newdic = self . __parsertable . insert ( state , token ) action = newdic [ "action" ] if action == "Fail" : return False elif action == "Accept" : return True if action == "Reduce" : reductionrule = newdic [ "rule" ] #TODO extract len(right side) of the rule and insert left side for rsymbol in reversed ( reductionrule . rightside ) : state , symbol = stack . pop ( ) # TODO: check state = stack [ - 1 ] [ 0 ] state = self . __parsertable . goto ( state , reductionrule . leftside [ 0 ] ) stack . append ( ( state , reductionrule . leftside [ 0 ] ) ) elif action == "Shift" : stack . append ( ( newdic [ 'dest' ] , tokenlist . pop ( 0 ) ) ) else : raise ValueError ( "Unknown action" ) return False | see parent docstring | 353 | 4 |
247,420 | def graph_from_alphabet ( alphabet , base ) : if not isinstance ( alphabet , Choice ) : raise TypeError ( alphabet . __class__ . __name__ ) if not isinstance ( base , Choice ) : raise TypeError ( base . __class__ . __name__ ) import networkx result = networkx . DiGraph ( ) current_alphabet = alphabet pending_stack = set ( current_alphabet ) while pending_stack : current_alphabet = pending_stack . pop ( ) if current_alphabet == base : continue if current_alphabet in base : result . add_edge ( current_alphabet , base ) elif isinstance ( current_alphabet , Choice ) : for element in current_alphabet : if element in base : result . add_edge ( current_alphabet , base ) else : result . add_edge ( current_alphabet , element ) pending_stack . add ( element ) elif current_alphabet . alphabet : result . add_edge ( current_alphabet , current_alphabet . alphabet ) pending_stack . add ( current_alphabet . alphabet ) return result | Creates a graph that connects the base with the target through alphabets If every target is connected to any inputs create the independent paths | 241 | 28 |
247,421 | def is_subset ( a , b ) : return b . left <= a . left and b . right > a . right or b . left < a . left and b . right >= a . right | Excluding same size | 43 | 4 |
247,422 | def digraph_walker_backwards ( graph , element , call_back ) : call_back ( graph , element ) for predecessor in graph . predecessors ( element ) : call_back ( graph , predecessor ) for predecessor in graph . predecessors ( element ) : digraph_walker_backwards ( graph , predecessor , call_back ) | Visits every element guaranteeing that the previous elements have been visited before | 70 | 13 |
247,423 | def first_lookup ( self , symbol , size = 1 ) : if isinstance ( symbol , ( TerminalSymbol , NullSymbol ) ) : return [ symbol . gd ] result = [ ] for production in self . productions : if production . leftside [ 0 ] != symbol : continue for right_symbol in production . rightside : if right_symbol == symbol : #Avoids infinite recursion break current_symbol_first = self . first_lookup ( right_symbol , size ) import collections from pydsl . grammar . definition import String if isinstance ( current_symbol_first , collections . Iterable ) and not isinstance ( current_symbol_first , String ) : result += current_symbol_first else : result . append ( current_symbol_first ) if isinstance ( current_symbol_first , String ) or not isinstance ( current_symbol_first , collections . Iterable ) or ( NullSymbol not in current_symbol_first ) : break # This element doesn't have Null in its first set so there is no need to continue if not result : raise KeyError ( "Symbol doesn't exist in this grammar" ) return Choice ( result ) | Returns a Grammar Definition with the first n terminal symbols produced by the input symbol | 261 | 16 |
247,424 | def next_lookup ( self , symbol ) : result = [ ] if symbol == self . initialsymbol : result . append ( EndSymbol ( ) ) for production in self . productions : if symbol in production . rightside : nextindex = production . rightside . index ( symbol ) + 1 while nextindex < len ( production . rightside ) : nextsymbol = production . rightside [ nextindex ] firstlist = self . first_lookup ( nextsymbol ) cleanfirstlist = Choice ( [ x for x in firstlist if x != NullSymbol ( ) ] ) result . append ( cleanfirstlist ) if NullSymbol ( ) not in firstlist : break else : result += self . next_lookup ( production . leftside [ 0 ] ) #reached the end of the rightside return result | Returns the next TerminalSymbols produced by the input symbol within this grammar definition | 174 | 16 |
247,425 | def main_production ( self ) : for rule in self . productions : if rule . leftside [ 0 ] == self . _initialsymbol : return rule raise IndexError | Returns main rule | 36 | 3 |
247,426 | def getSymbols ( self ) : symbollist = [ ] for rule in self . productions : for symbol in rule . leftside + rule . rightside : if symbol not in symbollist : symbollist . append ( symbol ) symbollist += self . terminal_symbols return symbollist | Returns every symbol | 66 | 3 |
247,427 | def extract_alphabet ( alphabet , inputdata , fixed_start = False ) : if not inputdata : return [ ] base_alphabet = alphabet . alphabet lexer = lexer_factory ( alphabet , base_alphabet ) totallen = len ( inputdata ) maxl = totallen minl = 1 if fixed_start : max_start = 1 else : max_start = totallen result = [ ] for i in range ( max_start ) : for j in range ( i + minl , min ( i + maxl , totallen ) + 1 ) : try : lexed = lexer ( inputdata [ i : j ] ) if lexed and len ( lexed ) == 1 : result . append ( ( i , j , inputdata [ i : j ] , lexed [ 0 ] . gd ) ) elif lexed : raise Exception except : continue result = filter_subsets ( result ) return [ PositionToken ( content , gd , left , right ) for ( left , right , content , gd ) in result ] | Receives a sequence and an alphabet returns a list of PositionTokens with all of the parts of the sequence that are a subset of the alphabet | 229 | 29 |
247,428 | def extract ( grammar , inputdata , fixed_start = False , return_first = False ) : if not inputdata : return [ ] checker = checker_factory ( grammar ) totallen = len ( inputdata ) from pydsl . grammar . PEG import Choice try : maxl = grammar . maxsize or totallen except NotImplementedError : maxl = totallen try : #minl = grammar.minsize #FIXME: It won't work with incompatible alphabets minl = 1 except NotImplementedError : minl = 1 if fixed_start : max_start = 1 else : max_start = totallen result = [ ] for i in range ( max_start ) : for j in range ( i + minl , min ( i + maxl , totallen ) + 1 ) : slice = inputdata [ i : j ] check = checker . check ( slice ) if check : this_pt = PositionToken ( slice , grammar , i , j ) if return_first : return this_pt result . append ( this_pt ) return result | Receives a sequence and a grammar returns a list of PositionTokens with all of the parts of the sequence that are recognized by the grammar | 238 | 28 |
247,429 | def append_position_to_token_list ( token_list ) : return [ PositionToken ( value . content , value . gd , index , index + 1 ) for ( index , value ) in enumerate ( token_list ) ] | Converts a list of Token into a list of Token asuming size == 1 | 51 | 16 |
247,430 | def load_python_file ( moduleobject ) : if isinstance ( moduleobject , str ) : moduleobject = load_module ( moduleobject ) if not hasattr ( moduleobject , "iclass" ) : raise KeyError ( "Element" + str ( moduleobject ) ) iclass = getattr ( moduleobject , "iclass" ) mylist = getattr ( moduleobject , "__all__" , None ) or list ( filter ( lambda x : x [ : 1 ] != "_" , ( dir ( moduleobject ) ) ) ) mylist . remove ( 'iclass' ) resultdic = { } for x in mylist : resultdic [ x ] = getattr ( moduleobject , x ) if iclass == "SymbolGrammar" : from pydsl . grammar . BNF import BNFGrammar return BNFGrammar ( * * resultdic ) elif iclass == "PLY" : from pydsl . grammar . definition import PLYGrammar return PLYGrammar ( moduleobject ) elif iclass in [ "PythonGrammar" ] : from pydsl . grammar . definition import PythonGrammar return PythonGrammar ( resultdic ) elif iclass == "PythonTranslator" : return resultdic elif iclass == "parsley" : from pydsl . grammar . parsley import ParsleyGrammar return ParsleyGrammar ( * * resultdic ) elif iclass == "pyparsing" : return resultdic [ 'root_symbol' ] else : raise ValueError ( str ( moduleobject ) ) | Try to create an indexable instance from a module | 354 | 10 |
247,431 | def load_bnf_file ( filepath , repository = None ) : linelist = [ ] with open ( filepath , 'r' ) as mlfile : for line in mlfile : linelist . append ( line ) return strlist_to_production_set ( linelist , repository ) | Converts a bnf file into a BNFGrammar instance | 65 | 15 |
247,432 | def load_re_from_file ( filepath ) : regexp = None with open ( filepath , 'r' ) as mlfile : flagstr = "" for line in mlfile : cleanline = re . sub ( "//.*$" , "" , line ) if re . search ( "^\s*$" , cleanline ) : continue if re . search ( "^#.*$" , cleanline ) : flagstr = cleanline [ 1 : ] continue if regexp is not None : raise Exception ( "Regular expression file format error" ) else : regexp = cleanline . rstrip ( '\n' ) flags = 0 if "i" in flagstr : flags |= re . I from pydsl . grammar . definition import RegularExpression return RegularExpression ( regexp , flags ) | Converts a re file to Regular Grammar instance | 177 | 10 |
247,433 | def url_for ( context , __route_name , * * parts ) : app = context [ 'app' ] query = None if 'query_' in parts : query = parts . pop ( 'query_' ) for key in parts : val = parts [ key ] if isinstance ( val , str ) : # if type is inherited from str expilict cast to str makes sense # if type is exactly str the operation is very fast val = str ( val ) elif type ( val ) is int : # int inherited classes like bool are forbidden val = str ( val ) else : raise TypeError ( "argument value should be str or int, " "got {} -> [{}] {!r}" . format ( key , type ( val ) , val ) ) parts [ key ] = val url = app . router [ __route_name ] . url_for ( * * parts ) if query : url = url . with_query ( query ) return url | Filter for generating urls . | 204 | 6 |
247,434 | def static_url ( context , static_file_path ) : app = context [ 'app' ] try : static_url = app [ 'static_root_url' ] except KeyError : raise RuntimeError ( "app does not define a static root url " "'static_root_url', you need to set the url root " "with app['static_root_url'] = '<static root>'." ) from None return '{}/{}' . format ( static_url . rstrip ( '/' ) , static_file_path . lstrip ( '/' ) ) | Filter for generating urls for static files . | 126 | 9 |
247,435 | def init_gl ( self ) : self . vr_system = openvr . init ( openvr . VRApplication_Scene ) w , h = self . vr_system . getRecommendedRenderTargetSize ( ) self . left_fb = OpenVrFramebuffer ( w , h , multisample = self . multisample ) self . right_fb = OpenVrFramebuffer ( w , h , multisample = self . multisample ) self . compositor = openvr . VRCompositor ( ) if self . compositor is None : raise Exception ( "Unable to create compositor" ) self . left_fb . init_gl ( ) self . right_fb . init_gl ( ) # Compute projection matrix zNear = 0.2 zFar = 500.0 self . projection_left = numpy . asarray ( matrixForOpenVrMatrix ( self . vr_system . getProjectionMatrix ( openvr . Eye_Left , zNear , zFar ) ) ) self . projection_right = numpy . asarray ( matrixForOpenVrMatrix ( self . vr_system . getProjectionMatrix ( openvr . Eye_Right , zNear , zFar ) ) ) self . view_left = matrixForOpenVrMatrix ( self . vr_system . getEyeToHeadTransform ( openvr . Eye_Left ) ) . I # head_X_eye in Kane notation self . view_right = matrixForOpenVrMatrix ( self . vr_system . getEyeToHeadTransform ( openvr . Eye_Right ) ) . I # head_X_eye in Kane notation for actor in self : actor . init_gl ( ) | allocate OpenGL resources | 367 | 4 |
247,436 | def display ( self ) : self . compositor . waitGetPoses ( self . poses , openvr . k_unMaxTrackedDeviceCount , None , 0 ) hmd_pose0 = self . poses [ openvr . k_unTrackedDeviceIndex_Hmd ] if not hmd_pose0 . bPoseIsValid : return # hmd_pose = hmd_pose0.mDeviceToAbsoluteTracking # 1) On-screen render: if True : glClearColor ( 0.8 , 0.4 , 0.4 , 0 ) # Pink background glClear ( GL_COLOR_BUFFER_BIT ) # glutSwapBuffers() glFlush ( ) # Single buffer # 2) VR render # TODO: render different things to each eye glBindFramebuffer ( GL_FRAMEBUFFER , self . fb ) glClearColor ( 0.8 , 0.4 , 0.4 , 0 ) # Pink background glClear ( GL_COLOR_BUFFER_BIT ) glBindFramebuffer ( GL_FRAMEBUFFER , 0 ) # # TODO: use different textures for each eye self . compositor . submit ( openvr . Eye_Left , self . texture ) self . compositor . submit ( openvr . Eye_Right , self . texture ) glBindFramebuffer ( GL_FRAMEBUFFER , 0 ) | Renders the scene once every refresh | 293 | 7 |
247,437 | def key_press ( self , key , x , y ) : if ord ( key ) == 27 : # print "Escape!" if bool ( glutLeaveMainLoop ) : glutLeaveMainLoop ( ) else : raise Exception ( "Application quit" ) | Close the application when the player presses ESCAPE | 53 | 9 |
247,438 | def key_callback ( self , window , key , scancode , action , mods ) : if key == glfw . KEY_ESCAPE and action == glfw . PRESS : glfw . SetWindowShouldClose ( self . window , True ) | press ESCAPE to quite the application | 53 | 7 |
247,439 | def run_loop ( self ) : self . running = True event = SDL_Event ( ) try : while self . running : while SDL_PollEvent ( ctypes . byref ( event ) ) != 0 : f = self . _sdl_event_handlers . get ( event . type ) if f is not None : f ( event ) self . render_scene ( ) except SdlAppQuit as e : pass | keep rendering until the user says quit | 91 | 7 |
247,440 | def scale ( self , x , y = None , z = None ) : if y is None : y = x if z is None : z = x m = self for col in range ( 4 ) : # Only the top three rows m [ 0 , col ] *= x m [ 1 , col ] *= y m [ 2 , col ] *= z return self | Uniform scale if only sx argument is specified | 78 | 10 |
247,441 | def _check_devices ( self ) : for i in range ( 1 , len ( self . poses ) ) : pose = self . poses [ i ] if not pose . bDeviceIsConnected : continue if not pose . bPoseIsValid : continue if self . show_controllers_only : device_class = openvr . VRSystem ( ) . getTrackedDeviceClass ( i ) if not device_class == openvr . TrackedDeviceClass_Controller : continue model_name = openvr . VRSystem ( ) . getStringTrackedDeviceProperty ( i , openvr . Prop_RenderModelName_String ) # Create a new mesh object, if necessary if model_name not in self . meshes : self . meshes [ model_name ] = TrackedDeviceMesh ( model_name ) | Enumerate OpenVR tracked devices and check whether any need to be initialized | 170 | 15 |
247,442 | def getGenericInterface ( interfaceVersion ) : error = EVRInitError ( ) result = _openvr . VR_GetGenericInterface ( interfaceVersion , byref ( error ) ) _checkInitError ( error . value ) return result | Returns the interface of the specified version . This method must be called after VR_Init . The pointer returned is valid until VR_Shutdown is called . | 49 | 31 |
247,443 | def getRecommendedRenderTargetSize ( self ) : fn = self . function_table . getRecommendedRenderTargetSize pnWidth = c_uint32 ( ) pnHeight = c_uint32 ( ) fn ( byref ( pnWidth ) , byref ( pnHeight ) ) return pnWidth . value , pnHeight . value | Suggested size for the intermediate render target that the distortion pulls from . | 73 | 14 |
247,444 | def getProjectionMatrix ( self , eEye , fNearZ , fFarZ ) : fn = self . function_table . getProjectionMatrix result = fn ( eEye , fNearZ , fFarZ ) return result | The projection matrix for the specified eye | 49 | 7 |
247,445 | def getProjectionRaw ( self , eEye ) : fn = self . function_table . getProjectionRaw pfLeft = c_float ( ) pfRight = c_float ( ) pfTop = c_float ( ) pfBottom = c_float ( ) fn ( eEye , byref ( pfLeft ) , byref ( pfRight ) , byref ( pfTop ) , byref ( pfBottom ) ) return pfLeft . value , pfRight . value , pfTop . value , pfBottom . value | The components necessary to build your own projection matrix in case your application is doing something fancy like infinite Z | 121 | 20 |
247,446 | def computeDistortion ( self , eEye , fU , fV ) : fn = self . function_table . computeDistortion pDistortionCoordinates = DistortionCoordinates_t ( ) result = fn ( eEye , fU , fV , byref ( pDistortionCoordinates ) ) return result , pDistortionCoordinates | Gets the result of the distortion function for the specified eye and input UVs . UVs go from 0 0 in the upper left of that eye s viewport and 1 1 in the lower right of that eye s viewport . Returns true for success . Otherwise returns false and distortion coordinates are not suitable . | 77 | 62 |
247,447 | def getTimeSinceLastVsync ( self ) : fn = self . function_table . getTimeSinceLastVsync pfSecondsSinceLastVsync = c_float ( ) pulFrameCounter = c_uint64 ( ) result = fn ( byref ( pfSecondsSinceLastVsync ) , byref ( pulFrameCounter ) ) return result , pfSecondsSinceLastVsync . value , pulFrameCounter . value | Returns the number of elapsed seconds since the last recorded vsync event . This will come from a vsync timer event in the timer if possible or from the application - reported time if that is not available . If no vsync times are available the function will return zero for vsync time and frame counter and return false from the method . | 93 | 67 |
247,448 | def getTrackedDeviceActivityLevel ( self , unDeviceId ) : fn = self . function_table . getTrackedDeviceActivityLevel result = fn ( unDeviceId ) return result | Returns the level of activity on the device . | 39 | 9 |
247,449 | def applyTransform ( self ) : fn = self . function_table . applyTransform pOutputPose = TrackedDevicePose_t ( ) pTrackedDevicePose = TrackedDevicePose_t ( ) pTransform = HmdMatrix34_t ( ) fn ( byref ( pOutputPose ) , byref ( pTrackedDevicePose ) , byref ( pTransform ) ) return pOutputPose , pTrackedDevicePose , pTransform | Convenience utility to apply the specified transform to the specified pose . This properly transforms all pose components including velocity and angular velocity | 102 | 25 |
247,450 | def getTrackedDeviceIndexForControllerRole ( self , unDeviceType ) : fn = self . function_table . getTrackedDeviceIndexForControllerRole result = fn ( unDeviceType ) return result | Returns the device index associated with a specific role for example the left hand or the right hand . This function is deprecated in favor of the new IVRInput system . | 43 | 33 |
247,451 | def getControllerRoleForTrackedDeviceIndex ( self , unDeviceIndex ) : fn = self . function_table . getControllerRoleForTrackedDeviceIndex result = fn ( unDeviceIndex ) return result | Returns the controller type associated with a device index . This function is deprecated in favor of the new IVRInput system . | 43 | 24 |
247,452 | def isTrackedDeviceConnected ( self , unDeviceIndex ) : fn = self . function_table . isTrackedDeviceConnected result = fn ( unDeviceIndex ) return result | Returns true if there is a device connected in this slot . | 39 | 12 |
247,453 | def getBoolTrackedDeviceProperty ( self , unDeviceIndex , prop ) : fn = self . function_table . getBoolTrackedDeviceProperty pError = ETrackedPropertyError ( ) result = fn ( unDeviceIndex , prop , byref ( pError ) ) return result , pError | Returns a bool property . If the device index is not valid or the property is not a bool type this function will return false . | 65 | 26 |
247,454 | def getArrayTrackedDeviceProperty ( self , unDeviceIndex , prop , propType , pBuffer , unBufferSize ) : fn = self . function_table . getArrayTrackedDeviceProperty pError = ETrackedPropertyError ( ) result = fn ( unDeviceIndex , prop , propType , pBuffer , unBufferSize , byref ( pError ) ) return result , pError | Returns an array of one type of property . If the device index is not valid or the property is not a single value or an array of the specified type this function will return 0 . Otherwise it returns the number of bytes necessary to hold the array of properties . If unBufferSize is greater than the returned size and pBuffer is non - NULL pBuffer is filled with the contents of array of properties . | 83 | 81 |
247,455 | def getStringTrackedDeviceProperty ( self , unDeviceIndex , prop ) : fn = self . function_table . getStringTrackedDeviceProperty pError = ETrackedPropertyError ( ) # TODO: automate this string argument manipulation **** unRequiredBufferLen = fn ( unDeviceIndex , prop , None , 0 , byref ( pError ) ) if unRequiredBufferLen == 0 : return b"" pchBuffer = ctypes . create_string_buffer ( unRequiredBufferLen ) fn ( unDeviceIndex , prop , pchBuffer , unRequiredBufferLen , byref ( pError ) ) if pError . value != TrackedProp_Success : raise OpenVRError ( str ( pError ) ) sResult = bytes ( pchBuffer . value ) return sResult | Returns a string property . If the device index is not valid or the property is not a string type this function will return 0 . Otherwise it returns the length of the number of bytes necessary to hold this string including the trailing null . Strings will always fit in buffers of k_unMaxPropertyStringSize characters . | 167 | 63 |
247,456 | def getPropErrorNameFromEnum ( self , error ) : fn = self . function_table . getPropErrorNameFromEnum result = fn ( error ) return result | returns a string that corresponds with the specified property error . The string will be the name of the error enum value for all valid error codes | 37 | 28 |
247,457 | def pollNextEvent ( self , pEvent ) : fn = self . function_table . pollNextEvent result = fn ( byref ( pEvent ) , sizeof ( VREvent_t ) ) return result != 0 | Returns true and fills the event with the next event on the queue if there is one . If there are no events this method returns false . uncbVREvent should be the size in bytes of the VREvent_t struct | 46 | 47 |
247,458 | def pollNextEventWithPose ( self , eOrigin , uncbVREvent ) : fn = self . function_table . pollNextEventWithPose pEvent = VREvent_t ( ) pTrackedDevicePose = TrackedDevicePose_t ( ) result = fn ( eOrigin , byref ( pEvent ) , uncbVREvent , byref ( pTrackedDevicePose ) ) return result , pEvent , pTrackedDevicePose | Returns true and fills the event with the next event on the queue if there is one . If there are no events this method returns false . Fills in the pose of the associated tracked device in the provided pose struct . This pose will always be older than the call to this function and should not be used to render the device . uncbVREvent should be the size in bytes of the VREvent_t struct | 103 | 85 |
247,459 | def getEventTypeNameFromEnum ( self , eType ) : fn = self . function_table . getEventTypeNameFromEnum result = fn ( eType ) return result | returns the name of an EVREvent enum value | 39 | 11 |
247,460 | def getControllerState ( self , unControllerDeviceIndex , unControllerStateSize = sizeof ( VRControllerState_t ) ) : fn = self . function_table . getControllerState pControllerState = VRControllerState_t ( ) result = fn ( unControllerDeviceIndex , byref ( pControllerState ) , unControllerStateSize ) return result , pControllerState | Fills the supplied struct with the current state of the controller . Returns false if the controller index is invalid . This function is deprecated in favor of the new IVRInput system . | 77 | 36 |
247,461 | def getControllerStateWithPose ( self , eOrigin , unControllerDeviceIndex , unControllerStateSize = sizeof ( VRControllerState_t ) ) : fn = self . function_table . getControllerStateWithPose pControllerState = VRControllerState_t ( ) pTrackedDevicePose = TrackedDevicePose_t ( ) result = fn ( eOrigin , unControllerDeviceIndex , byref ( pControllerState ) , unControllerStateSize , byref ( pTrackedDevicePose ) ) return result , pControllerState , pTrackedDevicePose | fills the supplied struct with the current state of the controller and the provided pose with the pose of the controller when the controller state was updated most recently . Use this form if you need a precise controller pose as input to your application when the user presses or releases a button . This function is deprecated in favor of the new IVRInput system . | 123 | 69 |
247,462 | def triggerHapticPulse ( self , unControllerDeviceIndex , unAxisId , usDurationMicroSec ) : fn = self . function_table . triggerHapticPulse fn ( unControllerDeviceIndex , unAxisId , usDurationMicroSec ) | Trigger a single haptic pulse on a controller . After this call the application may not trigger another haptic pulse on this controller and axis combination for 5ms . This function is deprecated in favor of the new IVRInput system . | 55 | 46 |
247,463 | def getButtonIdNameFromEnum ( self , eButtonId ) : fn = self . function_table . getButtonIdNameFromEnum result = fn ( eButtonId ) return result | returns the name of an EVRButtonId enum value . This function is deprecated in favor of the new IVRInput system . | 41 | 27 |
247,464 | def getControllerAxisTypeNameFromEnum ( self , eAxisType ) : fn = self . function_table . getControllerAxisTypeNameFromEnum result = fn ( eAxisType ) return result | returns the name of an EVRControllerAxisType enum value . This function is deprecated in favor of the new IVRInput system . | 47 | 29 |
247,465 | def driverDebugRequest ( self , unDeviceIndex , pchRequest , pchResponseBuffer , unResponseBufferSize ) : fn = self . function_table . driverDebugRequest result = fn ( unDeviceIndex , pchRequest , pchResponseBuffer , unResponseBufferSize ) return result | Sends a request to the driver for the specified device and returns the response . The maximum response size is 32k but this method can be called with a smaller buffer . If the response exceeds the size of the buffer it is truncated . The size of the response including its terminating null is returned . | 61 | 60 |
247,466 | def getWindowBounds ( self ) : fn = self . function_table . getWindowBounds pnX = c_int32 ( ) pnY = c_int32 ( ) pnWidth = c_uint32 ( ) pnHeight = c_uint32 ( ) fn ( byref ( pnX ) , byref ( pnY ) , byref ( pnWidth ) , byref ( pnHeight ) ) return pnX . value , pnY . value , pnWidth . value , pnHeight . value | Size and position that the window needs to be on the VR display . | 119 | 14 |
247,467 | def getEyeOutputViewport ( self , eEye ) : fn = self . function_table . getEyeOutputViewport pnX = c_uint32 ( ) pnY = c_uint32 ( ) pnWidth = c_uint32 ( ) pnHeight = c_uint32 ( ) fn ( eEye , byref ( pnX ) , byref ( pnY ) , byref ( pnWidth ) , byref ( pnHeight ) ) return pnX . value , pnY . value , pnWidth . value , pnHeight . value | Gets the viewport in the frame buffer to draw the output of the distortion into | 127 | 17 |
247,468 | def getCameraErrorNameFromEnum ( self , eCameraError ) : fn = self . function_table . getCameraErrorNameFromEnum result = fn ( eCameraError ) return result | Returns a string for an error | 41 | 6 |
247,469 | def hasCamera ( self , nDeviceIndex ) : fn = self . function_table . hasCamera pHasCamera = openvr_bool ( ) result = fn ( nDeviceIndex , byref ( pHasCamera ) ) return result , pHasCamera | For convenience same as tracked property request Prop_HasCamera_Bool | 53 | 14 |
247,470 | def acquireVideoStreamingService ( self , nDeviceIndex ) : fn = self . function_table . acquireVideoStreamingService pHandle = TrackedCameraHandle_t ( ) result = fn ( nDeviceIndex , byref ( pHandle ) ) return result , pHandle | Acquiring streaming service permits video streaming for the caller . Releasing hints the system that video services do not need to be maintained for this client . If the camera has not already been activated a one time spin up may incur some auto exposure as well as initial streaming frame delays . The camera should be considered a global resource accessible for shared consumption but not exclusive to any caller . The camera may go inactive due to lack of active consumers or headset idleness . | 58 | 91 |
247,471 | def getVideoStreamFrameBuffer ( self , hTrackedCamera , eFrameType , pFrameBuffer , nFrameBufferSize , nFrameHeaderSize ) : fn = self . function_table . getVideoStreamFrameBuffer pFrameHeader = CameraVideoStreamFrameHeader_t ( ) result = fn ( hTrackedCamera , eFrameType , pFrameBuffer , nFrameBufferSize , byref ( pFrameHeader ) , nFrameHeaderSize ) return result , pFrameHeader | Copies the image frame into a caller s provided buffer . The image data is currently provided as RGBA data 4 bytes per pixel . A caller can provide null for the framebuffer or frameheader if not desired . Requesting the frame header first followed by the frame buffer allows the caller to determine if the frame as advanced per the frame header sequence . If there is no frame available yet due to initial camera spinup or re - activation the error will be VRTrackedCameraError_NoFrameAvailable . Ideally a caller should be polling at ~16ms intervals | 100 | 112 |
247,472 | def getVideoStreamTextureGL ( self , hTrackedCamera , eFrameType , nFrameHeaderSize ) : fn = self . function_table . getVideoStreamTextureGL pglTextureId = glUInt_t ( ) pFrameHeader = CameraVideoStreamFrameHeader_t ( ) result = fn ( hTrackedCamera , eFrameType , byref ( pglTextureId ) , byref ( pFrameHeader ) , nFrameHeaderSize ) return result , pglTextureId , pFrameHeader | Access a shared GL texture for the specified tracked camera stream | 108 | 11 |
247,473 | def addApplicationManifest ( self , pchApplicationManifestFullPath , bTemporary ) : fn = self . function_table . addApplicationManifest result = fn ( pchApplicationManifestFullPath , bTemporary ) return result | Adds an application manifest to the list to load when building the list of installed applications . Temporary manifests are not automatically loaded | 51 | 23 |
247,474 | def removeApplicationManifest ( self , pchApplicationManifestFullPath ) : fn = self . function_table . removeApplicationManifest result = fn ( pchApplicationManifestFullPath ) return result | Removes an application manifest from the list to load when building the list of installed applications . | 43 | 18 |
247,475 | def isApplicationInstalled ( self , pchAppKey ) : fn = self . function_table . isApplicationInstalled result = fn ( pchAppKey ) return result | Returns true if an application is installed | 37 | 7 |
247,476 | def getApplicationKeyByProcessId ( self , unProcessId , pchAppKeyBuffer , unAppKeyBufferLen ) : fn = self . function_table . getApplicationKeyByProcessId result = fn ( unProcessId , pchAppKeyBuffer , unAppKeyBufferLen ) return result | Returns the key of the application for the specified Process Id . The buffer should be at least k_unMaxApplicationKeyLength in order to fit the key . | 63 | 32 |
247,477 | def launchApplication ( self , pchAppKey ) : fn = self . function_table . launchApplication result = fn ( pchAppKey ) return result | Launches the application . The existing scene application will exit and then the new application will start . This call is not valid for dashboard overlay applications . | 33 | 29 |
247,478 | def launchApplicationFromMimeType ( self , pchMimeType , pchArgs ) : fn = self . function_table . launchApplicationFromMimeType result = fn ( pchMimeType , pchArgs ) return result | launches the application currently associated with this mime type and passes it the option args typically the filename or object name of the item being launched | 51 | 28 |
247,479 | def launchDashboardOverlay ( self , pchAppKey ) : fn = self . function_table . launchDashboardOverlay result = fn ( pchAppKey ) return result | Launches the dashboard overlay application if it is not already running . This call is only valid for dashboard overlay applications . | 39 | 23 |
247,480 | def cancelApplicationLaunch ( self , pchAppKey ) : fn = self . function_table . cancelApplicationLaunch result = fn ( pchAppKey ) return result | Cancel a pending launch for an application | 35 | 8 |
247,481 | def getApplicationProcessId ( self , pchAppKey ) : fn = self . function_table . getApplicationProcessId result = fn ( pchAppKey ) return result | Returns the process ID for an application . Return 0 if the application was not found or is not running . | 37 | 21 |
247,482 | def getApplicationsErrorNameFromEnum ( self , error ) : fn = self . function_table . getApplicationsErrorNameFromEnum result = fn ( error ) return result | Returns a string for an applications error | 37 | 7 |
247,483 | def getApplicationPropertyString ( self , pchAppKey , eProperty , pchPropertyValueBuffer , unPropertyValueBufferLen ) : fn = self . function_table . getApplicationPropertyString peError = EVRApplicationError ( ) result = fn ( pchAppKey , eProperty , pchPropertyValueBuffer , unPropertyValueBufferLen , byref ( peError ) ) return result , peError | Returns a value for an application property . The required buffer size to fit this value will be returned . | 87 | 20 |
247,484 | def getApplicationPropertyBool ( self , pchAppKey , eProperty ) : fn = self . function_table . getApplicationPropertyBool peError = EVRApplicationError ( ) result = fn ( pchAppKey , eProperty , byref ( peError ) ) return result , peError | Returns a bool value for an application property . Returns false in all error cases . | 65 | 16 |
247,485 | def setApplicationAutoLaunch ( self , pchAppKey , bAutoLaunch ) : fn = self . function_table . setApplicationAutoLaunch result = fn ( pchAppKey , bAutoLaunch ) return result | Sets the application auto - launch flag . This is only valid for applications which return true for VRApplicationProperty_IsDashboardOverlay_Bool . | 45 | 34 |
247,486 | def getApplicationAutoLaunch ( self , pchAppKey ) : fn = self . function_table . getApplicationAutoLaunch result = fn ( pchAppKey ) return result | Gets the application auto - launch flag . This is only valid for applications which return true for VRApplicationProperty_IsDashboardOverlay_Bool . | 37 | 34 |
247,487 | def setDefaultApplicationForMimeType ( self , pchAppKey , pchMimeType ) : fn = self . function_table . setDefaultApplicationForMimeType result = fn ( pchAppKey , pchMimeType ) return result | Adds this mime - type to the list of supported mime types for this application | 55 | 17 |
247,488 | def getDefaultApplicationForMimeType ( self , pchMimeType , pchAppKeyBuffer , unAppKeyBufferLen ) : fn = self . function_table . getDefaultApplicationForMimeType result = fn ( pchMimeType , pchAppKeyBuffer , unAppKeyBufferLen ) return result | return the app key that will open this mime type | 69 | 11 |
247,489 | def getApplicationSupportedMimeTypes ( self , pchAppKey , pchMimeTypesBuffer , unMimeTypesBuffer ) : fn = self . function_table . getApplicationSupportedMimeTypes result = fn ( pchAppKey , pchMimeTypesBuffer , unMimeTypesBuffer ) return result | Get the list of supported mime types for this application comma - delimited | 67 | 15 |
247,490 | def getApplicationsThatSupportMimeType ( self , pchMimeType , pchAppKeysThatSupportBuffer , unAppKeysThatSupportBuffer ) : fn = self . function_table . getApplicationsThatSupportMimeType result = fn ( pchMimeType , pchAppKeysThatSupportBuffer , unAppKeysThatSupportBuffer ) return result | Get the list of app - keys that support this mime type comma - delimited the return value is number of bytes you need to return the full string | 75 | 31 |
247,491 | def getApplicationLaunchArguments ( self , unHandle , pchArgs , unArgs ) : fn = self . function_table . getApplicationLaunchArguments result = fn ( unHandle , pchArgs , unArgs ) return result | Get the args list from an app launch that had the process already running you call this when you get a VREvent_ApplicationMimeTypeLoad | 49 | 30 |
247,492 | def getStartingApplication ( self , pchAppKeyBuffer , unAppKeyBufferLen ) : fn = self . function_table . getStartingApplication result = fn ( pchAppKeyBuffer , unAppKeyBufferLen ) return result | Returns the app key for the application that is starting up | 49 | 11 |
247,493 | def getApplicationsTransitionStateNameFromEnum ( self , state ) : fn = self . function_table . getApplicationsTransitionStateNameFromEnum result = fn ( state ) return result | Returns a string for an application transition state | 41 | 8 |
247,494 | def launchInternalProcess ( self , pchBinaryPath , pchArguments , pchWorkingDirectory ) : fn = self . function_table . launchInternalProcess result = fn ( pchBinaryPath , pchArguments , pchWorkingDirectory ) return result | Starts a subprocess within the calling application . This suppresses all application transition UI and automatically identifies the new executable as part of the same application . On success the calling process should exit immediately . If working directory is NULL or the directory portion of the binary path will be the working directory . | 57 | 58 |
247,495 | def getBoundsColor ( self , nNumOutputColors , flCollisionBoundsFadeDistance ) : fn = self . function_table . getBoundsColor pOutputColorArray = HmdColor_t ( ) pOutputCameraColor = HmdColor_t ( ) fn ( byref ( pOutputColorArray ) , nNumOutputColors , flCollisionBoundsFadeDistance , byref ( pOutputCameraColor ) ) return pOutputColorArray , pOutputCameraColor | Get the current chaperone bounds draw color and brightness | 105 | 11 |
247,496 | def commitWorkingCopy ( self , configFile ) : fn = self . function_table . commitWorkingCopy result = fn ( configFile ) return result | Saves the current working copy to disk | 31 | 8 |
247,497 | def getWorkingCollisionBoundsInfo ( self ) : fn = self . function_table . getWorkingCollisionBoundsInfo pQuadsBuffer = HmdQuad_t ( ) punQuadsCount = c_uint32 ( ) result = fn ( byref ( pQuadsBuffer ) , byref ( punQuadsCount ) ) return result , pQuadsBuffer , punQuadsCount . value | Returns the number of Quads if the buffer points to null . Otherwise it returns Quads into the buffer up to the max specified from the working copy . | 87 | 31 |
247,498 | def getWorkingSeatedZeroPoseToRawTrackingPose ( self ) : fn = self . function_table . getWorkingSeatedZeroPoseToRawTrackingPose pmatSeatedZeroPoseToRawTrackingPose = HmdMatrix34_t ( ) result = fn ( byref ( pmatSeatedZeroPoseToRawTrackingPose ) ) return result , pmatSeatedZeroPoseToRawTrackingPose | Returns the preferred seated position from the working copy . | 99 | 10 |
247,499 | def getWorkingStandingZeroPoseToRawTrackingPose ( self ) : fn = self . function_table . getWorkingStandingZeroPoseToRawTrackingPose pmatStandingZeroPoseToRawTrackingPose = HmdMatrix34_t ( ) result = fn ( byref ( pmatStandingZeroPoseToRawTrackingPose ) ) return result , pmatStandingZeroPoseToRawTrackingPose | Returns the standing origin from the working copy . | 94 | 9 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.