body_hash
stringlengths
64
64
body
stringlengths
23
109k
docstring
stringlengths
1
57k
path
stringlengths
4
198
name
stringlengths
1
115
repository_name
stringlengths
7
111
repository_stars
float64
0
191k
lang
stringclasses
1 value
body_without_docstring
stringlengths
14
108k
unified
stringlengths
45
133k
a802785447d4680ef68c0a78fe2ff71c338229b244c97a7024d91714e41b9217
def get_func(func_name): "Helper to return a function object by name. func_name must identify a\n function in this module or the path to a function relative to the base\n 'modeling' module.\n " if (func_name == ''): return None try: parts = func_name.split('.') if (len(parts) == 1): return globals()[parts[0]] module_name = ('modeling.' + '.'.join(parts[:(- 1)])) module = importlib.import_module(module_name) return getattr(module, parts[(- 1)]) except Exception: logger.error('Failed to find function: %s', func_name) raise
Helper to return a function object by name. func_name must identify a function in this module or the path to a function relative to the base 'modeling' module.
lib/modeling/model_builder.py
get_func
jcjs/FPN-Pytorch
271
python
def get_func(func_name): "Helper to return a function object by name. func_name must identify a\n function in this module or the path to a function relative to the base\n 'modeling' module.\n " if (func_name == ): return None try: parts = func_name.split('.') if (len(parts) == 1): return globals()[parts[0]] module_name = ('modeling.' + '.'.join(parts[:(- 1)])) module = importlib.import_module(module_name) return getattr(module, parts[(- 1)]) except Exception: logger.error('Failed to find function: %s', func_name) raise
def get_func(func_name): "Helper to return a function object by name. func_name must identify a\n function in this module or the path to a function relative to the base\n 'modeling' module.\n " if (func_name == ): return None try: parts = func_name.split('.') if (len(parts) == 1): return globals()[parts[0]] module_name = ('modeling.' + '.'.join(parts[:(- 1)])) module = importlib.import_module(module_name) return getattr(module, parts[(- 1)]) except Exception: logger.error('Failed to find function: %s', func_name) raise<|docstring|>Helper to return a function object by name. func_name must identify a function in this module or the path to a function relative to the base 'modeling' module.<|endoftext|>
8b76c2e928fbb3cb01e69baa766145c06f88260363de9ec32e538a726ae8ea7a
def _filter_boxes(boxes, min_size, im_info): 'Only keep boxes with both sides >= min_size and center within the image.\n ' min_size *= im_info[2] ws = ((boxes[(:, 2)] - boxes[(:, 0)]) + 1) hs = ((boxes[(:, 3)] - boxes[(:, 1)]) + 1) x_ctr = (boxes[(:, 0)] + (ws / 2.0)) y_ctr = (boxes[(:, 1)] + (hs / 2.0)) keep = np.where(((((ws >= min_size) & (hs >= min_size)) & (x_ctr < im_info[1])) & (y_ctr < im_info[0])))[0] return keep
Only keep boxes with both sides >= min_size and center within the image.
lib/modeling/model_builder.py
_filter_boxes
jcjs/FPN-Pytorch
271
python
def _filter_boxes(boxes, min_size, im_info): '\n ' min_size *= im_info[2] ws = ((boxes[(:, 2)] - boxes[(:, 0)]) + 1) hs = ((boxes[(:, 3)] - boxes[(:, 1)]) + 1) x_ctr = (boxes[(:, 0)] + (ws / 2.0)) y_ctr = (boxes[(:, 1)] + (hs / 2.0)) keep = np.where(((((ws >= min_size) & (hs >= min_size)) & (x_ctr < im_info[1])) & (y_ctr < im_info[0])))[0] return keep
def _filter_boxes(boxes, min_size, im_info): '\n ' min_size *= im_info[2] ws = ((boxes[(:, 2)] - boxes[(:, 0)]) + 1) hs = ((boxes[(:, 3)] - boxes[(:, 1)]) + 1) x_ctr = (boxes[(:, 0)] + (ws / 2.0)) y_ctr = (boxes[(:, 1)] + (hs / 2.0)) keep = np.where(((((ws >= min_size) & (hs >= min_size)) & (x_ctr < im_info[1])) & (y_ctr < im_info[0])))[0] return keep<|docstring|>Only keep boxes with both sides >= min_size and center within the image.<|endoftext|>
b7ce03a9b923d0120d557a1e88878ee69b043ac867bd707a09f687be5d236e44
def roi_feature_transform(self, blobs_in, rpn_ret, blob_rois='rois', method='RoIPoolF', resolution=7, spatial_scale=(1.0 / 16.0), sampling_ratio=0): 'Add the specified RoI pooling method. The sampling_ratio argument\n is supported for some, but not all, RoI transform methods.\n\n RoIFeatureTransform abstracts away:\n - Use of FPN or not\n - Specifics of the transform method\n ' assert (method in {'RoIPoolF', 'RoICrop', 'RoIAlign'}), 'Unknown pooling method: {}'.format(method) if isinstance(blobs_in, list): device_id = blobs_in[0].get_device() k_max = cfg.FPN.ROI_MAX_LEVEL k_min = cfg.FPN.ROI_MIN_LEVEL assert (len(blobs_in) == ((k_max - k_min) + 1)) bl_out_list = [] for lvl in range(k_min, (k_max + 1)): bl_in = blobs_in[(k_max - lvl)] sc = spatial_scale[(k_max - lvl)] bl_rois = ((blob_rois + '_fpn') + str(lvl)) if len(rpn_ret[bl_rois]): rois = Variable(torch.from_numpy(rpn_ret[bl_rois])).cuda(device_id) if (method == 'RoIPoolF'): xform_out = RoIPoolFunction(resolution, resolution, sc)(bl_in, rois) elif (method == 'RoICrop'): grid_xy = net_utils.affine_grid_gen(rois, bl_in.size()[2:], self.grid_size) grid_yx = torch.stack([grid_xy.data[(:, :, :, 1)], grid_xy.data[(:, :, :, 0)]], 3).contiguous() xform_out = RoICropFunction()(bl_in, Variable(grid_yx).detach()) if cfg.CROP_RESIZE_WITH_MAX_POOL: xform_out = F.max_pool2d(xform_out, 2, 2) elif (method == 'RoIAlign'): xform_out = RoIAlignFunction(resolution, resolution, sc, sampling_ratio)(bl_in, rois) bl_out_list.append(xform_out) xform_shuffled = torch.cat(bl_out_list, dim=0) device_id = xform_shuffled.get_device() restore_bl = rpn_ret[(blob_rois + '_idx_restore_int32')] restore_bl = Variable(torch.from_numpy(restore_bl.astype('int64', copy=False))).cuda(device_id) xform_out = xform_shuffled[restore_bl] else: device_id = blobs_in.get_device() rois = Variable(torch.from_numpy(rpn_ret[blob_rois])).cuda(device_id) if (method == 'RoIPoolF'): xform_out = RoIPoolFunction(resolution, resolution, spatial_scale)(blobs_in, rois) elif (method == 'RoICrop'): grid_xy = net_utils.affine_grid_gen(rois, blobs_in.size()[2:], self.grid_size) grid_yx = torch.stack([grid_xy.data[(:, :, :, 1)], grid_xy.data[(:, :, :, 0)]], 3).contiguous() xform_out = RoICropFunction()(blobs_in, Variable(grid_yx).detach()) if cfg.CROP_RESIZE_WITH_MAX_POOL: xform_out = F.max_pool2d(xform_out, 2, 2) elif (method == 'RoIAlign'): xform_out = RoIAlignFunction(resolution, resolution, spatial_scale, sampling_ratio)(blobs_in, rois) return xform_out
Add the specified RoI pooling method. The sampling_ratio argument is supported for some, but not all, RoI transform methods. RoIFeatureTransform abstracts away: - Use of FPN or not - Specifics of the transform method
lib/modeling/model_builder.py
roi_feature_transform
jcjs/FPN-Pytorch
271
python
def roi_feature_transform(self, blobs_in, rpn_ret, blob_rois='rois', method='RoIPoolF', resolution=7, spatial_scale=(1.0 / 16.0), sampling_ratio=0): 'Add the specified RoI pooling method. The sampling_ratio argument\n is supported for some, but not all, RoI transform methods.\n\n RoIFeatureTransform abstracts away:\n - Use of FPN or not\n - Specifics of the transform method\n ' assert (method in {'RoIPoolF', 'RoICrop', 'RoIAlign'}), 'Unknown pooling method: {}'.format(method) if isinstance(blobs_in, list): device_id = blobs_in[0].get_device() k_max = cfg.FPN.ROI_MAX_LEVEL k_min = cfg.FPN.ROI_MIN_LEVEL assert (len(blobs_in) == ((k_max - k_min) + 1)) bl_out_list = [] for lvl in range(k_min, (k_max + 1)): bl_in = blobs_in[(k_max - lvl)] sc = spatial_scale[(k_max - lvl)] bl_rois = ((blob_rois + '_fpn') + str(lvl)) if len(rpn_ret[bl_rois]): rois = Variable(torch.from_numpy(rpn_ret[bl_rois])).cuda(device_id) if (method == 'RoIPoolF'): xform_out = RoIPoolFunction(resolution, resolution, sc)(bl_in, rois) elif (method == 'RoICrop'): grid_xy = net_utils.affine_grid_gen(rois, bl_in.size()[2:], self.grid_size) grid_yx = torch.stack([grid_xy.data[(:, :, :, 1)], grid_xy.data[(:, :, :, 0)]], 3).contiguous() xform_out = RoICropFunction()(bl_in, Variable(grid_yx).detach()) if cfg.CROP_RESIZE_WITH_MAX_POOL: xform_out = F.max_pool2d(xform_out, 2, 2) elif (method == 'RoIAlign'): xform_out = RoIAlignFunction(resolution, resolution, sc, sampling_ratio)(bl_in, rois) bl_out_list.append(xform_out) xform_shuffled = torch.cat(bl_out_list, dim=0) device_id = xform_shuffled.get_device() restore_bl = rpn_ret[(blob_rois + '_idx_restore_int32')] restore_bl = Variable(torch.from_numpy(restore_bl.astype('int64', copy=False))).cuda(device_id) xform_out = xform_shuffled[restore_bl] else: device_id = blobs_in.get_device() rois = Variable(torch.from_numpy(rpn_ret[blob_rois])).cuda(device_id) if (method == 'RoIPoolF'): xform_out = RoIPoolFunction(resolution, resolution, spatial_scale)(blobs_in, rois) elif (method == 'RoICrop'): grid_xy = net_utils.affine_grid_gen(rois, blobs_in.size()[2:], self.grid_size) grid_yx = torch.stack([grid_xy.data[(:, :, :, 1)], grid_xy.data[(:, :, :, 0)]], 3).contiguous() xform_out = RoICropFunction()(blobs_in, Variable(grid_yx).detach()) if cfg.CROP_RESIZE_WITH_MAX_POOL: xform_out = F.max_pool2d(xform_out, 2, 2) elif (method == 'RoIAlign'): xform_out = RoIAlignFunction(resolution, resolution, spatial_scale, sampling_ratio)(blobs_in, rois) return xform_out
def roi_feature_transform(self, blobs_in, rpn_ret, blob_rois='rois', method='RoIPoolF', resolution=7, spatial_scale=(1.0 / 16.0), sampling_ratio=0): 'Add the specified RoI pooling method. The sampling_ratio argument\n is supported for some, but not all, RoI transform methods.\n\n RoIFeatureTransform abstracts away:\n - Use of FPN or not\n - Specifics of the transform method\n ' assert (method in {'RoIPoolF', 'RoICrop', 'RoIAlign'}), 'Unknown pooling method: {}'.format(method) if isinstance(blobs_in, list): device_id = blobs_in[0].get_device() k_max = cfg.FPN.ROI_MAX_LEVEL k_min = cfg.FPN.ROI_MIN_LEVEL assert (len(blobs_in) == ((k_max - k_min) + 1)) bl_out_list = [] for lvl in range(k_min, (k_max + 1)): bl_in = blobs_in[(k_max - lvl)] sc = spatial_scale[(k_max - lvl)] bl_rois = ((blob_rois + '_fpn') + str(lvl)) if len(rpn_ret[bl_rois]): rois = Variable(torch.from_numpy(rpn_ret[bl_rois])).cuda(device_id) if (method == 'RoIPoolF'): xform_out = RoIPoolFunction(resolution, resolution, sc)(bl_in, rois) elif (method == 'RoICrop'): grid_xy = net_utils.affine_grid_gen(rois, bl_in.size()[2:], self.grid_size) grid_yx = torch.stack([grid_xy.data[(:, :, :, 1)], grid_xy.data[(:, :, :, 0)]], 3).contiguous() xform_out = RoICropFunction()(bl_in, Variable(grid_yx).detach()) if cfg.CROP_RESIZE_WITH_MAX_POOL: xform_out = F.max_pool2d(xform_out, 2, 2) elif (method == 'RoIAlign'): xform_out = RoIAlignFunction(resolution, resolution, sc, sampling_ratio)(bl_in, rois) bl_out_list.append(xform_out) xform_shuffled = torch.cat(bl_out_list, dim=0) device_id = xform_shuffled.get_device() restore_bl = rpn_ret[(blob_rois + '_idx_restore_int32')] restore_bl = Variable(torch.from_numpy(restore_bl.astype('int64', copy=False))).cuda(device_id) xform_out = xform_shuffled[restore_bl] else: device_id = blobs_in.get_device() rois = Variable(torch.from_numpy(rpn_ret[blob_rois])).cuda(device_id) if (method == 'RoIPoolF'): xform_out = RoIPoolFunction(resolution, resolution, spatial_scale)(blobs_in, rois) elif (method == 'RoICrop'): grid_xy = net_utils.affine_grid_gen(rois, blobs_in.size()[2:], self.grid_size) grid_yx = torch.stack([grid_xy.data[(:, :, :, 1)], grid_xy.data[(:, :, :, 0)]], 3).contiguous() xform_out = RoICropFunction()(blobs_in, Variable(grid_yx).detach()) if cfg.CROP_RESIZE_WITH_MAX_POOL: xform_out = F.max_pool2d(xform_out, 2, 2) elif (method == 'RoIAlign'): xform_out = RoIAlignFunction(resolution, resolution, spatial_scale, sampling_ratio)(blobs_in, rois) return xform_out<|docstring|>Add the specified RoI pooling method. The sampling_ratio argument is supported for some, but not all, RoI transform methods. RoIFeatureTransform abstracts away: - Use of FPN or not - Specifics of the transform method<|endoftext|>
3a2242be10e30ce6c06562bbc6c7353e4402f1ee45851997d5027f6fb15ebcab
@check_inference def convbody_net(self, data): 'For inference. Run Conv Body only' blob_conv = self.Conv_Body(data) if cfg.FPN.FPN_ON: blob_conv = blob_conv[(- self.num_roi_levels):] return blob_conv
For inference. Run Conv Body only
lib/modeling/model_builder.py
convbody_net
jcjs/FPN-Pytorch
271
python
@check_inference def convbody_net(self, data): blob_conv = self.Conv_Body(data) if cfg.FPN.FPN_ON: blob_conv = blob_conv[(- self.num_roi_levels):] return blob_conv
@check_inference def convbody_net(self, data): blob_conv = self.Conv_Body(data) if cfg.FPN.FPN_ON: blob_conv = blob_conv[(- self.num_roi_levels):] return blob_conv<|docstring|>For inference. Run Conv Body only<|endoftext|>
e2265ed080aad3f7b2d3b6aaf79ebfa01db67f7f3b0e7242071dbc3977cec377
@check_inference def mask_net(self, blob_conv, rpn_blob): 'For inference' mask_feat = self.Mask_Head(blob_conv, rpn_blob) mask_pred = self.Mask_Outs(mask_feat) return mask_pred
For inference
lib/modeling/model_builder.py
mask_net
jcjs/FPN-Pytorch
271
python
@check_inference def mask_net(self, blob_conv, rpn_blob): mask_feat = self.Mask_Head(blob_conv, rpn_blob) mask_pred = self.Mask_Outs(mask_feat) return mask_pred
@check_inference def mask_net(self, blob_conv, rpn_blob): mask_feat = self.Mask_Head(blob_conv, rpn_blob) mask_pred = self.Mask_Outs(mask_feat) return mask_pred<|docstring|>For inference<|endoftext|>
870da89458f462f25da58ec2fcb5ef708b5f5b1f0b5b55d0be1fffd82923e516
@check_inference def keypoint_net(self, blob_conv, rpn_blob): 'For inference' kps_feat = self.Keypoint_Head(blob_conv, rpn_blob) kps_pred = self.Keypoint_Outs(kps_feat) return kps_pred
For inference
lib/modeling/model_builder.py
keypoint_net
jcjs/FPN-Pytorch
271
python
@check_inference def keypoint_net(self, blob_conv, rpn_blob): kps_feat = self.Keypoint_Head(blob_conv, rpn_blob) kps_pred = self.Keypoint_Outs(kps_feat) return kps_pred
@check_inference def keypoint_net(self, blob_conv, rpn_blob): kps_feat = self.Keypoint_Head(blob_conv, rpn_blob) kps_pred = self.Keypoint_Outs(kps_feat) return kps_pred<|docstring|>For inference<|endoftext|>
9d4844bc8157fdbd4810b151f899be6d15baabe5b1e227a2f1e66b695605c52f
def _add_loss(self, return_dict, key, value): 'Add loss tensor to returned dictionary' return_dict['losses'][key] = value
Add loss tensor to returned dictionary
lib/modeling/model_builder.py
_add_loss
jcjs/FPN-Pytorch
271
python
def _add_loss(self, return_dict, key, value): return_dict['losses'][key] = value
def _add_loss(self, return_dict, key, value): return_dict['losses'][key] = value<|docstring|>Add loss tensor to returned dictionary<|endoftext|>
4dbd6172296df2628eaee88ba7b9e1dc6e0d8c1b4ade45a7eb6403745d883a52
def find_largest_digit(n): '\n\t:param n: int.\n\t:return: bool.\n\t' highest = (- float('inf')) if (n < 0): n = (- n) return find_largest_digit_helper(n, highest)
:param n: int. :return: bool.
stanCode_Projects/boggle_game_solver_recursion/largest_digit.py
find_largest_digit
b911533/sc-projects
0
python
def find_largest_digit(n): '\n\t:param n: int.\n\t:return: bool.\n\t' highest = (- float('inf')) if (n < 0): n = (- n) return find_largest_digit_helper(n, highest)
def find_largest_digit(n): '\n\t:param n: int.\n\t:return: bool.\n\t' highest = (- float('inf')) if (n < 0): n = (- n) return find_largest_digit_helper(n, highest)<|docstring|>:param n: int. :return: bool.<|endoftext|>
9865c125ae901ffd64edc9e1e7801f530cbbf56db877204174aed13729c83172
def build_rpn(cfg): "\n This gives the gist of it. Not super important because it doesn't change as much\n " return RPNModule(cfg)
This gives the gist of it. Not super important because it doesn't change as much
MaskRCNN/pytorch/maskrcnn_benchmark/modeling/rpn/rpn.py
build_rpn
amazon-research/network-deconvolution-pp
6
python
def build_rpn(cfg): "\n \n " return RPNModule(cfg)
def build_rpn(cfg): "\n \n " return RPNModule(cfg)<|docstring|>This gives the gist of it. Not super important because it doesn't change as much<|endoftext|>
97f3b3626abd9f89a21ad9ba05369fb5f56bdbf975fd293deda53134b99579ee
def __init__(self, cfg, in_channels, num_anchors): '\n Arguments:\n cfg : config\n in_channels (int): number of channels of the input feature\n num_anchors (int): number of anchors to be predicted\n ' super(RPNHead, self).__init__() if cfg.MODEL.DECONV.LAYERWISE_NORM: norm_type = cfg.MODEL.DECONV.RPN_NORM_TYPE else: norm_type = 'none' if (cfg.MODEL.DECONV.RPN_NORM_TYPE == 'layernorm'): self.rpn_norm = LayerNorm(eps=cfg.MODEL.DECONV.EPS) if cfg.MODEL.RPN.USE_DECONV: self.conv = Deconv(in_channels, in_channels, kernel_size=3, stride=1, padding=1, block=cfg.MODEL.DECONV.BLOCK, sampling_stride=cfg.MODEL.DECONV.STRIDE, sync=cfg.MODEL.DECONV.SYNC, norm_type=norm_type) self.cls_logits = Deconv(in_channels, num_anchors, kernel_size=1, stride=1, block=cfg.MODEL.DECONV.BLOCK, sampling_stride=cfg.MODEL.DECONV.STRIDE, sync=cfg.MODEL.DECONV.SYNC, norm_type=norm_type) self.bbox_pred = Deconv(in_channels, (num_anchors * 4), kernel_size=1, stride=1, block=cfg.MODEL.DECONV.BLOCK, sampling_stride=cfg.MODEL.DECONV.STRIDE, sync=cfg.MODEL.DECONV.SYNC, norm_type=norm_type) else: self.conv = nn.Conv2d(in_channels, in_channels, kernel_size=3, stride=1, padding=1) self.cls_logits = nn.Conv2d(in_channels, num_anchors, kernel_size=1, stride=1) self.bbox_pred = nn.Conv2d(in_channels, (num_anchors * 4), kernel_size=1, stride=1) for l in [self.conv, self.cls_logits, self.bbox_pred]: torch.nn.init.normal_(l.weight, std=0.01) torch.nn.init.constant_(l.bias, 0)
Arguments: cfg : config in_channels (int): number of channels of the input feature num_anchors (int): number of anchors to be predicted
MaskRCNN/pytorch/maskrcnn_benchmark/modeling/rpn/rpn.py
__init__
amazon-research/network-deconvolution-pp
6
python
def __init__(self, cfg, in_channels, num_anchors): '\n Arguments:\n cfg : config\n in_channels (int): number of channels of the input feature\n num_anchors (int): number of anchors to be predicted\n ' super(RPNHead, self).__init__() if cfg.MODEL.DECONV.LAYERWISE_NORM: norm_type = cfg.MODEL.DECONV.RPN_NORM_TYPE else: norm_type = 'none' if (cfg.MODEL.DECONV.RPN_NORM_TYPE == 'layernorm'): self.rpn_norm = LayerNorm(eps=cfg.MODEL.DECONV.EPS) if cfg.MODEL.RPN.USE_DECONV: self.conv = Deconv(in_channels, in_channels, kernel_size=3, stride=1, padding=1, block=cfg.MODEL.DECONV.BLOCK, sampling_stride=cfg.MODEL.DECONV.STRIDE, sync=cfg.MODEL.DECONV.SYNC, norm_type=norm_type) self.cls_logits = Deconv(in_channels, num_anchors, kernel_size=1, stride=1, block=cfg.MODEL.DECONV.BLOCK, sampling_stride=cfg.MODEL.DECONV.STRIDE, sync=cfg.MODEL.DECONV.SYNC, norm_type=norm_type) self.bbox_pred = Deconv(in_channels, (num_anchors * 4), kernel_size=1, stride=1, block=cfg.MODEL.DECONV.BLOCK, sampling_stride=cfg.MODEL.DECONV.STRIDE, sync=cfg.MODEL.DECONV.SYNC, norm_type=norm_type) else: self.conv = nn.Conv2d(in_channels, in_channels, kernel_size=3, stride=1, padding=1) self.cls_logits = nn.Conv2d(in_channels, num_anchors, kernel_size=1, stride=1) self.bbox_pred = nn.Conv2d(in_channels, (num_anchors * 4), kernel_size=1, stride=1) for l in [self.conv, self.cls_logits, self.bbox_pred]: torch.nn.init.normal_(l.weight, std=0.01) torch.nn.init.constant_(l.bias, 0)
def __init__(self, cfg, in_channels, num_anchors): '\n Arguments:\n cfg : config\n in_channels (int): number of channels of the input feature\n num_anchors (int): number of anchors to be predicted\n ' super(RPNHead, self).__init__() if cfg.MODEL.DECONV.LAYERWISE_NORM: norm_type = cfg.MODEL.DECONV.RPN_NORM_TYPE else: norm_type = 'none' if (cfg.MODEL.DECONV.RPN_NORM_TYPE == 'layernorm'): self.rpn_norm = LayerNorm(eps=cfg.MODEL.DECONV.EPS) if cfg.MODEL.RPN.USE_DECONV: self.conv = Deconv(in_channels, in_channels, kernel_size=3, stride=1, padding=1, block=cfg.MODEL.DECONV.BLOCK, sampling_stride=cfg.MODEL.DECONV.STRIDE, sync=cfg.MODEL.DECONV.SYNC, norm_type=norm_type) self.cls_logits = Deconv(in_channels, num_anchors, kernel_size=1, stride=1, block=cfg.MODEL.DECONV.BLOCK, sampling_stride=cfg.MODEL.DECONV.STRIDE, sync=cfg.MODEL.DECONV.SYNC, norm_type=norm_type) self.bbox_pred = Deconv(in_channels, (num_anchors * 4), kernel_size=1, stride=1, block=cfg.MODEL.DECONV.BLOCK, sampling_stride=cfg.MODEL.DECONV.STRIDE, sync=cfg.MODEL.DECONV.SYNC, norm_type=norm_type) else: self.conv = nn.Conv2d(in_channels, in_channels, kernel_size=3, stride=1, padding=1) self.cls_logits = nn.Conv2d(in_channels, num_anchors, kernel_size=1, stride=1) self.bbox_pred = nn.Conv2d(in_channels, (num_anchors * 4), kernel_size=1, stride=1) for l in [self.conv, self.cls_logits, self.bbox_pred]: torch.nn.init.normal_(l.weight, std=0.01) torch.nn.init.constant_(l.bias, 0)<|docstring|>Arguments: cfg : config in_channels (int): number of channels of the input feature num_anchors (int): number of anchors to be predicted<|endoftext|>
cf4451e5462a4b21ddae5a54e7aa86d6fa57ff0762554f9dbcc2053d3e2a585c
def forward(self, images, features, targets=None): '\n Arguments:\n images (ImageList): images for which we want to compute the predictions\n features (list[Tensor]): features computed from the images that are\n used for computing the predictions. Each tensor in the list\n correspond to different feature levels\n targets (list[BoxList): ground-truth boxes present in the image (optional)\n\n Returns:\n boxes (list[BoxList]): the predicted boxes from the RPN, one BoxList per\n image.\n losses (dict[Tensor]): the losses for the model during training. During\n testing, it is an empty dict.\n ' (objectness, rpn_box_regression) = self.head(features) anchors = self.anchor_generator(images, features) if self.training: return self._forward_train(anchors, objectness, rpn_box_regression, targets) else: return self._forward_test(anchors, objectness, rpn_box_regression)
Arguments: images (ImageList): images for which we want to compute the predictions features (list[Tensor]): features computed from the images that are used for computing the predictions. Each tensor in the list correspond to different feature levels targets (list[BoxList): ground-truth boxes present in the image (optional) Returns: boxes (list[BoxList]): the predicted boxes from the RPN, one BoxList per image. losses (dict[Tensor]): the losses for the model during training. During testing, it is an empty dict.
MaskRCNN/pytorch/maskrcnn_benchmark/modeling/rpn/rpn.py
forward
amazon-research/network-deconvolution-pp
6
python
def forward(self, images, features, targets=None): '\n Arguments:\n images (ImageList): images for which we want to compute the predictions\n features (list[Tensor]): features computed from the images that are\n used for computing the predictions. Each tensor in the list\n correspond to different feature levels\n targets (list[BoxList): ground-truth boxes present in the image (optional)\n\n Returns:\n boxes (list[BoxList]): the predicted boxes from the RPN, one BoxList per\n image.\n losses (dict[Tensor]): the losses for the model during training. During\n testing, it is an empty dict.\n ' (objectness, rpn_box_regression) = self.head(features) anchors = self.anchor_generator(images, features) if self.training: return self._forward_train(anchors, objectness, rpn_box_regression, targets) else: return self._forward_test(anchors, objectness, rpn_box_regression)
def forward(self, images, features, targets=None): '\n Arguments:\n images (ImageList): images for which we want to compute the predictions\n features (list[Tensor]): features computed from the images that are\n used for computing the predictions. Each tensor in the list\n correspond to different feature levels\n targets (list[BoxList): ground-truth boxes present in the image (optional)\n\n Returns:\n boxes (list[BoxList]): the predicted boxes from the RPN, one BoxList per\n image.\n losses (dict[Tensor]): the losses for the model during training. During\n testing, it is an empty dict.\n ' (objectness, rpn_box_regression) = self.head(features) anchors = self.anchor_generator(images, features) if self.training: return self._forward_train(anchors, objectness, rpn_box_regression, targets) else: return self._forward_test(anchors, objectness, rpn_box_regression)<|docstring|>Arguments: images (ImageList): images for which we want to compute the predictions features (list[Tensor]): features computed from the images that are used for computing the predictions. Each tensor in the list correspond to different feature levels targets (list[BoxList): ground-truth boxes present in the image (optional) Returns: boxes (list[BoxList]): the predicted boxes from the RPN, one BoxList per image. losses (dict[Tensor]): the losses for the model during training. During testing, it is an empty dict.<|endoftext|>
35a29fb23923efbd589f4b3dae03944ea4f7b4dfe404a770ef7d634f6b12fbe1
@click.group() def main(): '\n DB Backup\n\n App allow to backup mysql database located in docker containers and send it into Object Storage.\n ' pass
DB Backup App allow to backup mysql database located in docker containers and send it into Object Storage.
src/db_backup.py
main
mkurc1/docker_db_backup
0
python
@click.group() def main(): '\n DB Backup\n\n App allow to backup mysql database located in docker containers and send it into Object Storage.\n ' pass
@click.group() def main(): '\n DB Backup\n\n App allow to backup mysql database located in docker containers and send it into Object Storage.\n ' pass<|docstring|>DB Backup App allow to backup mysql database located in docker containers and send it into Object Storage.<|endoftext|>
4bc57570e0d7ac0b76ef945bc24ad3a5de188959534ab1baf2b14f564675ea6f
@main.command('backup') def backup_cmd(): 'Process backup' backup = Backup() backup.process()
Process backup
src/db_backup.py
backup_cmd
mkurc1/docker_db_backup
0
python
@main.command('backup') def backup_cmd(): backup = Backup() backup.process()
@main.command('backup') def backup_cmd(): backup = Backup() backup.process()<|docstring|>Process backup<|endoftext|>
675657c4c9c628aeb212e19c9c8edb4e35a0ab44133a44db438745dd3ec53334
@main.command('list') def list_cmd(): 'List of all database connections' connection.list()
List of all database connections
src/db_backup.py
list_cmd
mkurc1/docker_db_backup
0
python
@main.command('list') def list_cmd(): connection.list()
@main.command('list') def list_cmd(): connection.list()<|docstring|>List of all database connections<|endoftext|>
4b8c407e085636e0adea220326c9c4cad7802332d04860c86ba36e7d3ac89034
@main.command('add') def add_cmd(): 'Add new connection' connection.add()
Add new connection
src/db_backup.py
add_cmd
mkurc1/docker_db_backup
0
python
@main.command('add') def add_cmd(): connection.add()
@main.command('add') def add_cmd(): connection.add()<|docstring|>Add new connection<|endoftext|>
96d335abd43b13a75ec7c509c106c9d155f05272451d01c0413f4f85e334d639
@main.command('edit') def edit_cmd(): 'Edit exist connection' connection.edit()
Edit exist connection
src/db_backup.py
edit_cmd
mkurc1/docker_db_backup
0
python
@main.command('edit') def edit_cmd(): connection.edit()
@main.command('edit') def edit_cmd(): connection.edit()<|docstring|>Edit exist connection<|endoftext|>
6a2d2de5f7b0cc6a5d179264f5968b49c318c845781f8a2a65380f949875c5b1
@main.command('remove') def edit_cmd(): 'Remove exist connection' connection.remove()
Remove exist connection
src/db_backup.py
edit_cmd
mkurc1/docker_db_backup
0
python
@main.command('remove') def edit_cmd(): connection.remove()
@main.command('remove') def edit_cmd(): connection.remove()<|docstring|>Remove exist connection<|endoftext|>
bf44565d270fd4ba6ebffb7aab0311aaf76be069faf936bf50363bdc20ba0fa2
def get_backend(path): '\n Return an instance of a registration backend, given the dotted\n Python import path (as a string) to the backend class.\n\n If the backend cannot be located (e.g., because no such module\n exists, or because the module does not contain a class of the\n appropriate name), ``django.core.exceptions.ImproperlyConfigured``\n is raised.\n \n ' i = path.rfind('.') (module, attr) = (path[:i], path[(i + 1):]) try: mod = import_module(module) except ImportError as e: raise ImproperlyConfigured(('Error loading registration backend %s: "%s"' % (module, e))) try: backend_class = getattr(mod, attr) except AttributeError: raise ImproperlyConfigured(('Module "%s" does not define a registration backend named "%s"' % (module, attr))) return backend_class()
Return an instance of a registration backend, given the dotted Python import path (as a string) to the backend class. If the backend cannot be located (e.g., because no such module exists, or because the module does not contain a class of the appropriate name), ``django.core.exceptions.ImproperlyConfigured`` is raised.
thirdpart/registration/backends/__init__.py
get_backend
drizzt/seahub
420
python
def get_backend(path): '\n Return an instance of a registration backend, given the dotted\n Python import path (as a string) to the backend class.\n\n If the backend cannot be located (e.g., because no such module\n exists, or because the module does not contain a class of the\n appropriate name), ``django.core.exceptions.ImproperlyConfigured``\n is raised.\n \n ' i = path.rfind('.') (module, attr) = (path[:i], path[(i + 1):]) try: mod = import_module(module) except ImportError as e: raise ImproperlyConfigured(('Error loading registration backend %s: "%s"' % (module, e))) try: backend_class = getattr(mod, attr) except AttributeError: raise ImproperlyConfigured(('Module "%s" does not define a registration backend named "%s"' % (module, attr))) return backend_class()
def get_backend(path): '\n Return an instance of a registration backend, given the dotted\n Python import path (as a string) to the backend class.\n\n If the backend cannot be located (e.g., because no such module\n exists, or because the module does not contain a class of the\n appropriate name), ``django.core.exceptions.ImproperlyConfigured``\n is raised.\n \n ' i = path.rfind('.') (module, attr) = (path[:i], path[(i + 1):]) try: mod = import_module(module) except ImportError as e: raise ImproperlyConfigured(('Error loading registration backend %s: "%s"' % (module, e))) try: backend_class = getattr(mod, attr) except AttributeError: raise ImproperlyConfigured(('Module "%s" does not define a registration backend named "%s"' % (module, attr))) return backend_class()<|docstring|>Return an instance of a registration backend, given the dotted Python import path (as a string) to the backend class. If the backend cannot be located (e.g., because no such module exists, or because the module does not contain a class of the appropriate name), ``django.core.exceptions.ImproperlyConfigured`` is raised.<|endoftext|>
7d5eaa90a38fd376706f24d3032514d7f3082a54ca02b91905102731f9552d19
def GetHoverControllers(wing_serial): 'Returns the hover controller gains.' if (wing_serial == m.kWingSerial01): low_altitude = {'kp': 1790.0, 'ki': 127.0, 'kd': 6330.0} high_altitude = {'kp': 687.0, 'ki': 40.6, 'kd': 2910.0} transform_tether_elevation = {'kp': 0.0, 'ki': (- 16.0), 'kd': 0.0} reel_tether_elevation = {'kp': 0.0, 'ki': 0.0375, 'kd': 0.0} roll = {'kp': 0.0, 'ki': 0.0, 'kd': 0.0} low_thrust_pitch = {'kp': 25200.0, 'ki': 1070.0, 'kd': 20600.0} pitch = {'kp': 52300.0, 'ki': 3310.0, 'kd': 30900.0} yaw = {'kp': 342000.0, 'ki': 27000.0, 'kd': 173000.0} tangential_short_tether = {'kp': 0.0115, 'ki': 0.000166, 'kd': 0.087} tangential_low_altitude_long_tether = {'kp': 0.0469, 'ki': 0.00169, 'kd': 0.193} tangential_high_altitude_long_tether = {'kp': 0.00713, 'ki': 4.56e-05, 'kd': 0.0331} radial = {'kp': 0.0, 'ki': 0.0, 'kd': (- 0.0581)} tension_hard = {'kp': 0.0, 'ki': 1.08e-05, 'kd': 0.0} tension_soft = {'kp': 0.0, 'ki': 1.08e-06, 'kd': 0.0} int_pitch = {'kp': 40600.0, 'ki': 536.0, 'kd': 0.0} int_yaw = {'kp': 46500.0, 'ki': 9250.0, 'kd': 0.0} elif (wing_serial == m.kWingSerial04Hover): low_altitude = {'kp': 1900.0, 'ki': 134.0, 'kd': 6680.0} high_altitude = {'kp': 729.0, 'ki': 43.1, 'kd': 3080.0} transform_tether_elevation = {'kp': 0.0, 'ki': (- 16.0), 'kd': 0.0} reel_tether_elevation = {'kp': 0.0, 'ki': 0.0375, 'kd': 0.0} roll = {'kp': 0.0, 'ki': 0.0, 'kd': 0.0} low_thrust_pitch = {'kp': 27400.0, 'ki': 1160.0, 'kd': 22300.0} pitch = {'kp': 57100.0, 'ki': 3620.0, 'kd': 33800.0} yaw = {'kp': 333000.0, 'ki': 26300.0, 'kd': 169000.0} tangential_short_tether = {'kp': 0.0115, 'ki': 0.000166, 'kd': 0.087} tangential_low_altitude_long_tether = {'kp': 0.0469, 'ki': 0.00169, 'kd': 0.193} tangential_high_altitude_long_tether = {'kp': 0.00713, 'ki': 4.56e-05, 'kd': 0.0331} radial = {'kp': 0.0, 'ki': 0.0, 'kd': (- 0.0574)} tension_hard = {'kp': 0.0, 'ki': 1.04e-05, 'kd': 0.0} tension_soft = {'kp': 0.0, 'ki': 1.04e-06, 'kd': 0.0} int_pitch = {'kp': 44600.0, 'ki': 588.0, 'kd': 0.0} int_yaw = {'kp': 45200.0, 'ki': 9010.0, 'kd': 0.0} elif (wing_serial == m.kWingSerial04Crosswind): low_altitude = {'kp': 1810.0, 'ki': 128.0, 'kd': 6390.0} high_altitude = {'kp': 694.0, 'ki': 41.0, 'kd': 2940.0} transform_tether_elevation = {'kp': 0.0, 'ki': (- 16.0), 'kd': 0.0} reel_tether_elevation = {'kp': 0.0, 'ki': 0.0375, 'kd': 0.0} roll = {'kp': 0.0, 'ki': 0.0, 'kd': 0.0} low_thrust_pitch = {'kp': 28400.0, 'ki': 1210.0, 'kd': 23200.0} pitch = {'kp': 59100.0, 'ki': 3750.0, 'kd': 35000.0} yaw = {'kp': 345000.0, 'ki': 27200.0, 'kd': 175000.0} tangential_short_tether = {'kp': 0.00937, 'ki': 0.000135, 'kd': 0.071} tangential_low_altitude_long_tether = {'kp': 0.0382, 'ki': 0.00138, 'kd': 0.157} tangential_high_altitude_long_tether = {'kp': 0.00582, 'ki': 3.72e-05, 'kd': 0.027} radial = {'kp': 0.0, 'ki': 0.0, 'kd': (- 0.0498)} tension_hard = {'kp': 0.0, 'ki': 1.08e-05, 'kd': 0.0} tension_soft = {'kp': 0.0, 'ki': 1.08e-06, 'kd': 0.0} int_pitch = {'kp': 45900.0, 'ki': 606.0, 'kd': 0.0} int_yaw = {'kp': 46800.0, 'ki': 9320.0, 'kd': 0.0} elif (wing_serial == m.kWingSerial05Hover): low_altitude = {'kp': 1860.0, 'ki': 132.0, 'kd': 6550.0} high_altitude = {'kp': 713.0, 'ki': 42.2, 'kd': 3020.0} transform_tether_elevation = {'kp': 0.0, 'ki': (- 16.0), 'kd': 0.0} reel_tether_elevation = {'kp': 0.0, 'ki': 0.0375, 'kd': 0.0} roll = {'kp': 0.0, 'ki': 0.0, 'kd': 0.0} low_thrust_pitch = {'kp': 26900.0, 'ki': 1140.0, 'kd': 21900.0} pitch = {'kp': 56000.0, 'ki': 3550.0, 'kd': 33100.0} yaw = {'kp': 327000.0, 'ki': 25800.0, 'kd': 165000.0} tangential_short_tether = {'kp': 0.0115, 'ki': 0.000166, 'kd': 0.087} tangential_low_altitude_long_tether = {'kp': 0.0469, 'ki': 0.00169, 'kd': 0.193} tangential_high_altitude_long_tether = {'kp': 0.00713, 'ki': 4.56e-05, 'kd': 0.0331} radial = {'kp': 0.0, 'ki': 0.0, 'kd': (- 0.0577)} tension_hard = {'kp': 0.0, 'ki': 1.06e-05, 'kd': 0.0} tension_soft = {'kp': 0.0, 'ki': 1.06e-06, 'kd': 0.0} int_pitch = {'kp': 43800.0, 'ki': 577.0, 'kd': 0.0} int_yaw = {'kp': 44400.0, 'ki': 8830.0, 'kd': 0.0} elif (wing_serial == m.kWingSerial05Crosswind): low_altitude = {'kp': 1770.0, 'ki': 126.0, 'kd': 6240.0} high_altitude = {'kp': 677.0, 'ki': 40.0, 'kd': 2860.0} transform_tether_elevation = {'kp': 0.0, 'ki': (- 16.0), 'kd': 0.0} reel_tether_elevation = {'kp': 0.0, 'ki': 0.0375, 'kd': 0.0} roll = {'kp': 0.0, 'ki': 0.0, 'kd': 0.0} low_thrust_pitch = {'kp': 27800.0, 'ki': 1180.0, 'kd': 22700.0} pitch = {'kp': 57800.0, 'ki': 3670.0, 'kd': 34200.0} yaw = {'kp': 337000.0, 'ki': 26600.0, 'kd': 171000.0} tangential_short_tether = {'kp': 0.00933, 'ki': 0.000135, 'kd': 0.0707} tangential_low_altitude_long_tether = {'kp': 0.0381, 'ki': 0.00137, 'kd': 0.157} tangential_high_altitude_long_tether = {'kp': 0.00579, 'ki': 3.71e-05, 'kd': 0.0269} radial = {'kp': 0.0, 'ki': 0.0, 'kd': (- 0.05)} tension_hard = {'kp': 0.0, 'ki': 1.1e-05, 'kd': 0.0} tension_soft = {'kp': 0.0, 'ki': 1.1e-06, 'kd': 0.0} int_pitch = {'kp': 44900.0, 'ki': 593.0, 'kd': 0.0} int_yaw = {'kp': 45800.0, 'ki': 9110.0, 'kd': 0.0} elif (wing_serial == m.kWingSerial06Hover): low_altitude = {'kp': 1900.0, 'ki': 135.0, 'kd': 6700.0} high_altitude = {'kp': 730.0, 'ki': 43.2, 'kd': 3090.0} transform_tether_elevation = {'kp': 0.0, 'ki': (- 16.0), 'kd': 0.0} reel_tether_elevation = {'kp': 0.0, 'ki': 0.0375, 'kd': 0.0} roll = {'kp': 0.0, 'ki': 0.0, 'kd': 0.0} low_thrust_pitch = {'kp': 27400.0, 'ki': 1160.0, 'kd': 22400.0} pitch = {'kp': 57100.0, 'ki': 3620.0, 'kd': 33800.0} yaw = {'kp': 334000.0, 'ki': 26400.0, 'kd': 169000.0} tangential_short_tether = {'kp': 0.0115, 'ki': 0.000166, 'kd': 0.087} tangential_low_altitude_long_tether = {'kp': 0.0469, 'ki': 0.00169, 'kd': 0.193} tangential_high_altitude_long_tether = {'kp': 0.00713, 'ki': 4.56e-05, 'kd': 0.0331} radial = {'kp': 0.0, 'ki': 0.0, 'kd': (- 0.0574)} tension_hard = {'kp': 0.0, 'ki': 1.04e-05, 'kd': 0.0} tension_soft = {'kp': 0.0, 'ki': 1.04e-06, 'kd': 0.0} int_pitch = {'kp': 44700.0, 'ki': 590.0, 'kd': 0.0} int_yaw = {'kp': 45300.0, 'ki': 9020.0, 'kd': 0.0} elif (wing_serial == m.kWingSerial06Crosswind): low_altitude = {'kp': 1810.0, 'ki': 128.0, 'kd': 6390.0} high_altitude = {'kp': 694.0, 'ki': 41.0, 'kd': 2940.0} transform_tether_elevation = {'kp': 0.0, 'ki': (- 16.0), 'kd': 0.0} reel_tether_elevation = {'kp': 0.0, 'ki': 0.0375, 'kd': 0.0} roll = {'kp': 0.0, 'ki': 0.0, 'kd': 0.0} low_thrust_pitch = {'kp': 28400.0, 'ki': 1210.0, 'kd': 23200.0} pitch = {'kp': 59100.0, 'ki': 3750.0, 'kd': 35000.0} yaw = {'kp': 345000.0, 'ki': 27200.0, 'kd': 175000.0} tangential_short_tether = {'kp': 0.00937, 'ki': 0.000135, 'kd': 0.0709} tangential_low_altitude_long_tether = {'kp': 0.0382, 'ki': 0.00138, 'kd': 0.157} tangential_high_altitude_long_tether = {'kp': 0.00582, 'ki': 3.72e-05, 'kd': 0.027} radial = {'kp': 0.0, 'ki': 0.0, 'kd': (- 0.0498)} tension_hard = {'kp': 0.0, 'ki': 1.08e-05, 'kd': 0.0} tension_soft = {'kp': 0.0, 'ki': 1.08e-06, 'kd': 0.0} int_pitch = {'kp': 45900.0, 'ki': 606.0, 'kd': 0.0} int_yaw = {'kp': 46800.0, 'ki': 9320.0, 'kd': 0.0} elif (wing_serial == m.kWingSerial07Hover): low_altitude = {'kp': 1900.0, 'ki': 134.0, 'kd': 6680.0} high_altitude = {'kp': 729.0, 'ki': 43.1, 'kd': 3080.0} transform_tether_elevation = {'kp': 0.0, 'ki': (- 16.0), 'kd': 0.0} reel_tether_elevation = {'kp': 0.0, 'ki': 0.0375, 'kd': 0.0} roll = {'kp': 0.0, 'ki': 0.0, 'kd': 0.0} low_thrust_pitch = {'kp': 27400.0, 'ki': 1160.0, 'kd': 22300.0} pitch = {'kp': 57100.0, 'ki': 3620.0, 'kd': 33800.0} yaw = {'kp': 333000.0, 'ki': 26300.0, 'kd': 169000.0} tangential_short_tether = {'kp': 0.0115, 'ki': 0.000166, 'kd': 0.087} tangential_low_altitude_long_tether = {'kp': 0.0469, 'ki': 0.00169, 'kd': 0.193} tangential_high_altitude_long_tether = {'kp': 0.00713, 'ki': 4.56e-05, 'kd': 0.0331} radial = {'kp': 0.0, 'ki': 0.0, 'kd': (- 0.0574)} tension_hard = {'kp': 0.0, 'ki': 1.04e-05, 'kd': 0.0} tension_soft = {'kp': 0.0, 'ki': 1.04e-06, 'kd': 0.0} int_pitch = {'kp': 44600.0, 'ki': 588.0, 'kd': 0.0} int_yaw = {'kp': 45200.0, 'ki': 9010.0, 'kd': 0.0} elif (wing_serial == m.kWingSerial07Crosswind): low_altitude = {'kp': 1810.0, 'ki': 128.0, 'kd': 6390.0} high_altitude = {'kp': 694.0, 'ki': 41.0, 'kd': 2940.0} transform_tether_elevation = {'kp': 0.0, 'ki': (- 16.0), 'kd': 0.0} reel_tether_elevation = {'kp': 0.0, 'ki': 0.0375, 'kd': 0.0} roll = {'kp': 0.0, 'ki': 0.0, 'kd': 0.0} low_thrust_pitch = {'kp': 28400.0, 'ki': 1210.0, 'kd': 23200.0} pitch = {'kp': 59100.0, 'ki': 3750.0, 'kd': 35000.0} yaw = {'kp': 345000.0, 'ki': 27200.0, 'kd': 175000.0} tangential_short_tether = {'kp': 0.00937, 'ki': 0.000135, 'kd': 0.071} tangential_low_altitude_long_tether = {'kp': 0.0382, 'ki': 0.00138, 'kd': 0.157} tangential_high_altitude_long_tether = {'kp': 0.00582, 'ki': 3.72e-05, 'kd': 0.027} radial = {'kp': 0.0, 'ki': 0.0, 'kd': (- 0.0498)} tension_hard = {'kp': 0.0, 'ki': 1.08e-05, 'kd': 0.0} tension_soft = {'kp': 0.0, 'ki': 1.08e-06, 'kd': 0.0} int_pitch = {'kp': 45900.0, 'ki': 606.0, 'kd': 0.0} int_yaw = {'kp': 46800.0, 'ki': 9320.0, 'kd': 0.0} else: assert False, ('wing_serial %d was not recognized' % wing_serial) return {'low_altitude': low_altitude, 'high_altitude': high_altitude, 'transform_tether_elevation': transform_tether_elevation, 'reel_tether_elevation': reel_tether_elevation, 'roll': roll, 'low_thrust_pitch': low_thrust_pitch, 'pitch': pitch, 'yaw': yaw, 'tangential_short_tether': tangential_short_tether, 'tangential_low_altitude_long_tether': tangential_low_altitude_long_tether, 'tangential_high_altitude_long_tether': tangential_high_altitude_long_tether, 'radial': radial, 'tension_hard': tension_hard, 'tension_soft': tension_soft, 'int_pitch': int_pitch, 'int_yaw': int_yaw}
Returns the hover controller gains.
config/m600/control/hover_controllers.py
GetHoverControllers
leozz37/makani
1,178
python
def GetHoverControllers(wing_serial): if (wing_serial == m.kWingSerial01): low_altitude = {'kp': 1790.0, 'ki': 127.0, 'kd': 6330.0} high_altitude = {'kp': 687.0, 'ki': 40.6, 'kd': 2910.0} transform_tether_elevation = {'kp': 0.0, 'ki': (- 16.0), 'kd': 0.0} reel_tether_elevation = {'kp': 0.0, 'ki': 0.0375, 'kd': 0.0} roll = {'kp': 0.0, 'ki': 0.0, 'kd': 0.0} low_thrust_pitch = {'kp': 25200.0, 'ki': 1070.0, 'kd': 20600.0} pitch = {'kp': 52300.0, 'ki': 3310.0, 'kd': 30900.0} yaw = {'kp': 342000.0, 'ki': 27000.0, 'kd': 173000.0} tangential_short_tether = {'kp': 0.0115, 'ki': 0.000166, 'kd': 0.087} tangential_low_altitude_long_tether = {'kp': 0.0469, 'ki': 0.00169, 'kd': 0.193} tangential_high_altitude_long_tether = {'kp': 0.00713, 'ki': 4.56e-05, 'kd': 0.0331} radial = {'kp': 0.0, 'ki': 0.0, 'kd': (- 0.0581)} tension_hard = {'kp': 0.0, 'ki': 1.08e-05, 'kd': 0.0} tension_soft = {'kp': 0.0, 'ki': 1.08e-06, 'kd': 0.0} int_pitch = {'kp': 40600.0, 'ki': 536.0, 'kd': 0.0} int_yaw = {'kp': 46500.0, 'ki': 9250.0, 'kd': 0.0} elif (wing_serial == m.kWingSerial04Hover): low_altitude = {'kp': 1900.0, 'ki': 134.0, 'kd': 6680.0} high_altitude = {'kp': 729.0, 'ki': 43.1, 'kd': 3080.0} transform_tether_elevation = {'kp': 0.0, 'ki': (- 16.0), 'kd': 0.0} reel_tether_elevation = {'kp': 0.0, 'ki': 0.0375, 'kd': 0.0} roll = {'kp': 0.0, 'ki': 0.0, 'kd': 0.0} low_thrust_pitch = {'kp': 27400.0, 'ki': 1160.0, 'kd': 22300.0} pitch = {'kp': 57100.0, 'ki': 3620.0, 'kd': 33800.0} yaw = {'kp': 333000.0, 'ki': 26300.0, 'kd': 169000.0} tangential_short_tether = {'kp': 0.0115, 'ki': 0.000166, 'kd': 0.087} tangential_low_altitude_long_tether = {'kp': 0.0469, 'ki': 0.00169, 'kd': 0.193} tangential_high_altitude_long_tether = {'kp': 0.00713, 'ki': 4.56e-05, 'kd': 0.0331} radial = {'kp': 0.0, 'ki': 0.0, 'kd': (- 0.0574)} tension_hard = {'kp': 0.0, 'ki': 1.04e-05, 'kd': 0.0} tension_soft = {'kp': 0.0, 'ki': 1.04e-06, 'kd': 0.0} int_pitch = {'kp': 44600.0, 'ki': 588.0, 'kd': 0.0} int_yaw = {'kp': 45200.0, 'ki': 9010.0, 'kd': 0.0} elif (wing_serial == m.kWingSerial04Crosswind): low_altitude = {'kp': 1810.0, 'ki': 128.0, 'kd': 6390.0} high_altitude = {'kp': 694.0, 'ki': 41.0, 'kd': 2940.0} transform_tether_elevation = {'kp': 0.0, 'ki': (- 16.0), 'kd': 0.0} reel_tether_elevation = {'kp': 0.0, 'ki': 0.0375, 'kd': 0.0} roll = {'kp': 0.0, 'ki': 0.0, 'kd': 0.0} low_thrust_pitch = {'kp': 28400.0, 'ki': 1210.0, 'kd': 23200.0} pitch = {'kp': 59100.0, 'ki': 3750.0, 'kd': 35000.0} yaw = {'kp': 345000.0, 'ki': 27200.0, 'kd': 175000.0} tangential_short_tether = {'kp': 0.00937, 'ki': 0.000135, 'kd': 0.071} tangential_low_altitude_long_tether = {'kp': 0.0382, 'ki': 0.00138, 'kd': 0.157} tangential_high_altitude_long_tether = {'kp': 0.00582, 'ki': 3.72e-05, 'kd': 0.027} radial = {'kp': 0.0, 'ki': 0.0, 'kd': (- 0.0498)} tension_hard = {'kp': 0.0, 'ki': 1.08e-05, 'kd': 0.0} tension_soft = {'kp': 0.0, 'ki': 1.08e-06, 'kd': 0.0} int_pitch = {'kp': 45900.0, 'ki': 606.0, 'kd': 0.0} int_yaw = {'kp': 46800.0, 'ki': 9320.0, 'kd': 0.0} elif (wing_serial == m.kWingSerial05Hover): low_altitude = {'kp': 1860.0, 'ki': 132.0, 'kd': 6550.0} high_altitude = {'kp': 713.0, 'ki': 42.2, 'kd': 3020.0} transform_tether_elevation = {'kp': 0.0, 'ki': (- 16.0), 'kd': 0.0} reel_tether_elevation = {'kp': 0.0, 'ki': 0.0375, 'kd': 0.0} roll = {'kp': 0.0, 'ki': 0.0, 'kd': 0.0} low_thrust_pitch = {'kp': 26900.0, 'ki': 1140.0, 'kd': 21900.0} pitch = {'kp': 56000.0, 'ki': 3550.0, 'kd': 33100.0} yaw = {'kp': 327000.0, 'ki': 25800.0, 'kd': 165000.0} tangential_short_tether = {'kp': 0.0115, 'ki': 0.000166, 'kd': 0.087} tangential_low_altitude_long_tether = {'kp': 0.0469, 'ki': 0.00169, 'kd': 0.193} tangential_high_altitude_long_tether = {'kp': 0.00713, 'ki': 4.56e-05, 'kd': 0.0331} radial = {'kp': 0.0, 'ki': 0.0, 'kd': (- 0.0577)} tension_hard = {'kp': 0.0, 'ki': 1.06e-05, 'kd': 0.0} tension_soft = {'kp': 0.0, 'ki': 1.06e-06, 'kd': 0.0} int_pitch = {'kp': 43800.0, 'ki': 577.0, 'kd': 0.0} int_yaw = {'kp': 44400.0, 'ki': 8830.0, 'kd': 0.0} elif (wing_serial == m.kWingSerial05Crosswind): low_altitude = {'kp': 1770.0, 'ki': 126.0, 'kd': 6240.0} high_altitude = {'kp': 677.0, 'ki': 40.0, 'kd': 2860.0} transform_tether_elevation = {'kp': 0.0, 'ki': (- 16.0), 'kd': 0.0} reel_tether_elevation = {'kp': 0.0, 'ki': 0.0375, 'kd': 0.0} roll = {'kp': 0.0, 'ki': 0.0, 'kd': 0.0} low_thrust_pitch = {'kp': 27800.0, 'ki': 1180.0, 'kd': 22700.0} pitch = {'kp': 57800.0, 'ki': 3670.0, 'kd': 34200.0} yaw = {'kp': 337000.0, 'ki': 26600.0, 'kd': 171000.0} tangential_short_tether = {'kp': 0.00933, 'ki': 0.000135, 'kd': 0.0707} tangential_low_altitude_long_tether = {'kp': 0.0381, 'ki': 0.00137, 'kd': 0.157} tangential_high_altitude_long_tether = {'kp': 0.00579, 'ki': 3.71e-05, 'kd': 0.0269} radial = {'kp': 0.0, 'ki': 0.0, 'kd': (- 0.05)} tension_hard = {'kp': 0.0, 'ki': 1.1e-05, 'kd': 0.0} tension_soft = {'kp': 0.0, 'ki': 1.1e-06, 'kd': 0.0} int_pitch = {'kp': 44900.0, 'ki': 593.0, 'kd': 0.0} int_yaw = {'kp': 45800.0, 'ki': 9110.0, 'kd': 0.0} elif (wing_serial == m.kWingSerial06Hover): low_altitude = {'kp': 1900.0, 'ki': 135.0, 'kd': 6700.0} high_altitude = {'kp': 730.0, 'ki': 43.2, 'kd': 3090.0} transform_tether_elevation = {'kp': 0.0, 'ki': (- 16.0), 'kd': 0.0} reel_tether_elevation = {'kp': 0.0, 'ki': 0.0375, 'kd': 0.0} roll = {'kp': 0.0, 'ki': 0.0, 'kd': 0.0} low_thrust_pitch = {'kp': 27400.0, 'ki': 1160.0, 'kd': 22400.0} pitch = {'kp': 57100.0, 'ki': 3620.0, 'kd': 33800.0} yaw = {'kp': 334000.0, 'ki': 26400.0, 'kd': 169000.0} tangential_short_tether = {'kp': 0.0115, 'ki': 0.000166, 'kd': 0.087} tangential_low_altitude_long_tether = {'kp': 0.0469, 'ki': 0.00169, 'kd': 0.193} tangential_high_altitude_long_tether = {'kp': 0.00713, 'ki': 4.56e-05, 'kd': 0.0331} radial = {'kp': 0.0, 'ki': 0.0, 'kd': (- 0.0574)} tension_hard = {'kp': 0.0, 'ki': 1.04e-05, 'kd': 0.0} tension_soft = {'kp': 0.0, 'ki': 1.04e-06, 'kd': 0.0} int_pitch = {'kp': 44700.0, 'ki': 590.0, 'kd': 0.0} int_yaw = {'kp': 45300.0, 'ki': 9020.0, 'kd': 0.0} elif (wing_serial == m.kWingSerial06Crosswind): low_altitude = {'kp': 1810.0, 'ki': 128.0, 'kd': 6390.0} high_altitude = {'kp': 694.0, 'ki': 41.0, 'kd': 2940.0} transform_tether_elevation = {'kp': 0.0, 'ki': (- 16.0), 'kd': 0.0} reel_tether_elevation = {'kp': 0.0, 'ki': 0.0375, 'kd': 0.0} roll = {'kp': 0.0, 'ki': 0.0, 'kd': 0.0} low_thrust_pitch = {'kp': 28400.0, 'ki': 1210.0, 'kd': 23200.0} pitch = {'kp': 59100.0, 'ki': 3750.0, 'kd': 35000.0} yaw = {'kp': 345000.0, 'ki': 27200.0, 'kd': 175000.0} tangential_short_tether = {'kp': 0.00937, 'ki': 0.000135, 'kd': 0.0709} tangential_low_altitude_long_tether = {'kp': 0.0382, 'ki': 0.00138, 'kd': 0.157} tangential_high_altitude_long_tether = {'kp': 0.00582, 'ki': 3.72e-05, 'kd': 0.027} radial = {'kp': 0.0, 'ki': 0.0, 'kd': (- 0.0498)} tension_hard = {'kp': 0.0, 'ki': 1.08e-05, 'kd': 0.0} tension_soft = {'kp': 0.0, 'ki': 1.08e-06, 'kd': 0.0} int_pitch = {'kp': 45900.0, 'ki': 606.0, 'kd': 0.0} int_yaw = {'kp': 46800.0, 'ki': 9320.0, 'kd': 0.0} elif (wing_serial == m.kWingSerial07Hover): low_altitude = {'kp': 1900.0, 'ki': 134.0, 'kd': 6680.0} high_altitude = {'kp': 729.0, 'ki': 43.1, 'kd': 3080.0} transform_tether_elevation = {'kp': 0.0, 'ki': (- 16.0), 'kd': 0.0} reel_tether_elevation = {'kp': 0.0, 'ki': 0.0375, 'kd': 0.0} roll = {'kp': 0.0, 'ki': 0.0, 'kd': 0.0} low_thrust_pitch = {'kp': 27400.0, 'ki': 1160.0, 'kd': 22300.0} pitch = {'kp': 57100.0, 'ki': 3620.0, 'kd': 33800.0} yaw = {'kp': 333000.0, 'ki': 26300.0, 'kd': 169000.0} tangential_short_tether = {'kp': 0.0115, 'ki': 0.000166, 'kd': 0.087} tangential_low_altitude_long_tether = {'kp': 0.0469, 'ki': 0.00169, 'kd': 0.193} tangential_high_altitude_long_tether = {'kp': 0.00713, 'ki': 4.56e-05, 'kd': 0.0331} radial = {'kp': 0.0, 'ki': 0.0, 'kd': (- 0.0574)} tension_hard = {'kp': 0.0, 'ki': 1.04e-05, 'kd': 0.0} tension_soft = {'kp': 0.0, 'ki': 1.04e-06, 'kd': 0.0} int_pitch = {'kp': 44600.0, 'ki': 588.0, 'kd': 0.0} int_yaw = {'kp': 45200.0, 'ki': 9010.0, 'kd': 0.0} elif (wing_serial == m.kWingSerial07Crosswind): low_altitude = {'kp': 1810.0, 'ki': 128.0, 'kd': 6390.0} high_altitude = {'kp': 694.0, 'ki': 41.0, 'kd': 2940.0} transform_tether_elevation = {'kp': 0.0, 'ki': (- 16.0), 'kd': 0.0} reel_tether_elevation = {'kp': 0.0, 'ki': 0.0375, 'kd': 0.0} roll = {'kp': 0.0, 'ki': 0.0, 'kd': 0.0} low_thrust_pitch = {'kp': 28400.0, 'ki': 1210.0, 'kd': 23200.0} pitch = {'kp': 59100.0, 'ki': 3750.0, 'kd': 35000.0} yaw = {'kp': 345000.0, 'ki': 27200.0, 'kd': 175000.0} tangential_short_tether = {'kp': 0.00937, 'ki': 0.000135, 'kd': 0.071} tangential_low_altitude_long_tether = {'kp': 0.0382, 'ki': 0.00138, 'kd': 0.157} tangential_high_altitude_long_tether = {'kp': 0.00582, 'ki': 3.72e-05, 'kd': 0.027} radial = {'kp': 0.0, 'ki': 0.0, 'kd': (- 0.0498)} tension_hard = {'kp': 0.0, 'ki': 1.08e-05, 'kd': 0.0} tension_soft = {'kp': 0.0, 'ki': 1.08e-06, 'kd': 0.0} int_pitch = {'kp': 45900.0, 'ki': 606.0, 'kd': 0.0} int_yaw = {'kp': 46800.0, 'ki': 9320.0, 'kd': 0.0} else: assert False, ('wing_serial %d was not recognized' % wing_serial) return {'low_altitude': low_altitude, 'high_altitude': high_altitude, 'transform_tether_elevation': transform_tether_elevation, 'reel_tether_elevation': reel_tether_elevation, 'roll': roll, 'low_thrust_pitch': low_thrust_pitch, 'pitch': pitch, 'yaw': yaw, 'tangential_short_tether': tangential_short_tether, 'tangential_low_altitude_long_tether': tangential_low_altitude_long_tether, 'tangential_high_altitude_long_tether': tangential_high_altitude_long_tether, 'radial': radial, 'tension_hard': tension_hard, 'tension_soft': tension_soft, 'int_pitch': int_pitch, 'int_yaw': int_yaw}
def GetHoverControllers(wing_serial): if (wing_serial == m.kWingSerial01): low_altitude = {'kp': 1790.0, 'ki': 127.0, 'kd': 6330.0} high_altitude = {'kp': 687.0, 'ki': 40.6, 'kd': 2910.0} transform_tether_elevation = {'kp': 0.0, 'ki': (- 16.0), 'kd': 0.0} reel_tether_elevation = {'kp': 0.0, 'ki': 0.0375, 'kd': 0.0} roll = {'kp': 0.0, 'ki': 0.0, 'kd': 0.0} low_thrust_pitch = {'kp': 25200.0, 'ki': 1070.0, 'kd': 20600.0} pitch = {'kp': 52300.0, 'ki': 3310.0, 'kd': 30900.0} yaw = {'kp': 342000.0, 'ki': 27000.0, 'kd': 173000.0} tangential_short_tether = {'kp': 0.0115, 'ki': 0.000166, 'kd': 0.087} tangential_low_altitude_long_tether = {'kp': 0.0469, 'ki': 0.00169, 'kd': 0.193} tangential_high_altitude_long_tether = {'kp': 0.00713, 'ki': 4.56e-05, 'kd': 0.0331} radial = {'kp': 0.0, 'ki': 0.0, 'kd': (- 0.0581)} tension_hard = {'kp': 0.0, 'ki': 1.08e-05, 'kd': 0.0} tension_soft = {'kp': 0.0, 'ki': 1.08e-06, 'kd': 0.0} int_pitch = {'kp': 40600.0, 'ki': 536.0, 'kd': 0.0} int_yaw = {'kp': 46500.0, 'ki': 9250.0, 'kd': 0.0} elif (wing_serial == m.kWingSerial04Hover): low_altitude = {'kp': 1900.0, 'ki': 134.0, 'kd': 6680.0} high_altitude = {'kp': 729.0, 'ki': 43.1, 'kd': 3080.0} transform_tether_elevation = {'kp': 0.0, 'ki': (- 16.0), 'kd': 0.0} reel_tether_elevation = {'kp': 0.0, 'ki': 0.0375, 'kd': 0.0} roll = {'kp': 0.0, 'ki': 0.0, 'kd': 0.0} low_thrust_pitch = {'kp': 27400.0, 'ki': 1160.0, 'kd': 22300.0} pitch = {'kp': 57100.0, 'ki': 3620.0, 'kd': 33800.0} yaw = {'kp': 333000.0, 'ki': 26300.0, 'kd': 169000.0} tangential_short_tether = {'kp': 0.0115, 'ki': 0.000166, 'kd': 0.087} tangential_low_altitude_long_tether = {'kp': 0.0469, 'ki': 0.00169, 'kd': 0.193} tangential_high_altitude_long_tether = {'kp': 0.00713, 'ki': 4.56e-05, 'kd': 0.0331} radial = {'kp': 0.0, 'ki': 0.0, 'kd': (- 0.0574)} tension_hard = {'kp': 0.0, 'ki': 1.04e-05, 'kd': 0.0} tension_soft = {'kp': 0.0, 'ki': 1.04e-06, 'kd': 0.0} int_pitch = {'kp': 44600.0, 'ki': 588.0, 'kd': 0.0} int_yaw = {'kp': 45200.0, 'ki': 9010.0, 'kd': 0.0} elif (wing_serial == m.kWingSerial04Crosswind): low_altitude = {'kp': 1810.0, 'ki': 128.0, 'kd': 6390.0} high_altitude = {'kp': 694.0, 'ki': 41.0, 'kd': 2940.0} transform_tether_elevation = {'kp': 0.0, 'ki': (- 16.0), 'kd': 0.0} reel_tether_elevation = {'kp': 0.0, 'ki': 0.0375, 'kd': 0.0} roll = {'kp': 0.0, 'ki': 0.0, 'kd': 0.0} low_thrust_pitch = {'kp': 28400.0, 'ki': 1210.0, 'kd': 23200.0} pitch = {'kp': 59100.0, 'ki': 3750.0, 'kd': 35000.0} yaw = {'kp': 345000.0, 'ki': 27200.0, 'kd': 175000.0} tangential_short_tether = {'kp': 0.00937, 'ki': 0.000135, 'kd': 0.071} tangential_low_altitude_long_tether = {'kp': 0.0382, 'ki': 0.00138, 'kd': 0.157} tangential_high_altitude_long_tether = {'kp': 0.00582, 'ki': 3.72e-05, 'kd': 0.027} radial = {'kp': 0.0, 'ki': 0.0, 'kd': (- 0.0498)} tension_hard = {'kp': 0.0, 'ki': 1.08e-05, 'kd': 0.0} tension_soft = {'kp': 0.0, 'ki': 1.08e-06, 'kd': 0.0} int_pitch = {'kp': 45900.0, 'ki': 606.0, 'kd': 0.0} int_yaw = {'kp': 46800.0, 'ki': 9320.0, 'kd': 0.0} elif (wing_serial == m.kWingSerial05Hover): low_altitude = {'kp': 1860.0, 'ki': 132.0, 'kd': 6550.0} high_altitude = {'kp': 713.0, 'ki': 42.2, 'kd': 3020.0} transform_tether_elevation = {'kp': 0.0, 'ki': (- 16.0), 'kd': 0.0} reel_tether_elevation = {'kp': 0.0, 'ki': 0.0375, 'kd': 0.0} roll = {'kp': 0.0, 'ki': 0.0, 'kd': 0.0} low_thrust_pitch = {'kp': 26900.0, 'ki': 1140.0, 'kd': 21900.0} pitch = {'kp': 56000.0, 'ki': 3550.0, 'kd': 33100.0} yaw = {'kp': 327000.0, 'ki': 25800.0, 'kd': 165000.0} tangential_short_tether = {'kp': 0.0115, 'ki': 0.000166, 'kd': 0.087} tangential_low_altitude_long_tether = {'kp': 0.0469, 'ki': 0.00169, 'kd': 0.193} tangential_high_altitude_long_tether = {'kp': 0.00713, 'ki': 4.56e-05, 'kd': 0.0331} radial = {'kp': 0.0, 'ki': 0.0, 'kd': (- 0.0577)} tension_hard = {'kp': 0.0, 'ki': 1.06e-05, 'kd': 0.0} tension_soft = {'kp': 0.0, 'ki': 1.06e-06, 'kd': 0.0} int_pitch = {'kp': 43800.0, 'ki': 577.0, 'kd': 0.0} int_yaw = {'kp': 44400.0, 'ki': 8830.0, 'kd': 0.0} elif (wing_serial == m.kWingSerial05Crosswind): low_altitude = {'kp': 1770.0, 'ki': 126.0, 'kd': 6240.0} high_altitude = {'kp': 677.0, 'ki': 40.0, 'kd': 2860.0} transform_tether_elevation = {'kp': 0.0, 'ki': (- 16.0), 'kd': 0.0} reel_tether_elevation = {'kp': 0.0, 'ki': 0.0375, 'kd': 0.0} roll = {'kp': 0.0, 'ki': 0.0, 'kd': 0.0} low_thrust_pitch = {'kp': 27800.0, 'ki': 1180.0, 'kd': 22700.0} pitch = {'kp': 57800.0, 'ki': 3670.0, 'kd': 34200.0} yaw = {'kp': 337000.0, 'ki': 26600.0, 'kd': 171000.0} tangential_short_tether = {'kp': 0.00933, 'ki': 0.000135, 'kd': 0.0707} tangential_low_altitude_long_tether = {'kp': 0.0381, 'ki': 0.00137, 'kd': 0.157} tangential_high_altitude_long_tether = {'kp': 0.00579, 'ki': 3.71e-05, 'kd': 0.0269} radial = {'kp': 0.0, 'ki': 0.0, 'kd': (- 0.05)} tension_hard = {'kp': 0.0, 'ki': 1.1e-05, 'kd': 0.0} tension_soft = {'kp': 0.0, 'ki': 1.1e-06, 'kd': 0.0} int_pitch = {'kp': 44900.0, 'ki': 593.0, 'kd': 0.0} int_yaw = {'kp': 45800.0, 'ki': 9110.0, 'kd': 0.0} elif (wing_serial == m.kWingSerial06Hover): low_altitude = {'kp': 1900.0, 'ki': 135.0, 'kd': 6700.0} high_altitude = {'kp': 730.0, 'ki': 43.2, 'kd': 3090.0} transform_tether_elevation = {'kp': 0.0, 'ki': (- 16.0), 'kd': 0.0} reel_tether_elevation = {'kp': 0.0, 'ki': 0.0375, 'kd': 0.0} roll = {'kp': 0.0, 'ki': 0.0, 'kd': 0.0} low_thrust_pitch = {'kp': 27400.0, 'ki': 1160.0, 'kd': 22400.0} pitch = {'kp': 57100.0, 'ki': 3620.0, 'kd': 33800.0} yaw = {'kp': 334000.0, 'ki': 26400.0, 'kd': 169000.0} tangential_short_tether = {'kp': 0.0115, 'ki': 0.000166, 'kd': 0.087} tangential_low_altitude_long_tether = {'kp': 0.0469, 'ki': 0.00169, 'kd': 0.193} tangential_high_altitude_long_tether = {'kp': 0.00713, 'ki': 4.56e-05, 'kd': 0.0331} radial = {'kp': 0.0, 'ki': 0.0, 'kd': (- 0.0574)} tension_hard = {'kp': 0.0, 'ki': 1.04e-05, 'kd': 0.0} tension_soft = {'kp': 0.0, 'ki': 1.04e-06, 'kd': 0.0} int_pitch = {'kp': 44700.0, 'ki': 590.0, 'kd': 0.0} int_yaw = {'kp': 45300.0, 'ki': 9020.0, 'kd': 0.0} elif (wing_serial == m.kWingSerial06Crosswind): low_altitude = {'kp': 1810.0, 'ki': 128.0, 'kd': 6390.0} high_altitude = {'kp': 694.0, 'ki': 41.0, 'kd': 2940.0} transform_tether_elevation = {'kp': 0.0, 'ki': (- 16.0), 'kd': 0.0} reel_tether_elevation = {'kp': 0.0, 'ki': 0.0375, 'kd': 0.0} roll = {'kp': 0.0, 'ki': 0.0, 'kd': 0.0} low_thrust_pitch = {'kp': 28400.0, 'ki': 1210.0, 'kd': 23200.0} pitch = {'kp': 59100.0, 'ki': 3750.0, 'kd': 35000.0} yaw = {'kp': 345000.0, 'ki': 27200.0, 'kd': 175000.0} tangential_short_tether = {'kp': 0.00937, 'ki': 0.000135, 'kd': 0.0709} tangential_low_altitude_long_tether = {'kp': 0.0382, 'ki': 0.00138, 'kd': 0.157} tangential_high_altitude_long_tether = {'kp': 0.00582, 'ki': 3.72e-05, 'kd': 0.027} radial = {'kp': 0.0, 'ki': 0.0, 'kd': (- 0.0498)} tension_hard = {'kp': 0.0, 'ki': 1.08e-05, 'kd': 0.0} tension_soft = {'kp': 0.0, 'ki': 1.08e-06, 'kd': 0.0} int_pitch = {'kp': 45900.0, 'ki': 606.0, 'kd': 0.0} int_yaw = {'kp': 46800.0, 'ki': 9320.0, 'kd': 0.0} elif (wing_serial == m.kWingSerial07Hover): low_altitude = {'kp': 1900.0, 'ki': 134.0, 'kd': 6680.0} high_altitude = {'kp': 729.0, 'ki': 43.1, 'kd': 3080.0} transform_tether_elevation = {'kp': 0.0, 'ki': (- 16.0), 'kd': 0.0} reel_tether_elevation = {'kp': 0.0, 'ki': 0.0375, 'kd': 0.0} roll = {'kp': 0.0, 'ki': 0.0, 'kd': 0.0} low_thrust_pitch = {'kp': 27400.0, 'ki': 1160.0, 'kd': 22300.0} pitch = {'kp': 57100.0, 'ki': 3620.0, 'kd': 33800.0} yaw = {'kp': 333000.0, 'ki': 26300.0, 'kd': 169000.0} tangential_short_tether = {'kp': 0.0115, 'ki': 0.000166, 'kd': 0.087} tangential_low_altitude_long_tether = {'kp': 0.0469, 'ki': 0.00169, 'kd': 0.193} tangential_high_altitude_long_tether = {'kp': 0.00713, 'ki': 4.56e-05, 'kd': 0.0331} radial = {'kp': 0.0, 'ki': 0.0, 'kd': (- 0.0574)} tension_hard = {'kp': 0.0, 'ki': 1.04e-05, 'kd': 0.0} tension_soft = {'kp': 0.0, 'ki': 1.04e-06, 'kd': 0.0} int_pitch = {'kp': 44600.0, 'ki': 588.0, 'kd': 0.0} int_yaw = {'kp': 45200.0, 'ki': 9010.0, 'kd': 0.0} elif (wing_serial == m.kWingSerial07Crosswind): low_altitude = {'kp': 1810.0, 'ki': 128.0, 'kd': 6390.0} high_altitude = {'kp': 694.0, 'ki': 41.0, 'kd': 2940.0} transform_tether_elevation = {'kp': 0.0, 'ki': (- 16.0), 'kd': 0.0} reel_tether_elevation = {'kp': 0.0, 'ki': 0.0375, 'kd': 0.0} roll = {'kp': 0.0, 'ki': 0.0, 'kd': 0.0} low_thrust_pitch = {'kp': 28400.0, 'ki': 1210.0, 'kd': 23200.0} pitch = {'kp': 59100.0, 'ki': 3750.0, 'kd': 35000.0} yaw = {'kp': 345000.0, 'ki': 27200.0, 'kd': 175000.0} tangential_short_tether = {'kp': 0.00937, 'ki': 0.000135, 'kd': 0.071} tangential_low_altitude_long_tether = {'kp': 0.0382, 'ki': 0.00138, 'kd': 0.157} tangential_high_altitude_long_tether = {'kp': 0.00582, 'ki': 3.72e-05, 'kd': 0.027} radial = {'kp': 0.0, 'ki': 0.0, 'kd': (- 0.0498)} tension_hard = {'kp': 0.0, 'ki': 1.08e-05, 'kd': 0.0} tension_soft = {'kp': 0.0, 'ki': 1.08e-06, 'kd': 0.0} int_pitch = {'kp': 45900.0, 'ki': 606.0, 'kd': 0.0} int_yaw = {'kp': 46800.0, 'ki': 9320.0, 'kd': 0.0} else: assert False, ('wing_serial %d was not recognized' % wing_serial) return {'low_altitude': low_altitude, 'high_altitude': high_altitude, 'transform_tether_elevation': transform_tether_elevation, 'reel_tether_elevation': reel_tether_elevation, 'roll': roll, 'low_thrust_pitch': low_thrust_pitch, 'pitch': pitch, 'yaw': yaw, 'tangential_short_tether': tangential_short_tether, 'tangential_low_altitude_long_tether': tangential_low_altitude_long_tether, 'tangential_high_altitude_long_tether': tangential_high_altitude_long_tether, 'radial': radial, 'tension_hard': tension_hard, 'tension_soft': tension_soft, 'int_pitch': int_pitch, 'int_yaw': int_yaw}<|docstring|>Returns the hover controller gains.<|endoftext|>
dc293822bbcae810f75527a120cc0bb6b5215f3d4b8f61e435e014b47786d93f
def __init__(self, ignore=(SystemExit,), message=("Command '%s' failed, exiting: " % sys.argv[0]), status=None): '\n On exceptions log exception and optionally sys.exit.\n\n ignore -- exceptions classes to ignore\n message -- log message on exception\n status -- exit status on non ignored exception, None to prevent exit\n ' self.ignore = ignore self.message = message self.status = status
On exceptions log exception and optionally sys.exit. ignore -- exceptions classes to ignore message -- log message on exception status -- exit status on non ignored exception, None to prevent exit
rocky/process.py
__init__
Berjiz/rocky
1
python
def __init__(self, ignore=(SystemExit,), message=("Command '%s' failed, exiting: " % sys.argv[0]), status=None): '\n On exceptions log exception and optionally sys.exit.\n\n ignore -- exceptions classes to ignore\n message -- log message on exception\n status -- exit status on non ignored exception, None to prevent exit\n ' self.ignore = ignore self.message = message self.status = status
def __init__(self, ignore=(SystemExit,), message=("Command '%s' failed, exiting: " % sys.argv[0]), status=None): '\n On exceptions log exception and optionally sys.exit.\n\n ignore -- exceptions classes to ignore\n message -- log message on exception\n status -- exit status on non ignored exception, None to prevent exit\n ' self.ignore = ignore self.message = message self.status = status<|docstring|>On exceptions log exception and optionally sys.exit. ignore -- exceptions classes to ignore message -- log message on exception status -- exit status on non ignored exception, None to prevent exit<|endoftext|>
177826e16947c76e74d2612291095342a6dd81289a47a12592ddd0ee81facdd9
def __init__(self, signums=(), handler=None): '\n signums -- iterable on signals to handle\n handler -- signal handler taking signum and frame\n ' self.existing_handlers = {} self.signums = signums self.handler = (handler or self.on_signal)
signums -- iterable on signals to handle handler -- signal handler taking signum and frame
rocky/process.py
__init__
Berjiz/rocky
1
python
def __init__(self, signums=(), handler=None): '\n signums -- iterable on signals to handle\n handler -- signal handler taking signum and frame\n ' self.existing_handlers = {} self.signums = signums self.handler = (handler or self.on_signal)
def __init__(self, signums=(), handler=None): '\n signums -- iterable on signals to handle\n handler -- signal handler taking signum and frame\n ' self.existing_handlers = {} self.signums = signums self.handler = (handler or self.on_signal)<|docstring|>signums -- iterable on signals to handle handler -- signal handler taking signum and frame<|endoftext|>
82a62d231e31a55c5f3ea736adb35a265a1f9d1348115a8a46e66607800356ea
def on_signal(self, signum, frame): ' Called on singals unless handler was set in constructor. ' pass
Called on singals unless handler was set in constructor.
rocky/process.py
on_signal
Berjiz/rocky
1
python
def on_signal(self, signum, frame): ' ' pass
def on_signal(self, signum, frame): ' ' pass<|docstring|>Called on singals unless handler was set in constructor.<|endoftext|>
da0e4893cce4e15d6af87b7d22e44a74aff40aab071a8e2f0503e03ee38dd637
def __init__(self, signums=(SIGINT,), count=4): '\n signums -- iterable on signals to handle\n count -- signals received before sys.exit\n ' super().__init__(signums=signums) self._stop = False self._count = count
signums -- iterable on signals to handle count -- signals received before sys.exit
rocky/process.py
__init__
Berjiz/rocky
1
python
def __init__(self, signums=(SIGINT,), count=4): '\n signums -- iterable on signals to handle\n count -- signals received before sys.exit\n ' super().__init__(signums=signums) self._stop = False self._count = count
def __init__(self, signums=(SIGINT,), count=4): '\n signums -- iterable on signals to handle\n count -- signals received before sys.exit\n ' super().__init__(signums=signums) self._stop = False self._count = count<|docstring|>signums -- iterable on signals to handle count -- signals received before sys.exit<|endoftext|>
5ec835cf12411d6999916b868db0f07a744825cd34dc888698550964bbeca84a
def check_stop(self, throw=True): ' Raise SystemExit if stop flag is set. If throw is False, it will not raise exception but return the\n stop property, this can be useful if it is more convenient to pass this method as a callable. ' if (throw and self._stop): raise SystemExit() return self._stop
Raise SystemExit if stop flag is set. If throw is False, it will not raise exception but return the stop property, this can be useful if it is more convenient to pass this method as a callable.
rocky/process.py
check_stop
Berjiz/rocky
1
python
def check_stop(self, throw=True): ' Raise SystemExit if stop flag is set. If throw is False, it will not raise exception but return the\n stop property, this can be useful if it is more convenient to pass this method as a callable. ' if (throw and self._stop): raise SystemExit() return self._stop
def check_stop(self, throw=True): ' Raise SystemExit if stop flag is set. If throw is False, it will not raise exception but return the\n stop property, this can be useful if it is more convenient to pass this method as a callable. ' if (throw and self._stop): raise SystemExit() return self._stop<|docstring|>Raise SystemExit if stop flag is set. If throw is False, it will not raise exception but return the stop property, this can be useful if it is more convenient to pass this method as a callable.<|endoftext|>
053ddf4f2a7ee00fd0cb38a0b3a12ae42dc9e5c4b35e680beef8c95a44a98cbc
@property def stop(self): ' Set to true when stop is requested, can also be set to true explicitly if stopping is wanted. ' return self._stop
Set to true when stop is requested, can also be set to true explicitly if stopping is wanted.
rocky/process.py
stop
Berjiz/rocky
1
python
@property def stop(self): ' ' return self._stop
@property def stop(self): ' ' return self._stop<|docstring|>Set to true when stop is requested, can also be set to true explicitly if stopping is wanted.<|endoftext|>
9863ce8c2d8d5e568dde8c9fe862c7ba80490d7a86bb5dd152f434743902211a
@property def go_on(self): ' The inverse of stop. ' return (not self._stop)
The inverse of stop.
rocky/process.py
go_on
Berjiz/rocky
1
python
@property def go_on(self): ' ' return (not self._stop)
@property def go_on(self): ' ' return (not self._stop)<|docstring|>The inverse of stop.<|endoftext|>
bc05ca0dbf75aa508a58a545f78465504c5afcac6027e17ee3d4c0a4970ddc81
def __init__(self, signums=(SIGUSR1,)): '\n signums -- iterable on signals to dump stack for\n ' super().__init__(signums=signums)
signums -- iterable on signals to dump stack for
rocky/process.py
__init__
Berjiz/rocky
1
python
def __init__(self, signums=(SIGUSR1,)): '\n \n ' super().__init__(signums=signums)
def __init__(self, signums=(SIGUSR1,)): '\n \n ' super().__init__(signums=signums)<|docstring|>signums -- iterable on signals to dump stack for<|endoftext|>
ac7b3ad751619b971257fe067b00c45b1de7b3851fbdab4455641b9a81dd93f2
def __init__(self, filename=None, dirname=DEFAULT_PID_DIR, basename=None, max_age=None, max_age_callback=None, existing_callback=None, dead_callback=None): '\n filename -- pid file, will be dirname / basename if not set (available as property)\n dirname -- the directory to put pid file in of filename is not set\n basename -- default based on sys.argv[0]\n max_age -- max age seconds of existing process before max age event (available as property), forever if None\n max_age_callback -- se class description\n existing_callback -- se class description\n dead_callback -- se class description\n ' self.progname = os.path.basename(sys.argv[0]) self.dirname = dirname self.basename = (basename or (self.progname + '.pid')) self.filename = (filename or os.path.join(self.dirname, self.basename)) self.max_age = max_age self.max_age_callback = max_age_callback self.existing_callback = existing_callback self.dead_callback = dead_callback self.created = False
filename -- pid file, will be dirname / basename if not set (available as property) dirname -- the directory to put pid file in of filename is not set basename -- default based on sys.argv[0] max_age -- max age seconds of existing process before max age event (available as property), forever if None max_age_callback -- se class description existing_callback -- se class description dead_callback -- se class description
rocky/process.py
__init__
Berjiz/rocky
1
python
def __init__(self, filename=None, dirname=DEFAULT_PID_DIR, basename=None, max_age=None, max_age_callback=None, existing_callback=None, dead_callback=None): '\n filename -- pid file, will be dirname / basename if not set (available as property)\n dirname -- the directory to put pid file in of filename is not set\n basename -- default based on sys.argv[0]\n max_age -- max age seconds of existing process before max age event (available as property), forever if None\n max_age_callback -- se class description\n existing_callback -- se class description\n dead_callback -- se class description\n ' self.progname = os.path.basename(sys.argv[0]) self.dirname = dirname self.basename = (basename or (self.progname + '.pid')) self.filename = (filename or os.path.join(self.dirname, self.basename)) self.max_age = max_age self.max_age_callback = max_age_callback self.existing_callback = existing_callback self.dead_callback = dead_callback self.created = False
def __init__(self, filename=None, dirname=DEFAULT_PID_DIR, basename=None, max_age=None, max_age_callback=None, existing_callback=None, dead_callback=None): '\n filename -- pid file, will be dirname / basename if not set (available as property)\n dirname -- the directory to put pid file in of filename is not set\n basename -- default based on sys.argv[0]\n max_age -- max age seconds of existing process before max age event (available as property), forever if None\n max_age_callback -- se class description\n existing_callback -- se class description\n dead_callback -- se class description\n ' self.progname = os.path.basename(sys.argv[0]) self.dirname = dirname self.basename = (basename or (self.progname + '.pid')) self.filename = (filename or os.path.join(self.dirname, self.basename)) self.max_age = max_age self.max_age_callback = max_age_callback self.existing_callback = existing_callback self.dead_callback = dead_callback self.created = False<|docstring|>filename -- pid file, will be dirname / basename if not set (available as property) dirname -- the directory to put pid file in of filename is not set basename -- default based on sys.argv[0] max_age -- max age seconds of existing process before max age event (available as property), forever if None max_age_callback -- se class description existing_callback -- se class description dead_callback -- se class description<|endoftext|>
d7df74cedbca4c0b079cfb88c580239be05a9ad94c5358bab10beb2e513c8349
def on_existing(self, pid, age): '\n Called when the process in the pid file is alive but was created less than. Return true if pid cretion should\n be retried (this requires killing the other process, or it will be a loop). Return\n false to continue without a pid file.\n\n Default behaviour is to info log and raise SystemExit.\n\n pid -- pid of existing process\n age -- age of the other process\n ' if self.existing_callback: return self.existing_callback(pid, age) logger.info(('other %s with pid %d still running, stopping' % (self.progname, pid))) raise SystemExit()
Called when the process in the pid file is alive but was created less than. Return true if pid cretion should be retried (this requires killing the other process, or it will be a loop). Return false to continue without a pid file. Default behaviour is to info log and raise SystemExit. pid -- pid of existing process age -- age of the other process
rocky/process.py
on_existing
Berjiz/rocky
1
python
def on_existing(self, pid, age): '\n Called when the process in the pid file is alive but was created less than. Return true if pid cretion should\n be retried (this requires killing the other process, or it will be a loop). Return\n false to continue without a pid file.\n\n Default behaviour is to info log and raise SystemExit.\n\n pid -- pid of existing process\n age -- age of the other process\n ' if self.existing_callback: return self.existing_callback(pid, age) logger.info(('other %s with pid %d still running, stopping' % (self.progname, pid))) raise SystemExit()
def on_existing(self, pid, age): '\n Called when the process in the pid file is alive but was created less than. Return true if pid cretion should\n be retried (this requires killing the other process, or it will be a loop). Return\n false to continue without a pid file.\n\n Default behaviour is to info log and raise SystemExit.\n\n pid -- pid of existing process\n age -- age of the other process\n ' if self.existing_callback: return self.existing_callback(pid, age) logger.info(('other %s with pid %d still running, stopping' % (self.progname, pid))) raise SystemExit()<|docstring|>Called when the process in the pid file is alive but was created less than. Return true if pid cretion should be retried (this requires killing the other process, or it will be a loop). Return false to continue without a pid file. Default behaviour is to info log and raise SystemExit. pid -- pid of existing process age -- age of the other process<|endoftext|>
2fb20a7b476305f4435a9eee1897a0ca0ebd81026a522bc9f6467aa0bf112357
def on_max_age(self, pid, age): '\n Called when the process in the pid file is alive but was created more than max_age seconds ago. Return true\n if pid cretion should be retried (this requires killing the other process, or it will be a loop). Return\n false to continue without a pid file.\n\n Default behaviour is to log a warning and raise SystemExit.\n\n pid -- pid of existing process\n age -- age of the other process\n ' if self.max_age_callback: return self.max_age_callback(pid, age) logger.warning(("age of other process with pid %d exceeds max age, %ds > %ds, pid file '%s', stopping" % (pid, age, self.max_age, self.filename))) raise SystemExit()
Called when the process in the pid file is alive but was created more than max_age seconds ago. Return true if pid cretion should be retried (this requires killing the other process, or it will be a loop). Return false to continue without a pid file. Default behaviour is to log a warning and raise SystemExit. pid -- pid of existing process age -- age of the other process
rocky/process.py
on_max_age
Berjiz/rocky
1
python
def on_max_age(self, pid, age): '\n Called when the process in the pid file is alive but was created more than max_age seconds ago. Return true\n if pid cretion should be retried (this requires killing the other process, or it will be a loop). Return\n false to continue without a pid file.\n\n Default behaviour is to log a warning and raise SystemExit.\n\n pid -- pid of existing process\n age -- age of the other process\n ' if self.max_age_callback: return self.max_age_callback(pid, age) logger.warning(("age of other process with pid %d exceeds max age, %ds > %ds, pid file '%s', stopping" % (pid, age, self.max_age, self.filename))) raise SystemExit()
def on_max_age(self, pid, age): '\n Called when the process in the pid file is alive but was created more than max_age seconds ago. Return true\n if pid cretion should be retried (this requires killing the other process, or it will be a loop). Return\n false to continue without a pid file.\n\n Default behaviour is to log a warning and raise SystemExit.\n\n pid -- pid of existing process\n age -- age of the other process\n ' if self.max_age_callback: return self.max_age_callback(pid, age) logger.warning(("age of other process with pid %d exceeds max age, %ds > %ds, pid file '%s', stopping" % (pid, age, self.max_age, self.filename))) raise SystemExit()<|docstring|>Called when the process in the pid file is alive but was created more than max_age seconds ago. Return true if pid cretion should be retried (this requires killing the other process, or it will be a loop). Return false to continue without a pid file. Default behaviour is to log a warning and raise SystemExit. pid -- pid of existing process age -- age of the other process<|endoftext|>
a57dac79d84bb285d46f22edd1c3f5e370fb5ed8f74188e319cac5c37652419f
def on_dead(self, pid): '\n Called when the process in the pid file is dead. Return true if pid cretion should be retried (this requires\n removing the pid file).Return\n false to continue without a pid file.\n\n Default behaviour is to log a warning a warning then remove file and retry).\n\n pid -- pid of existing process\n ' if self.dead_callback: return self.dead_callback(pid) logger.warning(("process %d from pid file '%s' does not exist but pid file do, last run of %s failed fatally" % (pid, self.filename, self.progname))) os.remove(self.filename) return True
Called when the process in the pid file is dead. Return true if pid cretion should be retried (this requires removing the pid file).Return false to continue without a pid file. Default behaviour is to log a warning a warning then remove file and retry). pid -- pid of existing process
rocky/process.py
on_dead
Berjiz/rocky
1
python
def on_dead(self, pid): '\n Called when the process in the pid file is dead. Return true if pid cretion should be retried (this requires\n removing the pid file).Return\n false to continue without a pid file.\n\n Default behaviour is to log a warning a warning then remove file and retry).\n\n pid -- pid of existing process\n ' if self.dead_callback: return self.dead_callback(pid) logger.warning(("process %d from pid file '%s' does not exist but pid file do, last run of %s failed fatally" % (pid, self.filename, self.progname))) os.remove(self.filename) return True
def on_dead(self, pid): '\n Called when the process in the pid file is dead. Return true if pid cretion should be retried (this requires\n removing the pid file).Return\n false to continue without a pid file.\n\n Default behaviour is to log a warning a warning then remove file and retry).\n\n pid -- pid of existing process\n ' if self.dead_callback: return self.dead_callback(pid) logger.warning(("process %d from pid file '%s' does not exist but pid file do, last run of %s failed fatally" % (pid, self.filename, self.progname))) os.remove(self.filename) return True<|docstring|>Called when the process in the pid file is dead. Return true if pid cretion should be retried (this requires removing the pid file).Return false to continue without a pid file. Default behaviour is to log a warning a warning then remove file and retry). pid -- pid of existing process<|endoftext|>
73dad41136ecc86447d076a5aa62c0a04aea829044bc9b957a44daea8b50349a
def has_permission(self, request, view): 'Verifica que el usuario sea auxiliar de sistemas o coordinador.' return bool((request.user.is_assistant or request.user.is_admin))
Verifica que el usuario sea auxiliar de sistemas o coordinador.
andromeda/modules/inventory/permissions/inventory.py
has_permission
sango09/andromeda_api_rest
1
python
def has_permission(self, request, view): return bool((request.user.is_assistant or request.user.is_admin))
def has_permission(self, request, view): return bool((request.user.is_assistant or request.user.is_admin))<|docstring|>Verifica que el usuario sea auxiliar de sistemas o coordinador.<|endoftext|>
7056a84b510d695fd7cab385823c89be2e011a719e0f1046930627c86ca7f2b1
def has_permission(self, request, view): 'Verifica que el usuario sea coordinador.' return bool(request.user.is_admin)
Verifica que el usuario sea coordinador.
andromeda/modules/inventory/permissions/inventory.py
has_permission
sango09/andromeda_api_rest
1
python
def has_permission(self, request, view): return bool(request.user.is_admin)
def has_permission(self, request, view): return bool(request.user.is_admin)<|docstring|>Verifica que el usuario sea coordinador.<|endoftext|>
6e9346032cb3bc9e5e5a95d7088dd74b92ee6bb64c2594d40190a67e834aae65
def _process_kvps_exception(pattoo_db_records): 'Get all the key-value pairs found.\n\n Traps any exceptions and return them for processing. Very helpful in\n troubleshooting multiprocessing\n\n Args:\n pattoo_db_records: List of dicts read from cache files.\n\n Returns:\n None\n\n ' result = [] "\n Sleep for a short random time. We have seen where on very fast systems\n SQLAlchemy will hang the creation of multiprocessing subprocesses. The\n typical behaviour is the creation of one fewer\n pattoo.db._add_engine_pidguard() log messages than agents to process.\n These messages correspond to the creation of a subprocess which immediately\n invalidates a parent process's DB connection that will cause errors\n if used, which provided the clue to the source of the problem.\n\n Though SQLAlchemy isn't used by key_value_pairs. It's added as a\n future precaution in case it does.\n " time.sleep(((random.random() / 10) + 0.1)) try: result = get.key_value_pairs(pattoo_db_records) except Exception as error: _exception = sys.exc_info() log.log2exception(20133, _exception) return ExceptionWrapper(error) except: _exception = sys.exc_info() log.log2exception_die(20111, _exception) return result
Get all the key-value pairs found. Traps any exceptions and return them for processing. Very helpful in troubleshooting multiprocessing Args: pattoo_db_records: List of dicts read from cache files. Returns: None
pattoo/ingest/records.py
_process_kvps_exception
palisadoes/pattoo
0
python
def _process_kvps_exception(pattoo_db_records): 'Get all the key-value pairs found.\n\n Traps any exceptions and return them for processing. Very helpful in\n troubleshooting multiprocessing\n\n Args:\n pattoo_db_records: List of dicts read from cache files.\n\n Returns:\n None\n\n ' result = [] "\n Sleep for a short random time. We have seen where on very fast systems\n SQLAlchemy will hang the creation of multiprocessing subprocesses. The\n typical behaviour is the creation of one fewer\n pattoo.db._add_engine_pidguard() log messages than agents to process.\n These messages correspond to the creation of a subprocess which immediately\n invalidates a parent process's DB connection that will cause errors\n if used, which provided the clue to the source of the problem.\n\n Though SQLAlchemy isn't used by key_value_pairs. It's added as a\n future precaution in case it does.\n " time.sleep(((random.random() / 10) + 0.1)) try: result = get.key_value_pairs(pattoo_db_records) except Exception as error: _exception = sys.exc_info() log.log2exception(20133, _exception) return ExceptionWrapper(error) except: _exception = sys.exc_info() log.log2exception_die(20111, _exception) return result
def _process_kvps_exception(pattoo_db_records): 'Get all the key-value pairs found.\n\n Traps any exceptions and return them for processing. Very helpful in\n troubleshooting multiprocessing\n\n Args:\n pattoo_db_records: List of dicts read from cache files.\n\n Returns:\n None\n\n ' result = [] "\n Sleep for a short random time. We have seen where on very fast systems\n SQLAlchemy will hang the creation of multiprocessing subprocesses. The\n typical behaviour is the creation of one fewer\n pattoo.db._add_engine_pidguard() log messages than agents to process.\n These messages correspond to the creation of a subprocess which immediately\n invalidates a parent process's DB connection that will cause errors\n if used, which provided the clue to the source of the problem.\n\n Though SQLAlchemy isn't used by key_value_pairs. It's added as a\n future precaution in case it does.\n " time.sleep(((random.random() / 10) + 0.1)) try: result = get.key_value_pairs(pattoo_db_records) except Exception as error: _exception = sys.exc_info() log.log2exception(20133, _exception) return ExceptionWrapper(error) except: _exception = sys.exc_info() log.log2exception_die(20111, _exception) return result<|docstring|>Get all the key-value pairs found. Traps any exceptions and return them for processing. Very helpful in troubleshooting multiprocessing Args: pattoo_db_records: List of dicts read from cache files. Returns: None<|endoftext|>
632d8a547bf3620f648afc3de7f0553e1fe2440b415363cb87f150181b1d2d45
def _process_data_exception(pattoo_db_records): 'Insert all data values for an agent into database.\n\n Traps any exceptions and return them for processing. Very helpful in\n troubleshooting multiprocessing\n\n Args:\n pattoo_db_records: List of dicts read from cache files.\n\n Returns:\n None\n\n ' "\n Sleep for a short random time. We have seen where on very fast systems\n SQLAlchemy will hang the creation of multiprocessing subprocesses. The\n typical behaviour is the creation of one fewer\n pattoo.db._add_engine_pidguard() log messages than agents to process.\n These messages correspond to the creation of a subprocess which immediately\n invalidates a parent process's DB connection that will cause errors\n if used, which provided the clue to the source of the problem.\n " time.sleep(((random.random() / 10) + 0.1)) try: process_db_records(pattoo_db_records) except Exception as error: _exception = sys.exc_info() log.log2exception(20132, _exception) return ExceptionWrapper(error) except: _exception = sys.exc_info() log.log2exception_die(20109, _exception) return None
Insert all data values for an agent into database. Traps any exceptions and return them for processing. Very helpful in troubleshooting multiprocessing Args: pattoo_db_records: List of dicts read from cache files. Returns: None
pattoo/ingest/records.py
_process_data_exception
palisadoes/pattoo
0
python
def _process_data_exception(pattoo_db_records): 'Insert all data values for an agent into database.\n\n Traps any exceptions and return them for processing. Very helpful in\n troubleshooting multiprocessing\n\n Args:\n pattoo_db_records: List of dicts read from cache files.\n\n Returns:\n None\n\n ' "\n Sleep for a short random time. We have seen where on very fast systems\n SQLAlchemy will hang the creation of multiprocessing subprocesses. The\n typical behaviour is the creation of one fewer\n pattoo.db._add_engine_pidguard() log messages than agents to process.\n These messages correspond to the creation of a subprocess which immediately\n invalidates a parent process's DB connection that will cause errors\n if used, which provided the clue to the source of the problem.\n " time.sleep(((random.random() / 10) + 0.1)) try: process_db_records(pattoo_db_records) except Exception as error: _exception = sys.exc_info() log.log2exception(20132, _exception) return ExceptionWrapper(error) except: _exception = sys.exc_info() log.log2exception_die(20109, _exception) return None
def _process_data_exception(pattoo_db_records): 'Insert all data values for an agent into database.\n\n Traps any exceptions and return them for processing. Very helpful in\n troubleshooting multiprocessing\n\n Args:\n pattoo_db_records: List of dicts read from cache files.\n\n Returns:\n None\n\n ' "\n Sleep for a short random time. We have seen where on very fast systems\n SQLAlchemy will hang the creation of multiprocessing subprocesses. The\n typical behaviour is the creation of one fewer\n pattoo.db._add_engine_pidguard() log messages than agents to process.\n These messages correspond to the creation of a subprocess which immediately\n invalidates a parent process's DB connection that will cause errors\n if used, which provided the clue to the source of the problem.\n " time.sleep(((random.random() / 10) + 0.1)) try: process_db_records(pattoo_db_records) except Exception as error: _exception = sys.exc_info() log.log2exception(20132, _exception) return ExceptionWrapper(error) except: _exception = sys.exc_info() log.log2exception_die(20109, _exception) return None<|docstring|>Insert all data values for an agent into database. Traps any exceptions and return them for processing. Very helpful in troubleshooting multiprocessing Args: pattoo_db_records: List of dicts read from cache files. Returns: None<|endoftext|>
f7709d79ca3c448fe26b9094b05bd3d66389ca61e768e64a7b6d8ff4f44f4fdb
def process_db_records(pattoo_db_records): 'Insert all data values for an agent into database.\n\n Args:\n pattoo_db_records: List of dicts read from cache files.\n\n Returns:\n None\n\n Method:\n 1) Get all the idx_datapoint and idx_pair values that exist in the\n PattooDBrecord data from the database. All the records MUST be\n from the same source.\n 2) Add these idx values to tracking memory variables for speedy lookup\n 3) Ignore non numeric data values sent\n 4) Add data to the database. If new checksum values are found in the\n PattooDBrecord data, then create the new index values to the\n database, update the tracking memory variables before hand.\n\n ' _data = {} if (bool(pattoo_db_records) is False): return agent_id = pattoo_db_records[0].pattoo_agent_id checksum_table = misc.agent_checksums(agent_id) for pdbr in pattoo_db_records: if (pdbr.pattoo_data_type in [DATA_NONE, DATA_STRING]): continue try: float_value = float(pdbr.pattoo_value) except: continue if (pdbr.pattoo_checksum in checksum_table): idx_datapoint = checksum_table[pdbr.pattoo_checksum].idx_datapoint else: idx_datapoint = datapoint.idx_datapoint(pdbr) if (bool(idx_datapoint) is True): checksum_table[pdbr.pattoo_checksum] = ChecksumLookup(idx_datapoint=idx_datapoint, polling_interval=int(pdbr.pattoo_agent_polling_interval), last_timestamp=1) idx_pairs = get.pairs(pdbr) glue.insert_rows(idx_datapoint, idx_pairs) else: continue if (pdbr.pattoo_timestamp > checksum_table[pdbr.pattoo_checksum].last_timestamp): '\n Add the Data table results to a dict in case we have duplicate\n posting over the API. We need to key off a unique time dependent\n value per datapoint to prevent different datapoints at the same\n point in time overwriting the value. This is specifically for\n removing duplicates for the _SAME_ datapoint at the same point in\n time as could possibly occur with the restart of an agent causing a\n double posting or network issues. We therefore use a tuple of\n idx_datapoint and timestamp.\n ' _data[(pdbr.pattoo_timestamp, idx_datapoint)] = IDXTimestampValue(idx_datapoint=idx_datapoint, polling_interval=int(pdbr.pattoo_agent_polling_interval), timestamp=pdbr.pattoo_timestamp, value=float_value) if (bool(_data) is True): data.insert_rows(list(_data.values())) log_message = 'Finished cache data processing for agent_id: {}'.format(agent_id) log.log2debug(20113, log_message)
Insert all data values for an agent into database. Args: pattoo_db_records: List of dicts read from cache files. Returns: None Method: 1) Get all the idx_datapoint and idx_pair values that exist in the PattooDBrecord data from the database. All the records MUST be from the same source. 2) Add these idx values to tracking memory variables for speedy lookup 3) Ignore non numeric data values sent 4) Add data to the database. If new checksum values are found in the PattooDBrecord data, then create the new index values to the database, update the tracking memory variables before hand.
pattoo/ingest/records.py
process_db_records
palisadoes/pattoo
0
python
def process_db_records(pattoo_db_records): 'Insert all data values for an agent into database.\n\n Args:\n pattoo_db_records: List of dicts read from cache files.\n\n Returns:\n None\n\n Method:\n 1) Get all the idx_datapoint and idx_pair values that exist in the\n PattooDBrecord data from the database. All the records MUST be\n from the same source.\n 2) Add these idx values to tracking memory variables for speedy lookup\n 3) Ignore non numeric data values sent\n 4) Add data to the database. If new checksum values are found in the\n PattooDBrecord data, then create the new index values to the\n database, update the tracking memory variables before hand.\n\n ' _data = {} if (bool(pattoo_db_records) is False): return agent_id = pattoo_db_records[0].pattoo_agent_id checksum_table = misc.agent_checksums(agent_id) for pdbr in pattoo_db_records: if (pdbr.pattoo_data_type in [DATA_NONE, DATA_STRING]): continue try: float_value = float(pdbr.pattoo_value) except: continue if (pdbr.pattoo_checksum in checksum_table): idx_datapoint = checksum_table[pdbr.pattoo_checksum].idx_datapoint else: idx_datapoint = datapoint.idx_datapoint(pdbr) if (bool(idx_datapoint) is True): checksum_table[pdbr.pattoo_checksum] = ChecksumLookup(idx_datapoint=idx_datapoint, polling_interval=int(pdbr.pattoo_agent_polling_interval), last_timestamp=1) idx_pairs = get.pairs(pdbr) glue.insert_rows(idx_datapoint, idx_pairs) else: continue if (pdbr.pattoo_timestamp > checksum_table[pdbr.pattoo_checksum].last_timestamp): '\n Add the Data table results to a dict in case we have duplicate\n posting over the API. We need to key off a unique time dependent\n value per datapoint to prevent different datapoints at the same\n point in time overwriting the value. This is specifically for\n removing duplicates for the _SAME_ datapoint at the same point in\n time as could possibly occur with the restart of an agent causing a\n double posting or network issues. We therefore use a tuple of\n idx_datapoint and timestamp.\n ' _data[(pdbr.pattoo_timestamp, idx_datapoint)] = IDXTimestampValue(idx_datapoint=idx_datapoint, polling_interval=int(pdbr.pattoo_agent_polling_interval), timestamp=pdbr.pattoo_timestamp, value=float_value) if (bool(_data) is True): data.insert_rows(list(_data.values())) log_message = 'Finished cache data processing for agent_id: {}'.format(agent_id) log.log2debug(20113, log_message)
def process_db_records(pattoo_db_records): 'Insert all data values for an agent into database.\n\n Args:\n pattoo_db_records: List of dicts read from cache files.\n\n Returns:\n None\n\n Method:\n 1) Get all the idx_datapoint and idx_pair values that exist in the\n PattooDBrecord data from the database. All the records MUST be\n from the same source.\n 2) Add these idx values to tracking memory variables for speedy lookup\n 3) Ignore non numeric data values sent\n 4) Add data to the database. If new checksum values are found in the\n PattooDBrecord data, then create the new index values to the\n database, update the tracking memory variables before hand.\n\n ' _data = {} if (bool(pattoo_db_records) is False): return agent_id = pattoo_db_records[0].pattoo_agent_id checksum_table = misc.agent_checksums(agent_id) for pdbr in pattoo_db_records: if (pdbr.pattoo_data_type in [DATA_NONE, DATA_STRING]): continue try: float_value = float(pdbr.pattoo_value) except: continue if (pdbr.pattoo_checksum in checksum_table): idx_datapoint = checksum_table[pdbr.pattoo_checksum].idx_datapoint else: idx_datapoint = datapoint.idx_datapoint(pdbr) if (bool(idx_datapoint) is True): checksum_table[pdbr.pattoo_checksum] = ChecksumLookup(idx_datapoint=idx_datapoint, polling_interval=int(pdbr.pattoo_agent_polling_interval), last_timestamp=1) idx_pairs = get.pairs(pdbr) glue.insert_rows(idx_datapoint, idx_pairs) else: continue if (pdbr.pattoo_timestamp > checksum_table[pdbr.pattoo_checksum].last_timestamp): '\n Add the Data table results to a dict in case we have duplicate\n posting over the API. We need to key off a unique time dependent\n value per datapoint to prevent different datapoints at the same\n point in time overwriting the value. This is specifically for\n removing duplicates for the _SAME_ datapoint at the same point in\n time as could possibly occur with the restart of an agent causing a\n double posting or network issues. We therefore use a tuple of\n idx_datapoint and timestamp.\n ' _data[(pdbr.pattoo_timestamp, idx_datapoint)] = IDXTimestampValue(idx_datapoint=idx_datapoint, polling_interval=int(pdbr.pattoo_agent_polling_interval), timestamp=pdbr.pattoo_timestamp, value=float_value) if (bool(_data) is True): data.insert_rows(list(_data.values())) log_message = 'Finished cache data processing for agent_id: {}'.format(agent_id) log.log2debug(20113, log_message)<|docstring|>Insert all data values for an agent into database. Args: pattoo_db_records: List of dicts read from cache files. Returns: None Method: 1) Get all the idx_datapoint and idx_pair values that exist in the PattooDBrecord data from the database. All the records MUST be from the same source. 2) Add these idx values to tracking memory variables for speedy lookup 3) Ignore non numeric data values sent 4) Add data to the database. If new checksum values are found in the PattooDBrecord data, then create the new index values to the database, update the tracking memory variables before hand.<|endoftext|>
55cd150c2996d414c1d54bbe810271da4de0b023253b4a81bae4638d1f019169
def __init__(self, error_exception): 'Initialize the class.\n\n Args:\n error_exception: Exception object\n\n Returns:\n None\n\n ' self._error_exception = error_exception (self._etype, self._evalue, self._etraceback) = sys.exc_info()
Initialize the class. Args: error_exception: Exception object Returns: None
pattoo/ingest/records.py
__init__
palisadoes/pattoo
0
python
def __init__(self, error_exception): 'Initialize the class.\n\n Args:\n error_exception: Exception object\n\n Returns:\n None\n\n ' self._error_exception = error_exception (self._etype, self._evalue, self._etraceback) = sys.exc_info()
def __init__(self, error_exception): 'Initialize the class.\n\n Args:\n error_exception: Exception object\n\n Returns:\n None\n\n ' self._error_exception = error_exception (self._etype, self._evalue, self._etraceback) = sys.exc_info()<|docstring|>Initialize the class. Args: error_exception: Exception object Returns: None<|endoftext|>
ec893f5ccdf6d87e2cc67f36dc698b5c92ffe60cdf238387ffead3328a2c3ed2
def re_raise(self): 'Extend the re_raise method.\n\n Args:\n None\n\n Returns:\n None\n\n ' log.log2exception(20114, (self._etype, self._evalue, self._etraceback)) raise self._error_exception.with_traceback(self._etraceback)
Extend the re_raise method. Args: None Returns: None
pattoo/ingest/records.py
re_raise
palisadoes/pattoo
0
python
def re_raise(self): 'Extend the re_raise method.\n\n Args:\n None\n\n Returns:\n None\n\n ' log.log2exception(20114, (self._etype, self._evalue, self._etraceback)) raise self._error_exception.with_traceback(self._etraceback)
def re_raise(self): 'Extend the re_raise method.\n\n Args:\n None\n\n Returns:\n None\n\n ' log.log2exception(20114, (self._etype, self._evalue, self._etraceback)) raise self._error_exception.with_traceback(self._etraceback)<|docstring|>Extend the re_raise method. Args: None Returns: None<|endoftext|>
4726ea31f8f759a29854032ef5d106d83d8cb588cf51795a7793b3a3aa26e5a0
def __init__(self, pattoo_db_records_lists): 'Initialize the class.\n\n Args:\n pattoo_db_records_lists: List of PattooDBrecord oject lists\n grouped by source and sorted by timestamp. This data is\n obtained from PattooShared.converter.extract\n\n Returns:\n None\n\n ' config = Config() self._arguments = [(_,) for _ in pattoo_db_records_lists if (bool(_) is True)] self._multiprocess = config.multiprocessing() self._pool_size = cpu_count()
Initialize the class. Args: pattoo_db_records_lists: List of PattooDBrecord oject lists grouped by source and sorted by timestamp. This data is obtained from PattooShared.converter.extract Returns: None
pattoo/ingest/records.py
__init__
palisadoes/pattoo
0
python
def __init__(self, pattoo_db_records_lists): 'Initialize the class.\n\n Args:\n pattoo_db_records_lists: List of PattooDBrecord oject lists\n grouped by source and sorted by timestamp. This data is\n obtained from PattooShared.converter.extract\n\n Returns:\n None\n\n ' config = Config() self._arguments = [(_,) for _ in pattoo_db_records_lists if (bool(_) is True)] self._multiprocess = config.multiprocessing() self._pool_size = cpu_count()
def __init__(self, pattoo_db_records_lists): 'Initialize the class.\n\n Args:\n pattoo_db_records_lists: List of PattooDBrecord oject lists\n grouped by source and sorted by timestamp. This data is\n obtained from PattooShared.converter.extract\n\n Returns:\n None\n\n ' config = Config() self._arguments = [(_,) for _ in pattoo_db_records_lists if (bool(_) is True)] self._multiprocess = config.multiprocessing() self._pool_size = cpu_count()<|docstring|>Initialize the class. Args: pattoo_db_records_lists: List of PattooDBrecord oject lists grouped by source and sorted by timestamp. This data is obtained from PattooShared.converter.extract Returns: None<|endoftext|>
6c8c8fa3ba90a637b26ee0d0f731cd26166d40a3e808318b3a8f8ee11369f17d
def multiprocess_pairs(self): 'Update rows in the Pair database table if necessary.\n\n Do all multiprocessing outside of the class for consistent results\n without unexpected hanging waiting for pool.join() to happen.\n\n Args:\n None\n\n Returns:\n None\n\n ' pattoo_db_records_lists_tuple = self._arguments pool_size = self._pool_size with get_context('spawn').Pool(processes=pool_size) as pool: per_process_key_value_pairs = pool.starmap(_process_kvps_exception, pattoo_db_records_lists_tuple) pool.join() for result in per_process_key_value_pairs: if isinstance(result, ExceptionWrapper): result.re_raise() pair.insert_rows(per_process_key_value_pairs)
Update rows in the Pair database table if necessary. Do all multiprocessing outside of the class for consistent results without unexpected hanging waiting for pool.join() to happen. Args: None Returns: None
pattoo/ingest/records.py
multiprocess_pairs
palisadoes/pattoo
0
python
def multiprocess_pairs(self): 'Update rows in the Pair database table if necessary.\n\n Do all multiprocessing outside of the class for consistent results\n without unexpected hanging waiting for pool.join() to happen.\n\n Args:\n None\n\n Returns:\n None\n\n ' pattoo_db_records_lists_tuple = self._arguments pool_size = self._pool_size with get_context('spawn').Pool(processes=pool_size) as pool: per_process_key_value_pairs = pool.starmap(_process_kvps_exception, pattoo_db_records_lists_tuple) pool.join() for result in per_process_key_value_pairs: if isinstance(result, ExceptionWrapper): result.re_raise() pair.insert_rows(per_process_key_value_pairs)
def multiprocess_pairs(self): 'Update rows in the Pair database table if necessary.\n\n Do all multiprocessing outside of the class for consistent results\n without unexpected hanging waiting for pool.join() to happen.\n\n Args:\n None\n\n Returns:\n None\n\n ' pattoo_db_records_lists_tuple = self._arguments pool_size = self._pool_size with get_context('spawn').Pool(processes=pool_size) as pool: per_process_key_value_pairs = pool.starmap(_process_kvps_exception, pattoo_db_records_lists_tuple) pool.join() for result in per_process_key_value_pairs: if isinstance(result, ExceptionWrapper): result.re_raise() pair.insert_rows(per_process_key_value_pairs)<|docstring|>Update rows in the Pair database table if necessary. Do all multiprocessing outside of the class for consistent results without unexpected hanging waiting for pool.join() to happen. Args: None Returns: None<|endoftext|>
b496ed0504670217201ec26b880b27d272d19a34bd32b7b8f9d3760f8f7eeac5
def multiprocess_data(self): 'Insert rows into the Data and DataPoint tables as necessary.\n\n Do all multiprocessing outside of the class for consistent results\n without unexpected hanging waiting for pool.join() to happen.\n\n Args:\n None\n\n Returns:\n None\n\n ' pattoo_db_records_lists_tuple = self._arguments pool_size = self._pool_size log_message = 'Processing {} agents from cache'.format(len(pattoo_db_records_lists_tuple)) log.log2debug(20009, log_message) with get_context('spawn').Pool(processes=pool_size) as pool: results = pool.starmap(_process_data_exception, pattoo_db_records_lists_tuple) pool.join() for result in results: if isinstance(result, ExceptionWrapper): result.re_raise()
Insert rows into the Data and DataPoint tables as necessary. Do all multiprocessing outside of the class for consistent results without unexpected hanging waiting for pool.join() to happen. Args: None Returns: None
pattoo/ingest/records.py
multiprocess_data
palisadoes/pattoo
0
python
def multiprocess_data(self): 'Insert rows into the Data and DataPoint tables as necessary.\n\n Do all multiprocessing outside of the class for consistent results\n without unexpected hanging waiting for pool.join() to happen.\n\n Args:\n None\n\n Returns:\n None\n\n ' pattoo_db_records_lists_tuple = self._arguments pool_size = self._pool_size log_message = 'Processing {} agents from cache'.format(len(pattoo_db_records_lists_tuple)) log.log2debug(20009, log_message) with get_context('spawn').Pool(processes=pool_size) as pool: results = pool.starmap(_process_data_exception, pattoo_db_records_lists_tuple) pool.join() for result in results: if isinstance(result, ExceptionWrapper): result.re_raise()
def multiprocess_data(self): 'Insert rows into the Data and DataPoint tables as necessary.\n\n Do all multiprocessing outside of the class for consistent results\n without unexpected hanging waiting for pool.join() to happen.\n\n Args:\n None\n\n Returns:\n None\n\n ' pattoo_db_records_lists_tuple = self._arguments pool_size = self._pool_size log_message = 'Processing {} agents from cache'.format(len(pattoo_db_records_lists_tuple)) log.log2debug(20009, log_message) with get_context('spawn').Pool(processes=pool_size) as pool: results = pool.starmap(_process_data_exception, pattoo_db_records_lists_tuple) pool.join() for result in results: if isinstance(result, ExceptionWrapper): result.re_raise()<|docstring|>Insert rows into the Data and DataPoint tables as necessary. Do all multiprocessing outside of the class for consistent results without unexpected hanging waiting for pool.join() to happen. Args: None Returns: None<|endoftext|>
5b7939769a393261a1b67296eeb8911af7757caaa035a9dffd870575cdc8cbb5
def singleprocess_pairs(self): 'Update rows in the Pair database table if necessary.\n\n Args:\n None\n\n Returns:\n None\n\n ' pairs = [] for item in self._arguments: row = item[0] per_process_key_value_pairs = get.key_value_pairs(row) pairs.append(per_process_key_value_pairs) pair.insert_rows(pairs)
Update rows in the Pair database table if necessary. Args: None Returns: None
pattoo/ingest/records.py
singleprocess_pairs
palisadoes/pattoo
0
python
def singleprocess_pairs(self): 'Update rows in the Pair database table if necessary.\n\n Args:\n None\n\n Returns:\n None\n\n ' pairs = [] for item in self._arguments: row = item[0] per_process_key_value_pairs = get.key_value_pairs(row) pairs.append(per_process_key_value_pairs) pair.insert_rows(pairs)
def singleprocess_pairs(self): 'Update rows in the Pair database table if necessary.\n\n Args:\n None\n\n Returns:\n None\n\n ' pairs = [] for item in self._arguments: row = item[0] per_process_key_value_pairs = get.key_value_pairs(row) pairs.append(per_process_key_value_pairs) pair.insert_rows(pairs)<|docstring|>Update rows in the Pair database table if necessary. Args: None Returns: None<|endoftext|>
28eb4907cf0f9162aa8ea635634291c6ea56d2b37b516d1cd7f4e2f550e85550
def singleprocess_data(self): 'Insert rows into the Data and DataPoint tables as necessary.\n\n Args:\n None\n\n Returns:\n None\n\n ' for item in self._arguments: row = item[0] process_db_records(row)
Insert rows into the Data and DataPoint tables as necessary. Args: None Returns: None
pattoo/ingest/records.py
singleprocess_data
palisadoes/pattoo
0
python
def singleprocess_data(self): 'Insert rows into the Data and DataPoint tables as necessary.\n\n Args:\n None\n\n Returns:\n None\n\n ' for item in self._arguments: row = item[0] process_db_records(row)
def singleprocess_data(self): 'Insert rows into the Data and DataPoint tables as necessary.\n\n Args:\n None\n\n Returns:\n None\n\n ' for item in self._arguments: row = item[0] process_db_records(row)<|docstring|>Insert rows into the Data and DataPoint tables as necessary. Args: None Returns: None<|endoftext|>
8eadaaf37318a54284c0aab717cfed9b81af1772cbf89917f6a0dc5036768c4c
def ingest(self): 'Insert rows into the Data and DataPoint tables as necessary.\n\n Args:\n None\n\n Returns:\n None\n\n ' if (self._multiprocess is True): self.multiprocess_pairs() self.multiprocess_data() else: self.singleprocess_pairs() self.singleprocess_data()
Insert rows into the Data and DataPoint tables as necessary. Args: None Returns: None
pattoo/ingest/records.py
ingest
palisadoes/pattoo
0
python
def ingest(self): 'Insert rows into the Data and DataPoint tables as necessary.\n\n Args:\n None\n\n Returns:\n None\n\n ' if (self._multiprocess is True): self.multiprocess_pairs() self.multiprocess_data() else: self.singleprocess_pairs() self.singleprocess_data()
def ingest(self): 'Insert rows into the Data and DataPoint tables as necessary.\n\n Args:\n None\n\n Returns:\n None\n\n ' if (self._multiprocess is True): self.multiprocess_pairs() self.multiprocess_data() else: self.singleprocess_pairs() self.singleprocess_data()<|docstring|>Insert rows into the Data and DataPoint tables as necessary. Args: None Returns: None<|endoftext|>
95b073ba5c0925f0ad165872230766d43c92bbbcf3c4a5c9a25d04dd9642b101
def _framework_platform_info_impl(ctx): "The implementation of `framework_platform_info`\n\n Args:\n ctx (ctx): The rule's context object\n\n Returns:\n list: A provider containing platform info\n " return [ForeignCcPlatformInfo(os=ctx.attr.os)]
The implementation of `framework_platform_info` Args: ctx (ctx): The rule's context object Returns: list: A provider containing platform info
foreign_cc/private/framework/platform.bzl
_framework_platform_info_impl
rubensf/rules_foreign_cc
521
python
def _framework_platform_info_impl(ctx): "The implementation of `framework_platform_info`\n\n Args:\n ctx (ctx): The rule's context object\n\n Returns:\n list: A provider containing platform info\n " return [ForeignCcPlatformInfo(os=ctx.attr.os)]
def _framework_platform_info_impl(ctx): "The implementation of `framework_platform_info`\n\n Args:\n ctx (ctx): The rule's context object\n\n Returns:\n list: A provider containing platform info\n " return [ForeignCcPlatformInfo(os=ctx.attr.os)]<|docstring|>The implementation of `framework_platform_info` Args: ctx (ctx): The rule's context object Returns: list: A provider containing platform info<|endoftext|>
609d102d1efa6488277833055cb9da174ba6349b49e7c4481a3526165456610f
def framework_platform_info(name='platform_info'): 'Define a target containing platform information used in the foreign_cc framework' _framework_platform_info(name=name, os=select({'@platforms//os:android': 'android', '@platforms//os:freebsd': 'freebsd', '@platforms//os:ios': 'ios', '@platforms//os:linux': 'linux', '@platforms//os:macos': 'macos', '@platforms//os:none': 'none', '@platforms//os:openbsd': 'openbsd', '@platforms//os:qnx': 'qnx', '@platforms//os:tvos': 'tvos', '@platforms//os:watchos': 'watchos', '@platforms//os:windows': 'windows', '//conditions:default': 'unknown'}), visibility=['//visibility:public'])
Define a target containing platform information used in the foreign_cc framework
foreign_cc/private/framework/platform.bzl
framework_platform_info
rubensf/rules_foreign_cc
521
python
def framework_platform_info(name='platform_info'): _framework_platform_info(name=name, os=select({'@platforms//os:android': 'android', '@platforms//os:freebsd': 'freebsd', '@platforms//os:ios': 'ios', '@platforms//os:linux': 'linux', '@platforms//os:macos': 'macos', '@platforms//os:none': 'none', '@platforms//os:openbsd': 'openbsd', '@platforms//os:qnx': 'qnx', '@platforms//os:tvos': 'tvos', '@platforms//os:watchos': 'watchos', '@platforms//os:windows': 'windows', '//conditions:default': 'unknown'}), visibility=['//visibility:public'])
def framework_platform_info(name='platform_info'): _framework_platform_info(name=name, os=select({'@platforms//os:android': 'android', '@platforms//os:freebsd': 'freebsd', '@platforms//os:ios': 'ios', '@platforms//os:linux': 'linux', '@platforms//os:macos': 'macos', '@platforms//os:none': 'none', '@platforms//os:openbsd': 'openbsd', '@platforms//os:qnx': 'qnx', '@platforms//os:tvos': 'tvos', '@platforms//os:watchos': 'watchos', '@platforms//os:windows': 'windows', '//conditions:default': 'unknown'}), visibility=['//visibility:public'])<|docstring|>Define a target containing platform information used in the foreign_cc framework<|endoftext|>
48c1cf33825f9e7d40e23235b212b6c40eeea2d15cebc96d308a2e33e1080d9d
def os_name(ctx): "A helper function for getting the operating system name from a `ForeignCcPlatformInfo` provider\n\n Args:\n ctx (ctx): The current rule's context object\n\n Returns:\n str: The string of the current platform\n " platform_info = getattr(ctx.attr, '_foreign_cc_framework_platform') if (not platform_info): return 'unknown' return platform_info[ForeignCcPlatformInfo].os
A helper function for getting the operating system name from a `ForeignCcPlatformInfo` provider Args: ctx (ctx): The current rule's context object Returns: str: The string of the current platform
foreign_cc/private/framework/platform.bzl
os_name
rubensf/rules_foreign_cc
521
python
def os_name(ctx): "A helper function for getting the operating system name from a `ForeignCcPlatformInfo` provider\n\n Args:\n ctx (ctx): The current rule's context object\n\n Returns:\n str: The string of the current platform\n " platform_info = getattr(ctx.attr, '_foreign_cc_framework_platform') if (not platform_info): return 'unknown' return platform_info[ForeignCcPlatformInfo].os
def os_name(ctx): "A helper function for getting the operating system name from a `ForeignCcPlatformInfo` provider\n\n Args:\n ctx (ctx): The current rule's context object\n\n Returns:\n str: The string of the current platform\n " platform_info = getattr(ctx.attr, '_foreign_cc_framework_platform') if (not platform_info): return 'unknown' return platform_info[ForeignCcPlatformInfo].os<|docstring|>A helper function for getting the operating system name from a `ForeignCcPlatformInfo` provider Args: ctx (ctx): The current rule's context object Returns: str: The string of the current platform<|endoftext|>
5bfbd617a486ad28b5826db8cb7ce9626c82d5e0bf4b727eacacd947ad14e61a
def DbpediaWriter(directed: bool=False, verbose: int=2, cache_path: str='graphs/networkrepository', **additional_graph_kwargs: Dict) -> EnsmallenGraph: 'Return new instance of the dbpedia-writer graph.\n\n The graph is automatically retrieved from the NetworkRepository repository. \n\n\t\n\n Parameters\n -------------------\n directed: bool = False,\n Wether to load the graph as directed or undirected.\n By default false.\n verbose: int = 2,\n Wether to show loading bars during the retrieval and building\n of the graph.\n cache_path: str = "graphs",\n Where to store the downloaded graphs.\n additional_graph_kwargs: Dict,\n Additional graph kwargs.\n\n Returns\n -----------------------\n Instace of dbpedia-writer graph.\n\n\tReport\n\t---------------------\n\tAt the time of rendering these methods (please see datetime below), the graph\n\thad the following characteristics:\n\t\n\tDatetime: 2021-02-06 11:08:48.792091\n\t\n\tThe undirected graph dbpedia-writer has 89356 nodes and 144338 unweighted\n\tedges, of which 8 are self-loops. The graph is extremely sparse as it has\n\ta density of 0.00004 and is connected, as it has a single component. The\n\tgraph median node degree is 2, the mean node degree is 3.23, and the node\n\tdegree mode is 2. The top 5 most central nodes are 1618 (degree 247), 630\n\t(degree 237), 996 (degree 215), 1064 (degree 180) and 2667 (degree 143).\n\t\n\n\tReferences\n\t---------------------\n\tPlease cite the following if you use the data:\n\t\n\t@inproceedings{nr,\n\t title = {The Network Data Repository with Interactive Graph Analytics and Visualization},\n\t author={Ryan A. Rossi and Nesreen K. Ahmed},\n\t booktitle = {AAAI},\n\t url={http://networkrepository.com},\n\t year={2015}\n\t}\n\t\n\n\tUsage example\n\t----------------------\n\tThe usage of this graph is relatively straightforward:\n\t\n\t.. code:: python\n\t\n\t # First import the function to retrieve the graph from the datasets\n\t from ensmallen_graph.datasets.networkrepository import DbpediaWriter\n\t\n\t # Then load the graph\n\t graph = DbpediaWriter()\n\t\n\t # Finally, you can do anything with it, for instance, compute its report:\n\t print(graph)\n\t\n\t # If you need to run a link prediction task with validation,\n\t # you can split the graph using a connected holdout as follows:\n\t train_graph, validation_graph = graph.connected_holdout(\n\t # You can use an 80/20 split the holdout, for example.\n\t train_size=0.8,\n\t # The random state is used to reproduce the holdout.\n\t random_state=42,\n\t # Wether to show a loading bar.\n\t verbose=True\n\t )\n\t\n\t # Remember that, if you need, you can enable the memory-time trade-offs:\n\t train_graph.enable(\n\t vector_sources=True,\n\t vector_destinations=True,\n\t vector_outbounds=True\n\t )\n\t\n\t # Consider using the methods made available in the Embiggen package\n\t # to run graph embedding or link prediction tasks.\n ' return AutomaticallyRetrievedGraph(graph_name='DbpediaWriter', dataset='networkrepository', directed=directed, verbose=verbose, cache_path=cache_path, additional_graph_kwargs=additional_graph_kwargs)()
Return new instance of the dbpedia-writer graph. The graph is automatically retrieved from the NetworkRepository repository. Parameters ------------------- directed: bool = False, Wether to load the graph as directed or undirected. By default false. verbose: int = 2, Wether to show loading bars during the retrieval and building of the graph. cache_path: str = "graphs", Where to store the downloaded graphs. additional_graph_kwargs: Dict, Additional graph kwargs. Returns ----------------------- Instace of dbpedia-writer graph. Report --------------------- At the time of rendering these methods (please see datetime below), the graph had the following characteristics: Datetime: 2021-02-06 11:08:48.792091 The undirected graph dbpedia-writer has 89356 nodes and 144338 unweighted edges, of which 8 are self-loops. The graph is extremely sparse as it has a density of 0.00004 and is connected, as it has a single component. The graph median node degree is 2, the mean node degree is 3.23, and the node degree mode is 2. The top 5 most central nodes are 1618 (degree 247), 630 (degree 237), 996 (degree 215), 1064 (degree 180) and 2667 (degree 143). References --------------------- Please cite the following if you use the data: @inproceedings{nr, title = {The Network Data Repository with Interactive Graph Analytics and Visualization}, author={Ryan A. Rossi and Nesreen K. Ahmed}, booktitle = {AAAI}, url={http://networkrepository.com}, year={2015} } Usage example ---------------------- The usage of this graph is relatively straightforward: .. code:: python # First import the function to retrieve the graph from the datasets from ensmallen_graph.datasets.networkrepository import DbpediaWriter # Then load the graph graph = DbpediaWriter() # Finally, you can do anything with it, for instance, compute its report: print(graph) # If you need to run a link prediction task with validation, # you can split the graph using a connected holdout as follows: train_graph, validation_graph = graph.connected_holdout( # You can use an 80/20 split the holdout, for example. train_size=0.8, # The random state is used to reproduce the holdout. random_state=42, # Wether to show a loading bar. verbose=True ) # Remember that, if you need, you can enable the memory-time trade-offs: train_graph.enable( vector_sources=True, vector_destinations=True, vector_outbounds=True ) # Consider using the methods made available in the Embiggen package # to run graph embedding or link prediction tasks.
bindings/python/ensmallen_graph/datasets/networkrepository/dbpediawriter.py
DbpediaWriter
caufieldjh/ensmallen_graph
0
python
def DbpediaWriter(directed: bool=False, verbose: int=2, cache_path: str='graphs/networkrepository', **additional_graph_kwargs: Dict) -> EnsmallenGraph: 'Return new instance of the dbpedia-writer graph.\n\n The graph is automatically retrieved from the NetworkRepository repository. \n\n\t\n\n Parameters\n -------------------\n directed: bool = False,\n Wether to load the graph as directed or undirected.\n By default false.\n verbose: int = 2,\n Wether to show loading bars during the retrieval and building\n of the graph.\n cache_path: str = "graphs",\n Where to store the downloaded graphs.\n additional_graph_kwargs: Dict,\n Additional graph kwargs.\n\n Returns\n -----------------------\n Instace of dbpedia-writer graph.\n\n\tReport\n\t---------------------\n\tAt the time of rendering these methods (please see datetime below), the graph\n\thad the following characteristics:\n\t\n\tDatetime: 2021-02-06 11:08:48.792091\n\t\n\tThe undirected graph dbpedia-writer has 89356 nodes and 144338 unweighted\n\tedges, of which 8 are self-loops. The graph is extremely sparse as it has\n\ta density of 0.00004 and is connected, as it has a single component. The\n\tgraph median node degree is 2, the mean node degree is 3.23, and the node\n\tdegree mode is 2. The top 5 most central nodes are 1618 (degree 247), 630\n\t(degree 237), 996 (degree 215), 1064 (degree 180) and 2667 (degree 143).\n\t\n\n\tReferences\n\t---------------------\n\tPlease cite the following if you use the data:\n\t\n\t@inproceedings{nr,\n\t title = {The Network Data Repository with Interactive Graph Analytics and Visualization},\n\t author={Ryan A. Rossi and Nesreen K. Ahmed},\n\t booktitle = {AAAI},\n\t url={http://networkrepository.com},\n\t year={2015}\n\t}\n\t\n\n\tUsage example\n\t----------------------\n\tThe usage of this graph is relatively straightforward:\n\t\n\t.. code:: python\n\t\n\t # First import the function to retrieve the graph from the datasets\n\t from ensmallen_graph.datasets.networkrepository import DbpediaWriter\n\t\n\t # Then load the graph\n\t graph = DbpediaWriter()\n\t\n\t # Finally, you can do anything with it, for instance, compute its report:\n\t print(graph)\n\t\n\t # If you need to run a link prediction task with validation,\n\t # you can split the graph using a connected holdout as follows:\n\t train_graph, validation_graph = graph.connected_holdout(\n\t # You can use an 80/20 split the holdout, for example.\n\t train_size=0.8,\n\t # The random state is used to reproduce the holdout.\n\t random_state=42,\n\t # Wether to show a loading bar.\n\t verbose=True\n\t )\n\t\n\t # Remember that, if you need, you can enable the memory-time trade-offs:\n\t train_graph.enable(\n\t vector_sources=True,\n\t vector_destinations=True,\n\t vector_outbounds=True\n\t )\n\t\n\t # Consider using the methods made available in the Embiggen package\n\t # to run graph embedding or link prediction tasks.\n ' return AutomaticallyRetrievedGraph(graph_name='DbpediaWriter', dataset='networkrepository', directed=directed, verbose=verbose, cache_path=cache_path, additional_graph_kwargs=additional_graph_kwargs)()
def DbpediaWriter(directed: bool=False, verbose: int=2, cache_path: str='graphs/networkrepository', **additional_graph_kwargs: Dict) -> EnsmallenGraph: 'Return new instance of the dbpedia-writer graph.\n\n The graph is automatically retrieved from the NetworkRepository repository. \n\n\t\n\n Parameters\n -------------------\n directed: bool = False,\n Wether to load the graph as directed or undirected.\n By default false.\n verbose: int = 2,\n Wether to show loading bars during the retrieval and building\n of the graph.\n cache_path: str = "graphs",\n Where to store the downloaded graphs.\n additional_graph_kwargs: Dict,\n Additional graph kwargs.\n\n Returns\n -----------------------\n Instace of dbpedia-writer graph.\n\n\tReport\n\t---------------------\n\tAt the time of rendering these methods (please see datetime below), the graph\n\thad the following characteristics:\n\t\n\tDatetime: 2021-02-06 11:08:48.792091\n\t\n\tThe undirected graph dbpedia-writer has 89356 nodes and 144338 unweighted\n\tedges, of which 8 are self-loops. The graph is extremely sparse as it has\n\ta density of 0.00004 and is connected, as it has a single component. The\n\tgraph median node degree is 2, the mean node degree is 3.23, and the node\n\tdegree mode is 2. The top 5 most central nodes are 1618 (degree 247), 630\n\t(degree 237), 996 (degree 215), 1064 (degree 180) and 2667 (degree 143).\n\t\n\n\tReferences\n\t---------------------\n\tPlease cite the following if you use the data:\n\t\n\t@inproceedings{nr,\n\t title = {The Network Data Repository with Interactive Graph Analytics and Visualization},\n\t author={Ryan A. Rossi and Nesreen K. Ahmed},\n\t booktitle = {AAAI},\n\t url={http://networkrepository.com},\n\t year={2015}\n\t}\n\t\n\n\tUsage example\n\t----------------------\n\tThe usage of this graph is relatively straightforward:\n\t\n\t.. code:: python\n\t\n\t # First import the function to retrieve the graph from the datasets\n\t from ensmallen_graph.datasets.networkrepository import DbpediaWriter\n\t\n\t # Then load the graph\n\t graph = DbpediaWriter()\n\t\n\t # Finally, you can do anything with it, for instance, compute its report:\n\t print(graph)\n\t\n\t # If you need to run a link prediction task with validation,\n\t # you can split the graph using a connected holdout as follows:\n\t train_graph, validation_graph = graph.connected_holdout(\n\t # You can use an 80/20 split the holdout, for example.\n\t train_size=0.8,\n\t # The random state is used to reproduce the holdout.\n\t random_state=42,\n\t # Wether to show a loading bar.\n\t verbose=True\n\t )\n\t\n\t # Remember that, if you need, you can enable the memory-time trade-offs:\n\t train_graph.enable(\n\t vector_sources=True,\n\t vector_destinations=True,\n\t vector_outbounds=True\n\t )\n\t\n\t # Consider using the methods made available in the Embiggen package\n\t # to run graph embedding or link prediction tasks.\n ' return AutomaticallyRetrievedGraph(graph_name='DbpediaWriter', dataset='networkrepository', directed=directed, verbose=verbose, cache_path=cache_path, additional_graph_kwargs=additional_graph_kwargs)()<|docstring|>Return new instance of the dbpedia-writer graph. The graph is automatically retrieved from the NetworkRepository repository. Parameters ------------------- directed: bool = False, Wether to load the graph as directed or undirected. By default false. verbose: int = 2, Wether to show loading bars during the retrieval and building of the graph. cache_path: str = "graphs", Where to store the downloaded graphs. additional_graph_kwargs: Dict, Additional graph kwargs. Returns ----------------------- Instace of dbpedia-writer graph. Report --------------------- At the time of rendering these methods (please see datetime below), the graph had the following characteristics: Datetime: 2021-02-06 11:08:48.792091 The undirected graph dbpedia-writer has 89356 nodes and 144338 unweighted edges, of which 8 are self-loops. The graph is extremely sparse as it has a density of 0.00004 and is connected, as it has a single component. The graph median node degree is 2, the mean node degree is 3.23, and the node degree mode is 2. The top 5 most central nodes are 1618 (degree 247), 630 (degree 237), 996 (degree 215), 1064 (degree 180) and 2667 (degree 143). References --------------------- Please cite the following if you use the data: @inproceedings{nr, title = {The Network Data Repository with Interactive Graph Analytics and Visualization}, author={Ryan A. Rossi and Nesreen K. Ahmed}, booktitle = {AAAI}, url={http://networkrepository.com}, year={2015} } Usage example ---------------------- The usage of this graph is relatively straightforward: .. code:: python # First import the function to retrieve the graph from the datasets from ensmallen_graph.datasets.networkrepository import DbpediaWriter # Then load the graph graph = DbpediaWriter() # Finally, you can do anything with it, for instance, compute its report: print(graph) # If you need to run a link prediction task with validation, # you can split the graph using a connected holdout as follows: train_graph, validation_graph = graph.connected_holdout( # You can use an 80/20 split the holdout, for example. train_size=0.8, # The random state is used to reproduce the holdout. random_state=42, # Wether to show a loading bar. verbose=True ) # Remember that, if you need, you can enable the memory-time trade-offs: train_graph.enable( vector_sources=True, vector_destinations=True, vector_outbounds=True ) # Consider using the methods made available in the Embiggen package # to run graph embedding or link prediction tasks.<|endoftext|>
57abfedeb292743af770a21c25c65aa9ca0371f33ff8ab364f865e8028d9c3fe
def __init__(self, asset_id=None, asset_name=None, asset_type_id=None, asset_number=None, purchase_date=None, purchase_price=None, disposal_price=None, asset_status=None, warranty_expiry_date=None, serial_number=None, book_depreciation_setting=None, book_depreciation_detail=None, can_rollback=None, accounting_book_value=None, is_delete_enabled_for_date=None): 'Asset - a model defined in OpenAPI' self._asset_id = None self._asset_name = None self._asset_type_id = None self._asset_number = None self._purchase_date = None self._purchase_price = None self._disposal_price = None self._asset_status = None self._warranty_expiry_date = None self._serial_number = None self._book_depreciation_setting = None self._book_depreciation_detail = None self._can_rollback = None self._accounting_book_value = None self._is_delete_enabled_for_date = None self.discriminator = None if (asset_id is not None): self.asset_id = asset_id self.asset_name = asset_name if (asset_type_id is not None): self.asset_type_id = asset_type_id if (asset_number is not None): self.asset_number = asset_number if (purchase_date is not None): self.purchase_date = purchase_date if (purchase_price is not None): self.purchase_price = purchase_price if (disposal_price is not None): self.disposal_price = disposal_price if (asset_status is not None): self.asset_status = asset_status if (warranty_expiry_date is not None): self.warranty_expiry_date = warranty_expiry_date if (serial_number is not None): self.serial_number = serial_number if (book_depreciation_setting is not None): self.book_depreciation_setting = book_depreciation_setting if (book_depreciation_detail is not None): self.book_depreciation_detail = book_depreciation_detail if (can_rollback is not None): self.can_rollback = can_rollback if (accounting_book_value is not None): self.accounting_book_value = accounting_book_value if (is_delete_enabled_for_date is not None): self.is_delete_enabled_for_date = is_delete_enabled_for_date
Asset - a model defined in OpenAPI
xero_python/assets/models/asset.py
__init__
sromero84/xero-python
0
python
def __init__(self, asset_id=None, asset_name=None, asset_type_id=None, asset_number=None, purchase_date=None, purchase_price=None, disposal_price=None, asset_status=None, warranty_expiry_date=None, serial_number=None, book_depreciation_setting=None, book_depreciation_detail=None, can_rollback=None, accounting_book_value=None, is_delete_enabled_for_date=None): self._asset_id = None self._asset_name = None self._asset_type_id = None self._asset_number = None self._purchase_date = None self._purchase_price = None self._disposal_price = None self._asset_status = None self._warranty_expiry_date = None self._serial_number = None self._book_depreciation_setting = None self._book_depreciation_detail = None self._can_rollback = None self._accounting_book_value = None self._is_delete_enabled_for_date = None self.discriminator = None if (asset_id is not None): self.asset_id = asset_id self.asset_name = asset_name if (asset_type_id is not None): self.asset_type_id = asset_type_id if (asset_number is not None): self.asset_number = asset_number if (purchase_date is not None): self.purchase_date = purchase_date if (purchase_price is not None): self.purchase_price = purchase_price if (disposal_price is not None): self.disposal_price = disposal_price if (asset_status is not None): self.asset_status = asset_status if (warranty_expiry_date is not None): self.warranty_expiry_date = warranty_expiry_date if (serial_number is not None): self.serial_number = serial_number if (book_depreciation_setting is not None): self.book_depreciation_setting = book_depreciation_setting if (book_depreciation_detail is not None): self.book_depreciation_detail = book_depreciation_detail if (can_rollback is not None): self.can_rollback = can_rollback if (accounting_book_value is not None): self.accounting_book_value = accounting_book_value if (is_delete_enabled_for_date is not None): self.is_delete_enabled_for_date = is_delete_enabled_for_date
def __init__(self, asset_id=None, asset_name=None, asset_type_id=None, asset_number=None, purchase_date=None, purchase_price=None, disposal_price=None, asset_status=None, warranty_expiry_date=None, serial_number=None, book_depreciation_setting=None, book_depreciation_detail=None, can_rollback=None, accounting_book_value=None, is_delete_enabled_for_date=None): self._asset_id = None self._asset_name = None self._asset_type_id = None self._asset_number = None self._purchase_date = None self._purchase_price = None self._disposal_price = None self._asset_status = None self._warranty_expiry_date = None self._serial_number = None self._book_depreciation_setting = None self._book_depreciation_detail = None self._can_rollback = None self._accounting_book_value = None self._is_delete_enabled_for_date = None self.discriminator = None if (asset_id is not None): self.asset_id = asset_id self.asset_name = asset_name if (asset_type_id is not None): self.asset_type_id = asset_type_id if (asset_number is not None): self.asset_number = asset_number if (purchase_date is not None): self.purchase_date = purchase_date if (purchase_price is not None): self.purchase_price = purchase_price if (disposal_price is not None): self.disposal_price = disposal_price if (asset_status is not None): self.asset_status = asset_status if (warranty_expiry_date is not None): self.warranty_expiry_date = warranty_expiry_date if (serial_number is not None): self.serial_number = serial_number if (book_depreciation_setting is not None): self.book_depreciation_setting = book_depreciation_setting if (book_depreciation_detail is not None): self.book_depreciation_detail = book_depreciation_detail if (can_rollback is not None): self.can_rollback = can_rollback if (accounting_book_value is not None): self.accounting_book_value = accounting_book_value if (is_delete_enabled_for_date is not None): self.is_delete_enabled_for_date = is_delete_enabled_for_date<|docstring|>Asset - a model defined in OpenAPI<|endoftext|>
0878fdac425ba90ea932a0cd0137e651993e61872ca239475d0ad689f3f3774b
@property def asset_id(self): 'Gets the asset_id of this Asset. # noqa: E501\n\n The Xero-generated Id for the asset # noqa: E501\n\n :return: The asset_id of this Asset. # noqa: E501\n :rtype: str\n ' return self._asset_id
Gets the asset_id of this Asset. # noqa: E501 The Xero-generated Id for the asset # noqa: E501 :return: The asset_id of this Asset. # noqa: E501 :rtype: str
xero_python/assets/models/asset.py
asset_id
sromero84/xero-python
0
python
@property def asset_id(self): 'Gets the asset_id of this Asset. # noqa: E501\n\n The Xero-generated Id for the asset # noqa: E501\n\n :return: The asset_id of this Asset. # noqa: E501\n :rtype: str\n ' return self._asset_id
@property def asset_id(self): 'Gets the asset_id of this Asset. # noqa: E501\n\n The Xero-generated Id for the asset # noqa: E501\n\n :return: The asset_id of this Asset. # noqa: E501\n :rtype: str\n ' return self._asset_id<|docstring|>Gets the asset_id of this Asset. # noqa: E501 The Xero-generated Id for the asset # noqa: E501 :return: The asset_id of this Asset. # noqa: E501 :rtype: str<|endoftext|>
ba352636453f5fde5720f39d0d01053c2b9c5b62905152aea07ced12889603de
@asset_id.setter def asset_id(self, asset_id): 'Sets the asset_id of this Asset.\n\n The Xero-generated Id for the asset # noqa: E501\n\n :param asset_id: The asset_id of this Asset. # noqa: E501\n :type: str\n ' self._asset_id = asset_id
Sets the asset_id of this Asset. The Xero-generated Id for the asset # noqa: E501 :param asset_id: The asset_id of this Asset. # noqa: E501 :type: str
xero_python/assets/models/asset.py
asset_id
sromero84/xero-python
0
python
@asset_id.setter def asset_id(self, asset_id): 'Sets the asset_id of this Asset.\n\n The Xero-generated Id for the asset # noqa: E501\n\n :param asset_id: The asset_id of this Asset. # noqa: E501\n :type: str\n ' self._asset_id = asset_id
@asset_id.setter def asset_id(self, asset_id): 'Sets the asset_id of this Asset.\n\n The Xero-generated Id for the asset # noqa: E501\n\n :param asset_id: The asset_id of this Asset. # noqa: E501\n :type: str\n ' self._asset_id = asset_id<|docstring|>Sets the asset_id of this Asset. The Xero-generated Id for the asset # noqa: E501 :param asset_id: The asset_id of this Asset. # noqa: E501 :type: str<|endoftext|>
c0b72d3a1600c5854d8cc1074416112085ba245c9258f9f25d77d059ddc38316
@property def asset_name(self): 'Gets the asset_name of this Asset. # noqa: E501\n\n The name of the asset # noqa: E501\n\n :return: The asset_name of this Asset. # noqa: E501\n :rtype: str\n ' return self._asset_name
Gets the asset_name of this Asset. # noqa: E501 The name of the asset # noqa: E501 :return: The asset_name of this Asset. # noqa: E501 :rtype: str
xero_python/assets/models/asset.py
asset_name
sromero84/xero-python
0
python
@property def asset_name(self): 'Gets the asset_name of this Asset. # noqa: E501\n\n The name of the asset # noqa: E501\n\n :return: The asset_name of this Asset. # noqa: E501\n :rtype: str\n ' return self._asset_name
@property def asset_name(self): 'Gets the asset_name of this Asset. # noqa: E501\n\n The name of the asset # noqa: E501\n\n :return: The asset_name of this Asset. # noqa: E501\n :rtype: str\n ' return self._asset_name<|docstring|>Gets the asset_name of this Asset. # noqa: E501 The name of the asset # noqa: E501 :return: The asset_name of this Asset. # noqa: E501 :rtype: str<|endoftext|>
0ae1e2ff7656d40c50af76b848bb6685a68356e0441be5eab4bc7a6c79c96b89
@asset_name.setter def asset_name(self, asset_name): 'Sets the asset_name of this Asset.\n\n The name of the asset # noqa: E501\n\n :param asset_name: The asset_name of this Asset. # noqa: E501\n :type: str\n ' if (asset_name is None): raise ValueError('Invalid value for `asset_name`, must not be `None`') self._asset_name = asset_name
Sets the asset_name of this Asset. The name of the asset # noqa: E501 :param asset_name: The asset_name of this Asset. # noqa: E501 :type: str
xero_python/assets/models/asset.py
asset_name
sromero84/xero-python
0
python
@asset_name.setter def asset_name(self, asset_name): 'Sets the asset_name of this Asset.\n\n The name of the asset # noqa: E501\n\n :param asset_name: The asset_name of this Asset. # noqa: E501\n :type: str\n ' if (asset_name is None): raise ValueError('Invalid value for `asset_name`, must not be `None`') self._asset_name = asset_name
@asset_name.setter def asset_name(self, asset_name): 'Sets the asset_name of this Asset.\n\n The name of the asset # noqa: E501\n\n :param asset_name: The asset_name of this Asset. # noqa: E501\n :type: str\n ' if (asset_name is None): raise ValueError('Invalid value for `asset_name`, must not be `None`') self._asset_name = asset_name<|docstring|>Sets the asset_name of this Asset. The name of the asset # noqa: E501 :param asset_name: The asset_name of this Asset. # noqa: E501 :type: str<|endoftext|>
5da9712519ed4e70c0542ba929f9475b04770253565d557f240922de6634bc7a
@property def asset_type_id(self): 'Gets the asset_type_id of this Asset. # noqa: E501\n\n The Xero-generated Id for the asset type # noqa: E501\n\n :return: The asset_type_id of this Asset. # noqa: E501\n :rtype: str\n ' return self._asset_type_id
Gets the asset_type_id of this Asset. # noqa: E501 The Xero-generated Id for the asset type # noqa: E501 :return: The asset_type_id of this Asset. # noqa: E501 :rtype: str
xero_python/assets/models/asset.py
asset_type_id
sromero84/xero-python
0
python
@property def asset_type_id(self): 'Gets the asset_type_id of this Asset. # noqa: E501\n\n The Xero-generated Id for the asset type # noqa: E501\n\n :return: The asset_type_id of this Asset. # noqa: E501\n :rtype: str\n ' return self._asset_type_id
@property def asset_type_id(self): 'Gets the asset_type_id of this Asset. # noqa: E501\n\n The Xero-generated Id for the asset type # noqa: E501\n\n :return: The asset_type_id of this Asset. # noqa: E501\n :rtype: str\n ' return self._asset_type_id<|docstring|>Gets the asset_type_id of this Asset. # noqa: E501 The Xero-generated Id for the asset type # noqa: E501 :return: The asset_type_id of this Asset. # noqa: E501 :rtype: str<|endoftext|>
2113e3dc20f26945142a308c2236afbe3c8e4ef7952c9f5af6df9483b7928eec
@asset_type_id.setter def asset_type_id(self, asset_type_id): 'Sets the asset_type_id of this Asset.\n\n The Xero-generated Id for the asset type # noqa: E501\n\n :param asset_type_id: The asset_type_id of this Asset. # noqa: E501\n :type: str\n ' self._asset_type_id = asset_type_id
Sets the asset_type_id of this Asset. The Xero-generated Id for the asset type # noqa: E501 :param asset_type_id: The asset_type_id of this Asset. # noqa: E501 :type: str
xero_python/assets/models/asset.py
asset_type_id
sromero84/xero-python
0
python
@asset_type_id.setter def asset_type_id(self, asset_type_id): 'Sets the asset_type_id of this Asset.\n\n The Xero-generated Id for the asset type # noqa: E501\n\n :param asset_type_id: The asset_type_id of this Asset. # noqa: E501\n :type: str\n ' self._asset_type_id = asset_type_id
@asset_type_id.setter def asset_type_id(self, asset_type_id): 'Sets the asset_type_id of this Asset.\n\n The Xero-generated Id for the asset type # noqa: E501\n\n :param asset_type_id: The asset_type_id of this Asset. # noqa: E501\n :type: str\n ' self._asset_type_id = asset_type_id<|docstring|>Sets the asset_type_id of this Asset. The Xero-generated Id for the asset type # noqa: E501 :param asset_type_id: The asset_type_id of this Asset. # noqa: E501 :type: str<|endoftext|>
441d9b34d064518990218d8a24ee0bec97c7db634be9f9ead1f05300c88304b3
@property def asset_number(self): 'Gets the asset_number of this Asset. # noqa: E501\n\n Must be unique. # noqa: E501\n\n :return: The asset_number of this Asset. # noqa: E501\n :rtype: str\n ' return self._asset_number
Gets the asset_number of this Asset. # noqa: E501 Must be unique. # noqa: E501 :return: The asset_number of this Asset. # noqa: E501 :rtype: str
xero_python/assets/models/asset.py
asset_number
sromero84/xero-python
0
python
@property def asset_number(self): 'Gets the asset_number of this Asset. # noqa: E501\n\n Must be unique. # noqa: E501\n\n :return: The asset_number of this Asset. # noqa: E501\n :rtype: str\n ' return self._asset_number
@property def asset_number(self): 'Gets the asset_number of this Asset. # noqa: E501\n\n Must be unique. # noqa: E501\n\n :return: The asset_number of this Asset. # noqa: E501\n :rtype: str\n ' return self._asset_number<|docstring|>Gets the asset_number of this Asset. # noqa: E501 Must be unique. # noqa: E501 :return: The asset_number of this Asset. # noqa: E501 :rtype: str<|endoftext|>
f5d24206c910082719a0c6c925fd72ecc6c104895ddce013307b58b1a8320151
@asset_number.setter def asset_number(self, asset_number): 'Sets the asset_number of this Asset.\n\n Must be unique. # noqa: E501\n\n :param asset_number: The asset_number of this Asset. # noqa: E501\n :type: str\n ' self._asset_number = asset_number
Sets the asset_number of this Asset. Must be unique. # noqa: E501 :param asset_number: The asset_number of this Asset. # noqa: E501 :type: str
xero_python/assets/models/asset.py
asset_number
sromero84/xero-python
0
python
@asset_number.setter def asset_number(self, asset_number): 'Sets the asset_number of this Asset.\n\n Must be unique. # noqa: E501\n\n :param asset_number: The asset_number of this Asset. # noqa: E501\n :type: str\n ' self._asset_number = asset_number
@asset_number.setter def asset_number(self, asset_number): 'Sets the asset_number of this Asset.\n\n Must be unique. # noqa: E501\n\n :param asset_number: The asset_number of this Asset. # noqa: E501\n :type: str\n ' self._asset_number = asset_number<|docstring|>Sets the asset_number of this Asset. Must be unique. # noqa: E501 :param asset_number: The asset_number of this Asset. # noqa: E501 :type: str<|endoftext|>
5649f9c599960b35662c76434377c6ae7970e180b93b4871da27edcaee0ba46c
@property def purchase_date(self): 'Gets the purchase_date of this Asset. # noqa: E501\n\n The date the asset was purchased YYYY-MM-DD # noqa: E501\n\n :return: The purchase_date of this Asset. # noqa: E501\n :rtype: date\n ' return self._purchase_date
Gets the purchase_date of this Asset. # noqa: E501 The date the asset was purchased YYYY-MM-DD # noqa: E501 :return: The purchase_date of this Asset. # noqa: E501 :rtype: date
xero_python/assets/models/asset.py
purchase_date
sromero84/xero-python
0
python
@property def purchase_date(self): 'Gets the purchase_date of this Asset. # noqa: E501\n\n The date the asset was purchased YYYY-MM-DD # noqa: E501\n\n :return: The purchase_date of this Asset. # noqa: E501\n :rtype: date\n ' return self._purchase_date
@property def purchase_date(self): 'Gets the purchase_date of this Asset. # noqa: E501\n\n The date the asset was purchased YYYY-MM-DD # noqa: E501\n\n :return: The purchase_date of this Asset. # noqa: E501\n :rtype: date\n ' return self._purchase_date<|docstring|>Gets the purchase_date of this Asset. # noqa: E501 The date the asset was purchased YYYY-MM-DD # noqa: E501 :return: The purchase_date of this Asset. # noqa: E501 :rtype: date<|endoftext|>
fee7c19d0ab0749b377505e9c9731b8f200bd352f0cabb6494738abaf3ba3d38
@purchase_date.setter def purchase_date(self, purchase_date): 'Sets the purchase_date of this Asset.\n\n The date the asset was purchased YYYY-MM-DD # noqa: E501\n\n :param purchase_date: The purchase_date of this Asset. # noqa: E501\n :type: date\n ' self._purchase_date = purchase_date
Sets the purchase_date of this Asset. The date the asset was purchased YYYY-MM-DD # noqa: E501 :param purchase_date: The purchase_date of this Asset. # noqa: E501 :type: date
xero_python/assets/models/asset.py
purchase_date
sromero84/xero-python
0
python
@purchase_date.setter def purchase_date(self, purchase_date): 'Sets the purchase_date of this Asset.\n\n The date the asset was purchased YYYY-MM-DD # noqa: E501\n\n :param purchase_date: The purchase_date of this Asset. # noqa: E501\n :type: date\n ' self._purchase_date = purchase_date
@purchase_date.setter def purchase_date(self, purchase_date): 'Sets the purchase_date of this Asset.\n\n The date the asset was purchased YYYY-MM-DD # noqa: E501\n\n :param purchase_date: The purchase_date of this Asset. # noqa: E501\n :type: date\n ' self._purchase_date = purchase_date<|docstring|>Sets the purchase_date of this Asset. The date the asset was purchased YYYY-MM-DD # noqa: E501 :param purchase_date: The purchase_date of this Asset. # noqa: E501 :type: date<|endoftext|>
0ae2ddb77e55891bca90ca5fa9af8a906c7885b5e07e4ed87d405ff168b51008
@property def purchase_price(self): 'Gets the purchase_price of this Asset. # noqa: E501\n\n The purchase price of the asset # noqa: E501\n\n :return: The purchase_price of this Asset. # noqa: E501\n :rtype: float\n ' return self._purchase_price
Gets the purchase_price of this Asset. # noqa: E501 The purchase price of the asset # noqa: E501 :return: The purchase_price of this Asset. # noqa: E501 :rtype: float
xero_python/assets/models/asset.py
purchase_price
sromero84/xero-python
0
python
@property def purchase_price(self): 'Gets the purchase_price of this Asset. # noqa: E501\n\n The purchase price of the asset # noqa: E501\n\n :return: The purchase_price of this Asset. # noqa: E501\n :rtype: float\n ' return self._purchase_price
@property def purchase_price(self): 'Gets the purchase_price of this Asset. # noqa: E501\n\n The purchase price of the asset # noqa: E501\n\n :return: The purchase_price of this Asset. # noqa: E501\n :rtype: float\n ' return self._purchase_price<|docstring|>Gets the purchase_price of this Asset. # noqa: E501 The purchase price of the asset # noqa: E501 :return: The purchase_price of this Asset. # noqa: E501 :rtype: float<|endoftext|>
a1088da2204634c1d51bb81ea494938179283dab0c65f21130d8d17796400616
@purchase_price.setter def purchase_price(self, purchase_price): 'Sets the purchase_price of this Asset.\n\n The purchase price of the asset # noqa: E501\n\n :param purchase_price: The purchase_price of this Asset. # noqa: E501\n :type: float\n ' self._purchase_price = purchase_price
Sets the purchase_price of this Asset. The purchase price of the asset # noqa: E501 :param purchase_price: The purchase_price of this Asset. # noqa: E501 :type: float
xero_python/assets/models/asset.py
purchase_price
sromero84/xero-python
0
python
@purchase_price.setter def purchase_price(self, purchase_price): 'Sets the purchase_price of this Asset.\n\n The purchase price of the asset # noqa: E501\n\n :param purchase_price: The purchase_price of this Asset. # noqa: E501\n :type: float\n ' self._purchase_price = purchase_price
@purchase_price.setter def purchase_price(self, purchase_price): 'Sets the purchase_price of this Asset.\n\n The purchase price of the asset # noqa: E501\n\n :param purchase_price: The purchase_price of this Asset. # noqa: E501\n :type: float\n ' self._purchase_price = purchase_price<|docstring|>Sets the purchase_price of this Asset. The purchase price of the asset # noqa: E501 :param purchase_price: The purchase_price of this Asset. # noqa: E501 :type: float<|endoftext|>
ec13eb3f75c9bb704d79322c268fb827b7cec96a896c3fea54950b90de361aa8
@property def disposal_price(self): 'Gets the disposal_price of this Asset. # noqa: E501\n\n The price the asset was disposed at # noqa: E501\n\n :return: The disposal_price of this Asset. # noqa: E501\n :rtype: float\n ' return self._disposal_price
Gets the disposal_price of this Asset. # noqa: E501 The price the asset was disposed at # noqa: E501 :return: The disposal_price of this Asset. # noqa: E501 :rtype: float
xero_python/assets/models/asset.py
disposal_price
sromero84/xero-python
0
python
@property def disposal_price(self): 'Gets the disposal_price of this Asset. # noqa: E501\n\n The price the asset was disposed at # noqa: E501\n\n :return: The disposal_price of this Asset. # noqa: E501\n :rtype: float\n ' return self._disposal_price
@property def disposal_price(self): 'Gets the disposal_price of this Asset. # noqa: E501\n\n The price the asset was disposed at # noqa: E501\n\n :return: The disposal_price of this Asset. # noqa: E501\n :rtype: float\n ' return self._disposal_price<|docstring|>Gets the disposal_price of this Asset. # noqa: E501 The price the asset was disposed at # noqa: E501 :return: The disposal_price of this Asset. # noqa: E501 :rtype: float<|endoftext|>
c40ee92e0c8078455b1cb46c9a2e5c2587f058d828bcfaef904612d3d8ef2bf9
@disposal_price.setter def disposal_price(self, disposal_price): 'Sets the disposal_price of this Asset.\n\n The price the asset was disposed at # noqa: E501\n\n :param disposal_price: The disposal_price of this Asset. # noqa: E501\n :type: float\n ' self._disposal_price = disposal_price
Sets the disposal_price of this Asset. The price the asset was disposed at # noqa: E501 :param disposal_price: The disposal_price of this Asset. # noqa: E501 :type: float
xero_python/assets/models/asset.py
disposal_price
sromero84/xero-python
0
python
@disposal_price.setter def disposal_price(self, disposal_price): 'Sets the disposal_price of this Asset.\n\n The price the asset was disposed at # noqa: E501\n\n :param disposal_price: The disposal_price of this Asset. # noqa: E501\n :type: float\n ' self._disposal_price = disposal_price
@disposal_price.setter def disposal_price(self, disposal_price): 'Sets the disposal_price of this Asset.\n\n The price the asset was disposed at # noqa: E501\n\n :param disposal_price: The disposal_price of this Asset. # noqa: E501\n :type: float\n ' self._disposal_price = disposal_price<|docstring|>Sets the disposal_price of this Asset. The price the asset was disposed at # noqa: E501 :param disposal_price: The disposal_price of this Asset. # noqa: E501 :type: float<|endoftext|>
3ce4fd3895b7bed33edbb57d56905c990e57fc42b301a006058d6353adb19cd3
@property def asset_status(self): 'Gets the asset_status of this Asset. # noqa: E501\n\n\n :return: The asset_status of this Asset. # noqa: E501\n :rtype: AssetStatus\n ' return self._asset_status
Gets the asset_status of this Asset. # noqa: E501 :return: The asset_status of this Asset. # noqa: E501 :rtype: AssetStatus
xero_python/assets/models/asset.py
asset_status
sromero84/xero-python
0
python
@property def asset_status(self): 'Gets the asset_status of this Asset. # noqa: E501\n\n\n :return: The asset_status of this Asset. # noqa: E501\n :rtype: AssetStatus\n ' return self._asset_status
@property def asset_status(self): 'Gets the asset_status of this Asset. # noqa: E501\n\n\n :return: The asset_status of this Asset. # noqa: E501\n :rtype: AssetStatus\n ' return self._asset_status<|docstring|>Gets the asset_status of this Asset. # noqa: E501 :return: The asset_status of this Asset. # noqa: E501 :rtype: AssetStatus<|endoftext|>
ae02f0b20d07bc3c978b74010f555ff932b0eb214382b932df9d2546ae87f7bc
@asset_status.setter def asset_status(self, asset_status): 'Sets the asset_status of this Asset.\n\n\n :param asset_status: The asset_status of this Asset. # noqa: E501\n :type: AssetStatus\n ' self._asset_status = asset_status
Sets the asset_status of this Asset. :param asset_status: The asset_status of this Asset. # noqa: E501 :type: AssetStatus
xero_python/assets/models/asset.py
asset_status
sromero84/xero-python
0
python
@asset_status.setter def asset_status(self, asset_status): 'Sets the asset_status of this Asset.\n\n\n :param asset_status: The asset_status of this Asset. # noqa: E501\n :type: AssetStatus\n ' self._asset_status = asset_status
@asset_status.setter def asset_status(self, asset_status): 'Sets the asset_status of this Asset.\n\n\n :param asset_status: The asset_status of this Asset. # noqa: E501\n :type: AssetStatus\n ' self._asset_status = asset_status<|docstring|>Sets the asset_status of this Asset. :param asset_status: The asset_status of this Asset. # noqa: E501 :type: AssetStatus<|endoftext|>
d79f94025cca023ebc7969af4da6e59dcbf2eaa9316cdc8d9eca391563237f45
@property def warranty_expiry_date(self): 'Gets the warranty_expiry_date of this Asset. # noqa: E501\n\n The date the asset’s warranty expires (if needed) YYYY-MM-DD # noqa: E501\n\n :return: The warranty_expiry_date of this Asset. # noqa: E501\n :rtype: str\n ' return self._warranty_expiry_date
Gets the warranty_expiry_date of this Asset. # noqa: E501 The date the asset’s warranty expires (if needed) YYYY-MM-DD # noqa: E501 :return: The warranty_expiry_date of this Asset. # noqa: E501 :rtype: str
xero_python/assets/models/asset.py
warranty_expiry_date
sromero84/xero-python
0
python
@property def warranty_expiry_date(self): 'Gets the warranty_expiry_date of this Asset. # noqa: E501\n\n The date the asset’s warranty expires (if needed) YYYY-MM-DD # noqa: E501\n\n :return: The warranty_expiry_date of this Asset. # noqa: E501\n :rtype: str\n ' return self._warranty_expiry_date
@property def warranty_expiry_date(self): 'Gets the warranty_expiry_date of this Asset. # noqa: E501\n\n The date the asset’s warranty expires (if needed) YYYY-MM-DD # noqa: E501\n\n :return: The warranty_expiry_date of this Asset. # noqa: E501\n :rtype: str\n ' return self._warranty_expiry_date<|docstring|>Gets the warranty_expiry_date of this Asset. # noqa: E501 The date the asset’s warranty expires (if needed) YYYY-MM-DD # noqa: E501 :return: The warranty_expiry_date of this Asset. # noqa: E501 :rtype: str<|endoftext|>
2c05066eebcbbe233ae11ea462866fa1947c2a91eaa057923721fa4dad5aaedd
@warranty_expiry_date.setter def warranty_expiry_date(self, warranty_expiry_date): 'Sets the warranty_expiry_date of this Asset.\n\n The date the asset’s warranty expires (if needed) YYYY-MM-DD # noqa: E501\n\n :param warranty_expiry_date: The warranty_expiry_date of this Asset. # noqa: E501\n :type: str\n ' self._warranty_expiry_date = warranty_expiry_date
Sets the warranty_expiry_date of this Asset. The date the asset’s warranty expires (if needed) YYYY-MM-DD # noqa: E501 :param warranty_expiry_date: The warranty_expiry_date of this Asset. # noqa: E501 :type: str
xero_python/assets/models/asset.py
warranty_expiry_date
sromero84/xero-python
0
python
@warranty_expiry_date.setter def warranty_expiry_date(self, warranty_expiry_date): 'Sets the warranty_expiry_date of this Asset.\n\n The date the asset’s warranty expires (if needed) YYYY-MM-DD # noqa: E501\n\n :param warranty_expiry_date: The warranty_expiry_date of this Asset. # noqa: E501\n :type: str\n ' self._warranty_expiry_date = warranty_expiry_date
@warranty_expiry_date.setter def warranty_expiry_date(self, warranty_expiry_date): 'Sets the warranty_expiry_date of this Asset.\n\n The date the asset’s warranty expires (if needed) YYYY-MM-DD # noqa: E501\n\n :param warranty_expiry_date: The warranty_expiry_date of this Asset. # noqa: E501\n :type: str\n ' self._warranty_expiry_date = warranty_expiry_date<|docstring|>Sets the warranty_expiry_date of this Asset. The date the asset’s warranty expires (if needed) YYYY-MM-DD # noqa: E501 :param warranty_expiry_date: The warranty_expiry_date of this Asset. # noqa: E501 :type: str<|endoftext|>
5a2cae6b49bf9a92039e60dd411373991c1dd8440cc870566cf2cc26f45ee332
@property def serial_number(self): "Gets the serial_number of this Asset. # noqa: E501\n\n The asset's serial number # noqa: E501\n\n :return: The serial_number of this Asset. # noqa: E501\n :rtype: str\n " return self._serial_number
Gets the serial_number of this Asset. # noqa: E501 The asset's serial number # noqa: E501 :return: The serial_number of this Asset. # noqa: E501 :rtype: str
xero_python/assets/models/asset.py
serial_number
sromero84/xero-python
0
python
@property def serial_number(self): "Gets the serial_number of this Asset. # noqa: E501\n\n The asset's serial number # noqa: E501\n\n :return: The serial_number of this Asset. # noqa: E501\n :rtype: str\n " return self._serial_number
@property def serial_number(self): "Gets the serial_number of this Asset. # noqa: E501\n\n The asset's serial number # noqa: E501\n\n :return: The serial_number of this Asset. # noqa: E501\n :rtype: str\n " return self._serial_number<|docstring|>Gets the serial_number of this Asset. # noqa: E501 The asset's serial number # noqa: E501 :return: The serial_number of this Asset. # noqa: E501 :rtype: str<|endoftext|>
14d50919bb4cff5e9f5c8828dfee7dc165073f56f374a57e171e7ff01ded8e5d
@serial_number.setter def serial_number(self, serial_number): "Sets the serial_number of this Asset.\n\n The asset's serial number # noqa: E501\n\n :param serial_number: The serial_number of this Asset. # noqa: E501\n :type: str\n " self._serial_number = serial_number
Sets the serial_number of this Asset. The asset's serial number # noqa: E501 :param serial_number: The serial_number of this Asset. # noqa: E501 :type: str
xero_python/assets/models/asset.py
serial_number
sromero84/xero-python
0
python
@serial_number.setter def serial_number(self, serial_number): "Sets the serial_number of this Asset.\n\n The asset's serial number # noqa: E501\n\n :param serial_number: The serial_number of this Asset. # noqa: E501\n :type: str\n " self._serial_number = serial_number
@serial_number.setter def serial_number(self, serial_number): "Sets the serial_number of this Asset.\n\n The asset's serial number # noqa: E501\n\n :param serial_number: The serial_number of this Asset. # noqa: E501\n :type: str\n " self._serial_number = serial_number<|docstring|>Sets the serial_number of this Asset. The asset's serial number # noqa: E501 :param serial_number: The serial_number of this Asset. # noqa: E501 :type: str<|endoftext|>
585016b56107453f377c42081a3be4acce7616edec29b131f488d9d5a6b3d89b
@property def book_depreciation_setting(self): 'Gets the book_depreciation_setting of this Asset. # noqa: E501\n\n\n :return: The book_depreciation_setting of this Asset. # noqa: E501\n :rtype: BookDepreciationSetting\n ' return self._book_depreciation_setting
Gets the book_depreciation_setting of this Asset. # noqa: E501 :return: The book_depreciation_setting of this Asset. # noqa: E501 :rtype: BookDepreciationSetting
xero_python/assets/models/asset.py
book_depreciation_setting
sromero84/xero-python
0
python
@property def book_depreciation_setting(self): 'Gets the book_depreciation_setting of this Asset. # noqa: E501\n\n\n :return: The book_depreciation_setting of this Asset. # noqa: E501\n :rtype: BookDepreciationSetting\n ' return self._book_depreciation_setting
@property def book_depreciation_setting(self): 'Gets the book_depreciation_setting of this Asset. # noqa: E501\n\n\n :return: The book_depreciation_setting of this Asset. # noqa: E501\n :rtype: BookDepreciationSetting\n ' return self._book_depreciation_setting<|docstring|>Gets the book_depreciation_setting of this Asset. # noqa: E501 :return: The book_depreciation_setting of this Asset. # noqa: E501 :rtype: BookDepreciationSetting<|endoftext|>
09751577f758f8ab02091903ba716952dd15c3bcf0491eb401cc3bc35ae189ff
@book_depreciation_setting.setter def book_depreciation_setting(self, book_depreciation_setting): 'Sets the book_depreciation_setting of this Asset.\n\n\n :param book_depreciation_setting: The book_depreciation_setting of this Asset. # noqa: E501\n :type: BookDepreciationSetting\n ' self._book_depreciation_setting = book_depreciation_setting
Sets the book_depreciation_setting of this Asset. :param book_depreciation_setting: The book_depreciation_setting of this Asset. # noqa: E501 :type: BookDepreciationSetting
xero_python/assets/models/asset.py
book_depreciation_setting
sromero84/xero-python
0
python
@book_depreciation_setting.setter def book_depreciation_setting(self, book_depreciation_setting): 'Sets the book_depreciation_setting of this Asset.\n\n\n :param book_depreciation_setting: The book_depreciation_setting of this Asset. # noqa: E501\n :type: BookDepreciationSetting\n ' self._book_depreciation_setting = book_depreciation_setting
@book_depreciation_setting.setter def book_depreciation_setting(self, book_depreciation_setting): 'Sets the book_depreciation_setting of this Asset.\n\n\n :param book_depreciation_setting: The book_depreciation_setting of this Asset. # noqa: E501\n :type: BookDepreciationSetting\n ' self._book_depreciation_setting = book_depreciation_setting<|docstring|>Sets the book_depreciation_setting of this Asset. :param book_depreciation_setting: The book_depreciation_setting of this Asset. # noqa: E501 :type: BookDepreciationSetting<|endoftext|>
d947cabffb55023affdba84e193fec407d17240bc87372dbf960c208682470ad
@property def book_depreciation_detail(self): 'Gets the book_depreciation_detail of this Asset. # noqa: E501\n\n\n :return: The book_depreciation_detail of this Asset. # noqa: E501\n :rtype: BookDepreciationDetail\n ' return self._book_depreciation_detail
Gets the book_depreciation_detail of this Asset. # noqa: E501 :return: The book_depreciation_detail of this Asset. # noqa: E501 :rtype: BookDepreciationDetail
xero_python/assets/models/asset.py
book_depreciation_detail
sromero84/xero-python
0
python
@property def book_depreciation_detail(self): 'Gets the book_depreciation_detail of this Asset. # noqa: E501\n\n\n :return: The book_depreciation_detail of this Asset. # noqa: E501\n :rtype: BookDepreciationDetail\n ' return self._book_depreciation_detail
@property def book_depreciation_detail(self): 'Gets the book_depreciation_detail of this Asset. # noqa: E501\n\n\n :return: The book_depreciation_detail of this Asset. # noqa: E501\n :rtype: BookDepreciationDetail\n ' return self._book_depreciation_detail<|docstring|>Gets the book_depreciation_detail of this Asset. # noqa: E501 :return: The book_depreciation_detail of this Asset. # noqa: E501 :rtype: BookDepreciationDetail<|endoftext|>
14fdc8d86bb8a971d3b9ab4a3d7292d1bcd3aceff8e98a6a39cd01bf2e36bc41
@book_depreciation_detail.setter def book_depreciation_detail(self, book_depreciation_detail): 'Sets the book_depreciation_detail of this Asset.\n\n\n :param book_depreciation_detail: The book_depreciation_detail of this Asset. # noqa: E501\n :type: BookDepreciationDetail\n ' self._book_depreciation_detail = book_depreciation_detail
Sets the book_depreciation_detail of this Asset. :param book_depreciation_detail: The book_depreciation_detail of this Asset. # noqa: E501 :type: BookDepreciationDetail
xero_python/assets/models/asset.py
book_depreciation_detail
sromero84/xero-python
0
python
@book_depreciation_detail.setter def book_depreciation_detail(self, book_depreciation_detail): 'Sets the book_depreciation_detail of this Asset.\n\n\n :param book_depreciation_detail: The book_depreciation_detail of this Asset. # noqa: E501\n :type: BookDepreciationDetail\n ' self._book_depreciation_detail = book_depreciation_detail
@book_depreciation_detail.setter def book_depreciation_detail(self, book_depreciation_detail): 'Sets the book_depreciation_detail of this Asset.\n\n\n :param book_depreciation_detail: The book_depreciation_detail of this Asset. # noqa: E501\n :type: BookDepreciationDetail\n ' self._book_depreciation_detail = book_depreciation_detail<|docstring|>Sets the book_depreciation_detail of this Asset. :param book_depreciation_detail: The book_depreciation_detail of this Asset. # noqa: E501 :type: BookDepreciationDetail<|endoftext|>
81f71ea6e464935032d29cda8868393747d1ea9f5dab314b639a98c5f2d9849f
@property def can_rollback(self): "Gets the can_rollback of this Asset. # noqa: E501\n\n Boolean to indicate whether depreciation can be rolled back for this asset individually. This is true if it doesn't have 'legacy' journal entries and if there is no lock period that would prevent this asset from rolling back. # noqa: E501\n\n :return: The can_rollback of this Asset. # noqa: E501\n :rtype: bool\n " return self._can_rollback
Gets the can_rollback of this Asset. # noqa: E501 Boolean to indicate whether depreciation can be rolled back for this asset individually. This is true if it doesn't have 'legacy' journal entries and if there is no lock period that would prevent this asset from rolling back. # noqa: E501 :return: The can_rollback of this Asset. # noqa: E501 :rtype: bool
xero_python/assets/models/asset.py
can_rollback
sromero84/xero-python
0
python
@property def can_rollback(self): "Gets the can_rollback of this Asset. # noqa: E501\n\n Boolean to indicate whether depreciation can be rolled back for this asset individually. This is true if it doesn't have 'legacy' journal entries and if there is no lock period that would prevent this asset from rolling back. # noqa: E501\n\n :return: The can_rollback of this Asset. # noqa: E501\n :rtype: bool\n " return self._can_rollback
@property def can_rollback(self): "Gets the can_rollback of this Asset. # noqa: E501\n\n Boolean to indicate whether depreciation can be rolled back for this asset individually. This is true if it doesn't have 'legacy' journal entries and if there is no lock period that would prevent this asset from rolling back. # noqa: E501\n\n :return: The can_rollback of this Asset. # noqa: E501\n :rtype: bool\n " return self._can_rollback<|docstring|>Gets the can_rollback of this Asset. # noqa: E501 Boolean to indicate whether depreciation can be rolled back for this asset individually. This is true if it doesn't have 'legacy' journal entries and if there is no lock period that would prevent this asset from rolling back. # noqa: E501 :return: The can_rollback of this Asset. # noqa: E501 :rtype: bool<|endoftext|>
f7a837d898e7d2848ce97ad7104e19580dbcd6307fce4dd16f989d14a81cd9eb
@can_rollback.setter def can_rollback(self, can_rollback): "Sets the can_rollback of this Asset.\n\n Boolean to indicate whether depreciation can be rolled back for this asset individually. This is true if it doesn't have 'legacy' journal entries and if there is no lock period that would prevent this asset from rolling back. # noqa: E501\n\n :param can_rollback: The can_rollback of this Asset. # noqa: E501\n :type: bool\n " self._can_rollback = can_rollback
Sets the can_rollback of this Asset. Boolean to indicate whether depreciation can be rolled back for this asset individually. This is true if it doesn't have 'legacy' journal entries and if there is no lock period that would prevent this asset from rolling back. # noqa: E501 :param can_rollback: The can_rollback of this Asset. # noqa: E501 :type: bool
xero_python/assets/models/asset.py
can_rollback
sromero84/xero-python
0
python
@can_rollback.setter def can_rollback(self, can_rollback): "Sets the can_rollback of this Asset.\n\n Boolean to indicate whether depreciation can be rolled back for this asset individually. This is true if it doesn't have 'legacy' journal entries and if there is no lock period that would prevent this asset from rolling back. # noqa: E501\n\n :param can_rollback: The can_rollback of this Asset. # noqa: E501\n :type: bool\n " self._can_rollback = can_rollback
@can_rollback.setter def can_rollback(self, can_rollback): "Sets the can_rollback of this Asset.\n\n Boolean to indicate whether depreciation can be rolled back for this asset individually. This is true if it doesn't have 'legacy' journal entries and if there is no lock period that would prevent this asset from rolling back. # noqa: E501\n\n :param can_rollback: The can_rollback of this Asset. # noqa: E501\n :type: bool\n " self._can_rollback = can_rollback<|docstring|>Sets the can_rollback of this Asset. Boolean to indicate whether depreciation can be rolled back for this asset individually. This is true if it doesn't have 'legacy' journal entries and if there is no lock period that would prevent this asset from rolling back. # noqa: E501 :param can_rollback: The can_rollback of this Asset. # noqa: E501 :type: bool<|endoftext|>
499a89824e8ee83f6c99813299229e2980276424af94fe1fc327b1d8a6f98dfe
@property def accounting_book_value(self): 'Gets the accounting_book_value of this Asset. # noqa: E501\n\n The accounting value of the asset # noqa: E501\n\n :return: The accounting_book_value of this Asset. # noqa: E501\n :rtype: float\n ' return self._accounting_book_value
Gets the accounting_book_value of this Asset. # noqa: E501 The accounting value of the asset # noqa: E501 :return: The accounting_book_value of this Asset. # noqa: E501 :rtype: float
xero_python/assets/models/asset.py
accounting_book_value
sromero84/xero-python
0
python
@property def accounting_book_value(self): 'Gets the accounting_book_value of this Asset. # noqa: E501\n\n The accounting value of the asset # noqa: E501\n\n :return: The accounting_book_value of this Asset. # noqa: E501\n :rtype: float\n ' return self._accounting_book_value
@property def accounting_book_value(self): 'Gets the accounting_book_value of this Asset. # noqa: E501\n\n The accounting value of the asset # noqa: E501\n\n :return: The accounting_book_value of this Asset. # noqa: E501\n :rtype: float\n ' return self._accounting_book_value<|docstring|>Gets the accounting_book_value of this Asset. # noqa: E501 The accounting value of the asset # noqa: E501 :return: The accounting_book_value of this Asset. # noqa: E501 :rtype: float<|endoftext|>
8ab1254fb62442e8622c019feda6531322ecad1453543ea7469ffeca8321860e
@accounting_book_value.setter def accounting_book_value(self, accounting_book_value): 'Sets the accounting_book_value of this Asset.\n\n The accounting value of the asset # noqa: E501\n\n :param accounting_book_value: The accounting_book_value of this Asset. # noqa: E501\n :type: float\n ' self._accounting_book_value = accounting_book_value
Sets the accounting_book_value of this Asset. The accounting value of the asset # noqa: E501 :param accounting_book_value: The accounting_book_value of this Asset. # noqa: E501 :type: float
xero_python/assets/models/asset.py
accounting_book_value
sromero84/xero-python
0
python
@accounting_book_value.setter def accounting_book_value(self, accounting_book_value): 'Sets the accounting_book_value of this Asset.\n\n The accounting value of the asset # noqa: E501\n\n :param accounting_book_value: The accounting_book_value of this Asset. # noqa: E501\n :type: float\n ' self._accounting_book_value = accounting_book_value
@accounting_book_value.setter def accounting_book_value(self, accounting_book_value): 'Sets the accounting_book_value of this Asset.\n\n The accounting value of the asset # noqa: E501\n\n :param accounting_book_value: The accounting_book_value of this Asset. # noqa: E501\n :type: float\n ' self._accounting_book_value = accounting_book_value<|docstring|>Sets the accounting_book_value of this Asset. The accounting value of the asset # noqa: E501 :param accounting_book_value: The accounting_book_value of this Asset. # noqa: E501 :type: float<|endoftext|>
9b22ec476860d2f603034ffdd78d7e8aaaa048f7104cf2ef1ff8476059a4e1fe
@property def is_delete_enabled_for_date(self): 'Gets the is_delete_enabled_for_date of this Asset. # noqa: E501\n\n Boolean to indicate whether delete is enabled # noqa: E501\n\n :return: The is_delete_enabled_for_date of this Asset. # noqa: E501\n :rtype: bool\n ' return self._is_delete_enabled_for_date
Gets the is_delete_enabled_for_date of this Asset. # noqa: E501 Boolean to indicate whether delete is enabled # noqa: E501 :return: The is_delete_enabled_for_date of this Asset. # noqa: E501 :rtype: bool
xero_python/assets/models/asset.py
is_delete_enabled_for_date
sromero84/xero-python
0
python
@property def is_delete_enabled_for_date(self): 'Gets the is_delete_enabled_for_date of this Asset. # noqa: E501\n\n Boolean to indicate whether delete is enabled # noqa: E501\n\n :return: The is_delete_enabled_for_date of this Asset. # noqa: E501\n :rtype: bool\n ' return self._is_delete_enabled_for_date
@property def is_delete_enabled_for_date(self): 'Gets the is_delete_enabled_for_date of this Asset. # noqa: E501\n\n Boolean to indicate whether delete is enabled # noqa: E501\n\n :return: The is_delete_enabled_for_date of this Asset. # noqa: E501\n :rtype: bool\n ' return self._is_delete_enabled_for_date<|docstring|>Gets the is_delete_enabled_for_date of this Asset. # noqa: E501 Boolean to indicate whether delete is enabled # noqa: E501 :return: The is_delete_enabled_for_date of this Asset. # noqa: E501 :rtype: bool<|endoftext|>
d4af31ebf5531047e985d35cbbc692c6badd958fd30de964b22d1bcda0fc7302
@is_delete_enabled_for_date.setter def is_delete_enabled_for_date(self, is_delete_enabled_for_date): 'Sets the is_delete_enabled_for_date of this Asset.\n\n Boolean to indicate whether delete is enabled # noqa: E501\n\n :param is_delete_enabled_for_date: The is_delete_enabled_for_date of this Asset. # noqa: E501\n :type: bool\n ' self._is_delete_enabled_for_date = is_delete_enabled_for_date
Sets the is_delete_enabled_for_date of this Asset. Boolean to indicate whether delete is enabled # noqa: E501 :param is_delete_enabled_for_date: The is_delete_enabled_for_date of this Asset. # noqa: E501 :type: bool
xero_python/assets/models/asset.py
is_delete_enabled_for_date
sromero84/xero-python
0
python
@is_delete_enabled_for_date.setter def is_delete_enabled_for_date(self, is_delete_enabled_for_date): 'Sets the is_delete_enabled_for_date of this Asset.\n\n Boolean to indicate whether delete is enabled # noqa: E501\n\n :param is_delete_enabled_for_date: The is_delete_enabled_for_date of this Asset. # noqa: E501\n :type: bool\n ' self._is_delete_enabled_for_date = is_delete_enabled_for_date
@is_delete_enabled_for_date.setter def is_delete_enabled_for_date(self, is_delete_enabled_for_date): 'Sets the is_delete_enabled_for_date of this Asset.\n\n Boolean to indicate whether delete is enabled # noqa: E501\n\n :param is_delete_enabled_for_date: The is_delete_enabled_for_date of this Asset. # noqa: E501\n :type: bool\n ' self._is_delete_enabled_for_date = is_delete_enabled_for_date<|docstring|>Sets the is_delete_enabled_for_date of this Asset. Boolean to indicate whether delete is enabled # noqa: E501 :param is_delete_enabled_for_date: The is_delete_enabled_for_date of this Asset. # noqa: E501 :type: bool<|endoftext|>
c832198cff03c9acef90230b0ba384b2392c4534a8ae275f0041c5a15263a89d
def getquoted(self): 'Return the appropriate SQL for the given object, typecast\n to the registered db_type.\n ' adapted = adapt(tuple(self._obj)) adapted.prepare(connection.connection) return '{sql}::{db_type}'.format(db_type=self._db_type, sql=adapted.getquoted().decode('utf8')).encode('utf8')
Return the appropriate SQL for the given object, typecast to the registered db_type.
django_pg/models/fields/composite/adapter.py
getquoted
lavr/django-pgfields
1
python
def getquoted(self): 'Return the appropriate SQL for the given object, typecast\n to the registered db_type.\n ' adapted = adapt(tuple(self._obj)) adapted.prepare(connection.connection) return '{sql}::{db_type}'.format(db_type=self._db_type, sql=adapted.getquoted().decode('utf8')).encode('utf8')
def getquoted(self): 'Return the appropriate SQL for the given object, typecast\n to the registered db_type.\n ' adapted = adapt(tuple(self._obj)) adapted.prepare(connection.connection) return '{sql}::{db_type}'.format(db_type=self._db_type, sql=adapted.getquoted().decode('utf8')).encode('utf8')<|docstring|>Return the appropriate SQL for the given object, typecast to the registered db_type.<|endoftext|>
6d9df1f6e442a4b21fdcd36808b6d36214655068a0301edf4ef952358692e94a
def validate_expression(wildcard_expression): " Validates and shortens the wild card expression(if needed) without changing the intended meaning .\n\n Parameters\n ----------\n wildcard_expression: str\n\n Returns\n -------\n str\n A shortened copy of the wild card expression.\n\n Raises\n ------\n InvalidWildCardExpressionError\n Any error while validating the expression.\n\n Example\n -------\n >>> from lexpy._utils import validate_expression\n >>> sample_expr = 'a*?' # Match literal `a` followed by any character Zero or unlimited times.\n >>> print(validate_expression(sample_expr)) # Outputs 'a*'\n " try: if (re.search(__questionmark_after_asterisk_pattern, wildcard_expression) is not None): raise InvalidWildCardExpressionError(wildcard_expression, "A '?' followed by an '*' in the wildcard expr is illegal") if (re.search(__illegal_characters_pattern, wildcard_expression) is not None): raise InvalidWildCardExpressionError(wildcard_expression, 'Illegal Characters') except InvalidWildCardExpressionError as e: raise e result = re.sub('\\*+', '*', wildcard_expression) result = re.sub('\\?+', '?', result) result = re.sub('(\\*\\?)+', '*', result) return result
Validates and shortens the wild card expression(if needed) without changing the intended meaning . Parameters ---------- wildcard_expression: str Returns ------- str A shortened copy of the wild card expression. Raises ------ InvalidWildCardExpressionError Any error while validating the expression. Example ------- >>> from lexpy._utils import validate_expression >>> sample_expr = 'a*?' # Match literal `a` followed by any character Zero or unlimited times. >>> print(validate_expression(sample_expr)) # Outputs 'a*'
inc_search/_utils/utils.py
validate_expression
nguyentritai2906/inc_search
0
python
def validate_expression(wildcard_expression): " Validates and shortens the wild card expression(if needed) without changing the intended meaning .\n\n Parameters\n ----------\n wildcard_expression: str\n\n Returns\n -------\n str\n A shortened copy of the wild card expression.\n\n Raises\n ------\n InvalidWildCardExpressionError\n Any error while validating the expression.\n\n Example\n -------\n >>> from lexpy._utils import validate_expression\n >>> sample_expr = 'a*?' # Match literal `a` followed by any character Zero or unlimited times.\n >>> print(validate_expression(sample_expr)) # Outputs 'a*'\n " try: if (re.search(__questionmark_after_asterisk_pattern, wildcard_expression) is not None): raise InvalidWildCardExpressionError(wildcard_expression, "A '?' followed by an '*' in the wildcard expr is illegal") if (re.search(__illegal_characters_pattern, wildcard_expression) is not None): raise InvalidWildCardExpressionError(wildcard_expression, 'Illegal Characters') except InvalidWildCardExpressionError as e: raise e result = re.sub('\\*+', '*', wildcard_expression) result = re.sub('\\?+', '?', result) result = re.sub('(\\*\\?)+', '*', result) return result
def validate_expression(wildcard_expression): " Validates and shortens the wild card expression(if needed) without changing the intended meaning .\n\n Parameters\n ----------\n wildcard_expression: str\n\n Returns\n -------\n str\n A shortened copy of the wild card expression.\n\n Raises\n ------\n InvalidWildCardExpressionError\n Any error while validating the expression.\n\n Example\n -------\n >>> from lexpy._utils import validate_expression\n >>> sample_expr = 'a*?' # Match literal `a` followed by any character Zero or unlimited times.\n >>> print(validate_expression(sample_expr)) # Outputs 'a*'\n " try: if (re.search(__questionmark_after_asterisk_pattern, wildcard_expression) is not None): raise InvalidWildCardExpressionError(wildcard_expression, "A '?' followed by an '*' in the wildcard expr is illegal") if (re.search(__illegal_characters_pattern, wildcard_expression) is not None): raise InvalidWildCardExpressionError(wildcard_expression, 'Illegal Characters') except InvalidWildCardExpressionError as e: raise e result = re.sub('\\*+', '*', wildcard_expression) result = re.sub('\\?+', '?', result) result = re.sub('(\\*\\?)+', '*', result) return result<|docstring|>Validates and shortens the wild card expression(if needed) without changing the intended meaning . Parameters ---------- wildcard_expression: str Returns ------- str A shortened copy of the wild card expression. Raises ------ InvalidWildCardExpressionError Any error while validating the expression. Example ------- >>> from lexpy._utils import validate_expression >>> sample_expr = 'a*?' # Match literal `a` followed by any character Zero or unlimited times. >>> print(validate_expression(sample_expr)) # Outputs 'a*'<|endoftext|>
46c6c5fe45ac361d1dcbbc9aaae6822a3a1bb288557885b9e8306362dc8dc400
def get_all_apps(): ' Get all available desktop app\n\n Returns\n -------\n all_apps: list\n A list of all apps as AppInfo objects\n app_dict: {Display Name: AppInfo Object}\n A dictionary of all apps\n ' app_dict = {} if (platform == 'linux'): all_apps = Gio.AppInfo.get_all() app_dict = {app.get_display_name().lower(): app for app in all_apps} elif (platform == 'win32'): pass return app_dict
Get all available desktop app Returns ------- all_apps: list A list of all apps as AppInfo objects app_dict: {Display Name: AppInfo Object} A dictionary of all apps
inc_search/_utils/utils.py
get_all_apps
nguyentritai2906/inc_search
0
python
def get_all_apps(): ' Get all available desktop app\n\n Returns\n -------\n all_apps: list\n A list of all apps as AppInfo objects\n app_dict: {Display Name: AppInfo Object}\n A dictionary of all apps\n ' app_dict = {} if (platform == 'linux'): all_apps = Gio.AppInfo.get_all() app_dict = {app.get_display_name().lower(): app for app in all_apps} elif (platform == 'win32'): pass return app_dict
def get_all_apps(): ' Get all available desktop app\n\n Returns\n -------\n all_apps: list\n A list of all apps as AppInfo objects\n app_dict: {Display Name: AppInfo Object}\n A dictionary of all apps\n ' app_dict = {} if (platform == 'linux'): all_apps = Gio.AppInfo.get_all() app_dict = {app.get_display_name().lower(): app for app in all_apps} elif (platform == 'win32'): pass return app_dict<|docstring|>Get all available desktop app Returns ------- all_apps: list A list of all apps as AppInfo objects app_dict: {Display Name: AppInfo Object} A dictionary of all apps<|endoftext|>
4793cbe8f0114280bedb8819b98e00ab03034d78a5a7c02d3d91a12f1362a0c9
def _map_fusion_test_cases(): 'Generates test cases for the MapFusion optimization.' identity = (lambda x: x) increment = (lambda x: (x + 1)) def increment_and_square(x): y = (x + 1) return (y * y) functions = [identity, increment, increment_and_square] tests = [] for (i, fun1) in enumerate(functions): for (j, fun2) in enumerate(functions): tests.append(('Test{}{}'.format(i, j), [fun1, fun2])) for (k, fun3) in enumerate(functions): tests.append(('Test{}{}{}'.format(i, j, k), [fun1, fun2, fun3])) swap = (lambda x, n: (n, x)) tests.append(('Swap1', [(lambda x: (x, 42)), swap])) tests.append(('Swap2', [(lambda x: (x, 42)), swap, swap])) return tuple(tests)
Generates test cases for the MapFusion optimization.
tensorflow/python/data/experimental/kernel_tests/optimization/map_fusion_test.py
_map_fusion_test_cases
aaaaadamchen/tensorflow
848
python
def _map_fusion_test_cases(): identity = (lambda x: x) increment = (lambda x: (x + 1)) def increment_and_square(x): y = (x + 1) return (y * y) functions = [identity, increment, increment_and_square] tests = [] for (i, fun1) in enumerate(functions): for (j, fun2) in enumerate(functions): tests.append(('Test{}{}'.format(i, j), [fun1, fun2])) for (k, fun3) in enumerate(functions): tests.append(('Test{}{}{}'.format(i, j, k), [fun1, fun2, fun3])) swap = (lambda x, n: (n, x)) tests.append(('Swap1', [(lambda x: (x, 42)), swap])) tests.append(('Swap2', [(lambda x: (x, 42)), swap, swap])) return tuple(tests)
def _map_fusion_test_cases(): identity = (lambda x: x) increment = (lambda x: (x + 1)) def increment_and_square(x): y = (x + 1) return (y * y) functions = [identity, increment, increment_and_square] tests = [] for (i, fun1) in enumerate(functions): for (j, fun2) in enumerate(functions): tests.append(('Test{}{}'.format(i, j), [fun1, fun2])) for (k, fun3) in enumerate(functions): tests.append(('Test{}{}{}'.format(i, j, k), [fun1, fun2, fun3])) swap = (lambda x, n: (n, x)) tests.append(('Swap1', [(lambda x: (x, 42)), swap])) tests.append(('Swap2', [(lambda x: (x, 42)), swap, swap])) return tuple(tests)<|docstring|>Generates test cases for the MapFusion optimization.<|endoftext|>
3ab8dbd9875f5586493675bfeb1225f381400444446617cd92f3cf4270eebff1
def pi_value(): '\n calculate the pi value using\n sources:\n https://en.wikipedia.org/wiki/Pi\n https://en.wikipedia.org/wiki/Leibniz_formula_for_%CF%80\n ' amount = int(input('type the number of value: ')) sum = 0 for k in range(0, (amount + 1)): r = (math.pow((- 1), k) / ((2 * k) + 1)) sum = (sum + r) print((4 * sum))
calculate the pi value using sources: https://en.wikipedia.org/wiki/Pi https://en.wikipedia.org/wiki/Leibniz_formula_for_%CF%80
exercises/pi.py
pi_value
leonel-123/python-fundamentals
0
python
def pi_value(): '\n calculate the pi value using\n sources:\n https://en.wikipedia.org/wiki/Pi\n https://en.wikipedia.org/wiki/Leibniz_formula_for_%CF%80\n ' amount = int(input('type the number of value: ')) sum = 0 for k in range(0, (amount + 1)): r = (math.pow((- 1), k) / ((2 * k) + 1)) sum = (sum + r) print((4 * sum))
def pi_value(): '\n calculate the pi value using\n sources:\n https://en.wikipedia.org/wiki/Pi\n https://en.wikipedia.org/wiki/Leibniz_formula_for_%CF%80\n ' amount = int(input('type the number of value: ')) sum = 0 for k in range(0, (amount + 1)): r = (math.pow((- 1), k) / ((2 * k) + 1)) sum = (sum + r) print((4 * sum))<|docstring|>calculate the pi value using sources: https://en.wikipedia.org/wiki/Pi https://en.wikipedia.org/wiki/Leibniz_formula_for_%CF%80<|endoftext|>
b24f719fb7abfa2003ea3155fbafbac232ac8591249d3b0495cbd8a0da2a51e8
def __init__(self, **kwargs): '\n Initializes a new TaskRunLogSummary object with values from keyword arguments.\n The following keyword arguments are supported (corresponding to the getters/setters of this class):\n\n :param message:\n The value to assign to the message property of this TaskRunLogSummary.\n :type message: str\n\n ' self.swagger_types = {'message': 'str'} self.attribute_map = {'message': 'message'} self._message = None
Initializes a new TaskRunLogSummary object with values from keyword arguments. The following keyword arguments are supported (corresponding to the getters/setters of this class): :param message: The value to assign to the message property of this TaskRunLogSummary. :type message: str
src/oci/data_integration/models/task_run_log_summary.py
__init__
Manny27nyc/oci-python-sdk
249
python
def __init__(self, **kwargs): '\n Initializes a new TaskRunLogSummary object with values from keyword arguments.\n The following keyword arguments are supported (corresponding to the getters/setters of this class):\n\n :param message:\n The value to assign to the message property of this TaskRunLogSummary.\n :type message: str\n\n ' self.swagger_types = {'message': 'str'} self.attribute_map = {'message': 'message'} self._message = None
def __init__(self, **kwargs): '\n Initializes a new TaskRunLogSummary object with values from keyword arguments.\n The following keyword arguments are supported (corresponding to the getters/setters of this class):\n\n :param message:\n The value to assign to the message property of this TaskRunLogSummary.\n :type message: str\n\n ' self.swagger_types = {'message': 'str'} self.attribute_map = {'message': 'message'} self._message = None<|docstring|>Initializes a new TaskRunLogSummary object with values from keyword arguments. The following keyword arguments are supported (corresponding to the getters/setters of this class): :param message: The value to assign to the message property of this TaskRunLogSummary. :type message: str<|endoftext|>
ba574fc7612bda807f2bd2a66ede341929f08cba92b975326fd194d306252887
@property def message(self): '\n Gets the message of this TaskRunLogSummary.\n A user-friendly log message.\n\n\n :return: The message of this TaskRunLogSummary.\n :rtype: str\n ' return self._message
Gets the message of this TaskRunLogSummary. A user-friendly log message. :return: The message of this TaskRunLogSummary. :rtype: str
src/oci/data_integration/models/task_run_log_summary.py
message
Manny27nyc/oci-python-sdk
249
python
@property def message(self): '\n Gets the message of this TaskRunLogSummary.\n A user-friendly log message.\n\n\n :return: The message of this TaskRunLogSummary.\n :rtype: str\n ' return self._message
@property def message(self): '\n Gets the message of this TaskRunLogSummary.\n A user-friendly log message.\n\n\n :return: The message of this TaskRunLogSummary.\n :rtype: str\n ' return self._message<|docstring|>Gets the message of this TaskRunLogSummary. A user-friendly log message. :return: The message of this TaskRunLogSummary. :rtype: str<|endoftext|>
18a2f724c4c3131bbb9bce6155cd298280436a49e6de4ac049a9f3b1c1a1a656
@message.setter def message(self, message): '\n Sets the message of this TaskRunLogSummary.\n A user-friendly log message.\n\n\n :param message: The message of this TaskRunLogSummary.\n :type: str\n ' self._message = message
Sets the message of this TaskRunLogSummary. A user-friendly log message. :param message: The message of this TaskRunLogSummary. :type: str
src/oci/data_integration/models/task_run_log_summary.py
message
Manny27nyc/oci-python-sdk
249
python
@message.setter def message(self, message): '\n Sets the message of this TaskRunLogSummary.\n A user-friendly log message.\n\n\n :param message: The message of this TaskRunLogSummary.\n :type: str\n ' self._message = message
@message.setter def message(self, message): '\n Sets the message of this TaskRunLogSummary.\n A user-friendly log message.\n\n\n :param message: The message of this TaskRunLogSummary.\n :type: str\n ' self._message = message<|docstring|>Sets the message of this TaskRunLogSummary. A user-friendly log message. :param message: The message of this TaskRunLogSummary. :type: str<|endoftext|>
195877b4ff66bbc77a9207e4951895543d9dac5c248fcbd2884e3c24c397fd87
def check_systrace_path(): 'Finds systrace on the path.' paths = os.environ['PATH'].split(os.pathsep) systrace = 'systrace' for p in paths: systrace_dir = os.path.join(p, systrace) if os.path.isdir(systrace_dir): return systrace_dir return None
Finds systrace on the path.
scripts/python/rheatrace/common/env_checker.py
check_systrace_path
genius158/btrace
1,007
python
def check_systrace_path(): paths = os.environ['PATH'].split(os.pathsep) systrace = 'systrace' for p in paths: systrace_dir = os.path.join(p, systrace) if os.path.isdir(systrace_dir): return systrace_dir return None
def check_systrace_path(): paths = os.environ['PATH'].split(os.pathsep) systrace = 'systrace' for p in paths: systrace_dir = os.path.join(p, systrace) if os.path.isdir(systrace_dir): return systrace_dir return None<|docstring|>Finds systrace on the path.<|endoftext|>
0bff2976fe7b91b921b63d89cf8cdd7975b316e0d542d439ee16c78c8df442b8
def _find_adb(): 'Finds adb on the path.' paths = os.environ['PATH'].split(os.pathsep) executable = 'adb' if (sys.platform == 'win32'): executable = (executable + '.exe') for p in paths: f = os.path.join(p, executable) if os.path.isfile(f): return f return None
Finds adb on the path.
scripts/python/rheatrace/common/env_checker.py
_find_adb
genius158/btrace
1,007
python
def _find_adb(): paths = os.environ['PATH'].split(os.pathsep) executable = 'adb' if (sys.platform == 'win32'): executable = (executable + '.exe') for p in paths: f = os.path.join(p, executable) if os.path.isfile(f): return f return None
def _find_adb(): paths = os.environ['PATH'].split(os.pathsep) executable = 'adb' if (sys.platform == 'win32'): executable = (executable + '.exe') for p in paths: f = os.path.join(p, executable) if os.path.isfile(f): return f return None<|docstring|>Finds adb on the path.<|endoftext|>
ba5ca385bd508b9ff16a2e9e4708617b356e8533b2ddb7f0102eadfee7f25e12
def __init__(self, **kwargs): '\n Initializes a new EnumIntegerImageCapabilityDescriptor object with values from keyword arguments. The default value of the :py:attr:`~oci.core.models.EnumIntegerImageCapabilityDescriptor.descriptor_type` attribute\n of this class is ``enuminteger`` and it should not be changed.\n The following keyword arguments are supported (corresponding to the getters/setters of this class):\n\n :param descriptor_type:\n The value to assign to the descriptor_type property of this EnumIntegerImageCapabilityDescriptor.\n :type descriptor_type: str\n\n :param source:\n The value to assign to the source property of this EnumIntegerImageCapabilityDescriptor.\n Allowed values for this property are: "GLOBAL", "IMAGE"\n :type source: str\n\n :param values:\n The value to assign to the values property of this EnumIntegerImageCapabilityDescriptor.\n :type values: list[int]\n\n :param default_value:\n The value to assign to the default_value property of this EnumIntegerImageCapabilityDescriptor.\n :type default_value: int\n\n ' self.swagger_types = {'descriptor_type': 'str', 'source': 'str', 'values': 'list[int]', 'default_value': 'int'} self.attribute_map = {'descriptor_type': 'descriptorType', 'source': 'source', 'values': 'values', 'default_value': 'defaultValue'} self._descriptor_type = None self._source = None self._values = None self._default_value = None self._descriptor_type = 'enuminteger'
Initializes a new EnumIntegerImageCapabilityDescriptor object with values from keyword arguments. The default value of the :py:attr:`~oci.core.models.EnumIntegerImageCapabilityDescriptor.descriptor_type` attribute of this class is ``enuminteger`` and it should not be changed. The following keyword arguments are supported (corresponding to the getters/setters of this class): :param descriptor_type: The value to assign to the descriptor_type property of this EnumIntegerImageCapabilityDescriptor. :type descriptor_type: str :param source: The value to assign to the source property of this EnumIntegerImageCapabilityDescriptor. Allowed values for this property are: "GLOBAL", "IMAGE" :type source: str :param values: The value to assign to the values property of this EnumIntegerImageCapabilityDescriptor. :type values: list[int] :param default_value: The value to assign to the default_value property of this EnumIntegerImageCapabilityDescriptor. :type default_value: int
src/oci/core/models/enum_integer_image_capability_descriptor.py
__init__
Manny27nyc/oci-python-sdk
249
python
def __init__(self, **kwargs): '\n Initializes a new EnumIntegerImageCapabilityDescriptor object with values from keyword arguments. The default value of the :py:attr:`~oci.core.models.EnumIntegerImageCapabilityDescriptor.descriptor_type` attribute\n of this class is ``enuminteger`` and it should not be changed.\n The following keyword arguments are supported (corresponding to the getters/setters of this class):\n\n :param descriptor_type:\n The value to assign to the descriptor_type property of this EnumIntegerImageCapabilityDescriptor.\n :type descriptor_type: str\n\n :param source:\n The value to assign to the source property of this EnumIntegerImageCapabilityDescriptor.\n Allowed values for this property are: "GLOBAL", "IMAGE"\n :type source: str\n\n :param values:\n The value to assign to the values property of this EnumIntegerImageCapabilityDescriptor.\n :type values: list[int]\n\n :param default_value:\n The value to assign to the default_value property of this EnumIntegerImageCapabilityDescriptor.\n :type default_value: int\n\n ' self.swagger_types = {'descriptor_type': 'str', 'source': 'str', 'values': 'list[int]', 'default_value': 'int'} self.attribute_map = {'descriptor_type': 'descriptorType', 'source': 'source', 'values': 'values', 'default_value': 'defaultValue'} self._descriptor_type = None self._source = None self._values = None self._default_value = None self._descriptor_type = 'enuminteger'
def __init__(self, **kwargs): '\n Initializes a new EnumIntegerImageCapabilityDescriptor object with values from keyword arguments. The default value of the :py:attr:`~oci.core.models.EnumIntegerImageCapabilityDescriptor.descriptor_type` attribute\n of this class is ``enuminteger`` and it should not be changed.\n The following keyword arguments are supported (corresponding to the getters/setters of this class):\n\n :param descriptor_type:\n The value to assign to the descriptor_type property of this EnumIntegerImageCapabilityDescriptor.\n :type descriptor_type: str\n\n :param source:\n The value to assign to the source property of this EnumIntegerImageCapabilityDescriptor.\n Allowed values for this property are: "GLOBAL", "IMAGE"\n :type source: str\n\n :param values:\n The value to assign to the values property of this EnumIntegerImageCapabilityDescriptor.\n :type values: list[int]\n\n :param default_value:\n The value to assign to the default_value property of this EnumIntegerImageCapabilityDescriptor.\n :type default_value: int\n\n ' self.swagger_types = {'descriptor_type': 'str', 'source': 'str', 'values': 'list[int]', 'default_value': 'int'} self.attribute_map = {'descriptor_type': 'descriptorType', 'source': 'source', 'values': 'values', 'default_value': 'defaultValue'} self._descriptor_type = None self._source = None self._values = None self._default_value = None self._descriptor_type = 'enuminteger'<|docstring|>Initializes a new EnumIntegerImageCapabilityDescriptor object with values from keyword arguments. The default value of the :py:attr:`~oci.core.models.EnumIntegerImageCapabilityDescriptor.descriptor_type` attribute of this class is ``enuminteger`` and it should not be changed. The following keyword arguments are supported (corresponding to the getters/setters of this class): :param descriptor_type: The value to assign to the descriptor_type property of this EnumIntegerImageCapabilityDescriptor. :type descriptor_type: str :param source: The value to assign to the source property of this EnumIntegerImageCapabilityDescriptor. Allowed values for this property are: "GLOBAL", "IMAGE" :type source: str :param values: The value to assign to the values property of this EnumIntegerImageCapabilityDescriptor. :type values: list[int] :param default_value: The value to assign to the default_value property of this EnumIntegerImageCapabilityDescriptor. :type default_value: int<|endoftext|>
340bd674d8a713529fe394383c01f9e4f030610fbabe295f4173e83c5b2fed36
@property def values(self): '\n **[Required]** Gets the values of this EnumIntegerImageCapabilityDescriptor.\n the list of values for the enum\n\n\n :return: The values of this EnumIntegerImageCapabilityDescriptor.\n :rtype: list[int]\n ' return self._values
**[Required]** Gets the values of this EnumIntegerImageCapabilityDescriptor. the list of values for the enum :return: The values of this EnumIntegerImageCapabilityDescriptor. :rtype: list[int]
src/oci/core/models/enum_integer_image_capability_descriptor.py
values
Manny27nyc/oci-python-sdk
249
python
@property def values(self): '\n **[Required]** Gets the values of this EnumIntegerImageCapabilityDescriptor.\n the list of values for the enum\n\n\n :return: The values of this EnumIntegerImageCapabilityDescriptor.\n :rtype: list[int]\n ' return self._values
@property def values(self): '\n **[Required]** Gets the values of this EnumIntegerImageCapabilityDescriptor.\n the list of values for the enum\n\n\n :return: The values of this EnumIntegerImageCapabilityDescriptor.\n :rtype: list[int]\n ' return self._values<|docstring|>**[Required]** Gets the values of this EnumIntegerImageCapabilityDescriptor. the list of values for the enum :return: The values of this EnumIntegerImageCapabilityDescriptor. :rtype: list[int]<|endoftext|>
b219e6d3fb41d6d2791e8cc10737615b8378dabde60c2aed9ff3e88f11362933
@values.setter def values(self, values): '\n Sets the values of this EnumIntegerImageCapabilityDescriptor.\n the list of values for the enum\n\n\n :param values: The values of this EnumIntegerImageCapabilityDescriptor.\n :type: list[int]\n ' self._values = values
Sets the values of this EnumIntegerImageCapabilityDescriptor. the list of values for the enum :param values: The values of this EnumIntegerImageCapabilityDescriptor. :type: list[int]
src/oci/core/models/enum_integer_image_capability_descriptor.py
values
Manny27nyc/oci-python-sdk
249
python
@values.setter def values(self, values): '\n Sets the values of this EnumIntegerImageCapabilityDescriptor.\n the list of values for the enum\n\n\n :param values: The values of this EnumIntegerImageCapabilityDescriptor.\n :type: list[int]\n ' self._values = values
@values.setter def values(self, values): '\n Sets the values of this EnumIntegerImageCapabilityDescriptor.\n the list of values for the enum\n\n\n :param values: The values of this EnumIntegerImageCapabilityDescriptor.\n :type: list[int]\n ' self._values = values<|docstring|>Sets the values of this EnumIntegerImageCapabilityDescriptor. the list of values for the enum :param values: The values of this EnumIntegerImageCapabilityDescriptor. :type: list[int]<|endoftext|>
09afa76e0a31e157b6a937d52d7d97da392b48988265bee34d85a915be083530
@property def default_value(self): '\n Gets the default_value of this EnumIntegerImageCapabilityDescriptor.\n the default value\n\n\n :return: The default_value of this EnumIntegerImageCapabilityDescriptor.\n :rtype: int\n ' return self._default_value
Gets the default_value of this EnumIntegerImageCapabilityDescriptor. the default value :return: The default_value of this EnumIntegerImageCapabilityDescriptor. :rtype: int
src/oci/core/models/enum_integer_image_capability_descriptor.py
default_value
Manny27nyc/oci-python-sdk
249
python
@property def default_value(self): '\n Gets the default_value of this EnumIntegerImageCapabilityDescriptor.\n the default value\n\n\n :return: The default_value of this EnumIntegerImageCapabilityDescriptor.\n :rtype: int\n ' return self._default_value
@property def default_value(self): '\n Gets the default_value of this EnumIntegerImageCapabilityDescriptor.\n the default value\n\n\n :return: The default_value of this EnumIntegerImageCapabilityDescriptor.\n :rtype: int\n ' return self._default_value<|docstring|>Gets the default_value of this EnumIntegerImageCapabilityDescriptor. the default value :return: The default_value of this EnumIntegerImageCapabilityDescriptor. :rtype: int<|endoftext|>
261d155da906aaae680abfde58b4bb962673c0565efc77d07b095ed671dab287
@default_value.setter def default_value(self, default_value): '\n Sets the default_value of this EnumIntegerImageCapabilityDescriptor.\n the default value\n\n\n :param default_value: The default_value of this EnumIntegerImageCapabilityDescriptor.\n :type: int\n ' self._default_value = default_value
Sets the default_value of this EnumIntegerImageCapabilityDescriptor. the default value :param default_value: The default_value of this EnumIntegerImageCapabilityDescriptor. :type: int
src/oci/core/models/enum_integer_image_capability_descriptor.py
default_value
Manny27nyc/oci-python-sdk
249
python
@default_value.setter def default_value(self, default_value): '\n Sets the default_value of this EnumIntegerImageCapabilityDescriptor.\n the default value\n\n\n :param default_value: The default_value of this EnumIntegerImageCapabilityDescriptor.\n :type: int\n ' self._default_value = default_value
@default_value.setter def default_value(self, default_value): '\n Sets the default_value of this EnumIntegerImageCapabilityDescriptor.\n the default value\n\n\n :param default_value: The default_value of this EnumIntegerImageCapabilityDescriptor.\n :type: int\n ' self._default_value = default_value<|docstring|>Sets the default_value of this EnumIntegerImageCapabilityDescriptor. the default value :param default_value: The default_value of this EnumIntegerImageCapabilityDescriptor. :type: int<|endoftext|>
809854fd193e2242fd69084c99a35095e7f22b336fe9a9393e4b682827779bf5
def assertIsFile(self, path): 'Assert that the path exists and is a file.' if (not pathlib.Path(path).resolve().is_file()): raise AssertionError(('File does not exist: %s' % str(path)))
Assert that the path exists and is a file.
outsource/test.py
assertIsFile
zhiiker/ic
941
python
def assertIsFile(self, path): if (not pathlib.Path(path).resolve().is_file()): raise AssertionError(('File does not exist: %s' % str(path)))
def assertIsFile(self, path): if (not pathlib.Path(path).resolve().is_file()): raise AssertionError(('File does not exist: %s' % str(path)))<|docstring|>Assert that the path exists and is a file.<|endoftext|>
b3ff43cae8ae33e5a6877cbb4aead1221f49737929c53737542dbc94ec0dfcbb
def assertNotIsFile(self, path): 'Assert that the path does not exist or is not a file.' if pathlib.Path(path).resolve().is_file(): raise AssertionError(('File exists: %s' % str(path)))
Assert that the path does not exist or is not a file.
outsource/test.py
assertNotIsFile
zhiiker/ic
941
python
def assertNotIsFile(self, path): if pathlib.Path(path).resolve().is_file(): raise AssertionError(('File exists: %s' % str(path)))
def assertNotIsFile(self, path): if pathlib.Path(path).resolve().is_file(): raise AssertionError(('File exists: %s' % str(path)))<|docstring|>Assert that the path does not exist or is not a file.<|endoftext|>
b2dce0c15a26aa104dcee0247c486d3997d4f460773f92074fdf0eaa5b179dec
def assertIsDir(self, path): 'Assert that the path does not exist or is not a directory.' if (not pathlib.Path(path).resolve().is_dir()): raise AssertionError(('Directory does not exist: %s' % str(path)))
Assert that the path does not exist or is not a directory.
outsource/test.py
assertIsDir
zhiiker/ic
941
python
def assertIsDir(self, path): if (not pathlib.Path(path).resolve().is_dir()): raise AssertionError(('Directory does not exist: %s' % str(path)))
def assertIsDir(self, path): if (not pathlib.Path(path).resolve().is_dir()): raise AssertionError(('Directory does not exist: %s' % str(path)))<|docstring|>Assert that the path does not exist or is not a directory.<|endoftext|>
96cea1cc7cfc2e9d229fc17ca2c08733a414b86043003b119c239a9d575a9935
def assertNotIsDir(self, path): 'Assert that the path does not exist or is not a directory.' if pathlib.Path(path).resolve().is_dir(): raise AssertionError(('Directory exists: %s' % str(path)))
Assert that the path does not exist or is not a directory.
outsource/test.py
assertNotIsDir
zhiiker/ic
941
python
def assertNotIsDir(self, path): if pathlib.Path(path).resolve().is_dir(): raise AssertionError(('Directory exists: %s' % str(path)))
def assertNotIsDir(self, path): if pathlib.Path(path).resolve().is_dir(): raise AssertionError(('Directory exists: %s' % str(path)))<|docstring|>Assert that the path does not exist or is not a directory.<|endoftext|>
31d021bc8ff250d93f4d44c8552341adbe4178f285783b69b3df7b542a0c7c91
def test_sanitized_argv(self): 'Ensure arguments are sanitized properly.' self.assertEqual(remote.sanitized_argv([]), []) self.assertEqual(remote.sanitized_argv(['echo', 'hello']), ['--', 'echo', 'hello']) self.assertEqual(remote.sanitized_argv(['-v', 'hello', 'world', '--foo']), ['-v', '--', 'hello', 'world', '--foo'])
Ensure arguments are sanitized properly.
outsource/test.py
test_sanitized_argv
zhiiker/ic
941
python
def test_sanitized_argv(self): self.assertEqual(remote.sanitized_argv([]), []) self.assertEqual(remote.sanitized_argv(['echo', 'hello']), ['--', 'echo', 'hello']) self.assertEqual(remote.sanitized_argv(['-v', 'hello', 'world', '--foo']), ['-v', '--', 'hello', 'world', '--foo'])
def test_sanitized_argv(self): self.assertEqual(remote.sanitized_argv([]), []) self.assertEqual(remote.sanitized_argv(['echo', 'hello']), ['--', 'echo', 'hello']) self.assertEqual(remote.sanitized_argv(['-v', 'hello', 'world', '--foo']), ['-v', '--', 'hello', 'world', '--foo'])<|docstring|>Ensure arguments are sanitized properly.<|endoftext|>
36206b7661fd554387809f18b0d17403f53b5ef7992c2fad9245f81a157521db
def test_shell_safe_encode_decode_id(self): 'Ensure shell-safe encoding roundtrip is the identity.' def roundtrip(obj): enc = shell_safe.encode(obj) dec = shell_safe.decode(enc) return dec test_cases = [['echo', 'hello'], 'foo', 'utf-8 yay? 😃'] [self.assertEqual(obj, roundtrip(obj)) for obj in test_cases]
Ensure shell-safe encoding roundtrip is the identity.
outsource/test.py
test_shell_safe_encode_decode_id
zhiiker/ic
941
python
def test_shell_safe_encode_decode_id(self): def roundtrip(obj): enc = shell_safe.encode(obj) dec = shell_safe.decode(enc) return dec test_cases = [['echo', 'hello'], 'foo', 'utf-8 yay? 😃'] [self.assertEqual(obj, roundtrip(obj)) for obj in test_cases]
def test_shell_safe_encode_decode_id(self): def roundtrip(obj): enc = shell_safe.encode(obj) dec = shell_safe.decode(enc) return dec test_cases = [['echo', 'hello'], 'foo', 'utf-8 yay? 😃'] [self.assertEqual(obj, roundtrip(obj)) for obj in test_cases]<|docstring|>Ensure shell-safe encoding roundtrip is the identity.<|endoftext|>