Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@deprecated(reason="Not used, open an issue if required.", version='2.4.110')
def edit_tag_json(self, json_file, tag_id):
"""Edit the tag using a json file."""
with open(json_file, 'rb') as f:
jdata = json.load(f)
url = urljoin(self.root_url, 'tags/edit/{}'.format(tag_id))
response = self._prepare_request('POST', url, json.dumps(jdata))
return self._check_response(response)
@deprecated(reason="Use ExpandedPyMISP.search", version='2.4.111')
def search_all(self, value):
"""Search a value in the whole database"""
query = {'value': value, 'searchall': 1}
return self.__query('restSearch', query)
@deprecated(version='4.0.0', reason="You should use : are_cells_different")
def areCellsDifferent(self, _cell1, _cell2):
return self.are_cells_different(cell1=_cell1, cell2=_cell2)
def rename_kwargs(func_name, kwargs, aliases):
for alias, new in aliases.items():
if alias in kwargs:
if new in kwargs:
raise InvalidParamException(
'{} received both {} and {}'.format(func_name, alias, new))
# Manually invoke the deprecated decorator with an empty lambda
# to signal deprecation
deprecated(deprecated_in='1.1',
removed_in='2.0',
current_version=cloudbridge.__version__,
details='{} is deprecated, use {} instead'.format(
alias, new))(lambda: None)()
kwargs[new] = kwargs.pop(alias)
@deprecated(reason="Use ExpandedPyMISP.enable_taxonomy", version='2.4.110')
def enable_taxonomy(self, taxonomy_id):
"""Enable a taxonomy by id."""
url = urljoin(self.root_url, 'taxonomies/enable/{}'.format(taxonomy_id))
response = self._prepare_request('POST', url)
return self._check_response(response)
@deprecated(reason="Use ExpandedPyMISP.tags_statistics", version='2.4.110')
def get_tags_statistics(self, percentage=None, name_sort=None):
"""Get tags statistics from the MISP instance"""
if percentage is not None:
percentage = 'true'
else:
percentage = 'false'
if name_sort is not None:
name_sort = 'true'
else:
name_sort = 'false'
url = urljoin(self.root_url, 'tags/tagStatistics/{}/{}'.format(percentage, name_sort))
response = self._prepare_request('GET', url)
return self._check_response(response)
@deprecated(reason="This method has been deprecated, using solve_one_image instead")
def solve_a_image(self, img):
"""
this method must be implemented to solve a single image
img must be a numpy array
then return the detection or segmentation out
:param img:
:return:
"""
raise NotImplementedError('solve_a_image method must be implemented')
@deprecated("1.2.4", reason="Payment Method Supercash is no longer supported")
def create_supercash_coupon(self, base_coupon):
base_coupon.update({'go_id': self.gopay.config['goid']})
return self._api('supercash/coupon', JSON, base_coupon)
@deprecated(reason="Use ExpandedPyMISP.get_object")
def get_object(self, obj_id):
"""Get an object
:param obj_id: Object id to get
"""
url = urljoin(self.root_url, 'objects/view/{}'.format(obj_id))
response = self._prepare_request('GET', url)
return self._check_response(response)
@deprecated(reason="Use self.from_dict(**kwargs) instead. Removal date: 2020-01-01.")
def set_all_values(self, **kwargs): # pragma: no cover
self.from_dict(**kwargs)