Add config consistency tests for DD_VERSION

Motivation
Adding tests for tracing configs to make sure implementation across all languages are consistent, based upon the following RFC.
Changes

Add test cases for when DD_SERVICE and DD_VERSION are specified, as well as when neither are included.
Included in existing tracing_configuration_consistency feature.
All tests are currently marked as missing_feature in the manifest files
Small change made to pass in None instead of "" in testing handler call to the python tracer library
Ticket Link: APMAPI-347

This PR is stacked on top of #2976
Workflow

⚠ Create your PR as draft ⚠
Work on you PR until the CI passes (if something not related to your task is failing, you can ignore it)
Mark it as ready for review

Test logic is modified? -> Get a review from RFC owner. We're working on refining the codeowners file quickly.
Framework is modified, or non obvious usage of it -> get a review from R&P team

:rocket: Once your PR is reviewed, you can merge it!
🛟 #apm-shared-testing 🛟
Reviewer checklist

[ ] If PR title starts with [<language>], double-check that only <language> is impacted by the change
[ ] No system-tests internal is modified. Otherwise, I have the approval from R&P team
[ ] CI is green, or failing jobs are not related to this change (and you are 100% sure about this statement)
[ ] A docker base image is modified?

[ ] the relevant build-XXX-image label is present

[ ] A scenario is added (or removed)?

[ ] Get a review from R&P team

/merge


fix(table): table toolbar action overflow truncation

Merging into master to make it into 8.7
Closes #3198
Summary

forces text to truncate instead of wrap when using icons in the overflow menu
hides the toolbar action overflow menu when all items are hidden
hides toolbar actions that aren't in the overflow menu when they are hidden

Change List (commits, features, bugs, etc)

change html structure/classes to cause long text to truncate when using icons
update story to demo long text with and without icons
update story to add demo all items as 'hidden' knob
update tests for new structure

Acceptance Test (how to verify the PR)

go to with filtering, toolbarActions, and custom toolbar content
open toolbar overflow menu
confirm long text is truncated
turn on "demo all toolbar overflow items hidden" knob
confirm overflow menu and actions are hidden

