Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[hma/pytx] Black format everything #1740

Merged
merged 1 commit into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
A production-ish OMM config, for the curator role.

The curator role only gets internal traffic, and so you can probably
get away with a single instance for a long time.
get away with a single instance for a long time.
"""

import os
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
You only need a hasher role if you are not doing hashing on the instances
of your service that are handling the content uploads, which can save on
transmission costs at the expense of CPU cost on your frontend.
transmission costs at the expense of CPU cost on your frontend.
A common pattern is to use a queue external to OMM to build up items to be
hashed and checked, in which case a hasher role might be your largest tier,
since converting large content like videos can take a significant amount of
since converting large content like videos can take a significant amount of
CPU.
"""

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""empty message

Revision ID: 21cb8a3df884
Revises:
Revises:
Create Date: 2024-03-13 17:54:36.675199

"""
Expand Down
2 changes: 1 addition & 1 deletion hasher-matcher-actioner/src/OpenMediaMatch/persistence.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
think future deployers may change their mind about which backends to
use. We know we are going to have more than relational data, so
SQLAlchemy isn't going to be enough. Thus an even more abstract
accessor.
accessor.
"""

import typing as t
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
Abstraction layer for fetching information needed to run OMM.

To try and separate concerns for extension, this file provides
access to all the persistent data needed to run OMM. In the
default implementation, we have a unified implementation that
access to all the persistent data needed to run OMM. In the
default implementation, we have a unified implementation that
implements all interfaces, but different implementations may
prefer to store different data in different places.

For implementations, see storage.mocked.MockedStore, which provides
plausable defaults for all of these interfaces, useful for testing,
or storage.default.DefaultOMMStore, which uses a combination of
static configuration and postgres.
static configuration and postgres.
"""

import abc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"""
Helpers for fetch benchmarking and testing.

In the long term, these are generic enough that should probably live in
python-threatexchange, but for short-term needs we're just working on them
In the long term, these are generic enough that should probably live in
python-threatexchange, but for short-term needs we're just working on them
here.
"""
from dataclasses import dataclass, field, replace
Expand Down
2 changes: 1 addition & 1 deletion python-threatexchange/threatexchange/cli/cli_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""
Local storage and configuration for the CLI.

The CLI and Hasher-Matcher-Actioner are roughly parallel, but this isn't a
The CLI and Hasher-Matcher-Actioner are roughly parallel, but this isn't a
scalable service running on AWS. Instead, we have all of our state in
a file (likely ~/.threatexchange)
"""
Expand Down
2 changes: 1 addition & 1 deletion python-threatexchange/threatexchange/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
3. Match data
$ threatexchange match photo my_photo.jpg
4. Contribute labels to external APIs
$ threatexchange label photo my_photo.jpg dog
$ threatexchange label photo my_photo.jpg dog
$ threatexchange label photo my_photo.jpg --false-positive

Additionally, there are a number of utility commands:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@

Most of the individual components of pytx are find to use piecemeal, and
the full interface covers the most complex and complete useage. A usecase
with one collection of hashes using one algorithm might be better off
with one collection of hashes using one algorithm might be better off
hardcoding those things rather than fully implementing the interface.

# Migration Notes
There's an earlier attempt at these interfaces used for CLI at
<@Mackay-Fisher add the right pointer to the CLI storage>.
During the development of Hasher-Matcher-Actioner 2.0
During the development of Hasher-Matcher-Actioner 2.0
(github.com/facebook/ThreatExchange/tree/main/hasher-matcher-actioner/)
we realized that the original attempt at this wouldn't meet the needs
of that code and wrote a new interface.
of that code and wrote a new interface.

As of 12/2024, we are now migrating that interface from HMA into pytx
proper as part of a migration to dbm
proper as part of a migration to dbm
(github.com/facebook/ThreatExchange/issues/1687). The general approach is:
1. Copy the interface unchanged from HMA to pytx
2. Release a new version of pytx
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""
Simple implementation for the NCMEC hash sharing XML API

You can find the complete documentation at
You can find the complete documentation at
https://report.cybertip.org/hashsharing/v2/documentation.pdf
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""
Helpers for implementing SignalExchangeAPIs or state.

They demonstrate how the methods in SignalExchangeAPI can be used to
They demonstrate how the methods in SignalExchangeAPI can be used to
reproduce databases of signals, as well as simple recipes for stage.
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""
A solution that allows loading signals directly from a file.

This is useful if you don't have access to an API, but still have a list of
This is useful if you don't have access to an API, but still have a list of
hashes from somewhere.
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

In the test cases, the class descriptions will be used for context, so
include:
1. The last version it was available
1. The last version it was available
2. The change

i.e.
Expand All @@ -24,7 +24,7 @@ class SignalOpinionOwnerRemoved:
'''
owner: int
category: SignalOpinionCategory
tags: t.Set[str]
tags: t.Set[str]
"""

import copy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def OLD_json_to_vpdq(json_str: str) -> t.List[vpdq.VpdqFeature]:


def OLD_read_file_to_hash(
input_hash_filename: t.Union[str, pathlib.Path]
input_hash_filename: t.Union[str, pathlib.Path],
) -> t.List[VpdqCompactFeature]:
"""Read hash file and return list of VPDQ features

Expand Down