Browse Source

chore: apply F811 linter rule to eliminate redefined imports and methods (#2412)

tags/0.5.5
Bowen Liang 1 year ago
parent
commit
65a02f7d32
No account linked to committer's email address

+ 0
- 1
api/controllers/service_api/dataset/document.py View File

import json import json


from flask import request from flask import request
from flask_login import current_user
from flask_restful import marshal, reqparse from flask_restful import marshal, reqparse
from sqlalchemy import desc from sqlalchemy import desc
from werkzeug.exceptions import NotFound from werkzeug.exceptions import NotFound

+ 0
- 1
api/core/model_runtime/model_providers/spark/llm/_client.py View File

import base64 import base64
import datetime
import hashlib import hashlib
import hmac import hmac
import json import json

+ 0
- 1
api/core/third_party/spark/spark_llm.py View File

import base64 import base64
import datetime
import hashlib import hashlib
import hmac import hmac
import json import json

+ 0
- 38
api/libs/gmpy2_pkcs10aep_cipher.py View File

if randfunc is None: if randfunc is None:
randfunc = Random.get_random_bytes randfunc = Random.get_random_bytes
return PKCS1OAEP_Cipher(key, hashAlgo, mgfunc, label, randfunc) return PKCS1OAEP_Cipher(key, hashAlgo, mgfunc, label, randfunc)


def new(key, hashAlgo=None, mgfunc=None, label=b'', randfunc=None):
"""Return a cipher object :class:`PKCS1OAEP_Cipher` that can be used to perform PKCS#1 OAEP encryption or decryption.

:param key:
The key object to use to encrypt or decrypt the message.
Decryption is only possible with a private RSA key.
:type key: RSA key object

:param hashAlgo:
The hash function to use. This can be a module under `Crypto.Hash`
or an existing hash object created from any of such modules.
If not specified, `Crypto.Hash.SHA1` is used.
:type hashAlgo: hash object

:param mgfunc:
A mask generation function that accepts two parameters: a string to
use as seed, and the lenth of the mask to generate, in bytes.
If not specified, the standard MGF1 consistent with ``hashAlgo`` is used (a safe choice).
:type mgfunc: callable

:param label:
A label to apply to this particular encryption. If not specified,
an empty string is used. Specifying a label does not improve
security.
:type label: bytes/bytearray/memoryview

:param randfunc:
A function that returns random bytes.
The default is `Random.get_random_bytes`.
:type randfunc: callable
"""

if randfunc is None:
randfunc = Random.get_random_bytes
return PKCS1OAEP_Cipher(key, hashAlgo, mgfunc, label, randfunc)


+ 1
- 0
api/pyproject.toml View File

"F401", # unused-import "F401", # unused-import
"I001", # unsorted-imports "I001", # unsorted-imports
"I002", # missing-required-import "I002", # missing-required-import
"F811", # redefined-while-unused
] ]

Loading…
Cancel
Save