repo stringlengths 7 55 | path stringlengths 4 223 | func_name stringlengths 1 134 | original_string stringlengths 75 104k | language stringclasses 1
value | code stringlengths 75 104k | code_tokens listlengths 19 28.4k | docstring stringlengths 1 46.9k | docstring_tokens listlengths 1 1.97k | sha stringlengths 40 40 | url stringlengths 87 315 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
djgagne/hagelslag | hagelslag/processing/ObjectMatcher.py | ellipse_distance | def ellipse_distance(item_a, time_a, item_b, time_b, max_value):
"""
Calculate differences in the properties of ellipses fitted to each object.
Args:
item_a: STObject from the first set in ObjectMatcher
time_a: Time integer being evaluated
item_b: STObject from the second set in Obj... | python | def ellipse_distance(item_a, time_a, item_b, time_b, max_value):
"""
Calculate differences in the properties of ellipses fitted to each object.
Args:
item_a: STObject from the first set in ObjectMatcher
time_a: Time integer being evaluated
item_b: STObject from the second set in Obj... | [
"def",
"ellipse_distance",
"(",
"item_a",
",",
"time_a",
",",
"item_b",
",",
"time_b",
",",
"max_value",
")",
":",
"ts",
"=",
"np",
".",
"array",
"(",
"[",
"0",
",",
"np",
".",
"pi",
"]",
")",
"ell_a",
"=",
"item_a",
".",
"get_ellipse_model",
"(",
... | Calculate differences in the properties of ellipses fitted to each object.
Args:
item_a: STObject from the first set in ObjectMatcher
time_a: Time integer being evaluated
item_b: STObject from the second set in ObjectMatcher
time_b: Time integer being evaluated
max_value: Ma... | [
"Calculate",
"differences",
"in",
"the",
"properties",
"of",
"ellipses",
"fitted",
"to",
"each",
"object",
"."
] | 6fb6c3df90bf4867e13a97d3460b14471d107df1 | https://github.com/djgagne/hagelslag/blob/6fb6c3df90bf4867e13a97d3460b14471d107df1/hagelslag/processing/ObjectMatcher.py#L311-L331 | train |
djgagne/hagelslag | hagelslag/processing/ObjectMatcher.py | nonoverlap | def nonoverlap(item_a, time_a, item_b, time_b, max_value):
"""
Percentage of pixels in each object that do not overlap with the other object
Args:
item_a: STObject from the first set in ObjectMatcher
time_a: Time integer being evaluated
item_b: STObject from the second set in Object... | python | def nonoverlap(item_a, time_a, item_b, time_b, max_value):
"""
Percentage of pixels in each object that do not overlap with the other object
Args:
item_a: STObject from the first set in ObjectMatcher
time_a: Time integer being evaluated
item_b: STObject from the second set in Object... | [
"def",
"nonoverlap",
"(",
"item_a",
",",
"time_a",
",",
"item_b",
",",
"time_b",
",",
"max_value",
")",
":",
"return",
"np",
".",
"minimum",
"(",
"1",
"-",
"item_a",
".",
"count_overlap",
"(",
"time_a",
",",
"item_b",
",",
"time_b",
")",
",",
"max_valu... | Percentage of pixels in each object that do not overlap with the other object
Args:
item_a: STObject from the first set in ObjectMatcher
time_a: Time integer being evaluated
item_b: STObject from the second set in ObjectMatcher
time_b: Time integer being evaluated
max_value:... | [
"Percentage",
"of",
"pixels",
"in",
"each",
"object",
"that",
"do",
"not",
"overlap",
"with",
"the",
"other",
"object"
] | 6fb6c3df90bf4867e13a97d3460b14471d107df1 | https://github.com/djgagne/hagelslag/blob/6fb6c3df90bf4867e13a97d3460b14471d107df1/hagelslag/processing/ObjectMatcher.py#L334-L348 | train |
djgagne/hagelslag | hagelslag/processing/ObjectMatcher.py | max_intensity | def max_intensity(item_a, time_a, item_b, time_b, max_value):
"""
RMS difference in maximum intensity
Args:
item_a: STObject from the first set in ObjectMatcher
time_a: Time integer being evaluated
item_b: STObject from the second set in ObjectMatcher
time_b: Time integer be... | python | def max_intensity(item_a, time_a, item_b, time_b, max_value):
"""
RMS difference in maximum intensity
Args:
item_a: STObject from the first set in ObjectMatcher
time_a: Time integer being evaluated
item_b: STObject from the second set in ObjectMatcher
time_b: Time integer be... | [
"def",
"max_intensity",
"(",
"item_a",
",",
"time_a",
",",
"item_b",
",",
"time_b",
",",
"max_value",
")",
":",
"intensity_a",
"=",
"item_a",
".",
"max_intensity",
"(",
"time_a",
")",
"intensity_b",
"=",
"item_b",
".",
"max_intensity",
"(",
"time_b",
")",
... | RMS difference in maximum intensity
Args:
item_a: STObject from the first set in ObjectMatcher
time_a: Time integer being evaluated
item_b: STObject from the second set in ObjectMatcher
time_b: Time integer being evaluated
max_value: Maximum distance value used as scaling va... | [
"RMS",
"difference",
"in",
"maximum",
"intensity"
] | 6fb6c3df90bf4867e13a97d3460b14471d107df1 | https://github.com/djgagne/hagelslag/blob/6fb6c3df90bf4867e13a97d3460b14471d107df1/hagelslag/processing/ObjectMatcher.py#L351-L368 | train |
djgagne/hagelslag | hagelslag/processing/ObjectMatcher.py | area_difference | def area_difference(item_a, time_a, item_b, time_b, max_value):
"""
RMS Difference in object areas.
Args:
item_a: STObject from the first set in ObjectMatcher
time_a: Time integer being evaluated
item_b: STObject from the second set in ObjectMatcher
time_b: Time integer bein... | python | def area_difference(item_a, time_a, item_b, time_b, max_value):
"""
RMS Difference in object areas.
Args:
item_a: STObject from the first set in ObjectMatcher
time_a: Time integer being evaluated
item_b: STObject from the second set in ObjectMatcher
time_b: Time integer bein... | [
"def",
"area_difference",
"(",
"item_a",
",",
"time_a",
",",
"item_b",
",",
"time_b",
",",
"max_value",
")",
":",
"size_a",
"=",
"item_a",
".",
"size",
"(",
"time_a",
")",
"size_b",
"=",
"item_b",
".",
"size",
"(",
"time_b",
")",
"diff",
"=",
"np",
"... | RMS Difference in object areas.
Args:
item_a: STObject from the first set in ObjectMatcher
time_a: Time integer being evaluated
item_b: STObject from the second set in ObjectMatcher
time_b: Time integer being evaluated
max_value: Maximum distance value used as scaling value ... | [
"RMS",
"Difference",
"in",
"object",
"areas",
"."
] | 6fb6c3df90bf4867e13a97d3460b14471d107df1 | https://github.com/djgagne/hagelslag/blob/6fb6c3df90bf4867e13a97d3460b14471d107df1/hagelslag/processing/ObjectMatcher.py#L371-L388 | train |
djgagne/hagelslag | hagelslag/processing/ObjectMatcher.py | mean_minimum_centroid_distance | def mean_minimum_centroid_distance(item_a, item_b, max_value):
"""
RMS difference in the minimum distances from the centroids of one track to the centroids of another track
Args:
item_a: STObject from the first set in TrackMatcher
item_b: STObject from the second set in TrackMatcher
... | python | def mean_minimum_centroid_distance(item_a, item_b, max_value):
"""
RMS difference in the minimum distances from the centroids of one track to the centroids of another track
Args:
item_a: STObject from the first set in TrackMatcher
item_b: STObject from the second set in TrackMatcher
... | [
"def",
"mean_minimum_centroid_distance",
"(",
"item_a",
",",
"item_b",
",",
"max_value",
")",
":",
"centroids_a",
"=",
"np",
".",
"array",
"(",
"[",
"item_a",
".",
"center_of_mass",
"(",
"t",
")",
"for",
"t",
"in",
"item_a",
".",
"times",
"]",
")",
"cent... | RMS difference in the minimum distances from the centroids of one track to the centroids of another track
Args:
item_a: STObject from the first set in TrackMatcher
item_b: STObject from the second set in TrackMatcher
max_value: Maximum distance value used as scaling value and upper constrai... | [
"RMS",
"difference",
"in",
"the",
"minimum",
"distances",
"from",
"the",
"centroids",
"of",
"one",
"track",
"to",
"the",
"centroids",
"of",
"another",
"track"
] | 6fb6c3df90bf4867e13a97d3460b14471d107df1 | https://github.com/djgagne/hagelslag/blob/6fb6c3df90bf4867e13a97d3460b14471d107df1/hagelslag/processing/ObjectMatcher.py#L391-L407 | train |
djgagne/hagelslag | hagelslag/processing/ObjectMatcher.py | mean_min_time_distance | def mean_min_time_distance(item_a, item_b, max_value):
"""
Calculate the mean time difference among the time steps in each object.
Args:
item_a: STObject from the first set in TrackMatcher
item_b: STObject from the second set in TrackMatcher
max_value: Maximum distance value used as... | python | def mean_min_time_distance(item_a, item_b, max_value):
"""
Calculate the mean time difference among the time steps in each object.
Args:
item_a: STObject from the first set in TrackMatcher
item_b: STObject from the second set in TrackMatcher
max_value: Maximum distance value used as... | [
"def",
"mean_min_time_distance",
"(",
"item_a",
",",
"item_b",
",",
"max_value",
")",
":",
"times_a",
"=",
"item_a",
".",
"times",
".",
"reshape",
"(",
"(",
"item_a",
".",
"times",
".",
"size",
",",
"1",
")",
")",
"times_b",
"=",
"item_b",
".",
"times"... | Calculate the mean time difference among the time steps in each object.
Args:
item_a: STObject from the first set in TrackMatcher
item_b: STObject from the second set in TrackMatcher
max_value: Maximum distance value used as scaling value and upper constraint.
Returns:
Distance... | [
"Calculate",
"the",
"mean",
"time",
"difference",
"among",
"the",
"time",
"steps",
"in",
"each",
"object",
"."
] | 6fb6c3df90bf4867e13a97d3460b14471d107df1 | https://github.com/djgagne/hagelslag/blob/6fb6c3df90bf4867e13a97d3460b14471d107df1/hagelslag/processing/ObjectMatcher.py#L410-L426 | train |
djgagne/hagelslag | hagelslag/processing/ObjectMatcher.py | start_centroid_distance | def start_centroid_distance(item_a, item_b, max_value):
"""
Distance between the centroids of the first step in each object.
Args:
item_a: STObject from the first set in TrackMatcher
item_b: STObject from the second set in TrackMatcher
max_value: Maximum distance value used as scali... | python | def start_centroid_distance(item_a, item_b, max_value):
"""
Distance between the centroids of the first step in each object.
Args:
item_a: STObject from the first set in TrackMatcher
item_b: STObject from the second set in TrackMatcher
max_value: Maximum distance value used as scali... | [
"def",
"start_centroid_distance",
"(",
"item_a",
",",
"item_b",
",",
"max_value",
")",
":",
"start_a",
"=",
"item_a",
".",
"center_of_mass",
"(",
"item_a",
".",
"times",
"[",
"0",
"]",
")",
"start_b",
"=",
"item_b",
".",
"center_of_mass",
"(",
"item_b",
".... | Distance between the centroids of the first step in each object.
Args:
item_a: STObject from the first set in TrackMatcher
item_b: STObject from the second set in TrackMatcher
max_value: Maximum distance value used as scaling value and upper constraint.
Returns:
Distance value ... | [
"Distance",
"between",
"the",
"centroids",
"of",
"the",
"first",
"step",
"in",
"each",
"object",
"."
] | 6fb6c3df90bf4867e13a97d3460b14471d107df1 | https://github.com/djgagne/hagelslag/blob/6fb6c3df90bf4867e13a97d3460b14471d107df1/hagelslag/processing/ObjectMatcher.py#L429-L444 | train |
djgagne/hagelslag | hagelslag/processing/ObjectMatcher.py | start_time_distance | def start_time_distance(item_a, item_b, max_value):
"""
Absolute difference between the starting times of each item.
Args:
item_a: STObject from the first set in TrackMatcher
item_b: STObject from the second set in TrackMatcher
max_value: Maximum distance value used as scaling value... | python | def start_time_distance(item_a, item_b, max_value):
"""
Absolute difference between the starting times of each item.
Args:
item_a: STObject from the first set in TrackMatcher
item_b: STObject from the second set in TrackMatcher
max_value: Maximum distance value used as scaling value... | [
"def",
"start_time_distance",
"(",
"item_a",
",",
"item_b",
",",
"max_value",
")",
":",
"start_time_diff",
"=",
"np",
".",
"abs",
"(",
"item_a",
".",
"times",
"[",
"0",
"]",
"-",
"item_b",
".",
"times",
"[",
"0",
"]",
")",
"return",
"np",
".",
"minim... | Absolute difference between the starting times of each item.
Args:
item_a: STObject from the first set in TrackMatcher
item_b: STObject from the second set in TrackMatcher
max_value: Maximum distance value used as scaling value and upper constraint.
Returns:
Distance value betw... | [
"Absolute",
"difference",
"between",
"the",
"starting",
"times",
"of",
"each",
"item",
"."
] | 6fb6c3df90bf4867e13a97d3460b14471d107df1 | https://github.com/djgagne/hagelslag/blob/6fb6c3df90bf4867e13a97d3460b14471d107df1/hagelslag/processing/ObjectMatcher.py#L447-L460 | train |
djgagne/hagelslag | hagelslag/processing/ObjectMatcher.py | duration_distance | def duration_distance(item_a, item_b, max_value):
"""
Absolute difference in the duration of two items
Args:
item_a: STObject from the first set in TrackMatcher
item_b: STObject from the second set in TrackMatcher
max_value: Maximum distance value used as scaling value and upper con... | python | def duration_distance(item_a, item_b, max_value):
"""
Absolute difference in the duration of two items
Args:
item_a: STObject from the first set in TrackMatcher
item_b: STObject from the second set in TrackMatcher
max_value: Maximum distance value used as scaling value and upper con... | [
"def",
"duration_distance",
"(",
"item_a",
",",
"item_b",
",",
"max_value",
")",
":",
"duration_a",
"=",
"item_a",
".",
"times",
".",
"size",
"duration_b",
"=",
"item_b",
".",
"times",
".",
"size",
"return",
"np",
".",
"minimum",
"(",
"np",
".",
"abs",
... | Absolute difference in the duration of two items
Args:
item_a: STObject from the first set in TrackMatcher
item_b: STObject from the second set in TrackMatcher
max_value: Maximum distance value used as scaling value and upper constraint.
Returns:
Distance value between 0 and 1. | [
"Absolute",
"difference",
"in",
"the",
"duration",
"of",
"two",
"items"
] | 6fb6c3df90bf4867e13a97d3460b14471d107df1 | https://github.com/djgagne/hagelslag/blob/6fb6c3df90bf4867e13a97d3460b14471d107df1/hagelslag/processing/ObjectMatcher.py#L463-L477 | train |
djgagne/hagelslag | hagelslag/processing/ObjectMatcher.py | mean_area_distance | def mean_area_distance(item_a, item_b, max_value):
"""
Absolute difference in the means of the areas of each track over time.
Args:
item_a: STObject from the first set in TrackMatcher
item_b: STObject from the second set in TrackMatcher
max_value: Maximum distance value used as scal... | python | def mean_area_distance(item_a, item_b, max_value):
"""
Absolute difference in the means of the areas of each track over time.
Args:
item_a: STObject from the first set in TrackMatcher
item_b: STObject from the second set in TrackMatcher
max_value: Maximum distance value used as scal... | [
"def",
"mean_area_distance",
"(",
"item_a",
",",
"item_b",
",",
"max_value",
")",
":",
"mean_area_a",
"=",
"np",
".",
"mean",
"(",
"[",
"item_a",
".",
"size",
"(",
"t",
")",
"for",
"t",
"in",
"item_a",
".",
"times",
"]",
")",
"mean_area_b",
"=",
"np"... | Absolute difference in the means of the areas of each track over time.
Args:
item_a: STObject from the first set in TrackMatcher
item_b: STObject from the second set in TrackMatcher
max_value: Maximum distance value used as scaling value and upper constraint.
Returns:
Distance ... | [
"Absolute",
"difference",
"in",
"the",
"means",
"of",
"the",
"areas",
"of",
"each",
"track",
"over",
"time",
"."
] | 6fb6c3df90bf4867e13a97d3460b14471d107df1 | https://github.com/djgagne/hagelslag/blob/6fb6c3df90bf4867e13a97d3460b14471d107df1/hagelslag/processing/ObjectMatcher.py#L480-L494 | train |
djgagne/hagelslag | hagelslag/processing/ObjectMatcher.py | ObjectMatcher.match_objects | def match_objects(self, set_a, set_b, time_a, time_b):
"""
Match two sets of objects at particular times.
Args:
set_a: list of STObjects
set_b: list of STObjects
time_a: time at which set_a is being evaluated for matching
time_b: time at which set... | python | def match_objects(self, set_a, set_b, time_a, time_b):
"""
Match two sets of objects at particular times.
Args:
set_a: list of STObjects
set_b: list of STObjects
time_a: time at which set_a is being evaluated for matching
time_b: time at which set... | [
"def",
"match_objects",
"(",
"self",
",",
"set_a",
",",
"set_b",
",",
"time_a",
",",
"time_b",
")",
":",
"costs",
"=",
"self",
".",
"cost_matrix",
"(",
"set_a",
",",
"set_b",
",",
"time_a",
",",
"time_b",
")",
"*",
"100",
"min_row_costs",
"=",
"costs",... | Match two sets of objects at particular times.
Args:
set_a: list of STObjects
set_b: list of STObjects
time_a: time at which set_a is being evaluated for matching
time_b: time at which set_b is being evaluated for matching
Returns:
List of tu... | [
"Match",
"two",
"sets",
"of",
"objects",
"at",
"particular",
"times",
"."
] | 6fb6c3df90bf4867e13a97d3460b14471d107df1 | https://github.com/djgagne/hagelslag/blob/6fb6c3df90bf4867e13a97d3460b14471d107df1/hagelslag/processing/ObjectMatcher.py#L27-L53 | train |
djgagne/hagelslag | hagelslag/processing/ObjectMatcher.py | ObjectMatcher.cost_matrix | def cost_matrix(self, set_a, set_b, time_a, time_b):
"""
Calculates the costs (distances) between the items in set a and set b at the specified times.
Args:
set_a: List of STObjects
set_b: List of STObjects
time_a: time at which objects in set_a are evaluated... | python | def cost_matrix(self, set_a, set_b, time_a, time_b):
"""
Calculates the costs (distances) between the items in set a and set b at the specified times.
Args:
set_a: List of STObjects
set_b: List of STObjects
time_a: time at which objects in set_a are evaluated... | [
"def",
"cost_matrix",
"(",
"self",
",",
"set_a",
",",
"set_b",
",",
"time_a",
",",
"time_b",
")",
":",
"costs",
"=",
"np",
".",
"zeros",
"(",
"(",
"len",
"(",
"set_a",
")",
",",
"len",
"(",
"set_b",
")",
")",
")",
"for",
"a",
",",
"item_a",
"in... | Calculates the costs (distances) between the items in set a and set b at the specified times.
Args:
set_a: List of STObjects
set_b: List of STObjects
time_a: time at which objects in set_a are evaluated
time_b: time at whcih object in set_b are evaluated
... | [
"Calculates",
"the",
"costs",
"(",
"distances",
")",
"between",
"the",
"items",
"in",
"set",
"a",
"and",
"set",
"b",
"at",
"the",
"specified",
"times",
"."
] | 6fb6c3df90bf4867e13a97d3460b14471d107df1 | https://github.com/djgagne/hagelslag/blob/6fb6c3df90bf4867e13a97d3460b14471d107df1/hagelslag/processing/ObjectMatcher.py#L55-L73 | train |
djgagne/hagelslag | hagelslag/processing/ObjectMatcher.py | ObjectMatcher.total_cost_function | def total_cost_function(self, item_a, item_b, time_a, time_b):
"""
Calculate total cost function between two items.
Args:
item_a: STObject
item_b: STObject
time_a: Timestep in item_a at which cost function is evaluated
time_b: Timestep in item_b a... | python | def total_cost_function(self, item_a, item_b, time_a, time_b):
"""
Calculate total cost function between two items.
Args:
item_a: STObject
item_b: STObject
time_a: Timestep in item_a at which cost function is evaluated
time_b: Timestep in item_b a... | [
"def",
"total_cost_function",
"(",
"self",
",",
"item_a",
",",
"item_b",
",",
"time_a",
",",
"time_b",
")",
":",
"distances",
"=",
"np",
".",
"zeros",
"(",
"len",
"(",
"self",
".",
"weights",
")",
")",
"for",
"c",
",",
"component",
"in",
"enumerate",
... | Calculate total cost function between two items.
Args:
item_a: STObject
item_b: STObject
time_a: Timestep in item_a at which cost function is evaluated
time_b: Timestep in item_b at which cost function is evaluated
Returns:
The total weighted... | [
"Calculate",
"total",
"cost",
"function",
"between",
"two",
"items",
"."
] | 6fb6c3df90bf4867e13a97d3460b14471d107df1 | https://github.com/djgagne/hagelslag/blob/6fb6c3df90bf4867e13a97d3460b14471d107df1/hagelslag/processing/ObjectMatcher.py#L75-L92 | train |
djgagne/hagelslag | hagelslag/processing/ObjectMatcher.py | TrackMatcher.match_tracks | def match_tracks(self, set_a, set_b, closest_matches=False):
"""
Find the optimal set of matching assignments between set a and set b. This function supports optimal 1:1
matching using the Munkres method and matching from every object in set a to the closest object in set b.
In this situ... | python | def match_tracks(self, set_a, set_b, closest_matches=False):
"""
Find the optimal set of matching assignments between set a and set b. This function supports optimal 1:1
matching using the Munkres method and matching from every object in set a to the closest object in set b.
In this situ... | [
"def",
"match_tracks",
"(",
"self",
",",
"set_a",
",",
"set_b",
",",
"closest_matches",
"=",
"False",
")",
":",
"costs",
"=",
"self",
".",
"track_cost_matrix",
"(",
"set_a",
",",
"set_b",
")",
"*",
"100",
"min_row_costs",
"=",
"costs",
".",
"min",
"(",
... | Find the optimal set of matching assignments between set a and set b. This function supports optimal 1:1
matching using the Munkres method and matching from every object in set a to the closest object in set b.
In this situation set b accepts multiple matches from set a.
Args:
set_a... | [
"Find",
"the",
"optimal",
"set",
"of",
"matching",
"assignments",
"between",
"set",
"a",
"and",
"set",
"b",
".",
"This",
"function",
"supports",
"optimal",
"1",
":",
"1",
"matching",
"using",
"the",
"Munkres",
"method",
"and",
"matching",
"from",
"every",
... | 6fb6c3df90bf4867e13a97d3460b14471d107df1 | https://github.com/djgagne/hagelslag/blob/6fb6c3df90bf4867e13a97d3460b14471d107df1/hagelslag/processing/ObjectMatcher.py#L112-L145 | train |
djgagne/hagelslag | hagelslag/processing/ObjectMatcher.py | TrackStepMatcher.match | def match(self, set_a, set_b):
"""
For each step in each track from set_a, identify all steps in all tracks from set_b that meet all
cost function criteria
Args:
set_a: List of STObjects
set_b: List of STObjects
Returns:
track_pairing... | python | def match(self, set_a, set_b):
"""
For each step in each track from set_a, identify all steps in all tracks from set_b that meet all
cost function criteria
Args:
set_a: List of STObjects
set_b: List of STObjects
Returns:
track_pairing... | [
"def",
"match",
"(",
"self",
",",
"set_a",
",",
"set_b",
")",
":",
"track_step_matches",
"=",
"[",
"[",
"]",
"*",
"len",
"(",
"set_a",
")",
"]",
"costs",
"=",
"self",
".",
"cost_matrix",
"(",
"set_a",
",",
"set_b",
")",
"valid_costs",
"=",
"np",
".... | For each step in each track from set_a, identify all steps in all tracks from set_b that meet all
cost function criteria
Args:
set_a: List of STObjects
set_b: List of STObjects
Returns:
track_pairings: pandas.DataFrame | [
"For",
"each",
"step",
"in",
"each",
"track",
"from",
"set_a",
"identify",
"all",
"steps",
"in",
"all",
"tracks",
"from",
"set_b",
"that",
"meet",
"all",
"cost",
"function",
"criteria",
"Args",
":",
"set_a",
":",
"List",
"of",
"STObjects",
"set_b",
":",
... | 6fb6c3df90bf4867e13a97d3460b14471d107df1 | https://github.com/djgagne/hagelslag/blob/6fb6c3df90bf4867e13a97d3460b14471d107df1/hagelslag/processing/ObjectMatcher.py#L190-L224 | train |
nion-software/nionswift | nion/swift/model/Symbolic.py | ComputationVariable.variable_specifier | def variable_specifier(self) -> dict:
"""Return the variable specifier for this variable.
The specifier can be used to lookup the value of this variable in a computation context.
"""
if self.value_type is not None:
return {"type": "variable", "version": 1, "uuid": str(self.u... | python | def variable_specifier(self) -> dict:
"""Return the variable specifier for this variable.
The specifier can be used to lookup the value of this variable in a computation context.
"""
if self.value_type is not None:
return {"type": "variable", "version": 1, "uuid": str(self.u... | [
"def",
"variable_specifier",
"(",
"self",
")",
"->",
"dict",
":",
"if",
"self",
".",
"value_type",
"is",
"not",
"None",
":",
"return",
"{",
"\"type\"",
":",
"\"variable\"",
",",
"\"version\"",
":",
"1",
",",
"\"uuid\"",
":",
"str",
"(",
"self",
".",
"u... | Return the variable specifier for this variable.
The specifier can be used to lookup the value of this variable in a computation context. | [
"Return",
"the",
"variable",
"specifier",
"for",
"this",
"variable",
"."
] | d43693eaf057b8683b9638e575000f055fede452 | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/Symbolic.py#L228-L236 | train |
nion-software/nionswift | nion/swift/model/Symbolic.py | ComputationVariable.bound_variable | def bound_variable(self):
"""Return an object with a value property and a changed_event.
The value property returns the value of the variable. The changed_event is fired
whenever the value changes.
"""
class BoundVariable:
def __init__(self, variable):
... | python | def bound_variable(self):
"""Return an object with a value property and a changed_event.
The value property returns the value of the variable. The changed_event is fired
whenever the value changes.
"""
class BoundVariable:
def __init__(self, variable):
... | [
"def",
"bound_variable",
"(",
"self",
")",
":",
"class",
"BoundVariable",
":",
"def",
"__init__",
"(",
"self",
",",
"variable",
")",
":",
"self",
".",
"__variable",
"=",
"variable",
"self",
".",
"changed_event",
"=",
"Event",
".",
"Event",
"(",
")",
"sel... | Return an object with a value property and a changed_event.
The value property returns the value of the variable. The changed_event is fired
whenever the value changes. | [
"Return",
"an",
"object",
"with",
"a",
"value",
"property",
"and",
"a",
"changed_event",
"."
] | d43693eaf057b8683b9638e575000f055fede452 | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/Symbolic.py#L239-L261 | train |
nion-software/nionswift | nion/swift/model/Symbolic.py | ComputationContext.resolve_object_specifier | def resolve_object_specifier(self, object_specifier, secondary_specifier=None, property_name=None, objects_model=None):
"""Resolve the object specifier.
First lookup the object specifier in the enclosing computation. If it's not found,
then lookup in the computation's context. Otherwise it shou... | python | def resolve_object_specifier(self, object_specifier, secondary_specifier=None, property_name=None, objects_model=None):
"""Resolve the object specifier.
First lookup the object specifier in the enclosing computation. If it's not found,
then lookup in the computation's context. Otherwise it shou... | [
"def",
"resolve_object_specifier",
"(",
"self",
",",
"object_specifier",
",",
"secondary_specifier",
"=",
"None",
",",
"property_name",
"=",
"None",
",",
"objects_model",
"=",
"None",
")",
":",
"variable",
"=",
"self",
".",
"__computation",
"(",
")",
".",
"res... | Resolve the object specifier.
First lookup the object specifier in the enclosing computation. If it's not found,
then lookup in the computation's context. Otherwise it should be a value type variable.
In that case, return the bound variable. | [
"Resolve",
"the",
"object",
"specifier",
"."
] | d43693eaf057b8683b9638e575000f055fede452 | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/Symbolic.py#L435-L447 | train |
nion-software/nionswift | nion/swift/model/Symbolic.py | Computation.parse_names | def parse_names(cls, expression):
"""Return the list of identifiers used in the expression."""
names = set()
try:
ast_node = ast.parse(expression, "ast")
class Visitor(ast.NodeVisitor):
def visit_Name(self, node):
names.add(node.id)
... | python | def parse_names(cls, expression):
"""Return the list of identifiers used in the expression."""
names = set()
try:
ast_node = ast.parse(expression, "ast")
class Visitor(ast.NodeVisitor):
def visit_Name(self, node):
names.add(node.id)
... | [
"def",
"parse_names",
"(",
"cls",
",",
"expression",
")",
":",
"names",
"=",
"set",
"(",
")",
"try",
":",
"ast_node",
"=",
"ast",
".",
"parse",
"(",
"expression",
",",
"\"ast\"",
")",
"class",
"Visitor",
"(",
"ast",
".",
"NodeVisitor",
")",
":",
"def... | Return the list of identifiers used in the expression. | [
"Return",
"the",
"list",
"of",
"identifiers",
"used",
"in",
"the",
"expression",
"."
] | d43693eaf057b8683b9638e575000f055fede452 | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/Symbolic.py#L686-L699 | train |
nion-software/nionswift | nion/swift/model/Symbolic.py | Computation.bind | def bind(self, context) -> None:
"""Bind a context to this computation.
The context allows the computation to convert object specifiers to actual objects.
"""
# make a computation context based on the enclosing context.
self.__computation_context = ComputationContext(self, cont... | python | def bind(self, context) -> None:
"""Bind a context to this computation.
The context allows the computation to convert object specifiers to actual objects.
"""
# make a computation context based on the enclosing context.
self.__computation_context = ComputationContext(self, cont... | [
"def",
"bind",
"(",
"self",
",",
"context",
")",
"->",
"None",
":",
"# make a computation context based on the enclosing context.",
"self",
".",
"__computation_context",
"=",
"ComputationContext",
"(",
"self",
",",
"context",
")",
"# re-bind is not valid. be careful to set ... | Bind a context to this computation.
The context allows the computation to convert object specifiers to actual objects. | [
"Bind",
"a",
"context",
"to",
"this",
"computation",
"."
] | d43693eaf057b8683b9638e575000f055fede452 | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/Symbolic.py#L863-L884 | train |
nion-software/nionswift | nion/swift/model/Symbolic.py | Computation.unbind | def unbind(self):
"""Unlisten and close each bound item."""
for variable in self.variables:
self.__unbind_variable(variable)
for result in self.results:
self.__unbind_result(result) | python | def unbind(self):
"""Unlisten and close each bound item."""
for variable in self.variables:
self.__unbind_variable(variable)
for result in self.results:
self.__unbind_result(result) | [
"def",
"unbind",
"(",
"self",
")",
":",
"for",
"variable",
"in",
"self",
".",
"variables",
":",
"self",
".",
"__unbind_variable",
"(",
"variable",
")",
"for",
"result",
"in",
"self",
".",
"results",
":",
"self",
".",
"__unbind_result",
"(",
"result",
")"... | Unlisten and close each bound item. | [
"Unlisten",
"and",
"close",
"each",
"bound",
"item",
"."
] | d43693eaf057b8683b9638e575000f055fede452 | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/Symbolic.py#L886-L891 | train |
base4sistemas/satcfe | satcfe/clientelocal.py | ClienteSATLocal.ativar_sat | def ativar_sat(self, tipo_certificado, cnpj, codigo_uf):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.ativar_sat`.
:return: Uma resposta SAT especilizada em ``AtivarSAT``.
:rtype: satcfe.resposta.ativarsat.RespostaAtivarSAT
"""
retorno = super(ClienteSATLocal, self).ativar_sat(
... | python | def ativar_sat(self, tipo_certificado, cnpj, codigo_uf):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.ativar_sat`.
:return: Uma resposta SAT especilizada em ``AtivarSAT``.
:rtype: satcfe.resposta.ativarsat.RespostaAtivarSAT
"""
retorno = super(ClienteSATLocal, self).ativar_sat(
... | [
"def",
"ativar_sat",
"(",
"self",
",",
"tipo_certificado",
",",
"cnpj",
",",
"codigo_uf",
")",
":",
"retorno",
"=",
"super",
"(",
"ClienteSATLocal",
",",
"self",
")",
".",
"ativar_sat",
"(",
"tipo_certificado",
",",
"cnpj",
",",
"codigo_uf",
")",
"return",
... | Sobrepõe :meth:`~satcfe.base.FuncoesSAT.ativar_sat`.
:return: Uma resposta SAT especilizada em ``AtivarSAT``.
:rtype: satcfe.resposta.ativarsat.RespostaAtivarSAT | [
"Sobrepõe",
":",
"meth",
":",
"~satcfe",
".",
"base",
".",
"FuncoesSAT",
".",
"ativar_sat",
"."
] | cb8e8815f4133d3e3d94cf526fa86767b4521ed9 | https://github.com/base4sistemas/satcfe/blob/cb8e8815f4133d3e3d94cf526fa86767b4521ed9/satcfe/clientelocal.py#L46-L54 | train |
base4sistemas/satcfe | satcfe/clientelocal.py | ClienteSATLocal.comunicar_certificado_icpbrasil | def comunicar_certificado_icpbrasil(self, certificado):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.comunicar_certificado_icpbrasil`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
retorno = super(ClienteSATLocal, self).\
comunica... | python | def comunicar_certificado_icpbrasil(self, certificado):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.comunicar_certificado_icpbrasil`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
retorno = super(ClienteSATLocal, self).\
comunica... | [
"def",
"comunicar_certificado_icpbrasil",
"(",
"self",
",",
"certificado",
")",
":",
"retorno",
"=",
"super",
"(",
"ClienteSATLocal",
",",
"self",
")",
".",
"comunicar_certificado_icpbrasil",
"(",
"certificado",
")",
"return",
"RespostaSAT",
".",
"comunicar_certificad... | Sobrepõe :meth:`~satcfe.base.FuncoesSAT.comunicar_certificado_icpbrasil`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT | [
"Sobrepõe",
":",
"meth",
":",
"~satcfe",
".",
"base",
".",
"FuncoesSAT",
".",
"comunicar_certificado_icpbrasil",
"."
] | cb8e8815f4133d3e3d94cf526fa86767b4521ed9 | https://github.com/base4sistemas/satcfe/blob/cb8e8815f4133d3e3d94cf526fa86767b4521ed9/satcfe/clientelocal.py#L57-L65 | train |
base4sistemas/satcfe | satcfe/clientelocal.py | ClienteSATLocal.enviar_dados_venda | def enviar_dados_venda(self, dados_venda):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.enviar_dados_venda`.
:return: Uma resposta SAT especializada em ``EnviarDadosVenda``.
:rtype: satcfe.resposta.enviardadosvenda.RespostaEnviarDadosVenda
"""
retorno = super(ClienteSATLocal, self... | python | def enviar_dados_venda(self, dados_venda):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.enviar_dados_venda`.
:return: Uma resposta SAT especializada em ``EnviarDadosVenda``.
:rtype: satcfe.resposta.enviardadosvenda.RespostaEnviarDadosVenda
"""
retorno = super(ClienteSATLocal, self... | [
"def",
"enviar_dados_venda",
"(",
"self",
",",
"dados_venda",
")",
":",
"retorno",
"=",
"super",
"(",
"ClienteSATLocal",
",",
"self",
")",
".",
"enviar_dados_venda",
"(",
"dados_venda",
")",
"return",
"RespostaEnviarDadosVenda",
".",
"analisar",
"(",
"retorno",
... | Sobrepõe :meth:`~satcfe.base.FuncoesSAT.enviar_dados_venda`.
:return: Uma resposta SAT especializada em ``EnviarDadosVenda``.
:rtype: satcfe.resposta.enviardadosvenda.RespostaEnviarDadosVenda | [
"Sobrepõe",
":",
"meth",
":",
"~satcfe",
".",
"base",
".",
"FuncoesSAT",
".",
"enviar_dados_venda",
"."
] | cb8e8815f4133d3e3d94cf526fa86767b4521ed9 | https://github.com/base4sistemas/satcfe/blob/cb8e8815f4133d3e3d94cf526fa86767b4521ed9/satcfe/clientelocal.py#L68-L75 | train |
base4sistemas/satcfe | satcfe/clientelocal.py | ClienteSATLocal.cancelar_ultima_venda | def cancelar_ultima_venda(self, chave_cfe, dados_cancelamento):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.cancelar_ultima_venda`.
:return: Uma resposta SAT especializada em ``CancelarUltimaVenda``.
:rtype: satcfe.resposta.cancelarultimavenda.RespostaCancelarUltimaVenda
"""
reto... | python | def cancelar_ultima_venda(self, chave_cfe, dados_cancelamento):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.cancelar_ultima_venda`.
:return: Uma resposta SAT especializada em ``CancelarUltimaVenda``.
:rtype: satcfe.resposta.cancelarultimavenda.RespostaCancelarUltimaVenda
"""
reto... | [
"def",
"cancelar_ultima_venda",
"(",
"self",
",",
"chave_cfe",
",",
"dados_cancelamento",
")",
":",
"retorno",
"=",
"super",
"(",
"ClienteSATLocal",
",",
"self",
")",
".",
"cancelar_ultima_venda",
"(",
"chave_cfe",
",",
"dados_cancelamento",
")",
"return",
"Respos... | Sobrepõe :meth:`~satcfe.base.FuncoesSAT.cancelar_ultima_venda`.
:return: Uma resposta SAT especializada em ``CancelarUltimaVenda``.
:rtype: satcfe.resposta.cancelarultimavenda.RespostaCancelarUltimaVenda | [
"Sobrepõe",
":",
"meth",
":",
"~satcfe",
".",
"base",
".",
"FuncoesSAT",
".",
"cancelar_ultima_venda",
"."
] | cb8e8815f4133d3e3d94cf526fa86767b4521ed9 | https://github.com/base4sistemas/satcfe/blob/cb8e8815f4133d3e3d94cf526fa86767b4521ed9/satcfe/clientelocal.py#L78-L86 | train |
base4sistemas/satcfe | satcfe/clientelocal.py | ClienteSATLocal.consultar_sat | def consultar_sat(self):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.consultar_sat`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
retorno = super(ClienteSATLocal, self).consultar_sat()
return RespostaSAT.consultar_sat(retorno) | python | def consultar_sat(self):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.consultar_sat`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
retorno = super(ClienteSATLocal, self).consultar_sat()
return RespostaSAT.consultar_sat(retorno) | [
"def",
"consultar_sat",
"(",
"self",
")",
":",
"retorno",
"=",
"super",
"(",
"ClienteSATLocal",
",",
"self",
")",
".",
"consultar_sat",
"(",
")",
"return",
"RespostaSAT",
".",
"consultar_sat",
"(",
"retorno",
")"
] | Sobrepõe :meth:`~satcfe.base.FuncoesSAT.consultar_sat`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT | [
"Sobrepõe",
":",
"meth",
":",
"~satcfe",
".",
"base",
".",
"FuncoesSAT",
".",
"consultar_sat",
"."
] | cb8e8815f4133d3e3d94cf526fa86767b4521ed9 | https://github.com/base4sistemas/satcfe/blob/cb8e8815f4133d3e3d94cf526fa86767b4521ed9/satcfe/clientelocal.py#L89-L96 | train |
base4sistemas/satcfe | satcfe/clientelocal.py | ClienteSATLocal.consultar_status_operacional | def consultar_status_operacional(self):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.consultar_status_operacional`.
:return: Uma resposta SAT especializada em ``ConsultarStatusOperacional``.
:rtype: satcfe.resposta.consultarstatusoperacional.RespostaConsultarStatusOperacional
"""
... | python | def consultar_status_operacional(self):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.consultar_status_operacional`.
:return: Uma resposta SAT especializada em ``ConsultarStatusOperacional``.
:rtype: satcfe.resposta.consultarstatusoperacional.RespostaConsultarStatusOperacional
"""
... | [
"def",
"consultar_status_operacional",
"(",
"self",
")",
":",
"retorno",
"=",
"super",
"(",
"ClienteSATLocal",
",",
"self",
")",
".",
"consultar_status_operacional",
"(",
")",
"return",
"RespostaConsultarStatusOperacional",
".",
"analisar",
"(",
"retorno",
")"
] | Sobrepõe :meth:`~satcfe.base.FuncoesSAT.consultar_status_operacional`.
:return: Uma resposta SAT especializada em ``ConsultarStatusOperacional``.
:rtype: satcfe.resposta.consultarstatusoperacional.RespostaConsultarStatusOperacional | [
"Sobrepõe",
":",
"meth",
":",
"~satcfe",
".",
"base",
".",
"FuncoesSAT",
".",
"consultar_status_operacional",
"."
] | cb8e8815f4133d3e3d94cf526fa86767b4521ed9 | https://github.com/base4sistemas/satcfe/blob/cb8e8815f4133d3e3d94cf526fa86767b4521ed9/satcfe/clientelocal.py#L109-L116 | train |
base4sistemas/satcfe | satcfe/clientelocal.py | ClienteSATLocal.consultar_numero_sessao | def consultar_numero_sessao(self, numero_sessao):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.consultar_numero_sessao`.
:return: Uma resposta SAT que irá depender da sessão consultada.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
retorno = super(ClienteSATLocal, self).\
... | python | def consultar_numero_sessao(self, numero_sessao):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.consultar_numero_sessao`.
:return: Uma resposta SAT que irá depender da sessão consultada.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
retorno = super(ClienteSATLocal, self).\
... | [
"def",
"consultar_numero_sessao",
"(",
"self",
",",
"numero_sessao",
")",
":",
"retorno",
"=",
"super",
"(",
"ClienteSATLocal",
",",
"self",
")",
".",
"consultar_numero_sessao",
"(",
"numero_sessao",
")",
"return",
"RespostaConsultarNumeroSessao",
".",
"analisar",
"... | Sobrepõe :meth:`~satcfe.base.FuncoesSAT.consultar_numero_sessao`.
:return: Uma resposta SAT que irá depender da sessão consultada.
:rtype: satcfe.resposta.padrao.RespostaSAT | [
"Sobrepõe",
":",
"meth",
":",
"~satcfe",
".",
"base",
".",
"FuncoesSAT",
".",
"consultar_numero_sessao",
"."
] | cb8e8815f4133d3e3d94cf526fa86767b4521ed9 | https://github.com/base4sistemas/satcfe/blob/cb8e8815f4133d3e3d94cf526fa86767b4521ed9/satcfe/clientelocal.py#L119-L127 | train |
base4sistemas/satcfe | satcfe/clientelocal.py | ClienteSATLocal.configurar_interface_de_rede | def configurar_interface_de_rede(self, configuracao):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.configurar_interface_de_rede`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
retorno = super(ClienteSATLocal, self).\
configurar_in... | python | def configurar_interface_de_rede(self, configuracao):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.configurar_interface_de_rede`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
retorno = super(ClienteSATLocal, self).\
configurar_in... | [
"def",
"configurar_interface_de_rede",
"(",
"self",
",",
"configuracao",
")",
":",
"retorno",
"=",
"super",
"(",
"ClienteSATLocal",
",",
"self",
")",
".",
"configurar_interface_de_rede",
"(",
"configuracao",
")",
"return",
"RespostaSAT",
".",
"configurar_interface_de_... | Sobrepõe :meth:`~satcfe.base.FuncoesSAT.configurar_interface_de_rede`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT | [
"Sobrepõe",
":",
"meth",
":",
"~satcfe",
".",
"base",
".",
"FuncoesSAT",
".",
"configurar_interface_de_rede",
"."
] | cb8e8815f4133d3e3d94cf526fa86767b4521ed9 | https://github.com/base4sistemas/satcfe/blob/cb8e8815f4133d3e3d94cf526fa86767b4521ed9/satcfe/clientelocal.py#L130-L138 | train |
base4sistemas/satcfe | satcfe/clientelocal.py | ClienteSATLocal.associar_assinatura | def associar_assinatura(self, sequencia_cnpj, assinatura_ac):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.associar_assinatura`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
retorno = super(ClienteSATLocal, self).\
associar_assin... | python | def associar_assinatura(self, sequencia_cnpj, assinatura_ac):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.associar_assinatura`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
retorno = super(ClienteSATLocal, self).\
associar_assin... | [
"def",
"associar_assinatura",
"(",
"self",
",",
"sequencia_cnpj",
",",
"assinatura_ac",
")",
":",
"retorno",
"=",
"super",
"(",
"ClienteSATLocal",
",",
"self",
")",
".",
"associar_assinatura",
"(",
"sequencia_cnpj",
",",
"assinatura_ac",
")",
"# (!) resposta baseada... | Sobrepõe :meth:`~satcfe.base.FuncoesSAT.associar_assinatura`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT | [
"Sobrepõe",
":",
"meth",
":",
"~satcfe",
".",
"base",
".",
"FuncoesSAT",
".",
"associar_assinatura",
"."
] | cb8e8815f4133d3e3d94cf526fa86767b4521ed9 | https://github.com/base4sistemas/satcfe/blob/cb8e8815f4133d3e3d94cf526fa86767b4521ed9/satcfe/clientelocal.py#L141-L150 | train |
base4sistemas/satcfe | satcfe/clientelocal.py | ClienteSATLocal.atualizar_software_sat | def atualizar_software_sat(self):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.atualizar_software_sat`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
retorno = super(ClienteSATLocal, self).atualizar_software_sat()
return RespostaSAT.atual... | python | def atualizar_software_sat(self):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.atualizar_software_sat`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
retorno = super(ClienteSATLocal, self).atualizar_software_sat()
return RespostaSAT.atual... | [
"def",
"atualizar_software_sat",
"(",
"self",
")",
":",
"retorno",
"=",
"super",
"(",
"ClienteSATLocal",
",",
"self",
")",
".",
"atualizar_software_sat",
"(",
")",
"return",
"RespostaSAT",
".",
"atualizar_software_sat",
"(",
"retorno",
")"
] | Sobrepõe :meth:`~satcfe.base.FuncoesSAT.atualizar_software_sat`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT | [
"Sobrepõe",
":",
"meth",
":",
"~satcfe",
".",
"base",
".",
"FuncoesSAT",
".",
"atualizar_software_sat",
"."
] | cb8e8815f4133d3e3d94cf526fa86767b4521ed9 | https://github.com/base4sistemas/satcfe/blob/cb8e8815f4133d3e3d94cf526fa86767b4521ed9/satcfe/clientelocal.py#L153-L160 | train |
base4sistemas/satcfe | satcfe/clientelocal.py | ClienteSATLocal.extrair_logs | def extrair_logs(self):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.extrair_logs`.
:return: Uma resposta SAT especializada em ``ExtrairLogs``.
:rtype: satcfe.resposta.extrairlogs.RespostaExtrairLogs
"""
retorno = super(ClienteSATLocal, self).extrair_logs()
return Resposta... | python | def extrair_logs(self):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.extrair_logs`.
:return: Uma resposta SAT especializada em ``ExtrairLogs``.
:rtype: satcfe.resposta.extrairlogs.RespostaExtrairLogs
"""
retorno = super(ClienteSATLocal, self).extrair_logs()
return Resposta... | [
"def",
"extrair_logs",
"(",
"self",
")",
":",
"retorno",
"=",
"super",
"(",
"ClienteSATLocal",
",",
"self",
")",
".",
"extrair_logs",
"(",
")",
"return",
"RespostaExtrairLogs",
".",
"analisar",
"(",
"retorno",
")"
] | Sobrepõe :meth:`~satcfe.base.FuncoesSAT.extrair_logs`.
:return: Uma resposta SAT especializada em ``ExtrairLogs``.
:rtype: satcfe.resposta.extrairlogs.RespostaExtrairLogs | [
"Sobrepõe",
":",
"meth",
":",
"~satcfe",
".",
"base",
".",
"FuncoesSAT",
".",
"extrair_logs",
"."
] | cb8e8815f4133d3e3d94cf526fa86767b4521ed9 | https://github.com/base4sistemas/satcfe/blob/cb8e8815f4133d3e3d94cf526fa86767b4521ed9/satcfe/clientelocal.py#L163-L170 | train |
base4sistemas/satcfe | satcfe/clientelocal.py | ClienteSATLocal.bloquear_sat | def bloquear_sat(self):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.bloquear_sat`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
retorno = super(ClienteSATLocal, self).bloquear_sat()
return RespostaSAT.bloquear_sat(retorno) | python | def bloquear_sat(self):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.bloquear_sat`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
retorno = super(ClienteSATLocal, self).bloquear_sat()
return RespostaSAT.bloquear_sat(retorno) | [
"def",
"bloquear_sat",
"(",
"self",
")",
":",
"retorno",
"=",
"super",
"(",
"ClienteSATLocal",
",",
"self",
")",
".",
"bloquear_sat",
"(",
")",
"return",
"RespostaSAT",
".",
"bloquear_sat",
"(",
"retorno",
")"
] | Sobrepõe :meth:`~satcfe.base.FuncoesSAT.bloquear_sat`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT | [
"Sobrepõe",
":",
"meth",
":",
"~satcfe",
".",
"base",
".",
"FuncoesSAT",
".",
"bloquear_sat",
"."
] | cb8e8815f4133d3e3d94cf526fa86767b4521ed9 | https://github.com/base4sistemas/satcfe/blob/cb8e8815f4133d3e3d94cf526fa86767b4521ed9/satcfe/clientelocal.py#L173-L180 | train |
base4sistemas/satcfe | satcfe/clientelocal.py | ClienteSATLocal.desbloquear_sat | def desbloquear_sat(self):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.desbloquear_sat`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
retorno = super(ClienteSATLocal, self).desbloquear_sat()
return RespostaSAT.desbloquear_sat(retorno) | python | def desbloquear_sat(self):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.desbloquear_sat`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
retorno = super(ClienteSATLocal, self).desbloquear_sat()
return RespostaSAT.desbloquear_sat(retorno) | [
"def",
"desbloquear_sat",
"(",
"self",
")",
":",
"retorno",
"=",
"super",
"(",
"ClienteSATLocal",
",",
"self",
")",
".",
"desbloquear_sat",
"(",
")",
"return",
"RespostaSAT",
".",
"desbloquear_sat",
"(",
"retorno",
")"
] | Sobrepõe :meth:`~satcfe.base.FuncoesSAT.desbloquear_sat`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT | [
"Sobrepõe",
":",
"meth",
":",
"~satcfe",
".",
"base",
".",
"FuncoesSAT",
".",
"desbloquear_sat",
"."
] | cb8e8815f4133d3e3d94cf526fa86767b4521ed9 | https://github.com/base4sistemas/satcfe/blob/cb8e8815f4133d3e3d94cf526fa86767b4521ed9/satcfe/clientelocal.py#L183-L190 | train |
base4sistemas/satcfe | satcfe/clientelocal.py | ClienteSATLocal.trocar_codigo_de_ativacao | def trocar_codigo_de_ativacao(self, novo_codigo_ativacao,
opcao=constantes.CODIGO_ATIVACAO_REGULAR,
codigo_emergencia=None):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.trocar_codigo_de_ativacao`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSA... | python | def trocar_codigo_de_ativacao(self, novo_codigo_ativacao,
opcao=constantes.CODIGO_ATIVACAO_REGULAR,
codigo_emergencia=None):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.trocar_codigo_de_ativacao`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSA... | [
"def",
"trocar_codigo_de_ativacao",
"(",
"self",
",",
"novo_codigo_ativacao",
",",
"opcao",
"=",
"constantes",
".",
"CODIGO_ATIVACAO_REGULAR",
",",
"codigo_emergencia",
"=",
"None",
")",
":",
"retorno",
"=",
"super",
"(",
"ClienteSATLocal",
",",
"self",
")",
".",
... | Sobrepõe :meth:`~satcfe.base.FuncoesSAT.trocar_codigo_de_ativacao`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT | [
"Sobrepõe",
":",
"meth",
":",
"~satcfe",
".",
"base",
".",
"FuncoesSAT",
".",
"trocar_codigo_de_ativacao",
"."
] | cb8e8815f4133d3e3d94cf526fa86767b4521ed9 | https://github.com/base4sistemas/satcfe/blob/cb8e8815f4133d3e3d94cf526fa86767b4521ed9/satcfe/clientelocal.py#L193-L204 | train |
base4sistemas/satcfe | satcfe/entidades.py | Entidade.documento | def documento(self, *args, **kwargs):
"""Resulta no documento XML como string, que pode ou não incluir a
declaração XML no início do documento.
"""
forcar_unicode = kwargs.pop('forcar_unicode', False)
incluir_xml_decl = kwargs.pop('incluir_xml_decl', True)
doc = ET.tostri... | python | def documento(self, *args, **kwargs):
"""Resulta no documento XML como string, que pode ou não incluir a
declaração XML no início do documento.
"""
forcar_unicode = kwargs.pop('forcar_unicode', False)
incluir_xml_decl = kwargs.pop('incluir_xml_decl', True)
doc = ET.tostri... | [
"def",
"documento",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"forcar_unicode",
"=",
"kwargs",
".",
"pop",
"(",
"'forcar_unicode'",
",",
"False",
")",
"incluir_xml_decl",
"=",
"kwargs",
".",
"pop",
"(",
"'incluir_xml_decl'",
",",
... | Resulta no documento XML como string, que pode ou não incluir a
declaração XML no início do documento. | [
"Resulta",
"no",
"documento",
"XML",
"como",
"string",
"que",
"pode",
"ou",
"não",
"incluir",
"a",
"declaração",
"XML",
"no",
"início",
"do",
"documento",
"."
] | cb8e8815f4133d3e3d94cf526fa86767b4521ed9 | https://github.com/base4sistemas/satcfe/blob/cb8e8815f4133d3e3d94cf526fa86767b4521ed9/satcfe/entidades.py#L308-L324 | train |
nion-software/nionswift | nion/swift/Application.py | Application.start | def start(self, skip_choose=False, fixed_workspace_dir=None):
"""
Start the application.
Looks for workspace_location persistent string. If it doesn't find it, uses a default
workspace location.
Then checks to see if that workspace exists. If not and if skip_cho... | python | def start(self, skip_choose=False, fixed_workspace_dir=None):
"""
Start the application.
Looks for workspace_location persistent string. If it doesn't find it, uses a default
workspace location.
Then checks to see if that workspace exists. If not and if skip_cho... | [
"def",
"start",
"(",
"self",
",",
"skip_choose",
"=",
"False",
",",
"fixed_workspace_dir",
"=",
"None",
")",
":",
"logging",
".",
"getLogger",
"(",
"\"migration\"",
")",
".",
"setLevel",
"(",
"logging",
".",
"INFO",
")",
"if",
"fixed_workspace_dir",
":",
"... | Start the application.
Looks for workspace_location persistent string. If it doesn't find it, uses a default
workspace location.
Then checks to see if that workspace exists. If not and if skip_choose has not been
set to True, asks the user for a workspace location. User... | [
"Start",
"the",
"application",
"."
] | d43693eaf057b8683b9638e575000f055fede452 | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/Application.py#L176-L229 | train |
nion-software/nionswift | nion/swift/model/DataItem.py | sort_by_date_key | def sort_by_date_key(data_item):
""" A sort key to for the created field of a data item. The sort by uuid makes it determinate. """
return data_item.title + str(data_item.uuid) if data_item.is_live else str(), data_item.date_for_sorting, str(data_item.uuid) | python | def sort_by_date_key(data_item):
""" A sort key to for the created field of a data item. The sort by uuid makes it determinate. """
return data_item.title + str(data_item.uuid) if data_item.is_live else str(), data_item.date_for_sorting, str(data_item.uuid) | [
"def",
"sort_by_date_key",
"(",
"data_item",
")",
":",
"return",
"data_item",
".",
"title",
"+",
"str",
"(",
"data_item",
".",
"uuid",
")",
"if",
"data_item",
".",
"is_live",
"else",
"str",
"(",
")",
",",
"data_item",
".",
"date_for_sorting",
",",
"str",
... | A sort key to for the created field of a data item. The sort by uuid makes it determinate. | [
"A",
"sort",
"key",
"to",
"for",
"the",
"created",
"field",
"of",
"a",
"data",
"item",
".",
"The",
"sort",
"by",
"uuid",
"makes",
"it",
"determinate",
"."
] | d43693eaf057b8683b9638e575000f055fede452 | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/DataItem.py#L1148-L1150 | train |
nion-software/nionswift | nion/swift/model/DataItem.py | DataItem.snapshot | def snapshot(self):
"""Return a new library item which is a copy of this one with any dynamic behavior made static."""
data_item = self.__class__()
# data format (temporary until moved to buffered data source)
data_item.large_format = self.large_format
data_item.set_data_and_meta... | python | def snapshot(self):
"""Return a new library item which is a copy of this one with any dynamic behavior made static."""
data_item = self.__class__()
# data format (temporary until moved to buffered data source)
data_item.large_format = self.large_format
data_item.set_data_and_meta... | [
"def",
"snapshot",
"(",
"self",
")",
":",
"data_item",
"=",
"self",
".",
"__class__",
"(",
")",
"# data format (temporary until moved to buffered data source)",
"data_item",
".",
"large_format",
"=",
"self",
".",
"large_format",
"data_item",
".",
"set_data_and_metadata"... | Return a new library item which is a copy of this one with any dynamic behavior made static. | [
"Return",
"a",
"new",
"library",
"item",
"which",
"is",
"a",
"copy",
"of",
"this",
"one",
"with",
"any",
"dynamic",
"behavior",
"made",
"static",
"."
] | d43693eaf057b8683b9638e575000f055fede452 | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/DataItem.py#L331-L347 | train |
nion-software/nionswift | nion/swift/model/DataItem.py | DataItem.set_r_value | def set_r_value(self, r_var: str, *, notify_changed=True) -> None:
"""Used to signal changes to the ref var, which are kept in document controller. ugh."""
self.r_var = r_var
self._description_changed()
if notify_changed: # set to False to set the r-value at startup; avoid marking it as... | python | def set_r_value(self, r_var: str, *, notify_changed=True) -> None:
"""Used to signal changes to the ref var, which are kept in document controller. ugh."""
self.r_var = r_var
self._description_changed()
if notify_changed: # set to False to set the r-value at startup; avoid marking it as... | [
"def",
"set_r_value",
"(",
"self",
",",
"r_var",
":",
"str",
",",
"*",
",",
"notify_changed",
"=",
"True",
")",
"->",
"None",
":",
"self",
".",
"r_var",
"=",
"r_var",
"self",
".",
"_description_changed",
"(",
")",
"if",
"notify_changed",
":",
"# set to F... | Used to signal changes to the ref var, which are kept in document controller. ugh. | [
"Used",
"to",
"signal",
"changes",
"to",
"the",
"ref",
"var",
"which",
"are",
"kept",
"in",
"document",
"controller",
".",
"ugh",
"."
] | d43693eaf057b8683b9638e575000f055fede452 | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/DataItem.py#L611-L616 | train |
nion-software/nionswift | nion/swift/model/DataItem.py | DataItem.set_data_and_metadata | def set_data_and_metadata(self, data_and_metadata, data_modified=None):
"""Sets the underlying data and data-metadata to the data_and_metadata.
Note: this does not make a copy of the data.
"""
self.increment_data_ref_count()
try:
if data_and_metadata:
... | python | def set_data_and_metadata(self, data_and_metadata, data_modified=None):
"""Sets the underlying data and data-metadata to the data_and_metadata.
Note: this does not make a copy of the data.
"""
self.increment_data_ref_count()
try:
if data_and_metadata:
... | [
"def",
"set_data_and_metadata",
"(",
"self",
",",
"data_and_metadata",
",",
"data_modified",
"=",
"None",
")",
":",
"self",
".",
"increment_data_ref_count",
"(",
")",
"try",
":",
"if",
"data_and_metadata",
":",
"data",
"=",
"data_and_metadata",
".",
"data",
"dat... | Sets the underlying data and data-metadata to the data_and_metadata.
Note: this does not make a copy of the data. | [
"Sets",
"the",
"underlying",
"data",
"and",
"data",
"-",
"metadata",
"to",
"the",
"data_and_metadata",
"."
] | d43693eaf057b8683b9638e575000f055fede452 | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/DataItem.py#L1005-L1031 | train |
nion-software/nionswift | nion/swift/model/DisplayItem.py | DisplayDataChannel.color_map_data | def color_map_data(self) -> typing.Optional[numpy.ndarray]:
"""Return the color map data as a uint8 ndarray with shape (256, 3)."""
if self.display_data_shape is None: # is there display data?
return None
else:
return self.__color_map_data if self.__color_map_data is not... | python | def color_map_data(self) -> typing.Optional[numpy.ndarray]:
"""Return the color map data as a uint8 ndarray with shape (256, 3)."""
if self.display_data_shape is None: # is there display data?
return None
else:
return self.__color_map_data if self.__color_map_data is not... | [
"def",
"color_map_data",
"(",
"self",
")",
"->",
"typing",
".",
"Optional",
"[",
"numpy",
".",
"ndarray",
"]",
":",
"if",
"self",
".",
"display_data_shape",
"is",
"None",
":",
"# is there display data?",
"return",
"None",
"else",
":",
"return",
"self",
".",
... | Return the color map data as a uint8 ndarray with shape (256, 3). | [
"Return",
"the",
"color",
"map",
"data",
"as",
"a",
"uint8",
"ndarray",
"with",
"shape",
"(",
"256",
"3",
")",
"."
] | d43693eaf057b8683b9638e575000f055fede452 | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/DisplayItem.py#L670-L675 | train |
nion-software/nionswift | nion/swift/model/DisplayItem.py | DisplayDataChannel.get_calculated_display_values | def get_calculated_display_values(self, immediate: bool=False) -> DisplayValues:
"""Return the display values.
Return the current (possibly uncalculated) display values unless 'immediate' is specified.
If 'immediate', return the existing (calculated) values if they exist. Using the 'immediate'... | python | def get_calculated_display_values(self, immediate: bool=False) -> DisplayValues:
"""Return the display values.
Return the current (possibly uncalculated) display values unless 'immediate' is specified.
If 'immediate', return the existing (calculated) values if they exist. Using the 'immediate'... | [
"def",
"get_calculated_display_values",
"(",
"self",
",",
"immediate",
":",
"bool",
"=",
"False",
")",
"->",
"DisplayValues",
":",
"if",
"not",
"immediate",
"or",
"not",
"self",
".",
"__is_master",
"or",
"not",
"self",
".",
"__last_display_values",
":",
"if",
... | Return the display values.
Return the current (possibly uncalculated) display values unless 'immediate' is specified.
If 'immediate', return the existing (calculated) values if they exist. Using the 'immediate' values
avoids calculation except in cases where the display values haven't already ... | [
"Return",
"the",
"display",
"values",
"."
] | d43693eaf057b8683b9638e575000f055fede452 | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/DisplayItem.py#L718-L736 | train |
nion-software/nionswift | nion/swift/model/DisplayItem.py | DisplayDataChannel.increment_display_ref_count | def increment_display_ref_count(self, amount: int=1):
"""Increment display reference count to indicate this library item is currently displayed."""
display_ref_count = self.__display_ref_count
self.__display_ref_count += amount
if display_ref_count == 0:
self.__is_master = Tr... | python | def increment_display_ref_count(self, amount: int=1):
"""Increment display reference count to indicate this library item is currently displayed."""
display_ref_count = self.__display_ref_count
self.__display_ref_count += amount
if display_ref_count == 0:
self.__is_master = Tr... | [
"def",
"increment_display_ref_count",
"(",
"self",
",",
"amount",
":",
"int",
"=",
"1",
")",
":",
"display_ref_count",
"=",
"self",
".",
"__display_ref_count",
"self",
".",
"__display_ref_count",
"+=",
"amount",
"if",
"display_ref_count",
"==",
"0",
":",
"self",... | Increment display reference count to indicate this library item is currently displayed. | [
"Increment",
"display",
"reference",
"count",
"to",
"indicate",
"this",
"library",
"item",
"is",
"currently",
"displayed",
"."
] | d43693eaf057b8683b9638e575000f055fede452 | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/DisplayItem.py#L738-L746 | train |
nion-software/nionswift | nion/swift/model/DisplayItem.py | DisplayDataChannel.decrement_display_ref_count | def decrement_display_ref_count(self, amount: int=1):
"""Decrement display reference count to indicate this library item is no longer displayed."""
assert not self._closed
self.__display_ref_count -= amount
if self.__display_ref_count == 0:
self.__is_master = False
if... | python | def decrement_display_ref_count(self, amount: int=1):
"""Decrement display reference count to indicate this library item is no longer displayed."""
assert not self._closed
self.__display_ref_count -= amount
if self.__display_ref_count == 0:
self.__is_master = False
if... | [
"def",
"decrement_display_ref_count",
"(",
"self",
",",
"amount",
":",
"int",
"=",
"1",
")",
":",
"assert",
"not",
"self",
".",
"_closed",
"self",
".",
"__display_ref_count",
"-=",
"amount",
"if",
"self",
".",
"__display_ref_count",
"==",
"0",
":",
"self",
... | Decrement display reference count to indicate this library item is no longer displayed. | [
"Decrement",
"display",
"reference",
"count",
"to",
"indicate",
"this",
"library",
"item",
"is",
"no",
"longer",
"displayed",
"."
] | d43693eaf057b8683b9638e575000f055fede452 | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/DisplayItem.py#L748-L756 | train |
nion-software/nionswift | nion/swift/model/DisplayItem.py | DisplayDataChannel.auto_display_limits | def auto_display_limits(self):
"""Calculate best display limits and set them."""
display_data_and_metadata = self.get_calculated_display_values(True).display_data_and_metadata
data = display_data_and_metadata.data if display_data_and_metadata else None
if data is not None:
# ... | python | def auto_display_limits(self):
"""Calculate best display limits and set them."""
display_data_and_metadata = self.get_calculated_display_values(True).display_data_and_metadata
data = display_data_and_metadata.data if display_data_and_metadata else None
if data is not None:
# ... | [
"def",
"auto_display_limits",
"(",
"self",
")",
":",
"display_data_and_metadata",
"=",
"self",
".",
"get_calculated_display_values",
"(",
"True",
")",
".",
"display_data_and_metadata",
"data",
"=",
"display_data_and_metadata",
".",
"data",
"if",
"display_data_and_metadata... | Calculate best display limits and set them. | [
"Calculate",
"best",
"display",
"limits",
"and",
"set",
"them",
"."
] | d43693eaf057b8683b9638e575000f055fede452 | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/DisplayItem.py#L766-L776 | train |
nion-software/nionswift | nion/swift/model/DisplayItem.py | DisplayItem.snapshot | def snapshot(self):
"""Return a new library item which is a copy of this one with any dynamic behavior made static."""
display_item = self.__class__()
display_item.display_type = self.display_type
# metadata
display_item._set_persistent_property_value("title", self._get_persisten... | python | def snapshot(self):
"""Return a new library item which is a copy of this one with any dynamic behavior made static."""
display_item = self.__class__()
display_item.display_type = self.display_type
# metadata
display_item._set_persistent_property_value("title", self._get_persisten... | [
"def",
"snapshot",
"(",
"self",
")",
":",
"display_item",
"=",
"self",
".",
"__class__",
"(",
")",
"display_item",
".",
"display_type",
"=",
"self",
".",
"display_type",
"# metadata",
"display_item",
".",
"_set_persistent_property_value",
"(",
"\"title\"",
",",
... | Return a new library item which is a copy of this one with any dynamic behavior made static. | [
"Return",
"a",
"new",
"library",
"item",
"which",
"is",
"a",
"copy",
"of",
"this",
"one",
"with",
"any",
"dynamic",
"behavior",
"made",
"static",
"."
] | d43693eaf057b8683b9638e575000f055fede452 | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/DisplayItem.py#L980-L998 | train |
nion-software/nionswift | nion/swift/model/DisplayItem.py | DisplayItem.increment_display_ref_count | def increment_display_ref_count(self, amount: int=1):
"""Increment display reference count to indicate this library item is currently displayed."""
display_ref_count = self.__display_ref_count
self.__display_ref_count += amount
for display_data_channel in self.display_data_channels:
... | python | def increment_display_ref_count(self, amount: int=1):
"""Increment display reference count to indicate this library item is currently displayed."""
display_ref_count = self.__display_ref_count
self.__display_ref_count += amount
for display_data_channel in self.display_data_channels:
... | [
"def",
"increment_display_ref_count",
"(",
"self",
",",
"amount",
":",
"int",
"=",
"1",
")",
":",
"display_ref_count",
"=",
"self",
".",
"__display_ref_count",
"self",
".",
"__display_ref_count",
"+=",
"amount",
"for",
"display_data_channel",
"in",
"self",
".",
... | Increment display reference count to indicate this library item is currently displayed. | [
"Increment",
"display",
"reference",
"count",
"to",
"indicate",
"this",
"library",
"item",
"is",
"currently",
"displayed",
"."
] | d43693eaf057b8683b9638e575000f055fede452 | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/DisplayItem.py#L1167-L1172 | train |
nion-software/nionswift | nion/swift/model/DisplayItem.py | DisplayItem.decrement_display_ref_count | def decrement_display_ref_count(self, amount: int=1):
"""Decrement display reference count to indicate this library item is no longer displayed."""
assert not self._closed
self.__display_ref_count -= amount
for display_data_channel in self.display_data_channels:
display_data_... | python | def decrement_display_ref_count(self, amount: int=1):
"""Decrement display reference count to indicate this library item is no longer displayed."""
assert not self._closed
self.__display_ref_count -= amount
for display_data_channel in self.display_data_channels:
display_data_... | [
"def",
"decrement_display_ref_count",
"(",
"self",
",",
"amount",
":",
"int",
"=",
"1",
")",
":",
"assert",
"not",
"self",
".",
"_closed",
"self",
".",
"__display_ref_count",
"-=",
"amount",
"for",
"display_data_channel",
"in",
"self",
".",
"display_data_channel... | Decrement display reference count to indicate this library item is no longer displayed. | [
"Decrement",
"display",
"reference",
"count",
"to",
"indicate",
"this",
"library",
"item",
"is",
"no",
"longer",
"displayed",
"."
] | d43693eaf057b8683b9638e575000f055fede452 | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/DisplayItem.py#L1174-L1179 | train |
nion-software/nionswift | nion/swift/model/DisplayItem.py | DisplayItem.remove_graphic | def remove_graphic(self, graphic: Graphics.Graphic, *, safe: bool=False) -> typing.Optional[typing.Sequence]:
"""Remove a graphic, but do it through the container, so dependencies can be tracked."""
return self.remove_model_item(self, "graphics", graphic, safe=safe) | python | def remove_graphic(self, graphic: Graphics.Graphic, *, safe: bool=False) -> typing.Optional[typing.Sequence]:
"""Remove a graphic, but do it through the container, so dependencies can be tracked."""
return self.remove_model_item(self, "graphics", graphic, safe=safe) | [
"def",
"remove_graphic",
"(",
"self",
",",
"graphic",
":",
"Graphics",
".",
"Graphic",
",",
"*",
",",
"safe",
":",
"bool",
"=",
"False",
")",
"->",
"typing",
".",
"Optional",
"[",
"typing",
".",
"Sequence",
"]",
":",
"return",
"self",
".",
"remove_mode... | Remove a graphic, but do it through the container, so dependencies can be tracked. | [
"Remove",
"a",
"graphic",
"but",
"do",
"it",
"through",
"the",
"container",
"so",
"dependencies",
"can",
"be",
"tracked",
"."
] | d43693eaf057b8683b9638e575000f055fede452 | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/DisplayItem.py#L1446-L1448 | train |
nion-software/nionswift | nion/swift/model/DisplayItem.py | DisplayItem.dimensional_shape | def dimensional_shape(self) -> typing.Optional[typing.Tuple[int, ...]]:
"""Shape of the underlying data, if only one."""
if not self.__data_and_metadata:
return None
return self.__data_and_metadata.dimensional_shape | python | def dimensional_shape(self) -> typing.Optional[typing.Tuple[int, ...]]:
"""Shape of the underlying data, if only one."""
if not self.__data_and_metadata:
return None
return self.__data_and_metadata.dimensional_shape | [
"def",
"dimensional_shape",
"(",
"self",
")",
"->",
"typing",
".",
"Optional",
"[",
"typing",
".",
"Tuple",
"[",
"int",
",",
"...",
"]",
"]",
":",
"if",
"not",
"self",
".",
"__data_and_metadata",
":",
"return",
"None",
"return",
"self",
".",
"__data_and_... | Shape of the underlying data, if only one. | [
"Shape",
"of",
"the",
"underlying",
"data",
"if",
"only",
"one",
"."
] | d43693eaf057b8683b9638e575000f055fede452 | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/DisplayItem.py#L1482-L1486 | train |
nion-software/nionswift | nion/swift/model/DisplayItem.py | DisplayItem.view_to_intervals | def view_to_intervals(self, data_and_metadata: DataAndMetadata.DataAndMetadata, intervals: typing.List[typing.Tuple[float, float]]) -> None:
"""Change the view to encompass the channels and data represented by the given intervals."""
left = None
right = None
for interval in intervals:
... | python | def view_to_intervals(self, data_and_metadata: DataAndMetadata.DataAndMetadata, intervals: typing.List[typing.Tuple[float, float]]) -> None:
"""Change the view to encompass the channels and data represented by the given intervals."""
left = None
right = None
for interval in intervals:
... | [
"def",
"view_to_intervals",
"(",
"self",
",",
"data_and_metadata",
":",
"DataAndMetadata",
".",
"DataAndMetadata",
",",
"intervals",
":",
"typing",
".",
"List",
"[",
"typing",
".",
"Tuple",
"[",
"float",
",",
"float",
"]",
"]",
")",
"->",
"None",
":",
"lef... | Change the view to encompass the channels and data represented by the given intervals. | [
"Change",
"the",
"view",
"to",
"encompass",
"the",
"channels",
"and",
"data",
"represented",
"by",
"the",
"given",
"intervals",
"."
] | d43693eaf057b8683b9638e575000f055fede452 | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/DisplayItem.py#L1587-L1611 | train |
nion-software/nionswift | nion/swift/model/NDataHandler.py | write_local_file | def write_local_file(fp, name_bytes, writer, dt):
"""
Writes a zip file local file header structure at the current file position.
Returns data_len, crc32 for the data.
:param fp: the file point to which to write the header
:param name: the name of the file
:param writer: a ... | python | def write_local_file(fp, name_bytes, writer, dt):
"""
Writes a zip file local file header structure at the current file position.
Returns data_len, crc32 for the data.
:param fp: the file point to which to write the header
:param name: the name of the file
:param writer: a ... | [
"def",
"write_local_file",
"(",
"fp",
",",
"name_bytes",
",",
"writer",
",",
"dt",
")",
":",
"fp",
".",
"write",
"(",
"struct",
".",
"pack",
"(",
"'I'",
",",
"0x04034b50",
")",
")",
"# local file header",
"fp",
".",
"write",
"(",
"struct",
".",
"pack",... | Writes a zip file local file header structure at the current file position.
Returns data_len, crc32 for the data.
:param fp: the file point to which to write the header
:param name: the name of the file
:param writer: a function taking an fp parameter to do the writing, returns crc32
... | [
"Writes",
"a",
"zip",
"file",
"local",
"file",
"header",
"structure",
"at",
"the",
"current",
"file",
"position",
"."
] | d43693eaf057b8683b9638e575000f055fede452 | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/NDataHandler.py#L40-L77 | train |
nion-software/nionswift | nion/swift/model/NDataHandler.py | write_directory_data | def write_directory_data(fp, offset, name_bytes, data_len, crc32, dt):
"""
Write a zip fie directory entry at the current file position
:param fp: the file point to which to write the header
:param offset: the offset of the associated local file header
:param name: the name of the f... | python | def write_directory_data(fp, offset, name_bytes, data_len, crc32, dt):
"""
Write a zip fie directory entry at the current file position
:param fp: the file point to which to write the header
:param offset: the offset of the associated local file header
:param name: the name of the f... | [
"def",
"write_directory_data",
"(",
"fp",
",",
"offset",
",",
"name_bytes",
",",
"data_len",
",",
"crc32",
",",
"dt",
")",
":",
"fp",
".",
"write",
"(",
"struct",
".",
"pack",
"(",
"'I'",
",",
"0x02014b50",
")",
")",
"# central directory header",
"fp",
"... | Write a zip fie directory entry at the current file position
:param fp: the file point to which to write the header
:param offset: the offset of the associated local file header
:param name: the name of the file
:param data_len: the length of data that will be written to the archive
... | [
"Write",
"a",
"zip",
"fie",
"directory",
"entry",
"at",
"the",
"current",
"file",
"position"
] | d43693eaf057b8683b9638e575000f055fede452 | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/NDataHandler.py#L80-L110 | train |
nion-software/nionswift | nion/swift/model/NDataHandler.py | write_end_of_directory | def write_end_of_directory(fp, dir_size, dir_offset, count):
"""
Write zip file end of directory header at the current file position
:param fp: the file point to which to write the header
:param dir_size: the total size of the directory
:param dir_offset: the start of the first dire... | python | def write_end_of_directory(fp, dir_size, dir_offset, count):
"""
Write zip file end of directory header at the current file position
:param fp: the file point to which to write the header
:param dir_size: the total size of the directory
:param dir_offset: the start of the first dire... | [
"def",
"write_end_of_directory",
"(",
"fp",
",",
"dir_size",
",",
"dir_offset",
",",
"count",
")",
":",
"fp",
".",
"write",
"(",
"struct",
".",
"pack",
"(",
"'I'",
",",
"0x06054b50",
")",
")",
"# central directory header",
"fp",
".",
"write",
"(",
"struct"... | Write zip file end of directory header at the current file position
:param fp: the file point to which to write the header
:param dir_size: the total size of the directory
:param dir_offset: the start of the first directory header
:param count: the count of files | [
"Write",
"zip",
"file",
"end",
"of",
"directory",
"header",
"at",
"the",
"current",
"file",
"position"
] | d43693eaf057b8683b9638e575000f055fede452 | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/NDataHandler.py#L113-L129 | train |
nion-software/nionswift | nion/swift/model/NDataHandler.py | write_zip_fp | def write_zip_fp(fp, data, properties, dir_data_list=None):
"""
Write custom zip file of data and properties to fp
:param fp: the file point to which to write the header
:param data: the data to write to the file; may be None
:param properties: the properties to write to the file; m... | python | def write_zip_fp(fp, data, properties, dir_data_list=None):
"""
Write custom zip file of data and properties to fp
:param fp: the file point to which to write the header
:param data: the data to write to the file; may be None
:param properties: the properties to write to the file; m... | [
"def",
"write_zip_fp",
"(",
"fp",
",",
"data",
",",
"properties",
",",
"dir_data_list",
"=",
"None",
")",
":",
"assert",
"data",
"is",
"not",
"None",
"or",
"properties",
"is",
"not",
"None",
"# dir_data_list has the format: local file record offset, name, data length,... | Write custom zip file of data and properties to fp
:param fp: the file point to which to write the header
:param data: the data to write to the file; may be None
:param properties: the properties to write to the file; may be None
:param dir_data_list: optional list of directory header i... | [
"Write",
"custom",
"zip",
"file",
"of",
"data",
"and",
"properties",
"to",
"fp"
] | d43693eaf057b8683b9638e575000f055fede452 | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/NDataHandler.py#L132-L199 | train |
nion-software/nionswift | nion/swift/model/NDataHandler.py | write_zip | def write_zip(file_path, data, properties):
"""
Write custom zip file to the file path
:param file_path: the file to which to write the zip file
:param data: the data to write to the file; may be None
:param properties: the properties to write to the file; may be None
The p... | python | def write_zip(file_path, data, properties):
"""
Write custom zip file to the file path
:param file_path: the file to which to write the zip file
:param data: the data to write to the file; may be None
:param properties: the properties to write to the file; may be None
The p... | [
"def",
"write_zip",
"(",
"file_path",
",",
"data",
",",
"properties",
")",
":",
"with",
"open",
"(",
"file_path",
",",
"\"w+b\"",
")",
"as",
"fp",
":",
"write_zip_fp",
"(",
"fp",
",",
"data",
",",
"properties",
")"
] | Write custom zip file to the file path
:param file_path: the file to which to write the zip file
:param data: the data to write to the file; may be None
:param properties: the properties to write to the file; may be None
The properties param must not change during this method. Callers ... | [
"Write",
"custom",
"zip",
"file",
"to",
"the",
"file",
"path"
] | d43693eaf057b8683b9638e575000f055fede452 | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/NDataHandler.py#L202-L216 | train |
nion-software/nionswift | nion/swift/model/NDataHandler.py | parse_zip | def parse_zip(fp):
"""
Parse the zip file headers at fp
:param fp: the file pointer from which to parse the zip file
:return: A tuple of local files, directory headers, and end of central directory
The local files are dictionary where the keys are the local file offset and the
... | python | def parse_zip(fp):
"""
Parse the zip file headers at fp
:param fp: the file pointer from which to parse the zip file
:return: A tuple of local files, directory headers, and end of central directory
The local files are dictionary where the keys are the local file offset and the
... | [
"def",
"parse_zip",
"(",
"fp",
")",
":",
"local_files",
"=",
"{",
"}",
"dir_files",
"=",
"{",
"}",
"eocd",
"=",
"None",
"fp",
".",
"seek",
"(",
"0",
")",
"while",
"True",
":",
"pos",
"=",
"fp",
".",
"tell",
"(",
")",
"signature",
"=",
"struct",
... | Parse the zip file headers at fp
:param fp: the file pointer from which to parse the zip file
:return: A tuple of local files, directory headers, and end of central directory
The local files are dictionary where the keys are the local file offset and the
values are each a tuple consist... | [
"Parse",
"the",
"zip",
"file",
"headers",
"at",
"fp"
] | d43693eaf057b8683b9638e575000f055fede452 | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/NDataHandler.py#L219-L275 | train |
nion-software/nionswift | nion/swift/model/NDataHandler.py | read_data | def read_data(fp, local_files, dir_files, name_bytes):
"""
Read a numpy data array from the zip file
:param fp: a file pointer
:param local_files: the local files structure
:param dir_files: the directory headers
:param name: the name of the data file to read
:return... | python | def read_data(fp, local_files, dir_files, name_bytes):
"""
Read a numpy data array from the zip file
:param fp: a file pointer
:param local_files: the local files structure
:param dir_files: the directory headers
:param name: the name of the data file to read
:return... | [
"def",
"read_data",
"(",
"fp",
",",
"local_files",
",",
"dir_files",
",",
"name_bytes",
")",
":",
"if",
"name_bytes",
"in",
"dir_files",
":",
"fp",
".",
"seek",
"(",
"local_files",
"[",
"dir_files",
"[",
"name_bytes",
"]",
"[",
"1",
"]",
"]",
"[",
"1",... | Read a numpy data array from the zip file
:param fp: a file pointer
:param local_files: the local files structure
:param dir_files: the directory headers
:param name: the name of the data file to read
:return: the numpy data array, if found
The file pointer will be at a... | [
"Read",
"a",
"numpy",
"data",
"array",
"from",
"the",
"zip",
"file"
] | d43693eaf057b8683b9638e575000f055fede452 | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/NDataHandler.py#L278-L297 | train |
nion-software/nionswift | nion/swift/model/NDataHandler.py | read_json | def read_json(fp, local_files, dir_files, name_bytes):
"""
Read json properties from the zip file
:param fp: a file pointer
:param local_files: the local files structure
:param dir_files: the directory headers
:param name: the name of the json file to read
:return: t... | python | def read_json(fp, local_files, dir_files, name_bytes):
"""
Read json properties from the zip file
:param fp: a file pointer
:param local_files: the local files structure
:param dir_files: the directory headers
:param name: the name of the json file to read
:return: t... | [
"def",
"read_json",
"(",
"fp",
",",
"local_files",
",",
"dir_files",
",",
"name_bytes",
")",
":",
"if",
"name_bytes",
"in",
"dir_files",
":",
"json_pos",
"=",
"local_files",
"[",
"dir_files",
"[",
"name_bytes",
"]",
"[",
"1",
"]",
"]",
"[",
"1",
"]",
"... | Read json properties from the zip file
:param fp: a file pointer
:param local_files: the local files structure
:param dir_files: the directory headers
:param name: the name of the json file to read
:return: the json properites as a dictionary, if found
The file pointer ... | [
"Read",
"json",
"properties",
"from",
"the",
"zip",
"file"
] | d43693eaf057b8683b9638e575000f055fede452 | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/NDataHandler.py#L300-L322 | train |
nion-software/nionswift | nion/swift/model/NDataHandler.py | rewrite_zip | def rewrite_zip(file_path, properties):
"""
Rewrite the json properties in the zip file
:param file_path: the file path to the zip file
:param properties: the updated properties to write to the zip file
This method will attempt to keep the data file within the zip
file inta... | python | def rewrite_zip(file_path, properties):
"""
Rewrite the json properties in the zip file
:param file_path: the file path to the zip file
:param properties: the updated properties to write to the zip file
This method will attempt to keep the data file within the zip
file inta... | [
"def",
"rewrite_zip",
"(",
"file_path",
",",
"properties",
")",
":",
"with",
"open",
"(",
"file_path",
",",
"\"r+b\"",
")",
"as",
"fp",
":",
"local_files",
",",
"dir_files",
",",
"eocd",
"=",
"parse_zip",
"(",
"fp",
")",
"# check to make sure directory has two... | Rewrite the json properties in the zip file
:param file_path: the file path to the zip file
:param properties: the updated properties to write to the zip file
This method will attempt to keep the data file within the zip
file intact without rewriting it. However, if the data file is no... | [
"Rewrite",
"the",
"json",
"properties",
"in",
"the",
"zip",
"file"
] | d43693eaf057b8683b9638e575000f055fede452 | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/NDataHandler.py#L325-L356 | train |
nion-software/nionswift | nion/swift/model/NDataHandler.py | NDataHandler.is_matching | def is_matching(cls, file_path):
"""
Return whether the given absolute file path is an ndata file.
"""
if file_path.endswith(".ndata") and os.path.exists(file_path):
try:
with open(file_path, "r+b") as fp:
local_files, dir_files, eocd =... | python | def is_matching(cls, file_path):
"""
Return whether the given absolute file path is an ndata file.
"""
if file_path.endswith(".ndata") and os.path.exists(file_path):
try:
with open(file_path, "r+b") as fp:
local_files, dir_files, eocd =... | [
"def",
"is_matching",
"(",
"cls",
",",
"file_path",
")",
":",
"if",
"file_path",
".",
"endswith",
"(",
"\".ndata\"",
")",
"and",
"os",
".",
"path",
".",
"exists",
"(",
"file_path",
")",
":",
"try",
":",
"with",
"open",
"(",
"file_path",
",",
"\"r+b\"",... | Return whether the given absolute file path is an ndata file. | [
"Return",
"whether",
"the",
"given",
"absolute",
"file",
"path",
"is",
"an",
"ndata",
"file",
"."
] | d43693eaf057b8683b9638e575000f055fede452 | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/NDataHandler.py#L393-L411 | train |
nion-software/nionswift | nion/swift/model/NDataHandler.py | NDataHandler.write_data | def write_data(self, data, file_datetime):
"""
Write data to the ndata file specified by reference.
:param data: the numpy array data to write
:param file_datetime: the datetime for the file
"""
with self.__lock:
assert data is not None
... | python | def write_data(self, data, file_datetime):
"""
Write data to the ndata file specified by reference.
:param data: the numpy array data to write
:param file_datetime: the datetime for the file
"""
with self.__lock:
assert data is not None
... | [
"def",
"write_data",
"(",
"self",
",",
"data",
",",
"file_datetime",
")",
":",
"with",
"self",
".",
"__lock",
":",
"assert",
"data",
"is",
"not",
"None",
"absolute_file_path",
"=",
"self",
".",
"__file_path",
"#logging.debug(\"WRITE data file %s for %s\", absolute_f... | Write data to the ndata file specified by reference.
:param data: the numpy array data to write
:param file_datetime: the datetime for the file | [
"Write",
"data",
"to",
"the",
"ndata",
"file",
"specified",
"by",
"reference",
"."
] | d43693eaf057b8683b9638e575000f055fede452 | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/NDataHandler.py#L425-L442 | train |
nion-software/nionswift | nion/swift/model/NDataHandler.py | NDataHandler.write_properties | def write_properties(self, properties, file_datetime):
"""
Write properties to the ndata file specified by reference.
:param reference: the reference to which to write
:param properties: the dict to write to the file
:param file_datetime: the datetime for the fil... | python | def write_properties(self, properties, file_datetime):
"""
Write properties to the ndata file specified by reference.
:param reference: the reference to which to write
:param properties: the dict to write to the file
:param file_datetime: the datetime for the fil... | [
"def",
"write_properties",
"(",
"self",
",",
"properties",
",",
"file_datetime",
")",
":",
"with",
"self",
".",
"__lock",
":",
"absolute_file_path",
"=",
"self",
".",
"__file_path",
"#logging.debug(\"WRITE properties %s for %s\", absolute_file_path, key)",
"make_directory_i... | Write properties to the ndata file specified by reference.
:param reference: the reference to which to write
:param properties: the dict to write to the file
:param file_datetime: the datetime for the file
The properties param must not change during this method. Callers... | [
"Write",
"properties",
"to",
"the",
"ndata",
"file",
"specified",
"by",
"reference",
"."
] | d43693eaf057b8683b9638e575000f055fede452 | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/NDataHandler.py#L444-L467 | train |
nion-software/nionswift | nion/swift/model/NDataHandler.py | NDataHandler.read_properties | def read_properties(self):
"""
Read properties from the ndata file reference
:param reference: the reference from which to read
:return: a tuple of the item_uuid and a dict of the properties
"""
with self.__lock:
absolute_file_path = self.__file_p... | python | def read_properties(self):
"""
Read properties from the ndata file reference
:param reference: the reference from which to read
:return: a tuple of the item_uuid and a dict of the properties
"""
with self.__lock:
absolute_file_path = self.__file_p... | [
"def",
"read_properties",
"(",
"self",
")",
":",
"with",
"self",
".",
"__lock",
":",
"absolute_file_path",
"=",
"self",
".",
"__file_path",
"with",
"open",
"(",
"absolute_file_path",
",",
"\"rb\"",
")",
"as",
"fp",
":",
"local_files",
",",
"dir_files",
",",
... | Read properties from the ndata file reference
:param reference: the reference from which to read
:return: a tuple of the item_uuid and a dict of the properties | [
"Read",
"properties",
"from",
"the",
"ndata",
"file",
"reference"
] | d43693eaf057b8683b9638e575000f055fede452 | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/NDataHandler.py#L469-L481 | train |
nion-software/nionswift | nion/swift/model/NDataHandler.py | NDataHandler.read_data | def read_data(self):
"""
Read data from the ndata file reference
:param reference: the reference from which to read
:return: a numpy array of the data; maybe None
"""
with self.__lock:
absolute_file_path = self.__file_path
#logging.deb... | python | def read_data(self):
"""
Read data from the ndata file reference
:param reference: the reference from which to read
:return: a numpy array of the data; maybe None
"""
with self.__lock:
absolute_file_path = self.__file_path
#logging.deb... | [
"def",
"read_data",
"(",
"self",
")",
":",
"with",
"self",
".",
"__lock",
":",
"absolute_file_path",
"=",
"self",
".",
"__file_path",
"#logging.debug(\"READ data file %s\", absolute_file_path)",
"with",
"open",
"(",
"absolute_file_path",
",",
"\"rb\"",
")",
"as",
"f... | Read data from the ndata file reference
:param reference: the reference from which to read
:return: a numpy array of the data; maybe None | [
"Read",
"data",
"from",
"the",
"ndata",
"file",
"reference"
] | d43693eaf057b8683b9638e575000f055fede452 | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/NDataHandler.py#L483-L496 | train |
nion-software/nionswift | nion/swift/model/NDataHandler.py | NDataHandler.remove | def remove(self):
"""
Remove the ndata file reference
:param reference: the reference to remove
"""
with self.__lock:
absolute_file_path = self.__file_path
#logging.debug("DELETE data file %s", absolute_file_path)
if os.path.isfile(abs... | python | def remove(self):
"""
Remove the ndata file reference
:param reference: the reference to remove
"""
with self.__lock:
absolute_file_path = self.__file_path
#logging.debug("DELETE data file %s", absolute_file_path)
if os.path.isfile(abs... | [
"def",
"remove",
"(",
"self",
")",
":",
"with",
"self",
".",
"__lock",
":",
"absolute_file_path",
"=",
"self",
".",
"__file_path",
"#logging.debug(\"DELETE data file %s\", absolute_file_path)",
"if",
"os",
".",
"path",
".",
"isfile",
"(",
"absolute_file_path",
")",
... | Remove the ndata file reference
:param reference: the reference to remove | [
"Remove",
"the",
"ndata",
"file",
"reference"
] | d43693eaf057b8683b9638e575000f055fede452 | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/NDataHandler.py#L498-L508 | train |
nion-software/nionswift | nion/swift/DisplayPanel.py | DisplayPanelManager.build_menu | def build_menu(self, display_type_menu, document_controller, display_panel):
"""Build the dynamic menu for the selected display panel.
The user accesses this menu by right-clicking on the display panel.
The basic menu items are to an empty display panel or a browser display panel.
Aft... | python | def build_menu(self, display_type_menu, document_controller, display_panel):
"""Build the dynamic menu for the selected display panel.
The user accesses this menu by right-clicking on the display panel.
The basic menu items are to an empty display panel or a browser display panel.
Aft... | [
"def",
"build_menu",
"(",
"self",
",",
"display_type_menu",
",",
"document_controller",
",",
"display_panel",
")",
":",
"dynamic_live_actions",
"=",
"list",
"(",
")",
"def",
"switch_to_display_content",
"(",
"display_panel_type",
")",
":",
"self",
".",
"switch_to_di... | Build the dynamic menu for the selected display panel.
The user accesses this menu by right-clicking on the display panel.
The basic menu items are to an empty display panel or a browser display panel.
After that, each display controller factory is given a chance to add to the menu. The displ... | [
"Build",
"the",
"dynamic",
"menu",
"for",
"the",
"selected",
"display",
"panel",
"."
] | d43693eaf057b8683b9638e575000f055fede452 | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/DisplayPanel.py#L1898-L1936 | train |
nion-software/nionswift | nion/swift/model/DataStructure.py | DataStructure.persistent_object_context_changed | def persistent_object_context_changed(self):
""" Override from PersistentObject. """
super().persistent_object_context_changed()
def source_registered(source):
self.__source = source
def source_unregistered(source=None):
pass
def reference_registered(pr... | python | def persistent_object_context_changed(self):
""" Override from PersistentObject. """
super().persistent_object_context_changed()
def source_registered(source):
self.__source = source
def source_unregistered(source=None):
pass
def reference_registered(pr... | [
"def",
"persistent_object_context_changed",
"(",
"self",
")",
":",
"super",
"(",
")",
".",
"persistent_object_context_changed",
"(",
")",
"def",
"source_registered",
"(",
"source",
")",
":",
"self",
".",
"__source",
"=",
"source",
"def",
"source_unregistered",
"("... | Override from PersistentObject. | [
"Override",
"from",
"PersistentObject",
"."
] | d43693eaf057b8683b9638e575000f055fede452 | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/model/DataStructure.py#L114-L141 | train |
base4sistemas/satcfe | satcfe/clientesathub.py | ClienteSATHub.ativar_sat | def ativar_sat(self, tipo_certificado, cnpj, codigo_uf):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.ativar_sat`.
:return: Uma resposta SAT especializada em ``AtivarSAT``.
:rtype: satcfe.resposta.ativarsat.RespostaAtivarSAT
"""
resp = self._http_post('ativarsat',
... | python | def ativar_sat(self, tipo_certificado, cnpj, codigo_uf):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.ativar_sat`.
:return: Uma resposta SAT especializada em ``AtivarSAT``.
:rtype: satcfe.resposta.ativarsat.RespostaAtivarSAT
"""
resp = self._http_post('ativarsat',
... | [
"def",
"ativar_sat",
"(",
"self",
",",
"tipo_certificado",
",",
"cnpj",
",",
"codigo_uf",
")",
":",
"resp",
"=",
"self",
".",
"_http_post",
"(",
"'ativarsat'",
",",
"tipo_certificado",
"=",
"tipo_certificado",
",",
"cnpj",
"=",
"cnpj",
",",
"codigo_uf",
"=",... | Sobrepõe :meth:`~satcfe.base.FuncoesSAT.ativar_sat`.
:return: Uma resposta SAT especializada em ``AtivarSAT``.
:rtype: satcfe.resposta.ativarsat.RespostaAtivarSAT | [
"Sobrepõe",
":",
"meth",
":",
"~satcfe",
".",
"base",
".",
"FuncoesSAT",
".",
"ativar_sat",
"."
] | cb8e8815f4133d3e3d94cf526fa86767b4521ed9 | https://github.com/base4sistemas/satcfe/blob/cb8e8815f4133d3e3d94cf526fa86767b4521ed9/satcfe/clientesathub.py#L103-L114 | train |
base4sistemas/satcfe | satcfe/clientesathub.py | ClienteSATHub.comunicar_certificado_icpbrasil | def comunicar_certificado_icpbrasil(self, certificado):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.comunicar_certificado_icpbrasil`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
resp = self._http_post('comunicarcertificadoicpbrasil',
... | python | def comunicar_certificado_icpbrasil(self, certificado):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.comunicar_certificado_icpbrasil`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
resp = self._http_post('comunicarcertificadoicpbrasil',
... | [
"def",
"comunicar_certificado_icpbrasil",
"(",
"self",
",",
"certificado",
")",
":",
"resp",
"=",
"self",
".",
"_http_post",
"(",
"'comunicarcertificadoicpbrasil'",
",",
"certificado",
"=",
"certificado",
")",
"conteudo",
"=",
"resp",
".",
"json",
"(",
")",
"ret... | Sobrepõe :meth:`~satcfe.base.FuncoesSAT.comunicar_certificado_icpbrasil`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT | [
"Sobrepõe",
":",
"meth",
":",
"~satcfe",
".",
"base",
".",
"FuncoesSAT",
".",
"comunicar_certificado_icpbrasil",
"."
] | cb8e8815f4133d3e3d94cf526fa86767b4521ed9 | https://github.com/base4sistemas/satcfe/blob/cb8e8815f4133d3e3d94cf526fa86767b4521ed9/satcfe/clientesathub.py#L117-L127 | train |
base4sistemas/satcfe | satcfe/clientesathub.py | ClienteSATHub.enviar_dados_venda | def enviar_dados_venda(self, dados_venda):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.enviar_dados_venda`.
:return: Uma resposta SAT especializada em ``EnviarDadosVenda``.
:rtype: satcfe.resposta.enviardadosvenda.RespostaEnviarDadosVenda
"""
resp = self._http_post('enviardadosve... | python | def enviar_dados_venda(self, dados_venda):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.enviar_dados_venda`.
:return: Uma resposta SAT especializada em ``EnviarDadosVenda``.
:rtype: satcfe.resposta.enviardadosvenda.RespostaEnviarDadosVenda
"""
resp = self._http_post('enviardadosve... | [
"def",
"enviar_dados_venda",
"(",
"self",
",",
"dados_venda",
")",
":",
"resp",
"=",
"self",
".",
"_http_post",
"(",
"'enviardadosvenda'",
",",
"dados_venda",
"=",
"dados_venda",
".",
"documento",
"(",
")",
")",
"conteudo",
"=",
"resp",
".",
"json",
"(",
"... | Sobrepõe :meth:`~satcfe.base.FuncoesSAT.enviar_dados_venda`.
:return: Uma resposta SAT especializada em ``EnviarDadosVenda``.
:rtype: satcfe.resposta.enviardadosvenda.RespostaEnviarDadosVenda | [
"Sobrepõe",
":",
"meth",
":",
"~satcfe",
".",
"base",
".",
"FuncoesSAT",
".",
"enviar_dados_venda",
"."
] | cb8e8815f4133d3e3d94cf526fa86767b4521ed9 | https://github.com/base4sistemas/satcfe/blob/cb8e8815f4133d3e3d94cf526fa86767b4521ed9/satcfe/clientesathub.py#L130-L139 | train |
base4sistemas/satcfe | satcfe/clientesathub.py | ClienteSATHub.cancelar_ultima_venda | def cancelar_ultima_venda(self, chave_cfe, dados_cancelamento):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.cancelar_ultima_venda`.
:return: Uma resposta SAT especializada em ``CancelarUltimaVenda``.
:rtype: satcfe.resposta.cancelarultimavenda.RespostaCancelarUltimaVenda
"""
resp... | python | def cancelar_ultima_venda(self, chave_cfe, dados_cancelamento):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.cancelar_ultima_venda`.
:return: Uma resposta SAT especializada em ``CancelarUltimaVenda``.
:rtype: satcfe.resposta.cancelarultimavenda.RespostaCancelarUltimaVenda
"""
resp... | [
"def",
"cancelar_ultima_venda",
"(",
"self",
",",
"chave_cfe",
",",
"dados_cancelamento",
")",
":",
"resp",
"=",
"self",
".",
"_http_post",
"(",
"'cancelarultimavenda'",
",",
"chave_cfe",
"=",
"chave_cfe",
",",
"dados_cancelamento",
"=",
"dados_cancelamento",
".",
... | Sobrepõe :meth:`~satcfe.base.FuncoesSAT.cancelar_ultima_venda`.
:return: Uma resposta SAT especializada em ``CancelarUltimaVenda``.
:rtype: satcfe.resposta.cancelarultimavenda.RespostaCancelarUltimaVenda | [
"Sobrepõe",
":",
"meth",
":",
"~satcfe",
".",
"base",
".",
"FuncoesSAT",
".",
"cancelar_ultima_venda",
"."
] | cb8e8815f4133d3e3d94cf526fa86767b4521ed9 | https://github.com/base4sistemas/satcfe/blob/cb8e8815f4133d3e3d94cf526fa86767b4521ed9/satcfe/clientesathub.py#L142-L152 | train |
base4sistemas/satcfe | satcfe/clientesathub.py | ClienteSATHub.consultar_sat | def consultar_sat(self):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.consultar_sat`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
resp = self._http_post('consultarsat')
conteudo = resp.json()
return RespostaSAT.consultar_sat(con... | python | def consultar_sat(self):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.consultar_sat`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
resp = self._http_post('consultarsat')
conteudo = resp.json()
return RespostaSAT.consultar_sat(con... | [
"def",
"consultar_sat",
"(",
"self",
")",
":",
"resp",
"=",
"self",
".",
"_http_post",
"(",
"'consultarsat'",
")",
"conteudo",
"=",
"resp",
".",
"json",
"(",
")",
"return",
"RespostaSAT",
".",
"consultar_sat",
"(",
"conteudo",
".",
"get",
"(",
"'retorno'",... | Sobrepõe :meth:`~satcfe.base.FuncoesSAT.consultar_sat`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT | [
"Sobrepõe",
":",
"meth",
":",
"~satcfe",
".",
"base",
".",
"FuncoesSAT",
".",
"consultar_sat",
"."
] | cb8e8815f4133d3e3d94cf526fa86767b4521ed9 | https://github.com/base4sistemas/satcfe/blob/cb8e8815f4133d3e3d94cf526fa86767b4521ed9/satcfe/clientesathub.py#L155-L163 | train |
base4sistemas/satcfe | satcfe/clientesathub.py | ClienteSATHub.consultar_status_operacional | def consultar_status_operacional(self):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.consultar_status_operacional`.
:return: Uma resposta SAT especializada em ``ConsultarStatusOperacional``.
:rtype: satcfe.resposta.consultarstatusoperacional.RespostaConsultarStatusOperacional
"""
... | python | def consultar_status_operacional(self):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.consultar_status_operacional`.
:return: Uma resposta SAT especializada em ``ConsultarStatusOperacional``.
:rtype: satcfe.resposta.consultarstatusoperacional.RespostaConsultarStatusOperacional
"""
... | [
"def",
"consultar_status_operacional",
"(",
"self",
")",
":",
"resp",
"=",
"self",
".",
"_http_post",
"(",
"'consultarstatusoperacional'",
")",
"conteudo",
"=",
"resp",
".",
"json",
"(",
")",
"return",
"RespostaConsultarStatusOperacional",
".",
"analisar",
"(",
"c... | Sobrepõe :meth:`~satcfe.base.FuncoesSAT.consultar_status_operacional`.
:return: Uma resposta SAT especializada em ``ConsultarStatusOperacional``.
:rtype: satcfe.resposta.consultarstatusoperacional.RespostaConsultarStatusOperacional | [
"Sobrepõe",
":",
"meth",
":",
"~satcfe",
".",
"base",
".",
"FuncoesSAT",
".",
"consultar_status_operacional",
"."
] | cb8e8815f4133d3e3d94cf526fa86767b4521ed9 | https://github.com/base4sistemas/satcfe/blob/cb8e8815f4133d3e3d94cf526fa86767b4521ed9/satcfe/clientesathub.py#L178-L187 | train |
base4sistemas/satcfe | satcfe/clientesathub.py | ClienteSATHub.consultar_numero_sessao | def consultar_numero_sessao(self, numero_sessao):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.consultar_numero_sessao`.
:return: Uma resposta SAT que irá depender da sessão consultada.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
resp = self._http_post('consultarnumerosessao',
... | python | def consultar_numero_sessao(self, numero_sessao):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.consultar_numero_sessao`.
:return: Uma resposta SAT que irá depender da sessão consultada.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
resp = self._http_post('consultarnumerosessao',
... | [
"def",
"consultar_numero_sessao",
"(",
"self",
",",
"numero_sessao",
")",
":",
"resp",
"=",
"self",
".",
"_http_post",
"(",
"'consultarnumerosessao'",
",",
"numero_sessao",
"=",
"numero_sessao",
")",
"conteudo",
"=",
"resp",
".",
"json",
"(",
")",
"return",
"R... | Sobrepõe :meth:`~satcfe.base.FuncoesSAT.consultar_numero_sessao`.
:return: Uma resposta SAT que irá depender da sessão consultada.
:rtype: satcfe.resposta.padrao.RespostaSAT | [
"Sobrepõe",
":",
"meth",
":",
"~satcfe",
".",
"base",
".",
"FuncoesSAT",
".",
"consultar_numero_sessao",
"."
] | cb8e8815f4133d3e3d94cf526fa86767b4521ed9 | https://github.com/base4sistemas/satcfe/blob/cb8e8815f4133d3e3d94cf526fa86767b4521ed9/satcfe/clientesathub.py#L190-L199 | train |
base4sistemas/satcfe | satcfe/clientesathub.py | ClienteSATHub.configurar_interface_de_rede | def configurar_interface_de_rede(self, configuracao):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.configurar_interface_de_rede`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
resp = self._http_post('configurarinterfacederede',
co... | python | def configurar_interface_de_rede(self, configuracao):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.configurar_interface_de_rede`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
resp = self._http_post('configurarinterfacederede',
co... | [
"def",
"configurar_interface_de_rede",
"(",
"self",
",",
"configuracao",
")",
":",
"resp",
"=",
"self",
".",
"_http_post",
"(",
"'configurarinterfacederede'",
",",
"configuracao",
"=",
"configuracao",
".",
"documento",
"(",
")",
")",
"conteudo",
"=",
"resp",
"."... | Sobrepõe :meth:`~satcfe.base.FuncoesSAT.configurar_interface_de_rede`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT | [
"Sobrepõe",
":",
"meth",
":",
"~satcfe",
".",
"base",
".",
"FuncoesSAT",
".",
"configurar_interface_de_rede",
"."
] | cb8e8815f4133d3e3d94cf526fa86767b4521ed9 | https://github.com/base4sistemas/satcfe/blob/cb8e8815f4133d3e3d94cf526fa86767b4521ed9/satcfe/clientesathub.py#L202-L211 | train |
base4sistemas/satcfe | satcfe/clientesathub.py | ClienteSATHub.associar_assinatura | def associar_assinatura(self, sequencia_cnpj, assinatura_ac):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.associar_assinatura`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
resp = self._http_post('associarassinatura',
sequencia_... | python | def associar_assinatura(self, sequencia_cnpj, assinatura_ac):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.associar_assinatura`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
resp = self._http_post('associarassinatura',
sequencia_... | [
"def",
"associar_assinatura",
"(",
"self",
",",
"sequencia_cnpj",
",",
"assinatura_ac",
")",
":",
"resp",
"=",
"self",
".",
"_http_post",
"(",
"'associarassinatura'",
",",
"sequencia_cnpj",
"=",
"sequencia_cnpj",
",",
"assinatura_ac",
"=",
"assinatura_ac",
")",
"#... | Sobrepõe :meth:`~satcfe.base.FuncoesSAT.associar_assinatura`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT | [
"Sobrepõe",
":",
"meth",
":",
"~satcfe",
".",
"base",
".",
"FuncoesSAT",
".",
"associar_assinatura",
"."
] | cb8e8815f4133d3e3d94cf526fa86767b4521ed9 | https://github.com/base4sistemas/satcfe/blob/cb8e8815f4133d3e3d94cf526fa86767b4521ed9/satcfe/clientesathub.py#L214-L224 | train |
base4sistemas/satcfe | satcfe/clientesathub.py | ClienteSATHub.atualizar_software_sat | def atualizar_software_sat(self):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.atualizar_software_sat`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
resp = self._http_post('atualizarsoftwaresat')
conteudo = resp.json()
return Res... | python | def atualizar_software_sat(self):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.atualizar_software_sat`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
resp = self._http_post('atualizarsoftwaresat')
conteudo = resp.json()
return Res... | [
"def",
"atualizar_software_sat",
"(",
"self",
")",
":",
"resp",
"=",
"self",
".",
"_http_post",
"(",
"'atualizarsoftwaresat'",
")",
"conteudo",
"=",
"resp",
".",
"json",
"(",
")",
"return",
"RespostaSAT",
".",
"atualizar_software_sat",
"(",
"conteudo",
".",
"g... | Sobrepõe :meth:`~satcfe.base.FuncoesSAT.atualizar_software_sat`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT | [
"Sobrepõe",
":",
"meth",
":",
"~satcfe",
".",
"base",
".",
"FuncoesSAT",
".",
"atualizar_software_sat",
"."
] | cb8e8815f4133d3e3d94cf526fa86767b4521ed9 | https://github.com/base4sistemas/satcfe/blob/cb8e8815f4133d3e3d94cf526fa86767b4521ed9/satcfe/clientesathub.py#L227-L235 | train |
base4sistemas/satcfe | satcfe/clientesathub.py | ClienteSATHub.extrair_logs | def extrair_logs(self):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.extrair_logs`.
:return: Uma resposta SAT especializada em ``ExtrairLogs``.
:rtype: satcfe.resposta.extrairlogs.RespostaExtrairLogs
"""
resp = self._http_post('extrairlogs')
conteudo = resp.json()
... | python | def extrair_logs(self):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.extrair_logs`.
:return: Uma resposta SAT especializada em ``ExtrairLogs``.
:rtype: satcfe.resposta.extrairlogs.RespostaExtrairLogs
"""
resp = self._http_post('extrairlogs')
conteudo = resp.json()
... | [
"def",
"extrair_logs",
"(",
"self",
")",
":",
"resp",
"=",
"self",
".",
"_http_post",
"(",
"'extrairlogs'",
")",
"conteudo",
"=",
"resp",
".",
"json",
"(",
")",
"return",
"RespostaExtrairLogs",
".",
"analisar",
"(",
"conteudo",
".",
"get",
"(",
"'retorno'"... | Sobrepõe :meth:`~satcfe.base.FuncoesSAT.extrair_logs`.
:return: Uma resposta SAT especializada em ``ExtrairLogs``.
:rtype: satcfe.resposta.extrairlogs.RespostaExtrairLogs | [
"Sobrepõe",
":",
"meth",
":",
"~satcfe",
".",
"base",
".",
"FuncoesSAT",
".",
"extrair_logs",
"."
] | cb8e8815f4133d3e3d94cf526fa86767b4521ed9 | https://github.com/base4sistemas/satcfe/blob/cb8e8815f4133d3e3d94cf526fa86767b4521ed9/satcfe/clientesathub.py#L238-L246 | train |
base4sistemas/satcfe | satcfe/clientesathub.py | ClienteSATHub.bloquear_sat | def bloquear_sat(self):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.bloquear_sat`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
resp = self._http_post('bloquearsat')
conteudo = resp.json()
return RespostaSAT.bloquear_sat(conteud... | python | def bloquear_sat(self):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.bloquear_sat`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
resp = self._http_post('bloquearsat')
conteudo = resp.json()
return RespostaSAT.bloquear_sat(conteud... | [
"def",
"bloquear_sat",
"(",
"self",
")",
":",
"resp",
"=",
"self",
".",
"_http_post",
"(",
"'bloquearsat'",
")",
"conteudo",
"=",
"resp",
".",
"json",
"(",
")",
"return",
"RespostaSAT",
".",
"bloquear_sat",
"(",
"conteudo",
".",
"get",
"(",
"'retorno'",
... | Sobrepõe :meth:`~satcfe.base.FuncoesSAT.bloquear_sat`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT | [
"Sobrepõe",
":",
"meth",
":",
"~satcfe",
".",
"base",
".",
"FuncoesSAT",
".",
"bloquear_sat",
"."
] | cb8e8815f4133d3e3d94cf526fa86767b4521ed9 | https://github.com/base4sistemas/satcfe/blob/cb8e8815f4133d3e3d94cf526fa86767b4521ed9/satcfe/clientesathub.py#L249-L257 | train |
base4sistemas/satcfe | satcfe/clientesathub.py | ClienteSATHub.desbloquear_sat | def desbloquear_sat(self):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.desbloquear_sat`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
resp = self._http_post('desbloquearsat')
conteudo = resp.json()
return RespostaSAT.desbloquear... | python | def desbloquear_sat(self):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.desbloquear_sat`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
resp = self._http_post('desbloquearsat')
conteudo = resp.json()
return RespostaSAT.desbloquear... | [
"def",
"desbloquear_sat",
"(",
"self",
")",
":",
"resp",
"=",
"self",
".",
"_http_post",
"(",
"'desbloquearsat'",
")",
"conteudo",
"=",
"resp",
".",
"json",
"(",
")",
"return",
"RespostaSAT",
".",
"desbloquear_sat",
"(",
"conteudo",
".",
"get",
"(",
"'reto... | Sobrepõe :meth:`~satcfe.base.FuncoesSAT.desbloquear_sat`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT | [
"Sobrepõe",
":",
"meth",
":",
"~satcfe",
".",
"base",
".",
"FuncoesSAT",
".",
"desbloquear_sat",
"."
] | cb8e8815f4133d3e3d94cf526fa86767b4521ed9 | https://github.com/base4sistemas/satcfe/blob/cb8e8815f4133d3e3d94cf526fa86767b4521ed9/satcfe/clientesathub.py#L260-L268 | train |
base4sistemas/satcfe | satcfe/clientesathub.py | ClienteSATHub.trocar_codigo_de_ativacao | def trocar_codigo_de_ativacao(self, novo_codigo_ativacao,
opcao=constantes.CODIGO_ATIVACAO_REGULAR,
codigo_emergencia=None):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.trocar_codigo_de_ativacao`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSA... | python | def trocar_codigo_de_ativacao(self, novo_codigo_ativacao,
opcao=constantes.CODIGO_ATIVACAO_REGULAR,
codigo_emergencia=None):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.trocar_codigo_de_ativacao`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSA... | [
"def",
"trocar_codigo_de_ativacao",
"(",
"self",
",",
"novo_codigo_ativacao",
",",
"opcao",
"=",
"constantes",
".",
"CODIGO_ATIVACAO_REGULAR",
",",
"codigo_emergencia",
"=",
"None",
")",
":",
"resp",
"=",
"self",
".",
"_http_post",
"(",
"'trocarcodigodeativacao'",
"... | Sobrepõe :meth:`~satcfe.base.FuncoesSAT.trocar_codigo_de_ativacao`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT | [
"Sobrepõe",
":",
"meth",
":",
"~satcfe",
".",
"base",
".",
"FuncoesSAT",
".",
"trocar_codigo_de_ativacao",
"."
] | cb8e8815f4133d3e3d94cf526fa86767b4521ed9 | https://github.com/base4sistemas/satcfe/blob/cb8e8815f4133d3e3d94cf526fa86767b4521ed9/satcfe/clientesathub.py#L271-L284 | train |
nion-software/nionswift | nion/typeshed/API_1_0.py | Graphic.bounds | def bounds(self) -> typing.Tuple[typing.Tuple[float, float], typing.Tuple[float, float]]:
"""Return the bounds property in relative coordinates.
Bounds is a tuple ((top, left), (height, width))"""
... | python | def bounds(self) -> typing.Tuple[typing.Tuple[float, float], typing.Tuple[float, float]]:
"""Return the bounds property in relative coordinates.
Bounds is a tuple ((top, left), (height, width))"""
... | [
"def",
"bounds",
"(",
"self",
")",
"->",
"typing",
".",
"Tuple",
"[",
"typing",
".",
"Tuple",
"[",
"float",
",",
"float",
"]",
",",
"typing",
".",
"Tuple",
"[",
"float",
",",
"float",
"]",
"]",
":",
"..."
] | Return the bounds property in relative coordinates.
Bounds is a tuple ((top, left), (height, width)) | [
"Return",
"the",
"bounds",
"property",
"in",
"relative",
"coordinates",
"."
] | d43693eaf057b8683b9638e575000f055fede452 | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/typeshed/API_1_0.py#L38-L42 | train |
nion-software/nionswift | nion/typeshed/API_1_0.py | Graphic.end | def end(self, value: typing.Union[float, typing.Tuple[float, float]]) -> None:
"""Set the end property in relative coordinates.
End may be a float when graphic is an Interval or a tuple (y, x) when graphic is a Line."""
... | python | def end(self, value: typing.Union[float, typing.Tuple[float, float]]) -> None:
"""Set the end property in relative coordinates.
End may be a float when graphic is an Interval or a tuple (y, x) when graphic is a Line."""
... | [
"def",
"end",
"(",
"self",
",",
"value",
":",
"typing",
".",
"Union",
"[",
"float",
",",
"typing",
".",
"Tuple",
"[",
"float",
",",
"float",
"]",
"]",
")",
"->",
"None",
":",
"..."
] | Set the end property in relative coordinates.
End may be a float when graphic is an Interval or a tuple (y, x) when graphic is a Line. | [
"Set",
"the",
"end",
"property",
"in",
"relative",
"coordinates",
"."
] | d43693eaf057b8683b9638e575000f055fede452 | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/typeshed/API_1_0.py#L73-L77 | train |
nion-software/nionswift | nion/typeshed/API_1_0.py | Graphic.start | def start(self, value: typing.Union[float, typing.Tuple[float, float]]) -> None:
"""Set the end property in relative coordinates.
End may be a float when graphic is an Interval or a tuple (y, x) when graphic is a Line."""
... | python | def start(self, value: typing.Union[float, typing.Tuple[float, float]]) -> None:
"""Set the end property in relative coordinates.
End may be a float when graphic is an Interval or a tuple (y, x) when graphic is a Line."""
... | [
"def",
"start",
"(",
"self",
",",
"value",
":",
"typing",
".",
"Union",
"[",
"float",
",",
"typing",
".",
"Tuple",
"[",
"float",
",",
"float",
"]",
"]",
")",
"->",
"None",
":",
"..."
] | Set the end property in relative coordinates.
End may be a float when graphic is an Interval or a tuple (y, x) when graphic is a Line. | [
"Set",
"the",
"end",
"property",
"in",
"relative",
"coordinates",
"."
] | d43693eaf057b8683b9638e575000f055fede452 | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/typeshed/API_1_0.py#L183-L187 | train |
nion-software/nionswift | nion/typeshed/API_1_0.py | Graphic.vector | def vector(self) -> typing.Tuple[typing.Tuple[float, float], typing.Tuple[float, float]]:
"""Return the vector property in relative coordinates.
Vector will be a tuple of tuples ((y_start, x_start), (y_end, x_end))."""
... | python | def vector(self) -> typing.Tuple[typing.Tuple[float, float], typing.Tuple[float, float]]:
"""Return the vector property in relative coordinates.
Vector will be a tuple of tuples ((y_start, x_start), (y_end, x_end))."""
... | [
"def",
"vector",
"(",
"self",
")",
"->",
"typing",
".",
"Tuple",
"[",
"typing",
".",
"Tuple",
"[",
"float",
",",
"float",
"]",
",",
"typing",
".",
"Tuple",
"[",
"float",
",",
"float",
"]",
"]",
":",
"..."
] | Return the vector property in relative coordinates.
Vector will be a tuple of tuples ((y_start, x_start), (y_end, x_end)). | [
"Return",
"the",
"vector",
"property",
"in",
"relative",
"coordinates",
"."
] | d43693eaf057b8683b9638e575000f055fede452 | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/typeshed/API_1_0.py#L212-L216 | train |
nion-software/nionswift | nion/typeshed/API_1_0.py | Library.get_data_item_for_hardware_source | def get_data_item_for_hardware_source(self, hardware_source, channel_id: str=None, processor_id: str=None, create_if_needed: bool=False, large_format: bool=False) -> DataItem:
"""Get the data item associated with hardware source and (optional) channel id and processor_id. Optionally create if missing.
... | python | def get_data_item_for_hardware_source(self, hardware_source, channel_id: str=None, processor_id: str=None, create_if_needed: bool=False, large_format: bool=False) -> DataItem:
"""Get the data item associated with hardware source and (optional) channel id and processor_id. Optionally create if missing.
... | [
"def",
"get_data_item_for_hardware_source",
"(",
"self",
",",
"hardware_source",
",",
"channel_id",
":",
"str",
"=",
"None",
",",
"processor_id",
":",
"str",
"=",
"None",
",",
"create_if_needed",
":",
"bool",
"=",
"False",
",",
"large_format",
":",
"bool",
"="... | Get the data item associated with hardware source and (optional) channel id and processor_id. Optionally create if missing.
:param hardware_source: The hardware_source.
:param channel_id: The (optional) channel id.
:param processor_id: The (optional) processor id for the channel.
:param... | [
"Get",
"the",
"data",
"item",
"associated",
"with",
"hardware",
"source",
"and",
"(",
"optional",
")",
"channel",
"id",
"and",
"processor_id",
".",
"Optionally",
"create",
"if",
"missing",
"."
] | d43693eaf057b8683b9638e575000f055fede452 | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/typeshed/API_1_0.py#L751-L765 | train |
nion-software/nionswift | nion/typeshed/API_1_0.py | Library.get_data_item_for_reference_key | def get_data_item_for_reference_key(self, data_item_reference_key: str=None, create_if_needed: bool=False, large_format: bool=False) -> DataItem:
"""Get the data item associated with data item reference key. Optionally create if missing.
:param data_item_reference_key: The data item reference key.
... | python | def get_data_item_for_reference_key(self, data_item_reference_key: str=None, create_if_needed: bool=False, large_format: bool=False) -> DataItem:
"""Get the data item associated with data item reference key. Optionally create if missing.
:param data_item_reference_key: The data item reference key.
... | [
"def",
"get_data_item_for_reference_key",
"(",
"self",
",",
"data_item_reference_key",
":",
"str",
"=",
"None",
",",
"create_if_needed",
":",
"bool",
"=",
"False",
",",
"large_format",
":",
"bool",
"=",
"False",
")",
"->",
"DataItem",
":",
"..."
] | Get the data item associated with data item reference key. Optionally create if missing.
:param data_item_reference_key: The data item reference key.
:param create_if_needed: Whether to create a new data item if none is found.
:return: The associated data item. May be None.
.. versiona... | [
"Get",
"the",
"data",
"item",
"associated",
"with",
"data",
"item",
"reference",
"key",
".",
"Optionally",
"create",
"if",
"missing",
"."
] | d43693eaf057b8683b9638e575000f055fede452 | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/typeshed/API_1_0.py#L767-L779 | train |
nion-software/nionswift | nion/typeshed/API_1_0.py | DocumentWindow.show_get_string_message_box | def show_get_string_message_box(self, caption: str, text: str, accepted_fn, rejected_fn=None, accepted_text: str=None, rejected_text: str=None) -> None:
"""Show a dialog box and ask for a string.
Caption describes the user prompt. Text is the initial/default string.
Accepted function must be a... | python | def show_get_string_message_box(self, caption: str, text: str, accepted_fn, rejected_fn=None, accepted_text: str=None, rejected_text: str=None) -> None:
"""Show a dialog box and ask for a string.
Caption describes the user prompt. Text is the initial/default string.
Accepted function must be a... | [
"def",
"show_get_string_message_box",
"(",
"self",
",",
"caption",
":",
"str",
",",
"text",
":",
"str",
",",
"accepted_fn",
",",
"rejected_fn",
"=",
"None",
",",
"accepted_text",
":",
"str",
"=",
"None",
",",
"rejected_text",
":",
"str",
"=",
"None",
")",
... | Show a dialog box and ask for a string.
Caption describes the user prompt. Text is the initial/default string.
Accepted function must be a function taking one argument which is the resulting text if the user accepts the
message dialog. It will only be called if the user clicks OK.
Rej... | [
"Show",
"a",
"dialog",
"box",
"and",
"ask",
"for",
"a",
"string",
"."
] | d43693eaf057b8683b9638e575000f055fede452 | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/typeshed/API_1_0.py#L987-L1001 | train |
nion-software/nionswift | nion/typeshed/API_1_0.py | API.create_calibration | def create_calibration(self, offset: float=None, scale: float=None, units: str=None) -> Calibration.Calibration:
"""Create a calibration object with offset, scale, and units.
:param offset: The offset of the calibration.
:param scale: The scale of the calibration.
:param units: The unit... | python | def create_calibration(self, offset: float=None, scale: float=None, units: str=None) -> Calibration.Calibration:
"""Create a calibration object with offset, scale, and units.
:param offset: The offset of the calibration.
:param scale: The scale of the calibration.
:param units: The unit... | [
"def",
"create_calibration",
"(",
"self",
",",
"offset",
":",
"float",
"=",
"None",
",",
"scale",
":",
"float",
"=",
"None",
",",
"units",
":",
"str",
"=",
"None",
")",
"->",
"Calibration",
".",
"Calibration",
":",
"..."
] | Create a calibration object with offset, scale, and units.
:param offset: The offset of the calibration.
:param scale: The scale of the calibration.
:param units: The units of the calibration as a string.
:return: The calibration object.
.. versionadded:: 1.0
Scriptabl... | [
"Create",
"a",
"calibration",
"object",
"with",
"offset",
"scale",
"and",
"units",
"."
] | d43693eaf057b8683b9638e575000f055fede452 | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/typeshed/API_1_0.py#L1077-L1092 | train |
nion-software/nionswift | nion/typeshed/API_1_0.py | API.create_data_and_metadata | def create_data_and_metadata(self, data: numpy.ndarray, intensity_calibration: Calibration.Calibration=None, dimensional_calibrations: typing.List[Calibration.Calibration]=None, metadata: dict=None, timestamp: str=None, data_descriptor: DataAndMetadata.DataDescriptor=None) -> DataAndMetadata.DataAndMetadata:
""... | python | def create_data_and_metadata(self, data: numpy.ndarray, intensity_calibration: Calibration.Calibration=None, dimensional_calibrations: typing.List[Calibration.Calibration]=None, metadata: dict=None, timestamp: str=None, data_descriptor: DataAndMetadata.DataDescriptor=None) -> DataAndMetadata.DataAndMetadata:
""... | [
"def",
"create_data_and_metadata",
"(",
"self",
",",
"data",
":",
"numpy",
".",
"ndarray",
",",
"intensity_calibration",
":",
"Calibration",
".",
"Calibration",
"=",
"None",
",",
"dimensional_calibrations",
":",
"typing",
".",
"List",
"[",
"Calibration",
".",
"C... | Create a data_and_metadata object from data.
:param data: an ndarray of data.
:param intensity_calibration: An optional calibration object.
:param dimensional_calibrations: An optional list of calibration objects.
:param metadata: A dict of metadata.
:param timestamp: A datetime... | [
"Create",
"a",
"data_and_metadata",
"object",
"from",
"data",
"."
] | d43693eaf057b8683b9638e575000f055fede452 | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/typeshed/API_1_0.py#L1094-L1108 | train |
nion-software/nionswift | nion/typeshed/API_1_0.py | API.create_data_and_metadata_from_data | def create_data_and_metadata_from_data(self, data: numpy.ndarray, intensity_calibration: Calibration.Calibration=None, dimensional_calibrations: typing.List[Calibration.Calibration]=None, metadata: dict=None, timestamp: str=None) -> DataAndMetadata.DataAndMetadata:
"""Create a data_and_metadata object from data... | python | def create_data_and_metadata_from_data(self, data: numpy.ndarray, intensity_calibration: Calibration.Calibration=None, dimensional_calibrations: typing.List[Calibration.Calibration]=None, metadata: dict=None, timestamp: str=None) -> DataAndMetadata.DataAndMetadata:
"""Create a data_and_metadata object from data... | [
"def",
"create_data_and_metadata_from_data",
"(",
"self",
",",
"data",
":",
"numpy",
".",
"ndarray",
",",
"intensity_calibration",
":",
"Calibration",
".",
"Calibration",
"=",
"None",
",",
"dimensional_calibrations",
":",
"typing",
".",
"List",
"[",
"Calibration",
... | Create a data_and_metadata object from data.
.. versionadded:: 1.0
.. deprecated:: 1.1
Use :py:meth:`~nion.swift.Facade.DataItem.create_data_and_metadata` instead.
Scriptable: No | [
"Create",
"a",
"data_and_metadata",
"object",
"from",
"data",
"."
] | d43693eaf057b8683b9638e575000f055fede452 | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/typeshed/API_1_0.py#L1110-L1119 | train |
nion-software/nionswift | nion/typeshed/API_1_0.py | API.create_data_descriptor | def create_data_descriptor(self, is_sequence: bool, collection_dimension_count: int, datum_dimension_count: int) -> DataAndMetadata.DataDescriptor:
"""Create a data descriptor.
:param is_sequence: whether the descriptor describes a sequence of data.
:param collection_dimension_count: the number... | python | def create_data_descriptor(self, is_sequence: bool, collection_dimension_count: int, datum_dimension_count: int) -> DataAndMetadata.DataDescriptor:
"""Create a data descriptor.
:param is_sequence: whether the descriptor describes a sequence of data.
:param collection_dimension_count: the number... | [
"def",
"create_data_descriptor",
"(",
"self",
",",
"is_sequence",
":",
"bool",
",",
"collection_dimension_count",
":",
"int",
",",
"datum_dimension_count",
":",
"int",
")",
"->",
"DataAndMetadata",
".",
"DataDescriptor",
":",
"..."
] | Create a data descriptor.
:param is_sequence: whether the descriptor describes a sequence of data.
:param collection_dimension_count: the number of collection dimensions represented by the descriptor.
:param datum_dimension_count: the number of datum dimensions represented by the descriptor.
... | [
"Create",
"a",
"data",
"descriptor",
"."
] | d43693eaf057b8683b9638e575000f055fede452 | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/typeshed/API_1_0.py#L1132-L1143 | train |
nion-software/nionswift | nion/swift/Inspector.py | make_calibration_row_widget | def make_calibration_row_widget(ui, calibration_observable, label: str=None):
"""Called when an item (calibration_observable) is inserted into the list widget. Returns a widget."""
calibration_row = ui.create_row_widget()
row_label = ui.create_label_widget(label, properties={"width": 60})
row_label.widg... | python | def make_calibration_row_widget(ui, calibration_observable, label: str=None):
"""Called when an item (calibration_observable) is inserted into the list widget. Returns a widget."""
calibration_row = ui.create_row_widget()
row_label = ui.create_label_widget(label, properties={"width": 60})
row_label.widg... | [
"def",
"make_calibration_row_widget",
"(",
"ui",
",",
"calibration_observable",
",",
"label",
":",
"str",
"=",
"None",
")",
":",
"calibration_row",
"=",
"ui",
".",
"create_row_widget",
"(",
")",
"row_label",
"=",
"ui",
".",
"create_label_widget",
"(",
"label",
... | Called when an item (calibration_observable) is inserted into the list widget. Returns a widget. | [
"Called",
"when",
"an",
"item",
"(",
"calibration_observable",
")",
"is",
"inserted",
"into",
"the",
"list",
"widget",
".",
"Returns",
"a",
"widget",
"."
] | d43693eaf057b8683b9638e575000f055fede452 | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/Inspector.py#L1067-L1091 | train |
nion-software/nionswift | nion/swift/Inspector.py | InspectorSection.add_widget_to_content | def add_widget_to_content(self, widget):
"""Subclasses should call this to add content in the section's top level column."""
self.__section_content_column.add_spacing(4)
self.__section_content_column.add(widget) | python | def add_widget_to_content(self, widget):
"""Subclasses should call this to add content in the section's top level column."""
self.__section_content_column.add_spacing(4)
self.__section_content_column.add(widget) | [
"def",
"add_widget_to_content",
"(",
"self",
",",
"widget",
")",
":",
"self",
".",
"__section_content_column",
".",
"add_spacing",
"(",
"4",
")",
"self",
".",
"__section_content_column",
".",
"add",
"(",
"widget",
")"
] | Subclasses should call this to add content in the section's top level column. | [
"Subclasses",
"should",
"call",
"this",
"to",
"add",
"content",
"in",
"the",
"section",
"s",
"top",
"level",
"column",
"."
] | d43693eaf057b8683b9638e575000f055fede452 | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/Inspector.py#L218-L221 | train |
nion-software/nionswift | nion/swift/Inspector.py | CalibrationsInspectorSection.__create_list_item_widget | def __create_list_item_widget(self, ui, calibration_observable):
"""Called when an item (calibration_observable) is inserted into the list widget. Returns a widget."""
calibration_row = make_calibration_row_widget(ui, calibration_observable)
column = ui.create_column_widget()
column.add_... | python | def __create_list_item_widget(self, ui, calibration_observable):
"""Called when an item (calibration_observable) is inserted into the list widget. Returns a widget."""
calibration_row = make_calibration_row_widget(ui, calibration_observable)
column = ui.create_column_widget()
column.add_... | [
"def",
"__create_list_item_widget",
"(",
"self",
",",
"ui",
",",
"calibration_observable",
")",
":",
"calibration_row",
"=",
"make_calibration_row_widget",
"(",
"ui",
",",
"calibration_observable",
")",
"column",
"=",
"ui",
".",
"create_column_widget",
"(",
")",
"co... | Called when an item (calibration_observable) is inserted into the list widget. Returns a widget. | [
"Called",
"when",
"an",
"item",
"(",
"calibration_observable",
")",
"is",
"inserted",
"into",
"the",
"list",
"widget",
".",
"Returns",
"a",
"widget",
"."
] | d43693eaf057b8683b9638e575000f055fede452 | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/Inspector.py#L1211-L1217 | train |
nion-software/nionswift | nion/swift/HistogramPanel.py | AdornmentsCanvasItem._repaint | def _repaint(self, drawing_context):
"""Repaint the canvas item. This will occur on a thread."""
# canvas size
canvas_width = self.canvas_size[1]
canvas_height = self.canvas_size[0]
left = self.display_limits[0]
right = self.display_limits[1]
# draw left displa... | python | def _repaint(self, drawing_context):
"""Repaint the canvas item. This will occur on a thread."""
# canvas size
canvas_width = self.canvas_size[1]
canvas_height = self.canvas_size[0]
left = self.display_limits[0]
right = self.display_limits[1]
# draw left displa... | [
"def",
"_repaint",
"(",
"self",
",",
"drawing_context",
")",
":",
"# canvas size",
"canvas_width",
"=",
"self",
".",
"canvas_size",
"[",
"1",
"]",
"canvas_height",
"=",
"self",
".",
"canvas_size",
"[",
"0",
"]",
"left",
"=",
"self",
".",
"display_limits",
... | Repaint the canvas item. This will occur on a thread. | [
"Repaint",
"the",
"canvas",
"item",
".",
"This",
"will",
"occur",
"on",
"a",
"thread",
"."
] | d43693eaf057b8683b9638e575000f055fede452 | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/HistogramPanel.py#L42-L79 | train |
nion-software/nionswift | nion/swift/HistogramPanel.py | SimpleLineGraphCanvasItem._repaint | def _repaint(self, drawing_context):
"""Repaint the canvas item. This will occur on a thread."""
# canvas size
canvas_width = self.canvas_size[1]
canvas_height = self.canvas_size[0]
# draw background
if self.background_color:
with drawing_context.saver():
... | python | def _repaint(self, drawing_context):
"""Repaint the canvas item. This will occur on a thread."""
# canvas size
canvas_width = self.canvas_size[1]
canvas_height = self.canvas_size[0]
# draw background
if self.background_color:
with drawing_context.saver():
... | [
"def",
"_repaint",
"(",
"self",
",",
"drawing_context",
")",
":",
"# canvas size",
"canvas_width",
"=",
"self",
".",
"canvas_size",
"[",
"1",
"]",
"canvas_height",
"=",
"self",
".",
"canvas_size",
"[",
"0",
"]",
"# draw background",
"if",
"self",
".",
"backg... | Repaint the canvas item. This will occur on a thread. | [
"Repaint",
"the",
"canvas",
"item",
".",
"This",
"will",
"occur",
"on",
"a",
"thread",
"."
] | d43693eaf057b8683b9638e575000f055fede452 | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/HistogramPanel.py#L124-L155 | train |
nion-software/nionswift | nion/swift/HistogramPanel.py | ColorMapCanvasItem.color_map_data | def color_map_data(self, data: numpy.ndarray) -> None:
"""Set the data and mark the canvas item for updating.
Data should be an ndarray of shape (256, 3) with type uint8
"""
self.__color_map_data = data
self.update() | python | def color_map_data(self, data: numpy.ndarray) -> None:
"""Set the data and mark the canvas item for updating.
Data should be an ndarray of shape (256, 3) with type uint8
"""
self.__color_map_data = data
self.update() | [
"def",
"color_map_data",
"(",
"self",
",",
"data",
":",
"numpy",
".",
"ndarray",
")",
"->",
"None",
":",
"self",
".",
"__color_map_data",
"=",
"data",
"self",
".",
"update",
"(",
")"
] | Set the data and mark the canvas item for updating.
Data should be an ndarray of shape (256, 3) with type uint8 | [
"Set",
"the",
"data",
"and",
"mark",
"the",
"canvas",
"item",
"for",
"updating",
"."
] | d43693eaf057b8683b9638e575000f055fede452 | https://github.com/nion-software/nionswift/blob/d43693eaf057b8683b9638e575000f055fede452/nion/swift/HistogramPanel.py#L171-L177 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.