id stringlengths 30 32 | content stringlengths 139 2.8k |
|---|---|
codereview_new_python_data_157 |
import shutil
import os
-FILE_TO_DOWNLOAD = "https://searchfox.org/mozilla-central/source/toolkit/components/passwordmgr/LoginManager.shared.mjs"
-REAL_FILE_NAME = "LoginManagerShared.mjs"
TEMP_FILE_NAME_APPEND = "TEMP_DOWNLOADED_FILE"
GITHUB_ACTIONS_PATH = "./Client/Assets/CC_Script/"
TEMP_FILE_PATH = GITHUB_A... |
codereview_new_python_data_158 |
import shutil
import os
-FILE_TO_DOWNLOAD = "https://searchfox.org/mozilla-central/source/toolkit/components/passwordmgr/LoginManager.shared.mjs"
-REAL_FILE_NAME = "LoginManagerShared.mjs"
TEMP_FILE_NAME_APPEND = "TEMP_DOWNLOADED_FILE"
GITHUB_ACTIONS_PATH = "./Client/Assets/CC_Script/"
TEMP_FILE_PATH = GITHUB_A... |
codereview_new_python_data_869 |
#!/usr/bin/env python
-# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
```suggestion
# Copyright 2022 Google LLC
```
#!/usr/bin/env python
+# Copyright 2022 Google LLC
#
# Licensed under t... |
codereview_new_python_data_870 |
#!/usr/bin/env python
-# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Is this script product specific? If not, I should look into consolidating these scripts into one script – Perf/Sessions/Crashl... |
codereview_new_python_data_2919 | def sign(self, cookie):
url = "https://pc.ccava.net/zb_users/plugin/mochu_us/cmd.php?act=qiandao"
res = requests.get(url, headers={"Cookie": cookie}).json()
if "登录" in res["msg"]:
- msg = "cookie 失效"
elif "今天" in res["msg"]:
- msg = f'重复签到, 剩余 {res["giod"]} 月光币... |
codereview_new_python_data_3841 |
SUPPORTED_FUNCTIONS = [
"abs",
"acos",
There should be some comments to help people know this file is auto generated. Would be better to mention how it's generated.
+######################################################################
+# NOTE: This file is auto-generated by gen_function_list.sh.
+# Do no... |
codereview_new_python_data_3843 |
"avro<=1.11.1",
"azure-storage-file-datalake<=12.5.0",
"azure-synapse-spark<=0.7.0",
# fixing Azure Machine Learning authentication issue per https://stackoverflow.com/a/72262694/3193073
- "aiohttp==3.8.3", # pin to resolve Synapse import issue
"azure-identity>=1.8.... |
codereview_new_python_data_3844 | def __init__(self, config_path:str = "./feathr_config.yaml", local_workspace_dir
registry_delimiter = self.envutils.get_environment_variable_with_default('feature_registry', 'purview', 'delimiter')
# initialize the registry no matter whether we set purview name or not, given some of the metho... |
codereview_new_python_data_3845 | def add_new_dropoff_and_fare_amount_column(df: DataFrame):
client.build_features(anchor_list=[agg_anchor, request_anchor], derived_feature_list=derived_feature_list)
return client
-def registry_test_setup_update(config_path: str, project_name: str):
now = datetime.now()
os.environ["project_config... |
codereview_new_python_data_3846 | def _upload_single_entity(self, entity:AtlasEntity):
else:
raise ConflictError("The requested entity %s conflicts with the existing entity in PurView" % j["attributes"]["qualifiedName"])
except AtlasException as e:
- print("XXXXXX", e)
pass
enti... |
codereview_new_python_data_3847 | def get_result_df(client: FeathrClient, format: str = None, res_url: str = None,
def copy_files(client: FeathrClient, source_url: str, target_url: str = None):
source_url: str = source_url or client.get_job_result_uri(block=True, timeout_sec=1200)
- if source_url is None or target_url is None:
rais... |
codereview_new_python_data_3848 | class MaterializationSettings:
sinks: sinks where the materialized features should be written to
feature_names: list of feature names to be materialized
backfill_time: time range and frequency for the materialization. Default to now().
"""
def __init__(self, name: str, sinks: List[... |
codereview_new_python_data_3849 | def wait_for_completion(self, timeout_seconds: Optional[float]) -> bool:
logger.error("Feathr job has failed.")
error_msg = self._api.get_driver_log(self.current_job_info.id).decode('utf-8')
logger.error(error_msg)
- logger.error("The size of the whole ... |
codereview_new_python_data_3850 | def delete_entity(entity: str):
downstream_entities = registry.get_dependent_entities(entity_id)
if len(downstream_entities) > 0:
raise HTTPException(
- status_code=500, detail=f"""Entity cannot be deleted as it has downstream/dependent entities.
Entities: {list([e.qualified_n... |
codereview_new_python_data_3851 | def delete_entity(entity: str):
downstream_entities = registry.get_dependent_entities(entity_id)
if len(downstream_entities) > 0:
raise HTTPException(
- status_code=500, detail=f"""Entity cannot be deleted as it has downstream/dependent entities.
Entities: {list([e.qualified_... |
codereview_new_python_data_3852 | def get_version():
# Decouple Feathr MAVEN Version from Feathr Python SDK Version
import os
-def get_maven_artifact():
- maven_version = os.environ.get("FEATHR_MAVEN_VERSION", __version__)
- return f"com.linkedin.feathr:feathr_2.12:{maven_version}"
\ No newline at end of file
\ No newline at end of file
Mig... |
codereview_new_python_data_3853 | def get_version():
# Decouple Feathr MAVEN Version from Feathr Python SDK Version
import os
-def get_maven_artifact():
- maven_version = os.environ.get("FEATHR_MAVEN_VERSION", __version__)
- return f"com.linkedin.feathr:feathr_2.12:{maven_version}"
\ No newline at end of file
\ No newline at end of file
Sug... |
codereview_new_python_data_3854 | def to_feature_config(self) -> str:
{% if source.sql is defined %}
sql: "{{source.sql}}"
{% elif source.table is defined %}
- sql: "{{source.table}}"
{% endif %}
}
{% if source.event... |
codereview_new_python_data_3855 |
# it brings a different version of msrest(0.7.0) which is incompatible with azure-core==1.22.1. Hence we need to pin it.
# See this for more details: https://github.com/Azure/azure-sdk-for-python/issues/24765
"msrest<=0.6.21",
- "typing_extensions>=4.2.0",
- "aws-requests-auth>... |
codereview_new_python_data_3856 | def save_to_feature_config_from_context(self, anchor_list, derived_feature_list,
def default_registry_client(project_name: str, config_path:str = "./feathr_config.yaml", project_registry_tag: Dict[str, str]=None, credential = None) -> FeathrRegistry:
from feathr.registry._feathr_registry_client import _FeatureRe... |
codereview_new_python_data_3857 | def test_feathr_online_store_agg_features():
if client.spark_runtime == 'databricks':
output_path = ''.join(['dbfs:/feathrazure_cijob','_', str(now.minute), '_', str(now.second), ".avro"])
else:
- output_path = ''.join(['abfss://feathrazuretest3fs@xchfeathrtest4sto.dfs.core.windows.net/demo_d... |
codereview_new_python_data_3858 | class FeathrModel(BaseModel):
"""
displayName: str # name of the entity showed on UI
typeName: str # type of entity in str format, will be displayed in UI
- # Represents zero, one or multiple keyPlaceholderRefs which are used as the
- # identifiers to reference KeyPlaceholders of the FeatureSour... |
codereview_new_python_data_3859 | class SlidingWindowEmbeddingAggregationType(Enum):
class WindowTimeUnit(Enum):
"""
- Represents a unit of time.
"""
DAY = "day"
HOUR = "hour"
nit: fix spacing
class SlidingWindowEmbeddingAggregationType(Enum):
class WindowTimeUnit(Enum):
"""
+ Represents a unit of time.
""... |
codereview_new_python_data_3860 |
import pandas as pd
from pyspark.sql import DataFrame, SparkSession
from feathr.datasets.utils import maybe_download
from feathr.utils.platform import is_databricks
-NYC_TAXI_SMALL_URL = (
- "https://azurefeathrstorage.blob.core.windows.net/public/sample_data/green_tripdata_2020-04_with_index.csv"
-)
-
-
... |
codereview_new_python_data_3862 | def _parse_function_str_for_name(fn_str: str) -> str:
return None
tree = ast.parse(fn_str)
if len(tree.body) != 1 or not isinstance(tree.body[0], ast.FunctionDef):
raise ValueError("provided code fragment is not a single function")
return tree.body[0].name
... |
codereview_new_python_data_3866 | class HdfsSource(Source):
registry_tags: A dict of (str, str) that you can pass to feature registry for better organization. For example, you can use {"deprecated": "true"} to indicate this source is deprecated, etc.
time_partition_pattern(Optional[str]): Format of the time partitioned feat... |
codereview_new_python_data_3867 | class HdfsSink(Sink):
"""Offline Hadoop HDFS-compatible(HDFS, delta lake, Azure blog storage etc) sink that is used to store feature data.
The result is in AVRO format.
- Incremental aggregation is enabled by default when using HdfsSink. Use incremental aggregation will significantly expedite the SWA f... |
codereview_new_python_data_3868 |
"confluent-kafka<=1.9.2",
"databricks-cli<=0.17.3",
"avro<=1.11.1",
- "azure-storage-file-datalake>=12.5.0",
"azure-synapse-spark<=0.7.0",
# fixing Azure Machine Learning authentication issue per https://stackoverflow.com/a/72262694/3193073
"azure-identity>=... |
codereview_new_python_data_3869 | def test_feathr_register_features_e2e(self):
config_paths = [
"feathr_config_registry_purview.yaml",
"feathr_config_registry_sql.yaml",
- "feathr_config_registry_sql_rbac.yaml"
]
for config_path in config_paths:
Should we have 4 tests? i.e.
sql
sql+... |
codereview_new_python_data_3871 |
Purpose of this is to decouple backend data models from API specific data models.
For each feature registry provider/implementation, they will extend this abstract
data models and backend API.
-Diagram of the data models:
"""
Just one suggestion, possible we use mermaid for this ... |
codereview_new_python_data_3872 | def parse_avro_result(output_path):
vertical_concat_df = pd.concat(dataframe_list, axis=0)
return vertical_concat_df
-
-if __name__ == "__main__":
- test_local_spark_get_offline_features()
-
remove this for e2e testing?
def parse_avro_result(output_path):
vertical_concat_df = pd.concat... |
codereview_new_python_data_3877 | class RelationshipType(Enum):
Consumes = 3
Produces = 4
-
- def __str__(self):
- return {
- RelationshipType.Contains: "Contains",
- RelationshipType.BelongsTo: "BelongsTo",
- RelationshipType.Consumes: "Consumes",
- RelationshipType.Produces: "Produces... |
codereview_new_python_data_3878 |
import json
from typing import Dict, List, Optional
from jinja2 import Template
-from pymysql import paramstyle
from feathr.definition.feathrconfig import HoconConvertible
Remove pymysql as current code does not use it
import json
from typing import Dict, List, Optional
from jinja2 import Template
from ... |
codereview_new_python_data_3879 |
class BackfillTime:
- """Time range to materialize/backfill feature data. Please refer to https://github.com/linkedin/feathr/blob/main/docs/concepts/materializing-features.md#feature-backfill for a more detailed explanation.
Attributes:
start: start time of the backfill, inclusive.
https://lin... |
codereview_new_python_data_3880 | def _register_feathr_feature_types(self):
superTypes=["DataSet"],
)
new_entitydefs = [type_feathr_anchor_features, type_feathr_anchors,
type_feathr_derived_features, type_feathr_sources, type_feathr_project]
new_entitydefs_names = [entity.name for enti... |
codereview_new_python_data_3881 | class WindowAggTransformation(Transformation):
agg_func: aggregation function. Available values: `SUM`, `COUNT`, `MAX`, `MIN`, `AVG`, `MAX_POOLING`, `MIN_POOLING`, `AVG_POOLING`, `LATEST`
window: Time window length to apply the aggregation. support 4 type of units: d(day), h(hour), m(minute), s(secon... |
codereview_new_python_data_3882 | def _get_user_from_token(decoded_token: Mapping) -> User:
except Exception as e:
raise InvalidAuthorization(detail=f'Unable to extract subject as unique id from token, {e}')
- print(decoded_token)
-
aad_user_key = "preferred_username"
aad_app_key = "appid"
comm... |
codereview_new_python_data_3883 | def __init__(self,
def validate_feature(self):
"""Validate the derived feature is valid"""
- # Validate key alias
input_feature_key_alias = []
for feature in self.input_features:
- input_feature_key_alias.extend(feature.key_alias)
for key_alias in self.key_a... |
codereview_new_python_data_3884 |
env_file = os.path.join("registry", "access_control", ".env")
config = Config(os.path.abspath(env_file))
-def _get_config(key:str, default:str = "", config:Config = config):
- return os.environ.get(key) or config.get(key, default=default)
# API Settings
-RBAC_API_BASE: str = _get_config("RBAC_API_BASE", defa... |
codereview_new_python_data_3885 | def get_result_df(client: FeathrClient, format: str = None, res_url: str = None,
format: format override, could be "parquet", "delta", etc.
res_url: output URL to download files. Note that this will not block the job so you need to make sure the job is finished and result URL contains actual data.
"""... |
codereview_new_python_data_3886 | def get_result_df(client: FeathrClient, format: str = None, res_url: str = None,
format: format override, could be "parquet", "delta", etc.
res_url: output URL to download files. Note that this will not block the job so you need to make sure the job is finished and result URL contains actual data.
"""... |
codereview_new_python_data_3887 | def get_result_df(client: FeathrClient, format: str = None, res_url: str = None,
tmp_dir = tempfile.TemporaryDirectory()
local_dir_path = tmp_dir.name
- client.feathr_spark_laucher.download_result(result_path=res_url, local_folder=local_dir_path)
dataframe_list = []
# by defaul... |
codereview_new_python_data_3888 | def submit_feathr_job(self, job_name: str, main_jar_path: str, main_class_name:
submission_params['new_cluster']['spark_conf'] = configuration
submission_params['new_cluster']['custom_tags'] = job_tags
# the feathr main jar file is anyway needed regardless it's pyspark or scala spar... |
codereview_new_python_data_3889 | def search_entity(self,
project: Optional[Union[str, UUID]] = None) -> list[EntityRef]:
pass
-
-if __name__ == '__main__':
- print("foo bar")
-else:
- print("spam")
remove this part
def search_entity(self,
project: Optional[Union[str, UUID]] = None) -> ... |
codereview_new_python_data_3896 | def _parse_anchors(self, anchor_list: List[FeatureAnchor]) -> List[AtlasEntity]:
anchors_batch.append(anchor_entity)
return anchors_batch
- def _merge_anchor(self,original_anchor:dict, new_anchor:dict)->dict[str,any]:
- print('gua?')
'''
Merge the new anchors defined... |
codereview_new_python_data_3899 | def to_feature_config(self) -> str:
return msg
-class OfflineSink(Sink):
"""Offline Hadoop HDFS-compatible(HDFS, delta lake, Azure blog storage etc) sink that is used to store feature data.
The result is in AVRO format.
Should we call it HDFSSink instead? Since we might also need to sink it t... |
codereview_new_python_data_3900 |
from .lookup_feature import LookupFeature
from .aggregation import Aggregation
from .feathr_configurations import SparkExecutionConfiguration
-from feathr.api.app.core.feathr_api_exception import *
\ No newline at end of file
\ No newline at end of file
I made the call that the exceptions in [feathr.api.app.core.f... |
codereview_new_python_data_3901 |
from urllib.parse import urlparse
from os.path import basename
from enum import Enum
-from azure.identity import DefaultAzureCredential
-
from azure.identity import (ChainedTokenCredential, DefaultAzureCredential,
DeviceCodeCredential, EnvironmentCredential,
... |
codereview_new_python_data_3902 |
from pathlib import Path
from typing import Dict, List, Optional, Union
from pprint import pprint
-from xmlrpc.client import Boolean
import redis
from azure.identity import DefaultAzureCredential
this seems wrong wrong?
from pathlib import Path
from typing import Dict, List, Optional, Union
from pprint im... |
codereview_new_python_data_3903 | def get_offline_features(self,
else:
raise RuntimeError("Please call FeathrClient.build_features() first in order to get offline features")
- # Pretty print anchor list and derived_feature_list
if verbose:
- if self.anchor_list:
- FeaturePrinter... |
codereview_new_python_data_3904 |
from pathlib import Path
from pyspark.sql.functions import col,sum,avg,max
from feathr.utils.job_utils import get_result_df
-from feathr.feature_definition.anchor import FeatureAnchor
-from feathr.feature_definition.dtype import STRING, BOOLEAN, FLOAT, INT32, ValueType
-from feathr.feature_definition.feature import... |
codereview_new_python_data_3905 | def wait_for_completion(self, timeout_seconds: Optional[int] = 600) -> bool:
elif status in {'INTERNAL_ERROR', 'FAILED', 'TIMEDOUT', 'CANCELED'}:
result = RunsApi(self.api_client).get_run_output(self.res_job_id)
# See here for the returned fields: https://docs.microsoft.c... |
codereview_new_python_data_3906 | def wait_for_completion(self, timeout_seconds: Optional[int] = 600) -> bool:
elif status in {'INTERNAL_ERROR', 'FAILED', 'TIMEDOUT', 'CANCELED'}:
result = RunsApi(self.api_client).get_run_output(self.res_job_id)
# See here for the returned fields: https://docs.microsoft.c... |
codereview_new_python_data_3907 | def wait_for_completion(self, timeout_seconds: Optional[int] = 600) -> bool:
elif status in {'INTERNAL_ERROR', 'FAILED', 'TIMEDOUT', 'CANCELED'}:
result = RunsApi(self.api_client).get_run_output(self.res_job_id)
# See here for the returned fields: https://docs.microsoft.c... |
codereview_new_python_data_3908 |
# The short X.Y version
version = '0.4'
# The full version, including alpha/beta/rc tags
-release = '0.4_azure_alpha'
# -- General configuration ---------------------------------------------------
should we just say 0.4?
# The short X.Y version
version = '0.4'
# The full version, including alpha/beta/rc ... |
codereview_new_python_data_3909 |
'pytest',
],
extras_require={
- 'pyspark': ["pyspark>=3.1.2",],
},
entry_points={
'console_scripts': ['feathr=feathrcli.cli:cli']
we shoud name it something as full_dependency or full instead of pyspark as we may have more heavy depdencies in the future that goes into this... |
codereview_new_python_data_3910 | def add_new_dropoff_and_fare_amount_column(df: DataFrame):
def get_online_test_table_name(table_name: str):
# use different time for testing to avoid write conflicts
now = datetime.now()
- return ''.join([table_name,'_', str(now.minute), '_', str(now.second)])
\ No newline at end of file
\ No newline at ... |
codereview_new_python_data_3911 |
from loguru import logger
from azure.core.exceptions import ResourceNotFoundError
-class akvClient:
def __init__(self, akv_name: str):
self.akv_name = akv_name
self.secret_client = None
[nitpick] - Suggest changing it to more descriptive name AzureKeyVaultClient, the way we have for Purview... |
codereview_new_python_data_3912 | def snowflake_test_setup(config_path: str):
def registry_test_setup(config_path: str):
- # use a new project name every time to make sure if all features are registered correctly no
now = datetime.now()
os.environ["project_config__project_name"] = ''.join(['feathr_ci','_', str(now.minute), '_', str(... |
codereview_new_python_data_3913 | def __str__(self):
class KafkaConfig:
def __init__(self, brokers: List[str], topics: List[str], schema: SourceSchema):
self.brokers = brokers
self.topics = topics
doc
def __str__(self):
class KafkaConfig:
+ """Kafka config for a streaming source
+ Attributes:
+ brokers:... |
codereview_new_python_data_3914 | def __init__(self, config_path:str = "./feathr_config.yaml", local_workspace_dir
# Kafka configs
self.kafka_endpoint = envutils.get_environment_variable_with_default(
- 'offline_store', 'kafka', 'kafka_endpoint')
# spark configs
self.output_num_parts = envutils.get_en... |
codereview_new_python_data_3918 | def validate_features(self):
if self.source != INPUT_CONTEXT:
for feature in self.features:
if feature.key == [DUMMY_KEY]:
- raise RuntimeError(f"For Non INPUT_CONTEXT(PASSTHROUGH) anchors, key of feature {feature.name} "
- ... |
codereview_new_python_data_3919 | def submit_spark_job(feature_names_funcs):
print(scala_dataframe)
# Need to convert java DataFrame into python DataFrame
py_df = DataFrame(scala_dataframe, sql_ctx)
- print("Corresponding py_df: ")
- print(py_df)
- py_df.show(10)
# Preprocess the DataFrame via U... |
codereview_new_python_data_3920 | def submit_spark_job(feature_names_funcs):
print(scala_dataframe)
# Need to convert java DataFrame into python DataFrame
py_df = DataFrame(scala_dataframe, sql_ctx)
- print("Corresponding py_df: ")
- print(py_df)
- py_df.show(10)
# Preprocess the DataFrame via U... |
codereview_new_python_data_3921 | def submit_spark_job(feature_names_funcs):
print(scala_dataframe)
# Need to convert java DataFrame into python DataFrame
py_df = DataFrame(scala_dataframe, sql_ctx)
- print("Corresponding py_df: ")
- print(py_df)
- py_df.show(10)
# Preprocess the DataFrame via U... |
codereview_new_python_data_3923 |
"google>=3.0.0",
"graphlib_backport",
"google-api-python-client>=2.41.0",
],
tests_require=[
'pytest',
The license seems not compatible with Apache 2?
"google>=3.0.0",
"graphlib_backport",
"google-api-python-client>=2.41.0",
+ "azure-ke... |
codereview_new_python_data_3924 | class FeatureAnchor:
name: Unique name of the anchor.
source: data source that the features are anchored to. Should be either of `INPUT_CONTEXT` or `feathr.source.Source`
features: list of features within this anchor.
- registry_tags: A dict of (str, str) that you can pass to feature... |
codereview_new_python_data_3925 | def add_new_dropoff_and_fare_amount_column(df: DataFrame):
derived_feature_list = [
f_trip_time_distance, f_trip_time_rounded, f_trip_time_rounded_plus]
- random.shuffle(derived_feature_list)
# shuffule the order to make sure they can be parsed correctly
client.build_fe... |
codereview_new_python_data_3926 | class FeatureAnchor:
name: Unique name of the anchor.
source: data source that the features are anchored to. Should be either of `INPUT_CONTEXT` or `feathr.source.Source`
features: list of features within this anchor.
- registry_tags: A dict of (str, str) that you can pass to feature... |
codereview_new_python_data_3927 | class DerivedFeature(FeatureBase):
key: All features with corresponding keys that this derived feature depends on
input_features: features that this derived features depends on
transform: transformation that produces the derived feature value, based on the input_features
- registry_ta... |
codereview_new_python_data_3938 | def __init__(self,
self.timestamp_format = timestamp_format
self.observation_path = observation_path
if observation_path.startswith("http"):
- logger.warning("Your observation_path starts with http, which might not work in Spark. Consider using paths starting with wasb[s]/abfs[s]/... |
codereview_new_python_data_3939 | def upload_file(self, src_file_path)-> str:
def download_file(self, target_adls_directory: str, local_dir_cache: str):
"""
- Download file to a local cache. Supporting download a folder and the content in its subfolder
Args:
target_adls_directory (str): target ADLS direct... |
codereview_new_python_data_3944 |
REDIS_PASSWORD = 'REDIS_PASSWORD'
# 1MB = 1024*1024
-DATABRICKS_MB_BYTES = 1048576
\ No newline at end of file
\ No newline at end of file
this isn't databrics specific so no need to say databricks.
REDIS_PASSWORD = 'REDIS_PASSWORD'
# 1MB = 1024*1024
\ No newline at end of file
+MB_BYTES = 1048576
\ No newl... |
codereview_new_python_data_3945 | def download_result(self, result_path: str, local_folder: str):
"""
Supports downloading files from the result folder. Only support paths starts with `dbfs:/` and only support downloading files in one folder (per Spark's design, everything will be in the result folder in a flat manner)
"""
-... |
codereview_new_python_data_3946 |
from enum import Enum
class Aggregation(Enum):
NOP = 0
AVG = 1
MAX = 2
MIN = 3
SUM = 4
UNION = 5
ELEMENTWISE_AVG = 6
ELEMENTWISE_MIN = 7
ELEMENTWISE_MAX = 8
ELEMENTWISE_SUM = 9
LATEST = 10
\ No newline at end of file
explain what does each aggregation do
f... |
codereview_new_python_data_3947 |
-from feathr.feature import Feature
-from feathr.lookup_feature import LookupFeature
-from feathr.dtype import FLOAT, FLOAT_VECTOR, ValueType, INT32_VECTOR
-from feathr.typed_key import TypedKey
-
-from feathr.aggregation import Aggregation
def assert_config_equals(one, another):
assert one.translate(str.maket... |
codereview_new_python_data_3948 | def _get_sql_config_str(self):
return config_str
def _get_snowflake_config_str(self):
- """Construct the Snowflake config string for jdbc. The dbtable (query), user, password and other parameters can be set via
- environment variables."""
sf_url = self.envutils.get_environment_va... |
codereview_new_python_data_3949 |
"pandas",
"redis",
"requests",
- "scikit-learn",
"pyapacheatlas",
"pyhocon",
"pandavro",
"python-snappy",
"pyyaml",
"Jinja2",
"google",
"google-api-python-client"
],
entry_points={
'console_scri... |
codereview_new_python_data_3955 | def _get_sql_config_str(self):
""".format(JDBC_TABLE=table, JDBC_USER=user, JDBC_PASSWORD=password)
return config_str
- def sync_features(self, project_name):
""" Sync features from the registry given a project name """
self.registry.sync_features_from_registry(projec... |
codereview_new_python_data_3956 | def list_registered_features(self, project_name: str = None) -> List[str]:
return feature_list
- def sync_features_from_registry(self, project_name: str, workspace_path: str):
"""[Sync Features from registry to local workspace, given a project_name, will write project's features from regis... |
codereview_new_python_data_3957 | def _get_sql_config_str(self):
return config_str
def get_features_from_registry(self, project_name):
- """ Sync features from the registry given a project name """
self.registry.get_features_from_registry(project_name, os.path.abspath("./"))
\ No newline at end of file
Is this by... |
codereview_new_python_data_4000 | def run(self):
# in DynamicRequirements and optionally define a custom complete method
def custom_complete(complete_fn):
# example: Data() stores all outputs in the same directory, so avoid doing len(data) fs
- # calls but rather check the only the first, and compare basenames... |
codereview_new_python_data_4002 | def contents(self):
#
# @param self A file object.
- def length(self):
return vine_file_length(self._file)
##
Suggest the more pythonic `def __len__(self)`. Code then calls `len(File(...))`
def contents(self):
#
# @param self A file object.
+ def __l... |
codereview_new_python_data_4003 | class FileBuffer(File):
# @param buffer The contents of the buffer, or None for an empty output buffer.
def __init__(self, buffer=None):
- if buffer is None:
- self._file = vine_file_buffer(None,0);
else:
- buffer = str(buffer)
self._file = vine_file_b... |
codereview_new_python_data_4004 | class FileBuffer(File):
# @param buffer The contents of the buffer, or None for an empty output buffer.
def __init__(self, buffer=None):
- if buffer is None:
- self._file = vine_file_buffer(None,0);
else:
- buffer = str(buffer)
self._file = vine_file_b... |
codereview_new_python_data_4005 |
sys.exit(1)
print("listening on port", m.port)
- m.enable_debug_log("manager.log")
-
temp_files = []
for i in range(0, 36):
temp_files.append(vine.FileTemp())
enable_debug_log not there anymore.
Logs always in `vine-run-info/%Y-%m-%dT%H:%M:%S` (see https://cctools.readthedocs.... |
codereview_new_python_data_4012 | def remote_wrapper(event, q=None):
def send_configuration(config):
config_string = json.dumps(config)
- print(len(config_string) + 1, "\\n", config_string + "\\n", flush=True)
def main():
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
The print is sending itself a newline, is this intended?
... |
codereview_new_python_data_4016 | def _clear_widgets(self):
self.keystring, self.prog, self.clock, *self._text_widgets]:
assert isinstance(widget, QWidget)
if widget in [self.prog, self.backforward]:
- widget.enabled=False
widget.hide()
self._hbox.removeWidget(w... |
codereview_new_python_data_4140 |
def main():
- for project in ('.', 'op-wheel'):
print(f'Updating {project}...')
update_mod(project)
Note that `indexer/go.mod` also references op-geth but wasn't previously included in the list to update. Should it be added here?
def main():
+ for project in ('.', 'op-wheel', 'indexer'):
print... |
codereview_new_python_data_4191 | class DumpDetResults(DumpResults):
segmentation masks into RLE format.
Args:
- keep_gt (bool): Whether dumped `gt_instances` simultaneously. It
should be True if offline VOCMetric is used. Defaults to False.
keep_gt_ignore (bool): Whether dumped `ignored_instances`
... |
codereview_new_python_data_4192 | def _forward(self,
mask_outs = self.mask_head.forward(x)
else:
mask_outs = self.mask_head.forward(x, positive_infos)
- outs = outs + (mask_outs[0], )
return outs
def loss(self, batch_inputs: Tensor, batch_data_samples: SampleList,
Can we add some comments abov... |
codereview_new_python_data_4193 | def forward(self, x: Tuple[Tensor], rpn_results_list: InstanceList,
batch_img_metas=batch_img_metas,
batch_gt_instances=batch_gt_instances)
bbox_results.pop('loss_bbox')
bbox_results.pop('results_list')
bbox_res = bbox_results... |
codereview_new_python_data_4194 | def _forward(self,
mask_outs = self.mask_head.forward(x)
else:
mask_outs = self.mask_head.forward(x, positive_infos)
- # YOLACT segmentation branch,
- # if not training will not process the forward function.
- if hasattr(self.mask_head, 'segm_branch') and not sel... |
codereview_new_python_data_4195 | def forward(self, x: Tuple[Tensor], rpn_results_list: InstanceList,
batch_img_metas=batch_img_metas,
batch_gt_instances=batch_gt_instances)
bbox_results.pop('loss_bbox')
- # JIT don't support type SamplingResult
bbox_results.pop... |
codereview_new_python_data_4196 | def main(args):
logger.info(f'Processing: {model_name}')
- http_prefix = 'https://download.openmmlab.com/mmclassification/'
if args.checkpoint_root is not None:
root = args.checkpoint_root
if 's3://' in args.checkpoint_root:
mmcls or mmdet?
def main(args):
... |
codereview_new_python_data_4197 | def inference(args, logger):
# 2. load a picture from the dataset
# In two stage detectors, _forward need batch_samples to get
# rpn_results_list, then use rpn_results_list to compute flops,
- # so only support use the second way.
try:
model = MODELS.build(cfg.model)
if torch.c... |
codereview_new_python_data_4198 | class DetDataPreprocessor(ImgDataPreprocessor):
boxtype2tensor (bool): Whether to keep the ``BaseBoxes`` type of
bboxes data or not. Defaults to True.
non_blocking (bool): Whether block current process
- when transferring data to device. New in version v0.3.0.
- Def... |
codereview_new_python_data_4199 |
class DumpDetResults(DumpResults):
"""Dump model predictions to a pickle file for offline evaluation.
Args:
out_file_path (str): Path of the dumped file. Must end with '.pkl'
or '.pickle'.
Might indicate what is the difference between it and the DumpResults.
class DumpDetResults(... |
codereview_new_python_data_4200 |
train_pipeline = [
dict(
type='LoadImageFromFile',
- file_client_args={{_base_.file_client_args}},
imdecode_backend=backend),
dict(type='LoadAnnotations', with_bbox=True, with_mask=False),
dict(type='RandomFlip', prob=0.5),
```suggestion
file_client_args=_base_.file_c... |
codereview_new_python_data_4201 |
train_pipeline = [
dict(
type='LoadImageFromFile',
- file_client_args={{_base_.file_client_args}},
imdecode_backend=backend),
dict(type='LoadAnnotations', with_bbox=True, with_mask=False),
dict(type='RandomFlip', prob=0.5),
```suggestion
dict(type='LoadAnnotations', with_... |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 3