repo stringlengths 7 55 | path stringlengths 4 127 | func_name stringlengths 1 88 | original_string stringlengths 75 19.8k | language stringclasses 1
value | code stringlengths 75 19.8k | code_tokens list | docstring stringlengths 3 17.3k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 87 242 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
dakrauth/django-swingtime | swingtime/views.py | event_view | def event_view(
request,
pk,
template='swingtime/event_detail.html',
event_form_class=forms.EventForm,
recurrence_form_class=forms.MultipleOccurrenceForm
):
'''
View an ``Event`` instance and optionally update either the event or its
occurrences.
Context parameters:
``event``
... | python | def event_view(
request,
pk,
template='swingtime/event_detail.html',
event_form_class=forms.EventForm,
recurrence_form_class=forms.MultipleOccurrenceForm
):
'''
View an ``Event`` instance and optionally update either the event or its
occurrences.
Context parameters:
``event``
... | [
"def",
"event_view",
"(",
"request",
",",
"pk",
",",
"template",
"=",
"'swingtime/event_detail.html'",
",",
"event_form_class",
"=",
"forms",
".",
"EventForm",
",",
"recurrence_form_class",
"=",
"forms",
".",
"MultipleOccurrenceForm",
")",
":",
"event",
"=",
"get_... | View an ``Event`` instance and optionally update either the event or its
occurrences.
Context parameters:
``event``
the event keyed by ``pk``
``event_form``
a form object for updating the event
``recurrence_form``
a form object for adding occurrences | [
"View",
"an",
"Event",
"instance",
"and",
"optionally",
"update",
"either",
"the",
"event",
"or",
"its",
"occurrences",
"."
] | d1cdd449bd5c6895c3ff182fd890c4d3452943fe | https://github.com/dakrauth/django-swingtime/blob/d1cdd449bd5c6895c3ff182fd890c4d3452943fe/swingtime/views.py#L43-L88 | train |
dakrauth/django-swingtime | swingtime/views.py | occurrence_view | def occurrence_view(
request,
event_pk,
pk,
template='swingtime/occurrence_detail.html',
form_class=forms.SingleOccurrenceForm
):
'''
View a specific occurrence and optionally handle any updates.
Context parameters:
``occurrence``
the occurrence object keyed by ``pk``
... | python | def occurrence_view(
request,
event_pk,
pk,
template='swingtime/occurrence_detail.html',
form_class=forms.SingleOccurrenceForm
):
'''
View a specific occurrence and optionally handle any updates.
Context parameters:
``occurrence``
the occurrence object keyed by ``pk``
... | [
"def",
"occurrence_view",
"(",
"request",
",",
"event_pk",
",",
"pk",
",",
"template",
"=",
"'swingtime/occurrence_detail.html'",
",",
"form_class",
"=",
"forms",
".",
"SingleOccurrenceForm",
")",
":",
"occurrence",
"=",
"get_object_or_404",
"(",
"Occurrence",
",",
... | View a specific occurrence and optionally handle any updates.
Context parameters:
``occurrence``
the occurrence object keyed by ``pk``
``form``
a form object for updating the occurrence | [
"View",
"a",
"specific",
"occurrence",
"and",
"optionally",
"handle",
"any",
"updates",
"."
] | d1cdd449bd5c6895c3ff182fd890c4d3452943fe | https://github.com/dakrauth/django-swingtime/blob/d1cdd449bd5c6895c3ff182fd890c4d3452943fe/swingtime/views.py#L91-L118 | train |
dakrauth/django-swingtime | swingtime/views.py | add_event | def add_event(
request,
template='swingtime/add_event.html',
event_form_class=forms.EventForm,
recurrence_form_class=forms.MultipleOccurrenceForm
):
'''
Add a new ``Event`` instance and 1 or more associated ``Occurrence``s.
Context parameters:
``dtstart``
a datetime.datetime ob... | python | def add_event(
request,
template='swingtime/add_event.html',
event_form_class=forms.EventForm,
recurrence_form_class=forms.MultipleOccurrenceForm
):
'''
Add a new ``Event`` instance and 1 or more associated ``Occurrence``s.
Context parameters:
``dtstart``
a datetime.datetime ob... | [
"def",
"add_event",
"(",
"request",
",",
"template",
"=",
"'swingtime/add_event.html'",
",",
"event_form_class",
"=",
"forms",
".",
"EventForm",
",",
"recurrence_form_class",
"=",
"forms",
".",
"MultipleOccurrenceForm",
")",
":",
"dtstart",
"=",
"None",
"if",
"req... | Add a new ``Event`` instance and 1 or more associated ``Occurrence``s.
Context parameters:
``dtstart``
a datetime.datetime object representing the GET request value if present,
otherwise None
``event_form``
a form object for updating the event
``recurrence_form``
a fo... | [
"Add",
"a",
"new",
"Event",
"instance",
"and",
"1",
"or",
"more",
"associated",
"Occurrence",
"s",
"."
] | d1cdd449bd5c6895c3ff182fd890c4d3452943fe | https://github.com/dakrauth/django-swingtime/blob/d1cdd449bd5c6895c3ff182fd890c4d3452943fe/swingtime/views.py#L121-L168 | train |
dakrauth/django-swingtime | swingtime/views.py | _datetime_view | def _datetime_view(
request,
template,
dt,
timeslot_factory=None,
items=None,
params=None
):
'''
Build a time slot grid representation for the given datetime ``dt``. See
utils.create_timeslot_table documentation for items and params.
Context parameters:
``day``
the ... | python | def _datetime_view(
request,
template,
dt,
timeslot_factory=None,
items=None,
params=None
):
'''
Build a time slot grid representation for the given datetime ``dt``. See
utils.create_timeslot_table documentation for items and params.
Context parameters:
``day``
the ... | [
"def",
"_datetime_view",
"(",
"request",
",",
"template",
",",
"dt",
",",
"timeslot_factory",
"=",
"None",
",",
"items",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"timeslot_factory",
"=",
"timeslot_factory",
"or",
"utils",
".",
"create_timeslot_table"... | Build a time slot grid representation for the given datetime ``dt``. See
utils.create_timeslot_table documentation for items and params.
Context parameters:
``day``
the specified datetime value (dt)
``next_day``
day + 1 day
``prev_day``
day - 1 day
``timeslots``
... | [
"Build",
"a",
"time",
"slot",
"grid",
"representation",
"for",
"the",
"given",
"datetime",
"dt",
".",
"See",
"utils",
".",
"create_timeslot_table",
"documentation",
"for",
"items",
"and",
"params",
"."
] | d1cdd449bd5c6895c3ff182fd890c4d3452943fe | https://github.com/dakrauth/django-swingtime/blob/d1cdd449bd5c6895c3ff182fd890c4d3452943fe/swingtime/views.py#L171-L206 | train |
dakrauth/django-swingtime | swingtime/views.py | month_view | def month_view(
request,
year,
month,
template='swingtime/monthly_view.html',
queryset=None
):
'''
Render a tradional calendar grid view with temporal navigation variables.
Context parameters:
``today``
the current datetime.datetime value
``calendar``
a list of... | python | def month_view(
request,
year,
month,
template='swingtime/monthly_view.html',
queryset=None
):
'''
Render a tradional calendar grid view with temporal navigation variables.
Context parameters:
``today``
the current datetime.datetime value
``calendar``
a list of... | [
"def",
"month_view",
"(",
"request",
",",
"year",
",",
"month",
",",
"template",
"=",
"'swingtime/monthly_view.html'",
",",
"queryset",
"=",
"None",
")",
":",
"year",
",",
"month",
"=",
"int",
"(",
"year",
")",
",",
"int",
"(",
"month",
")",
"cal",
"="... | Render a tradional calendar grid view with temporal navigation variables.
Context parameters:
``today``
the current datetime.datetime value
``calendar``
a list of rows containing (day, items) cells, where day is the day of
the month integer and items is a (potentially empty) list ... | [
"Render",
"a",
"tradional",
"calendar",
"grid",
"view",
"with",
"temporal",
"navigation",
"variables",
"."
] | d1cdd449bd5c6895c3ff182fd890c4d3452943fe | https://github.com/dakrauth/django-swingtime/blob/d1cdd449bd5c6895c3ff182fd890c4d3452943fe/swingtime/views.py#L270-L323 | train |
p1c2u/openapi-core | openapi_core/schema/schemas/models.py | Schema.cast | def cast(self, value, custom_formatters=None, strict=True):
"""Cast value to schema type"""
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.ge... | python | def cast(self, value, custom_formatters=None, strict=True):
"""Cast value to schema type"""
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.ge... | [
"def",
"cast",
"(",
"self",
",",
"value",
",",
"custom_formatters",
"=",
"None",
",",
"strict",
"=",
"True",
")",
":",
"if",
"value",
"is",
"None",
":",
"if",
"not",
"self",
".",
"nullable",
":",
"raise",
"InvalidSchemaValue",
"(",
"\"Null value for non-nu... | Cast value to schema type | [
"Cast",
"value",
"to",
"schema",
"type"
] | f274836c4dd45729b1634aff8758c63323173947 | https://github.com/p1c2u/openapi-core/blob/f274836c4dd45729b1634aff8758c63323173947/openapi_core/schema/schemas/models.py#L171-L189 | train |
p1c2u/openapi-core | openapi_core/schema/schemas/models.py | Schema.unmarshal | def unmarshal(self, value, custom_formatters=None, strict=True):
"""Unmarshal parameter from the value."""
if self.deprecated:
warnings.warn("The schema is deprecated", DeprecationWarning)
casted = self.cast(value, custom_formatters=custom_formatters, strict=strict)
if cast... | python | def unmarshal(self, value, custom_formatters=None, strict=True):
"""Unmarshal parameter from the value."""
if self.deprecated:
warnings.warn("The schema is deprecated", DeprecationWarning)
casted = self.cast(value, custom_formatters=custom_formatters, strict=strict)
if cast... | [
"def",
"unmarshal",
"(",
"self",
",",
"value",
",",
"custom_formatters",
"=",
"None",
",",
"strict",
"=",
"True",
")",
":",
"if",
"self",
".",
"deprecated",
":",
"warnings",
".",
"warn",
"(",
"\"The schema is deprecated\"",
",",
"DeprecationWarning",
")",
"c... | Unmarshal parameter from the value. | [
"Unmarshal",
"parameter",
"from",
"the",
"value",
"."
] | f274836c4dd45729b1634aff8758c63323173947 | https://github.com/p1c2u/openapi-core/blob/f274836c4dd45729b1634aff8758c63323173947/openapi_core/schema/schemas/models.py#L191-L205 | train |
p1c2u/openapi-core | openapi_core/validation/util.py | get_operation_pattern | def get_operation_pattern(server_url, request_url_pattern):
"""Return an updated request URL pattern with the server URL removed."""
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 ... | python | def get_operation_pattern(server_url, request_url_pattern):
"""Return an updated request URL pattern with the server URL removed."""
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 ... | [
"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",
... | Return an updated request URL pattern with the server URL removed. | [
"Return",
"an",
"updated",
"request",
"URL",
"pattern",
"with",
"the",
"server",
"URL",
"removed",
"."
] | f274836c4dd45729b1634aff8758c63323173947 | https://github.com/p1c2u/openapi-core/blob/f274836c4dd45729b1634aff8758c63323173947/openapi_core/validation/util.py#L17-L24 | train |
nesaro/pydsl | pydsl/check.py | check | def check(definition, data, *args, **kwargs):
"""Checks if the input follows the definition"""
checker = checker_factory(definition)
return checker(data, *args, **kwargs) | python | def check(definition, data, *args, **kwargs):
"""Checks if the input follows the definition"""
checker = checker_factory(definition)
return checker(data, *args, **kwargs) | [
"def",
"check",
"(",
"definition",
",",
"data",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"checker",
"=",
"checker_factory",
"(",
"definition",
")",
"return",
"checker",
"(",
"data",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | Checks if the input follows the definition | [
"Checks",
"if",
"the",
"input",
"follows",
"the",
"definition"
] | 00b4fffd72036b80335e1a44a888fac57917ab41 | https://github.com/nesaro/pydsl/blob/00b4fffd72036b80335e1a44a888fac57917ab41/pydsl/check.py#L29-L32 | train |
nesaro/pydsl | pydsl/check.py | RegularExpressionChecker.check | def check(self, data):
"""returns True if any match any regexp"""
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)) | python | def check(self, data):
"""returns True if any match any regexp"""
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)) | [
"def",
"check",
"(",
"self",
",",
"data",
")",
":",
"if",
"isinstance",
"(",
"data",
",",
"Iterable",
")",
":",
"data",
"=",
"\"\"",
".",
"join",
"(",
"str",
"(",
"x",
")",
"for",
"x",
"in",
"data",
")",
"try",
":",
"data",
"=",
"str",
"(",
"... | returns True if any match any regexp | [
"returns",
"True",
"if",
"any",
"match",
"any",
"regexp"
] | 00b4fffd72036b80335e1a44a888fac57917ab41 | https://github.com/nesaro/pydsl/blob/00b4fffd72036b80335e1a44a888fac57917ab41/pydsl/check.py#L93-L101 | train |
nesaro/pydsl | pydsl/parser/LR0.py | _build_item_closure | def _build_item_closure(itemset, productionset):
"""Build input itemset closure """
#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(item... | python | def _build_item_closure(itemset, productionset):
"""Build input itemset closure """
#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(item... | [
"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",... | Build input itemset closure | [
"Build",
"input",
"itemset",
"closure"
] | 00b4fffd72036b80335e1a44a888fac57917ab41 | https://github.com/nesaro/pydsl/blob/00b4fffd72036b80335e1a44a888fac57917ab41/pydsl/parser/LR0.py#L34-L54 | train |
nesaro/pydsl | pydsl/parser/LR0.py | item_set_goto | def item_set_goto(itemset, inputsymbol, productionset):
"""returns an itemset
locate inside itemset every element with inputsymbol following cursor
for every located item, append its itemclosure"""
resultset = LR0ItemSet()
for item in itemset.itemlist:
if item.next_symbol() == inputsymbol:
... | python | def item_set_goto(itemset, inputsymbol, productionset):
"""returns an itemset
locate inside itemset every element with inputsymbol following cursor
for every located item, append its itemclosure"""
resultset = LR0ItemSet()
for item in itemset.itemlist:
if item.next_symbol() == inputsymbol:
... | [
"def",
"item_set_goto",
"(",
"itemset",
",",
"inputsymbol",
",",
"productionset",
")",
":",
"resultset",
"=",
"LR0ItemSet",
"(",
")",
"for",
"item",
"in",
"itemset",
".",
"itemlist",
":",
"if",
"item",
".",
"next_symbol",
"(",
")",
"==",
"inputsymbol",
":"... | returns an itemset
locate inside itemset every element with inputsymbol following cursor
for every located item, append its itemclosure | [
"returns",
"an",
"itemset",
"locate",
"inside",
"itemset",
"every",
"element",
"with",
"inputsymbol",
"following",
"cursor",
"for",
"every",
"located",
"item",
"append",
"its",
"itemclosure"
] | 00b4fffd72036b80335e1a44a888fac57917ab41 | https://github.com/nesaro/pydsl/blob/00b4fffd72036b80335e1a44a888fac57917ab41/pydsl/parser/LR0.py#L56-L65 | train |
nesaro/pydsl | pydsl/parser/LR0.py | _slr_build_parser_table | def _slr_build_parser_table(productionset):
"""SLR method to build parser table"""
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 pr... | python | def _slr_build_parser_table(productionset):
"""SLR method to build parser table"""
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 pr... | [
"def",
"_slr_build_parser_table",
"(",
"productionset",
")",
":",
"result",
"=",
"ParserTable",
"(",
")",
"statesset",
"=",
"build_states_sets",
"(",
"productionset",
")",
"for",
"itemindex",
",",
"itemset",
"in",
"enumerate",
"(",
"statesset",
")",
":",
"LOG",
... | SLR method to build parser table | [
"SLR",
"method",
"to",
"build",
"parser",
"table"
] | 00b4fffd72036b80335e1a44a888fac57917ab41 | https://github.com/nesaro/pydsl/blob/00b4fffd72036b80335e1a44a888fac57917ab41/pydsl/parser/LR0.py#L97-L134 | train |
nesaro/pydsl | pydsl/parser/LR0.py | ParserTable.append | def append(self, state, symbol, action, destinationstate, production = None):
"""Appends a new rule"""
if action not in (None, "Accept", "Shift", "Reduce"):
raise TypeError
rule = {"action":action, "dest":destinationstate}
if action == "Reduce":
if rule is None:
... | python | def append(self, state, symbol, action, destinationstate, production = None):
"""Appends a new rule"""
if action not in (None, "Accept", "Shift", "Reduce"):
raise TypeError
rule = {"action":action, "dest":destinationstate}
if action == "Reduce":
if rule is None:
... | [
"def",
"append",
"(",
"self",
",",
"state",
",",
"symbol",
",",
"action",
",",
"destinationstate",
",",
"production",
"=",
"None",
")",
":",
"if",
"action",
"not",
"in",
"(",
"None",
",",
"\"Accept\"",
",",
"\"Shift\"",
",",
"\"Reduce\"",
")",
":",
"ra... | Appends a new rule | [
"Appends",
"a",
"new",
"rule"
] | 00b4fffd72036b80335e1a44a888fac57917ab41 | https://github.com/nesaro/pydsl/blob/00b4fffd72036b80335e1a44a888fac57917ab41/pydsl/parser/LR0.py#L141-L154 | train |
nesaro/pydsl | pydsl/parser/LR0.py | ParserTable.insert | def insert(self, state, token):
"""change internal state, return action"""
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 sy... | python | def insert(self, state, token):
"""change internal state, return action"""
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 sy... | [
"def",
"insert",
"(",
"self",
",",
"state",
",",
"token",
")",
":",
"if",
"token",
"==",
"EndSymbol",
"(",
")",
":",
"return",
"self",
"[",
"state",
"]",
"[",
"EndSymbol",
"(",
")",
"]",
"from",
"pydsl",
".",
"check",
"import",
"check",
"symbol_list"... | change internal state, return action | [
"change",
"internal",
"state",
"return",
"action"
] | 00b4fffd72036b80335e1a44a888fac57917ab41 | https://github.com/nesaro/pydsl/blob/00b4fffd72036b80335e1a44a888fac57917ab41/pydsl/parser/LR0.py#L164-L175 | train |
nesaro/pydsl | pydsl/parser/LR0.py | LR0ItemSet.append_item | def append_item(self, item):
"""Append new item to set"""
if not isinstance(item, LR0Item):
raise TypeError
self.itemlist.append(item) | python | def append_item(self, item):
"""Append new item to set"""
if not isinstance(item, LR0Item):
raise TypeError
self.itemlist.append(item) | [
"def",
"append_item",
"(",
"self",
",",
"item",
")",
":",
"if",
"not",
"isinstance",
"(",
"item",
",",
"LR0Item",
")",
":",
"raise",
"TypeError",
"self",
".",
"itemlist",
".",
"append",
"(",
"item",
")"
] | Append new item to set | [
"Append",
"new",
"item",
"to",
"set"
] | 00b4fffd72036b80335e1a44a888fac57917ab41 | https://github.com/nesaro/pydsl/blob/00b4fffd72036b80335e1a44a888fac57917ab41/pydsl/parser/LR0.py#L248-L252 | train |
nesaro/pydsl | pydsl/parser/LR0.py | LR0ItemSet.append_transition | def append_transition(self, symbol, targetset):
"""Appends a transition"""
if symbol in self.transitions:
return
self.transitions[symbol] = targetset | python | def append_transition(self, symbol, targetset):
"""Appends a transition"""
if symbol in self.transitions:
return
self.transitions[symbol] = targetset | [
"def",
"append_transition",
"(",
"self",
",",
"symbol",
",",
"targetset",
")",
":",
"if",
"symbol",
"in",
"self",
".",
"transitions",
":",
"return",
"self",
".",
"transitions",
"[",
"symbol",
"]",
"=",
"targetset"
] | Appends a transition | [
"Appends",
"a",
"transition"
] | 00b4fffd72036b80335e1a44a888fac57917ab41 | https://github.com/nesaro/pydsl/blob/00b4fffd72036b80335e1a44a888fac57917ab41/pydsl/parser/LR0.py#L254-L258 | train |
nesaro/pydsl | pydsl/parser/LR0.py | LR0Parser.__parse | def __parse(self, tokenlist):
"""see parent docstring"""
#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: ... | python | def __parse(self, tokenlist):
"""see parent docstring"""
#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: ... | [
"def",
"__parse",
"(",
"self",
",",
"tokenlist",
")",
":",
"#empty stack",
"#iterate over symbollist",
"tokenlist",
"=",
"[",
"x",
"for",
"x",
"in",
"tokenlist",
"]",
"if",
"not",
"isinstance",
"(",
"tokenlist",
",",
"list",
")",
":",
"raise",
"TypeError",
... | see parent docstring | [
"see",
"parent",
"docstring"
] | 00b4fffd72036b80335e1a44a888fac57917ab41 | https://github.com/nesaro/pydsl/blob/00b4fffd72036b80335e1a44a888fac57917ab41/pydsl/parser/LR0.py#L279-L312 | train |
nesaro/pydsl | pydsl/lex.py | graph_from_alphabet | def graph_from_alphabet(alphabet, base):
"""Creates a graph that connects the base with the target through alphabets
If every target is connected to any inputs, create the independent paths"""
if not isinstance(alphabet, Choice):
raise TypeError(alphabet.__class__.__name__)
if not isinstance(bas... | python | def graph_from_alphabet(alphabet, base):
"""Creates a graph that connects the base with the target through alphabets
If every target is connected to any inputs, create the independent paths"""
if not isinstance(alphabet, Choice):
raise TypeError(alphabet.__class__.__name__)
if not isinstance(bas... | [
"def",
"graph_from_alphabet",
"(",
"alphabet",
",",
"base",
")",
":",
"if",
"not",
"isinstance",
"(",
"alphabet",
",",
"Choice",
")",
":",
"raise",
"TypeError",
"(",
"alphabet",
".",
"__class__",
".",
"__name__",
")",
"if",
"not",
"isinstance",
"(",
"base"... | Creates a graph that connects the base with the target through alphabets
If every target is connected to any inputs, create the independent paths | [
"Creates",
"a",
"graph",
"that",
"connects",
"the",
"base",
"with",
"the",
"target",
"through",
"alphabets",
"If",
"every",
"target",
"is",
"connected",
"to",
"any",
"inputs",
"create",
"the",
"independent",
"paths"
] | 00b4fffd72036b80335e1a44a888fac57917ab41 | https://github.com/nesaro/pydsl/blob/00b4fffd72036b80335e1a44a888fac57917ab41/pydsl/lex.py#L56-L84 | train |
nesaro/pydsl | pydsl/lex.py | is_subset | def is_subset(a, b):
"""Excluding same size"""
return b.left <= a.left and b.right > a.right or b.left < a.left and b.right >= a.right | python | def is_subset(a, b):
"""Excluding same size"""
return b.left <= a.left and b.right > a.right or b.left < a.left and b.right >= a.right | [
"def",
"is_subset",
"(",
"a",
",",
"b",
")",
":",
"return",
"b",
".",
"left",
"<=",
"a",
".",
"left",
"and",
"b",
".",
"right",
">",
"a",
".",
"right",
"or",
"b",
".",
"left",
"<",
"a",
".",
"left",
"and",
"b",
".",
"right",
">=",
"a",
".",... | Excluding same size | [
"Excluding",
"same",
"size"
] | 00b4fffd72036b80335e1a44a888fac57917ab41 | https://github.com/nesaro/pydsl/blob/00b4fffd72036b80335e1a44a888fac57917ab41/pydsl/lex.py#L141-L143 | train |
nesaro/pydsl | pydsl/lex.py | digraph_walker_backwards | def digraph_walker_backwards(graph, element, call_back):
"""Visits every element guaranteeing that the previous elements have been visited before"""
call_back(graph, element)
for predecessor in graph.predecessors(element):
call_back(graph, predecessor)
for predecessor in graph.predecessors(eleme... | python | def digraph_walker_backwards(graph, element, call_back):
"""Visits every element guaranteeing that the previous elements have been visited before"""
call_back(graph, element)
for predecessor in graph.predecessors(element):
call_back(graph, predecessor)
for predecessor in graph.predecessors(eleme... | [
"def",
"digraph_walker_backwards",
"(",
"graph",
",",
"element",
",",
"call_back",
")",
":",
"call_back",
"(",
"graph",
",",
"element",
")",
"for",
"predecessor",
"in",
"graph",
".",
"predecessors",
"(",
"element",
")",
":",
"call_back",
"(",
"graph",
",",
... | Visits every element guaranteeing that the previous elements have been visited before | [
"Visits",
"every",
"element",
"guaranteeing",
"that",
"the",
"previous",
"elements",
"have",
"been",
"visited",
"before"
] | 00b4fffd72036b80335e1a44a888fac57917ab41 | https://github.com/nesaro/pydsl/blob/00b4fffd72036b80335e1a44a888fac57917ab41/pydsl/lex.py#L185-L191 | train |
nesaro/pydsl | pydsl/grammar/BNF.py | BNFGrammar.first_lookup | def first_lookup(self, symbol, size=1):
"""
Returns a Grammar Definition with the first n terminal symbols
produced by the input symbol
"""
if isinstance(symbol, (TerminalSymbol, NullSymbol)):
return [symbol.gd]
result = []
for production in self.produ... | python | def first_lookup(self, symbol, size=1):
"""
Returns a Grammar Definition with the first n terminal symbols
produced by the input symbol
"""
if isinstance(symbol, (TerminalSymbol, NullSymbol)):
return [symbol.gd]
result = []
for production in self.produ... | [
"def",
"first_lookup",
"(",
"self",
",",
"symbol",
",",
"size",
"=",
"1",
")",
":",
"if",
"isinstance",
"(",
"symbol",
",",
"(",
"TerminalSymbol",
",",
"NullSymbol",
")",
")",
":",
"return",
"[",
"symbol",
".",
"gd",
"]",
"result",
"=",
"[",
"]",
"... | Returns a Grammar Definition with the first n terminal symbols
produced by the input symbol | [
"Returns",
"a",
"Grammar",
"Definition",
"with",
"the",
"first",
"n",
"terminal",
"symbols",
"produced",
"by",
"the",
"input",
"symbol"
] | 00b4fffd72036b80335e1a44a888fac57917ab41 | https://github.com/nesaro/pydsl/blob/00b4fffd72036b80335e1a44a888fac57917ab41/pydsl/grammar/BNF.py#L96-L123 | train |
nesaro/pydsl | pydsl/grammar/BNF.py | BNFGrammar.next_lookup | def next_lookup(self, symbol):
"""Returns the next TerminalSymbols produced by the input symbol within this grammar definition"""
result = []
if symbol == self.initialsymbol:
result.append(EndSymbol())
for production in self.productions:
if symbol in production.ri... | python | def next_lookup(self, symbol):
"""Returns the next TerminalSymbols produced by the input symbol within this grammar definition"""
result = []
if symbol == self.initialsymbol:
result.append(EndSymbol())
for production in self.productions:
if symbol in production.ri... | [
"def",
"next_lookup",
"(",
"self",
",",
"symbol",
")",
":",
"result",
"=",
"[",
"]",
"if",
"symbol",
"==",
"self",
".",
"initialsymbol",
":",
"result",
".",
"append",
"(",
"EndSymbol",
"(",
")",
")",
"for",
"production",
"in",
"self",
".",
"productions... | Returns the next TerminalSymbols produced by the input symbol within this grammar definition | [
"Returns",
"the",
"next",
"TerminalSymbols",
"produced",
"by",
"the",
"input",
"symbol",
"within",
"this",
"grammar",
"definition"
] | 00b4fffd72036b80335e1a44a888fac57917ab41 | https://github.com/nesaro/pydsl/blob/00b4fffd72036b80335e1a44a888fac57917ab41/pydsl/grammar/BNF.py#L125-L142 | train |
nesaro/pydsl | pydsl/grammar/BNF.py | BNFGrammar.main_production | def main_production(self):
"""Returns main rule"""
for rule in self.productions:
if rule.leftside[0] == self._initialsymbol:
return rule
raise IndexError | python | def main_production(self):
"""Returns main rule"""
for rule in self.productions:
if rule.leftside[0] == self._initialsymbol:
return rule
raise IndexError | [
"def",
"main_production",
"(",
"self",
")",
":",
"for",
"rule",
"in",
"self",
".",
"productions",
":",
"if",
"rule",
".",
"leftside",
"[",
"0",
"]",
"==",
"self",
".",
"_initialsymbol",
":",
"return",
"rule",
"raise",
"IndexError"
] | Returns main rule | [
"Returns",
"main",
"rule"
] | 00b4fffd72036b80335e1a44a888fac57917ab41 | https://github.com/nesaro/pydsl/blob/00b4fffd72036b80335e1a44a888fac57917ab41/pydsl/grammar/BNF.py#L155-L160 | train |
nesaro/pydsl | pydsl/grammar/BNF.py | BNFGrammar.getSymbols | def getSymbols(self):
"""Returns every symbol"""
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
... | python | def getSymbols(self):
"""Returns every symbol"""
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
... | [
"def",
"getSymbols",
"(",
"self",
")",
":",
"symbollist",
"=",
"[",
"]",
"for",
"rule",
"in",
"self",
".",
"productions",
":",
"for",
"symbol",
"in",
"rule",
".",
"leftside",
"+",
"rule",
".",
"rightside",
":",
"if",
"symbol",
"not",
"in",
"symbollist"... | Returns every symbol | [
"Returns",
"every",
"symbol"
] | 00b4fffd72036b80335e1a44a888fac57917ab41 | https://github.com/nesaro/pydsl/blob/00b4fffd72036b80335e1a44a888fac57917ab41/pydsl/grammar/BNF.py#L168-L176 | train |
nesaro/pydsl | pydsl/extract.py | extract_alphabet | def extract_alphabet(alphabet, inputdata, fixed_start = False):
"""
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
"""
if not inputdata:
return []
base_alphabet = alphabet.alphabet
l... | python | def extract_alphabet(alphabet, inputdata, fixed_start = False):
"""
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
"""
if not inputdata:
return []
base_alphabet = alphabet.alphabet
l... | [
"def",
"extract_alphabet",
"(",
"alphabet",
",",
"inputdata",
",",
"fixed_start",
"=",
"False",
")",
":",
"if",
"not",
"inputdata",
":",
"return",
"[",
"]",
"base_alphabet",
"=",
"alphabet",
".",
"alphabet",
"lexer",
"=",
"lexer_factory",
"(",
"alphabet",
",... | 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 | [
"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"
] | 00b4fffd72036b80335e1a44a888fac57917ab41 | https://github.com/nesaro/pydsl/blob/00b4fffd72036b80335e1a44a888fac57917ab41/pydsl/extract.py#L44-L74 | train |
nesaro/pydsl | pydsl/extract.py | extract | def extract(grammar, inputdata, fixed_start = False, return_first=False):
"""
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
"""
if not inputdata:
return []
checker = checker_factory(gramm... | python | def extract(grammar, inputdata, fixed_start = False, return_first=False):
"""
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
"""
if not inputdata:
return []
checker = checker_factory(gramm... | [
"def",
"extract",
"(",
"grammar",
",",
"inputdata",
",",
"fixed_start",
"=",
"False",
",",
"return_first",
"=",
"False",
")",
":",
"if",
"not",
"inputdata",
":",
"return",
"[",
"]",
"checker",
"=",
"checker_factory",
"(",
"grammar",
")",
"totallen",
"=",
... | 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 | [
"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"
] | 00b4fffd72036b80335e1a44a888fac57917ab41 | https://github.com/nesaro/pydsl/blob/00b4fffd72036b80335e1a44a888fac57917ab41/pydsl/extract.py#L76-L111 | train |
nesaro/pydsl | pydsl/token.py | append_position_to_token_list | def append_position_to_token_list(token_list):
"""Converts a list of Token into a list of Token, asuming size == 1"""
return [PositionToken(value.content, value.gd, index, index+1) for (index, value) in enumerate(token_list)] | python | def append_position_to_token_list(token_list):
"""Converts a list of Token into a list of Token, asuming size == 1"""
return [PositionToken(value.content, value.gd, index, index+1) for (index, value) in enumerate(token_list)] | [
"def",
"append_position_to_token_list",
"(",
"token_list",
")",
":",
"return",
"[",
"PositionToken",
"(",
"value",
".",
"content",
",",
"value",
".",
"gd",
",",
"index",
",",
"index",
"+",
"1",
")",
"for",
"(",
"index",
",",
"value",
")",
"in",
"enumerat... | Converts a list of Token into a list of Token, asuming size == 1 | [
"Converts",
"a",
"list",
"of",
"Token",
"into",
"a",
"list",
"of",
"Token",
"asuming",
"size",
"==",
"1"
] | 00b4fffd72036b80335e1a44a888fac57917ab41 | https://github.com/nesaro/pydsl/blob/00b4fffd72036b80335e1a44a888fac57917ab41/pydsl/token.py#L62-L64 | train |
nesaro/pydsl | pydsl/file/python.py | load_python_file | def load_python_file(moduleobject):
""" Try to create an indexable instance from a module"""
if isinstance(moduleobject, str):
moduleobject = load_module(moduleobject)
if not hasattr(moduleobject, "iclass"):
raise KeyError("Element" + str(moduleobject))
iclass = getattr(moduleobject, "ic... | python | def load_python_file(moduleobject):
""" Try to create an indexable instance from a module"""
if isinstance(moduleobject, str):
moduleobject = load_module(moduleobject)
if not hasattr(moduleobject, "iclass"):
raise KeyError("Element" + str(moduleobject))
iclass = getattr(moduleobject, "ic... | [
"def",
"load_python_file",
"(",
"moduleobject",
")",
":",
"if",
"isinstance",
"(",
"moduleobject",
",",
"str",
")",
":",
"moduleobject",
"=",
"load_module",
"(",
"moduleobject",
")",
"if",
"not",
"hasattr",
"(",
"moduleobject",
",",
"\"iclass\"",
")",
":",
"... | Try to create an indexable instance from a module | [
"Try",
"to",
"create",
"an",
"indexable",
"instance",
"from",
"a",
"module"
] | 00b4fffd72036b80335e1a44a888fac57917ab41 | https://github.com/nesaro/pydsl/blob/00b4fffd72036b80335e1a44a888fac57917ab41/pydsl/file/python.py#L34-L63 | train |
nesaro/pydsl | pydsl/file/BNF.py | load_bnf_file | def load_bnf_file(filepath, repository = None):
"""Converts a bnf file into a BNFGrammar instance"""
linelist = []
with open(filepath,'r') as mlfile:
for line in mlfile:
linelist.append(line)
return strlist_to_production_set(linelist, repository) | python | def load_bnf_file(filepath, repository = None):
"""Converts a bnf file into a BNFGrammar instance"""
linelist = []
with open(filepath,'r') as mlfile:
for line in mlfile:
linelist.append(line)
return strlist_to_production_set(linelist, repository) | [
"def",
"load_bnf_file",
"(",
"filepath",
",",
"repository",
"=",
"None",
")",
":",
"linelist",
"=",
"[",
"]",
"with",
"open",
"(",
"filepath",
",",
"'r'",
")",
"as",
"mlfile",
":",
"for",
"line",
"in",
"mlfile",
":",
"linelist",
".",
"append",
"(",
"... | Converts a bnf file into a BNFGrammar instance | [
"Converts",
"a",
"bnf",
"file",
"into",
"a",
"BNFGrammar",
"instance"
] | 00b4fffd72036b80335e1a44a888fac57917ab41 | https://github.com/nesaro/pydsl/blob/00b4fffd72036b80335e1a44a888fac57917ab41/pydsl/file/BNF.py#L141-L147 | train |
nesaro/pydsl | pydsl/file/regexp.py | load_re_from_file | def load_re_from_file(filepath):
"""Converts a re file to Regular Grammar instance"""
regexp = None
with open(filepath,'r') as mlfile:
flagstr = ""
for line in mlfile:
cleanline = re.sub("//.*$", "", line)
if re.search("^\s*$", cleanline):
continue
... | python | def load_re_from_file(filepath):
"""Converts a re file to Regular Grammar instance"""
regexp = None
with open(filepath,'r') as mlfile:
flagstr = ""
for line in mlfile:
cleanline = re.sub("//.*$", "", line)
if re.search("^\s*$", cleanline):
continue
... | [
"def",
"load_re_from_file",
"(",
"filepath",
")",
":",
"regexp",
"=",
"None",
"with",
"open",
"(",
"filepath",
",",
"'r'",
")",
"as",
"mlfile",
":",
"flagstr",
"=",
"\"\"",
"for",
"line",
"in",
"mlfile",
":",
"cleanline",
"=",
"re",
".",
"sub",
"(",
... | Converts a re file to Regular Grammar instance | [
"Converts",
"a",
"re",
"file",
"to",
"Regular",
"Grammar",
"instance"
] | 00b4fffd72036b80335e1a44a888fac57917ab41 | https://github.com/nesaro/pydsl/blob/00b4fffd72036b80335e1a44a888fac57917ab41/pydsl/file/regexp.py#L28-L48 | train |
aio-libs/aiohttp-jinja2 | aiohttp_jinja2/helpers.py | url_for | def url_for(context, __route_name, **parts):
"""Filter for generating urls.
Usage: {{ url('the-view-name') }} might become "/path/to/view" or
{{ url('item-details', id=123, query={'active': 'true'}) }}
might become "/items/1?active=true".
"""
app = context['app']
query = None
if 'query... | python | def url_for(context, __route_name, **parts):
"""Filter for generating urls.
Usage: {{ url('the-view-name') }} might become "/path/to/view" or
{{ url('item-details', id=123, query={'active': 'true'}) }}
might become "/items/1?active=true".
"""
app = context['app']
query = None
if 'query... | [
"def",
"url_for",
"(",
"context",
",",
"__route_name",
",",
"*",
"*",
"parts",
")",
":",
"app",
"=",
"context",
"[",
"'app'",
"]",
"query",
"=",
"None",
"if",
"'query_'",
"in",
"parts",
":",
"query",
"=",
"parts",
".",
"pop",
"(",
"'query_'",
")",
... | Filter for generating urls.
Usage: {{ url('the-view-name') }} might become "/path/to/view" or
{{ url('item-details', id=123, query={'active': 'true'}) }}
might become "/items/1?active=true". | [
"Filter",
"for",
"generating",
"urls",
"."
] | 474a852c8b29dc69106bf4aba28a9c99cf63dac9 | https://github.com/aio-libs/aiohttp-jinja2/blob/474a852c8b29dc69106bf4aba28a9c99cf63dac9/aiohttp_jinja2/helpers.py#L9-L39 | train |
aio-libs/aiohttp-jinja2 | aiohttp_jinja2/helpers.py | static_url | def static_url(context, static_file_path):
"""Filter for generating urls for static files.
NOTE: you'll need
to set app['static_root_url'] to be used as the root for the urls returned.
Usage: {{ static('styles.css') }} might become
"/static/styles.css" or "http://mycdn.example.com/styles.css"
... | python | def static_url(context, static_file_path):
"""Filter for generating urls for static files.
NOTE: you'll need
to set app['static_root_url'] to be used as the root for the urls returned.
Usage: {{ static('styles.css') }} might become
"/static/styles.css" or "http://mycdn.example.com/styles.css"
... | [
"def",
"static_url",
"(",
"context",
",",
"static_file_path",
")",
":",
"app",
"=",
"context",
"[",
"'app'",
"]",
"try",
":",
"static_url",
"=",
"app",
"[",
"'static_root_url'",
"]",
"except",
"KeyError",
":",
"raise",
"RuntimeError",
"(",
"\"app does not defi... | Filter for generating urls for static files.
NOTE: you'll need
to set app['static_root_url'] to be used as the root for the urls returned.
Usage: {{ static('styles.css') }} might become
"/static/styles.css" or "http://mycdn.example.com/styles.css" | [
"Filter",
"for",
"generating",
"urls",
"for",
"static",
"files",
"."
] | 474a852c8b29dc69106bf4aba28a9c99cf63dac9 | https://github.com/aio-libs/aiohttp-jinja2/blob/474a852c8b29dc69106bf4aba28a9c99cf63dac9/aiohttp_jinja2/helpers.py#L43-L60 | train |
cmbruns/pyopenvr | src/openvr/gl_renderer.py | OpenVrGlRenderer.init_gl | def init_gl(self):
"allocate OpenGL resources"
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=... | python | def init_gl(self):
"allocate OpenGL resources"
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=... | [
"def",
"init_gl",
"(",
"self",
")",
":",
"self",
".",
"vr_system",
"=",
"openvr",
".",
"init",
"(",
"openvr",
".",
"VRApplication_Scene",
")",
"w",
",",
"h",
"=",
"self",
".",
"vr_system",
".",
"getRecommendedRenderTargetSize",
"(",
")",
"self",
".",
"le... | allocate OpenGL resources | [
"allocate",
"OpenGL",
"resources"
] | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/gl_renderer.py#L144-L169 | train |
cmbruns/pyopenvr | src/samples/glut/pink_world.py | PinkWorld.display | def display(self):
"Renders the scene once every refresh"
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.m... | python | def display(self):
"Renders the scene once every refresh"
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.m... | [
"def",
"display",
"(",
"self",
")",
":",
"self",
".",
"compositor",
".",
"waitGetPoses",
"(",
"self",
".",
"poses",
",",
"openvr",
".",
"k_unMaxTrackedDeviceCount",
",",
"None",
",",
"0",
")",
"hmd_pose0",
"=",
"self",
".",
"poses",
"[",
"openvr",
".",
... | Renders the scene once every refresh | [
"Renders",
"the",
"scene",
"once",
"every",
"refresh"
] | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/samples/glut/pink_world.py#L93-L116 | train |
cmbruns/pyopenvr | src/samples/glut/pink_world.py | PinkWorld.key_press | def key_press(self, key, x, y):
"Close the application when the player presses ESCAPE"
if ord(key) == 27:
# print "Escape!"
if bool(glutLeaveMainLoop):
glutLeaveMainLoop()
else:
raise Exception("Application quit") | python | def key_press(self, key, x, y):
"Close the application when the player presses ESCAPE"
if ord(key) == 27:
# print "Escape!"
if bool(glutLeaveMainLoop):
glutLeaveMainLoop()
else:
raise Exception("Application quit") | [
"def",
"key_press",
"(",
"self",
",",
"key",
",",
"x",
",",
"y",
")",
":",
"if",
"ord",
"(",
"key",
")",
"==",
"27",
":",
"# print \"Escape!\"\r",
"if",
"bool",
"(",
"glutLeaveMainLoop",
")",
":",
"glutLeaveMainLoop",
"(",
")",
"else",
":",
"raise",
... | Close the application when the player presses ESCAPE | [
"Close",
"the",
"application",
"when",
"the",
"player",
"presses",
"ESCAPE"
] | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/samples/glut/pink_world.py#L118-L125 | train |
cmbruns/pyopenvr | src/openvr/glframework/cyglfw3_app.py | CyGLFW3App.key_callback | def key_callback(self, window, key, scancode, action, mods):
"""press ESCAPE to quite the application"""
if key == glfw.KEY_ESCAPE and action == glfw.PRESS:
glfw.SetWindowShouldClose(self.window, True) | python | def key_callback(self, window, key, scancode, action, mods):
"""press ESCAPE to quite the application"""
if key == glfw.KEY_ESCAPE and action == glfw.PRESS:
glfw.SetWindowShouldClose(self.window, True) | [
"def",
"key_callback",
"(",
"self",
",",
"window",
",",
"key",
",",
"scancode",
",",
"action",
",",
"mods",
")",
":",
"if",
"key",
"==",
"glfw",
".",
"KEY_ESCAPE",
"and",
"action",
"==",
"glfw",
".",
"PRESS",
":",
"glfw",
".",
"SetWindowShouldClose",
"... | press ESCAPE to quite the application | [
"press",
"ESCAPE",
"to",
"quite",
"the",
"application"
] | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/glframework/cyglfw3_app.py#L66-L69 | train |
cmbruns/pyopenvr | src/openvr/glframework/sdl_app.py | SdlApp.run_loop | def run_loop(self):
"keep rendering until the user says quit"
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()
exc... | python | def run_loop(self):
"keep rendering until the user says quit"
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()
exc... | [
"def",
"run_loop",
"(",
"self",
")",
":",
"self",
".",
"running",
"=",
"True",
"event",
"=",
"SDL_Event",
"(",
")",
"try",
":",
"while",
"self",
".",
"running",
":",
"while",
"SDL_PollEvent",
"(",
"ctypes",
".",
"byref",
"(",
"event",
")",
")",
"!=",... | keep rendering until the user says quit | [
"keep",
"rendering",
"until",
"the",
"user",
"says",
"quit"
] | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/glframework/sdl_app.py#L112-L124 | train |
cmbruns/pyopenvr | src/samples/sdl/NOTWORKING_hellovr_opengl_sdl.py | Matrix4.scale | def scale(self, x, y=None, z=None):
"Uniform scale, if only sx argument is specified"
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
... | python | def scale(self, x, y=None, z=None):
"Uniform scale, if only sx argument is specified"
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
... | [
"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",
"(",
... | Uniform scale, if only sx argument is specified | [
"Uniform",
"scale",
"if",
"only",
"sx",
"argument",
"is",
"specified"
] | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/samples/sdl/NOTWORKING_hellovr_opengl_sdl.py#L160-L172 | train |
cmbruns/pyopenvr | src/openvr/tracked_devices_actor.py | TrackedDevicesActor._check_devices | def _check_devices(self):
"Enumerate OpenVR tracked devices and check whether any need to be initialized"
for i in range(1, len(self.poses)):
pose = self.poses[i]
if not pose.bDeviceIsConnected:
continue
if not pose.bPoseIsValid:
contin... | python | def _check_devices(self):
"Enumerate OpenVR tracked devices and check whether any need to be initialized"
for i in range(1, len(self.poses)):
pose = self.poses[i]
if not pose.bDeviceIsConnected:
continue
if not pose.bPoseIsValid:
contin... | [
"def",
"_check_devices",
"(",
"self",
")",
":",
"for",
"i",
"in",
"range",
"(",
"1",
",",
"len",
"(",
"self",
".",
"poses",
")",
")",
":",
"pose",
"=",
"self",
".",
"poses",
"[",
"i",
"]",
"if",
"not",
"pose",
".",
"bDeviceIsConnected",
":",
"con... | Enumerate OpenVR tracked devices and check whether any need to be initialized | [
"Enumerate",
"OpenVR",
"tracked",
"devices",
"and",
"check",
"whether",
"any",
"need",
"to",
"be",
"initialized"
] | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/tracked_devices_actor.py#L144-L159 | train |
cmbruns/pyopenvr | src/openvr/__init__.py | getGenericInterface | def getGenericInterface(interfaceVersion):
"""
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.
"""
error = EVRInitError()
result = _openvr.VR_GetGenericInterface(interfaceVersion, byref(erro... | python | def getGenericInterface(interfaceVersion):
"""
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.
"""
error = EVRInitError()
result = _openvr.VR_GetGenericInterface(interfaceVersion, byref(erro... | [
"def",
"getGenericInterface",
"(",
"interfaceVersion",
")",
":",
"error",
"=",
"EVRInitError",
"(",
")",
"result",
"=",
"_openvr",
".",
"VR_GetGenericInterface",
"(",
"interfaceVersion",
",",
"byref",
"(",
"error",
")",
")",
"_checkInitError",
"(",
"error",
".",... | 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. | [
"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",
"."
] | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/__init__.py#L6414-L6422 | train |
cmbruns/pyopenvr | src/openvr/__init__.py | IVRSystem.getRecommendedRenderTargetSize | def getRecommendedRenderTargetSize(self):
"""Suggested size for the intermediate render target that the distortion pulls from."""
fn = self.function_table.getRecommendedRenderTargetSize
pnWidth = c_uint32()
pnHeight = c_uint32()
fn(byref(pnWidth), byref(pnHeight))
return... | python | def getRecommendedRenderTargetSize(self):
"""Suggested size for the intermediate render target that the distortion pulls from."""
fn = self.function_table.getRecommendedRenderTargetSize
pnWidth = c_uint32()
pnHeight = c_uint32()
fn(byref(pnWidth), byref(pnHeight))
return... | [
"def",
"getRecommendedRenderTargetSize",
"(",
"self",
")",
":",
"fn",
"=",
"self",
".",
"function_table",
".",
"getRecommendedRenderTargetSize",
"pnWidth",
"=",
"c_uint32",
"(",
")",
"pnHeight",
"=",
"c_uint32",
"(",
")",
"fn",
"(",
"byref",
"(",
"pnWidth",
")... | Suggested size for the intermediate render target that the distortion pulls from. | [
"Suggested",
"size",
"for",
"the",
"intermediate",
"render",
"target",
"that",
"the",
"distortion",
"pulls",
"from",
"."
] | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/__init__.py#L2628-L2635 | train |
cmbruns/pyopenvr | src/openvr/__init__.py | IVRSystem.getProjectionMatrix | def getProjectionMatrix(self, eEye, fNearZ, fFarZ):
"""The projection matrix for the specified eye"""
fn = self.function_table.getProjectionMatrix
result = fn(eEye, fNearZ, fFarZ)
return result | python | def getProjectionMatrix(self, eEye, fNearZ, fFarZ):
"""The projection matrix for the specified eye"""
fn = self.function_table.getProjectionMatrix
result = fn(eEye, fNearZ, fFarZ)
return result | [
"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 | [
"The",
"projection",
"matrix",
"for",
"the",
"specified",
"eye"
] | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/__init__.py#L2637-L2642 | train |
cmbruns/pyopenvr | src/openvr/__init__.py | IVRSystem.getProjectionRaw | def getProjectionRaw(self, eEye):
"""
The components necessary to build your own projection matrix in case your
application is doing something fancy like infinite Z
"""
fn = self.function_table.getProjectionRaw
pfLeft = c_float()
pfRight = c_float()
pfTop... | python | def getProjectionRaw(self, eEye):
"""
The components necessary to build your own projection matrix in case your
application is doing something fancy like infinite Z
"""
fn = self.function_table.getProjectionRaw
pfLeft = c_float()
pfRight = c_float()
pfTop... | [
"def",
"getProjectionRaw",
"(",
"self",
",",
"eEye",
")",
":",
"fn",
"=",
"self",
".",
"function_table",
".",
"getProjectionRaw",
"pfLeft",
"=",
"c_float",
"(",
")",
"pfRight",
"=",
"c_float",
"(",
")",
"pfTop",
"=",
"c_float",
"(",
")",
"pfBottom",
"=",... | The components necessary to build your own projection matrix in case your
application is doing something fancy like infinite Z | [
"The",
"components",
"necessary",
"to",
"build",
"your",
"own",
"projection",
"matrix",
"in",
"case",
"your",
"application",
"is",
"doing",
"something",
"fancy",
"like",
"infinite",
"Z"
] | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/__init__.py#L2644-L2656 | train |
cmbruns/pyopenvr | src/openvr/__init__.py | IVRSystem.computeDistortion | def computeDistortion(self, eEye, fU, fV):
"""
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, ... | python | def computeDistortion(self, eEye, fU, fV):
"""
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, ... | [
"def",
"computeDistortion",
"(",
"self",
",",
"eEye",
",",
"fU",
",",
"fV",
")",
":",
"fn",
"=",
"self",
".",
"function_table",
".",
"computeDistortion",
"pDistortionCoordinates",
"=",
"DistortionCoordinates_t",
"(",
")",
"result",
"=",
"fn",
"(",
"eEye",
",... | 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. | [
"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",
"t... | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/__init__.py#L2658-L2668 | train |
cmbruns/pyopenvr | src/openvr/__init__.py | IVRSystem.getTimeSinceLastVsync | def getTimeSinceLastVsync(self):
"""
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... | python | def getTimeSinceLastVsync(self):
"""
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... | [
"def",
"getTimeSinceLastVsync",
"(",
"self",
")",
":",
"fn",
"=",
"self",
".",
"function_table",
".",
"getTimeSinceLastVsync",
"pfSecondsSinceLastVsync",
"=",
"c_float",
"(",
")",
"pulFrameCounter",
"=",
"c_uint64",
"(",
")",
"result",
"=",
"fn",
"(",
"byref",
... | 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... | [
"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",
"... | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/__init__.py#L2681-L2693 | train |
cmbruns/pyopenvr | src/openvr/__init__.py | IVRSystem.getTrackedDeviceActivityLevel | def getTrackedDeviceActivityLevel(self, unDeviceId):
"""Returns the level of activity on the device."""
fn = self.function_table.getTrackedDeviceActivityLevel
result = fn(unDeviceId)
return result | python | def getTrackedDeviceActivityLevel(self, unDeviceId):
"""Returns the level of activity on the device."""
fn = self.function_table.getTrackedDeviceActivityLevel
result = fn(unDeviceId)
return result | [
"def",
"getTrackedDeviceActivityLevel",
"(",
"self",
",",
"unDeviceId",
")",
":",
"fn",
"=",
"self",
".",
"function_table",
".",
"getTrackedDeviceActivityLevel",
"result",
"=",
"fn",
"(",
"unDeviceId",
")",
"return",
"result"
] | Returns the level of activity on the device. | [
"Returns",
"the",
"level",
"of",
"activity",
"on",
"the",
"device",
"."
] | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/__init__.py#L2835-L2840 | train |
cmbruns/pyopenvr | src/openvr/__init__.py | IVRSystem.applyTransform | def applyTransform(self):
"""
Convenience utility to apply the specified transform to the specified pose.
This properly transforms all pose components, including velocity and angular velocity
"""
fn = self.function_table.applyTransform
pOutputPose = TrackedDevicePose_t... | python | def applyTransform(self):
"""
Convenience utility to apply the specified transform to the specified pose.
This properly transforms all pose components, including velocity and angular velocity
"""
fn = self.function_table.applyTransform
pOutputPose = TrackedDevicePose_t... | [
"def",
"applyTransform",
"(",
"self",
")",
":",
"fn",
"=",
"self",
".",
"function_table",
".",
"applyTransform",
"pOutputPose",
"=",
"TrackedDevicePose_t",
"(",
")",
"pTrackedDevicePose",
"=",
"TrackedDevicePose_t",
"(",
")",
"pTransform",
"=",
"HmdMatrix34_t",
"(... | Convenience utility to apply the specified transform to the specified pose.
This properly transforms all pose components, including velocity and angular velocity | [
"Convenience",
"utility",
"to",
"apply",
"the",
"specified",
"transform",
"to",
"the",
"specified",
"pose",
".",
"This",
"properly",
"transforms",
"all",
"pose",
"components",
"including",
"velocity",
"and",
"angular",
"velocity"
] | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/__init__.py#L2842-L2853 | train |
cmbruns/pyopenvr | src/openvr/__init__.py | IVRSystem.getTrackedDeviceIndexForControllerRole | def getTrackedDeviceIndexForControllerRole(self, unDeviceType):
"""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."""
fn = self.function_table.getTrackedDeviceIndexForControllerRole
... | python | def getTrackedDeviceIndexForControllerRole(self, unDeviceType):
"""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."""
fn = self.function_table.getTrackedDeviceIndexForControllerRole
... | [
"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. | [
"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",
... | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/__init__.py#L2855-L2860 | train |
cmbruns/pyopenvr | src/openvr/__init__.py | IVRSystem.getControllerRoleForTrackedDeviceIndex | def getControllerRoleForTrackedDeviceIndex(self, unDeviceIndex):
"""Returns the controller type associated with a device index. This function is deprecated in favor of the new IVRInput system."""
fn = self.function_table.getControllerRoleForTrackedDeviceIndex
result = fn(unDeviceIndex)
... | python | def getControllerRoleForTrackedDeviceIndex(self, unDeviceIndex):
"""Returns the controller type associated with a device index. This function is deprecated in favor of the new IVRInput system."""
fn = self.function_table.getControllerRoleForTrackedDeviceIndex
result = fn(unDeviceIndex)
... | [
"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. | [
"Returns",
"the",
"controller",
"type",
"associated",
"with",
"a",
"device",
"index",
".",
"This",
"function",
"is",
"deprecated",
"in",
"favor",
"of",
"the",
"new",
"IVRInput",
"system",
"."
] | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/__init__.py#L2862-L2867 | train |
cmbruns/pyopenvr | src/openvr/__init__.py | IVRSystem.isTrackedDeviceConnected | def isTrackedDeviceConnected(self, unDeviceIndex):
"""Returns true if there is a device connected in this slot."""
fn = self.function_table.isTrackedDeviceConnected
result = fn(unDeviceIndex)
return result | python | def isTrackedDeviceConnected(self, unDeviceIndex):
"""Returns true if there is a device connected in this slot."""
fn = self.function_table.isTrackedDeviceConnected
result = fn(unDeviceIndex)
return result | [
"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. | [
"Returns",
"true",
"if",
"there",
"is",
"a",
"device",
"connected",
"in",
"this",
"slot",
"."
] | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/__init__.py#L2883-L2888 | train |
cmbruns/pyopenvr | src/openvr/__init__.py | IVRSystem.getBoolTrackedDeviceProperty | def getBoolTrackedDeviceProperty(self, unDeviceIndex, prop):
"""Returns a bool property. If the device index is not valid or the property is not a bool type this function will return false."""
fn = self.function_table.getBoolTrackedDeviceProperty
pError = ETrackedPropertyError()
result ... | python | def getBoolTrackedDeviceProperty(self, unDeviceIndex, prop):
"""Returns a bool property. If the device index is not valid or the property is not a bool type this function will return false."""
fn = self.function_table.getBoolTrackedDeviceProperty
pError = ETrackedPropertyError()
result ... | [
"def",
"getBoolTrackedDeviceProperty",
"(",
"self",
",",
"unDeviceIndex",
",",
"prop",
")",
":",
"fn",
"=",
"self",
".",
"function_table",
".",
"getBoolTrackedDeviceProperty",
"pError",
"=",
"ETrackedPropertyError",
"(",
")",
"result",
"=",
"fn",
"(",
"unDeviceInd... | Returns a bool property. If the device index is not valid or the property is not a bool type this function will return false. | [
"Returns",
"a",
"bool",
"property",
".",
"If",
"the",
"device",
"index",
"is",
"not",
"valid",
"or",
"the",
"property",
"is",
"not",
"a",
"bool",
"type",
"this",
"function",
"will",
"return",
"false",
"."
] | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/__init__.py#L2890-L2896 | train |
cmbruns/pyopenvr | src/openvr/__init__.py | IVRSystem.getArrayTrackedDeviceProperty | def getArrayTrackedDeviceProperty(self, unDeviceIndex, prop, propType, pBuffer, unBufferSize):
"""
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... | python | def getArrayTrackedDeviceProperty(self, unDeviceIndex, prop, propType, pBuffer, unBufferSize):
"""
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... | [
"def",
"getArrayTrackedDeviceProperty",
"(",
"self",
",",
"unDeviceIndex",
",",
"prop",
",",
"propType",
",",
"pBuffer",
",",
"unBufferSize",
")",
":",
"fn",
"=",
"self",
".",
"function_table",
".",
"getArrayTrackedDeviceProperty",
"pError",
"=",
"ETrackedPropertyEr... | 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 returne... | [
"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",
"fu... | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/__init__.py#L2930-L2940 | train |
cmbruns/pyopenvr | src/openvr/__init__.py | IVRSystem.getStringTrackedDeviceProperty | def getStringTrackedDeviceProperty(self, unDeviceIndex, prop):
"""
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 tra... | python | def getStringTrackedDeviceProperty(self, unDeviceIndex, prop):
"""
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 tra... | [
"def",
"getStringTrackedDeviceProperty",
"(",
"self",
",",
"unDeviceIndex",
",",
"prop",
")",
":",
"fn",
"=",
"self",
".",
"function_table",
".",
"getStringTrackedDeviceProperty",
"pError",
"=",
"ETrackedPropertyError",
"(",
")",
"# TODO: automate this string argument man... | 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... | [
"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",
"... | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/__init__.py#L2942-L2960 | train |
cmbruns/pyopenvr | src/openvr/__init__.py | IVRSystem.getPropErrorNameFromEnum | def getPropErrorNameFromEnum(self, error):
"""
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
"""
fn = self.function_table.getPropErrorNameFromEnum
result = fn(error)
... | python | def getPropErrorNameFromEnum(self, error):
"""
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
"""
fn = self.function_table.getPropErrorNameFromEnum
result = fn(error)
... | [
"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 | [
"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"
] | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/__init__.py#L2962-L2970 | train |
cmbruns/pyopenvr | src/openvr/__init__.py | IVRSystem.pollNextEvent | def pollNextEvent(self, pEvent):
"""
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
"""
fn = self.function_table.pollNextEvent
... | python | def pollNextEvent(self, pEvent):
"""
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
"""
fn = self.function_table.pollNextEvent
... | [
"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 | [
"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... | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/__init__.py#L2972-L2980 | train |
cmbruns/pyopenvr | src/openvr/__init__.py | IVRSystem.pollNextEventWithPose | def pollNextEventWithPose(self, eOrigin, uncbVREvent):
"""
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 ... | python | def pollNextEventWithPose(self, eOrigin, uncbVREvent):
"""
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 ... | [
"def",
"pollNextEventWithPose",
"(",
"self",
",",
"eOrigin",
",",
"uncbVREvent",
")",
":",
"fn",
"=",
"self",
".",
"function_table",
".",
"pollNextEventWithPose",
"pEvent",
"=",
"VREvent_t",
"(",
")",
"pTrackedDevicePose",
"=",
"TrackedDevicePose_t",
"(",
")",
"... | 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 re... | [
"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... | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/__init__.py#L2982-L2994 | train |
cmbruns/pyopenvr | src/openvr/__init__.py | IVRSystem.getEventTypeNameFromEnum | def getEventTypeNameFromEnum(self, eType):
"""returns the name of an EVREvent enum value"""
fn = self.function_table.getEventTypeNameFromEnum
result = fn(eType)
return result | python | def getEventTypeNameFromEnum(self, eType):
"""returns the name of an EVREvent enum value"""
fn = self.function_table.getEventTypeNameFromEnum
result = fn(eType)
return result | [
"def",
"getEventTypeNameFromEnum",
"(",
"self",
",",
"eType",
")",
":",
"fn",
"=",
"self",
".",
"function_table",
".",
"getEventTypeNameFromEnum",
"result",
"=",
"fn",
"(",
"eType",
")",
"return",
"result"
] | returns the name of an EVREvent enum value | [
"returns",
"the",
"name",
"of",
"an",
"EVREvent",
"enum",
"value"
] | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/__init__.py#L2996-L3001 | train |
cmbruns/pyopenvr | src/openvr/__init__.py | IVRSystem.getControllerState | def getControllerState(self, unControllerDeviceIndex, unControllerStateSize=sizeof(VRControllerState_t)):
"""
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.
... | python | def getControllerState(self, unControllerDeviceIndex, unControllerStateSize=sizeof(VRControllerState_t)):
"""
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.
... | [
"def",
"getControllerState",
"(",
"self",
",",
"unControllerDeviceIndex",
",",
"unControllerStateSize",
"=",
"sizeof",
"(",
"VRControllerState_t",
")",
")",
":",
"fn",
"=",
"self",
".",
"function_table",
".",
"getControllerState",
"pControllerState",
"=",
"VRControlle... | 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. | [
"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",
... | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/__init__.py#L3018-L3027 | train |
cmbruns/pyopenvr | src/openvr/__init__.py | IVRSystem.getControllerStateWithPose | def getControllerStateWithPose(self, eOrigin, unControllerDeviceIndex, unControllerStateSize=sizeof(VRControllerState_t)):
"""
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 rece... | python | def getControllerStateWithPose(self, eOrigin, unControllerDeviceIndex, unControllerStateSize=sizeof(VRControllerState_t)):
"""
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 rece... | [
"def",
"getControllerStateWithPose",
"(",
"self",
",",
"eOrigin",
",",
"unControllerDeviceIndex",
",",
"unControllerStateSize",
"=",
"sizeof",
"(",
"VRControllerState_t",
")",
")",
":",
"fn",
"=",
"self",
".",
"function_table",
".",
"getControllerStateWithPose",
"pCon... | 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... | [
"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",
... | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/__init__.py#L3029-L3040 | train |
cmbruns/pyopenvr | src/openvr/__init__.py | IVRSystem.triggerHapticPulse | def triggerHapticPulse(self, 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 th... | python | def triggerHapticPulse(self, 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 th... | [
"def",
"triggerHapticPulse",
"(",
"self",
",",
"unControllerDeviceIndex",
",",
"unAxisId",
",",
"usDurationMicroSec",
")",
":",
"fn",
"=",
"self",
".",
"function_table",
".",
"triggerHapticPulse",
"fn",
"(",
"unControllerDeviceIndex",
",",
"unAxisId",
",",
"usDurati... | 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. | [
"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",
".",
"Thi... | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/__init__.py#L3042-L3049 | train |
cmbruns/pyopenvr | src/openvr/__init__.py | IVRSystem.getButtonIdNameFromEnum | def getButtonIdNameFromEnum(self, eButtonId):
"""returns the name of an EVRButtonId enum value. This function is deprecated in favor of the new IVRInput system."""
fn = self.function_table.getButtonIdNameFromEnum
result = fn(eButtonId)
return result | python | def getButtonIdNameFromEnum(self, eButtonId):
"""returns the name of an EVRButtonId enum value. This function is deprecated in favor of the new IVRInput system."""
fn = self.function_table.getButtonIdNameFromEnum
result = fn(eButtonId)
return result | [
"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. | [
"returns",
"the",
"name",
"of",
"an",
"EVRButtonId",
"enum",
"value",
".",
"This",
"function",
"is",
"deprecated",
"in",
"favor",
"of",
"the",
"new",
"IVRInput",
"system",
"."
] | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/__init__.py#L3051-L3056 | train |
cmbruns/pyopenvr | src/openvr/__init__.py | IVRSystem.getControllerAxisTypeNameFromEnum | def getControllerAxisTypeNameFromEnum(self, eAxisType):
"""returns the name of an EVRControllerAxisType enum value. This function is deprecated in favor of the new IVRInput system."""
fn = self.function_table.getControllerAxisTypeNameFromEnum
result = fn(eAxisType)
return result | python | def getControllerAxisTypeNameFromEnum(self, eAxisType):
"""returns the name of an EVRControllerAxisType enum value. This function is deprecated in favor of the new IVRInput system."""
fn = self.function_table.getControllerAxisTypeNameFromEnum
result = fn(eAxisType)
return result | [
"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. | [
"returns",
"the",
"name",
"of",
"an",
"EVRControllerAxisType",
"enum",
"value",
".",
"This",
"function",
"is",
"deprecated",
"in",
"favor",
"of",
"the",
"new",
"IVRInput",
"system",
"."
] | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/__init__.py#L3058-L3063 | train |
cmbruns/pyopenvr | src/openvr/__init__.py | IVRSystem.driverDebugRequest | def driverDebugRequest(self, unDeviceIndex, pchRequest, pchResponseBuffer, unResponseBufferSize):
"""
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 th... | python | def driverDebugRequest(self, unDeviceIndex, pchRequest, pchResponseBuffer, unResponseBufferSize):
"""
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 th... | [
"def",
"driverDebugRequest",
"(",
"self",
",",
"unDeviceIndex",
",",
"pchRequest",
",",
"pchResponseBuffer",
",",
"unResponseBufferSize",
")",
":",
"fn",
"=",
"self",
".",
"function_table",
".",
"driverDebugRequest",
"result",
"=",
"fn",
"(",
"unDeviceIndex",
",",... | 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. | [
"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",
"buffe... | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/__init__.py#L3105-L3114 | train |
cmbruns/pyopenvr | src/openvr/__init__.py | IVRExtendedDisplay.getWindowBounds | def getWindowBounds(self):
"""Size and position that the window needs to be on the VR display."""
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(... | python | def getWindowBounds(self):
"""Size and position that the window needs to be on the VR display."""
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(... | [
"def",
"getWindowBounds",
"(",
"self",
")",
":",
"fn",
"=",
"self",
".",
"function_table",
".",
"getWindowBounds",
"pnX",
"=",
"c_int32",
"(",
")",
"pnY",
"=",
"c_int32",
"(",
")",
"pnWidth",
"=",
"c_uint32",
"(",
")",
"pnHeight",
"=",
"c_uint32",
"(",
... | Size and position that the window needs to be on the VR display. | [
"Size",
"and",
"position",
"that",
"the",
"window",
"needs",
"to",
"be",
"on",
"the",
"VR",
"display",
"."
] | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/__init__.py#L3176-L3185 | train |
cmbruns/pyopenvr | src/openvr/__init__.py | IVRExtendedDisplay.getEyeOutputViewport | def getEyeOutputViewport(self, eEye):
"""Gets the viewport in the frame buffer to draw the output of the distortion into"""
fn = self.function_table.getEyeOutputViewport
pnX = c_uint32()
pnY = c_uint32()
pnWidth = c_uint32()
pnHeight = c_uint32()
fn(eEye, byref(p... | python | def getEyeOutputViewport(self, eEye):
"""Gets the viewport in the frame buffer to draw the output of the distortion into"""
fn = self.function_table.getEyeOutputViewport
pnX = c_uint32()
pnY = c_uint32()
pnWidth = c_uint32()
pnHeight = c_uint32()
fn(eEye, byref(p... | [
"def",
"getEyeOutputViewport",
"(",
"self",
",",
"eEye",
")",
":",
"fn",
"=",
"self",
".",
"function_table",
".",
"getEyeOutputViewport",
"pnX",
"=",
"c_uint32",
"(",
")",
"pnY",
"=",
"c_uint32",
"(",
")",
"pnWidth",
"=",
"c_uint32",
"(",
")",
"pnHeight",
... | Gets the viewport in the frame buffer to draw the output of the distortion into | [
"Gets",
"the",
"viewport",
"in",
"the",
"frame",
"buffer",
"to",
"draw",
"the",
"output",
"of",
"the",
"distortion",
"into"
] | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/__init__.py#L3187-L3196 | train |
cmbruns/pyopenvr | src/openvr/__init__.py | IVRTrackedCamera.getCameraErrorNameFromEnum | def getCameraErrorNameFromEnum(self, eCameraError):
"""Returns a string for an error"""
fn = self.function_table.getCameraErrorNameFromEnum
result = fn(eCameraError)
return result | python | def getCameraErrorNameFromEnum(self, eCameraError):
"""Returns a string for an error"""
fn = self.function_table.getCameraErrorNameFromEnum
result = fn(eCameraError)
return result | [
"def",
"getCameraErrorNameFromEnum",
"(",
"self",
",",
"eCameraError",
")",
":",
"fn",
"=",
"self",
".",
"function_table",
".",
"getCameraErrorNameFromEnum",
"result",
"=",
"fn",
"(",
"eCameraError",
")",
"return",
"result"
] | Returns a string for an error | [
"Returns",
"a",
"string",
"for",
"an",
"error"
] | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/__init__.py#L3243-L3248 | train |
cmbruns/pyopenvr | src/openvr/__init__.py | IVRTrackedCamera.hasCamera | def hasCamera(self, nDeviceIndex):
"""For convenience, same as tracked property request Prop_HasCamera_Bool"""
fn = self.function_table.hasCamera
pHasCamera = openvr_bool()
result = fn(nDeviceIndex, byref(pHasCamera))
return result, pHasCamera | python | def hasCamera(self, nDeviceIndex):
"""For convenience, same as tracked property request Prop_HasCamera_Bool"""
fn = self.function_table.hasCamera
pHasCamera = openvr_bool()
result = fn(nDeviceIndex, byref(pHasCamera))
return result, pHasCamera | [
"def",
"hasCamera",
"(",
"self",
",",
"nDeviceIndex",
")",
":",
"fn",
"=",
"self",
".",
"function_table",
".",
"hasCamera",
"pHasCamera",
"=",
"openvr_bool",
"(",
")",
"result",
"=",
"fn",
"(",
"nDeviceIndex",
",",
"byref",
"(",
"pHasCamera",
")",
")",
"... | For convenience, same as tracked property request Prop_HasCamera_Bool | [
"For",
"convenience",
"same",
"as",
"tracked",
"property",
"request",
"Prop_HasCamera_Bool"
] | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/__init__.py#L3250-L3256 | train |
cmbruns/pyopenvr | src/openvr/__init__.py | IVRTrackedCamera.acquireVideoStreamingService | def acquireVideoStreamingService(self, nDeviceIndex):
"""
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 so... | python | def acquireVideoStreamingService(self, nDeviceIndex):
"""
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 so... | [
"def",
"acquireVideoStreamingService",
"(",
"self",
",",
"nDeviceIndex",
")",
":",
"fn",
"=",
"self",
".",
"function_table",
".",
"acquireVideoStreamingService",
"pHandle",
"=",
"TrackedCameraHandle_t",
"(",
")",
"result",
"=",
"fn",
"(",
"nDeviceIndex",
",",
"byr... | 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 ca... | [
"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",
"... | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/__init__.py#L3281-L3292 | train |
cmbruns/pyopenvr | src/openvr/__init__.py | IVRTrackedCamera.getVideoStreamFrameBuffer | def getVideoStreamFrameBuffer(self, hTrackedCamera, eFrameType, pFrameBuffer, nFrameBufferSize, nFrameHeaderSize):
"""
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 fr... | python | def getVideoStreamFrameBuffer(self, hTrackedCamera, eFrameType, pFrameBuffer, nFrameBufferSize, nFrameHeaderSize):
"""
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 fr... | [
"def",
"getVideoStreamFrameBuffer",
"(",
"self",
",",
"hTrackedCamera",
",",
"eFrameType",
",",
"pFrameBuffer",
",",
"nFrameBufferSize",
",",
"nFrameHeaderSize",
")",
":",
"fn",
"=",
"self",
".",
"function_table",
".",
"getVideoStreamFrameBuffer",
"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... | [
"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... | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/__init__.py#L3299-L3311 | train |
cmbruns/pyopenvr | src/openvr/__init__.py | IVRTrackedCamera.getVideoStreamTextureGL | def getVideoStreamTextureGL(self, hTrackedCamera, eFrameType, nFrameHeaderSize):
"""Access a shared GL texture for the specified tracked camera stream"""
fn = self.function_table.getVideoStreamTextureGL
pglTextureId = glUInt_t()
pFrameHeader = CameraVideoStreamFrameHeader_t()
re... | python | def getVideoStreamTextureGL(self, hTrackedCamera, eFrameType, nFrameHeaderSize):
"""Access a shared GL texture for the specified tracked camera stream"""
fn = self.function_table.getVideoStreamTextureGL
pglTextureId = glUInt_t()
pFrameHeader = CameraVideoStreamFrameHeader_t()
re... | [
"def",
"getVideoStreamTextureGL",
"(",
"self",
",",
"hTrackedCamera",
",",
"eFrameType",
",",
"nFrameHeaderSize",
")",
":",
"fn",
"=",
"self",
".",
"function_table",
".",
"getVideoStreamTextureGL",
"pglTextureId",
"=",
"glUInt_t",
"(",
")",
"pFrameHeader",
"=",
"C... | Access a shared GL texture for the specified tracked camera stream | [
"Access",
"a",
"shared",
"GL",
"texture",
"for",
"the",
"specified",
"tracked",
"camera",
"stream"
] | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/__init__.py#L3339-L3346 | train |
cmbruns/pyopenvr | src/openvr/__init__.py | IVRApplications.addApplicationManifest | def addApplicationManifest(self, pchApplicationManifestFullPath, bTemporary):
"""
Adds an application manifest to the list to load when building the list of installed applications.
Temporary manifests are not automatically loaded
"""
fn = self.function_table.addApplicationManif... | python | def addApplicationManifest(self, pchApplicationManifestFullPath, bTemporary):
"""
Adds an application manifest to the list to load when building the list of installed applications.
Temporary manifests are not automatically loaded
"""
fn = self.function_table.addApplicationManif... | [
"def",
"addApplicationManifest",
"(",
"self",
",",
"pchApplicationManifestFullPath",
",",
"bTemporary",
")",
":",
"fn",
"=",
"self",
".",
"function_table",
".",
"addApplicationManifest",
"result",
"=",
"fn",
"(",
"pchApplicationManifestFullPath",
",",
"bTemporary",
")... | Adds an application manifest to the list to load when building the list of installed applications.
Temporary manifests are not automatically loaded | [
"Adds",
"an",
"application",
"manifest",
"to",
"the",
"list",
"to",
"load",
"when",
"building",
"the",
"list",
"of",
"installed",
"applications",
".",
"Temporary",
"manifests",
"are",
"not",
"automatically",
"loaded"
] | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/__init__.py#L3404-L3412 | train |
cmbruns/pyopenvr | src/openvr/__init__.py | IVRApplications.removeApplicationManifest | def removeApplicationManifest(self, pchApplicationManifestFullPath):
"""Removes an application manifest from the list to load when building the list of installed applications."""
fn = self.function_table.removeApplicationManifest
result = fn(pchApplicationManifestFullPath)
return result | python | def removeApplicationManifest(self, pchApplicationManifestFullPath):
"""Removes an application manifest from the list to load when building the list of installed applications."""
fn = self.function_table.removeApplicationManifest
result = fn(pchApplicationManifestFullPath)
return result | [
"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. | [
"Removes",
"an",
"application",
"manifest",
"from",
"the",
"list",
"to",
"load",
"when",
"building",
"the",
"list",
"of",
"installed",
"applications",
"."
] | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/__init__.py#L3414-L3419 | train |
cmbruns/pyopenvr | src/openvr/__init__.py | IVRApplications.isApplicationInstalled | def isApplicationInstalled(self, pchAppKey):
"""Returns true if an application is installed"""
fn = self.function_table.isApplicationInstalled
result = fn(pchAppKey)
return result | python | def isApplicationInstalled(self, pchAppKey):
"""Returns true if an application is installed"""
fn = self.function_table.isApplicationInstalled
result = fn(pchAppKey)
return result | [
"def",
"isApplicationInstalled",
"(",
"self",
",",
"pchAppKey",
")",
":",
"fn",
"=",
"self",
".",
"function_table",
".",
"isApplicationInstalled",
"result",
"=",
"fn",
"(",
"pchAppKey",
")",
"return",
"result"
] | Returns true if an application is installed | [
"Returns",
"true",
"if",
"an",
"application",
"is",
"installed"
] | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/__init__.py#L3421-L3426 | train |
cmbruns/pyopenvr | src/openvr/__init__.py | IVRApplications.getApplicationKeyByProcessId | def getApplicationKeyByProcessId(self, unProcessId, pchAppKeyBuffer, unAppKeyBufferLen):
"""
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.
"""
fn = self.function_table.getAppli... | python | def getApplicationKeyByProcessId(self, unProcessId, pchAppKeyBuffer, unAppKeyBufferLen):
"""
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.
"""
fn = self.function_table.getAppli... | [
"def",
"getApplicationKeyByProcessId",
"(",
"self",
",",
"unProcessId",
",",
"pchAppKeyBuffer",
",",
"unAppKeyBufferLen",
")",
":",
"fn",
"=",
"self",
".",
"function_table",
".",
"getApplicationKeyByProcessId",
"result",
"=",
"fn",
"(",
"unProcessId",
",",
"pchAppKe... | 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. | [
"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",
"."
] | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/__init__.py#L3446-L3454 | train |
cmbruns/pyopenvr | src/openvr/__init__.py | IVRApplications.launchApplication | def launchApplication(self, pchAppKey):
"""
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.
"""
fn = self.function_table.launchApplication
result = fn(p... | python | def launchApplication(self, pchAppKey):
"""
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.
"""
fn = self.function_table.launchApplication
result = fn(p... | [
"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. | [
"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",
"."
] | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/__init__.py#L3456-L3464 | train |
cmbruns/pyopenvr | src/openvr/__init__.py | IVRApplications.launchApplicationFromMimeType | def launchApplicationFromMimeType(self, pchMimeType, pchArgs):
"""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"""
fn = self.function_table.launchApplicationFromMimeType
result = ... | python | def launchApplicationFromMimeType(self, pchMimeType, pchArgs):
"""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"""
fn = self.function_table.launchApplicationFromMimeType
result = ... | [
"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 | [
"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"
] | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/__init__.py#L3477-L3482 | train |
cmbruns/pyopenvr | src/openvr/__init__.py | IVRApplications.launchDashboardOverlay | def launchDashboardOverlay(self, pchAppKey):
"""
Launches the dashboard overlay application if it is not already running. This call is only valid for
dashboard overlay applications.
"""
fn = self.function_table.launchDashboardOverlay
result = fn(pchAppKey)
retur... | python | def launchDashboardOverlay(self, pchAppKey):
"""
Launches the dashboard overlay application if it is not already running. This call is only valid for
dashboard overlay applications.
"""
fn = self.function_table.launchDashboardOverlay
result = fn(pchAppKey)
retur... | [
"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. | [
"Launches",
"the",
"dashboard",
"overlay",
"application",
"if",
"it",
"is",
"not",
"already",
"running",
".",
"This",
"call",
"is",
"only",
"valid",
"for",
"dashboard",
"overlay",
"applications",
"."
] | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/__init__.py#L3484-L3492 | train |
cmbruns/pyopenvr | src/openvr/__init__.py | IVRApplications.cancelApplicationLaunch | def cancelApplicationLaunch(self, pchAppKey):
"""Cancel a pending launch for an application"""
fn = self.function_table.cancelApplicationLaunch
result = fn(pchAppKey)
return result | python | def cancelApplicationLaunch(self, pchAppKey):
"""Cancel a pending launch for an application"""
fn = self.function_table.cancelApplicationLaunch
result = fn(pchAppKey)
return result | [
"def",
"cancelApplicationLaunch",
"(",
"self",
",",
"pchAppKey",
")",
":",
"fn",
"=",
"self",
".",
"function_table",
".",
"cancelApplicationLaunch",
"result",
"=",
"fn",
"(",
"pchAppKey",
")",
"return",
"result"
] | Cancel a pending launch for an application | [
"Cancel",
"a",
"pending",
"launch",
"for",
"an",
"application"
] | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/__init__.py#L3494-L3499 | train |
cmbruns/pyopenvr | src/openvr/__init__.py | IVRApplications.getApplicationProcessId | def getApplicationProcessId(self, pchAppKey):
"""Returns the process ID for an application. Return 0 if the application was not found or is not running."""
fn = self.function_table.getApplicationProcessId
result = fn(pchAppKey)
return result | python | def getApplicationProcessId(self, pchAppKey):
"""Returns the process ID for an application. Return 0 if the application was not found or is not running."""
fn = self.function_table.getApplicationProcessId
result = fn(pchAppKey)
return result | [
"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. | [
"Returns",
"the",
"process",
"ID",
"for",
"an",
"application",
".",
"Return",
"0",
"if",
"the",
"application",
"was",
"not",
"found",
"or",
"is",
"not",
"running",
"."
] | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/__init__.py#L3513-L3518 | train |
cmbruns/pyopenvr | src/openvr/__init__.py | IVRApplications.getApplicationsErrorNameFromEnum | def getApplicationsErrorNameFromEnum(self, error):
"""Returns a string for an applications error"""
fn = self.function_table.getApplicationsErrorNameFromEnum
result = fn(error)
return result | python | def getApplicationsErrorNameFromEnum(self, error):
"""Returns a string for an applications error"""
fn = self.function_table.getApplicationsErrorNameFromEnum
result = fn(error)
return result | [
"def",
"getApplicationsErrorNameFromEnum",
"(",
"self",
",",
"error",
")",
":",
"fn",
"=",
"self",
".",
"function_table",
".",
"getApplicationsErrorNameFromEnum",
"result",
"=",
"fn",
"(",
"error",
")",
"return",
"result"
] | Returns a string for an applications error | [
"Returns",
"a",
"string",
"for",
"an",
"applications",
"error"
] | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/__init__.py#L3520-L3525 | train |
cmbruns/pyopenvr | src/openvr/__init__.py | IVRApplications.getApplicationPropertyString | def getApplicationPropertyString(self, pchAppKey, eProperty, pchPropertyValueBuffer, unPropertyValueBufferLen):
"""Returns a value for an application property. The required buffer size to fit this value will be returned."""
fn = self.function_table.getApplicationPropertyString
peError = EVRAppl... | python | def getApplicationPropertyString(self, pchAppKey, eProperty, pchPropertyValueBuffer, unPropertyValueBufferLen):
"""Returns a value for an application property. The required buffer size to fit this value will be returned."""
fn = self.function_table.getApplicationPropertyString
peError = EVRAppl... | [
"def",
"getApplicationPropertyString",
"(",
"self",
",",
"pchAppKey",
",",
"eProperty",
",",
"pchPropertyValueBuffer",
",",
"unPropertyValueBufferLen",
")",
":",
"fn",
"=",
"self",
".",
"function_table",
".",
"getApplicationPropertyString",
"peError",
"=",
"EVRApplicati... | Returns a value for an application property. The required buffer size to fit this value will be returned. | [
"Returns",
"a",
"value",
"for",
"an",
"application",
"property",
".",
"The",
"required",
"buffer",
"size",
"to",
"fit",
"this",
"value",
"will",
"be",
"returned",
"."
] | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/__init__.py#L3527-L3533 | train |
cmbruns/pyopenvr | src/openvr/__init__.py | IVRApplications.getApplicationPropertyBool | def getApplicationPropertyBool(self, pchAppKey, eProperty):
"""Returns a bool value for an application property. Returns false in all error cases."""
fn = self.function_table.getApplicationPropertyBool
peError = EVRApplicationError()
result = fn(pchAppKey, eProperty, byref(peError))
... | python | def getApplicationPropertyBool(self, pchAppKey, eProperty):
"""Returns a bool value for an application property. Returns false in all error cases."""
fn = self.function_table.getApplicationPropertyBool
peError = EVRApplicationError()
result = fn(pchAppKey, eProperty, byref(peError))
... | [
"def",
"getApplicationPropertyBool",
"(",
"self",
",",
"pchAppKey",
",",
"eProperty",
")",
":",
"fn",
"=",
"self",
".",
"function_table",
".",
"getApplicationPropertyBool",
"peError",
"=",
"EVRApplicationError",
"(",
")",
"result",
"=",
"fn",
"(",
"pchAppKey",
"... | Returns a bool value for an application property. Returns false in all error cases. | [
"Returns",
"a",
"bool",
"value",
"for",
"an",
"application",
"property",
".",
"Returns",
"false",
"in",
"all",
"error",
"cases",
"."
] | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/__init__.py#L3535-L3541 | train |
cmbruns/pyopenvr | src/openvr/__init__.py | IVRApplications.setApplicationAutoLaunch | def setApplicationAutoLaunch(self, pchAppKey, bAutoLaunch):
"""Sets the application auto-launch flag. This is only valid for applications which return true for VRApplicationProperty_IsDashboardOverlay_Bool."""
fn = self.function_table.setApplicationAutoLaunch
result = fn(pchAppKey, bAutoLaunch)... | python | def setApplicationAutoLaunch(self, pchAppKey, bAutoLaunch):
"""Sets the application auto-launch flag. This is only valid for applications which return true for VRApplicationProperty_IsDashboardOverlay_Bool."""
fn = self.function_table.setApplicationAutoLaunch
result = fn(pchAppKey, bAutoLaunch)... | [
"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. | [
"Sets",
"the",
"application",
"auto",
"-",
"launch",
"flag",
".",
"This",
"is",
"only",
"valid",
"for",
"applications",
"which",
"return",
"true",
"for",
"VRApplicationProperty_IsDashboardOverlay_Bool",
"."
] | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/__init__.py#L3551-L3556 | train |
cmbruns/pyopenvr | src/openvr/__init__.py | IVRApplications.getApplicationAutoLaunch | def getApplicationAutoLaunch(self, pchAppKey):
"""Gets the application auto-launch flag. This is only valid for applications which return true for VRApplicationProperty_IsDashboardOverlay_Bool."""
fn = self.function_table.getApplicationAutoLaunch
result = fn(pchAppKey)
return result | python | def getApplicationAutoLaunch(self, pchAppKey):
"""Gets the application auto-launch flag. This is only valid for applications which return true for VRApplicationProperty_IsDashboardOverlay_Bool."""
fn = self.function_table.getApplicationAutoLaunch
result = fn(pchAppKey)
return result | [
"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. | [
"Gets",
"the",
"application",
"auto",
"-",
"launch",
"flag",
".",
"This",
"is",
"only",
"valid",
"for",
"applications",
"which",
"return",
"true",
"for",
"VRApplicationProperty_IsDashboardOverlay_Bool",
"."
] | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/__init__.py#L3558-L3563 | train |
cmbruns/pyopenvr | src/openvr/__init__.py | IVRApplications.setDefaultApplicationForMimeType | def setDefaultApplicationForMimeType(self, pchAppKey, pchMimeType):
"""Adds this mime-type to the list of supported mime types for this application"""
fn = self.function_table.setDefaultApplicationForMimeType
result = fn(pchAppKey, pchMimeType)
return result | python | def setDefaultApplicationForMimeType(self, pchAppKey, pchMimeType):
"""Adds this mime-type to the list of supported mime types for this application"""
fn = self.function_table.setDefaultApplicationForMimeType
result = fn(pchAppKey, pchMimeType)
return result | [
"def",
"setDefaultApplicationForMimeType",
"(",
"self",
",",
"pchAppKey",
",",
"pchMimeType",
")",
":",
"fn",
"=",
"self",
".",
"function_table",
".",
"setDefaultApplicationForMimeType",
"result",
"=",
"fn",
"(",
"pchAppKey",
",",
"pchMimeType",
")",
"return",
"re... | Adds this mime-type to the list of supported mime types for this application | [
"Adds",
"this",
"mime",
"-",
"type",
"to",
"the",
"list",
"of",
"supported",
"mime",
"types",
"for",
"this",
"application"
] | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/__init__.py#L3565-L3570 | train |
cmbruns/pyopenvr | src/openvr/__init__.py | IVRApplications.getDefaultApplicationForMimeType | def getDefaultApplicationForMimeType(self, pchMimeType, pchAppKeyBuffer, unAppKeyBufferLen):
"""return the app key that will open this mime type"""
fn = self.function_table.getDefaultApplicationForMimeType
result = fn(pchMimeType, pchAppKeyBuffer, unAppKeyBufferLen)
return result | python | def getDefaultApplicationForMimeType(self, pchMimeType, pchAppKeyBuffer, unAppKeyBufferLen):
"""return the app key that will open this mime type"""
fn = self.function_table.getDefaultApplicationForMimeType
result = fn(pchMimeType, pchAppKeyBuffer, unAppKeyBufferLen)
return result | [
"def",
"getDefaultApplicationForMimeType",
"(",
"self",
",",
"pchMimeType",
",",
"pchAppKeyBuffer",
",",
"unAppKeyBufferLen",
")",
":",
"fn",
"=",
"self",
".",
"function_table",
".",
"getDefaultApplicationForMimeType",
"result",
"=",
"fn",
"(",
"pchMimeType",
",",
"... | return the app key that will open this mime type | [
"return",
"the",
"app",
"key",
"that",
"will",
"open",
"this",
"mime",
"type"
] | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/__init__.py#L3572-L3577 | train |
cmbruns/pyopenvr | src/openvr/__init__.py | IVRApplications.getApplicationSupportedMimeTypes | def getApplicationSupportedMimeTypes(self, pchAppKey, pchMimeTypesBuffer, unMimeTypesBuffer):
"""Get the list of supported mime types for this application, comma-delimited"""
fn = self.function_table.getApplicationSupportedMimeTypes
result = fn(pchAppKey, pchMimeTypesBuffer, unMimeTypesBuffer)
... | python | def getApplicationSupportedMimeTypes(self, pchAppKey, pchMimeTypesBuffer, unMimeTypesBuffer):
"""Get the list of supported mime types for this application, comma-delimited"""
fn = self.function_table.getApplicationSupportedMimeTypes
result = fn(pchAppKey, pchMimeTypesBuffer, unMimeTypesBuffer)
... | [
"def",
"getApplicationSupportedMimeTypes",
"(",
"self",
",",
"pchAppKey",
",",
"pchMimeTypesBuffer",
",",
"unMimeTypesBuffer",
")",
":",
"fn",
"=",
"self",
".",
"function_table",
".",
"getApplicationSupportedMimeTypes",
"result",
"=",
"fn",
"(",
"pchAppKey",
",",
"p... | Get the list of supported mime types for this application, comma-delimited | [
"Get",
"the",
"list",
"of",
"supported",
"mime",
"types",
"for",
"this",
"application",
"comma",
"-",
"delimited"
] | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/__init__.py#L3579-L3584 | train |
cmbruns/pyopenvr | src/openvr/__init__.py | IVRApplications.getApplicationsThatSupportMimeType | def getApplicationsThatSupportMimeType(self, pchMimeType, pchAppKeysThatSupportBuffer, unAppKeysThatSupportBuffer):
"""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"""
fn = self.function_table.getApplication... | python | def getApplicationsThatSupportMimeType(self, pchMimeType, pchAppKeysThatSupportBuffer, unAppKeysThatSupportBuffer):
"""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"""
fn = self.function_table.getApplication... | [
"def",
"getApplicationsThatSupportMimeType",
"(",
"self",
",",
"pchMimeType",
",",
"pchAppKeysThatSupportBuffer",
",",
"unAppKeysThatSupportBuffer",
")",
":",
"fn",
"=",
"self",
".",
"function_table",
".",
"getApplicationsThatSupportMimeType",
"result",
"=",
"fn",
"(",
... | 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 | [
"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"
] | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/__init__.py#L3586-L3591 | train |
cmbruns/pyopenvr | src/openvr/__init__.py | IVRApplications.getApplicationLaunchArguments | def getApplicationLaunchArguments(self, unHandle, pchArgs, unArgs):
"""Get the args list from an app launch that had the process already running, you call this when you get a VREvent_ApplicationMimeTypeLoad"""
fn = self.function_table.getApplicationLaunchArguments
result = fn(unHandle, pchArgs,... | python | def getApplicationLaunchArguments(self, unHandle, pchArgs, unArgs):
"""Get the args list from an app launch that had the process already running, you call this when you get a VREvent_ApplicationMimeTypeLoad"""
fn = self.function_table.getApplicationLaunchArguments
result = fn(unHandle, pchArgs,... | [
"def",
"getApplicationLaunchArguments",
"(",
"self",
",",
"unHandle",
",",
"pchArgs",
",",
"unArgs",
")",
":",
"fn",
"=",
"self",
".",
"function_table",
".",
"getApplicationLaunchArguments",
"result",
"=",
"fn",
"(",
"unHandle",
",",
"pchArgs",
",",
"unArgs",
... | Get the args list from an app launch that had the process already running, you call this when you get a VREvent_ApplicationMimeTypeLoad | [
"Get",
"the",
"args",
"list",
"from",
"an",
"app",
"launch",
"that",
"had",
"the",
"process",
"already",
"running",
"you",
"call",
"this",
"when",
"you",
"get",
"a",
"VREvent_ApplicationMimeTypeLoad"
] | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/__init__.py#L3593-L3598 | train |
cmbruns/pyopenvr | src/openvr/__init__.py | IVRApplications.getStartingApplication | def getStartingApplication(self, pchAppKeyBuffer, unAppKeyBufferLen):
"""Returns the app key for the application that is starting up"""
fn = self.function_table.getStartingApplication
result = fn(pchAppKeyBuffer, unAppKeyBufferLen)
return result | python | def getStartingApplication(self, pchAppKeyBuffer, unAppKeyBufferLen):
"""Returns the app key for the application that is starting up"""
fn = self.function_table.getStartingApplication
result = fn(pchAppKeyBuffer, unAppKeyBufferLen)
return result | [
"def",
"getStartingApplication",
"(",
"self",
",",
"pchAppKeyBuffer",
",",
"unAppKeyBufferLen",
")",
":",
"fn",
"=",
"self",
".",
"function_table",
".",
"getStartingApplication",
"result",
"=",
"fn",
"(",
"pchAppKeyBuffer",
",",
"unAppKeyBufferLen",
")",
"return",
... | Returns the app key for the application that is starting up | [
"Returns",
"the",
"app",
"key",
"for",
"the",
"application",
"that",
"is",
"starting",
"up"
] | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/__init__.py#L3600-L3605 | train |
cmbruns/pyopenvr | src/openvr/__init__.py | IVRApplications.getApplicationsTransitionStateNameFromEnum | def getApplicationsTransitionStateNameFromEnum(self, state):
"""Returns a string for an application transition state"""
fn = self.function_table.getApplicationsTransitionStateNameFromEnum
result = fn(state)
return result | python | def getApplicationsTransitionStateNameFromEnum(self, state):
"""Returns a string for an application transition state"""
fn = self.function_table.getApplicationsTransitionStateNameFromEnum
result = fn(state)
return result | [
"def",
"getApplicationsTransitionStateNameFromEnum",
"(",
"self",
",",
"state",
")",
":",
"fn",
"=",
"self",
".",
"function_table",
".",
"getApplicationsTransitionStateNameFromEnum",
"result",
"=",
"fn",
"(",
"state",
")",
"return",
"result"
] | Returns a string for an application transition state | [
"Returns",
"a",
"string",
"for",
"an",
"application",
"transition",
"state"
] | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/__init__.py#L3630-L3635 | train |
cmbruns/pyopenvr | src/openvr/__init__.py | IVRApplications.launchInternalProcess | def launchInternalProcess(self, pchBinaryPath, pchArguments, pchWorkingDirectory):
"""
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 callin... | python | def launchInternalProcess(self, pchBinaryPath, pchArguments, pchWorkingDirectory):
"""
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 callin... | [
"def",
"launchInternalProcess",
"(",
"self",
",",
"pchBinaryPath",
",",
"pchArguments",
",",
"pchWorkingDirectory",
")",
":",
"fn",
"=",
"self",
".",
"function_table",
".",
"launchInternalProcess",
"result",
"=",
"fn",
"(",
"pchBinaryPath",
",",
"pchArguments",
",... | 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... | [
"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",
".",
... | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/__init__.py#L3644-L3655 | train |
cmbruns/pyopenvr | src/openvr/__init__.py | IVRChaperone.getBoundsColor | def getBoundsColor(self, nNumOutputColors, flCollisionBoundsFadeDistance):
"""Get the current chaperone bounds draw color and brightness"""
fn = self.function_table.getBoundsColor
pOutputColorArray = HmdColor_t()
pOutputCameraColor = HmdColor_t()
fn(byref(pOutputColorArray), nNu... | python | def getBoundsColor(self, nNumOutputColors, flCollisionBoundsFadeDistance):
"""Get the current chaperone bounds draw color and brightness"""
fn = self.function_table.getBoundsColor
pOutputColorArray = HmdColor_t()
pOutputCameraColor = HmdColor_t()
fn(byref(pOutputColorArray), nNu... | [
"def",
"getBoundsColor",
"(",
"self",
",",
"nNumOutputColors",
",",
"flCollisionBoundsFadeDistance",
")",
":",
"fn",
"=",
"self",
".",
"function_table",
".",
"getBoundsColor",
"pOutputColorArray",
"=",
"HmdColor_t",
"(",
")",
"pOutputCameraColor",
"=",
"HmdColor_t",
... | Get the current chaperone bounds draw color and brightness | [
"Get",
"the",
"current",
"chaperone",
"bounds",
"draw",
"color",
"and",
"brightness"
] | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/__init__.py#L3749-L3756 | train |
cmbruns/pyopenvr | src/openvr/__init__.py | IVRChaperoneSetup.commitWorkingCopy | def commitWorkingCopy(self, configFile):
"""Saves the current working copy to disk"""
fn = self.function_table.commitWorkingCopy
result = fn(configFile)
return result | python | def commitWorkingCopy(self, configFile):
"""Saves the current working copy to disk"""
fn = self.function_table.commitWorkingCopy
result = fn(configFile)
return result | [
"def",
"commitWorkingCopy",
"(",
"self",
",",
"configFile",
")",
":",
"fn",
"=",
"self",
".",
"function_table",
".",
"commitWorkingCopy",
"result",
"=",
"fn",
"(",
"configFile",
")",
"return",
"result"
] | Saves the current working copy to disk | [
"Saves",
"the",
"current",
"working",
"copy",
"to",
"disk"
] | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/__init__.py#L3817-L3822 | train |
cmbruns/pyopenvr | src/openvr/__init__.py | IVRChaperoneSetup.getWorkingCollisionBoundsInfo | def getWorkingCollisionBoundsInfo(self):
"""
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.
"""
fn = self.function_table.getWorkingCollisionBoundsInfo
pQuadsBuffer = Hmd... | python | def getWorkingCollisionBoundsInfo(self):
"""
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.
"""
fn = self.function_table.getWorkingCollisionBoundsInfo
pQuadsBuffer = Hmd... | [
"def",
"getWorkingCollisionBoundsInfo",
"(",
"self",
")",
":",
"fn",
"=",
"self",
".",
"function_table",
".",
"getWorkingCollisionBoundsInfo",
"pQuadsBuffer",
"=",
"HmdQuad_t",
"(",
")",
"punQuadsCount",
"=",
"c_uint32",
"(",
")",
"result",
"=",
"fn",
"(",
"byre... | 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. | [
"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",
"."
] | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/__init__.py#L3861-L3871 | train |
cmbruns/pyopenvr | src/openvr/__init__.py | IVRChaperoneSetup.getWorkingSeatedZeroPoseToRawTrackingPose | def getWorkingSeatedZeroPoseToRawTrackingPose(self):
"""Returns the preferred seated position from the working copy."""
fn = self.function_table.getWorkingSeatedZeroPoseToRawTrackingPose
pmatSeatedZeroPoseToRawTrackingPose = HmdMatrix34_t()
result = fn(byref(pmatSeatedZeroPoseToRawTrack... | python | def getWorkingSeatedZeroPoseToRawTrackingPose(self):
"""Returns the preferred seated position from the working copy."""
fn = self.function_table.getWorkingSeatedZeroPoseToRawTrackingPose
pmatSeatedZeroPoseToRawTrackingPose = HmdMatrix34_t()
result = fn(byref(pmatSeatedZeroPoseToRawTrack... | [
"def",
"getWorkingSeatedZeroPoseToRawTrackingPose",
"(",
"self",
")",
":",
"fn",
"=",
"self",
".",
"function_table",
".",
"getWorkingSeatedZeroPoseToRawTrackingPose",
"pmatSeatedZeroPoseToRawTrackingPose",
"=",
"HmdMatrix34_t",
"(",
")",
"result",
"=",
"fn",
"(",
"byref",... | Returns the preferred seated position from the working copy. | [
"Returns",
"the",
"preferred",
"seated",
"position",
"from",
"the",
"working",
"copy",
"."
] | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/__init__.py#L3885-L3891 | train |
cmbruns/pyopenvr | src/openvr/__init__.py | IVRChaperoneSetup.getWorkingStandingZeroPoseToRawTrackingPose | def getWorkingStandingZeroPoseToRawTrackingPose(self):
"""Returns the standing origin from the working copy."""
fn = self.function_table.getWorkingStandingZeroPoseToRawTrackingPose
pmatStandingZeroPoseToRawTrackingPose = HmdMatrix34_t()
result = fn(byref(pmatStandingZeroPoseToRawTrackin... | python | def getWorkingStandingZeroPoseToRawTrackingPose(self):
"""Returns the standing origin from the working copy."""
fn = self.function_table.getWorkingStandingZeroPoseToRawTrackingPose
pmatStandingZeroPoseToRawTrackingPose = HmdMatrix34_t()
result = fn(byref(pmatStandingZeroPoseToRawTrackin... | [
"def",
"getWorkingStandingZeroPoseToRawTrackingPose",
"(",
"self",
")",
":",
"fn",
"=",
"self",
".",
"function_table",
".",
"getWorkingStandingZeroPoseToRawTrackingPose",
"pmatStandingZeroPoseToRawTrackingPose",
"=",
"HmdMatrix34_t",
"(",
")",
"result",
"=",
"fn",
"(",
"b... | Returns the standing origin from the working copy. | [
"Returns",
"the",
"standing",
"origin",
"from",
"the",
"working",
"copy",
"."
] | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/__init__.py#L3893-L3899 | train |
cmbruns/pyopenvr | src/openvr/__init__.py | IVRChaperoneSetup.setWorkingPlayAreaSize | def setWorkingPlayAreaSize(self, sizeX, sizeZ):
"""Sets the Play Area in the working copy."""
fn = self.function_table.setWorkingPlayAreaSize
fn(sizeX, sizeZ) | python | def setWorkingPlayAreaSize(self, sizeX, sizeZ):
"""Sets the Play Area in the working copy."""
fn = self.function_table.setWorkingPlayAreaSize
fn(sizeX, sizeZ) | [
"def",
"setWorkingPlayAreaSize",
"(",
"self",
",",
"sizeX",
",",
"sizeZ",
")",
":",
"fn",
"=",
"self",
".",
"function_table",
".",
"setWorkingPlayAreaSize",
"fn",
"(",
"sizeX",
",",
"sizeZ",
")"
] | Sets the Play Area in the working copy. | [
"Sets",
"the",
"Play",
"Area",
"in",
"the",
"working",
"copy",
"."
] | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/__init__.py#L3901-L3905 | train |
cmbruns/pyopenvr | src/openvr/__init__.py | IVRChaperoneSetup.setWorkingSeatedZeroPoseToRawTrackingPose | def setWorkingSeatedZeroPoseToRawTrackingPose(self):
"""Sets the preferred seated position in the working copy."""
fn = self.function_table.setWorkingSeatedZeroPoseToRawTrackingPose
pMatSeatedZeroPoseToRawTrackingPose = HmdMatrix34_t()
fn(byref(pMatSeatedZeroPoseToRawTrackingPose))
... | python | def setWorkingSeatedZeroPoseToRawTrackingPose(self):
"""Sets the preferred seated position in the working copy."""
fn = self.function_table.setWorkingSeatedZeroPoseToRawTrackingPose
pMatSeatedZeroPoseToRawTrackingPose = HmdMatrix34_t()
fn(byref(pMatSeatedZeroPoseToRawTrackingPose))
... | [
"def",
"setWorkingSeatedZeroPoseToRawTrackingPose",
"(",
"self",
")",
":",
"fn",
"=",
"self",
".",
"function_table",
".",
"setWorkingSeatedZeroPoseToRawTrackingPose",
"pMatSeatedZeroPoseToRawTrackingPose",
"=",
"HmdMatrix34_t",
"(",
")",
"fn",
"(",
"byref",
"(",
"pMatSeat... | Sets the preferred seated position in the working copy. | [
"Sets",
"the",
"preferred",
"seated",
"position",
"in",
"the",
"working",
"copy",
"."
] | 68395d26bb3df6ab1f0f059c38d441f962938be6 | https://github.com/cmbruns/pyopenvr/blob/68395d26bb3df6ab1f0f059c38d441f962938be6/src/openvr/__init__.py#L3923-L3929 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.