Skip to content
This repository has been archived by the owner on Nov 22, 2022. It is now read-only.

Commit

Permalink
Fix variable annotation style
Browse files Browse the repository at this point in the history
  • Loading branch information
zero323 committed Aug 25, 2019
1 parent e3338f3 commit f17fb80
Show file tree
Hide file tree
Showing 47 changed files with 535 additions and 537 deletions.
10 changes: 5 additions & 5 deletions third_party/3/pyspark/accumulators.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import socketserver as SocketServer
from typing import Any

class Accumulator(Generic[T]):
aid = ... # type: int
accum_param = ... # type: AccumulatorParam[T]
aid: int
accum_param: AccumulatorParam[T]
def __init__(self, aid: int, value: T, accum_param: AccumulatorParam[T]) -> None: ...
def __reduce__(self) -> Tuple[Callable[[int, int, AccumulatorParam[T]], Accumulator[T]], Tuple[int, int, AccumulatorParam[T]]]: ...
@property
Expand All @@ -30,7 +30,7 @@ class AccumulatorParam(Generic[T]):
def addInPlace(self, value1: T, value2: T) -> T: ...

class AddingAccumulatorParam(AccumulatorParam[U]):
zero_value = ... # type: U
zero_value: U
def __init__(self, zero_value: U) -> None: ...
def zero(self, value: U) -> U: ...
def addInPlace(self, value1: U, value2: U) -> U: ...
Expand All @@ -39,7 +39,7 @@ class _UpdateRequestHandler(SocketServer.StreamRequestHandler):
def handle(self) -> None: ...

class AccumulatorServer(SocketServer.TCPServer):
auth_token = ... # type: str
auth_token: str
def __init__(self, server_address: Tuple[str, int], RequestHandlerClass: Type[socketserver.BaseRequestHandler], auth_token: str) -> None: ...
server_shutdown: bool = ...
server_shutdown: bool
def shutdown(self) -> None: ...
16 changes: 8 additions & 8 deletions third_party/3/pyspark/conf.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ from py4j.java_gateway import JVMView, JavaObject # type: ignore

class SparkConf:
def __init__(self, loadDefaults: bool = ..., _jvm: Optional[JVMView] = ..., _jconf: Optional[JavaObject] = ...) -> None: ...
def set(self, key: str, value: str) -> 'SparkConf': ...
def setIfMissing(self, key: str, value: str) -> 'SparkConf': ...
def setMaster(self, value: str) -> 'SparkConf': ...
def setAppName(self, value: str) -> 'SparkConf': ...
def setSparkHome(self, value: str) -> 'SparkConf': ...
def set(self, key: str, value: str) -> SparkConf: ...
def setIfMissing(self, key: str, value: str) -> SparkConf: ...
def setMaster(self, value: str) -> SparkConf: ...
def setAppName(self, value: str) -> SparkConf: ...
def setSparkHome(self, value: str) -> SparkConf: ...
@overload
def setExecutorEnv(self, key: str, value: str) -> 'SparkConf': ...
def setExecutorEnv(self, key: str, value: str) -> SparkConf: ...
@overload
def setExecutorEnv(self, *, pairs: List[Tuple[str, str]]) -> 'SparkConf': ...
def setAll(self, pairs: List[Tuple[str, str]]) -> 'SparkConf': ...
def setExecutorEnv(self, *, pairs: List[Tuple[str, str]]) -> SparkConf: ...
def setAll(self, pairs: List[Tuple[str, str]]) -> SparkConf: ...
def get(self, key: str, defaultValue: Optional[str] = ...) -> str: ...
def getAll(self) -> List[Tuple[str, str]]: ...
def contains(self, key: str) -> bool: ...
Expand Down
4 changes: 2 additions & 2 deletions third_party/3/pyspark/context.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ T = TypeVar('T')
U = TypeVar('U')

