hexsha
stringlengths
40
40
repo
stringlengths
7
114
path
stringlengths
4
124
license
listlengths
1
9
language
stringclasses
1 value
identifier
stringlengths
1
71
return_type
stringlengths
1
749
⌀
original_string
stringlengths
76
22.7k
original_docstring
stringlengths
16
7.61k
docstring
stringlengths
16
2.47k
docstring_tokens
listlengths
6
477
code
stringlengths
14
10.2k
code_tokens
listlengths
6
996
short_docstring
stringlengths
2
644
short_docstring_tokens
listlengths
1
116
comment
listlengths
1
89
parameters
listlengths
0
64
docstring_params
dict
45fc43f1280dae8bb17518c2eaf88f7029af6153
numb3r3/lingvo
lingvo/tasks/asr/frontend.py
[ "Apache-2.0" ]
Python
FProp
<not_specific>
def FProp(self, theta, input_batch): """Perform signal processing on a sequence of PCM data. NOTE: This implementation does not currently support paddings, and they are accepted for compatibility with the super-class. TODO(laurenzo): Rework this to support paddings. Args: theta: Layer theta...
Perform signal processing on a sequence of PCM data. NOTE: This implementation does not currently support paddings, and they are accepted for compatibility with the super-class. TODO(laurenzo): Rework this to support paddings. Args: theta: Layer theta. input_batch: PCM input map: ...
Perform signal processing on a sequence of PCM data. NOTE: This implementation does not currently support paddings, and they are accepted for compatibility with the super-class. Rework this to support paddings.
[ "Perform", "signal", "processing", "on", "a", "sequence", "of", "PCM", "data", ".", "NOTE", ":", "This", "implementation", "does", "not", "currently", "support", "paddings", "and", "they", "are", "accepted", "for", "compatibility", "with", "the", "super", "-",...
def FProp(self, theta, input_batch): p = self.params pcm_audio_data = input_batch.src_inputs pcm_audio_paddings = input_batch.paddings batch_size = py_utils.GetShape(pcm_audio_data)[0] mel_spectrogram, mel_spectrogram_paddings = self._FPropChunk( theta, pcm_audio_data, pcm_audio_paddings) ...
[ "def", "FProp", "(", "self", ",", "theta", ",", "input_batch", ")", ":", "p", "=", "self", ".", "params", "pcm_audio_data", "=", "input_batch", ".", "src_inputs", "pcm_audio_paddings", "=", "input_batch", ".", "paddings", "batch_size", "=", "py_utils", ".", ...
Perform signal processing on a sequence of PCM data.
[ "Perform", "signal", "processing", "on", "a", "sequence", "of", "PCM", "data", "." ]
[ "\"\"\"Perform signal processing on a sequence of PCM data.\n\n NOTE: This implementation does not currently support paddings, and they\n are accepted for compatibility with the super-class.\n\n TODO(laurenzo): Rework this to support paddings.\n\n Args:\n theta: Layer theta.\n input_batch: PCM...
[ { "param": "self", "type": null }, { "param": "theta", "type": null }, { "param": "input_batch", "type": null } ]
{ "returns": [ { "docstring": "NestedMap of encoder inputs which can be passed directly to a\ncompatible encoder and contains.\n\n'src_inputs': inputs to the encoder, minimally of shape\n[batch, time, ...].\n'paddings': a 0/1 tensor of shape [batch, time].", "docstring_tokens": [ "NestedMap", ...
45fc43f1280dae8bb17518c2eaf88f7029af6153
numb3r3/lingvo
lingvo/tasks/asr/frontend.py
[ "Apache-2.0" ]
Python
_MelSpectrogram
<not_specific>
def _MelSpectrogram(self, signal): """Computes the mel spectrogram from a waveform signal. Args: signal: f32 Tensor, shaped [batch_size, num_samples] Returns: features: f32 Tensor, shaped [batch_size, num_frames, mel_channels] """ p = self.params # FFT. real_frequency_spectrogr...
Computes the mel spectrogram from a waveform signal. Args: signal: f32 Tensor, shaped [batch_size, num_samples] Returns: features: f32 Tensor, shaped [batch_size, num_frames, mel_channels]
Computes the mel spectrogram from a waveform signal.
[ "Computes", "the", "mel", "spectrogram", "from", "a", "waveform", "signal", "." ]
def _MelSpectrogram(self, signal): p = self.params real_frequency_spectrogram = tf.signal.rfft(signal, [self._fft_size]) magnitude_spectrogram = tf.abs(real_frequency_spectrogram) mel_weight_matrix = tf.signal.linear_to_mel_weight_matrix( num_mel_bins=p.num_bins, num_spectrogram_bins=sel...
[ "def", "_MelSpectrogram", "(", "self", ",", "signal", ")", ":", "p", "=", "self", ".", "params", "real_frequency_spectrogram", "=", "tf", ".", "signal", ".", "rfft", "(", "signal", ",", "[", "self", ".", "_fft_size", "]", ")", "magnitude_spectrogram", "=",...
Computes the mel spectrogram from a waveform signal.
[ "Computes", "the", "mel", "spectrogram", "from", "a", "waveform", "signal", "." ]
[ "\"\"\"Computes the mel spectrogram from a waveform signal.\n\n Args:\n signal: f32 Tensor, shaped [batch_size, num_samples]\n\n Returns:\n features: f32 Tensor, shaped [batch_size, num_frames, mel_channels]\n \"\"\"", "# FFT.", "# Shape of magnitude_spectrogram is num_frames x (fft_size/2+1)...
[ { "param": "self", "type": null }, { "param": "signal", "type": null } ]
{ "returns": [ { "docstring": "f32 Tensor, shaped [batch_size, num_frames, mel_channels]", "docstring_tokens": [ "f32", "Tensor", "shaped", "[", "batch_size", "num_frames", "mel_channels", "]" ], "type": "features" } ], ...
0fe0073f1891b3e36440d6ad3e8b5817e15906f0
LansburyCH/relightable-nr
neural_renderer/neural_renderer/load_obj.py
[ "MIT" ]
Python
load_obj
<not_specific>
def load_obj(filename_obj, normalization=True, texture_size=4, load_texture=False, texture_wrapping='REPEAT', use_bilinear=True, use_cuda = True): """ Load Wavefront .obj file. This function only supports vertices (v x x x) and faces (f x x x). """ # read in all lines with open(fil...
Load Wavefront .obj file. This function only supports vertices (v x x x) and faces (f x x x).
Load Wavefront .obj file.
[ "Load", "Wavefront", ".", "obj", "file", "." ]
def load_obj(filename_obj, normalization=True, texture_size=4, load_texture=False, texture_wrapping='REPEAT', use_bilinear=True, use_cuda = True): with open(filename_obj) as f: lines = f.readlines() vertices = [] for line in lines: if len(line.split()) == 0: continue...
[ "def", "load_obj", "(", "filename_obj", ",", "normalization", "=", "True", ",", "texture_size", "=", "4", ",", "load_texture", "=", "False", ",", "texture_wrapping", "=", "'REPEAT'", ",", "use_bilinear", "=", "True", ",", "use_cuda", "=", "True", ")", ":", ...
Load Wavefront .obj file.
[ "Load", "Wavefront", ".", "obj", "file", "." ]
[ "\"\"\"\n Load Wavefront .obj file.\n This function only supports vertices (v x x x) and faces (f x x x).\n \"\"\"", "# read in all lines", "# load vertices", "# load vertex normal", "# load vertex texture coordinates", "# load faces", "# load textures", "# normalize into a unit cube centered...
[ { "param": "filename_obj", "type": null }, { "param": "normalization", "type": null }, { "param": "texture_size", "type": null }, { "param": "load_texture", "type": null }, { "param": "texture_wrapping", "type": null }, { "param": "use_bilinear", "...
{ "returns": [], "raises": [], "params": [ { "identifier": "filename_obj", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "normalization", "type": null, "docstring": null, "doc...
a8d1ee76f43390ba8bb01c35cdd860f04cf36254
quantrocket-codeload/zipline-intro
intro_zipline/winners.py
[ "Apache-2.0" ]
Python
initialize
null
def initialize(context): """ Called once at the start of a backtest, and once per day at the start of live trading. """ # Attach the pipeline to the algo algo.attach_pipeline(make_pipeline(), 'pipeline') algo.set_benchmark(algo.sid('FIBBG000BDTBL9')) # Rebalance every day, 30 minutes b...
Called once at the start of a backtest, and once per day at the start of live trading.
Called once at the start of a backtest, and once per day at the start of live trading.
[ "Called", "once", "at", "the", "start", "of", "a", "backtest", "and", "once", "per", "day", "at", "the", "start", "of", "live", "trading", "." ]
def initialize(context): algo.attach_pipeline(make_pipeline(), 'pipeline') algo.set_benchmark(algo.sid('FIBBG000BDTBL9')) algo.schedule_function( rebalance, algo.date_rules.every_day(), algo.time_rules.market_close(minutes=30), )
[ "def", "initialize", "(", "context", ")", ":", "algo", ".", "attach_pipeline", "(", "make_pipeline", "(", ")", ",", "'pipeline'", ")", "algo", ".", "set_benchmark", "(", "algo", ".", "sid", "(", "'FIBBG000BDTBL9'", ")", ")", "algo", ".", "schedule_function",...
Called once at the start of a backtest, and once per day at the start of live trading.
[ "Called", "once", "at", "the", "start", "of", "a", "backtest", "and", "once", "per", "day", "at", "the", "start", "of", "live", "trading", "." ]
[ "\"\"\"\n Called once at the start of a backtest, and once per day at\n the start of live trading.\n \"\"\"", "# Attach the pipeline to the algo", "# Rebalance every day, 30 minutes before market close." ]
[ { "param": "context", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "context", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
a8d1ee76f43390ba8bb01c35cdd860f04cf36254
quantrocket-codeload/zipline-intro
intro_zipline/winners.py
[ "Apache-2.0" ]
Python
make_pipeline
<not_specific>
def make_pipeline(): """ Create a pipeline that filters by dollar volume and calculates 1-year return. """ pipeline = Pipeline( columns={ "1y_returns": Returns(window_length=252), }, screen=AverageDollarVolume(window_length=30) > 10e6 ) return pipeline
Create a pipeline that filters by dollar volume and calculates 1-year return.
Create a pipeline that filters by dollar volume and calculates 1-year return.
[ "Create", "a", "pipeline", "that", "filters", "by", "dollar", "volume", "and", "calculates", "1", "-", "year", "return", "." ]
def make_pipeline(): pipeline = Pipeline( columns={ "1y_returns": Returns(window_length=252), }, screen=AverageDollarVolume(window_length=30) > 10e6 ) return pipeline
[ "def", "make_pipeline", "(", ")", ":", "pipeline", "=", "Pipeline", "(", "columns", "=", "{", "\"1y_returns\"", ":", "Returns", "(", "window_length", "=", "252", ")", ",", "}", ",", "screen", "=", "AverageDollarVolume", "(", "window_length", "=", "30", ")"...
Create a pipeline that filters by dollar volume and calculates 1-year return.
[ "Create", "a", "pipeline", "that", "filters", "by", "dollar", "volume", "and", "calculates", "1", "-", "year", "return", "." ]
[ "\"\"\"\n Create a pipeline that filters by dollar volume and\n calculates 1-year return.\n \"\"\"" ]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
a8d1ee76f43390ba8bb01c35cdd860f04cf36254
quantrocket-codeload/zipline-intro
intro_zipline/winners.py
[ "Apache-2.0" ]
Python
before_trading_start
null
def before_trading_start(context, data): """ Called every day before market open. """ factors = algo.pipeline_output('pipeline') # Get the top and bottom 3 stocks by 1-year return returns = factors["1y_returns"].sort_values(ascending=False) context.winners = returns.index[:3]
Called every day before market open.
Called every day before market open.
[ "Called", "every", "day", "before", "market", "open", "." ]
def before_trading_start(context, data): factors = algo.pipeline_output('pipeline') returns = factors["1y_returns"].sort_values(ascending=False) context.winners = returns.index[:3]
[ "def", "before_trading_start", "(", "context", ",", "data", ")", ":", "factors", "=", "algo", ".", "pipeline_output", "(", "'pipeline'", ")", "returns", "=", "factors", "[", "\"1y_returns\"", "]", ".", "sort_values", "(", "ascending", "=", "False", ")", "con...
Called every day before market open.
[ "Called", "every", "day", "before", "market", "open", "." ]
[ "\"\"\"\n Called every day before market open.\n \"\"\"", "# Get the top and bottom 3 stocks by 1-year return" ]
[ { "param": "context", "type": null }, { "param": "data", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "context", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "data", "type": null, "docstring": null, "docstring_tokens"...
71be3964a70d3794f02d96c993d82a9dcec313c6
Gitgigabyte/mmd
mmdet/models/mask_heads/mask_iou_head_ca.py
[ "Apache-2.0" ]
Python
_get_area_ratio
<not_specific>
def _get_area_ratio(self, pos_proposals, pos_assigned_gt_inds, gt_masks): """Compute area ratio of the gt mask inside the proposal and the gt mask of the corresponding instance""" num_pos = pos_proposals.size(0) if num_pos > 0: area_ratios = [] proposals_np = pos_...
Compute area ratio of the gt mask inside the proposal and the gt mask of the corresponding instance
Compute area ratio of the gt mask inside the proposal and the gt mask of the corresponding instance
[ "Compute", "area", "ratio", "of", "the", "gt", "mask", "inside", "the", "proposal", "and", "the", "gt", "mask", "of", "the", "corresponding", "instance" ]
def _get_area_ratio(self, pos_proposals, pos_assigned_gt_inds, gt_masks): num_pos = pos_proposals.size(0) if num_pos > 0: area_ratios = [] proposals_np = pos_proposals.cpu().numpy() pos_assigned_gt_inds = pos_assigned_gt_inds.cpu().numpy() gt_instance_mask...
[ "def", "_get_area_ratio", "(", "self", ",", "pos_proposals", ",", "pos_assigned_gt_inds", ",", "gt_masks", ")", ":", "num_pos", "=", "pos_proposals", ".", "size", "(", "0", ")", "if", "num_pos", ">", "0", ":", "area_ratios", "=", "[", "]", "proposals_np", ...
Compute area ratio of the gt mask inside the proposal and the gt mask of the corresponding instance
[ "Compute", "area", "ratio", "of", "the", "gt", "mask", "inside", "the", "proposal", "and", "the", "gt", "mask", "of", "the", "corresponding", "instance" ]
[ "\"\"\"Compute area ratio of the gt mask inside the proposal and the gt\n mask of the corresponding instance\"\"\"", "# compute mask areas of gt instances (batch processing for speedup)", "# crop the gt mask inside the proposal" ]
[ { "param": "self", "type": null }, { "param": "pos_proposals", "type": null }, { "param": "pos_assigned_gt_inds", "type": null }, { "param": "gt_masks", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "pos_proposals", "type": null, "docstring": null, "docstring_t...
c719be96b05a947e13db4916532fbe0f84394eb8
Gitgigabyte/mmd
mmdet/core/bbox/geometry.py
[ "Apache-2.0" ]
Python
mask_overlaps
<not_specific>
def mask_overlaps(pos_proposals, pos_assigned_gt_inds, gt_masks): """Compute area ratio of the gt mask inside the proposal and the gt mask of the corresponding instance""" if len(pos_proposals.size()) == 1: pos_proposals = pos_proposals[None, :] num_pos = pos_proposals.size(0) if num_pos > 0...
Compute area ratio of the gt mask inside the proposal and the gt mask of the corresponding instance
Compute area ratio of the gt mask inside the proposal and the gt mask of the corresponding instance
[ "Compute", "area", "ratio", "of", "the", "gt", "mask", "inside", "the", "proposal", "and", "the", "gt", "mask", "of", "the", "corresponding", "instance" ]
def mask_overlaps(pos_proposals, pos_assigned_gt_inds, gt_masks): if len(pos_proposals.size()) == 1: pos_proposals = pos_proposals[None, :] num_pos = pos_proposals.size(0) if num_pos > 0: area_ratios = [] proposals_np = pos_proposals.cpu().numpy() pos_assigned_gt_inds = pos_a...
[ "def", "mask_overlaps", "(", "pos_proposals", ",", "pos_assigned_gt_inds", ",", "gt_masks", ")", ":", "if", "len", "(", "pos_proposals", ".", "size", "(", ")", ")", "==", "1", ":", "pos_proposals", "=", "pos_proposals", "[", "None", ",", ":", "]", "num_pos...
Compute area ratio of the gt mask inside the proposal and the gt mask of the corresponding instance
[ "Compute", "area", "ratio", "of", "the", "gt", "mask", "inside", "the", "proposal", "and", "the", "gt", "mask", "of", "the", "corresponding", "instance" ]
[ "\"\"\"Compute area ratio of the gt mask inside the proposal and the gt\n mask of the corresponding instance\"\"\"", "# compute mask areas of gt instances (batch processing for speedup)", "# crop the gt mask inside the proposal" ]
[ { "param": "pos_proposals", "type": null }, { "param": "pos_assigned_gt_inds", "type": null }, { "param": "gt_masks", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "pos_proposals", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "pos_assigned_gt_inds", "type": null, "docstring": null, ...
4c3bc1094f20f006b4cc5d1ddbab8a856064839a
jmscslgroup/rosbagpy
bagpy/bagreader.py
[ "MIT" ]
Python
laser_data
<not_specific>
def laser_data(self, **kwargs): ''' Class method `laser_data` extracts laser data from the given file, assuming laser data is of type `sensor_msgs/LaserScan`. Parameters ------------- kwargs variable keyword arguments Returns --------- `list`...
Class method `laser_data` extracts laser data from the given file, assuming laser data is of type `sensor_msgs/LaserScan`. Parameters ------------- kwargs variable keyword arguments Returns --------- `list` A list of strings. Each string...
Class method `laser_data` extracts laser data from the given file, assuming laser data is of type `sensor_msgs/LaserScan`. Parameters kwargs variable keyword arguments Returns `list` A list of strings. Each string will correspond to file path of CSV file that contains extracted data of laser scan type Example
[ "Class", "method", "`", "laser_data", "`", "extracts", "laser", "data", "from", "the", "given", "file", "assuming", "laser", "data", "is", "of", "type", "`", "sensor_msgs", "/", "LaserScan", "`", ".", "Parameters", "kwargs", "variable", "keyword", "arguments",...
def laser_data(self, **kwargs): tstart =None tend = None type_to_look ="sensor_msgs/LaserScan" table_rows = self.topic_table[self.topic_table['Types']==type_to_look] topics_to_read = table_rows['Topics'].values message_counts = table_rows['Message Count'].values c...
[ "def", "laser_data", "(", "self", ",", "**", "kwargs", ")", ":", "tstart", "=", "None", "tend", "=", "None", "type_to_look", "=", "\"sensor_msgs/LaserScan\"", "table_rows", "=", "self", ".", "topic_table", "[", "self", ".", "topic_table", "[", "'Types'", "]"...
Class method `laser_data` extracts laser data from the given file, assuming laser data is of type `sensor_msgs/LaserScan`.
[ "Class", "method", "`", "laser_data", "`", "extracts", "laser", "data", "from", "the", "given", "file", "assuming", "laser", "data", "is", "of", "type", "`", "sensor_msgs", "/", "LaserScan", "`", "." ]
[ "'''\n Class method `laser_data` extracts laser data from the given file, assuming laser data is of type `sensor_msgs/LaserScan`.\n\n Parameters\n -------------\n kwargs\n variable keyword arguments\n\n Returns\n ---------\n `list`\n A list of s...
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
4c3bc1094f20f006b4cc5d1ddbab8a856064839a
jmscslgroup/rosbagpy
bagpy/bagreader.py
[ "MIT" ]
Python
vel_data
<not_specific>
def vel_data(self, **kwargs): ''' Class method `vel_data` extracts velocity data from the given file, assuming laser data is of type `geometry_msgs/Twist`. Parameters ------------- kwargs variable keyword arguments Returns --------- `list` ...
Class method `vel_data` extracts velocity data from the given file, assuming laser data is of type `geometry_msgs/Twist`. Parameters ------------- kwargs variable keyword arguments Returns --------- `list` A list of strings. Each string ...
Class method `vel_data` extracts velocity data from the given file, assuming laser data is of type `geometry_msgs/Twist`. Parameters kwargs variable keyword arguments Returns `list` A list of strings. Each string will correspond to file path of CSV file that contains extracted data of geometry_msgs/Twist type Examp...
[ "Class", "method", "`", "vel_data", "`", "extracts", "velocity", "data", "from", "the", "given", "file", "assuming", "laser", "data", "is", "of", "type", "`", "geometry_msgs", "/", "Twist", "`", ".", "Parameters", "kwargs", "variable", "keyword", "arguments", ...
def vel_data(self, **kwargs): tstart = None tend = None type_to_look ="geometry_msgs/Twist" table_rows = self.topic_table[self.topic_table['Types']==type_to_look] topics_to_read = table_rows['Topics'].values message_counts = table_rows['Message Count'].values colu...
[ "def", "vel_data", "(", "self", ",", "**", "kwargs", ")", ":", "tstart", "=", "None", "tend", "=", "None", "type_to_look", "=", "\"geometry_msgs/Twist\"", "table_rows", "=", "self", ".", "topic_table", "[", "self", ".", "topic_table", "[", "'Types'", "]", ...
Class method `vel_data` extracts velocity data from the given file, assuming laser data is of type `geometry_msgs/Twist`.
[ "Class", "method", "`", "vel_data", "`", "extracts", "velocity", "data", "from", "the", "given", "file", "assuming", "laser", "data", "is", "of", "type", "`", "geometry_msgs", "/", "Twist", "`", "." ]
[ "'''\n Class method `vel_data` extracts velocity data from the given file, assuming laser data is of type `geometry_msgs/Twist`.\n\n Parameters\n -------------\n kwargs\n variable keyword arguments\n\n Returns\n ---------\n `list`\n A list of st...
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
4c3bc1094f20f006b4cc5d1ddbab8a856064839a
jmscslgroup/rosbagpy
bagpy/bagreader.py
[ "MIT" ]
Python
odometry_data
<not_specific>
def odometry_data(self, **kwargs): ''' Class method `odometry_data` extracts velocity data from the given file, assuming laser data is of type `nav_msgs/Odometry`. Parameters ------------- kwargs variable keyword arguments Returns --------- `...
Class method `odometry_data` extracts velocity data from the given file, assuming laser data is of type `nav_msgs/Odometry`. Parameters ------------- kwargs variable keyword arguments Returns --------- `list` A list of strings. Each stri...
Class method `odometry_data` extracts velocity data from the given file, assuming laser data is of type `nav_msgs/Odometry`. Parameters kwargs variable keyword arguments Returns `list` A list of strings. Each string will correspond to file path of CSV file that contains extracted data of nav_msgs/Odometry type Exam...
[ "Class", "method", "`", "odometry_data", "`", "extracts", "velocity", "data", "from", "the", "given", "file", "assuming", "laser", "data", "is", "of", "type", "`", "nav_msgs", "/", "Odometry", "`", ".", "Parameters", "kwargs", "variable", "keyword", "arguments...
def odometry_data(self, **kwargs): tstart = None tend = None type_to_look ="nav_msgs/Odometry" table_rows = self.topic_table[self.topic_table['Types']==type_to_look] topics_to_read = table_rows['Topics'].values message_counts = table_rows['Message Count'].values c...
[ "def", "odometry_data", "(", "self", ",", "**", "kwargs", ")", ":", "tstart", "=", "None", "tend", "=", "None", "type_to_look", "=", "\"nav_msgs/Odometry\"", "table_rows", "=", "self", ".", "topic_table", "[", "self", ".", "topic_table", "[", "'Types'", "]",...
Class method `odometry_data` extracts velocity data from the given file, assuming laser data is of type `nav_msgs/Odometry`.
[ "Class", "method", "`", "odometry_data", "`", "extracts", "velocity", "data", "from", "the", "given", "file", "assuming", "laser", "data", "is", "of", "type", "`", "nav_msgs", "/", "Odometry", "`", "." ]
[ "'''\n Class method `odometry_data` extracts velocity data from the given file, assuming laser data is of type `nav_msgs/Odometry`.\n\n Parameters\n -------------\n kwargs\n variable keyword arguments\n\n Returns\n ---------\n `list`\n A list of...
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
4c3bc1094f20f006b4cc5d1ddbab8a856064839a
jmscslgroup/rosbagpy
bagpy/bagreader.py
[ "MIT" ]
Python
wrench_data
<not_specific>
def wrench_data(self, **kwargs): ''' Class method `wrench_data` extracts velocity data from the given file, assuming laser data is of type `geometry_msgs/Wrench`. Parameters ------------- kwargs variable keyword arguments Returns --------- `l...
Class method `wrench_data` extracts velocity data from the given file, assuming laser data is of type `geometry_msgs/Wrench`. Parameters ------------- kwargs variable keyword arguments Returns --------- `list` A list of strings. Each str...
Class method `wrench_data` extracts velocity data from the given file, assuming laser data is of type `geometry_msgs/Wrench`. Parameters kwargs variable keyword arguments Returns `list` A list of strings. Each string will correspond to file path of CSV file that contains extracted data of geometry_msgs/Wrench type ...
[ "Class", "method", "`", "wrench_data", "`", "extracts", "velocity", "data", "from", "the", "given", "file", "assuming", "laser", "data", "is", "of", "type", "`", "geometry_msgs", "/", "Wrench", "`", ".", "Parameters", "kwargs", "variable", "keyword", "argument...
def wrench_data(self, **kwargs): tstart = None tend = None type_to_look ="geometry_msgs/Wrench" table_rows = self.topic_table[self.topic_table['Types']==type_to_look] topics_to_read = table_rows['Topics'].values message_counts = table_rows['Message Count'].values ...
[ "def", "wrench_data", "(", "self", ",", "**", "kwargs", ")", ":", "tstart", "=", "None", "tend", "=", "None", "type_to_look", "=", "\"geometry_msgs/Wrench\"", "table_rows", "=", "self", ".", "topic_table", "[", "self", ".", "topic_table", "[", "'Types'", "]"...
Class method `wrench_data` extracts velocity data from the given file, assuming laser data is of type `geometry_msgs/Wrench`.
[ "Class", "method", "`", "wrench_data", "`", "extracts", "velocity", "data", "from", "the", "given", "file", "assuming", "laser", "data", "is", "of", "type", "`", "geometry_msgs", "/", "Wrench", "`", "." ]
[ "'''\n Class method `wrench_data` extracts velocity data from the given file, assuming laser data is of type `geometry_msgs/Wrench`.\n\n Parameters\n -------------\n kwargs\n variable keyword arguments\n\n Returns\n ---------\n `list`\n A list o...
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
4c3bc1094f20f006b4cc5d1ddbab8a856064839a
jmscslgroup/rosbagpy
bagpy/bagreader.py
[ "MIT" ]
Python
clock_data
<not_specific>
def clock_data(self, **kwargs): ''' Class method `vel_data` extracts velocity data from the given file, assuming laser data is of type `rosgraph_msgs/Clock`. Parameters ------------- kwargs variable keyword arguments Returns --------- `list`...
Class method `vel_data` extracts velocity data from the given file, assuming laser data is of type `rosgraph_msgs/Clock`. Parameters ------------- kwargs variable keyword arguments Returns --------- `list` A list of strings. Each string ...
Class method `vel_data` extracts velocity data from the given file, assuming laser data is of type `rosgraph_msgs/Clock`. Parameters kwargs variable keyword arguments Returns `list` A list of strings. Each string will correspond to file path of CSV file that contains extracted data of rosgraph_msgs/Clock type Examp...
[ "Class", "method", "`", "vel_data", "`", "extracts", "velocity", "data", "from", "the", "given", "file", "assuming", "laser", "data", "is", "of", "type", "`", "rosgraph_msgs", "/", "Clock", "`", ".", "Parameters", "kwargs", "variable", "keyword", "arguments", ...
def clock_data(self, **kwargs): tstart = None tend = None type_to_look ="rosgraph_msgs/Clock" table_rows = self.topic_table[self.topic_table['Types']==type_to_look] topics_to_read = table_rows['Topics'].values message_counts = table_rows['Message Count'].values c...
[ "def", "clock_data", "(", "self", ",", "**", "kwargs", ")", ":", "tstart", "=", "None", "tend", "=", "None", "type_to_look", "=", "\"rosgraph_msgs/Clock\"", "table_rows", "=", "self", ".", "topic_table", "[", "self", ".", "topic_table", "[", "'Types'", "]", ...
Class method `vel_data` extracts velocity data from the given file, assuming laser data is of type `rosgraph_msgs/Clock`.
[ "Class", "method", "`", "vel_data", "`", "extracts", "velocity", "data", "from", "the", "given", "file", "assuming", "laser", "data", "is", "of", "type", "`", "rosgraph_msgs", "/", "Clock", "`", "." ]
[ "'''\n Class method `vel_data` extracts velocity data from the given file, assuming laser data is of type `rosgraph_msgs/Clock`.\n\n Parameters\n -------------\n kwargs\n variable keyword arguments\n\n Returns\n ---------\n `list`\n A list of st...
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
4c3bc1094f20f006b4cc5d1ddbab8a856064839a
jmscslgroup/rosbagpy
bagpy/bagreader.py
[ "MIT" ]
Python
timeindex
<not_specific>
def timeindex(df, inplace=False): ''' Convert multi Dataframe of which on column must be 'Time' to pandas-compatible timeseries where timestamp is used to replace indices Parameters -------------- df: `pandas.DataFrame` A pandas dataframe with two columns with the column names "Time" and ...
Convert multi Dataframe of which on column must be 'Time' to pandas-compatible timeseries where timestamp is used to replace indices Parameters -------------- df: `pandas.DataFrame` A pandas dataframe with two columns with the column names "Time" and "Message" inplace: `bool` Mo...
Convert multi Dataframe of which on column must be 'Time' to pandas-compatible timeseries where timestamp is used to replace indices Parameters `pandas.DataFrame` A pandas dataframe with two columns with the column names "Time" and "Message" `bool` Modifies the actual dataframe, if true, otherwise doesn't. Returns ...
[ "Convert", "multi", "Dataframe", "of", "which", "on", "column", "must", "be", "'", "Time", "'", "to", "pandas", "-", "compatible", "timeseries", "where", "timestamp", "is", "used", "to", "replace", "indices", "Parameters", "`", "pandas", ".", "DataFrame", "`...
def timeindex(df, inplace=False): if inplace: newdf = df else: newdf =df.copy(deep = True) newdf['Time'] = df['Time'] Time = pd.to_datetime(newdf['Time'], unit='s') newdf['Clock'] = pd.DatetimeIndex(Time) if inplace: newdf.set_index('Clock', inplace=inplace) else: ...
[ "def", "timeindex", "(", "df", ",", "inplace", "=", "False", ")", ":", "if", "inplace", ":", "newdf", "=", "df", "else", ":", "newdf", "=", "df", ".", "copy", "(", "deep", "=", "True", ")", "newdf", "[", "'Time'", "]", "=", "df", "[", "'Time'", ...
Convert multi Dataframe of which on column must be 'Time' to pandas-compatible timeseries where timestamp is used to replace indices Parameters
[ "Convert", "multi", "Dataframe", "of", "which", "on", "column", "must", "be", "'", "Time", "'", "to", "pandas", "-", "compatible", "timeseries", "where", "timestamp", "is", "used", "to", "replace", "indices", "Parameters" ]
[ "'''\n Convert multi Dataframe of which on column must be 'Time' to pandas-compatible timeseries where timestamp is used to replace indices\n\n Parameters\n --------------\n\n df: `pandas.DataFrame`\n A pandas dataframe with two columns with the column names \"Time\" and \"Message\"\n\n inpla...
[ { "param": "df", "type": null }, { "param": "inplace", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "df", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "inplace", "type": null, "docstring": null, "docstring_tokens": ...
415563151a6cf9427d793ff34531d4b98ffe1912
algrs/polliwog
polliwog/plane/plane.py
[ "BSD-2-Clause" ]
Python
from_points
<not_specific>
def from_points(cls, p1, p2, p3): """ If the points are oriented in a counterclockwise direction, the plane's normal extends towards you. """ vg.shape.check(locals(), "p1", (3,)) vg.shape.check(locals(), "p2", (3,)) vg.shape.check(locals(), "p3", (3,)) po...
If the points are oriented in a counterclockwise direction, the plane's normal extends towards you.
If the points are oriented in a counterclockwise direction, the plane's normal extends towards you.
[ "If", "the", "points", "are", "oriented", "in", "a", "counterclockwise", "direction", "the", "plane", "'", "s", "normal", "extends", "towards", "you", "." ]
def from_points(cls, p1, p2, p3): vg.shape.check(locals(), "p1", (3,)) vg.shape.check(locals(), "p2", (3,)) vg.shape.check(locals(), "p3", (3,)) points = np.array([p1, p2, p3]) return cls( point_on_plane=p1, unit_normal=functions.plane_normal_from_points(points) ...
[ "def", "from_points", "(", "cls", ",", "p1", ",", "p2", ",", "p3", ")", ":", "vg", ".", "shape", ".", "check", "(", "locals", "(", ")", ",", "\"p1\"", ",", "(", "3", ",", ")", ")", "vg", ".", "shape", ".", "check", "(", "locals", "(", ")", ...
If the points are oriented in a counterclockwise direction, the plane's normal extends towards you.
[ "If", "the", "points", "are", "oriented", "in", "a", "counterclockwise", "direction", "the", "plane", "'", "s", "normal", "extends", "towards", "you", "." ]
[ "\"\"\"\n If the points are oriented in a counterclockwise direction, the plane's\n normal extends towards you.\n\n \"\"\"" ]
[ { "param": "cls", "type": null }, { "param": "p1", "type": null }, { "param": "p2", "type": null }, { "param": "p3", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "cls", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "p1", "type": null, "docstring": null, "docstring_tokens": [], ...
415563151a6cf9427d793ff34531d4b98ffe1912
algrs/polliwog
polliwog/plane/plane.py
[ "BSD-2-Clause" ]
Python
from_points_and_vector
<not_specific>
def from_points_and_vector(cls, p1, p2, vector): """ Compute a plane which contains two given points and the given vector. Its reference point will be p1. For example, to find the vertical plane that passes through two landmarks: from_points_and_normal(p1, p2, vecto...
Compute a plane which contains two given points and the given vector. Its reference point will be p1. For example, to find the vertical plane that passes through two landmarks: from_points_and_normal(p1, p2, vector) Another way to think about this: identify the pl...
Compute a plane which contains two given points and the given vector. Its reference point will be p1. For example, to find the vertical plane that passes through two landmarks. Another way to think about this: identify the plane to which your result plane should be perpendicular, and specify vector as its normal ve...
[ "Compute", "a", "plane", "which", "contains", "two", "given", "points", "and", "the", "given", "vector", ".", "Its", "reference", "point", "will", "be", "p1", ".", "For", "example", "to", "find", "the", "vertical", "plane", "that", "passes", "through", "tw...
def from_points_and_vector(cls, p1, p2, vector): vg.shape.check(locals(), "p1", (3,)) vg.shape.check(locals(), "p2", (3,)) vg.shape.check(locals(), "vector", (3,)) normal = np.cross(p2 - p1, vector) return cls(point_on_plane=p1, unit_normal=normal)
[ "def", "from_points_and_vector", "(", "cls", ",", "p1", ",", "p2", ",", "vector", ")", ":", "vg", ".", "shape", ".", "check", "(", "locals", "(", ")", ",", "\"p1\"", ",", "(", "3", ",", ")", ")", "vg", ".", "shape", ".", "check", "(", "locals", ...
Compute a plane which contains two given points and the given vector.
[ "Compute", "a", "plane", "which", "contains", "two", "given", "points", "and", "the", "given", "vector", "." ]
[ "\"\"\"\n Compute a plane which contains two given points and the given\n vector. Its reference point will be p1.\n\n For example, to find the vertical plane that passes through\n two landmarks:\n\n from_points_and_normal(p1, p2, vector)\n\n Another way to think about t...
[ { "param": "cls", "type": null }, { "param": "p1", "type": null }, { "param": "p2", "type": null }, { "param": "vector", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "cls", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "p1", "type": null, "docstring": null, "docstring_tokens": [], ...
415563151a6cf9427d793ff34531d4b98ffe1912
algrs/polliwog
polliwog/plane/plane.py
[ "BSD-2-Clause" ]
Python
fit_from_points
<not_specific>
def fit_from_points(cls, points): """ Fits a plane whose normal is orthgonal to the first two principal axes of variation in the data and centered on the points' centroid. """ vg.shape.check(locals(), "points", (-1, 3)) eigval, eigvec = np.linalg.eig(np.cov(points.T)) ...
Fits a plane whose normal is orthgonal to the first two principal axes of variation in the data and centered on the points' centroid.
Fits a plane whose normal is orthgonal to the first two principal axes of variation in the data and centered on the points' centroid.
[ "Fits", "a", "plane", "whose", "normal", "is", "orthgonal", "to", "the", "first", "two", "principal", "axes", "of", "variation", "in", "the", "data", "and", "centered", "on", "the", "points", "'", "centroid", "." ]
def fit_from_points(cls, points): vg.shape.check(locals(), "points", (-1, 3)) eigval, eigvec = np.linalg.eig(np.cov(points.T)) ordering = np.argsort(eigval)[::-1] normal = np.cross(eigvec[:, ordering[0]], eigvec[:, ordering[1]]) return cls(points.mean(axis=0), normal)
[ "def", "fit_from_points", "(", "cls", ",", "points", ")", ":", "vg", ".", "shape", ".", "check", "(", "locals", "(", ")", ",", "\"points\"", ",", "(", "-", "1", ",", "3", ")", ")", "eigval", ",", "eigvec", "=", "np", ".", "linalg", ".", "eig", ...
Fits a plane whose normal is orthgonal to the first two principal axes of variation in the data and centered on the points' centroid.
[ "Fits", "a", "plane", "whose", "normal", "is", "orthgonal", "to", "the", "first", "two", "principal", "axes", "of", "variation", "in", "the", "data", "and", "centered", "on", "the", "points", "'", "centroid", "." ]
[ "\"\"\"\n Fits a plane whose normal is orthgonal to the first two principal axes\n of variation in the data and centered on the points' centroid.\n \"\"\"" ]
[ { "param": "cls", "type": null }, { "param": "points", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "cls", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "points", "type": null, "docstring": null, "docstring_tokens": ...
415563151a6cf9427d793ff34531d4b98ffe1912
algrs/polliwog
polliwog/plane/plane.py
[ "BSD-2-Clause" ]
Python
reference_point
<not_specific>
def reference_point(self): """ The point used to create this plane. """ return self._r0
The point used to create this plane.
The point used to create this plane.
[ "The", "point", "used", "to", "create", "this", "plane", "." ]
def reference_point(self): return self._r0
[ "def", "reference_point", "(", "self", ")", ":", "return", "self", ".", "_r0" ]
The point used to create this plane.
[ "The", "point", "used", "to", "create", "this", "plane", "." ]
[ "\"\"\"\n The point used to create this plane.\n\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
415563151a6cf9427d793ff34531d4b98ffe1912
algrs/polliwog
polliwog/plane/plane.py
[ "BSD-2-Clause" ]
Python
canonical_point
<not_specific>
def canonical_point(self): """ A canonical point on the plane, the one at which the normal would intersect the plane if drawn from the origin (0, 0, 0). This is computed by projecting the reference point onto the normal. This is useful for partitioning the space between...
A canonical point on the plane, the one at which the normal would intersect the plane if drawn from the origin (0, 0, 0). This is computed by projecting the reference point onto the normal. This is useful for partitioning the space between two planes, as we do when sea...
A canonical point on the plane, the one at which the normal would intersect the plane if drawn from the origin (0, 0, 0). This is computed by projecting the reference point onto the normal. This is useful for partitioning the space between two planes, as we do when searching for planar cross sections.
[ "A", "canonical", "point", "on", "the", "plane", "the", "one", "at", "which", "the", "normal", "would", "intersect", "the", "plane", "if", "drawn", "from", "the", "origin", "(", "0", "0", "0", ")", ".", "This", "is", "computed", "by", "projecting", "th...
def canonical_point(self): return self._r0.dot(self._n) * self._n
[ "def", "canonical_point", "(", "self", ")", ":", "return", "self", ".", "_r0", ".", "dot", "(", "self", ".", "_n", ")", "*", "self", ".", "_n" ]
A canonical point on the plane, the one at which the normal would intersect the plane if drawn from the origin (0, 0, 0).
[ "A", "canonical", "point", "on", "the", "plane", "the", "one", "at", "which", "the", "normal", "would", "intersect", "the", "plane", "if", "drawn", "from", "the", "origin", "(", "0", "0", "0", ")", "." ]
[ "\"\"\"\n A canonical point on the plane, the one at which the normal\n would intersect the plane if drawn from the origin (0, 0, 0).\n\n This is computed by projecting the reference point onto the\n normal.\n\n This is useful for partitioning the space between two planes,\n ...
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
415563151a6cf9427d793ff34531d4b98ffe1912
algrs/polliwog
polliwog/plane/plane.py
[ "BSD-2-Clause" ]
Python
normal
<not_specific>
def normal(self): """ Return the plane's normal vector. """ return self._n
Return the plane's normal vector.
Return the plane's normal vector.
[ "Return", "the", "plane", "'", "s", "normal", "vector", "." ]
def normal(self): return self._n
[ "def", "normal", "(", "self", ")", ":", "return", "self", ".", "_n" ]
Return the plane's normal vector.
[ "Return", "the", "plane", "'", "s", "normal", "vector", "." ]
[ "\"\"\"\n Return the plane's normal vector.\n\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
415563151a6cf9427d793ff34531d4b98ffe1912
algrs/polliwog
polliwog/plane/plane.py
[ "BSD-2-Clause" ]
Python
flipped
<not_specific>
def flipped(self): """ Creates a new Plane with an inverted orientation. """ return Plane(point_on_plane=self._r0, unit_normal=-self._n)
Creates a new Plane with an inverted orientation.
Creates a new Plane with an inverted orientation.
[ "Creates", "a", "new", "Plane", "with", "an", "inverted", "orientation", "." ]
def flipped(self): return Plane(point_on_plane=self._r0, unit_normal=-self._n)
[ "def", "flipped", "(", "self", ")", ":", "return", "Plane", "(", "point_on_plane", "=", "self", ".", "_r0", ",", "unit_normal", "=", "-", "self", ".", "_n", ")" ]
Creates a new Plane with an inverted orientation.
[ "Creates", "a", "new", "Plane", "with", "an", "inverted", "orientation", "." ]
[ "\"\"\"\n Creates a new Plane with an inverted orientation.\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
415563151a6cf9427d793ff34531d4b98ffe1912
algrs/polliwog
polliwog/plane/plane.py
[ "BSD-2-Clause" ]
Python
sign
<not_specific>
def sign(self, points): """ Given an array of points, return an array with +1 for points in front of the plane (in the direction of the normal), -1 for points behind the plane (away from the normal), and 0 for points on the plane. """ vg.shape.check(locals(), "points", (...
Given an array of points, return an array with +1 for points in front of the plane (in the direction of the normal), -1 for points behind the plane (away from the normal), and 0 for points on the plane.
Given an array of points, return an array with +1 for points in front of the plane (in the direction of the normal), -1 for points behind the plane (away from the normal), and 0 for points on the plane.
[ "Given", "an", "array", "of", "points", "return", "an", "array", "with", "+", "1", "for", "points", "in", "front", "of", "the", "plane", "(", "in", "the", "direction", "of", "the", "normal", ")", "-", "1", "for", "points", "behind", "the", "plane", "...
def sign(self, points): vg.shape.check(locals(), "points", (-1, 3)) return np.sign(self.signed_distance(points))
[ "def", "sign", "(", "self", ",", "points", ")", ":", "vg", ".", "shape", ".", "check", "(", "locals", "(", ")", ",", "\"points\"", ",", "(", "-", "1", ",", "3", ")", ")", "return", "np", ".", "sign", "(", "self", ".", "signed_distance", "(", "p...
Given an array of points, return an array with +1 for points in front of the plane (in the direction of the normal), -1 for points behind the plane (away from the normal), and 0 for points on the plane.
[ "Given", "an", "array", "of", "points", "return", "an", "array", "with", "+", "1", "for", "points", "in", "front", "of", "the", "plane", "(", "in", "the", "direction", "of", "the", "normal", ")", "-", "1", "for", "points", "behind", "the", "plane", "...
[ "\"\"\"\n Given an array of points, return an array with +1 for points in front\n of the plane (in the direction of the normal), -1 for points behind\n the plane (away from the normal), and 0 for points on the plane.\n\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "points", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "points", "type": null, "docstring": null, "docstring_tokens":...
415563151a6cf9427d793ff34531d4b98ffe1912
algrs/polliwog
polliwog/plane/plane.py
[ "BSD-2-Clause" ]
Python
points_in_front
<not_specific>
def points_in_front(self, points, inverted=False, ret_indices=False): """ Given an array of points, return the points which lie either on the plane or in the half-space in front of it (i.e. in the direction of the plane normal). points: An array of points. inverted: When...
Given an array of points, return the points which lie either on the plane or in the half-space in front of it (i.e. in the direction of the plane normal). points: An array of points. inverted: When `True`, invert the logic. Return the points that lie behind the plane ...
Given an array of points, return the points which lie either on the plane or in the half-space in front of it . An array of points. inverted: When `True`, invert the logic. Return the points that lie behind the plane instead. ret_indices: When `True`, return the indices instead of the points themselves.
[ "Given", "an", "array", "of", "points", "return", "the", "points", "which", "lie", "either", "on", "the", "plane", "or", "in", "the", "half", "-", "space", "in", "front", "of", "it", ".", "An", "array", "of", "points", ".", "inverted", ":", "When", "...
def points_in_front(self, points, inverted=False, ret_indices=False): sign = self.sign(points) if inverted: mask = np.less_equal(sign, 0) else: mask = np.greater_equal(sign, 0) indices = np.flatnonzero(mask) return indices if ret_indices else points[indice...
[ "def", "points_in_front", "(", "self", ",", "points", ",", "inverted", "=", "False", ",", "ret_indices", "=", "False", ")", ":", "sign", "=", "self", ".", "sign", "(", "points", ")", "if", "inverted", ":", "mask", "=", "np", ".", "less_equal", "(", "...
Given an array of points, return the points which lie either on the plane or in the half-space in front of it (i.e.
[ "Given", "an", "array", "of", "points", "return", "the", "points", "which", "lie", "either", "on", "the", "plane", "or", "in", "the", "half", "-", "space", "in", "front", "of", "it", "(", "i", ".", "e", "." ]
[ "\"\"\"\n Given an array of points, return the points which lie either on the\n plane or in the half-space in front of it (i.e. in the direction of\n the plane normal).\n\n points: An array of points.\n inverted: When `True`, invert the logic. Return the points that lie\n ...
[ { "param": "self", "type": null }, { "param": "points", "type": null }, { "param": "inverted", "type": null }, { "param": "ret_indices", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "points", "type": null, "docstring": null, "docstring_tokens":...
415563151a6cf9427d793ff34531d4b98ffe1912
algrs/polliwog
polliwog/plane/plane.py
[ "BSD-2-Clause" ]
Python
signed_distance
<not_specific>
def signed_distance(self, points): """ Returns the signed distances to the given points or the signed distance to a single point. Params: - points: V x 3 np.array """ return functions.signed_distance_to_plane(points, self.equation)
Returns the signed distances to the given points or the signed distance to a single point. Params: - points: V x 3 np.array
Returns the signed distances to the given points or the signed distance to a single point.
[ "Returns", "the", "signed", "distances", "to", "the", "given", "points", "or", "the", "signed", "distance", "to", "a", "single", "point", "." ]
def signed_distance(self, points): return functions.signed_distance_to_plane(points, self.equation)
[ "def", "signed_distance", "(", "self", ",", "points", ")", ":", "return", "functions", ".", "signed_distance_to_plane", "(", "points", ",", "self", ".", "equation", ")" ]
Returns the signed distances to the given points or the signed distance to a single point.
[ "Returns", "the", "signed", "distances", "to", "the", "given", "points", "or", "the", "signed", "distance", "to", "a", "single", "point", "." ]
[ "\"\"\"\n Returns the signed distances to the given points or the signed\n distance to a single point.\n\n Params:\n - points:\n V x 3 np.array\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "points", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "points", "type": null, "docstring": null, "docstring_tokens":...
415563151a6cf9427d793ff34531d4b98ffe1912
algrs/polliwog
polliwog/plane/plane.py
[ "BSD-2-Clause" ]
Python
project_point
<not_specific>
def project_point(self, points): """ Project a given point (or stack of points) to the plane. """ return functions.project_point_to_plane(points, self.equation)
Project a given point (or stack of points) to the plane.
Project a given point (or stack of points) to the plane.
[ "Project", "a", "given", "point", "(", "or", "stack", "of", "points", ")", "to", "the", "plane", "." ]
def project_point(self, points): return functions.project_point_to_plane(points, self.equation)
[ "def", "project_point", "(", "self", ",", "points", ")", ":", "return", "functions", ".", "project_point_to_plane", "(", "points", ",", "self", ".", "equation", ")" ]
Project a given point (or stack of points) to the plane.
[ "Project", "a", "given", "point", "(", "or", "stack", "of", "points", ")", "to", "the", "plane", "." ]
[ "\"\"\"\n Project a given point (or stack of points) to the plane.\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "points", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "points", "type": null, "docstring": null, "docstring_tokens":...
be876757134f3d89c259dd4ed5f85ac46a7701cc
algrs/polliwog
polliwog/line/line.py
[ "BSD-2-Clause" ]
Python
intersect_line
<not_specific>
def intersect_line(self, other): """ Find the intersection with another line. """ from .line_intersect import line_intersect3 return line_intersect3(*(self.reference_points + other.reference_points))
Find the intersection with another line.
Find the intersection with another line.
[ "Find", "the", "intersection", "with", "another", "line", "." ]
def intersect_line(self, other): from .line_intersect import line_intersect3 return line_intersect3(*(self.reference_points + other.reference_points))
[ "def", "intersect_line", "(", "self", ",", "other", ")", ":", "from", ".", "line_intersect", "import", "line_intersect3", "return", "line_intersect3", "(", "*", "(", "self", ".", "reference_points", "+", "other", ".", "reference_points", ")", ")" ]
Find the intersection with another line.
[ "Find", "the", "intersection", "with", "another", "line", "." ]
[ "\"\"\"\n Find the intersection with another line.\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "other", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "other", "type": null, "docstring": null, "docstring_tokens": ...
be876757134f3d89c259dd4ed5f85ac46a7701cc
algrs/polliwog
polliwog/line/line.py
[ "BSD-2-Clause" ]
Python
project
<not_specific>
def project(self, points): """ Project a given point (or stack of points) to the plane. """ return project_to_line( points=points, reference_points_of_lines=self.reference_point, vectors_along_lines=self.along, )
Project a given point (or stack of points) to the plane.
Project a given point (or stack of points) to the plane.
[ "Project", "a", "given", "point", "(", "or", "stack", "of", "points", ")", "to", "the", "plane", "." ]
def project(self, points): return project_to_line( points=points, reference_points_of_lines=self.reference_point, vectors_along_lines=self.along, )
[ "def", "project", "(", "self", ",", "points", ")", ":", "return", "project_to_line", "(", "points", "=", "points", ",", "reference_points_of_lines", "=", "self", ".", "reference_point", ",", "vectors_along_lines", "=", "self", ".", "along", ",", ")" ]
Project a given point (or stack of points) to the plane.
[ "Project", "a", "given", "point", "(", "or", "stack", "of", "points", ")", "to", "the", "plane", "." ]
[ "\"\"\"\n Project a given point (or stack of points) to the plane.\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "points", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "points", "type": null, "docstring": null, "docstring_tokens":...
1ae5fecf81244cda668a532a1879f8f257fb1c44
algrs/polliwog
polliwog/polyline/inflection_points.py
[ "BSD-2-Clause" ]
Python
inflection_points
<not_specific>
def inflection_points(points, axis, span): """ Find the list of vertices that preceed inflection points in a curve. The curve is differentiated with respect to the coordinate system defined by axis and span. Interestingly, `lambda x: 2*x + 1` should have no inflection points, but almost every point...
Find the list of vertices that preceed inflection points in a curve. The curve is differentiated with respect to the coordinate system defined by axis and span. Interestingly, `lambda x: 2*x + 1` should have no inflection points, but almost every point on the line is detected. It's because a zero or z...
Find the list of vertices that preceed inflection points in a curve. The curve is differentiated with respect to the coordinate system defined by axis and span. Interestingly, `lambda x: 2*x + 1` should have no inflection points, but almost every point on the line is detected. It's because a zero or zero crossing in t...
[ "Find", "the", "list", "of", "vertices", "that", "preceed", "inflection", "points", "in", "a", "curve", ".", "The", "curve", "is", "differentiated", "with", "respect", "to", "the", "coordinate", "system", "defined", "by", "axis", "and", "span", ".", "Interes...
def inflection_points(points, axis, span): vg.shape.check(locals(), "points", (-1, 3)) vg.shape.check(locals(), "axis", (3,)) vg.shape.check(locals(), "span", (3,)) coords_on_span = points.dot(span) coords_on_axis = points.dot(axis) finite_difference_1 = np.gradient(coords_on_axis, coords_on_spa...
[ "def", "inflection_points", "(", "points", ",", "axis", ",", "span", ")", ":", "vg", ".", "shape", ".", "check", "(", "locals", "(", ")", ",", "\"points\"", ",", "(", "-", "1", ",", "3", ")", ")", "vg", ".", "shape", ".", "check", "(", "locals", ...
Find the list of vertices that preceed inflection points in a curve.
[ "Find", "the", "list", "of", "vertices", "that", "preceed", "inflection", "points", "in", "a", "curve", "." ]
[ "\"\"\"\n Find the list of vertices that preceed inflection points in a curve. The curve is differentiated\n with respect to the coordinate system defined by axis and span.\n\n Interestingly, `lambda x: 2*x + 1` should have no inflection points, but\n almost every point on the line is detected. It's bec...
[ { "param": "points", "type": null }, { "param": "axis", "type": null }, { "param": "span", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "points", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "axis", "type": null, "docstring": null, "docstring_tokens":...
c3a728190703960abc191e091f03e0f2a9903d3f
algrs/polliwog
polliwog/tri/barycentric.py
[ "BSD-2-Clause" ]
Python
compute_barycentric_coordinates
<not_specific>
def compute_barycentric_coordinates(vertices_of_tris, points): """ Compute barycentric coordinates for the projection of a set of points to a given set of triangles specfied by their vertices. These barycentric coordinates can refer to points outside the triangle. This happens when one of the coord...
Compute barycentric coordinates for the projection of a set of points to a given set of triangles specfied by their vertices. These barycentric coordinates can refer to points outside the triangle. This happens when one of the coordinates is negative. However they can't specify points outside the ...
Compute barycentric coordinates for the projection of a set of points to a given set of triangles specfied by their vertices. These barycentric coordinates can refer to points outside the triangle. This happens when one of the coordinates is negative. However they can't specify points outside the triangle's plane. (Th...
[ "Compute", "barycentric", "coordinates", "for", "the", "projection", "of", "a", "set", "of", "points", "to", "a", "given", "set", "of", "triangles", "specfied", "by", "their", "vertices", ".", "These", "barycentric", "coordinates", "can", "refer", "to", "point...
def compute_barycentric_coordinates(vertices_of_tris, points): k = vg.shape.check(locals(), "vertices_of_tris", (-1, 3, 3)) vg.shape.check(locals(), "points", (k, 3)) p = points.T q = vertices_of_tris[:, 0].T u = (vertices_of_tris[:, 1] - vertices_of_tris[:, 0]).T v = (vertices_of_tris[:, 2] - v...
[ "def", "compute_barycentric_coordinates", "(", "vertices_of_tris", ",", "points", ")", ":", "k", "=", "vg", ".", "shape", ".", "check", "(", "locals", "(", ")", ",", "\"vertices_of_tris\"", ",", "(", "-", "1", ",", "3", ",", "3", ")", ")", "vg", ".", ...
Compute barycentric coordinates for the projection of a set of points to a given set of triangles specfied by their vertices.
[ "Compute", "barycentric", "coordinates", "for", "the", "projection", "of", "a", "set", "of", "points", "to", "a", "given", "set", "of", "triangles", "specfied", "by", "their", "vertices", "." ]
[ "\"\"\"\n Compute barycentric coordinates for the projection of a set of points to a\n given set of triangles specfied by their vertices.\n\n These barycentric coordinates can refer to points outside the triangle.\n This happens when one of the coordinates is negative. However they can't\n specify po...
[ { "param": "vertices_of_tris", "type": null }, { "param": "points", "type": null } ]
{ "returns": [ { "docstring": "Barycentric coordinates as `kx3`", "docstring_tokens": [ "Barycentric", "coordinates", "as", "`", "kx3", "`" ], "type": "np.ndarray" } ], "raises": [], "params": [ { "identifier": "vertices_o...
4fce7ce8529504740976d5ad900e6124fe679f7a
algrs/polliwog
polliwog/transform/rotation.py
[ "BSD-2-Clause" ]
Python
rotation_from_up_and_look
<not_specific>
def rotation_from_up_and_look(up, look): """ Rotation matrix to rotate a mesh into a canonical reference frame. The result is a rotation matrix that will make up along +y and look along +z (i.e. facing towards a default opengl camera). Note that if you're reorienting a mesh, you can use its `reorie...
Rotation matrix to rotate a mesh into a canonical reference frame. The result is a rotation matrix that will make up along +y and look along +z (i.e. facing towards a default opengl camera). Note that if you're reorienting a mesh, you can use its `reorient` method to accomplish this. up: The ...
Rotation matrix to rotate a mesh into a canonical reference frame. The result is a rotation matrix that will make up along +y and look along +z . Note that if you're reorienting a mesh, you can use its `reorient` method to accomplish this. The foot-to-head direction. look: The direction the eyes are facing, or the he...
[ "Rotation", "matrix", "to", "rotate", "a", "mesh", "into", "a", "canonical", "reference", "frame", ".", "The", "result", "is", "a", "rotation", "matrix", "that", "will", "make", "up", "along", "+", "y", "and", "look", "along", "+", "z", ".", "Note", "t...
def rotation_from_up_and_look(up, look): up, look = np.array(up, dtype=np.float64), np.array(look, dtype=np.float64) if np.linalg.norm(up) == 0: raise ValueError("Singular up") if np.linalg.norm(look) == 0: raise ValueError("Singular look") y = up / np.linalg.norm(up) z = look - np.d...
[ "def", "rotation_from_up_and_look", "(", "up", ",", "look", ")", ":", "up", ",", "look", "=", "np", ".", "array", "(", "up", ",", "dtype", "=", "np", ".", "float64", ")", ",", "np", ".", "array", "(", "look", ",", "dtype", "=", "np", ".", "float6...
Rotation matrix to rotate a mesh into a canonical reference frame.
[ "Rotation", "matrix", "to", "rotate", "a", "mesh", "into", "a", "canonical", "reference", "frame", "." ]
[ "\"\"\"\n Rotation matrix to rotate a mesh into a canonical reference frame. The\n result is a rotation matrix that will make up along +y and look along +z\n (i.e. facing towards a default opengl camera).\n\n Note that if you're reorienting a mesh, you can use its `reorient` method\n to accomplish th...
[ { "param": "up", "type": null }, { "param": "look", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "up", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "look", "type": null, "docstring": null, "docstring_tokens": [],...
ebe085f8b5019bc86b77c5625bf3dd6b081eeaf3
algrs/polliwog
polliwog/plane/functions.py
[ "BSD-2-Clause" ]
Python
plane_normal_from_points
<not_specific>
def plane_normal_from_points(points): """ Given a set of three points, compute the normal of the plane which passes through them. Also works on stacked inputs (i.e. many sets of three points). """ points, _, transform_result = columnize(points, (-1, 3, 3), name="points") p1s = points[:, 0] ...
Given a set of three points, compute the normal of the plane which passes through them. Also works on stacked inputs (i.e. many sets of three points).
Given a set of three points, compute the normal of the plane which passes through them. Also works on stacked inputs .
[ "Given", "a", "set", "of", "three", "points", "compute", "the", "normal", "of", "the", "plane", "which", "passes", "through", "them", ".", "Also", "works", "on", "stacked", "inputs", "." ]
def plane_normal_from_points(points): points, _, transform_result = columnize(points, (-1, 3, 3), name="points") p1s = points[:, 0] p2s = points[:, 1] p3s = points[:, 2] v1s = p2s - p1s v2s = p3s - p1s unit_normals = vg.normalize(vg.cross(v1s, v2s)) return transform_result(unit_normals)
[ "def", "plane_normal_from_points", "(", "points", ")", ":", "points", ",", "_", ",", "transform_result", "=", "columnize", "(", "points", ",", "(", "-", "1", ",", "3", ",", "3", ")", ",", "name", "=", "\"points\"", ")", "p1s", "=", "points", "[", ":"...
Given a set of three points, compute the normal of the plane which passes through them.
[ "Given", "a", "set", "of", "three", "points", "compute", "the", "normal", "of", "the", "plane", "which", "passes", "through", "them", "." ]
[ "\"\"\"\n Given a set of three points, compute the normal of the plane which\n passes through them. Also works on stacked inputs (i.e. many sets\n of three points).\n \"\"\"" ]
[ { "param": "points", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "points", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
ebe085f8b5019bc86b77c5625bf3dd6b081eeaf3
algrs/polliwog
polliwog/plane/functions.py
[ "BSD-2-Clause" ]
Python
project_point_to_plane
<not_specific>
def project_point_to_plane(points, plane_equations): """ Project each point to the corresponding plane. """ k = check_shape_any(points, (3,), (-1, 3), name="points") check_shape_any( plane_equations, (4,), (-1 if k is None else k, 4), name="plane_equations" ) # Translate the point b...
Project each point to the corresponding plane.
Project each point to the corresponding plane.
[ "Project", "each", "point", "to", "the", "corresponding", "plane", "." ]
def project_point_to_plane(points, plane_equations): k = check_shape_any(points, (3,), (-1, 3), name="points") check_shape_any( plane_equations, (4,), (-1 if k is None else k, 4), name="plane_equations" ) signed_distance = signed_distance_to_plane(points, plane_equations) normals, _ = normal...
[ "def", "project_point_to_plane", "(", "points", ",", "plane_equations", ")", ":", "k", "=", "check_shape_any", "(", "points", ",", "(", "3", ",", ")", ",", "(", "-", "1", ",", "3", ")", ",", "name", "=", "\"points\"", ")", "check_shape_any", "(", "plan...
Project each point to the corresponding plane.
[ "Project", "each", "point", "to", "the", "corresponding", "plane", "." ]
[ "\"\"\"\n Project each point to the corresponding plane.\n \"\"\"", "# Translate the point back to the plane along the normal." ]
[ { "param": "points", "type": null }, { "param": "plane_equations", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "points", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "plane_equations", "type": null, "docstring": null, "docstri...
cc110b69ca357bc9fb2a512c4f6f9cb2a472c9f8
algrs/polliwog
polliwog/polyline/polyline.py
[ "BSD-2-Clause" ]
Python
join
<not_specific>
def join(cls, *polylines): """ Join together a stack of open polylines end-to-end into one contiguous polyline. The last vertex of the first polyline is connected to the first vertex of the second polyline, and so on. """ if len(polylines) == 0: raise ValueEr...
Join together a stack of open polylines end-to-end into one contiguous polyline. The last vertex of the first polyline is connected to the first vertex of the second polyline, and so on.
Join together a stack of open polylines end-to-end into one contiguous polyline. The last vertex of the first polyline is connected to the first vertex of the second polyline, and so on.
[ "Join", "together", "a", "stack", "of", "open", "polylines", "end", "-", "to", "-", "end", "into", "one", "contiguous", "polyline", ".", "The", "last", "vertex", "of", "the", "first", "polyline", "is", "connected", "to", "the", "first", "vertex", "of", "...
def join(cls, *polylines): if len(polylines) == 0: raise ValueError("Need at least one polyline to join") if any([polyline.is_closed for polyline in polylines]): raise ValueError("Expected input polylines to be open, not closed") return cls(np.vstack([polyline.v for polyl...
[ "def", "join", "(", "cls", ",", "*", "polylines", ")", ":", "if", "len", "(", "polylines", ")", "==", "0", ":", "raise", "ValueError", "(", "\"Need at least one polyline to join\"", ")", "if", "any", "(", "[", "polyline", ".", "is_closed", "for", "polyline...
Join together a stack of open polylines end-to-end into one contiguous polyline.
[ "Join", "together", "a", "stack", "of", "open", "polylines", "end", "-", "to", "-", "end", "into", "one", "contiguous", "polyline", "." ]
[ "\"\"\"\n\n Join together a stack of open polylines end-to-end into one\n contiguous polyline. The last vertex of the first polyline is\n connected to the first vertex of the second polyline, and so on.\n \"\"\"" ]
[ { "param": "cls", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "cls", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
cc110b69ca357bc9fb2a512c4f6f9cb2a472c9f8
algrs/polliwog
polliwog/polyline/polyline.py
[ "BSD-2-Clause" ]
Python
num_v
<not_specific>
def num_v(self): """ Return the number of vertices in the polyline. """ return len(self)
Return the number of vertices in the polyline.
Return the number of vertices in the polyline.
[ "Return", "the", "number", "of", "vertices", "in", "the", "polyline", "." ]
def num_v(self): return len(self)
[ "def", "num_v", "(", "self", ")", ":", "return", "len", "(", "self", ")" ]
Return the number of vertices in the polyline.
[ "Return", "the", "number", "of", "vertices", "in", "the", "polyline", "." ]
[ "\"\"\"\n Return the number of vertices in the polyline.\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
cc110b69ca357bc9fb2a512c4f6f9cb2a472c9f8
algrs/polliwog
polliwog/polyline/polyline.py
[ "BSD-2-Clause" ]
Python
segment_lengths
<not_specific>
def segment_lengths(self): """ The length of each of the segments. """ if self.e is None: return np.zeros(0) else: v1s = self.v[self.e[:, 0]] v2s = self.v[self.e[:, 1]] return vg.euclidean_distance(v1s, v2s)
The length of each of the segments.
The length of each of the segments.
[ "The", "length", "of", "each", "of", "the", "segments", "." ]
def segment_lengths(self): if self.e is None: return np.zeros(0) else: v1s = self.v[self.e[:, 0]] v2s = self.v[self.e[:, 1]] return vg.euclidean_distance(v1s, v2s)
[ "def", "segment_lengths", "(", "self", ")", ":", "if", "self", ".", "e", "is", "None", ":", "return", "np", ".", "zeros", "(", "0", ")", "else", ":", "v1s", "=", "self", ".", "v", "[", "self", ".", "e", "[", ":", ",", "0", "]", "]", "v2s", ...
The length of each of the segments.
[ "The", "length", "of", "each", "of", "the", "segments", "." ]
[ "\"\"\"\n The length of each of the segments.\n\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
cc110b69ca357bc9fb2a512c4f6f9cb2a472c9f8
algrs/polliwog
polliwog/polyline/polyline.py
[ "BSD-2-Clause" ]
Python
bounding_box
<not_specific>
def bounding_box(self): """ The bounding box which encompasses the entire polyline. """ from ..box.box import Box if self.num_v == 0: return None return Box.from_points(self.v)
The bounding box which encompasses the entire polyline.
The bounding box which encompasses the entire polyline.
[ "The", "bounding", "box", "which", "encompasses", "the", "entire", "polyline", "." ]
def bounding_box(self): from ..box.box import Box if self.num_v == 0: return None return Box.from_points(self.v)
[ "def", "bounding_box", "(", "self", ")", ":", "from", ".", ".", "box", ".", "box", "import", "Box", "if", "self", ".", "num_v", "==", "0", ":", "return", "None", "return", "Box", ".", "from_points", "(", "self", ".", "v", ")" ]
The bounding box which encompasses the entire polyline.
[ "The", "bounding", "box", "which", "encompasses", "the", "entire", "polyline", "." ]
[ "\"\"\"\n The bounding box which encompasses the entire polyline.\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
cc110b69ca357bc9fb2a512c4f6f9cb2a472c9f8
algrs/polliwog
polliwog/polyline/polyline.py
[ "BSD-2-Clause" ]
Python
flip
<not_specific>
def flip(self): """ Flip the polyline from end to end. """ self.v = np.flipud(self.v) return self
Flip the polyline from end to end.
Flip the polyline from end to end.
[ "Flip", "the", "polyline", "from", "end", "to", "end", "." ]
def flip(self): self.v = np.flipud(self.v) return self
[ "def", "flip", "(", "self", ")", ":", "self", ".", "v", "=", "np", ".", "flipud", "(", "self", ".", "v", ")", "return", "self" ]
Flip the polyline from end to end.
[ "Flip", "the", "polyline", "from", "end", "to", "end", "." ]
[ "\"\"\"\n Flip the polyline from end to end.\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
cc110b69ca357bc9fb2a512c4f6f9cb2a472c9f8
algrs/polliwog
polliwog/polyline/polyline.py
[ "BSD-2-Clause" ]
Python
oriented_along
<not_specific>
def oriented_along(self, along, reverse=False): """ Flip the polyline, if necessary, so that it points (approximately) along the second vector rather than (approximately) opposite it. """ if self.is_closed: raise ValueError("Can't reorient a closed polyline") ...
Flip the polyline, if necessary, so that it points (approximately) along the second vector rather than (approximately) opposite it.
Flip the polyline, if necessary, so that it points (approximately) along the second vector rather than (approximately) opposite it.
[ "Flip", "the", "polyline", "if", "necessary", "so", "that", "it", "points", "(", "approximately", ")", "along", "the", "second", "vector", "rather", "than", "(", "approximately", ")", "opposite", "it", "." ]
def oriented_along(self, along, reverse=False): if self.is_closed: raise ValueError("Can't reorient a closed polyline") vg.shape.check(locals(), "along", (3,)) if self.num_v < 2: return self extent = self.v[-1] - self.v[0] projected = vg.project(extent, on...
[ "def", "oriented_along", "(", "self", ",", "along", ",", "reverse", "=", "False", ")", ":", "if", "self", ".", "is_closed", ":", "raise", "ValueError", "(", "\"Can't reorient a closed polyline\"", ")", "vg", ".", "shape", ".", "check", "(", "locals", "(", ...
Flip the polyline, if necessary, so that it points (approximately) along the second vector rather than (approximately) opposite it.
[ "Flip", "the", "polyline", "if", "necessary", "so", "that", "it", "points", "(", "approximately", ")", "along", "the", "second", "vector", "rather", "than", "(", "approximately", ")", "opposite", "it", "." ]
[ "\"\"\"\n Flip the polyline, if necessary, so that it points (approximately)\n along the second vector rather than (approximately) opposite it.\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "along", "type": null }, { "param": "reverse", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "along", "type": null, "docstring": null, "docstring_tokens": ...
cc110b69ca357bc9fb2a512c4f6f9cb2a472c9f8
algrs/polliwog
polliwog/polyline/polyline.py
[ "BSD-2-Clause" ]
Python
reindexed
<not_specific>
def reindexed(self, index, ret_edge_mapping=False): """ Return a new Polyline which reindexes the callee polyline, which much be closed, so the vertex with the given index becomes vertex 0. ret_edge_mapping: if True, return an array that maps from old edge indices to new. ...
Return a new Polyline which reindexes the callee polyline, which much be closed, so the vertex with the given index becomes vertex 0. ret_edge_mapping: if True, return an array that maps from old edge indices to new.
Return a new Polyline which reindexes the callee polyline, which much be closed, so the vertex with the given index becomes vertex 0. if True, return an array that maps from old edge indices to new.
[ "Return", "a", "new", "Polyline", "which", "reindexes", "the", "callee", "polyline", "which", "much", "be", "closed", "so", "the", "vertex", "with", "the", "given", "index", "becomes", "vertex", "0", ".", "if", "True", "return", "an", "array", "that", "map...
def reindexed(self, index, ret_edge_mapping=False): if not self.is_closed: raise ValueError("Can't reindex an open polyline") result = Polyline( v=np.append(self.v[index:], self.v[0:index], axis=0), is_closed=True ) if ret_edge_mapping: edge_mapping = ...
[ "def", "reindexed", "(", "self", ",", "index", ",", "ret_edge_mapping", "=", "False", ")", ":", "if", "not", "self", ".", "is_closed", ":", "raise", "ValueError", "(", "\"Can't reindex an open polyline\"", ")", "result", "=", "Polyline", "(", "v", "=", "np",...
Return a new Polyline which reindexes the callee polyline, which much be closed, so the vertex with the given index becomes vertex 0.
[ "Return", "a", "new", "Polyline", "which", "reindexes", "the", "callee", "polyline", "which", "much", "be", "closed", "so", "the", "vertex", "with", "the", "given", "index", "becomes", "vertex", "0", "." ]
[ "\"\"\"\n Return a new Polyline which reindexes the callee polyline, which much\n be closed, so the vertex with the given index becomes vertex 0.\n\n ret_edge_mapping: if True, return an array that maps from old edge\n indices to new.\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "index", "type": null }, { "param": "ret_edge_mapping", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "index", "type": null, "docstring": null, "docstring_tokens": ...
cc110b69ca357bc9fb2a512c4f6f9cb2a472c9f8
algrs/polliwog
polliwog/polyline/polyline.py
[ "BSD-2-Clause" ]
Python
partition_by_length
<not_specific>
def partition_by_length(self, max_length, ret_indices=False): """ Subdivide each line segment longer than max_length with equal-length segments, such that none of the new segments are longer than max_length. ret_indices: If True, return the indices of the original vertices. ...
Subdivide each line segment longer than max_length with equal-length segments, such that none of the new segments are longer than max_length. ret_indices: If True, return the indices of the original vertices. Otherwise return self for chaining.
Subdivide each line segment longer than max_length with equal-length segments, such that none of the new segments are longer than max_length. If True, return the indices of the original vertices. Otherwise return self for chaining.
[ "Subdivide", "each", "line", "segment", "longer", "than", "max_length", "with", "equal", "-", "length", "segments", "such", "that", "none", "of", "the", "new", "segments", "are", "longer", "than", "max_length", ".", "If", "True", "return", "the", "indices", ...
def partition_by_length(self, max_length, ret_indices=False): import itertools from ..segment.segment import partition_segment old_num_e = self.num_e old_num_v = self.num_v num_segments_needed = np.ceil(self.segment_lengths / max_length).astype( dtype=np.int64 ...
[ "def", "partition_by_length", "(", "self", ",", "max_length", ",", "ret_indices", "=", "False", ")", ":", "import", "itertools", "from", ".", ".", "segment", ".", "segment", "import", "partition_segment", "old_num_e", "=", "self", ".", "num_e", "old_num_v", "=...
Subdivide each line segment longer than max_length with equal-length segments, such that none of the new segments are longer than max_length.
[ "Subdivide", "each", "line", "segment", "longer", "than", "max_length", "with", "equal", "-", "length", "segments", "such", "that", "none", "of", "the", "new", "segments", "are", "longer", "than", "max_length", "." ]
[ "\"\"\"\n Subdivide each line segment longer than max_length with\n equal-length segments, such that none of the new segments\n are longer than max_length.\n\n ret_indices: If True, return the indices of the original vertices.\n Otherwise return self for chaining.\n\n \"\...
[ { "param": "self", "type": null }, { "param": "max_length", "type": null }, { "param": "ret_indices", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "max_length", "type": null, "docstring": null, "docstring_toke...
cc110b69ca357bc9fb2a512c4f6f9cb2a472c9f8
algrs/polliwog
polliwog/polyline/polyline.py
[ "BSD-2-Clause" ]
Python
bisect_edges
<not_specific>
def bisect_edges(self, edges): """ Cutting the given edges in half. Return an arrray that gives the new indices of the original vertices. """ new_vs = self.v indices_of_original_vertices = np.arange(len(self.v)) for offset, edge_to_subdivide in enumerate(edges): ...
Cutting the given edges in half. Return an arrray that gives the new indices of the original vertices.
Cutting the given edges in half. Return an arrray that gives the new indices of the original vertices.
[ "Cutting", "the", "given", "edges", "in", "half", ".", "Return", "an", "arrray", "that", "gives", "the", "new", "indices", "of", "the", "original", "vertices", "." ]
def bisect_edges(self, edges): new_vs = self.v indices_of_original_vertices = np.arange(len(self.v)) for offset, edge_to_subdivide in enumerate(edges): new_v = np.mean(self.segments[edge_to_subdivide], axis=0).reshape(-1, 3) old_v2_index = self.e[edge_to_subdivide][0] + 1...
[ "def", "bisect_edges", "(", "self", ",", "edges", ")", ":", "new_vs", "=", "self", ".", "v", "indices_of_original_vertices", "=", "np", ".", "arange", "(", "len", "(", "self", ".", "v", ")", ")", "for", "offset", ",", "edge_to_subdivide", "in", "enumerat...
Cutting the given edges in half.
[ "Cutting", "the", "given", "edges", "in", "half", "." ]
[ "\"\"\"\n Cutting the given edges in half.\n\n Return an arrray that gives the new indices of the original vertices.\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "edges", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "edges", "type": null, "docstring": null, "docstring_tokens": ...
cc110b69ca357bc9fb2a512c4f6f9cb2a472c9f8
algrs/polliwog
polliwog/polyline/polyline.py
[ "BSD-2-Clause" ]
Python
cut_by_plane
<not_specific>
def cut_by_plane(self, plane): """ Return a new Polyline which keeps only the part that is in front of the given plane. For open polylines, the plane must intersect the polyline exactly once. For closed polylines, the plane must intersect the polylint exactly twice, lea...
Return a new Polyline which keeps only the part that is in front of the given plane. For open polylines, the plane must intersect the polyline exactly once. For closed polylines, the plane must intersect the polylint exactly twice, leaving a single contiguous segment in front....
Return a new Polyline which keeps only the part that is in front of the given plane. For open polylines, the plane must intersect the polyline exactly once. For closed polylines, the plane must intersect the polylint exactly twice, leaving a single contiguous segment in front.
[ "Return", "a", "new", "Polyline", "which", "keeps", "only", "the", "part", "that", "is", "in", "front", "of", "the", "given", "plane", ".", "For", "open", "polylines", "the", "plane", "must", "intersect", "the", "polyline", "exactly", "once", ".", "For", ...
def cut_by_plane(self, plane): from .cut_by_plane import cut_open_polyline_by_plane if self.is_closed and self.num_v > 1: signed_distances = plane.signed_distance(self.v) signs_of_verts = np.sign(signed_distances) if signs_of_verts[-1] == 1: vertices_n...
[ "def", "cut_by_plane", "(", "self", ",", "plane", ")", ":", "from", ".", "cut_by_plane", "import", "cut_open_polyline_by_plane", "if", "self", ".", "is_closed", "and", "self", ".", "num_v", ">", "1", ":", "signed_distances", "=", "plane", ".", "signed_distance...
Return a new Polyline which keeps only the part that is in front of the given plane.
[ "Return", "a", "new", "Polyline", "which", "keeps", "only", "the", "part", "that", "is", "in", "front", "of", "the", "given", "plane", "." ]
[ "\"\"\"\n Return a new Polyline which keeps only the part that is in front of the given\n plane.\n\n For open polylines, the plane must intersect the polyline exactly once.\n\n For closed polylines, the plane must intersect the polylint exactly\n twice, leaving a single contiguous...
[ { "param": "self", "type": null }, { "param": "plane", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "plane", "type": null, "docstring": null, "docstring_tokens": ...
49ddb24b9f51f7dcb4e37225668ccf232f5c86d3
algrs/polliwog
polliwog/segment/segment.py
[ "BSD-2-Clause" ]
Python
partition_segment
<not_specific>
def partition_segment(p1, p2, n_samples, endpoint=True): """ For two points in n-space, return an np.ndarray of equidistant partition points along the segment determined by p1 & p2. The total number of points returned will be n_samples. When n_samples is 2, returns the original points. When en...
For two points in n-space, return an np.ndarray of equidistant partition points along the segment determined by p1 & p2. The total number of points returned will be n_samples. When n_samples is 2, returns the original points. When endpoint is True, p2 is the last point. When false, p2 is excluded...
For two points in n-space, return an np.ndarray of equidistant partition points along the segment determined by p1 & p2. The total number of points returned will be n_samples. When n_samples is 2, returns the original points. When endpoint is True, p2 is the last point. When false, p2 is excluded. Partition order is...
[ "For", "two", "points", "in", "n", "-", "space", "return", "an", "np", ".", "ndarray", "of", "equidistant", "partition", "points", "along", "the", "segment", "determined", "by", "p1", "&", "p2", ".", "The", "total", "number", "of", "points", "returned", ...
def partition_segment(p1, p2, n_samples, endpoint=True): if not isinstance(n_samples, int): raise TypeError("partition_size should be an int.") elif n_samples < 2: raise ValueError("partition_size should be bigger than 1.") return (p2 - p1) * np.linspace(0, 1, num=n_samples, endpoint=endpoin...
[ "def", "partition_segment", "(", "p1", ",", "p2", ",", "n_samples", ",", "endpoint", "=", "True", ")", ":", "if", "not", "isinstance", "(", "n_samples", ",", "int", ")", ":", "raise", "TypeError", "(", "\"partition_size should be an int.\"", ")", "elif", "n_...
For two points in n-space, return an np.ndarray of equidistant partition points along the segment determined by p1 & p2.
[ "For", "two", "points", "in", "n", "-", "space", "return", "an", "np", ".", "ndarray", "of", "equidistant", "partition", "points", "along", "the", "segment", "determined", "by", "p1", "&", "p2", "." ]
[ "\"\"\"\n For two points in n-space, return an np.ndarray of equidistant partition\n points along the segment determined by p1 & p2.\n\n The total number of points returned will be n_samples. When n_samples is\n 2, returns the original points.\n\n When endpoint is True, p2 is the last point. When fal...
[ { "param": "p1", "type": null }, { "param": "p2", "type": null }, { "param": "n_samples", "type": null }, { "param": "endpoint", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "p1", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "p2", "type": null, "docstring": null, "docstring_tokens": [], ...
49ddb24b9f51f7dcb4e37225668ccf232f5c86d3
algrs/polliwog
polliwog/segment/segment.py
[ "BSD-2-Clause" ]
Python
partition_segment_old
<not_specific>
def partition_segment_old(p1, p2, partition_size=5): """ Deprecated. Please use partition_segment. For two points in n-space, return an np.ndarray of partition points at equal widths determined by 'partition_size' on the interior of the segment determined by p1 & p2. Accomplished by partitioning t...
Deprecated. Please use partition_segment. For two points in n-space, return an np.ndarray of partition points at equal widths determined by 'partition_size' on the interior of the segment determined by p1 & p2. Accomplished by partitioning the segment into 'partition_size' sub-intervals. Partiti...
Accomplished by partitioning the segment into 'partition_size' sub-intervals. Partition order is oriented from p1 to p2.
[ "Accomplished", "by", "partitioning", "the", "segment", "into", "'", "partition_size", "'", "sub", "-", "intervals", ".", "Partition", "order", "is", "oriented", "from", "p1", "to", "p2", "." ]
def partition_segment_old(p1, p2, partition_size=5): if not isinstance(partition_size, int): raise TypeError("partition_size should be an int.") elif partition_size < 2: raise ValueError("partition_size should be bigger than 1.") dist = np.linalg.norm(p1 - p2) unit_direction = (p2 - p1) ...
[ "def", "partition_segment_old", "(", "p1", ",", "p2", ",", "partition_size", "=", "5", ")", ":", "if", "not", "isinstance", "(", "partition_size", ",", "int", ")", ":", "raise", "TypeError", "(", "\"partition_size should be an int.\"", ")", "elif", "partition_si...
Deprecated.
[ "Deprecated", "." ]
[ "\"\"\"\n Deprecated. Please use partition_segment.\n\n For two points in n-space, return an np.ndarray of partition points at equal widths\n determined by 'partition_size' on the interior of the segment determined by p1 & p2.\n\n Accomplished by partitioning the segment into 'partition_size' sub-interv...
[ { "param": "p1", "type": null }, { "param": "p2", "type": null }, { "param": "partition_size", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "p1", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "p2", "type": null, "docstring": null, "docstring_tokens": [], ...
59ac2e7d023e13bf924414d81fd7586b96d3c981
algrs/polliwog
polliwog/tri/surface_normals.py
[ "BSD-2-Clause" ]
Python
surface_normal
<not_specific>
def surface_normal(points, normalize=True): """ Compute the surface normal of a triangle. Can provide three points or an array of points. """ p1 = points[..., 0, :] p2 = points[..., 1, :] p3 = points[..., 2, :] normal = np.cross(p2 - p1, p3 - p1) return vg.normalize(normal) if norma...
Compute the surface normal of a triangle. Can provide three points or an array of points.
Compute the surface normal of a triangle. Can provide three points or an array of points.
[ "Compute", "the", "surface", "normal", "of", "a", "triangle", ".", "Can", "provide", "three", "points", "or", "an", "array", "of", "points", "." ]
def surface_normal(points, normalize=True): p1 = points[..., 0, :] p2 = points[..., 1, :] p3 = points[..., 2, :] normal = np.cross(p2 - p1, p3 - p1) return vg.normalize(normal) if normalize else normal
[ "def", "surface_normal", "(", "points", ",", "normalize", "=", "True", ")", ":", "p1", "=", "points", "[", "...", ",", "0", ",", ":", "]", "p2", "=", "points", "[", "...", ",", "1", ",", ":", "]", "p3", "=", "points", "[", "...", ",", "2", ",...
Compute the surface normal of a triangle.
[ "Compute", "the", "surface", "normal", "of", "a", "triangle", "." ]
[ "\"\"\"\n Compute the surface normal of a triangle.\n\n Can provide three points or an array of points.\n \"\"\"" ]
[ { "param": "points", "type": null }, { "param": "normalize", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "points", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "normalize", "type": null, "docstring": null, "docstring_tok...
9f274201e78fbf2c1aa20062d6262aee112eb32c
jianggeng/tensorflow
tensorflow/python/data/experimental/ops/distribute.py
[ "Apache-2.0" ]
Python
replicate
<not_specific>
def replicate(dataset, devices): """A transformation that replicates `dataset` onto a list of devices. Args: dataset: A `tf.data.Dataset` object. devices: A list of devices to replicate the dataset on. Returns: A dictionary mapping device name to a dataset on that device. """ if not isinstance(d...
A transformation that replicates `dataset` onto a list of devices. Args: dataset: A `tf.data.Dataset` object. devices: A list of devices to replicate the dataset on. Returns: A dictionary mapping device name to a dataset on that device.
A transformation that replicates `dataset` onto a list of devices.
[ "A", "transformation", "that", "replicates", "`", "dataset", "`", "onto", "a", "list", "of", "devices", "." ]
def replicate(dataset, devices): if not isinstance(dataset, dataset_ops.DatasetV2): raise TypeError("`dataset` must be a `tf.data.Dataset` object.") dataset_device = dataset._variant_tensor.device datasets = {} if len(devices) == 1 and devices[0] == dataset_device: datasets[devices[0]] = dataset ret...
[ "def", "replicate", "(", "dataset", ",", "devices", ")", ":", "if", "not", "isinstance", "(", "dataset", ",", "dataset_ops", ".", "DatasetV2", ")", ":", "raise", "TypeError", "(", "\"`dataset` must be a `tf.data.Dataset` object.\"", ")", "dataset_device", "=", "da...
A transformation that replicates `dataset` onto a list of devices.
[ "A", "transformation", "that", "replicates", "`", "dataset", "`", "onto", "a", "list", "of", "devices", "." ]
[ "\"\"\"A transformation that replicates `dataset` onto a list of devices.\n\n Args:\n dataset: A `tf.data.Dataset` object.\n devices: A list of devices to replicate the dataset on.\n\n Returns:\n A dictionary mapping device name to a dataset on that device.\n \"\"\"", "# pylint: disable=protected-acce...
[ { "param": "dataset", "type": null }, { "param": "devices", "type": null } ]
{ "returns": [ { "docstring": "A dictionary mapping device name to a dataset on that device.", "docstring_tokens": [ "A", "dictionary", "mapping", "device", "name", "to", "a", "dataset", "on", "that", "device", ...
1651b48a4191b6c24201f9c9ca813b0770b546aa
Sciguymjm/gpytorch
gpytorch/likelihoods/multitask_gaussian_likelihood.py
[ "MIT" ]
Python
forward
<not_specific>
def forward(self, input, *params): """ Adds the task noises to the diagonal of the covariance matrix of the supplied :obj:`gpytorch.distributions.MultivariateNormal` or :obj:`gpytorch.distributions.MultitaskMultivariateNormal`, in case of `rank` == 0. Otherwise, adds a rank `rank` covari...
Adds the task noises to the diagonal of the covariance matrix of the supplied :obj:`gpytorch.distributions.MultivariateNormal` or :obj:`gpytorch.distributions.MultitaskMultivariateNormal`, in case of `rank` == 0. Otherwise, adds a rank `rank` covariance matrix to it. This scales the ta...
Adds the task noises to the diagonal of the covariance matrix of the supplied
[ "Adds", "the", "task", "noises", "to", "the", "diagonal", "of", "the", "covariance", "matrix", "of", "the", "supplied" ]
def forward(self, input, *params): mean, covar = input.mean, input.lazy_covariance_matrix batch_shape, n = covar.shape[:-2], covar.shape[-1] // self.num_tasks if len(batch_shape) > 1: raise NotImplementedError("Batch shapes with dim > 1 not yet supported for MulitTask Likelihoods") ...
[ "def", "forward", "(", "self", ",", "input", ",", "*", "params", ")", ":", "mean", ",", "covar", "=", "input", ".", "mean", ",", "input", ".", "lazy_covariance_matrix", "batch_shape", ",", "n", "=", "covar", ".", "shape", "[", ":", "-", "2", "]", "...
Adds the task noises to the diagonal of the covariance matrix of the supplied
[ "Adds", "the", "task", "noises", "to", "the", "diagonal", "of", "the", "covariance", "matrix", "of", "the", "supplied" ]
[ "\"\"\"\n Adds the task noises to the diagonal of the covariance matrix of the supplied\n :obj:`gpytorch.distributions.MultivariateNormal` or :obj:`gpytorch.distributions.MultitaskMultivariateNormal`,\n in case of `rank` == 0. Otherwise, adds a rank `rank` covariance matrix to it.\n\n Th...
[ { "param": "self", "type": null }, { "param": "input", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "input", "type": null, "docstring": null, "docstring_tokens": ...
1651b48a4191b6c24201f9c9ca813b0770b546aa
Sciguymjm/gpytorch
gpytorch/likelihoods/multitask_gaussian_likelihood.py
[ "MIT" ]
Python
forward
<not_specific>
def forward(self, input, *params): """ Adds the task noises to the diagonal of the covariance matrix of the supplied :obj:`gpytorch.distributions.MultivariateNormal` or :obj:`gpytorch.distributions.MultitaskMultivariateNormal`, in case of `rank` == 0. Otherwise, adds a rank `rank` covari...
Adds the task noises to the diagonal of the covariance matrix of the supplied :obj:`gpytorch.distributions.MultivariateNormal` or :obj:`gpytorch.distributions.MultitaskMultivariateNormal`, in case of `rank` == 0. Otherwise, adds a rank `rank` covariance matrix to it. To accomplish this...
Adds the task noises to the diagonal of the covariance matrix of the supplied
[ "Adds", "the", "task", "noises", "to", "the", "diagonal", "of", "the", "covariance", "matrix", "of", "the", "supplied" ]
def forward(self, input, *params): mean, covar = input.mean, input.lazy_covariance_matrix if self.rank == 0: task_noises = self._param_transform(self.raw_task_noises) if covar.ndimension() == 2: if settings.debug.on() and task_noises.size(0) > 1: ...
[ "def", "forward", "(", "self", ",", "input", ",", "*", "params", ")", ":", "mean", ",", "covar", "=", "input", ".", "mean", ",", "input", ".", "lazy_covariance_matrix", "if", "self", ".", "rank", "==", "0", ":", "task_noises", "=", "self", ".", "_par...
Adds the task noises to the diagonal of the covariance matrix of the supplied
[ "Adds", "the", "task", "noises", "to", "the", "diagonal", "of", "the", "covariance", "matrix", "of", "the", "supplied" ]
[ "\"\"\"\n Adds the task noises to the diagonal of the covariance matrix of the supplied\n :obj:`gpytorch.distributions.MultivariateNormal` or :obj:`gpytorch.distributions.MultitaskMultivariateNormal`,\n in case of `rank` == 0. Otherwise, adds a rank `rank` covariance matrix to it.\n\n To...
[ { "param": "self", "type": null }, { "param": "input", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "input", "type": null, "docstring": null, "docstring_tokens": ...
805570bba378dac0cae233a2bc3d79a45713b5e2
Sciguymjm/gpytorch
gpytorch/likelihoods/noise_models.py
[ "MIT" ]
Python
forward
<not_specific>
def forward(self, *params, shape=None): """In the homoskedastic case, the parameters are only used to infer the required shape. Here are the possible scenarios: - non-batched noise, non-batched input, non-MT -> noise_diag shape is `n` - non-batched noise, non-batched input, MT -> noise_d...
In the homoskedastic case, the parameters are only used to infer the required shape. Here are the possible scenarios: - non-batched noise, non-batched input, non-MT -> noise_diag shape is `n` - non-batched noise, non-batched input, MT -> noise_diag shape is `nt` - non-batched noise, batc...
In the homoskedastic case, the parameters are only used to infer the required shape.
[ "In", "the", "homoskedastic", "case", "the", "parameters", "are", "only", "used", "to", "infer", "the", "required", "shape", "." ]
def forward(self, *params, shape=None): if shape is None: p = params[0] if torch.is_tensor(params[0]) else params[0][0] shape = p.shape if len(p.shape) == 1 else p.shape[:-1] noise = self.noise batch_shape, n = shape[:-1], shape[-1] noise_batch_shape = noise.shape...
[ "def", "forward", "(", "self", ",", "*", "params", ",", "shape", "=", "None", ")", ":", "if", "shape", "is", "None", ":", "p", "=", "params", "[", "0", "]", "if", "torch", ".", "is_tensor", "(", "params", "[", "0", "]", ")", "else", "params", "...
In the homoskedastic case, the parameters are only used to infer the required shape.
[ "In", "the", "homoskedastic", "case", "the", "parameters", "are", "only", "used", "to", "infer", "the", "required", "shape", "." ]
[ "\"\"\"In the homoskedastic case, the parameters are only used to infer the required shape.\n Here are the possible scenarios:\n - non-batched noise, non-batched input, non-MT -> noise_diag shape is `n`\n - non-batched noise, non-batched input, MT -> noise_diag shape is `nt`\n - non-batc...
[ { "param": "self", "type": null }, { "param": "shape", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "shape", "type": null, "docstring": null, "docstring_tokens": ...
b9b0f52fa2e2894d441844055dfbcb317e3fe2f3
veeresht/filterpy
filterpy/kalman/tests/test_kf.py
[ "MIT" ]
Python
const_vel_filter
<not_specific>
def const_vel_filter(dt, x0=0, x_ndim=1, P_diag=(1., 1.), R_std=1., Q_var=0.0001): """ helper, constructs 1d, constant velocity filter""" f = KalmanFilter (dim_x=2, dim_z=1) if x_ndim == 1: f.x = np.array([x0, 0]) else: f.x = np.array([[x0, 0]]).T f.F = np.array([[1., dt], ...
helper, constructs 1d, constant velocity filter
helper, constructs 1d, constant velocity filter
[ "helper", "constructs", "1d", "constant", "velocity", "filter" ]
def const_vel_filter(dt, x0=0, x_ndim=1, P_diag=(1., 1.), R_std=1., Q_var=0.0001): f = KalmanFilter (dim_x=2, dim_z=1) if x_ndim == 1: f.x = np.array([x0, 0]) else: f.x = np.array([[x0, 0]]).T f.F = np.array([[1., dt], [0., 1.]]) f.H = np.array([[1.,0.]]) f.P ...
[ "def", "const_vel_filter", "(", "dt", ",", "x0", "=", "0", ",", "x_ndim", "=", "1", ",", "P_diag", "=", "(", "1.", ",", "1.", ")", ",", "R_std", "=", "1.", ",", "Q_var", "=", "0.0001", ")", ":", "f", "=", "KalmanFilter", "(", "dim_x", "=", "2",...
helper, constructs 1d, constant velocity filter
[ "helper", "constructs", "1d", "constant", "velocity", "filter" ]
[ "\"\"\" helper, constructs 1d, constant velocity filter\"\"\"" ]
[ { "param": "dt", "type": null }, { "param": "x0", "type": null }, { "param": "x_ndim", "type": null }, { "param": "P_diag", "type": null }, { "param": "R_std", "type": null }, { "param": "Q_var", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "dt", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "x0", "type": null, "docstring": null, "docstring_tokens": [], ...
b9b0f52fa2e2894d441844055dfbcb317e3fe2f3
veeresht/filterpy
filterpy/kalman/tests/test_kf.py
[ "MIT" ]
Python
const_vel_filter_2d
<not_specific>
def const_vel_filter_2d(dt, x_ndim=1, P_diag=(1., 1, 1, 1), R_std=1., Q_var=0.0001): """ helper, constructs 1d, constant velocity filter""" kf = KalmanFilter (dim_x=4, dim_z=2) kf.x = np.array([[0., 0.0, 0., 0.]]).T kf.P *= np.diag(P_diag) kf.F = np.array([[1, dt, 0, 0], [0, ...
helper, constructs 1d, constant velocity filter
helper, constructs 1d, constant velocity filter
[ "helper", "constructs", "1d", "constant", "velocity", "filter" ]
def const_vel_filter_2d(dt, x_ndim=1, P_diag=(1., 1, 1, 1), R_std=1., Q_var=0.0001): kf = KalmanFilter (dim_x=4, dim_z=2) kf.x = np.array([[0., 0.0, 0., 0.]]).T kf.P *= np.diag(P_diag) kf.F = np.array([[1, dt, 0, 0], [0, 1, 0, 0], [0, 0, 1, dt], ...
[ "def", "const_vel_filter_2d", "(", "dt", ",", "x_ndim", "=", "1", ",", "P_diag", "=", "(", "1.", ",", "1", ",", "1", ",", "1", ")", ",", "R_std", "=", "1.", ",", "Q_var", "=", "0.0001", ")", ":", "kf", "=", "KalmanFilter", "(", "dim_x", "=", "4...
helper, constructs 1d, constant velocity filter
[ "helper", "constructs", "1d", "constant", "velocity", "filter" ]
[ "\"\"\" helper, constructs 1d, constant velocity filter\"\"\"" ]
[ { "param": "dt", "type": null }, { "param": "x_ndim", "type": null }, { "param": "P_diag", "type": null }, { "param": "R_std", "type": null }, { "param": "Q_var", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "dt", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "x_ndim", "type": null, "docstring": null, "docstring_tokens": [...
b9b0f52fa2e2894d441844055dfbcb317e3fe2f3
veeresht/filterpy
filterpy/kalman/tests/test_kf.py
[ "MIT" ]
Python
proc_form
null
def proc_form(): """ This is for me to run against the class_form() function to see which, if either, runs faster. They within a few ms of each other on my machine with Python 3.5.1""" dt = 1. std_z = 10.1 x = np.array([[0.], [0.]]) F = np.array([[1., dt], [0., 1.]]) H = np.array([[1.,...
This is for me to run against the class_form() function to see which, if either, runs faster. They within a few ms of each other on my machine with Python 3.5.1
This is for me to run against the class_form() function to see which, if either, runs faster. They within a few ms of each other on my machine with Python 3.5.1
[ "This", "is", "for", "me", "to", "run", "against", "the", "class_form", "()", "function", "to", "see", "which", "if", "either", "runs", "faster", ".", "They", "within", "a", "few", "ms", "of", "each", "other", "on", "my", "machine", "with", "Python", "...
def proc_form(): dt = 1. std_z = 10.1 x = np.array([[0.], [0.]]) F = np.array([[1., dt], [0., 1.]]) H = np.array([[1.,0.]]) P = np.eye(2) R = np.eye(1)*std_z**2 Q = Q_discrete_white_noise(2, dt, 5.1) pos = 0. for t in range (2000): z = pos + random.randn() * std_z ...
[ "def", "proc_form", "(", ")", ":", "dt", "=", "1.", "std_z", "=", "10.1", "x", "=", "np", ".", "array", "(", "[", "[", "0.", "]", ",", "[", "0.", "]", "]", ")", "F", "=", "np", ".", "array", "(", "[", "[", "1.", ",", "dt", "]", ",", "["...
This is for me to run against the class_form() function to see which, if either, runs faster.
[ "This", "is", "for", "me", "to", "run", "against", "the", "class_form", "()", "function", "to", "see", "which", "if", "either", "runs", "faster", "." ]
[ "\"\"\" This is for me to run against the class_form() function to see which,\n if either, runs faster. They within a few ms of each other on my machine\n with Python 3.5.1\"\"\"", "# perform kalman filtering" ]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
2159eb3faf8270f9731fde5a1584dff714d5b378
veeresht/filterpy
filterpy/stats/stats.py
[ "MIT" ]
Python
_to_cov
<not_specific>
def _to_cov(x,n): """ If x is a scalar, returns a covariance matrix generated from it as the identity matrix multiplied by x. The dimension will be nxn. If x is already a numpy array then it is returned unchanged. """ try: x.shape if type(x) != np.ndarray: x = np.asarray(...
If x is a scalar, returns a covariance matrix generated from it as the identity matrix multiplied by x. The dimension will be nxn. If x is already a numpy array then it is returned unchanged.
If x is a scalar, returns a covariance matrix generated from it as the identity matrix multiplied by x. The dimension will be nxn. If x is already a numpy array then it is returned unchanged.
[ "If", "x", "is", "a", "scalar", "returns", "a", "covariance", "matrix", "generated", "from", "it", "as", "the", "identity", "matrix", "multiplied", "by", "x", ".", "The", "dimension", "will", "be", "nxn", ".", "If", "x", "is", "already", "a", "numpy", ...
def _to_cov(x,n): try: x.shape if type(x) != np.ndarray: x = np.asarray(x)[0] return x except: return np.eye(n) * x
[ "def", "_to_cov", "(", "x", ",", "n", ")", ":", "try", ":", "x", ".", "shape", "if", "type", "(", "x", ")", "!=", "np", ".", "ndarray", ":", "x", "=", "np", ".", "asarray", "(", "x", ")", "[", "0", "]", "return", "x", "except", ":", "return...
If x is a scalar, returns a covariance matrix generated from it as the identity matrix multiplied by x.
[ "If", "x", "is", "a", "scalar", "returns", "a", "covariance", "matrix", "generated", "from", "it", "as", "the", "identity", "matrix", "multiplied", "by", "x", "." ]
[ "\"\"\" If x is a scalar, returns a covariance matrix generated from it\n as the identity matrix multiplied by x. The dimension will be nxn.\n If x is already a numpy array then it is returned unchanged.\n \"\"\"" ]
[ { "param": "x", "type": null }, { "param": "n", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "x", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "n", "type": null, "docstring": null, "docstring_tokens": [], ...
e648afd76924d0807b9a51f78dd430b1e5da5480
veeresht/filterpy
filterpy/kalman/tests/test_ekf.py
[ "MIT" ]
Python
H_of
<not_specific>
def H_of(x): """ compute Jacobian of H matrix for state x """ horiz_dist = x[0] altitude = x[2] denom = sqrt(horiz_dist**2 + altitude**2) # dh_ddist = horiz_dist/denom # dh_dvel = 0 # dh_dalt = altitude/denom return array ([[horiz_dist/denom, 0., altitude/denom]])
compute Jacobian of H matrix for state x
compute Jacobian of H matrix for state x
[ "compute", "Jacobian", "of", "H", "matrix", "for", "state", "x" ]
def H_of(x): horiz_dist = x[0] altitude = x[2] denom = sqrt(horiz_dist**2 + altitude**2) return array ([[horiz_dist/denom, 0., altitude/denom]])
[ "def", "H_of", "(", "x", ")", ":", "horiz_dist", "=", "x", "[", "0", "]", "altitude", "=", "x", "[", "2", "]", "denom", "=", "sqrt", "(", "horiz_dist", "**", "2", "+", "altitude", "**", "2", ")", "return", "array", "(", "[", "[", "horiz_dist", ...
compute Jacobian of H matrix for state x
[ "compute", "Jacobian", "of", "H", "matrix", "for", "state", "x" ]
[ "\"\"\" compute Jacobian of H matrix for state x \"\"\"", "# dh_ddist = horiz_dist/denom", "# dh_dvel = 0", "# dh_dalt = altitude/denom" ]
[ { "param": "x", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "x", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
c02e6225229f8e45b27401357f1d7c146783de5a
jungerm2/pyRANSAC-3D
pyransac3d/aux_functions.py
[ "Apache-2.0" ]
Python
rodrigues_rot
<not_specific>
def rodrigues_rot(P, n0, n1): """ Rotate a set of point between two normal vectors using Rodrigues' formula. :param P: Set of points `np.array (N,3)`. :param n0: Orign vector `np.array (1,3)`. :param n1: Destiny vector `np.array (1,3)`. :returns: Set of points P, but rotated `np.array (N, 3)` ...
Rotate a set of point between two normal vectors using Rodrigues' formula. :param P: Set of points `np.array (N,3)`. :param n0: Orign vector `np.array (1,3)`. :param n1: Destiny vector `np.array (1,3)`. :returns: Set of points P, but rotated `np.array (N, 3)` ---
Rotate a set of point between two normal vectors using Rodrigues' formula.
[ "Rotate", "a", "set", "of", "point", "between", "two", "normal", "vectors", "using", "Rodrigues", "'", "formula", "." ]
def rodrigues_rot(P, n0, n1): P = np.asarray(P) if P.ndim == 1: P = P[np.newaxis, :] n0 = n0 / np.linalg.norm(n0) n1 = n1 / np.linalg.norm(n1) k = np.cross(n0, n1) P_rot = np.zeros((len(P), 3)) if np.linalg.norm(k) != 0: k = k / np.linalg.norm(k) theta = np.arccos(np....
[ "def", "rodrigues_rot", "(", "P", ",", "n0", ",", "n1", ")", ":", "P", "=", "np", ".", "asarray", "(", "P", ")", "if", "P", ".", "ndim", "==", "1", ":", "P", "=", "P", "[", "np", ".", "newaxis", ",", ":", "]", "n0", "=", "n0", "/", "np", ...
Rotate a set of point between two normal vectors using Rodrigues' formula.
[ "Rotate", "a", "set", "of", "point", "between", "two", "normal", "vectors", "using", "Rodrigues", "'", "formula", "." ]
[ "\"\"\"\n Rotate a set of point between two normal vectors using Rodrigues' formula.\n\n :param P: Set of points `np.array (N,3)`.\n :param n0: Orign vector `np.array (1,3)`.\n :param n1: Destiny vector `np.array (1,3)`.\n\n :returns: Set of points P, but rotated `np.array (N, 3)`\n\n ---\n \"\...
[ { "param": "P", "type": null }, { "param": "n0", "type": null }, { "param": "n1", "type": null } ]
{ "returns": [ { "docstring": "Set of points P, but rotated `np.array (N, 3)`", "docstring_tokens": [ "Set", "of", "points", "P", "but", "rotated", "`", "np", ".", "array", "(", "N", "3", ")...
d7c8b66ec070c1b101ab6d66ccba68d96b15ed52
madhavarshney/keepalive-service
keepalive/keepalive.py
[ "MIT" ]
Python
check_service
None
async def check_service( config: Config, service: Service, state: State, session: aiohttp.ClientSession ) -> None: """ Check a service and send notifications. """ logger.debug(f"Checking service {service['name']}...") try: healthy, output = await get_service_health(service, session) ...
Check a service and send notifications.
Check a service and send notifications.
[ "Check", "a", "service", "and", "send", "notifications", "." ]
async def check_service( config: Config, service: Service, state: State, session: aiohttp.ClientSession ) -> None: logger.debug(f"Checking service {service['name']}...") try: healthy, output = await get_service_health(service, session) prev_healthy = state[service["name"]] if not hea...
[ "async", "def", "check_service", "(", "config", ":", "Config", ",", "service", ":", "Service", ",", "state", ":", "State", ",", "session", ":", "aiohttp", ".", "ClientSession", ")", "->", "None", ":", "logger", ".", "debug", "(", "f\"Checking service {servic...
Check a service and send notifications.
[ "Check", "a", "service", "and", "send", "notifications", "." ]
[ "\"\"\"\n Check a service and send notifications.\n \"\"\"" ]
[ { "param": "config", "type": "Config" }, { "param": "service", "type": "Service" }, { "param": "state", "type": "State" }, { "param": "session", "type": "aiohttp.ClientSession" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "config", "type": "Config", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "service", "type": "Service", "docstring": null, "docstr...
d7c8b66ec070c1b101ab6d66ccba68d96b15ed52
madhavarshney/keepalive-service
keepalive/keepalive.py
[ "MIT" ]
Python
start
None
async def start() -> None: """ Start the keepalive service - loads the config and starts monitoring. """ config = load_config() state: State = defaultdict(lambda: True) logger.info( f"Keepalive service started - monitoring {len(config['services'])} services" ) async with aiohtt...
Start the keepalive service - loads the config and starts monitoring.
Start the keepalive service - loads the config and starts monitoring.
[ "Start", "the", "keepalive", "service", "-", "loads", "the", "config", "and", "starts", "monitoring", "." ]
async def start() -> None: config = load_config() state: State = defaultdict(lambda: True) logger.info( f"Keepalive service started - monitoring {len(config['services'])} services" ) async with aiohttp.ClientSession() as session: await asyncio.gather( *(watch(config, serv...
[ "async", "def", "start", "(", ")", "->", "None", ":", "config", "=", "load_config", "(", ")", "state", ":", "State", "=", "defaultdict", "(", "lambda", ":", "True", ")", "logger", ".", "info", "(", "f\"Keepalive service started - monitoring {len(config['services...
Start the keepalive service - loads the config and starts monitoring.
[ "Start", "the", "keepalive", "service", "-", "loads", "the", "config", "and", "starts", "monitoring", "." ]
[ "\"\"\"\n Start the keepalive service - loads the config and starts monitoring.\n \"\"\"" ]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
934496826d3b5016e2566aa8cb4d2f49b554e4ac
madhavarshney/keepalive-service
keepalive/discord_notifications.py
[ "MIT" ]
Python
send_discord_message
None
async def send_discord_message( config: Config, session: aiohttp.ClientSession, content: str ) -> None: """ Send a discord message through the configured webhook URL. """ await session.post( config["discord_webhook_url"], json={ "content": content, }, rais...
Send a discord message through the configured webhook URL.
Send a discord message through the configured webhook URL.
[ "Send", "a", "discord", "message", "through", "the", "configured", "webhook", "URL", "." ]
async def send_discord_message( config: Config, session: aiohttp.ClientSession, content: str ) -> None: await session.post( config["discord_webhook_url"], json={ "content": content, }, raise_for_status=True, )
[ "async", "def", "send_discord_message", "(", "config", ":", "Config", ",", "session", ":", "aiohttp", ".", "ClientSession", ",", "content", ":", "str", ")", "->", "None", ":", "await", "session", ".", "post", "(", "config", "[", "\"discord_webhook_url\"", "]...
Send a discord message through the configured webhook URL.
[ "Send", "a", "discord", "message", "through", "the", "configured", "webhook", "URL", "." ]
[ "\"\"\"\n Send a discord message through the configured webhook URL.\n \"\"\"" ]
[ { "param": "config", "type": "Config" }, { "param": "session", "type": "aiohttp.ClientSession" }, { "param": "content", "type": "str" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "config", "type": "Config", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "session", "type": "aiohttp.ClientSession", "docstring": null,...
934496826d3b5016e2566aa8cb4d2f49b554e4ac
madhavarshney/keepalive-service
keepalive/discord_notifications.py
[ "MIT" ]
Python
on_service_healthy
None
async def on_service_healthy( config: Config, service: Service, session: aiohttp.ClientSession ) -> None: """ Notify discord webhook when a service is healthy. """ await send_discord_message( config, session, textwrap.dedent( f""" :salad: **__{service[...
Notify discord webhook when a service is healthy.
Notify discord webhook when a service is healthy.
[ "Notify", "discord", "webhook", "when", "a", "service", "is", "healthy", "." ]
async def on_service_healthy( config: Config, service: Service, session: aiohttp.ClientSession ) -> None: await send_discord_message( config, session, textwrap.dedent( f""" :salad: **__{service['name']}__** :salad: Service looks healthy! {s...
[ "async", "def", "on_service_healthy", "(", "config", ":", "Config", ",", "service", ":", "Service", ",", "session", ":", "aiohttp", ".", "ClientSession", ")", "->", "None", ":", "await", "send_discord_message", "(", "config", ",", "session", ",", "textwrap", ...
Notify discord webhook when a service is healthy.
[ "Notify", "discord", "webhook", "when", "a", "service", "is", "healthy", "." ]
[ "\"\"\"\n Notify discord webhook when a service is healthy.\n \"\"\"" ]
[ { "param": "config", "type": "Config" }, { "param": "service", "type": "Service" }, { "param": "session", "type": "aiohttp.ClientSession" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "config", "type": "Config", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "service", "type": "Service", "docstring": null, "docstr...
934496826d3b5016e2566aa8cb4d2f49b554e4ac
madhavarshney/keepalive-service
keepalive/discord_notifications.py
[ "MIT" ]
Python
on_service_error
None
async def on_service_error( config: Config, service: Service, session: aiohttp.ClientSession, output: str ) -> None: """ Notify discord webhook when there is an error in a service. """ await send_discord_message( config, session, textwrap.dedent( f""" ...
Notify discord webhook when there is an error in a service.
Notify discord webhook when there is an error in a service.
[ "Notify", "discord", "webhook", "when", "there", "is", "an", "error", "in", "a", "service", "." ]
async def on_service_error( config: Config, service: Service, session: aiohttp.ClientSession, output: str ) -> None: await send_discord_message( config, session, textwrap.dedent( f""" :no_entry_sign: **__{service['name']}__** :no_entry_sign: Something ...
[ "async", "def", "on_service_error", "(", "config", ":", "Config", ",", "service", ":", "Service", ",", "session", ":", "aiohttp", ".", "ClientSession", ",", "output", ":", "str", ")", "->", "None", ":", "await", "send_discord_message", "(", "config", ",", ...
Notify discord webhook when there is an error in a service.
[ "Notify", "discord", "webhook", "when", "there", "is", "an", "error", "in", "a", "service", "." ]
[ "\"\"\"\n Notify discord webhook when there is an error in a service.\n \"\"\"" ]
[ { "param": "config", "type": "Config" }, { "param": "service", "type": "Service" }, { "param": "session", "type": "aiohttp.ClientSession" }, { "param": "output", "type": "str" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "config", "type": "Config", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "service", "type": "Service", "docstring": null, "docstr...
1422d04172a7ce2e7f4cf0232c405b4588675aa4
amitkml/EPAI3-AdvancedPythonSequence
test_session10.py
[ "Apache-2.0" ]
Python
validate_polygon_class
null
def validate_polygon_class(): """ This function will have test case to validate polygon class Returns ------- assert error or success. """ polygon_vertices = 10 circumradius = 20 polygon_vertices_big = 15 custom_polygon = Polygon(polygon_vertices, ...
This function will have test case to validate polygon class Returns ------- assert error or success.
This function will have test case to validate polygon class Returns assert error or success.
[ "This", "function", "will", "have", "test", "case", "to", "validate", "polygon", "class", "Returns", "assert", "error", "or", "success", "." ]
def validate_polygon_class(): polygon_vertices = 10 circumradius = 20 polygon_vertices_big = 15 custom_polygon = Polygon(polygon_vertices, circumradius) custom_polygon_2nd = Polygon(polygon_vertices, circumradius) custom_polygon_big = Pol...
[ "def", "validate_polygon_class", "(", ")", ":", "polygon_vertices", "=", "10", "circumradius", "=", "20", "polygon_vertices_big", "=", "15", "custom_polygon", "=", "Polygon", "(", "polygon_vertices", ",", "circumradius", ")", "custom_polygon_2nd", "=", "Polygon", "(...
This function will have test case to validate polygon class Returns
[ "This", "function", "will", "have", "test", "case", "to", "validate", "polygon", "class", "Returns" ]
[ "\"\"\"\n This function will have test case to validate polygon class\n\n Returns\n -------\n assert error or success.\n\n \"\"\"", "## test case to validate it returns proper value" ]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
1422d04172a7ce2e7f4cf0232c405b4588675aa4
amitkml/EPAI3-AdvancedPythonSequence
test_session10.py
[ "Apache-2.0" ]
Python
validate_polygon_seq
null
def validate_polygon_seq(): """ This function will have test case to validate polygon class Returns ------- assert error or success. """ polygon_vertices = [10,50,30,40,20] polygon_vertices_25 = [k for k in range(1,26)] circumradius = 30 polygonsequencecustom = PolygonSequ...
This function will have test case to validate polygon class Returns ------- assert error or success.
This function will have test case to validate polygon class Returns assert error or success.
[ "This", "function", "will", "have", "test", "case", "to", "validate", "polygon", "class", "Returns", "assert", "error", "or", "success", "." ]
def validate_polygon_seq(): polygon_vertices = [10,50,30,40,20] polygon_vertices_25 = [k for k in range(1,26)] circumradius = 30 polygonsequencecustom = PolygonSequence() polygon_vertices_25Custom = PolygonSequence(polygon_vertices_25, circumradius) ...
[ "def", "validate_polygon_seq", "(", ")", ":", "polygon_vertices", "=", "[", "10", ",", "50", ",", "30", ",", "40", ",", "20", "]", "polygon_vertices_25", "=", "[", "k", "for", "k", "in", "range", "(", "1", ",", "26", ")", "]", "circumradius", "=", ...
This function will have test case to validate polygon class Returns
[ "This", "function", "will", "have", "test", "case", "to", "validate", "polygon", "class", "Returns" ]
[ "\"\"\"\n This function will have test case to validate polygon class\n\n Returns\n -------\n assert error or success.\n\n \"\"\"", "## test case to validate it returns proper value", "#print(polygon_vertices_25Custom.__getitem__(\"max_efficiency_list\"))" ]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
c40dbf456eeec4e62db7c3c8c2a325c59abe330f
dumpmemory/state-spaces
src/models/hippo/hippo.py
[ "Apache-2.0" ]
Python
transition
<not_specific>
def transition(measure, N, **measure_args): """ A, B transition matrices for different measures measure: the type of measure legt - Legendre (translated) legs - Legendre (scaled) glagt - generalized Laguerre (translated) lagt, tlagt - previous versions of (tilted) Laguerre with slightly...
A, B transition matrices for different measures measure: the type of measure legt - Legendre (translated) legs - Legendre (scaled) glagt - generalized Laguerre (translated) lagt, tlagt - previous versions of (tilted) Laguerre with slightly different normalization
A, B transition matrices for different measures measure: the type of measure legt - Legendre (translated) legs - Legendre (scaled) glagt - generalized Laguerre (translated) lagt, tlagt - previous versions of (tilted) Laguerre with slightly different normalization
[ "A", "B", "transition", "matrices", "for", "different", "measures", "measure", ":", "the", "type", "of", "measure", "legt", "-", "Legendre", "(", "translated", ")", "legs", "-", "Legendre", "(", "scaled", ")", "glagt", "-", "generalized", "Laguerre", "(", ...
def transition(measure, N, **measure_args): if measure == 'lagt': b = measure_args.get('beta', 1.0) A = np.eye(N) / 2 - np.tril(np.ones((N, N))) B = b * np.ones((N, 1)) elif measure == 'tlagt': b = measure_args.get('beta', 1.0) A = (1.-b)/2 * np.eye(N) - np.tril(np.ones((...
[ "def", "transition", "(", "measure", ",", "N", ",", "**", "measure_args", ")", ":", "if", "measure", "==", "'lagt'", ":", "b", "=", "measure_args", ".", "get", "(", "'beta'", ",", "1.0", ")", "A", "=", "np", ".", "eye", "(", "N", ")", "/", "2", ...
A, B transition matrices for different measures measure: the type of measure legt - Legendre (translated) legs - Legendre (scaled) glagt - generalized Laguerre (translated) lagt, tlagt - previous versions of (tilted) Laguerre with slightly different normalization
[ "A", "B", "transition", "matrices", "for", "different", "measures", "measure", ":", "the", "type", "of", "measure", "legt", "-", "Legendre", "(", "translated", ")", "legs", "-", "Legendre", "(", "scaled", ")", "glagt", "-", "generalized", "Laguerre", "(", ...
[ "\"\"\" A, B transition matrices for different measures\n\n measure: the type of measure\n legt - Legendre (translated)\n legs - Legendre (scaled)\n glagt - generalized Laguerre (translated)\n lagt, tlagt - previous versions of (tilted) Laguerre with slightly different normalization\n \"\"...
[ { "param": "measure", "type": null }, { "param": "N", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "measure", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "N", "type": null, "docstring": null, "docstring_tokens": [...
c40dbf456eeec4e62db7c3c8c2a325c59abe330f
dumpmemory/state-spaces
src/models/hippo/hippo.py
[ "Apache-2.0" ]
Python
initial_C
<not_specific>
def initial_C(measure, N, dtype=torch.float): """ Return C that captures the other endpoint in the HiPPO approximation """ if measure == 'legt': C = (torch.arange(N, dtype=dtype)*2+1)**.5 * (-1)**torch.arange(N) elif measure == 'fourier': C = torch.ones(N, dtype=dtype) # (N) else: ...
Return C that captures the other endpoint in the HiPPO approximation
Return C that captures the other endpoint in the HiPPO approximation
[ "Return", "C", "that", "captures", "the", "other", "endpoint", "in", "the", "HiPPO", "approximation" ]
def initial_C(measure, N, dtype=torch.float): if measure == 'legt': C = (torch.arange(N, dtype=dtype)*2+1)**.5 * (-1)**torch.arange(N) elif measure == 'fourier': C = torch.ones(N, dtype=dtype) else: C = torch.zeros(N, dtype=dtype) return C
[ "def", "initial_C", "(", "measure", ",", "N", ",", "dtype", "=", "torch", ".", "float", ")", ":", "if", "measure", "==", "'legt'", ":", "C", "=", "(", "torch", ".", "arange", "(", "N", ",", "dtype", "=", "dtype", ")", "*", "2", "+", "1", ")", ...
Return C that captures the other endpoint in the HiPPO approximation
[ "Return", "C", "that", "captures", "the", "other", "endpoint", "in", "the", "HiPPO", "approximation" ]
[ "\"\"\" Return C that captures the other endpoint in the HiPPO approximation \"\"\"", "# (N)", "# (N)" ]
[ { "param": "measure", "type": null }, { "param": "N", "type": null }, { "param": "dtype", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "measure", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "N", "type": null, "docstring": null, "docstring_tokens": [...
dde63bf76ffdad81cdcc5de897a0c25b53cd54f0
p1gm1/powerplant
powerplant/users/ml/data_prep/data_utils.py
[ "MIT" ]
Python
show_head_csv
null
def show_head_csv(self, df): """Show the first five rows of a dataframe. """ print(f"The dataframe size is : {df.shape}") print(df.head(5))
Show the first five rows of a dataframe.
Show the first five rows of a dataframe.
[ "Show", "the", "first", "five", "rows", "of", "a", "dataframe", "." ]
def show_head_csv(self, df): print(f"The dataframe size is : {df.shape}") print(df.head(5))
[ "def", "show_head_csv", "(", "self", ",", "df", ")", ":", "print", "(", "f\"The dataframe size is : {df.shape}\"", ")", "print", "(", "df", ".", "head", "(", "5", ")", ")" ]
Show the first five rows of a dataframe.
[ "Show", "the", "first", "five", "rows", "of", "a", "dataframe", "." ]
[ "\"\"\"Show the first five rows\n of a dataframe.\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "df", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "df", "type": null, "docstring": null, "docstring_tokens": [],...
dde63bf76ffdad81cdcc5de897a0c25b53cd54f0
p1gm1/powerplant
powerplant/users/ml/data_prep/data_utils.py
[ "MIT" ]
Python
missing_data_analisis
null
def missing_data_analisis(self, df): """Analisis of missing data if any""" df_na = (df.isnull().sum() / len(df)) * 100 df_na = df_na.drop(df_na[df_na == 0].index).sort_values(ascending=False)[:30] missing_data = pd.DataFrame({'Missing Ratio' :df_na}) print(missing_data.head(20))
Analisis of missing data if any
Analisis of missing data if any
[ "Analisis", "of", "missing", "data", "if", "any" ]
def missing_data_analisis(self, df): df_na = (df.isnull().sum() / len(df)) * 100 df_na = df_na.drop(df_na[df_na == 0].index).sort_values(ascending=False)[:30] missing_data = pd.DataFrame({'Missing Ratio' :df_na}) print(missing_data.head(20))
[ "def", "missing_data_analisis", "(", "self", ",", "df", ")", ":", "df_na", "=", "(", "df", ".", "isnull", "(", ")", ".", "sum", "(", ")", "/", "len", "(", "df", ")", ")", "*", "100", "df_na", "=", "df_na", ".", "drop", "(", "df_na", "[", "df_na...
Analisis of missing data if any
[ "Analisis", "of", "missing", "data", "if", "any" ]
[ "\"\"\"Analisis of missing data if any\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "df", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "df", "type": null, "docstring": null, "docstring_tokens": [],...
dde63bf76ffdad81cdcc5de897a0c25b53cd54f0
p1gm1/powerplant
powerplant/users/ml/data_prep/data_utils.py
[ "MIT" ]
Python
data_correlation
null
def data_correlation(self, df): """Plot in a heatmap the data correlation""" corrmat = df.corr() plt.subplots(figsize=(12,9)) sns.heatmap(corrmat, vmax=0.9, square=True) plt.show()
Plot in a heatmap the data correlation
Plot in a heatmap the data correlation
[ "Plot", "in", "a", "heatmap", "the", "data", "correlation" ]
def data_correlation(self, df): corrmat = df.corr() plt.subplots(figsize=(12,9)) sns.heatmap(corrmat, vmax=0.9, square=True) plt.show()
[ "def", "data_correlation", "(", "self", ",", "df", ")", ":", "corrmat", "=", "df", ".", "corr", "(", ")", "plt", ".", "subplots", "(", "figsize", "=", "(", "12", ",", "9", ")", ")", "sns", ".", "heatmap", "(", "corrmat", ",", "vmax", "=", "0.9", ...
Plot in a heatmap the data correlation
[ "Plot", "in", "a", "heatmap", "the", "data", "correlation" ]
[ "\"\"\"Plot in a heatmap the data correlation\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "df", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "df", "type": null, "docstring": null, "docstring_tokens": [],...
dde63bf76ffdad81cdcc5de897a0c25b53cd54f0
p1gm1/powerplant
powerplant/users/ml/data_prep/data_utils.py
[ "MIT" ]
Python
skew_features
null
def skew_features(self, df): """Check the skew of all numerical features""" skewed_feats = df.apply(lambda x: skew(x)).sort_values(ascending=False) print("\nSkew in numerical features: \n") skewness = pd.DataFrame({'Skew' :skewed_feats}) print(skewness.head(10))
Check the skew of all numerical features
Check the skew of all numerical features
[ "Check", "the", "skew", "of", "all", "numerical", "features" ]
def skew_features(self, df): skewed_feats = df.apply(lambda x: skew(x)).sort_values(ascending=False) print("\nSkew in numerical features: \n") skewness = pd.DataFrame({'Skew' :skewed_feats}) print(skewness.head(10))
[ "def", "skew_features", "(", "self", ",", "df", ")", ":", "skewed_feats", "=", "df", ".", "apply", "(", "lambda", "x", ":", "skew", "(", "x", ")", ")", ".", "sort_values", "(", "ascending", "=", "False", ")", "print", "(", "\"\\nSkew in numerical feature...
Check the skew of all numerical features
[ "Check", "the", "skew", "of", "all", "numerical", "features" ]
[ "\"\"\"Check the skew of all numerical features\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "df", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "df", "type": null, "docstring": null, "docstring_tokens": [],...
92609c9667c2d553e8770d0c6b5adc12354fa286
AoiKuiyuyou/AoikHotkey
src/aoikhotkey/util/growl.py
[ "MIT" ]
Python
hotkey_tfunc
<not_specific>
def hotkey_tfunc(hotkey_manager, hotkey, hotkey_type, hotkey_info, event): """ Hotkey trigger function that sends notification to Growl. :param hotkey_manager: Hotkey manager. :param hotkey: Hotkey's virtual key list. :param hotkey_type: Hotkey type. :param hotkey_info: Hotkey info. :pa...
Hotkey trigger function that sends notification to Growl. :param hotkey_manager: Hotkey manager. :param hotkey: Hotkey's virtual key list. :param hotkey_type: Hotkey type. :param hotkey_info: Hotkey info. :param event: Event object. :return: None.
Hotkey trigger function that sends notification to Growl.
[ "Hotkey", "trigger", "function", "that", "sends", "notification", "to", "Growl", "." ]
def hotkey_tfunc(hotkey_manager, hotkey, hotkey_type, hotkey_info, event): def task_func(): hotkey_tfunc_default( hotkey_manager, hotkey, hotkey_type, hotkey_info, event ) global _GROWL_NOTI if _GROWL_NOTI is False: return if _GROWL_NOTI is None: ...
[ "def", "hotkey_tfunc", "(", "hotkey_manager", ",", "hotkey", ",", "hotkey_type", ",", "hotkey_info", ",", "event", ")", ":", "def", "task_func", "(", ")", ":", "hotkey_tfunc_default", "(", "hotkey_manager", ",", "hotkey", ",", "hotkey_type", ",", "hotkey_info", ...
Hotkey trigger function that sends notification to Growl.
[ "Hotkey", "trigger", "function", "that", "sends", "notification", "to", "Growl", "." ]
[ "\"\"\"\n Hotkey trigger function that sends notification to Growl.\n\n :param hotkey_manager: Hotkey manager.\n\n :param hotkey: Hotkey's virtual key list.\n\n :param hotkey_type: Hotkey type.\n\n :param hotkey_info: Hotkey info.\n\n :param event: Event object.\n\n :return: None.\n \"\"\"",...
[ { "param": "hotkey_manager", "type": null }, { "param": "hotkey", "type": null }, { "param": "hotkey_type", "type": null }, { "param": "hotkey_info", "type": null }, { "param": "event", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "hotkey_manager", "type": null, "docstring": null, "docstring_tokens": [ "None" ], "default": nu...
5ac2a4b8bf2ae5a1b96501a9b1951a061fe629f7
AoiKuiyuyou/AoikHotkey
src/aoikhotkey/util/keyboard_winos.py
[ "MIT" ]
Python
_parse_hotkey
<not_specific>
def _parse_hotkey(self, pattern): """ Parse hotkey pattern to virtual key list. :param pattern: Hotkey pattern. :return: Virtual key list. """ # Parse given hotkey pattern to virtual key lists hotkey_s = hotkey_manager_get().hotkey_parse(pattern) # Use ...
Parse hotkey pattern to virtual key list. :param pattern: Hotkey pattern. :return: Virtual key list.
Parse hotkey pattern to virtual key list.
[ "Parse", "hotkey", "pattern", "to", "virtual", "key", "list", "." ]
def _parse_hotkey(self, pattern): hotkey_s = hotkey_manager_get().hotkey_parse(pattern) hotkey = hotkey_s[0] return hotkey
[ "def", "_parse_hotkey", "(", "self", ",", "pattern", ")", ":", "hotkey_s", "=", "hotkey_manager_get", "(", ")", ".", "hotkey_parse", "(", "pattern", ")", "hotkey", "=", "hotkey_s", "[", "0", "]", "return", "hotkey" ]
Parse hotkey pattern to virtual key list.
[ "Parse", "hotkey", "pattern", "to", "virtual", "key", "list", "." ]
[ "\"\"\"\n Parse hotkey pattern to virtual key list.\n\n :param pattern: Hotkey pattern.\n\n :return: Virtual key list.\n \"\"\"", "# Parse given hotkey pattern to virtual key lists", "# Use the first virtual key list", "# Return the first virtual key list" ]
[ { "param": "self", "type": null }, { "param": "pattern", "type": null } ]
{ "returns": [ { "docstring": "Virtual key list.", "docstring_tokens": [ "Virtual", "key", "list", "." ], "type": null } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_to...
5ac2a4b8bf2ae5a1b96501a9b1951a061fe629f7
AoiKuiyuyou/AoikHotkey
src/aoikhotkey/util/keyboard_winos.py
[ "MIT" ]
Python
hotkey_info_set
<not_specific>
def hotkey_info_set(self, hotkey_info): """ Set hotkey info. Will be called by hotkey manager. :param hotkey_info: Hotkey info. :return: None. """ # If backspace count is given by user if self._back_count is not None: # Do not compute automatically ...
Set hotkey info. Will be called by hotkey manager. :param hotkey_info: Hotkey info. :return: None.
Set hotkey info. Will be called by hotkey manager.
[ "Set", "hotkey", "info", ".", "Will", "be", "called", "by", "hotkey", "manager", "." ]
def hotkey_info_set(self, hotkey_info): if self._back_count is not None: return hotkey_tuple_s = hotkey_info[HOTKEY_INFO_K_HOTKEY_TUPLES] hotkey_tuple = hotkey_tuple_s[0] self._back_count = len(hotkey_tuple) - 1
[ "def", "hotkey_info_set", "(", "self", ",", "hotkey_info", ")", ":", "if", "self", ".", "_back_count", "is", "not", "None", ":", "return", "hotkey_tuple_s", "=", "hotkey_info", "[", "HOTKEY_INFO_K_HOTKEY_TUPLES", "]", "hotkey_tuple", "=", "hotkey_tuple_s", "[", ...
Set hotkey info.
[ "Set", "hotkey", "info", "." ]
[ "\"\"\"\n Set hotkey info. Will be called by hotkey manager.\n\n :param hotkey_info: Hotkey info.\n\n :return: None.\n \"\"\"", "# If backspace count is given by user", "# Do not compute automatically", "# If backspace count is not given by user.", "# Get the hotkey's virtual key...
[ { "param": "self", "type": null }, { "param": "hotkey_info", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null ...
56c12f9a67245b07c752f2fe33b2fbed0dda547c
AoiKuiyuyou/AoikHotkey
src/aoikhotkey/hotkey_spec_parser.py
[ "MIT" ]
Python
hotkey_info_set
null
def hotkey_info_set(self, hotkey_info): """ Set hotkey info. Will be called by hotkey manager. :param hotkey_info: Hotkey info. :return: None. """ # Raise error raise NotImplementedError()
Set hotkey info. Will be called by hotkey manager. :param hotkey_info: Hotkey info. :return: None.
Set hotkey info. Will be called by hotkey manager.
[ "Set", "hotkey", "info", ".", "Will", "be", "called", "by", "hotkey", "manager", "." ]
def hotkey_info_set(self, hotkey_info): raise NotImplementedError()
[ "def", "hotkey_info_set", "(", "self", ",", "hotkey_info", ")", ":", "raise", "NotImplementedError", "(", ")" ]
Set hotkey info.
[ "Set", "hotkey", "info", "." ]
[ "\"\"\"\n Set hotkey info. Will be called by hotkey manager.\n\n :param hotkey_info: Hotkey info.\n\n :return: None.\n \"\"\"", "# Raise error" ]
[ { "param": "self", "type": null }, { "param": "hotkey_info", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null ...
56c12f9a67245b07c752f2fe33b2fbed0dda547c
AoiKuiyuyou/AoikHotkey
src/aoikhotkey/hotkey_spec_parser.py
[ "MIT" ]
Python
tag_call_in_main_thread
<not_specific>
def tag_call_in_main_thread(func): """ Decorator that adds `call in main thread` tag attribute to decorated \ function. :param func: Decorated function. :return: Decorated function. """ # Set tag attribute on given function setattr(func, _TAG_CALL_IN_MAIN_THREAD, True) # Retur...
Decorator that adds `call in main thread` tag attribute to decorated \ function. :param func: Decorated function. :return: Decorated function.
Decorator that adds `call in main thread` tag attribute to decorated \ function.
[ "Decorator", "that", "adds", "`", "call", "in", "main", "thread", "`", "tag", "attribute", "to", "decorated", "\\", "function", "." ]
def tag_call_in_main_thread(func): setattr(func, _TAG_CALL_IN_MAIN_THREAD, True) return func
[ "def", "tag_call_in_main_thread", "(", "func", ")", ":", "setattr", "(", "func", ",", "_TAG_CALL_IN_MAIN_THREAD", ",", "True", ")", "return", "func" ]
Decorator that adds `call in main thread` tag attribute to decorated \ function.
[ "Decorator", "that", "adds", "`", "call", "in", "main", "thread", "`", "tag", "attribute", "to", "decorated", "\\", "function", "." ]
[ "\"\"\"\n Decorator that adds `call in main thread` tag attribute to decorated \\\n function.\n\n :param func: Decorated function.\n\n :return: Decorated function.\n \"\"\"", "# Set tag attribute on given function", "# Return given function" ]
[ { "param": "func", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "func", "type": null, "docstring": null, "docstring_tokens": [ "None" ], "default": null, ...
56c12f9a67245b07c752f2fe33b2fbed0dda547c
AoiKuiyuyou/AoikHotkey
src/aoikhotkey/hotkey_spec_parser.py
[ "MIT" ]
Python
tag_call_in_main_thread_exists
<not_specific>
def tag_call_in_main_thread_exists(func): """ Test whether given function has `call in main thread` tag. """ # Return tag attribute's value return getattr(func, _TAG_CALL_IN_MAIN_THREAD, False)
Test whether given function has `call in main thread` tag.
Test whether given function has `call in main thread` tag.
[ "Test", "whether", "given", "function", "has", "`", "call", "in", "main", "thread", "`", "tag", "." ]
def tag_call_in_main_thread_exists(func): return getattr(func, _TAG_CALL_IN_MAIN_THREAD, False)
[ "def", "tag_call_in_main_thread_exists", "(", "func", ")", ":", "return", "getattr", "(", "func", ",", "_TAG_CALL_IN_MAIN_THREAD", ",", "False", ")" ]
Test whether given function has `call in main thread` tag.
[ "Test", "whether", "given", "function", "has", "`", "call", "in", "main", "thread", "`", "tag", "." ]
[ "\"\"\"\n Test whether given function has `call in main thread` tag.\n \"\"\"", "# Return tag attribute's value" ]
[ { "param": "func", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "func", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
56c12f9a67245b07c752f2fe33b2fbed0dda547c
AoiKuiyuyou/AoikHotkey
src/aoikhotkey/hotkey_spec_parser.py
[ "MIT" ]
Python
tag_call_with_info
<not_specific>
def tag_call_with_info(func): """ Decorator that adds `call with info` tag attribute to decorated function. :param func: Decorated function. :return: Decorated function. """ # Set tag attribute on given function setattr(func, _TAG_CALL_WITH_INFO, True) # Return given function retu...
Decorator that adds `call with info` tag attribute to decorated function. :param func: Decorated function. :return: Decorated function.
Decorator that adds `call with info` tag attribute to decorated function.
[ "Decorator", "that", "adds", "`", "call", "with", "info", "`", "tag", "attribute", "to", "decorated", "function", "." ]
def tag_call_with_info(func): setattr(func, _TAG_CALL_WITH_INFO, True) return func
[ "def", "tag_call_with_info", "(", "func", ")", ":", "setattr", "(", "func", ",", "_TAG_CALL_WITH_INFO", ",", "True", ")", "return", "func" ]
Decorator that adds `call with info` tag attribute to decorated function.
[ "Decorator", "that", "adds", "`", "call", "with", "info", "`", "tag", "attribute", "to", "decorated", "function", "." ]
[ "\"\"\"\n Decorator that adds `call with info` tag attribute to decorated function.\n\n :param func: Decorated function.\n\n :return: Decorated function.\n \"\"\"", "# Set tag attribute on given function", "# Return given function" ]
[ { "param": "func", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "func", "type": null, "docstring": null, "docstring_tokens": [ "None" ], "default": null, ...
56c12f9a67245b07c752f2fe33b2fbed0dda547c
AoiKuiyuyou/AoikHotkey
src/aoikhotkey/hotkey_spec_parser.py
[ "MIT" ]
Python
tag_call_with_info_exists
<not_specific>
def tag_call_with_info_exists(func): """ Test whether given function has `call with info` tag. """ # Return tag attribute's value return getattr(func, _TAG_CALL_WITH_INFO, False)
Test whether given function has `call with info` tag.
Test whether given function has `call with info` tag.
[ "Test", "whether", "given", "function", "has", "`", "call", "with", "info", "`", "tag", "." ]
def tag_call_with_info_exists(func): return getattr(func, _TAG_CALL_WITH_INFO, False)
[ "def", "tag_call_with_info_exists", "(", "func", ")", ":", "return", "getattr", "(", "func", ",", "_TAG_CALL_WITH_INFO", ",", "False", ")" ]
Test whether given function has `call with info` tag.
[ "Test", "whether", "given", "function", "has", "`", "call", "with", "info", "`", "tag", "." ]
[ "\"\"\"\n Test whether given function has `call with info` tag.\n \"\"\"", "# Return tag attribute's value" ]
[ { "param": "func", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "func", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
56c12f9a67245b07c752f2fe33b2fbed0dda547c
AoiKuiyuyou/AoikHotkey
src/aoikhotkey/hotkey_spec_parser.py
[ "MIT" ]
Python
spec_parse
<not_specific>
def spec_parse(specs): """ Parse hotkey spec list into hotkey info list. :param specs: Hotkey spec list. :return: Hotkey info list. """ # Import here to avoid circular import. from .util.cmd import MuteNoti from .util.cmd import Noti # `Call in main thread` option _OPT_CALL_IN...
Parse hotkey spec list into hotkey info list. :param specs: Hotkey spec list. :return: Hotkey info list.
Parse hotkey spec list into hotkey info list.
[ "Parse", "hotkey", "spec", "list", "into", "hotkey", "info", "list", "." ]
def spec_parse(specs): from .util.cmd import MuteNoti from .util.cmd import Noti _OPT_CALL_IN_MAIN_THREAD = '_OPT_CALL_IN_MAIN_THREAD' _OPT_KEY_UP_HOTKEY = '_OPT_KEY_UP_HOTKEY' hotkey_info_s = [] for spec in specs: full_spec = list(spec) Get hotkey pattern hotkey_pattern...
[ "def", "spec_parse", "(", "specs", ")", ":", "from", ".", "util", ".", "cmd", "import", "MuteNoti", "from", ".", "util", ".", "cmd", "import", "Noti", "_OPT_CALL_IN_MAIN_THREAD", "=", "'_OPT_CALL_IN_MAIN_THREAD'", "_OPT_KEY_UP_HOTKEY", "=", "'_OPT_KEY_UP_HOTKEY'", ...
Parse hotkey spec list into hotkey info list.
[ "Parse", "hotkey", "spec", "list", "into", "hotkey", "info", "list", "." ]
[ "\"\"\"\n Parse hotkey spec list into hotkey info list.\n\n :param specs: Hotkey spec list.\n\n :return: Hotkey info list.\n \"\"\"", "# Import here to avoid circular import.", "# `Call in main thread` option", "# `Key-up hotkey` option", "# Hotkey info list", "# For given hotkey spec list's e...
[ { "param": "specs", "type": null } ]
{ "returns": [ { "docstring": "Hotkey info list.", "docstring_tokens": [ "Hotkey", "info", "list", "." ], "type": null } ], "raises": [], "params": [ { "identifier": "specs", "type": null, "docstring": "Hotkey spec list.", ...
7fca06098569aef45b356c52d19a75a24025dd4c
AoiKuiyuyou/AoikHotkey
src/aoikhotkey/util/mouse_winos.py
[ "MIT" ]
Python
move_cursor
null
def move_cursor(self, position): """ Move cursor to given position. :param position: Position tuple of (x, y). :return: None. """ # Get x and y coordinates x, y = position # Get old position old_pos = self.get_cursor_position() # Get x ...
Move cursor to given position. :param position: Position tuple of (x, y). :return: None.
Move cursor to given position.
[ "Move", "cursor", "to", "given", "position", "." ]
def move_cursor(self, position): x, y = position old_pos = self.get_cursor_position() x = x if (x != -1) else old_pos[0] y = y if (y != -1) else old_pos[1] self._send_mouse_event( self.MOUSEEVENTF_MOVE + self.MOUSEEVENTF_ABSOLUTE, x, y, 0, 0 )
[ "def", "move_cursor", "(", "self", ",", "position", ")", ":", "x", ",", "y", "=", "position", "old_pos", "=", "self", ".", "get_cursor_position", "(", ")", "x", "=", "x", "if", "(", "x", "!=", "-", "1", ")", "else", "old_pos", "[", "0", "]", "y",...
Move cursor to given position.
[ "Move", "cursor", "to", "given", "position", "." ]
[ "\"\"\"\n Move cursor to given position.\n\n :param position: Position tuple of (x, y).\n\n :return: None.\n \"\"\"", "# Get x and y coordinates", "# Get old position", "# Get x coordinate", "# Get y coordinate", "# Send mouse event" ]
[ { "param": "self", "type": null }, { "param": "position", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null ...
7fca06098569aef45b356c52d19a75a24025dd4c
AoiKuiyuyou/AoikHotkey
src/aoikhotkey/util/mouse_winos.py
[ "MIT" ]
Python
click_window_position
null
def click_window_position( self, position, button_name='left', pre_click_wait=0, post_click_move=False, hwnd=None, ): """ Click relative position in a window. :param position: Position tuple of (x_offset, y_offset). :param button_name...
Click relative position in a window. :param position: Position tuple of (x_offset, y_offset). :param button_name: Button name. :param post_click_move: Whether restore old cursor position after \ click. :param pre_click_wait: Pre-click wait time. :param h...
Click relative position in a window.
[ "Click", "relative", "position", "in", "a", "window", "." ]
def click_window_position( self, position, button_name='left', pre_click_wait=0, post_click_move=False, hwnd=None, ): if hwnd is None: hwnd = _GetForegroundWindow() x_left, y_top, _, _ = self.get_window_rect(hwnd) abs_x = x_left + p...
[ "def", "click_window_position", "(", "self", ",", "position", ",", "button_name", "=", "'left'", ",", "pre_click_wait", "=", "0", ",", "post_click_move", "=", "False", ",", "hwnd", "=", "None", ",", ")", ":", "if", "hwnd", "is", "None", ":", "hwnd", "=",...
Click relative position in a window.
[ "Click", "relative", "position", "in", "a", "window", "." ]
[ "\"\"\"\n Click relative position in a window.\n\n :param position: Position tuple of (x_offset, y_offset).\n\n :param button_name: Button name.\n\n :param post_click_move: Whether restore old cursor position after \\\n click.\n\n :param pre_click_wait: Pre-click wait t...
[ { "param": "self", "type": null }, { "param": "position", "type": null }, { "param": "button_name", "type": null }, { "param": "pre_click_wait", "type": null }, { "param": "post_click_move", "type": null }, { "param": "hwnd", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null ...
50728dc2e02a0fb6d2db6d412e384ce9c6abdcd0
AoiKuiyuyou/AoikHotkey
src/aoikhotkey/util/cmd.py
[ "MIT" ]
Python
Quit
null
def Quit(): """ Hotkey function that stops hotkey manager's event loop. :return: None. """ # Stop hotkey manager's event loop hotkey_manager_get().eloop_stop()
Hotkey function that stops hotkey manager's event loop. :return: None.
Hotkey function that stops hotkey manager's event loop.
[ "Hotkey", "function", "that", "stops", "hotkey", "manager", "'", "s", "event", "loop", "." ]
def Quit(): hotkey_manager_get().eloop_stop()
[ "def", "Quit", "(", ")", ":", "hotkey_manager_get", "(", ")", ".", "eloop_stop", "(", ")" ]
Hotkey function that stops hotkey manager's event loop.
[ "Hotkey", "function", "that", "stops", "hotkey", "manager", "'", "s", "event", "loop", "." ]
[ "\"\"\"\n Hotkey function that stops hotkey manager's event loop.\n\n :return: None.\n \"\"\"", "# Stop hotkey manager's event loop" ]
[]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [], "outlier_params": [], "others": [] }
50728dc2e02a0fb6d2db6d412e384ce9c6abdcd0
AoiKuiyuyou/AoikHotkey
src/aoikhotkey/util/cmd.py
[ "MIT" ]
Python
SpecReload
null
def SpecReload(): """ Hotkey function that reloads hotkey spec. :return: None. """ # Create event loop stop callback def stop_callback(): # Raise special exception to notify upper context to reload hotkey spec raise SpecReloadExc() # Get hotkey manager hotkey_manager = ...
Hotkey function that reloads hotkey spec. :return: None.
Hotkey function that reloads hotkey spec.
[ "Hotkey", "function", "that", "reloads", "hotkey", "spec", "." ]
def SpecReload(): def stop_callback(): raise SpecReloadExc() hotkey_manager = hotkey_manager_get() hotkey_manager.eloop_stop_callback_set(stop_callback) hotkey_manager.eloop_stop()
[ "def", "SpecReload", "(", ")", ":", "def", "stop_callback", "(", ")", ":", "raise", "SpecReloadExc", "(", ")", "hotkey_manager", "=", "hotkey_manager_get", "(", ")", "hotkey_manager", ".", "eloop_stop_callback_set", "(", "stop_callback", ")", "hotkey_manager", "."...
Hotkey function that reloads hotkey spec.
[ "Hotkey", "function", "that", "reloads", "hotkey", "spec", "." ]
[ "\"\"\"\n Hotkey function that reloads hotkey spec.\n\n :return: None.\n \"\"\"", "# Create event loop stop callback", "# Raise special exception to notify upper context to reload hotkey spec", "# Get hotkey manager", "# Set hotkey manager's event loop stop callback", "# Stop hotkey manager's eve...
[]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [], "outlier_params": [], "others": [] }
50728dc2e02a0fb6d2db6d412e384ce9c6abdcd0
AoiKuiyuyou/AoikHotkey
src/aoikhotkey/util/cmd.py
[ "MIT" ]
Python
SpecSwitch
<not_specific>
def SpecSwitch(spec_id): """ Create hotkey function that switches hotkey spec. :param spec_id: Hotkey spec ID or index. :return: Hotkey function. """ # Create hotkey function that switches hotkey spec func = partial(spec_switch, spec_id) # Add `call in main thread` tag func = tag_...
Create hotkey function that switches hotkey spec. :param spec_id: Hotkey spec ID or index. :return: Hotkey function.
Create hotkey function that switches hotkey spec.
[ "Create", "hotkey", "function", "that", "switches", "hotkey", "spec", "." ]
def SpecSwitch(spec_id): func = partial(spec_switch, spec_id) func = tag_call_in_main_thread(func) return func
[ "def", "SpecSwitch", "(", "spec_id", ")", ":", "func", "=", "partial", "(", "spec_switch", ",", "spec_id", ")", "func", "=", "tag_call_in_main_thread", "(", "func", ")", "return", "func" ]
Create hotkey function that switches hotkey spec.
[ "Create", "hotkey", "function", "that", "switches", "hotkey", "spec", "." ]
[ "\"\"\"\n Create hotkey function that switches hotkey spec.\n\n :param spec_id: Hotkey spec ID or index.\n\n :return: Hotkey function.\n \"\"\"", "# Create hotkey function that switches hotkey spec", "# Add `call in main thread` tag", "# Return the hotkey function" ]
[ { "param": "spec_id", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "spec_id", "type": null, "docstring": "Hotkey spec ID or index.", "docstring_tokens": [ "Hotkey", "s...
50728dc2e02a0fb6d2db6d412e384ce9c6abdcd0
AoiKuiyuyou/AoikHotkey
src/aoikhotkey/util/cmd.py
[ "MIT" ]
Python
EventPropagate
<not_specific>
def EventPropagate(): """ Hotkey function that returns True to propagate the event that triggers \ the hotkey. :return: True. """ # Return True return True
Hotkey function that returns True to propagate the event that triggers \ the hotkey. :return: True.
Hotkey function that returns True to propagate the event that triggers \ the hotkey.
[ "Hotkey", "function", "that", "returns", "True", "to", "propagate", "the", "event", "that", "triggers", "\\", "the", "hotkey", "." ]
def EventPropagate(): return True
[ "def", "EventPropagate", "(", ")", ":", "return", "True" ]
Hotkey function that returns True to propagate the event that triggers \ the hotkey.
[ "Hotkey", "function", "that", "returns", "True", "to", "propagate", "the", "event", "that", "triggers", "\\", "the", "hotkey", "." ]
[ "\"\"\"\n Hotkey function that returns True to propagate the event that triggers \\\n the hotkey.\n\n :return: True.\n \"\"\"", "# Return True" ]
[]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [], "outlier_params": [], "others": [] }
50728dc2e02a0fb6d2db6d412e384ce9c6abdcd0
AoiKuiyuyou/AoikHotkey
src/aoikhotkey/util/cmd.py
[ "MIT" ]
Python
EventStop
<not_specific>
def EventStop(): """ Hotkey function that returns False to discard the event that triggers \ the hotkey. :return: False. """ # Return False return False
Hotkey function that returns False to discard the event that triggers \ the hotkey. :return: False.
Hotkey function that returns False to discard the event that triggers \ the hotkey.
[ "Hotkey", "function", "that", "returns", "False", "to", "discard", "the", "event", "that", "triggers", "\\", "the", "hotkey", "." ]
def EventStop(): return False
[ "def", "EventStop", "(", ")", ":", "return", "False" ]
Hotkey function that returns False to discard the event that triggers \ the hotkey.
[ "Hotkey", "function", "that", "returns", "False", "to", "discard", "the", "event", "that", "triggers", "\\", "the", "hotkey", "." ]
[ "\"\"\"\n Hotkey function that returns False to discard the event that triggers \\\n the hotkey.\n\n :return: False.\n \"\"\"", "# Return False" ]
[]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [], "outlier_params": [], "others": [] }
50728dc2e02a0fb6d2db6d412e384ce9c6abdcd0
AoiKuiyuyou/AoikHotkey
src/aoikhotkey/util/cmd.py
[ "MIT" ]
Python
Sleep
<not_specific>
def Sleep(duration): """ Create hotkey function that sleeps for given duration. :param duration: Sleep duration. :return: Created function. """ # Return hotkey function that sleeps for given duration return partial(sleep, duration)
Create hotkey function that sleeps for given duration. :param duration: Sleep duration. :return: Created function.
Create hotkey function that sleeps for given duration.
[ "Create", "hotkey", "function", "that", "sleeps", "for", "given", "duration", "." ]
def Sleep(duration): return partial(sleep, duration)
[ "def", "Sleep", "(", "duration", ")", ":", "return", "partial", "(", "sleep", ",", "duration", ")" ]
Create hotkey function that sleeps for given duration.
[ "Create", "hotkey", "function", "that", "sleeps", "for", "given", "duration", "." ]
[ "\"\"\"\n Create hotkey function that sleeps for given duration.\n\n :param duration: Sleep duration.\n\n :return: Created function.\n \"\"\"", "# Return hotkey function that sleeps for given duration" ]
[ { "param": "duration", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "duration", "type": null, "docstring": null, "docstring_tokens": [ "None" ], "default": null, ...
0dca8df9b241b128d049a38086c24a57cd572544
AoiKuiyuyou/AoikHotkey
src/aoikhotkey/event_manager_macos.py
[ "MIT" ]
Python
_handle_mouse_move_wheel_event
<not_specific>
def _handle_mouse_move_wheel_event(self, event, ns_event, propagate): """ Mouse move or wheel event handler called by \ :paramref:`_tap_callback_inner`. This handler translates platform-specific event to cross-platform event object. And then calls `self.MouseMove` or `self.Mouse...
Mouse move or wheel event handler called by \ :paramref:`_tap_callback_inner`. This handler translates platform-specific event to cross-platform event object. And then calls `self.MouseMove` or `self.MouseWheel` with the cross-platform event object. :param event: CGEve...
Mouse move or wheel event handler called by \
[ "Mouse", "move", "or", "wheel", "event", "handler", "called", "by", "\\" ]
def _handle_mouse_move_wheel_event(self, event, ns_event, propagate): event_type = ns_event.type() message, message_name, handler_attr_name = \ self._MOUSE_EVENT_TYPE_TO_INFO_TUPLE[event_type] event_handler = getattr(self, handler_attr_name, None) if event_handler is not None...
[ "def", "_handle_mouse_move_wheel_event", "(", "self", ",", "event", ",", "ns_event", ",", "propagate", ")", ":", "event_type", "=", "ns_event", ".", "type", "(", ")", "message", ",", "message_name", ",", "handler_attr_name", "=", "self", ".", "_MOUSE_EVENT_TYPE_...
Mouse move or wheel event handler called by \
[ "Mouse", "move", "or", "wheel", "event", "handler", "called", "by", "\\" ]
[ "\"\"\"\n Mouse move or wheel event handler called by \\\n :paramref:`_tap_callback_inner`.\n\n This handler translates platform-specific event to cross-platform event\n object. And then calls `self.MouseMove` or `self.MouseWheel` with the\n cross-platform event object.\n\n ...
[ { "param": "self", "type": null }, { "param": "event", "type": null }, { "param": "ns_event", "type": null }, { "param": "propagate", "type": null } ]
{ "returns": [ { "docstring": "Given event object to propagate the event, or None to \\\ndiscard the event.", "docstring_tokens": [ "Given", "event", "object", "to", "propagate", "the", "event", "or", "None", "to", ...
f22a5b1104c427a69dd3be9eb9d46943e758efbd
AoiKuiyuyou/AoikHotkey
src/aoikhotkey/util/tfunc.py
[ "MIT" ]
Python
hotkey_tfunc
null
def hotkey_tfunc(hotkey_manager, hotkey, hotkey_type, hotkey_info, event): """ Hotkey trigger function that prints info to console. :param hotkey_manager: Hotkey manager. :param hotkey: Hotkey's virtual key list. :param hotkey_type: Hotkey type. :param hotkey_info: Hotkey info. :param e...
Hotkey trigger function that prints info to console. :param hotkey_manager: Hotkey manager. :param hotkey: Hotkey's virtual key list. :param hotkey_type: Hotkey type. :param hotkey_info: Hotkey info. :param event: Event object. :return: None.
Hotkey trigger function that prints info to console.
[ "Hotkey", "trigger", "function", "that", "prints", "info", "to", "console", "." ]
def hotkey_tfunc(hotkey_manager, hotkey, hotkey_type, hotkey_info, event): if hotkey_type == HOTKEY_TYPE_V_DN: up_dn_text = ' down ' elif hotkey_type == HOTKEY_TYPE_V_UP: up_dn_text = ' up ' else: up_dn_text = ' ' orig_spec = hotkey_info[HOTKEY_INFO_K_HOTKEY_ORIG_SPEC] hotkey...
[ "def", "hotkey_tfunc", "(", "hotkey_manager", ",", "hotkey", ",", "hotkey_type", ",", "hotkey_info", ",", "event", ")", ":", "if", "hotkey_type", "==", "HOTKEY_TYPE_V_DN", ":", "up_dn_text", "=", "' down '", "elif", "hotkey_type", "==", "HOTKEY_TYPE_V_UP", ":", ...
Hotkey trigger function that prints info to console.
[ "Hotkey", "trigger", "function", "that", "prints", "info", "to", "console", "." ]
[ "\"\"\"\n Hotkey trigger function that prints info to console.\n\n :param hotkey_manager: Hotkey manager.\n\n :param hotkey: Hotkey's virtual key list.\n\n :param hotkey_type: Hotkey type.\n\n :param hotkey_info: Hotkey info.\n\n :param event: Event object.\n\n :return: None.\n \"\"\"", "#...
[ { "param": "hotkey_manager", "type": null }, { "param": "hotkey", "type": null }, { "param": "hotkey_type", "type": null }, { "param": "hotkey_info", "type": null }, { "param": "event", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "hotkey_manager", "type": null, "docstring": null, "docstring_tokens": [ "None" ], "default": nu...
7f231947d84957b6258ec7930b97a756b8e0893a
AoiKuiyuyou/AoikHotkey
src/aoikhotkeydep/aoikimportutil.py
[ "MIT" ]
Python
import_module_by_code
<not_specific>
def import_module_by_code(mod_code, mod_name, sys_add=True, sys_use=True): """Create a module object by code. @param mod_code: the code that the module contains. @param mod_name: module name. @param sys_use: whether use an existing module with the same name in |sys.modules|, instead of creati...
Create a module object by code. @param mod_code: the code that the module contains. @param mod_name: module name. @param sys_use: whether use an existing module with the same name in |sys.modules|, instead of creating a new one. @param sys_add: whether add the module object to |sys.modules|....
Create a module object by code.
[ "Create", "a", "module", "object", "by", "code", "." ]
def import_module_by_code(mod_code, mod_name, sys_add=True, sys_use=True): mod_obj_old = sys.modules.get(mod_name, None) if mod_obj_old is not None and sys_use: return mod_obj_old mod_obj = imp.new_module(mod_name) 3plQeic exec_(mod_code, mod_obj.__dict__, mod_obj.__dict__) if sys_add: ...
[ "def", "import_module_by_code", "(", "mod_code", ",", "mod_name", ",", "sys_add", "=", "True", ",", "sys_use", "=", "True", ")", ":", "mod_obj_old", "=", "sys", ".", "modules", ".", "get", "(", "mod_name", ",", "None", ")", "if", "mod_obj_old", "is", "no...
Create a module object by code.
[ "Create", "a", "module", "object", "by", "code", "." ]
[ "\"\"\"Create a module object by code.\n @param mod_code: the code that the module contains.\n\n @param mod_name: module name.\n\n @param sys_use: whether use an existing module with the same name in\n |sys.modules|,\n instead of creating a new one.\n\n @param sys_add: whether add the module obje...
[ { "param": "mod_code", "type": null }, { "param": "mod_name", "type": null }, { "param": "sys_add", "type": null }, { "param": "sys_use", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "mod_code", "type": null, "docstring": "the code that the module contains.", "docstring_tokens": [ "the", "code", "that", "the", "module", "contains", "." ], "...
7f231947d84957b6258ec7930b97a756b8e0893a
AoiKuiyuyou/AoikHotkey
src/aoikhotkeydep/aoikimportutil.py
[ "MIT" ]
Python
import_module_by_name
<not_specific>
def import_module_by_name( mod_name, ns_dir=None, sys_use=True, sys_add=True, ): """Import a module by module name. @param mod_name: module name in Python namespace. @param ns_dir: load from which namespace dir. Namespace dir means the dir is considered as if it's in |sys.path|. If...
Import a module by module name. @param mod_name: module name in Python namespace. @param ns_dir: load from which namespace dir. Namespace dir means the dir is considered as if it's in |sys.path|. If |ns_dir| is specified, only load from that dir. Otherwise load from any namespace dirs in |sys.path...
Import a module by module name.
[ "Import", "a", "module", "by", "module", "name", "." ]
def import_module_by_name( mod_name, ns_dir=None, sys_use=True, sys_add=True, ): if ns_dir is None: try: mod_obj_old = sys.modules[mod_name] except KeyError: mod_obj_old = None if sys_use: if mod_obj_old is not None: return ...
[ "def", "import_module_by_name", "(", "mod_name", ",", "ns_dir", "=", "None", ",", "sys_use", "=", "True", ",", "sys_add", "=", "True", ",", ")", ":", "if", "ns_dir", "is", "None", ":", "try", ":", "mod_obj_old", "=", "sys", ".", "modules", "[", "mod_na...
Import a module by module name.
[ "Import", "a", "module", "by", "module", "name", "." ]
[ "\"\"\"Import a module by module name.\n\n @param mod_name: module name in Python namespace.\n\n @param ns_dir: load from which namespace dir.\n Namespace dir means the dir is considered as if it's in |sys.path|.\n If |ns_dir| is specified, only load from that dir.\n Otherwise load from any namespace...
[ { "param": "mod_name", "type": null }, { "param": "ns_dir", "type": null }, { "param": "sys_use", "type": null }, { "param": "sys_add", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "mod_name", "type": null, "docstring": "module name in Python namespace.", "docstring_tokens": [ "module", "name", "in", "Python", "namespace", "." ], "default": null,...
7f231947d84957b6258ec7930b97a756b8e0893a
AoiKuiyuyou/AoikHotkey
src/aoikhotkeydep/aoikimportutil.py
[ "MIT" ]
Python
import_module_by_path
<not_specific>
def import_module_by_path(mod_path, mod_name, sys_add=True, sys_use=True): """Import a module by module file path. @param mod_path: module file path. @param mod_name: module name to be imported as. @param sys_use: see func |import_module_by_code|'s same name arg. @param sys_add: see func |import...
Import a module by module file path. @param mod_path: module file path. @param mod_name: module name to be imported as. @param sys_use: see func |import_module_by_code|'s same name arg. @param sys_add: see func |import_module_by_code|'s same name arg.
Import a module by module file path.
[ "Import", "a", "module", "by", "module", "file", "path", "." ]
def import_module_by_path(mod_path, mod_name, sys_add=True, sys_use=True): mod_code = open(mod_path).read() raise error mod_obj = import_module_by_code( mod_code=mod_code, mod_name=mod_name, sys_use=sys_use, sys_add=sys_add, ) raise error mod_obj.__file__ = mod_...
[ "def", "import_module_by_path", "(", "mod_path", ",", "mod_name", ",", "sys_add", "=", "True", ",", "sys_use", "=", "True", ")", ":", "mod_code", "=", "open", "(", "mod_path", ")", ".", "read", "(", ")", "mod_obj", "=", "import_module_by_code", "(", "mod_c...
Import a module by module file path.
[ "Import", "a", "module", "by", "module", "file", "path", "." ]
[ "\"\"\"Import a module by module file path.\n\n @param mod_path: module file path.\n\n @param mod_name: module name to be imported as.\n\n @param sys_use: see func |import_module_by_code|'s same name arg.\n\n @param sys_add: see func |import_module_by_code|'s same name arg.\n \"\"\"", "#", "# rai...
[ { "param": "mod_path", "type": null }, { "param": "mod_name", "type": null }, { "param": "sys_add", "type": null }, { "param": "sys_use", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "mod_path", "type": null, "docstring": "module file path.", "docstring_tokens": [ "module", "file", "path", "." ], "default": null, "is_optional": false }, { "iden...
7f231947d84957b6258ec7930b97a756b8e0893a
AoiKuiyuyou/AoikHotkey
src/aoikhotkeydep/aoikimportutil.py
[ "MIT" ]
Python
import_module_by_http
<not_specific>
def import_module_by_http(uri, mod_name, sys_use=True, sys_add=True): """Download module code via HTTP and create the module object from the code. @param uri: HTTP URI of the module file. @param mod_name: module name to be imported as. @param sys_use: see func |import_module_by_code|'s same name arg....
Download module code via HTTP and create the module object from the code. @param uri: HTTP URI of the module file. @param mod_name: module name to be imported as. @param sys_use: see func |import_module_by_code|'s same name arg. @param sys_add: see func |import_module_by_code|'s same name arg.
Download module code via HTTP and create the module object from the code.
[ "Download", "module", "code", "via", "HTTP", "and", "create", "the", "module", "object", "from", "the", "code", "." ]
def import_module_by_http(uri, mod_name, sys_use=True, sys_add=True): resp = urlopen(uri) raise error mod_code = resp.read() raise error mod_obj = import_module_by_code( mod_code=mod_code, mod_name=mod_name, sys_use=sys_use, sys_add=sys_add, ) raise error ...
[ "def", "import_module_by_http", "(", "uri", ",", "mod_name", ",", "sys_use", "=", "True", ",", "sys_add", "=", "True", ")", ":", "resp", "=", "urlopen", "(", "uri", ")", "mod_code", "=", "resp", ".", "read", "(", ")", "mod_obj", "=", "import_module_by_co...
Download module code via HTTP and create the module object from the code.
[ "Download", "module", "code", "via", "HTTP", "and", "create", "the", "module", "object", "from", "the", "code", "." ]
[ "\"\"\"Download module code via HTTP and create the module object from the code.\n\n @param uri: HTTP URI of the module file.\n\n @param mod_name: module name to be imported as.\n\n @param sys_use: see func |import_module_by_code|'s same name arg.\n\n @param sys_add: see func |import_module_by_code|'s s...
[ { "param": "uri", "type": null }, { "param": "mod_name", "type": null }, { "param": "sys_use", "type": null }, { "param": "sys_add", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "uri", "type": null, "docstring": "HTTP URI of the module file.", "docstring_tokens": [ "HTTP", "URI", "of", "the", "module", "file", "." ], "default": null, ...
7f231947d84957b6258ec7930b97a756b8e0893a
AoiKuiyuyou/AoikHotkey
src/aoikhotkeydep/aoikimportutil.py
[ "MIT" ]
Python
load_obj
<not_specific>
def load_obj( uri, mod_name=None, sys_use=True, sys_add=True, mod_attr_sep='::', attr_chain_sep='.', retn_mod=False, uri_parts=None, ): """Load an object from a module (specified by module name in Python namespace) or from a module file (specified by module file path). ...
Load an object from a module (specified by module name in Python namespace) or from a module file (specified by module file path). @param uri: an uri specifying which object to load. An |uri| consists of two parts: |module uri| and |attr chain|, e.g. |a/b/c.py::x.y.z| or |a.b.c::x.y.z| # mod...
Load an object from a module (specified by module name in Python namespace) or from a module file (specified by module file path).
[ "Load", "an", "object", "from", "a", "module", "(", "specified", "by", "module", "name", "in", "Python", "namespace", ")", "or", "from", "a", "module", "file", "(", "specified", "by", "module", "file", "path", ")", "." ]
def load_obj( uri, mod_name=None, sys_use=True, sys_add=True, mod_attr_sep='::', attr_chain_sep='.', retn_mod=False, uri_parts=None, ): if uri_parts is None: uri_parts = uri_split(uri=uri, mod_attr_sep=mod_attr_sep) prot, mod_uri, attr_chain = uri_parts This means th...
[ "def", "load_obj", "(", "uri", ",", "mod_name", "=", "None", ",", "sys_use", "=", "True", ",", "sys_add", "=", "True", ",", "mod_attr_sep", "=", "'::'", ",", "attr_chain_sep", "=", "'.'", ",", "retn_mod", "=", "False", ",", "uri_parts", "=", "None", ",...
Load an object from a module (specified by module name in Python namespace) or from a module file (specified by module file path).
[ "Load", "an", "object", "from", "a", "module", "(", "specified", "by", "module", "name", "in", "Python", "namespace", ")", "or", "from", "a", "module", "file", "(", "specified", "by", "module", "file", "path", ")", "." ]
[ "\"\"\"Load an object from a module (specified by module name in Python\n namespace)\n or from a module file (specified by module file path).\n\n @param uri: an uri specifying which object to load.\n An |uri| consists of two parts: |module uri| and |attr chain|,\n e.g. |a/b/c.py::x.y.z| or |a.b.c::...
[ { "param": "uri", "type": null }, { "param": "mod_name", "type": null }, { "param": "sys_use", "type": null }, { "param": "sys_add", "type": null }, { "param": "mod_attr_sep", "type": null }, { "param": "attr_chain_sep", "type": null }, { "...
{ "returns": [], "raises": [], "params": [ { "identifier": "uri", "type": null, "docstring": "an uri specifying which object to load.\nAn |uri| consists of two parts: |module uri| and |attr chain|,\ne.g.\n\nmodule uri\n|a/b/c.py| or |a.b.c| is the |module uri| part.\nCan be either a file pat...
7f231947d84957b6258ec7930b97a756b8e0893a
AoiKuiyuyou/AoikHotkey
src/aoikhotkeydep/aoikimportutil.py
[ "MIT" ]
Python
load_obj_http
<not_specific>
def load_obj_http( uri, mod_name=None, sys_use=True, sys_add=True, mod_attr_sep='::', attr_chain_sep='.', retn_mod=False, uri_parts=None, ): """Load an object from a remote module file downloaded via HTTP. @param uri: specify the remote module file's location and which attribute...
Load an object from a remote module file downloaded via HTTP. @param uri: specify the remote module file's location and which attribute object to load. # load the module object https://localhost/aoikimportutil/aoikimportutil.py # load the module object, get its attribute object |load_obj_http|. ...
Load an object from a remote module file downloaded via HTTP.
[ "Load", "an", "object", "from", "a", "remote", "module", "file", "downloaded", "via", "HTTP", "." ]
def load_obj_http( uri, mod_name=None, sys_use=True, sys_add=True, mod_attr_sep='::', attr_chain_sep='.', retn_mod=False, uri_parts=None, ): if uri_parts is None: uri_parts = uri_split(uri=uri, mod_attr_sep=mod_attr_sep) _, file_url, attr_chain = uri_parts |None| or ...
[ "def", "load_obj_http", "(", "uri", ",", "mod_name", "=", "None", ",", "sys_use", "=", "True", ",", "sys_add", "=", "True", ",", "mod_attr_sep", "=", "'::'", ",", "attr_chain_sep", "=", "'.'", ",", "retn_mod", "=", "False", ",", "uri_parts", "=", "None",...
Load an object from a remote module file downloaded via HTTP.
[ "Load", "an", "object", "from", "a", "remote", "module", "file", "downloaded", "via", "HTTP", "." ]
[ "\"\"\"Load an object from a remote module file downloaded via HTTP.\n\n @param uri: specify the remote module file's location and which attribute\n object to load.\n # load the module object\n https://localhost/aoikimportutil/aoikimportutil.py\n\n # load the module object, get its attribute object |...
[ { "param": "uri", "type": null }, { "param": "mod_name", "type": null }, { "param": "sys_use", "type": null }, { "param": "sys_add", "type": null }, { "param": "mod_attr_sep", "type": null }, { "param": "attr_chain_sep", "type": null }, { "...
{ "returns": [], "raises": [], "params": [ { "identifier": "uri", "type": null, "docstring": "specify the remote module file's location and which attribute\nobject to load.\n\nload the module object, get its attribute object |load_obj_http|.", "docstring_tokens": [ "specify", ...
243efde49da8872a88e98b43dbb9e75a52bcbcc6
AoiKuiyuyou/AoikHotkey
src/aoikhotkey/hotkey_manager.py
[ "MIT" ]
Python
eloop_stop_callback_set
null
def eloop_stop_callback_set(self, callback): """ Set event loop stop callback. :param callback: Event loop stop callback. :return: None. """ # Set event loop stop callback self._eloop_stop_callback = callback
Set event loop stop callback. :param callback: Event loop stop callback. :return: None.
Set event loop stop callback.
[ "Set", "event", "loop", "stop", "callback", "." ]
def eloop_stop_callback_set(self, callback): self._eloop_stop_callback = callback
[ "def", "eloop_stop_callback_set", "(", "self", ",", "callback", ")", ":", "self", ".", "_eloop_stop_callback", "=", "callback" ]
Set event loop stop callback.
[ "Set", "event", "loop", "stop", "callback", "." ]
[ "\"\"\"\n Set event loop stop callback.\n\n :param callback: Event loop stop callback.\n\n :return: None.\n \"\"\"", "# Set event loop stop callback" ]
[ { "param": "self", "type": null }, { "param": "callback", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null ...
243efde49da8872a88e98b43dbb9e75a52bcbcc6
AoiKuiyuyou/AoikHotkey
src/aoikhotkey/hotkey_manager.py
[ "MIT" ]
Python
emask_ctx
<not_specific>
def emask_ctx(self, emask): """ Create event mask context manager. :param mask: Event mask. :return: Event mask context manager. """ # Create context manager factory @contextmanager def ctx_factory(): # Store old mask old_mask = s...
Create event mask context manager. :param mask: Event mask. :return: Event mask context manager.
Create event mask context manager.
[ "Create", "event", "mask", "context", "manager", "." ]
def emask_ctx(self, emask): @contextmanager def ctx_factory(): old_mask = self._emask self._emask = emask yield self._emask = old_mask return ctx_factory()
[ "def", "emask_ctx", "(", "self", ",", "emask", ")", ":", "@", "contextmanager", "def", "ctx_factory", "(", ")", ":", "old_mask", "=", "self", ".", "_emask", "self", ".", "_emask", "=", "emask", "yield", "self", ".", "_emask", "=", "old_mask", "return", ...
Create event mask context manager.
[ "Create", "event", "mask", "context", "manager", "." ]
[ "\"\"\"\n Create event mask context manager.\n\n :param mask: Event mask.\n\n :return: Event mask context manager.\n \"\"\"", "# Create context manager factory", "# Store old mask", "# Set new mask", "# This is before entering the context", "# This is after exiting the context"...
[ { "param": "self", "type": null }, { "param": "emask", "type": null } ]
{ "returns": [ { "docstring": "Event mask context manager.", "docstring_tokens": [ "Event", "mask", "context", "manager", "." ], "type": null } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstr...
243efde49da8872a88e98b43dbb9e75a52bcbcc6
AoiKuiyuyou/AoikHotkey
src/aoikhotkey/hotkey_manager.py
[ "MIT" ]
Python
hotkey_parse
<not_specific>
def hotkey_parse(self, pattern): """ Parse hotkey pattern to virtual key lists. :param pattern: Hotkey pattern. :return: Virtual key lists. """ # Parse hotkey pattern to virtual key lists return self._hotkey_parse(pattern)
Parse hotkey pattern to virtual key lists. :param pattern: Hotkey pattern. :return: Virtual key lists.
Parse hotkey pattern to virtual key lists.
[ "Parse", "hotkey", "pattern", "to", "virtual", "key", "lists", "." ]
def hotkey_parse(self, pattern): return self._hotkey_parse(pattern)
[ "def", "hotkey_parse", "(", "self", ",", "pattern", ")", ":", "return", "self", ".", "_hotkey_parse", "(", "pattern", ")" ]
Parse hotkey pattern to virtual key lists.
[ "Parse", "hotkey", "pattern", "to", "virtual", "key", "lists", "." ]
[ "\"\"\"\n Parse hotkey pattern to virtual key lists.\n\n :param pattern: Hotkey pattern.\n\n :return: Virtual key lists.\n \"\"\"", "# Parse hotkey pattern to virtual key lists" ]
[ { "param": "self", "type": null }, { "param": "pattern", "type": null } ]
{ "returns": [ { "docstring": "Virtual key lists.", "docstring_tokens": [ "Virtual", "key", "lists", "." ], "type": null } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_...
243efde49da8872a88e98b43dbb9e75a52bcbcc6
AoiKuiyuyou/AoikHotkey
src/aoikhotkey/hotkey_manager.py
[ "MIT" ]
Python
_hotkey_info_by_vk_map_get
<not_specific>
def _hotkey_info_by_vk_map_get(self, hotkey_type): """ Get hotkey info by-VK map for given hotkey type. :param hotkey_type: Hotkey type. :return: Hotkey info by-VK map for given hotkey type. """ # If is key-down hotkey if hotkey_type == HOTKEY_TYPE_V_DN: ...
Get hotkey info by-VK map for given hotkey type. :param hotkey_type: Hotkey type. :return: Hotkey info by-VK map for given hotkey type.
Get hotkey info by-VK map for given hotkey type.
[ "Get", "hotkey", "info", "by", "-", "VK", "map", "for", "given", "hotkey", "type", "." ]
def _hotkey_info_by_vk_map_get(self, hotkey_type): if hotkey_type == HOTKEY_TYPE_V_DN: hotkey_info_by_vk_map = self._hotkey_info_by_vk_map_for_key_down elif hotkey_type == HOTKEY_TYPE_V_UP: hotkey_info_by_vk_map = self._hotkey_info_by_vk_map_for_key_up elif hotkey_type ==...
[ "def", "_hotkey_info_by_vk_map_get", "(", "self", ",", "hotkey_type", ")", ":", "if", "hotkey_type", "==", "HOTKEY_TYPE_V_DN", ":", "hotkey_info_by_vk_map", "=", "self", ".", "_hotkey_info_by_vk_map_for_key_down", "elif", "hotkey_type", "==", "HOTKEY_TYPE_V_UP", ":", "h...
Get hotkey info by-VK map for given hotkey type.
[ "Get", "hotkey", "info", "by", "-", "VK", "map", "for", "given", "hotkey", "type", "." ]
[ "\"\"\"\n Get hotkey info by-VK map for given hotkey type.\n\n :param hotkey_type: Hotkey type.\n\n :return: Hotkey info by-VK map for given hotkey type.\n \"\"\"", "# If is key-down hotkey", "# Use key-down map", "# If is key-up hotkey", "# Use key-up map", "# If is key-sequen...
[ { "param": "self", "type": null }, { "param": "hotkey_type", "type": null } ]
{ "returns": [ { "docstring": "Hotkey info by-VK map for given hotkey type.", "docstring_tokens": [ "Hotkey", "info", "by", "-", "VK", "map", "for", "given", "hotkey", "type", "." ], "type": null } ...
243efde49da8872a88e98b43dbb9e75a52bcbcc6
AoiKuiyuyou/AoikHotkey
src/aoikhotkey/hotkey_manager.py
[ "MIT" ]
Python
_hotkey_to_tuple
<not_specific>
def _hotkey_to_tuple(self, hotkey, hotkey_type): """ Convert given hotkey to virtual key tuple. :param hotkey: Virtual key list. :param hotkey_type: Hotkey type. :param return: Virtual key tuple. """ # If given hotkey type is key-sequence if hotkey_type...
Convert given hotkey to virtual key tuple. :param hotkey: Virtual key list. :param hotkey_type: Hotkey type. :param return: Virtual key tuple.
Convert given hotkey to virtual key tuple.
[ "Convert", "given", "hotkey", "to", "virtual", "key", "tuple", "." ]
def _hotkey_to_tuple(self, hotkey, hotkey_type): if hotkey_type == HOTKEY_TYPE_V_KS: hotkey_tuple = tuple(hotkey) else: hotkey_tuple = tuple(sorted(hotkey)) return hotkey_tuple
[ "def", "_hotkey_to_tuple", "(", "self", ",", "hotkey", ",", "hotkey_type", ")", ":", "if", "hotkey_type", "==", "HOTKEY_TYPE_V_KS", ":", "hotkey_tuple", "=", "tuple", "(", "hotkey", ")", "else", ":", "hotkey_tuple", "=", "tuple", "(", "sorted", "(", "hotkey"...
Convert given hotkey to virtual key tuple.
[ "Convert", "given", "hotkey", "to", "virtual", "key", "tuple", "." ]
[ "\"\"\"\n Convert given hotkey to virtual key tuple.\n\n :param hotkey: Virtual key list.\n\n :param hotkey_type: Hotkey type.\n\n :param return: Virtual key tuple.\n \"\"\"", "# If given hotkey type is key-sequence", "# Get virtual key tuple", "# Get sorted virtual key tupl...
[ { "param": "self", "type": null }, { "param": "hotkey", "type": null }, { "param": "hotkey_type", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "hotkey", "type": null, "docstring": "Virtual key list.", "doc...
243efde49da8872a88e98b43dbb9e75a52bcbcc6
AoiKuiyuyou/AoikHotkey
src/aoikhotkey/hotkey_manager.py
[ "MIT" ]
Python
_hotkey_info_get_by_hotkey
<not_specific>
def _hotkey_info_get_by_hotkey(self, hotkey, hotkey_type): """ Get hotkey info for given hotkey. :param hotkey: Virtual key list. :param hotkey_type: Hotkey type. :param return: Hotkey info. """ # Get given hotkey's virtual key tuple hotkey_tuple = self...
Get hotkey info for given hotkey. :param hotkey: Virtual key list. :param hotkey_type: Hotkey type. :param return: Hotkey info.
Get hotkey info for given hotkey.
[ "Get", "hotkey", "info", "for", "given", "hotkey", "." ]
def _hotkey_info_get_by_hotkey(self, hotkey, hotkey_type): hotkey_tuple = self._hotkey_to_tuple(hotkey, hotkey_type=hotkey_type) hotkey_info_by_vk_map = self._hotkey_info_by_vk_map_get(hotkey_type) hotkey_tuple_info = hotkey_info_by_vk_map.get(hotkey_tuple, None) return hotkey_tuple_info
[ "def", "_hotkey_info_get_by_hotkey", "(", "self", ",", "hotkey", ",", "hotkey_type", ")", ":", "hotkey_tuple", "=", "self", ".", "_hotkey_to_tuple", "(", "hotkey", ",", "hotkey_type", "=", "hotkey_type", ")", "hotkey_info_by_vk_map", "=", "self", ".", "_hotkey_inf...
Get hotkey info for given hotkey.
[ "Get", "hotkey", "info", "for", "given", "hotkey", "." ]
[ "\"\"\"\n Get hotkey info for given hotkey.\n\n :param hotkey: Virtual key list.\n\n :param hotkey_type: Hotkey type.\n\n :param return: Hotkey info.\n \"\"\"", "# Get given hotkey's virtual key tuple", "# Get hotkey info map", "# Get hotkey info", "# Return the hotkey inf...
[ { "param": "self", "type": null }, { "param": "hotkey", "type": null }, { "param": "hotkey_type", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "hotkey", "type": null, "docstring": "Virtual key list.", "doc...
243efde49da8872a88e98b43dbb9e75a52bcbcc6
AoiKuiyuyou/AoikHotkey
src/aoikhotkey/hotkey_manager.py
[ "MIT" ]
Python
_key_dn_hdlr
<not_specific>
def _key_dn_hdlr(self, event, mouse_wm=False): """ Key-down event handler. :param event: Event object. :param mouse_wm: Whether is handler for mouse wheel or mouse move \ events. :return: Whether propagate the event. """ # If given event is mouse ev...
Key-down event handler. :param event: Event object. :param mouse_wm: Whether is handler for mouse wheel or mouse move \ events. :return: Whether propagate the event.
Key-down event handler.
[ "Key", "-", "down", "event", "handler", "." ]
def _key_dn_hdlr(self, event, mouse_wm=False): if 'mouse' in event.MessageName: vk = event.Message if vk == VK_MOUSE_WHEEL: if event.Wheel > 0: vk = EVK_MOUSE_WHEEL_UP elif event.Wheel < 0: vk = EVK_MOUSE_WHEEL_DOWN ...
[ "def", "_key_dn_hdlr", "(", "self", ",", "event", ",", "mouse_wm", "=", "False", ")", ":", "if", "'mouse'", "in", "event", ".", "MessageName", ":", "vk", "=", "event", ".", "Message", "if", "vk", "==", "VK_MOUSE_WHEEL", ":", "if", "event", ".", "Wheel"...
Key-down event handler.
[ "Key", "-", "down", "event", "handler", "." ]
[ "\"\"\"\n Key-down event handler.\n\n :param event: Event object.\n\n :param mouse_wm: Whether is handler for mouse wheel or mouse move \\\n events.\n\n :return: Whether propagate the event.\n \"\"\"", "# If given event is mouse event", "# Get the mouse event's virt...
[ { "param": "self", "type": null }, { "param": "event", "type": null }, { "param": "mouse_wm", "type": null } ]
{ "returns": [ { "docstring": "Whether propagate the event.", "docstring_tokens": [ "Whether", "propagate", "the", "event", "." ], "type": null } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docs...