code
stringlengths
3
6.57k
ICalendarParser.get_instance(device_data[CONF_PARSER])
HTTPPasswordMgrWithDefaultRealm()
HTTPBasicAuthHandler(passman)
HTTPDigestAuthHandler(passman)
build_opener(digest_auth_handler, basic_auth_handler)
install_opener(opener)
_download_calendar(self)
or (datetime.now()
datetime.now()
urlopen(self.url)
conn.read()
decode()
replace("\0", "")
_LOGGER.error(f"{self.name}: Failed to open url: {http_error.reason}")
_LOGGER.error(f"{self.name}: Failed to open url: {url_error.reason}")
_LOGGER.error(f"{self.name}: Failed to open url!")
async_get_events(self, hass, start_date, end_date)
hass.async_add_job(self._download_calendar)
list(map(self.format_dates, events)
_LOGGER.error(f"{self.name}: Failed to parse ICS!")
Throttle(MIN_TIME_BETWEEN_UPDATES)
update(self)
self._download_calendar()
_LOGGER.error(f"{self.name}: Failed to parse ICS!")
format_dates(self, event)
self.get_date_formatted(event["start"], event["all_day"])
self.get_date_formatted(event["end"], event["all_day"])
get_date_formatted(self, dt, is_all_day)
dt.strftime("%Y-%m-%d")
dt.strftime("%Y-%m-%dT%H:%M:%S.%f%z")
get_hass_date(self, dt, is_all_day)
self.parser.get_date_formatted(dt, is_all_day)
self.parser.get_date_formatted(dt, is_all_day)
_rand(a=0., b=1.)
np.random.rand()
get_imageId_from_fileName(filename, id_iter)
os.path.splitext(filename)
filename.isdigit()
int(filename)
random_sample_crop(image, boxes)
np.random.choice([None, 0.1, 0.3, 0.5, 0.7, 0.9])
trails (50)
range(50)
_rand(0.3, 1.0)
_rand(0.3, 1.0)
_rand()
_rand()
np.array([int(top)
int(left)
int(top + h)
int(left + w)
jaccard_numpy(boxes, rect)
drop_mask.any()
min()
max()
mask.any()
copy()
np.maximum(boxes_t[:, :2], rect[:2])
np.minimum(boxes_t[:, 2:4], rect[2:4])
preprocess_fn(img_id, image, box, is_training)
cv2.setNumThreads(2)
_infer_data(image, input_shape)
cv2.resize(image, (input_w, input_h)
len(image.shape)
np.expand_dims(image, axis=-1)
np.concatenate([image, image, image], axis=-1)
np.array((img_h, img_w)
_data_aug(image, box, is_training, image_size=(300, 300)
_infer_data(image, image_size)
box.astype(np.float32)
random_sample_crop(image, box)
cv2.resize(image, (w, h)
_rand()
cv2.flip(image, 1, dst=None)
len(image.shape)
np.expand_dims(image, axis=-1)
np.concatenate([image, image, image], axis=-1)
ssd_bboxes_encode(box)
_data_aug(image, box, is_training, image_size=config.img_shape)
create_voc_label(is_training)
enumerate(config.classes)
os.path.join(voc_root, sub_dir)
os.path.isdir(voc_dir)
ValueError(f'Cannot find {sub_dir} dataset path.')
os.path.isdir(os.path.join(voc_dir, 'Images')
os.path.join(voc_dir, 'Images')
os.path.isdir(os.path.join(voc_dir, 'Annotations')
os.path.join(voc_dir, 'Annotations')
os.path.join(config.voc_root, config.voc_json)
os.path.split(json_file)
os.path.isdir(file_dir)
os.makedirs(file_dir)
os.listdir(anno_dir)
print(anno_file)
anno_file.endswith('xml')
et.parse(os.path.join(anno_dir, anno_file)
tree.getroot()
root_node.find('filename')
get_imageId_from_fileName(file_name, id_iter)
os.path.join(image_dir, file_name)