Issue with logits_processor logic in token generation process

System Info
CPU: X86_64
GPU: L4
RAM: 48GB
OS: Debian 11
Python: 3.10
TensorRT-LLM version: 0.9.0.dev2024022700
TensorRT: 9.2.0.post12.dev5
CUDA Version: 12.2
NVIDIA Driver Version: 535.86.10
Who can help?
@byshiue
Information

[ ] The official example scripts
[X] My own modified scripts

Tasks

[X] An officially supported task in the examples folder (such as GLUE/SQuAD, ...)
[ ] My own task or dataset (give details below)

Reproduction
Running the multi-modal example (run.py) for LlaVA but editing the generate call to pass a logits_processor produces weird behaviour where the same token is generated over and over again. Specifically, what I did was editing (source in run.py):
output_ids = self.model.generate(
                input_ids,
                sampling_config=None,
                prompt_table_path='prompt_table.npy',
                max_new_tokens=max_new_tokens,
                end_id=end_id,
                pad_id=self.tokenizer.pad_token_id,
                top_k=self.args.top_k,
                num_beams=self.args.num_beams,
                output_sequence_lengths=False,
                return_dict=False)

to be
output_ids = self.model.generate(
                input_ids,
                sampling_config=None,
                prompt_table_path='prompt_table.npy',
                max_new_tokens=max_new_tokens,
                end_id=end_id,
                pad_id=self.tokenizer.pad_token_id,
                top_k=self.args.top_k,
                num_beams=self.args.num_beams,
                output_sequence_lengths=False,
                return_dict=False,
                logits_processor=logits_processor)

Where logits_processor is a function that modifies the logits tensor. But it seems like any operation that touches logits breaks any further generation step. Went so far as to define logits_processor as:
def logits_processor(step, final_output_ids_, logits):
    return 1.0*logits

The generated output tokens where all the same.
Interestingly, when debugging, I edited the tensorrt_llm/runtime/generation.py (source) to remove setting self.buffer['logits'] = logits and the problem went away.
Expected behavior
I want to apply the logits processor feature to enable things like JSON decoding.
actual behavior
Adding a logits processor that edits logits in the generation step in any way, causes the model to output the same token over and over again.
additional notes
What are the consequences of removing the self.buffer['logits'] = logits line in the generation script? Is this a bug?
Thank you for the help!

I also meet the same problem with the whisper model. Unfortunately, removing the self.buffer['logits'] = logits doesn't seem to solve the problem. It crashes due to an illegal memory access. The interesting thing is that this problem doesn't happen for a num_beams=1

Interesting... So there's a mix of parameters and/models that affect this behaviour. In my case, for LlaVA, num_beams=1 (as per default params in examples/multimodal/run.py for the model) but I did have to remove the self.buffer['logits'] = logits to get the output I expected.