class SparkContext:
PACKAGE_EXTENSIONS = ... # type: Iterable[str]
PACKAGE_EXTENSIONS: Iterable[str]
def __init__(self, master: Optional[str] = ..., appName: Optional[str] = ..., sparkHome: Optional[str] = ..., pyFiles: Optional[List[str]] = ..., environment: Optional[Dict[str, str]] = ..., batchSize: int = ..., serializer: Serializer = ..., conf: Optional[SparkConf] = ..., gateway: Optional[JavaGateway] = ..., jsc: Optional[JavaObject] = ..., profiler_cls: type = ...) -> None: ...
def __getnewargs__(self): ...
def __enter__(self): ...
def __exit__(self, type, value, trace): ...
@classmethod
def getOrCreate(cls, conf: Optional[SparkConf] = ...) -> 'SparkContext': ...
def getOrCreate(cls, conf: Optional[SparkConf] = ...) -> SparkContext: ...
def setLogLevel(self, logLevel: str) -> None: ...
@classmethod
def setSystemProperty(cls, key: str, value: str) -> None: ...
Expand Down
12 changes: 6 additions & 6 deletions third_party/3/pyspark/ml/base.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,29 @@ M = TypeVar("M", bound=Transformer)
ParamMap = Dict[Param, Any]

class _FitMultipleIterator:
fitSingleModel = ... # type: Callable[[int], Transformer]
numModel = ... # type: int
fitSingleModel: Callable[[int], Transformer]
numModel: int
counter: int = ...
lock = ... # type: _thread.LockType
lock: _thread.LockType
def __init__(self, fitSingleModel: Callable[[int], Transformer], numModels: int) -> None: ...
def __iter__(self) -> _FitMultipleIterator: ...
def __next__(self) -> Tuple[int, Transformer]: ...
def next(self) -> Tuple[int, Transformer]: ...

class Estimator(Params, Generic[M]):
__metaclass__ = ... # type: Type[abc.ABCMeta]
__metaclass__: Type[abc.ABCMeta]
@overload
def fit(self, dataset: DataFrame, params: Optional[ParamMap] = ...) -> M: ...
@overload
def fit(self, dataset: DataFrame, params: List[ParamMap]) -> List[M]: ...
def fitMultiple(self, dataset: DataFrame, params: List[ParamMap]) -> Iterable[Tuple[int, M]]: ...

class Transformer(Params):
__metaclass__ = ... # type: Type[abc.ABCMeta]
__metaclass__: Type[abc.ABCMeta]
def transform(self, dataset: DataFrame, params: Optional[ParamMap] = ...) -> DataFrame: ...

class Model(Transformer):
__metaclass__ = ... # type: Type[abc.ABCMeta]
__metaclass__: Type[abc.ABCMeta]

class UnaryTransformer(HasInputCol, HasOutputCol, Transformer):
def createTransformFunc(self) -> Callable: ...
Expand Down
72 changes: 36 additions & 36 deletions third_party/3/pyspark/ml/classification.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class JavaClassificationModel(JavaPredictionModel):

class LinearSVC(JavaEstimator[LinearSVCModel], HasFeaturesCol, HasLabelCol, HasPredictionCol, HasMaxIter, HasRegParam, HasTol, HasRawPredictionCol, HasFitIntercept, HasStandardization, HasThreshold, HasWeightCol, HasAggregationDepth, JavaMLWritable, JavaMLReadable):
def __init__(self, featuresCol: str = ..., labelCol: str = ..., predictionCol: str = ..., maxIter: int = ..., regParam: float = ..., tol: float = ..., rawPredictionCol: str = ..., fitIntercept: bool = ..., standardization: bool = ..., threshold: float = ..., weightCol: Optional[str] = ..., aggregationDepth: int = ...) -> None: ...
def setParams(self, featuresCol: str = ..., labelCol: str = ..., predictionCol: str = ..., maxIter: int = ..., regParam: float = ..., tol: float = ..., rawPredictionCol: str = ..., fitIntercept: bool = ..., standardization: bool = ..., threshold: float = ..., weightCol: Optional[str] = ..., aggregationDepth: int = ...) -> 'LinearSVC': ...
def setParams(self, featuresCol: str = ..., labelCol: str = ..., predictionCol: str = ..., maxIter: int = ..., regParam: float = ..., tol: float = ..., rawPredictionCol: str = ..., fitIntercept: bool = ..., standardization: bool = ..., threshold: float = ..., weightCol: Optional[str] = ..., aggregationDepth: int = ...) -> LinearSVC: ...