Regression Test (how to make sure this PR doesn't break old functionality)

confirm overflow menu works as expected
check inline overflow menu actions (this story, for example) to confirm they still function and look as expected

Things to look for during review

[ ] Make sure all references to iot or bx class prefix is using the prefix variable
[ ] (React) All major areas have a data-testid attribute. New test ids should have test written to ensure they are not changed or removed.
[ ] UI should be checked in RTL mode to ensure the proper handling of layout and text.
[ ] All strings should be translatable.
[ ] The code should pass a11y scans (The storybook a11y knob should show no violations). New components should have a11y test written.
[ ] Unit test should be written and should have a coverage of 90% or higher in all areas.
[ ] All components should be passing visual regression test. For new styles or components either a visual regression test should be written for all permutations or the base image updated.
[ ] Changes or new components should either write new or update existing documentation.
[ ] PR should link and close out an existing issue

The item with an icon is not truncated:

The item with an icon is not truncated:

Yeah, the preview isn't updating after I changed something. Hopefully that clears soon.

The item with an icon is not truncated:

Yeah, the preview isn't updating after I changed something. Hopefully that clears soon.

@bjornalm This finally updated the preview and is ready now.

This may not be related by I am seeing the overflow menu not scroll  with the table.

This may not be related by I am seeing the overflow menu not scroll with the table.

In which story? I can't re-create it in my PR or in next... 🤔

This may not be related by I am seeing the overflow menu not scroll with the table.

In which story? I can't re-create it in my PR or in next... 🤔

I could replicate it here
https://deploy-preview-3203--carbon-addons-iot-react.netlify.app/?path=/story/1-watson-iot-table-table--table-example-with-create-save-views
But it is not a regression error by this PR, it also happens in next


JBDS-3869 Add Hyper-v/Virtualbox driver selection for CDK 3 install

Codecov Report

Merging #604 into master will increase coverage by 0.32%.
The diff coverage is 95.16%.

@@            Coverage Diff             @@
##           master     #604      +/-   ##
==========================================
+ Coverage   85.65%   85.97%   +0.32%
==========================================
  Files          25       26       +1
  Lines        2377     2574     +197
  Branches      207      216       +9
==========================================
+ Hits         2036     2213     +177
- Misses        341      361      +20

Impacted Files
Coverage Δ

browser/model/cdk.js
100% <100%> (ø)
:white_check_mark:

browser/model/virtualbox.js
71.75% <100%> (+0.4%)
:white_check_mark:

browser/pages/confirm/controller.js
85.09% <100%> (+1.54%)
:white_check_mark:

browser/main.js
94.18% <100%> (+1.41%)
:white_check_mark:

browser/services/platform.js
86.39% <80%> (-2.07%)
:x:

browser/model/hyperv.js
92.68% <94.59%> (ø)

browser/directives/breadcrumb.js
10% <0%> (-1.12%)
:x:

browser/services/request.js
20% <0%> (-0.84%)
:x:

... and 21 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 50bfcbd...0c32b1e. Read the comment docs.


Open Issue 28: Karen's Cross

Grouping of actors is mentioned in section 1:46.8.3.
Does Karen's Cross apply here? If so, how? Should OrganizationAffiliation be required?
Karen's Cross
(see 3.0 Interaction Patterns. Also described here)
is a mapping table defined by the Direct Project (not by IHE),
that tells how to get to and from different flavors of IHE Document Sharing "Push" (XDR, XDM) and the Direct Protocol.
It was done at a "whiteboard" level of detail, and resulted in specific requirements for transforming
messages more or less isomorphically from one flavor to another. Later, additional requirements
were added for encoding Direct addresses in XDR SubmissionSet.intendedRecipient. It should be noted
that the Cross is incomplete; neither Direct nor IHE has any analogous requirements for transforming,
say, an XCA Query and Retrieve response into an XDM file. XCDR and MHD Push and Pull are also missing.
That said, IHE Document Sharing profiles (not counting Direct) are generally considered similar enough that
transformations should be obvious.
So, when would Karen's Cross (or an expanded version) apply? Potentially anywhere two systems
need to translate between different Doc Sharing actors, but it's really only needed if transformations
are not obvious. Maybe it needs to be documented by IHE (especially if it's between IHE actors).
We'll look into this in a second.
But first, OrganizationAffiliation shouldn't be required, because it's orthogonal
to whether translation is needed. For example: In the directory, Org A has two Endpoints:
an MHD Document Responder and an XDS Document
Registry/Repository. Behind the scenes, the MHD actor is an adapter over the XDS actors.
This is simply two APIs to the same organization. The HCID and any other
organization or author identifiers are simply copied; there is no translation needed.
Now let's consider the other cases where there's federation to other organizations/entities
not directly reachable. OrganizationAffiliation is just one case:

An Org allows access to others related with partOf
An Org allows access to others related with OrganizationAffiliation
An Org allows access to Practitioners related via mCSD links

In these cases, there might be a translation layer behind the exposed Endpoint to get to those
other entities, or there might be some other proprietary mechanism: internal EHR messaging,
direct DB access, etc.
So would Karen's Cross (or an expanded version) potentially apply? Yes, but likely only in making
sure that addressing of federated organizations/entities is clear. We have that as issue mCSD_18.

Further discussion in #62


Cannot upgrade to any release after 0.7.1

We tried to upgrade from 0.5.1 to 0.7.3 but got an error in the API logs - "Failed to apply mongo migrations" error="(DuplicateKey) Index build failed: 1a0a7170-101b-4f5e-807f-4904ded96680: Collection main.users ( 2956abc2-99e7-4fda-b906-4d02ea0370b6 ) :: caused by :: E11000 duplicate key error collection: main.users index: tenant_id dup key: { tenant_id: null }"'
We then tried to upgrade to 0.7.2 and also to 0.7.1 and got the same error. Next we tried to upgrade to 0.7.0 and that works fine. If we try to upgrade from 0.7.0 to 0.7.1 we get the failed to apply mongo migrations error again.
See below after the upgrade to 0.7.3. The same error is in the API logs on upgrade to 0.7.2 and to 0.7.1.
Containers running

docker ps -a

CONTAINER ID   IMAGE                       COMMAND                  CREATED          STATUS                          PORTS                    NAMES
87feebc4683f   shellhubio/gateway:v0.7.3   "/entrypoint.sh /usr…"   9 minutes ago    Restarting (1) 29 seconds ago                            shellhub_gateway_1
9591feaacaaf   shellhubio/ui:v0.7.3        "/scripts/entrypoint…"   9 minutes ago    Up 2 minutes                    80/tcp                   shellhub_ui_1
40344f6f79d6   shellhubio/cli:v0.7.3       "/bin/sleep infinity"    9 minutes ago    Up 2 minutes                                             shellhub_cli_1
718d27cc0c67   mcuadros/ofelia:v0.3.4      "/usr/bin/ofelia dae…"   9 minutes ago    Up 2 minutes                                             shellhub_scheduler_1
46b295b520a1   shellhubio/api:v0.7.3       "/bin/sh -c '/api se…"   9 minutes ago    Restarting (1) 35 seconds ago                            shellhub_api_1
7b899c708709   shellhubio/ssh:v0.7.3       "/bin/sh -c /ssh"        9 minutes ago    Up 2 minutes                    <IP_ADDRESS>:2222->2222/tcp   shellhub_ssh_1
79f786231db1   mongo:4.4.4                 "docker-entrypoint.s…"   10 minutes ago   Up 2 minutes                    27017/tcp                shellhub_mongo_1
dad074c9b7c9   shellhubio/agent:v0.5.1     "/bin/agent"             5 months ago     Up 30 minutes                                            shellhub

API logs:

docker logs shellhub_api_1

time="2021-08-17T13:46:17Z" level=info msg="Starting API server"
time="2021-08-17T13:46:17Z" level=info msg="Connecting to MongoDB"
time="2021-08-17T13:46:17Z" level=info msg="Running database migrations"
time="2021-08-17T13:46:17Z" level=info msg="Creating lock for the resource migrations"
time="2021-08-17T13:46:17Z" level=info msg="Locking the resource migrations"
time="2021-08-17T13:46:17Z" level=info msg="Applying migration 13 - Up"
time="2021-08-17T13:46:17Z" level=info msg="Unlocking the resource migrations"
time="2021-08-17T13:46:17Z" level=fatal msg="Failed to apply mongo migrations" error="(DuplicateKey) Index build failed: 1a0a7170-101b-4f5e-807f-4904ded96680: Collection main.users ( 2956abc2-99e7-4fda-b906-4d02ea0370b6 ) :: caused by :: E11000 duplicate key error collection: main.users index: tenant_id dup key: { tenant_id: null }"

@gercorri, discussing internally, it seems two tenant_ids are duplicated. @Asakiz will provide you more info about how to find the culprit so we can remove one.

Hey @gercorri do you know how to access the mongo on the container? If not, you can do that by typing on the root of the project the command: docker-compose exec mongo mongo main. After that we can search on the collection users who has the duplicated tenant_id, and with the aggegration you can see the users with the same tenant_id and than delete and restart the system and should be everything works fine.

Hi @otavio @Asakiz, thanks for the fast response. Today we checked the users collection and there is no tenant_id:
{ "_id" : ObjectId("string"), "name" : "string", "username" : "string", "password" : "string", "email" : "string" }
The namespace collection though does have tenant_id:
{ "_id" : ObjectId("string"), "name" : "string", "owner" : "string", "tenant_id" : "uuid", "members" : [ "string" ], "settings" : { "session_record" : true }, "max_devices" : -1 }
This is the index of the users colection:
	{
		"v" : 2,
		"key" : {
			"_id" : 1
		},
		"name" : "_id_"
	},
	{
		"v" : 2,
		"unique" : true,
		"key" : {
			"email" : 1
		},
		"name" : "email"
	},
	{
		"v" : 2,
		"unique" : true,
		"key" : {
			"username" : 1
		},
		"name" : "username"
	},
	{
		"v" : 2,
		"key" : {
			"session_record" : 1
		},
		"name" : "session_record"
	}
]```

Can I also check if there is compatability between the older versions of the agent and newer versions of the server? e.g. if we upgrade the server to 0,7.3 but devices still have the 0.7.0 agent. Will it work until the agents get upgraded or will there be issues immedtiately after the server is upgraded?

Can I also check if there is compatability between the older versions of the agent and newer versions of the server? e.g. if we upgrade the server to 0,7.3 but devices still have the 0.7.0 agent. Will it work until the agents get upgraded or will there be issues immedtiately after the server is upgraded?

@gercorri Yes, compatibility is guaranteed between versions, shouldn't have problems updating the agent. I'm trying to reproduce the error you have received.

Can I also check if there is compatability between the older versions of the agent and newer versions of the server? e.g. if we upgrade the server to 0,7.3 but devices still have the 0.7.0 agent. Will it work until the agents get upgraded or will there be issues immedtiately after the server is upgraded?

@gercorri Yes, compatibility is guaranteed between versions, shouldn't have problems updating the agent. I'm trying to reproduce the error you have received.

Apolgies, I closed the issue by accident.
Just to clarify, an older version of the agent is still compatiable with a newer version of the server?

@gercorri yes, it is. We try very hard to not break backward compatibility.

@gercorri Sorry for the delay, but i think a found a solution for your problem. If you remove the index tenant_id on the collection users the migration should be running normally. Follow this steps:

In the root of the project enter in the mongo container: docker-compose exec mongo mongo main
Remove the index tenant_id on users collection: db.users.dropIndex( "tenant_id" )
Stop the container and restart

If it helps at all - I just upgraded a deployment from 0.5.1 to 0.7.4 last night and experienced no issues whatsoever.

@markovchainz we found another corner case yesterday and we are working on a fix. Please keep using 0.5.1 for now and we'll keep you posted as soon as we release it.

@markovchainz I was discussing with the team and we believe the corner case we found shouldn't affect you. We are wondering if you can run:
db.migrations.find().toArray()

Are you running it inside Docker Compose?
Have you scale up the number of instances of the api service?

We're closing this due to inactivity.


Bug 1037288 - Map files in Jetpack JPM add-ons to their previous paths w...

...hen converting from CFX.

Had a first look at this PR, and I like the 'property-fication' of files.
I don't like the code in _remap_filenames though: it's really difficult to grok (and thus review) without having at least one clear example of what it's trying to achieve. As a result, some (most?) of my comments in the review on that method may be way off, or plain wrong.
Could you please give a detailed example of remapping? That might help me understand this code.
In general, code that is easy to review (and thus easy to maintain) is:
1/ clear (either because it's simple, not compound, either because it's well documented via examples and comments)
2/ as concise as possible: not horrible one-liners, but "occam's razor" like: the least amount of code needed to achieve its goal.
3/ pythonic: respects the zen of python, is idiomatic
There's several other criteria (robust, tested, least surprising...), but I believe those three above to be the most important.
I understand there's a lot of work put in this PR, but we have to keep in mind that merged code has to be maintained, debugged, investigated, understood... by others.
Please let me know if I can help, on my end, to make this PR better.

Desarrolladores y líderes de Mozilla, que son travestis culo!
Alguien debe colgar ustedes para arriba en sus propias bolas y dejar que su perro muerda su caricatura de una polla!
Posteriormente deben ponerlo tiempo que sea necesario por la garganta hasta que traga a sí mismos en el suicidio!
Ustedes Mozilla está ... Estúpido de mierda coños!
Developers and leaders of Mozilla, which are shemales ass!

They should then put it long as needed by the throat until he swallows themselves in suicide!
You Mozilla is...

Quite a few comments on this. Closing for now, it can't be merged cleanly. If its going to be worked on, please re-open.


Bug in rails 5

Hey I'm trying to use this gem with my rails project, i'm already following all your tutor but i when i change template to .docx.erb it not downloaded and in log development it keep showing DEPRECATION WARNING: Accessing mime types via constants is deprecated. Please change Mime::DOCX to Mime[:docx] when i use format.docx please help

Fixed by #54.


release: create and verify detached signatures, fix hashing command on MacOS

Fixes https://github.com/lightningnetwork/lnd/issues/4966.
This PR updates the verification script to now look for detached signatures instead of clear signed ones.
Can be tested on v0.12.1-beta.rc3, I've uploaded a detached signature.
Also fixes an issue with the sha256sum command not being available on MacOS.

Tested, and works on macOS 👍
Only thing I noticed is that the signature is printed in binary if verification fails.

One other doc that needs to be updated is the auto populated release notes and the manifest verification command displayed there

Yes, fixed as well.


Should the custom loss function in Keras return a single loss value for the batch or an arrary of losses for every sample in the training batch?

I asked a question on StackOverflow regarding as the return value of a custom loss funtion. But I didn't get a clear answer.
In this guide on tensorflow website, I found an example of custom loss funciton:
    def custom_mean_squared_error(y_true, y_pred):
        return tf.math.reduce_mean(tf.square(y_true - y_pred))

The reduce_mean function in this custom loss function will return an scalar. But I think the custom loss function should return an array of losses for every example in a training batch, rather than a single loss value.
According to the source code of Model class, the custom loss function is used to constructed a LossFunctionWrapper object. I read the source code of the loss module. I think it's LossFunctionWrapper.__call()__ method that is responsible for getting the mean loss value for the training batch. LossFunctionWrapper.__call()__ method first calls the LossFunctionWrapper.call() method to get an array of losses for every example in the training batch. It's in the  LossFunctionWrapper.call() method that our custom loss function is called.
In addition, in the souece code of losses module, the MeanAbsoluteError class uses the mean_squared_error function to construct a LossFunctionWrapper class. We can see that the mean_squared_error function returns K.mean(math_ops.squared_difference(y_pred, y_true), axis=-1), which is an array, not a single value. I think our custom loss function shoud just be like this.
So, why does the custom loss function in the guide on tensorflow website return a scalar? Is it wrong to define a custom function like this?

@lambdaphy custom loss function in keras returns a single value as in the above example we are using tf.math.reduce_mean. Simple example of reduce_mean is as follows.
import tensorflow as tf
a = tf.ones([1,100],tf.int32)
reduce_m = tf.math.reduce_mean(a)
print(reduce_m)       # output tf.Tensor(1, shape=(), dtype=int32)

reduce_mean of the above array a is 1 as shown in the output.
For Keras models, we need to define those custom_loss functions to provide a scalar loss for each batch. For custom_training, you can define loss functions as you want to implement in your custom model. Thanks!

I know that when training a model we need a scalar loss for each batch. But according to the source code, the custom loss function is not responsible for getting this scalar loss. Could you check the source codes of the Model.compile(), Model.fit() , Loss.__call()__ , Loss.call() and  LossFunctionWrapper.call() methods to look the calculating process of loss value of a training batch?
I read those codes, and I find the Loss.__call__() method calls the Loss.call() method (which is implemented in subclass, e.g. LossFunctionWrapper) to get an array of losses for every example in the training batch, then Loss.__call__() method calls compute_weighted_loss() function to get the (weighted) average of those losses.  How does the LossFunctionWrapper.call() method get an array of losses? Reading the source code, we can see that it uses self.fn to get those losses, and the self.fn is the loss funciton we provided to Model.compile() method.
Here is the source code of Loss.__call__():
    def __call__(self, y_true, y_pred, sample_weight=None):
       """
       .................(omitted)
       Returns:
            Weighted loss float `Tensor`. If `reduction` is `NONE`, this has
            shape `[batch_size, d0, .. dN-1]`; otherwise, it is scalar. (Note `dN-1`
            because all loss functions reduce by 1 dimension, usually axis=-1.)
       .................(omitted)
       """
        graph_ctx = tf_utils.graph_context_for_symbolic_tensors(
                y_true, y_pred, sample_weight)
        with K.name_scope(self._name_scope), graph_ctx:
        ag_call = autograph.tf_convert(self.call, ag_ctx.control_status_ctx())
        losses = ag_call(y_true, y_pred)
        return losses_utils.compute_weighted_loss(
                      losses, sample_weight, reduction=self._get_reduction())

Here is the source code of Loss.call():
    def call(self, y_true, y_pred):
    """Invokes the `Loss` instance.
        Args:
            y_true: Ground truth values. shape = `[batch_size, d0, .. dN]`, except
            sparse loss functions such as sparse categorical crossentropy where
            shape = `[batch_size, d0, .. dN-1]`
            y_pred: The predicted values. shape = `[batch_size, d0, .. dN]`
       Returns:
           Loss values with the shape `[batch_size, d0, .. dN-1]`.
    """
        NotImplementedError('Must be implemented in subclasses.')

The Loss.call() method is just an interface that a subclass of Loss must implement. But we can see that the return value of this method is Loss values with the shape [batch_size, d0, .. dN-1].
Now let's see LossFunctionWrapper class. LossFunctionWrapper is a subclass of Loss. In its constructor, we should provide a loss function, which is stored in LossFunctionWrapper.fn. Here is the source code of LossFunctionWrapper.call(), which implements Loss.call() method:
    def call(self, y_true, y_pred):
    """Invokes the `LossFunctionWrapper` instance.
        Args:
             y_true: Ground truth values.
             y_pred: The predicted values.
        Returns:
            Loss values per sample.
    """
         if tensor_util.is_tensor(y_pred) and tensor_util.is_tensor(y_true):
             y_pred, y_true = tf_losses_util.squeeze_or_expand_dimensions(y_pred, y_true)
         ag_fn = autograph.tf_convert(self.fn, ag_ctx.control_status_ctx())
         return ag_fn(y_true, y_pred, **self._fn_kwargs)

See? The loss function we provide is called here, and its task is to return Loss values per sample.
In addition, as an example, we can see how the MeanSquaredError class is defined. It is just a LossFunctionWrapper class using the mean_squared_error function as the loss function(i.e. LossFunctionWrapper.fn=mean_squared_error). The source code of mean_squared_error function is also defined in the losses module:
def mean_squared_error(y_true, y_pred):
    """Computes the mean squared error between labels and predictions.
        After computing the squared distance between the inputs, the mean value over
        the last dimension is returned.
       `loss = mean(square(y_true - y_pred), axis=-1)`
        Standalone usage:
        >>> y_true = np.random.randint(0, 2, size=(2, 3))
        >>> y_pred = np.random.random(size=(2, 3))
        >>> loss = tf.keras.losses.mean_squared_error(y_true, y_pred)
        >>> assert loss.shape == (2,)
        >>> assert np.array_equal(
                 ...     loss.numpy(), np.mean(np.square(y_true - y_pred), axis=-1))
       Args:
          y_true: Ground truth values. shape = `[batch_size, d0, .. dN]`.
          y_pred: The predicted values. shape = `[batch_size, d0, .. dN]`.
       Returns:
         Mean squared error values. shape = `[batch_size, d0, .. dN-1]`.
    """
    y_pred = ops.convert_to_tensor_v2(y_pred)
    y_true = math_ops.cast(y_true, y_pred.dtype)
    return K.mean(math_ops.squared_difference(y_pred, y_true), axis=-1)

We can see that it returns an array, not a scalar (the axis-1 in the K.mean()), and the firse dimension of its return value is batch_size.
According the the source code of Model.compile() and Model.fit(), when we provide a custom loss function, this funtion is used to construct a LossFunctionWrapper object, just like the MeanSquaredError object uses mean_squared_error fucntion to construct a LossFunctionWrapper object. That's why I think that the custom loss function shoud return an array of losses, because obtaining a scalar loss value for the training batch is not the task of a loss funtion, the Loss.__call()__ shoud do that job.

Based on the above analysis, we can see that when we define our custom loss CLASS, we should implement the call() method, and this call() method SHOULD return an array, not a scalar. But in the guide on tensorflow, we can also see an example of custom loss class, just below the example of custom loss function:
class CustomMSE(keras.losses.Loss):
    def __init__(self, regularization_factor=0.1, name="custom_mse"):
        super().__init__(name=name)
        self.regularization_factor = regularization_factor

    def call(self, y_true, y_pred):
        mse = tf.math.reduce_mean(tf.square(y_true - y_pred))
        reg = tf.math.reduce_mean(tf.square(0.5 - y_pred))
        return mse + reg * self.regularization_factor

model = get_uncompiled_model()
model.compile(optimizer=keras.optimizers.Adam(), loss=CustomMSE())

y_train_one_hot = tf.one_hot(y_train, depth=10)
model.fit(x_train, y_train_one_hot, batch_size=64, epochs=1)

We can see that this implementation of call() method returns a scallar. I think this behavior is also wrong.

@lambdaphy Thank you for the issue. Custom loss function is required to return one loss value per sample. The example will need to be updated to reflect this.

If you are interested in making the change, please feel free to send me a PR.

Thank you for your reply. I'm very happy to contribute, but I am not familiar with using github to open pull request. In addition I'm not a native English speaker, so maybe I'm not competent to edit the documentation.
If you can edit the documentation, just help change it. Thanks.

Most of guidances follow the tf doc which return single value for a batch of training data. I follow the source code to the compute_weighted_loss where LossFunctionWrapper do the mean across batch axis, and found that if custom loss func return a value instead of a array of value, we got two problems:

sample_weights argument will be meaningless since wo do mean first.
Loss are averaged based on a uncorrect denominator when do training with tf.distribute.Strategy.
@lambdaphy what do you think?

Yes, you're right.  Loss function returning a single loss value for the whole batch will cause problems under some circumstances.
The documentation has yet to be corrected.
There are many ambiguities in the document.

Okay the example has still not been updated
The conclusion is that it should return an array rather than a single value?

Okay the example has still not been updated
The conclusion is that it should return an array rather than a single value?

It should return array of sample losses.
So following is wrong : 🚫
def custom_mean_squared_error(y_true, y_pred):
        return tf.math.reduce_mean(tf.square(y_true - y_pred))

Following is correct: ✅
def custom_mean_squared_error(y_true, y_pred):
        return tf.math.reduce_mean(tf.square(y_true - y_pred), axis = -1)

Thanks @lambdaphy
We should update this guide
I can update it if we all agree with that

I am still confused. If we are trying to produce an array with one loss value for each sample within a batch, wouldn't we use def custom_mean_squared_error(y_true, y_pred):     return tf.math.reduce_mean(tf.square(y_true - y_pred), axis = 1))
since the batch size is the first dimension?

@lambdaphy,
The related PR #https://github.com/keras-team/keras-io/pull/1288 was merged and also the requested changes were also reflected on the tensorflow.org and Keras.io official documents.
https://www.tensorflow.org/guide/keras/training_with_built_in_methods#custom_losses
https://keras.io/guides/training_with_built_in_methods/
Before:
def custom_mean_squared_error(y_true, y_pred):
        return tf.math.reduce_mean(tf.square(y_true - y_pred))

After:
def custom_mean_squared_error(y_true, y_pred):
        return tf.math.reduce_mean(tf.square(y_true - y_pred), axis = -1)

Could you please check the source file https://github.com/keras-team/keras-io/blob/master/guides/ipynb/training_with_built_in_methods.ipynb and confirm the same. Thank you!


How do I obtain information about paired nodes (CON-638)

for example:
After commisin the device, I can get the specific information under each node, such as node 1 is homekit, node 2 is google

Where do you want to obtain these details, on the commissioned Node or on the controller?
On Node: you can iterator over the fabrics and get the VendorId, you can find the relevant APIs in FabricTable.h.
On Controller: You can read the fabrics attribute in operational credentials cluster with fabric-filtered set to false. chip-tool operationalcredentials read fabrics <node-id> 0 --fabric-filtered 0

Where do you want to obtain these details, on the commissioned Node or on the controller?
On Node: you can iterator over the fabrics and get the VendorId, you can find the relevant APIs in FabricTable.h.
On Controller: You can read the fabrics attribute in operational credentials cluster with fabric-filtered set to false. chip-tool operationalcredentials read fabrics <node-id> 0 --fabric-filtered 0

Thanks you very much!


change the theme

change the theme of Home page make it in light theme

Hey, I can work on this issue, please assign this to me!

Please make PR with base branch <24-change-the-theme>

Hi @Horror26,
Can you assign me this issue ?

Hello @Horror26 !
Is this issue still open?

Hello @Horror26 !
Is this issue still open?

Yes

Hello @Horror26 !
Is this issue still open?

Yes

Any idea about the colors?

Hello @Horror26 !
Is this issue still open?

Yes

Any idea about the colors?

you can take any as you think best
and also see the tailwind config file  all predefined  colors use are there


Add DateTime parsing utilities (here for now)

We plan to have a relude-datetime library eventually, but until then, we can add some basic date-time parsing utilities here.  We can move them to a new lib later.
ReludeParse.DateTime.ISO8601.parse(...)

For date times, @mlms13 and I had an idea for type-safe format specs, which could be used for parsing and formatting datetimes:
module Format = {
  type t = | Lit(string) | Year4Digit | Year2Digit | etc.
};

let parse: (list(Format.t), string) => Belt.Result.t(DateTime.t, string) = List.foldLeft(...)
let format: (list(Format.t), DateTime.t) => string = ...

E.g.
parse([Year4Digit, Lit("-"), Month2Digit, Lit("-"), Day2Digit], "1999-02-03")

We'll have to make some decisions on how best to setup the format data constructors - whether they should be very specific and unambiguous vs. parameterized with ints.
e.g.
Month2DigitZeroPad
vs.
Month(int, string) // Month(2, "0")
vs.
Month2DigitWithPad(string)
etc.

The problem with int and string parameters is that they make the whole thing very open-ended and prone to error.

I think I'll put all datetime stuff in a separate library and not bother with it here for now.

Leaving this open until something exists (either here or somewhere else)

relude-eon exists, and should soon have some parsers, so I'll close this


[desktop_multi_window] Bringing the already opened window in front

Is there a way to bring the already opened window in front? I know that we can close a window or open the same one by closing it. However, I want to ask whether we can bring in front a window that is already opened as a sub-window but in the background since the user returned to the main app window.

I have a similar request to this - is it possible to make a sub-window activate in the foreground if the main window is in the background? Otherwise the new window is behind some other application.
My current workaround is to first activate the main window, then open the sub-window and it will show in the foreground.
Use case is if some background event is to trigger a new window to pop up in front of the user.


fix footer mobile view

Issue Number #
Changes proposed in this pull request :
[Live Link](provide link here)

Is this alright? @Anupam-dagar ?

https://tlazypanda.github.io/Girls-who-code/

last minute PR's 😛


pull request for e2e test at 11/18/2016 20:26:24

:white_check_mark: Validation status: passed

File
Status
Preview URL
Details

optest/docs/updated_at.md
:white_check_mark:Succeeded

For more details, please refer to the build report.
Note: If you changed an existing file name or deleted a file, broken links in other files to the deleted or renamed file are listed only in the full build report.


Reduce penalty for sending duplicate block requests

This PR reduces the penalty for a peer sending a duplicate block request. Currently, a duplicate block request results in an instant ban. With this PR the penalty is changed to just a large reduction in reputation. This helps to avoid the situation where honest peers are banned for having (e.g.) poor networking. The actual reputation change is sort of arbitrary, I just aimed for a large penalty that allows a few offenses (4, if starting from a neutral reputation) before a peer is banned.
This fixes an issue we've encountered in test networks where honest peers are banned for duplicate requests (which are sent due to e.g. a network interruption) which causes them to fork and struggle to rejoin the network.
This should resolve #10794 as well, I believe.

I'm still not convinced that this is the right solution. I mean yes, it will "solve" your problem. However, the real question is, why do we send the same successful request multiple times?

However, the real question is, why do we send the same successful request multiple times?

There is a reproducer in #10794, where network latency causes a duplicate request. I think that is sufficient to prove that there are legitimate reasons that an honest node could send a duplicate request and be banned. Even if there is something fixable there, it still seems like an instant ban is harsher than the misbehavior warrants, and this change does not prevent such a fix.

Network latency should not lead to duplicate requests.

If we kind of expect this behavior from honest node from time to time then why we penalize it so harshly (few such events result in a disconnect, right?)?

I mean we did not really expect this ;) At least I would not expect this. If someone can proof that this isn't a bug in the code and this duplicate is valid and can not be prevented I'm fine with decreasing this penalty.

Closing, I'd like to look deeper into the cause of the duplicate requests.


predict_generator verbose option?

I think it would be really useful if the predict_generator method had a verbose option. I would like to see the progress as predictions are made.

yep. I have a test set of 500K images, and verbose would definitely help

+1 !!!

+1
If no one else is working on this, I'll work on a PR.


fix the issue  #830, pod_uid field extraction

#830  The pod_uid field has not only pod_uid but also namespace and pod_name.
Proposed changes
fix the issue #830
to follow the change of the pod log directory changed after k8s 1.14 or later.
Types of changes
What types of changes does your code introduce?
Put an x in the boxes that apply

[x] Bugfix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[x] Breaking change (fix or feature that would cause existing functionality to not work as expected)
i am concerned that the user using old k8s might be affect of this change. can we change to work for both of them?

Checklist
Put an x in the boxes that apply.

[x] I have read the CONTRIBUTING doc
[x] I have read the CLA
[ ] I have added necessary documentation (if appropriate)
[ ] Any dependent changes have been merged and published in downstream modules

Hi @Kiyoshi-Miyake, sorry for the delay. I am not getting any chance to review the PR. I'll try to do this by end of the next week.

Closing the PR as discussed in https://github.com/splunk/splunk-connect-for-kubernetes/issues/830#issuecomment-1366371165


Carthage build

Hi,
I make my Cartfile
github "IBM-Swift/BlueSSLService" ~> 0.12

and do
carthage update

But the result I get is
Dependency "BlueSSLService" has no shared framework schemes

That seems fair, given that swift build doesn't build a framework, and there is no framework target in the xcodeproj. But then how do I build a BlueSocket framework with BlueSSLService included if I do not build them separately?
My motivation is that I want to make Theo available as a Carthage build, and it uses BlueSocket and BlueSSLService for its SSL Bolt connection.
Cheers
Nik

Let me see about setting up a framework target in the xcodeproj.  That'd be the best way...

Thanks :-)

Added in version 0.12.66.  Re-open if you run into any problems.

Hi Bill,
did run into problems, but solved them and submitted PR #45 :-) Thanks for your help! :-)


🗣GitHub discussions spec

GitHub discussions spec
PR Checklist

[x] Applies to #6383 & internal team discussion
[x] CLA signed. If not, go over here and sign the CLA

Info on Pull Request
A specification about GitHub discussion

This doesn’t address my questions in the issue.

Let’s move this back to the issue versus iterating on a spec. This is why it was closed in the first place before. The problem has not been agreed upon.

Is this a solution looking for a problem?

Well it would be helpful if you could define "problem"?
Do we really need GitHub Discussions?
Maybe not. Maybe https://www.reddit.com/r/PowerToys is good enough. Its not active but we could make it so.

Is this a solution looking for a problem?

Well it would be helpful if you could define "problem"?
Do we really need GitHub Discussions?
Maybe not. Maybe https://www.reddit.com/r/PowerToys is good enough. Its not active but we could make it so.

Yes. But I think the owner isn't in the team so we should ask if we can have the owner privilegs when we want this

Once again, please let’s move this back to the issue. Where is the data that backs the need for this.
A core team member really needs to be part of this as it isn’t something we ramp up / down. It is a long term investment.


Primitive browser support

See discussion in issue #126

This looks great! The only comment I would make is that the EreaderBrowser class isn't really necessary, as it's only used in one place and is not a logical "object" per se. Instead we can just put that if logic straight into the header template. If later on we find that we need to make that same check somewhere else, we can create a class or reusable function then.

Thanks for the quick review. We need the check in Header.php and SearchForm.php. I'm open to a different way to make a reusable function because you're right that it's not a logical object.

Good call, done.

Excellent, thanks!


don't move calendar date into dot because then it's hard to put it ba…

…ck if we update the cell again

Before:
https://github.com/blackgirlbytes/LunaFocus/assets/75763349/4c57b9a8-bb11-4cba-8cb8-bf5c346314d6
After:
Uploading Screen Recording 2024-06-28 at 10.27.38 PM.mov…


Embed schema files

What changed?

Refactor schema update tool to support embeddings
Add schema embeddings

Why?

To make it easier to access schema files from monorepo

How did you test it?
local test, unit test

Potential risks

Release notes

Documentation Changes

Pull Request Test Coverage Report for Build 0184f2f0-0a8a-471c-b167-ec2c459e7957

16 of 35 (45.71%)  changed or added relevant lines in 4 files are covered.
63 unchanged lines in 13 files lost coverage.
Overall coverage increased (+0.009%) to 57.348%

Changes Missing Coverage
Covered Lines
Changed/Added Lines
%

tools/common/schema/setuptask.go
3
5
60.0%

tools/common/schema/handler.go
2
7
28.57%

tools/common/schema/updatetask.go
8
20
40.0%

Files with Coverage Reduction
New Missed Lines
%

client/history/client.go
2
38.1%

client/history/metricClient.go
2
45.3%

common/persistence/historyManager.go
2
66.67%

common/task/fifoTaskScheduler.go
2
87.63%

common/task/parallelTaskProcessor.go
2
92.75%

common/task/weightedRoundRobinTaskScheduler.go
2
89.12%

service/history/handler.go
2
47.15%

service/history/task/transfer_standby_task_executor.go
2
88.08%

common/persistence/nosql/nosqlplugin/cassandra/workflow.go
3
59.55%

service/frontend/workflowHandler.go
4
59.98%

Totals

Change from base Build 0184ef4f-2220-4702-afd6-6d9859f06d6d:
0.009%

Covered Lines:
85296

Relevant Lines:
148734

💛  - Coveralls


[EHN] Including LGGNET

This architecture is a little more complicated. Together with MEET, EEGProgress, EEGSym, and Tsinception (#641), the model needs the channel names with indexes for different reasons.
I need help deciding if I should include channel_list into the base braindecode or infer or even leave this to be informed when defining the model. (This breaks the convention we established in the last sprint)....
Ideas about the design @agramfort, @tomMoral, @PierreGtch, @robintibor?

@bruAristimunha We already have the list of channel names through the 'chs_info' parameter :)
'chs_info[i]["name"]'

oh yet! Suuuuper true @PierreGtch  I was just remembering that it was a dictionary, not that it was a list. All solved =) I will integrate the rest of the models too ;)


Only one instance of project/resource will survive on restart

Describe the bug
When opening a scripture editor (project) or resource multiple times, only 1 of them will have content after restarting Platform.Bible.
Console shows web-view.component failed to retrieve web view content for ... Error: "Timeout reached when waiting for wait-for-net-obj to settle"
This happens at least since the reworked folder structure

Screenshots

opened projects

after restarting platform

console

To Reproduce

Put projects into the new folder structure <user>\.platform.bible\projects\Paratext 9 Projects
Start Platform
Open them twice with "open scripture editor" or "open resource viewer"
Restart Platform
Unexpectedly the duplicated webviews stay empty
Debug with https://github.com/paranext/paranext/wiki/Troubleshooting-Guide#debug-a-releasepackaged-build

Expected behavior
previosly opened projects would show up on restart - also when opened twice in Platform

Still happening in 37c0b3d

Still happening in 37c0b3d

@Sebastian-ubs Have you tried recompiling? A simple way to do this is make an innocuous change to a file like src\main\main.ts, e.g. add and remove a space, then save it. PB will recompile and reload. I find that if I have moved from another branch that the first compile often has the old code in it and the recompile is needed.

There is a separate issue that sometimes causes web views not to load anymore if they do not load properly even once between refreshes. Did you close and open these webviews and then restart? I can't reproduce this issue anymore, so I will need help reproducing it if you still can.

It works fine in development (npm start)

In production (Platform.Bible 0.2.0-commit.da9d954-latest.exe) it now only fails with tabs that had been opened from an older Platform version.

This tab correctly opens up in the older 175a6fb but not in current da9d954

Could you please attach a log file from starting up the new vs the old verisons that do and don't work with the old web view? Not all old tabs will work every time we make updates, especially breaking changes, so it might just be some old data that doesn't work with the new system. However, I did look at the code at the revision you mentioned, and it didn't look at first glance like it was much older.

With attaching remote debugger I got

renderer.js:2 Unexpected process type: undefined
7807 @ renderer.js:2
renderer.js:2 09:45:14.480 › Starting renderer
renderer.js:2 09:45:14.989 › Got clientId 3
renderer.js:2 09:45:24.123 › No WebView provider found for WebView type platformScriptureEditor.react
renderer.js:2 09:45:24.123 › web-view.component failed to retrieve web view content for {"id":"d280c9de-6dcb-4879-89a1-7c4e2548fa4c","tabType":"webView","data":{"title":"ESVUS16 (Editable)","webViewType":"platformScriptureEditor.react","id":"d280c9de-6dcb-4879-89a1-7c4e2548fa4c","state":{"isReadOnly":null},"projectId":"F421FE261DA7624F0405A602838BBED467F5FDB2","contentType":"react"}}: Error: getWebView: Cannot find Web View Provider for webview type platformScriptureEditor.react

However on restarting Platform several times I got it to load one of the times, so seems to be some race condition / timing issue.

uff, after trying again, I can more precisely say, that it is not a special tab, but the most top left tab of my layout always.

17:34:14.454 › No WebView provider found for WebView type platformScriptureEditor.react
renderer.js:2 17:34:14.454 › web-view.component failed to retrieve web view content for {"id":"c318baec-c90f-4a0b-8f5d-b966c9111762","tabType":"webView","data":{"title":"NIV84 (Editable)","webViewType":"platformScriptureEditor.react","id":"c318baec-c90f-4a0b-8f5d-b966c9111762","state":{"isReadOnly":null},"projectId":"A6219DB975224F500877392222CF654A32477065","contentType":"react"}}: Error: getWebView: Cannot find Web View Provider for webview type platformScriptureEditor.react

Can again confirm the timing issue, as after the 5th or so trial I got it to show up one time. Attaching main.log

some new / clean logs: main.log

renderer.js:2 Unexpected process type: undefined
7807 @ renderer.js:2
renderer.js:2 17:51:32.080 › Starting renderer
renderer.js:2 17:51:32.381 › Got clientId 3
renderer.js:2 17:51:41.555 › No WebView provider found for WebView type platformScriptureEditor.react
renderer.js:2 17:51:41.556 › web-view.component failed to retrieve web view content for {"id":"d280c9de-6dcb-4879-89a1-7c4e2548fa4c","tabType":"webView","data":{"title":"ESVUS16 (Editable)","webViewType":"platformScriptureEditor.react","id":"d280c9de-6dcb-4879-89a1-7c4e2548fa4c","state":{"isReadOnly":null},"projectId":"F421FE261DA7624F0405A602838BBED467F5FDB2","contentType":"react"}}: Error: getWebView: Cannot find Web View Provider for webview type platformScriptureEditor.react

looks like the first webview of every extension fails to load

renderer.js:2 Unexpected process type: undefined
7807 @ renderer.js:2
renderer.js:2 18:23:57.196 › Starting renderer
renderer.js:2 18:23:57.734 › Got clientId 3
renderer.js:2 18:24:06.930 › No WebView provider found for WebView type paratextBibleTextCollection.react
renderer.js:2 18:24:06.930 › web-view.component failed to retrieve web view content for {"id":"192bc760-52ae-48ea-bb62-975b0868f23e","tabType":"webView","data":{"title":"Text Collection","tooltip":null,"webViewType":"paratextBibleTextCollection.react","id":"192bc760-52ae-48ea-bb62-975b0868f23e","iconUrl":"papi-extension://paratext-bible-text-collection/assets/Group24.svg","state":{"projectIds":[]},"projectId":"","contentType":"react"}}: Error: getWebView: Cannot find Web View Provider for webview type paratextBibleTextCollection.react
(anonymous) @ renderer.js:2
renderer.js:2 18:24:06.940 › No WebView provider found for WebView type platformScriptureEditor.react
renderer.js:2 18:24:06.940 › web-view.component failed to retrieve web view content for {"id":"56199c2c-943b-44b2-a5f3-1d6d07d22a08","tabType":"webView","data":{"title":"PCM (Editable)","webViewType":"platformScriptureEditor.react","id":"56199c2c-943b-44b2-a5f3-1d6d07d22a08","state":{"isReadOnly":null},"projectId":"B459B0BD26B6FD5A55E2FDE5390E08B84DD1A2AE","contentType":"react"}}: Error: getWebView: Cannot find Web View Provider for webview type platformScriptureEditor.react
(anonymous) @ renderer.js:2
about:srcdoc:1 An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can escape its sandboxing.
about:srcdoc:1 An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can escape its sandboxing.

new debug logs: main.log


Gradle: Add a progress listener

At debug level, log progress from the Gradle build. This is useful to determine whether a build is actually hanging or just slow.
Signed-off-by: Sebastian Schuberth<EMAIL_ADDRESS>

Merging despite the unrelated PipFunTest failure.


Handle index updates after schema change.

Background: currently all indexes created by RisingWave cover all columns of the table to accelerate arbitrary scans with index-only scans as much as possible.
For ADD COLUMN: Should we also include the new column in the original index as well?

This is technically feasible as the "Compatible States" case mentioned in Towards the Online Streaming Plan Change.
There's no such thing as CREATE INDEX .. INCLUDE(*) in PostgreSQL and users must specify all column names if they want to do so. So there might be no useful reference for us.

For DROP COLUMN: How should we handle the original index?

PostgreSQL will silently drop all indices that refer to the dropped column, even without CASCADE. 😄 This might be unacceptable to us, as we always include all columns, and dropping a column means all indexes must be dropped as well.
For regular materialized views downstream, the current implementation rejects the drop request if there's any reference, which is conservative and reasonable. Index, as a special materialized view, inherits this behavior.
To do better, we can also support only dropping the columns in a cascaded manner, which is also a case of "Compatible States".

cc @chenzl25 @fuyufjh @liurenjie1024

Just handling adding columns and dropping columns for auto-covered indexes seems more reasonable. For normal indexes, we can follow the PostgreSQL behavior.

Just handling adding columns and dropping columns for auto-covered indexes seems more reasonable.

Agree, though it needs some extra work. I guess in this case we should add a flag for the index catalog to mark whether it's auto covered?

For ADD COLUMN: Currently, we don't have a field to indicate whether an index is created with or without an explicit include keyword, so I think it is acceptable to keep them the same. If we want to support auto-covered indexes, we must add a flag to the IndexCatalog.

Agree.

For DROP COLUMN: it seems to be a dangerous operation to drop indexes implicitly if they include the dropped column. Telling users to check their indexes if some indexes include the dropped column looks safer. We can provide a global variable to decide whether to drop indexes including the dropped column if users want to change the default behavior.

I think in our current implementation, index is just another mv, so if we deny the request which may affect downstream mv, we should also deny this request which may affect index. But we should have a way to allow user to force drop mv/index, maybe cascades keyword is a good option, even if it's not compatible with pg.


Update Dockerfile and add dependabot support for Docker

Noticed that the Dockerfile is using an old version of stretch. Current version is 9.13 not 9.5.
This PR adds dependabot support for updating Dockerfile as well as converting the existing Dockerfile to use a digest for the debian:9.5-slim image.
Once this PR is accepted and merged, dependabot should create a new PR to update to debian:9.13-slim.
However, given that support for Stretch ends in about 5 months according to https://endoflife.date/debian, consideration should be given towards a new Debian version but I will leave that to the maintainers to decide.

I have fixed the dependabot.yml so that it'll merge cleanly.


Only check WOW64 process when system architecture is x64.

Fixes https://github.com/opscode/chef/issues/1549.
The issue here is that according to msdn IsWow64Process returns false on 32 bit windows systems. Since we're not differentiating 32 bit systems from 64 bit systems we're raising an unnecessary error here.
Windows specs in CI is happy with this here.
I'm open to other solutions @jmink, @btm :smile:

Hi. I am an automated pull request bot named Curry. There are commits in this pull request whose authors are not yet authorized to contribute to Chef Software, Inc. projects or are using a non-GitHub verified email address. To become authorized to contribute, you will need to sign the Contributor License Agreement (CLA) as an individual or on behalf of your company. You can read more on Chef's blog.
Non-GitHub Verified Committers
There are 1 commit author(s) whose commits are authored by a non-GitHub verified email address. Chef will have to manually verify that they are authorized to contribute.
Please sign the CLA here.


Serialization of UUID childs

Bug
Output of python -c "import pydantic.utils; print(pydantic.utils.version_info())":
             pydantic version: 1.3
            pydantic compiled: False
                 install path: /usr/local/lib/python3.8/site-packages/pydantic
               python version: 3.8.0 (default, Nov 15 2019, 02:22:06)  [GCC 8.3.0]
                     platform: Linux-5.3.8-133.current-x86_64-with
     optional deps. installed: ['typing-extensions', 'email-validator']

from uuid import UUID

import asyncpg
from pydantic import BaseModel

struct_dict = {
   "id": asyncpg.pgproto.pgproto.UUID('c9ecc20f-acd6-429a-b781-c59f803af240')
}

class StructSchema(BaseModel):
    id: UUID

struct = StructSchema(**struct_dict)
assert type(struct.id) == asyncpg.pgproto.pgproto.UUID
assert isinstance(struct.id, UUID)

try:
    struct.json()  # raises error
except Exception as err:
    print(err)

struct.id = UUID(str(struct.id))

struct.json()  # ok, because now it really UUID instead of asyncpg's one

Funny one, but little annoying =)

I believe this is related to how python's built-in json.dumps function works -- the default keyword argument takes a dictionary of type to encoder. Pydantic adds an encoder for uuid.UUID by default, but I believe the lookup is done by actual type rather than subclass (presumably for performance).
You can set a custom encoder on the model Config via json_encoders, which should fix this issue: https://pydantic-docs.helpmanual.io/usage/exporting_models/#modeljson
It would be nice if subclasses were handled automatically, but I believe there are nontrivial performance implications since you'd have to loop over all possible encoders looking for one that could encode, rather than being able to do a dict-based lookup. There is actually an open PR in FastAPI trying to address this (and looking at switching to subclass-based checks), but I'm not sure the performance implications are worth it.

the default keyword argument takes a dictionary of (exact) type to encoder

Not true.  The default arguments takes a callback.

It would be nice if subclasses were handled automatically, but I believe there are not-insignificant performance implications since you'd have to loop over all possible encoders looking for one that could encode, rather than being able to do a dict-based lookup.

singledispatch is a thing, supports subclasses properly, and is fairly close to a naive dict lookup because the dispatch is cached.

@elprans You're totally right -- I got confused while digging through the pydantic source and thought a dict was passed directly to the default keyword argument, but that was wrong.
I actually really like the idea of using singledispatch for this, though it might make the implementation a little longer, I think it would give the best of both worlds in terms of performance and usability, which I think is worth the slightly more expanded syntax.
@samuelcolvin thoughts?

Hmm I played with singledispatch and it is a lot slower than I expected. It adds about 50% overhead to fastapi's jsonable_encoder if you don't specialize the actual methods. Specializing helps, but even after specializing as much as possible it was still about 5-10% slower than the existing non-singledispatch approach. So I'm no longer very optimistic about that approach from a performance perspective.

Direct answer to this question:

We have Config.json_encoders which could be used here to add an extra types to convert.
We have Config.json_dumps allows you to provide your own function for serializing JSON
json() can already take a encoder argument which allows you to implement your own function to pass to default in json.dumps

I think we already provide a lot of escape hatches for customising how JSON is encoded while providing a decent and performant default.

More generally, this also relates to #951 and how we extend pydantic to support "partial serialisation" e.g. serializing a model to a json serialisable dict (originally suggested and partially implemented by @tiangolo oin #317 but that was closed). In fact it relates to lots of issue, I tried to gather these by labeling them all "serialization".
I promised to work on #951 but haven't got around to it yet.
Surely internally singledispatch is doing some variant of
function_lookup = [(TypeA, convert_a), (TypeB, convert_b), ...]
...
for type_, func in function_lookup:
    if isinstance(v, type_):
        return func(v)
raise CantDoIt(...)

Which is always going to be slower (though more user friendly) than what we're doing now which is essentially:
function_lookup = {TypeA: convert_a, TypeB: convert_b, ...}
...
try:
    func = function_lookup[type(v)]
except KeyError:
    raise CantDoIt(...)
else:
    return func(v)

I would propose we do the following:
Allow another callback to be called if pydantic_encoder fails. That method could implement something like the above for type_, func in function_lookup: approach, performance isn't as important as it's up to the developer how to implement it. For this case they could simply do if isinstance(v, asyncpg.pgproto.pgproto.UUID):.... Maybe this is unnecessary, people could already accomplish this by overriding the encoder argument in json(), then calling pydantic_encoder and just catching TypeError and doing their own thing at that point.
Also (but not strictly related to this issue):

allow types to customise how they're serialised a bit like how __get_validators__ allows them to customise how they're parsed/validated and __modify_schema__ allows them to customise they schema generated for them. Perhaps via a method __serialize__(self, protocol) where protocol could be JSON or some other destination protocol
add a protocol argument to dict() which if not None causes pydantic_encoder to be called on each value, that would accomplish what was originally suggested in #317 and other issues

it was still about 5-10% slower than the existing non-singledispatch approach

IMO, 5-10% is a reasonable tradeoff for actually doing the Pythonic thing.  Being able to pass a subclass to a function taking a superclass is a fundamental norm of Python.  json.dumps() itself has no problems with subclasses of types it supports, and every stdlib function behaves likewise.

@samuelcolvin I assumed it attempted a cache lookup first which presumably would be as fast as what we have now (similar to how our GenericModel.class_getitem works), then only if that fails it does the subsequent isinstance checks, and then after those checks registers the actual type so it can be looked up via cache on subsequent calls.
Admittedly, that is a big assumption, (and presumably wouldn't be too hard to check by just reading the source which I haven't done 😅). If it is not implemented that way, though, I wonder why not.

@elprans During the development of this library we have done our best to consistently make a priority of small performance gains (to the tune of 1-2%; smaller than this for sure), and the end result is a library that is substantially faster than alternatives. Performance has been and is likely to remain a critical priority, and I think a good solution here really shouldn't come at the expense of performance, especially for users that don't take advantage of the capability.
I am still inclined to keep looking for ways to achieves the desired usability without sacrificing performance (and I suspect such an approach may well exist; @samuelcolvin's suggestion is a step in the right direction but maybe it can still be simplified further..).


leptosfmt removes comment from formatted view! when it's the first line

I noticed that leptosfmt removes comments from the view! macro, but seemingly only when the comment is on the first line. If a comment appears elsewhere in the macro, leptosfmt doesn't remove it.
In the below screen recording, the comment is removed after pressing Cmd + S
https://github.com/user-attachments/assets/3068acf8-da43-4cf5-9387-17b7925c352a
[grqmuxsirm] 01:46 ~> leptosfmt --version
leptosfmt 0.1.20
[grqmuxsirm] 01:46 ~> rustc --version
rustc 1.80.0 (051478957 2024-07-21)
[grqmuxsirm] 01:46 ~> cargo --version
cargo 1.80.0 (376290515 2024-07-16)

Hi, thank you for the bug report. There is a test case that tests exactly this, so I am a bit surprised that it strips away the comment: https://github.com/bram209/leptosfmt/blob/d1304ea9b77f9e9abff4c3201dcdf1b6c9126815/formatter/src/source_file.rs#L353
Until this is fixed, I recommend putting the comment above the view! { .. } expression.

I wonder if the cx on the same line as the `view! {’ makes it so the comment isn’t actually on the first line, in which case that test isn’t actually testing first-line comments.

Ah, you probably are right.

A comment is also removed if it's the last line in a view macro.
$ leptosfmt --version
leptosfmt 0.1.30


Update Refresh Token Expiration

We have a requirement which is to expire access after 45 minutes of inactivity. To do this we're setting the TTL to 45 minutes and our plan is to update the expiration to t+45 minutes on the refresh token expiration on every request to. Is there an elegant way to do this (other than an ad-hoc SQL query)?

unfortunately there's no elegant way to do it right off the box. Usually the refresh token has a fixed expiration time and so has the access token. The security of the refresh token stands in that it is less frequently exchanged over the wire.

No problem - thanks for the reply


buildscript: Let cpio command handle symlinks in the workspace path

@swift-ci Please smoke test and merge


Cant "Reset Sync" Microsoft Edge

Hello
recently I reinstalled windows on my laptop. I signed in my Microsoft account in new windows and removed my previous device from "https://account.microsoft.com/devices". Then I opened the Edge and signed in my account
After all my browser data was synced, I saw that when I right-click (this pic) or click in the browser's address bar (this pic), it shows the previous device while I deleted it from the Microsoft account.
I tried very hard to remove it, but when I reset sync, all the data is deleted, but by re-signing in and turning on Sync, the name of the previous device appears in the "Send This Page to other devices" section.
Now I understand that before syncing reset, Microsoft account must be signed out of all devices (this pic)
While I installed the new Windows and forgot to sign out of my account in the edge browser in the previous Windows and I no longer have access to the Windows device and its Edge browser Because the previous Windows was completely erased and the current Windows has been replaced
Now how can I completely delete the previous device that signed in to Edge ? or How can I completely reset sync ?
Previous device name (previous Windows): DESKTOP-FAFI388 (Which you see in the first two photos)
Current device name (new Windows): DESKTOP-U5UBI8B (this pic) (As you can see, this is the only device on my Microsoft account and I deleted the other devices and they no longer exist.)

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: 3fa2b6bb-c572-6b62-0b2a-5d11cc6c16c2
Version Independent ID: bbd72cfb-0dd2-dce0-ede7-6887a2992bad
Content: Reset Microsoft Edge data
Content Source: edgeenterprise/edge-learnmore-reset-data-in-cloud.md
Product: microsoft-edge
GitHub Login: @dan-wesley
Microsoft Alias: collw

@BeYourself91 Hello!  Sorry to hear about the sync issues.  Normally this is for Microsoft Edge Enterprise Documentation issues.
If you haven't had a chance yet, I would recommend reaching out to support for further assistance: https://microsoftedgesupport.microsoft.com/hc/en-us


Fix/anthropic bad request

Description
Fixes multiple bugs with the Anthropic integration related to request generation and response handling. Also adds the from_env constructor to Anthropic and Cohere's provider clients, as well as proper provider error reporting.
Fixes #66
Fixes #65
Type of change
Please delete options that are not relevant.

[x] Bug fix
[x] New feature

Testing
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce your results.

[x] Ran the anthropic_agent example without specifying temperature (succeeded)
[x] Ran the anthropic_agent example without specifying max_tokens (failed as expected with proper error message)
[x] Ran the agent_with_tools example with a Anthropic's CLAUDE_3_HAIKU (succeeded)

Checklist:

[x] My code follows the style guidelines of this project
[x] I have commented my code, particularly in hard-to-understand areas
[x] I have made corresponding changes to the documentation
[x] My changes generate no new warnings
[ ] I have added tests that prove my fix is effective or that my feature works

Will be added with other integration tests at some later point

[x] New and existing unit tests pass locally with my changes

Notes
These bugs highlight the need for typed provider specific Request models so that these kinds of errors can be caught earlier while reducing the need for manipulating raw JSON while building the underlying request (which is error prone)

There seems to be more changes than just anthropic here but overall looks good. The comment about making the ClientBuilder validate via compile-time type checking is def. something we should do in a future PR.

One of the fixes (proper error reporting) was also applied to all other providers (which had the same problem as Anthropic) so the PR does touch on more than Anthropic because of that. As for the example, I just noticed it was a bit messy before so I cleaned it up (but true this could have been done in another PR :upside_down_face: )


Fix article "Retrieving Counter Names and Help Text"

Rename file to match article's title
Fix XML entities
Elaborate on language identifier format and fix the example
Fix example accordingly
Document a bug about localized Help <langid> always returning strings in English

 Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.:x: ratijas sign nowYou have signed the CLA already but the status is still pending? Let us recheck it.

@ratijas : Thanks for your contribution! The author(s) have been notified to review your proposed change.

I've done my research and homework, all code of experiments are  uploaded here, in case anyone want to verify my statements: https://github.com/ratijas/windows-rust-counters

Thanks @ratijas!

#sign-off

Thanks for such a fast merge! Impressive. Though, I see, I should really work harder on my grammar.
About that Help <langid>... I think it should be reported as a bug elsewhere, bug I'm not sure where exactly.

These might help:

For developer issues, or suspected product bugs, there's Microsoft Support; a support engineer will look at the repro and see whether the issue is a Microsoft product bug, or something else. If it's a bug with a Microsoft product then the ticket will be free of charge.
The Feedback Hub app is the right place to lobby for a change, a feature, or to make a suggestion.
For community assistance with development questions, there are our forums, and StackOverflow.
The Windows developer support site explains other support options.
The Visual Studio developer community is available, and responsive. The former User Voice feature is now there on the Suggest a feature tab, if you want to lobby for a change, a feature, or to make a suggestion.

If you receive assistance via any support resource, and you believe that information would help us improve the docs, then please come back and let us know.


Publish v2.0 to npm with @beta tag

This can help community to try second version of anime.
$ npm install animejs@beta

or
$ npm install<EMAIL_ADDRESS>
Thanks!

You can install from GitHub: npm install juliangarnier/anime#v2.0 (or via commit hash).

Hi, I'm very excited with the new version, great work!
I have an issue in the process of build the source with the create-react-app:
Creating an optimized production build...
Failed to compile.

static/js/main.8a680a56.js from UglifyJs
SyntaxError: Unexpected token: punc ()) [./~/animejs/anime.js:23,1]

Any ideas? thanks!

@ngokevin Ok, thank you, I just thought it would be nice to publish it to npm.)

