code
stringlengths
3
6.57k
params(self)
copy.deepcopy(self.__actual_params__)
tag(cls)
description(cls)
key(cls)
no_field(self)
len(self.__params__)
CombineDBs(data.Dataset)
__init__(self, dataloaders, excluded=None)
self.im_ids.append(elem)
self.im_ids.remove(elem)
enumerate(dataloaders)
enumerate(dl.im_ids)
if (curr_im_id in self.im_ids)
and (curr_im_id not in new_im_ids)
new_im_ids.append(curr_im_id)
range(len(dl.obj_dict[curr_im_id])
self.obj_list.append({'db_ii': ii, 'obj_ii': dl.obj_list.index([jj, kk])
self.im_list.append({'db_ii': ii, 'im_ii': jj})
print('Combined number of images: {:d}\nCombined number of objects: {:d}'.format(num_images, len(self.obj_list)
__getitem__(self, index)
__getitem__(_obj_ii)
sample.keys()
str(self.dataloaders[_db_ii])
__len__(self)
len(self.obj_list)
__str__(self)
str(db)
str(db)
str(include_db)
str(exclude_db)
tr.RandomHorizontalFlip()
tr.ScaleNRotate(rots=(-15, 15)
tr.FixedResize(resolutions={'image': (450, 450)
tr.DistanceMap(v=0.15, elem='gt')
tr.ConcatInputs(elems=('image', 'distance_map')
tr.ToTensor()
tr.FixedResize(resolutions={'image': (450, 450)
tr.DistanceMap(v=0.15, elem='gt')
tr.ConcatInputs(elems=('image', 'distance_map')
tr.ToTensor()
pascal.VOCSegmentation(split='val', transform=composed_transforms_ts, retname=True)
sbd.SBDSegmentation(split=['train', 'val'], transform=composed_transforms_tr, retname=True)
pascal.VOCSegmentation(split='train', transform=composed_transforms_tr, retname=True)
CombineDBs([pascal_voc_train, sbd], excluded=[pascal_voc_val])
torch.utils.data.DataLoader(dataset, batch_size=2, shuffle=True, num_workers=0)
enumerate(dataloader)
range(sample["image"].size()
numpy()
numpy()
np.array(gt[0])
astype(np.uint8)
np.array(dismap[0])
astype(np.uint8)
display.astype(np.uint8)
plt.figure()
plt.title('display')
plt.imshow(display, cmap='gray')
plt.show(block=True)
SlackClient('<YOUR_SLACK_API_TOKEN>')
handle_command(command, channel)
command.startswith(MAKE_TEA_COMMAND)
requests.post('https://api.relayr.io/devices/<KETTLE_DEVICE_ID>/data', data=json.dumps(data)
command.startswith(STOP_BOILING_COMMAND)
requests.post('https://api.relayr.io/devices/<KETTLE_DEVICE_ID>/data', data=json.dumps(data)
command.startswith("is the kettle boiling?")
requests.get('https://api.relayr.io/devices/<KETTLE_DEVICE_ID>/readings', headers=headers)
json.loads(r.text)
command.startswith("is the water hot?")
requests.get('https://api.relayr.io/devices/<KETTLE_TEMPERATURE_DEVICE_ID>/readings', headers=headers)
json.loads(r.text)
float(resp['readings'][0]['value'])
float(resp['readings'][0]['value'])
float(resp['readings'][0]['value'])
parse_slack_output(slack_rtm_output)
len(output_list)
split(AT_BOT)
strip()
lower()
slack_client.rtm_connect()
print("StarterBot connected and running!")
parse_slack_output(slack_client.rtm_read()
handle_command(command, channel)
time.sleep(READ_WEBSOCKET_DELAY)
print("Connection failed. Invalid Slack token or bot ID?")
_vim_vital_web_api_github_main()
import (urlparse, parse_qs, urlencode, urlunparse)
import (urlparse, parse_qs, urlunparse)
format_exception()
sys.exc_info()
to_vim(obj)
isinstance(obj, bool)
int(obj)
isinstance(obj, dict)
dict([to_vim(k)
to_vim(v)
obj.items()
isinstance(obj, (list, tuple)
list(to_vim(v)
build_headers(token)