body stringlengths 26 98.2k | body_hash int64 -9,222,864,604,528,158,000 9,221,803,474B | docstring stringlengths 1 16.8k | path stringlengths 5 230 | name stringlengths 1 96 | repository_name stringlengths 7 89 | lang stringclasses 1
value | body_without_docstring stringlengths 20 98.2k |
|---|---|---|---|---|---|---|---|
def sigmoid_focal_loss(x, label, fg_num, gamma=2.0, alpha=0.25):
'\n\t:alias_main: paddle.nn.functional.sigmoid_focal_loss\n\t:alias: paddle.nn.functional.sigmoid_focal_loss,paddle.nn.functional.loss.sigmoid_focal_loss\n\t:old_api: paddle.fluid.layers.sigmoid_focal_loss\n\n **Sigmoid Focal Loss Operator.**\n\n ... | -185,429,799,281,533,660 | :alias_main: paddle.nn.functional.sigmoid_focal_loss
:alias: paddle.nn.functional.sigmoid_focal_loss,paddle.nn.functional.loss.sigmoid_focal_loss
:old_api: paddle.fluid.layers.sigmoid_focal_loss
**Sigmoid Focal Loss Operator.**
`Focal Loss <https://arxiv.org/abs/1708.02002>`_ is used to address the foreground... | python/paddle/fluid/layers/detection.py | sigmoid_focal_loss | 92lqllearning/Paddle | python | def sigmoid_focal_loss(x, label, fg_num, gamma=2.0, alpha=0.25):
'\n\t:alias_main: paddle.nn.functional.sigmoid_focal_loss\n\t:alias: paddle.nn.functional.sigmoid_focal_loss,paddle.nn.functional.loss.sigmoid_focal_loss\n\t:old_api: paddle.fluid.layers.sigmoid_focal_loss\n\n **Sigmoid Focal Loss Operator.**\n\n ... |
def detection_output(loc, scores, prior_box, prior_box_var, background_label=0, nms_threshold=0.3, nms_top_k=400, keep_top_k=200, score_threshold=0.01, nms_eta=1.0, return_index=False):
"\n\t:alias_main: paddle.nn.functional.detection_output\n\t:alias: paddle.nn.functional.detection_output,paddle.nn.functional.visi... | 3,502,451,009,088,788,000 | :alias_main: paddle.nn.functional.detection_output
:alias: paddle.nn.functional.detection_output,paddle.nn.functional.vision.detection_output
:old_api: paddle.fluid.layers.detection_output
Given the regression locations, classification confidences and prior boxes,
calculate the detection outputs by performing ... | python/paddle/fluid/layers/detection.py | detection_output | 92lqllearning/Paddle | python | def detection_output(loc, scores, prior_box, prior_box_var, background_label=0, nms_threshold=0.3, nms_top_k=400, keep_top_k=200, score_threshold=0.01, nms_eta=1.0, return_index=False):
"\n\t:alias_main: paddle.nn.functional.detection_output\n\t:alias: paddle.nn.functional.detection_output,paddle.nn.functional.visi... |
@templatedoc()
def iou_similarity(x, y, box_normalized=True, name=None):
"\n\t:alias_main: paddle.nn.functional.iou_similarity\n\t:alias: paddle.nn.functional.iou_similarity,paddle.nn.functional.loss.iou_similarity\n\t:old_api: paddle.fluid.layers.iou_similarity\n\n ${comment}\n\n Args:\n x (Variable):... | -1,729,417,256,943,608,600 | :alias_main: paddle.nn.functional.iou_similarity
:alias: paddle.nn.functional.iou_similarity,paddle.nn.functional.loss.iou_similarity
:old_api: paddle.fluid.layers.iou_similarity
${comment}
Args:
x (Variable): ${x_comment}.The data type is float32 or float64.
y (Variable): ${y_comment}.The data type i... | python/paddle/fluid/layers/detection.py | iou_similarity | 92lqllearning/Paddle | python | @templatedoc()
def iou_similarity(x, y, box_normalized=True, name=None):
"\n\t:alias_main: paddle.nn.functional.iou_similarity\n\t:alias: paddle.nn.functional.iou_similarity,paddle.nn.functional.loss.iou_similarity\n\t:old_api: paddle.fluid.layers.iou_similarity\n\n ${comment}\n\n Args:\n x (Variable):... |
@templatedoc()
def box_coder(prior_box, prior_box_var, target_box, code_type='encode_center_size', box_normalized=True, name=None, axis=0):
'\n\t:alias_main: paddle.nn.functional.box_coder\n\t:alias: paddle.nn.functional.box_coder,paddle.nn.functional.vision.box_coder\n\t:old_api: paddle.fluid.layers.box_coder\n\n ... | 8,675,982,313,976,703,000 | :alias_main: paddle.nn.functional.box_coder
:alias: paddle.nn.functional.box_coder,paddle.nn.functional.vision.box_coder
:old_api: paddle.fluid.layers.box_coder
**Box Coder Layer**
Encode/Decode the target bounding box with the priorbox information.
The Encoding schema described below:
.. math::
ox = (... | python/paddle/fluid/layers/detection.py | box_coder | 92lqllearning/Paddle | python | @templatedoc()
def box_coder(prior_box, prior_box_var, target_box, code_type='encode_center_size', box_normalized=True, name=None, axis=0):
'\n\t:alias_main: paddle.nn.functional.box_coder\n\t:alias: paddle.nn.functional.box_coder,paddle.nn.functional.vision.box_coder\n\t:old_api: paddle.fluid.layers.box_coder\n\n ... |
@templatedoc()
def polygon_box_transform(input, name=None):
"\n ${comment}\n\n Args:\n input(Variable): The input with shape [batch_size, geometry_channels, height, width].\n A Tensor with type float32, float64.\n name(str, Optional): For details, please refer to :ref:`ap... | -6,165,797,317,977,171,000 | ${comment}
Args:
input(Variable): The input with shape [batch_size, geometry_channels, height, width].
A Tensor with type float32, float64.
name(str, Optional): For details, please refer to :ref:`api_guide_Name`.
Generally, no setting is required. Default: None.
Return... | python/paddle/fluid/layers/detection.py | polygon_box_transform | 92lqllearning/Paddle | python | @templatedoc()
def polygon_box_transform(input, name=None):
"\n ${comment}\n\n Args:\n input(Variable): The input with shape [batch_size, geometry_channels, height, width].\n A Tensor with type float32, float64.\n name(str, Optional): For details, please refer to :ref:`ap... |
@templatedoc(op_type='yolov3_loss')
def yolov3_loss(x, gt_box, gt_label, anchors, anchor_mask, class_num, ignore_thresh, downsample_ratio, gt_score=None, use_label_smooth=True, name=None, scale_x_y=1.0):
"\n\t:alias_main: paddle.nn.functional.yolov3_loss\n\t:alias: paddle.nn.functional.yolov3_loss,paddle.nn.functio... | -623,141,446,200,941,600 | :alias_main: paddle.nn.functional.yolov3_loss
:alias: paddle.nn.functional.yolov3_loss,paddle.nn.functional.vision.yolov3_loss
:old_api: paddle.fluid.layers.yolov3_loss
${comment}
Args:
x (Variable): ${x_comment}The data type is float32 or float64.
gt_box (Variable): groud truth boxes, should be in s... | python/paddle/fluid/layers/detection.py | yolov3_loss | 92lqllearning/Paddle | python | @templatedoc(op_type='yolov3_loss')
def yolov3_loss(x, gt_box, gt_label, anchors, anchor_mask, class_num, ignore_thresh, downsample_ratio, gt_score=None, use_label_smooth=True, name=None, scale_x_y=1.0):
"\n\t:alias_main: paddle.nn.functional.yolov3_loss\n\t:alias: paddle.nn.functional.yolov3_loss,paddle.nn.functio... |
@templatedoc(op_type='yolo_box')
def yolo_box(x, img_size, anchors, class_num, conf_thresh, downsample_ratio, clip_bbox=True, name=None, scale_x_y=1.0):
"\n\t:alias_main: paddle.nn.functional.yolo_box\n\t:alias: paddle.nn.functional.yolo_box,paddle.nn.functional.vision.yolo_box\n\t:old_api: paddle.fluid.layers.yolo... | -7,077,621,889,497,212,000 | :alias_main: paddle.nn.functional.yolo_box
:alias: paddle.nn.functional.yolo_box,paddle.nn.functional.vision.yolo_box
:old_api: paddle.fluid.layers.yolo_box
${comment}
Args:
x (Variable): ${x_comment} The data type is float32 or float64.
img_size (Variable): ${img_size_comment} The data type is int32... | python/paddle/fluid/layers/detection.py | yolo_box | 92lqllearning/Paddle | python | @templatedoc(op_type='yolo_box')
def yolo_box(x, img_size, anchors, class_num, conf_thresh, downsample_ratio, clip_bbox=True, name=None, scale_x_y=1.0):
"\n\t:alias_main: paddle.nn.functional.yolo_box\n\t:alias: paddle.nn.functional.yolo_box,paddle.nn.functional.vision.yolo_box\n\t:old_api: paddle.fluid.layers.yolo... |
@templatedoc()
def detection_map(detect_res, label, class_num, background_label=0, overlap_threshold=0.3, evaluate_difficult=True, has_state=None, input_states=None, out_states=None, ap_version='integral'):
"\n ${comment}\n\n Args:\n detect_res: ${detect_res_comment}\n label: ${label_comment}\n... | -7,399,942,053,922,242,000 | ${comment}
Args:
detect_res: ${detect_res_comment}
label: ${label_comment}
class_num: ${class_num_comment}
background_label: ${background_label_comment}
overlap_threshold: ${overlap_threshold_comment}
evaluate_difficult: ${evaluate_difficult_comment}
has_state: ${has_state_comment}
inp... | python/paddle/fluid/layers/detection.py | detection_map | 92lqllearning/Paddle | python | @templatedoc()
def detection_map(detect_res, label, class_num, background_label=0, overlap_threshold=0.3, evaluate_difficult=True, has_state=None, input_states=None, out_states=None, ap_version='integral'):
"\n ${comment}\n\n Args:\n detect_res: ${detect_res_comment}\n label: ${label_comment}\n... |
def bipartite_match(dist_matrix, match_type=None, dist_threshold=None, name=None):
"\n\t:alias_main: paddle.nn.functional.bipartite_match\n\t:alias: paddle.nn.functional.bipartite_match,paddle.nn.functional.vision.bipartite_match\n\t:old_api: paddle.fluid.layers.bipartite_match\n\n This operator implements a gre... | -1,167,445,085,259,828,700 | :alias_main: paddle.nn.functional.bipartite_match
:alias: paddle.nn.functional.bipartite_match,paddle.nn.functional.vision.bipartite_match
:old_api: paddle.fluid.layers.bipartite_match
This operator implements a greedy bipartite matching algorithm, which is
used to obtain the matching with the maximum distance... | python/paddle/fluid/layers/detection.py | bipartite_match | 92lqllearning/Paddle | python | def bipartite_match(dist_matrix, match_type=None, dist_threshold=None, name=None):
"\n\t:alias_main: paddle.nn.functional.bipartite_match\n\t:alias: paddle.nn.functional.bipartite_match,paddle.nn.functional.vision.bipartite_match\n\t:old_api: paddle.fluid.layers.bipartite_match\n\n This operator implements a gre... |
def target_assign(input, matched_indices, negative_indices=None, mismatch_value=None, name=None):
"\n\t:alias_main: paddle.nn.functional.target_assign\n\t:alias: paddle.nn.functional.target_assign,paddle.nn.functional.extension.target_assign\n\t:old_api: paddle.fluid.layers.target_assign\n\n This operator can be... | 1,944,621,000,617,827,300 | :alias_main: paddle.nn.functional.target_assign
:alias: paddle.nn.functional.target_assign,paddle.nn.functional.extension.target_assign
:old_api: paddle.fluid.layers.target_assign
This operator can be, for given the target bounding boxes or labels,
to assign classification and regression targets to each predic... | python/paddle/fluid/layers/detection.py | target_assign | 92lqllearning/Paddle | python | def target_assign(input, matched_indices, negative_indices=None, mismatch_value=None, name=None):
"\n\t:alias_main: paddle.nn.functional.target_assign\n\t:alias: paddle.nn.functional.target_assign,paddle.nn.functional.extension.target_assign\n\t:old_api: paddle.fluid.layers.target_assign\n\n This operator can be... |
def ssd_loss(location, confidence, gt_box, gt_label, prior_box, prior_box_var=None, background_label=0, overlap_threshold=0.5, neg_pos_ratio=3.0, neg_overlap=0.5, loc_loss_weight=1.0, conf_loss_weight=1.0, match_type='per_prediction', mining_type='max_negative', normalize=True, sample_size=None):
"\n\t:alias_main: ... | 3,573,965,390,815,687,000 | :alias_main: paddle.nn.functional.ssd_loss
:alias: paddle.nn.functional.ssd_loss,paddle.nn.functional.loss.ssd_loss
:old_api: paddle.fluid.layers.ssd_loss
**Multi-box loss layer for object detection algorithm of SSD**
This layer is to compute detection loss for SSD given the location offset
predictions, confi... | python/paddle/fluid/layers/detection.py | ssd_loss | 92lqllearning/Paddle | python | def ssd_loss(location, confidence, gt_box, gt_label, prior_box, prior_box_var=None, background_label=0, overlap_threshold=0.5, neg_pos_ratio=3.0, neg_overlap=0.5, loc_loss_weight=1.0, conf_loss_weight=1.0, match_type='per_prediction', mining_type='max_negative', normalize=True, sample_size=None):
"\n\t:alias_main: ... |
def prior_box(input, image, min_sizes, max_sizes=None, aspect_ratios=[1.0], variance=[0.1, 0.1, 0.2, 0.2], flip=False, clip=False, steps=[0.0, 0.0], offset=0.5, name=None, min_max_aspect_ratios_order=False):
'\n\t:alias_main: paddle.nn.functional.prior_box\n\t:alias: paddle.nn.functional.prior_box,paddle.nn.functio... | 5,445,573,688,111,395,000 | :alias_main: paddle.nn.functional.prior_box
:alias: paddle.nn.functional.prior_box,paddle.nn.functional.vision.prior_box
:old_api: paddle.fluid.layers.prior_box
This op generates prior boxes for SSD(Single Shot MultiBox Detector) algorithm.
Each position of the input produce N prior boxes, N is determined by
t... | python/paddle/fluid/layers/detection.py | prior_box | 92lqllearning/Paddle | python | def prior_box(input, image, min_sizes, max_sizes=None, aspect_ratios=[1.0], variance=[0.1, 0.1, 0.2, 0.2], flip=False, clip=False, steps=[0.0, 0.0], offset=0.5, name=None, min_max_aspect_ratios_order=False):
'\n\t:alias_main: paddle.nn.functional.prior_box\n\t:alias: paddle.nn.functional.prior_box,paddle.nn.functio... |
def density_prior_box(input, image, densities=None, fixed_sizes=None, fixed_ratios=None, variance=[0.1, 0.1, 0.2, 0.2], clip=False, steps=[0.0, 0.0], offset=0.5, flatten_to_2d=False, name=None):
'\n\t:alias_main: paddle.nn.functional.density_prior_box\n\t:alias: paddle.nn.functional.density_prior_box,paddle.nn.func... | -4,812,473,693,915,520,000 | :alias_main: paddle.nn.functional.density_prior_box
:alias: paddle.nn.functional.density_prior_box,paddle.nn.functional.vision.density_prior_box
:old_api: paddle.fluid.layers.density_prior_box
This op generates density prior boxes for SSD(Single Shot MultiBox Detector)
algorithm. Each position of the input p... | python/paddle/fluid/layers/detection.py | density_prior_box | 92lqllearning/Paddle | python | def density_prior_box(input, image, densities=None, fixed_sizes=None, fixed_ratios=None, variance=[0.1, 0.1, 0.2, 0.2], clip=False, steps=[0.0, 0.0], offset=0.5, flatten_to_2d=False, name=None):
'\n\t:alias_main: paddle.nn.functional.density_prior_box\n\t:alias: paddle.nn.functional.density_prior_box,paddle.nn.func... |
def multi_box_head(inputs, image, base_size, num_classes, aspect_ratios, min_ratio=None, max_ratio=None, min_sizes=None, max_sizes=None, steps=None, step_w=None, step_h=None, offset=0.5, variance=[0.1, 0.1, 0.2, 0.2], flip=True, clip=False, kernel_size=1, pad=0, stride=1, name=None, min_max_aspect_ratios_order=False):
... | -2,723,292,436,989,180,400 | :api_attr: Static Graph
Base on SSD ((Single Shot MultiBox Detector) algorithm, generate prior boxes,
regression location and classification confidence on multiple input feature
maps, then output the concatenate results. The details of this algorithm,
please refer the section 2.2 of SSD paper `SSD: Single Shot MultiBo... | python/paddle/fluid/layers/detection.py | multi_box_head | 92lqllearning/Paddle | python | def multi_box_head(inputs, image, base_size, num_classes, aspect_ratios, min_ratio=None, max_ratio=None, min_sizes=None, max_sizes=None, steps=None, step_w=None, step_h=None, offset=0.5, variance=[0.1, 0.1, 0.2, 0.2], flip=True, clip=False, kernel_size=1, pad=0, stride=1, name=None, min_max_aspect_ratios_order=False):
... |
def anchor_generator(input, anchor_sizes=None, aspect_ratios=None, variance=[0.1, 0.1, 0.2, 0.2], stride=None, offset=0.5, name=None):
"\n\t:alias_main: paddle.nn.functional.anchor_generator\n\t:alias: paddle.nn.functional.anchor_generator,paddle.nn.functional.vision.anchor_generator\n\t:old_api: paddle.fluid.layer... | 6,149,320,233,878,684,000 | :alias_main: paddle.nn.functional.anchor_generator
:alias: paddle.nn.functional.anchor_generator,paddle.nn.functional.vision.anchor_generator
:old_api: paddle.fluid.layers.anchor_generator
**Anchor generator operator**
Generate anchors for Faster RCNN algorithm.
Each position of the input produce N anchors, N... | python/paddle/fluid/layers/detection.py | anchor_generator | 92lqllearning/Paddle | python | def anchor_generator(input, anchor_sizes=None, aspect_ratios=None, variance=[0.1, 0.1, 0.2, 0.2], stride=None, offset=0.5, name=None):
"\n\t:alias_main: paddle.nn.functional.anchor_generator\n\t:alias: paddle.nn.functional.anchor_generator,paddle.nn.functional.vision.anchor_generator\n\t:old_api: paddle.fluid.layer... |
def roi_perspective_transform(input, rois, transformed_height, transformed_width, spatial_scale=1.0, name=None):
"\n **The** `rois` **of this op should be a LoDTensor.**\n\n ROI perspective transform op applies perspective transform to map each roi into an \n rectangular region. Perspective transform is a ... | -6,383,202,107,289,695,000 | **The** `rois` **of this op should be a LoDTensor.**
ROI perspective transform op applies perspective transform to map each roi into an
rectangular region. Perspective transform is a type of transformation in linear algebra.
Parameters:
input (Variable): 4-D Tensor, input of ROIPerspectiveTransformOp. The format... | python/paddle/fluid/layers/detection.py | roi_perspective_transform | 92lqllearning/Paddle | python | def roi_perspective_transform(input, rois, transformed_height, transformed_width, spatial_scale=1.0, name=None):
"\n **The** `rois` **of this op should be a LoDTensor.**\n\n ROI perspective transform op applies perspective transform to map each roi into an \n rectangular region. Perspective transform is a ... |
def generate_proposal_labels(rpn_rois, gt_classes, is_crowd, gt_boxes, im_info, batch_size_per_im=256, fg_fraction=0.25, fg_thresh=0.25, bg_thresh_hi=0.5, bg_thresh_lo=0.0, bbox_reg_weights=[0.1, 0.1, 0.2, 0.2], class_nums=None, use_random=True, is_cls_agnostic=False, is_cascade_rcnn=False):
"\n\t:alias_main: paddl... | 2,734,986,607,020,780,500 | :alias_main: paddle.nn.functional.generate_proposal_labels
:alias: paddle.nn.functional.generate_proposal_labels,paddle.nn.functional.vision.generate_proposal_labels
:old_api: paddle.fluid.layers.generate_proposal_labels
**Generate Proposal Labels of Faster-RCNN**
This operator can be, for given the GenerateP... | python/paddle/fluid/layers/detection.py | generate_proposal_labels | 92lqllearning/Paddle | python | def generate_proposal_labels(rpn_rois, gt_classes, is_crowd, gt_boxes, im_info, batch_size_per_im=256, fg_fraction=0.25, fg_thresh=0.25, bg_thresh_hi=0.5, bg_thresh_lo=0.0, bbox_reg_weights=[0.1, 0.1, 0.2, 0.2], class_nums=None, use_random=True, is_cls_agnostic=False, is_cascade_rcnn=False):
"\n\t:alias_main: paddl... |
def generate_mask_labels(im_info, gt_classes, is_crowd, gt_segms, rois, labels_int32, num_classes, resolution):
'\n\t:alias_main: paddle.nn.functional.generate_mask_labels\n\t:alias: paddle.nn.functional.generate_mask_labels,paddle.nn.functional.vision.generate_mask_labels\n\t:old_api: paddle.fluid.layers.generate_... | 2,185,424,872,180,812,500 | :alias_main: paddle.nn.functional.generate_mask_labels
:alias: paddle.nn.functional.generate_mask_labels,paddle.nn.functional.vision.generate_mask_labels
:old_api: paddle.fluid.layers.generate_mask_labels
**Generate Mask Labels for Mask-RCNN**
This operator can be, for given the RoIs and corresponding labels,... | python/paddle/fluid/layers/detection.py | generate_mask_labels | 92lqllearning/Paddle | python | def generate_mask_labels(im_info, gt_classes, is_crowd, gt_segms, rois, labels_int32, num_classes, resolution):
'\n\t:alias_main: paddle.nn.functional.generate_mask_labels\n\t:alias: paddle.nn.functional.generate_mask_labels,paddle.nn.functional.vision.generate_mask_labels\n\t:old_api: paddle.fluid.layers.generate_... |
def generate_proposals(scores, bbox_deltas, im_info, anchors, variances, pre_nms_top_n=6000, post_nms_top_n=1000, nms_thresh=0.5, min_size=0.1, eta=1.0, name=None, return_rois_num=False):
"\n\t:alias_main: paddle.nn.functional.generate_proposals\n\t:alias: paddle.nn.functional.generate_proposals,paddle.nn.functiona... | 6,057,635,229,248,410,000 | :alias_main: paddle.nn.functional.generate_proposals
:alias: paddle.nn.functional.generate_proposals,paddle.nn.functional.vision.generate_proposals
:old_api: paddle.fluid.layers.generate_proposals
**Generate proposal Faster-RCNN**
This operation proposes RoIs according to each box with their
probability to be... | python/paddle/fluid/layers/detection.py | generate_proposals | 92lqllearning/Paddle | python | def generate_proposals(scores, bbox_deltas, im_info, anchors, variances, pre_nms_top_n=6000, post_nms_top_n=1000, nms_thresh=0.5, min_size=0.1, eta=1.0, name=None, return_rois_num=False):
"\n\t:alias_main: paddle.nn.functional.generate_proposals\n\t:alias: paddle.nn.functional.generate_proposals,paddle.nn.functiona... |
def box_clip(input, im_info, name=None):
"\n\t:alias_main: paddle.nn.functional.box_clip\n\t:alias: paddle.nn.functional.box_clip,paddle.nn.functional.vision.box_clip\n\t:old_api: paddle.fluid.layers.box_clip\n\t\n Clip the box into the size given by im_info\n For each input box, The formula is given as follo... | -4,038,965,544,099,605,000 | :alias_main: paddle.nn.functional.box_clip
:alias: paddle.nn.functional.box_clip,paddle.nn.functional.vision.box_clip
:old_api: paddle.fluid.layers.box_clip
Clip the box into the size given by im_info
For each input box, The formula is given as follows:
.. code-block:: text
xmin = max(min(xmin, i... | python/paddle/fluid/layers/detection.py | box_clip | 92lqllearning/Paddle | python | def box_clip(input, im_info, name=None):
"\n\t:alias_main: paddle.nn.functional.box_clip\n\t:alias: paddle.nn.functional.box_clip,paddle.nn.functional.vision.box_clip\n\t:old_api: paddle.fluid.layers.box_clip\n\t\n Clip the box into the size given by im_info\n For each input box, The formula is given as follo... |
def retinanet_detection_output(bboxes, scores, anchors, im_info, score_threshold=0.05, nms_top_k=1000, keep_top_k=100, nms_threshold=0.3, nms_eta=1.0):
'\n **Detection Output Layer for the detector RetinaNet.**\n\n In the detector `RetinaNet <https://arxiv.org/abs/1708.02002>`_ , many \n `FPN <https://arxi... | -6,385,242,098,909,211,000 | **Detection Output Layer for the detector RetinaNet.**
In the detector `RetinaNet <https://arxiv.org/abs/1708.02002>`_ , many
`FPN <https://arxiv.org/abs/1612.03144>`_ levels output the category
and location predictions, this OP is to get the detection results by
performing following steps:
1. For each FPN level, de... | python/paddle/fluid/layers/detection.py | retinanet_detection_output | 92lqllearning/Paddle | python | def retinanet_detection_output(bboxes, scores, anchors, im_info, score_threshold=0.05, nms_top_k=1000, keep_top_k=100, nms_threshold=0.3, nms_eta=1.0):
'\n **Detection Output Layer for the detector RetinaNet.**\n\n In the detector `RetinaNet <https://arxiv.org/abs/1708.02002>`_ , many \n `FPN <https://arxi... |
def multiclass_nms(bboxes, scores, score_threshold, nms_top_k, keep_top_k, nms_threshold=0.3, normalized=True, nms_eta=1.0, background_label=0, name=None):
"\n\t:alias_main: paddle.nn.functional.multiclass_nms\n\t:alias: paddle.nn.functional.multiclass_nms,paddle.nn.functional.extension.multiclass_nms\n\t:old_api: ... | 8,379,884,880,675,210,000 | :alias_main: paddle.nn.functional.multiclass_nms
:alias: paddle.nn.functional.multiclass_nms,paddle.nn.functional.extension.multiclass_nms
:old_api: paddle.fluid.layers.multiclass_nms
**Multiclass NMS**
This operator is to do multi-class non maximum suppression (NMS) on
boxes and scores.
In the NMS step, thi... | python/paddle/fluid/layers/detection.py | multiclass_nms | 92lqllearning/Paddle | python | def multiclass_nms(bboxes, scores, score_threshold, nms_top_k, keep_top_k, nms_threshold=0.3, normalized=True, nms_eta=1.0, background_label=0, name=None):
"\n\t:alias_main: paddle.nn.functional.multiclass_nms\n\t:alias: paddle.nn.functional.multiclass_nms,paddle.nn.functional.extension.multiclass_nms\n\t:old_api: ... |
def locality_aware_nms(bboxes, scores, score_threshold, nms_top_k, keep_top_k, nms_threshold=0.3, normalized=True, nms_eta=1.0, background_label=(- 1), name=None):
"\n **Local Aware NMS**\n \n `Local Aware NMS <https://arxiv.org/abs/1704.03155>`_ is to do locality-aware non maximum\n suppression (LANMS)... | -8,855,049,203,573,389,000 | **Local Aware NMS**
`Local Aware NMS <https://arxiv.org/abs/1704.03155>`_ is to do locality-aware non maximum
suppression (LANMS) on boxes and scores.
Firstly, this operator merge box and score according their IOU
(intersection over union). In the NMS step, this operator greedily selects a
subset of detection boundin... | python/paddle/fluid/layers/detection.py | locality_aware_nms | 92lqllearning/Paddle | python | def locality_aware_nms(bboxes, scores, score_threshold, nms_top_k, keep_top_k, nms_threshold=0.3, normalized=True, nms_eta=1.0, background_label=(- 1), name=None):
"\n **Local Aware NMS**\n \n `Local Aware NMS <https://arxiv.org/abs/1704.03155>`_ is to do locality-aware non maximum\n suppression (LANMS)... |
def matrix_nms(bboxes, scores, score_threshold, post_threshold, nms_top_k, keep_top_k, use_gaussian=False, gaussian_sigma=2.0, background_label=0, normalized=True, return_index=False, name=None):
"\n **Matrix NMS**\n\n This operator does matrix non maximum suppression (NMS).\n\n First selects a subset of c... | 4,937,063,959,042,622,000 | **Matrix NMS**
This operator does matrix non maximum suppression (NMS).
First selects a subset of candidate bounding boxes that have higher scores
than score_threshold (if provided), then the top k candidate is selected if
nms_top_k is larger than -1. Score of the remaining candidate are then
decayed according to the... | python/paddle/fluid/layers/detection.py | matrix_nms | 92lqllearning/Paddle | python | def matrix_nms(bboxes, scores, score_threshold, post_threshold, nms_top_k, keep_top_k, use_gaussian=False, gaussian_sigma=2.0, background_label=0, normalized=True, return_index=False, name=None):
"\n **Matrix NMS**\n\n This operator does matrix non maximum suppression (NMS).\n\n First selects a subset of c... |
def distribute_fpn_proposals(fpn_rois, min_level, max_level, refer_level, refer_scale, name=None):
"\n\t:alias_main: paddle.nn.functional.distribute_fpn_proposals\n\t:alias: paddle.nn.functional.distribute_fpn_proposals,paddle.nn.functional.vision.distribute_fpn_proposals\n\t:old_api: paddle.fluid.layers.distribute... | -1,772,570,103,615,518,700 | :alias_main: paddle.nn.functional.distribute_fpn_proposals
:alias: paddle.nn.functional.distribute_fpn_proposals,paddle.nn.functional.vision.distribute_fpn_proposals
:old_api: paddle.fluid.layers.distribute_fpn_proposals
**This op only takes LoDTensor as input.** In Feature Pyramid Networks
(FPN) models, ... | python/paddle/fluid/layers/detection.py | distribute_fpn_proposals | 92lqllearning/Paddle | python | def distribute_fpn_proposals(fpn_rois, min_level, max_level, refer_level, refer_scale, name=None):
"\n\t:alias_main: paddle.nn.functional.distribute_fpn_proposals\n\t:alias: paddle.nn.functional.distribute_fpn_proposals,paddle.nn.functional.vision.distribute_fpn_proposals\n\t:old_api: paddle.fluid.layers.distribute... |
@templatedoc()
def box_decoder_and_assign(prior_box, prior_box_var, target_box, box_score, box_clip, name=None):
"\n\t:alias_main: paddle.nn.functional.box_decoder_and_assign\n\t:alias: paddle.nn.functional.box_decoder_and_assign,paddle.nn.functional.vision.box_decoder_and_assign\n\t:old_api: paddle.fluid.layers.bo... | 7,764,178,062,581,068,000 | :alias_main: paddle.nn.functional.box_decoder_and_assign
:alias: paddle.nn.functional.box_decoder_and_assign,paddle.nn.functional.vision.box_decoder_and_assign
:old_api: paddle.fluid.layers.box_decoder_and_assign
${comment}
Args:
prior_box(${prior_box_type}): ${prior_box_comment}
prior_box_var(${pr... | python/paddle/fluid/layers/detection.py | box_decoder_and_assign | 92lqllearning/Paddle | python | @templatedoc()
def box_decoder_and_assign(prior_box, prior_box_var, target_box, box_score, box_clip, name=None):
"\n\t:alias_main: paddle.nn.functional.box_decoder_and_assign\n\t:alias: paddle.nn.functional.box_decoder_and_assign,paddle.nn.functional.vision.box_decoder_and_assign\n\t:old_api: paddle.fluid.layers.bo... |
def collect_fpn_proposals(multi_rois, multi_scores, min_level, max_level, post_nms_top_n, name=None):
"\n\t:alias_main: paddle.nn.functional.collect_fpn_proposals\n\t:alias: paddle.nn.functional.collect_fpn_proposals,paddle.nn.functional.vision.collect_fpn_proposals\n\t:old_api: paddle.fluid.layers.collect_fpn_prop... | -8,454,494,883,364,616,000 | :alias_main: paddle.nn.functional.collect_fpn_proposals
:alias: paddle.nn.functional.collect_fpn_proposals,paddle.nn.functional.vision.collect_fpn_proposals
:old_api: paddle.fluid.layers.collect_fpn_proposals
**This OP only supports LoDTensor as input**. Concat multi-level RoIs
(Region of Interest) and se... | python/paddle/fluid/layers/detection.py | collect_fpn_proposals | 92lqllearning/Paddle | python | def collect_fpn_proposals(multi_rois, multi_scores, min_level, max_level, post_nms_top_n, name=None):
"\n\t:alias_main: paddle.nn.functional.collect_fpn_proposals\n\t:alias: paddle.nn.functional.collect_fpn_proposals,paddle.nn.functional.vision.collect_fpn_proposals\n\t:old_api: paddle.fluid.layers.collect_fpn_prop... |
def adm_doses_italy(save_image=False, show=False):
'\n Administration data about Italy.\n '
plt.bar(italy_df['data_somministrazione'], italy_df['prima_dose'], label='Prime dosi')
plt.bar(italy_df['data_somministrazione'], italy_df['seconda_dose'], bottom=italy_df['prima_dose'], label='Seconde dosi')
... | 7,212,101,780,947,173,000 | Administration data about Italy. | chart-generation/charts/vaccines.py | adm_doses_italy | maldins46/CovidAnalysis | python | def adm_doses_italy(save_image=False, show=False):
'\n \n '
plt.bar(italy_df['data_somministrazione'], italy_df['prima_dose'], label='Prime dosi')
plt.bar(italy_df['data_somministrazione'], italy_df['seconda_dose'], bottom=italy_df['prima_dose'], label='Seconde dosi')
plt.title('Somministrazioni g... |
def adm_doses_marche(save_image=False, show=False):
'\n Administration data about Italy.\n '
plt.bar(marche_df['data_somministrazione'], marche_df['prima_dose'], label='Prime dosi')
plt.bar(marche_df['data_somministrazione'], marche_df['seconda_dose'], bottom=marche_df['prima_dose'], label='Seconde do... | 4,750,569,846,045,732,000 | Administration data about Italy. | chart-generation/charts/vaccines.py | adm_doses_marche | maldins46/CovidAnalysis | python | def adm_doses_marche(save_image=False, show=False):
'\n \n '
plt.bar(marche_df['data_somministrazione'], marche_df['prima_dose'], label='Prime dosi')
plt.bar(marche_df['data_somministrazione'], marche_df['seconda_dose'], bottom=marche_df['prima_dose'], label='Seconde dosi')
plt.title('Somministraz... |
def regional_doses(save_image=False, show=False):
'\n Comparation between doses administrated in various regions\n '
for (area_code, region_data) in benchmark_dict.items():
rolling_avg_adm = region_data['totale_per_100000_ab'].rolling(7, center=True).mean()
plt.plot(region_data['data_sommi... | 7,807,525,126,023,081,000 | Comparation between doses administrated in various regions | chart-generation/charts/vaccines.py | regional_doses | maldins46/CovidAnalysis | python | def regional_doses(save_image=False, show=False):
'\n \n '
for (area_code, region_data) in benchmark_dict.items():
rolling_avg_adm = region_data['totale_per_100000_ab'].rolling(7, center=True).mean()
plt.plot(region_data['data_somministrazione'], rolling_avg_adm, label=area_names_dict[area... |
def immunes_percentage(save_image=False, show=False):
'\n Computes and plots relations between the population of a place and people that took the second shot.\n '
for (area_code, region_data) in benchmark_dict.items():
plt.plot(region_data['data_somministrazione'], region_data['seconda_dose_totale... | -1,740,053,331,135,391,200 | Computes and plots relations between the population of a place and people that took the second shot. | chart-generation/charts/vaccines.py | immunes_percentage | maldins46/CovidAnalysis | python | def immunes_percentage(save_image=False, show=False):
'\n \n '
for (area_code, region_data) in benchmark_dict.items():
plt.plot(region_data['data_somministrazione'], region_data['seconda_dose_totale_storico_su_pop'], label=area_names_dict[area_code])
plt.plot(italy_df['data_somministrazione'],... |
def getJsons(imgPath, maskPath, savePath, yamlPath=''):
'\n imgPath: origin image path \n\n maskPath : mask image path \n\n savePath : json file save path \n\n \n >>> getJsons(path-to-your-imgs,path-to-your-maskimgs,path-to-your-jsonfiles) \n\n '
logger.info('currently, only *.jpg supported')
... | 5,811,460,459,359,987,000 | imgPath: origin image path
maskPath : mask image path
savePath : json file save path
>>> getJsons(path-to-your-imgs,path-to-your-maskimgs,path-to-your-jsonfiles) | convertmask/utils/mask2json_script.py | getJsons | guchengxi1994/mask2json | python | def getJsons(imgPath, maskPath, savePath, yamlPath=):
'\n imgPath: origin image path \n\n maskPath : mask image path \n\n savePath : json file save path \n\n \n >>> getJsons(path-to-your-imgs,path-to-your-maskimgs,path-to-your-jsonfiles) \n\n '
logger.info('currently, only *.jpg supported')
... |
def create_vote(vote_dict, cutoff):
'\n changes the vote to the [-1, 1] range\n '
modified_vote = (1 if (float(vote_dict['vote']) > cutoff) else (- 1))
return Vote(user=str(vote_dict['user']), post=str(vote_dict['post']), vote=modified_vote) | -3,061,405,477,472,610,000 | changes the vote to the [-1, 1] range | kiwi-content/kiwi/TransferTypes.py | create_vote | bubblegumsoldier/kiwi | python | def create_vote(vote_dict, cutoff):
'\n \n '
modified_vote = (1 if (float(vote_dict['vote']) > cutoff) else (- 1))
return Vote(user=str(vote_dict['user']), post=str(vote_dict['post']), vote=modified_vote) |
def test_transcriptmapper_TranscriptMapper_LCE3C_uncertain(self):
'Use NM_178434.2 tests to test mapping with uncertain positions'
tx_ac = 'NM_178434.2'
alt_ac = 'NC_000001.10'
tm = TranscriptMapper(self.hdp, tx_ac, alt_ac, alt_aln_method='splign')
parser = hgvs.parser.Parser()
test_cases = [{'g... | -8,786,582,584,565,190,000 | Use NM_178434.2 tests to test mapping with uncertain positions | tests/test_hgvs_transcriptmapper.py | test_transcriptmapper_TranscriptMapper_LCE3C_uncertain | jmuhlich/hgvs | python | def test_transcriptmapper_TranscriptMapper_LCE3C_uncertain(self):
tx_ac = 'NM_178434.2'
alt_ac = 'NC_000001.10'
tm = TranscriptMapper(self.hdp, tx_ac, alt_ac, alt_aln_method='splign')
parser = hgvs.parser.Parser()
test_cases = [{'g': parser.parse_g_interval('(152573138)'), 'r': parser.parse_r_i... |
def test_transcriptmapper_TranscriptMapper_LCE3C(self):
'NM_178434.2: LCE3C single exon, strand = +1, all coordinate input/output are in HGVS'
tx_ac = 'NM_178434.2'
alt_ac = 'NC_000001.10'
tm = TranscriptMapper(self.hdp, tx_ac, alt_ac, alt_aln_method='splign')
parser = hgvs.parser.Parser()
test_... | -2,397,615,263,211,383,000 | NM_178434.2: LCE3C single exon, strand = +1, all coordinate input/output are in HGVS | tests/test_hgvs_transcriptmapper.py | test_transcriptmapper_TranscriptMapper_LCE3C | jmuhlich/hgvs | python | def test_transcriptmapper_TranscriptMapper_LCE3C(self):
tx_ac = 'NM_178434.2'
alt_ac = 'NC_000001.10'
tm = TranscriptMapper(self.hdp, tx_ac, alt_ac, alt_aln_method='splign')
parser = hgvs.parser.Parser()
test_cases = [{'g': parser.parse_g_interval('152573138'), 'r': parser.parse_r_interval('1')... |
def test_transcriptmapper_TranscriptMapper_HIST3H2A(self):
'NM_033445.2: LCE3C single exon, strand = -1, all coordinate input/output are in HGVS'
tx_ac = 'NM_033445.2'
alt_ac = 'NC_000001.10'
tm = TranscriptMapper(self.hdp, tx_ac, alt_ac, alt_aln_method='splign')
parser = hgvs.parser.Parser()
te... | -7,917,196,163,994,230,000 | NM_033445.2: LCE3C single exon, strand = -1, all coordinate input/output are in HGVS | tests/test_hgvs_transcriptmapper.py | test_transcriptmapper_TranscriptMapper_HIST3H2A | jmuhlich/hgvs | python | def test_transcriptmapper_TranscriptMapper_HIST3H2A(self):
tx_ac = 'NM_033445.2'
alt_ac = 'NC_000001.10'
tm = TranscriptMapper(self.hdp, tx_ac, alt_ac, alt_aln_method='splign')
parser = hgvs.parser.Parser()
test_cases = [{'g': parser.parse_g_interval('228645560'), 'r': parser.parse_r_interval('... |
def test_transcriptmapper_TranscriptMapper_LCE2B(self):
'NM_014357.4: LCE2B, two exons, strand = +1, all coordinate input/output are in HGVS'
tx_ac = 'NM_014357.4'
alt_ac = 'NC_000001.10'
tm = TranscriptMapper(self.hdp, tx_ac, alt_ac, alt_aln_method='splign')
parser = hgvs.parser.Parser()
test_c... | -9,154,633,420,330,855,000 | NM_014357.4: LCE2B, two exons, strand = +1, all coordinate input/output are in HGVS | tests/test_hgvs_transcriptmapper.py | test_transcriptmapper_TranscriptMapper_LCE2B | jmuhlich/hgvs | python | def test_transcriptmapper_TranscriptMapper_LCE2B(self):
tx_ac = 'NM_014357.4'
alt_ac = 'NC_000001.10'
tm = TranscriptMapper(self.hdp, tx_ac, alt_ac, alt_aln_method='splign')
parser = hgvs.parser.Parser()
test_cases = [{'g': parser.parse_g_interval('152658599'), 'r': parser.parse_r_interval('1')... |
def test_transcriptmapper_TranscriptMapper_PTH2(self):
'NM_178449.3: PTH2, two exons, strand = -1, all coordinate input/output are in HGVS'
tx_ac = 'NM_178449.3'
alt_ac = 'NC_000019.9'
tm = TranscriptMapper(self.hdp, tx_ac, alt_ac, alt_aln_method='splign')
parser = hgvs.parser.Parser()
test_case... | 3,569,334,816,543,326,700 | NM_178449.3: PTH2, two exons, strand = -1, all coordinate input/output are in HGVS | tests/test_hgvs_transcriptmapper.py | test_transcriptmapper_TranscriptMapper_PTH2 | jmuhlich/hgvs | python | def test_transcriptmapper_TranscriptMapper_PTH2(self):
tx_ac = 'NM_178449.3'
alt_ac = 'NC_000019.9'
tm = TranscriptMapper(self.hdp, tx_ac, alt_ac, alt_aln_method='splign')
parser = hgvs.parser.Parser()
test_cases = [{'g': parser.parse_g_interval('49926698'), 'r': parser.parse_r_interval('1'), '... |
def setUp(self):
'\n Create two example sites that we can use to test what gets displayed\n where.\n '
super(SitesTest, self).setUp()
(self.site1, created1) = Site.objects.get_or_create(domain='example.com', name='example.com')
(self.site2, created2) = Site.objects.get_or_create(dom... | -5,771,233,725,206,190,000 | Create two example sites that we can use to test what gets displayed
where. | photologue/tests/test_sites.py | setUp | elena/django-photologue | python | def setUp(self):
'\n Create two example sites that we can use to test what gets displayed\n where.\n '
super(SitesTest, self).setUp()
(self.site1, created1) = Site.objects.get_or_create(domain='example.com', name='example.com')
(self.site2, created2) = Site.objects.get_or_create(dom... |
def test_basics(self):
' See if objects were added automatically (by the factory) to the current site. '
self.assertEqual(list(self.gallery1.sites.all()), [self.site1])
self.assertEqual(list(self.photo1.sites.all()), [self.site1]) | 5,815,624,118,007,133,000 | See if objects were added automatically (by the factory) to the current site. | photologue/tests/test_sites.py | test_basics | elena/django-photologue | python | def test_basics(self):
' '
self.assertEqual(list(self.gallery1.sites.all()), [self.site1])
self.assertEqual(list(self.photo1.sites.all()), [self.site1]) |
def test_auto_add_sites(self):
'\n Objects should not be automatically associated with a particular site when\n ``PHOTOLOGUE_MULTISITE`` is ``True``.\n '
with self.settings(PHOTOLOGUE_MULTISITE=False):
gallery = GalleryFactory()
photo = PhotoFactory()
self.assertEqual(li... | 2,680,923,825,896,937,000 | Objects should not be automatically associated with a particular site when
``PHOTOLOGUE_MULTISITE`` is ``True``. | photologue/tests/test_sites.py | test_auto_add_sites | elena/django-photologue | python | def test_auto_add_sites(self):
'\n Objects should not be automatically associated with a particular site when\n ``PHOTOLOGUE_MULTISITE`` is ``True``.\n '
with self.settings(PHOTOLOGUE_MULTISITE=False):
gallery = GalleryFactory()
photo = PhotoFactory()
self.assertEqual(li... |
def test_photos_in_gallery(self):
'\n Only those photos are supposed to be shown in a gallery that are\n also associated with the current site.\n '
response = self.client.get('/ptests/gallery/test-gallery/')
self.assertEqual(list(response.context['object'].public()), [self.photo1]) | 1,634,909,017,167,998,000 | Only those photos are supposed to be shown in a gallery that are
also associated with the current site. | photologue/tests/test_sites.py | test_photos_in_gallery | elena/django-photologue | python | def test_photos_in_gallery(self):
'\n Only those photos are supposed to be shown in a gallery that are\n also associated with the current site.\n '
response = self.client.get('/ptests/gallery/test-gallery/')
self.assertEqual(list(response.context['object'].public()), [self.photo1]) |
@unittest.skipUnless(('django.contrib.sitemaps' in settings.INSTALLED_APPS), 'Sitemaps not installed in this project, nothing to test.')
def test_sitemap(self):
'A sitemap should only show objects associated with the current site.'
response = self.client.get('/sitemap.xml')
self.assertContains(response, '<u... | -3,910,695,803,669,627,000 | A sitemap should only show objects associated with the current site. | photologue/tests/test_sites.py | test_sitemap | elena/django-photologue | python | @unittest.skipUnless(('django.contrib.sitemaps' in settings.INSTALLED_APPS), 'Sitemaps not installed in this project, nothing to test.')
def test_sitemap(self):
response = self.client.get('/sitemap.xml')
self.assertContains(response, '<url><loc>http://example.com/ptests/photo/test-photo/</loc><lastmod>2011... |
def test_basic(self):
'Test decompose a single H into u2.\n '
qr = QuantumRegister(1, 'qr')
circuit = QuantumCircuit(qr)
circuit.h(qr[0])
dag = circuit_to_dag(circuit)
pass_ = Decompose(HGate)
after_dag = pass_.run(dag)
op_nodes = after_dag.op_nodes()
self.assertEqual(len(op_n... | -8,106,845,320,404,883,000 | Test decompose a single H into u2. | test/python/transpiler/test_decompose.py | test_basic | dominik-steenken/qiskit-terra | python | def test_basic(self):
'\n '
qr = QuantumRegister(1, 'qr')
circuit = QuantumCircuit(qr)
circuit.h(qr[0])
dag = circuit_to_dag(circuit)
pass_ = Decompose(HGate)
after_dag = pass_.run(dag)
op_nodes = after_dag.op_nodes()
self.assertEqual(len(op_nodes), 1)
self.assertEqual(op_... |
def test_decompose_only_h(self):
'Test to decompose a single H, without the rest\n '
qr = QuantumRegister(2, 'qr')
circuit = QuantumCircuit(qr)
circuit.h(qr[0])
circuit.cx(qr[0], qr[1])
dag = circuit_to_dag(circuit)
pass_ = Decompose(HGate)
after_dag = pass_.run(dag)
op_nodes ... | 6,406,512,899,642,825,000 | Test to decompose a single H, without the rest | test/python/transpiler/test_decompose.py | test_decompose_only_h | dominik-steenken/qiskit-terra | python | def test_decompose_only_h(self):
'\n '
qr = QuantumRegister(2, 'qr')
circuit = QuantumCircuit(qr)
circuit.h(qr[0])
circuit.cx(qr[0], qr[1])
dag = circuit_to_dag(circuit)
pass_ = Decompose(HGate)
after_dag = pass_.run(dag)
op_nodes = after_dag.op_nodes()
self.assertEqual(le... |
def test_decompose_toffoli(self):
'Test decompose CCX.\n '
qr1 = QuantumRegister(2, 'qr1')
qr2 = QuantumRegister(1, 'qr2')
circuit = QuantumCircuit(qr1, qr2)
circuit.ccx(qr1[0], qr1[1], qr2[0])
dag = circuit_to_dag(circuit)
pass_ = Decompose(ToffoliGate)
after_dag = pass_.run(dag)... | 4,077,511,452,411,139,000 | Test decompose CCX. | test/python/transpiler/test_decompose.py | test_decompose_toffoli | dominik-steenken/qiskit-terra | python | def test_decompose_toffoli(self):
'\n '
qr1 = QuantumRegister(2, 'qr1')
qr2 = QuantumRegister(1, 'qr2')
circuit = QuantumCircuit(qr1, qr2)
circuit.ccx(qr1[0], qr1[1], qr2[0])
dag = circuit_to_dag(circuit)
pass_ = Decompose(ToffoliGate)
after_dag = pass_.run(dag)
op_nodes = aft... |
def test_decompose_conditional(self):
'Test decompose a 1-qubit gates with a conditional.\n '
qr = QuantumRegister(1, 'qr')
cr = ClassicalRegister(1, 'cr')
circuit = QuantumCircuit(qr, cr)
circuit.h(qr).c_if(cr, 1)
circuit.x(qr).c_if(cr, 1)
dag = circuit_to_dag(circuit)
pass_ = De... | 8,697,716,771,767,612,000 | Test decompose a 1-qubit gates with a conditional. | test/python/transpiler/test_decompose.py | test_decompose_conditional | dominik-steenken/qiskit-terra | python | def test_decompose_conditional(self):
'\n '
qr = QuantumRegister(1, 'qr')
cr = ClassicalRegister(1, 'cr')
circuit = QuantumCircuit(qr, cr)
circuit.h(qr).c_if(cr, 1)
circuit.x(qr).c_if(cr, 1)
dag = circuit_to_dag(circuit)
pass_ = Decompose(HGate)
after_dag = pass_.run(dag)
... |
def get_nodes(self, gid, sid, did, scid, doid):
'\n Generate the Check Constraint collection node.\n '
(yield self.generate_browser_collection_node(doid)) | -2,100,387,297,712,318,200 | Generate the Check Constraint collection node. | code/venv/lib/python3.6/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/__init__.py | get_nodes | jhkuang11/UniTrade | python | def get_nodes(self, gid, sid, did, scid, doid):
'\n \n '
(yield self.generate_browser_collection_node(doid)) |
@property
def node_inode(self):
'\n Returns Check Constraint node as leaf node.\n '
return False | 2,246,541,425,044,905,200 | Returns Check Constraint node as leaf node. | code/venv/lib/python3.6/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/__init__.py | node_inode | jhkuang11/UniTrade | python | @property
def node_inode(self):
'\n \n '
return False |
@property
def script_load(self):
'\n Load the module script for the Check Constraint, when any of the\n Check node is initialized.\n '
return database.DatabaseModule.NODE_TYPE | -1,586,024,280,889,844,000 | Load the module script for the Check Constraint, when any of the
Check node is initialized. | code/venv/lib/python3.6/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/__init__.py | script_load | jhkuang11/UniTrade | python | @property
def script_load(self):
'\n Load the module script for the Check Constraint, when any of the\n Check node is initialized.\n '
return database.DatabaseModule.NODE_TYPE |
@property
def module_use_template_javascript(self):
'\n Returns whether Jinja2 template is used for generating the javascript\n module.\n '
return False | 6,463,411,142,113,810,000 | Returns whether Jinja2 template is used for generating the javascript
module. | code/venv/lib/python3.6/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/__init__.py | module_use_template_javascript | jhkuang11/UniTrade | python | @property
def module_use_template_javascript(self):
'\n Returns whether Jinja2 template is used for generating the javascript\n module.\n '
return False |
@property
def csssnippets(self):
'\n Returns a snippet of css to include in the page\n '
return [render_template('check_constraint/css/check_constraint.css', node_type=self.node_type)] | 2,008,301,717,462,353,000 | Returns a snippet of css to include in the page | code/venv/lib/python3.6/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/__init__.py | csssnippets | jhkuang11/UniTrade | python | @property
def csssnippets(self):
'\n \n '
return [render_template('check_constraint/css/check_constraint.css', node_type=self.node_type)] |
def module_js(self):
'\n Load JS file (check_constraint.js) for this module.\n '
return make_response(render_template('check_constraint/js/check_constraint.js', _=_), 200, {'Content-Type': 'application/x-javascript'}) | -8,185,117,777,359,820,000 | Load JS file (check_constraint.js) for this module. | code/venv/lib/python3.6/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/__init__.py | module_js | jhkuang11/UniTrade | python | def module_js(self):
'\n \n '
return make_response(render_template('check_constraint/js/check_constraint.js', _=_), 200, {'Content-Type': 'application/x-javascript'}) |
def check_precondition(f):
'\n Works as a decorator.\n Checks database connection status.\n Attach connection object and template path.\n '
@wraps(f)
def wrap(*args, **kwargs):
self = args[0]
driver = get_driver(PG_DEFAULT_DRIVER)
self.manager = driver.co... | -1,662,070,888,570,002,400 | Works as a decorator.
Checks database connection status.
Attach connection object and template path. | code/venv/lib/python3.6/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/__init__.py | check_precondition | jhkuang11/UniTrade | python | def check_precondition(f):
'\n Works as a decorator.\n Checks database connection status.\n Attach connection object and template path.\n '
@wraps(f)
def wrap(*args, **kwargs):
self = args[0]
driver = get_driver(PG_DEFAULT_DRIVER)
self.manager = driver.co... |
def end_transaction(self):
'\n End database transaction.\n Returns:\n\n '
SQL = 'END;'
self.conn.execute_scalar(SQL) | -6,065,021,381,072,232,000 | End database transaction.
Returns: | code/venv/lib/python3.6/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/__init__.py | end_transaction | jhkuang11/UniTrade | python | def end_transaction(self):
'\n End database transaction.\n Returns:\n\n '
SQL = 'END;'
self.conn.execute_scalar(SQL) |
@check_precondition
def list(self, gid, sid, did, scid, tid, cid=None):
'\n List the Check Constraints.\n\n Args:\n gid: Server Group Id\n sid: Server Id\n did: Database Id\n scid: Schema Id\n tid: Table Id\n cid: Check Id\n '
... | 3,641,996,271,668,683,300 | List the Check Constraints.
Args:
gid: Server Group Id
sid: Server Id
did: Database Id
scid: Schema Id
tid: Table Id
cid: Check Id | code/venv/lib/python3.6/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/__init__.py | list | jhkuang11/UniTrade | python | @check_precondition
def list(self, gid, sid, did, scid, tid, cid=None):
'\n List the Check Constraints.\n\n Args:\n gid: Server Group Id\n sid: Server Id\n did: Database Id\n scid: Schema Id\n tid: Table Id\n cid: Check Id\n '
... |
def get_node_list(self, gid, sid, did, scid, tid, cid=None):
'\n This function returns all check constraints\n nodes within that collection as a list.\n\n Args:\n gid: Server Group ID\n sid: Server ID\n did: Database ID\n scid: Schema ID\n tid: Table... | -901,582,869,631,029,800 | This function returns all check constraints
nodes within that collection as a list.
Args:
gid: Server Group ID
sid: Server ID
did: Database ID
scid: Schema ID
tid: Table ID
cid: Cehck constraint ID
Returns: | code/venv/lib/python3.6/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/__init__.py | get_node_list | jhkuang11/UniTrade | python | def get_node_list(self, gid, sid, did, scid, tid, cid=None):
'\n This function returns all check constraints\n nodes within that collection as a list.\n\n Args:\n gid: Server Group ID\n sid: Server ID\n did: Database ID\n scid: Schema ID\n tid: Table... |
@check_precondition
def node(self, gid, sid, did, scid, tid, cid):
'\n Returns all the Check Constraints.\n\n Args:\n gid: Server Group Id\n sid: Server Id\n did: Database Id\n scid: Schema Id\n tid: Table Id\n cid: Check constraint Id.... | -8,474,499,497,717,976,000 | Returns all the Check Constraints.
Args:
gid: Server Group Id
sid: Server Id
did: Database Id
scid: Schema Id
tid: Table Id
cid: Check constraint Id. | code/venv/lib/python3.6/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/__init__.py | node | jhkuang11/UniTrade | python | @check_precondition
def node(self, gid, sid, did, scid, tid, cid):
'\n Returns all the Check Constraints.\n\n Args:\n gid: Server Group Id\n sid: Server Id\n did: Database Id\n scid: Schema Id\n tid: Table Id\n cid: Check constraint Id.... |
@check_precondition
def nodes(self, gid, sid, did, scid, tid):
'\n Returns all the Check Constraints.\n\n Args:\n gid: Server Group Id\n sid: Server Id\n did: Database Id\n scid: Schema Id\n tid: Table Id\n cid: Check constraint Id.\n ... | -2,540,133,028,761,386,000 | Returns all the Check Constraints.
Args:
gid: Server Group Id
sid: Server Id
did: Database Id
scid: Schema Id
tid: Table Id
cid: Check constraint Id. | code/venv/lib/python3.6/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/__init__.py | nodes | jhkuang11/UniTrade | python | @check_precondition
def nodes(self, gid, sid, did, scid, tid):
'\n Returns all the Check Constraints.\n\n Args:\n gid: Server Group Id\n sid: Server Id\n did: Database Id\n scid: Schema Id\n tid: Table Id\n cid: Check constraint Id.\n ... |
def get_nodes(self, gid, sid, did, scid, tid, cid=None):
'\n This function returns all event check constraint as a list.\n\n Args:\n gid: Server Group ID\n sid: Server ID\n did: Database ID\n scid: Schema ID\n tid: Table ID\n cid: Check constraint ... | 5,346,953,289,429,174,000 | This function returns all event check constraint as a list.
Args:
gid: Server Group ID
sid: Server ID
did: Database ID
scid: Schema ID
tid: Table ID
cid: Check constraint ID
Returns: | code/venv/lib/python3.6/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/__init__.py | get_nodes | jhkuang11/UniTrade | python | def get_nodes(self, gid, sid, did, scid, tid, cid=None):
'\n This function returns all event check constraint as a list.\n\n Args:\n gid: Server Group ID\n sid: Server ID\n did: Database ID\n scid: Schema ID\n tid: Table ID\n cid: Check constraint ... |
@check_precondition
def properties(self, gid, sid, did, scid, tid, cid):
'\n Returns the Check Constraints property.\n\n Args:\n gid: Server Group Id\n sid: Server Id\n did: Database Id\n scid: Schema Id\n tid: Check Id\n cid: Check Con... | -8,792,875,693,216,955,000 | Returns the Check Constraints property.
Args:
gid: Server Group Id
sid: Server Id
did: Database Id
scid: Schema Id
tid: Check Id
cid: Check Constraint Id | code/venv/lib/python3.6/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/__init__.py | properties | jhkuang11/UniTrade | python | @check_precondition
def properties(self, gid, sid, did, scid, tid, cid):
'\n Returns the Check Constraints property.\n\n Args:\n gid: Server Group Id\n sid: Server Id\n did: Database Id\n scid: Schema Id\n tid: Check Id\n cid: Check Con... |
@check_precondition
def create(self, gid, sid, did, scid, tid, cid=None):
'\n This function will create a primary key.\n\n Args:\n gid: Server Group ID\n sid: Server ID\n did: Database ID\n scid: Schema ID\n tid: Table ID\n cid: Check constraint ID... | -8,490,392,163,302,637,000 | This function will create a primary key.
Args:
gid: Server Group ID
sid: Server ID
did: Database ID
scid: Schema ID
tid: Table ID
cid: Check constraint ID
Returns: | code/venv/lib/python3.6/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/__init__.py | create | jhkuang11/UniTrade | python | @check_precondition
def create(self, gid, sid, did, scid, tid, cid=None):
'\n This function will create a primary key.\n\n Args:\n gid: Server Group ID\n sid: Server ID\n did: Database ID\n scid: Schema ID\n tid: Table ID\n cid: Check constraint ID... |
@check_precondition
def delete(self, gid, sid, did, scid, tid, cid):
'\n Drops the Check Constraint object.\n\n Args:\n gid: Server Group Id\n sid: Server Id\n did: Database Id\n scid: Schema Id\n tid: Check Id\n cid: Check Constraint I... | -1,481,032,813,985,460,000 | Drops the Check Constraint object.
Args:
gid: Server Group Id
sid: Server Id
did: Database Id
scid: Schema Id
tid: Check Id
cid: Check Constraint Id | code/venv/lib/python3.6/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/__init__.py | delete | jhkuang11/UniTrade | python | @check_precondition
def delete(self, gid, sid, did, scid, tid, cid):
'\n Drops the Check Constraint object.\n\n Args:\n gid: Server Group Id\n sid: Server Id\n did: Database Id\n scid: Schema Id\n tid: Check Id\n cid: Check Constraint I... |
@check_precondition
def update(self, gid, sid, did, scid, tid, cid):
'\n Updates the Check Constraint object.\n\n Args:\n gid: Server Group Id\n sid: Server Id\n did: Database Id\n scid: Schema Id\n tid: Table Id\n cid: Check Constraint... | 2,486,437,542,261,388,300 | Updates the Check Constraint object.
Args:
gid: Server Group Id
sid: Server Id
did: Database Id
scid: Schema Id
tid: Table Id
cid: Check Constraint Id | code/venv/lib/python3.6/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/__init__.py | update | jhkuang11/UniTrade | python | @check_precondition
def update(self, gid, sid, did, scid, tid, cid):
'\n Updates the Check Constraint object.\n\n Args:\n gid: Server Group Id\n sid: Server Id\n did: Database Id\n scid: Schema Id\n tid: Table Id\n cid: Check Constraint... |
@check_precondition
def sql(self, gid, sid, did, scid, tid, cid=None):
'\n Returns the SQL for the Check Constraint object.\n\n Args:\n gid: Server Group Id\n sid: Server Id\n did: Database Id\n scid: Schema Id\n tid: Table Id\n cid: Ch... | -2,459,164,446,102,590,000 | Returns the SQL for the Check Constraint object.
Args:
gid: Server Group Id
sid: Server Id
did: Database Id
scid: Schema Id
tid: Table Id
cid: Check Constraint Id | code/venv/lib/python3.6/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/__init__.py | sql | jhkuang11/UniTrade | python | @check_precondition
def sql(self, gid, sid, did, scid, tid, cid=None):
'\n Returns the SQL for the Check Constraint object.\n\n Args:\n gid: Server Group Id\n sid: Server Id\n did: Database Id\n scid: Schema Id\n tid: Table Id\n cid: Ch... |
@check_precondition
def msql(self, gid, sid, did, scid, tid, cid=None):
'\n Returns the modified SQL.\n\n Args:\n gid: Server Group Id\n sid: Server Id\n did: Database Id\n scid: Schema Id\n tid: Table Id\n cid: Check Constraint Id\n\n ... | -8,169,333,509,492,578,000 | Returns the modified SQL.
Args:
gid: Server Group Id
sid: Server Id
did: Database Id
scid: Schema Id
tid: Table Id
cid: Check Constraint Id
Returns:
Check Constraint object in json format. | code/venv/lib/python3.6/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/__init__.py | msql | jhkuang11/UniTrade | python | @check_precondition
def msql(self, gid, sid, did, scid, tid, cid=None):
'\n Returns the modified SQL.\n\n Args:\n gid: Server Group Id\n sid: Server Id\n did: Database Id\n scid: Schema Id\n tid: Table Id\n cid: Check Constraint Id\n\n ... |
def get_sql(self, gid, sid, data, scid, tid, cid=None):
'\n Generates the SQL statements to create/update the Check Constraint.\n\n Args:\n gid: Server Group Id\n sid: Server Id\n did: Database Id\n scid: Schema Id\n tid: Table Id\n ci... | 7,280,083,442,559,355,000 | Generates the SQL statements to create/update the Check Constraint.
Args:
gid: Server Group Id
sid: Server Id
did: Database Id
scid: Schema Id
tid: Table Id
cid: Check Constraint Id | code/venv/lib/python3.6/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/__init__.py | get_sql | jhkuang11/UniTrade | python | def get_sql(self, gid, sid, data, scid, tid, cid=None):
'\n Generates the SQL statements to create/update the Check Constraint.\n\n Args:\n gid: Server Group Id\n sid: Server Id\n did: Database Id\n scid: Schema Id\n tid: Table Id\n ci... |
@check_precondition
def dependents(self, gid, sid, did, scid, tid, cid):
'\n This function get the dependents and return ajax response\n for the Check Constraint node.\n\n Args:\n gid: Server Group Id\n sid: Server Id\n did: Database Id\n scid: Sch... | 8,944,948,045,789,013,000 | This function get the dependents and return ajax response
for the Check Constraint node.
Args:
gid: Server Group Id
sid: Server Id
did: Database Id
scid: Schema Id
tid: Table Id
cid: Check Constraint Id | code/venv/lib/python3.6/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/__init__.py | dependents | jhkuang11/UniTrade | python | @check_precondition
def dependents(self, gid, sid, did, scid, tid, cid):
'\n This function get the dependents and return ajax response\n for the Check Constraint node.\n\n Args:\n gid: Server Group Id\n sid: Server Id\n did: Database Id\n scid: Sch... |
@check_precondition
def dependencies(self, gid, sid, did, scid, tid, cid):
'\n This function get the dependencies and return ajax response\n for the Check Constraint node.\n\n Args:\n gid: Server Group Id\n sid: Server Id\n did: Database Id\n scid: Sc... | 1,714,487,567,196,472,300 | This function get the dependencies and return ajax response
for the Check Constraint node.
Args:
gid: Server Group Id
sid: Server Id
did: Database Id
scid: Schema Id
tid: Table Id
cid: Check Constraint Id | code/venv/lib/python3.6/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/__init__.py | dependencies | jhkuang11/UniTrade | python | @check_precondition
def dependencies(self, gid, sid, did, scid, tid, cid):
'\n This function get the dependencies and return ajax response\n for the Check Constraint node.\n\n Args:\n gid: Server Group Id\n sid: Server Id\n did: Database Id\n scid: Sc... |
@check_precondition
def validate_check_constraint(self, gid, sid, did, scid, tid, cid):
'\n Validate check constraint.\n Args:\n gid: Server Group Id\n sid: Server Id\n did: Database Id\n scid: Schema Id\n tid: Table Id\n cid: Check Con... | -5,572,943,996,713,023,000 | Validate check constraint.
Args:
gid: Server Group Id
sid: Server Id
did: Database Id
scid: Schema Id
tid: Table Id
cid: Check Constraint Id
Returns: | code/venv/lib/python3.6/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/__init__.py | validate_check_constraint | jhkuang11/UniTrade | python | @check_precondition
def validate_check_constraint(self, gid, sid, did, scid, tid, cid):
'\n Validate check constraint.\n Args:\n gid: Server Group Id\n sid: Server Id\n did: Database Id\n scid: Schema Id\n tid: Table Id\n cid: Check Con... |
@pytest.fixture
def add_network(host):
'Adds a network to the stacki db. For historical reasons the first test network this creates is pxe=False.'
def _inner(name, address, pxe=False):
result = host.run(f'stack add network {name} address={address} mask=255.255.255.0 pxe={pxe}')
if (result.rc !=... | 8,484,405,872,898,039,000 | Adds a network to the stacki db. For historical reasons the first test network this creates is pxe=False. | test-framework/test-suites/integration/tests/fixtures/add_data.py | add_network | anooprajendra/stacki | python | @pytest.fixture
def add_network(host):
def _inner(name, address, pxe=False):
result = host.run(f'stack add network {name} address={address} mask=255.255.255.0 pxe={pxe}')
if (result.rc != 0):
pytest.fail(f'unable to add dummy network "{name}"')
_inner('test', '192.168.0.0')
... |
@pytest.fixture
def add_host_with_net(host, add_host_with_interface, add_network):
'Adds a host with a network. The first network this adds defaults to pxe=True.'
def _inner(hostname, rack, rank, appliance, interface, ip, network, address, pxe):
add_host_with_interface(hostname=hostname, rack=rack, ran... | -5,918,668,350,231,279,000 | Adds a host with a network. The first network this adds defaults to pxe=True. | test-framework/test-suites/integration/tests/fixtures/add_data.py | add_host_with_net | anooprajendra/stacki | python | @pytest.fixture
def add_host_with_net(host, add_host_with_interface, add_network):
def _inner(hostname, rack, rank, appliance, interface, ip, network, address, pxe):
add_host_with_interface(hostname=hostname, rack=rack, rank=rank, appliance=appliance, interface=interface)
add_network(name=netw... |
@pytest.fixture(params=(('', 'exec=True'), ('', '| bash -x'), ('document=', 'exec=True'), ('document=', '| bash -x')), ids=('stack_load_exec', 'stack_load_bash', 'stack_load_document_exec', 'stack_load_document_bash'))
def stack_load(request, host):
'This fixture is used to run `stack load` on the host during integ... | -8,641,065,466,918,791,000 | This fixture is used to run `stack load` on the host during integration tests.
There are 4 essentially equivalent ways of loading and running a dump.json. Using
this test fixture ensures that all 4 are tested. I.E:
stack load dump_file exec=True
stack load document=dump_file exec=True
stack load dump_file | bash -x
s... | test-framework/test-suites/integration/tests/fixtures/add_data.py | stack_load | anooprajendra/stacki | python | @pytest.fixture(params=((, 'exec=True'), (, '| bash -x'), ('document=', 'exec=True'), ('document=', '| bash -x')), ids=('stack_load_exec', 'stack_load_bash', 'stack_load_document_exec', 'stack_load_document_bash'))
def stack_load(request, host):
'This fixture is used to run `stack load` on the host during integrati... |
@pytest.fixture
def fake_local_firmware_file(tmp_path_factory):
'Creates a fake local firmware file and returns a pathlib.Path object that points to it.'
fake_firmware_file = (tmp_path_factory.mktemp('fake_firmware') / 'foo.img')
fake_firmware_file.write_text('foofakefirmware')
return fake_firmware_file | 8,963,504,310,616,549,000 | Creates a fake local firmware file and returns a pathlib.Path object that points to it. | test-framework/test-suites/integration/tests/fixtures/add_data.py | fake_local_firmware_file | anooprajendra/stacki | python | @pytest.fixture
def fake_local_firmware_file(tmp_path_factory):
fake_firmware_file = (tmp_path_factory.mktemp('fake_firmware') / 'foo.img')
fake_firmware_file.write_text('foofakefirmware')
return fake_firmware_file |
def _sample_pair(self):
'Sample a pair of two windows.\n '
(win_ind1, rec_ind1) = self.sample_window()
ts1 = self.metadata.iloc[win_ind1]['i_start_in_trial']
ts = self.info.iloc[rec_ind1]['i_start_in_trial']
pair_type = self.rng.binomial(1, 0.5)
win_ind2 = None
if (pair_type == 0):
... | -7,632,719,765,910,472,000 | Sample a pair of two windows. | braindecode/samplers/ssl.py | _sample_pair | Div12345/braindecode | python | def _sample_pair(self):
'\n '
(win_ind1, rec_ind1) = self.sample_window()
ts1 = self.metadata.iloc[win_ind1]['i_start_in_trial']
ts = self.info.iloc[rec_ind1]['i_start_in_trial']
pair_type = self.rng.binomial(1, 0.5)
win_ind2 = None
if (pair_type == 0):
if self.same_rec_neg:
... |
def presample(self):
'Presample examples.\n\n Once presampled, the examples are the same from one epoch to another.\n '
self.examples = [self._sample_pair() for _ in range(self.n_examples)]
return self | 1,304,268,887,128,117,200 | Presample examples.
Once presampled, the examples are the same from one epoch to another. | braindecode/samplers/ssl.py | presample | Div12345/braindecode | python | def presample(self):
'Presample examples.\n\n Once presampled, the examples are the same from one epoch to another.\n '
self.examples = [self._sample_pair() for _ in range(self.n_examples)]
return self |
def __iter__(self):
'Iterate over pairs.\n\n Yields\n ------\n (int): position of the first window in the dataset.\n (int): position of the second window in the dataset.\n (float): 0 for negative pair, 1 for positive pair.\n '
for i in range(self.n_examples)... | -1,480,063,355,216,798,500 | Iterate over pairs.
Yields
------
(int): position of the first window in the dataset.
(int): position of the second window in the dataset.
(float): 0 for negative pair, 1 for positive pair. | braindecode/samplers/ssl.py | __iter__ | Div12345/braindecode | python | def __iter__(self):
'Iterate over pairs.\n\n Yields\n ------\n (int): position of the first window in the dataset.\n (int): position of the second window in the dataset.\n (float): 0 for negative pair, 1 for positive pair.\n '
for i in range(self.n_examples)... |
def setup_run_environment(self, env):
'Set up the compile and runtime environments for a package.'
env.prepend_path('LD_LIBRARY_PATH', (self.spec['cuda'].prefix + '/extras/CUPTI/lib64')) | -4,009,019,514,122,506,000 | Set up the compile and runtime environments for a package. | var/spack/repos/builtin/packages/cbtf-argonavis/package.py | setup_run_environment | CreRecombinase/spack | python | def setup_run_environment(self, env):
env.prepend_path('LD_LIBRARY_PATH', (self.spec['cuda'].prefix + '/extras/CUPTI/lib64')) |
def setup_build_environment(self, env):
'Set up the compile and runtime environments for a package.'
env.prepend_path('LD_LIBRARY_PATH', (self.spec['cuda'].prefix + '/extras/CUPTI/lib64')) | 2,743,965,887,238,356,500 | Set up the compile and runtime environments for a package. | var/spack/repos/builtin/packages/cbtf-argonavis/package.py | setup_build_environment | CreRecombinase/spack | python | def setup_build_environment(self, env):
env.prepend_path('LD_LIBRARY_PATH', (self.spec['cuda'].prefix + '/extras/CUPTI/lib64')) |
def _is_token(pieces: list, special_symbol: str='▁') -> List[str]:
'\n Check for stopwords and actual words in word pieces\n\n Args:\n pieces (list): word pieces returned by sentencepiece model\n special_symbol (str): spm prefix special symbol for space\n Returns:\n List of decoded w... | -3,571,330,227,367,067,600 | Check for stopwords and actual words in word pieces
Args:
pieces (list): word pieces returned by sentencepiece model
special_symbol (str): spm prefix special symbol for space
Returns:
List of decoded words | urduhack/tokenization/wtk.py | _is_token | cinfotech94/urduhackk | python | def _is_token(pieces: list, special_symbol: str='▁') -> List[str]:
'\n Check for stopwords and actual words in word pieces\n\n Args:\n pieces (list): word pieces returned by sentencepiece model\n special_symbol (str): spm prefix special symbol for space\n Returns:\n List of decoded w... |
def _load_model(model_path: str) -> spm.SentencePieceProcessor:
'\n Loads pre_trained keras model and vocab file\n\n Args:\n model_path (str): Path to the spm model file\n Returns:\n spm model class instance\n '
spm_model = spm.SentencePieceProcessor()
spm_model.Load(model_file=mod... | 5,117,550,707,783,732,000 | Loads pre_trained keras model and vocab file
Args:
model_path (str): Path to the spm model file
Returns:
spm model class instance | urduhack/tokenization/wtk.py | _load_model | cinfotech94/urduhackk | python | def _load_model(model_path: str) -> spm.SentencePieceProcessor:
'\n Loads pre_trained keras model and vocab file\n\n Args:\n model_path (str): Path to the spm model file\n Returns:\n spm model class instance\n '
spm_model = spm.SentencePieceProcessor()
spm_model.Load(model_file=mod... |
def _is_model_available(model_path: str) -> None:
'\n Check if the models file exist.\n\n Args:\n model_path (str): path to the tokenizer model file\n Raises:\n FileNotFoundError: If model_path does not exist\n Returns: None\n '
if (not Path(model_path).exists()):
_error = "... | 7,883,573,858,682,982,000 | Check if the models file exist.
Args:
model_path (str): path to the tokenizer model file
Raises:
FileNotFoundError: If model_path does not exist
Returns: None | urduhack/tokenization/wtk.py | _is_model_available | cinfotech94/urduhackk | python | def _is_model_available(model_path: str) -> None:
'\n Check if the models file exist.\n\n Args:\n model_path (str): path to the tokenizer model file\n Raises:\n FileNotFoundError: If model_path does not exist\n Returns: None\n '
if (not Path(model_path).exists()):
_error = "... |
@click.group()
def main():
'mutori -- for building and applying classifiers of mutation origin'
pass | 2,046,043,796,722,569,700 | mutori -- for building and applying classifiers of mutation origin | mutation_origin/cli.py | main | HuttleyLab/mutationorigin | python | @click.group()
def main():
pass |
@main.command()
@_seed
@_enu_path
@_germline_path
@_output_path
@_train_size
@_enu_ratio
@_numreps
@_overwrite
def sample_data(enu_path, germline_path, output_path, seed, train_size, enu_ratio, numreps, overwrite):
'creates train/test sample data'
if (seed is None):
seed = int(time.time())
LOGGER.lo... | 2,462,059,754,860,692,000 | creates train/test sample data | mutation_origin/cli.py | sample_data | HuttleyLab/mutationorigin | python | @main.command()
@_seed
@_enu_path
@_germline_path
@_output_path
@_train_size
@_enu_ratio
@_numreps
@_overwrite
def sample_data(enu_path, germline_path, output_path, seed, train_size, enu_ratio, numreps, overwrite):
if (seed is None):
seed = int(time.time())
LOGGER.log_args()
LOGGER.log_versions... |
@main.command()
@_training_path
@_output_path
@_label_col
@_seed
@_score
@_flank_size
@_feature_dim
@_proximal
@_usegc
@_c_values
@_penalty_options
@_n_jobs
@_overwrite
@_verbose
def lr_train(training_path, output_path, label_col, seed, scoring, flank_size, feature_dim, proximal, usegc, c_values, penalty_options, n_job... | 2,206,609,258,705,900,500 | logistic regression training, validation, dumps optimal model | mutation_origin/cli.py | lr_train | HuttleyLab/mutationorigin | python | @main.command()
@_training_path
@_output_path
@_label_col
@_seed
@_score
@_flank_size
@_feature_dim
@_proximal
@_usegc
@_c_values
@_penalty_options
@_n_jobs
@_overwrite
@_verbose
def lr_train(training_path, output_path, label_col, seed, scoring, flank_size, feature_dim, proximal, usegc, c_values, penalty_options, n_job... |
@main.command()
@_training_path
@_output_path
@_label_col
@_seed
@_score
@_flank_size
@_feature_dim
@_proximal
@_usegc
@_alpha_options
@_class_prior
@_n_jobs
@_overwrite
@_verbose
def nb_train(training_path, output_path, label_col, seed, scoring, flank_size, feature_dim, proximal, usegc, alpha_options, class_prior, n_j... | 7,332,786,271,015,682,000 | Naive Bayes training, validation, dumps optimal model | mutation_origin/cli.py | nb_train | HuttleyLab/mutationorigin | python | @main.command()
@_training_path
@_output_path
@_label_col
@_seed
@_score
@_flank_size
@_feature_dim
@_proximal
@_usegc
@_alpha_options
@_class_prior
@_n_jobs
@_overwrite
@_verbose
def nb_train(training_path, output_path, label_col, seed, scoring, flank_size, feature_dim, proximal, usegc, alpha_options, class_prior, n_j... |
@main.command()
@_training_path
@_output_path
@_label_col
@_seed
@_flank_size
@_feature_dim
@_proximal
@_usegc
@_strategy
@_n_jobs
@_overwrite
@_verbose
def xgboost_train(training_path, output_path, label_col, seed, flank_size, feature_dim, proximal, usegc, strategy, n_jobs, overwrite, verbose):
'Naive Bayes traini... | 1,488,352,229,197,225,200 | Naive Bayes training, validation, dumps optimal model | mutation_origin/cli.py | xgboost_train | HuttleyLab/mutationorigin | python | @main.command()
@_training_path
@_output_path
@_label_col
@_seed
@_flank_size
@_feature_dim
@_proximal
@_usegc
@_strategy
@_n_jobs
@_overwrite
@_verbose
def xgboost_train(training_path, output_path, label_col, seed, flank_size, feature_dim, proximal, usegc, strategy, n_jobs, overwrite, verbose):
if (not seed):... |
@main.command()
@_training_path
@_output_path
@_label_col
@_seed
@_flank_size
@_feature_dim
@_proximal
@_usegc
@_overwrite
@_verbose
def ocs_train(training_path, output_path, label_col, seed, flank_size, feature_dim, proximal, usegc, overwrite, verbose):
'one-class svm training for outlier detection'
if (seed i... | 223,836,685,097,591,780 | one-class svm training for outlier detection | mutation_origin/cli.py | ocs_train | HuttleyLab/mutationorigin | python | @main.command()
@_training_path
@_output_path
@_label_col
@_seed
@_flank_size
@_feature_dim
@_proximal
@_usegc
@_overwrite
@_verbose
def ocs_train(training_path, output_path, label_col, seed, flank_size, feature_dim, proximal, usegc, overwrite, verbose):
if (seed is None):
seed = int(time.time())
L... |
@main.command()
@_classifier_path
@_data_path
@_output_path
@_label_col
@_class_prior
@_overwrite
@_verbose
def predict(classifier_path, data_path, output_path, label_col, class_prior, overwrite, verbose):
'predict labels for data'
LOGGER.log_args()
LOGGER.log_versions(['sklearn', 'numpy'])
(classifier,... | 6,324,410,792,706,579,000 | predict labels for data | mutation_origin/cli.py | predict | HuttleyLab/mutationorigin | python | @main.command()
@_classifier_path
@_data_path
@_output_path
@_label_col
@_class_prior
@_overwrite
@_verbose
def predict(classifier_path, data_path, output_path, label_col, class_prior, overwrite, verbose):
LOGGER.log_args()
LOGGER.log_versions(['sklearn', 'numpy'])
(classifier, feature_params, scaler) ... |
@main.command()
@_data_path
@_predictions_path
@_output_path
@_label_col
@_overwrite
@_verbose
def performance(data_path, predictions_path, output_path, label_col, overwrite, verbose):
'produce measures of classifier performance'
LOGGER.log_args()
LOGGER.log_versions(['sklearn', 'numpy'])
if (not (data_... | -2,990,725,081,721,783,300 | produce measures of classifier performance | mutation_origin/cli.py | performance | HuttleyLab/mutationorigin | python | @main.command()
@_data_path
@_predictions_path
@_output_path
@_label_col
@_overwrite
@_verbose
def performance(data_path, predictions_path, output_path, label_col, overwrite, verbose):
LOGGER.log_args()
LOGGER.log_versions(['sklearn', 'numpy'])
if (not (data_path or predictions_path)):
click.se... |
def startup(self):
'\n Construct and show the Toga application.\n\n Usually, you would add your application to a main content box.\n We then create a main window (with a name matching the app), and\n show the main window.\n '
main_box = toga.Box(style=Pack(direction=COLUMN))
... | -7,820,798,773,575,304,000 | Construct and show the Toga application.
Usually, you would add your application to a main content box.
We then create a main window (with a name matching the app), and
show the main window. | src/helloworld/app.py | startup | The-Heyman/helloworld | python | def startup(self):
'\n Construct and show the Toga application.\n\n Usually, you would add your application to a main content box.\n We then create a main window (with a name matching the app), and\n show the main window.\n '
main_box = toga.Box(style=Pack(direction=COLUMN))
... |
def report_following_redirect(self, new_url):
'Report information extraction.'
self._downloader.to_screen(('[redirect] Following redirect to %s' % new_url)) | -5,159,658,233,100,727,000 | Report information extraction. | yt_dlp/extractor/generic.py | report_following_redirect | king-millez/yt-dlp | python | def report_following_redirect(self, new_url):
self._downloader.to_screen(('[redirect] Following redirect to %s' % new_url)) |
def _extract_camtasia(self, url, video_id, webpage):
' Returns None if no camtasia video can be found. '
camtasia_cfg = self._search_regex('fo\\.addVariable\\(\\s*"csConfigFile",\\s*"([^"]+)"\\s*\\);', webpage, 'camtasia configuration file', default=None)
if (camtasia_cfg is None):
return None
t... | 293,797,661,186,300,600 | Returns None if no camtasia video can be found. | yt_dlp/extractor/generic.py | _extract_camtasia | king-millez/yt-dlp | python | def _extract_camtasia(self, url, video_id, webpage):
' '
camtasia_cfg = self._search_regex('fo\\.addVariable\\(\\s*"csConfigFile",\\s*"([^"]+)"\\s*\\);', webpage, 'camtasia configuration file', default=None)
if (camtasia_cfg is None):
return None
title = self._html_search_meta('DC.title', webpa... |
def __init__(__self__, resource_name: str, opts: Optional[pulumi.ResourceOptions]=None, api_id: Optional[pulumi.Input[str]]=None, description: Optional[pulumi.Input[str]]=None, display_name: Optional[pulumi.Input[str]]=None, method: Optional[pulumi.Input[str]]=None, operation_id: Optional[pulumi.Input[str]]=None, polic... | 5,588,701,446,771,875,000 | Api Operation details.
:param str resource_name: The name of the resource.
:param pulumi.ResourceOptions opts: Options for the resource.
:param pulumi.Input[str] api_id: API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the re... | sdk/python/pulumi_azure_nextgen/apimanagement/v20200601preview/api_operation.py | __init__ | pulumi/pulumi-azure-nextgen | python | def __init__(__self__, resource_name: str, opts: Optional[pulumi.ResourceOptions]=None, api_id: Optional[pulumi.Input[str]]=None, description: Optional[pulumi.Input[str]]=None, display_name: Optional[pulumi.Input[str]]=None, method: Optional[pulumi.Input[str]]=None, operation_id: Optional[pulumi.Input[str]]=None, polic... |
@staticmethod
def get(resource_name: str, id: pulumi.Input[str], opts: Optional[pulumi.ResourceOptions]=None) -> 'ApiOperation':
"\n Get an existing ApiOperation resource's state with the given name, id, and optional extra\n properties used to qualify the lookup.\n\n :param str resource_name: T... | -5,423,887,866,892,393,000 | Get an existing ApiOperation resource's state with the given name, id, and optional extra
properties used to qualify the lookup.
:param str resource_name: The unique name of the resulting resource.
:param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
:param pulumi.ResourceOptions opts: Option... | sdk/python/pulumi_azure_nextgen/apimanagement/v20200601preview/api_operation.py | get | pulumi/pulumi-azure-nextgen | python | @staticmethod
def get(resource_name: str, id: pulumi.Input[str], opts: Optional[pulumi.ResourceOptions]=None) -> 'ApiOperation':
"\n Get an existing ApiOperation resource's state with the given name, id, and optional extra\n properties used to qualify the lookup.\n\n :param str resource_name: T... |
@property
@pulumi.getter
def description(self) -> pulumi.Output[Optional[str]]:
'\n Description of the operation. May include HTML formatting tags.\n '
return pulumi.get(self, 'description') | 427,557,619,421,051,900 | Description of the operation. May include HTML formatting tags. | sdk/python/pulumi_azure_nextgen/apimanagement/v20200601preview/api_operation.py | description | pulumi/pulumi-azure-nextgen | python | @property
@pulumi.getter
def description(self) -> pulumi.Output[Optional[str]]:
'\n \n '
return pulumi.get(self, 'description') |
@property
@pulumi.getter(name='displayName')
def display_name(self) -> pulumi.Output[str]:
'\n Operation Name.\n '
return pulumi.get(self, 'display_name') | 3,246,000,777,289,042,000 | Operation Name. | sdk/python/pulumi_azure_nextgen/apimanagement/v20200601preview/api_operation.py | display_name | pulumi/pulumi-azure-nextgen | python | @property
@pulumi.getter(name='displayName')
def display_name(self) -> pulumi.Output[str]:
'\n \n '
return pulumi.get(self, 'display_name') |
@property
@pulumi.getter
def method(self) -> pulumi.Output[str]:
'\n A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them.\n '
return pulumi.get(self, 'method') | -9,205,044,597,593,766,000 | A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them. | sdk/python/pulumi_azure_nextgen/apimanagement/v20200601preview/api_operation.py | method | pulumi/pulumi-azure-nextgen | python | @property
@pulumi.getter
def method(self) -> pulumi.Output[str]:
'\n \n '
return pulumi.get(self, 'method') |
@property
@pulumi.getter
def name(self) -> pulumi.Output[str]:
'\n Resource name.\n '
return pulumi.get(self, 'name') | 4,695,236,134,441,039,000 | Resource name. | sdk/python/pulumi_azure_nextgen/apimanagement/v20200601preview/api_operation.py | name | pulumi/pulumi-azure-nextgen | python | @property
@pulumi.getter
def name(self) -> pulumi.Output[str]:
'\n \n '
return pulumi.get(self, 'name') |
@property
@pulumi.getter
def policies(self) -> pulumi.Output[Optional[str]]:
'\n Operation Policies\n '
return pulumi.get(self, 'policies') | -8,272,438,894,036,339,000 | Operation Policies | sdk/python/pulumi_azure_nextgen/apimanagement/v20200601preview/api_operation.py | policies | pulumi/pulumi-azure-nextgen | python | @property
@pulumi.getter
def policies(self) -> pulumi.Output[Optional[str]]:
'\n \n '
return pulumi.get(self, 'policies') |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.