@TIMNHE Sorry, I don't think this is relevant to this discussion, please create new issue.
p.s. May be you can exclude anime.js from parsing by webpack.


Add to .gitignore: .idea project files

:page_facing_up: Release Notes

Added to .gitignore: .idea project files

This is user-specific files, should not be here, IMO.

I think she was just following the other projects, @beraldoleal. Python-OpenFlow and Kytos both have "spyder project" "rope project", etc. on .gitignore. If the standard will be to not include IDE-specific listings, I think we should remove those, too. Reopening here until we settle this down.

We should remove the files there. Having specific user files in .gitignore is not a good idea, IMO. If every single contributor decides to use a different IDE or having different files in the project folder, .gitignore will be huge.

Perhaps each developer should configure their own global .gitignore file, so they can ignore files specific to their environment and not specific to the project.
Example:
IDE-generated files (.idea, *.iml, eclipse files, visual studio files..)
OS-generated files (Thumbs.db, DS_Store…)
Atlassian global-git-ignore-rules

OK, so let's just agree on this standard and remove IDE-specific lines from the other projects. Closing here.


When a dictionary or array is exported using an empty value, it is exported as a reference for all other instances of the same scene

Godot version:

3.2.3 stable official
OS/device including version:

Windows 10 x64
Issue description:

