query
stringlengths
9
3.4k
document
stringlengths
9
87.4k
metadata
dict
negatives
listlengths
4
101
negative_scores
listlengths
4
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Encodes batch data. Combines intent and text and action name and action text if both are present.
def _process_batch_data( self, tf_batch_data: Dict[Text, Dict[Text, List[tf.Tensor]]] ) -> Tuple[tf.Tensor, Optional[tf.Tensor], Optional[tf.Tensor]]: # encode each attribute present in tf_batch_data text_output = None text_sequence_lengths = None batch_encoded = {} f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def encode(batch, tokenizer):\n return tokenizer.batch_encode_plus(batch['sentence'], padding='max_length')", "def __call__(\n self, data_batch: Dict[str, List[str]]\n ) -> Tuple[\n BatchEncoding,\n List[Dict[str, Union[int, str]]],\n List[SquadExample],\n List[SquadFeatu...
[ "0.5812564", "0.57255256", "0.5528758", "0.5521924", "0.5521924", "0.54412633", "0.5408598", "0.52338", "0.5196475", "0.51125795", "0.50439006", "0.5042097", "0.5039555", "0.5026467", "0.49971974", "0.4960177", "0.49545312", "0.49537224", "0.4953697", "0.4952628", "0.49509415...
0.6363296
0
Calculates the loss for the given batch.
def batch_loss( self, batch_in: Union[Tuple[tf.Tensor, ...], Tuple[np.ndarray, ...]] ) -> tf.Tensor: tf_batch_data = self.batch_to_model_data_format(batch_in, self.data_signature) self._compute_dialogue_indices(tf_batch_data) all_label_ids, all_labels_embed = self._create_all_labels...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def loss_(self, batch):\n raise NotImplementedError", "def compute_batch_loss(self, batch_data):\n loss = 0\n for data in batch_data:\n x, y = data\n x = x.view(-1,x.shape[0],x.shape[1])\n y = y.view(-1,y.shape[0], y.shape[1])\n loss += self.comput...
[ "0.8202585", "0.80554086", "0.7891249", "0.77008855", "0.7672072", "0.7433997", "0.73631585", "0.72367036", "0.71682936", "0.7149837", "0.71187645", "0.7041454", "0.7039752", "0.7038395", "0.6965841", "0.694148", "0.6937839", "0.6924688", "0.6857049", "0.6846526", "0.6832357"...
0.701632
14
Prepares the model for prediction.
def prepare_for_predict(self) -> None: _, self.all_labels_embed = self._create_all_labels_embed()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _predict_preproc_model(self, model_cfg, model,):\n model = self._make_model(model_cfg['model_name'], databunch=self._data)\n model.model_param = model_cfg['model_param']\n model.wrapper_params = model_cfg['wrapper_params']\n return(model)", "def prepare(self):\n\n inp = sel...
[ "0.72086805", "0.6995577", "0.6810046", "0.65236855", "0.651078", "0.6463981", "0.6454248", "0.63576317", "0.62059766", "0.6198991", "0.6195827", "0.6190496", "0.6141832", "0.6115495", "0.61043113", "0.6095206", "0.60888636", "0.605198", "0.60391265", "0.6035085", "0.6032339"...
0.6949675
2
Predicts the output of the given batch.
def batch_predict( self, batch_in: Union[Tuple[tf.Tensor, ...], Tuple[np.ndarray, ...]] ) -> Dict[Text, Union[tf.Tensor, Dict[Text, tf.Tensor]]]: if self.all_labels_embed is None: raise ValueError( "The model was not prepared for prediction. " "Call `prepa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def predict(self):\n batch = get_predict_batch(1, num_rec_out=self.num_test_rec)\n self.g_model.test_batch(\n batch, self.global_step, num_rec_out=self.num_test_rec)", "def predict_on_batch(self, input_batch):\n from deeplift.util import run_function_in_batches\n from deepl...
[ "0.7748216", "0.77126604", "0.7606435", "0.75135857", "0.74619675", "0.743488", "0.72738177", "0.7270976", "0.72188425", "0.7205821", "0.7106716", "0.7099856", "0.70555043", "0.7051696", "0.70497996", "0.7023709", "0.7003142", "0.6971342", "0.6956929", "0.6940344", "0.6928592...
0.691853
22
Test that the Crossref Events DAG has the correct structure.
def test_dag_structure(self): dag = UnpaywallTelescope().make_dag() self.assert_dag_structure( { "check_dependencies": ["check_releases"], "check_releases": ["download"], "download": ["upload_downloaded"], "upload_downloaded": ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_dag_structure(self):\n\n organisation = Organisation(name=self.organisation_name)\n dag = GoogleBooksTelescope(organisation, accounts=None).make_dag()\n self.assert_dag_structure(\n {\n \"check_dependencies\": [\"list_release_info\"],\n \"list_...
[ "0.680294", "0.6669853", "0.63210905", "0.6311622", "0.6105268", "0.60811025", "0.60449713", "0.6024524", "0.6015868", "0.5979063", "0.596869", "0.5906138", "0.5839312", "0.583271", "0.58317727", "0.583064", "0.5763963", "0.5728018", "0.572314", "0.5720221", "0.57139593", "...
0.6582648
2
Test that the DAG can be loaded from a DAG bag.
def test_dag_load(self): with ObservatoryEnvironment().create(): dag_file = os.path.join(module_file_path("academic_observatory_workflows.dags"), "unpaywall_telescope.py") self.assert_dag_load("unpaywall", dag_file)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_dag_load(self):\n\n with ObservatoryEnvironment().create():\n dag_file = os.path.join(module_file_path(\"academic_observatory_workflows.dags\"), \"openalex_telescope.py\")\n self.assert_dag_load(\"openalex\", dag_file)", "def test_dag_loads(self):\n self.assertEqual(F...
[ "0.7385436", "0.71135604", "0.7110756", "0.6724345", "0.6162052", "0.6110341", "0.6085278", "0.60069627", "0.5982009", "0.57431567", "0.5735573", "0.57125735", "0.5702912", "0.5669966", "0.56557333", "0.56340045", "0.5584368", "0.557622", "0.5550951", "0.553458", "0.55253327"...
0.7223948
1
Given a hostname, resolve it to a JSON document
def TEST_fetch_host_info( hostname ): if os.path.exists("/tmp/test-poll-host-pubkey.pub"): with open("/tmp/test-poll-host-pubkey.pub", "r") as f: pubk = f.read() host_info = {} host_info['hostname'] = hostname host_info['public_key'] = pubk.strip() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hostname_get():\n try:\n return json_response.success({'hostname': hostname.determine()})\n except hostname.Error as e:\n return json_response.error(str(e)), 200", "def resolve_hostname(request, hostname):\n try:\n ipaddress = usm_wrapper_utils.resolve_hostname(hostname)\n ex...
[ "0.6831419", "0.5982652", "0.5836917", "0.58359957", "0.582843", "0.5785391", "0.5735598", "0.57210416", "0.5714465", "0.5700011", "0.56317395", "0.5622472", "0.5604329", "0.5579752", "0.55299777", "0.55011827", "0.5488329", "0.54761213", "0.54317594", "0.54242593", "0.542425...
0.58959544
2
Given a hostname, resolve it to a JSON document
def opencloud_fetch_host_info( hostname ): raise Exception("Opencloud support not implemented")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hostname_get():\n try:\n return json_response.success({'hostname': hostname.determine()})\n except hostname.Error as e:\n return json_response.error(str(e)), 200", "def resolve_hostname(request, hostname):\n try:\n ipaddress = usm_wrapper_utils.resolve_hostname(hostname)\n ex...
[ "0.6831419", "0.5982652", "0.58959544", "0.5836917", "0.58359957", "0.582843", "0.5785391", "0.5735598", "0.57210416", "0.5714465", "0.56317395", "0.5622472", "0.5604329", "0.5579752", "0.55299777", "0.55011827", "0.5488329", "0.54761213", "0.54317594", "0.54242593", "0.54242...
0.5700011
10
Compute the IoUs between bounding boxes.
def iou_bbox(bboxes1, bboxes2): bboxes1 = np.array(bboxes1, np.float32) bboxes2 = np.array(bboxes2, np.float32) intersection_min_y = np.maximum(bboxes1[:, 0], bboxes2[:, 0]) intersection_max_y = np.minimum(bboxes1[:, 0] + bboxes1[:, 2] - 1, bboxes2[:, 0] + bboxes2[:, 2] - 1) intersection_height...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def IoUs(box, boxes):\n box_area = (box[2] - box[0]) * (box[3] - box[1])\n area = (boxes[:, 2] - boxes[:, 0]) * (boxes[:, 3] - boxes[:, 1])\n xx1 = np.maximum(box[0], boxes[:, 0])\n yy1 = np.maximum(box[1], boxes[:, 1])\n xx2 = np.minimum(box[2], boxes[:, 2])\n yy2 = np.minimum(box[3], boxes[:, 3...
[ "0.79760545", "0.7360302", "0.73063666", "0.7305902", "0.72878903", "0.72744477", "0.695732", "0.695732", "0.6948172", "0.69370276", "0.69283444", "0.69266987", "0.69141793", "0.6910099", "0.6884505", "0.6847904", "0.68431014", "0.6842791", "0.682574", "0.6824961", "0.6815399...
0.688465
14
Parameterize bounding boxes with respect to anchors. Namely, (y,x,h,w)>(ty,tx,th,tw).
def param_bbox(bboxes, anchors): bboxes = np.array(bboxes, np.float32) anchors = np.array(anchors, np.float32) tyx = (bboxes[:, :2] - anchors[:, :2]) / anchors[:, 2:] thw = np.log(bboxes[:, 2:] / anchors[:, 2:]) t = np.concatenate((tyx, thw), axis=1) return t
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __call__(self, loc, scores, anchors, img_size):\n anchors = bbox.loc2bbox(anchor)", "def xywh_xyxy(boxes):\n bbox = np.zeros(boxes.shape)\n bbox[:, 0] = boxes[:, 0] \n bbox[:, 1] = boxes[:, 1] \n bbox[:, 2] = boxes[:, 0] + 1 * boxes[:, 2]\n bbox[:, 3] = boxes[:, 1] + 1 * boxes[:, 3]\n ...
[ "0.7079935", "0.6789713", "0.65681434", "0.6469251", "0.6254045", "0.62500405", "0.6196701", "0.61934334", "0.6183325", "0.61690676", "0.61612844", "0.613867", "0.6136252", "0.61226267", "0.61135674", "0.61123616", "0.6107818", "0.6079668", "0.6065356", "0.60578364", "0.60495...
0.69789153
1
Unparameterize bounding boxes with respect to anchors. Namely, (ty,tx,th,tw)>(y,x,h,w).
def unparam_bbox(t, anchors, max_shape=None): t = np.array(t, np.float32) anchors = np.array(anchors, np.float32) yx = t[:, :2] * anchors[:, 2:] + anchors[:, :2] hw = np.exp(t[:, 2:]) * anchors[:, 2:] bboxes = np.concatenate((yx, hw), axis=1) if max_shape != None: bboxes = rectify_bbo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bbox_transform_inv(bbox):\n with tf.variable_scope('bbox_transform_inv') as scope:\n xmin = bbox[..., 0]\n ymin = bbox[..., 1]\n xmax = bbox[..., 2]\n ymax = bbox[..., 3]\n w = xmax - xmin + 1.0\n h = ymax - ymin + 1.0\n out_box = np.stack(\n [xmin + 0.5*w, ymin + 0.5*h, w, h],\n ...
[ "0.65151864", "0.6448961", "0.6441325", "0.64217514", "0.6378641", "0.6352084", "0.6197559", "0.61599165", "0.61406326", "0.6111988", "0.60997486", "0.60890275", "0.6063085", "0.6047759", "0.6045166", "0.60417753", "0.59831274", "0.5976186", "0.5973511", "0.59560215", "0.5952...
0.7801747
0
Clip bounding boxes to image boundary if necessary.
def rectify_bbox(bboxes, max_shape): bboxes = np.array(bboxes, np.int32) n = bboxes.shape[0] if n == 0: return bboxes h, w = max_shape bboxes[:, 0] = np.maximum(bboxes[:, 0], np.zeros((n))) bboxes[:, 0] = np.minimum(bboxes[:, 0], (h-1) * np.ones((n))) bboxes[:, 1] = np.maximum(bbo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bbox_clip(bboxes,img_shape):\n assert bboxes.shape[-1] % 4 == 0\n clipped_bboxes = np.empty_like(bboxes,dtype=bboxes.dtype)\n clipped_bboxes[...,0::2] = np.maximum(np.minimum(bboxes[...,0::2],img_shape[1]-1),0)\n clipped_bboxes[...,1::2] = np.maximum(np.minimum(bboxes[...,1::2],img_shape[0]-1),0)\n...
[ "0.79604113", "0.7733745", "0.75160044", "0.75160044", "0.75128055", "0.74821913", "0.74603677", "0.74603677", "0.7283722", "0.7270051", "0.72697234", "0.7187394", "0.7116647", "0.70570165", "0.7002503", "0.695813", "0.6916214", "0.6896344", "0.68704635", "0.6869429", "0.6868...
0.6155318
46
Map bounding boxes in old image shape to their counterparts in new image shape.
def convert_bbox(bboxes, old_shape, new_shape): bboxes = np.array(bboxes, np.float32) if bboxes.shape[0] == 0: return bboxes oh, ow = old_shape nh, nw = new_shape bboxes[:, 0] = bboxes[:, 0] * nh / oh bboxes[:, 1] = bboxes[:, 1] * nw / ow bboxes[:, 2] = bboxes[:, 2] * nh / oh b...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_bounding_box(old_shape, new_shape, row):\n # First index specifies rows of image, second index columns.\n # This means first index is y and second x\n scale_factor = new_shape[0] / old_shape[0]\n offset = (new_shape[1] - old_shape[1] * scale_factor)/2\n\n # May end up a little off-center\...
[ "0.7477527", "0.68143463", "0.6739359", "0.6597438", "0.6442463", "0.64015967", "0.6345242", "0.62468106", "0.6223599", "0.6106933", "0.6054487", "0.60216993", "0.60213155", "0.593495", "0.5909381", "0.5888657", "0.5888657", "0.5861662", "0.5829333", "0.5829333", "0.5824078",...
0.7284216
1
Enlarge bounding boxes by the given factor (without changing their centers).
def expand_bbox(bboxes, max_shape, factor=1.5): bboxes = np.array(bboxes, np.float32) n = bboxes.shape[0] if n == 0: return bboxes H = bboxes[:, 2] * factor W = bboxes[:, 3] * factor Y = bboxes[:, 0] - bboxes[:, 2] * (factor * 0.5 - 0.5) X = bboxes[:, 1] - bboxes[:, 3] * (factor * 0...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resize_to_box(im, size):\n #mx = np.max(im.shape[:2])\n\n factors = [size[i]/im.shape[i] for i in range(2)]\n\n f = np.min(factors)\n if f < 1.0:\n return resize_with_factor_new(im, f)\n else:\n return im", "def expand_boxes(boxes, scale):\n w_half = (boxes[:, 2] - box...
[ "0.6589286", "0.6390398", "0.63020176", "0.627091", "0.61904466", "0.61847234", "0.61352766", "0.6132406", "0.6007678", "0.60033876", "0.60017043", "0.59644324", "0.59606093", "0.5915594", "0.5887303", "0.5867812", "0.5867812", "0.5864122", "0.5853104", "0.58528006", "0.58093...
0.66979355
0
Get the labels of the anchors. Each anchor can be labeled as positive (1), negative (0) or ambiguous (1). Truncated anchors are always labeled as ambiguous.
def label_anchors(anchors, anchor_is_untruncated, gt_classes, gt_bboxes, background_id, iou_low_threshold=0.41, iou_high_threshold=0.61): n = anchors.shape[0] k = gt_bboxes.shape[0] # Compute the IoUs of the anchors and ground truth boxes tiled_anchors = np.tile(np.expand_dims(anchors, 1), (1, k, 1...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def numpy_select_label_anchors_minmax(_ground_truths, \n _anchors, \n _positive_threshold = 0.7, \n _negative_threshold = 0.3,\n _n_targets= 128):\n \n # Prune a...
[ "0.6365366", "0.6272056", "0.6209516", "0.6093799", "0.60793006", "0.6043222", "0.59958136", "0.5949583", "0.5946504", "0.58993435", "0.5892367", "0.58494216", "0.57686114", "0.5767941", "0.576532", "0.5765271", "0.5716308", "0.5708897", "0.57004285", "0.5694463", "0.5694382"...
0.6824482
0
Postprocess the detection results. Nonmaximum suppression.
def postprocess(scores, classes, bboxes, iou_threshold=0.3, score_threshold=0.5): n = len(scores) det_num = 0 det_classes = [] det_scores = [] det_bboxes = [] idx = np.argsort(scores)[::-1] sorted_scores = scores[idx] sorted_bboxes = bboxes[idx] sorted_classes = classes...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def postprocess(image: np.ndarray, results_list: list, threshold_confidence: float, threshold_nms: float) -> list:\n frameHeight = image.shape[0]\n frameWidth = image.shape[1]\n\n # Scan through all the bounding boxes output from the network and..\n # 1. keep only the ones with high confidence scores.\...
[ "0.6735261", "0.6664654", "0.6630579", "0.6577439", "0.6406923", "0.63441116", "0.629257", "0.61957365", "0.6079464", "0.6046928", "0.6036131", "0.6009213", "0.6006449", "0.59780705", "0.5972967", "0.59429765", "0.5928894", "0.5922842", "0.5915244", "0.58594865", "0.5853967",...
0.56760174
36
Postprocess the detection results. Nonmaximum suppression within each class.
def postprocess2(scores, classes, bboxes, iou_threshold=0.2, score_threshold=0.5): n = len(scores) count_per_class = {cls:0 for cls in classes} bbox_per_class = {cls:[] for cls in classes} score_per_class = {cls:[] for cls in classes} for i in range(n): count_per_class[classes[i]] += 1 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def postprocess(self, frame, outs):\n frameHeight = frame.shape[0]\n frameWidth = frame.shape[1]\n classIds = []\n confidences = []\n boxes = []\n # Scan through all the bounding boxes output from the network and keep only the\n # ones with high confidence scores. A...
[ "0.69125783", "0.6836886", "0.6585035", "0.6476055", "0.64319205", "0.6351669", "0.6329576", "0.63245493", "0.63100946", "0.6294223", "0.6243016", "0.6231166", "0.62281066", "0.61546725", "0.61398005", "0.61322653", "0.6119846", "0.6104196", "0.6073029", "0.6024173", "0.59493...
0.5997141
20
Read all properties of the given file return them as a dictionary.
def getFileProperties(fname): propNames = ('Comments', 'InternalName', 'ProductName', 'CompanyName', 'LegalCopyright', 'ProductVersion', 'FileDescription', 'LegalTrademarks', 'PrivateBuild', 'FileVersion', 'OriginalFilename', 'SpecialBuild') props = {'FixedFileInfo': None, 'StringFileIn...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_properties(filename):\n\n with open(filename, 'r') as f:\n lines = f.readlines()\n\n properties = get_properties(lines)\n\n return properties", "def org_properties(fname):\n\n d = {}\n in_props = False\n with open(fname) as fobj:\n for line in fobj:\n if ':PROP...
[ "0.7808817", "0.72304106", "0.71608496", "0.70748997", "0.7044528", "0.70093024", "0.69978476", "0.6890221", "0.68776745", "0.6767165", "0.6764475", "0.6644261", "0.65868574", "0.6525701", "0.6500845", "0.64988625", "0.6433803", "0.6405596", "0.63489175", "0.6335439", "0.6293...
0.5887806
55
Return a list of handles for visible windows with a given process name
def getMainWindowHandles(process_name, expect_one=False): # find all processes with process_name pids = [] for process in psutil.process_iter(): if process.name() == process_name: pids.append(process.pid) # find all window handles with process_name whandles = [] def windowF...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_hwnds(pid):\n def callback(hwnd, hwnds):\n if win32gui.IsWindowVisible(hwnd) and win32gui.IsWindowEnabled(hwnd):\n _, found_pid = win32process.GetWindowThreadProcessId(hwnd)\n if found_pid == pid:\n hwnds.append(hwnd)\n return True\n hwnds = []\n ...
[ "0.7882355", "0.74707407", "0.68533087", "0.68462783", "0.6585412", "0.65552914", "0.6511142", "0.6476083", "0.64665645", "0.64158076", "0.6220887", "0.62179965", "0.6139772", "0.61389536", "0.6114521", "0.59757996", "0.59497213", "0.59147716", "0.5892488", "0.5787817", "0.55...
0.74966705
1
Get a discord server given server id
def get_username(self, auth_token, user_id=None): self.headers['Authorization'] = f'Bearer {auth_token}' user = self.http_client.get( f'{self.api_endpoint}/users/@me', self.headers) return f'{user["username"]}#{user["discriminator"]}'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_server(self, id):\n\t\treturn self.__servers.get_server(id)", "def server(self, server_id):\n response = self._request(\"GET\", [ROUTE_SERVERS, server_id])\n if response.status_code != 200:\n logging.error(\"Error server id::{}\".format(response.text))\n return None\n\...
[ "0.7825828", "0.72106886", "0.7038349", "0.7023757", "0.7018549", "0.6773648", "0.66922504", "0.6597605", "0.6390267", "0.6101905", "0.60674965", "0.6005366", "0.5994605", "0.5986066", "0.5951594", "0.59417343", "0.59400356", "0.5926643", "0.5905813", "0.5848212", "0.58428794...
0.0
-1
Get a discord server given server id
async def get_guild(self, workspace_id) -> Guild: guild = await self.client.fetch_guild(workspace_id) return guild
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_server(self, id):\n\t\treturn self.__servers.get_server(id)", "def server(self, server_id):\n response = self._request(\"GET\", [ROUTE_SERVERS, server_id])\n if response.status_code != 200:\n logging.error(\"Error server id::{}\".format(response.text))\n return None\n\...
[ "0.78256756", "0.7210775", "0.70365936", "0.7023663", "0.701742", "0.6772921", "0.66907614", "0.6596807", "0.6389004", "0.6100305", "0.60650533", "0.6006278", "0.5992732", "0.5985209", "0.594971", "0.5941801", "0.59379864", "0.59259915", "0.5905143", "0.5842343", "0.58112395"...
0.584765
19
Get a discord channel given channel id
async def get_channel(self, channel_id): channel = await self.client.fetch_channel(channel_id) return channel
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_channel(self, channel_id):\n uri = 'channels/' + channel_id\n return self.make_request(uri)", "def get_channel(self, channel_id):\n try:\n return self[channel_id]\n except KeyError:\n raise ChannelNotFoundError(\"Channel {} not found\".format(channel_id))", "de...
[ "0.8683317", "0.82664853", "0.8244116", "0.77520853", "0.7731785", "0.7628041", "0.7377388", "0.7376629", "0.731581", "0.7271431", "0.70557", "0.7045037", "0.68866545", "0.68850803", "0.68683636", "0.6843198", "0.6786997", "0.6763132", "0.6759558", "0.6735168", "0.6725157", ...
0.86089706
1
Set discord channel topic
async def set_channel_topic(self, channel_topic, workspace_entity: WorkspaceEntity): await self.client.login(os.environ['DISCORD_BOT_TOKEN'], bot=self.is_bot) try: channel = await self.get_channel(workspace_entity.generated_channel_id) await channel.edit(topic=channel_topic) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def topic(self, channel, topic=None):\n if topic:\n channel += ' :' + topic\n self.send_line('TOPIC %s' % channel)", "def topic(self, channel, new_topic=None):\n if new_topic is None:\n time.sleep(1)\n self.s.send(\"TOPIC %s\\n\" % channel)\n logge...
[ "0.78130007", "0.7372703", "0.70083445", "0.6957028", "0.6779081", "0.6719136", "0.6646406", "0.6603524", "0.6588784", "0.6577933", "0.65143585", "0.6472604", "0.64440817", "0.6392307", "0.6212289", "0.6121125", "0.6107234", "0.60491633", "0.6034453", "0.6033108", "0.6015926"...
0.76062524
1
Post message to discord channel
async def post_message(self, message, workspace_entity: WorkspaceEntity): await self.client.login(os.environ['DISCORD_BOT_TOKEN'], bot=self.is_bot) try: channel = await self.get_channel(workspace_entity.generated_channel_id) await channel.send(content=message) except HTTP...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def post_to_channel(self, text):\n self.slack_client.api_call(\n \"chat.postMessage\",\n channel=self.config.SLACK_CHANNEL,\n text=text,\n username='pybot',\n icon_emoji=':robot_face:'\n )", "def post_message(channel, title, content):\n url ...
[ "0.75064564", "0.7293045", "0.71662164", "0.71404284", "0.70237076", "0.6974054", "0.68904084", "0.68200505", "0.68061984", "0.6802909", "0.6797641", "0.67762107", "0.67217904", "0.6698197", "0.667121", "0.66596895", "0.66530997", "0.66308546", "0.6626105", "0.66049105", "0.6...
0.7164306
3
Default to getting project channel id associated to the discord invite. If workspace id does match invite guild id then we fetch guild channel and select project channel id that belongs to workspace
async def select_project_channel_id(self, workspace: WorkspaceEntity, **kwargs): channel_id = "" invite_code = kwargs["invite_url"].rsplit("/", 1)[1] invite = self.http_client.get( f'{self.api_endpoint}/invites/{invite_code}', self.headers) # invite could be invalid ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def get_project_channel_name(self, workspace: WorkspaceEntity):\n await self.client.login(os.environ['DISCORD_BOT_TOKEN'], bot=self.is_bot)\n channel_name = \"\"\n try:\n channel = await self.get_channel(workspace.project_channel_id)\n except HTTPException as error:\n ...
[ "0.5926791", "0.5877593", "0.5625703", "0.55938035", "0.55938035", "0.55938035", "0.55938035", "0.5570502", "0.5564298", "0.5544257", "0.5543905", "0.55271715", "0.55019116", "0.55002284", "0.5465911", "0.54634124", "0.5453106", "0.5411919", "0.5381866", "0.5350541", "0.53374...
0.85108703
0
Get project channel name given project_channel_id using the channel associated with the discord invite url. invite should always be valid.
async def get_project_channel_name(self, workspace: WorkspaceEntity): await self.client.login(os.environ['DISCORD_BOT_TOKEN'], bot=self.is_bot) channel_name = "" try: channel = await self.get_channel(workspace.project_channel_id) except HTTPException as error: # p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def select_project_channel_id(self, workspace: WorkspaceEntity, **kwargs):\n channel_id = \"\"\n\n invite_code = kwargs[\"invite_url\"].rsplit(\"/\", 1)[1]\n invite = self.http_client.get(\n f'{self.api_endpoint}/invites/{invite_code}', self.headers)\n # invite could be...
[ "0.71972173", "0.6902223", "0.64741087", "0.6457699", "0.63657844", "0.6195817", "0.61137605", "0.60998803", "0.60551804", "0.5953863", "0.58828175", "0.58753836", "0.57890105", "0.577792", "0.57777005", "0.57777005", "0.57777005", "0.57777005", "0.57777005", "0.57777005", "0...
0.6246572
5
Return number_of_messages from a channel given the channel id
async def get_project_recent_messages(self, workspace): await self.client.login(os.environ['DISCORD_BOT_TOKEN'], bot=self.is_bot) messages = [] try: channel = await self.get_channel(workspace.project_channel_id) async for message in channel.history(limit=5): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def messages_in_channel(self, client, channel):\n result = None\n if client not in self.storage:\n return result\n if channel not in self.storage[client]:\n return result\n result = len(self.storage[client][channel])\n return result", "async def _count(\n ...
[ "0.6800228", "0.67264944", "0.64163625", "0.6140519", "0.60686487", "0.6049404", "0.6006016", "0.600338", "0.5973786", "0.5947724", "0.592754", "0.591469", "0.5882951", "0.5869114", "0.58490837", "0.5833381", "0.5818431", "0.5811311", "0.5793298", "0.5778113", "0.5772809", ...
0.0
-1
Exchange code for access token
def exchange_code(self, code): data = { 'client_id': self.client_id, 'client_secret': self.client_secret, 'grant_type': 'authorization_code', 'code': code, 'redirect_uri': self.redirect_uri, 'scope': 'identify' } headers = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def exchange_token(self, code):\n access_token_url = OAUTH_ROOT + '/access_token'\n params = {\n 'client_id': self.client_id,\n 'client_secret': self.client_secret,\n 'redirect_uri': self.redirect_uri,\n 'code': code,\n }\n resp = requests.get...
[ "0.76737565", "0.75573987", "0.74872184", "0.7459691", "0.7442583", "0.73809713", "0.7358272", "0.7275493", "0.7190624", "0.71864766", "0.7088587", "0.70770365", "0.70768636", "0.7065978", "0.70527726", "0.70141613", "0.69707495", "0.6928843", "0.6928744", "0.68662643", "0.68...
0.75274915
2
Refresh access token once expired.
def refresh_token(self, refresh_token): data = { 'client_id': self.client_id, 'client_secret': self.client_secret, 'grant_type': 'refresh_token', 'refresh_token': refresh_token, 'redirect_uri': self.redirect_uri, 'scope': 'identify email co...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def refresh_access_token(self):\n self._access_token = self.generate_access_token()", "def _refresh_access_token(self) -> None:\n response = httpx.post(\n f\"{self._base_url}/oauth2/token\",\n proxies=self._proxies,\n data={\n \"grant_type\": \"client...
[ "0.86163366", "0.8352881", "0.8289304", "0.82306564", "0.8187224", "0.8006817", "0.7974897", "0.79615444", "0.78723985", "0.7737143", "0.77223223", "0.77167267", "0.7680195", "0.76327974", "0.76249963", "0.75955814", "0.7581742", "0.7580342", "0.7550039", "0.7469374", "0.7422...
0.68990934
37
select channel id with most message activity within last 30 days
async def select_channel(self, channels: [abc.GuildChannel], workspace: WorkspaceEntity) -> str: text_channels = [] max_messages = -1 max_messages_channel = '' for channel in channels: if isinstance(channel, TextChannel): # skip generated channel from being se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_messages(cls, max, since=None):\n logging.getLogger('app').debug('Inside Database.get_last_n_messages')\n \n with cls.__get_connection() as cnx:\n return cnx.fetch_all(\"\"\"\n select\n m.message_id,\n m.message_text,\n ...
[ "0.562538", "0.5601993", "0.5466625", "0.54432464", "0.5381745", "0.5358702", "0.53061396", "0.5294843", "0.52904063", "0.52788347", "0.5263861", "0.5220234", "0.5187253", "0.51716506", "0.51274705", "0.5115105", "0.50410354", "0.50409", "0.5033649", "0.50318", "0.5029663", ...
0.61677015
0
Sets the start position.
def set_start_position(self) -> None: self.cozmo.set_head_angle(degrees(0)).wait_for_completed() self.cozmo.set_lift_height(0.0).wait_for_completed()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start(self, start: pos.Pos) -> None:\n self.__start = start", "def set_start(self, start_line):\n self.__start_line = start_line", "def set_starting_pos(self):\n if self.start and self.is_unoccupied(*self.start):\n self.current_pos = self.start[:]\n else:\n ...
[ "0.84893215", "0.80704427", "0.7979742", "0.7777096", "0.771941", "0.771941", "0.771941", "0.771941", "0.76588345", "0.7583015", "0.75784844", "0.74794215", "0.74246275", "0.72933054", "0.70534253", "0.70526403", "0.70484763", "0.68650675", "0.6849385", "0.67773587", "0.67768...
0.71430326
14
Gets an amount to rotate.
def __get_rotation_amount(self) -> int: min_rotate_angle = -10 max_rotate_angle = 10 if self.current_angle <= min_rotate_angle: rotation_amount = 5 + randint(0, 7) elif self.current_angle >= max_rotate_angle: rotation_amount = -5 - randint(0, 7) else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def angle(self) -> int:", "def rotation_rate(self) -> int:\n return self._rotation_rate", "def get_angle(self) -> NumberType:\n return self._angle", "def rotation_angle(self):\n return self.container['rotation_angle']", "def get_angle(n):\n return n % 360 if n > 360 else (n * 180) /...
[ "0.6747645", "0.6724292", "0.6570374", "0.6547653", "0.6504691", "0.6413458", "0.6402973", "0.63765687", "0.6352698", "0.6303226", "0.629455", "0.6278951", "0.6257527", "0.623377", "0.6233484", "0.6233484", "0.62223095", "0.6206932", "0.6192877", "0.6192748", "0.6174866", "...
0.7240605
0
Performs a positive reaction. Chooses a random number from 0 to 4 and plays reaction that is tied to that number.
def react_positively(self) -> None: positive_reactions = [ Triggers.MajorWin, Triggers.CodeLabHappy, Triggers.CodeLabYes, Triggers.CodeLabAmazed, Triggers.CodeLabCelebrate ] num = randint(0, 4) if num == 0: self.spe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def react_negatively(self) -> None:\n\n negative_reactions = [\n Triggers.MajorFail,\n Triggers.CubeMovedUpset,\n Triggers.CodeLabUnhappy,\n Triggers.PounceFail,\n Triggers.CodeLabBored\n ]\n num = randint(0, 4)\n if num == 0:\n ...
[ "0.6905896", "0.6231512", "0.62157935", "0.6211258", "0.61658084", "0.61590034", "0.60850656", "0.6050908", "0.6033337", "0.6005656", "0.5986243", "0.595127", "0.5939949", "0.5912327", "0.5898589", "0.5895938", "0.58722883", "0.58597785", "0.58351046", "0.57990456", "0.577905...
0.7328073
0
Performs a negative reaction. Chooses a random number from 0 to 4 and plays reaction that is tied to that number.
def react_negatively(self) -> None: negative_reactions = [ Triggers.MajorFail, Triggers.CubeMovedUpset, Triggers.CodeLabUnhappy, Triggers.PounceFail, Triggers.CodeLabBored ] num = randint(0, 4) if num == 0: self.__p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def react_positively(self) -> None:\n positive_reactions = [\n Triggers.MajorWin,\n Triggers.CodeLabHappy,\n Triggers.CodeLabYes,\n Triggers.CodeLabAmazed,\n Triggers.CodeLabCelebrate\n ]\n\n num = randint(0, 4)\n if num == 0:\n ...
[ "0.6683079", "0.61137176", "0.60331506", "0.593703", "0.591474", "0.5886511", "0.5886511", "0.5786441", "0.5680501", "0.56767386", "0.56580144", "0.5644133", "0.5632372", "0.5621879", "0.56003094", "0.55962235", "0.55849737", "0.55822545", "0.55530477", "0.55407363", "0.55339...
0.7776603
0
getter method for "data" atribut q224e
def data(self): return self.__data
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def data(value):\n return value.data", "def data(self):\r\n raise NotImplementedError", "def get_data(self):\n raise NotImplementedError(\"Not implemented!\")", "def data(self):", "def data(self):\n return self._data", "def get_data(self):\r\n pass", "def getData(self):\n ...
[ "0.77216864", "0.75554496", "0.75348544", "0.75284106", "0.7520041", "0.75094724", "0.7480755", "0.7480755", "0.74631673", "0.7455666", "0.7446747", "0.74320656", "0.74320656", "0.7396023", "0.7396023", "0.7396023", "0.7392962", "0.7392962", "0.73768085", "0.7324874", "0.7264...
0.7054529
48
setter method for "data" atribute
def data(self, data): self.__data = data
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_data(self, data):\n\n pass", "def set_data(self, data):\n self.data = data", "def setData(self, data):\n return None", "def setData(self, data):\n self.data = data", "def setData(self, data):\n self.data = data", "def SetData(self, data):\r\n\r\n self._da...
[ "0.8911663", "0.87387705", "0.8619419", "0.85456896", "0.85456896", "0.8334428", "0.8301211", "0.8301211", "0.8299661", "0.82963645", "0.82412356", "0.82412356", "0.82412356", "0.8151907", "0.8128655", "0.8128655", "0.8128655", "0.8128655", "0.8128655", "0.8128655", "0.795377...
0.85309285
5
The video conversion consists of several different steps. They need to be linked together for this to work. Something like. blob to file > convert file > create db file object (if successful do cleanup)
def create_video_task_structure(obj): parent_path = resource_path(obj.__parent__) obj_path = resource_path(obj) types = ['.mkv', '.avi'] #FIXME: Settings, formats etc... results = [] for mtype in types: task_c = chain(blob_to_tmp_file.s(obj_path), convert_file.s(mtype), tmp_to_blob.s(parent_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_video_path_and_save(video_path, output_path=\"output.mp4\", temp_folder = \"./temp\",\n frame_frequency=24, image_reducer=100, fontSize=10, spacing=1.1, maxsize=None, chars=\" .*:+%S0#@\",\n logs=False, processes=4, progress_tracker=None):\n...
[ "0.6675047", "0.6550464", "0.64586025", "0.6410163", "0.63592315", "0.63592315", "0.63508004", "0.6284475", "0.6279952", "0.61520207", "0.61121404", "0.61046207", "0.6064942", "0.6057947", "0.60255075", "0.59306794", "0.5902183", "0.58566123", "0.5844466", "0.5813281", "0.579...
0.5863424
17
Evaluate performance of prediction labels compared to ground truth. Args text_tar N length numpy array with integers for ground truth labels text_pred N length numpy array with integers for predicted labels tokenizer Determines the granularity level of the evaluation. None or '' characterwise evaluation r'\w' wordwise ...
def generate_token_arrays( text, text_tar, text_pred, tokenizer=None, expand_predictions=True, split_true_entities=True, ignore_value=None ): # split text for token evaluation if isinstance(tokenizer, stanfordnlp.pipeline.core.Pipeline): doc = tokenizer(text) # extrac...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def predict(self, texts: List[ParsedText]) -> List[ParsedText]:\n self.model.eval()\n texts = copy.deepcopy(texts)\n\n batches = DataLoader(texts=texts,\n batch_size=self.batch_size,\n vocabulary=self.vocabulary,\n ...
[ "0.6047719", "0.5638497", "0.56321526", "0.56077355", "0.54930854", "0.5477739", "0.54771405", "0.54673374", "0.5426912", "0.5415126", "0.539227", "0.53759074", "0.5339519", "0.5265813", "0.52645946", "0.5215363", "0.52048546", "0.5183925", "0.51813215", "0.51679975", "0.5154...
0.6754063
0
r""" Compute the Takagi Factorization to obtain eigenvalues and eigenvectors. Given a complex symmetric matrix A, the Takagi factorization is an algorithm that
def takagi_eig(z: torch.Tensor) -> Tuple[torch.Tensor, torch.Tensor]: compound_z = to_compound_symmetric( z ) # Z = A + iB, then compound_z = [(A, B),(B, -A)] evalues, q = eigh(compound_z) # evalues in ascending order # Think of Q as 4 block matrices. # Q = [(X, Re(U)), # (Y, -...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def eigenvalue_decomposition (a_t_a_matrix ):\r\n # get eigenvalues and -vectors from ATA matrix\r\n eigenvalues = np.zeros (a_t_a_matrix.shape[0] )\r\n eigenvectors = np.zeros ((a_t_a_matrix.shape[0], a_t_a_matrix.shape[0] ))\r\n evals, evecs = np.linalg.eig (a_t_a_matrix )\r\n\r\n # sort them\r\n ...
[ "0.67551243", "0.65288067", "0.635305", "0.6323472", "0.6140439", "0.596303", "0.589384", "0.588387", "0.5787465", "0.5755644", "0.56900215", "0.5678676", "0.56377494", "0.56096125", "0.5601024", "0.55979836", "0.5577778", "0.55142784", "0.55117464", "0.55056983", "0.5499221"...
0.57400054
10
r""" Compute the Takagi Factorization to obtain eigenvalues and eigenvectors. Given a complex symmetric matrix A, the Takagi factorization is an algorithm that
def takagi_eigvals(z: torch.Tensor) -> torch.Tensor: compound_z = to_compound_symmetric( z ) # Z = A + iB, then compound_z = [(A, B),(B, -A)] evalues = eigvalsh(compound_z) # evalues in ascending order index = torch.arange( start=z.shape[-1], end=2 * z.shape[-1], device=evalues.device,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def eigenvalue_decomposition (a_t_a_matrix ):\r\n # get eigenvalues and -vectors from ATA matrix\r\n eigenvalues = np.zeros (a_t_a_matrix.shape[0] )\r\n eigenvectors = np.zeros ((a_t_a_matrix.shape[0], a_t_a_matrix.shape[0] ))\r\n evals, evecs = np.linalg.eig (a_t_a_matrix )\r\n\r\n # sort them\r\n ...
[ "0.67551243", "0.65288067", "0.635305", "0.6323472", "0.6140439", "0.596303", "0.589384", "0.588387", "0.5787465", "0.5755644", "0.57400054", "0.56900215", "0.5678676", "0.56096125", "0.5601024", "0.55979836", "0.5577778", "0.55142784", "0.55117464", "0.55056983", "0.5499221"...
0.56377494
13
r""" Map elements from the Bounded Domain Model to the Upper Half Space Model.
def cayley_transform(z: torch.Tensor) -> torch.Tensor: identity = identity_like(z) i_z_plus_id = multiply_by_i(identity + z) inv_z_minus_id = inverse(identity - z) return i_z_plus_id @ inv_z_minus_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def normalize_bounds(self, bounds):\n scaled_bounds = []\n scalings = []\n intercepts = []\n \n non_fixed_params = []\n \n print(self.device)\n \n for name, domain in self.bounds.items():\n # Get any fixed parmeters\n if type(doma...
[ "0.54487365", "0.5227126", "0.52142507", "0.5171991", "0.5107734", "0.50656646", "0.5058526", "0.5027201", "0.49707612", "0.49313554", "0.49247977", "0.49091834", "0.49027383", "0.49019963", "0.48993587", "0.48976755", "0.48976755", "0.4897231", "0.4889632", "0.48836255", "0....
0.0
-1
r""" Map elements from the Upper Half Space Model to the Bounded Domain Model.
def inverse_cayley_transform(z: torch.Tensor) -> torch.Tensor: identity = identity_like(z) i_identity = multiply_by_i(identity) z_minus_id = z - i_identity inv_z_plus_id = inverse(z + i_identity) return z_minus_id @ inv_z_plus_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def normalize_bounds(self, bounds):\n scaled_bounds = []\n scalings = []\n intercepts = []\n \n non_fixed_params = []\n \n print(self.device)\n \n for name, domain in self.bounds.items():\n # Get any fixed parmeters\n if type(doma...
[ "0.5723099", "0.5415256", "0.5246361", "0.5238726", "0.51190364", "0.5076593", "0.50671107", "0.50671107", "0.505351", "0.50428146", "0.50336605", "0.4994442", "0.4975478", "0.49593166", "0.49453282", "0.49243712", "0.4914789", "0.4904812", "0.48992795", "0.48980626", "0.4889...
0.0
-1
Return whether the complex symmetric matrices are symmetric or not.
def is_complex_symmetric(z: torch.Tensor, atol=3e-5, rtol=1e-5): real_z, imag_z = z.real, z.imag return torch.allclose( real_z, real_z.transpose(-1, -2), atol=atol, rtol=rtol ) and torch.allclose(imag_z, imag_z.transpose(-1, -2), atol=atol, rtol=rtol)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_sparse_symmetric(m, complex: bool = False) -> bool:\n # https://mail.scipy.org/pipermail/scipy-dev/2014-October/020101.html\n if m.shape[0] != m.shape[1]:\n raise ValueError('m must be a square matrix')\n\n if not isinstance(m, sp.coo_matrix):\n m = sp.coo_matrix(m)\n\n r, c, v = m...
[ "0.78792083", "0.77783185", "0.7550069", "0.75136435", "0.7499239", "0.73405325", "0.73068935", "0.718236", "0.715196", "0.6975757", "0.69251335", "0.6864178", "0.68348575", "0.66318476", "0.65824836", "0.6559838", "0.6550716", "0.6302794", "0.6269109", "0.62109536", "0.61591...
0.727364
7
Build a real matrix out of the real and imaginary parts of a complex symmetric matrix. Let Z = A + iB be a matrix with complex entries, where A, B are n x n matrices with real entries.
def to_compound_symmetric(z: torch.Tensor) -> torch.Tensor: a, b = z.real, z.imag return block_matrix([[a, b], [b, -a]])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def real_of_complex(z):\n return np.vstack((np.real(z[:,0]),np.imag(z[:,0]),np.real(z[:,1]),np.imag(z[:,1]))).T", "def _complex(real, imag):\n real = np.asarray(real)\n imag = np.asarray(imag)\n cplx = 1j * imag \n return cplx + real", "def complex_matrix_to_real(m):\n a, b = np.real(m), np.im...
[ "0.7320743", "0.68548006", "0.67936164", "0.6741395", "0.6612078", "0.6526531", "0.6441918", "0.6295969", "0.62837374", "0.6214823", "0.6156181", "0.61043704", "0.610235", "0.6078308", "0.59810007", "0.59810007", "0.59810007", "0.59810007", "0.59810007", "0.59810007", "0.5981...
0.57143563
31
Return a complex identity of the shape of z, with the same type and device.
def identity_like(z: torch.Tensor) -> torch.Tensor: return torch.eye(z.shape[-1], dtype=z.dtype, device=z.device).expand_as(z)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def complexify(self,z):\r\n \r\n import numpy as np\r\n \r\n if not np.iscomplex(z).any():\r\n if len(z.shape) != 2 or z.shape[1] != 2:\r\n raise Exception('Shape format not understood. Provide shape vertices either as a complex vector, or as a N-by-2 real nump...
[ "0.7283238", "0.7283238", "0.7283238", "0.7283238", "0.7283238", "0.7283238", "0.7283238", "0.7283238", "0.7283238", "0.7283238", "0.6829854", "0.6434653", "0.64001256", "0.6320515", "0.62082124", "0.611706", "0.6097688", "0.6067596", "0.60050243", "0.59862447", "0.59814256",...
0.5861991
24
For Z = X + iY, calculates the operation i Z = i (X + iY) = Y + iX.
def multiply_by_i(z: torch.Tensor): return to_complex(-z.imag, z.real)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def execute(self):\n self.z = self.x + self.y", "def xewy_plus_z(x, y, z, activation=None):\n R = tf.add(tf.multiply(x, y), z)\n if activation:\n return activation(R)\n else: \n return R", "def mul(Z,X,Y):", "def __iadd__(self, other):\n self.x += other.x\n self.y ...
[ "0.63530385", "0.6340171", "0.6192241", "0.6054518", "0.60421085", "0.60085917", "0.59467405", "0.5932969", "0.59311134", "0.5928613", "0.5918655", "0.5918655", "0.5861854", "0.5843151", "0.58040804", "0.5794594", "0.5792426", "0.5758218", "0.5758218", "0.5758218", "0.5758218...
0.0
-1
Apply a positive conjugate projection to a real symmetric matrix.
def positive_conjugate_projection(y: torch.Tensor) -> torch.Tensor: evalues, s = eigh(y) evalues = torch.clamp(evalues, min=EPS[y.dtype]) y_tilde = s @ torch.diag_embed(evalues) @ s.transpose(-1, -2) # we do this so no operation is applied on the matrices that are already positive definite # This p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def conjugate(self):\r\n return self.__class__(self._real, -self._imag)", "def conjugate(self):\n return Complex(self._reNum, -self._imNum)", "def conjugate(self):\n v = zeros_como(self)\n for x in range(self.n):\n v[x] = (self[x]).conjugate()\n\n return v", "def...
[ "0.66299474", "0.6513677", "0.64540017", "0.64398617", "0.6426171", "0.64045066", "0.6403738", "0.6403738", "0.6403738", "0.6403738", "0.6403738", "0.6403738", "0.6403738", "0.6403738", "0.6403738", "0.6403738", "0.6403738", "0.6403738", "0.6403738", "0.6403738", "0.6403738",...
0.6503991
2
Is the queue empty?
def is_empty(self): return self.first is None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_empty(self):\n return self.queue == []", "def is_empty(self):\n return len(self.the_queue) == 0", "def is_empty(self):\n return len(self.queue) == 0", "def is_empty(self):\n return len(self.queue) == 0", "def is_empty(self):\n return len(self.__queue) > 0", "def ...
[ "0.92399496", "0.91864026", "0.91690904", "0.91690904", "0.91463965", "0.9136749", "0.90828764", "0.9066083", "0.9037413", "0.89759874", "0.8937634", "0.89152354", "0.89133626", "0.89084613", "0.88834363", "0.8876832", "0.88767827", "0.88767827", "0.88154984", "0.8768162", "0...
0.0
-1
Return the number of items in the queue.
def size(self): return self.N
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def size(self):\n return len(self._queue_items)", "def size(self):\r\n return len(self.queue)", "def size(self):\r\n return len(self.queue)", "def size(self):\n return len(self.queue)", "def size(self):\n return len(self.queue)", "def size(self):\n return len(sel...
[ "0.84928566", "0.83294904", "0.83294904", "0.8308619", "0.8308619", "0.8308619", "0.8308619", "0.8294581", "0.82817006", "0.81158674", "0.8024676", "0.79601943", "0.78984004", "0.78921103", "0.7763399", "0.77162796", "0.7704691", "0.76244605", "0.76244605", "0.7623233", "0.75...
0.0
-1
Return the item least recently added to the queue. Does not modify the queue.
def peek(self): if self.is_empty(): raise ValueError('Queue underflow') return self.first.item
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def top(self): # O(1)\n if not self.queue:\n return None\n return self.queue[0]", "def top(self):\n return self.queue[0]", "def top(self):\n while not self.queue[self.tag].empty():\n temp = self.queue[self.tag].get()\n self.queu...
[ "0.77313817", "0.7498477", "0.74331325", "0.7371703", "0.73413575", "0.73413575", "0.73301995", "0.7303269", "0.7290673", "0.7280591", "0.72582644", "0.72500014", "0.7247659", "0.72432554", "0.72195494", "0.7189716", "0.7187241", "0.71836096", "0.71619004", "0.7147872", "0.71...
0.71401
21
Add an item to the queue.
def enqueue(self, item): old_last = self.last self.last = self.Node(item) if self.is_empty(): self.first = self.last else: old_last.next_node = self.last self.N += 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def enqueue(self, item):\n self.queue.append(item)", "def enqueue(self, item):\n self.queue.append(item)", "def enqueue(self, item):\n self._queue.append(item)", "def enqueue(self, item):\n self.__queue.insert(0, item)", "def add(self, item):\n completeDeferred = defer.De...
[ "0.88014996", "0.88014996", "0.87262017", "0.8564763", "0.83524036", "0.8304818", "0.8270975", "0.8238265", "0.81438506", "0.8135321", "0.8135321", "0.80833095", "0.8079481", "0.7975776", "0.7962312", "0.7904748", "0.7904748", "0.7904748", "0.7904748", "0.7904748", "0.7893747...
0.6969514
97
Remove and return the item on the queue least recently added (e.g. at the front.)
def dequeue(self): if self.is_empty(): raise ValueError('Queue underflow') item = self.first.item self.first = self.first.next_node self.N -= 1 if self.is_empty(): self.last = None # To avoid loitering return item
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pop(self):\n self.queue.insert(len(self.queue), self.queue[0])\n self.queue.remove(self.queue[0])\n return self.queue.pop()", "def dequeue(self): # total O(1)\n topItem = self._queue[self._start] #O(1)\n self._queue[self._start] = None #O(1)\n self._start = (self....
[ "0.78243464", "0.7750231", "0.7648514", "0.7579684", "0.7571229", "0.75285035", "0.7490792", "0.7477285", "0.74620265", "0.7430369", "0.7426836", "0.7421849", "0.7421314", "0.7397516", "0.7391808", "0.7391045", "0.7384722", "0.7378833", "0.73569393", "0.73521245", "0.73507583...
0.6934145
82
Returns a list of items in the queue, starting with the item in the front of the queue.
def items(self): current = self.first output = [] while current is not None: output.append(current.item) current = current.next_node return output
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def queue_to_list(queue):\n result = []\n while queue.qsize() != 0:\n result.append(queue.get())\n return result", "def get_from_head(self, total_count = 1) -> list:\n return self.queue.get_all(total_count)", "def get_all_nowait(queue: Queue) -> list:\n\n results = []\n\n while Tru...
[ "0.6878175", "0.66443473", "0.66142774", "0.65437406", "0.6519724", "0.64220434", "0.6421816", "0.63827026", "0.63620025", "0.62990564", "0.62929565", "0.62783927", "0.6251019", "0.6233285", "0.62047136", "0.61885864", "0.6186185", "0.6179419", "0.61729276", "0.6167859", "0.6...
0.5712701
76
Returns items in the queue as a generator, starting with the item in the front of the queue.
def iteritems(self): current = self.first while current is not None: yield current.item current = current.next_node
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def queue_iter(queue: Queue) -> Generator[T, None, None]:\n while True:\n val = queue.get()\n yield val", "def get_generator(self):\n while self._is_running():\n yield self._queue.get()", "def get_generator(self):\n while self._is_running():\n yield self._qu...
[ "0.73305446", "0.6846361", "0.6846361", "0.6739455", "0.6710887", "0.66482306", "0.66402185", "0.6560582", "0.65385216", "0.65255594", "0.647886", "0.6452622", "0.6448023", "0.63225293", "0.6262202", "0.62370265", "0.62243056", "0.622232", "0.62099403", "0.62061656", "0.61503...
0.6098278
24
modify this according to leg construction
def _set_leg_params(self): self.p = 0.01600 self.q = 0.00000 self.r = 0.02000 self.c = 0.01811 self.u = 0.00000 self.v = 0.00000 self.e = -0.06000 self.h = -0.02820 self.s = 0.02200 self.d1 = 0.0 self.d2 = 0.0 self.d3 = 0.0 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reBuild(self): # redefine the rebuild method for loss function (polymorphism)\n self.updateRange()\n self.buildLine()\n self.normalize() # normalize loss function to have total area of 1 ", "def set_leg_for_person(self, person, leg):\n pass", "def CL(self):", "def __init__(s...
[ "0.679564", "0.58819866", "0.58000755", "0.57968915", "0.57861835", "0.57831764", "0.5769297", "0.5760113", "0.5710347", "0.5703536", "0.57016015", "0.568136", "0.5667604", "0.5666025", "0.5649842", "0.56333065", "0.5621189", "0.558316", "0.558316", "0.558316", "0.55752134", ...
0.5613859
17
modify this according to observation space
def _get_obs(self): pos = [] z = [] for i in range(params['memory_size']): if self._step - i * params['memory_size'] > 1: pos.append(self._track_item['joint_pos'][self._step - i * params['memory_size'] - 1].copy()) z.append(self._track_item['z'][self._...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def observation_space():", "def observation_space(self):\n pass", "def observation_space(self):\n raise NotImplementedError", "def create_observation(self):", "def create_observation(self):", "def __originate__(self):\n self.pos_to_num = deepcopy(self.o_pos_to_num)\n self.num_...
[ "0.73705953", "0.69167435", "0.68676424", "0.6199873", "0.6199873", "0.59468096", "0.5889655", "0.5877468", "0.58713746", "0.58399", "0.58200365", "0.5795784", "0.5741768", "0.5708703", "0.5667724", "0.56649333", "0.5630636", "0.56031966", "0.55794895", "0.55470127", "0.55426...
0.0
-1
modify this according to leg construction
def _leg_kinematics(self, knee_pos): knee_pos = np.abs(knee_pos) sign = np.sign(knee_pos) t = np.sqrt(self.p ** 2 + self.q ** 2 + self.r ** 2 - 2 * np.sqrt(self.p ** 2 + self.q ** 2) * self.r * np.cos(knee_pos)) phi = np.arccos((self.c ** 2 + t ** 2 - self.s **2) / (2 * self.c * t)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reBuild(self): # redefine the rebuild method for loss function (polymorphism)\n self.updateRange()\n self.buildLine()\n self.normalize() # normalize loss function to have total area of 1 ", "def set_leg_for_person(self, person, leg):\n pass", "def CL(self):", "def __init__(s...
[ "0.67977434", "0.58807766", "0.5800736", "0.5797241", "0.57861155", "0.57825583", "0.5768972", "0.5759353", "0.5711845", "0.5703295", "0.5701257", "0.56799626", "0.5669953", "0.5665548", "0.5651501", "0.56340134", "0.5620002", "0.5613218", "0.55845004", "0.55845004", "0.55845...
0.0
-1
modify this according to need
def _track_attr(self): self._track_item['joint_pos'].append(self.joint_pos.copy()) self._track_item['action'].append(self.action.copy()) self._track_item['velocity'].append(self.sim.data.qvel[:6].copy()) self._track_item['position'].append(self.sim.data.qpos[:3].copy()) self._tra...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def regular(self):", "def transform(self):", "def apply(self):", "def _set_attributes(self):", "def apply(self) -> None:", "def apply(self) -> None:", "def __call__(self):\n\t\treturn", "def preprocess(self):", "def build(self):", "def build(self):", "def build(self):", "def wrapup(self):\n ...
[ "0.69006395", "0.66655946", "0.65591294", "0.63855344", "0.6326173", "0.6326173", "0.6312347", "0.62946904", "0.62429655", "0.62429655", "0.62429655", "0.6238647", "0.62035924", "0.61887544", "0.61887544", "0.61887544", "0.61887544", "0.61887544", "0.6169873", "0.6138667", "0...
0.0
-1
modify this according to need
def _reset_track_lst(self): del self._track_item self._track_item = {key : [] for key in self._track_lst} return self._track_item
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def regular(self):", "def transform(self):", "def apply(self):", "def _set_attributes(self):", "def apply(self) -> None:", "def apply(self) -> None:", "def __call__(self):\n\t\treturn", "def preprocess(self):", "def build(self):", "def build(self):", "def build(self):", "def wrapup(self):\n ...
[ "0.6898327", "0.6665515", "0.6557633", "0.63853806", "0.6325384", "0.6325384", "0.63100964", "0.6292346", "0.6239352", "0.6239352", "0.6239352", "0.62390816", "0.6199866", "0.6188104", "0.6188104", "0.6188104", "0.6188104", "0.6188104", "0.6168081", "0.6137619", "0.61214644",...
0.0
-1
Existing analysis setups. Returns list of str List of all analysis setups in the design.
def existing_analysis_sweeps(self): setup_list = self.existing_analysis_setups sweep_list = [] s_type = self.solution_type for el in setup_list: sweep_list.append(el + " : " + s_type) return sweep_list
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_setup_names(self):\n self.setup_names = list(self._optimetrics.GetSetupNames())\n return self.setup_names.copy()", "def all_present_experiments(self):\n return _yield_subdir_names(self.exp_configs)", "def get_analysis_list(self):\n analysys_list = []\n\n analysis_type...
[ "0.64489913", "0.59564406", "0.5901408", "0.5773123", "0.56467426", "0.5641863", "0.56104463", "0.5600671", "0.55147064", "0.5445727", "0.53945076", "0.5340589", "0.5334018", "0.5283071", "0.52054447", "0.51864237", "0.51725304", "0.5147676", "0.5140388", "0.5132928", "0.5071...
0.7540443
0
Assign grille to a face or list of faces.
def assign_grille( self, air_faces, free_loss_coeff=True, free_area_ratio=0.8, resistance_type=0, external_temp="AmbientTemp", expternal_pressure="AmbientPressure", x_curve=["0", "1", "2"], y_curve=["0", "1", "2"], ): boundary_name = ge...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setFace(self, value):\n self.face = value", "def setFace(self, value):\n self.face = value", "def change_face(self, face):\n if self.face is not None:\n self.face.remove_point(self)\n\n self.face = face\n self.face.add_point(self)", "def faces(self, f):\n ...
[ "0.66815275", "0.66815275", "0.6373914", "0.6209701", "0.59925044", "0.5832084", "0.5554151", "0.55246836", "0.54223424", "0.54047036", "0.5346412", "0.5306642", "0.52954996", "0.52843904", "0.52732515", "0.5261938", "0.5224992", "0.4994123", "0.49903914", "0.49413803", "0.49...
0.57588255
6
Assign openings to a list of faces.
def assign_openings(self, air_faces): boundary_name = generate_unique_name("Opening") self.modeler.create_face_list(air_faces, "boundary_faces") props = {} air_faces = self.modeler._convert_list_to_ids(air_faces) props["Faces"] = air_faces props["Temperature"] = "Ambient...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def faces(self, f):\n self._faces = f", "def react_to_faces(faces):\n if (len(faces) == 1):\n # Get the location of the face (one of six positions)\n face_loc = get_location(faces[0].bbox, vision.VIDEO_SIZE)\n # Set the Raspimon pose\n if face_loc is not None:\n sense.set_pixels(VOLT_P...
[ "0.6327592", "0.58146024", "0.5767662", "0.5692748", "0.559544", "0.5340516", "0.52958256", "0.51952136", "0.51952136", "0.51705986", "0.51682824", "0.51266086", "0.5123751", "0.5064268", "0.50287205", "0.49778315", "0.49571183", "0.49558103", "0.49528244", "0.48971468", "0.4...
0.6439192
0
Assign twoway coupling to a setup.
def assign_2way_coupling( self, setup_name=None, number_of_iterations=2, continue_ipk_iterations=True, ipk_iterations_per_coupling=20 ): if not setup_name: if self.setups: setup_name = self.setups[0].name else: self.logger.glb.error("No setup i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup(bot):\n\tbot.add_cog(Wallet(bot))", "def setup_method(self, method):\n self.opp = get_test_open_peer_power()", "def setup_method(self, method):\n self.opp = get_test_open_peer_power()", "def _setup(self):\n if self._setup:\n return\n\n GPIO.setmode(GPIO.BCM)\n...
[ "0.5399899", "0.5323412", "0.5323412", "0.5253211", "0.52444965", "0.5201379", "0.51057905", "0.50686455", "0.50656474", "0.501346", "0.50123507", "0.49991336", "0.4993155", "0.4975337", "0.4950018", "0.49387175", "0.49261895", "0.49247813", "0.49237633", "0.4914572", "0.4902...
0.6021909
0
Assign to a box in Icepak the sources that come from the CSV file. Assignment is made by name.
def create_source_blocks_from_list(self, list_powers, assign_material=True, default_material="Ceramic_material"): oObjects = self.modeler.primitives.solid_names listmcad = [] num_power = None for row in list_powers: if not num_power: num_power = len(row) - 1 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _import_source_data(self, source_file: str) -> None:\n with open(source_file, 'r') as csv_file:\n reader = csv.DictReader(csv_file)\n for row in reader:\n self.cell_map.append(\n Cell(\n datamap_id=None,\n ...
[ "0.5608812", "0.5555337", "0.54913485", "0.5419967", "0.53080046", "0.5291996", "0.5269992", "0.52101916", "0.51923984", "0.5171572", "0.51682556", "0.5130636", "0.5125028", "0.5114853", "0.50463074", "0.5044218", "0.5032733", "0.5031158", "0.502738", "0.50222117", "0.5009049...
0.0
-1
Create a source block for an object.
def create_source_block( self, object_name, input_power, assign_material=True, material_name="Ceramic_material", use_object_for_name=True ): if assign_material: if isinstance(object_name, list): for el in object_name: self.modeler.primitives[el].materi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make(self, *args):\n return _uhd_swig.usrp_source_sptr_make(self, *args)", "def to_basic_block(self):\n return _uhd_swig.usrp_source_sptr_to_basic_block(self)", "def make(self, *args, **kwargs):\n return _uhd_swig.amsg_source_sptr_make(self, *args, **kwargs)", "def create_xblock(usag...
[ "0.60064274", "0.59292537", "0.5904522", "0.57898647", "0.57289743", "0.57095134", "0.57095134", "0.57032955", "0.56916565", "0.56502146", "0.56428325", "0.5628184", "0.5577237", "0.5540185", "0.5510298", "0.54880905", "0.54696864", "0.54547685", "0.5451283", "0.54358476", "0...
0.6881297
0
Create a source power for a face.
def create_source_power( self, face_id, input_power="0W", thermal_condtion="Total Power", surface_heat="0irrad_W_per_m2", temperature="AmbientTemp", radiate=False, source_name=None, ): if not source_name: source_name = generate_uniq...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pibooth_setup_picture_factory(cfg, opt_index, factory):", "def from_power(cls,angle=3.5*u.deg,npixel=256,seed=None,space=\"real\",powerTT=None,callback=\"camb_dimensionless\",lmax=3500):\n\n\t\t#Random seed\n\t\tif seed is not None:\n\t\t\tnp.random.seed(seed)\n\n\t\t#CMB lensing routines \n\t\tqlens = Lens(...
[ "0.522439", "0.5068676", "0.4991486", "0.49730086", "0.49581286", "0.49581286", "0.49515656", "0.4913044", "0.49089262", "0.49089262", "0.49024868", "0.4891229", "0.48829314", "0.48530835", "0.48487434", "0.4815359", "0.47930324", "0.4772436", "0.47723085", "0.47723085", "0.4...
0.75060856
0
Create a network block.
def create_network_block( self, object_name, power, rjc, rjb, gravity_dir, top, assign_material=True, default_material="Ceramic_material", use_object_for_name=True, ): if object_name in self.modeler.primitives.object_names: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def createBlock(self, block: ghidra.program.model.mem.MemoryBlock, name: unicode, start: ghidra.program.model.address.Address, length: long) -> ghidra.program.model.mem.MemoryBlock:\n ...", "def gen_new_block(self):\n block = BasicBlock()\n self.blocks.append(block)\n return block", ...
[ "0.78150713", "0.7146158", "0.7127016", "0.7124272", "0.69835055", "0.69597065", "0.6947752", "0.6910405", "0.6871594", "0.6822079", "0.68209267", "0.680913", "0.67646337", "0.6758735", "0.671372", "0.66777635", "0.6659609", "0.65750915", "0.65697277", "0.65690327", "0.654966...
0.6642023
17
Create network blocks from CSV files.
def create_network_blocks( self, input_list, gravity_dir, top, assign_material=True, default_material="Ceramic_material" ): objs = self.modeler.primitives.solid_names countpow = len(input_list[0]) - 3 networks = [] for row in input_list: if row[0] in objs: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def buildFromCSV(self, filepath):\r\n\t\t# TODO: Implement\r\n\t\traise NotImplementedError('This function has not yet been implemented.')\r\n\t\t# with open(filepath, 'r') as scheduleFile:\r\n\t\t# \t# Reusing Parser.parseCSVs(), but not in the intended way; ok because validation is not yet implemented\r\n\t\t# \...
[ "0.60700876", "0.5982457", "0.58930665", "0.5769913", "0.5688035", "0.5681831", "0.5606045", "0.56025296", "0.5596585", "0.55945504", "0.55530244", "0.55140656", "0.55128175", "0.55111945", "0.54853165", "0.54770124", "0.54687977", "0.5451146", "0.54387736", "0.54122007", "0....
0.5492376
14
Assign a surface monitor.
def assign_surface_monitor(self, face_name, monitor_type="Temperature", monitor_name=None): if not monitor_name: monitor_name = generate_unique_name("Monitor") oModule = self.odesign.GetModule("Monitor") oModule.AssignFaceMonitor(["NAME:" + monitor_name, "Quantities:=", [monitor_type...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_monitor(w_card):\n\n # standard name for the monitor interfaces\n mon_id = \"mon{}\".format(w_card.phy)\n\n if mon_id not in pyw.winterfaces():\n # this monitor interface is not set\n # then create a new one\n m_card = pyw.devadd(w_card, mon_id, 'monitor')\n\n # remove ...
[ "0.6523592", "0.5750645", "0.5728828", "0.5510032", "0.5482783", "0.53967303", "0.53698003", "0.53622407", "0.5345819", "0.5341474", "0.5330829", "0.52313554", "0.5227685", "0.51497513", "0.51342726", "0.51198417", "0.5113416", "0.5048145", "0.5045597", "0.50428575", "0.50274...
0.7559201
0
Create and assign a point monitor.
def assign_point_monitor(self, point_position, monitor_type="Temperature", monitor_name=None): point_name = generate_unique_name("Point") self.modeler.oeditor.CreatePoint( [ "NAME:PointParameters", "PointX:=", self.modeler.primitives._arg_with_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_temp_point_monitor(self, point_name, point_coord=[0, 0, 0]):\n arg1 = [\n \"NAME:PointParameters\",\n \"PointX:=\",\n point_coord[0],\n \"PointY:=\",\n point_coord[1],\n \"PointZ:=\",\n point_coord[2],\n ]\n\n ...
[ "0.6372603", "0.6200222", "0.580837", "0.5445098", "0.52815735", "0.52128863", "0.5191275", "0.51420385", "0.51420385", "0.51281756", "0.50980604", "0.50772643", "0.50596046", "0.50411236", "0.5038489", "0.5030054", "0.5010821", "0.5006753", "0.50021386", "0.49810976", "0.496...
0.768234
0
Assign block power to components based on a CSV file from Sherlock.
def assign_block_from_sherlock_file(self, csv_name): with open(csv_name) as csvfile: csv_input = csv.reader(csvfile) component_header = next(csv_input) data = list(csv_input) k = 0 component_data = {} for el in component_header: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def loadSpinFile(self, fileName):\r\n\r\n def getSpin(position, lines):\r\n \"\"\"Searches lines(a list of the lines found in the spin file) for\r\n a certain atom and returns the spin associated with it, or None if\r\n the atom is not in the list of lines.\"\"\"\r\n ...
[ "0.5574659", "0.5482745", "0.5295822", "0.5105875", "0.50926346", "0.50793165", "0.50631624", "0.50418556", "0.5041332", "0.50294137", "0.5015528", "0.501201", "0.50081575", "0.5005499", "0.50045425", "0.4995501", "0.49886698", "0.49570045", "0.49364844", "0.4930663", "0.4910...
0.8128566
0
Validate an Icepak design. If there are intersections, priorities are automatically applied to overcome simulation issues.
def assign_priority_on_intersections(self, component_prefix="COMP_"): temp_log = os.path.join(self.project_path, "validation.log") validate = self.odesign.ValidateDesign(temp_log) self.save_project() i = 2 if validate == 0: priority_list = [] with open(tem...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_elemental_composition_constraint_validation():\n name = \"Property Band gap\"\n elements = [\"Ga\", \"N\"]\n\n # Minimum can't be less than 0\n minimum = -1\n maximum = 2\n\n try:\n c = ElementalCompositionConstraint(name=name,\n elements=e...
[ "0.58644676", "0.5703968", "0.5642573", "0.5610521", "0.5567206", "0.55557936", "0.5502174", "0.54694086", "0.54298943", "0.538735", "0.5384461", "0.5378647", "0.5370359", "0.5365175", "0.5362339", "0.53607523", "0.5315794", "0.53015184", "0.5283785", "0.52618897", "0.5250919...
0.51348376
35
Find the top location of the layout given a gravity.
def find_top(self, gravityDir): dirs = ["-X", "+X", "-Y", "+Y", "-Z", "+Z"] for dir in dirs: argsval = ["NAME:" + dir + " Padding Data", "Value:=", "0"] args = [ "NAME:AllTabs", [ "NAME:Geometry3DCmdTab", ["N...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_attach_point_top(self):\n return self.mapToGlobal(self.rect().center()) # Default behavior", "def layout_y(self):\n return self.floris.farm.layout_y", "def getAbsoluteTop(self):\n return self.canvas.getAbsoluteTop()", "def get_pos(self):\n return self.rect.midtop", "def...
[ "0.6077535", "0.58963525", "0.569579", "0.5691413", "0.5642173", "0.56312567", "0.561799", "0.55809474", "0.5538494", "0.55331993", "0.55230623", "0.55064404", "0.54865223", "0.5485295", "0.5485295", "0.54806125", "0.5469844", "0.5455447", "0.54471344", "0.54401165", "0.54249...
0.721522
0
Create a parametric heat sink.
def create_parametric_fin_heat_sink( self, hs_height=100, hs_width=100, hs_basethick=10, pitch=20, thick=10, length=40, height=40, draftangle=0, patternangle=10, separation=5, symmetric=True, symmetric_separation=20,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __create_sample_data__(npts = 20):\n\t#data function\n\tdef wavy(x, y):\n\t\treturn np.sin(0.2*np.pi*x)*np.cos(0.4*np.pi*y)\n\t\n\t#make grid\n\txs = np.linspace(0, 2*20, 2*npts + 1)\n\tys = np.linspace(0, 20, npts + 1)\n\t(xgrid, ygrid) = np.meshgrid(xs, ys)\n\tzgrid = wavy(xgrid, ygrid)\n\t\n\treturn (xgrid,...
[ "0.50172657", "0.49718136", "0.4941488", "0.49096906", "0.48746008", "0.4873063", "0.48712033", "0.48473215", "0.4844691", "0.48285213", "0.47861546", "0.47523043", "0.4722584", "0.47122666", "0.47119308", "0.4706176", "0.46936378", "0.4685253", "0.4681379", "0.46753737", "0....
0.64573586
0
Update the main settings of the design.
def edit_design_settings( self, gravityDir=0, ambtemp=22, performvalidation=False, CheckLevel="None", defaultfluid="air", defaultsolid="Al-Extruded", ): AmbientTemp = str(ambtemp) + "cel" # # Configure design settings for gravity etc ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def updateSettingsUI(self):\n\n pass", "def update_settings(self):\n settings = {\n \"reference\": self,\n \"draw_tangents\": self.cbDrawTangents.isChecked(),\n }\n if self.cbShowSolarAngle.isChecked():\n settings[\"show_solar_angle\"] = self.cbSolarAn...
[ "0.79371053", "0.7370279", "0.7228131", "0.69154304", "0.6864276", "0.6823777", "0.66873527", "0.6674009", "0.66656154", "0.66357034", "0.6605516", "0.66019195", "0.65962917", "0.65909195", "0.6516604", "0.6515334", "0.6419422", "0.6341134", "0.62500346", "0.6247003", "0.6243...
0.6408862
17
Map EM losses to an Icepak design.
def assign_em_losses( self, designname="HFSSDesign1", setupname="Setup1", sweepname="LastAdaptive", map_frequency=None, surface_objects=[], source_project_name=None, paramlist=[], object_list=[], ): self.logger.glb.info("Mapping HFSS EM...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _makeimap(self):\n self.map_['source'] = 'GOES'\n self.map_['provider'] = 'NOAA'\n self.map_['instrument'] = 'SUVI'\n self.map_['physobs'] = 'flux'", "def from_enmap(emap):\n\n new_map = so_map()\n hdulist = emap.wcs.to_fits()\n header = hdulist[0].header\n new_map.pix...
[ "0.5513762", "0.52220994", "0.52134484", "0.5205543", "0.5147694", "0.51088357", "0.5089761", "0.49859834", "0.49765942", "0.49747527", "0.49704683", "0.4957417", "0.49562743", "0.49562743", "0.49485725", "0.49353972", "0.49210435", "0.48988274", "0.48841476", "0.4865084", "0...
0.67965555
0
Export the field surface output. This method exports one CSV file for the specified variation.
def eval_surface_quantity_from_field_summary( self, faces_list, quantity_name="HeatTransCoeff", savedir=None, filename=None, sweep_name=None, parameter_dict_with_values={}, ): name = generate_unique_name(quantity_name) self.modeler.create_face_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def export(self, output_path: str, export_format: str = 'csv', z_positive_up: bool = True, **kwargs):\n strt = perf_counter()\n print('****Exporting surface data to {}****'.format(export_format))\n fmt = export_format.lower()\n if os.path.exists(output_path):\n tstmp = dateti...
[ "0.6389275", "0.61024743", "0.6026513", "0.60168546", "0.58450335", "0.5803968", "0.5787736", "0.5779272", "0.57763594", "0.57551503", "0.5743111", "0.5724245", "0.5708107", "0.57041675", "0.56897855", "0.5661911", "0.5641275", "0.563398", "0.5632426", "0.56180626", "0.561395...
0.0
-1
Export the field volume output. This method exports one CSV file for the specified variation.
def eval_volume_quantity_from_field_summary( self, object_list, quantity_name="HeatTransCoeff", savedir=None, filename=None, sweep_name=None, parameter_dict_with_values={}, ): if not savedir: savedir = self.project_path if not filen...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def export_to_csv(self, outputfilepath, separator):\n\n con = fdb.connect(\n database=self.db_filepath,\n # dsn='localhost:~/test/CGI.vvv', #localhost:3050\n user='sysdba', password='masterkey'\n #charset='UTF8' # specify a character set for the connection\n ...
[ "0.64545417", "0.5754023", "0.56975734", "0.5678372", "0.56009924", "0.5591143", "0.55775434", "0.55506897", "0.55438507", "0.55271685", "0.54884607", "0.54863346", "0.5473634", "0.5464965", "0.54615444", "0.543746", "0.54295796", "0.5421413", "0.5415325", "0.5415011", "0.540...
0.0
-1
Unite the files created by a fields summary for the variations.
def UniteFieldsSummaryReports(self, savedir, proj_icepak): newfilename = os.path.join(savedir, proj_icepak + "_HTCAndTemp.csv") newfilelines = [] headerwriten = False filetoremove = [] # first variation i = 0 filename = os.path.join(savedir, proj_icepak + "_HTCAnd...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_set_reduce_fields_automatically_when_only_files_specified():\n\n files = ['Unihan_Readings.txt', 'Unihan_Variants.txt']\n\n options = {'input_files': files}\n\n b = process.Packager(options)\n\n results = process.get_fields(process.filter_manifest(files))\n expected = b.options['fields']\n\...
[ "0.6138094", "0.61131877", "0.58164036", "0.5275635", "0.52627516", "0.5150861", "0.51374656", "0.50474006", "0.5045591", "0.49486035", "0.4945565", "0.48872384", "0.4884592", "0.48613265", "0.48549768", "0.48328787", "0.48041835", "0.48029533", "0.48023853", "0.47989404", "0...
0.6775532
0
Export a fields summary of all objects.
def export_summary( self, output_dir=None, solution_name=None, type="Object", geometryType="Volume", quantity="Temperature", variation="", variationlist=[], ): all_objs = list(self.modeler.oeditor.GetObjectsInGroup("Solids")) all_objs_N...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def printSummary(self):\n pass", "def print_summary(self):\n\t\t\n\t\tif not self.objects:\n\t\t\tsys.stderr.write(\"No objects.\\n\")\n\t\t\treturn\n\t\t\n\t\t# Summary header data\n\t\theader = (\"ok\", \"error\", \"zdata\", \"xdata\", \"odata\", \"ratio\")\n\t\t\n\t\t# Summary header format\n\t\tfield ...
[ "0.63015485", "0.6184842", "0.6170315", "0.61438155", "0.6115484", "0.6029715", "0.6003916", "0.6003916", "0.59255403", "0.5897459", "0.5885808", "0.58348954", "0.58295274", "0.58198684", "0.58078593", "0.5788792", "0.5775526", "0.5759068", "0.5753282", "0.57292354", "0.57216...
0.61726904
2
Retrieve a list of linked data.
def get_link_data(self, linkData): if linkData[0] is None: project_name = "This Project*" else: project_name = linkData[0].replace("\\", "/") designName = linkData[1] hfssSolutionName = linkData[2] forceSourceSimEnabler = linkData[3] preserveSrcRe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def display_content(self):\n list = []\n traverse = self.head\n\n if self.head == None:\n # print(\"Linked List is empty\")\n return\n\n while traverse.next != None:\n list.append(traverse.data)\n traverse = traverse.next\n\n list.appe...
[ "0.6898586", "0.6640852", "0.6524167", "0.65154654", "0.6504477", "0.6492138", "0.64538014", "0.6377081", "0.6314501", "0.6314501", "0.6303047", "0.629092", "0.628569", "0.626632", "0.62105554", "0.6186964", "0.6186964", "0.6156874", "0.6129265", "0.6085171", "0.5974937", "...
0.0
-1
Create a PCB component in Icepak that is linked to an HFSS 3D Layout object.
def create_ipk_3dcomponent_pcb( self, compName, setupLinkInfo, solutionFreq, resolution, PCB_CS="Global", rad="Nothing", extenttype="Bounding Box", outlinepolygon="", powerin="0W", custom_x_resolution=None, custom_y_resoluti...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_pcb_from_3dlayout(\n self,\n component_name,\n project_name,\n design_name,\n resolution=2,\n extenttype=\"Bounding Box\",\n outlinepolygon=\"\",\n close_linked_project_after_import=True,\n custom_x_resolution=None,\n custom_y_resolut...
[ "0.722886", "0.6006457", "0.5916641", "0.5631487", "0.55857074", "0.5567293", "0.5479314", "0.547198", "0.5281856", "0.52459306", "0.52106047", "0.5193295", "0.5190418", "0.5168565", "0.51664287", "0.51517653", "0.5136186", "0.5127592", "0.5125972", "0.51216894", "0.51168144"...
0.7250074
0
Create a PCB component in Icepak that is linked to an HFSS 3D Layout object linking only to the geometry file.
def create_pcb_from_3dlayout( self, component_name, project_name, design_name, resolution=2, extenttype="Bounding Box", outlinepolygon="", close_linked_project_after_import=True, custom_x_resolution=None, custom_y_resolution=None, ): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_ipk_3dcomponent_pcb(\n self,\n compName,\n setupLinkInfo,\n solutionFreq,\n resolution,\n PCB_CS=\"Global\",\n rad=\"Nothing\",\n extenttype=\"Bounding Box\",\n outlinepolygon=\"\",\n powerin=\"0W\",\n custom_x_resolution=None,...
[ "0.71606755", "0.60618496", "0.5981655", "0.56415284", "0.5577579", "0.5565353", "0.5536651", "0.54877406", "0.54286206", "0.54191357", "0.53995544", "0.53853345", "0.53833777", "0.53343934", "0.53200406", "0.53013456", "0.5293416", "0.52651024", "0.5246153", "0.5235362", "0....
0.74508125
0
Copy a group from another design.
def copyGroupFrom(self, groupName, sourceDesign, sourceProject=None, sourceProjectPath=None): oName = self.project_name if sourceProject == oName or sourceProject is None: oSrcProject = self._desktop.GetActiveProject() else: self._desktop.OpenProject(sourceProjectPath) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def copy_group(self):\n dd = self.destination_directory\n sg = self.source_group\n dg = self.destination_group\n\n data = {\n 'description': sg.description,\n 'name': sg.name,\n 'status': sg.status,\n }\n\n # If this Group already exists, w...
[ "0.6744914", "0.6737628", "0.65842587", "0.64991206", "0.6265472", "0.6035223", "0.5887279", "0.5776485", "0.5767557", "0.5695418", "0.5676896", "0.5611046", "0.5533167", "0.55331063", "0.5526371", "0.5520259", "0.5512979", "0.5510256", "0.5470082", "0.5459582", "0.5455663", ...
0.7448452
0
Export the 3D model.
def export3DModel(self, fileName, filePath, fileFormat=".step", object_list=[], removed_objects=[]): if not object_list: allObjects = self.modeler.primitives.object_names if removed_objects: for rem in removed_objects: allObjects.remove(rem) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def export_model(self, output_model_dir):\n logger.info(\"Exporting model to directory : {}\".format(output_model_dir))\n self.model.export(output_model_dir=output_model_dir)", "def create_e3d_file(self,path='./'):\n dt=0.606*self.model_parameters['dh']/np.max(self.velocity_model['vp']) # dt...
[ "0.64824575", "0.6474481", "0.64248276", "0.63080794", "0.6297194", "0.62525713", "0.6229305", "0.6211556", "0.61593837", "0.6107157", "0.6102703", "0.60517895", "0.60356396", "0.60192573", "0.6001406", "0.5998077", "0.5985993", "0.5985118", "0.59555966", "0.59447503", "0.588...
0.69140553
0
Create a custom mesh tailored on a PCB design.
def globalMeshSettings( self, meshtype, gap_min_elements="1", noOgrids=False, MLM_en=True, MLM_Type="3D", stairStep_en=False, edge_min_elements="1", object="Region", ): oModule = self.odesign.GetModule("MeshRegion") oBoundingBo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def createMesh(self, chem, coord_x_start, coord_y_start) :\r\n init_conc = .0\r\n self.compParDiff(chem)\r\n comp.Comp.createMeshHomo(self, 'SC', chem, init_conc, coord_x_start, coord_y_start)\r\n #self.meshes[0].setConc(1)\r", "def MeshMachine(main):\n\n # oDesign definition\n ...
[ "0.6748844", "0.6687501", "0.6588435", "0.65406054", "0.6470928", "0.63661134", "0.6353918", "0.63378006", "0.6313802", "0.63055897", "0.6254621", "0.62144154", "0.614839", "0.6137772", "0.61252075", "0.602909", "0.6011781", "0.59770757", "0.5933673", "0.5916552", "0.58993566...
0.0
-1
Create a bounding box to be used as a mesh region in Icepak.
def create_meshregion_component( self, scale_factor=1.0, name="Component_Region", restore_padding_values=[50, 50, 50, 50, 50, 50] ): self.modeler.edit_region_dimensions([0, 0, 0, 0, 0, 0]) verticesID = self.modeler.oeditor.GetVertexIDsFromObject("Region") x_values = [] y_va...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def boundingBox(self):\n minx, miny, maxx, maxy = self.substrates.bounds\n return pcbnew.BOX2I(\n pcbnew.VECTOR2I(int(minx), int(miny)),\n pcbnew.VECTOR2I(int(maxx - minx), int(maxy - miny)))", "def bounding_box(self):\n # We use the solution described in\n # htt...
[ "0.7411611", "0.69350845", "0.6934657", "0.68345034", "0.6752757", "0.67286456", "0.6659727", "0.6606735", "0.65993637", "0.65464365", "0.654596", "0.65450597", "0.64703244", "0.6465996", "0.6458008", "0.6437728", "0.6423373", "0.64145267", "0.6410763", "0.63957316", "0.63891...
0.63606215
24
Create a temperature monitor for the simulation.
def create_temp_point_monitor(self, point_name, point_coord=[0, 0, 0]): arg1 = [ "NAME:PointParameters", "PointX:=", point_coord[0], "PointY:=", point_coord[1], "PointZ:=", point_coord[2], ] arg2 = ["NAME:Attrib...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, sensor, temperature_resolution, humidity_resolution):\n self.sensor = sensor\n self.sensor.turnHeaterOn() \n time.sleep(1.0) # Burn off condensed stuff.\n self.sensor.turnHeaterOff() \n self.update()\n # Main Program\n #print \"------------\"\n ...
[ "0.6352923", "0.60325027", "0.5969366", "0.596796", "0.58568716", "0.577268", "0.5719137", "0.5601181", "0.5568259", "0.5551024", "0.55270517", "0.5474353", "0.54662377", "0.54618007", "0.5457268", "0.545686", "0.5451471", "0.5451471", "0.5451471", "0.5444733", "0.5432432", ...
0.550815
11
Delete the EM losses boundary.
def delete_em_losses(self, bound_name): self.oboundary.DeleteBoundaries([bound_name]) return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def die(self):\n self.pjs.bombermen.remove(self)\n for block in self.physics.blocks[self.stype]:\n if block == self.rects[0]:\n self.physics.blocks[self.stype].remove(block)", "def eraseLastSeg(self):\n self.can.delete(self.segs.pop().getGraphicObject())", "def cl...
[ "0.6453558", "0.618556", "0.6140863", "0.6094852", "0.6082206", "0.6014098", "0.59995145", "0.5951281", "0.5936723", "0.57956755", "0.57941866", "0.57794243", "0.5707698", "0.5691199", "0.56879765", "0.5686631", "0.56787246", "0.56636286", "0.56636286", "0.5652219", "0.565171...
0.63696367
1
Delete a PCB component.
def delete_pcb_component(self, comp_name): arg = ["NAME:Selections", "Selections:=", comp_name] self.modeler.oeditor.Delete(arg) return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delcomponent(self,\n context=[],\n componentid=None):\n if componentid == None:\n raise ValueError, \"delcomponent: componentid is None\"\n return jsoncall.do_call(\"delcomponent\", {'modelname':self.modelname,\\\n ...
[ "0.66529816", "0.65597695", "0.64037114", "0.62848693", "0.6156556", "0.6069828", "0.6047589", "0.602334", "0.5979555", "0.59127647", "0.590122", "0.58975464", "0.58932763", "0.5750576", "0.5735574", "0.56635535", "0.56628716", "0.56628716", "0.5650871", "0.56496924", "0.5638...
0.68637323
0
Parses the source file for a give sample_type.
def _read_samples(self): logging.debug("Start file parsing.") data = pd.read_csv(self._source_file, header=None) data = pd.read_csv(self._source_file, header=None) header = pd.read_csv(self._header_file, delimiter=':', skiprows=1, header=None) header.columns = ['column'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_source_file(self, filepath):\n raise NotImplementedError('Not Implemented')", "def parse(source, *, filename=\"[STRING]\", typecheck=True):\n return _Parser(filename, source, typecheck).parse()", "def parse_file(self, source):\n # If this is a file-like object, we should be able to r...
[ "0.6792015", "0.60584515", "0.60023004", "0.5840672", "0.5758215", "0.5618943", "0.55958074", "0.55881006", "0.5586995", "0.5580437", "0.55724865", "0.5562735", "0.55514455", "0.55227596", "0.5517897", "0.55124015", "0.5453931", "0.54345775", "0.5429451", "0.5374856", "0.5351...
0.53575206
20
calculate reads per kilobase transcript per million reads NOTE. rpkm=(1e9C)/(LN)
def rpkm(counts,length): return 1e9*counts/(length[:,np.newaxis]*np.sum(counts,axis=0))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def TCMB(rs):\n\n return 0.235e-3 * rs", "def overhead(readings):\n return 100.0 * (int(readings[0]) + int(readings[1])) / (int(readings[2]) + int(readings[3]))", "def map_reads_2genes(self, reads_file):\n start1 = time()\n read_starts = self.__get_reads_pos(reads_file)\n start2 ...
[ "0.6038982", "0.590668", "0.5849638", "0.57630473", "0.5746753", "0.5619334", "0.559292", "0.5588034", "0.5583821", "0.55580336", "0.5542441", "0.5536606", "0.5535897", "0.55050975", "0.5450824", "0.5428289", "0.54251826", "0.54120463", "0.5382752", "0.53805065", "0.5346536",...
0.57263666
5
sendTCP_raw_singe same as sendTCP_raw but for single message
def sendTCP_raw_single(m,ip,port): s=socket.socket() s.settimeout(1) s.connect((ip,port)) s.send(m.data) #print ("RetVal: %s" % s.recv(1000)) return s.recv(1000)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sendRaw(self, msg, echo = False):\n\n sent = self.__sock.send(msg)\n if sent > 0 and echo:\n print \"Sent: %s\"%msg,", "async def send_raw(self, raw_message : str):\n await self._connection.send_raw(raw_message)", "async def send_raw(self, data: bytes) -> None:\n awai...
[ "0.711327", "0.67403096", "0.6615937", "0.65647995", "0.6527725", "0.6427289", "0.63520473", "0.6343768", "0.63324654", "0.63252115", "0.62935925", "0.626896", "0.6267537", "0.6251001", "0.6248931", "0.6226685", "0.6206426", "0.61644304", "0.6148088", "0.6148088", "0.6143113"...
0.74798274
0
sendTCP_raw_bytes same as sendTCP_raw_singe but for raw bytes
def sendTCP_raw_bytes(data,ip,port): s=socket.socket() s.settimeout(3) s.connect((ip,port)) s.send(data) #print ("RetVal: %s" % s.recv(1000)) return s.recv(1000)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send_bytes(self, data: bytes) -> None:", "async def send_raw(self, data: bytes) -> None:\n await self.socket.sendall(data)", "def send(self, data: bytes):", "def send_bytes(self, bytearray):\r\n try:\r\n self.socket.send(bytearray)\r\n except:\r\n # print(\"Sock...
[ "0.73878384", "0.72343266", "0.68756074", "0.67705405", "0.67532486", "0.65822387", "0.6581286", "0.65647763", "0.65512145", "0.6451417", "0.6440612", "0.6440612", "0.6415889", "0.63881886", "0.63653135", "0.6315379", "0.62951326", "0.62764776", "0.62761664", "0.622699", "0.6...
0.7612792
0
This function gets a sample pcap file and puts random bytes inside the all fields. Then sends it to the server. It returns all possible error messages in list.
def createErrorMsgs(messages, ip, port): rspList = list() for m in messages.values(): randomBS = copy.copy(m) randomBS_arr = bytearray(randomBS.data) for idx,bytInt in enumerate(randomBS_arr): randomBS_arr[idx] = random.randint(0,255) randomBS = bytes(randomBS_arr) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_and_store_pcap(file_name):\r\n file = open(file_name, \"rb\")\r\n global_header = file.read(24).hex()\r\n byte = file.read(16)\r\n packets = []\r\n bytes = []\r\n sizes = []\r\n while byte:\r\n packet_header = byte.hex()\r\n # parse the size for each packet\r\n si...
[ "0.56992763", "0.5480785", "0.5442786", "0.53123915", "0.52554893", "0.5206114", "0.5205962", "0.5205437", "0.5184168", "0.5165345", "0.5143179", "0.5138992", "0.51319814", "0.5131829", "0.509969", "0.5086289", "0.5083775", "0.5062206", "0.5027553", "0.5012516", "0.5002637", ...
0.5758332
0
diff_msg modify one field to value and get the difference with the original return False if timeout or the ratio of change
def diff_msg(sym,fi,val,ip,port): orig=sym.getValues()[0] try: respOrig=sendTCP_raw_bytes(orig,ip,port) except socket.timeout: return False msg=b'' for i in range(len(sym.fields)): msg+=sym.fields[i].getValues()[0] if fi!=i else val try: original = str(orig).part...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_diff(self,game,wanted_diff,wanted_starting_time=''):\n return True", "def _diff(self, param, diff):\n pass", "def check_compare_decrease(out_fields):\n change = out_fields[CHANGE_FLD]\n expected_change = -25.00\n check_compare(change, expected_change)\n check_float_value(cha...
[ "0.59433705", "0.58866566", "0.5741213", "0.57070243", "0.56107557", "0.5602087", "0.55542886", "0.55195427", "0.5489824", "0.53829694", "0.53829694", "0.5382785", "0.53190625", "0.53040767", "0.5303886", "0.5302495", "0.52817154", "0.5278376", "0.52559036", "0.5226828", "0.5...
0.7136184
0
Unify operations between two compared strings seqm is a difflib. SequenceMatcher instance whose a & b are strings
def show_diff(text, n_text): seqm = difflib.SequenceMatcher(None, text, n_text) output= [] for opcode, a0, a1, b0, b1 in seqm.get_opcodes(): if opcode == 'equal': output.append(seqm.a[a0:a1]) elif opcode == 'insert': output.append(colored(seqm.b[b0:b1],'red')) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def makediff(s1, s2):\n import difflib\n differ = difflib.SequenceMatcher()\n differ.set_seqs(s1, s2)\n #debug = False\n s1new = [ ]\n s2new = [ ]\n previousOp = None\n for op, i1, i2, j1, j2 in differ.get_opcodes():\n #if debug: print \"top\"\n #if debug: print op, i1, i2, j1...
[ "0.7173412", "0.6422844", "0.60554993", "0.6048219", "0.6048219", "0.6022853", "0.5894127", "0.5861843", "0.5823711", "0.581837", "0.5812351", "0.58081526", "0.57986295", "0.5772496", "0.57496095", "0.57384884", "0.57264704", "0.5713561", "0.57001203", "0.5696666", "0.5676719...
0.0
-1
takes list of blacklist urls
def load_blacklists(self, blacklist_urls: List[str]) -> Set[str]: items: Set[str] = set() sets = [] for url in blacklist_urls: fname = f'/tmp/{hashlib.md5(url.encode()).hexdigest()}-blacklist' # Download if necessary if not os.path.exists(fname): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def handle_weblists(bot, ievent):\n ievent.reply(\"whitelist: %s blacklist: %s\" % (cfg.get('whitelist'), \\\ncfg.get('blacklist')))", "def find_target_urls(url_list):\n candidate_urls = []\n \n #iterate through urls\n for url in get_urls(get_clean_text(message_list)):\n #skip any urls from...
[ "0.67311", "0.67156696", "0.66505307", "0.6576072", "0.6518747", "0.6418503", "0.6418085", "0.63344425", "0.6133395", "0.60442084", "0.5939", "0.59096384", "0.5879145", "0.5876669", "0.5847612", "0.5847537", "0.5801166", "0.5793875", "0.57607865", "0.5706794", "0.56880635", ...
0.6910591
0
Runs a transformation that is specified as a dict of checksums, such as returned by highlevel.Transformer.get_transformation_dict
def run_transformation_dict(transformation_dict, result_callback=None): # TODO: add type annotation and all kinds of validation... from .. import database_sink transformation_buffer = tf_get_buffer(transformation_dict) transformation = calculate_checksum(transformation_buffer) cache_buffer(transfor...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def run_transformation_dict_async(transformation_dict):\n # TODO: add type annotation and all kinds of validation...\n transformation_buffer = tf_get_buffer(transformation_dict)\n transformation = calculate_checksum(transformation_buffer)\n cache_buffer(transformation, transformation_buffer)\n ...
[ "0.6176635", "0.58770233", "0.5642491", "0.5400571", "0.53724617", "0.53604096", "0.53584576", "0.5241145", "0.5201133", "0.5098775", "0.5077724", "0.50566465", "0.5045827", "0.5000128", "0.49946854", "0.49663246", "0.49579343", "0.4930994", "0.48909107", "0.48407468", "0.483...
0.65600985
0
Runs a transformation that is specified as a dict of checksums, such as returned by highlevel.Transformer.get_transformation_dict
async def run_transformation_dict_async(transformation_dict): # TODO: add type annotation and all kinds of validation... transformation_buffer = tf_get_buffer(transformation_dict) transformation = calculate_checksum(transformation_buffer) cache_buffer(transformation, transformation_buffer) increfed ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run_transformation_dict(transformation_dict, result_callback=None):\n # TODO: add type annotation and all kinds of validation...\n from .. import database_sink\n\n transformation_buffer = tf_get_buffer(transformation_dict)\n transformation = calculate_checksum(transformation_buffer)\n cache_buff...
[ "0.65600985", "0.58770233", "0.5642491", "0.5400571", "0.53724617", "0.53604096", "0.53584576", "0.5241145", "0.5201133", "0.5098775", "0.5077724", "0.50566465", "0.5045827", "0.5000128", "0.49946854", "0.49663246", "0.49579343", "0.4930994", "0.48909107", "0.48407468", "0.48...
0.6176635
1