num_beams=1 and remove setting self.buffer['logits'] = logits doesn't even help me. I'm trying to integrate a JSONLogitsProcessor from Outlines (https://github.com/outlines-dev/outlines/blob/main/outlines/integrations/vllm.py) to trt_llm. Logits are masked from my logits processor after the first iteration. Here how it looks like - next_token_logits: tensor([[[ -inf, 184.9984,     -inf,  ...,     -inf,     -inf,     -inf]]], device='cuda:0')
Without logits processor looks like this -  next_token_logits: tensor([[[207.3016, 238.9770, 137.5957,  ..., 207.0755, 216.6228, 211.6978]]], device='cuda:0')
Then what happens as far as i understand it goes through,
                    should_stop = self.dynamic_decoder.forward(                         next_token_logits, decode_step, max_context_length,                         self.max_attention_window_size, self.sink_token_length,                         ite, batch_size, self.end_ids, self.embedding_bias_opt,                         context_lengths, sequence_limit_lengths,                         stop_words_list_ptrs, stop_words_lens,                         max_stop_words_len, bad_words_list_ptrs, bad_words_lens,                         max_bad_words_len, no_repeat_ngram_size,                         this_src_cache_indirection, self.output_ids,                         self.new_tokens, self.finished, self.finished,                         self.sequence_length_buffer, self.cum_log_probs,                         self.log_probs, self.log_probs_tiled, self.parent_ids,                         this_tgt_cache_indirection,                         self.beam_hyps_output_ids_tgt,                         self.beam_hyps_sequence_lengths_tgt,                         self.beam_hyps_cum_log_probs,                         self.beam_hyps_normed_scores, self.beam_hyps_log_probs,                         self.beam_hyps_min_normed_scores,                         self.beam_hyps_num_beams, self.beam_hyps_is_done,                         scfg.use_beam_hyps)
should_stop always become tensor([True]). I'm not sure something goes wrong when -INF values are present in the following kernel invocations.

@dfcastap Do you still have the question? If not, we will close it soon.


How to compile espidf module?

I tried to use the pure python display driver ili9341.py, but I received the error ImportError: no module named 'espidf'.
Then I tried to make esp32 with this module driver/esp32/espidf.c, but it failed with extmod/extmod.mk and with
ports/esp32/Makefile
ifeq ($(MICROPY_PY_LVGL), 1)
 LIB_SRC_C += \
+       lib/lv_bindings/driver/esp32/espidf.c \
        lib/lv_bindings/driver/esp32/modlvesp32.c \
        lib/lv_bindings/driver/esp32/modILI9341.c \

ports/esp32/mpconfigport.h
 extern const struct _mp_obj_module_t mp_module_xpt2046;
+extern const struct _mp_obj_module_t mp_module_espidf;
 extern const struct _mp_obj_module_t mp_module_rtch;

     { MP_OBJ_NEW_QSTR(MP_QSTR_xpt2046), (mp_obj_t)&mp_module_xpt2046 }, \
+    { MP_OBJ_NEW_QSTR(MP_QSTR_espidf), (mp_obj_t)&mp_module_espidf }, \
     { MP_OBJ_NEW_QSTR(MP_QSTR_rtch), (mp_obj_t)&mp_module_rtch }, \

The error is:
build/py/objmodule.o:(.rodata.mp_builtin_module_weak_links_table+0xa4): undefined reference to `mp_module_espidf'
Could you help me to use it with micropython?

Hi @sEpt0r !
The pure python display driver for ili9341 is very much a work in progress.
It's an experiment to see whether Micropython is fast enough to handle the display without display-specific C code (it only uses esp-idf and lvgl functions).
I've committed some fixes, please try to pull the latest changes, it should work now.
I've also added a "hybrid" demo mode, where all management and initialization are in micropython and only the critical "flush" and ISR code are written in C. I observed significant improvement with the hybrid mode (30FPS pure micropython vs. 50FPS hybrid, ~52K pixels per frame (~70% of the screen is refreshed every frame)). With C the limiting factor is SPI, so I believe even higher frame-rates are possible (by using IOMUX pins with 80MHz instead of 40MHz) but current rates are probably good enough.
Here is an example how to build it in hybrid mode:
make -C ports/esp32 -j4 ESPIDFMOD_CFLAGS="-DENABLE_ILI9341_DEMO_FLUSH=1" LV_CFLAGS="-DLV_COLOR_DEPTH=16 -DLV_COLOR_16_SWAP=1" DEBUG=0 SDKCONFIG=boards/sdkconfig.spiram deploy

(remove the ESPIDFMOD_CFLAGS="-DENABLE_ILI9341_DEMO_FLUSH=1" to build it in pure micropython mode)

It was successfully built. I'll upload and check it out later.
Thank you.

I checked it. The display driver ili9341 works well with pure python and modILI9341.c.
But both drivers hang after several touches when modxpt2046.c is used on the same SPI interface.
I tried to disable half duplex and change the clock frequency on the ILI and XPT devices, but could not achieve stable work.

Thanks for the update @sEpt0r!
Please have a look at #21 if you haven't yet.
I don't have xpt2046 hardware so I wrote that code "blindly" and let others test it. So I assume there may still be issues there.
One thing you can do it to dedicate a different SPI device for the display and for the touch sensor. ESP32 has two SPI devices, HSPI and VSPI (actually more, but these two are usually available for the end user).
Current driver assumes that both touch and display are on the same SPI device, but you can try to modify it, or you can write a pure python driver for xpt2046.
I'll be happy to help if you have any questions!

Thank you.
I read the #21 and tried everything out of the conversation before I opened this issue.
I'll try again with different SPI hosts and write about the results.

I cannot add the xpt2046 to the VSPI, it fails on the spi_bus_add_device.
    if (ret != ESP_OK) nlr_raise(
        mp_obj_new_exception_msg(&mp_type_RuntimeError, "Failed adding SPI device"));

I tried to set full-duplex and 1MHz on both ili and xpt devices, but it still hangs after the first touch.
I checked signals on the oscilloscope and CS pin is low after hang.

@sEpt0r Did you try the esp32_ili9341 example project?
It uses HSPI for the ILI9341 display and VSPI for XPT2046 (without Micropython).
Please try and see if that example is working for you.

Ok, I'll try it.
Thank you.

Let's continue this discussion on #37
Closing.


Fix dtype typings for basic creation functions (cp.empty etc.)

A few functions in _creation/basic.py assign float (i.e. the builtin python float) as the default value for dtype. This leads to type checking issues further down the line:
cupy.empty(1, dtype=cupy.float32)

yields
Argument of type "float32" cannot be assigned to parameter "dtype" of type "type[float]" in function "empty"
  "float32" is incompatible with "type[float]"
  Type "float32" cannot be assigned to type "type[float]"

with basic typechecking enabled, as the valid arguments for dtype are narrowed down to values that share the type of float. The same goes for cupy.ones, cupy.zeros etc.
In case I didn't miss anything here, I would propose changing these occurrences of dtype=float to dtype=None, since the default argument does not make a difference: dtype=None will still lead to the creation of a double precision array.

/test mini

Thanks for the pull-request @satoqz! These API signatures are kept consistent with the NumPy ones, so IMHO we should stick with dtype=float and instead add type annotation for arguments. I've asked @asi1024 to how we proceed with this adding type annotation.

@satoqz btw how do you configure mypy? Currently CuPy is shipped without py.typed so I guess the module should be treated as missing.

@kmaehashi I'm using vscode with
{
  "python.analysis.typeCheckingMode": "basic"
}

set in .vscode/settings.json
This seems like a vscode (=pylance) issue as it doesn't appear possible to have it ignore modules without a py.typed... It either aggressively typechecks every module or none at all.
Using mypy directly via cli like
mypy test.py --ignore-missing-imports

correctly picks up the missing py.typed and does not show errors.

Thanks, I've confirmed the problem reproduces on my end. I also confirmed the error disappear by setting "python.analysis.useLibraryCodeForTypes": false; this option seems to enable type checking only for libraries with py.typed.

xref https://github.com/cupy/cupy/issues/4831#issuecomment-1641834027

While "python.analysis.useLibraryCodeForTypes": false does resolve the issue, it also disables all other language server functionality for the library, such as completions and signature hinting, which is suboptimal..
Should I close this PR now or would you prefer to keep it around? (Alternatively reopen it as an issue)


Ability to setup CORS using the cli proxy

Preflight checklist

[X] I could not find a solution in the existing issues, docs, nor discussions.
[X] I agree to follow this project's Code of Conduct.
[X] I have read and am following this repository's Contribution Guidelines.
[X] This issue affects my Ory Cloud project.
[X] I have joined the Ory Community Slack.
[X] I am signed up to the Ory Security Patch Newsletter.

Describe your problem
The ory proxy cannot set any CORS headers
Describe your ideal solution
Add flags / environment variables that could be used to set CORS or even setup standard CORS headers so that the user would only need to provide the origins. We already have support for this feature in ory/x and would only need to add the cli flags.
Workarounds or alternatives
none
Version
v0.1.28
Additional Context
No response

CORS is now available on the tunnel!

Done for CLI


web-ui: Add success message for no violations

Add success message for no violations.
Related to #197

@rbarilani Yeah updated the code.

👍

👍

@rbarilani should I merge it?

@netme Yep.

👍

Waiting for Travis to pass


request update openvpn 2.5.3(edge)/2.5.2(stable)

https://pkgs.alpinelinux.org/packages?name=openvpn&branch=edge&repo=main

楼主可以发下2.5.3版本软件下地址吗谢谢了半天没找不到！！

@we6607 openvpn官网就有呀

What I did to install 2.5.3 was to clone this repo and change the Dockerfile as shown below. I built this locally and pushed it to a container registry before updating my compose file.
RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing/" >> /etc/apk/repositories && \
    echo "http://dl-cdn.alpinelinux.org/alpine/edge/main/" >> /etc/apk/repositories && \
    apk add --update openvpn iptables bash easy-rsa openvpn-auth-pam google-authenticator pamtester libqrencode && \

The current alpine:latest already comes with openvpn 2.5.5, so this issue is outdated.


How to implement the non-static CNN in (Kim, 2014) using Keras

In the paper (Kim, 2014), the non-static and static CNN were proposed. Has someone implemented the methods. I will appreciate it vary much if you share the codes with Keras.

@kashif

hmm, does a Convolutional1D work for you?
i have read that paper, and i think there is no problem in implementing it using Keras.

Hello @Imorton-zd , I implemented the  (Kim, 2014) model recently. And here is my code.
graph = Graph()
graph.add_input(name = 'input', input_shape=(config.sent_len,), dtype='int')
graph.add_node(
    Embedding(config.vocab_size, config.vec_dim, input_length=config.sent_len, weights = [self._load_embedding()]),
    name = 'nonstatic_emb', input = 'input'
)
conv_layer_outputs = []
for idx, window_size in enumerate(config.conv_filter_hs):
    conv_name = 'conv_nonstatic_%d' % idx
    pool_name = 'pool_nonstatic_%d' % idx
    graph.add_node(
        Convolution1D(config.conv_features, window_size, activation='relu',W_constraint=MaxNorm(3), b_constraint=MaxNorm(3)),
        name=conv_name, input = 'nonstatic_emb'
    )
    graph.add_node(MaxPooling1D(pool_length = config.sent_len - window_size + 1), name=pool_name, input = conv_name)
    conv_layer_outputs.append(pool_name)
#MLP
print conv_layer_outputs
graph.add_node(
    Reshape((config.conv_features * len(config.conv_filter_hs),)),
    inputs = conv_layer_outputs,
    name = 'reshape')
for idx, mlp_h_dim in enumerate(config.mlp_hidden_units):
    print mlp_h_dim
    graph.add_node(
        Dense(
            mlp_h_dim,
            activation='linear' if idx != len(config.mlp_hidden_units)-1 else 'softmax',
            W_constraint = MaxNorm(3),
            b_constraint = MaxNorm(3)
        ),
        name = 'fc_%d' % idx,
        input= 'reshape' if idx == 0 else 'fc_%d_dropout' %(idx-1)
    )
    if idx != len(config.mlp_hidden_units) - 1:
        graph.add_node(
            Dropout(config.dropout_rate),
            name = 'fc_%d_dropout' % idx,
            input = 'fc_%d' % idx
        )
graph.add_output(name='output',input='fc_%d' % (len(config.mlp_hidden_units)-1))

Hope it helps.

@chen070757 Thanks for your reply and sharing your code! But I have some questions to the code. First, what are the parameters setting in config? Second, what is MaxNorm? In addtion, in fact, I want to do semi-supervised learning. Therefore, how can I modify the embedding layer to achieve the idea of non-static? Any opinions would be appreciated!

@ymcui Thanks for your reply！As far as I'm concerned, the first input of the non-static cnn is the word embeddings pre-trained in word2vec, then the embbedings are always updated via back propagation. However, in keras, either using embedding layer which cannot do semi-supevised learning or directly putting the pre-trained embeddings into the networks as static input, it does not achieve the idea of non-static.

@Imorton-zd

what are the parameters setting in config？

config is a self-defined class that contains some constants of my network.

what is MaxNorm?

MaxNorm is a normalization method mentioned in (Kim 2014) paper as l2 constraints. It rescale the weight to make the l2 normalization (of the weight) less than a given constant (e.g. 3).

how can I modify the embedding layer to achieve the idea of non-static?

weights = [self._load_embedding()] means that I use pretrained word embedding to initialize the embedding layer. The embedding layer is still trainable during the training process, and it will be updated according to back propagation. So, actually, it is a non-static CNN model here.
**ps: if you set trainable=False to embedding layer, it will be a static CNN model

@chen070757 Thank you very much. I still have some questions, hope not disturbing you.

The weights could be assigned to word embedding? In my opinion, according to W^T*X+b, the X should be be assigned to word embedding, just the input of first layer?
In your posted code, I don't find trainable=True.
If permitted, would you send your full implementation including data reading, config definition and MaxNorm definition, to my email<EMAIL_ADDRESS>Thanks once again!

@Imorton-zd
Keras API changed recently. My code is based on Keras 0.3.2, and it is not compatible with the latest keras.

The weights could be assigned to word embedding? In my opinion, according to W^T*X+b, the X should be be assigned to word embedding, just the input of first layer?

Embedding layer contains a embedding matrix. When it receive a input sequence like [3,7], it will look up the embedding vector and output like [emb[3], emb[7]]. So, the embedding matrix can be initialized randomly by default or with given matrix.
For further information about Embedding, you should read the document http://keras.io/layers/embeddings/

In your posted code, I don't find trainable=True.

trainable argument is in definition of Layer class which is base class of all layer class. You can find it in https://github.com/fchollet/keras/blob/0.3.2/keras/layers/core.py

MaxNorm definition

MaxNorm is also defined by keras. You can find the definition in https://github.com/fchollet/keras/blob/0.3.2/keras/constraints.py

@chen070757 Many thanks! The last two questions:
1、In training process train(self,train_X,train_Y,valid_X,valid_Y), validation data valid_X,valid_Y are necessary? According to my experiments, training loss is also decreasing and training accuracy is also visible without validation data (I use model.fit()). So I think validation data are not necessary. The positions of valid_X,valid_Y could be assigned to test data. Am I wrong?
2、 After 25 epochs, are you sure that the model achieve the best performance?

@Imorton-zd

In training process train(self,train_X,train_Y,valid_X,valid_Y), validation data valid_X,valid_Y are necessary? According to my experiments, training loss is also decreasing and training accuracy is also visible without validation data (I use model.fit()). So I think validation data are not necessary. The positions of valid_X,valid_Y could be assigned to test data. Am I wrong?

Validation data is used to help to estimate whether model is underfitting or overfitting. It has no effect with training process.

After 25 epochs, are you sure that the model achieve the best performance?

config.n_epochs is just another constant, you can change it as you need. In the experiment I've done,  the model will converge very quickly if you use adadelta as you optimizer.

@chen070757  Did you get (almost) same performance on any dataset compared to the original implementation or the torch implementation.
I've tried to implement Kim's CNN (see #1994, though it used the old graph api) but failed to achieve 81% accuracy on MR (movie review) data set. I got about 79%~80%. This bothers me for a long time. I don't know whether the difference comes  from some minor difference in the model architecture or details of preprocessing.
It would be very helpful if you could provide the performance information,

@chen070757 Thanks a lot for your great comments. I have one more question. Is there any way to return back-propagated word vectors? Or even more general question, is it possible to just back-propagate word embeddings using labeled data set? I need to observe changes in the word vectors and similarities.
Regards,
Nader


[Prototype] Catalog enums in metadata not referenced by function or attribute (not generated in proto)

What does this Pull Request accomplish?
TODO: Include high-level description of the changes in this pull request.
Why should this Pull Request be merged?
TODO: Justify why this contribution should be part of the project.
What testing has been done?
TODO: Detail what testing has been done to ensure this submission meets requirements.

Committed to grpc-device in a separate PR.


Fix give-brownie-points/about API DB queries

This should speed up these api calls significantly

@BerkeleyTrue Great work!


Update SensSoft to Flagon

SensSoft still appears in many places througout repos.
Needing to update to remove references to SensSoft, in favor of Flagon.
Ex: https://github.com/apache/incubator-flagon-distill/blob/master/CONTRIBUTING.rst , etc...

This might be best treated as an epic, and have some distinct issues as some work gets done?  But... however work is best tracked?!?

This was fixed in recent release.


CI : made format,clippy,test run in parallel

made format,clippy,test run in parallel
Fixes: #394
/claim: #394
Build & Testing:
I ran cargo test successfully.
Checklist:
I have performed a self-review of my own code.

@akansh-bansal I think you have merged two separate PRs in this one?

No build is running it seems on this PR.

No build is running it seems on this PR.

No build is running it seems on this PR.

i think test will build by default not sure though, i can add build if you want

The build was running until https://github.com/tailcallhq/tailcall/pull/405/commits/5796d09a27ef5ef0821c1fd635a79f557025a074
But now it's not running.

Fixed in #396


Add UnmarshalJSON to Message and params to UpdateMessage

This PR adds UnmarshalJSON to Message so you can unmarshal an attachment action callback directly. Otherwise it fails due it having the original message as a quoted string and a string can be unmarshalled in Message struct.
It also adds parameters to UpdateMessage so more complex messages can be used.

This breaks compatibility. I am in the process of doing some other changes that may be breaking changes, so will merge this then. Shouldn't be long. I am now back on this (had a bit of a hiatus there).
Thanks for submitting and apologies for the late response!


Question about the usage of the 'listing' scripts in StatisticalRethinking v3 as Pluto notebooks.

Hi,
Over the last few months I have been working on a new version of StatisticalRethinking (v3) and one part that I always found  lacking is a good introduction to statistics using Julia. Your upcoming book fills this gap very nicely (and more). As the upcoming StatisticalRethinking v3 will use projects, Pluto notebooks and Plots (GR) I wanted to use a similar setup for your book's listings. As a proof of concept I did 3 chapters in StatisticsWithJuliaPlutoNotebooks.
My question is if this usage would be ok with both of you.
This is just a project, there is no need to register it, and if you are not ok I can make the repository private and remove all links to it in StatisticalRethinking.jl. Or, in case you would choose at some point to make (these or another version of the) Pluto notebooks part of your github repository I would simply update the links accordingly.
Thanks for a great book and your time to consider my request,
Rob
cc.: @yoninazarathy, @h-Klok

Hi Rob, it is a very nice initiative and certainly ok. Thank you for creating this. We've linked to your new repo from our README.


Fix status of recompile button

Description
closes #2650
Self Check:
Strike through any lines that are not applicable (~~line~~) then check the box

[x] Attached issue to pull request
[x] Changelog entry
[x] Code is clear and sufficiently documented
[x] Sufficient test cases (reproduces the bug/tests the requested feature)
[x] Correct, in line with design
[x] ~End user documentation is included or an issue is created for end-user documentation (add ref to issue here: )~

Reviewer Checklist:

[ ] Sufficient test cases (reproduces the bug/tests the requested feature)
[ ] Code is clear and sufficiently documented
[ ] Correct, in line with design

Processing this pull request

Merged into branches iso5, master in 95e13e8d7cf93a88687c6e6c1f74c5bb22dc4859

Processing #2701.


Remove cast to kv.NotFoundError, you can't assume the error is one of these

Fixes #2

Thanks for this - not sure what the purpose of the cast was really, given the method signature of Get!


figure out how font specifications in pango work

Why does "7x14" not work? It seems like the only way to actually get that font is via "Fixed 10.5", which seems less than ideal.

Gave a quick build/run whirl to this, and ran into a font issue.  Not sure this is the right issue,  but on my retina display macbook pro (running linux) runes has the "micro-small font" problem.  I typically use
  Xft*dpi:              150

in my .Xdefaults file to get around this, but I gather that means using xft fonts, which you mention not implementing above.


[Storage][DataLake] Make PathHttpHeaders a class

https://github.com/Azure/azure-sdk-for-net/pull/8235
PathHttpHeaders should be almost identical to BlobHttpHeaders:
https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/storage/Azure.Storage.Blobs/src/Models/BlobHttpHeaders.cs

Already done.


puppet: Allow unattended upgrades of -updates in addition to -security

This ensures that software will be fully up-to-date, not just with
security patches.

Merged, thanks @alexmv!


Remnant spawns items regardless of settings

Hi, I found those 2 issues with Remants:

Items spawn regardless of them being set to -1 in config (I tested it also by installing only remnants with dependencies in a separate profile)
there is some error when remnants is installed with this one particular skin:
https://thunderstore.io/c/lethal-company/p/Smtony/LuigiModel/

game version:
v56
remnant version:
v1.3.4

The -1 in the config setting still spawns the item is intended, since it spawns the item with the rarity in relative of its cost in the shop.
If you want to not spawn an item you should put the value to 0.
The problem seems to be from the Luigi's Mansion skin, I did not took in mind a preventive measure.
This issue will be fixed on the next update, but sadly the Luigi's Mansion skin will not be seen on the dead bodies from this mod.
Due to the skin having an ' in its name, which causes some problem in programming.
Thank you for the issue report.

This issue should be fixed now on the current version, I will close this issue in a couple of weeks unless it is still present.


Extract CLI config from client config. Allow to create SM client with

Prerequisites
SM Client should be easier to configure with authentication
Approach
Allow a SM client to be created with authentication configuration
Pull Request status

[x] Initial implementation
[ ] Unit tests

Pull Request Test Coverage Report for Build 201

43 of 108 (39.81%)  changed or added relevant lines in 7 files are covered.
No unchanged relevant lines lost coverage.
Overall coverage decreased (-1.7%) to 73.947%

Changes Missing Coverage
Covered Lines
Changed/Added Lines
%

internal/cmd/login/login.go
7
11
63.64%

pkg/auth/auth.go
0
5
0.0%

pkg/errors/error.go
0
6
0.0%

internal/configuration/configuration.go
32
41
78.05%

internal/cmd/commander.go
0
12
0.0%

pkg/smclient/client.go
2
31
6.45%

Totals

Change from base Build 195:
-1.7%

Covered Lines:
1053

Relevant Lines:
1424

💛  - Coveralls

 Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.1 out of 2 committers have signed the CLA.:white_check_mark: pankrator:x: dzaharievYou have signed the CLA already but the status is still pending? Let us recheck it.


[Day1] Write Leap Year In java

ToDo:

Follow TDD and implement Leapyear Exercise using JUnit5 in JDK17

Acceptance Criteria:

Tests are written in JUnit5
All tests are green
Relevant docs are updated for the solution

The solution is provided in the solutions branch.


Add Fair Source topic

Please confirm this pull request meets the following requirements:

[x] I followed the contributing guidelines: https://github.com/github/explore/blob/main/CONTRIBUTING.md.
[x] I am not the sole author or employee of a company who created either the topic I am modifying/adding or the collection entry I am modifying/adding.

Which change are you proposing?

[ ] Suggesting edits to an existing topic or collection
[x] Curating a new topic or collection
[ ] Something that does not neatly fit into the binary options above

Curating a new topic or collection

[x] I've formatted my changes as a new folder directory, named for the topic or collection as it appears in the URL on GitHub (e.g. https://github.com/topics/[NAME] or https://github.com/collections/[NAME])
[x] My folder contains a *.png image (if applicable) and index.md
[x] All required fields in my index.md conform to the Style Guide and API docs: https://github.com/github/explore/tree/main/docs

Please replace this line with an explanation of why you think this topic or collection should be curated.

Please note: we will close your PR without comment if you do not check the boxes above and provide ALL requested information.

@stevemoser i note you left the "conflict of interest" assertion unchecked - do you feel you have a conflict of interest with respect to this topic?

@ahpook Ah, sorry, I messed up the PR description. I do not have a conflict of interest with this project. Thank you for reaching out and asking.

Thanks @stevemoser , merging this!


[Unity] Cache ndarray-cache.json

Based on a comment from @tqchen I've gone ahead and made a PR for my suggestion/question of caching ndarray-cache.json before caching the shards. From my point of view this change means subsequent loads will pull 100% from CacheStorage, avoiding any external requests. Also I think this might make more sense because if your ndarrayCacheUrl is not pinned to a specific commit then it could perhaps become out of sync with the cached shards.

Adding CC comment for reviewers @quic-sanirudh & @tqchen as the contributing guidelines suggest I do.

Thank you @DustinBrett


Issues with Deutsch-Josza

Some issues have been raised with the section on the Deutsch-Jozsa algorithm. See PR #49 and these details on Twitter.

Also PR #52


Imported symbol as a type is not merged with a local variable

🔎 Search Terms
Declaration merging, isolatedModule, type import conflict
🕗 Version & Regression Information

This is the behavior in every version I tried, and I reviewed the FAQ for entries about declaration merging

⏯ Playground Link
https://www.typescriptlang.org/play?isolatedModules=true&ts=5.4.0-beta#code/JYWwDg9gTgLgBDAnmApnA3nAwhcEB2K+8AvnAGZS5wDkUKAhgMYw0DccA9J3ACoDKcFFCpQAznAIIAFsAkB3WQBs0weHLihIsFABM4DCQwTIUAKCYEx8HHkLEAXNlyR78AD5x8AVyVK4ALxevkpsZmZa0PBIqBhwAGJYcGSU1HSMLOxcPAIGfhDyEjCyRhJqNEYmqBZW8IlOiXCePn6BwX5hQA
💻 Code
import type { Component } from 'react'; // TS errors on this while it is imported as a type
const Component: Component | null = null;

import type { FC } from 'react'; // TS allows this as it's a type
const FC: FC | null = null;

🙁 Actual behavior
TypeScript reports the following error:
Import declaration conflicts with local declaration of Component.

🙂 Expected behavior
Because Component is imported as a type, it should be merged with the variable Component without emitting an error.
Additional information about the issue
A related issue was recently fixed and discussed in a design meeting.
Fixing the current issue could make TypeScript behavior more consistent.

This is intended, since import type {} will also create type information which can be used in typeof if possible. You can write:
// @filename: a.ts
export const Foo = 'Foo';

// @filename: b.ts
import type { Foo } from './a';
type Bar = typeof Foo
  // ^ type Bar = "Foo"

You are not allowed to define a variable Foo here, because it will change the result of typeof Foo.

@whzx5byb I am not sure that you have understood my point, or I am not sure that I am following you.
Here FC is a type that is imported as a type and is merged with the local variable FC.
Components is a class that is imported as a type and should merge with the local variable Components.
Basically, every type or value imported as a type should be mergeable with a local variable (that is not a type).

Thanks! That's so ugly ;(

import type {} will also create type information which can be used in typeof if possible.

More specifically, it imports all meanings of the imported symbol, even value meanings, it just doesn't allow using them in emitting positions.


Removed lint that was converted to a hard error

Removed lint that was converted to a hard error

Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 100.00%. Comparing base (f3983f5) to head (a2f5e46).

Additional details and impacted files
@@            Coverage Diff            @@
##            master       #23   +/-   ##
=========================================
  Coverage   100.00%   100.00%
=========================================
  Files            2         2
  Lines           66        66
=========================================
  Hits            66        66

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


IPv6 no longer working when SOLICIT required

Important notices
Before you add a new report, we ask you kindly to acknowledge the following:
[x] I have read the contributing guide lines at https://github.com/opnsense/core/blob/master/CONTRIBUTING.md
[x] I have searched the existing issues and I'm convinced that mine is new.
Describe the bug
Last known working 19.7, but possibly in early 20s. IPv6 setup for Zen Internet as per https://docs.opnsense.org/manual/how-tos/IPv6_ZenUK.html was followed in late February, and has been working since then. Recently upgraded to latest last week, and have noticed IPv6 is no longer working. LAN interface, configured as Tracked, is no longer being given an IPv6 IP, even though WAN is.
The option "Directly send SOLICIT" now appears to be missing from the UI, even though it is a requirement for Zen, described in the howto, and listed in the documentation. I can only assume this is the reason for the failure of Route Advertisement.
Happy to test this if someone advises what config file to edit.
To Reproduce
Use an ISP that requires Directly Send Solicit

As you can see from the patch the "removal" merely enables directly send solicit by default for everyone:
https://github.com/opnsense/core/commit/48e0c47a968b4f55bbe299d6b961613fa8d86802#diff-1332c372788c9e1a8c6c9bae9ebb55a5
While the docs need updating your issue seems to be elsewhere and is not currently visible from the information you reported.

@kylegordon - I wrote the doc and I'll update it. I use Zen on static, but I'll quickly switch to dhcp6 and check it.

dhcp6c working fine. Can you check your system log and filter using dhcp6c, see what it says.

@fichtner no problem, thank you for the clarification :+1:
@marjohn56 aha, thanks for the info and hints. I've disabled and reenabled the WAN interface (couldn't do it during work hours since working from home these days), and have gotten the following results.
The LAN interface did now get an IP address assigned, even though it's been spinning for at least the past 24 hours with hundreds of "dhcp6c[7680]: Sending Solicit" messages. In the past 36 hours, it's only been Sending Solicit messages from dhcpc6, interspersed with 3 occasions where dhcp6c was restarted and it issued a 'restarting' message.
I'll shortly reboot and see how well it can bring up the whole config.
May 15 22:06:43 firewall dhcp6c: RTSOLD script - Sending SIGHUP to dhcp6c for interface wan(pppoe0)
May 15 22:06:43 firewall dhcp6c[7680]: restarting
May 15 22:06:44 firewall dhcp6c: RTSOLD script - Sending SIGHUP to dhcp6c for interface wan(pppoe0)
May 15 22:06:44 firewall dhcp6c[7680]: restarting
May 15 22:06:44 firewall dhcp6c[7680]: Sending Solicit
May 15 22:06:45 firewall dhcp6c[7680]: Sending Solicit
May 15 22:06:48 firewall dhcp6c[7680]: Sending Solicit
May 15 22:06:52 firewall dhcp6c[7680]: Sending Solicit
May 15 22:07:00 firewall dhcp6c[7680]: Sending Solicit
May 15 22:07:17 firewall dhcp6c[7680]: Sending Solicit
May 15 22:07:50 firewall dhcp6c[7680]: Sending Solicit
May 15 22:07:51 firewall dhcp6c[7680]: Sending Request
May 15 22:07:51 firewall dhcp6c[7680]: Received REPLY for REQUEST
May 15 22:07:51 firewall dhcp6c[7680]: add an address 2a02:8010:66ab:0:5054:ff:fe6f:2f08/64 on vtnet0
May 15 22:07:51 firewall dhcp6c[7680]: status code for PD-0: success
May 15 22:07:51 firewall dhcp6c[7680]: status code for NA-0: no addresses
May 15 22:07:51 firewall dhcp6c: dhcp6c REQUEST on pppoe0
May 15 22:07:51 firewall dhcp6c: dhcp6c REQUEST on pppoe0 - running newipv6
May 15 22:07:52 firewall dhcp6c[7680]: Sending Solicit
May 15 22:07:53 firewall dhcp6c[7680]: Sending Solicit
May 15 22:07:55 firewall dhcp6c[7680]: Sending Solicit
May 15 22:07:59 firewall dhcp6c[7680]: Sending Solicit
May 15 22:08:07 firewall dhcp6c[7680]: Sending Solicit
May 15 22:08:24 firewall dhcp6c[7680]: Sending Solicit

Yep, a reboot brought it all back nicely and as expected. I'm at a loss as to why dhcp6c was spinning on Sending Solicit and not getting a reply. Maybe something somewhere got wedged.
Thank you for your time! Greatly appreciated :+1:

Happy to hear 😊


multiple following on feed glitch

https://www.dropbox.com/s/av7958zbef78o7g/Screenshot 2016-07-05 22.55.23.png?dl=0

I believe this happens when hitting the next page of results when scrolling down and there are new items at the top. Annoying but also edge case-y. Closing for now.


Use Transactions to create single point of access to github tokens across Cocoon instances

Every so often we have an issue with ci.yaml validation failing on an 'You have exceeded a secondary rate limit' error. The issue has been somewhat mitigated with write locks for the local cocoon instances and minting and accessing github tokens. We need to create a service (possibly expand on existing code) that will allow us to use something like DataStore to create and access tokens across cocoon instances. This will cut down on the number of times we see the secondary rate issue.
From a conversation with Casey:
Transactions have inherent locking: https://cloud.google.com/datastore/docs/concepts/transactions
There are locations in cocoon where we already implement transactions. Like here: https://cs.opensource.google/flutter/cocoon/+/main:app_dart/lib/src/service/datastore.dart?q=transaction&ss=flutter%2Fcocoon
The idea is for global token access to mint and read tokens.

This addresses the final steps for this issue: https://github.com/flutter/flutter/issues/102402

Is this complete?

No it is not. I plan to get to this after the configurable autosubmit is done and we have onboarded dart.


very nice project!  i need help CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

Access to XMLHttpRequest at 'http://localhost:5000/api/v1/run-command' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

Managed to get this to work on firefox


Compress to JXL

Preferably with a little settings-window in which you can play with all the possible options. And it'd be even better if every time you change a setting (i.e. check a checkbox or slide a slider), it tries to compress it already behind the scenes (if the image isn't too large) and it tells you what file-size you can expect from those settings.  And it'd be even better if every time you change a setting (i.e. check a checkbox or slide a slider), it tries to compress it already behind the scenes (if the image isn't too large) and it tells you what file-size you can expect from those settings. You know, like Preview does too:


⚠ Bofrost.de has degraded performance

In edaaad0, Bofrost.de (https://www.bofrost.de) experienced degraded performance:

HTTP code: 200
Response time: 1229 ms

Resolved: Bofrost.de performance has improved in ce86a65.


Improve release process docs

As discussed in x-team sync, add a couple steps to the release process doc to prepare other teams to handle release.
Added step about notifying weave-gitops-dev channel in slack
Added step about moving issues out of Uncategorized in PR description
Anything else you two feel we should add?

Great job! ✨ The basics are covered. I suggest to add what we agreed on to write when we have a regression and have to make a patch release. I will check it and add sample text.

Found it, it's in our pinned policy doc:
A person to cut a release to take care of the following improvements: 1) In case of making a fix release because of regressions, add a message about the regression to the release notes. 2) limit the use of ‘exclude from release notes’ label for more transparency


[BUG] Getting external.metrics.k8s.io/v1beta1: Got empty response for: external.metrics.k8s.io/v1beta1

Agent Environment
agent version: 7.38.2
deployed with the helm chart: 2.37.9
in a k8s cluster (more info at the bottom)
Describe what happened:
I am getting an error/warning when I run any kubectl command on a cluster that has datadog deployed:
E0302 18:01:45.684553    1989 memcache.go:255] couldn't get resource list for external.metrics.k8s.io/v1beta1: Got empty response for: external.metrics.k8s.io/v1beta1

Example:
$ kubectl get pod foo
E0302 18:01:45.684553    1989 memcache.go:255] couldn't get resource list for external.metrics.k8s.io/v1beta1: Got empty response for: external.metrics.k8s.io/v1beta1
Error from server (NotFound): pods "foo" not found

Usually it behaves like a warning, not causing any trouble except for the noise, but sometime it seems to be dealbreaker.
Example, when trying to run https://github.com/derailed/popeye tool:
$ popeye
E0302 17:56:47.154757    1231 memcache.go:255] couldn't get resource list for external.metrics.k8s.io/v1beta1: Got empty response for: external.metrics.k8s.io/v1beta1
 ___     ___ _____   _____                       D          .-'-.
| _ \___| _ \ __\ \ / / __|                       O     __| K    `\
|  _/ _ \  _/ _| \ V /| _|                         H   `-,-`--._   `\
|_| \___/_| |___| |_| |___|                       []  .->'  X     `|-'
  Biffs`em and Buffs`em!                            `=/ (__/_       /
                                                      \_,    `    _)
                                                         `----;  |

Boom! 💥 unable to retrieve the complete list of server APIs: external.metrics.k8s.io/v1beta1: Got empty response for: external.metrics.k8s.io/v1beta1

Describe what you expected:
No warning/errors.
Steps to reproduce the issue:

run kubectl get foo

Additional environment details (Operating System, Cloud provider, etc):
$ kubectl version --short
(...)
Client Version: v1.26.1
Kustomize Version: v4.5.7
Server Version: v1.23.14-gke.1800

Cloud Provider/Platform (AKS, GKE, Minikube etc.): GKE

A workaround: https://github.com/kubernetes/kubernetes/pull/115978

+1

This gets resolved if you use external.metrics with custom metrics in an hpa.
ex DD agent config
apiVersion: datadoghq.com/v2alpha1
kind: DatadogAgent
metadata:
  name: datadog
  namespace: datadog-system
spec:
  global:
    clusterName: example
    credentials:
      apiSecret:
        keyName: api-key
        secretName: datadog-secret
      appSecret:
        keyName: app-key
        secretName: datadog-secret
  override:
    nodeAgent:
      containers:
      env:
      - name: DD_HOSTNAME_FILE
        value: /var/lib/cloud/data/instance-id
      - name: DD_COLLECT_GCE_TAGS
        value: "false"
      tolerations:
      - operator: Exists
  features:
    clusterChecks:
      enabled: true
    externalMetricsServer:
      enabled: true
      useDatadogMetrics: true
      endpoint:
        credentials:
          apiSecret:
            keyName: api-key
            secretName: datadog-secret
          appSecret:
            keyName: app-key
            secretName: datadog-secret
    kubeStateMetricsCore:
      conf:
        configMap:
          name: kubernetes-state-core-confd
      enabled: true

external.metrics resources are empty, this will give you the warning if you kubectl api-resources
can see its empty with:
kubectl get --raw /apis/external.metrics.k8s.io/v1beta1
{"kind":"APIResourceList","apiVersion":"v1","groupVersion":"external.metrics.k8s.io/v1beta1","resources":[]}

add hpa for external.metrics following this guide: https://www.datadoghq.com/blog/autoscale-kubernetes-datadog/
apiVersion: "rbac.authorization.k8s.io/v1"
kind: ClusterRole
metadata:
  labels: {}
  name: datadog-cluster-agent-external-metrics-reader
rules:
  - apiGroups:
      - "external.metrics.k8s.io"
    resources:
      - "*"
    verbs:
      - list
      - get
      - watch
---
apiVersion: "rbac.authorization.k8s.io/v1"
kind: ClusterRoleBinding
metadata:
  labels: {}
  name: datadog-cluster-agent-external-metrics-reader
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: datadog-cluster-agent-external-metrics-reader
subjects:
  - kind: ServiceAccount
    name: horizontal-pod-autoscaler
    namespace: kube-system
---
apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
  name: nginxext
spec:
  minReplicas: 1
  maxReplicas: 5
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: nginx
  metrics:
  - type: External
    external:
      metricName: nginx.net.request_per_s
      metricSelector:
        matchLabels:
            kube_container_name: nginx
      targetAverageValue: 9

check exteranl metrics again
kubectl get --raw /apis/external.metrics.k8s.io/v1beta1 | jq '.'
{
  "kind": "APIResourceList",
  "apiVersion": "v1",
  "groupVersion": "external.metrics.k8s.io/v1beta1",
  "resources": [
    {
      "name": "nginx.net.request_per_s",
      "singularName": "",
      "namespaced": true,
      "kind": "ExternalMetricValueList",
      "verbs": [
        "get"
      ]
    }
  ]
}

no more warning
kubectl api-resources | grep unable
echo $?
1


Add the ability to restrict the creation of projects from organisation users

At the moment, all organisation users can create projects. We need to restrict this functionality to only users with the relevant permission.
Note that to maintain the current state for existing users, we'll need to add this permission for all organisation users in the system already.

The API work for this is now complete.
The patterns for these organisation permissions are identical to those of the environment and project permissions.
New endpoints:
GET /organisations/permissions

GET /organisations/user-permissions/
POST /organisations/user-permissions/
PATCH /organisations/user-permissions/:id
PUT /organisations/user-permissions/:id
DELETE /organisations/user-permissions/:id

GET /organisations/user-group-permissions/
POST /organisations/user-group-permissions/
PATCH /organisations/user-group-permissions/:id
PUT /organisations/user-group-permissions/:id
DELETE /organisations/user-group-permissions/:id

GET /organisations/:id/my-permissions

The data for each of these endpoints is identical to the endpoints that already exist for projects and environments.
@kyle-ssg we'll need to somewhat coordinate FE and BE releases for this. I've maintained the existing behaviour for existing users (i.e. given all organisation users the CREATE_PROJECT) permission. The issue, however, will be when an organisation invites a new user and expects them to be able to create new projects. They would have to make them an organisation admin until the FE is deployed to manage organisation permissions.
Hopefully that all makes sense. Shout if not.

Will be


Removing inline CSS from handlebars and adding it to SASS

Fixed #990 (c)
https://guarded-inlet-13297.herokuapp.com/
@aayusharora please review

Codecov Report

Merging #1186 into development will not change coverage.
The diff coverage is n/a.

@@             Coverage Diff              @@
##           development    #1186   +/-   ##
============================================
  Coverage        63.06%   63.06%
============================================
  Files                8        8
  Lines             1397     1397
  Branches           218      218
============================================
  Hits               881      881
  Misses             516      516

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 d57a439...b56899f. Read the comment docs.

@utkarshnath Great work. Can you please use the values of colours defined in config.scss for assigning colours to the element. Thanks

@geekyd done

@aayusharora plz review

@utkarshnath Please remove Merge conflicts

@aayusharora conflicts resolved

There are still conflicts :( @utkarshnath

@aayusharora resolved conflicts

@utkarshnath Please squash the commits. Thanks :)

@utkarshnath Please resolve the conflicts and squash the commits. Thanks :)


Fix the previous tab and next tab editor shortcuts being ignored

This makes Ctrl + Tab and Ctrl + Shift + Tab switch scene tabs in the editor as expected.
This should be cherry-picked to the 3.x branch after 3.3 is released, since the feature didn't work in 3.2.x either from my testing.
This closes https://github.com/godotengine/godot/issues/8799.

Superseded by #51346, which I am convinced is the "proper" fix, using the exact match checking.


Error when running Feature extraction model on CPU

System Info
optimum version: 1.13.2
OS: Windows 10.0.19045
Python: 3.11.5
Running on CPU

Who can help?
@JingyaHuang
Information

[ ] The official example scripts
[X] My own modified scripts

Tasks

[ ] An officially supported task in the examples folder (such as GLUE/SQuAD, ...)
[X] My own task or dataset (give details below)

Reproduction (minimal, reproducible, runnable)
The following code gives me an error as it is expecting token_type_ids as model input:
from optimum.onnxruntime import ORTModelForFeatureExtraction
from transformers import AutoTokenizer

model_name = "intfloat/multilingual-e5-large"
output_path = "./model_dir"
model = ORTModelForFeatureExtraction.from_pretrained(
    model_name, export=True
)
tokenizer = AutoTokenizer.from_pretrained(model_name)

model.save_pretrained(output_path)
tokenizer.save_pretrained(output_path)

# later in code

model = ORTModelForFeatureExtraction.from_pretrained(output_path)
tokenizer = AutoTokenizer.from_pretrained(output_path)

max_length = int(model.config.max_position_embeddings)

encoded_input = tokenizer(
    ["Hello World!"],
    padding=True,
    max_length=max_length,
    truncation=True,
    return_tensors="pt",
)
model_output = model(**encoded_input)

Gives the error: ValueError: Required inputs (['token_type_ids']) are missing from input feed (['input_ids', 'attention_mask']).
Expected behavior
The model should return the output

Hi @JingyaHuang. I'm able to create a PR for this as I have already fixed this locally :)

Hi @JingyaHuang I have added a PR to resolve this. Hope it is sufficient 🙏

Hi @mhattingpete, thanks a lot for opening the PR, why not just set return_token_type_ids=True in the tokenizer, with which you can have token_type_ids as inputs. Something like this:
encoded_input = tokenizer(["Hello World!"], padding=True, max_length=max_length, truncation=True, return_tensors="pt", return_token_type_ids=True)

Saying that because the model is traced with given token_type_ids as input, that's why the ORT model complains, as there is input inconsistency during inference compared to tracing.


packaging request: ocrodjvu

Project description
ocrodjvu is a wrapper for OCR systems, that allows you to perform OCR on DjVu files.
(via timlee126 or Reddit)
Metadata

homepage URL: https://jwilk.net/software/ocrodjvu
source URL: https://github.com/jwilk/ocrodjvu/commit/03c62afaa476a8cf357ac72e1bb8853fde134960
license: gpl2+
platforms: unix

Looked into it:

The package itself is a Python script that does not support Python 3
It relies on an as-of-yet unpackaged module from the same author. This one is also compatible with Python 3.

I don't think we want more Python 2 stuff now so I will put it in NUR.


Add PanNuke specialist finetuning

This is good to go from my side. I'll go ahead and merge this once the tests pass!


Features/dynamic errors

Codecov Report

Merging #25 (523e92f) into develop (e8ad806) will decrease coverage by 0.51%.
The diff coverage is 100.00%.

@@             Coverage Diff             @@
##           develop      #25      +/-   ##
===========================================
- Coverage    99.74%   99.22%   -0.52%
===========================================
  Files           15       15
  Lines          395      389       -6
===========================================
- Hits           394      386       -8
- Misses           1        3       +2

Impacted Files
Coverage Δ

src/ragger/__init__.py
100.00% <100.00%> (ø)

src/ragger/backend/__init__.py
100.00% <100.00%> (ø)

src/ragger/backend/interface.py
100.00% <100.00%> (ø)

src/ragger/backend/ledgercomm.py
100.00% <100.00%> (ø)

src/ragger/backend/ledgerwallet.py
95.16% <100.00%> (-3.26%)
:arrow_down:

src/ragger/backend/speculos.py
100.00% <100.00%> (ø)

src/ragger/error.py
100.00% <100.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 e8ad806...523e92f. Read the comment docs.


adding a new file in file tree is losing track of which buffers are open

I added a new file and then went back to a file I had been editing, and hadn't saved yet, and it prompted me about the autosave file!  also verified it happening again. seems to be only files in the same directory that you add new file to.

happened again, here's the error msg:
2019/02/01 16:43:51 giv.FileNode could not find node leabra25ra in: /Users/oreilly/go/src/github.com/emer/emergent/examples
2019/02/01 16:43:51 giv.FileNode could not find node leabra25ra in: /Users/oreilly/go/src/github.com/emer/emergent/examples
2019/02/01 17:13:41 giv.FileNode could not find node dtable in: /Users/oreilly/go/src/github.com/emer/emergent
2019/02/01 17:13:41 giv.FileNode could not find node dtable in: /Users/oreilly/go/src/github.com/emer/emergent

interestingly, I'm pretty sure that this is what triggers the other bug #112 !  i saw it happen.  will get around to fixing this sometime soon...


Added fix not supporting global object (happens with react-native + android)

This fixes react-native on android.
https://github.com/facebook/react-native/issues/12823
https://github.com/yorkie/react-native-wechat/issues/176
https://github.com/mockingbot/react-native-zip-archive/issues/27

This isn't applicable and more, as we don't polyfill Promise


x/pkgsite: documentation broken for non-leaf packages on a branch

What version of Go are you using (go version)?
N/A
What did you do?
Going to a non-leaf package on pkg.go.dev on a branch doesn't render any documentation items. For example, https://pkg.go.dev/net@master and https://pkg.go.dev/testing@master#F.
I think this is a regression, as the latter link is in the fuzzing beta blog post.
Navigating to a leaf package seems to work, e.g. https://pkg.go.dev/net/url@master.

This seems to be fixed now.


Investigate why black pre-commit hook fails

Not sure why I get this error when running black on pre-commit. As a workaround currenly poetry run black . is being used.
black....................................................................Failed
- hook id: black
- exit code: 1

Traceback (most recent call last):
  File "/home/dpalma/.cache/pre-commit/reporuiqo72y/py_env-python3.8/bin/black", line 8, in <module>
    sys.exit(patched_main())
  File "/home/dpalma/.cache/pre-commit/reporuiqo72y/py_env-python3.8/lib/python3.8/site-packages/black/__init__.py", line 6606, in patched_main
    patch_click()
  File "/home/dpalma/.cache/pre-commit/reporuiqo72y/py_env-python3.8/lib/python3.8/site-packages/black/__init__.py", line 6595, in patch_click
    from click import _unicodefun  # type: ignore
ImportError: cannot import name '_unicodefun' from 'click' (/home/dpalma/.cache/pre-commit/reporuiqo72y/py_env-python3.8/lib/python3.8/site-packages/click/__init__.py)

It seems it was related to ImportError: cannot import name '_unicodefun' from 'click'. Updating to 8.1.2 fixed the error.


VS Code randomly freezes entire PC for a few seconds multiple times a day

Issue Type: Performance Issue
I'm not sure what the cause is yet or how to reliably recreate it.
Some info:

I'm running VS Code locally on my Windows 10 machine but connected to a remote workspace with the remote SSH extension (had this happen for a local workspace so I don't think the remote extension is at fault here).
I'm working in a large monorepo. I saw this also happen for a much smaller workspace, but currently I think a larger workspace is more likely to cause it.
This isn't CPU use - it looks like it's GPU related. I leave the task manager open all the time to see historical system resource usage and there's always a huge spike in GPU to 100% and then back down to normal levels (~2%, depending on what I'm doing).
I'm not doing anything workload intensive, as far as I know. Most of the time I notice this happening when I alt-tab back to VS Code and try to type in the built-in terminal. And the commands are simple, like 'git status' or 'll'. I've also had this happen by simply alt-tabbing back to VS Code and doing nothing else.
When the freeze happens, all keyboard/mouse input is ignored. The screen doesn't update. This lasts for a few seconds before everything works again.
I have a GeForce 1080 Ti graphics card on this machine and updated to the latest graphics drivers just in case.
It feels like this is a recent regression.

Version: 1.69.2 (user setup) (also seen on 1.69.0)
Commit: 3b889b090b5ad5793f524b5d1d39fda662b96a2a
Date: 2022-07-18T16:12:52.460Z
Electron: 18.3.5
Chromium: 100.0.4896.160
Node.js: 16.13.2
V8: <IP_ADDRESS>-electron.0
OS: Windows_NT x64 10.0.19044

System Info

Item
Value

CPUs
Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz (8 x 4200)

GPU Status
2d_canvas: enabledcanvas_oop_rasterization: disabled_offdirect_rendering_display_compositor: disabled_off_okgpu_compositing: enabledmultiple_raster_threads: enabled_onopengl: enabled_onrasterization: enabledraw_draw: disabled_off_okskia_renderer: enabled_onvideo_decode: enabledvideo_encode: enabledvulkan: disabled_offwebgl: enabledwebgl2: enabled

Load (avg)
undefined

Memory (System)
31.94GB (15.35GB free)

Process Argv

Screen Reader
no

VM
0%

Item
Value

Remote
SSH: coder.asd

OS
Linux x64 5.4.0-1068-gke

CPUs
Intel(R) Xeon(R) CPU @ 3.10GHz (60 x 3100)

Memory (System)
236.15GB (118.82GB free)

VM
0%

Process Info
CPU %	Mem MB	   PID	Process
    0	   111	 25100	code main
    0	    91	  5268	   extensionHost
    0	   220	 15872	   gpu-process
    0	    92	 16696	   issue-reporter
    0	   107	 20044	   shared-process
    0	    75	   364	     ptyHost
    0	     4	 19692	       C:\WINDOWS\System32\cmd.exe /c (type "C:\Users\sam\AppData\Local\Temp\vscode-linux-multi-line-command-coder.asd-819971363.sh" | ssh -T -D 55324 "coder.asd" bash) & exit /b 0
    0	     9	  5664	         ssh  -T -D 55324 "coder.asd" bash
    0	    46	 21108	           "C:\\Users\\myusername\\bin\\coder.exe" tunnel asd 12213 stdio
    0	     8	 20112	       console-window-host (Windows internal process)
    0	    69	 17100	     fileWatcher
    0	   307	 21932	   window (fish - myusername (Workspace) [SSH: coder.asd] - Visual Studio Code)
    0	    47	 25536	   utility-network-service

Remote: SSH: coder.asd
CPU %	Mem MB	   PID	Process
    0	     0	370447	remote agent
    0	     0	370485	   ptyHost
    0	     0	389928	     /usr/bin/fish
    0	     0	370511	   extensionHost
    0	     0	370547	     /home/myusername/.vscode-server/bin/92d25e35d9bf1a6b16f7d0758f25d48ace11e5b9/node /home/myusername/.vscode-server/extensions/heptio.jsonnet-0.1.0/node_modules/vscode-languageclient/lib/utils/electronForkStart /home/myusername/.vscode-server/extensions/heptio.jsonnet-0.1.0/out/server/server.js --node-ipc --clientProcessId=370511
    0	     0	373002	     /home/myusername/go/bin/gopls -mode=stdio
    0	     0	373102	     /home/myusername/.vscode-server/extensions/hashicorp.terraform-2.23.0-linux-x64/bin/terraform-ls serve
    0	     0	373140	     /home/myusername/.vscode-server/extensions/rust-lang.rust-analyzer-0.3.1123-linux-x64/server/rust-analyzer
    0	     0	373440	       /home/myusername/.vscode-server/extensions/rust-lang.rust-analyzer-0.3.1123-linux-x64/server/rust-analyzer proc-macro
    0	     0	373144	     /home/myusername/.vscode-server/bin/92d25e35d9bf1a6b16f7d0758f25d48ace11e5b9/node /home/myusername/.vscode-server/bin/92d25e35d9bf1a6b16f7d0758f25d48ace11e5b9/extensions/json-language-features/server/dist/node/jsonServerMain --node-ipc --clientProcessId=370511
    0	     0	373242	     /home/myusername/.vscode-server/bin/92d25e35d9bf1a6b16f7d0758f25d48ace11e5b9/node /home/myusername/.vscode-server/extensions/ms-python.vscode-pylance-2022.7.20/dist/server.bundle.js --cancellationReceive=file:8dde805317c22445708c9a7ad0b86f86579eb8ea7c --node-ipc --clientProcessId=370511
    0	     0	370522	   fileWatcher
    0	     0	391533	   /bin/sh -c /bin/ps -ax -o pid=,ppid=,pcpu=,pmem=,command=
    0	     0	391534	     /bin/ps -ax -o pid=,ppid=,pcpu=,pmem=,command=

Workspace Info

|  Remote: SSH: coder.asd;

Extensions (24)

Extension
Author (truncated)
Version

Nix
bbe
1.0.1

postcss
css
1.0.9

jupyter-keymap
ms-
1.0.0

remote-ssh
ms-
0.82.1

remote-ssh-edit
ms-
0.80.0

remote-wsl
ms-
0.66.3

vscode-bazel
Baz
0.5.0

vscode-css-modules
cli
0.4.2

vscode-eslint
dba
2.2.6

vscode-deno
den
3.13.0

gitlens
eam
12.1.1

EditorConfig
Edi
0.16.4

prettier-vscode
esb
9.5.0

go
gol
0.34.1

terraform
has
2.23.0

jsonnet
hep
0.1.0

elixir-ls
Jak
0.10.0

python
ms-
2022.10.0

vscode-pylance
ms-
2022.7.20

jupyter
ms-
2022.6.1001902341

jupyter-keymap
ms-
1.0.0

jupyter-renderers
ms-
1.0.8

rust-analyzer
rus
0.3.1123

language-stylus
sys
1.16.0

Here's what system resources look like when this happens:

this is happening for a long time already, since ver ~1.48 or so .
i don't remember how, but i got a console/log report on this, as far i remember it said that OpenGL or something have crashed .
some Windows UI also freeze while this is happening . that is a consequence of the VSC's issue, no other program causes that .
it seems related to large coverage of Open/Workspace Folders .

might be related to https://github.com/microsoft/vscode/issues/152300

It sounds very similar, but in my case, I rarely have more than 2-3 integrated terminals open at once.

Just had this happen when I alt-tabbed back to a VS Code window (no other instances running) for a local workspace with a lot fewer files than the large mono repo I usually work in.

@goodspark does the issue happen with latest stable 1.70.0 to rule out the terminal issue linked above. If the issue persists, can you check if starting the application with --disable-features=CalculateNativeWinOcclusion mitigates the hang. Thanks!

my issue does happen on 1.70.0 . though at the time it appeared, terminal was opened .

Same, seeing it on 1.7.0. I'll try with the arg.

with the arg it happened relatively soon, without terminal ever opened since the start (but 1 console process was run without gui, by extension) .

Also same after adding the startup arguments. I had 1 terminal open FWIW. Same symptoms. Display frozen, but audio still works (ex. if music was playing from another app).

this often happens when i copy something to clipboard, but maybe that just makes me notice the freeze .

Anything we can do to help debug this? Still an issue on 1.70.2.

also, my system which has the issue uses 2ndary Intel's graphics processor which doesn't have drivers newer than from 2015 year . (in case you rely on some functionality which wasn't supported until some version)

@goodspark are you sure that your Nvid. GPU is used for processing VSC / do you have the latest drivers for all GPUs/"display adapters" which is involved in providing you the GUI ?

I'm think so. My monitor is plugged into the graphics card output and nothing else is plugged into the motherboard video out. And I open the task manager in Windows, there's only one section for GPU and it lists the Nvidia card as the hardware.

Hm. An interesting data point - it seems like this doesn't happen if I don't have Chromium running. Or at least, it doesn't happen as often. Left VSCode open over the weekend after closing Chromium and haven't seen this happen yet. Could it be an Electron thing? At the same time, I'm also using the Discord desktop client, which also uses Electron.

i also often have browser open .
after i work for certain time, 2-5 second freezes start to happen about every 10 minutes or less, can anyone whos responsible for the relevant parts of VSC imagine having that ?

this issue still has "Info needed" badge, whyyyyyy ??? we wasn't provided a single bit of info about what info to send .

Do you use Chromium or Chrome? Also, yes, it'd be nice to know if there's any more diagnostic or debugging information we can provide to help figure out what's going on.

@goodspark i use Firefox, i assume its already far from Chromium .

OK so I left the dev tools open for VSCode in the hopes of capturing a profile whenever I tabbed back into VSCode after a long break. I got lucky and finally captured a trace when the freeze happened (attached):
Profile-20220919T212500 - Copy.zip
You can view this in Chromium/Chrome/VSCode dev tools by going to the performance tab and clicking the icon to load the profile. The pause happened at ~23s into the trace. There's a 9s red block that says 'dropped frame'. That roughly lines up with the timing of the delay I saw on my machine.
Notable data:

There's a huge stack of animations occuring just before the red dropped frame block: https://user-images.githubusercontent.com/29210237/191169235-8ad04038-09c6-492a-98e4-e0be967e87d0.mp4
Nothing sticks out as bad in the captured function calls.
There are two long blocks of GPU activity during the dropped frame:

Hopefully this helps. I'm at a loss as to what other data we can provide the VSCode maintainers to help debug this issue. There's been a lot of silence.

Sorry for the delay here, please check if the issue still happens with latest insiders https://code.visualstudio.com/insiders and if it does capture the trace using the steps below,

Closing all running instances of VSCode Insiders
Start a new instance with the following arguments from the system terminal code-insiders --trace --trace-category-filter="base,benchmark,browser,latency,mojom,content,startup,toplevel,v8,navigation,disabled-by-default-lifecycles,blink,cc,gpu,viz"
Perform the steps to repro the gpu spike, open command palette  and run Developer: Stop Tracing, this will generate a trace and provide you the path at which the trace was saved. Attach it to this issue thread.

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.
Happy Coding!


Tooltip dots not displayed

Hi,
I can get everything working, including the tooltipHook, but no matter what I try I cannot make the tooltip-dots visible. Looking into the DOM structure I see the tooltip-dot element, and I see the value being updated during mouse actions, but no dot appears on the chart. Could I be missing something? This is my setup:
$scope.options = {
        margin: {
          top: 5
        },
        series: [{
          axis: 'y',
          dataset: 'dataset0',
          key: 'y',
          type: ['line', 'area']
        }],
        axes: {
          x: {
            key: 'x'
          },
          y: {
            ticks: [0, 100],
            min: 0
          }
        },
        grid: {
          x: false,
          y: false
        },
        tooltipHook: (d) => {
          return {
            abscissas: "Foo",
            rows:  d.map(function(s){
              return {
                value: s.row.y1
              }
            })
          }
        }
      };

Okay, nevermind :) I found that in my project there is another instance of the 'overlay' class, which is too greedy, and is setting the display: none.


Performance calculator required parameters could be metrics dependent.

nml.PerformanceCalculator for roc_auc  metric requires y_pred parameter while it is not really needed for roc_auc (which needs only y_true and y_pred_proba).

We could indeed check if we only need to calculate roc_auc then we could make y_pred optional.
We'll have to add some docs as well to make the expectations clear, and also add a clear error message when it is not provided yet required.


完成 tags 的介面細部設計

What's new?
完成了以下 6 個 route 並 handle 了所定義的各種 reponse。

單元測試函式的命名我遵循以下原則
The name of a unit test method should have the following form:
test_[unit_of_work]_with(when)_[scenario]_should_[expected_result]

The words outside the square brackets should be kept as-is. "with" and "when" can be chosen under the situation.
The naming convention is built from 3 parts:

unit_of_work: the name of the function/route. Should be omitted if the test is gathered under a test class.
scenario: the characteristic of the arguments/payload passed to the function/route or the circumstances under which the unit of work is being executed.
expected_result: the return value/response of the function/route or the result we expect to occur after executing the unit of work. You are recommended to use the verb "return" on the return value of functions and "respond" on the response of routes.

Resolves: #86

大致上沒有任何問題，但我認為可以將一些部份包裝成 utility，一方面是可以讓 route 更加專責，一方面是可以讓 item 在開發時能夠使用這些 utility。
目前想到可以包成 utility 的一些方法：

確認 tag 是否存在


Run build script on server side.

Relates to https://github.com/whatwg/html-build/pull/28
This is part of the fix for the problem of making the build service report the correct line numbers when a source file has parser errors. But beyond that, it is part of enabling users to run the build with zero dependencies installed locally other than bash, zip/unzip, and git.
This requires the html/build/build.sh script to be installed on the server and pointed to in the config file (in place of pointing to the wattsi binary).

Can you give a more high-level overview of how this is supposed to work?
Currently as input we take a multipart upload with files source, w3cbugs, and caniuse.
Now it seems like we're taking as input quiet, verbose, and a source file that is a zip file containing... what? And the output is... what? And it's coupled to changes to html-build?
This is a big change all at once :-/. I'd prefer to land this piecewise if at all possible, with a bit more planning before code-writing...

Can you give a more high-level overview of how this is supposed to work?

So essentially it works by changing the server-side build environment to behave exactly like the local build environment—in particular to expect only a single input, the HTML spec source file.

Currently as input we take a multipart upload with files source, w3cbugs, and caniuse.

This changes things such that we no longer need to upload the w3cbugs and caniuse files but instead we just have the build generate them on the server side in the same way the build generates them in the local case. It makes the server-side build just another local build.

Now it seems like we're taking as input quiet, verbose, and a source file that is a zip file containing... what?

A source file is just an HTML spec source file, as with local builds. Optionally, it can be a zipped source file, but the only reason I added that was just to reduce the size of the upload (from 5.8MB to ~1MB) to save people bandwidth and upload time when building (especially for people who are on slow connections).

And the output is... what?

The output is the exact same wattsi-output tree that a local build generates (and consumes), with a build.log file tucked in that's the log for the build run on the server.

And it's coupled to changes to html-build?

Yes. Though really the only change there was in what we send to the build server. We would now just send the source and let the build server run all the steps need to process that, including the steps needed to get the w3cbugs and caniuse data, and the steps for getting the Unicode CLDR data and the unicode.xml file from the W3C site, etc. And running the perl scripts.
So this also has the consequence/benefit of eliminating the requirement for users to install the Perl XML::Parser module, if they don’t have a local wattsi executable and just want to have the build server handle it all.
Also, altogether in my environment it takes only about 90 seconds to do all this—I mean, to upload the source file to the build server, and to wait for the build run to complete on the build server, and to download the output and do that final steps with that locally (creating the output/multipage dir, etc.)

OK, that makes a bit more sense. If you don't mind, I'd like to take a crack at working on this myself. I'd make the following changes:

Query strings for options
Use the body instead of multipart, as you suggested. We can then do zips with content-type switching instead of filename switching.
Use common cache dir for every build, instead of re-downloading for every user

I am still learning how to use this web framework (koa) so I'd enjoy the chance to do it myself :).

OK, that makes a bit more sense. If you don't mind, I'd like to take a crack at working on this myself.

Yeah, of course—that would be great. I have little real experience with doing much real-world stuff with node, and don’t even know basic things like what’s the normal way to access query params, let alone stuff like what additional modules might be around to help.

Query strings for options
Use the body instead of multipart, as you suggested. We can then do zips with content-type switching instead of filename switching.

Yeah, I think that would be the right way to do it.

Use common cache dir for every build, instead of re-downloading for every user

Yep—that clearly makes a lot more sense and should also dramatically reduce that server-side build time, and the time that users need to spend waiting for the build to complete.
I suspect it would then be on the same order of reduction in time as a for local builds, where the build time goes from a minute or more down to just 10 or 15 seconds. Of course the difference would be the time required to upload the source file and download the results, and that’s a factor that depends on the speed of the user’s network connection. But I think for the common case of most people have at least 10Mbps+ it should get time down to just 45 seconds—or roughly half of what it would take if we didn’t cache the dependencies on the server side.

I am still learning how to use this web framework (koa) so I'd enjoy the chance to do it myself :).

And I will enjoy observing how you do it so that I can learn from it :-)


clean up quiz landing page

fixes #982
fixes #975
fixes #981
fixes #1000

removes question counter from quiz and survey

questions and landing page both

increase font size to 12px for Correct/Incorrect answer status
unify replay and back buttons for questionnaires landing page
restrict home page as child of root page

Change "Replay Survey"/"Replay Poll" button text to "Go to Homepage" (and change the link accordingly). "Replay Quiz" should stay as it is.
Remove the old "Back" button from poll landing page:

For quizzes, put a second copy of the "Replay Quiz"/"Back" button pair right below the "Your results" element.
For quizzes, move the thank you text below this second copy of the "Replay Quiz"/"Back" button pair, above the first question.

@geoo89 done


CANFD support

Dear project admin,
I prepared a local branch with fixing CANFD support for your library, I would love to push it upstream and contribute it back to you project. Could you provide me the rights to push the branch and then maybe merge it, if it fits your requirements.

created a fork and PR


Expose request and response types in a simple way

Hey thanks for your module !
I'm coming from open-api-generator with axios-typescript which exposes enum and types directly from what's generated.
It could be nice to expose directly quer/params and response types from generation and maybe adding them to auto-import ?
Currently the only way to retrieve thse types is to import from the operations type:
import type { operations } from "#build/types/nuxt-open-fetch/schemas/---.ts"

function parms (param: operations['...']['query']) {}

Hi @huang-julien,
I like the idea.
There is a PR in openapi-typescript to solve this problem https://github.com/drwpow/openapi-typescript/pull/1260.
Unfortunately, the author said he won't be working on it anymore, so I'll give it a shot :)
The main problem as I understand is this one:

the proposal to have top-level “friendly names” doesn’t work for many schemas, because you’re allowed to use characters in component names that aren’t JS-safe. So we’d have to rename them somehow, while preventing conflicts.

interesting :eyes: ... I'll be waiting then.
i'm just doing a workaround ATM:
import type { operations } from '#build/types/nuxt-open-fetch/schemas/bff'

export type OperationParameters<T extends keyof operations> = 'parameters' extends keyof operations[T]
	? operations[T]['parameters']
	: never

// example
function (t: Partial<OperationParameters<'GetPet'>['query']>) {
    $fetch('...', { query : t })
}

It does work but def not my fav way of using types haha

Created a PR to export types with friendly names https://github.com/drwpow/openapi-typescript/pull/1599.
But it's an open question which level of nested types for paths should be aliased and what is the most convenient way to use them:
RequestEnterpriseAdminListGlobalWebhooks['query']
// or
RequestEnterpriseAdminListGlobalWebhooksQuery
// or
EnterpriseAdminListGlobalWebhooksQuery
// etc

I'm not sure if it's relevant for this issue. 😅 I'm wondering how I can access the response type for a certain request.
I would like to type my Pinia store without having to type something like this:
export const useStore = defineStore("test", {
  // ...
  state: () => ({
    token: null as null | string,
    userInfo: null as {
      deactivate?: string | undefined;
      email: string;
      id: string;
      instances: {
        id: string;
        name: string;
      }[];
      name: string;
      phone?: string | undefined;
      roles: string[];
    } | null
  })
});

Ideally the code would look something like this:
export const useStore = defineStore("test", {
  // ...
  state: () => ({
    token: null as null | string,
    userInfo: null as UserInfoByToken | null
  })
});

Here's the code I'm using to set userInfo:
const { data, error } = await useAuthService(
  "/user-info-by-token/{token}",
  {
    path: { token: this.token }
  }
);

this.userInfo = data.value;

@jonkri I suggest opening new issue for this. However, here's my suggestion as per what I understand you're trying to do:

You can import the type and assign it
import type { operations } from '#build/types/open-fetch/schemas/api'

export const useStore = defineStore("test", {
  // ...
  state: () => ({
    token: null as null | string,

	// You can get type from operations. You've to update below type according to your API
    userInfo: null as operations['...']['...'] | null,
  })
});

Additionally, I've also created few type utils for myself. These are custom made so there can be chances of improving it. I'm using it for my personal use and they're fine till now. This might look confusing so if you are beginner avoid this.
import type { operations } from '#build/types/open-fetch/schemas/api'

export type ApiResponse<T extends keyof operations, R extends keyof operations[T]['responses']> = operations[T]['responses'][R] extends { content: { 'application/json': infer U } }
  ? U
  : never

export type ApiRequestBody<T extends keyof operations> = operations[T]['requestBody'] extends { content: { 'application/json': infer U } }
  ? U
  : never

export type ApiRequestQueryParams<T extends keyof operations> = operations[T]['parameters'] extends { query?: infer U } ? U : never

Here's how you can use it:
import type { operations } from '#build/types/open-fetch/schemas/api'

export const useStore = defineStore("test", {
  // ...
  state: () => ({
    token: null as null | string,

	// You can get type from operations. You've to update below type according to your API
    userInfo: null as ApiResponse<'get_users__user_id', 200>,
  })
});

How about this:
import type { paths } from '#open-fetch-schemas/auth-fetch'

type Paths = keyof paths
type Methods<path extends Paths> = keyof paths[path]
type AuthService<pathT extends Paths, methodT extends Methods<pathT>> = paths[pathT][methodT]['responses']['200']['content']['application/json']

let userInfo: AuthService<'/user-info-by-token/{token}', 'get'>


Upgrade babel vulnerabilities

This PR upgrades the following packages to fix some vulnerability warnings:

@babel/cli
@babel/core
@babel/eslint-parser
@babel/plugin-transform-runtime
@babel/preset-env

Current dependencies on/for this PR:

main

PR #40   👈

This stack of pull requests is managed by Graphite.


React-native import

I'm pretty new to Swift, so please bare with!
Is it possible with c4 to 'export' as a project (I think with a .framework...?), to be imported into other xcode projects?
I've been referencing Swift -> React Native via this tutorial
http://browniefed.com/blog/react-native-how-to-bridge-a-swift-view/
However am unsure whether C4 can be used like this, or whether it was intended for standalone use only.

Hey boyswan, I haven't had a look at react-native. I'll read through this article tonight and post an answer.
Apologies for the long delay in responding to your question. I was on vacation for a few weeks, and then took some time to get caught up with everything.

From what I see on the tutorial you linked, C4 can be used like this.
We actually suggest building your projects by compiling C4 into a framework, so we're already achieving this step.
The real work is in creating the bindings... i.e. everything that allows you to get to doing this kind of stuff:
import React, { requireNativeComponent, processColor } from 'react-native';
let RNLinearGradient = requireNativeComponent('RNLinearGradientSwift', LinearGradient);
class LinearGradient extends React.Component {
  render() {
    let { colors, ...otherProps } = this.props;
    return <RNLinearGradient {...otherProps} colors={processColor(colors)} />;
  }
}
LinearGradient.propTypes = {
  colors: React.PropTypes.array.isRequired,
  locations: React.PropTypes.array,
}
export default LinearGradient;

I'd love to see C4 working with react native.


deepcopy bug

I think this is a proof issue?
Sample code:
import agate
import proof

def load_data(data):
    data['responses'] = agate.Table.from_csv('responses.csv')

def unweighted_totals(data):
    data['first'] = data['responses'].group_by('first')

if __name__ == '__main__':

    data_loaded = proof.Analysis(load_data)
    data_loaded.then(unweighted_totals)

Result:
File "tally.py", line 31, in <module>
    data_loaded.run()
  File "/Users/tylerfisher/.virtualenvs/listeners2015/lib/python2.7/site-packages/proof/analysis.py", line 204, in run
    analysis.run(refresh=refresh, _parent_cache=self._cache)
  File "/Users/tylerfisher/.virtualenvs/listeners2015/lib/python2.7/site-packages/proof/analysis.py", line 192, in run
    local_data = _parent_cache.get()
  File "/Users/tylerfisher/.virtualenvs/listeners2015/lib/python2.7/site-packages/proof/analysis.py", line 50, in get
    return deepcopy(self._data)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line 163, in deepcopy
    y = copier(x, memo)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line 257, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line 190, in deepcopy
    y = _reconstruct(x, rv, 1, memo)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line 334, in _reconstruct
    state = deepcopy(state, memo)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line 163, in deepcopy
    y = copier(x, memo)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line 257, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line 190, in deepcopy
    y = _reconstruct(x, rv, 1, memo)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line 334, in _reconstruct
    state = deepcopy(state, memo)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line 163, in deepcopy
    y = copier(x, memo)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line 257, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line 163, in deepcopy
    y = copier(x, memo)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line 237, in _deepcopy_tuple
    y.append(deepcopy(a, memo))
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line 190, in deepcopy
    y = _reconstruct(x, rv, 1, memo)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line 334, in _reconstruct
    state = deepcopy(state, memo)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line 163, in deepcopy
    y = copier(x, memo)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line 257, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line 190, in deepcopy
    y = _reconstruct(x, rv, 1, memo)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line 334, in _reconstruct
    state = deepcopy(state, memo)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line 163, in deepcopy
    y = copier(x, memo)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line 257, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line 163, in deepcopy
    y = copier(x, memo)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line 298, in _deepcopy_inst
    state = deepcopy(state, memo)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line 163, in deepcopy
    y = copier(x, memo)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line 257, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line 190, in deepcopy
    y = _reconstruct(x, rv, 1, memo)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line 334, in _reconstruct
    state = deepcopy(state, memo)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line 163, in deepcopy
    y = copier(x, memo)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line 257, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line 174, in deepcopy
    y = copier(memo)
TypeError: cannot deepcopy this pattern object

If I remove proof from the equation:
import agate

data = {}

def load_data():
    data['responses'] = agate.Table.from_csv('responses.csv')

def unweighted_totals():
    data['first'] = data['responses'].group_by('first')

if __name__ == '__main__':
    load_data()
    unweighted_totals()

It all works, and I can do things with my grouped data.

Weird. Latest agate? Which version of Python?

Never mind I see it's 2.7. I'll have to take a look. Maybe some issue with row references in tablesets. I've seen one similar issue before.

Latest agate as well.