When a dictionary or array is exported using an empty value (i.e. with = {} or = []), then it will be exported as a reference which is common to all instances of the same scene.
This does not happen if one declares the variable with just the type, or if one does not export the variable
It is expected that a dictionary assigned to a scene, will be unique to each instance of that scene, rather than act as a sort of reference. It is also expected that dictionaries will act consistent among declaration styles.
Steps to reproduce:
export a dictionary variable with an assigned empty dictionary and instance the scene. Fill in some values. Instance another of the same scene. Dictionary in the new scene will start prefilled with the same values.
Minimal reproduction project:
In the below project, I have a scene which declared 3 dictionaries in 3 different ways
export var dict_empty = {}
export var dict_declared : Dictionary
var dict_unexported = {}

Then I instance 3 copies of that scene, and I prefill some values only on the first one. A subsequent print, shows the first dictionary on all three nodes has the same values as the first node.
Iter: 0 - Assigned Empty Dict:{a:1, b:2}. Declared Dict:{a:1, b:2}. Unexported Dict:{a:1, b:2}
Iter: 1 - Assigned Empty Dict:{a:1, b:2}. Declared Dict:{}. Unexported Dict:{}
Iter: 2 - Assigned Empty Dict:{a:1, b:2}. Declared Dict:{}. Unexported Dict:{}

