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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
iotile/coretools | iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Environment.py | SubstitutionEnvironment.RemoveMethod | def RemoveMethod(self, function):
"""
Removes the specified function's MethodWrapper from the
added_methods list, so we don't re-bind it when making a clone.
"""
self.added_methods = [dm for dm in self.added_methods if not dm.method is function] | python | def RemoveMethod(self, function):
"""
Removes the specified function's MethodWrapper from the
added_methods list, so we don't re-bind it when making a clone.
"""
self.added_methods = [dm for dm in self.added_methods if not dm.method is function] | [
"def",
"RemoveMethod",
"(",
"self",
",",
"function",
")",
":",
"self",
".",
"added_methods",
"=",
"[",
"dm",
"for",
"dm",
"in",
"self",
".",
"added_methods",
"if",
"not",
"dm",
".",
"method",
"is",
"function",
"]"
] | Removes the specified function's MethodWrapper from the
added_methods list, so we don't re-bind it when making a clone. | [
"Removes",
"the",
"specified",
"function",
"s",
"MethodWrapper",
"from",
"the",
"added_methods",
"list",
"so",
"we",
"don",
"t",
"re",
"-",
"bind",
"it",
"when",
"making",
"a",
"clone",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Environment.py#L606-L611 | train |
iotile/coretools | iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Environment.py | SubstitutionEnvironment.Override | def Override(self, overrides):
"""
Produce a modified environment whose variables are overridden by
the overrides dictionaries. "overrides" is a dictionary that
will override the variables of this environment.
This function is much more efficient than Clone() or creating
... | python | def Override(self, overrides):
"""
Produce a modified environment whose variables are overridden by
the overrides dictionaries. "overrides" is a dictionary that
will override the variables of this environment.
This function is much more efficient than Clone() or creating
... | [
"def",
"Override",
"(",
"self",
",",
"overrides",
")",
":",
"if",
"not",
"overrides",
":",
"return",
"self",
"o",
"=",
"copy_non_reserved_keywords",
"(",
"overrides",
")",
"if",
"not",
"o",
":",
"return",
"self",
"overrides",
"=",
"{",
"}",
"merges",
"="... | Produce a modified environment whose variables are overridden by
the overrides dictionaries. "overrides" is a dictionary that
will override the variables of this environment.
This function is much more efficient than Clone() or creating
a new Environment because it doesn't copy the con... | [
"Produce",
"a",
"modified",
"environment",
"whose",
"variables",
"are",
"overridden",
"by",
"the",
"overrides",
"dictionaries",
".",
"overrides",
"is",
"a",
"dictionary",
"that",
"will",
"override",
"the",
"variables",
"of",
"this",
"environment",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Environment.py#L613-L637 | train |
iotile/coretools | iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Environment.py | SubstitutionEnvironment.MergeFlags | def MergeFlags(self, args, unique=1, dict=None):
"""
Merge the dict in args into the construction variables of this
env, or the passed-in dict. If args is not a dict, it is
converted into a dict using ParseFlags. If unique is not set,
the flags are appended rather than merged.
... | python | def MergeFlags(self, args, unique=1, dict=None):
"""
Merge the dict in args into the construction variables of this
env, or the passed-in dict. If args is not a dict, it is
converted into a dict using ParseFlags. If unique is not set,
the flags are appended rather than merged.
... | [
"def",
"MergeFlags",
"(",
"self",
",",
"args",
",",
"unique",
"=",
"1",
",",
"dict",
"=",
"None",
")",
":",
"if",
"dict",
"is",
"None",
":",
"dict",
"=",
"self",
"if",
"not",
"SCons",
".",
"Util",
".",
"is_Dict",
"(",
"args",
")",
":",
"args",
... | Merge the dict in args into the construction variables of this
env, or the passed-in dict. If args is not a dict, it is
converted into a dict using ParseFlags. If unique is not set,
the flags are appended rather than merged. | [
"Merge",
"the",
"dict",
"in",
"args",
"into",
"the",
"construction",
"variables",
"of",
"this",
"env",
"or",
"the",
"passed",
"-",
"in",
"dict",
".",
"If",
"args",
"is",
"not",
"a",
"dict",
"it",
"is",
"converted",
"into",
"a",
"dict",
"using",
"ParseF... | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Environment.py#L803-L858 | train |
iotile/coretools | iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Environment.py | Base.get_factory | def get_factory(self, factory, default='File'):
"""Return a factory function for creating Nodes for this
construction environment.
"""
name = default
try:
is_node = issubclass(factory, SCons.Node.FS.Base)
except TypeError:
# The specified factory i... | python | def get_factory(self, factory, default='File'):
"""Return a factory function for creating Nodes for this
construction environment.
"""
name = default
try:
is_node = issubclass(factory, SCons.Node.FS.Base)
except TypeError:
# The specified factory i... | [
"def",
"get_factory",
"(",
"self",
",",
"factory",
",",
"default",
"=",
"'File'",
")",
":",
"name",
"=",
"default",
"try",
":",
"is_node",
"=",
"issubclass",
"(",
"factory",
",",
"SCons",
".",
"Node",
".",
"FS",
".",
"Base",
")",
"except",
"TypeError",... | Return a factory function for creating Nodes for this
construction environment. | [
"Return",
"a",
"factory",
"function",
"for",
"creating",
"Nodes",
"for",
"this",
"construction",
"environment",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Environment.py#L1021-L1048 | train |
iotile/coretools | iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Environment.py | Base.Append | def Append(self, **kw):
"""Append values to existing construction variables
in an Environment.
"""
kw = copy_non_reserved_keywords(kw)
for key, val in kw.items():
# It would be easier on the eyes to write this using
# "continue" statements whenever we fini... | python | def Append(self, **kw):
"""Append values to existing construction variables
in an Environment.
"""
kw = copy_non_reserved_keywords(kw)
for key, val in kw.items():
# It would be easier on the eyes to write this using
# "continue" statements whenever we fini... | [
"def",
"Append",
"(",
"self",
",",
"**",
"kw",
")",
":",
"kw",
"=",
"copy_non_reserved_keywords",
"(",
"kw",
")",
"for",
"key",
",",
"val",
"in",
"kw",
".",
"items",
"(",
")",
":",
"try",
":",
"if",
"key",
"==",
"'CPPDEFINES'",
"and",
"SCons",
".",... | Append values to existing construction variables
in an Environment. | [
"Append",
"values",
"to",
"existing",
"construction",
"variables",
"in",
"an",
"Environment",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Environment.py#L1129-L1208 | train |
iotile/coretools | iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Environment.py | Base.AppendENVPath | def AppendENVPath(self, name, newpath, envname = 'ENV',
sep = os.pathsep, delete_existing=1):
"""Append path elements to the path 'name' in the 'ENV'
dictionary for this environment. Will only add any particular
path once, and will normpath and normcase all paths to help
... | python | def AppendENVPath(self, name, newpath, envname = 'ENV',
sep = os.pathsep, delete_existing=1):
"""Append path elements to the path 'name' in the 'ENV'
dictionary for this environment. Will only add any particular
path once, and will normpath and normcase all paths to help
... | [
"def",
"AppendENVPath",
"(",
"self",
",",
"name",
",",
"newpath",
",",
"envname",
"=",
"'ENV'",
",",
"sep",
"=",
"os",
".",
"pathsep",
",",
"delete_existing",
"=",
"1",
")",
":",
"orig",
"=",
"''",
"if",
"envname",
"in",
"self",
".",
"_dict",
"and",
... | Append path elements to the path 'name' in the 'ENV'
dictionary for this environment. Will only add any particular
path once, and will normpath and normcase all paths to help
assure this. This can also handle the case where the env
variable is a list instead of a string.
If de... | [
"Append",
"path",
"elements",
"to",
"the",
"path",
"name",
"in",
"the",
"ENV",
"dictionary",
"for",
"this",
"environment",
".",
"Will",
"only",
"add",
"any",
"particular",
"path",
"once",
"and",
"will",
"normpath",
"and",
"normcase",
"all",
"paths",
"to",
... | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Environment.py#L1219-L1241 | train |
iotile/coretools | iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Environment.py | Base.Detect | def Detect(self, progs):
"""Return the first available program in progs.
"""
if not SCons.Util.is_List(progs):
progs = [ progs ]
for prog in progs:
path = self.WhereIs(prog)
if path: return prog
return None | python | def Detect(self, progs):
"""Return the first available program in progs.
"""
if not SCons.Util.is_List(progs):
progs = [ progs ]
for prog in progs:
path = self.WhereIs(prog)
if path: return prog
return None | [
"def",
"Detect",
"(",
"self",
",",
"progs",
")",
":",
"if",
"not",
"SCons",
".",
"Util",
".",
"is_List",
"(",
"progs",
")",
":",
"progs",
"=",
"[",
"progs",
"]",
"for",
"prog",
"in",
"progs",
":",
"path",
"=",
"self",
".",
"WhereIs",
"(",
"prog",... | Return the first available program in progs. | [
"Return",
"the",
"first",
"available",
"program",
"in",
"progs",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Environment.py#L1486-L1494 | train |
iotile/coretools | iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Environment.py | Base.Dump | def Dump(self, key = None):
"""
Using the standard Python pretty printer, return the contents of the
scons build environment as a string.
If the key passed in is anything other than None, then that will
be used as an index into the build environment dictionary and
whatev... | python | def Dump(self, key = None):
"""
Using the standard Python pretty printer, return the contents of the
scons build environment as a string.
If the key passed in is anything other than None, then that will
be used as an index into the build environment dictionary and
whatev... | [
"def",
"Dump",
"(",
"self",
",",
"key",
"=",
"None",
")",
":",
"import",
"pprint",
"pp",
"=",
"pprint",
".",
"PrettyPrinter",
"(",
"indent",
"=",
"2",
")",
"if",
"key",
":",
"dict",
"=",
"self",
".",
"Dictionary",
"(",
"key",
")",
"else",
":",
"d... | Using the standard Python pretty printer, return the contents of the
scons build environment as a string.
If the key passed in is anything other than None, then that will
be used as an index into the build environment dictionary and
whatever is found there will be fed into the pretty pr... | [
"Using",
"the",
"standard",
"Python",
"pretty",
"printer",
"return",
"the",
"contents",
"of",
"the",
"scons",
"build",
"environment",
"as",
"a",
"string",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Environment.py#L1504-L1520 | train |
iotile/coretools | iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Environment.py | Base.FindIxes | def FindIxes(self, paths, prefix, suffix):
"""
Search a list of paths for something that matches the prefix and suffix.
paths - the list of paths or nodes.
prefix - construction variable for the prefix.
suffix - construction variable for the suffix.
"""
suffix =... | python | def FindIxes(self, paths, prefix, suffix):
"""
Search a list of paths for something that matches the prefix and suffix.
paths - the list of paths or nodes.
prefix - construction variable for the prefix.
suffix - construction variable for the suffix.
"""
suffix =... | [
"def",
"FindIxes",
"(",
"self",
",",
"paths",
",",
"prefix",
",",
"suffix",
")",
":",
"suffix",
"=",
"self",
".",
"subst",
"(",
"'$'",
"+",
"suffix",
")",
"prefix",
"=",
"self",
".",
"subst",
"(",
"'$'",
"+",
"prefix",
")",
"for",
"path",
"in",
"... | Search a list of paths for something that matches the prefix and suffix.
paths - the list of paths or nodes.
prefix - construction variable for the prefix.
suffix - construction variable for the suffix. | [
"Search",
"a",
"list",
"of",
"paths",
"for",
"something",
"that",
"matches",
"the",
"prefix",
"and",
"suffix",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Environment.py#L1522-L1537 | train |
iotile/coretools | iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Environment.py | Base.ParseDepends | def ParseDepends(self, filename, must_exist=None, only_one=0):
"""
Parse a mkdep-style file for explicit dependencies. This is
completely abusable, and should be unnecessary in the "normal"
case of proper SCons configuration, but it may help make
the transition from a Make hiera... | python | def ParseDepends(self, filename, must_exist=None, only_one=0):
"""
Parse a mkdep-style file for explicit dependencies. This is
completely abusable, and should be unnecessary in the "normal"
case of proper SCons configuration, but it may help make
the transition from a Make hiera... | [
"def",
"ParseDepends",
"(",
"self",
",",
"filename",
",",
"must_exist",
"=",
"None",
",",
"only_one",
"=",
"0",
")",
":",
"filename",
"=",
"self",
".",
"subst",
"(",
"filename",
")",
"try",
":",
"fp",
"=",
"open",
"(",
"filename",
",",
"'r'",
")",
... | Parse a mkdep-style file for explicit dependencies. This is
completely abusable, and should be unnecessary in the "normal"
case of proper SCons configuration, but it may help make
the transition from a Make hierarchy easier for some people
to swallow. It can also be genuinely useful wh... | [
"Parse",
"a",
"mkdep",
"-",
"style",
"file",
"for",
"explicit",
"dependencies",
".",
"This",
"is",
"completely",
"abusable",
"and",
"should",
"be",
"unnecessary",
"in",
"the",
"normal",
"case",
"of",
"proper",
"SCons",
"configuration",
"but",
"it",
"may",
"h... | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Environment.py#L1559-L1597 | train |
iotile/coretools | iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Environment.py | Base.Prepend | def Prepend(self, **kw):
"""Prepend values to existing construction variables
in an Environment.
"""
kw = copy_non_reserved_keywords(kw)
for key, val in kw.items():
# It would be easier on the eyes to write this using
# "continue" statements whenever we fi... | python | def Prepend(self, **kw):
"""Prepend values to existing construction variables
in an Environment.
"""
kw = copy_non_reserved_keywords(kw)
for key, val in kw.items():
# It would be easier on the eyes to write this using
# "continue" statements whenever we fi... | [
"def",
"Prepend",
"(",
"self",
",",
"**",
"kw",
")",
":",
"kw",
"=",
"copy_non_reserved_keywords",
"(",
"kw",
")",
"for",
"key",
",",
"val",
"in",
"kw",
".",
"items",
"(",
")",
":",
"try",
":",
"orig",
"=",
"self",
".",
"_dict",
"[",
"key",
"]",
... | Prepend values to existing construction variables
in an Environment. | [
"Prepend",
"values",
"to",
"existing",
"construction",
"variables",
"in",
"an",
"Environment",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Environment.py#L1603-L1666 | train |
iotile/coretools | iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Environment.py | Base.PrependENVPath | def PrependENVPath(self, name, newpath, envname = 'ENV', sep = os.pathsep,
delete_existing=1):
"""Prepend path elements to the path 'name' in the 'ENV'
dictionary for this environment. Will only add any particular
path once, and will normpath and normcase all paths to hel... | python | def PrependENVPath(self, name, newpath, envname = 'ENV', sep = os.pathsep,
delete_existing=1):
"""Prepend path elements to the path 'name' in the 'ENV'
dictionary for this environment. Will only add any particular
path once, and will normpath and normcase all paths to hel... | [
"def",
"PrependENVPath",
"(",
"self",
",",
"name",
",",
"newpath",
",",
"envname",
"=",
"'ENV'",
",",
"sep",
"=",
"os",
".",
"pathsep",
",",
"delete_existing",
"=",
"1",
")",
":",
"orig",
"=",
"''",
"if",
"envname",
"in",
"self",
".",
"_dict",
"and",... | Prepend path elements to the path 'name' in the 'ENV'
dictionary for this environment. Will only add any particular
path once, and will normpath and normcase all paths to help
assure this. This can also handle the case where the env
variable is a list instead of a string.
If d... | [
"Prepend",
"path",
"elements",
"to",
"the",
"path",
"name",
"in",
"the",
"ENV",
"dictionary",
"for",
"this",
"environment",
".",
"Will",
"only",
"add",
"any",
"particular",
"path",
"once",
"and",
"will",
"normpath",
"and",
"normcase",
"all",
"paths",
"to",
... | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Environment.py#L1668-L1690 | train |
iotile/coretools | iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Environment.py | Base.PrependUnique | def PrependUnique(self, delete_existing=0, **kw):
"""Prepend values to existing construction variables
in an Environment, if they're not already there.
If delete_existing is 1, removes existing values first, so
values move to front.
"""
kw = copy_non_reserved_keywords(kw)... | python | def PrependUnique(self, delete_existing=0, **kw):
"""Prepend values to existing construction variables
in an Environment, if they're not already there.
If delete_existing is 1, removes existing values first, so
values move to front.
"""
kw = copy_non_reserved_keywords(kw)... | [
"def",
"PrependUnique",
"(",
"self",
",",
"delete_existing",
"=",
"0",
",",
"**",
"kw",
")",
":",
"kw",
"=",
"copy_non_reserved_keywords",
"(",
"kw",
")",
"for",
"key",
",",
"val",
"in",
"kw",
".",
"items",
"(",
")",
":",
"if",
"SCons",
".",
"Util",
... | Prepend values to existing construction variables
in an Environment, if they're not already there.
If delete_existing is 1, removes existing values first, so
values move to front. | [
"Prepend",
"values",
"to",
"existing",
"construction",
"variables",
"in",
"an",
"Environment",
"if",
"they",
"re",
"not",
"already",
"there",
".",
"If",
"delete_existing",
"is",
"1",
"removes",
"existing",
"values",
"first",
"so",
"values",
"move",
"to",
"fron... | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Environment.py#L1692-L1731 | train |
iotile/coretools | iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Environment.py | Base.ReplaceIxes | def ReplaceIxes(self, path, old_prefix, old_suffix, new_prefix, new_suffix):
"""
Replace old_prefix with new_prefix and old_suffix with new_suffix.
env - Environment used to interpolate variables.
path - the path that will be modified.
old_prefix - construction variable for the ... | python | def ReplaceIxes(self, path, old_prefix, old_suffix, new_prefix, new_suffix):
"""
Replace old_prefix with new_prefix and old_suffix with new_suffix.
env - Environment used to interpolate variables.
path - the path that will be modified.
old_prefix - construction variable for the ... | [
"def",
"ReplaceIxes",
"(",
"self",
",",
"path",
",",
"old_prefix",
",",
"old_suffix",
",",
"new_prefix",
",",
"new_suffix",
")",
":",
"old_prefix",
"=",
"self",
".",
"subst",
"(",
"'$'",
"+",
"old_prefix",
")",
"old_suffix",
"=",
"self",
".",
"subst",
"(... | Replace old_prefix with new_prefix and old_suffix with new_suffix.
env - Environment used to interpolate variables.
path - the path that will be modified.
old_prefix - construction variable for the old prefix.
old_suffix - construction variable for the old suffix.
new_prefix - c... | [
"Replace",
"old_prefix",
"with",
"new_prefix",
"and",
"old_suffix",
"with",
"new_suffix",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Environment.py#L1749-L1771 | train |
iotile/coretools | iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Environment.py | Base.WhereIs | def WhereIs(self, prog, path=None, pathext=None, reject=[]):
"""Find prog in the path.
"""
if path is None:
try:
path = self['ENV']['PATH']
except KeyError:
pass
elif SCons.Util.is_String(path):
path = self.subst(path)
... | python | def WhereIs(self, prog, path=None, pathext=None, reject=[]):
"""Find prog in the path.
"""
if path is None:
try:
path = self['ENV']['PATH']
except KeyError:
pass
elif SCons.Util.is_String(path):
path = self.subst(path)
... | [
"def",
"WhereIs",
"(",
"self",
",",
"prog",
",",
"path",
"=",
"None",
",",
"pathext",
"=",
"None",
",",
"reject",
"=",
"[",
"]",
")",
":",
"if",
"path",
"is",
"None",
":",
"try",
":",
"path",
"=",
"self",
"[",
"'ENV'",
"]",
"[",
"'PATH'",
"]",
... | Find prog in the path. | [
"Find",
"prog",
"in",
"the",
"path",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Environment.py#L1791-L1811 | train |
iotile/coretools | iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Environment.py | Base.Command | def Command(self, target, source, action, **kw):
"""Builds the supplied target files from the supplied
source files using the supplied action. Action may
be any type that the Builder constructor will accept
for an action."""
bkw = {
'action' : action,
'ta... | python | def Command(self, target, source, action, **kw):
"""Builds the supplied target files from the supplied
source files using the supplied action. Action may
be any type that the Builder constructor will accept
for an action."""
bkw = {
'action' : action,
'ta... | [
"def",
"Command",
"(",
"self",
",",
"target",
",",
"source",
",",
"action",
",",
"**",
"kw",
")",
":",
"bkw",
"=",
"{",
"'action'",
":",
"action",
",",
"'target_factory'",
":",
"self",
".",
"fs",
".",
"Entry",
",",
"'source_factory'",
":",
"self",
".... | Builds the supplied target files from the supplied
source files using the supplied action. Action may
be any type that the Builder constructor will accept
for an action. | [
"Builds",
"the",
"supplied",
"target",
"files",
"from",
"the",
"supplied",
"source",
"files",
"using",
"the",
"supplied",
"action",
".",
"Action",
"may",
"be",
"any",
"type",
"that",
"the",
"Builder",
"constructor",
"will",
"accept",
"for",
"an",
"action",
"... | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Environment.py#L1951-L1965 | train |
iotile/coretools | iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Environment.py | Base.Depends | def Depends(self, target, dependency):
"""Explicity specify that 'target's depend on 'dependency'."""
tlist = self.arg2nodes(target, self.fs.Entry)
dlist = self.arg2nodes(dependency, self.fs.Entry)
for t in tlist:
t.add_dependency(dlist)
return tlist | python | def Depends(self, target, dependency):
"""Explicity specify that 'target's depend on 'dependency'."""
tlist = self.arg2nodes(target, self.fs.Entry)
dlist = self.arg2nodes(dependency, self.fs.Entry)
for t in tlist:
t.add_dependency(dlist)
return tlist | [
"def",
"Depends",
"(",
"self",
",",
"target",
",",
"dependency",
")",
":",
"tlist",
"=",
"self",
".",
"arg2nodes",
"(",
"target",
",",
"self",
".",
"fs",
".",
"Entry",
")",
"dlist",
"=",
"self",
".",
"arg2nodes",
"(",
"dependency",
",",
"self",
".",
... | Explicity specify that 'target's depend on 'dependency'. | [
"Explicity",
"specify",
"that",
"target",
"s",
"depend",
"on",
"dependency",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Environment.py#L1967-L1973 | train |
iotile/coretools | iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Environment.py | Base.NoClean | def NoClean(self, *targets):
"""Tags a target so that it will not be cleaned by -c"""
tlist = []
for t in targets:
tlist.extend(self.arg2nodes(t, self.fs.Entry))
for t in tlist:
t.set_noclean()
return tlist | python | def NoClean(self, *targets):
"""Tags a target so that it will not be cleaned by -c"""
tlist = []
for t in targets:
tlist.extend(self.arg2nodes(t, self.fs.Entry))
for t in tlist:
t.set_noclean()
return tlist | [
"def",
"NoClean",
"(",
"self",
",",
"*",
"targets",
")",
":",
"tlist",
"=",
"[",
"]",
"for",
"t",
"in",
"targets",
":",
"tlist",
".",
"extend",
"(",
"self",
".",
"arg2nodes",
"(",
"t",
",",
"self",
".",
"fs",
".",
"Entry",
")",
")",
"for",
"t",... | Tags a target so that it will not be cleaned by -c | [
"Tags",
"a",
"target",
"so",
"that",
"it",
"will",
"not",
"be",
"cleaned",
"by",
"-",
"c"
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Environment.py#L1995-L2002 | train |
iotile/coretools | iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Environment.py | Base.NoCache | def NoCache(self, *targets):
"""Tags a target so that it will not be cached"""
tlist = []
for t in targets:
tlist.extend(self.arg2nodes(t, self.fs.Entry))
for t in tlist:
t.set_nocache()
return tlist | python | def NoCache(self, *targets):
"""Tags a target so that it will not be cached"""
tlist = []
for t in targets:
tlist.extend(self.arg2nodes(t, self.fs.Entry))
for t in tlist:
t.set_nocache()
return tlist | [
"def",
"NoCache",
"(",
"self",
",",
"*",
"targets",
")",
":",
"tlist",
"=",
"[",
"]",
"for",
"t",
"in",
"targets",
":",
"tlist",
".",
"extend",
"(",
"self",
".",
"arg2nodes",
"(",
"t",
",",
"self",
".",
"fs",
".",
"Entry",
")",
")",
"for",
"t",... | Tags a target so that it will not be cached | [
"Tags",
"a",
"target",
"so",
"that",
"it",
"will",
"not",
"be",
"cached"
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Environment.py#L2004-L2011 | train |
iotile/coretools | iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Environment.py | Base.Execute | def Execute(self, action, *args, **kw):
"""Directly execute an action through an Environment
"""
action = self.Action(action, *args, **kw)
result = action([], [], self)
if isinstance(result, SCons.Errors.BuildError):
errstr = result.errstr
if result.filena... | python | def Execute(self, action, *args, **kw):
"""Directly execute an action through an Environment
"""
action = self.Action(action, *args, **kw)
result = action([], [], self)
if isinstance(result, SCons.Errors.BuildError):
errstr = result.errstr
if result.filena... | [
"def",
"Execute",
"(",
"self",
",",
"action",
",",
"*",
"args",
",",
"**",
"kw",
")",
":",
"action",
"=",
"self",
".",
"Action",
"(",
"action",
",",
"*",
"args",
",",
"**",
"kw",
")",
"result",
"=",
"action",
"(",
"[",
"]",
",",
"[",
"]",
","... | Directly execute an action through an Environment | [
"Directly",
"execute",
"an",
"action",
"through",
"an",
"Environment"
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Environment.py#L2027-L2039 | train |
iotile/coretools | iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Environment.py | Base.Ignore | def Ignore(self, target, dependency):
"""Ignore a dependency."""
tlist = self.arg2nodes(target, self.fs.Entry)
dlist = self.arg2nodes(dependency, self.fs.Entry)
for t in tlist:
t.add_ignore(dlist)
return tlist | python | def Ignore(self, target, dependency):
"""Ignore a dependency."""
tlist = self.arg2nodes(target, self.fs.Entry)
dlist = self.arg2nodes(dependency, self.fs.Entry)
for t in tlist:
t.add_ignore(dlist)
return tlist | [
"def",
"Ignore",
"(",
"self",
",",
"target",
",",
"dependency",
")",
":",
"tlist",
"=",
"self",
".",
"arg2nodes",
"(",
"target",
",",
"self",
".",
"fs",
".",
"Entry",
")",
"dlist",
"=",
"self",
".",
"arg2nodes",
"(",
"dependency",
",",
"self",
".",
... | Ignore a dependency. | [
"Ignore",
"a",
"dependency",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Environment.py#L2070-L2076 | train |
iotile/coretools | iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Environment.py | Base.SideEffect | def SideEffect(self, side_effect, target):
"""Tell scons that side_effects are built as side
effects of building targets."""
side_effects = self.arg2nodes(side_effect, self.fs.Entry)
targets = self.arg2nodes(target, self.fs.Entry)
for side_effect in side_effects:
if ... | python | def SideEffect(self, side_effect, target):
"""Tell scons that side_effects are built as side
effects of building targets."""
side_effects = self.arg2nodes(side_effect, self.fs.Entry)
targets = self.arg2nodes(target, self.fs.Entry)
for side_effect in side_effects:
if ... | [
"def",
"SideEffect",
"(",
"self",
",",
"side_effect",
",",
"target",
")",
":",
"side_effects",
"=",
"self",
".",
"arg2nodes",
"(",
"side_effect",
",",
"self",
".",
"fs",
".",
"Entry",
")",
"targets",
"=",
"self",
".",
"arg2nodes",
"(",
"target",
",",
"... | Tell scons that side_effects are built as side
effects of building targets. | [
"Tell",
"scons",
"that",
"side_effects",
"are",
"built",
"as",
"side",
"effects",
"of",
"building",
"targets",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Environment.py#L2144-L2158 | train |
iotile/coretools | iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Environment.py | Base.Split | def Split(self, arg):
"""This function converts a string or list into a list of strings
or Nodes. This makes things easier for users by allowing files to
be specified as a white-space separated list to be split.
The input rules are:
- A single string containing names separa... | python | def Split(self, arg):
"""This function converts a string or list into a list of strings
or Nodes. This makes things easier for users by allowing files to
be specified as a white-space separated list to be split.
The input rules are:
- A single string containing names separa... | [
"def",
"Split",
"(",
"self",
",",
"arg",
")",
":",
"if",
"SCons",
".",
"Util",
".",
"is_List",
"(",
"arg",
")",
":",
"return",
"list",
"(",
"map",
"(",
"self",
".",
"subst",
",",
"arg",
")",
")",
"elif",
"SCons",
".",
"Util",
".",
"is_String",
... | This function converts a string or list into a list of strings
or Nodes. This makes things easier for users by allowing files to
be specified as a white-space separated list to be split.
The input rules are:
- A single string containing names separated by spaces. These will be
... | [
"This",
"function",
"converts",
"a",
"string",
"or",
"list",
"into",
"a",
"list",
"of",
"strings",
"or",
"Nodes",
".",
"This",
"makes",
"things",
"easier",
"for",
"users",
"by",
"allowing",
"files",
"to",
"be",
"specified",
"as",
"a",
"white",
"-",
"spac... | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Environment.py#L2188-L2207 | train |
iotile/coretools | iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Environment.py | Base.FindSourceFiles | def FindSourceFiles(self, node='.'):
""" returns a list of all source files.
"""
node = self.arg2nodes(node, self.fs.Entry)[0]
sources = []
def build_source(ss):
for s in ss:
if isinstance(s, SCons.Node.FS.Dir):
build_source(s.all_... | python | def FindSourceFiles(self, node='.'):
""" returns a list of all source files.
"""
node = self.arg2nodes(node, self.fs.Entry)[0]
sources = []
def build_source(ss):
for s in ss:
if isinstance(s, SCons.Node.FS.Dir):
build_source(s.all_... | [
"def",
"FindSourceFiles",
"(",
"self",
",",
"node",
"=",
"'.'",
")",
":",
"node",
"=",
"self",
".",
"arg2nodes",
"(",
"node",
",",
"self",
".",
"fs",
".",
"Entry",
")",
"[",
"0",
"]",
"sources",
"=",
"[",
"]",
"def",
"build_source",
"(",
"ss",
")... | returns a list of all source files. | [
"returns",
"a",
"list",
"of",
"all",
"source",
"files",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Environment.py#L2241-L2263 | train |
iotile/coretools | iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Environment.py | Base.FindInstalledFiles | def FindInstalledFiles(self):
""" returns the list of all targets of the Install and InstallAs Builder.
"""
from SCons.Tool import install
if install._UNIQUE_INSTALLED_FILES is None:
install._UNIQUE_INSTALLED_FILES = SCons.Util.uniquer_hashables(install._INSTALLED_FILES)
... | python | def FindInstalledFiles(self):
""" returns the list of all targets of the Install and InstallAs Builder.
"""
from SCons.Tool import install
if install._UNIQUE_INSTALLED_FILES is None:
install._UNIQUE_INSTALLED_FILES = SCons.Util.uniquer_hashables(install._INSTALLED_FILES)
... | [
"def",
"FindInstalledFiles",
"(",
"self",
")",
":",
"from",
"SCons",
".",
"Tool",
"import",
"install",
"if",
"install",
".",
"_UNIQUE_INSTALLED_FILES",
"is",
"None",
":",
"install",
".",
"_UNIQUE_INSTALLED_FILES",
"=",
"SCons",
".",
"Util",
".",
"uniquer_hashabl... | returns the list of all targets of the Install and InstallAs Builder. | [
"returns",
"the",
"list",
"of",
"all",
"targets",
"of",
"the",
"Install",
"and",
"InstallAs",
"Builder",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Environment.py#L2265-L2271 | train |
iotile/coretools | iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/pdflatex.py | generate | def generate(env):
"""Add Builders and construction variables for pdflatex to an Environment."""
global PDFLaTeXAction
if PDFLaTeXAction is None:
PDFLaTeXAction = SCons.Action.Action('$PDFLATEXCOM', '$PDFLATEXCOMSTR')
global PDFLaTeXAuxAction
if PDFLaTeXAuxAction is None:
PDFLaTeXAu... | python | def generate(env):
"""Add Builders and construction variables for pdflatex to an Environment."""
global PDFLaTeXAction
if PDFLaTeXAction is None:
PDFLaTeXAction = SCons.Action.Action('$PDFLATEXCOM', '$PDFLATEXCOMSTR')
global PDFLaTeXAuxAction
if PDFLaTeXAuxAction is None:
PDFLaTeXAu... | [
"def",
"generate",
"(",
"env",
")",
":",
"global",
"PDFLaTeXAction",
"if",
"PDFLaTeXAction",
"is",
"None",
":",
"PDFLaTeXAction",
"=",
"SCons",
".",
"Action",
".",
"Action",
"(",
"'$PDFLATEXCOM'",
",",
"'$PDFLATEXCOMSTR'",
")",
"global",
"PDFLaTeXAuxAction",
"if... | Add Builders and construction variables for pdflatex to an Environment. | [
"Add",
"Builders",
"and",
"construction",
"variables",
"for",
"pdflatex",
"to",
"an",
"Environment",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/pdflatex.py#L52-L74 | train |
iotile/coretools | iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/install.py | installShlibLinks | def installShlibLinks(dest, source, env):
"""If we are installing a versioned shared library create the required links."""
Verbose = False
symlinks = listShlibLinksToInstall(dest, source, env)
if Verbose:
print('installShlibLinks: symlinks={:r}'.format(SCons.Tool.StringizeLibSymlinks(symlinks)))... | python | def installShlibLinks(dest, source, env):
"""If we are installing a versioned shared library create the required links."""
Verbose = False
symlinks = listShlibLinksToInstall(dest, source, env)
if Verbose:
print('installShlibLinks: symlinks={:r}'.format(SCons.Tool.StringizeLibSymlinks(symlinks)))... | [
"def",
"installShlibLinks",
"(",
"dest",
",",
"source",
",",
"env",
")",
":",
"Verbose",
"=",
"False",
"symlinks",
"=",
"listShlibLinksToInstall",
"(",
"dest",
",",
"source",
",",
"env",
")",
"if",
"Verbose",
":",
"print",
"(",
"'installShlibLinks: symlinks={:... | If we are installing a versioned shared library create the required links. | [
"If",
"we",
"are",
"installing",
"a",
"versioned",
"shared",
"library",
"create",
"the",
"required",
"links",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/install.py#L165-L173 | train |
iotile/coretools | iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/install.py | installFunc | def installFunc(target, source, env):
"""Install a source file into a target using the function specified
as the INSTALL construction variable."""
try:
install = env['INSTALL']
except KeyError:
raise SCons.Errors.UserError('Missing INSTALL construction variable.')
assert len(target)... | python | def installFunc(target, source, env):
"""Install a source file into a target using the function specified
as the INSTALL construction variable."""
try:
install = env['INSTALL']
except KeyError:
raise SCons.Errors.UserError('Missing INSTALL construction variable.')
assert len(target)... | [
"def",
"installFunc",
"(",
"target",
",",
"source",
",",
"env",
")",
":",
"try",
":",
"install",
"=",
"env",
"[",
"'INSTALL'",
"]",
"except",
"KeyError",
":",
"raise",
"SCons",
".",
"Errors",
".",
"UserError",
"(",
"'Missing INSTALL construction variable.'",
... | Install a source file into a target using the function specified
as the INSTALL construction variable. | [
"Install",
"a",
"source",
"file",
"into",
"a",
"target",
"using",
"the",
"function",
"specified",
"as",
"the",
"INSTALL",
"construction",
"variable",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/install.py#L175-L189 | train |
iotile/coretools | iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/install.py | installFuncVersionedLib | def installFuncVersionedLib(target, source, env):
"""Install a versioned library into a target using the function specified
as the INSTALLVERSIONEDLIB construction variable."""
try:
install = env['INSTALLVERSIONEDLIB']
except KeyError:
raise SCons.Errors.UserError('Missing INSTALLVERSION... | python | def installFuncVersionedLib(target, source, env):
"""Install a versioned library into a target using the function specified
as the INSTALLVERSIONEDLIB construction variable."""
try:
install = env['INSTALLVERSIONEDLIB']
except KeyError:
raise SCons.Errors.UserError('Missing INSTALLVERSION... | [
"def",
"installFuncVersionedLib",
"(",
"target",
",",
"source",
",",
"env",
")",
":",
"try",
":",
"install",
"=",
"env",
"[",
"'INSTALLVERSIONEDLIB'",
"]",
"except",
"KeyError",
":",
"raise",
"SCons",
".",
"Errors",
".",
"UserError",
"(",
"'Missing INSTALLVERS... | Install a versioned library into a target using the function specified
as the INSTALLVERSIONEDLIB construction variable. | [
"Install",
"a",
"versioned",
"library",
"into",
"a",
"target",
"using",
"the",
"function",
"specified",
"as",
"the",
"INSTALLVERSIONEDLIB",
"construction",
"variable",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/install.py#L191-L209 | train |
iotile/coretools | iotilecore/iotile/core/hw/update/records/send_rpc.py | SendErrorCheckingRPCRecord.parse_multiple_rpcs | def parse_multiple_rpcs(cls, record_data):
"""Parse record_data into multiple error checking rpcs."""
rpcs = []
while len(record_data) > 0:
total_length, record_type = struct.unpack_from("<LB3x", record_data)
if record_type != SendErrorCheckingRPCRecord.RecordType:
... | python | def parse_multiple_rpcs(cls, record_data):
"""Parse record_data into multiple error checking rpcs."""
rpcs = []
while len(record_data) > 0:
total_length, record_type = struct.unpack_from("<LB3x", record_data)
if record_type != SendErrorCheckingRPCRecord.RecordType:
... | [
"def",
"parse_multiple_rpcs",
"(",
"cls",
",",
"record_data",
")",
":",
"rpcs",
"=",
"[",
"]",
"while",
"len",
"(",
"record_data",
")",
">",
"0",
":",
"total_length",
",",
"record_type",
"=",
"struct",
".",
"unpack_from",
"(",
"\"<LB3x\"",
",",
"record_dat... | Parse record_data into multiple error checking rpcs. | [
"Parse",
"record_data",
"into",
"multiple",
"error",
"checking",
"rpcs",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilecore/iotile/core/hw/update/records/send_rpc.py#L195-L212 | train |
iotile/coretools | iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/clang.py | generate | def generate(env):
"""Add Builders and construction variables for clang to an Environment."""
SCons.Tool.cc.generate(env)
env['CC'] = env.Detect(compilers) or 'clang'
if env['PLATFORM'] in ['cygwin', 'win32']:
env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS')
else:
env['SHCCFLAGS'] = ... | python | def generate(env):
"""Add Builders and construction variables for clang to an Environment."""
SCons.Tool.cc.generate(env)
env['CC'] = env.Detect(compilers) or 'clang'
if env['PLATFORM'] in ['cygwin', 'win32']:
env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS')
else:
env['SHCCFLAGS'] = ... | [
"def",
"generate",
"(",
"env",
")",
":",
"SCons",
".",
"Tool",
".",
"cc",
".",
"generate",
"(",
"env",
")",
"env",
"[",
"'CC'",
"]",
"=",
"env",
".",
"Detect",
"(",
"compilers",
")",
"or",
"'clang'",
"if",
"env",
"[",
"'PLATFORM'",
"]",
"in",
"["... | Add Builders and construction variables for clang to an Environment. | [
"Add",
"Builders",
"and",
"construction",
"variables",
"for",
"clang",
"to",
"an",
"Environment",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/clang.py#L51-L74 | train |
iotile/coretools | iotilecore/iotile/core/utilities/stoppable_thread.py | StoppableWorkerThread.wait_running | def wait_running(self, timeout=None):
"""Wait for the thread to pass control to its routine.
Args:
timeout (float): The maximum amount of time to wait
"""
flag = self._running.wait(timeout)
if flag is False:
raise TimeoutExpiredError("Timeout waiting fo... | python | def wait_running(self, timeout=None):
"""Wait for the thread to pass control to its routine.
Args:
timeout (float): The maximum amount of time to wait
"""
flag = self._running.wait(timeout)
if flag is False:
raise TimeoutExpiredError("Timeout waiting fo... | [
"def",
"wait_running",
"(",
"self",
",",
"timeout",
"=",
"None",
")",
":",
"flag",
"=",
"self",
".",
"_running",
".",
"wait",
"(",
"timeout",
")",
"if",
"flag",
"is",
"False",
":",
"raise",
"TimeoutExpiredError",
"(",
"\"Timeout waiting for thread to start run... | Wait for the thread to pass control to its routine.
Args:
timeout (float): The maximum amount of time to wait | [
"Wait",
"for",
"the",
"thread",
"to",
"pass",
"control",
"to",
"its",
"routine",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilecore/iotile/core/utilities/stoppable_thread.py#L120-L130 | train |
iotile/coretools | iotileemulate/iotile/emulate/internal/emulation_loop.py | EmulationLoop.create_event | def create_event(self, register=False):
"""Create an asyncio.Event inside the emulation loop.
This method exists as a convenience to create an Event object that is
associated with the correct EventLoop(). If you pass register=True,
then the event will be registered as an event that mus... | python | def create_event(self, register=False):
"""Create an asyncio.Event inside the emulation loop.
This method exists as a convenience to create an Event object that is
associated with the correct EventLoop(). If you pass register=True,
then the event will be registered as an event that mus... | [
"def",
"create_event",
"(",
"self",
",",
"register",
"=",
"False",
")",
":",
"event",
"=",
"asyncio",
".",
"Event",
"(",
"loop",
"=",
"self",
".",
"_loop",
")",
"if",
"register",
":",
"self",
".",
"_events",
".",
"add",
"(",
"event",
")",
"return",
... | Create an asyncio.Event inside the emulation loop.
This method exists as a convenience to create an Event object that is
associated with the correct EventLoop(). If you pass register=True,
then the event will be registered as an event that must be set for the
EmulationLoop to be consid... | [
"Create",
"an",
"asyncio",
".",
"Event",
"inside",
"the",
"emulation",
"loop",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotileemulate/iotile/emulate/internal/emulation_loop.py#L70-L103 | train |
iotile/coretools | iotileemulate/iotile/emulate/internal/emulation_loop.py | EmulationLoop.create_queue | def create_queue(self, register=False):
"""Create a new work queue and optionally register it.
This will make sure the queue is attached to the correct event loop.
You can optionally choose to automatically register it so that
wait_idle() will block until the queue is empty.
Ar... | python | def create_queue(self, register=False):
"""Create a new work queue and optionally register it.
This will make sure the queue is attached to the correct event loop.
You can optionally choose to automatically register it so that
wait_idle() will block until the queue is empty.
Ar... | [
"def",
"create_queue",
"(",
"self",
",",
"register",
"=",
"False",
")",
":",
"queue",
"=",
"asyncio",
".",
"Queue",
"(",
"loop",
"=",
"self",
".",
"_loop",
")",
"if",
"register",
":",
"self",
".",
"_work_queues",
".",
"add",
"(",
"queue",
")",
"retur... | Create a new work queue and optionally register it.
This will make sure the queue is attached to the correct event loop.
You can optionally choose to automatically register it so that
wait_idle() will block until the queue is empty.
Args:
register (bool): Whether to call re... | [
"Create",
"a",
"new",
"work",
"queue",
"and",
"optionally",
"register",
"it",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotileemulate/iotile/emulate/internal/emulation_loop.py#L105-L123 | train |
iotile/coretools | iotileemulate/iotile/emulate/internal/emulation_loop.py | EmulationLoop.start | def start(self):
"""Start the background emulation loop."""
if self._started is True:
raise ArgumentError("EmulationLoop.start() called multiple times")
self._thread = threading.Thread(target=self._loop_thread_main)
self._thread.start()
self._started = True | python | def start(self):
"""Start the background emulation loop."""
if self._started is True:
raise ArgumentError("EmulationLoop.start() called multiple times")
self._thread = threading.Thread(target=self._loop_thread_main)
self._thread.start()
self._started = True | [
"def",
"start",
"(",
"self",
")",
":",
"if",
"self",
".",
"_started",
"is",
"True",
":",
"raise",
"ArgumentError",
"(",
"\"EmulationLoop.start() called multiple times\"",
")",
"self",
".",
"_thread",
"=",
"threading",
".",
"Thread",
"(",
"target",
"=",
"self",... | Start the background emulation loop. | [
"Start",
"the",
"background",
"emulation",
"loop",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotileemulate/iotile/emulate/internal/emulation_loop.py#L189-L197 | train |
iotile/coretools | iotileemulate/iotile/emulate/internal/emulation_loop.py | EmulationLoop.stop | def stop(self):
"""Stop the background emulation loop."""
if self._started is False:
raise ArgumentError("EmulationLoop.stop() called without calling start()")
self.verify_calling_thread(False, "Cannot call EmulationLoop.stop() from inside the event loop")
if self._thread.... | python | def stop(self):
"""Stop the background emulation loop."""
if self._started is False:
raise ArgumentError("EmulationLoop.stop() called without calling start()")
self.verify_calling_thread(False, "Cannot call EmulationLoop.stop() from inside the event loop")
if self._thread.... | [
"def",
"stop",
"(",
"self",
")",
":",
"if",
"self",
".",
"_started",
"is",
"False",
":",
"raise",
"ArgumentError",
"(",
"\"EmulationLoop.stop() called without calling start()\"",
")",
"self",
".",
"verify_calling_thread",
"(",
"False",
",",
"\"Cannot call EmulationLoo... | Stop the background emulation loop. | [
"Stop",
"the",
"background",
"emulation",
"loop",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotileemulate/iotile/emulate/internal/emulation_loop.py#L199-L209 | train |
iotile/coretools | iotileemulate/iotile/emulate/internal/emulation_loop.py | EmulationLoop.wait_idle | def wait_idle(self, timeout=1.0):
"""Wait until the rpc queue is empty.
This method may be called either from within the event loop or from
outside of it. If it is called outside of the event loop it will
block the calling thread until the rpc queue is temporarily empty.
If it... | python | def wait_idle(self, timeout=1.0):
"""Wait until the rpc queue is empty.
This method may be called either from within the event loop or from
outside of it. If it is called outside of the event loop it will
block the calling thread until the rpc queue is temporarily empty.
If it... | [
"def",
"wait_idle",
"(",
"self",
",",
"timeout",
"=",
"1.0",
")",
":",
"async",
"def",
"_awaiter",
"(",
")",
":",
"background_work",
"=",
"{",
"x",
".",
"join",
"(",
")",
"for",
"x",
"in",
"self",
".",
"_work_queues",
"}",
"for",
"event",
"in",
"se... | Wait until the rpc queue is empty.
This method may be called either from within the event loop or from
outside of it. If it is called outside of the event loop it will
block the calling thread until the rpc queue is temporarily empty.
If it is called from within the event loop it will... | [
"Wait",
"until",
"the",
"rpc",
"queue",
"is",
"empty",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotileemulate/iotile/emulate/internal/emulation_loop.py#L211-L242 | train |
iotile/coretools | iotileemulate/iotile/emulate/internal/emulation_loop.py | EmulationLoop.run_task_external | def run_task_external(self, coroutine):
"""Inject a task into the emulation loop and wait for it to finish.
The coroutine parameter is run as a Task inside the EmulationLoop
until it completes and the return value (or any raised Exception) is
pased back into the caller's thread.
... | python | def run_task_external(self, coroutine):
"""Inject a task into the emulation loop and wait for it to finish.
The coroutine parameter is run as a Task inside the EmulationLoop
until it completes and the return value (or any raised Exception) is
pased back into the caller's thread.
... | [
"def",
"run_task_external",
"(",
"self",
",",
"coroutine",
")",
":",
"self",
".",
"verify_calling_thread",
"(",
"False",
",",
"'run_task_external must not be called from the emulation thread'",
")",
"future",
"=",
"asyncio",
".",
"run_coroutine_threadsafe",
"(",
"coroutin... | Inject a task into the emulation loop and wait for it to finish.
The coroutine parameter is run as a Task inside the EmulationLoop
until it completes and the return value (or any raised Exception) is
pased back into the caller's thread.
Args:
coroutine (coroutine): The task... | [
"Inject",
"a",
"task",
"into",
"the",
"emulation",
"loop",
"and",
"wait",
"for",
"it",
"to",
"finish",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotileemulate/iotile/emulate/internal/emulation_loop.py#L244-L261 | train |
iotile/coretools | iotileemulate/iotile/emulate/internal/emulation_loop.py | EmulationLoop.call_rpc_external | def call_rpc_external(self, address, rpc_id, arg_payload, timeout=10.0):
"""Call an RPC from outside of the event loop and block until it finishes.
This is the main method by which a caller outside of the EmulationLoop
can inject an RPC into the EmulationLoop and wait for it to complete.
... | python | def call_rpc_external(self, address, rpc_id, arg_payload, timeout=10.0):
"""Call an RPC from outside of the event loop and block until it finishes.
This is the main method by which a caller outside of the EmulationLoop
can inject an RPC into the EmulationLoop and wait for it to complete.
... | [
"def",
"call_rpc_external",
"(",
"self",
",",
"address",
",",
"rpc_id",
",",
"arg_payload",
",",
"timeout",
"=",
"10.0",
")",
":",
"self",
".",
"verify_calling_thread",
"(",
"False",
",",
"\"call_rpc_external is for use **outside** of the event loop\"",
")",
"response... | Call an RPC from outside of the event loop and block until it finishes.
This is the main method by which a caller outside of the EmulationLoop
can inject an RPC into the EmulationLoop and wait for it to complete.
This method is synchronous so it blocks until the RPC completes or the
tim... | [
"Call",
"an",
"RPC",
"from",
"outside",
"of",
"the",
"event",
"loop",
"and",
"block",
"until",
"it",
"finishes",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotileemulate/iotile/emulate/internal/emulation_loop.py#L263-L290 | train |
iotile/coretools | iotileemulate/iotile/emulate/internal/emulation_loop.py | EmulationLoop.await_rpc | async def await_rpc(self, address, rpc_id, *args, **kwargs):
"""Send an RPC from inside the EmulationLoop.
This is the primary method by which tasks running inside the
EmulationLoop dispatch RPCs. The RPC is added to the queue of waiting
RPCs to be drained by the RPC dispatch task and ... | python | async def await_rpc(self, address, rpc_id, *args, **kwargs):
"""Send an RPC from inside the EmulationLoop.
This is the primary method by which tasks running inside the
EmulationLoop dispatch RPCs. The RPC is added to the queue of waiting
RPCs to be drained by the RPC dispatch task and ... | [
"async",
"def",
"await_rpc",
"(",
"self",
",",
"address",
",",
"rpc_id",
",",
"*",
"args",
",",
"**",
"kwargs",
")",
":",
"self",
".",
"verify_calling_thread",
"(",
"True",
",",
"\"await_rpc must be called from **inside** the event loop\"",
")",
"if",
"isinstance"... | Send an RPC from inside the EmulationLoop.
This is the primary method by which tasks running inside the
EmulationLoop dispatch RPCs. The RPC is added to the queue of waiting
RPCs to be drained by the RPC dispatch task and this coroutine will
block until it finishes.
**This met... | [
"Send",
"an",
"RPC",
"from",
"inside",
"the",
"EmulationLoop",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotileemulate/iotile/emulate/internal/emulation_loop.py#L292-L343 | train |
iotile/coretools | iotileemulate/iotile/emulate/internal/emulation_loop.py | EmulationLoop.verify_calling_thread | def verify_calling_thread(self, should_be_emulation, message=None):
"""Verify if the calling thread is or is not the emulation thread.
This method can be called to make sure that an action is being taken
in the appropriate context such as not blocking the event loop thread
or modifying ... | python | def verify_calling_thread(self, should_be_emulation, message=None):
"""Verify if the calling thread is or is not the emulation thread.
This method can be called to make sure that an action is being taken
in the appropriate context such as not blocking the event loop thread
or modifying ... | [
"def",
"verify_calling_thread",
"(",
"self",
",",
"should_be_emulation",
",",
"message",
"=",
"None",
")",
":",
"if",
"should_be_emulation",
"==",
"self",
".",
"_on_emulation_thread",
"(",
")",
":",
"return",
"if",
"message",
"is",
"None",
":",
"message",
"=",... | Verify if the calling thread is or is not the emulation thread.
This method can be called to make sure that an action is being taken
in the appropriate context such as not blocking the event loop thread
or modifying an emulate state outside of the event loop thread.
If the verification... | [
"Verify",
"if",
"the",
"calling",
"thread",
"is",
"or",
"is",
"not",
"the",
"emulation",
"thread",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotileemulate/iotile/emulate/internal/emulation_loop.py#L345-L373 | train |
iotile/coretools | iotileemulate/iotile/emulate/internal/emulation_loop.py | EmulationLoop.add_task | def add_task(self, tile_address, coroutine):
"""Add a task into the event loop.
This is the main entry point for registering background tasks that are
associated with a tile. The tasks are added to the EmulationLoop and
the tile they are a part of is recorded. When the tile is reset, a... | python | def add_task(self, tile_address, coroutine):
"""Add a task into the event loop.
This is the main entry point for registering background tasks that are
associated with a tile. The tasks are added to the EmulationLoop and
the tile they are a part of is recorded. When the tile is reset, a... | [
"def",
"add_task",
"(",
"self",
",",
"tile_address",
",",
"coroutine",
")",
":",
"self",
".",
"_loop",
".",
"call_soon_threadsafe",
"(",
"self",
".",
"_add_task",
",",
"tile_address",
",",
"coroutine",
")"
] | Add a task into the event loop.
This is the main entry point for registering background tasks that are
associated with a tile. The tasks are added to the EmulationLoop and
the tile they are a part of is recorded. When the tile is reset, all
of its background tasks are canceled as part ... | [
"Add",
"a",
"task",
"into",
"the",
"event",
"loop",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotileemulate/iotile/emulate/internal/emulation_loop.py#L375-L394 | train |
iotile/coretools | iotileemulate/iotile/emulate/internal/emulation_loop.py | EmulationLoop.stop_tasks | async def stop_tasks(self, address):
"""Clear all tasks pertaining to a tile.
This coroutine will synchronously cancel all running tasks that were
attached to the given tile and wait for them to stop before returning.
Args:
address (int): The address of the tile we should s... | python | async def stop_tasks(self, address):
"""Clear all tasks pertaining to a tile.
This coroutine will synchronously cancel all running tasks that were
attached to the given tile and wait for them to stop before returning.
Args:
address (int): The address of the tile we should s... | [
"async",
"def",
"stop_tasks",
"(",
"self",
",",
"address",
")",
":",
"tasks",
"=",
"self",
".",
"_tasks",
".",
"get",
"(",
"address",
",",
"[",
"]",
")",
"for",
"task",
"in",
"tasks",
":",
"task",
".",
"cancel",
"(",
")",
"asyncio",
".",
"gather",
... | Clear all tasks pertaining to a tile.
This coroutine will synchronously cancel all running tasks that were
attached to the given tile and wait for them to stop before returning.
Args:
address (int): The address of the tile we should stop. | [
"Clear",
"all",
"tasks",
"pertaining",
"to",
"a",
"tile",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotileemulate/iotile/emulate/internal/emulation_loop.py#L434-L449 | train |
iotile/coretools | iotileemulate/iotile/emulate/internal/emulation_loop.py | EmulationLoop._clean_shutdown | async def _clean_shutdown(self):
"""Cleanly shutdown the emulation loop."""
# Cleanly stop any other outstanding tasks not associated with tiles
remaining_tasks = []
for task in self._tasks.get(None, []):
self._logger.debug("Cancelling task at shutdown %s", task)
... | python | async def _clean_shutdown(self):
"""Cleanly shutdown the emulation loop."""
# Cleanly stop any other outstanding tasks not associated with tiles
remaining_tasks = []
for task in self._tasks.get(None, []):
self._logger.debug("Cancelling task at shutdown %s", task)
... | [
"async",
"def",
"_clean_shutdown",
"(",
"self",
")",
":",
"remaining_tasks",
"=",
"[",
"]",
"for",
"task",
"in",
"self",
".",
"_tasks",
".",
"get",
"(",
"None",
",",
"[",
"]",
")",
":",
"self",
".",
"_logger",
".",
"debug",
"(",
"\"Cancelling task at s... | Cleanly shutdown the emulation loop. | [
"Cleanly",
"shutdown",
"the",
"emulation",
"loop",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotileemulate/iotile/emulate/internal/emulation_loop.py#L451-L483 | train |
iotile/coretools | iotileemulate/iotile/emulate/internal/emulation_loop.py | EmulationLoop._add_task | def _add_task(self, tile_address, coroutine):
"""Add a task from within the event loop.
All tasks are associated with a tile so that they can be cleanly
stopped when that tile is reset.
"""
self.verify_calling_thread(True, "_add_task is not thread safe")
if tile_addres... | python | def _add_task(self, tile_address, coroutine):
"""Add a task from within the event loop.
All tasks are associated with a tile so that they can be cleanly
stopped when that tile is reset.
"""
self.verify_calling_thread(True, "_add_task is not thread safe")
if tile_addres... | [
"def",
"_add_task",
"(",
"self",
",",
"tile_address",
",",
"coroutine",
")",
":",
"self",
".",
"verify_calling_thread",
"(",
"True",
",",
"\"_add_task is not thread safe\"",
")",
"if",
"tile_address",
"not",
"in",
"self",
".",
"_tasks",
":",
"self",
".",
"_tas... | Add a task from within the event loop.
All tasks are associated with a tile so that they can be cleanly
stopped when that tile is reset. | [
"Add",
"a",
"task",
"from",
"within",
"the",
"event",
"loop",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotileemulate/iotile/emulate/internal/emulation_loop.py#L485-L498 | train |
iotile/coretools | iotilecore/iotile/core/utilities/schema_verify/dict_verify.py | DictionaryVerifier.key_rule | def key_rule(self, regex, verifier):
"""Add a rule with a pattern that should apply to all keys.
Any key not explicitly listed in an add_required or add_optional rule
must match ONE OF the rules given in a call to key_rule().
So these rules are all OR'ed together.
In this case ... | python | def key_rule(self, regex, verifier):
"""Add a rule with a pattern that should apply to all keys.
Any key not explicitly listed in an add_required or add_optional rule
must match ONE OF the rules given in a call to key_rule().
So these rules are all OR'ed together.
In this case ... | [
"def",
"key_rule",
"(",
"self",
",",
"regex",
",",
"verifier",
")",
":",
"if",
"regex",
"is",
"not",
"None",
":",
"regex",
"=",
"re",
".",
"compile",
"(",
"regex",
")",
"self",
".",
"_additional_key_rules",
".",
"append",
"(",
"(",
"regex",
",",
"ver... | Add a rule with a pattern that should apply to all keys.
Any key not explicitly listed in an add_required or add_optional rule
must match ONE OF the rules given in a call to key_rule().
So these rules are all OR'ed together.
In this case you should pass a raw string specifying a regex ... | [
"Add",
"a",
"rule",
"with",
"a",
"pattern",
"that",
"should",
"apply",
"to",
"all",
"keys",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilecore/iotile/core/utilities/schema_verify/dict_verify.py#L43-L63 | train |
iotile/coretools | iotilecore/iotile/core/hw/transport/virtualadapter.py | VirtualAdapterAsyncChannel.stream | def stream(self, report, callback=None):
"""Queue data for streaming
Args:
report (IOTileReport): A report object to stream to a client
callback (callable): An optional callback that will be called with
a bool value of True when this report actually gets streamed... | python | def stream(self, report, callback=None):
"""Queue data for streaming
Args:
report (IOTileReport): A report object to stream to a client
callback (callable): An optional callback that will be called with
a bool value of True when this report actually gets streamed... | [
"def",
"stream",
"(",
"self",
",",
"report",
",",
"callback",
"=",
"None",
")",
":",
"conn_id",
"=",
"self",
".",
"_find_connection",
"(",
"self",
".",
"conn_string",
")",
"if",
"isinstance",
"(",
"report",
",",
"BroadcastReport",
")",
":",
"self",
".",
... | Queue data for streaming
Args:
report (IOTileReport): A report object to stream to a client
callback (callable): An optional callback that will be called with
a bool value of True when this report actually gets streamed.
If the client disconnects and the ... | [
"Queue",
"data",
"for",
"streaming"
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilecore/iotile/core/hw/transport/virtualadapter.py#L23-L42 | train |
iotile/coretools | iotilecore/iotile/core/hw/transport/virtualadapter.py | VirtualAdapterAsyncChannel.trace | def trace(self, data, callback=None):
"""Queue data for tracing
Args:
data (bytearray, string): Unstructured data to trace to any
connected client.
callback (callable): An optional callback that will be called with
a bool value of True when this d... | python | def trace(self, data, callback=None):
"""Queue data for tracing
Args:
data (bytearray, string): Unstructured data to trace to any
connected client.
callback (callable): An optional callback that will be called with
a bool value of True when this d... | [
"def",
"trace",
"(",
"self",
",",
"data",
",",
"callback",
"=",
"None",
")",
":",
"conn_id",
"=",
"self",
".",
"_find_connection",
"(",
"self",
".",
"conn_string",
")",
"if",
"conn_id",
"is",
"not",
"None",
":",
"self",
".",
"adapter",
".",
"notify_eve... | Queue data for tracing
Args:
data (bytearray, string): Unstructured data to trace to any
connected client.
callback (callable): An optional callback that will be called with
a bool value of True when this data actually gets traced.
If the ... | [
"Queue",
"data",
"for",
"tracing"
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilecore/iotile/core/hw/transport/virtualadapter.py#L44-L62 | train |
iotile/coretools | iotilecore/iotile/core/hw/transport/virtualadapter.py | VirtualDeviceAdapter._load_device | def _load_device(self, name, config):
"""Load a device either from a script or from an installed module"""
if config is None:
config_dict = {}
elif isinstance(config, dict):
config_dict = config
elif config[0] == '#':
# Allow passing base64 encoded js... | python | def _load_device(self, name, config):
"""Load a device either from a script or from an installed module"""
if config is None:
config_dict = {}
elif isinstance(config, dict):
config_dict = config
elif config[0] == '#':
# Allow passing base64 encoded js... | [
"def",
"_load_device",
"(",
"self",
",",
"name",
",",
"config",
")",
":",
"if",
"config",
"is",
"None",
":",
"config_dict",
"=",
"{",
"}",
"elif",
"isinstance",
"(",
"config",
",",
"dict",
")",
":",
"config_dict",
"=",
"config",
"elif",
"config",
"[",
... | Load a device either from a script or from an installed module | [
"Load",
"a",
"device",
"either",
"from",
"a",
"script",
"or",
"from",
"an",
"installed",
"module"
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilecore/iotile/core/hw/transport/virtualadapter.py#L172-L212 | train |
iotile/coretools | iotilecore/iotile/core/hw/transport/virtualadapter.py | VirtualDeviceAdapter.disconnect | async def disconnect(self, conn_id):
"""Asynchronously disconnect from a connected device
Args:
conn_id (int): A unique identifier that will refer to this connection
callback (callback): A callback that will be called as
callback(conn_id, adapter_id, success, fai... | python | async def disconnect(self, conn_id):
"""Asynchronously disconnect from a connected device
Args:
conn_id (int): A unique identifier that will refer to this connection
callback (callback): A callback that will be called as
callback(conn_id, adapter_id, success, fai... | [
"async",
"def",
"disconnect",
"(",
"self",
",",
"conn_id",
")",
":",
"self",
".",
"_ensure_connection",
"(",
"conn_id",
",",
"True",
")",
"dev",
"=",
"self",
".",
"_get_property",
"(",
"conn_id",
",",
"'device'",
")",
"dev",
".",
"connected",
"=",
"False... | Asynchronously disconnect from a connected device
Args:
conn_id (int): A unique identifier that will refer to this connection
callback (callback): A callback that will be called as
callback(conn_id, adapter_id, success, failure_reason) | [
"Asynchronously",
"disconnect",
"from",
"a",
"connected",
"device"
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilecore/iotile/core/hw/transport/virtualadapter.py#L247-L261 | train |
iotile/coretools | iotilecore/iotile/core/hw/transport/virtualadapter.py | VirtualDeviceAdapter._send_scan_event | async def _send_scan_event(self, device):
"""Send a scan event from a device."""
conn_string = str(device.iotile_id)
info = {
'connection_string': conn_string,
'uuid': device.iotile_id,
'signal_strength': 100,
'validity_period': self.ExpirationTim... | python | async def _send_scan_event(self, device):
"""Send a scan event from a device."""
conn_string = str(device.iotile_id)
info = {
'connection_string': conn_string,
'uuid': device.iotile_id,
'signal_strength': 100,
'validity_period': self.ExpirationTim... | [
"async",
"def",
"_send_scan_event",
"(",
"self",
",",
"device",
")",
":",
"conn_string",
"=",
"str",
"(",
"device",
".",
"iotile_id",
")",
"info",
"=",
"{",
"'connection_string'",
":",
"conn_string",
",",
"'uuid'",
":",
"device",
".",
"iotile_id",
",",
"'s... | Send a scan event from a device. | [
"Send",
"a",
"scan",
"event",
"from",
"a",
"device",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilecore/iotile/core/hw/transport/virtualadapter.py#L369-L380 | train |
iotile/coretools | iotileemulate/iotile/emulate/constants/__init__.py | rpc_name | def rpc_name(rpc_id):
"""Map an RPC id to a string name.
This function looks the RPC up in a map of all globally declared RPCs,
and returns a nice name string. if the RPC is not found in the global
name map, returns a generic name string such as 'rpc 0x%04X'.
Args:
rpc_id (int): The id of... | python | def rpc_name(rpc_id):
"""Map an RPC id to a string name.
This function looks the RPC up in a map of all globally declared RPCs,
and returns a nice name string. if the RPC is not found in the global
name map, returns a generic name string such as 'rpc 0x%04X'.
Args:
rpc_id (int): The id of... | [
"def",
"rpc_name",
"(",
"rpc_id",
")",
":",
"name",
"=",
"_RPC_NAME_MAP",
".",
"get",
"(",
"rpc_id",
")",
"if",
"name",
"is",
"None",
":",
"name",
"=",
"'RPC 0x%04X'",
"%",
"rpc_id",
"return",
"name"
] | Map an RPC id to a string name.
This function looks the RPC up in a map of all globally declared RPCs,
and returns a nice name string. if the RPC is not found in the global
name map, returns a generic name string such as 'rpc 0x%04X'.
Args:
rpc_id (int): The id of the RPC that we wish to look... | [
"Map",
"an",
"RPC",
"id",
"to",
"a",
"string",
"name",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotileemulate/iotile/emulate/constants/__init__.py#L18-L36 | train |
iotile/coretools | iotileemulate/iotile/emulate/constants/__init__.py | stream_name | def stream_name(stream_id):
"""Map a stream id to a human readable name.
The mapping process is as follows:
If the stream id is globally known, its global name is used as <name>
otherwise a string representation of the stream is used as <name>.
In both cases the hex representation of the stream i... | python | def stream_name(stream_id):
"""Map a stream id to a human readable name.
The mapping process is as follows:
If the stream id is globally known, its global name is used as <name>
otherwise a string representation of the stream is used as <name>.
In both cases the hex representation of the stream i... | [
"def",
"stream_name",
"(",
"stream_id",
")",
":",
"name",
"=",
"_STREAM_NAME_MAP",
".",
"get",
"(",
"stream_id",
")",
"if",
"name",
"is",
"None",
":",
"name",
"=",
"str",
"(",
"DataStream",
".",
"FromEncoded",
"(",
"stream_id",
")",
")",
"return",
"\"{} ... | Map a stream id to a human readable name.
The mapping process is as follows:
If the stream id is globally known, its global name is used as <name>
otherwise a string representation of the stream is used as <name>.
In both cases the hex representation of the stream id is appended as a
number:
... | [
"Map",
"a",
"stream",
"id",
"to",
"a",
"human",
"readable",
"name",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotileemulate/iotile/emulate/constants/__init__.py#L39-L63 | train |
iotile/coretools | iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Script/SConsOptions.py | SConsValues.set_option | def set_option(self, name, value):
"""
Sets an option from an SConscript file.
"""
if not name in self.settable:
raise SCons.Errors.UserError("This option is not settable from a SConscript file: %s"%name)
if name == 'num_jobs':
try:
value ... | python | def set_option(self, name, value):
"""
Sets an option from an SConscript file.
"""
if not name in self.settable:
raise SCons.Errors.UserError("This option is not settable from a SConscript file: %s"%name)
if name == 'num_jobs':
try:
value ... | [
"def",
"set_option",
"(",
"self",
",",
"name",
",",
"value",
")",
":",
"if",
"not",
"name",
"in",
"self",
".",
"settable",
":",
"raise",
"SCons",
".",
"Errors",
".",
"UserError",
"(",
"\"This option is not settable from a SConscript file: %s\"",
"%",
"name",
"... | Sets an option from an SConscript file. | [
"Sets",
"an",
"option",
"from",
"an",
"SConscript",
"file",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Script/SConsOptions.py#L145-L200 | train |
iotile/coretools | iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Script/SConsOptions.py | SConsOptionGroup.format_help | def format_help(self, formatter):
"""
Format an option group's help text, outdenting the title so it's
flush with the "SCons Options" title we print at the top.
"""
formatter.dedent()
result = formatter.format_heading(self.title)
formatter.indent()
result ... | python | def format_help(self, formatter):
"""
Format an option group's help text, outdenting the title so it's
flush with the "SCons Options" title we print at the top.
"""
formatter.dedent()
result = formatter.format_heading(self.title)
formatter.indent()
result ... | [
"def",
"format_help",
"(",
"self",
",",
"formatter",
")",
":",
"formatter",
".",
"dedent",
"(",
")",
"result",
"=",
"formatter",
".",
"format_heading",
"(",
"self",
".",
"title",
")",
"formatter",
".",
"indent",
"(",
")",
"result",
"=",
"result",
"+",
... | Format an option group's help text, outdenting the title so it's
flush with the "SCons Options" title we print at the top. | [
"Format",
"an",
"option",
"group",
"s",
"help",
"text",
"outdenting",
"the",
"title",
"so",
"it",
"s",
"flush",
"with",
"the",
"SCons",
"Options",
"title",
"we",
"print",
"at",
"the",
"top",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Script/SConsOptions.py#L270-L279 | train |
iotile/coretools | iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Script/SConsOptions.py | SConsOptionParser._process_long_opt | def _process_long_opt(self, rargs, values):
"""
SCons-specific processing of long options.
This is copied directly from the normal
optparse._process_long_opt() method, except that, if configured
to do so, we catch the exception thrown when an unknown option
is encountere... | python | def _process_long_opt(self, rargs, values):
"""
SCons-specific processing of long options.
This is copied directly from the normal
optparse._process_long_opt() method, except that, if configured
to do so, we catch the exception thrown when an unknown option
is encountere... | [
"def",
"_process_long_opt",
"(",
"self",
",",
"rargs",
",",
"values",
")",
":",
"arg",
"=",
"rargs",
".",
"pop",
"(",
"0",
")",
"if",
"\"=\"",
"in",
"arg",
":",
"(",
"opt",
",",
"next_arg",
")",
"=",
"arg",
".",
"split",
"(",
"\"=\"",
",",
"1",
... | SCons-specific processing of long options.
This is copied directly from the normal
optparse._process_long_opt() method, except that, if configured
to do so, we catch the exception thrown when an unknown option
is encountered and just stick it back on the "leftover" arguments
for... | [
"SCons",
"-",
"specific",
"processing",
"of",
"long",
"options",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Script/SConsOptions.py#L290-L358 | train |
iotile/coretools | iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Script/SConsOptions.py | SConsOptionParser.add_local_option | def add_local_option(self, *args, **kw):
"""
Adds a local option to the parser.
This is initiated by a SetOption() call to add a user-defined
command-line option. We add the option to a separate option
group for the local options, creating the group if necessary.
"""
... | python | def add_local_option(self, *args, **kw):
"""
Adds a local option to the parser.
This is initiated by a SetOption() call to add a user-defined
command-line option. We add the option to a separate option
group for the local options, creating the group if necessary.
"""
... | [
"def",
"add_local_option",
"(",
"self",
",",
"*",
"args",
",",
"**",
"kw",
")",
":",
"try",
":",
"group",
"=",
"self",
".",
"local_option_group",
"except",
"AttributeError",
":",
"group",
"=",
"SConsOptionGroup",
"(",
"self",
",",
"'Local Options'",
")",
"... | Adds a local option to the parser.
This is initiated by a SetOption() call to add a user-defined
command-line option. We add the option to a separate option
group for the local options, creating the group if necessary. | [
"Adds",
"a",
"local",
"option",
"to",
"the",
"parser",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Script/SConsOptions.py#L425-L454 | train |
iotile/coretools | iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Script/SConsOptions.py | SConsIndentedHelpFormatter.format_heading | def format_heading(self, heading):
"""
This translates any heading of "options" or "Options" into
"SCons Options." Unfortunately, we have to do this here,
because those titles are hard-coded in the optparse calls.
"""
if heading == 'Options':
heading = "SCons... | python | def format_heading(self, heading):
"""
This translates any heading of "options" or "Options" into
"SCons Options." Unfortunately, we have to do this here,
because those titles are hard-coded in the optparse calls.
"""
if heading == 'Options':
heading = "SCons... | [
"def",
"format_heading",
"(",
"self",
",",
"heading",
")",
":",
"if",
"heading",
"==",
"'Options'",
":",
"heading",
"=",
"\"SCons Options\"",
"return",
"optparse",
".",
"IndentedHelpFormatter",
".",
"format_heading",
"(",
"self",
",",
"heading",
")"
] | This translates any heading of "options" or "Options" into
"SCons Options." Unfortunately, we have to do this here,
because those titles are hard-coded in the optparse calls. | [
"This",
"translates",
"any",
"heading",
"of",
"options",
"or",
"Options",
"into",
"SCons",
"Options",
".",
"Unfortunately",
"we",
"have",
"to",
"do",
"this",
"here",
"because",
"those",
"titles",
"are",
"hard",
"-",
"coded",
"in",
"the",
"optparse",
"calls",... | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Script/SConsOptions.py#L460-L468 | train |
iotile/coretools | iotilebuild/iotile/build/tilebus/block.py | TBBlock.to_dict | def to_dict(self):
"""Convert this object into a dictionary.
Returns:
dict: A dict with the same information as this object.
"""
out_dict = {}
out_dict['commands'] = self.commands
out_dict['configs'] = self.configs
out_dict['short_name'] = self.name... | python | def to_dict(self):
"""Convert this object into a dictionary.
Returns:
dict: A dict with the same information as this object.
"""
out_dict = {}
out_dict['commands'] = self.commands
out_dict['configs'] = self.configs
out_dict['short_name'] = self.name... | [
"def",
"to_dict",
"(",
"self",
")",
":",
"out_dict",
"=",
"{",
"}",
"out_dict",
"[",
"'commands'",
"]",
"=",
"self",
".",
"commands",
"out_dict",
"[",
"'configs'",
"]",
"=",
"self",
".",
"configs",
"out_dict",
"[",
"'short_name'",
"]",
"=",
"self",
"."... | Convert this object into a dictionary.
Returns:
dict: A dict with the same information as this object. | [
"Convert",
"this",
"object",
"into",
"a",
"dictionary",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/tilebus/block.py#L46-L63 | train |
iotile/coretools | iotilebuild/iotile/build/tilebus/block.py | TBBlock.set_api_version | def set_api_version(self, major, minor):
"""Set the API version this module was designed for.
Each module must declare the mib12 API version it was compiled with as a
2 byte major.minor number. This information is used by the pic12_executive
to decide whether the application is compati... | python | def set_api_version(self, major, minor):
"""Set the API version this module was designed for.
Each module must declare the mib12 API version it was compiled with as a
2 byte major.minor number. This information is used by the pic12_executive
to decide whether the application is compati... | [
"def",
"set_api_version",
"(",
"self",
",",
"major",
",",
"minor",
")",
":",
"if",
"not",
"self",
".",
"_is_byte",
"(",
"major",
")",
"or",
"not",
"self",
".",
"_is_byte",
"(",
"minor",
")",
":",
"raise",
"ArgumentError",
"(",
"\"Invalid API version number... | Set the API version this module was designed for.
Each module must declare the mib12 API version it was compiled with as a
2 byte major.minor number. This information is used by the pic12_executive
to decide whether the application is compatible. | [
"Set",
"the",
"API",
"version",
"this",
"module",
"was",
"designed",
"for",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/tilebus/block.py#L69-L81 | train |
iotile/coretools | iotilebuild/iotile/build/tilebus/block.py | TBBlock.set_module_version | def set_module_version(self, major, minor, patch):
"""Set the module version for this module.
Each module must declare a semantic version number in the form:
major.minor.patch
where each component is a 1 byte number between 0 and 255.
"""
if not (self._is_byte(major) a... | python | def set_module_version(self, major, minor, patch):
"""Set the module version for this module.
Each module must declare a semantic version number in the form:
major.minor.patch
where each component is a 1 byte number between 0 and 255.
"""
if not (self._is_byte(major) a... | [
"def",
"set_module_version",
"(",
"self",
",",
"major",
",",
"minor",
",",
"patch",
")",
":",
"if",
"not",
"(",
"self",
".",
"_is_byte",
"(",
"major",
")",
"and",
"self",
".",
"_is_byte",
"(",
"minor",
")",
"and",
"self",
".",
"_is_byte",
"(",
"patch... | Set the module version for this module.
Each module must declare a semantic version number in the form:
major.minor.patch
where each component is a 1 byte number between 0 and 255. | [
"Set",
"the",
"module",
"version",
"for",
"this",
"module",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/tilebus/block.py#L83-L96 | train |
iotile/coretools | iotilebuild/iotile/build/tilebus/block.py | TBBlock.set_name | def set_name(self, name):
"""Set the module name to a 6 byte string
If the string is too short it is appended with space characters.
"""
if len(name) > 6:
raise ArgumentError("Name must be at most 6 characters long", name=name)
if len(name) < 6:
name +=... | python | def set_name(self, name):
"""Set the module name to a 6 byte string
If the string is too short it is appended with space characters.
"""
if len(name) > 6:
raise ArgumentError("Name must be at most 6 characters long", name=name)
if len(name) < 6:
name +=... | [
"def",
"set_name",
"(",
"self",
",",
"name",
")",
":",
"if",
"len",
"(",
"name",
")",
">",
"6",
":",
"raise",
"ArgumentError",
"(",
"\"Name must be at most 6 characters long\"",
",",
"name",
"=",
"name",
")",
"if",
"len",
"(",
"name",
")",
"<",
"6",
":... | Set the module name to a 6 byte string
If the string is too short it is appended with space characters. | [
"Set",
"the",
"module",
"name",
"to",
"a",
"6",
"byte",
"string"
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/tilebus/block.py#L98-L110 | train |
iotile/coretools | iotilebuild/iotile/build/tilebus/block.py | TBBlock.add_command | def add_command(self, cmd_id, handler):
"""Add a command to the TBBlock.
The cmd_id must be a non-negative 2 byte number.
handler should be the command handler
"""
if cmd_id < 0 or cmd_id >= 2**16:
raise ArgumentError("Command ID in mib block is not a non-negative 2... | python | def add_command(self, cmd_id, handler):
"""Add a command to the TBBlock.
The cmd_id must be a non-negative 2 byte number.
handler should be the command handler
"""
if cmd_id < 0 or cmd_id >= 2**16:
raise ArgumentError("Command ID in mib block is not a non-negative 2... | [
"def",
"add_command",
"(",
"self",
",",
"cmd_id",
",",
"handler",
")",
":",
"if",
"cmd_id",
"<",
"0",
"or",
"cmd_id",
">=",
"2",
"**",
"16",
":",
"raise",
"ArgumentError",
"(",
"\"Command ID in mib block is not a non-negative 2-byte number\"",
",",
"cmd_id",
"="... | Add a command to the TBBlock.
The cmd_id must be a non-negative 2 byte number.
handler should be the command handler | [
"Add",
"a",
"command",
"to",
"the",
"TBBlock",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/tilebus/block.py#L112-L128 | train |
iotile/coretools | iotilebuild/iotile/build/tilebus/block.py | TBBlock.add_config | def add_config(self, config_id, config_data):
"""Add a configuration variable to the MIB block"""
if config_id < 0 or config_id >= 2**16:
raise ArgumentError("Config ID in mib block is not a non-negative 2-byte number",
config_data=config_id, data=config_data... | python | def add_config(self, config_id, config_data):
"""Add a configuration variable to the MIB block"""
if config_id < 0 or config_id >= 2**16:
raise ArgumentError("Config ID in mib block is not a non-negative 2-byte number",
config_data=config_id, data=config_data... | [
"def",
"add_config",
"(",
"self",
",",
"config_id",
",",
"config_data",
")",
":",
"if",
"config_id",
"<",
"0",
"or",
"config_id",
">=",
"2",
"**",
"16",
":",
"raise",
"ArgumentError",
"(",
"\"Config ID in mib block is not a non-negative 2-byte number\"",
",",
"con... | Add a configuration variable to the MIB block | [
"Add",
"a",
"configuration",
"variable",
"to",
"the",
"MIB",
"block"
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/tilebus/block.py#L130-L141 | train |
iotile/coretools | iotilebuild/iotile/build/tilebus/block.py | TBBlock._parse_hwtype | def _parse_hwtype(self):
"""Convert the numerical hardware id to a chip name."""
self.chip_name = KNOWN_HARDWARE_TYPES.get(self.hw_type, "Unknown Chip (type=%d)" % self.hw_type) | python | def _parse_hwtype(self):
"""Convert the numerical hardware id to a chip name."""
self.chip_name = KNOWN_HARDWARE_TYPES.get(self.hw_type, "Unknown Chip (type=%d)" % self.hw_type) | [
"def",
"_parse_hwtype",
"(",
"self",
")",
":",
"self",
".",
"chip_name",
"=",
"KNOWN_HARDWARE_TYPES",
".",
"get",
"(",
"self",
".",
"hw_type",
",",
"\"Unknown Chip (type=%d)\"",
"%",
"self",
".",
"hw_type",
")"
] | Convert the numerical hardware id to a chip name. | [
"Convert",
"the",
"numerical",
"hardware",
"id",
"to",
"a",
"chip",
"name",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/tilebus/block.py#L143-L146 | train |
iotile/coretools | iotilebuild/iotile/build/tilebus/block.py | TBBlock.render_template | def render_template(self, template_name, out_path=None):
"""Render a template based on this TileBus Block.
The template has access to all of the attributes of this block as a
dictionary (the result of calling self.to_dict()).
You can optionally render to a file by passing out_path.
... | python | def render_template(self, template_name, out_path=None):
"""Render a template based on this TileBus Block.
The template has access to all of the attributes of this block as a
dictionary (the result of calling self.to_dict()).
You can optionally render to a file by passing out_path.
... | [
"def",
"render_template",
"(",
"self",
",",
"template_name",
",",
"out_path",
"=",
"None",
")",
":",
"return",
"render_template",
"(",
"template_name",
",",
"self",
".",
"to_dict",
"(",
")",
",",
"out_path",
"=",
"out_path",
")"
] | Render a template based on this TileBus Block.
The template has access to all of the attributes of this block as a
dictionary (the result of calling self.to_dict()).
You can optionally render to a file by passing out_path.
Args:
template_name (str): The name of the templat... | [
"Render",
"a",
"template",
"based",
"on",
"this",
"TileBus",
"Block",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/tilebus/block.py#L148-L166 | train |
iotile/coretools | iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/packaging/__init__.py | Tag | def Tag(env, target, source, *more_tags, **kw_tags):
""" Tag a file with the given arguments, just sets the accordingly named
attribute on the file object.
TODO: FIXME
"""
if not target:
target=source
first_tag=None
else:
first_tag=source
if first_tag:
kw_ta... | python | def Tag(env, target, source, *more_tags, **kw_tags):
""" Tag a file with the given arguments, just sets the accordingly named
attribute on the file object.
TODO: FIXME
"""
if not target:
target=source
first_tag=None
else:
first_tag=source
if first_tag:
kw_ta... | [
"def",
"Tag",
"(",
"env",
",",
"target",
",",
"source",
",",
"*",
"more_tags",
",",
"**",
"kw_tags",
")",
":",
"if",
"not",
"target",
":",
"target",
"=",
"source",
"first_tag",
"=",
"None",
"else",
":",
"first_tag",
"=",
"source",
"if",
"first_tag",
... | Tag a file with the given arguments, just sets the accordingly named
attribute on the file object.
TODO: FIXME | [
"Tag",
"a",
"file",
"with",
"the",
"given",
"arguments",
"just",
"sets",
"the",
"accordingly",
"named",
"attribute",
"on",
"the",
"file",
"object",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/packaging/__init__.py#L44-L82 | train |
iotile/coretools | iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/packaging/__init__.py | copy_attr | def copy_attr(f1, f2):
""" copies the special packaging file attributes from f1 to f2.
"""
copyit = lambda x: not hasattr(f2, x) and x[:10] == 'PACKAGING_'
if f1._tags:
pattrs = [tag for tag in f1._tags if copyit(tag)]
for attr in pattrs:
f2.Tag(attr, f1.GetTag(attr)) | python | def copy_attr(f1, f2):
""" copies the special packaging file attributes from f1 to f2.
"""
copyit = lambda x: not hasattr(f2, x) and x[:10] == 'PACKAGING_'
if f1._tags:
pattrs = [tag for tag in f1._tags if copyit(tag)]
for attr in pattrs:
f2.Tag(attr, f1.GetTag(attr)) | [
"def",
"copy_attr",
"(",
"f1",
",",
"f2",
")",
":",
"copyit",
"=",
"lambda",
"x",
":",
"not",
"hasattr",
"(",
"f2",
",",
"x",
")",
"and",
"x",
"[",
":",
"10",
"]",
"==",
"'PACKAGING_'",
"if",
"f1",
".",
"_tags",
":",
"pattrs",
"=",
"[",
"tag",
... | copies the special packaging file attributes from f1 to f2. | [
"copies",
"the",
"special",
"packaging",
"file",
"attributes",
"from",
"f1",
"to",
"f2",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/packaging/__init__.py#L231-L238 | train |
iotile/coretools | iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/packaging/__init__.py | putintopackageroot | def putintopackageroot(target, source, env, pkgroot, honor_install_location=1):
""" Uses the CopyAs builder to copy all source files to the directory given
in pkgroot.
If honor_install_location is set and the copied source file has an
PACKAGING_INSTALL_LOCATION attribute, the PACKAGING_INSTALL_LOCATION... | python | def putintopackageroot(target, source, env, pkgroot, honor_install_location=1):
""" Uses the CopyAs builder to copy all source files to the directory given
in pkgroot.
If honor_install_location is set and the copied source file has an
PACKAGING_INSTALL_LOCATION attribute, the PACKAGING_INSTALL_LOCATION... | [
"def",
"putintopackageroot",
"(",
"target",
",",
"source",
",",
"env",
",",
"pkgroot",
",",
"honor_install_location",
"=",
"1",
")",
":",
"if",
"SCons",
".",
"Util",
".",
"is_String",
"(",
"pkgroot",
")",
":",
"pkgroot",
"=",
"env",
".",
"Dir",
"(",
"p... | Uses the CopyAs builder to copy all source files to the directory given
in pkgroot.
If honor_install_location is set and the copied source file has an
PACKAGING_INSTALL_LOCATION attribute, the PACKAGING_INSTALL_LOCATION is
used as the new name of the source file under pkgroot.
The source file will... | [
"Uses",
"the",
"CopyAs",
"builder",
"to",
"copy",
"all",
"source",
"files",
"to",
"the",
"directory",
"given",
"in",
"pkgroot",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/packaging/__init__.py#L240-L275 | train |
iotile/coretools | iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/packaging/__init__.py | stripinstallbuilder | def stripinstallbuilder(target, source, env):
""" Strips the install builder action from the source list and stores
the final installation location as the "PACKAGING_INSTALL_LOCATION" of
the source of the source file. This effectively removes the final installed
files from the source list while remember... | python | def stripinstallbuilder(target, source, env):
""" Strips the install builder action from the source list and stores
the final installation location as the "PACKAGING_INSTALL_LOCATION" of
the source of the source file. This effectively removes the final installed
files from the source list while remember... | [
"def",
"stripinstallbuilder",
"(",
"target",
",",
"source",
",",
"env",
")",
":",
"def",
"has_no_install_location",
"(",
"file",
")",
":",
"return",
"not",
"(",
"file",
".",
"has_builder",
"(",
")",
"and",
"hasattr",
"(",
"file",
".",
"builder",
",",
"'n... | Strips the install builder action from the source list and stores
the final installation location as the "PACKAGING_INSTALL_LOCATION" of
the source of the source file. This effectively removes the final installed
files from the source list while remembering the installation location.
It also warns abou... | [
"Strips",
"the",
"install",
"builder",
"action",
"from",
"the",
"source",
"list",
"and",
"stores",
"the",
"final",
"installation",
"location",
"as",
"the",
"PACKAGING_INSTALL_LOCATION",
"of",
"the",
"source",
"of",
"the",
"source",
"file",
".",
"This",
"effectiv... | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/packaging/__init__.py#L277-L305 | train |
iotile/coretools | iotilesensorgraph/iotile/sg/walker.py | BufferedStreamWalker.restore | def restore(self, state):
"""Restore a previous state of this stream walker.
Raises:
ArgumentError: If the state refers to a different selector or the
offset is invalid.
"""
selector = DataStreamSelector.FromString(state.get(u'selector'))
if selector... | python | def restore(self, state):
"""Restore a previous state of this stream walker.
Raises:
ArgumentError: If the state refers to a different selector or the
offset is invalid.
"""
selector = DataStreamSelector.FromString(state.get(u'selector'))
if selector... | [
"def",
"restore",
"(",
"self",
",",
"state",
")",
":",
"selector",
"=",
"DataStreamSelector",
".",
"FromString",
"(",
"state",
".",
"get",
"(",
"u'selector'",
")",
")",
"if",
"selector",
"!=",
"self",
".",
"selector",
":",
"raise",
"ArgumentError",
"(",
... | Restore a previous state of this stream walker.
Raises:
ArgumentError: If the state refers to a different selector or the
offset is invalid. | [
"Restore",
"a",
"previous",
"state",
"of",
"this",
"stream",
"walker",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilesensorgraph/iotile/sg/walker.py#L85-L98 | train |
iotile/coretools | iotilesensorgraph/iotile/sg/walker.py | BufferedStreamWalker.pop | def pop(self):
"""Pop a reading off of this stream and return it."""
if self._count == 0:
raise StreamEmptyError("Pop called on buffered stream walker without any data", selector=self.selector)
while True:
curr = self.engine.get(self.storage_type, self.offset)
... | python | def pop(self):
"""Pop a reading off of this stream and return it."""
if self._count == 0:
raise StreamEmptyError("Pop called on buffered stream walker without any data", selector=self.selector)
while True:
curr = self.engine.get(self.storage_type, self.offset)
... | [
"def",
"pop",
"(",
"self",
")",
":",
"if",
"self",
".",
"_count",
"==",
"0",
":",
"raise",
"StreamEmptyError",
"(",
"\"Pop called on buffered stream walker without any data\"",
",",
"selector",
"=",
"self",
".",
"selector",
")",
"while",
"True",
":",
"curr",
"... | Pop a reading off of this stream and return it. | [
"Pop",
"a",
"reading",
"off",
"of",
"this",
"stream",
"and",
"return",
"it",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilesensorgraph/iotile/sg/walker.py#L105-L118 | train |
iotile/coretools | iotilesensorgraph/iotile/sg/walker.py | BufferedStreamWalker.seek | def seek(self, value, target="offset"):
"""Seek this stream to a specific offset or reading id.
There are two modes of use. You can seek to a specific reading id,
which means the walker will be positioned exactly at the reading
pointed to by the reading ID. If the reading id cannot be... | python | def seek(self, value, target="offset"):
"""Seek this stream to a specific offset or reading id.
There are two modes of use. You can seek to a specific reading id,
which means the walker will be positioned exactly at the reading
pointed to by the reading ID. If the reading id cannot be... | [
"def",
"seek",
"(",
"self",
",",
"value",
",",
"target",
"=",
"\"offset\"",
")",
":",
"if",
"target",
"not",
"in",
"(",
"u'offset'",
",",
"u'id'",
")",
":",
"raise",
"ArgumentError",
"(",
"\"You must specify target as either offset or id\"",
",",
"target",
"="... | Seek this stream to a specific offset or reading id.
There are two modes of use. You can seek to a specific reading id,
which means the walker will be positioned exactly at the reading
pointed to by the reading ID. If the reading id cannot be found
an exception will be raised. The re... | [
"Seek",
"this",
"stream",
"to",
"a",
"specific",
"offset",
"or",
"reading",
"id",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilesensorgraph/iotile/sg/walker.py#L120-L179 | train |
iotile/coretools | iotilesensorgraph/iotile/sg/walker.py | BufferedStreamWalker.skip_all | def skip_all(self):
"""Skip all readings in this walker."""
storage, streaming = self.engine.count()
if self.selector.output:
self.offset = streaming
else:
self.offset = storage
self._count = 0 | python | def skip_all(self):
"""Skip all readings in this walker."""
storage, streaming = self.engine.count()
if self.selector.output:
self.offset = streaming
else:
self.offset = storage
self._count = 0 | [
"def",
"skip_all",
"(",
"self",
")",
":",
"storage",
",",
"streaming",
"=",
"self",
".",
"engine",
".",
"count",
"(",
")",
"if",
"self",
".",
"selector",
".",
"output",
":",
"self",
".",
"offset",
"=",
"streaming",
"else",
":",
"self",
".",
"offset",... | Skip all readings in this walker. | [
"Skip",
"all",
"readings",
"in",
"this",
"walker",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilesensorgraph/iotile/sg/walker.py#L228-L238 | train |
iotile/coretools | iotilesensorgraph/iotile/sg/walker.py | BufferedStreamWalker.notify_rollover | def notify_rollover(self, stream):
"""Notify that a reading in the given stream was overwritten.
Args:
stream (DataStream): The stream that had overwritten data.
"""
self.offset -= 1
if not self.matches(stream):
return
if self._count == 0:
... | python | def notify_rollover(self, stream):
"""Notify that a reading in the given stream was overwritten.
Args:
stream (DataStream): The stream that had overwritten data.
"""
self.offset -= 1
if not self.matches(stream):
return
if self._count == 0:
... | [
"def",
"notify_rollover",
"(",
"self",
",",
"stream",
")",
":",
"self",
".",
"offset",
"-=",
"1",
"if",
"not",
"self",
".",
"matches",
"(",
"stream",
")",
":",
"return",
"if",
"self",
".",
"_count",
"==",
"0",
":",
"raise",
"InternalError",
"(",
"\"B... | Notify that a reading in the given stream was overwritten.
Args:
stream (DataStream): The stream that had overwritten data. | [
"Notify",
"that",
"a",
"reading",
"in",
"the",
"given",
"stream",
"was",
"overwritten",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilesensorgraph/iotile/sg/walker.py#L252-L267 | train |
iotile/coretools | iotilesensorgraph/iotile/sg/walker.py | VirtualStreamWalker.dump | def dump(self):
"""Serialize the state of this stream walker.
Returns:
dict: The serialized state.
"""
reading = self.reading
if reading is not None:
reading = reading.asdict()
return {
u'selector': str(self.selector),
u'... | python | def dump(self):
"""Serialize the state of this stream walker.
Returns:
dict: The serialized state.
"""
reading = self.reading
if reading is not None:
reading = reading.asdict()
return {
u'selector': str(self.selector),
u'... | [
"def",
"dump",
"(",
"self",
")",
":",
"reading",
"=",
"self",
".",
"reading",
"if",
"reading",
"is",
"not",
"None",
":",
"reading",
"=",
"reading",
".",
"asdict",
"(",
")",
"return",
"{",
"u'selector'",
":",
"str",
"(",
"self",
".",
"selector",
")",
... | Serialize the state of this stream walker.
Returns:
dict: The serialized state. | [
"Serialize",
"the",
"state",
"of",
"this",
"stream",
"walker",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilesensorgraph/iotile/sg/walker.py#L286-L300 | train |
iotile/coretools | iotilesensorgraph/iotile/sg/walker.py | CounterStreamWalker.peek | def peek(self):
"""Peek at the oldest reading in this virtual stream."""
if self.reading is None:
raise StreamEmptyError("peek called on virtual stream walker without any data", selector=self.selector)
return self.reading | python | def peek(self):
"""Peek at the oldest reading in this virtual stream."""
if self.reading is None:
raise StreamEmptyError("peek called on virtual stream walker without any data", selector=self.selector)
return self.reading | [
"def",
"peek",
"(",
"self",
")",
":",
"if",
"self",
".",
"reading",
"is",
"None",
":",
"raise",
"StreamEmptyError",
"(",
"\"peek called on virtual stream walker without any data\"",
",",
"selector",
"=",
"self",
".",
"selector",
")",
"return",
"self",
".",
"read... | Peek at the oldest reading in this virtual stream. | [
"Peek",
"at",
"the",
"oldest",
"reading",
"in",
"this",
"virtual",
"stream",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilesensorgraph/iotile/sg/walker.py#L481-L487 | train |
iotile/coretools | iotilecore/iotile/core/utilities/linebuffer_ui.py | LinebufferUI.run | def run(self, refresh_interval=0.05):
"""Set up the loop, check that the tool is installed"""
try:
from asciimatics.screen import Screen
except ImportError:
raise ExternalError("You must have asciimatics installed to use LinebufferUI",
sugg... | python | def run(self, refresh_interval=0.05):
"""Set up the loop, check that the tool is installed"""
try:
from asciimatics.screen import Screen
except ImportError:
raise ExternalError("You must have asciimatics installed to use LinebufferUI",
sugg... | [
"def",
"run",
"(",
"self",
",",
"refresh_interval",
"=",
"0.05",
")",
":",
"try",
":",
"from",
"asciimatics",
".",
"screen",
"import",
"Screen",
"except",
"ImportError",
":",
"raise",
"ExternalError",
"(",
"\"You must have asciimatics installed to use LinebufferUI\"",... | Set up the loop, check that the tool is installed | [
"Set",
"up",
"the",
"loop",
"check",
"that",
"the",
"tool",
"is",
"installed"
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilecore/iotile/core/utilities/linebuffer_ui.py#L62-L70 | train |
iotile/coretools | iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/MSCommon/vc.py | find_vc_pdir | def find_vc_pdir(msvc_version):
"""Try to find the product directory for the given
version.
Note
----
If for some reason the requested version could not be found, an
exception which inherits from VisualCException will be raised."""
root = 'Software\\'
try:
hkeys = _VCVER_TO_PROD... | python | def find_vc_pdir(msvc_version):
"""Try to find the product directory for the given
version.
Note
----
If for some reason the requested version could not be found, an
exception which inherits from VisualCException will be raised."""
root = 'Software\\'
try:
hkeys = _VCVER_TO_PROD... | [
"def",
"find_vc_pdir",
"(",
"msvc_version",
")",
":",
"root",
"=",
"'Software\\\\'",
"try",
":",
"hkeys",
"=",
"_VCVER_TO_PRODUCT_DIR",
"[",
"msvc_version",
"]",
"except",
"KeyError",
":",
"debug",
"(",
"\"Unknown version of MSVC: %s\"",
"%",
"msvc_version",
")",
... | Try to find the product directory for the given
version.
Note
----
If for some reason the requested version could not be found, an
exception which inherits from VisualCException will be raised. | [
"Try",
"to",
"find",
"the",
"product",
"directory",
"for",
"the",
"given",
"version",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/MSCommon/vc.py#L257-L300 | train |
iotile/coretools | iotilesensorgraph/iotile/sg/compiler.py | compile_sgf | def compile_sgf(in_path, optimize=True, model=None):
"""Compile and optionally optimize an SGF file.
Args:
in_path (str): The input path to the sgf file to compile.
optimize (bool): Whether to optimize the compiled result,
defaults to True if not passed.
model (DeviceModel):... | python | def compile_sgf(in_path, optimize=True, model=None):
"""Compile and optionally optimize an SGF file.
Args:
in_path (str): The input path to the sgf file to compile.
optimize (bool): Whether to optimize the compiled result,
defaults to True if not passed.
model (DeviceModel):... | [
"def",
"compile_sgf",
"(",
"in_path",
",",
"optimize",
"=",
"True",
",",
"model",
"=",
"None",
")",
":",
"if",
"model",
"is",
"None",
":",
"model",
"=",
"DeviceModel",
"(",
")",
"parser",
"=",
"SensorGraphFileParser",
"(",
")",
"parser",
".",
"parse_file... | Compile and optionally optimize an SGF file.
Args:
in_path (str): The input path to the sgf file to compile.
optimize (bool): Whether to optimize the compiled result,
defaults to True if not passed.
model (DeviceModel): Optional device model if we are
compiling for a... | [
"Compile",
"and",
"optionally",
"optimize",
"an",
"SGF",
"file",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilesensorgraph/iotile/sg/compiler.py#L8-L34 | train |
iotile/coretools | iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/g77.py | generate | def generate(env):
"""Add Builders and construction variables for g77 to an Environment."""
add_all_to_env(env)
add_f77_to_env(env)
fcomp = env.Detect(compilers) or 'g77'
if env['PLATFORM'] in ['cygwin', 'win32']:
env['SHFORTRANFLAGS'] = SCons.Util.CLVar('$FORTRANFLAGS')
env['SHF77F... | python | def generate(env):
"""Add Builders and construction variables for g77 to an Environment."""
add_all_to_env(env)
add_f77_to_env(env)
fcomp = env.Detect(compilers) or 'g77'
if env['PLATFORM'] in ['cygwin', 'win32']:
env['SHFORTRANFLAGS'] = SCons.Util.CLVar('$FORTRANFLAGS')
env['SHF77F... | [
"def",
"generate",
"(",
"env",
")",
":",
"add_all_to_env",
"(",
"env",
")",
"add_f77_to_env",
"(",
"env",
")",
"fcomp",
"=",
"env",
".",
"Detect",
"(",
"compilers",
")",
"or",
"'g77'",
"if",
"env",
"[",
"'PLATFORM'",
"]",
"in",
"[",
"'cygwin'",
",",
... | Add Builders and construction variables for g77 to an Environment. | [
"Add",
"Builders",
"and",
"construction",
"variables",
"for",
"g77",
"to",
"an",
"Environment",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/g77.py#L41-L64 | train |
iotile/coretools | iotilesensorgraph/iotile/sg/parser/language.py | get_language | def get_language():
"""Create or retrieve the parse tree for defining a sensor graph."""
global sensor_graph, statement
if sensor_graph is not None:
return sensor_graph
_create_primitives()
_create_simple_statements()
_create_block_bnf()
sensor_graph = ZeroOrMore(statement) + Str... | python | def get_language():
"""Create or retrieve the parse tree for defining a sensor graph."""
global sensor_graph, statement
if sensor_graph is not None:
return sensor_graph
_create_primitives()
_create_simple_statements()
_create_block_bnf()
sensor_graph = ZeroOrMore(statement) + Str... | [
"def",
"get_language",
"(",
")",
":",
"global",
"sensor_graph",
",",
"statement",
"if",
"sensor_graph",
"is",
"not",
"None",
":",
"return",
"sensor_graph",
"_create_primitives",
"(",
")",
"_create_simple_statements",
"(",
")",
"_create_block_bnf",
"(",
")",
"senso... | Create or retrieve the parse tree for defining a sensor graph. | [
"Create",
"or",
"retrieve",
"the",
"parse",
"tree",
"for",
"defining",
"a",
"sensor",
"graph",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilesensorgraph/iotile/sg/parser/language.py#L142-L157 | train |
iotile/coretools | iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/msgfmt.py | _create_mo_file_builder | def _create_mo_file_builder(env, **kw):
""" Create builder object for `MOFiles` builder """
import SCons.Action
# FIXME: What factory use for source? Ours or their?
kw['action'] = SCons.Action.Action('$MSGFMTCOM','$MSGFMTCOMSTR')
kw['suffix'] = '$MOSUFFIX'
kw['src_suffix'] = '$POSUFFIX'
kw['src_builder'] ... | python | def _create_mo_file_builder(env, **kw):
""" Create builder object for `MOFiles` builder """
import SCons.Action
# FIXME: What factory use for source? Ours or their?
kw['action'] = SCons.Action.Action('$MSGFMTCOM','$MSGFMTCOMSTR')
kw['suffix'] = '$MOSUFFIX'
kw['src_suffix'] = '$POSUFFIX'
kw['src_builder'] ... | [
"def",
"_create_mo_file_builder",
"(",
"env",
",",
"**",
"kw",
")",
":",
"import",
"SCons",
".",
"Action",
"kw",
"[",
"'action'",
"]",
"=",
"SCons",
".",
"Action",
".",
"Action",
"(",
"'$MSGFMTCOM'",
",",
"'$MSGFMTCOMSTR'",
")",
"kw",
"[",
"'suffix'",
"]... | Create builder object for `MOFiles` builder | [
"Create",
"builder",
"object",
"for",
"MOFiles",
"builder"
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/msgfmt.py#L63-L72 | train |
iotile/coretools | iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/msgfmt.py | generate | def generate(env,**kw):
""" Generate `msgfmt` tool """
import SCons.Util
from SCons.Tool.GettextCommon import _detect_msgfmt
try:
env['MSGFMT'] = _detect_msgfmt(env)
except:
env['MSGFMT'] = 'msgfmt'
env.SetDefault(
MSGFMTFLAGS = [ SCons.Util.CLVar('-c') ],
MSGFMTCOM = '$MSGFMT $MSGFMTFLAGS -... | python | def generate(env,**kw):
""" Generate `msgfmt` tool """
import SCons.Util
from SCons.Tool.GettextCommon import _detect_msgfmt
try:
env['MSGFMT'] = _detect_msgfmt(env)
except:
env['MSGFMT'] = 'msgfmt'
env.SetDefault(
MSGFMTFLAGS = [ SCons.Util.CLVar('-c') ],
MSGFMTCOM = '$MSGFMT $MSGFMTFLAGS -... | [
"def",
"generate",
"(",
"env",
",",
"**",
"kw",
")",
":",
"import",
"SCons",
".",
"Util",
"from",
"SCons",
".",
"Tool",
".",
"GettextCommon",
"import",
"_detect_msgfmt",
"try",
":",
"env",
"[",
"'MSGFMT'",
"]",
"=",
"_detect_msgfmt",
"(",
"env",
")",
"... | Generate `msgfmt` tool | [
"Generate",
"msgfmt",
"tool"
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/msgfmt.py#L76-L91 | train |
iotile/coretools | iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Scanner/RC.py | RCScan | def RCScan():
"""Return a prototype Scanner instance for scanning RC source files"""
res_re= r'^(?:\s*#\s*(?:include)|' \
'.*?\s+(?:ICON|BITMAP|CURSOR|HTML|FONT|MESSAGETABLE|TYPELIB|REGISTRY|D3DFX)' \
'\s*.*?)' \
'\s*(<|"| )([^>"\s]+)(?:[>"\s])*$'
resScanner = SCons.Scan... | python | def RCScan():
"""Return a prototype Scanner instance for scanning RC source files"""
res_re= r'^(?:\s*#\s*(?:include)|' \
'.*?\s+(?:ICON|BITMAP|CURSOR|HTML|FONT|MESSAGETABLE|TYPELIB|REGISTRY|D3DFX)' \
'\s*.*?)' \
'\s*(<|"| )([^>"\s]+)(?:[>"\s])*$'
resScanner = SCons.Scan... | [
"def",
"RCScan",
"(",
")",
":",
"res_re",
"=",
"r'^(?:\\s*#\\s*(?:include)|'",
"'.*?\\s+(?:ICON|BITMAP|CURSOR|HTML|FONT|MESSAGETABLE|TYPELIB|REGISTRY|D3DFX)'",
"'\\s*.*?)'",
"'\\s*(<|\"| )([^>\"\\s]+)(?:[>\"\\s])*$'",
"resScanner",
"=",
"SCons",
".",
"Scanner",
".",
"ClassicCPP",
... | Return a prototype Scanner instance for scanning RC source files | [
"Return",
"a",
"prototype",
"Scanner",
"instance",
"for",
"scanning",
"RC",
"source",
"files"
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Scanner/RC.py#L47-L60 | train |
iotile/coretools | iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/GettextCommon.py | _read_linguas_from_files | def _read_linguas_from_files(env, linguas_files=None):
""" Parse `LINGUAS` file and return list of extracted languages """
import SCons.Util
import SCons.Environment
global _re_comment
global _re_lang
if not SCons.Util.is_List(linguas_files) \
and not SCons.Util.is_String(linguas_fil... | python | def _read_linguas_from_files(env, linguas_files=None):
""" Parse `LINGUAS` file and return list of extracted languages """
import SCons.Util
import SCons.Environment
global _re_comment
global _re_lang
if not SCons.Util.is_List(linguas_files) \
and not SCons.Util.is_String(linguas_fil... | [
"def",
"_read_linguas_from_files",
"(",
"env",
",",
"linguas_files",
"=",
"None",
")",
":",
"import",
"SCons",
".",
"Util",
"import",
"SCons",
".",
"Environment",
"global",
"_re_comment",
"global",
"_re_lang",
"if",
"not",
"SCons",
".",
"Util",
".",
"is_List",... | Parse `LINGUAS` file and return list of extracted languages | [
"Parse",
"LINGUAS",
"file",
"and",
"return",
"list",
"of",
"extracted",
"languages"
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/GettextCommon.py#L131-L151 | train |
iotile/coretools | iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/GettextCommon.py | _init_po_files | def _init_po_files(target, source, env):
""" Action function for `POInit` builder. """
nop = lambda target, source, env: 0
if 'POAUTOINIT' in env:
autoinit = env['POAUTOINIT']
else:
autoinit = False
# Well, if everything outside works well, this loop should do single
# iteration.... | python | def _init_po_files(target, source, env):
""" Action function for `POInit` builder. """
nop = lambda target, source, env: 0
if 'POAUTOINIT' in env:
autoinit = env['POAUTOINIT']
else:
autoinit = False
# Well, if everything outside works well, this loop should do single
# iteration.... | [
"def",
"_init_po_files",
"(",
"target",
",",
"source",
",",
"env",
")",
":",
"nop",
"=",
"lambda",
"target",
",",
"source",
",",
"env",
":",
"0",
"if",
"'POAUTOINIT'",
"in",
"env",
":",
"autoinit",
"=",
"env",
"[",
"'POAUTOINIT'",
"]",
"else",
":",
"... | Action function for `POInit` builder. | [
"Action",
"function",
"for",
"POInit",
"builder",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/GettextCommon.py#L362-L383 | train |
iotile/coretools | iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/GettextCommon.py | _POTargetFactory._create_node | def _create_node(self, name, factory, directory=None, create=1):
""" Create node, and set it up to factory settings. """
import SCons.Util
node = factory(name, directory, create)
node.set_noclean(self.noclean)
node.set_precious(self.precious)
if self.nodefault:
... | python | def _create_node(self, name, factory, directory=None, create=1):
""" Create node, and set it up to factory settings. """
import SCons.Util
node = factory(name, directory, create)
node.set_noclean(self.noclean)
node.set_precious(self.precious)
if self.nodefault:
... | [
"def",
"_create_node",
"(",
"self",
",",
"name",
",",
"factory",
",",
"directory",
"=",
"None",
",",
"create",
"=",
"1",
")",
":",
"import",
"SCons",
".",
"Util",
"node",
"=",
"factory",
"(",
"name",
",",
"directory",
",",
"create",
")",
"node",
".",... | Create node, and set it up to factory settings. | [
"Create",
"node",
"and",
"set",
"it",
"up",
"to",
"factory",
"settings",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/GettextCommon.py#L102-L112 | train |
iotile/coretools | iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/GettextCommon.py | _POTargetFactory.Entry | def Entry(self, name, directory=None, create=1):
""" Create `SCons.Node.FS.Entry` """
return self._create_node(name, self.env.fs.Entry, directory, create) | python | def Entry(self, name, directory=None, create=1):
""" Create `SCons.Node.FS.Entry` """
return self._create_node(name, self.env.fs.Entry, directory, create) | [
"def",
"Entry",
"(",
"self",
",",
"name",
",",
"directory",
"=",
"None",
",",
"create",
"=",
"1",
")",
":",
"return",
"self",
".",
"_create_node",
"(",
"name",
",",
"self",
".",
"env",
".",
"fs",
".",
"Entry",
",",
"directory",
",",
"create",
")"
] | Create `SCons.Node.FS.Entry` | [
"Create",
"SCons",
".",
"Node",
".",
"FS",
".",
"Entry"
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/GettextCommon.py#L114-L116 | train |
iotile/coretools | iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/GettextCommon.py | _POTargetFactory.File | def File(self, name, directory=None, create=1):
""" Create `SCons.Node.FS.File` """
return self._create_node(name, self.env.fs.File, directory, create) | python | def File(self, name, directory=None, create=1):
""" Create `SCons.Node.FS.File` """
return self._create_node(name, self.env.fs.File, directory, create) | [
"def",
"File",
"(",
"self",
",",
"name",
",",
"directory",
"=",
"None",
",",
"create",
"=",
"1",
")",
":",
"return",
"self",
".",
"_create_node",
"(",
"name",
",",
"self",
".",
"env",
".",
"fs",
".",
"File",
",",
"directory",
",",
"create",
")"
] | Create `SCons.Node.FS.File` | [
"Create",
"SCons",
".",
"Node",
".",
"FS",
".",
"File"
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilebuild/iotile/build/config/scons-local-3.0.1/SCons/Tool/GettextCommon.py#L118-L120 | train |
iotile/coretools | iotilesensorgraph/iotile/sg/parser/stream_allocator.py | StreamAllocator.allocate_stream | def allocate_stream(self, stream_type, stream_id=None, previous=None, attach=False):
"""Allocate a new stream of the given type.
The stream is allocated with an incremental ID starting at
StreamAllocator.StartingID. The returned data stream can always
be used to to attach a NodeInput t... | python | def allocate_stream(self, stream_type, stream_id=None, previous=None, attach=False):
"""Allocate a new stream of the given type.
The stream is allocated with an incremental ID starting at
StreamAllocator.StartingID. The returned data stream can always
be used to to attach a NodeInput t... | [
"def",
"allocate_stream",
"(",
"self",
",",
"stream_type",
",",
"stream_id",
"=",
"None",
",",
"previous",
"=",
"None",
",",
"attach",
"=",
"False",
")",
":",
"if",
"stream_type",
"not",
"in",
"DataStream",
".",
"TypeToString",
":",
"raise",
"ArgumentError",... | Allocate a new stream of the given type.
The stream is allocated with an incremental ID starting at
StreamAllocator.StartingID. The returned data stream can always
be used to to attach a NodeInput to this stream, however the
attach_stream() function should always be called first since ... | [
"Allocate",
"a",
"new",
"stream",
"of",
"the",
"given",
"type",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilesensorgraph/iotile/sg/parser/stream_allocator.py#L30-L84 | train |
iotile/coretools | iotilesensorgraph/iotile/sg/parser/stream_allocator.py | StreamAllocator.attach_stream | def attach_stream(self, stream):
"""Notify that we would like to attach a node input to this stream.
The return value from this function is the DataStream that should be attached
to since this function may internally allocate a new SGNode that copies the
stream if there is no space in t... | python | def attach_stream(self, stream):
"""Notify that we would like to attach a node input to this stream.
The return value from this function is the DataStream that should be attached
to since this function may internally allocate a new SGNode that copies the
stream if there is no space in t... | [
"def",
"attach_stream",
"(",
"self",
",",
"stream",
")",
":",
"curr_stream",
",",
"count",
",",
"prev",
"=",
"self",
".",
"_allocated_streams",
"[",
"stream",
"]",
"if",
"count",
"==",
"(",
"self",
".",
"model",
".",
"get",
"(",
"u'max_node_outputs'",
")... | Notify that we would like to attach a node input to this stream.
The return value from this function is the DataStream that should be attached
to since this function may internally allocate a new SGNode that copies the
stream if there is no space in the output list to hold another input.
... | [
"Notify",
"that",
"we",
"would",
"like",
"to",
"attach",
"a",
"node",
"input",
"to",
"this",
"stream",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilesensorgraph/iotile/sg/parser/stream_allocator.py#L86-L124 | train |
iotile/coretools | iotilecore/iotile/core/dev/iotileobj.py | IOTile._find_v1_settings | def _find_v1_settings(self, settings):
"""Parse a v1 module_settings.json file.
V1 is the older file format that requires a modules dictionary with a
module_name and modules key that could in theory hold information on
multiple modules in a single directory.
"""
if 'mod... | python | def _find_v1_settings(self, settings):
"""Parse a v1 module_settings.json file.
V1 is the older file format that requires a modules dictionary with a
module_name and modules key that could in theory hold information on
multiple modules in a single directory.
"""
if 'mod... | [
"def",
"_find_v1_settings",
"(",
"self",
",",
"settings",
")",
":",
"if",
"'module_name'",
"in",
"settings",
":",
"modname",
"=",
"settings",
"[",
"'module_name'",
"]",
"if",
"'modules'",
"not",
"in",
"settings",
"or",
"len",
"(",
"settings",
"[",
"'modules'... | Parse a v1 module_settings.json file.
V1 is the older file format that requires a modules dictionary with a
module_name and modules key that could in theory hold information on
multiple modules in a single directory. | [
"Parse",
"a",
"v1",
"module_settings",
".",
"json",
"file",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilecore/iotile/core/dev/iotileobj.py#L129-L158 | train |
iotile/coretools | iotilecore/iotile/core/dev/iotileobj.py | IOTile._ensure_product_string | def _ensure_product_string(cls, product):
"""Ensure that all product locations are strings.
Older components specify paths as lists of path components. Join
those paths into a normal path string.
"""
if isinstance(product, str):
return product
if isinstanc... | python | def _ensure_product_string(cls, product):
"""Ensure that all product locations are strings.
Older components specify paths as lists of path components. Join
those paths into a normal path string.
"""
if isinstance(product, str):
return product
if isinstanc... | [
"def",
"_ensure_product_string",
"(",
"cls",
",",
"product",
")",
":",
"if",
"isinstance",
"(",
"product",
",",
"str",
")",
":",
"return",
"product",
"if",
"isinstance",
"(",
"product",
",",
"list",
")",
":",
"return",
"os",
".",
"path",
".",
"join",
"... | Ensure that all product locations are strings.
Older components specify paths as lists of path components. Join
those paths into a normal path string. | [
"Ensure",
"that",
"all",
"product",
"locations",
"are",
"strings",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilecore/iotile/core/dev/iotileobj.py#L345-L358 | train |
iotile/coretools | iotilecore/iotile/core/dev/iotileobj.py | IOTile.find_products | def find_products(self, product_type):
"""Search for products of a given type.
Search through the products declared by this IOTile component and
return only those matching the given type. If the product is described
by the path to a file, a complete normalized path will be returned.
... | python | def find_products(self, product_type):
"""Search for products of a given type.
Search through the products declared by this IOTile component and
return only those matching the given type. If the product is described
by the path to a file, a complete normalized path will be returned.
... | [
"def",
"find_products",
"(",
"self",
",",
"product_type",
")",
":",
"if",
"self",
".",
"filter_prods",
"and",
"product_type",
"in",
"self",
".",
"LIST_PRODUCTS",
"and",
"product_type",
"not",
"in",
"self",
".",
"desired_prods",
":",
"return",
"[",
"]",
"if",... | Search for products of a given type.
Search through the products declared by this IOTile component and
return only those matching the given type. If the product is described
by the path to a file, a complete normalized path will be returned.
The path could be different depending on whe... | [
"Search",
"for",
"products",
"of",
"a",
"given",
"type",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilecore/iotile/core/dev/iotileobj.py#L374-L424 | train |
iotile/coretools | iotilecore/iotile/core/dev/iotileobj.py | IOTile.library_directories | def library_directories(self):
"""Return a list of directories containing any static libraries built by this IOTile."""
libs = self.find_products('library')
if len(libs) > 0:
return [os.path.join(self.output_folder)]
return [] | python | def library_directories(self):
"""Return a list of directories containing any static libraries built by this IOTile."""
libs = self.find_products('library')
if len(libs) > 0:
return [os.path.join(self.output_folder)]
return [] | [
"def",
"library_directories",
"(",
"self",
")",
":",
"libs",
"=",
"self",
".",
"find_products",
"(",
"'library'",
")",
"if",
"len",
"(",
"libs",
")",
">",
"0",
":",
"return",
"[",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"output_folder",
")"... | Return a list of directories containing any static libraries built by this IOTile. | [
"Return",
"a",
"list",
"of",
"directories",
"containing",
"any",
"static",
"libraries",
"built",
"by",
"this",
"IOTile",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilecore/iotile/core/dev/iotileobj.py#L426-L434 | train |
iotile/coretools | iotilecore/iotile/core/dev/iotileobj.py | IOTile.filter_products | def filter_products(self, desired_prods):
"""When asked for a product, filter only those on this list."""
self.filter_prods = True
self.desired_prods = set(desired_prods) | python | def filter_products(self, desired_prods):
"""When asked for a product, filter only those on this list."""
self.filter_prods = True
self.desired_prods = set(desired_prods) | [
"def",
"filter_products",
"(",
"self",
",",
"desired_prods",
")",
":",
"self",
".",
"filter_prods",
"=",
"True",
"self",
".",
"desired_prods",
"=",
"set",
"(",
"desired_prods",
")"
] | When asked for a product, filter only those on this list. | [
"When",
"asked",
"for",
"a",
"product",
"filter",
"only",
"those",
"on",
"this",
"list",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilecore/iotile/core/dev/iotileobj.py#L436-L440 | train |
iotile/coretools | iotilesensorgraph/iotile/sg/output_formats/ascii.py | format_ascii | def format_ascii(sensor_graph):
"""Format this sensor graph as a loadable ascii file format.
This includes commands to reset and clear previously stored
sensor graphs.
NB. This format does not include any required configuration
variables that were specified in this sensor graph, so you
should ... | python | def format_ascii(sensor_graph):
"""Format this sensor graph as a loadable ascii file format.
This includes commands to reset and clear previously stored
sensor graphs.
NB. This format does not include any required configuration
variables that were specified in this sensor graph, so you
should ... | [
"def",
"format_ascii",
"(",
"sensor_graph",
")",
":",
"cmdfile",
"=",
"CommandFile",
"(",
"\"Sensor Graph\"",
",",
"\"1.0\"",
")",
"cmdfile",
".",
"add",
"(",
"\"set_online\"",
",",
"False",
")",
"cmdfile",
".",
"add",
"(",
"\"clear\"",
")",
"cmdfile",
".",
... | Format this sensor graph as a loadable ascii file format.
This includes commands to reset and clear previously stored
sensor graphs.
NB. This format does not include any required configuration
variables that were specified in this sensor graph, so you
should also output tha information separately ... | [
"Format",
"this",
"sensor",
"graph",
"as",
"a",
"loadable",
"ascii",
"file",
"format",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilesensorgraph/iotile/sg/output_formats/ascii.py#L11-L57 | train |
iotile/coretools | iotilesensorgraph/iotile/sg/graph.py | SensorGraph.clear | def clear(self):
"""Clear all nodes from this sensor_graph.
This function is equivalent to just creating a new SensorGraph() object
from scratch. It does not clear any data from the SensorLog, however.
"""
self.roots = []
self.nodes = []
self.streamers = []
... | python | def clear(self):
"""Clear all nodes from this sensor_graph.
This function is equivalent to just creating a new SensorGraph() object
from scratch. It does not clear any data from the SensorLog, however.
"""
self.roots = []
self.nodes = []
self.streamers = []
... | [
"def",
"clear",
"(",
"self",
")",
":",
"self",
".",
"roots",
"=",
"[",
"]",
"self",
".",
"nodes",
"=",
"[",
"]",
"self",
".",
"streamers",
"=",
"[",
"]",
"self",
".",
"constant_database",
"=",
"{",
"}",
"self",
".",
"metadata_database",
"=",
"{",
... | Clear all nodes from this sensor_graph.
This function is equivalent to just creating a new SensorGraph() object
from scratch. It does not clear any data from the SensorLog, however. | [
"Clear",
"all",
"nodes",
"from",
"this",
"sensor_graph",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilesensorgraph/iotile/sg/graph.py#L55-L68 | train |
iotile/coretools | iotilesensorgraph/iotile/sg/graph.py | SensorGraph.add_node | def add_node(self, node_descriptor):
"""Add a node to the sensor graph based on the description given.
The node_descriptor must follow the sensor graph DSL and describe
a node whose input nodes already exist.
Args:
node_descriptor (str): A description of the node to be adde... | python | def add_node(self, node_descriptor):
"""Add a node to the sensor graph based on the description given.
The node_descriptor must follow the sensor graph DSL and describe
a node whose input nodes already exist.
Args:
node_descriptor (str): A description of the node to be adde... | [
"def",
"add_node",
"(",
"self",
",",
"node_descriptor",
")",
":",
"if",
"self",
".",
"_max_nodes",
"is",
"not",
"None",
"and",
"len",
"(",
"self",
".",
"nodes",
")",
">=",
"self",
".",
"_max_nodes",
":",
"raise",
"ResourceUsageError",
"(",
"\"Maximum numbe... | Add a node to the sensor graph based on the description given.
The node_descriptor must follow the sensor graph DSL and describe
a node whose input nodes already exist.
Args:
node_descriptor (str): A description of the node to be added
including its inputs, triggeri... | [
"Add",
"a",
"node",
"to",
"the",
"sensor",
"graph",
"based",
"on",
"the",
"description",
"given",
"."
] | 2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec | https://github.com/iotile/coretools/blob/2d794f5f1346b841b0dcd16c9d284e9bf2f3c6ec/iotilesensorgraph/iotile/sg/graph.py#L70-L127 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.