id int64 0 328k | repository_name stringlengths 7 58 | file_path stringlengths 9 302 | class_name stringlengths 5 256 | human_written_code stringlengths 16 2.16M | class_skeleton stringlengths 18 1.49M ⌀ | total_program_units int64 1 1.76k | total_doc_str int64 0 771 | AvgCountLine float64 0 7.89k | AvgCountLineBlank float64 0 297 | AvgCountLineCode float64 0 7.89k | AvgCountLineComment float64 0 7.89k | AvgCyclomatic float64 0 130 | CommentToCodeRatio float64 0 168 | CountClassBase float64 0 40 | CountClassCoupled float64 0 583 | CountClassCoupledModified float64 0 575 | CountClassDerived float64 0 5.35k | CountDeclInstanceMethod float64 0 529 | CountDeclInstanceVariable float64 0 296 | CountDeclMethod float64 0 599 | CountDeclMethodAll float64 0 1.12k | CountLine float64 1 40.4k | CountLineBlank float64 0 8.16k | CountLineCode float64 1 25.7k | CountLineCodeDecl float64 1 8.15k | CountLineCodeExe float64 0 24.2k | CountLineComment float64 0 16.5k | CountStmt float64 1 9.71k | CountStmtDecl float64 1 8.15k | CountStmtExe float64 0 9.69k | MaxCyclomatic float64 0 759 | MaxInheritanceTree float64 0 16 | MaxNesting float64 0 34 | SumCyclomatic float64 0 2.9k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6,700 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/utils/notebook.py | transformers.utils.notebook.NotebookTrainingTracker | import IPython.display as disp
class NotebookTrainingTracker(NotebookProgressBar):
"""
An object tracking the updates of an ongoing training with progress bars and a nice table reporting metrics.
Args:
num_steps (`int`): The number of steps during training. column_names (`list[str]`, *optional*):
... |
class NotebookTrainingTracker(NotebookProgressBar):
'''
An object tracking the updates of an ongoing training with progress bars and a nice table reporting metrics.
Args:
num_steps (`int`): The number of steps during training. column_names (`list[str]`, *optional*):
The list of column n... | 6 | 4 | 12 | 0 | 8 | 4 | 3 | 0.58 | 1 | 2 | 0 | 0 | 5 | 4 | 5 | 10 | 76 | 8 | 43 | 15 | 37 | 25 | 39 | 15 | 33 | 9 | 1 | 5 | 17 |
6,701 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/utils/quantization_config.py | transformers.utils.quantization_config.AWQLinearVersion | from enum import Enum
from packaging import version
class AWQLinearVersion(str, Enum):
GEMM = 'gemm'
GEMV = 'gemv'
EXLLAMA = 'exllama'
IPEX = 'ipex'
@staticmethod
def from_str(version: str):
version = version.lower()
if version == 'gemm':
return AWQLinearVersion.GEM... |
class AWQLinearVersion(str, Enum):
@staticmethod
def from_str(version: str):
pass | 3 | 0 | 12 | 0 | 12 | 0 | 5 | 0 | 2 | 1 | 0 | 0 | 0 | 0 | 1 | 116 | 19 | 1 | 18 | 7 | 15 | 0 | 13 | 6 | 11 | 5 | 4 | 1 | 5 |
6,702 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/utils/quantization_config.py | transformers.utils.quantization_config.AqlmConfig | from dataclasses import dataclass, is_dataclass
from typing import Any, Optional, Union
@dataclass
class AqlmConfig(QuantizationConfigMixin):
"""
This is a wrapper class about `aqlm` parameters.
Args:
in_group_size (`int`, *optional*, defaults to 8):
The group size along the input dime... | @dataclass
class AqlmConfig(QuantizationConfigMixin):
'''
This is a wrapper class about `aqlm` parameters.
Args:
in_group_size (`int`, *optional*, defaults to 8):
The group size along the input dimension.
out_group_size (`int`, *optional*, defaults to 1):
The group si... | 4 | 2 | 19 | 2 | 16 | 2 | 4 | 0.59 | 1 | 6 | 1 | 0 | 2 | 6 | 2 | 9 | 57 | 6 | 32 | 17 | 21 | 19 | 22 | 9 | 19 | 7 | 1 | 1 | 8 |
6,703 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/utils/quantization_config.py | transformers.utils.quantization_config.AwqBackendPackingMethod | from enum import Enum
class AwqBackendPackingMethod(str, Enum):
AUTOAWQ = 'autoawq'
LLMAWQ = 'llm-awq' |
class AwqBackendPackingMethod(str, Enum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 115 | 3 | 0 | 3 | 3 | 2 | 0 | 3 | 3 | 2 | 0 | 4 | 0 | 0 |
6,704 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/utils/quantization_config.py | transformers.utils.quantization_config.AwqConfig | import importlib.metadata
import copy
from ..utils import is_auto_awq_available, is_compressed_tensors_available, is_gptqmodel_available, is_hqq_available, is_quark_available, is_torch_available, is_torchao_available, logging
from typing import Any, Optional, Union
from packaging import version
from dataclasses import ... | @dataclass
class AwqConfig(QuantizationConfigMixin):
'''
This is a wrapper class about all possible attributes and features that you can play with a model that has been
loaded using `auto-awq` library awq quantization relying on auto_awq backend.
Args:
bits (`int`, *optional*, defaults to 4):
... | 5 | 2 | 45 | 5 | 39 | 1 | 8 | 0.29 | 1 | 9 | 4 | 0 | 3 | 11 | 3 | 10 | 170 | 18 | 118 | 39 | 101 | 34 | 66 | 26 | 62 | 20 | 1 | 3 | 23 |
6,705 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/utils/quantization_config.py | transformers.utils.quantization_config.BitsAndBytesConfig | import importlib.metadata
from packaging import version
import copy
from dataclasses import dataclass, is_dataclass
from typing import Any, Optional, Union
import json
@dataclass
class BitsAndBytesConfig(QuantizationConfigMixin):
"""
This is a wrapper class about all possible attributes and features that you c... | @dataclass
class BitsAndBytesConfig(QuantizationConfigMixin):
'''
This is a wrapper class about all possible attributes and features that you can play with a model that has been
loaded using `bitsandbytes`.
This replaces `load_in_8bit` or `load_in_4bit`therefore both options are mutually exclusive.
... | 17 | 6 | 15 | 2 | 11 | 2 | 4 | 0.56 | 1 | 8 | 1 | 0 | 11 | 11 | 11 | 18 | 228 | 36 | 123 | 46 | 94 | 69 | 91 | 29 | 79 | 11 | 1 | 2 | 39 |
6,706 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/utils/quantization_config.py | transformers.utils.quantization_config.CompressedTensorsConfig | from ..utils import is_auto_awq_available, is_compressed_tensors_available, is_gptqmodel_available, is_hqq_available, is_quark_available, is_torch_available, is_torchao_available, logging
from typing import Any, Optional, Union
class CompressedTensorsConfig(QuantizationConfigMixin):
"""
This is a wrapper class... |
class CompressedTensorsConfig(QuantizationConfigMixin):
'''
This is a wrapper class that handles compressed-tensors quantization config options.
It is a wrapper around `compressed_tensors.QuantizationConfig`
Args:
config_groups (`typing.dict[str, typing.Union[ForwardRef('QuantizationScheme'), t... | 14 | 4 | 22 | 3 | 13 | 6 | 2 | 0.82 | 1 | 7 | 1 | 0 | 4 | 3 | 5 | 12 | 141 | 22 | 67 | 29 | 46 | 55 | 35 | 16 | 27 | 3 | 1 | 2 | 12 |
6,707 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/utils/quantization_config.py | transformers.utils.quantization_config.EetqConfig | from dataclasses import dataclass, is_dataclass
from typing import Any, Optional, Union
@dataclass
class EetqConfig(QuantizationConfigMixin):
"""
This is a wrapper class about all possible attributes and features that you can play with a model that has been
loaded using `eetq`.
Args:
weights (... | @dataclass
class EetqConfig(QuantizationConfigMixin):
'''
This is a wrapper class about all possible attributes and features that you can play with a model that has been
loaded using `eetq`.
Args:
weights (`str`, *optional*, defaults to `"int8"`):
The target dtype for the weights. Su... | 4 | 2 | 9 | 0 | 7 | 2 | 2 | 0.87 | 1 | 3 | 1 | 0 | 2 | 3 | 2 | 9 | 31 | 3 | 15 | 12 | 7 | 13 | 10 | 7 | 7 | 2 | 1 | 1 | 3 |
6,708 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/utils/quantization_config.py | transformers.utils.quantization_config.ExllamaVersion | from enum import Enum
class ExllamaVersion(int, Enum):
ONE = 1
TWO = 2 |
class ExllamaVersion(int, Enum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 104 | 3 | 0 | 3 | 3 | 2 | 0 | 3 | 3 | 2 | 0 | 4 | 0 | 0 |
6,709 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/utils/quantization_config.py | transformers.utils.quantization_config.FbgemmFp8Config | from dataclasses import dataclass, is_dataclass
import copy
from typing import Any, Optional, Union
@dataclass
class FbgemmFp8Config(QuantizationConfigMixin):
"""
This is a wrapper class about all possible attributes and features that you can play with a model that has been
loaded using fbgemm fp8 quantiza... | @dataclass
class FbgemmFp8Config(QuantizationConfigMixin):
'''
This is a wrapper class about all possible attributes and features that you can play with a model that has been
loaded using fbgemm fp8 quantization.
Args:
activation_scale_ub (`float`, *optional*, defaults to 1200.0):
Th... | 4 | 1 | 7 | 0 | 7 | 0 | 1 | 0.67 | 1 | 2 | 1 | 0 | 2 | 3 | 2 | 9 | 28 | 3 | 15 | 14 | 7 | 10 | 10 | 9 | 7 | 1 | 1 | 0 | 2 |
6,710 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/utils/quantization_config.py | transformers.utils.quantization_config.GPTQConfig | import copy
from typing import Any, Optional, Union
from .import_utils import is_auto_gptq_available
import importlib.metadata
from dataclasses import dataclass, is_dataclass
from packaging import version
from ..utils import is_auto_awq_available, is_compressed_tensors_available, is_gptqmodel_available, is_hqq_availabl... | @dataclass
class GPTQConfig(QuantizationConfigMixin):
'''
This is a wrapper class about all possible attributes and features that you can play with a model that has been
loaded using `optimum` api for gptq quantization relying on auto_gptq backend.
Args:
bits (`int`):
The number of b... | 9 | 4 | 29 | 1 | 25 | 3 | 6 | 0.56 | 1 | 10 | 2 | 0 | 5 | 24 | 6 | 13 | 247 | 13 | 150 | 66 | 117 | 84 | 89 | 40 | 82 | 26 | 1 | 4 | 33 |
6,711 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/utils/quantization_config.py | transformers.utils.quantization_config.HiggsConfig | from dataclasses import dataclass, is_dataclass
from typing import Any, Optional, Union
@dataclass
class HiggsConfig(QuantizationConfigMixin):
"""
HiggsConfig is a configuration class for quantization using the HIGGS method.
Args:
bits (int, *optional*, defaults to 4):
Number of bits t... | @dataclass
class HiggsConfig(QuantizationConfigMixin):
'''
HiggsConfig is a configuration class for quantization using the HIGGS method.
Args:
bits (int, *optional*, defaults to 4):
Number of bits to use for quantization. Can be 2, 3 or 4. Default is 4.
p (int, *optional*, defaul... | 4 | 2 | 16 | 1 | 14 | 2 | 4 | 0.61 | 1 | 4 | 1 | 0 | 2 | 6 | 2 | 9 | 49 | 4 | 28 | 17 | 17 | 17 | 20 | 9 | 17 | 5 | 1 | 1 | 7 |
6,712 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/utils/quantization_config.py | transformers.utils.quantization_config.HqqConfig | from dataclasses import dataclass, is_dataclass
import json
from ..utils import is_auto_awq_available, is_compressed_tensors_available, is_gptqmodel_available, is_hqq_available, is_quark_available, is_torch_available, is_torchao_available, logging
from typing import Any, Optional, Union
@dataclass
class HqqConfig(Quan... | @dataclass
class HqqConfig(QuantizationConfigMixin):
'''
This is wrapper around hqq's BaseQuantizeConfig.
Args:
nbits (`int`, *optional*, defaults to 4):
Number of bits. Supported values are (8, 4, 3, 2, 1).
group_size (`int`, *optional*, defaults to 64):
Group-size v... | 9 | 5 | 16 | 2 | 11 | 3 | 3 | 0.54 | 1 | 8 | 1 | 0 | 5 | 3 | 6 | 13 | 122 | 17 | 68 | 29 | 50 | 37 | 41 | 19 | 33 | 8 | 1 | 2 | 15 |
6,713 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/utils/quantization_config.py | transformers.utils.quantization_config.QuantizationConfigMixin | import copy
from dataclasses import dataclass, is_dataclass
import os
from typing import Any, Optional, Union
import json
@dataclass
class QuantizationConfigMixin:
"""
Mixin class for quantization config
"""
quant_method: QuantizationMethod
@classmethod
def from_dict(cls, config_dict, return_u... | @dataclass
class QuantizationConfigMixin:
'''
Mixin class for quantization config
'''
@classmethod
def from_dict(cls, config_dict, return_unused_kwargs=False, **kwargs):
'''
Instantiates a [`QuantizationConfigMixin`] from a Python dictionary of parameters.
Args:
... | 10 | 7 | 14 | 2 | 6 | 7 | 2 | 1.17 | 0 | 4 | 0 | 14 | 6 | 0 | 7 | 7 | 110 | 19 | 42 | 20 | 33 | 49 | 39 | 18 | 31 | 5 | 0 | 2 | 15 |
6,714 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/utils/quantization_config.py | transformers.utils.quantization_config.QuantizationMethod | from enum import Enum
class QuantizationMethod(str, Enum):
BITS_AND_BYTES = 'bitsandbytes'
GPTQ = 'gptq'
AWQ = 'awq'
AQLM = 'aqlm'
VPTQ = 'vptq'
QUANTO = 'quanto'
EETQ = 'eetq'
HIGGS = 'higgs'
HQQ = 'hqq'
COMPRESSED_TENSORS = 'compressed-tensors'
FBGEMM_FP8 = 'fbgemm_fp8'
... |
class QuantizationMethod(str, Enum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 115 | 14 | 0 | 14 | 14 | 13 | 0 | 14 | 14 | 13 | 0 | 4 | 0 | 0 |
6,715 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/utils/quantization_config.py | transformers.utils.quantization_config.QuantoConfig | from dataclasses import dataclass, is_dataclass
from typing import Any, Optional, Union
@dataclass
class QuantoConfig(QuantizationConfigMixin):
"""
This is a wrapper class about all possible attributes and features that you can play with a model that has been
loaded using `quanto`.
Args:
weigh... | @dataclass
class QuantoConfig(QuantizationConfigMixin):
'''
This is a wrapper class about all possible attributes and features that you can play with a model that has been
loaded using `quanto`.
Args:
weights (`str`, *optional*, defaults to `"int8"`):
The target dtype for the weights... | 4 | 2 | 11 | 0 | 10 | 2 | 2 | 0.75 | 1 | 2 | 1 | 0 | 2 | 4 | 2 | 9 | 38 | 3 | 20 | 15 | 11 | 15 | 14 | 9 | 11 | 3 | 1 | 1 | 4 |
6,716 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/utils/quantization_config.py | transformers.utils.quantization_config.TorchAoConfig | import importlib.metadata
from packaging import version
import dataclasses
from dataclasses import dataclass, is_dataclass
from typing import Any, Optional, Union
from inspect import Parameter, signature
from ..utils import is_auto_awq_available, is_compressed_tensors_available, is_gptqmodel_available, is_hqq_available... | @dataclass
class TorchAoConfig(QuantizationConfigMixin):
def __init__(self, quant_type: Union[str, 'AOBaseConfig'], modules_to_not_convert: Optional[list]=None, include_input_output_embeddings: bool=False, untie_embedding_weights: bool=False, **kwargs):
pass
@staticmethod
def _get_ao_version() -> v... | 12 | 7 | 13 | 1 | 11 | 1 | 2 | 0.39 | 1 | 4 | 1 | 0 | 5 | 4 | 5 | 12 | 91 | 12 | 57 | 22 | 46 | 22 | 34 | 18 | 27 | 6 | 1 | 2 | 12 |
6,717 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/utils/quantization_config.py | transformers.utils.quantization_config.VptqConfig | from typing import Any, Optional, Union
from dataclasses import dataclass, is_dataclass
@dataclass
class VptqConfig(QuantizationConfigMixin):
"""
This is a wrapper class about `vptq` parameters.
Args:
enable_proxy_error (`bool`, *optional*, defaults to `False`): calculate proxy error for each laye... | @dataclass
class VptqConfig(QuantizationConfigMixin):
'''
This is a wrapper class about `vptq` parameters.
Args:
enable_proxy_error (`bool`, *optional*, defaults to `False`): calculate proxy error for each layer
config_for_layers (`Dict`, *optional*, defaults to `{}`): quantization params fo... | 4 | 2 | 11 | 0 | 10 | 2 | 2 | 0.75 | 1 | 6 | 2 | 0 | 2 | 5 | 2 | 9 | 38 | 3 | 20 | 16 | 10 | 15 | 13 | 9 | 10 | 3 | 1 | 1 | 4 |
6,718 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/src/transformers/utils/quantization_config.py | transformers.utils.quantization_config.VptqLayerConfig | from dataclasses import dataclass, is_dataclass
@dataclass
class VptqLayerConfig(QuantizationConfigMixin):
"""
This is used to explain vptq config params for each layer
Args:
enable_norm (`bool`, *optional*, defaults to `True`): to control if we have scale/bias for fp-weight
enable_perm (`b... | @dataclass
class VptqLayerConfig(QuantizationConfigMixin):
'''
This is used to explain vptq config params for each layer
Args:
enable_norm (`bool`, *optional*, defaults to `True`): to control if we have scale/bias for fp-weight
enable_perm (`bool`, *optional*, defaults to `True`): to perm in... | 4 | 2 | 18 | 0 | 16 | 2 | 2 | 0.52 | 1 | 4 | 0 | 0 | 2 | 12 | 2 | 9 | 52 | 2 | 33 | 30 | 15 | 17 | 18 | 15 | 15 | 2 | 1 | 1 | 3 |
6,719 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/examples/legacy/multiple_choice/utils_multiple_choice.py | utils_multiple_choice.ArcProcessor | import json
import os
import tqdm
class ArcProcessor(DataProcessor):
"""Processor for the ARC data set (request from allennlp)."""
def get_train_examples(self, data_dir):
"""See base class."""
logger.info(f'LOOKING AT {data_dir} train')
return self._create_examples(self._read_json(os.p... |
class ArcProcessor(DataProcessor):
'''Processor for the ARC data set (request from allennlp).'''
def get_train_examples(self, data_dir):
'''See base class.'''
pass
def get_dev_examples(self, data_dir):
'''See base class.'''
pass
def get_test_examples(self, data_dir):
... | 8 | 5 | 13 | 1 | 11 | 1 | 2 | 0.1 | 1 | 4 | 1 | 0 | 6 | 0 | 6 | 10 | 89 | 10 | 72 | 21 | 64 | 7 | 55 | 20 | 47 | 7 | 1 | 2 | 15 |
6,720 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/examples/legacy/multiple_choice/utils_multiple_choice.py | utils_multiple_choice.DataProcessor | class DataProcessor:
"""Base class for data converters for multiple choice data sets."""
def get_train_examples(self, data_dir):
"""Gets a collection of `InputExample`s for the train set."""
raise NotImplementedError()
def get_dev_examples(self, data_dir):
"""Gets a collection of `... | class DataProcessor:
'''Base class for data converters for multiple choice data sets.'''
def get_train_examples(self, data_dir):
'''Gets a collection of `InputExample`s for the train set.'''
pass
def get_dev_examples(self, data_dir):
'''Gets a collection of `InputExample`s for the ... | 5 | 5 | 3 | 0 | 2 | 1 | 1 | 0.56 | 0 | 1 | 0 | 4 | 4 | 0 | 4 | 4 | 18 | 4 | 9 | 5 | 4 | 5 | 9 | 5 | 4 | 1 | 0 | 0 | 4 |
6,721 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/examples/legacy/multiple_choice/utils_multiple_choice.py | utils_multiple_choice.InputExample | from dataclasses import dataclass
from typing import Optional
@dataclass(frozen=True)
class InputExample:
"""
A single training/test example for multiple choice
Args:
example_id: Unique id for the example.
question: string. The untokenized text of the second sequence (question).
co... | @dataclass(frozen=True)
class InputExample:
'''
A single training/test example for multiple choice
Args:
example_id: Unique id for the example.
question: string. The untokenized text of the second sequence (question).
contexts: list of str. The untokenized text of the first sequence ... | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 1.67 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 18 | 2 | 6 | 1 | 5 | 10 | 6 | 1 | 5 | 0 | 0 | 0 | 0 |
6,722 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/examples/legacy/multiple_choice/utils_multiple_choice.py | utils_multiple_choice.InputFeatures | from typing import Optional
from dataclasses import dataclass
@dataclass(frozen=True)
class InputFeatures:
"""
A single set of features of data.
Property names are the same names as the corresponding inputs to a model.
"""
example_id: str
input_ids: list[list[int]]
attention_mask: Optional[... | @dataclass(frozen=True)
class InputFeatures:
'''
A single set of features of data.
Property names are the same names as the corresponding inputs to a model.
'''
pass | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 0.67 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 11 | 1 | 6 | 1 | 5 | 4 | 6 | 1 | 5 | 0 | 0 | 0 | 0 |
6,723 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/examples/legacy/multiple_choice/utils_multiple_choice.py | utils_multiple_choice.RaceProcessor | import os
import glob
import tqdm
import json
class RaceProcessor(DataProcessor):
"""Processor for the RACE data set."""
def get_train_examples(self, data_dir):
"""See base class."""
logger.info(f'LOOKING AT {data_dir} train')
high = os.path.join(data_dir, 'train/high')
middle ... |
class RaceProcessor(DataProcessor):
'''Processor for the RACE data set.'''
def get_train_examples(self, data_dir):
'''See base class.'''
pass
def get_dev_examples(self, data_dir):
'''See base class.'''
pass
def get_test_examples(self, data_dir):
'''See base cl... | 7 | 6 | 10 | 0 | 9 | 1 | 2 | 0.13 | 1 | 5 | 1 | 0 | 6 | 0 | 6 | 10 | 65 | 7 | 52 | 26 | 45 | 7 | 44 | 25 | 37 | 3 | 1 | 2 | 9 |
6,724 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/examples/legacy/multiple_choice/utils_multiple_choice.py | utils_multiple_choice.SwagProcessor | import os
import csv
class SwagProcessor(DataProcessor):
"""Processor for the SWAG data set."""
def get_train_examples(self, data_dir):
"""See base class."""
logger.info(f'LOOKING AT {data_dir} train')
return self._create_examples(self._read_csv(os.path.join(data_dir, 'train.csv')), 't... |
class SwagProcessor(DataProcessor):
'''Processor for the SWAG data set.'''
def get_train_examples(self, data_dir):
'''See base class.'''
pass
def get_dev_examples(self, data_dir):
'''See base class.'''
pass
def get_test_examples(self, data_dir):
'''See base cl... | 7 | 6 | 7 | 0 | 5 | 2 | 1 | 0.3 | 1 | 4 | 1 | 0 | 6 | 0 | 6 | 10 | 49 | 8 | 33 | 9 | 26 | 10 | 21 | 8 | 14 | 2 | 1 | 1 | 7 |
6,725 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/examples/legacy/multiple_choice/utils_multiple_choice.py | utils_multiple_choice.SynonymProcessor | import csv
import os
class SynonymProcessor(DataProcessor):
"""Processor for the Synonym data set."""
def get_train_examples(self, data_dir):
"""See base class."""
logger.info(f'LOOKING AT {data_dir} train')
return self._create_examples(self._read_csv(os.path.join(data_dir, 'mctrain.cs... |
class SynonymProcessor(DataProcessor):
'''Processor for the Synonym data set.'''
def get_train_examples(self, data_dir):
'''See base class.'''
pass
def get_dev_examples(self, data_dir):
'''See base class.'''
pass
def get_test_examples(self, data_dir):
'''See b... | 7 | 6 | 6 | 1 | 4 | 2 | 1 | 0.37 | 1 | 3 | 1 | 0 | 6 | 0 | 6 | 10 | 44 | 9 | 27 | 9 | 20 | 10 | 18 | 8 | 11 | 1 | 1 | 1 | 6 |
6,726 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/examples/legacy/token-classification/utils_ner.py | utils_ner.InputExample | from typing import Optional, Union
from dataclasses import dataclass
@dataclass
class InputExample:
"""
A single training/test example for token classification.
Args:
guid: Unique id for the example.
words: list. The words of the sequence.
labels: (Optional) list. The labels for ea... | @dataclass
class InputExample:
'''
A single training/test example for token classification.
Args:
guid: Unique id for the example.
words: list. The words of the sequence.
labels: (Optional) list. The labels for each word of the sequence. This should be
specified for train and... | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 14 | 2 | 4 | 1 | 3 | 8 | 4 | 1 | 3 | 0 | 0 | 0 | 0 |
6,727 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/examples/legacy/token-classification/utils_ner.py | utils_ner.InputFeatures | from typing import Optional, Union
from dataclasses import dataclass
@dataclass
class InputFeatures:
"""
A single set of features of data.
Property names are the same names as the corresponding inputs to a model.
"""
input_ids: list[int]
attention_mask: list[int]
token_type_ids: Optional[li... | @dataclass
class InputFeatures:
'''
A single set of features of data.
Property names are the same names as the corresponding inputs to a model.
'''
pass | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 0.8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 1 | 5 | 3 | 4 | 4 | 5 | 3 | 4 | 0 | 0 | 0 | 0 |
6,728 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/examples/legacy/token-classification/utils_ner.py | utils_ner.Split | from enum import Enum
class Split(Enum):
train = 'train'
dev = 'dev'
test = 'test' |
class Split(Enum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 49 | 4 | 0 | 4 | 4 | 3 | 0 | 4 | 4 | 3 | 0 | 4 | 0 | 0 |
6,729 | huggingface/pytorch-pretrained-BERT | huggingface_pytorch-pretrained-BERT/examples/legacy/token-classification/utils_ner.py | utils_ner.TokenClassificationTask | from transformers import PreTrainedTokenizer, is_torch_available
from typing import Optional, Union
class TokenClassificationTask:
@staticmethod
def read_examples_from_file(data_dir, mode: Union[Split, str]) -> list[InputExample]:
raise NotImplementedError
@staticmethod
def get_labels(path: s... |
class TokenClassificationTask:
@staticmethod
def read_examples_from_file(data_dir, mode: Union[Split, str]) -> list[InputExample]:
pass
@staticmethod
def get_labels(path: str) -> list[str]:
pass
@staticmethod
def convert_examples_to_features(examples: list[InputExample], label_... | 7 | 1 | 43 | 5 | 28 | 11 | 5 | 0.36 | 0 | 9 | 3 | 2 | 0 | 0 | 3 | 3 | 136 | 16 | 88 | 35 | 65 | 32 | 63 | 16 | 59 | 14 | 0 | 3 | 16 |
6,730 | nvbn/thefuck | nvbn_thefuck/thefuck/argument_parser.py | thefuck.argument_parser.Parser | from argparse import ArgumentParser, SUPPRESS
import sys
from .const import ARGUMENT_PLACEHOLDER
from .utils import get_alias
class Parser(object):
"""Argument parser that can handle arguments with our special
placeholder.
"""
def __init__(self):
self._parser = ArgumentParser(prog='thefuck', ... |
class Parser(object):
'''Argument parser that can handle arguments with our special
placeholder.
'''
def __init__(self):
pass
def _add_arguments(self):
'''Adds arguments to parser.'''
pass
def _add_conflicting_arguments(self):
'''It's too dangerous to use `-y`... | 8 | 4 | 11 | 0 | 9 | 1 | 1 | 0.17 | 1 | 1 | 0 | 0 | 7 | 1 | 7 | 7 | 86 | 11 | 64 | 12 | 56 | 11 | 31 | 12 | 23 | 3 | 1 | 1 | 9 |
6,731 | nvbn/thefuck | nvbn_thefuck/thefuck/conf.py | thefuck.conf.Settings | from six import text_type
import sys
from warnings import warn
import os
from . import const
from .system import Path
class Settings(dict):
def __getattr__(self, item):
return self.get(item)
def __setattr__(self, key, value):
self[key] = value
def init(self, args=None):
"""Fills ... |
class Settings(dict):
def __getattr__(self, item):
pass
def __setattr__(self, key, value):
pass
def init(self, args=None):
'''Fills `settings` with values from `settings.py` and env.'''
pass
def _init_settings_file(self):
pass
def _get_user_dir_path(self... | 13 | 9 | 9 | 1 | 7 | 1 | 3 | 0.12 | 1 | 4 | 0 | 0 | 12 | 1 | 12 | 39 | 118 | 18 | 90 | 28 | 76 | 11 | 76 | 27 | 62 | 6 | 2 | 3 | 30 |
6,732 | nvbn/thefuck | nvbn_thefuck/thefuck/const.py | thefuck.const._GenConst | class _GenConst(object):
def __init__(self, name):
self._name = name
def __repr__(self):
return u'<const: {}>'.format(self._name) | class _GenConst(object):
def __init__(self, name):
pass
def __repr__(self):
pass | 3 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 2 | 1 | 2 | 2 | 6 | 1 | 5 | 4 | 2 | 0 | 5 | 4 | 2 | 1 | 1 | 0 | 2 |
6,733 | nvbn/thefuck | nvbn_thefuck/thefuck/exceptions.py | thefuck.exceptions.EmptyCommand | class EmptyCommand(Exception):
"""Raised when empty command passed to `thefuck`.""" | class EmptyCommand(Exception):
'''Raised when empty command passed to `thefuck`.'''
pass | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 2 | 0 | 1 | 1 | 0 | 1 | 1 | 1 | 0 | 0 | 3 | 0 | 0 |
6,734 | nvbn/thefuck | nvbn_thefuck/thefuck/exceptions.py | thefuck.exceptions.NoRuleMatched | class NoRuleMatched(Exception):
"""Raised when no rule matched for some command.""" | class NoRuleMatched(Exception):
'''Raised when no rule matched for some command.'''
pass | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 2 | 0 | 1 | 1 | 0 | 1 | 1 | 1 | 0 | 0 | 3 | 0 | 0 |
6,735 | nvbn/thefuck | nvbn_thefuck/thefuck/exceptions.py | thefuck.exceptions.ScriptNotInLog | class ScriptNotInLog(Exception):
"""Script not found in log.""" | class ScriptNotInLog(Exception):
'''Script not found in log.'''
pass | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 2 | 0 | 1 | 1 | 0 | 1 | 1 | 1 | 0 | 0 | 3 | 0 | 0 |
6,736 | nvbn/thefuck | nvbn_thefuck/thefuck/shells/bash.py | thefuck.shells.bash.Bash | from uuid import uuid4
from tempfile import gettempdir
from subprocess import Popen, PIPE
import os
from ..const import ARGUMENT_PLACEHOLDER, USER_COMMAND_MARK
from ..utils import DEVNULL, memoize
from .generic import Generic
from ..conf import settings
class Bash(Generic):
friendly_name = 'Bash'
def app_alia... |
class Bash(Generic):
def app_alias(self, alias_name):
pass
def instant_mode_alias(self, alias_name):
pass
def _parse_alias(self, alias):
pass
@memoize
def get_aliases(self):
pass
def _get_history_file_name(self):
pass
def _get_history_line(self, ... | 10 | 1 | 9 | 0 | 9 | 0 | 2 | 0.03 | 1 | 2 | 0 | 0 | 8 | 0 | 8 | 31 | 82 | 9 | 71 | 17 | 61 | 2 | 31 | 16 | 22 | 3 | 2 | 1 | 13 |
6,737 | nvbn/thefuck | nvbn_thefuck/thefuck/shells/fish.py | thefuck.shells.fish.Fish | from ..const import ARGUMENT_PLACEHOLDER
from .generic import Generic
from .. import logs
import os
from time import time
from subprocess import Popen, PIPE
import six
from ..utils import DEVNULL, cache
import sys
from ..conf import settings
class Fish(Generic):
friendly_name = 'Fish Shell'
def _get_overridde... |
class Fish(Generic):
def _get_overridden_aliases(self):
pass
def app_alias(self, alias_name):
pass
def get_aliases(self):
pass
def _expand_aliases(self, command_script):
pass
def _get_history_file_name(self):
pass
def _get_history_line(self, command... | 14 | 2 | 6 | 0 | 6 | 0 | 2 | 0.04 | 1 | 2 | 0 | 0 | 13 | 0 | 13 | 36 | 90 | 13 | 74 | 28 | 60 | 3 | 56 | 27 | 42 | 3 | 2 | 3 | 21 |
6,738 | nvbn/thefuck | nvbn_thefuck/thefuck/shells/generic.py | thefuck.shells.generic.Generic | import shlex
import os
import six
import io
from ..system import Path
from ..utils import memoize
from ..logs import warn
from ..conf import settings
class Generic(object):
friendly_name = 'Generic Shell'
def get_aliases(self):
return {}
def _expand_aliases(self, command_script):
aliases ... |
class Generic(object):
def get_aliases(self):
pass
def _expand_aliases(self, command_script):
pass
def from_shell(self, command_script):
'''Prepares command before running in app.'''
pass
def to_shell(self, command_script):
'''Prepares command for running in ... | 25 | 9 | 5 | 0 | 4 | 1 | 1 | 0.13 | 1 | 4 | 0 | 5 | 23 | 0 | 23 | 23 | 139 | 31 | 96 | 39 | 69 | 12 | 78 | 36 | 52 | 5 | 1 | 4 | 33 |
6,739 | nvbn/thefuck | nvbn_thefuck/thefuck/shells/powershell.py | thefuck.shells.powershell.Powershell | from .generic import Generic, ShellConfiguration
from subprocess import Popen, PIPE
from ..utils import DEVNULL
class Powershell(Generic):
friendly_name = 'PowerShell'
def app_alias(self, alias_name):
return 'function ' + alias_name + ' {\n $history = (Get-History -Count 1).CommandLine;\n if (-n... |
class Powershell(Generic):
def app_alias(self, alias_name):
pass
def and_(self, *commands):
pass
def how_to_configure(self):
pass
def _get_version(self):
'''Returns the version of the current shell'''
pass | 5 | 1 | 8 | 0 | 8 | 0 | 1 | 0.03 | 1 | 1 | 0 | 0 | 4 | 0 | 4 | 27 | 38 | 4 | 33 | 8 | 28 | 1 | 16 | 8 | 11 | 2 | 2 | 1 | 5 |
6,740 | nvbn/thefuck | nvbn_thefuck/thefuck/shells/tcsh.py | thefuck.shells.tcsh.Tcsh | from .generic import Generic
import os
from subprocess import Popen, PIPE
from ..utils import DEVNULL, memoize
from time import time
class Tcsh(Generic):
friendly_name = 'Tcsh'
def app_alias(self, alias_name):
return "alias {0} 'setenv TF_SHELL tcsh && setenv TF_ALIAS {0} && set fucked_cmd=`history -h... |
class Tcsh(Generic):
def app_alias(self, alias_name):
pass
def _parse_alias(self, alias):
pass
@memoize
def get_aliases(self):
pass
def _get_history_file_name(self):
pass
def _get_history_line(self, command_script):
pass
def how_to_configure(self... | 9 | 1 | 4 | 0 | 4 | 0 | 1 | 0.07 | 1 | 3 | 0 | 0 | 7 | 0 | 7 | 30 | 37 | 7 | 29 | 13 | 20 | 2 | 19 | 12 | 11 | 1 | 2 | 0 | 7 |
6,741 | nvbn/thefuck | nvbn_thefuck/thefuck/shells/zsh.py | thefuck.shells.zsh.Zsh | import os
from ..utils import DEVNULL, memoize
from ..conf import settings
from uuid import uuid4
from ..const import ARGUMENT_PLACEHOLDER, USER_COMMAND_MARK
from subprocess import Popen, PIPE
from .generic import Generic
from time import time
from tempfile import gettempdir
class Zsh(Generic):
friendly_name = 'ZS... |
class Zsh(Generic):
def app_alias(self, alias_name):
pass
def instant_mode_alias(self, alias_name):
pass
def _parse_alias(self, alias):
pass
@memoize
def get_aliases(self):
pass
def _get_history_file_name(self):
pass
def _get_history_line(self, c... | 11 | 1 | 8 | 0 | 8 | 0 | 1 | 0.03 | 1 | 3 | 0 | 0 | 9 | 0 | 9 | 32 | 85 | 9 | 74 | 17 | 63 | 2 | 31 | 16 | 21 | 2 | 2 | 1 | 13 |
6,742 | nvbn/thefuck | nvbn_thefuck/thefuck/types.py | thefuck.types.Command | from .output_readers import get_output
from .utils import get_alias, format_raw_script
from .exceptions import EmptyCommand
from . import logs
import sys
from .shells import shell
class Command(object):
"""Command that should be fixed."""
def __init__(self, script, output):
"""Initializes command with... |
class Command(object):
'''Command that should be fixed.'''
def __init__(self, script, output):
'''Initializes command with given values.
:type script: basestring
:type output: basestring
'''
pass
@property
def stdout(self):
pass
@property
def std... | 13 | 4 | 7 | 1 | 5 | 2 | 2 | 0.31 | 1 | 2 | 1 | 0 | 7 | 3 | 8 | 8 | 71 | 16 | 42 | 19 | 29 | 13 | 35 | 15 | 26 | 3 | 1 | 2 | 12 |
6,743 | nvbn/thefuck | nvbn_thefuck/thefuck/types.py | thefuck.types.CorrectedCommand | from .shells import shell
import os
from .utils import get_alias, format_raw_script
import sys
from .conf import settings, load_source
from . import logs
class CorrectedCommand(object):
"""Corrected by rule command."""
def __init__(self, script, side_effect, priority):
"""Initializes instance with giv... |
class CorrectedCommand(object):
'''Corrected by rule command.'''
def __init__(self, script, side_effect, priority):
'''Initializes instance with given fields.
:type script: basestring
:type side_effect: (Command, basestring) -> None
:type priority: int
'''
pass
... | 7 | 5 | 9 | 1 | 5 | 2 | 2 | 0.45 | 1 | 0 | 0 | 1 | 6 | 3 | 6 | 6 | 61 | 13 | 33 | 11 | 26 | 15 | 25 | 11 | 18 | 3 | 1 | 1 | 11 |
6,744 | nvbn/thefuck | nvbn_thefuck/thefuck/types.py | thefuck.types.Rule | from .conf import settings, load_source
from . import logs
from .const import DEFAULT_PRIORITY, ALL_ENABLED
import sys
class Rule(object):
"""Rule for fixing commands."""
def __init__(self, name, match, get_new_command, enabled_by_default, side_effect, priority, requires_output):
"""Initializes rule w... |
class Rule(object):
'''Rule for fixing commands.'''
def __init__(self, name, match, get_new_command, enabled_by_default, side_effect, priority, requires_output):
'''Initializes rule with given fields.
:type name: basestring
:type match: (Command) -> bool
:type get_new_command: ... | 10 | 6 | 15 | 2 | 10 | 3 | 2 | 0.35 | 1 | 5 | 1 | 1 | 6 | 7 | 7 | 7 | 114 | 18 | 71 | 24 | 59 | 25 | 45 | 20 | 37 | 4 | 1 | 3 | 15 |
6,745 | nvbn/thefuck | nvbn_thefuck/thefuck/ui.py | thefuck.ui.CommandSelector | from .exceptions import NoRuleMatched
class CommandSelector(object):
"""Helper for selecting rule from rules list."""
def __init__(self, commands):
""":type commands: Iterable[thefuck.types.CorrectedCommand]"""
self._commands_gen = commands
try:
self._commands = [next(self.... |
class CommandSelector(object):
'''Helper for selecting rule from rules list.'''
def __init__(self, commands):
''':type commands: Iterable[thefuck.types.CorrectedCommand]'''
pass
def _realise(self):
pass
def next(self):
pass
def previous(self):
pass
@p... | 7 | 3 | 4 | 0 | 4 | 0 | 1 | 0.14 | 1 | 3 | 1 | 0 | 5 | 4 | 5 | 5 | 30 | 5 | 22 | 11 | 15 | 3 | 21 | 10 | 15 | 2 | 1 | 1 | 7 |
6,746 | nvbn/thefuck | nvbn_thefuck/thefuck/utils.py | thefuck.utils.Cache | import atexit
import shelve
import pickle
import os
from .system import Path
from .logs import warn, exception
import sys
class Cache(object):
"""Lazy read cache and save changes at exit."""
def __init__(self):
self._db = None
def _init_db(self):
try:
self._setup_db()
... |
class Cache(object):
'''Lazy read cache and save changes at exit.'''
def __init__(self):
pass
def _init_db(self):
pass
def _setup_db(self):
pass
def _get_cache_dir(self):
pass
def _get_mtime(self, path):
pass
def _get_key(self, fn, depends_on, a... | 8 | 1 | 8 | 1 | 7 | 0 | 2 | 0.08 | 1 | 5 | 0 | 0 | 7 | 1 | 7 | 7 | 67 | 13 | 50 | 17 | 42 | 4 | 47 | 17 | 39 | 3 | 1 | 2 | 14 |
6,747 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/algorithms.py | benchmarks.algorithms.Duplicated | import pandas as pd
import numpy as np
class Duplicated:
params = [[True, False], ['first', 'last', False], ['int64', 'uint64', 'float64', 'string', 'datetime64[ns]', 'datetime64[ns, tz]', 'timestamp[ms][pyarrow]', 'duration[s][pyarrow]']]
param_names = ['unique', 'keep', 'dtype']
def setup(self, unique, ... |
class Duplicated:
def setup(self, unique, keep, dtype):
pass
def time_duplicated(self, unique, keep, dtype):
pass | 3 | 0 | 12 | 0 | 11 | 1 | 5 | 0.03 | 0 | 3 | 0 | 0 | 2 | 1 | 2 | 2 | 41 | 2 | 38 | 8 | 35 | 1 | 19 | 8 | 16 | 8 | 0 | 1 | 9 |
6,748 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/algorithms.py | benchmarks.algorithms.DuplicatedMaskedArray | import pandas as pd
import numpy as np
class DuplicatedMaskedArray:
params = [[True, False], ['first', 'last', False], ['Int64', 'Float64']]
param_names = ['unique', 'keep', 'dtype']
def setup(self, unique, keep, dtype):
N = 10 ** 5
data = pd.Series(np.arange(N), dtype=dtype)
data[... |
class DuplicatedMaskedArray:
def setup(self, unique, keep, dtype):
pass
def time_duplicated(self, unique, keep, dtype):
pass | 3 | 0 | 6 | 0 | 5 | 1 | 2 | 0.06 | 0 | 3 | 0 | 0 | 2 | 1 | 2 | 2 | 20 | 2 | 17 | 8 | 14 | 1 | 13 | 8 | 10 | 2 | 0 | 1 | 3 |
6,749 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/algorithms.py | benchmarks.algorithms.Factorize | import pandas as pd
import numpy as np
class Factorize:
params = [[True, False], [True, False], ['int64', 'uint64', 'float64', 'object', 'object_str', 'datetime64[ns]', 'datetime64[ns, tz]', 'Int64', 'boolean', 'string[pyarrow]']]
param_names = ['unique', 'sort', 'dtype']
def setup(self, unique, sort, dty... |
class Factorize:
def setup(self, unique, sort, dtype):
pass
def time_factorize(self, unique, sort, dtype):
pass
def peakmem_factorize(self, unique, sort, dtype):
pass | 4 | 0 | 10 | 1 | 9 | 0 | 4 | 0 | 0 | 3 | 0 | 0 | 3 | 1 | 3 | 3 | 51 | 5 | 46 | 9 | 42 | 0 | 21 | 9 | 17 | 9 | 0 | 1 | 11 |
6,750 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/algorithms.py | benchmarks.algorithms.Hashing | import pandas as pd
import numpy as np
class Hashing:
def setup_cache(self):
N = 10 ** 5
df = pd.DataFrame({'strings': pd.Series(pd.Index([f'i-{i}' for i in range(10000)], dtype=object).take(np.random.randint(0, 10000, size=N))), 'floats': np.random.randn(N), 'ints': np.arange(N), 'dates': pd.date... |
class Hashing:
def setup_cache(self):
pass
def time_frame(self, df):
pass
def time_series_int(self, df):
pass
def time_series_string(self, df):
pass
def time_series_float(self, df):
pass
def time_series_categorical(self, df):
pass
def t... | 9 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 0 | 3 | 0 | 0 | 8 | 0 | 8 | 8 | 41 | 8 | 33 | 11 | 24 | 0 | 21 | 11 | 12 | 1 | 0 | 0 | 8 |
6,751 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/algorithms.py | benchmarks.algorithms.Quantile | import numpy as np
import pandas as pd
class Quantile:
params = [[0, 0.5, 1], ['linear', 'nearest', 'lower', 'higher', 'midpoint'], ['float64', 'int64', 'uint64']]
param_names = ['quantile', 'interpolation', 'dtype']
def setup(self, quantile, interpolation, dtype):
N = 10 ** 5
if dtype in ... |
class Quantile:
def setup(self, quantile, interpolation, dtype):
pass
def time_quantile(self, quantile, interpolation, dtype):
pass | 3 | 0 | 6 | 0 | 6 | 0 | 2 | 0 | 0 | 2 | 0 | 0 | 2 | 1 | 2 | 2 | 20 | 2 | 18 | 8 | 15 | 0 | 12 | 8 | 9 | 3 | 0 | 1 | 4 |
6,752 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/algorithms.py | benchmarks.algorithms.SortIntegerArray | import numpy as np
import pandas as pd
class SortIntegerArray:
params = [10 ** 3, 10 ** 5]
def setup(self, N):
data = np.arange(N, dtype=float)
data[40] = np.nan
self.array = pd.array(data, dtype='Int64')
def time_argsort(self, N):
self.array.argsort() |
class SortIntegerArray:
def setup(self, N):
pass
def time_argsort(self, N):
pass | 3 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 2 | 1 | 2 | 2 | 10 | 2 | 8 | 6 | 5 | 0 | 8 | 6 | 5 | 1 | 0 | 0 | 2 |
6,753 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/algos/isin.py | benchmarks.algos.isin.IsIn | from pandas import Categorical, Index, NaT, Series, date_range
import numpy as np
class IsIn:
params = ['int64', 'uint64', 'object', 'Int64', 'boolean', 'bool', 'datetime64[ns]', 'category[object]', 'category[int]', 'str', 'string[python]', 'string[pyarrow]']
param_names = ['dtype']
def setup(self, dtype)... |
class IsIn:
def setup(self, dtype):
pass
def time_isin(self, dtype):
pass
def time_isin_categorical(self, dtype):
pass
def time_isin_empty(self, dtype):
pass
def time_isin_mismatched_dtype(self, dtype):
pass | 6 | 0 | 11 | 2 | 8 | 1 | 2 | 0.05 | 0 | 6 | 0 | 0 | 5 | 4 | 5 | 5 | 74 | 15 | 56 | 18 | 50 | 3 | 36 | 17 | 30 | 7 | 0 | 2 | 11 |
6,754 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/algos/isin.py | benchmarks.algos.isin.IsInFloat64 | import numpy as np
from pandas import Categorical, Index, NaT, Series, date_range
class IsInFloat64:
params = [[np.float64, 'Float64'], ['many_different_values', 'few_different_values', 'only_nans_values']]
param_names = ['dtype', 'title']
def setup(self, dtype, title):
N_many = 10 ** 5
N_... |
class IsInFloat64:
def setup(self, dtype, title):
pass
def time_isin(self, dtype, title):
pass | 3 | 0 | 9 | 1 | 7 | 2 | 3 | 0.15 | 0 | 2 | 0 | 0 | 2 | 2 | 2 | 2 | 26 | 3 | 20 | 9 | 17 | 3 | 14 | 9 | 11 | 4 | 0 | 1 | 5 |
6,755 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/algos/isin.py | benchmarks.algos.isin.IsInForObjects | import numpy as np
from pandas import Categorical, Index, NaT, Series, date_range
class IsInForObjects:
"""
A subset of the cartesian product of cases have special motivations:
"nans" x "nans"
if nan-objects are different objects,
this has the potential to trigger O(n^2) running time
... |
class IsInForObjects:
'''
A subset of the cartesian product of cases have special motivations:
"nans" x "nans"
if nan-objects are different objects,
this has the potential to trigger O(n^2) running time
"short" x "long"
running time dominated by the preprocessing
"long" x "s... | 3 | 1 | 13 | 2 | 11 | 0 | 5 | 0.58 | 0 | 2 | 0 | 0 | 2 | 2 | 2 | 2 | 55 | 14 | 26 | 11 | 23 | 15 | 20 | 11 | 17 | 9 | 0 | 1 | 10 |
6,756 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/algos/isin.py | benchmarks.algos.isin.IsInIndexes | import numpy as np
from pandas import Categorical, Index, NaT, Series, date_range
class IsInIndexes:
def setup(self):
self.range_idx = Index(range(1000))
self.index = Index(list(range(1000)))
self.series = Series(np.random.randint(100000, size=1000))
def time_isin_range_index(self):
... |
class IsInIndexes:
def setup(self):
pass
def time_isin_range_index(self):
pass
def time_isin_index(self):
pass | 4 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 3 | 0 | 0 | 3 | 3 | 3 | 3 | 11 | 2 | 9 | 7 | 5 | 0 | 9 | 7 | 5 | 1 | 0 | 0 | 3 |
6,757 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/algos/isin.py | benchmarks.algos.isin.IsInLongSeriesLookUpDominates | import numpy as np
from pandas import Categorical, Index, NaT, Series, date_range
class IsInLongSeriesLookUpDominates:
params = [['int64', 'int32', 'float64', 'float32', 'object', 'Int64', 'Float64'], [5, 1000], ['random_hits', 'random_misses', 'monotone_hits', 'monotone_misses']]
param_names = ['dtype', 'MaxN... |
class IsInLongSeriesLookUpDominates:
def setup(self, dtype, MaxNumber, series_type):
pass
def time_isin(self, dtypes, MaxNumber, series_type):
pass | 3 | 0 | 9 | 2 | 7 | 0 | 3 | 0 | 0 | 1 | 0 | 0 | 2 | 2 | 2 | 2 | 26 | 5 | 21 | 9 | 18 | 0 | 17 | 9 | 14 | 5 | 0 | 1 | 6 |
6,758 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/algos/isin.py | benchmarks.algos.isin.IsInLongSeriesValuesDominate | import numpy as np
from pandas import Categorical, Index, NaT, Series, date_range
class IsInLongSeriesValuesDominate:
params = [['int64', 'int32', 'float64', 'float32', 'object', 'Int64', 'Float64'], ['random', 'monotone']]
param_names = ['dtype', 'series_type']
def setup(self, dtype, series_type):
... |
class IsInLongSeriesValuesDominate:
def setup(self, dtype, series_type):
pass
def time_isin(self, dtypes, series_type):
pass | 3 | 0 | 7 | 1 | 6 | 0 | 2 | 0 | 0 | 1 | 0 | 0 | 2 | 2 | 2 | 2 | 21 | 4 | 17 | 10 | 14 | 0 | 14 | 10 | 11 | 3 | 0 | 1 | 4 |
6,759 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/algos/isin.py | benchmarks.algos.isin.IsInWithLongTupples | from pandas import Categorical, Index, NaT, Series, date_range
class IsInWithLongTupples:
def setup(self):
t = tuple(range(1000))
self.series = Series([t] * 1000)
self.values = [t]
def time_isin(self):
self.series.isin(self.values) |
class IsInWithLongTupples:
def setup(self):
pass
def time_isin(self):
pass | 3 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 3 | 0 | 0 | 2 | 2 | 2 | 2 | 8 | 1 | 7 | 6 | 4 | 0 | 7 | 6 | 4 | 1 | 0 | 0 | 2 |
6,760 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/algos/isin.py | benchmarks.algos.isin.IsinAlmostFullWithRandomInt | from pandas import Categorical, Index, NaT, Series, date_range
import numpy as np
class IsinAlmostFullWithRandomInt:
params = [[np.float64, np.int64, np.uint64, np.object_], range(10, 21), ['inside', 'outside']]
param_names = ['dtype', 'exponent', 'title']
def setup(self, dtype, exponent, title):
... |
class IsinAlmostFullWithRandomInt:
def setup(self, dtype, exponent, title):
pass
def time_isin(self, dtype, exponent, title):
pass | 3 | 0 | 7 | 1 | 6 | 1 | 2 | 0.05 | 0 | 2 | 0 | 0 | 2 | 2 | 2 | 2 | 23 | 3 | 19 | 9 | 16 | 1 | 13 | 9 | 10 | 3 | 0 | 1 | 4 |
6,761 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/algos/isin.py | benchmarks.algos.isin.IsinWithArange | from pandas import Categorical, Index, NaT, Series, date_range
import numpy as np
class IsinWithArange:
params = [[np.float64, np.int64, np.uint64, np.object_], [1000, 2000, 8000], [-2, 0, 2]]
param_names = ['dtype', 'M', 'offset_factor']
def setup(self, dtype, M, offset_factor):
offset = int(M * ... |
class IsinWithArange:
def setup(self, dtype, M, offset_factor):
pass
def time_isin(self, dtype, M, offset_factor):
pass | 3 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 0 | 2 | 0 | 0 | 2 | 2 | 2 | 2 | 20 | 2 | 18 | 9 | 15 | 0 | 10 | 9 | 7 | 1 | 0 | 0 | 2 |
6,762 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/algos/isin.py | benchmarks.algos.isin.IsinWithArangeSorted | import numpy as np
from pandas import Categorical, Index, NaT, Series, date_range
class IsinWithArangeSorted:
params = [[np.float64, np.int64, np.uint64, np.object_], [1000, 2000, 8000, 100000, 1000000]]
param_names = ['dtype', 'size']
def setup(self, dtype, size):
self.series = Series(np.arange(s... |
class IsinWithArangeSorted:
def setup(self, dtype, size):
pass
def time_isin(self, dtype, size):
pass | 3 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 2 | 2 | 2 | 2 | 19 | 2 | 17 | 7 | 14 | 0 | 8 | 7 | 5 | 1 | 0 | 0 | 2 |
6,763 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/algos/isin.py | benchmarks.algos.isin.IsinWithRandomFloat | import numpy as np
from pandas import Categorical, Index, NaT, Series, date_range
class IsinWithRandomFloat:
params = [[np.float64, np.object_], [1300, 2000, 7000, 8000, 70000, 80000, 750000, 900000], ['inside', 'outside']]
param_names = ['dtype', 'size', 'title']
def setup(self, dtype, size, title):
... |
class IsinWithRandomFloat:
def setup(self, dtype, size, title):
pass
def time_isin(self, dtype, size, title):
pass | 3 | 0 | 5 | 1 | 4 | 0 | 2 | 0 | 0 | 1 | 0 | 0 | 2 | 2 | 2 | 2 | 27 | 3 | 24 | 7 | 21 | 0 | 11 | 7 | 8 | 2 | 0 | 1 | 3 |
6,764 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/arithmetic.py | benchmarks.arithmetic.ApplyIndex | from pandas import DataFrame, Index, Series, Timestamp, date_range, to_timedelta
class ApplyIndex:
params = other_offsets
param_names = ['offset']
def setup(self, offset):
N = 10000
rng = date_range(start='1/1/2000', periods=N, freq='min')
self.rng = rng
def time_apply_index(s... |
class ApplyIndex:
def setup(self, offset):
pass
def time_apply_index(self, offset):
pass | 3 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 | 1 | 2 | 2 | 11 | 2 | 9 | 8 | 6 | 0 | 9 | 8 | 6 | 1 | 0 | 0 | 2 |
6,765 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/arithmetic.py | benchmarks.arithmetic.BinaryOpsMultiIndex | import pandas as pd
import numpy as np
from pandas import DataFrame, Index, Series, Timestamp, date_range, to_timedelta
class BinaryOpsMultiIndex:
params = ['sub', 'add', 'mul', 'div']
param_names = ['func']
def setup(self, func):
array = date_range('20200101 00:00', '20200102 0:00', freq='s')
... |
class BinaryOpsMultiIndex:
def setup(self, func):
pass
def time_binary_op_multiindex(self, func):
pass | 3 | 0 | 9 | 2 | 8 | 0 | 1 | 0 | 0 | 2 | 0 | 0 | 2 | 2 | 2 | 2 | 23 | 5 | 18 | 11 | 15 | 0 | 12 | 11 | 9 | 1 | 0 | 0 | 2 |
6,766 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/arithmetic.py | benchmarks.arithmetic.CategoricalComparisons | import pandas as pd
class CategoricalComparisons:
params = ['__lt__', '__le__', '__eq__', '__ne__', '__ge__', '__gt__']
param_names = ['op']
def setup(self, op):
N = 10 ** 5
self.cat = pd.Categorical(list('aabbcd') * N, ordered=True)
def time_categorical_op(self, op):
getattr(... |
class CategoricalComparisons:
def setup(self, op):
pass
def time_categorical_op(self, op):
pass | 3 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 2 | 1 | 2 | 2 | 10 | 2 | 8 | 7 | 5 | 0 | 8 | 7 | 5 | 1 | 0 | 0 | 2 |
6,767 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/arithmetic.py | benchmarks.arithmetic.DateInferOps | import numpy as np
from pandas import DataFrame, Index, Series, Timestamp, date_range, to_timedelta
class DateInferOps:
def setup_cache(self):
N = 5 * 10 ** 5
df = DataFrame({'datetime64': np.arange(N).astype('datetime64[ms]')})
df['timedelta'] = df['datetime64'] - df['datetime64']
... |
class DateInferOps:
def setup_cache(self):
pass
def time_subtract_datetimes(self, df):
pass
def time_timedelta_plus_datetime(self, df):
pass
def time_add_timedeltas(self, df):
pass | 5 | 0 | 3 | 0 | 3 | 0 | 1 | 0.08 | 0 | 0 | 0 | 0 | 4 | 0 | 4 | 4 | 16 | 3 | 12 | 7 | 7 | 1 | 12 | 7 | 7 | 1 | 0 | 0 | 4 |
6,768 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/arithmetic.py | benchmarks.arithmetic.FrameWithFrameWide | import numpy as np
from pandas import DataFrame, Index, Series, Timestamp, date_range, to_timedelta
import operator
import pandas as pd
class FrameWithFrameWide:
params = [[operator.add, operator.floordiv, operator.gt], [(1000000, 10), (100000, 100), (10000, 1000), (1000, 10000)]]
param_names = ['op', 'shape']... |
class FrameWithFrameWide:
def setup(self, op, shape):
pass
def time_op_different_blocks(self, op, shape):
pass
def time_op_same_blocks(self, op, shape):
pass | 4 | 0 | 12 | 1 | 8 | 3 | 1 | 0.34 | 0 | 0 | 0 | 0 | 3 | 2 | 3 | 3 | 59 | 8 | 38 | 14 | 34 | 13 | 22 | 14 | 18 | 2 | 0 | 1 | 4 |
6,769 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/arithmetic.py | benchmarks.arithmetic.IndexArithmetic | from pandas import DataFrame, Index, Series, Timestamp, date_range, to_timedelta
import numpy as np
class IndexArithmetic:
params = ['float', 'int']
param_names = ['dtype']
def setup(self, dtype):
N = 10 ** 6
if dtype == 'float':
self.index = Index(np.arange(N), dtype=np.float6... |
class IndexArithmetic:
def setup(self, dtype):
pass
def time_add(self, dtype):
pass
def time_subtract(self, dtype):
pass
def time_multiply(self, dtype):
pass
def time_divide(self, dtype):
pass
def time_modulo(self, dtype):
pass | 7 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 6 | 1 | 6 | 6 | 25 | 6 | 19 | 11 | 12 | 0 | 18 | 11 | 11 | 3 | 0 | 1 | 8 |
6,770 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/arithmetic.py | benchmarks.arithmetic.IntFrameWithScalar | from pandas import DataFrame, Index, Series, Timestamp, date_range, to_timedelta
import numpy as np
import operator
class IntFrameWithScalar:
params = [[np.float64, np.int64], [2, 3.0, np.int32(4), np.float64(5)], [operator.add, operator.sub, operator.mul, operator.truediv, operator.floordiv, operator.pow, operato... |
class IntFrameWithScalar:
def setup(self, dtype, scalar, op):
pass
def time_frame_op_with_scalar(self, dtype, scalar, op):
pass | 3 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 | 1 | 2 | 2 | 28 | 2 | 26 | 7 | 23 | 0 | 8 | 7 | 5 | 1 | 0 | 0 | 2 |
6,771 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/arithmetic.py | benchmarks.arithmetic.IrregularOps | from pandas import DataFrame, Index, Series, Timestamp, date_range, to_timedelta
import numpy as np
class IrregularOps:
def setup(self):
N = 10 ** 5
idx = date_range(start='1/1/2000', periods=N, freq='s')
s = Series(np.random.randn(N), index=idx)
self.left = s.sample(frac=1)
... |
class IrregularOps:
def setup(self):
pass
def time_add(self):
pass | 3 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 2 | 2 | 2 | 2 | 10 | 1 | 9 | 8 | 6 | 0 | 9 | 8 | 6 | 1 | 0 | 0 | 2 |
6,772 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/arithmetic.py | benchmarks.arithmetic.MixedFrameWithSeriesAxis | import operator
import numpy as np
from pandas import DataFrame, Index, Series, Timestamp, date_range, to_timedelta
class MixedFrameWithSeriesAxis:
params = [['eq', 'ne', 'lt', 'le', 'ge', 'gt', 'add', 'sub', 'truediv', 'floordiv', 'mul', 'pow']]
param_names = ['opname']
def setup(self, opname):
a... |
class MixedFrameWithSeriesAxis:
def setup(self, opname):
pass
def time_frame_op_with_series_axis0(self, opname):
pass
def time_frame_op_with_series_axis1(self, opname):
pass | 4 | 0 | 4 | 0 | 4 | 0 | 1 | 0.07 | 0 | 0 | 0 | 0 | 3 | 3 | 3 | 3 | 36 | 4 | 30 | 11 | 26 | 2 | 15 | 11 | 11 | 1 | 0 | 0 | 3 |
6,773 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/arithmetic.py | benchmarks.arithmetic.NumericInferOps | import numpy as np
from .pandas_vb_common import numeric_dtypes
from pandas import DataFrame, Index, Series, Timestamp, date_range, to_timedelta
class NumericInferOps:
params = numeric_dtypes
param_names = ['dtype']
def setup(self, dtype):
N = 5 * 10 ** 5
self.df = DataFrame({'A': np.arang... |
class NumericInferOps:
def setup(self, dtype):
pass
def time_add(self, dtype):
pass
def time_subtract(self, dtype):
pass
def time_multiply(self, dtype):
pass
def time_divide(self, dtype):
pass
def time_modulo(self, dtype):
pass | 7 | 0 | 3 | 0 | 3 | 0 | 1 | 0.06 | 0 | 0 | 0 | 0 | 6 | 1 | 6 | 6 | 25 | 6 | 18 | 11 | 11 | 1 | 16 | 11 | 9 | 1 | 0 | 0 | 6 |
6,774 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/arithmetic.py | benchmarks.arithmetic.OffsetArrayArithmetic | import warnings
from pandas import DataFrame, Index, Series, Timestamp, date_range, to_timedelta
class OffsetArrayArithmetic:
params = offsets
param_names = ['offset']
def setup(self, offset):
N = 10000
rng = date_range(start='1/1/2000', periods=N, freq='min')
self.rng = rng
... |
class OffsetArrayArithmetic:
def setup(self, offset):
pass
def time_add_series_offset(self, offset):
pass
def time_add_dti_offset(self, offset):
pass | 4 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 0 | 2 | 0 | 0 | 3 | 2 | 3 | 3 | 17 | 3 | 14 | 10 | 10 | 0 | 14 | 10 | 10 | 1 | 0 | 1 | 3 |
6,775 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/arithmetic.py | benchmarks.arithmetic.OpWithFillValue | import numpy as np
from pandas import DataFrame, Index, Series, Timestamp, date_range, to_timedelta
class OpWithFillValue:
def setup(self):
arr = np.arange(10 ** 6)
df = DataFrame({'A': arr})
ser = df['A']
self.df = df
self.ser = ser
def time_frame_op_with_fill_value_n... |
class OpWithFillValue:
def setup(self):
pass
def time_frame_op_with_fill_value_no_nas(self):
pass
def time_series_op_with_fill_value_no_nas(self):
pass | 4 | 0 | 4 | 0 | 3 | 0 | 1 | 0.09 | 0 | 0 | 0 | 0 | 3 | 2 | 3 | 3 | 15 | 3 | 11 | 9 | 7 | 1 | 11 | 9 | 7 | 1 | 0 | 0 | 3 |
6,776 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/arithmetic.py | benchmarks.arithmetic.Ops | from pandas import DataFrame, Index, Series, Timestamp, date_range, to_timedelta
import numpy as np
class Ops:
params = [[True, False], ['default', 1]]
param_names = ['use_numexpr', 'threads']
def setup(self, use_numexpr, threads):
self.df = DataFrame(np.random.randn(20000, 100))
self.df2 ... |
class Ops:
def setup(self, use_numexpr, threads):
pass
def time_frame_add(self, use_numexpr, threads):
pass
def time_frame_mult(self, use_numexpr, threads):
pass
def time_frame_multi_and(self, use_numexpr, threads):
pass
def time_frame_comparison(self, use_numex... | 7 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 6 | 2 | 6 | 6 | 28 | 7 | 21 | 11 | 14 | 0 | 21 | 11 | 14 | 3 | 0 | 1 | 8 |
6,777 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/arithmetic.py | benchmarks.arithmetic.Ops2 | from pandas import DataFrame, Index, Series, Timestamp, date_range, to_timedelta
import numpy as np
class Ops2:
def setup(self):
N = 10 ** 3
self.df = DataFrame(np.random.randn(N, N))
self.df2 = DataFrame(np.random.randn(N, N))
self.df_int = DataFrame(np.random.randint(np.iinfo(np.... |
class Ops2:
def setup(self):
pass
def time_frame_float_div(self):
pass
def time_frame_float_div_by_zero(self):
pass
def time_frame_float_floor_by_zero(self):
pass
def time_frame_int_div_by_zero(self):
pass
def time_frame_int_mod(self):
pass
... | 11 | 0 | 4 | 0 | 3 | 0 | 1 | 0.09 | 0 | 1 | 0 | 0 | 10 | 5 | 10 | 10 | 51 | 14 | 34 | 17 | 23 | 3 | 26 | 17 | 15 | 1 | 0 | 0 | 10 |
6,778 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/arithmetic.py | benchmarks.arithmetic.TimedeltaOps | from pandas import DataFrame, Index, Series, Timestamp, date_range, to_timedelta
import numpy as np
class TimedeltaOps:
def setup(self):
self.td = to_timedelta(np.arange(1000000))
self.ts = Timestamp('2000')
def time_add_td_ts(self):
self.td + self.ts |
class TimedeltaOps:
def setup(self):
pass
def time_add_td_ts(self):
pass | 3 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 | 2 | 2 | 2 | 7 | 1 | 6 | 5 | 3 | 0 | 6 | 5 | 3 | 1 | 0 | 0 | 2 |
6,779 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/arithmetic.py | benchmarks.arithmetic.Timeseries | from pandas import DataFrame, Index, Series, Timestamp, date_range, to_timedelta
class Timeseries:
params = [None, 'US/Eastern']
param_names = ['tz']
def setup(self, tz):
N = 10 ** 6
halfway = N // 2 - 1
self.s = Series(date_range('20010101', periods=N, freq='min', tz=tz))
... |
class Timeseries:
def setup(self, tz):
pass
def time_series_timestamp_compare(self, tz):
pass
def time_series_timestamp_different_reso_compare(self, tz):
pass
def time_timestamp_series_compare(self, tz):
pass
def time_timestamp_ops_diff(self, tz):
pass
... | 7 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 6 | 4 | 6 | 6 | 27 | 7 | 20 | 15 | 13 | 0 | 20 | 15 | 13 | 1 | 0 | 0 | 6 |
6,780 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/array.py | benchmarks.array.ArrowExtensionArray | import pandas as pd
import numpy as np
class ArrowExtensionArray:
params = [['boolean[pyarrow]', 'float64[pyarrow]', 'int64[pyarrow]', 'string[pyarrow]', 'timestamp[ns][pyarrow]'], [False, True]]
param_names = ['dtype', 'hasna']
def setup(self, dtype, hasna):
N = 100000
if dtype == 'boolea... |
class ArrowExtensionArray:
def setup(self, dtype, hasna):
pass
def time_to_numpy(self, dtype, hasna):
pass | 3 | 0 | 11 | 1 | 10 | 0 | 4 | 0 | 0 | 4 | 0 | 0 | 2 | 1 | 2 | 2 | 35 | 3 | 32 | 9 | 29 | 0 | 18 | 9 | 15 | 7 | 0 | 1 | 8 |
6,781 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/array.py | benchmarks.array.ArrowStringArray | import pandas as pd
import numpy as np
class ArrowStringArray:
params = [False, True]
param_names = ['multiple_chunks']
def setup(self, multiple_chunks):
try:
import pyarrow as pa
except ImportError as err:
raise NotImplementedError from err
strings = np.arr... |
class ArrowStringArray:
def setup(self, multiple_chunks):
pass
def time_setitem(self, multiple_chunks):
pass
def time_setitem_list(self, multiple_chunks):
pass
def time_setitem_slice(self, multiple_chunks):
pass
def time_setitem_null_slice(self, multiple_chunks)... | 7 | 0 | 4 | 0 | 4 | 0 | 2 | 0 | 0 | 6 | 0 | 0 | 6 | 1 | 6 | 6 | 32 | 6 | 26 | 16 | 18 | 0 | 25 | 15 | 17 | 3 | 0 | 1 | 9 |
6,782 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/array.py | benchmarks.array.BooleanArray | import numpy as np
import pandas as pd
class BooleanArray:
def setup(self):
self.values_bool = np.array([True, False, True, False])
self.values_float = np.array([1.0, 0.0, 1.0, 0.0])
self.values_integer = np.array([1, 0, 1, 0])
self.values_integer_like = [1, 0, 1, 0]
self.d... |
class BooleanArray:
def setup(self):
pass
def time_constructor(self):
pass
def time_from_bool_array(self):
pass
def time_from_integer_array(self):
pass
def time_from_integer_like(self):
pass
def time_from_float_array(self):
pass | 7 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 6 | 6 | 6 | 6 | 23 | 5 | 18 | 13 | 11 | 0 | 18 | 13 | 11 | 1 | 0 | 0 | 6 |
6,783 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/array.py | benchmarks.array.IntegerArray | import pandas as pd
import numpy as np
class IntegerArray:
def setup(self):
N = 250000
self.values_integer = np.tile(np.array([1, 0, 1, 0]), N)
self.data = np.tile(np.array([1, 2, 3, 4], dtype='int64'), N)
self.mask = np.tile(np.array([False, False, True, False]), N)
def time_... |
class IntegerArray:
def setup(self):
pass
def time_constructor(self):
pass
def time_from_integer_array(self):
pass | 4 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 | 3 | 3 | 3 | 12 | 2 | 10 | 8 | 6 | 0 | 10 | 8 | 6 | 1 | 0 | 0 | 3 |
6,784 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/array.py | benchmarks.array.IntervalArray | import pandas as pd
class IntervalArray:
def setup(self):
N = 10000
self.tuples = [(i, i + 1) for i in range(N)]
def time_from_tuples(self):
pd.arrays.IntervalArray.from_tuples(self.tuples) |
class IntervalArray:
def setup(self):
pass
def time_from_tuples(self):
pass | 3 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 2 | 1 | 2 | 2 | 7 | 1 | 6 | 5 | 3 | 0 | 6 | 5 | 3 | 1 | 0 | 0 | 2 |
6,785 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/array.py | benchmarks.array.StringArray | import numpy as np
import pandas as pd
class StringArray:
def setup(self):
N = 100000
values = np.array([str(i) for i in range(N)], dtype=object)
self.values_obj = np.array(values, dtype='object')
self.values_str = np.array(values, dtype='U')
self.values_list = values.tolis... |
class StringArray:
def setup(self):
pass
def time_from_np_object_array(self):
pass
def time_from_np_str_array(self):
pass
def time_from_list(self):
pass | 5 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 3 | 0 | 0 | 4 | 3 | 4 | 4 | 16 | 3 | 13 | 10 | 8 | 0 | 13 | 10 | 8 | 1 | 0 | 0 | 4 |
6,786 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/attrs_caching.py | benchmarks.attrs_caching.DataFrameAttributes | import numpy as np
from pandas import DataFrame
class DataFrameAttributes:
def setup(self):
self.df = DataFrame(np.random.randn(10, 6))
self.cur_index = self.df.index
def time_get_index(self):
self.df.index
def time_set_index(self):
self.df.index = self.cur_index |
class DataFrameAttributes:
def setup(self):
pass
def time_get_index(self):
pass
def time_set_index(self):
pass | 4 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 | 2 | 3 | 3 | 10 | 2 | 8 | 6 | 4 | 0 | 8 | 6 | 4 | 1 | 0 | 0 | 3 |
6,787 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/attrs_caching.py | benchmarks.attrs_caching.SeriesArrayAttribute | import pandas as pd
class SeriesArrayAttribute:
params = [['numeric', 'object', 'category', 'datetime64', 'datetime64tz']]
param_names = ['dtype']
def setup(self, dtype):
if dtype == 'numeric':
self.series = pd.Series([1, 2, 3])
elif dtype == 'object':
self.series =... |
class SeriesArrayAttribute:
def setup(self, dtype):
pass
def time_array(self, dtype):
pass
def time_extract_array(self, dtype):
pass
def time_extract_array_numpy(self, dtype):
pass | 5 | 0 | 4 | 0 | 4 | 0 | 2 | 0 | 0 | 2 | 0 | 0 | 4 | 1 | 4 | 4 | 24 | 4 | 20 | 8 | 15 | 0 | 16 | 8 | 11 | 6 | 0 | 1 | 9 |
6,788 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/boolean.py | benchmarks.boolean.TimeLogicalOps | import pandas as pd
import numpy as np
class TimeLogicalOps:
def setup(self):
N = 10000
left, right, lmask, rmask = np.random.randint(0, 2, size=(4, N)).astype('bool')
self.left = pd.arrays.BooleanArray(left, lmask)
self.right = pd.arrays.BooleanArray(right, rmask)
def time_or... |
class TimeLogicalOps:
def setup(self):
pass
def time_or_scalar(self):
pass
def time_or_array(self):
pass
def time_and_scalar(self):
pass
def time_and_array(self):
pass
def time_xor_scalar(self):
pass
def time_xor_array(self):
pa... | 8 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 7 | 2 | 7 | 7 | 27 | 6 | 21 | 12 | 13 | 0 | 21 | 12 | 13 | 1 | 0 | 0 | 7 |
6,789 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/categoricals.py | benchmarks.categoricals.AsType | import pandas as pd
import sys
import string
import numpy as np
class AsType:
def setup(self):
N = 10 ** 5
random_pick = np.random.default_rng().choice
categories = {'str': list(string.ascii_letters), 'int': np.random.randint(2 ** 16, size=154), 'float': sys.maxsize * np.random.random((38,... |
class AsType:
def setup(self):
pass
def astype_str(self):
pass
def astype_int(self):
pass
def astype_float(self):
pass
def astype_datetime(self):
pass | 6 | 0 | 7 | 1 | 6 | 0 | 1 | 0 | 0 | 2 | 0 | 0 | 5 | 1 | 5 | 5 | 39 | 9 | 30 | 10 | 24 | 0 | 18 | 10 | 12 | 3 | 0 | 1 | 7 |
6,790 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/categoricals.py | benchmarks.categoricals.CategoricalSlicing | import numpy as np
import pandas as pd
class CategoricalSlicing:
params = ['monotonic_incr', 'monotonic_decr', 'non_monotonic']
param_names = ['index']
def setup(self, index):
N = 10 ** 6
categories = ['a', 'b', 'c']
if index == 'monotonic_incr':
codes = np.repeat([0, 1... |
class CategoricalSlicing:
def setup(self, index):
pass
def time_getitem_scalar(self, index):
pass
def time_getitem_slice(self, index):
pass
def time_getitem_list_like(self, index):
pass
def time_getitem_list_like(self, index):
pass
def time_getitem_... | 7 | 0 | 4 | 0 | 4 | 0 | 2 | 0 | 0 | 3 | 0 | 0 | 6 | 4 | 6 | 6 | 35 | 7 | 28 | 16 | 21 | 0 | 25 | 16 | 18 | 4 | 0 | 1 | 9 |
6,791 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/categoricals.py | benchmarks.categoricals.Concat | import pandas as pd
class Concat:
def setup(self):
N = 10 ** 5
self.s = pd.Series(list('aabbcd') * N).astype('category')
self.a = pd.Categorical(list('aabbcd') * N)
self.b = pd.Categorical(list('bbcdjk') * N)
self.idx_a = pd.CategoricalIndex(range(N), range(N))
self... |
class Concat:
def setup(self):
pass
def time_concat(self):
pass
def time_union(self):
pass
def time_append_overlapping_index(self):
pass
def time_append_non_overlapping_index(self):
pass
def time_concat_overlapping_index(self):
pass
def... | 8 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 4 | 0 | 0 | 7 | 7 | 7 | 7 | 30 | 8 | 22 | 16 | 14 | 0 | 22 | 16 | 14 | 1 | 0 | 0 | 7 |
6,792 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/categoricals.py | benchmarks.categoricals.Constructor | import numpy as np
import pandas as pd
class Constructor:
def setup(self):
N = 10 ** 5
self.categories = list('abcde')
self.cat_idx = pd.Index(self.categories)
self.values = np.tile(self.categories, N)
self.codes = np.tile(range(len(self.categories)), N)
self.dateti... |
class Constructor:
def setup(self):
pass
def time_regular(self):
pass
def time_fastpath(self):
pass
def time_datetimes(self):
pass
def time_interval(self):
pass
def time_datetimes_with_nat(self):
pass
def time_with_nan(self):
pa... | 12 | 0 | 4 | 0 | 3 | 0 | 1 | 0 | 0 | 3 | 0 | 0 | 11 | 12 | 11 | 11 | 51 | 12 | 39 | 26 | 27 | 0 | 37 | 26 | 25 | 1 | 0 | 0 | 11 |
6,793 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/categoricals.py | benchmarks.categoricals.Contains | import pandas as pd
import numpy as np
class Contains:
def setup(self):
N = 10 ** 5
self.ci = pd.CategoricalIndex(np.arange(N))
self.c = self.ci.values
self.key = self.ci.categories[0]
def time_categorical_index_contains(self):
self.key in self.ci
def time_categor... |
class Contains:
def setup(self):
pass
def time_categorical_index_contains(self):
pass
def time_categorical_contains(self):
pass | 4 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 | 3 | 3 | 3 | 12 | 2 | 10 | 8 | 6 | 0 | 10 | 8 | 6 | 1 | 0 | 0 | 3 |
6,794 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/categoricals.py | benchmarks.categoricals.Indexing | import pandas as pd
class Indexing:
def setup(self):
N = 10 ** 5
self.index = pd.CategoricalIndex(range(N), range(N))
self.series = pd.Series(range(N), index=self.index).sort_index()
self.category = self.index[500]
def time_get_loc(self):
self.index.get_loc(self.catego... |
class Indexing:
def setup(self):
pass
def time_get_loc(self):
pass
def time_shallow_copy(self):
pass
def time_align(self):
pass
def time_intersection(self):
pass
def time_unique(self):
pass
def time_reindex(self):
pass
def ... | 10 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 0 | 3 | 0 | 0 | 9 | 3 | 9 | 9 | 30 | 8 | 22 | 14 | 12 | 0 | 22 | 14 | 12 | 1 | 0 | 0 | 9 |
6,795 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/categoricals.py | benchmarks.categoricals.IsMonotonic | import pandas as pd
class IsMonotonic:
def setup(self):
N = 1000
self.c = pd.CategoricalIndex(list('a' * N + 'b' * N + 'c' * N))
self.s = pd.Series(self.c)
def time_categorical_index_is_monotonic_increasing(self):
self.c.is_monotonic_increasing
def time_categorical_index_... |
class IsMonotonic:
def setup(self):
pass
def time_categorical_index_is_monotonic_increasing(self):
pass
def time_categorical_index_is_monotonic_decreasing(self):
pass
def time_categorical_series_is_monotonic_increasing(self):
pass
def time_categorical_series_is_... | 6 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 0 | 3 | 0 | 0 | 5 | 2 | 5 | 5 | 17 | 4 | 13 | 9 | 7 | 0 | 13 | 9 | 7 | 1 | 0 | 0 | 5 |
6,796 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/categoricals.py | benchmarks.categoricals.Rank | import warnings
import numpy as np
import pandas as pd
class Rank:
def setup(self):
N = 10 ** 5
ncats = 15
self.s_str = pd.Series(np.random.randint(0, ncats, size=N).astype(str))
self.s_str_cat = pd.Series(self.s_str, dtype='category')
with warnings.catch_warnings(record=Tr... |
class Rank:
def setup(self):
pass
def time_rank_string(self):
pass
def time_rank_string_cat(self):
pass
def time_rank_string_cat_ordered(self):
pass
def time_rank_int(self):
pass
def time_rank_int_cat(self):
pass
def time_rank_int_cat_o... | 8 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 0 | 4 | 0 | 0 | 7 | 6 | 7 | 7 | 34 | 8 | 26 | 18 | 18 | 0 | 26 | 18 | 18 | 1 | 0 | 1 | 7 |
6,797 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/categoricals.py | benchmarks.categoricals.RemoveCategories | import pandas as pd
import numpy as np
class RemoveCategories:
def setup(self):
n = 5 * 10 ** 5
arr = [f's{i:04d}' for i in np.random.randint(0, n // 10, size=n)]
self.ts = pd.Series(arr).astype('category')
def time_remove_categories(self):
self.ts.cat.remove_categories(self.t... |
class RemoveCategories:
def setup(self):
pass
def time_remove_categories(self):
pass | 3 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 2 | 1 | 2 | 2 | 8 | 1 | 7 | 6 | 4 | 0 | 7 | 6 | 4 | 1 | 0 | 0 | 2 |
6,798 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/categoricals.py | benchmarks.categoricals.Repr | import pandas as pd
class Repr:
def setup(self):
self.sel = pd.Series(['s1234']).astype('category')
def time_rendering(self):
str(self.sel) |
class Repr:
def setup(self):
pass
def time_rendering(self):
pass | 3 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 0 | 2 | 0 | 0 | 2 | 1 | 2 | 2 | 6 | 1 | 5 | 4 | 2 | 0 | 5 | 4 | 2 | 1 | 0 | 0 | 2 |
6,799 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/categoricals.py | benchmarks.categoricals.SearchSorted | import numpy as np
import pandas as pd
class SearchSorted:
def setup(self):
N = 10 ** 5
self.ci = pd.CategoricalIndex(np.arange(N)).sort_values()
self.c = self.ci.values
self.key = self.ci.categories[1]
def time_categorical_index_contains(self):
self.ci.searchsorted(se... |
class SearchSorted:
def setup(self):
pass
def time_categorical_index_contains(self):
pass
def time_categorical_contains(self):
pass | 4 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 | 3 | 3 | 3 | 12 | 2 | 10 | 8 | 6 | 0 | 10 | 8 | 6 | 1 | 0 | 0 | 3 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.