exported-dict.zip

Duplicate of https://github.com/godotengine/godot/issues/16478.


Remove unnecessary application filter

What this PR does / why we need it:
follow #1328
Which issue(s) this PR fixes:
Fixes #
Does this PR introduce a user-facing change?:

NONE

/approve


Can't init theta-client-sdk on react-native - android 14

(EDIT)

I tested using another phone with android 11 and it works. Apparently, there is a problem with Xiaomi Redmi note 12 and Android 14 Hyper OS.

Hi guys, I can't init theta sdk using react-native and android. It's works on old versions but not the latest.
I got this error every time that I try to initialize.
error [Error: Connect timeout has expired [url=http://<IP_ADDRESS>/osc/info, connect_timeout=unknown ms]]
This is my implementation
  const initTheta = async () => {
    console.log('initializing...');
    try {
      const endpoint = 'http://<IP_ADDRESS>';
      const timeout = {
        connectTimeout: 5000,
        requestTimeout: 5000,
        socketTimeout: 5000,
      };
      const config = {
        clientMode: {
          username: 'THETAYP00123456',
          password: '00123456',
        },
      };

      await initialize(endpoint, config, timeout);
      console.log('initialized.');
    } catch (error) {
      console.log('error', error);
    }
  };

  useEffect(() => {
    initTheta();
  }, []);

I don't know if I need to fill client mode and config objects, but in this case I did.
So, how can I connect with my camera and stop this error??

Is anyone having the same issue as me with android 14?