query stringlengths 9 9.05k | document stringlengths 10 222k | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Set appointment's end time; Create new appointment and rendere result | def appointment_end_time(end_time):
session.attributes['end_time'] = str(end_time)
form = AppointmentForm(session.attributes)
form.submit()
return render_result(form) | [
"def appointment_time(begin_time):\n\n session.attributes['begin_time'] = str(begin_time)\n msg = render_template('end_date')\n return question(msg)",
"def appointment_end_date(end_date):\n\n session.attributes['end_date'] = str(end_date)\n msg = render_template('end_time')\n return question(msg... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Significant duration model by Abrahamson and Silva (1996) Empirical ground motion models, report prepared for Brookhaven National Laboratory. Input | def abrahamson_silva_ds_1999(magnitude=7.0,distance=10.0,soil=True,duration_type='DS575H'):
# map the duration_type to integer key
dur_map = {'DS575H': 0,
'DS575V': 1,
'DS595H': 2,
'DS595V': 3}
dur_tag = dur_map.get(duration_type.upper(),None)
if dur_tag is... | [
"def residence_time(self):\r\n if self.model == \"exponential\":\r\n return self.model_params[1] / np.log(2)\r\n elif self.model == \"biexponential\":\r\n fraction1 = self.model_params[1]\r\n return (\r\n (fraction1 * self.model_params[2])\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Make n bars dataframe seeing past n bars. The row size of `df` must be greater than or equal to `n_bars`, or raise ValueError. | def make_nbars_past(df: pd.DataFrame, n_bars: int, cols: List[str] = ['Close'], datetime_col: Union[str, None] = 'Date') -> pd.DataFrame:
if df.shape[0] < n_bars + 1:
raise ValueError(
f'row size of the df (={df.shape[0]}) must be greater than or equal to n_bars + 1 (={n_bars + 1})')
df = df... | [
"def make_nbars_future(df: pd.DataFrame, n_bars: int, cols: List[str] = ['Close'], datetime_col: Union[str, None] = 'Date') -> pd.DataFrame:\n if df.shape[0] < n_bars + 1:\n raise ValueError(\n f'row size of the df (={df.shape[0]}) must be greater than or equal to n_bars + 1 (={n_bars + 1})')\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Make n bars dataframe seeing future n bars. The row size of `df` must be greater than or equal to `n_bars`, or raise ValueError. | def make_nbars_future(df: pd.DataFrame, n_bars: int, cols: List[str] = ['Close'], datetime_col: Union[str, None] = 'Date') -> pd.DataFrame:
if df.shape[0] < n_bars + 1:
raise ValueError(
f'row size of the df (={df.shape[0]}) must be greater than or equal to n_bars + 1 (={n_bars + 1})')
df = ... | [
"def make_nbars_past(df: pd.DataFrame, n_bars: int, cols: List[str] = ['Close'], datetime_col: Union[str, None] = 'Date') -> pd.DataFrame:\n if df.shape[0] < n_bars + 1:\n raise ValueError(\n f'row size of the df (={df.shape[0]}) must be greater than or equal to n_bars + 1 (={n_bars + 1})')\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Usage When you call the DescribeDBInstanceEncryptionKey operation, the instance must have transparent data encryption (TDE) enabled in BYOK mode. You can call the [ModifyDBInstanceTDE](~~131267~~) operation to enable TDE. | def describe_dbinstance_encryption_key_with_options(
self,
request: dds_20151201_models.DescribeDBInstanceEncryptionKeyRequest,
runtime: util_models.RuntimeOptions,
) -> dds_20151201_models.DescribeDBInstanceEncryptionKeyResponse:
UtilClient.validate_model(request)
query = {}... | [
"def describe_dbinstance_encryption_key(\n self,\n request: dds_20151201_models.DescribeDBInstanceEncryptionKeyRequest,\n ) -> dds_20151201_models.DescribeDBInstanceEncryptionKeyResponse:\n runtime = util_models.RuntimeOptions()\n return self.describe_dbinstance_encryption_key_with_op... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Usage When you call the DescribeDBInstanceEncryptionKey operation, the instance must have transparent data encryption (TDE) enabled in BYOK mode. You can call the [ModifyDBInstanceTDE](~~131267~~) operation to enable TDE. | def describe_dbinstance_encryption_key(
self,
request: dds_20151201_models.DescribeDBInstanceEncryptionKeyRequest,
) -> dds_20151201_models.DescribeDBInstanceEncryptionKeyResponse:
runtime = util_models.RuntimeOptions()
return self.describe_dbinstance_encryption_key_with_options(requ... | [
"def describe_dbinstance_encryption_key_with_options(\n self,\n request: dds_20151201_models.DescribeDBInstanceEncryptionKeyRequest,\n runtime: util_models.RuntimeOptions,\n ) -> dds_20151201_models.DescribeDBInstanceEncryptionKeyResponse:\n UtilClient.validate_model(request)\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
You can use the custom key obtained by calling the DescribeUserEncryptionKeyList operation to enable TDE. For more information, see [ModifyDBInstanceTDE](~~131267~~). | def describe_user_encryption_key_list_with_options(
self,
request: dds_20151201_models.DescribeUserEncryptionKeyListRequest,
runtime: util_models.RuntimeOptions,
) -> dds_20151201_models.DescribeUserEncryptionKeyListResponse:
UtilClient.validate_model(request)
query = {}
... | [
"def describe_dbinstance_encryption_key_with_options(\n self,\n request: dds_20151201_models.DescribeDBInstanceEncryptionKeyRequest,\n runtime: util_models.RuntimeOptions,\n ) -> dds_20151201_models.DescribeDBInstanceEncryptionKeyResponse:\n UtilClient.validate_model(request)\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This operation is available only for replica set instances that run MongoDB 4.2 or earlier and sharded cluster instances. If you have applied for a public endpoint for the ApsaraDB for MongoDB instance, you must call the [ReleasePublicNetworkAddress](~~67604~~) operation to release the public endpoint before you call t... | def migrate_available_zone_with_options(
self,
request: dds_20151201_models.MigrateAvailableZoneRequest,
runtime: util_models.RuntimeOptions,
) -> dds_20151201_models.MigrateAvailableZoneResponse:
UtilClient.validate_model(request)
query = {}
if not UtilClient.is_unse... | [
"def migrate_available_zone(\n self,\n request: dds_20151201_models.MigrateAvailableZoneRequest,\n ) -> dds_20151201_models.MigrateAvailableZoneResponse:\n runtime = util_models.RuntimeOptions()\n return self.migrate_available_zone_with_options(request, runtime)",
"def test_replace_... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This operation is available only for replica set instances that run MongoDB 4.2 or earlier and sharded cluster instances. If you have applied for a public endpoint for the ApsaraDB for MongoDB instance, you must call the [ReleasePublicNetworkAddress](~~67604~~) operation to release the public endpoint before you call t... | def migrate_available_zone(
self,
request: dds_20151201_models.MigrateAvailableZoneRequest,
) -> dds_20151201_models.MigrateAvailableZoneResponse:
runtime = util_models.RuntimeOptions()
return self.migrate_available_zone_with_options(request, runtime) | [
"def migrate_available_zone_with_options(\n self,\n request: dds_20151201_models.MigrateAvailableZoneRequest,\n runtime: util_models.RuntimeOptions,\n ) -> dds_20151201_models.MigrateAvailableZoneResponse:\n UtilClient.validate_model(request)\n query = {}\n if not UtilCl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Precautions The instance must be in the Running state when you call this operation. If you call this operation to modify specific instance parameters and the modification for part of the parameters can take effect only after an instance restart, the instance is automatically restarted after this operation is called. Yo... | def modify_parameters_with_options(
self,
request: dds_20151201_models.ModifyParametersRequest,
runtime: util_models.RuntimeOptions,
) -> dds_20151201_models.ModifyParametersResponse:
UtilClient.validate_model(request)
query = {}
if not UtilClient.is_unset(request.cha... | [
"def source_instance_params(self) -> 'outputs.SourceInstanceParamsResponse':\n return pulumi.get(self, \"source_instance_params\")",
"def _apply_params(self):\n config = self.get_startup_config()\n # Pass true to _set_params so we know these are startup values\n self._set_params(config... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This operation can be used to release the internal endpoint of a shard or Configserver node in a sharded cluster instance. For more information, see [Release the endpoint of a shard or Configserver node](~~134067~~). To release the public endpoint of a shard or Configserver node in a sharded cluster instance, you can c... | def release_node_private_network_address(
self,
request: dds_20151201_models.ReleaseNodePrivateNetworkAddressRequest,
) -> dds_20151201_models.ReleaseNodePrivateNetworkAddressResponse:
runtime = util_models.RuntimeOptions()
return self.release_node_private_network_address_with_option... | [
"def release_public_ips(conn, public_ips_list):\n\n for addr in conn.get_all_addresses(addresses = public_ips_list):\n if addr.instance_id == '':\n addr.release()",
"def release_floating_ip(self, req, iface):\n # net_id it is not needed if there is just one port of the VM\n try:... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The instance must be in the running state when you call this operation. > The available database versions depend on the storage engine used by the instance. For more information, see [Upgrades of MongoDB major versions](~~398673~~). You can also call the [DescribeAvailableEngineVersion](~~141355~~) operation to query t... | def upgrade_dbinstance_engine_version(
self,
request: dds_20151201_models.UpgradeDBInstanceEngineVersionRequest,
) -> dds_20151201_models.UpgradeDBInstanceEngineVersionResponse:
runtime = util_models.RuntimeOptions()
return self.upgrade_dbinstance_engine_version_with_options(request,... | [
"def mongo_upgrade():\n if mongo.init():\n print \"Starting MongoDB migration.\"\n mongo.connect()\n\n # Check for schema version and create it.\n if \"cuckoo_schema\" in mongo.db.collection_names():\n print \"Mongo schema version not expected\"\n sys.exit()\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
When you call the UpgradeDBInstanceKernelVersion operation, the instance must be in the Running state. > The UpgradeDBInstanceKernelVersion operation is applicable to replica set and sharded cluster instances, but not to standalone instances. > The instance will be restarted once during the upgrade. Call this operation... | def upgrade_dbinstance_kernel_version(
self,
request: dds_20151201_models.UpgradeDBInstanceKernelVersionRequest,
) -> dds_20151201_models.UpgradeDBInstanceKernelVersionResponse:
runtime = util_models.RuntimeOptions()
return self.upgrade_dbinstance_kernel_version_with_options(request,... | [
"async def upgrade_dbinstance_kernel_version_async(\n self,\n request: dds_20151201_models.UpgradeDBInstanceKernelVersionRequest,\n ) -> dds_20151201_models.UpgradeDBInstanceKernelVersionResponse:\n runtime = util_models.RuntimeOptions()\n return await self.upgrade_dbinstance_kernel_v... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
When you call the UpgradeDBInstanceKernelVersion operation, the instance must be in the Running state. > The UpgradeDBInstanceKernelVersion operation is applicable to replica set and sharded cluster instances, but not to standalone instances. > The instance will be restarted once during the upgrade. Call this operation... | async def upgrade_dbinstance_kernel_version_async(
self,
request: dds_20151201_models.UpgradeDBInstanceKernelVersionRequest,
) -> dds_20151201_models.UpgradeDBInstanceKernelVersionResponse:
runtime = util_models.RuntimeOptions()
return await self.upgrade_dbinstance_kernel_version_wit... | [
"def upgrade_dbinstance_kernel_version(\n self,\n request: dds_20151201_models.UpgradeDBInstanceKernelVersionRequest,\n ) -> dds_20151201_models.UpgradeDBInstanceKernelVersionResponse:\n runtime = util_models.RuntimeOptions()\n return self.upgrade_dbinstance_kernel_version_with_option... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Use features and result to train Support Vector Machine | def train(features, result):
clf = grid_search(result)
clf.fit(features, result)
return clf | [
"def training(string):\n print(\"Training...\")\n vec = create_vector(string)\n print(\"Selecting features...\")\n feature_list = select_features(vec)\n print(\"Done!\")\n return feature_list",
"def svm():",
"def __trainLocal__(self, featureVals, targetVals):\n pass",
"def test_svm():\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
When a user asks for a potential_category, rank the possible categories by relevance and return the top match | def find_match(potential_category: str, categories: List[str]):
return process.extractOne(potential_category, categories)[0] | [
"def category(category, term):",
"def FoodRank(search_term):\n return _ranks[search_term.lower()]",
"def get_field(self, summary, category=\"nationality\"):\n known_set = self.sets[category]\n guess = [word\n for word in self.tokenizr.tokenize(summary)\n if word in... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the is_bot of this UserBase. A boolean specifying whether the user is a bot or full account. | def is_bot(self):
return self._is_bot | [
"def get_user_is_bot(self, user_id):\n if user_id == \"USLACKBOT\": return True # for some reason, Slack doesn't consider Slackbot a real bot\n user_info = self.get_user_info_by_id_cached(user_id)\n return user_info.get(\"is_bot\", False)",
"def bot_type(self):\n return self._bot_type"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the is_bot of this UserBase. A boolean specifying whether the user is a bot or full account. | def is_bot(self, is_bot):
self._is_bot = is_bot | [
"def is_bot(self):\n return self._is_bot",
"def get_user_is_bot(self, user_id):\n if user_id == \"USLACKBOT\": return True # for some reason, Slack doesn't consider Slackbot a real bot\n user_info = self.get_user_info_by_id_cached(user_id)\n return user_info.get(\"is_bot\", False)",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the avatar_url of this UserBase. | def avatar_url(self):
return self._avatar_url | [
"def get_user_avatar_url(self):\n if self.user_id:\n return self.session.project_client.service.getUserAvatarURL(\n self.user_id)\n else:\n raise PyleroLibException(\"The user object is empty\")",
"def get_avatar_url(self):\n return self.get_profile_pic(pi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the avatar_url of this UserBase. | def avatar_url(self, avatar_url):
self._avatar_url = avatar_url | [
"def users_set_avatar(self, avatar_url, **kwargs):\n if avatar_url.startswith('http://') or avatar_url.startswith('https://'):\n return self.__call_api_post('users.setAvatar', avatarUrl=avatar_url, kwargs=kwargs)\n else:\n avatar_file = {\"image\": open(avatar_url, \"rb\")}\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the avatar_version of this UserBase. Version for the user's avatar. Used for cachebusting requests for the user's avatar. Clients generally shouldn't need to use this; most avatar URLs sent by Zulip will already end with `?v={avatar_version}`. | def avatar_version(self):
return self._avatar_version | [
"def avatar_version(self, avatar_version):\n\n self._avatar_version = avatar_version",
"def GetAvatar(self):\n\n return self.__GetJsonOrNone(\"/users/\"+self.userName+\"/avatar\", False)",
"def avatar(self):\n # This is lazy loaded and cached, so it won't affect performances if\n # y... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the avatar_version of this UserBase. Version for the user's avatar. Used for cachebusting requests for the user's avatar. Clients generally shouldn't need to use this; most avatar URLs sent by Zulip will already end with `?v={avatar_version}`. | def avatar_version(self, avatar_version):
self._avatar_version = avatar_version | [
"def avatar_version(self):\n return self._avatar_version",
"def users_set_avatar(self, avatar_url, **kwargs):\n if avatar_url.startswith('http://') or avatar_url.startswith('https://'):\n return self.__call_api_post('users.setAvatar', avatarUrl=avatar_url, kwargs=kwargs)\n else:\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the is_admin of this UserBase. A boolean specifying whether the user is an organization administrator. | def is_admin(self, is_admin):
self._is_admin = is_admin | [
"def is_admin(self, is_admin: bool):\n if is_admin is None:\n raise ValueError(\"Invalid value for `is_admin`, must not be `None`\") # noqa: E501\n\n self._is_admin = is_admin",
"def is_admin(self) -> bool:\n return pulumi.get(self, \"is_admin\")",
"def is_billing_admin(self, is... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the is_owner of this UserBase. | def is_owner(self):
return self._is_owner | [
"def is_user_is_owner(self):\n return self._tag == 'user_is_owner'",
"def get_isowner(self, obj):\n user = self.context.get('user')\n\n if not user.is_anonymous():\n return obj.creator == user\n\n return False",
"def is_owner(self, user: User) -> bool:\n return self... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the is_owner of this UserBase. | def is_owner(self, is_owner):
self._is_owner = is_owner | [
"def set_owner(self, owner):\n self.settings[\"owner\"] = owner",
"def set_owner(self, owner: Owner):\n ...",
"def is_user_is_owner(self):\n return self._tag == 'user_is_owner'",
"def owner_id(self, owner_id):\n self._owner_id = owner_id",
"def owner_type(self, owner_type):\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the is_billing_admin of this UserBase. | def is_billing_admin(self):
return self._is_billing_admin | [
"def is_billing_admin(self, is_billing_admin):\n\n self._is_billing_admin = is_billing_admin",
"def is_admin(self):\n if self.user is None:\n return False\n if unicode(self.user._id) in self.barcamp.admins:\n return True\n if self.user.is_admin:\n retur... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the is_billing_admin of this UserBase. | def is_billing_admin(self, is_billing_admin):
self._is_billing_admin = is_billing_admin | [
"def is_billing_admin(self):\n return self._is_billing_admin",
"def is_admin(self, is_admin):\n\n self._is_admin = is_admin",
"def is_admin(self, is_admin: bool):\n if is_admin is None:\n raise ValueError(\"Invalid value for `is_admin`, must not be `None`\") # noqa: E501\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the bot_type of this UserBase. | def bot_type(self):
return self._bot_type | [
"def chat_type(self) -> str:\n return self.user.chat_type.name",
"def user_type(self):\n return self._user_type",
"def lobby_type(self):\n return self._get(\"lobby_type\")",
"def gametype(self) -> Type[ba.GameActivity]:\n return self._gametype",
"def user_type(self):\n if ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the bot_type of this UserBase. | def bot_type(self, bot_type):
self._bot_type = bot_type | [
"def bot_type(self):\n return self._bot_type",
"def user_type(self, user_type):\n self._user_type = user_type",
"def set_type(self, rtype=ALL_USERS):\r\n self.type = rtype",
"def set_type(self, type):\n self.type = type",
"def is_bot(self, is_bot):\n\n self._is_bot = is_bo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the bot_owner_id of this UserBase. | def bot_owner_id(self):
return self._bot_owner_id | [
"def owner(self) -> None:\n return self.bot.get_user(self.bot.config.owner_ids[0])",
"def owner_id(self):\n return self._owner_id",
"def owner_id(self) -> int:\n return pulumi.get(self, \"owner_id\")",
"def owner_account_id(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the bot_owner_id of this UserBase. | def bot_owner_id(self, bot_owner_id):
self._bot_owner_id = bot_owner_id | [
"def _SetOwnerId(self, owner_id):\r\n assert owner_id is not None\r\n self._unique_id = owner_id\r\n self.owner_id = owner_id",
"def owner_id(self, owner_id):\n self._owner_id = owner_id",
"def bot_owner_id(self):\n return self._bot_owner_id",
"def set_owner(self, owner):\n self.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the is_guest of this UserBase. A boolean specifying whether the user is a guest user. | def is_guest(self):
return self._is_guest | [
"def is_guest(self) -> bool:\n value = self._data.get(\"IsGuest\")\n return isinstance(value, bool) and value",
"def get_guest(self):\n return self.get_user('guest')",
"def is_guest(self, is_guest):\n\n self._is_guest = is_guest",
"def get_guest_user():\n\n guest = User.quer... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the is_guest of this UserBase. A boolean specifying whether the user is a guest user. | def is_guest(self, is_guest):
self._is_guest = is_guest | [
"def is_guest(self) -> bool:\n value = self._data.get(\"IsGuest\")\n return isinstance(value, bool) and value",
"def guest(self, guest):\n if guest is None:\n raise ValueError(\"Invalid value for `guest`, must not be `None`\")\n\n self._guest = guest",
"def is_guest(self):... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the date_joined of this UserBase. The time the user account was created. | def date_joined(self):
return self._date_joined | [
"def get_latest_user(self):\n\n return User.objects.latest('date_joined')",
"def get_account_created_date(self):\n return self.account_created_date",
"def getJoiningTime(self):\n return self.__joinTime",
"def get_join_date(self, obj):\n return obj.join_date",
"def created_at(self... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the date_joined of this UserBase. The time the user account was created. | def date_joined(self, date_joined):
self._date_joined = date_joined | [
"def date_joined(self):\n return self._date_joined",
"def test_user_creation_old_date_joined(self):\n new_user = self.registration_profile.objects.create_inactive_user(\n site=Site.objects.get_current(), **self.user_info)\n self.assertEqual(new_user.get_username(), 'alice')\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the delivery_email of this UserBase. The user's real email address. This field is present only if [email address visibility](/help/restrictvisibilityofemailaddresses) is limited and you are an administrator with access to real email addresses under the configured policy. | def delivery_email(self):
return self._delivery_email | [
"def get_user_email(self):\n member = self.get_user()\n if member:\n return member.getProperty('email')",
"def user_email(self):\n return self._user_email",
"def Get_Email( self ):\n\n return self._email_address",
"def customer_email(self):\n return self._customer_e... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the delivery_email of this UserBase. The user's real email address. This field is present only if [email address visibility](/help/restrictvisibilityofemailaddresses) is limited and you are an administrator with access to real email addresses under the configured policy. | def delivery_email(self, delivery_email):
self._delivery_email = delivery_email | [
"def delivery_email(self):\n return self._delivery_email",
"def delivery(self, delivery):\n if self.local_vars_configuration.client_side_validation and delivery is None: # noqa: E501\n raise ValueError(\"Invalid value for `delivery`, must not be `None`\") # noqa: E501\n\n self._d... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the profile_data of this UserBase. A dictionary containing custom profile field data for the user. Each entry maps the integer ID of a custom profile field in the organization to a dictionary containing the user's data for that field. Generally the data includes just a single `value` key; for those custom profile ... | def profile_data(self):
return self._profile_data | [
"def get_user_profile_raw(self):\n payload = {'access_token': self._lr_object.access.token}\n url = SECURE_API_URL + \"api/v2/userprofile/raw/\"\n return self._lr_object._get_json(url, payload)",
"def augment_user_data(self, data):\n user_id = data.get('id')\n if user_id:\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the profile_data of this UserBase. A dictionary containing custom profile field data for the user. Each entry maps the integer ID of a custom profile field in the organization to a dictionary containing the user's data for that field. Generally the data includes just a single `value` key; for those custom profile ... | def profile_data(self, profile_data):
self._profile_data = profile_data | [
"def set_profile_data(data, content_user):\n # create empty profile if none exists\n profile, _created = UserProfile.objects.get_or_create(user=content_user)\n location = \"\"\n if profile.city:\n location = profile.city\n if profile.country:\n if profile.city:\n location += ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check the northbound queue for RPC's queued by GUI or SOAP requests. A client should connect triggered by a CONNECTION_REQUEST and any RPC's queued by the northbound will be then added to the session queue by this function. | def add_nb_queue_to_session_queue(self, session):
rpc_list = []
client_id = get_element('cid', session['client'])
if client_id is not None and client_id in RPCS.Northbound_Queue:
# Check if all commands have been serviced
if RPCS.Northbound_Queue[client_id]:
... | [
"def check_in(self):\n etree = self._encapsulate_request(self._generate_ping())\n self.zmq_scheduler_request_queue.put_nowait(etree)",
"def _check_queue(self):\n self._process_incoming_queue_messages()\n self._root.after(200, self._check_queue)",
"def queryPrivilegedQueue(self, reque... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
When NB requests are queued put them in the session queue. If there are RPCs in queue to be sent, return prepared RPC and move to ExpectResponse. Otherwise, go to Listening and send a 'done' RPC. | def run(self, session):
rpc = None
if session['client']['event'] == 'CONNECTION_REQUEST':
self.add_nb_queue_to_session_queue(session)
while rpc is None and session['queue']:
try:
# Loop through queue until there is an RPC to send, or until
... | [
"def add_nb_queue_to_session_queue(self, session):\n rpc_list = []\n client_id = get_element('cid', session['client'])\n\n if client_id is not None and client_id in RPCS.Northbound_Queue:\n # Check if all commands have been serviced\n if RPCS.Northbound_Queue[client_id]:\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function determines the common supported protocol version. This is determined by a version supported by the RPCS server that is in the range of numbers that exist between the value of the first integer of the earliest supported protocol version and the value of the first integer of the latest supported protocol ve... | def determine_supported_protocol(self, earliest, latest):
earliest = int(earliest.split('.')[0])
latest = int(latest.split('.')[0])
if earliest <= latest:
supported = range(earliest, latest + 1)
for version in (reversed(supported)):
if version in RPCS.SUPP... | [
"def compare_protocol_versions(self, session):\n # First parse protocol version strings to check for invalid formatting\n invalid_string = self.parse_protocol_version(\n [self.earliest_protocol_version, self.latest_protocol_version])\n if invalid_string is not None:\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function is responsible for parsing, validating and making all necessary comparisons between provided and supported protocol versions. | def compare_protocol_versions(self, session):
# First parse protocol version strings to check for invalid formatting
invalid_string = self.parse_protocol_version(
[self.earliest_protocol_version, self.latest_protocol_version])
if invalid_string is not None:
# Erro... | [
"def _sanityCheckProtocolVersions(other):\n if other.minVersion > other.maxVersion:\n raise ValueError(\"Versions set incorrectly\")\n if other.minVersion not in KNOWN_VERSIONS:\n raise ValueError(\"minVersion set incorrectly\")\n if other.maxVersion not in KNOWN_VERSIONS:... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If a client_id is provided together with the inform message, Now we have enough information to get the data from the database | def handle_client_id(self, session):
if session['client']['cid'] is not None:
# A subscriber ID may only contain letters, numbers, spaces and
# the following special characters: - _ \ / ( ) # .
p = re.compile('^[A-Za-z0-9-_\\\. #/()]+$')
if p.match(session['clien... | [
"def handle_inform(self, message):\n content = json.loads(message.content)\n if content['ref'] == 'R_01':\n display_message(self.agent.aid.name, 'Mensagem INFORM Recebida')",
"def detail(client_id):\n try:\n # Fetch client details from the BancBox api and render\n clientI... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Validates received protocol compression parameter. Sets protocol compression to be used in session according to result of this validation. | def handle_protocol_compression(self, session):
if self.protocol_compression is not None:
valid = RPCS.VALID_COMPRESSION_METHODS
if self.protocol_compression not in valid:
self.protocol_compression = 'NONE'
raise ClientRequestError('InvalidParameterValue',... | [
"def validate_encoding(self) -> None:\n\n codecs.lookup(self.encoding)",
"def compression_codec(self) -> Optional[str]:\n return pulumi.get(self, \"compression_codec\")",
"def test_compression_level(self):\n test_compression_level = 8\n self.encoder._compression_level = test_compress... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
(str) > bool Return True if correct service name | def is_service_name_correct(self, service):
return service in self.services | [
"def has_service(self, name):\n services = self.services(filters={'name': name})\n return len(services) > 0",
"def istype(client, service_name: str):\n\n if is_client(client):\n return (\n client.meta.service_model.service_name.lower()\n == service_name.strip().lower(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
(str) > bool Return True if correct class mail type | def is_class_mail_types_correct(self, class_mail_type):
return class_mail_type in self.class_mail_types | [
"def is_mail_types_correct(self, mail_type):\r\n return mail_type in self.mail_types",
"def mail_type(self):\n\n if self.machine.get_error():\n return \"error\"\n\n if self.machine._ran:\n return \"success\"\n\n return None",
"def translatable(self):\n if... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
(str) > bool Return True if correct container type | def is_container_type_correct(self, container):
return container in self.containers | [
"def is_container(item):\n if isinstance(item, str):\n return False\n elif hasattr(item, \"__iter__\"):\n return True\n\n return False",
"def is_container(x):\n return isinstance(x, Iterable) and not isinstance(x, str)",
"def is_container(self):",
"def _supported_type(self,obj):\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
(class xml.etree.ElementTree.Element) > list Return dictionary with all Postage information | def get_postage_from_response(self, xml_response):
postages = xml_response.find("Package").findall("Postage")
postages_list = []
if postages:
for postage in postages:
postages_list.append(self.get_response_information(postage))
return postages_list | [
"def get_all_personinfos(root: Element) -> dict:\n result = []\n for child in root:\n if child.tag == \"personinfo\":\n d = personinfo_to_dict(child)\n result.append(d)\n return result",
"def get_all_tripinfos(root: Element) -> dict:\n result = []\n for child in root:\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
(str) > bool Return True if correct mail type | def is_mail_types_correct(self, mail_type):
return mail_type in self.mail_types | [
"def mail_type(self):\n\n if self.machine.get_error():\n return \"error\"\n\n if self.machine._ran:\n return \"success\"\n\n return None",
"def is_class_mail_types_correct(self, class_mail_type):\r\n return class_mail_type in self.class_mail_types",
"def get_rec... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the event information for a Betfair market ID. | def get_event_info(self, market_id: str) -> Tuple[str, str, str]:
market_filter_ = market_filter(market_ids=[market_id])
event_type = (
self._client
.betting
.list_event_types(filter=market_filter_)[0]
.event_type
.name
)
even... | [
"def get_market_info(\n self, market_id: str\n ) -> Tuple[str, datetime, Dict[int, str]]:\n market_filter_ = market_filter(market_ids=[market_id])\n\n market = (\n self._client\n .betting\n .list_market_catalogue(\n filter=market_filter_,\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the market information from a Betfair market ID. | def get_market_info(
self, market_id: str
) -> Tuple[str, datetime, Dict[int, str]]:
market_filter_ = market_filter(market_ids=[market_id])
market = (
self._client
.betting
.list_market_catalogue(
filter=market_filter_,
... | [
"def getMarket(self):\n return self.market",
"def query_bid_price(market_data):\n print(\"Consultando BID\")\n if market_data[\"marketData\"][\"BI\"]:\n bid_price = market_data[\"marketData\"][\"BI\"][0][\"price\"]\n print(f\"Precio de BID: ${bid_price:,.2f}\".replace('.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Stop a running Betfair ladder stream. | def stop_betfair_ladder_stream(self) -> None:
if self.stream is not None:
logger.info("Stopping the Betfair market stream.")
self.stream.stop()
self.stream.listener.output_queue.put("Terminate")
self.stream = None
else:
logger.info("No existing... | [
"def stop_stream(self):\n pass",
"def stop(self):\n\t\tself.stream.stop_stream()",
"def stop(self):\n self.stream.stop()\n self.running = False",
"def stop(self):\n self.streaming_context.stop()",
"def stop(self) -> None:\n self._stopping = True\n for stream in self... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns class by interpreting input string as module path and class name. Module path should be separated by dots as usual. Separate class name from module by '/'. | def get_class(string):
logger = logman.getLogger(__name__)
if '/' not in string:
logger.error("The string is not properly formatted. Use '/' to separate module path from classname. String is: {}".format(string))
return
module_name, class_name = string.split('/')
try:
logger.debug... | [
"def str_to_class(string: str):\n idx_dot = string.rfind('.')\n if idx_dot < 0:\n module_str = 'fnet.nn_modules'\n class_str = string\n else:\n module_str = string[:idx_dot]\n class_str = string[idx_dot + 1:]\n module = importlib.import_module(module_str)\n return getattr(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FresnelReflection takes the smallest angle between the ray direction and the normal. Thus the flipped normal will also work. | def test_antinormal_reflection(self):
n1 = 1.0
n2 = 1.5
normal = (0.0, 0.0, -1.0)
angle = 0.0
ray = Ray(position=(0.0, 0.0, 0.0), direction=(0.0, 0.0, 1.0), wavelength=None)
fresnel = FresnelReflection()
assert np.isclose(fresnel.reflectivity(angle, n1, n2), 0.04)... | [
"def reflection_normal(outgoing_ray, incoming_ray):\n ray1 = normalize(-incoming_ray)\n ray2 = normalize(outgoing_ray)\n return normalize((ray1 + ray2)/2)",
"def reflectivity(self, surface, ray, geometry, container, adjacent):\n # Get the surface normal to determine which surface has been hit.\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests the API endpoint to get hashrate resale details with missing field | def test_mining_hashrate_resale_details_with_missing_field(params):
client = Client(key, secret)
client.mining_hashrate_resale_details.when.called_with(**params).should.throw(
ParameterRequiredError
) | [
"def test_mining_hashrate_resale_details():\n\n client = Client(key, secret)\n response = client.mining_hashrate_resale_details(123, \"user_name\")\n response.should.equal(mock_item)",
"def test_retire_rate_plan(self):\n pass",
"def test_api_projects_id_rates_get(self):\n pass",
"def te... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests the API endpoint to get hashrate resale details | def test_mining_hashrate_resale_details():
client = Client(key, secret)
response = client.mining_hashrate_resale_details(123, "user_name")
response.should.equal(mock_item) | [
"def test_get_exchange_rates(self):\n test_service.get_exchange_rates(self)\n\n headers = { \n 'Accept': 'application/json',\n }\n response = self.client.open(\n '/{currency}/rates/{height}'.format(currency='btc', height=1),\n method='GET',\n h... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Takes a url and email, sends POST request and display body | def main():
post_url = argv[1]
params = {
'email': argv[2]
}
query_string = parse.urlencode(params)
post_data = query_string.encode("ascii")
with request.urlopen(post_url, post_data) as post_response:
response_text = post_response.read()
print(response_text.decode("UTF-8"... | [
"def post(self):\n self.receive(mail.InboundEmailMessage(self.request.body))",
"def email_post(request):\n if request.user.is_authenticated:\n messages.error(request, _(\"You are already logged in.\"))\n return redirect(ta_settings.LOGIN_REDIRECT)\n\n form = EmailForm(request.POST)\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return stock move name by type. | def next_move(ttype):
count = db.session.query(StockMove.id).count() + 1
return str('SO/' if ttype =='sale' else 'PO/') + str(count) | [
"def typeToName(type: int) -> unicode:\n ...",
"def _get_type_name(ot):\n if hasattr(ot, \"_name\") and ot._name:\n return ot._name\n elif hasattr(ot, \"__name__\") and ot.__name__:\n return ot.__name__\n else:\n return str(ot)",
"def getEventTypeNameFromEnum(self, type_):\r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load and return the vowel training dataset. Returns (X_train, X_test, y_train, y_test) Tuple A tuple of data and target | def load_vowel():
train = _load_vowel_train()
test = _load_vowel_test()
return (train[0], train[1].reshape(-1, 1), test[0], test[1].reshape(-1, 1)) | [
"def _load_vowel_test():\n vowel_data = np.loadtxt(_VOWEL_TEST_PATH, delimiter=',', skiprows=1)\n X = vowel_data[:, -10:]\n y = vowel_data[:, 1].astype(int)\n return (X, y)",
"def load_data():\n\n contents = []\n with open('train.csv') as csv_file:\n csv_reader = csv.reader(csv_file, deli... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load and return the vowel testing dataset. Returns (X, y) Tuple A tuple of data and target | def _load_vowel_test():
vowel_data = np.loadtxt(_VOWEL_TEST_PATH, delimiter=',', skiprows=1)
X = vowel_data[:, -10:]
y = vowel_data[:, 1].astype(int)
return (X, y) | [
"def load_vowel():\n train = _load_vowel_train()\n test = _load_vowel_test()\n return (train[0], train[1].reshape(-1, 1), test[0], test[1].reshape(-1, 1))",
"def learn_vowels(self, data=None):\n #pdb.set_trace()\n if not data:\n data = self.memory\n # find acoustic prototy... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load and return the breast cancer wisconsin dataset (classification). The breast cancer dataset is a classic and very easy binary classification dataset. Returns (X_train, X_test, y_train, y_test) Tuple A tuple of data and target The copy of UCI ML Breast Cancer Wisconsin (Original) dataset is | def load_breast_cancer():
bc_data_train = np.load(_BREAST_CANCER_FOLDER+'bc_data.train')
bc_data_test = np.load(_BREAST_CANCER_FOLDER+'bc_data.test')
bc_target_train = np.load(_BREAST_CANCER_FOLDER+'bc_target.train')
bc_target_test = np.load(_BREAST_CANCER_FOLDER+'bc_target.test')
for i in range(len... | [
"def wisconsin_breast_cancer_data():\n\n # uncomment these lines to read directly from original file\n # data_test = pandas.read_csv('../data/breast-cancer-wisconsin.csv', header=None)\n # # replacing Y values with -1 and 1\n # data_test.loc[data_test[10] == 2, 10] = -1\n # data_t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
sub(Vector,Vector) subtracts second vector from first one | def sub(first, other):
if isinstance(first,FreeCAD.Vector) and isinstance(other,FreeCAD.Vector):
return FreeCAD.Vector(first.x-other.x, first.y-other.y, first.z-other.z) | [
"def vector_sub(v1,v2):\n return Vector(v1.x - v2.x, v1.y - v2.y, v1.z - v2.z)",
"def subtract_vect(a, b):\n return (a[0] - b[0],\n a[1] - b[1],\n a[2] - b[2])",
"def vector_subtract(v1, v2):\n return v1[0] - v2[0], v1[1] - v2[1]",
"def __sub__(vec1, vec2):\n if len(vec1)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test that a valid message is sent to a valid webhook. | def test_valid_webhook(self, mock_send):
send_notification("valid_webhook", self.message)
mock_send.assert_called() | [
"def test_slackWH_send_good(get_slackwebhook, capsys):\n s = get_slackwebhook\n s.send()\n out, err = capsys.readouterr()\n assert \"Message sent\" in out",
"def test_create_webhook(self):\n pass",
"def test_webhook():\n data = {\n \"username\": CONFIG['USERNAME'],\n \"avatar... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets up biosafe and stores it as an object variable. | def setup_biosafe(self):
# Generate dummy data in the right format
species_presence = pd.DataFrame(
np.random.randint(2, size=len(self.links_law)),
columns=['speciesPresence'], index=self.links_law.index)
ecotope_area = pd.DataFrame(
np.ones(len(s... | [
"def __init__(self):\n if os.path.isfile('./jamf.pickle') is False:\n self.save_keys()\n else:\n pickle_in = open(\"jamf.pickle\", \"rb\")\n keys = pickle.load(pickle_in)\n self.casper_system_url = keys[\"Casper URL\"]\n self.casper_username = key... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculate the total area of all ecotopes on the playing board. | def ecotope_area_sums(self, board):
# clean up the input and merge into a single dataframe
cols = ['geometry', 'z_reference', 'landuse', 'biosafe']
board_clean = board.loc[board.biosafe, cols]
board_eco = pd.merge(board_clean, self.vr_eco,
on=['z_reference',... | [
"def calculate_total_area(self) -> float:\n sum_of_areas = 0\n for value in self.list_of_shapes:\n area = value.get_area()\n sum_of_areas += area\n return sum_of_areas",
"def area(self):\n area = 0\n\n for room in self.rooms:\n area += room.polyg... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function that calculates the biodiversity score based on the Biosafe output. the numbers 29.33 and 1.4349 follow from running MC simulations to determine the lowest and highest possible scores. The biodiversity score reflects the 0100% range between the two. | def set_score(self):
if self.PotTax_intervention is None:
if self.PotTax_reference is not None:
self.score = (((self.PotTax_reference.sum().TFI - 29.33) /
1.4349) / 100)
else:
print("There is no Biosafe output to score")
... | [
"def compute_secondary_score(self, predictions):\n print(\"compute secondary score...\")\n\n return self.compute_bleu(predictions)",
"def scoreChari_2015(svmInputFile, svmOutputFile, PAM, genome):\n\n model = f_p + '/models/293T_HiSeq_SP_Nuclease_100_SVM_Model.txt'\n dist = f_p + '/models/Hg19_RefFlat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Like `Flask.app.route` but takes only a function that returns HtmlSanitizedStr | def safe_route(app: Flask, rule, **options) -> Callable[[RouteFunction], None]:
original_decorator = app.route(rule, **options)
def decorator(fn: RouteFunction):
return original_decorator(compose(str, fn)) # type: ignore
return decorator | [
"def strip_html(func):\n\n cleaner = re.compile(\"<.*?>\")\n def new_func(*args, strip_html=False, **kwargs):\n name = func(*args, **kwargs)\n if strip_html:\n if isinstance(name, str):\n return html.unescape(re.sub(cleaner, \"\", name))\n elif isinstance(nam... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Program entry point. Loads a CSV file of observations Determines how items were exchanged during various rendezvous Prints the exchanges as they happen, if desired Prints the latest owner of a specific item, if desired. Otherwise neatly prints a dictionary mapping suspects to the item they currently own. This program w... | def main(args):
# Tuple of carried items and timeline
time_tuple = load_timeline(args.observations)
# For each Observation in list, calculated final held item
for suspectPair in time_tuple[1].rendezvous():
# If user wanted exchanges, print each exchange
if args.exchanges:
pr... | [
"def check_my_books(login):\n\n # rented.csv = [ID, rental_date, return_date, login]\n with open('rented.csv', 'r') as rented_base:\n rented_reader = csv.reader(rented_base)\n next(rented_reader)\n\n books_table = []\n\n for line in rented_reader:\n if line[-1] == login:... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Keep only notNaN column positions in all arrays. | def drop_nan_columns(arrays):
# Keep all column indices
not_nan_filter = ones(len(arrays[0]), dtype=bool)
# Currently keeping all columns!
# Keep column indices without missing value in all arrays
# for a in arrays:
# not_nan_filter &= ~isnan(a)
return [a[not_nan_filter] for a in arr... | [
"def columns_with_na_values(data):\n aux = data.isna().sum() > 0\n return aux.index[aux.values].values",
"def remove_nans(coords):\n s = np.apply_along_axis(sum,1,np.isnan(coords[1])) == 0\n coords[0] = (np.asarray(coords[0])[s]).tolist()\n coords[1] = coords[1][s,:]",
"def remove_nans(arr):\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Drop slice that contains only value from df. | def drop_uniform_slice_from_dataframe(df, value, axis=0):
if axis == 0:
dropped = (df == value).all(axis=0)
if any(dropped):
print('Removed {} column index(ices) whose values are all {}.'.
format(dropped.sum(), value))
return df.ix[:, ~dropped]
elif axis =... | [
"def keep_only_values(data, col, value):\n \n total = list(data[col].unique())\n invalid = set(total) - set(value)\n for val in invalid:\n data = data[data[col] != val]\n\n return data",
"def _filter_depth_df(self, df):\n df = df.loc[self.depth_from:self.depth_to]\n if len(df) =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Split df into n_split blocks (by row). | def split_dataframe(df, n_split, axis=0):
# TODO: implement axis logic
if df.shape[0] < n_split:
raise ValueError(
'n_split ({}) can\'t be greater than the number of rows ({}).'.
format(n_split, df.shape[0]))
elif n_split <= 0:
raise ValueError('n_split ({}) can... | [
"def split_df(df, n_chunks):\n chunk_size = int(np.ceil(df.shape[0] / n_chunks))\n assert n_chunks * chunk_size >= df.shape[0]\n chunks = []\n for i in range(0, df.shape[0], chunk_size):\n chunks.append(df[i:i + chunk_size])\n assert len(chunks) == n_chunks\n return chunks",
"def chunk_df... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
decorator to register a babel cli handler. | def babel_cli_handler(**options):
def decorator(cls):
"""
decorates the given class and registers an instance
of it into available babel cli handlers.
:param BabelCLIHandlerBase cls: babel cli handler class.
:returns: babel cli handler class.
:rtype: BabelCLIHandle... | [
"def decorator(cls):\n\n instance = cls()\n babel_services.register_cli_handler(instance, **options)\n\n return cls",
"def __init__(self):\n\n super().__init__(BabelCLIHandlersEnum.INIT)",
"def register_command(*parse_args, **options):\n def wrapper(function):\n function._i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
decorates the given class and registers an instance of it into available babel cli handlers. | def decorator(cls):
instance = cls()
babel_services.register_cli_handler(instance, **options)
return cls | [
"def babel_cli_handler(**options):\n\n def decorator(cls):\n \"\"\"\n decorates the given class and registers an instance\n of it into available babel cli handlers.\n\n :param BabelCLIHandlerBase cls: babel cli handler class.\n\n :returns: babel cli handler class.\n :rty... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return a new (unsaved) shareditem object. Does not set any of the fields that would come from the Request object (i.e. ``user``). | def get_shared_object(self):
if not self.is_valid():
raise ValueError("get_shared_object may only be called on valid forms")
new = SharedItem(
object_id = force_unicode(self.target_object._get_pk_val()),
content_type = ContentType.objects.get_for_model(self.target... | [
"def get_shared_object(self):\n if not self.is_valid():\n raise ValueError(\"get_shared_object may only be called on valid forms\")\n\n new = SharedItem(\n content_type = ContentType.objects.get_for_model(self.target_object),\n object_id = force_unicode(self.target_... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return a new (unsaved) shareditem object. Does not set any of the fields that would come from the Request object (i.e. ``user``). | def get_shared_object(self):
if not self.is_valid():
raise ValueError("get_shared_object may only be called on valid forms")
new = SharedItem(
content_type = ContentType.objects.get_for_model(self.target_object),
object_id = force_unicode(self.target_object._get_p... | [
"def get_shared_object(self):\n if not self.is_valid():\n raise ValueError(\"get_shared_object may only be called on valid forms\")\n\n new = SharedItem(\n object_id = force_unicode(self.target_object._get_pk_val()),\n content_type = ContentType.objects.get_for_mode... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test FeathrClient() get_online_features and batch_get can get data correctly. | def test_feathr_online_store_agg_features():
online_test_table = get_online_test_table_name("nycTaxiCITableMaven")
test_workspace_dir = Path(
__file__).parent.resolve() / "test_user_workspace"
# os.chdir(test_workspace_dir)
# The `feathr_runtime_location` was commented out in this config file,... | [
"def test_get_training_datasets_for_featurestore(self):\n pass",
"def test_bqfeature_fetch_1():\n filename = 'bqfeature_fetch_1.h5'\n path = os.path.join(results_location, filename)\n filename = Feature().fetch(bqsession, 'SimpleTestFeature', resource_list, path=path)",
"def test_read_feature_co... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initializes the object to have a pronunciation dictionary available | def __init__(self):
self._pronunciations = nltk.corpus.cmudict.dict() | [
"def __init__(self):\n self._pronunciations = nltk.corpus.cmudict.dict()\n \"\"\"\n API Documentation for CMU dictionary corpus\n http://www.nltk.org/api/nltk.corpus.reader.html#module-nltk.corpus.reader.cmudict\n \"\"\"",
"def __init__(self):\n self.number_string = \"\"\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the number of syllables in a word. If there's more than one pronunciation, take the shorter one. If there is no entry in the dictionary, return 1. | def num_syllables(self, word):
# TODO: provide an implementation!
word = word.lower()
D = self._pronunciations
#D = nltk.corpus.cmudict.dict()
if(word not in D.keys()):
#print word not in CMUDictionary
return 1
#count stores no of syllables for ea... | [
"def count_syllables_in_word(word):\n try:\n return [len(list(y for y in x if y[-1].isdigit())) for x in CMUDICT[word.lower()]][0]\n except KeyError:\n return sylco(word)",
"def num_syllables(self, word):\n\n pronouncation = 0\n firstProno = 0\n count = 0\n\n x = word\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Takes text where lines are separated by newline characters. Returns True if the text is a limerick, False otherwise. A limerick is defined as a poem with the form AABBA, where the A lines rhyme with each other, the B lines rhyme with each other, and the A lines do not rhyme with the B lines. | def is_limerick(self, text):
# TODO: provide an implementation!
text = text.lower()
p = []
p = text.split('\n')
p = [i.strip(' ') for i in p]
p = list(filter(None, p))
# all limericks must have 5 lines AABBA
if len(p) != 5:
return False
... | [
"def is_limerick(self, text):\n array = []\n ending = []\n bobo = line_tokenize(text)\n pattern = re.compile(r'[a-z]')\n\n lim = False\n\n # Return last word in sentence\n for i in bobo:\n array.append(word_tokenize(i))\n\n for i in array:\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculates sky background temperature for a given Galactic longitude (gl), Galactic latitude (gb), and frequency (freq in MHz). Coordinates are in degrees. Assuming spectral index of "index", default is 2.55 Return value is in K If frequency array 'freqs' is given, then Tsky is calculated for each frequency in the arra... | def tsky(gl, gb, freq, index, freqs=None):
# reading the table
nsky=np.zeros((90, 180), dtype=float)
for ii in xrange(90):
for jj in xrange(180):
pos=(ii*180+jj)*5
nsky[ii,jj]=float(haslam_table[pos:pos+5])
# Convert to standard l,b
b = int(gb + 90.5)
if b >= 180: b = 179
l = int(gl + 0.5)
if gl >= 36... | [
"def tsky_range(gl, gb, f1, f2, index, freqs=None):\n\n\t# reading the table\n\tnsky=np.zeros((90, 180), dtype=float)\n\tfor ii in xrange(90):\n\t\tfor jj in xrange(180):\n\t\t\tpos=(ii*180+jj)*5\n\t\t\tnsky[ii,jj]=float(haslam_table[pos:pos+5])\n\n\t# Convert to standard l,b\n\tb = int(gb + 90.5)\n\tif b >= 180: b... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculates average sky background temperature for a given Galactic longitude (gl), Galactic latitude (gb), and between frequencies f1 and f2 (in MHz). Coordinates are in degrees. Assuming spectral index of "index", default is 2.55 Return value is in K If frequency array 'freqs' is given, then avergae Tsky is calculated... | def tsky_range(gl, gb, f1, f2, index, freqs=None):
# reading the table
nsky=np.zeros((90, 180), dtype=float)
for ii in xrange(90):
for jj in xrange(180):
pos=(ii*180+jj)*5
nsky[ii,jj]=float(haslam_table[pos:pos+5])
# Convert to standard l,b
b = int(gb + 90.5)
if b >= 180: b = 179
l = int(gl + 0.5)
if ... | [
"def tsky(gl, gb, freq, index, freqs=None):\n\n\t# reading the table\n\tnsky=np.zeros((90, 180), dtype=float)\n\tfor ii in xrange(90):\n\t\tfor jj in xrange(180):\n\t\t\tpos=(ii*180+jj)*5\n\t\t\tnsky[ii,jj]=float(haslam_table[pos:pos+5])\n\n\t# Convert to standard l,b\n\tb = int(gb + 90.5)\n\tif b >= 180: b = 179\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Verification process of signature for file name document | def verification(file_name: str) -> None:
print("Verification process...")
file_name = os.path.join('data', file_name)
file1 = open("data/key.txt", "r")
file2 = open("data/signature.txt", "r")
p = int(file1.readline().rstrip())
q = int(file1.readline().rstrip())
g = int(file1.readline().rst... | [
"def _verify_signature(self):\n #FIXME\n return True",
"def verify_signature_dialog():\n signature_name = input(\"Enter signature identity: \")\n file_path = input(\"Enter file path: \")\n user = input(\"Enter username: \")\n\n if not(os.path.exists(user)):\n raise Exception(ERROR... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return path for lights file | def lightPath(self):
return mfl.mayaFile( self._path + '/lights.ma' ) | [
"def file_path():\n # Get path to LightWave's config folder, and join with the filename\n folder = lwsdk.LWDirInfoFunc(lwsdk.LWFTYPE_SETTING)\n file_path = os.path.join(folder, PRESETS_FILE)\n return file_path",
"def darkpath(cam):\n return os.path.join(BASEPATH, cam + \"_dark\")",... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return the path for the shader file | def shaderPath(self):
return mfl.mayaFile( self._path + '/shaders.ma' ) | [
"def getShaderDir():\n\n if fslgl.GL_VERSION == '2.1': subdir = 'gl21'\n elif fslgl.GL_VERSION == '1.4': subdir = 'gl14'\n\n return op.join(fsleyes.assetDir, 'assets', 'gl', subdir)",
"def _getFileName(prefix, shaderType):\n\n suffix = getShaderSuffix()\n\n if shaderType not in ('vert', 'frag'):\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return the path for the aovs file | def aovsPath(self):
return fl.File( self._path + '/aovs.data' ) | [
"def GetAAPath(topomsafile):#{{{\n if g_params['aapath'] != \"\":\n return g_params['aapath']\n else:\n return myfunc.my_dirname(topomsafile)",
"def path(self) -> str:\n\t\treturn os.path.join(self.location, self.fname)",
"def file_path(self) -> str:\n return pulumi.get(self, \"file_p... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return the path for the masterLayer data | def masterPath(self):
return fl.File( self._path + '/master.data' ) | [
"def path(self):\n return self.dataset.mountpoint",
"def get_data_path(self):\n return self.__path + '/data/'",
"def data_path(self) -> str:\n return self._get(\"data_path\", \"./data/\")",
"def getPathName(self):\n return self.data.pathName",
"def getDataPath():\n\treturn \"..\"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
export master layer settings so we can re apply it | def exportMasterLayerSettings(self):
master = rlayer.RenderLayer( 'defaultRenderLayer' )
master.makeCurrent()
masterData = {}
nodes = ['defaultArnoldRenderOptions','defaultResolution','defaultRenderGlobals']
mnNodes =[ mn.Node( n ) for n in nodes ]
for n in mnNodes:
for a in n.listAttr( se = True, v = Tr... | [
"def importMasterSettings(self):\n\t\tpickleData = pickle.load( open( self.masterPath.path, \"rb\" ) )\n\t\tmaster = rlayer.RenderLayer( 'defaultRenderLayer' )\n\t\tmaster.makeCurrent()\n\t\tfor a in pickleData.keys():\n\t\t\ttry:\n\t\t\t\ta.v = pickleData[a]\n\t\t\texcept:\n\t\t\t\tcontinue",
"def apply_settings... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
export data from scene, objects overrides in renderlayers.. etc | def exportData(self):
lays = rlayer.renderlayers()
data = {}
for l in lays:
if l.name == 'defaultRenderLayer':
continue
data[l.name] = {'objects':l.objects, # OBJECTS IN LAYER
'values' :l.overridesWithValues, # OVERRIDED ATTRIBUTES ONLY CHANGED VALUES
'conns' :l.over... | [
"def export_scene():\n try:\n # check for mesh\n mesh = cmds.ls(typ='mesh')\n if not mesh:\n cmds.warning('{0}: No mesh to export.'.format(__file__))\n return None\n else:\n cmds.select(mesh)\n # check plug-in\n if not cmds.pluginInfo('fb... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
export lights from scene | def exportLights(self):
#TODO! REMOVE CONSTRAINS
lights = mc.ls( typ=['light','aiAreaLight','aiSkyDomeLight','aiVolumeScattering','aiSky'], l=1 )
mc.editRenderLayerGlobals( currentRenderLayer = 'defaultRenderLayer' )
litsToExport = []
for li in lights:
finalLi = li.split( '|' )
if len(finalLi) == 1:
... | [
"def export_lights(lamps, file, scene, global_matrix, tab_write):\n\n from .render import write_matrix, tab_write\n\n # Incremented after each lamp export to declare its target\n # currently used for Fresnel diffuse shader as their slope vector:\n global exported_lights_count\n # Get all lamps and ke... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
export all the lightlinking in the scene | def exportLightLinking(self):
lights = [a for a in mc.ls( typ = ['light','aiAreaLight'] ) if not 'eye' in a]
allShapes = [s for s in mc.ls( type = 'geometryShape', ni = 1) if not (mc.objectType( s ) in ( 'aiAreaLight','aiSkyDomeLight' ))]
litLinks = {}
for l in lights:
lightLinkShapes = mc.lightlink( que... | [
"def exportLights(self):\n\t\t#TODO! REMOVE CONSTRAINS\n\t\tlights = mc.ls( typ=['light','aiAreaLight','aiSkyDomeLight','aiVolumeScattering','aiSky'], l=1 )\n\t\tmc.editRenderLayerGlobals( currentRenderLayer = 'defaultRenderLayer' )\n\t\tlitsToExport = []\n\t\tfor li in lights:\n\t\t\tfinalLi = li.split( '|' )\n\t\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
export aovs from scene | def exportAovs(self):
aovs = mc.ls( typ = 'aiAOV' )
aovData = {}
for a in aovs:
aovData[a] = {}
aovData[a]['enabled'] = mc.getAttr( a + '.enabled' )
aovData[a]['name'] = mc.getAttr( a + '.name' )
aovData[a]['type'] = mc.getAttr( a + '.type' )
pickle.dump( aovData, open( sel... | [
"def export_scene():\n try:\n # check for mesh\n mesh = cmds.ls(typ='mesh')\n if not mesh:\n cmds.warning('{0}: No mesh to export.'.format(__file__))\n return None\n else:\n cmds.select(mesh)\n # check plug-in\n if not cmds.pluginInfo('fb... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
import lights in scene | def importLights(self, asset = '', searchAndReplace = ['',''] ):
if self.lightPath.exists:
self.lightPath.imp()
if self.lightLinkPath.exists:
self.importLightLinking( asset, searchAndReplace ) | [
"def setupLights(self) :\n\t\tself.ambientLight = render.attachNewNode(AmbientLight( \\\n\t\t\t\t\t\"ambientLight\"))\n\t\tself.ambientLight.node().setColor(Vec4(.8,.8,.8,1))\n\t\trender.setLight(self.ambientLight)\n\n\t\tdLight1 = DirectionalLight(\"dLight1\")\n\t\tdLight1.setColor(Vec4(6,5,7,1))\n\t\tdLight1.setD... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
import light linking to lights | def importLightLinking(self, asset = '', searchAndReplace = ['',''] ):
LayersInfo = pickle.load( open( self.lightLinkPath.path, "rb") )
mc.refresh( su = 1 )
if not asset == '':
LayersInfo = self.filterLightLinksData( LayersInfo , asset, searchAndReplace )
for l in LayersInfo.keys():
objsToBreakLink = []
... | [
"def importLights(self, asset = '', searchAndReplace = ['',''] ):\n\t\tif self.lightPath.exists:\n\t\t\tself.lightPath.imp()\n\t\t\tif self.lightLinkPath.exists:\n\t\t\t\tself.importLightLinking( asset, searchAndReplace )",
"def setupLights(self) :\n\t\tself.ambientLight = render.attachNewNode(AmbientLight( \\\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
filter light linking data for the specific asset | def filterLightLinksData(self, LayersInfo , asset, sAr = ['',''] ):
lightData = [(a.replace( sAr[0], sAr[1] ),LayersInfo[a].replace( sAr[0], sAr[1] )) for a in LayersInfo.keys() if asset in a]
return dict( lightData ) | [
"def importLightLinking(self, asset = '', searchAndReplace = ['',''] ):\n\t\tLayersInfo = pickle.load( open( self.lightLinkPath.path, \"rb\") )\n\t\tmc.refresh( su = 1 )\n\t\tif not asset == '':\n\t\t\tLayersInfo = self.filterLightLinksData( LayersInfo , asset, searchAndReplace )\n\t\tfor l in LayersInfo.keys():\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
import aovs into scene | def importAovs(self):
LayersInfo = pickle.load( open( self.aovsPath.path, "rb") )
mc.refresh( su = 1 )
for ao in LayersInfo.keys():
aov.create( ao, LayersInfo[ao]['name'], LayersInfo[ao]['type'], LayersInfo[ao]['enabled'] )
mc.refresh( su = 0 ) | [
"def import_scene(file_path):\n\n pass",
"def importAbcAsset ():\n\n help(importAbcAsset)\n\n import hou\n import os\n \n \n #set path\n hipPath = hou.expandString('$HIP')\n path = hipPath + \"/abc/\"\n print (path)\n \n listPath = os.listdir(path)\n \n obj = hou.node(\"/obj... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
import shaders into scene | def importShaders(self):
if self.shaderPath.exists:
self.shaderPath.imp() | [
"def _on_load_scene_shaders(self):\n\n artellapipe.ShadersMgr().load_scene_shaders()",
"def importShader(path):\r\n try:\r\n pm.importFile(path)\r\n print 'Success import {}'.format(path)\r\n except:\r\n print 'Failed import {}'.format(path)\r\n return\r\n assignShader(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
import data from file asset = Only import for the asset that you want searchAndReplace = Change any part of the objects name to another word | def importData( self, asset = '', searchAndReplace = ['',''] ):
pickleData = pickle.load( open( self.dataPath.path, "rb" ) )
layers = [RenderLayerData(l,d) for l,d in pickleData.items() if not ':' in l]
for l in layers:
if not searchAndReplace [0]== '' or not searchAndReplace[1] == '':
l.filterMe( asset, s... | [
"def replace(name, newobject):",
"def test_ReplaceFromJsonFile(self):\n jsonFilePath = os.path.join(\n TestReplaceResolver.assemblyRepo, \"a\", \"v1\", ReplaceResolver.Tokens.replaceFileName\n )\n\n pair1 = [\"component/c/v1/c.usda\", \"component/c/v2/c.usda\"]\n pair2 = [\"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
import master settings from data file | def importMasterSettings(self):
pickleData = pickle.load( open( self.masterPath.path, "rb" ) )
master = rlayer.RenderLayer( 'defaultRenderLayer' )
master.makeCurrent()
for a in pickleData.keys():
try:
a.v = pickleData[a]
except:
continue | [
"def importsettings(importfile, verbose):\n settings = json.load(importfile)\n if verbose:\n click.echo('Got settings from input file: ')\n click.echo(settings)\n # write into settings.json\n with open(pwd.getpwuid(os.getuid()).pw_dir+'/.ethvigil/settings.json', 'w') as f:\n json.du... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return the overrides in the layer | def dataOverrides(self):
return self._overrides | [
"def overrides(self):\n return self._overrides",
"def get_overrides(self, namespace=None):\n return {}",
"def overrides(self) -> ConfigNodePropertyArray:\n return self._overrides",
"def overrides(self) -> tuple[dict[str, Any], dict[str, Any]]:\n settings = {}\n if self.actio... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |