way to pass access_token to typescript file retrieved using razor syntax

What is the way to pass await Context.GetTokenAsync("access_token") to typescript file.
As storing this to hidden and then use it in typescript file does not seem right to me.
Is there any other way?
I want to set it to default header of axios which is in typescript file. But I am only able to access this value using Razor in cshtml.

What do you suggest?

Teat your server-side app as one client, and the client-side app as another client.

ohk. so separate auth for both. right? I'll do that way. Big fan of urs. didnt expect u will answer here. :) Thanks.

@brockallen  If I keep both client distinct, I'll have to redirect to login page again? As without that it gives me login_required error if I do silent login. And if it requires to login again, then, from user perspective it will be troublesome to login twice. Can u please help?

One more thing. If I seperate them client wise. Will their session update to both client? Because client side token might get refreshed automatically, but if server side won't, then it will redirect to login page, where it shouldn't. Haven't tried this practically yet. but I think it will work that way. i am checking on it and will update you if this is the case.

I'll have to redirect to login page again

Yes, but it should work without user interaction on the 2nd one due to SSO.

Will their session update to both client

What session? Can you be more explicit?

Ignore session word. :) But if I keep calling API from js clinet. Will my server side authentication gets refreshed? Wont it redirect me to login if there is no activity of controller of MVC and I call it after timeout? Will seperate client's token timeout will be updated to be timeout on same time?

But if I keep calling API from js clinet. Will my server side authentication gets refreshed

they are independent, so you need to design for that.


[CRIMRE-212] Restrict user deactivation journey

Description of change
Ensure that the user cannot delete all other users in manage_users dashboard
Link to relevant ticket
https://dsdmoj.atlassian.net/browse/CRIMRE-212
Notes for reviewer
Screenshots of changes (if applicable)
Before changes:
After changes:

How to manually test the feature

User logs into portal.
If the user has manage other user's responsibility they should see an option to manage users as attached on the screenshot.
User clicks on Manage users.
if the user has existing users in the manage users menu, they can edit the users and give them access to manage other users permissions, by clicking on edit under the Actions subheading.
If the user has multiple existing users they can deactivate the users by clicking on deactivate under the Actions subheading.
When the user can see that there only two admin users left and they try to deactivate another admin user they will get message banner that will say "Unable to deactivate user. There must be at least two users who can manage others".

@timpeat was deactivated_users_controller.rb (past tense) meant to be called deactivate_users_controller.rb (present tense, same as old controller name before moving into new folder) ?

@timpeat was deactivated_users_controller.rb (past tense) meant to be called deactivate_users_controller.rb (present tense, same as old controller name before moving into new folder) ?

No, I have another PR which uses this controller to list the deactivated users so they can be reactivated.

I think that maybe this change in functionality isn't covering the actual edge case that we were trying to cover.
We want to block a user manager removing user management rights from the final other user manager. Which I was just able to do on this branch.
This page:

I think that maybe this change in functionality isn't covering the actual edge case that we were trying to cover.
We want to block a user manager removing user management rights from the final other user manager. Which I was just able to do on this branch.
This page:

Ah missed this behaviour. Now added. Thanks @arthurashman


idx.index creation is not 64-bit safe

Expected Behavior
Created a idx file with mmseqs createindex. Input is big, uniref30.
I was expecting the resulting .idx.index to show me how large each "chunk" in the idx database is...
Current Behavior
...however, sizes in .idx.index are truncated to 32-bit.
Steps to Reproduce (for bugs)
I did not create the idx file, I only get to inspect the idx.index afterwards.
So, we have 3 files
214G uniref30_2302_db.idx
   4 uniref30_2302_db.idx.dbtype
 506 uniref30_2302_db.idx.index

$ cat uniref30_2302_db.idx.index

0	0	3
1	4096	49
2	8192	4331
3<PHONE_NUMBER>28	1075201
4<PHONE_NUMBER>32	387072001
5	24576<PHONE_NUMBER>
6<PHONE_NUMBER><PHONE_NUMBER>
7<PHONE_NUMBER><PHONE_NUMBER>
8<PHONE_NUMBER>8<PHONE_NUMBER>
9<PHONE_NUMBER>76<PHONE_NUMBER>
10<PHONE_NUMBER>76<PHONE_NUMBER>
12<PHONE_NUMBER>32	9
13<PHONE_NUMBER>28	9
14<PHONE_NUMBER>24	93370172
15<PHONE_NUMBER>72	9
16<PHONE_NUMBER>68	290347937
18<PHONE_NUMBER>0<PHONE_NUMBER>
19<PHONE_NUMBER>48	250490302
20<PHONE_NUMBER>0<PHONE_NUMBER>
21<PHONE_NUMBER>48	250490302
22	20480	41
23	16384	1
24<PHONE_NUMBER>88<PHONE_NUMBER>
25<PHONE_NUMBER>84	119952652

Copy pasta that into LibreOffice or whatever, add up the length column: adds up to only 15 GB ish!
Lets look at key 9 aka ENTRIES and the following key 10 aka ENTRIESOFFSETS.
Their offsets are<PHONE_NUMBER>76 and<PHONE_NUMBER>76, ie ENTRIES should be of size<PHONE_NUMBER>76-162807525376=46688051200 but index says it's<PHONE_NUMBER> ie 10x too small.
Correct size in hex is: ADED32000 and size in index DED31067:
A_DED32000
  DED31067

ie. the leading bits got truncated off. The few extra bytes difference are from rounding up to page boundary.
On linux. Installed from prebuilt https://mmseqs.com/latest/mmseqs-linux-avx2.tar.gz.
Not sure where and how this happens... the code looks fine.
There is one 32-bit length here https://github.com/soedinglab/MMseqs2/blob/master/src/commons/DBReader.h#L61 but i'm not sure how it would come into play with creating the .idx.index.

How does the truncated length make it into the index file though?
In https://github.com/soedinglab/MMseqs2/blob/master/src/prefiltering/PrefilteringIndexReader.cpp#L247, things look 64-bit safe.
Calls https://github.com/soedinglab/MMseqs2/blob/master/src/commons/DBWriter.cpp#L403, which eventually calls https://github.com/soedinglab/MMseqs2/blob/master/src/commons/DBWriter.cpp#L379 where the length is computed from offsets.
And eventually formatted to text as a 64-bit integer https://github.com/soedinglab/MMseqs2/blob/master/src/commons/DBWriter.cpp#L415.

Most likely from DBWriter::close. It will read in the database again with a DBReader (4-byte length), check if the keys are sorted correctly, and if not write the index out again, truncating the length.

ok, thanks for clarification


Add documentation for rails-assets buildpack

Thanks for contributing. To speed up the process of reviewing your pull request
please provide us with:
Please confirm the following:

[X] I have viewed, signed, and submitted the Contributor License Agreement.
[ ] I have added an integration test, if necessary.

@ryanmoran anything I missed?

@ryanmoran anything I missed?

@ryanmoran anything I missed?

LGTM

@ryanmoran anything I missed?

LGTM


Server Exceptions are not shown in Application Insights

Describe the bug
Any server exceptions thrown by the service are not visible in Application insights if the RestApiOptionsErrorHandlingExceptionFilter is set to enabled
To Reproduce
Steps to reproduce the behavior:

Setup a service with:

Connected Application Insight
RestApiOptionsErrorHandlingExceptionFilter setup and enabled

Throw an intentional exception that will cause a 500 internal server
See that the exception is not shown in the Application Insight

Expected behavior
Exception are still shown in the Application insight.
Workaround
Simply disabling the filter resolves the issue.
Additional context
This error handling exception filter is enabled by default and is an addon to ATC which might not be something users want to have by default. Consider disabling this feature by default.
I would also argue that this exception handling might not be something ATC should handle, but is something each project needs to handle on their own.

I know how to fix it but with the new(ish) repository I don't know how to test it

I know how to fix it but with the new(ish) repository I don't know how to test it


Text nodes containing only whitespace are converted to null

Example input: convert(document.createTextNode('\t \n '))
Expected output: '\t \n '
Actual output: null

An example of why this is a problem: link 1 link 2 should have a space between the two links. This removes it.
Another example of why this is a problem: I am using this package to process arbitrary, user-inputted rich text, and the white-space: pre-wrap style is applied to the output, which makes whitespace visible.
It is not good to assume it is safe to remove any whitespace. All inputted whitespace should be rendered to the output. If someone, for whatever reason, specifically wants to omit inputted whitespace text nodes from the output, they should use an action, which would be very simple.

If you want, I can try to submit pull requests fixing each of the issues I've submitted so far.

It seems another person ran into this issue in https://github.com/gilbarbara/react-from-dom/issues/7#issuecomment-777103084, but it never got a reply.

Fixed in 0.7.0


[Event Request] Page Sales Quote Subform - add Parameter

Please add the xRec, as standard code does, we also use it for further checks and tracings.
...Like this:
[EventSubscriber(ObjectType::Page, Page::"Sales Quote Subform", 'OnNewRecordEvent', '', true, true)]
local procedure "Sales Quote Subform_OnNewRecordEvent"
(
    var Rec: Record "Sales Line";
    xRec: Record "Sales Line";
    BelowxRec: Boolean
)

Internal page OnNewRecord event cannot be modified because it is a platform one. If you need a new event calling from trigger OnNewRecord then provide information about event signature and needed place in the code.

Internal page OnNewRecord event cannot be modified because it is a platform one. If you need a new event calling from trigger OnNewRecord then provide information about event signature and needed place in the code.


Updated codeviewer

Fixed GitBlob fetch bug
Updated CodeMirror

Using CodeMirror minified

Codeviewer will fit to screen

Since this is just an upstream sync, I say shipit


Burned the one and only pwm, 18th pin on raspberry pi...

Burned the pwm pin on raspberry pi. Now I use 13th pin to connect to the led. The FPS dropped from ~60 to ~13, and there are some weird flickering that randomly occurs. e.g. half of the leds turn into random colors for like 1/10 of a second. The connection seems to be fine.
Is there any way to get the FPS higher, and to get rid of the flickering? I heard that raspberry pi can simulate the pwm somehow on any pin. Any ideas?

I have been using pin 21 with no problems just make sure it's grounded and power is injected where appropriate.


File not found

Hello!!
I get an execution error. When I randomly create a db.json file and run it, there is no error, but the file content is only {}
json-server 1.0.0-beta.1
npx json-server --port 9999 db.json

File db.json not found

@callor
What is the location for your db.json and package.json file?


Integrate with other asyncio framework example ?

Is it a good idea to mix pulsar with other framework like https://github.com/channelcat/sanic ?

It depends what you want to do.
If you have a specific question, or would like to discuss possible applications, please ask it in the mailing list.
Issues are for bug reports and feature requests.


[BUG] EpochsTFR.save not saving metadata

Just realized that EpochsTFR.save doesn't save metadata so if you save and reload the function you'll lose the metadata, event, and event_id information. I missed this when I updated EpochsTFR to include metadata. The problem arises when writing to the Hard Disk, mne.time_frequency._prepare_write_tfr() hardcodes what attributes to save into a dict, so that when I added new attributes, they didn't get saved. I think I can fix this by doing something like
attributes = vars(epochsTF)
with a few other adjustments.
If others agree, I can make a quick PR on this

+1 for bug fix PR asap. thx
I would just copy how it's done in epochs.save

I would just copy /refactor and reuse/ how it's done in epochs.save

FTFY :)

... in general we try to avoid things like vars(epochsTF) because while general is not so obvious what is actually getting saved. So we tend to use explicit variable names instead.


fix(config): remove unsupported nullish coalescing

Types of changes

[x] Bug fix (a non-breaking change which fixes an issue)

Description

issue introduced in https://github.com/nuxt/nuxt.js/pull/9280

closes #9321
Checklist:

[x] All new and existing tests are passing.

Codecov Report

Merging #9322 (1e9b8ea) into dev (c56d484) will increase coverage by 0.04%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##              dev    #9322      +/-   ##
==========================================
+ Coverage   65.13%   65.17%   +0.04%
==========================================
  Files          94       94
  Lines        4101     4106       +5
  Branches     1124     1123       -1
==========================================
+ Hits         2671     2676       +5
  Misses       1152     1152
  Partials      278      278

Flag
Coverage Δ

unittests
65.17% <100.00%> (+0.04%)
:arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files
Coverage Δ

packages/config/src/load.js
76.84% <100.00%> (+1.28%)
:arrow_up:

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 c56d484...1e9b8ea. Read the comment docs.

(pending to check possibility of adding esbuild to build scripts to avoid accidental syntax usage in the future)


Need Open Brands dataset to run the sample code

I tried to run test_sample.sh with the pretrained model, which got some errors. The error message showed OpenBrandDataset not found.
Hence, I tried to download the dataset from ACM MM2021 Security AI Challenger, but the site popped up a message showing "You should register this competition before downloading the dataset". I don't think I could register for the competition now.
Could you provide the dataset for running the example? Thank you!

Hi, I added the download path file *.md, but I'm not sure if these download links are working, hope they are useful for you. Thank you!

Thanks for your response. The links worked with Microsoft Edge browser. I could not download the dataset with Google Chrome and Vivaldi browser. After some trials, I figured out some browsers will not be allowed to download the zip files for security issues.


Switch to fork of serde_rosmsg

Description

Discovered that serde_rosmsg was quite slow on uint8[] -> Vec deserialization
Figured out how to make it MUCH faster: https://github.com/adnanademovic/serde_rosmsg/pull/5
Switched to our own fork of serde_rosmsg to enable to optimization
Updated codegen to generate types that take advantage of optimization via serde_bytes
Added criterion based benchmarking to validate speedup (and to start adding performance testing in general):

This resulted in a 71% speedup on sending 1080p color images, from 22ms to 6.3ms.
Running benches/image_bench.rs (target/release/deps/image_bench-3e2fda80b1f23a8a)
Gnuplot not found, using plotters backend
image_bench             time:   [6.2894 ms 6.3457 ms 6.4039 ms]
                        change: [-71.261% -71.004% -70.693%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 100 measurements (3.00%)
  3 (3.00%) high mild

Benchmarking is not fixtured in CI yet. Results obtained on a AMD Ryzen 9 4900HS
Fixes
Closes: number
Checklist

[x] Update CHANGELOG.md

Leaving this here for future self.
This is a 5 second profile run of the image send / recv bench mark. Looking at where performance can still be gained.


Improve information about Premium subscriptions and Teams

As seen in #496, the current way Ferdi displays information about the Premium status may be irritating to new users.
This commit will:

Hide all premium sections if we are not using the Franz server as they are not used with Ferdi servers
Hide teams section if we are not using the Franz server as Ferdi servers do not support Teams
Update the description on the Teams page to indicate that Teams are of no use in Ferdi
Fix accessing the Team Management page to redirect to meetfranz.com instead of getferdi.com
Hide the "Delete Account" section on the accounts page as accounts on Ferdi servers can be deleted through the Dashboard and not though Ferdi

Types of changes

[x] Bug fix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

[x] My code follows the code style of this project (run $ yarn lint).

With Franz server:

With Ferdi server:

I cannot reproduce your problem with the titles having the wrong the right text color - are you still seeing that problem?

This is an issue related to Dark Mode, will address in another pull request.

Hi,
Why this important feature is disabled ?
Can we easily add it if we use our own server ?
Thank you

@aminebenj This PR doesn't disable any features: The "Teams" and "Premium" sections are only useful when using Franz's server as Ferdi's servers don't offer such a functionality - when you are using Ferdi's servers all premium features are already available.
This is why we hide those sections to make it more clear that they are not needed.

@vantezzen So maybe I m posting in the wrong PR. But I wanted to understund is why we can't have Teams on Ferdi's servers? Is it a choice? Because I think that it a very interesting feature.
If I have some answers or guidelines maybe i can help doing it and then make a pull request to add it.
We can at least keep it when people use their own server.

@aminebenj there is another issue referenced in this pull request that seem to answer your question:

See https://github.com/getferdi/ferdi/issues/496#issuecomment-603861664:

Ferdi doesn't officially support Franz Teams and there is no support for Teams on custom Ferdi servers.
The reason for this is that Ferdi doesn't offer any "premium" subscriptions, thus making Franz's Team management useless as that is only used to manage subscriptions for multiple users.
We may remove the "Teams" page in the future to make this more clear.

@kytwb Thank you for your clarification.
At First, I thought that teams are made to collaborate in the same tools. and give coworkers access to the same accounts in tools like shared email boxes...
Can Ferdi be usefull for this usecase ?

@aminebenj Thank you for sharing your use case.
At the moment, Ferdi server is used to sync services. That means if you use Ferdi with an account on computer A, then login on computer B with the same account on the same server, you won't have to reconfigure Ferdi. For security reasons, we can't share active sessions, so you would have to re-login to each services on computer B.

@aminebenj To answer your question, Ferdi isn't optimized for your use case (as any way your coworker would have to re-login, as in you can't give coworkers access to the same accounts thanks to Ferdi). An interesting part of your use case we could maybe take a look at is improving the use of shared account (as in you can use 1 account for you and your workers so you all have the same services in Ferdi and are all in the same page when it comes to what services are used at work), or offer a "import services" feature where you could share you current services to your coworkers, and each to their accounts would import the list of services you shared. WDYT? /cc @vantezzen

You already offer such (or a similar) functionality: You can create your services in Ferdi and export your configuration over Ferdi's dashboard (at api.getferdi.com) and let your coworkers import that configuration so they have the same services.

@kytwb It can be interesting. Sharing the same account, feels like a hack (as we will use the same password) and has the same security issues level as having a team in the back side. So in that case better doing the teams.
Importing services avoid Ferdi to manage all security issues so it can be a good idea. But i give the user more security issues to manage. Be sure that no one export the companies services...

You already offer such (or a similar) functionality: You can create your services in Ferdi and export your configuration over Ferdi's dashboard (at api.getferdi.com) and let your coworkers import that configuration so they have the same services.

Also, you can theoretically give coworkers access to the same account - as sessions aren't shared over the server, you can all use the same configuration with different accounts.


order matching keeper task

Bot/ keeper task that connects to the exchange and performs (arbitrage) trades.

[ ] Study https://github.com/nexusdev/keeper
[ ] Discuss with dbrock how to integrate this with keeper

(ported from https://github.com/MakerDAO/maker-otc/issues/8)

Development for this is happening in https://github.com/BlockChainCompany/maker-market-matcher

Moved to https://github.com/BlockChainCompany/maker-market-matcher


Adds support for MB5RS2MTA 256KB FRAM component

Tested using this breakout board connected to SPI3 on a Matek H743 Wing FMU:
https://www.adafruit.com/product/4718

Once the change merges upstream we can take this in as a backport.
Please re push this with [BACKPORT] in the commit message  as
[BACKPORT] Adds device descriptor for the MB5RS2MTA 256KB FRAM part


Fix: main area width should be auto (fix #4)

As described in #4, on smaller screens the sidebar navigation is partially pushed off-screen because both the sidebar and main content area have fixe widths that total for more than 1280 px.
Overriding the main content area's width to be sligtly smaller (900px instead of 990) is enought to fix this on common screens.

close #4

Haha yeah, done in a couple of hours, just trying to get it out so I didn't have to deal with the new design. Thanks Linus.


Add attribute times to the docstring of Raw, Epochs and Evocked.

Fix #4700.

Codecov Report

Merging #4706 into master will increase coverage by 0.01%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #4706      +/-   ##
==========================================
+ Coverage    87.8%   87.82%   +0.01%
==========================================
  Files         349      349
  Lines       65700    65700
  Branches    11300    11300
==========================================
+ Hits        57687    57698      +11
+ Misses       5150     5141       -9
+ Partials     2863     2861       -2

@agramfort Improved the descriptions.

thx @aweinstein


Spotbugs

As an alternative to Sonar we should try out/introduce Spotbugs, which also works offline and without a secret.
See also: https://github.com/xdev-software/standard-maven-template/issues/57

Another option: https://github.com/pmd/pmd

Current state:

Will not implement SpotBugs as there are serious problems with FP and ignores
Implemented PMD, will take a bit until it's merged into every nested repo


Don't lose fragmentRefs when unwrapping fragment

Assuming I have:
const raw: FragmentOf<typeof SomeFrag> = ...;
const frag = readFragment(SomeFrag, raw);

I would expect to be able to use frag in places that expect to receive FragmentOf<typeof SomeFrag>:
const rawAgain: FragmentOf<typeof SomeFrag> = frag;

However, currently this causes a TypeScript error stating it's incompatible.
The current code seems to lose fragmentRefs when you call readFragment(), preventing passing the read fragment to an argument/prop expecting FragmentOf<typeof SomeFrag>. This PR restores the behaviour I would expect.
I made these changes directly in GitHub after using patch-package to ensure the change worked for my one use-case locally. I'm not sure if this is the right way to solve the issue or if this is a deliberate behaviour; guidance welcome

More comments re. this change can be found here: https://github.com/0no-co/gql.tada/pull/124#issuecomment-1986569997
Closing for now due to reasons explained there, but marking that we should likely come back to the todo in that comment and figure out a way to make this less confusing. Possibly related to masked fragment ergonomics as mentioned in #123.


Add a Custom Entity - Step #8

In configuring your webhook:
Step 2 - Replace this code:
// Import the Dialogflow module and response creation dependencies from the
// Actions on Google client library.
const {
  dialogflow,
  Permission,
  Suggestions,
} = require('actions-on-google');

with this:
// Import the Dialogflow module and response creation dependencies from the
// Actions on Google client library.
const {
  dialogflow,
  Permission,
  Suggestions,
  BasicCard,
} = require('actions-on-google');

BasicCard,
The ending comma causes issues.

This may be related to the linting tool/configuration you're using. The ending comma is valid JavaScript, although there are stylistic differences in if it should be used.


Pin Dockerfiles to buildpacks-dep:bullseye

I ran into a problem this morning when running make publishing-api. It was failing with the following error:
LoadError: libssl.so.1.1: cannot open shared object file: No such file or directory - /root/.rbenv/versions/3.1.2/lib/ruby/3.1.0/x86_64-linux/openssl.so
/govuk/publishing-api/config/application.rb:3:in `<main>'
/govuk/publishing-api/Rakefile:4:in `<main>'
(See full trace by running task with --trace)
make: ***
[/home/chrisroos/govuk/govuk-docker/projects/publishing-api/Makefile:2:publishing-api] Error 1

By not specifying a tag of the buildpack-deps image we were implicitly using latest which, as far as I can tell, is the same as stable. The stable tag was recently updated from Debian 11 (Bullseye) to 12 (Bookwork). The upgrade from Debian 11 to 12 brings an upgrade of OpenSSL from 1.1.1n to 3.0.9 and this appears to be the cause of the problems I was seeing.
By specifying the bullseye tag I believe we should be retaining the behaviour from before the change to the stable tag.
Prior to this change running make publishing-api, make asset-manager and make whitehall all failed with similar SSL problems. After this change they all build successfully.

The change looks good, but I think we should add a comment about it as a todo to fix.
As I understand from my digging this is an issue caused by using Ruby < 3.1.4, so it'd be good to state that we can change this line back to the stable branch of buildpack-deps once all apps are using that.

Thanks @kevindew :+1: I've added some comments. Is that the sort of thing you had in mind?


Using observer with new React hooks does not work

https://codesandbox.io/s/vjy5j1xx93
React hooks is still in the oven, I do realize this, but obviously using observer as HOC does something strange to make the React think it's not a regular component.

hope this tweet would help you.
https://twitter.com/mweststrate/status/1055532227939966976

@Yauheni-blr Thanks for the link, it looks great indeed, but I don't know what am I doing wrong then. Is there some unpublished mobx-react version that works with hooks? @mweststrate Can you please share it, looks really amazing :)

Closing in favor of #588


Profile

Codecov Report
Attention: 523 lines in your changes are missing coverage. Please review.

Comparison is base (f429c1b) 61.48% compared to head (d0d2def) 52.89%.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #36      +/-   ##
==========================================
- Coverage   61.48%   52.89%   -8.59%
==========================================
  Files          32       33       +1
  Lines        3544     3435     -109
  Branches      157      191      +34
==========================================
- Hits         2179     1817     -362
- Misses       1361     1614     +253
  Partials        4        4

Files
Coverage Δ

frontend/src/App.tsx
100.00% <100.00%> (ø)

frontend/src/Pages/Auth/LogoutPage.tsx
100.00% <ø> (ø)

frontend/src/Pages/Auth/landingPage.tsx
96.27% <100.00%> (+0.02%)
:arrow_up:

frontend/src/Pages/Explore/Explore.tsx
15.68% <0.00%> (ø)

...d/src/components/ProtectedRoute/ProtectedRoute.tsx
31.25% <0.00%> (ø)

frontend/src/deprecateded/createJobAPI.ts
8.82% <0.00%> (ø)

frontend/src/deprecateded/auth.ts
10.00% <0.00%> (ø)

frontend/src/store/UserStore.ts
93.81% <66.66%> (-1.79%)
:arrow_down:

frontend/src/components/Job/JobDetails.tsx
39.32% <7.69%> (-1.26%)
:arrow_down:

frontend/src/Pages/CreateJob/CreateJob.tsx
93.71% <93.15%> (-1.31%)
:arrow_down:

... and 5 more

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.


Maybe a bug

Hi,
I am not sure if it is bug. However, the code uses iterator as the advice using iterator from the previous same error. But it does not work. When I tried saving model, save_path = saver.save(sess, ckpt_saver_file_final, global_step), I get the error.
Error:
[libprotobuf FATAL external/protobuf_archive/src/google/protobuf/message_lite.cc:68] CHECK failed: (byte_size_before_serialization) == (byte_size_after_serialization): tensorflow.GraphDef was modified concurrently during serialization.
terminate called after throwing an instance of 'google::protobuf::FatalException'
  what():  CHECK failed: (byte_size_before_serialization) == (byte_size_after_serialization): tensorflow.GraphDef was modified concurrently during serialization.
Fatal Python error: Aborted

Tensorflow: 1.8-cuda
Python: 3.6
GPU :  Tesla V100-SXM2-16GB
Train and Model Code:
Error Trace ;
[libprotobuf FATAL external/protobuf_archive/src/google/protobuf/message_lite.cc:68] CHECK failed: (byte_size_before_serialization) == (byte_size_after_serialization): tensorflow.GraphDef was modified concurrently during serialization.
terminate called after throwing an instance of 'google::protobuf::FatalException'
  what():  CHECK failed: (byte_size_before_serialization) == (byte_size_after_serialization): tensorflow.GraphDef was modified concurrently during serialization.
Fatal Python error: Aborted

Thread 0x00002aabae642700 (most recent call first):
  File "/opt/apps/resif/data/production/v1.1-20180716/default/software/lang/Python/3.6.4-foss-2018a/lib/python3.6/threading.py", line 295 in wait
  File "/opt/apps/resif/data/production/v1.1-20180716/default/software/lang/Python/3.6.4-foss-2018a/lib/python3.6/queue.py", line 164 in get
  File "/opt/apps/resif/data/production/v1.1-20180716/default/software/lib/TensorFlow/1.8.0-foss-2018a-Python-3.6.4-CUDA-9.1.85/lib/python3.6/site-packages/tensorflow/python/summary/writer/event_file_writer.py", line 159 in run
  File "/opt/apps/resif/data/production/v1.1-20180716/default/software/lang/Python/3.6.4-foss-2018a/lib/python3.6/threading.py", line 916 in _bootstrap_inner
  File "/opt/apps/resif/data/production/v1.1-20180716/default/software/lang/Python/3.6.4-foss-2018a/lib/python3.6/threading.py", line 884 in _bootstrap

Current thread 0x00002aaaaaaea900 (most recent call first):
  File "/opt/apps/resif/data/production/v1.1-20180716/default/software/lib/TensorFlow/1.8.0-foss-2018a-Python-3.6.4-CUDA-9.1.85/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3169 in _as_graph_def
  File "/opt/apps/resif/data/production/v1.1-20180716/default/software/lib/TensorFlow/1.8.0-foss-2018a-Python-3.6.4-CUDA-9.1.85/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3228 in as_graph_def
  File "/opt/apps/resif/data/production/v1.1-20180716/default/software/lib/TensorFlow/1.8.0-foss-2018a-Python-3.6.4-CUDA-9.1.85/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1766 in export_meta_graph
  File "/opt/apps/resif/data/production/v1.1-20180716/default/software/lib/TensorFlow/1.8.0-foss-2018a-Python-3.6.4-CUDA-9.1.85/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1728 in save
  File "/mnt/lscratch/users/wma/ncc/inst2vec/inst2vec_embedding.py", line 417 in train_skip_gram
  File "/mnt/lscratch/users/wma/ncc/inst2vec/inst2vec_embedding.py", line 546 in train_embeddings
  File "train_inst2vec.py", line 60 in main
  File "/opt/apps/resif/data/production/v1.1-20180716/default/software/lib/TensorFlow/1.8.0-foss-2018a-Python-3.6.4-CUDA-9.1.85/lib/python3.6/site-packages/absl/app.py", line 251 in _run_main
  File "/opt/apps/resif/data/production/v1.1-20180716/default/software/lib/TensorFlow/1.8.0-foss-2018a-Python-3.6.4-CUDA-9.1.85/lib/python3.6/site-packages/absl/app.py", line 300 in run
  File "train_inst2vec.py", line 74 in <module>
/var/lib/slurmd/job1799931/slurm_script: line 21: 217538 Aborted                 python train_inst2vec.py

Code:
########################################################################################################################
# Training embeddings
########################################################################################################################
def train_skip_gram(V, data_folder, data_folders, dataset_size, reverse_dictionary,
                    param, valid_examples, log_dir, vocab_metada_file, embeddings_pickle,
                    ckpt_saver_file, ckpt_saver_file_init, ckpt_saver_file_final,
                    restore_variables):
    """
    Train embeddings (Skip-Gram model)
    :param V: vocabulary size
    :param data_folder: string containing the path to the parent directory of raw data sub-folders
    :param data_folders: list of sub-folders containing pre-processed LLVM IR code
    :param dataset_size: number of data pairs in total in the training data set
    :param reverse_dictionary: [keys=statement index, values=statement]
    :param param: parameters of the inst2vec training
    :param valid_examples: statements to be used as validation examples (list of indices)
    :param log_dir: logging directory for Tensorboard output
    :param vocab_metada_file: vocabulary metadata file for Tensorboard
    :param embeddings_pickle: file in which to pickle embeddings
    :param ckpt_saver_file: checkpoint saver file (intermediate states of training)
    :param ckpt_saver_file_init: checkpoint saver file (initial state of training)
    :param ckpt_saver_file_final: checkpoint saver file (final state of training)
    :param restore_variables: boolean: whether to restore variables from a previous training
    :return: embeddings matrix
    """
    ####################################################################################################################
    # Extract parameters from dictionary "param"
    N = param['embedding_size']
    mini_batch_size = param['mini_batch_size']
    num_sampled = param['num_sampled']
    num_epochs = param['num_epochs']
    learning_rate = param['learning_rate']
    l2_reg_scale = param['beta']
    freq_print_loss = param['freq_print_loss']
    step_print_neighbors = param['step_print_neighbors']
    context_width = param['context_width']

    ####################################################################################################################
    # Set up for analogies
    analogies, analogy_types, n_questions_total, n_questions_relevant = i2v_eval.load_analogies(data_folder)
    folder_evaluation = embeddings_pickle.replace('.p', '') + 'eval'
    if not os.path.exists(folder_evaluation):
        os.makedirs(folder_evaluation)
    analogy_evaluation_file = os.path.join(folder_evaluation, "analogy_results")

    config = None
    options = None
    metadata = None
    if FLAGS.profile:
        options = tf.RunOptions(trace_level=tf.RunOptions.FULL_TRACE)
        metadata = tf.RunMetadata()
    if FLAGS.xla:
        config = tf.ConfigProto()
        config.graph_options.optimizer_options.global_jit_level = tf.OptimizerOptions.ON_1

    ####################################################################################################################
    # Read data using Tensorflow's data API
    data_files = get_data_pair_files(data_folders, context_width)
    print('\ttraining with data from files:', data_files)
    with tf.name_scope("Reader") as scope:

        random.shuffle(data_files)
        dataset_raw = tf.data.FixedLengthRecordDataset(filenames=data_files,
                                                       record_bytes=8)  # <TFRecordDataset shapes: (), types: tf.string>
        dataset = dataset_raw.map(record_parser)
        dataset = dataset.shuffle(int(1e5))
        dataset_batched = dataset.apply(tf.contrib.data.batch_and_drop_remainder(mini_batch_size))
        dataset_batched = dataset_batched.prefetch(int(100000000))
        iterator = dataset_batched.make_initializable_iterator()
        saveable_iterator = tf.contrib.data.make_saveable_from_iterator(iterator)
        next_batch = iterator.get_next()  # Tensor("Shape:0", shape=(2,), dtype=int32)

    ####################################################################################################################
    # Tensorflow computational graph
    # Placeholders for inputs
    with tf.name_scope("Input_Data") as scope:
        train_inputs = next_batch[:, 0]
        train_labels = tf.reshape(next_batch[:, 1], shape=[mini_batch_size, 1], name="training_labels")

    # (input) Embedding matrix
    with tf.name_scope("Input_Layer") as scope:
        W_in = tf.Variable(tf.random_uniform([V, N], -1.0, 1.0), name="input-embeddings")

        # Look up the vector representing each source word in the batch (fetches rows of the embedding matrix)
        h = tf.nn.embedding_lookup(W_in, train_inputs, name="input_embedding_vectors")

    # Normalized embedding matrix
    with tf.name_scope("Embeddings_Normalized") as scope:
        normalized_embeddings = tf.nn.l2_normalize(W_in, name="embeddings_normalized")

    # (output) Embedding matrix ("output weights")
    with tf.name_scope("Output_Layer") as scope:
        if FLAGS.softmax:
            W_out = tf.Variable(tf.truncated_normal([N, V], stddev=1.0 / math.sqrt(N)), name="output_embeddings")
        else:
            W_out = tf.Variable(tf.truncated_normal([V, N], stddev=1.0 / math.sqrt(N)), name="output_embeddings")

        # Biases between hidden layer and output layer
        b_out = tf.Variable(tf.zeros([V]), name="nce_bias")

    # Optimization
    with tf.name_scope("Optimization_Block") as scope:
        # Loss function
        if FLAGS.softmax:
            logits = tf.layers.dense(inputs=h, units=V)
            onehot = tf.one_hot(train_labels, V)
            loss_tensor = tf.nn.softmax_cross_entropy_with_logits_v2(labels=onehot, logits=logits)
        else:
            loss_tensor = tf.nn.nce_loss(weights=W_out,
                                         biases=b_out,
                                         labels=train_labels,
                                         inputs=h,
                                         num_sampled=num_sampled,
                                         num_classes=V)
        train_loss = tf.reduce_mean(loss_tensor, name="nce_loss")

        # Regularization (optional)
        if l2_reg_scale > 0:
            tf.add_to_collection(tf.GraphKeys.REGULARIZATION_LOSSES, W_in)
            tf.add_to_collection(tf.GraphKeys.REGULARIZATION_LOSSES, W_out)
            regularizer = tf.contrib.layers.l2_regularizer(l2_reg_scale)
            reg_variables = tf.get_collection(tf.GraphKeys.REGULARIZATION_LOSSES)
            reg_term = tf.contrib.layers.apply_regularization(regularizer, reg_variables)
            loss = train_loss + reg_term
        else:
            loss = train_loss

        # Optimizer
        if FLAGS.optimizer == 'adam':
            optimizer = tf.train.AdamOptimizer(learning_rate=learning_rate).minimize(loss)
        elif FLAGS.optimizer == 'nadam':
            optimizer = tf.contrib.opt.NadamOptimizer(learning_rate=learning_rate).minimize(loss)
        elif FLAGS.optimizer == 'momentum':
            global_train_step = tf.Variable(0, trainable=False, dtype=tf.int32, name="global_step")
            # Passing global_step to minimize() will increment it at each step.
            optimizer = (
                tf.train.MomentumOptimizer(learning_rate, 0.9).minimize(loss, global_step=global_train_step)
            )
        else:
            raise ValueError('Unrecognized optimizer ' + FLAGS.optimizer)

    if FLAGS.optimizer != 'momentum':
        global_train_step = tf.Variable(0, trainable=False, dtype=tf.int32, name="global_step")

    ####################################################################################################################
    # Validation block
    with tf.name_scope("Validation_Block") as scope:
        valid_dataset = tf.constant(valid_examples, dtype=tf.int32, name="validation_data_size")
        valid_embeddings = tf.nn.embedding_lookup(normalized_embeddings, valid_dataset)
        cosine_similarity = tf.matmul(valid_embeddings, normalized_embeddings, transpose_b=True)

    ####################################################################################################################
    # Summaries
    with tf.name_scope("Summaries") as scope:
        tf.summary.histogram("input_embeddings", W_in)
        tf.summary.histogram("input_embeddings_normalized", normalized_embeddings)
        tf.summary.histogram("output_embeddings", W_out)
        tf.summary.scalar("nce_loss", loss)

        analogy_score_tensor = tf.Variable(0, trainable=False, dtype=tf.int32, name="analogy_score")
        tf.summary.scalar("analogy_score", analogy_score_tensor)

    ####################################################################################################################
    # Misc.
    restore_completed = False
    init = tf.global_variables_initializer()        # variables initializer
    summary_op = tf.summary.merge_all()             # merge summaries into one operation

    ####################################################################################################################
    # Training
    with tf.Session(config=config) as sess:

        # Add TensorBoard components
        writer = tf.summary.FileWriter(log_dir)  # create summary writer
        writer.add_graph(sess.graph)
        gvars = [gvar for gvar in tf.global_variables() if 'analogy_score' not in gvar.name]
        saver = tf.train.Saver(gvars, max_to_keep=5)  # create checkpoint saver
        config = projector.ProjectorConfig()  # create projector config
        embedding = config.embeddings.add()  # add embeddings visualizer
        embedding.tensor_name = W_in.name
        embedding.metadata_path = vocab_metada_file  # link metadata
        projector.visualize_embeddings(writer, config)  # add writer and config to projector

        # Set up variables
        if restore_variables:   # restore variables from disk
            restore_file = tf.train.latest_checkpoint(log_dir)
            assert restore_file is not None, "No restore file found in folder " + log_dir
            assert os.path.exists(restore_file + ".index"), \
                "Trying to restore Tensorflow session from non-existing file: " + restore_file + ".index"
            init.run()
            saver.restore(sess, restore_file)
            print("\tVariables restored from file", ckpt_saver_file, "in TensorFlow ")

        else:  # save the computational graph to file and initialize variables

            graph_saver = tf.train.Saver(allow_empty=True)
            init.run()
            graph_saver.save(sess, ckpt_saver_file_init, global_step=0, write_meta_graph=True)
            tf.add_to_collection(tf.GraphKeys.SAVEABLE_OBJECTS, saveable_iterator)
            print("\tVariables initialized in TensorFlow")

        # Compute the necessary number of steps for this epoch as well as how often to print the avg loss
        num_steps = int(math.ceil(dataset_size / mini_batch_size))
        step_print_loss = int(math.ceil(num_steps / freq_print_loss))
        print('\tPrinting loss every ', step_print_loss, 'steps, i.e.', freq_print_loss, 'times per epoch')

        ################################################################################################################
        # Epoch loop
        epoch = 0
        global_step = 0
        while epoch < int(num_epochs):
            print('\n\tStarting epoch ', epoch)
            sess.run(iterator.initializer)      # initialize iterator

            # If restoring a previous training session, set the right training epoch
            if restore_variables and not restore_completed:
                epoch = int(math.floor(global_train_step.eval() / (dataset_size / mini_batch_size)))
                global_step = global_train_step.eval()
                print('Starting from epoch', epoch)

            ############################################################################################################
            # Loop over steps (mini batches) inside of epoch
            step = 0
            avg_loss = 0
            while True:

                try:

                    # Print average loss every x steps
                    if step_print_loss > 0 and step % int(step_print_loss) == 0:    # update step with logging

                        # If restoring a previous training session, set the right training epoch
                        if restore_variables and not restore_completed:
                            restore_completed = True

                        # Write global step
                        if FLAGS.optimizer != 'momentum':
                            global_train_step.assign(global_step).eval()

                        # Perform an update
                        # print('\tStarting local step {:>6}'.format(step))  # un-comment for debugging
                        [_, loss_val, train_loss_val, global_step] = sess.run(
                            [optimizer, loss, train_loss, global_train_step], options=options,
                            run_metadata=metadata)
                        assert not np.isnan(loss_val), "Loss at step " + str(step) + " is nan"
                        assert not np.isinf(loss_val), "Loss at step " + str(step) + " is inf"
                        avg_loss += loss_val

                        if step > 0:
                            avg_loss /= step_print_loss

                        analogy_score = i2v_eval.evaluate_analogies(W_in.eval(), reverse_dictionary, analogies,
                                                                    analogy_types, analogy_evaluation_file,
                                                                    session=sess, print=i2v_eval.nop)
                        total_analogy_score = sum([a[0] for a in analogy_score])
                        analogy_score_tensor.assign(total_analogy_score).eval()  # for tf.summary

                        [summary, W_in_val] = sess.run([summary_op, W_in])

                        if FLAGS.savebest is not None:
                            filelist = [f for f in os.listdir(FLAGS.savebest)]
                            scorelist = [int(s.split('-')[1]) for s in filelist]
                            if len(scorelist) == 0 or total_analogy_score > sorted(scorelist)[-1]:
                                i2v_utils.safe_pickle(W_in_val, FLAGS.savebest + '/' + 'score-' +
                                                      str(total_analogy_score) + '-w.p')

                        # Display average loss
                        print('{} Avg. loss at epoch {:>6,d}, step {:>12,d} of {:>12,d}, global step {:>15} : {:>12.3f}, analogies: {})'.format(
                            str(datetime.now()), epoch, step, num_steps, global_step, avg_loss, str(analogy_score)))
                        avg_loss = 0

                        # Pickle intermediate embeddings
                        i2v_utils.safe_pickle(W_in_val, embeddings_pickle)

                        # Write to TensorBoard
                        saver.save(sess, ckpt_saver_file, global_step=global_step, write_meta_graph=False)
                        writer.add_summary(summary, global_step=global_step)

                        if FLAGS.profile:
                            fetched_timeline = timeline.Timeline(metadata.step_stats)
                            chrome_trace = fetched_timeline.generate_chrome_trace_format()
                            with open('timeline_step_%d.json' % step, 'w') as f:
                                f.write(chrome_trace)

                        if step > 0 and FLAGS.extreme:
                            sys.exit(22)

                    else:   # ordinary update step
                        [_, loss_val] = sess.run([optimizer, loss])
                        avg_loss += loss_val

                    # Compute and print nearest neighbors every x steps
                    if step_print_neighbors > 0 and step % int(step_print_neighbors) == 0:
                        print_neighbors(op=cosine_similarity, examples=valid_examples, top_k=6,
                                        reverse_dictionary=reverse_dictionary)

                    # Update loop index (steps in epoch)
                    step += 1
                    global_step += 1

                except tf.errors.OutOfRangeError:

                    # We reached the end of the epoch
                    print('\n\t Writing embeddings to file ', embeddings_pickle)
                    i2v_utils.safe_pickle([W_in.eval()], embeddings_pickle)                   # WEIRD!
                    epoch += 1      # update loop index (epochs)
                    break           # from this inner loop

        ################################################################################################################
        # End of training:
        # Print the nearest neighbors at the end of the run
        if step_print_neighbors == -1:
            print_neighbors(op=cosine_similarity, examples=valid_examples, top_k=6,
                            reverse_dictionary=reverse_dictionary)

        # Save state of training and close the TensorBoard summary writer
        save_path = saver.save(sess, ckpt_saver_file_final, global_step)
        writer.add_summary(summary, global_step)
        writer.close()

        return W_in.eval()

@Marvinmw,
In order to expedite the trouble-shooting process, could you please provide a minimal code snippet to reproduce the issue reported here.
Also, is there any specific reason you are using TensorFlow 1.8? Could you please upgrade your TensorFlow version to 2.x or 1.15 and let us know if you're facing the same issue. Thanks!

The provided code example is too long. It would be great if it could be minimized to the lines that produce the bug and nothing more, so that we can run it quickly and debug.
This is indeed a bug and we need to solve it if it happens in 1.15 or 2.x. If it happens on versions before 1.15 then, since those are no longer supported, we can only close the issues and recommend and update.

hi, thanks. i will try Tensorflow 2.0. But to use Tensorflow 2.0,  it is compatible with  Tensorflow 1.8

@Marvinmw,
To run your code with TF 2.x, you'll have to migrate the code from TF 1.x to TF 2.x. Please take a look at this guide which might help you in this case. Thanks!

TF 1.8 is not supported. We cannot dedicate time to fix that and we won't issue a fix anyway.

I tried tensorflow 1.13 and still have the issue.

@Marvinmw,
Please take a look at this issue with a similar error and let us know if it helps. Thanks!

@Marvinmw 1.13 is still out of support. 1.15 is the earliest supported


Packaging .pxd files

Hi, Thanks for writing this library,  It is very useful. I am planning to build a new python extension module and it needs access to some of the extension types used in pykrb5. I want to access the Cython level functions and attributes but currently I see that pykrb5 doesn't ship it's .pxd files. Adding those files will be really helpful as I don't have to re-implement them again. Do you have any plans of shipping .pxd files?
Thanks,
Chamakuri Vineel

The published sdist contains both the .pyx and .pxd files. I don't include them in the wheels because it contains the already compiled code for a particular platform and I typically don't include the source for them in a wheel.
Also keep in mind the interfaces of these classes are not publicly documented so can (and has changed) over a release.

Thanks for the details.


refactor chef-session.service.ts

Note: This needs some ux work before engineering work starts.
Overview

It's not wired into ngrx
it's parsing the JWT id_token which is a bit too much coupling
it uses plain JS intervals for session refresh, nothing ngrx-y either; we've got bugs caused by this, IIRC
it's wired up as a router guard, not sure if that's the ngrx-y thing

this work has been deprioritized, so closing.


ENH: Let stats.binned_statistic take structured/rec arrays as input

Reference issue
I was too lazy to make an issue for this.
What does this implement/fix?
Adding a check so binned_statistic can take a numpy structured or rec array as input.
Additional information
I think most people would probably just convert to a pandas DataFrame and do a groupby, but for my use case I think the overhead of creating dataframes would become an issue.

All feature PRs like this need a unit test.
Unit test added.
What happens if values has zero size with and without this PR?
Looks like binned_statistic fails either way with a zero size values array.
Does this work if statistic is a string?
Fails if values is a structured array and statistic is a string, which is good because it's ambiguous what the mean should be for an array with multiple columns. Could add an explicit ValueError if that seems helpful.

Could add an explicit ValueError if that seems helpful.

It would be. And adding a test that the error is emitted as intended with pytest.raises(ValueError, match=message) context..
That said, I'd hold up on adding that. I'll talk with other statistics maintainers about this shortly, but I'm not sure adding support for structured arrays is a direction we want to start going down. We recently removed support for object arrays from stats.mode, for instance, and the main thrust right now is support for the Python array API, which does not have a specification for structured arrays.
What other SciPy functions "should" have support for structured arrays, in your opinion, and for those, is there not another option to do the same sort of tasks (e.g. pandas)?

Hi @yoachim,
I agree with Matt on not moving forward with this proposal. We are adding support for Array API so these input arrays should follow the standard. If down the line the standard would allow something like rec array, then by all mean.

What other SciPy functions "should" have support for structured arrays, in your opinion, and for those, is there not another option to do the same sort of tasks (e.g. pandas)?

I'm going to close this PR, but feel free to continue discussing this point here!


Giving error on Electra model when used for code2nl task

I was using the script provided for fine-tuning the codeBert for an Electra Model instead of Roberta, and I am getting this error
File "run.py", line 513, in <module>
    main()
  File "run.py", line 320, in main
    loss,_,_ = model(source_ids=source_ids,source_mask=source_mask,target_ids=target_ids,target_mask=target_mask)
  File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py", line 889, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/content/model.py", line 57, in forward
    out = self.decoder(tgt_embeddings,encoder_output,tgt_mask=attn_mask,memory_key_padding_mask=(1-source_mask).bool())
  File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py", line 889, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/transformer.py", line 234, in forward
    memory_key_padding_mask=memory_key_padding_mask)
  File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py", line 889, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/transformer.py", line 364, in forward
    key_padding_mask=tgt_key_padding_mask)[0]
  File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py", line 889, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/activation.py", line 987, in forward
    attn_mask=attn_mask)
  File "/usr/local/lib/python3.7/dist-packages/torch/nn/functional.py", line 4625, in multi_head_attention_forward
    assert embed_dim == embed_dim_to_check
AssertionError

Since the codeBERT is based on the architecture of Roberta, you have to use Roberta.


Is there a way to run the tests based on the context from commandline

My tests are currently scattered in different contexts as shown in sample project. In case if i want to run only one context at a time , is it possible to execute.
Do I have to wrap them in NUnit , MsTest frameworks. if so is there any example for it.
Thanks,

https://github.com/lefthandedgoat/canopyStarterKit
The starter kit has examples of the code taking arguments, and only run certain tests based on the arguments.


🌐 Add Korean translation for docs/ko/docs/tutorial/background-tasks.md

Add Korean translation for docs/ko/docs/tutorial/background-tasks.md
Related https://github.com/tiangolo/fastapi/issues/2017

📝 Docs preview for commit e3284b4de1c44223c3518e3d001a94ac69e27fef at: https://649a1e92acd72b160761e973--fastapi.netlify.app

Thank you! @junah201 🚀
And thanks for the reviews @joonas-yoon and @Junhyung21 🧐🔍


review: sample_geometric_exp_slow

Towards #2069

#2118  👈
main

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @Shoeboxam and the rest of your teammates on  Graphite

@Shoeboxam attached is my proof review.
sample_geometric_exp_slow.pdf

@michaelghay

Those commit hashes ostensibly achieve what we are setting out to do, but are incredibly prone to change. Updated.
I notice a comment on the # in the code. This is where a latex \label is, linked to from the proof. I could do more to hide the hash, but it's also kind of nice knowing there's a label there.
The link is right, but the Rust documentation failed to build after OpenDP 0.12's release yesterday. It will fix itself once #2212 is merged and 0.12.1 is released.
The correct output distribution is $(1 - \exp(-x)) \exp(-x)^{k}$, and indeed negating the bools gives us this distribution. Good catch!

I fixed the above, added distribution definitions, and cleaned up some of the formatting and structure in the "respond to review commit".
Thanks for taking the time to look at this!


Unstabilize visualize

Description of changes:
Unstabilizes the --visualize feature due to incorrect coverage results (see #2048). It uses a custom message to inform users about these issues, which is shown as:

This PR also removes the --visualize item from our "Common command line flags" section. The rest of our documentation still mentions --visualize (without --enable-unstable), and we should consider using it less in the tutorial but it's not clear to me what's the best action to take in there.
Resolved issues:
Related #2048
Call-outs:
The plan is to convert --visualize into a standard unstable feature after the next release. Another option here is to print the message but continue the analysis (as a kind of warning).

Testing:

How is this change tested? Existing tests.

Is this a refactor change? No.

Checklist

[x] Each commit message has a non-empty body, explaining why the change was made
[x] Methods or procedures are documented
[x] Regression or unit tests are included, or existing tests cover the modified code
[x] My PR is restricted to a single feature or bugfix

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.

we should update our documentation too, we have an entire section dedicated to using --visualize.

What do you think of the idea of just disabling the coverage report for --visualize?


Update Splunk URL

input- is not needed in the URL, if used it fails to connect. There must also be a port specified which is not visible in the URL used to access Splunk. The default is 8088

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

Hi @chcomley - Could you review the proposed update? Also, should the metadata author value be changed to your GitHub account name? It's currently set to the Microsoft alias roferg. Thanks.

@chcomley for review
Thanks.

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

#sign-off


Feature Timeline is not shown on Backlog/Board

Describe the bug
Azure DevOps Server 2020 on-prem. After extension installation there is no tab labeled "Feature Timeline" or "Epic Roadmap" on Boards or Backlogs page.
The extension shows no error during installation.
Thanks for any help.
Kind regagrds,
Zdeněk Neustupa
Browser
[ X] Edge
Version
[X] Azure DevOps Server 2020
Screenshots
Screenshots attached.

i have same problem...

Sorry, but this code in this repo is not currently being maintained. We recommend you use the Delivery Plans feature that is core to Azure DevOps.


User picker custom field not being exported

I have tried every option in the config file to get this working but this field is being ignored on the export.  I have tried using the name and "source-type": "name".  I've tried with and without the mapper.  This is the only custom field in the config that is not being exported at all.
  {
    "source": "customfield_10100",
    "target": "Custom.Tester",
    "mapper": "MapUser",
    "for": "User Story,Defect"
  }

@calvinmichel  just to clarify is your custom field a single user or multiuser picker?
I would suggest using the source-type: "name". Tested this and had no problem exporting custom user picker, using this mapping:  {         "source": "SingleUserPicker",         "source-type": "name",         "target": "Custom.TestField",         "for": "Product Backlog Item",         "mapper": "MapUser"       }

Closing this issue in lack of further response. @calvinmichel  feel free to reopen if you still experience problems

@madkoo Sorry again that I did not respond.  I am not receiving notifications from GitHub when comments are added.  I have updated the config file as suggested
{
"source": "Tester",
"source-type": "name",
"target": "Custom.Tester",
"for": "User Story,Defect",
"mapper": "MapUser"
}
I ran the export and for a JIRA issue that has a value in the Tester field, the json does not have that field.  Other custom fields are mapped and Assigned To is mapped as well.  Please let me know if you need any additional information to help in resolving this.


Bug: element class with razor content and onclick gives compile error in generated class

Add this code to the end of the Index.cshtml of a new Blazor client project.
<button
        @onclick(()=>dosomething())
        class="@name">Button</button>
<div>@Message</div>

@functions
{
    string name = "btn btn-primary";
    string Message = "";
    void dosomething()
    {
        Message = "Clicked";
    }
}

This will fail to build with the following error
Error CS1503	Argument 2: cannot convert from 'string' to 'Microsoft.AspNetCore.Blazor.RenderTree.RenderTreeFrame'

The generated code in the intermediate file looks like this:
            builder.OpenElement(7, "button");
            builder.AddAttribute(8, "class", "");
            builder.AddAttribute(9, onclick(()=>dosomething()));
            builder.AddAttribute(10, name);
            builder.AddContent(11, "Button");
            builder.CloseElement();

You can see that it's put in a class attribute (8) with an empty string, then item 10 tries to put the name property in as an attribute, which is where the compile error is coming from.
However, if the order of the attributes is reversed, with the class coming before the onclick, it compiles fine.

think this is a duplicate of #386

Looks like it. I did search but don't think that one came up.

Thanks for reporting this. I do expect this issue no longer applies due to the new bind handling, but please let us know if you can still repro it after 0.2.0 is released this week.


Support Elasticsearch 7.x

You can manually create the index and import the index template but I don't think that is great for most people who aren't experienced with Elastic. I was trying to find the files that talk specifically about elastic to modify the index information. Can you point me to those so I can test a few things and build out the index/index template that will match with the Elastic 7.x data structures?

These are the files related the ES support:

ElasticSearchRestTargetRepository.java (logic for dealing with indexes is here)
ElasticSearchClientFactory.java

Currently, it checks if the index exists, and creates one if no index is found.

I believe the main thing that breaks compatibility support ES 7+ is the removal of document types, but I haven't had the time to try to fix it yet: https://www.elastic.co/guide/en/elasticsearch/reference/current/removal-of-types.html
Maybe creating a new "repository" class to support ES 7+ would be the easiest. Anyway, please let us know if you manage to make it work. A PR for this would be very welcome.

I will absolutely let you know. With the document types being removed, it actually makes it much simpler to create index templates.

The easiest way to overcome this would be to configure the elastic instance for dynamic mapping. Then you are scalable unless they get rid of that functionality with I highly doubt.

I believe the main thing that breaks compatibility support ES 7+ is the removal of document types, but I haven't had the time to try to fix it yet: https://www.elastic.co/guide/en/elasticsearch/reference/current/removal-of-types.html Maybe creating a new "repository" class to support ES 7+ would be the easiest. Anyway, please let us know if you manage to make it work. A PR for this would be very welcome.

Hello, My Boss in office also try to correct this problem too. I already test with Elasticsearch 7.16.2 and  It work. So I hope this can help, Thank you.

Great, thanks. Did you have the chance to test if the web search interface works as well?

Below this is the file which my boss edit for support ElasticSearch 7.x.
ElasticSearchRestTargetRepository.zip

I have made a pull request #282 and implemented some of the suggestions from @chanwitkepha. The indexing works great but the web search interface will not work without further changes.

Just merged it. Thanks, @JuliusHenke and @chanwitkepha!

PR #341 adds support to the search interface and concludes this issue.


Automatically set build version string.

@liamsi is this is generally-accepted way of generating build version strings for executables?

Yup, looks familiar. See e.g., https://github.com/cosmos/gaia/blob/cf7efca8facb1e6d622c5ed27d1e15a1737b28e0/Makefile#L4
https://github.com/cosmos/gaia/blob/cf7efca8facb1e6d622c5ed27d1e15a1737b28e0/Makefile#L55


no-this-assignment works weird (destructuring)

Bug Report

TSLint version:     "tslint": "^5.18.0",
TypeScript version:     "typescript": "3.5.3"
Running TSLint via: Rider/WebStorm

Reproduction using TSLint Playground

TypeScript code being linted
class A {
    private a: number;
    private b: number;

    constructor() {
        const { b } = (this); // no error
        const { a } = this;   // error
    }
}

with tslint.json configuration:
// You can modify the configuration here with your own.
// Make sure that your json is valid, and if you run into
// other issues, try checking the console for errors.

{
    "extends": ["tslint:recommended"],
    "rules": {
        "no-this-assignment": true
    } // add additional rules and their configuration
}

Actual behavior
error in 1 case
Expected behavior
no errors (destructuring instead of assignment)

I wonder why so obvious bugs still were not found and fixed

I wonder why so obvious bugs were yet not found and fixed

FWIW, this is not a great tone for engaging in open source projects.
Also, you may want to check the rule documentation: https://palantir.github.io/tslint/rules/no-this-assignment/. In this case there is a rule option which should allow destructuring assignment.


tailscale: 1.42.0 -> 1.44.0

Remove rec expression, while here

Description of changes
https://github.com/tailscale/tailscale/releases/tag/v1.44.0
Things done

Built on platform(s)

[ ] x86_64-linux
[ ] aarch64-linux
[ ] x86_64-darwin
[x] aarch64-darwin

[ ] For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
[ ] Tested, as applicable:

NixOS test(s) (look inside nixos/tests)
and/or package tests
or, for functions and "core" functionality, tests in lib/tests or pkgs/test
made sure NixOS tests are linked to the relevant packages

[ ] Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
[x] Tested basic functionality of all binary files (usually in ./result/bin/)
23.11 Release Notes (or backporting 23.05 Release notes)

[ ] (Package updates) Added a release notes entry if the change is major or breaking
[ ] (Module updates) Added a release notes entry if the change is significant
[ ] (Module addition) Added a release notes entry if adding a new NixOS module

[ ] Fits CONTRIBUTING.md.

Result of nixpkgs-review pr 239176 run on x86_64-linux 1

2 packages built:

tailscale
trayscale

Whether it's better to use let than rec is controversial, but anyway.

@NickCao w.r.t. rec.

That thread just demonstrates how controversial the topic is


Mac version

Hi,
is there any hope to have it on mac?

You can try compiling it on .Net Core using RoslynPad.NetCore project, it uses Avalonia for UI, it should work but it's under development and a lot of features are still missing.

See instructions in README.md. It's currently very alpha, but I'm working on a more feature-complete version.


Make sure imagemagick < 7.0.9

Checklist

[x] Used a fork of the feedstock to propose changes
[x] Bumped the build number (if the version is unchanged)
[x] Reset the build number to 0 (if the version changed)
[x] Re-rendered with the latest conda-smithy (Use the phrase @conda-forge-admin, please rerender in a comment in this PR for automated rerendering)
[x] Ensured the license file is being packaged.

Hi! This is the friendly automated conda-forge-linting service.
I wanted to let you know that I linted all conda-recipes in your PR (recipe) and found some lint.
Here's what I've got...
For recipe:

requirements: host: imagemagick < 7.0.9 should not contain a space between relational operator and the version, i.e. imagemagick <7.0.9
requirements: run: imagemagick < 7.0.9 should not contain a space between relational operator and the version, i.e. imagemagick <7.0.9

Hi! This is the friendly automated conda-forge-linting service.
I just wanted to let you know that I linted all conda-recipes in your PR (recipe) and found it was in an excellent condition.

@conda-forge-admin, please rerender

@jcupitt
We are facing the same issues here as in #4

Linux builds fail with the same error
OSX builds fail with the make check (testing blankpage.svg svgload ... save / load difference is 80.000000)

While conda-forge/core takes a look at the Linux issue, could you please upload an equivalent 8.8.1a release, please?
Again, the blankpage.svg svgload failed test should be related to a package update, right? Otherwise, it wouldn't have passed the tests when we released 8.8.1...

@sebastian-luna-valero OK, I uploaded vips-8.8.1a.tar.gz
Yes, the test failing is because librsvg changed the way they round float pixel coordinates to int.

Thanks @jcupitt
Do you know by any chance which version librsvg works with the default tests?
Since we are making a new release, I could pin both imagemagick and librsvg for 8.8.1 on this PR.
Or the other way around, do you need to change your tests in libvips to work with the latest librsvg?

Yes, 8.9 will have a reworked SVG test that's less sensitive to small offsets like this. For now, it's just disabled.

While we find out what's the issue with gstreamer-orc, we'll pin it for this release of libvips.


Update the shuffle1_dyn API

Currently, shuffle1_dyn is a safe function, but if the index is out-of-bounds its behavior is undefined: it will panic! in some archs, and return an unspecified lane value in others - this is a bug (allowing safe Rust to have UB).

[ ] We should add an unsafe shuffle1_dyn_unchecked API that has undefined behavior if the index is out-of-bounds and not 0x80.

[ ] We should change shuffle1_dyn to panic! if any index is out-of-bounds and not 0x80 (that is, shuffle1_dyn checks the indices and calls shuffle1_dyn_unchecked).

[ ] Both APIs should set the resulting lane to 0 if the index is 0x80 - we can provide a: const SHUFFLE1_DYN_ZERO: usize = 0x80; constant for this.

See https://github.com/WebAssembly/simd/issues/68 , https://github.com/WebAssembly/simd/issues/24, https://github.com/WebAssembly/simd/pull/71
where @zeux mentioned:

x86_64: If bit 7 is 1, set to 0, otherwise use lower 4 bits for lookup
ARM: if index is out of range (0-15), set to 0
PPC64: use lower 4 bits for lookup (no out of range handling)
MIPS: if bit 6 or bit 7 is 1, set to 0; otherwise use lower 4 bits for lookup (or rather use lower 5 bits for lookup into a table that has 32 elements constructed from 2 input vectors, but if both vectors are the same then it effectively means bits 4,5 are ignored)
RISCV: if index is out of range (0-15), set to 0.
[...] if the specification says that all out-of-range indices return 0, then ARM and RISCV will use the native instruction, x86_64/PPC64/MIPS will have to generate additional checks using a 3-instruction sequence like "compare with 15; shuffle; andnot".
we could say that if index is 0x80 we return 0, if index is 0-15 we return the index result, otherwise the resulting byte is unspecified. This seems like the cleanest way to unify x86_64 behavior with the rest, resulting in zero-cost implementation for x86_64, ARM, MIPS, RISCV, and a 3-instruction sequence (compare to 0x80, shuffle, andnot) on PPC64.

We should add an unsafe shuffle1_dyn_unchecked API that has undefined behavior if the index is out-of-bounds and not 0x80.

We should change shuffle1_dyn to panic! if any index is out-of-bounds and not 0x80 (that is, shuffle1_dyn checks the indices and calls shuffle1_dyn_unchecked).

Both APIs should set the resulting lane to 0 if the index is 0x80 - we can provide a: const SHUFFLE1_DYN_ZERO: usize = 0x80; constant for this.Both APIs should set the resulting lane to 0 if the index is 0x80 - we can provide a: const SHUFFLE1_DYN_ZERO: usize = 0x80; constant for this.

I'd prefer the following, which is equally as consistent across architectures, and is defined in more cases: instead of the "return-zero" case being ==0x80, instead make it >=0x80. On all of x86_64, ARM, MIPS, RISCV it has a zero-cost implementation. On PPC64 I'd guess (although I don't know that ISA) it still has a 3-instruction sequence (compare to 0x80, shuffle, andnot), but this time the comparison is >= instead of ==.
With >=0x80 the implementation is defined in more cases, which is more useful for users (admittedly it constrains future hardware implementors). An especially useful case is that we'd like an index of 0xFF to return zero; this comes up naturally when ORing with m8 mask objects.


Build resctl-demo when an upstream version is released rather than on a schedule

Currently we build resctl-demo every-week on a Monday early-morning (or a manual build can be initiated by pressing Actions > Build resctl-demo > Run workflow).
Rebuilding things which haven't changed is a waste of CI resources and there is a cadence if a new version of resctl-demo has been released.
We should probably change this to check for changes to upstream and only re-build when needed.

There is difficulty in implementing this without infecting resctl-demo CI.
Github actions doesn't have facility to watch for changes in external repository and then trigger workflow.
The only way this is done is  by sending repository_dispatch event from upstream repo to listening repo.
i.e resctl-demo repo CI job will send repository_dispatch event and iocost-benchmark-ci will listen for this event and trigger workflow when this event is sent by upstream resctl-demo.
see discussion here: https://github.com/orgs/community/discussions/26323
So we would need to add code in resctl-demo workflow to emit repository_dispatch event when new release is made.
I ain't sure if this is acceptable here
@saravan2 @htejun

Could the checking of a new tag be done in a nightly job ?

PR is merged so we can close this issue:
https://github.com/iocost-benchmark/iocost-benchmarks-ci/pull/17


add function to let the user to choose network interface to be used

This is also useful if the user can do without google.ca.

Thank you!  I created a branch with your changes and changes from me, let me know what you think. What I wanted to do all along was listen on any interface... I realize now that it's the <IP_ADDRESS> address.

Also I don't think you need to specify both the address and the port, right? I can change the function to take only an Ipv4Addr and not a full SocketAddrV4.

I liked your changes It'd be fine for me.

I wrote the changes and published it on crates.io.


Integrate with Codecov

Codecov Report

:exclamation: No coverage uploaded for pull request base (main@a4f0d34). Click here to learn what that means.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main      #11   +/-   ##
=======================================
  Coverage        ?   36.66%
=======================================
  Files           ?       12
  Lines           ?     2433
  Branches        ?        0
=======================================
  Hits            ?      892
  Misses          ?     1496
  Partials        ?       45

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 a4f0d34...f140ded. Read the comment docs.


Specify type for all constants, not just the first

Closes #22

Please sign your commits following these rules:
https://github.com/docker/docker/blob/master/CONTRIBUTING.md#sign-your-work
The easiest way to do this is to amend the last commit:
$ git clone -b "qtype" git@github.com:dominikh/go-p9p.git somewhere
$ cd somewhere
$ git commit --amend -s --no-edit
$ git push -f

Ammending updates the existing PR. You DO NOT need to open a new one.

Current coverage is 15.91% (diff: 100%)

Merging #23 into master will not change coverage

@@             master        #23   diff @@
==========================================
  Files            13         13
  Lines          1131       1131
  Methods           0          0
  Messages          0          0
  Branches          0          0
==========================================
  Hits            180        180
  Misses          903        903
  Partials         48         48

Powered by Codecov. Last update 87c6cf4...f970a77

ping @stevvooe PTAL

@thaJeztah @dominikh See https://github.com/docker/go-p9p/issues/22#issuecomment-239538912.
Otherwise, this looks okay.


NixOS module system: improve one of error messages

Motivation for this change
Partially helps with https://github.com/NixOS/nixpkgs/issues/15747
The error can be reproduced like:
    $ nix-instantiate ./nixos -A system --arg configuration '
      { fileSystems."/".device = "nodev";
        boot.loader.grub.devices = [ "nodev" ];
        containers.t.config.imports = [ <nixpkgs/nixos/modules/virtualisation/amazon-image.nix> ];
      }'

Previously error was:
    error: The unique option `containers.t.networking.hostName' is defined multiple times, in `/nix/var/nix/profiles/per-user/root/channels/nixpkgs/nixos/modules/virtualisation/amazon-image.nix' and `<unknown-file>'.
    (use ‘--show-trace’ to show detailed location information)

Now it is:
    error: The unique option `containers.t.networking.hostName' is defined multiple times, in:
     - /nix/var/nix/profiles/per-user/root/channels/nixpkgs/nixos/modules/virtualisation/amazon-image.nix
     - module at /home/danbst/dev/nixpkgs/nixos/modules/virtualisation/containers.nix:470.
    (use '--show-trace' to show detailed location information)

What do you think? Is it clearer now?

that's cool ! I have many similar issues where it can't pinpoint the issue.  I just need to add _file = "module at ${__curPos.file}:${toString __curPos.line}"; good to know.


Support az style runtime and fix prompt

Support az style runtime and fix prompt

Codecov Report

Merging #1061 into develop will decrease coverage by 0.01%.
The diff coverage is 0.00%.

@@              Coverage Diff              @@
##             develop    #1061      +/-   ##
=============================================
- Coverage      36.27%   36.25%   -0.02%
  Complexity       537      537
=============================================
  Files            103      103
  Lines           4430     4432       +2
  Branches         683      684       +1
=============================================
  Hits            1607     1607
- Misses          2684     2686       +2
  Partials         139      139

Impacted Files
Coverage Δ
Complexity Δ

...re/maven/spring/spring/SpringDeploymentClient.java
0.00% <0.00%> (ø)
0.00 <0.00> (ø)

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 326492d...f559775. Read the comment docs.


npm dependency on gulp should be a devDependency

Hi @MeirionHughes ,
I've just gone through the process of upgrading to gulp4 and saw the usual gulp3 warnings:
npm WARN deprecated<EMAIL_ADDRESS>graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to<EMAIL_ADDRESS>as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.

I ran the specified command to find gulp-aurelia-template-lint holds the dependency to gulp3, however from what I can tell from your code it should only be a dev dependency not a run time dependency, right?

Ah, just noticed that gulp-utils is a direct dependency because of gutils.log which can be replaced with fancy-log as per this official blog post.

Closing, seems dead, cleaning up my old issues


[ci skip] adding user @amkrajewski

Hi! This is the friendly automated conda-forge-webservice.
I've added user @amkrajewski as instructed in #7.
Merge this PR to add the user. Please do not rerender this PR or change it in any way. It has [ci skip] in the commit message to avoid pushing a new build and so the build configuration in the feedstock should not be changed.
Please contact conda-forge/core to have this PR merged, if the maintainer is unresponsive.
Fixes #7

To add some context: I do not know @amkrajewski, and I don't endorse or oppose their maintainership here. However, they did apply to join this feedstock team (through the GH UI, rather than our automation), so I'm only trying to guide this application into the right patterns.
As a general comment: I welcome the initiative, and any help is generally welcome! That said, I leave the choice here to the feedstock-maintainers (unless concrete work piles up undone and the feedstock maintainers are not responsive).


fix(merge_index): scheme was not well formatted

Hey 👋 ,
I was trying to use merge_index with a remote folder following this structure :
s3://my_bucket
└───mds_1
│   │   index.json
└───mds_2
    │   index.json

I was calling it like this: merge_index("s3://my_bucket"), but it kept failing. After some digging, I realized that it was attempting to download s3//my_bucket/mds_1/index.json (missing the ":").
The fix involves simply adding a colon ':' here - it might not be obvious, as I had to move some code to add a test.
Thanks!
General

[x] I have read the contributor guidelines
[ ] This is a documentation change or typo fix. If so, skip the rest of this checklist.
[x] I certify that the changes I am introducing will be backward compatible, and I have discussed concerns about this, if any, with the MosaicML team.
[x] I have updated any necessary documentation, including README and API docs (if appropriate).

Tests

[x] I ran pre-commit on my change. (check out the pre-commit section of prerequisites)
[x] I have added tests that prove my fix is effective or that my feature works (if appropriate).
[x] I ran the tests locally to make sure it pass. (check out testing)
[x] I have added unit and/or integration tests as appropriate to ensure backward compatibility of the changes.

@fwertel  Thanks for capturing the bug! The unit tests did not cover that part.
There is a failure here, can you fix it?
def _format_remote_index_files(remote: str, files: list[str]) -> list[str]:

TypeError: 'type' object is not subscriptable

@fwertel yes, that pyright error is annoying. I got the same error.  @karan6181 You have an idea why it is?

@fwertel we found changing List[Union[str, Tuple[str, str]]] to Sequence[Union[str, Tuple[str, str]]] in  _merge_index_from_list can fix the pyright problem.....

@XiaohanZhangCMU pyright is happy now :)

Hey @fwertel, looks like linting is failing on your PR. I would recommend running pre-commit run -a locally as mentioned in the contribution guide. This will fix the linting issue.

Hey @karan6181 I did run it, as mention to @XiaohanZhangCMU on slack it broke pretty much the whole codebase by replacing double quotes by single quote. e.g:
diff --git a/streaming/base/format/mds/reader.py b/streaming/base/format/mds/reader.py
index 1c9b0f8..ef618f5 100644
--- a/streaming/base/format/mds/reader.py
+++ b/streaming/base/format/mds/reader.py
@@ -70,11 +70,11 @@ class MDSReader(JointReader):
         """
         args = deepcopy(obj)
         if args['version'] != 2:
-            raise ValueError(f'Unsupported streaming data version: {args["version"]}. ' +
+            raise ValueError(f'Unsupported streaming data version: {args['version']}. ' +
                              f'Expected version 2.')
         del args['version']
         if args['format'] != 'mds':
-            raise ValueError(f'Unsupported data format: {args["format"]}. ' +
+            raise ValueError(f'Unsupported data format: {args['format']}. ' +
                              f'Expected to be `mds`.')
         del args['format']

fix double quoted strings................................................Failed
- hook id: double-quote-string-fixer
- exit code: 1
- files were modified by this hook

Fixing strings in scripts/partition/diff.py
Fixing strings in simulation/interfaces/sim_script.py
Fixing strings in streaming/base/local.py
Fixing strings in streaming/base/util.py
Fixing strings in scripts/shuffle/bench.py
Fixing strings in streaming/base/format/mds/reader.py
Fixing strings in scripts/partition/bench.py
Fixing strings in streaming/base/format/xsv/reader.py
Fixing strings in streaming/base/format/json/reader.py
Fixing strings in docs/source/conf.py
Fixing strings in simulation/interfaces/sim_cli.py
Fixing strings in streaming/base/stream.py

Glad you got all lints resolved.

@fwertel Can you please rebase your branch over mosaicml:main?


build(icons): add ability to generate specific icons

Description:
Add ability to generate a specific SVG icon instead of re-generating all of them

Motivation and Context:
Currently genereate-icons re-generates all icons every time, which is redundant since icons are added one by one to the project

How Has This Been Tested?
Manually
yarn generate-icon icon.svg

Screenshots (if appropriate):
Types of changes:
Devops change

Checklist:

[x] My code follows the code style of this project.
[x] I have reviewed and updated the documentation accordingly.
[x] I have read the CONTRIBUTING document.
[ ] I have added tests to cover my changes where needed.
[ ] All new and existing tests passed.
[x] My commits have been squashed into a concise set of changes.

Coverage remained the same at 20.509% when pulling b25f589e22e1d1d4481f0d0f951f4124f589f650 on korhaliv:build/gen-icons into 195e03d22e5eabbfa7e0cee831a504686d9a85d4 on LN-Zap:next.

@mrfelton updated


🗨 feat: Prompts

Summary
I implemented the initial features for the Prompt Library, enhancing prompt management capabilities as proposed in issue #3023. This includes functionalities for creating, using, and sharing prompts, as well as admin-specific controls and categorization.

Implemented ability to create and use prompts easily.
Added support for prompts to have "fill-in" variables.
Created special variables for current date and current user.
Enabled users to share prompts globally.
Provided quick and easy access to prompts from the side panel.
Added filtering functionality for prompts.
Implemented advanced and optional versioning of prompts.
Enabled categorization and labeling of prompts.
Allowed admins to share prompts globally.
Enabled admins to restrict user prompt creation.
Allowed admins to add categories for prompts.

Testing
To ensure the implemented features are working correctly:

Create a prompt and verify its usability within a chat.
Use fill-in variables within a prompt and confirm correct substitution.
Share a prompt globally and check its visibility to other users.
Access prompts from the side panel and verify quick access functionality.
Filter prompts and confirm accurate results.
Test versioning by creating multiple versions of a prompt.
Categorize prompts and check if they are listed under the correct labels.
Admins should try sharing and restricting user prompts and adding categories.

Test Configuration:

Test different user roles (admin, regular user).
Ensure prompts work across various chat endpoints.
Verify prompt management functionalities in different browsers.

Checklist

[x] My code adheres to this project's style guidelines
[x] I have performed a self-review of my own code
[x] I have commented in any complex areas of my code
[x] I have made pertinent documentation changes
[x] My changes do not introduce new warnings
[x] I have written tests demonstrating that my changes are effective or that my feature works
[x] Local unit tests pass with my changes

Also closes  #3128

Holy hell, Danny, you're on fire.

Holy hell, Danny, you're on fire.

Thanks! About to merge this.

Quick Question: Is it already possible to share a prompt?

Quick Question: Is it already possible to share a prompt?

Yes, try it

you can do it when editing prompts:

Admin (the first created user) needs to enable the option

Thank you, this trick did it.


Manually widen a type for conditional/mapped type

Search Terms
manual widen
Suggestion
I would like some keyword or other mechanism to refer to the widened version of a type, e.g. widened 42 would be number and widened 'foo' would be string. Importantly, widened 42 & { foo: 'bar' } would be number & { foo: 'bar' }.
Use Cases
Our project uses a ton of branded primitives, which are accomplished by casting a number or string to number & Branding or string & Branding. We use this for all sorts of things: we have number & Pixels to indicate that a number is in pixels (and to force numbers passed to a function expecting pixels to use a number branded as pixels), we use string & Url to indicate a string is a URL, and so on.
We also have functions that operate on these types in a generic fashion, where we want to retain the branding. For example,
declare function plus<N extends number>(a: N, b: N): N;

This plus function is supposed to make sure we are adding pixels to pixels (or whatever unit), and retain the fact that their sum is also a number of pixels.
The problem comes in when we also have const offset = 5 as 5 & Pixels;. We define it as having that literal value for convenience (mostly, it shows up in Intellisense), and we have quite a few of these. More relevantly, the implementations of times and dividedBy (which I’m avoiding putting here as they are vastly more complex to cover canceling out units) can and should be able to take just plain numbers, but when I call times(offset, 2) it is inferred as times<Pixels, 2> and the return value retains the 2 even though obviously the runtime value is almost-certainly not going to be 2.
I asked for a solution to this on Stack Overflow, and was informed the only solution was to manually recreate the type by covering all of the potential brandings—which I basically have done, except that in the end there needs to be a generic overload, because we have a lot of situations where these functions are called by functions/classes that are also generic, and so only have N extends number, so the only overload available is the final one—which just retains whatever N was, even if N was a literal. I want to use widen N instead.
Examples
const c = 5 as const;
const w: widened typeof c = 3;

function plus<N extends number>(a: N, b: N): widened N {
    return a + b;
}
class Pixels { private '__ in': 'pixel'; }
const offset = 5 as 5 & Pixels;
declare const width: Pixels;

const offsetWidth = plus(width, offset); // Pixels, not 5 & Pixels

Checklist
My suggestion meets these guidelines:

[x] This wouldn't be a breaking change in existing TypeScript/JavaScript code
[x] This wouldn't change the runtime behavior of existing JavaScript code
[x] This could be implemented without emitting different JS based on the types of the expressions
[x] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
[x] This feature would agree with the rest of TypeScript's Design Goals.

type Widen<T> = T extends number ? number : T extends string ? string : never;
const w: Widen<typeof c> = c;


Run Gulp 4 tasks programmatically from other files

Hi, I'd like to know if this is currently supported (or there's a workaround to it)...
What I'm trying to achieve is basically calling gulp tasks defined in other files without using the cli.
For instance, define a generic gulp task in a file:
const gulp = require('gulp');
const cleanCSS = require('gulp-clean-css');

gulp.task('css:run', (paths) => {
    const dist = '../output';
    return gulp.src(paths, { sourcemaps: true })
        .pipe(cleanCSS())
        .pipe(gulp.dest(dist));
});

And call it from another function:
const gulp = require('gulp');
/* require dependencie(s) */

function runTasksOnDemand() {
    /* run required/ imported task */
}

runTasksOnDemand();

PS.: I've looked into some SO questions, but the (scarce) answers for Gulp v4 were not enough to put me in any directions (at least in the way I needed).

You really don't want to do this.  The power of having "tasks" and running them is all in the CLI.  You'll likely be able to find a much better way to achieve your goals than trying to run gulp tasks programatically.

@phated Actually, I do want to achieve this because I'm trying to wrap around gulp and gulp extensions.
Because of that, I can't depend on the cli to call the tasks.
Are there any real limitations that makes this impossible to achieve?

There's no reason to wrap around gulp.  You likely want custom registries (documentation coming in the future).

There's no reason to wrap around gulp

@phated How do you know I don't have a good reason for that!? :)

You likely want custom registries (documentation coming in the future).

Is there any tests/ issues where I can learn a little bit more about this API?

How do you know I don't have a good reason for that!? :)
Because this has been my life for 3 years and I've explored everything.  The things people want are either handled by custom registries or a custom CLI.

Is there any tests/ issues where I can learn a little bit more about this API?
Have you used the search feature of github? It's been discussed before.
However, you can find the information we have at https://github.com/gulpjs/undertaker#custom-registries

Because this has been my life for 3 years and I've explored everything. The things people want are either handled by custom registries or a custom CLI.

Still, neither of those options are what I need - Maybe you haven't explored everything then ;)
Seriously though, thanks for trying to help.

Have you used the search feature of github? It's been discussed before.
However, you can find the information we have at https://github.com/gulpjs/undertaker#custom-registries

Yes, I have, but Github's search sometimes mixes a lot of undesired information about the repository.
Besides that, I don't find Github Issues a very reliable source of information about the current state of any project. Most of the times one will have to read through all of the history to just find simple information. Anyways, I'll read a little more about custom registries in the link you provided, thanks.

@thiagomajesk sounds good.  I'm going to lock this because we don't provide support on this forum. If you have further support needs, you can email us for paid support.


feat: ability to mimic /v1/models/ api

Simulate the OpenAI /v1/models API, send requests to all deployments endpoints asynchronously, and aggregate the responses.

Can you fix this error?

Can you fix this error?

already fixed

It seems there are still errors.

It seems there are still errors.

minor linter error, fixing...

Thank you for your contribution; your feature will be released in version 1.3.8.