class LinearSVCModel(JavaModel, JavaClassificationModel, JavaMLWritable, JavaMLReadable):
@property
Expand All @@ -31,27 +31,27 @@ class LinearSVCModel(JavaModel, JavaClassificationModel, JavaMLWritable, JavaMLR
def intercept(self) -> float: ...

class LogisticRegression(JavaEstimator[LogisticRegressionModel], HasFeaturesCol, HasLabelCol, HasPredictionCol, HasMaxIter, HasRegParam, HasTol, HasProbabilityCol, HasRawPredictionCol, HasElasticNetParam, HasFitIntercept, HasStandardization, HasThresholds, HasWeightCol, HasAggregationDepth, JavaMLWritable, JavaMLReadable):
threshold = ... # type: Param
family = ... # type: Param
lowerBoundsOnCoefficients = ... # type: Param
upperBoundsOnCoefficients = ... # type: Param
lowerBoundsOnIntercepts = ... # type: Param
upperBoundsOnIntercepts = ... # type: Param
threshold: Param
family: Param
lowerBoundsOnCoefficients: Param
upperBoundsOnCoefficients: Param
lowerBoundsOnIntercepts: Param
upperBoundsOnIntercepts: Param
def __init__(self, featuresCol: str = ..., labelCol: str = ..., predictionCol: str = ..., maxIter: int = ..., regParam: float = ..., elasticNetParam: float = ..., tol: float = ..., fitIntercept: bool = ..., threshold: float = ..., thresholds: Optional[List[float]] = ..., probabilityCol: str = ..., rawPredictionCol: str = ..., standardization: bool = ..., weightCol: Optional[str] = ..., aggregationDepth: int = ..., family: str = ..., lowerBoundsOnCoefficients: Optional[Matrix] = ..., upperBoundsOnCoefficients: Optional[Matrix] = ..., lowerBoundsOnIntercepts: Optional[Vector] = ..., upperBoundsOnIntercepts: Optional[Vector] = ...) -> None: ...
def setParams(self, featuresCol: str = ..., labelCol: str = ..., predictionCol: str = ..., maxIter: int = ..., regParam: float = ..., elasticNetParam: float = ..., tol: float = ..., fitIntercept: bool = ..., threshold: float = ..., thresholds: Optional[List[float]] = ..., probabilityCol: str = ..., rawPredictionCol: str = ..., standardization: bool = ..., weightCol: Optional[str] = ..., aggregationDepth: int = ..., family: str = ..., lowerBoundsOnCoefficients: Optional[Matrix] = ..., upperBoundsOnCoefficients: Optional[Matrix] = ..., lowerBoundsOnIntercepts: Optional[Vector] = ..., upperBoundsOnIntercepts: Optional[Vector] = ...) -> 'LogisticRegression': ...
def setThreshold(self, value: float) -> 'LogisticRegression': ...
def setParams(self, featuresCol: str = ..., labelCol: str = ..., predictionCol: str = ..., maxIter: int = ..., regParam: float = ..., elasticNetParam: float = ..., tol: float = ..., fitIntercept: bool = ..., threshold: float = ..., thresholds: Optional[List[float]] = ..., probabilityCol: str = ..., rawPredictionCol: str = ..., standardization: bool = ..., weightCol: Optional[str] = ..., aggregationDepth: int = ..., family: str = ..., lowerBoundsOnCoefficients: Optional[Matrix] = ..., upperBoundsOnCoefficients: Optional[Matrix] = ..., lowerBoundsOnIntercepts: Optional[Vector] = ..., upperBoundsOnIntercepts: Optional[Vector] = ...) -> LogisticRegression: ...
def setThreshold(self, value: float) -> LogisticRegression: ...
def getThreshold(self) -> float: ...
def setThresholds(self, value: List[float]) -> 'LogisticRegression': ...
def setThresholds(self, value: List[float]) -> LogisticRegression: ...
def getThresholds(self) -> List[float]: ...
def setFamily(self, value: str) -> 'LogisticRegression': ...
def setFamily(self, value: str) -> LogisticRegression: ...
def getFamily(self) -> str: ...
def setLowerBoundsOnCoefficients(self, value: Matrix) -> 'LogisticRegression': ...
def setLowerBoundsOnCoefficients(self, value: Matrix) -> LogisticRegression: ...
def getLowerBoundsOnCoefficients(self) -> Matrix : ...
def setUpperBoundsOnCoefficients(self, value: Matrix) -> 'LogisticRegression': ...
def setUpperBoundsOnCoefficients(self, value: Matrix) -> LogisticRegression: ...
def getUpperBoundsOnCoefficients(self) -> Matrix: ...
def setLowerBoundsOnIntercepts(self, value: Vector) -> 'LogisticRegression': ...
def setLowerBoundsOnIntercepts(self, value: Vector) -> LogisticRegression: ...
def getLowerBoundsOnIntercepts(self) -> Vector: ...
def setUpperBoundsOnIntercepts(self, value: Vector) -> 'LogisticRegression': ...
def setUpperBoundsOnIntercepts(self, value: Vector) -> LogisticRegression: ...
def getUpperBoundsOnIntercepts(self) -> Vector: ...

class LogisticRegressionModel(JavaModel, JavaClassificationModel, JavaMLWritable, JavaMLReadable, HasTrainingSummary):
Expand Down Expand Up @@ -126,8 +126,8 @@ class BinaryLogisticRegressionSummary(LogisticRegressionSummary):
class BinaryLogisticRegressionTrainingSummary(BinaryLogisticRegressionSummary, LogisticRegressionTrainingSummary): ...

class TreeClassifierParams:
supportedImpurities = ... # type: List[str]
impurity = ... # type: Param
supportedImpurities: List[str]
impurity: Param
def __init__(self) -> None: ...
def getImpurity(self) -> str: ...

Expand Down Expand Up @@ -167,8 +167,8 @@ class RandomForestClassificationModel(TreeEnsembleModel, JavaClassificationModel
def trees(self) -> List[DecisionTreeClassificationModel]: ...

class GBTClassifierParams(GBTParams, HasVarianceImpurity):
supportedLossTypes = ... # type: List[str]
lossType = ... # type: Param
supportedLossTypes: List[str]
lossType: Param
def getLossType(self) -> str: ...

class GBTClassifier(JavaEstimator, HasFeaturesCol, HasLabelCol, HasPredictionCol, GBTClassifierParams, HasCheckpointInterval, HasSeed, JavaMLWritable, JavaMLReadable):
Expand All @@ -194,13 +194,13 @@ class GBTClassificationModel(TreeEnsembleModel, JavaClassificationModel, JavaMLW
def evaluateEachIteration(self, dataset: DataFrame) -> List[float]: ...

class NaiveBayes(JavaEstimator[NaiveBayesModel], HasFeaturesCol, HasLabelCol, HasPredictionCol, HasProbabilityCol, HasRawPredictionCol, HasThresholds, HasWeightCol, JavaMLWritable, JavaMLReadable):
smoothing = ... # type: Param
modelType = ... # type: Param
smoothing: Param
modelType: Param
def __init__(self, featuresCol: str = ..., labelCol: str = ..., predictionCol: str = ..., probabilityCol: str = ..., rawPredictionCol: str = ..., smoothing: float = ..., modelType: str = ..., thresholds: Optional[List[float]] = ..., weightCol: Optional[str] = ...) -> None: ...
def setParams(self, featuresCol: str = ..., labelCol: str = ..., predictionCol: str = ..., probabilityCol: str = ..., rawPredictionCol: str = ..., smoothing: float = ..., modelType: str = ..., thresholds: Optional[List[float]] = ..., weightCol: Optional[str] = ...) -> 'NaiveBayes': ...
def setSmoothing(self, value: float) -> 'NaiveBayes': ...
def setParams(self, featuresCol: str = ..., labelCol: str = ..., predictionCol: str = ..., probabilityCol: str = ..., rawPredictionCol: str = ..., smoothing: float = ..., modelType: str = ..., thresholds: Optional[List[float]] = ..., weightCol: Optional[str] = ...) -> NaiveBayes: ...
def setSmoothing(self, value: float) -> NaiveBayes: ...
def getSmoothing(self) -> float: ...
def setModelType(self, value: str) -> 'NaiveBayes': ...
def setModelType(self, value: str) -> NaiveBayes: ...
def getModelType(self) -> str: ...

class NaiveBayesModel(JavaModel, JavaClassificationModel, JavaMLWritable, JavaMLReadable):
Expand All @@ -210,19 +210,19 @@ class NaiveBayesModel(JavaModel, JavaClassificationModel, JavaMLWritable, JavaML
def theta(self) -> Matrix: ...

class MultilayerPerceptronClassifier(JavaEstimator[MultilayerPerceptronClassificationModel], HasFeaturesCol, HasLabelCol, HasPredictionCol, HasMaxIter, HasTol, HasSeed, HasStepSize, HasSolver, JavaMLWritable, JavaMLReadable, HasProbabilityCol, HasRawPredictionCol):
layers = ... # type: Param
blockSize = ... # type: Param
solver = ... # type: Param
initialWeights = ... # type: Param
layers: Param
blockSize: Param
solver: Param
initialWeights: Param
def __init__(self, featuresCol: str = ..., labelCol: str = ..., predictionCol: str = ..., maxIter: int = ..., tol: float = ..., seed: Optional[int] = ..., layers: Optional[List[int]] = ..., blockSize: int = ..., stepSize: float = ..., solver: str = ..., initialWeights: Optional[Vector] = ..., probabilityCol: str = ..., rawPredictionCol: str = ...) -> None: ...
def setParams(self, featuresCol: str = ..., labelCol: str = ..., predictionCol: str = ..., maxIter: int = ..., tol: float = ..., seed: Optional[int] = ..., layers: Optional[List[int]] = ..., blockSize: int = ..., stepSize: float = ..., solver: str = ..., initialWeights: Optional[Vector] = ..., probabilityCol: str = ..., rawPredictionCol: str = ...) -> 'MultilayerPerceptronClassifier': ...
def setLayers(self, value: List[int]) -> 'MultilayerPerceptronClassifier': ...
def setParams(self, featuresCol: str = ..., labelCol: str = ..., predictionCol: str = ..., maxIter: int = ..., tol: float = ..., seed: Optional[int] = ..., layers: Optional[List[int]] = ..., blockSize: int = ..., stepSize: float = ..., solver: str = ..., initialWeights: Optional[Vector] = ..., probabilityCol: str = ..., rawPredictionCol: str = ...) -> MultilayerPerceptronClassifier: ...
def setLayers(self, value: List[int]) -> MultilayerPerceptronClassifier: ...
def getLayers(self) -> List[int]: ...
def setBlockSize(self, value: int) -> 'MultilayerPerceptronClassifier': ...
def setBlockSize(self, value: int) -> MultilayerPerceptronClassifier: ...
def getBlockSize(self) -> int: ...
def setStepSize(self, value: float) -> 'MultilayerPerceptronClassifier': ...
def setStepSize(self, value: float) -> MultilayerPerceptronClassifier: ...
def getStepSize(self) -> float: ...
def setInitialWeights(self, value: Vector) -> 'MultilayerPerceptronClassifier': ...
def setInitialWeights(self, value: Vector) -> MultilayerPerceptronClassifier: ...
def getInitialWeights(self) -> Vector: ...

class MultilayerPerceptronClassificationModel(JavaModel, JavaClassificationModel, JavaMLWritable, JavaMLReadable):
Expand All @@ -232,7 +232,7 @@ class MultilayerPerceptronClassificationModel(JavaModel, JavaClassificationModel
def weights(self) -> Vector: ...

class OneVsRestParams(HasFeaturesCol, HasLabelCol, HasWeightCol, HasPredictionCol, HasRawPredictionCol):
classifier = ... # type: Param
classifier: Param
def setClassifier(self, value: Estimator[M]) -> OneVsRestParams: ...
def getClassifier(self) -> Estimator[M]: ...

Expand All @@ -242,6 +242,6 @@ class OneVsRest(Estimator[OneVsRestModel], OneVsRestParams, HasParallelism, Java
def copy(self, extra: Optional[ParamMap] = ...) -> OneVsRest: ...

class OneVsRestModel(Model, OneVsRestParams, JavaMLReadable, JavaMLWritable):
models = ... # type: List[Transformer]
models: List[Transformer]
def __init__(self, models: List[Transformer]) -> None: ...
def copy(self, extra: Optional[ParamMap] = ...) -> 'OneVsRestModel': ...
def copy(self, extra: Optional[ParamMap] = ...) -> OneVsRestModel: ...
Loading

0 comments on commit f17fb80

Please sign in to comment.