Using pulse gates with Runtime

Describe the bug
Hi all, it seems to me that using custom pulse gates in conjunction with IBM Runtime is a no-go at the moment.
Steps to reproduce
If I run this script, I get sensible results.
from qiskit.quantum_info import SparsePauliOp
from qiskit import QuantumCircuit

service = QiskitRuntimeService()
backend = service.backend('ibm_oslo')
z_op = SparsePauliOp('Z')

circ = QuantumCircuit(1,1)
circ.h(0)
circ.measure(0,0)

with Session(service=service, backend=backend) as session:
    estimator = Estimator(session=session)
    res = estimator.run(circ, z_op)

print(res.result())

On the other hand, if I run this code:
from qiskit_ibm_runtime import QiskitRuntimeService, Estimator, Session
from qiskit.pulse import Gaussian
from qiskit.quantum_info import SparsePauliOp
from qiskit import QuantumCircuit
from qiskit.circuit import Gate

service = QiskitRuntimeService()
backend = service.backend('ibm_oslo')
z_op = SparsePauliOp('Z')

circ = QuantumCircuit(1,1)
circ.h(0)
custom_gate = Gate('custom_gate', 1, [])
circ.append(custom_gate, [0])
circ.measure(0,0)

with pulse.build(backend=backend) as sched:
    pulse.play(Gaussian(duration=64, amp=0.2, sigma=8), pulse.drive_channel(0))

circ.add_calibration('custom_gate', [0], sched, [])

with Session(service=service, backend=backend) as session:
    estimator = Estimator(session=session)
    res = estimator.run(circ, z_op)

print(res.result())

I get an error which boils down to TypeError: __new__() missing 3 required positional arguments: 'duration', 'amp', and 'sigma'.
Expected behavior
Both of these pieces of code work if you simply run them directly on a backend, but one fails if you use Runtime. I would've expected both to work
Suggested solutions
🤷♂
Additional Information
The same is true for Sampler

qiskit-ibm-runtime version:  0.8.0
Python version: 3.8.12
Operating system: macOS

This looks like an issue with qpy that was fixed in terra but not picked up by ibm-runtime. For example, if I do
import io
from qiskit import qpy

with io.BytesIO() as buff:
    qpy.dump(circ, buff)    # Using circ from earlier example
    buff.seek(0)
    restored = qpy.load(buff)
    restored[0].copy()    # Used by the estimator which raised the exception

The code above works, but if I switch to ibm-runtime's qpy this fails with
TypeError: __new__() missing 3 required positional arguments: 'duration', 'amp', and 'sigma'

I don't get the __new__() error. I get the behavior in #657. I am not sure why the behavior is different. As a workaround, you can try converting your pulses to Waveform so replacing Gaussian(duration=64, amp=0.2, sigma=8) with Gaussian(duration=64, amp=0.2, sigma=8).get_waveform() because I think it is only parametric pulses that are broken rather than all pulse gates.

Could you clarify what you mean by the code above works?

Here "works" just means that the code example does not produce the error locally (without submitting to the runtime), not that it produces a circuit that can be submitted to the runtime. For comparison, this code does reproduce the error locally:
import json

from qiskit import QuantumCircuit, assemble, pulse
from qiskit_ibm_runtime.utils import RuntimeEncoder, RuntimeDecoder

with pulse.builder.build(name="x") as sched:
    pulse.play(pulse.Gaussian(100, 0.8, 10), pulse.DriveChannel(0))

qc = QuantumCircuit(1)
qc.x(0)
qc.add_calibration("x", (0,), sched)

dumped = json.dumps(qc, cls=RuntimeEncoder)
loaded = json.loads(dumped, cls=RuntimeDecoder)

loaded.copy()

The difference is that this code uses the runtime's version of qpy to dump and load rather than terra's version.

Here is a modified version of your example that gets past the pulse problem (an illustration of my second edited workaround above):
from qiskit_ibm_runtime import QiskitRuntimeService, Estimator, Session
from qiskit.pulse import Gaussian
from qiskit.quantum_info import SparsePauliOp
from qiskit import QuantumCircuit
from qiskit.circuit import Gate

service = QiskitRuntimeService()
backend = service.backend('ibm_oslo')
z_op = SparsePauliOp('Z')

circ = QuantumCircuit(1,1)
circ.h(0)
custom_gate = Gate('custom_gate', 1, [])
circ.append(custom_gate, [0])
circ.measure(0,0)

gauss = Gaussian(duration=64, amp=0.2, sigma=8)
gauss._pulse_type = "custom_gaussian"
with pulse.build(backend=backend) as sched:
    pulse.play(gauss, pulse.drive_channel(0))

circ.add_calibration('custom_gate', [0], sched, [])

with Session(service=service, backend=backend) as session:
    estimator = Estimator(session=session)
    res = estimator.run(circ, z_op)

print(res.result())

For me, this gives:
2022-12-16T15:06:27.524698748Z     pass_.run(FencedDAGCircuit(dag))
2022-12-16T15:06:27.524698748Z   File "/opt/app-root/lib64/python3.9/site-packages/qiskit/transpiler/passes/optimization/commutation_analysis.py", line 75, in run
2022-12-16T15:06:27.524698748Z     does_commute = self.comm_checker.commute(
2022-12-16T15:06:27.524698748Z   File "/opt/app-root/lib64/python3.9/site-packages/qiskit/circuit/commutation_checker.py", line 135, in commute
2022-12-16T15:06:27.524698748Z     operator_1 = Operator(op1, input_dims=(2,) * len(qarg1), output_dims=(2,) * len(qarg1))
2022-12-16T15:06:27.524698748Z   File "/opt/app-root/lib64/python3.9/site-packages/qiskit/quantum_info/operators/operator.py", line 85, in __init__
2022-12-16T15:06:27.524698748Z     self._data = self._init_instruction(data).data
2022-12-16T15:06:27.524698748Z   File "/opt/app-root/lib64/python3.9/site-packages/qiskit/quantum_info/operators/operator.py", line 520, in _init_instruction
2022-12-16T15:06:27.524698748Z     op._append_instruction(instruction)
2022-12-16T15:06:27.524698748Z   File "/opt/app-root/lib64/python3.9/site-packages/qiskit/quantum_info/operators/operator.py", line 564, in _append_instruction
2022-12-16T15:06:27.524698748Z     raise QiskitError(f"Cannot apply Operation: {obj.name}")
2022-12-16T15:06:27.524698748Z qiskit.exceptions.QiskitError: 'Cannot apply Operation: custom_gate'

Here is a modified version of your example that gets past the pulse problem (an illustration of my second edited workaround above):
from qiskit_ibm_runtime import QiskitRuntimeService, Estimator, Session
from qiskit.pulse import Gaussian
from qiskit.quantum_info import SparsePauliOp
from qiskit import QuantumCircuit
from qiskit.circuit import Gate

service = QiskitRuntimeService()
backend = service.backend('ibm_oslo')
z_op = SparsePauliOp('Z')

circ = QuantumCircuit(1,1)
circ.h(0)
custom_gate = Gate('custom_gate', 1, [])
circ.append(custom_gate, [0])
circ.measure(0,0)

gauss = Gaussian(duration=64, amp=0.2, sigma=8)
gauss._pulse_type = "custom_gaussian"
with pulse.build(backend=backend) as sched:
    pulse.play(gauss, pulse.drive_channel(0))

circ.add_calibration('custom_gate', [0], sched, [])

with Session(service=service, backend=backend) as session:
    estimator = Estimator(session=session)
    res = estimator.run(circ, z_op)

print(res.result())

For me, this gives:
2022-12-16T15:06:27.524698748Z     pass_.run(FencedDAGCircuit(dag))
2022-12-16T15:06:27.524698748Z   File "/opt/app-root/lib64/python3.9/site-packages/qiskit/transpiler/passes/optimization/commutation_analysis.py", line 75, in run
2022-12-16T15:06:27.524698748Z     does_commute = self.comm_checker.commute(
2022-12-16T15:06:27.524698748Z   File "/opt/app-root/lib64/python3.9/site-packages/qiskit/circuit/commutation_checker.py", line 135, in commute
2022-12-16T15:06:27.524698748Z     operator_1 = Operator(op1, input_dims=(2,) * len(qarg1), output_dims=(2,) * len(qarg1))
2022-12-16T15:06:27.524698748Z   File "/opt/app-root/lib64/python3.9/site-packages/qiskit/quantum_info/operators/operator.py", line 85, in __init__
2022-12-16T15:06:27.524698748Z     self._data = self._init_instruction(data).data
2022-12-16T15:06:27.524698748Z   File "/opt/app-root/lib64/python3.9/site-packages/qiskit/quantum_info/operators/operator.py", line 520, in _init_instruction
2022-12-16T15:06:27.524698748Z     op._append_instruction(instruction)
2022-12-16T15:06:27.524698748Z   File "/opt/app-root/lib64/python3.9/site-packages/qiskit/quantum_info/operators/operator.py", line 564, in _append_instruction
2022-12-16T15:06:27.524698748Z     raise QiskitError(f"Cannot apply Operation: {obj.name}")
2022-12-16T15:06:27.524698748Z qiskit.exceptions.QiskitError: 'Cannot apply Operation: custom_gate'

I tried my own version of the waveform approach you mentioned and it gave me a different error, not sure why. The error says trying to find more "in" edges ? I don't know, nothing I try seems to work.
from qiskit import IBMQ
IBMQ.load_account()
provider= IBMQ.get_provider(hub= "provider here")
import qiskit
from qiskit_ibm_runtime import QiskitRuntimeService, Session, Options
from qiskit_ibm_runtime import Estimator as my_runtime_estimator
service = QiskitRuntimeService()
real_backend_manila= provider.get_backend('ibmq_manila')
service_real_backend_waveform_manila = service.backend('ibmq_manila')

from qiskit import pulse
from qiskit.circuit import Gate
from qiskit import QuantumCircuit
from qiskit.circuit.library import standard_gates
from qiskit.pulse.library import Gaussian, Drag

pulse_x_gate = Gate(name='pulse_x_gate', label='p_x_g', num_qubits=2, params=[])

qc_pulse_gate_circuit_waveform_manila = QuantumCircuit(2, 0)
qc_pulse_gate_circuit_waveform_manila.append(pulse_x_gate,[0,1])

sched_waveform_x_manila = Gaussian(duration=64, amp=0.2, sigma=8).get_waveform()

with pulse.build(real_backend_manila, name='custom_pulse_sched_waveform_manila') as custom_pulse_schedule_waveform_manila:
    pulse.play(sched_waveform_x_manila, pulse.drive_channel(0))

qc_pulse_gate_circuit_waveform_manila.add_calibration('pulse_x_gate', [0,1],custom_pulse_schedule_waveform_manila)

options_manila = Options()
options_manila.transpilation.skip_transpilation = True

from qiskit.quantum_info import SparsePauliOp
z_op = SparsePauliOp('ZZ')

with Session(service=service, backend=service_real_backend_waveform_manila) as session:
    estimator = my_runtime_estimator(session=session,options=options_manila)
    res = estimator.run(qc_pulse_gate_circuit_waveform_manila, z_op)

print(res.result())

This gives (part of the long error message):
Started server process [7]
Waiting for application startup.
Application startup complete.
--- Logging error ---
raceback (most recent call last):
File "/provider/programruntime/program_starter_wrapper.py", line 88, in execute
final_result = self.main(backend, self.messenger, **self.user_params)
File "/code/./program.py", line 1399, in main
result = estimator.run(
File "/code/./program.py", line 209, in run
transpiled_circuits = self.transpiled_circuits
File "/code/./program.py", line 392, in transpiled_circuits
self._split_transpile()
File "/code/./program.py", line 435, in _split_transpile
self._transpiled_circuits += self._combine(
File "/code/./program.py", line 449, in _combine
transpiled_circuit.compose(diff_circuit, inplace=True)
File "/opt/app-root/lib64/python3.9/site-packages/qiskit/circuit/quantumcircuit.py", line 931, in compose
raise CircuitError(
qiskit.circuit.exceptions.CircuitError: "Trying to compose with another QuantumCircuit which has more 'in' edges."

@Pauliver90 I haven't tried to get your example to work, but it seems like the problem is related to transpilation. You might try removing your skip_transpilation option or keep it but do an explicit  qiskit.transpile() call on qc_pulse_gate_circuit_waveform_manila before passing it to estimator.run(). My guess is that the estimator program is composing your input circuit with a circuit for the expectation value measurement that has been transpiled for the full number of qubits in the backend. The error seems to be related to the number of qubits not matching between the two circuits.

@tylerjones1 are you still having this issue? We just updated qpy on the server side

Hi @kt474, this issue seems resolved, my snippet runs into an unrelated error. Thanks!


Combines HardwareIO and HardwareSimulator

Allows for periodic polling of the CM730 to determine whether to simulate or use real hardware.

@Bidski (and even @MattAmos?) are we keen to update this PR or discard it?

Im guessing HardwareSimulator probably needs some updating, and webots may be a viable alternative

Yeah it sounds like Webots would be a better alternative now. 👍 To close the PR


if user session exist will show user button on nav

and will say Dashboard instead of Get Started on Home page

This is good, but I missed a button on the nav that takes you to the dashboard

@trace2798 Another thing I noticed is that when I log out from the home page, I'm immediately directed to /login. I don't think that would be the best approach. How about removing the redirection?

thx :rocket:


Error using library

I can't use any function because I receive "<googletrans.models.Translated at 0x1nnnnnnnn>" for any line
after "translator = Translator()" . Using Python 3.6.2 or 3.5.2
Is there a solution ?

I understand how to obtain the text from the object.
There is any evidence on the samples


[FR] New! App freeze easter egg is available now [Opened]

Checklist / 检查清单

[X] No one has submitted a similar or identical feature request before. / 之前没有人提交过类似或相同的功能请求。
[X] This suggestion does not depart from the original intention of Easter Eggs. / 这个建议不会背离 Easter Eggs 的初衷。

Enhancement propose / 改进目的
Easter Eggs freezing app for the aboutic is added. In Easter Eggs, or freeze was just apps still easter egg Landroid is freezer: Android 15 or Android 14. But it's not too late, was just AppControl special thanks?
This was for application freeze warned SD Maid SE issues closed: #1462
Solution / 解决方案
No response
Additional info / 额外信息
No response

SuperFreezZ just uses accessibility features to help you force stop unnecessary apps, I don't understand what I need to do.

I am not supported was just SuperFreezZ liked that delay Android 12 not support. Of course simpled: Android 12
Made close issues in #423 foundation.

If you have any questions about SuperFreezZ, please move to the SuperFreezZ repository to submit your issue.

If you have any questions about SuperFreezZ, please move to the SuperFreezZ repository to submit your issue.

Yes, we are good.


fallback to syntax if Describe throws

Codecov Report

Merging #17 into master will decrease coverage by 0.14%.
The diff coverage is 0%.

@@            Coverage Diff             @@
##           master      #17      +/-   ##
==========================================
- Coverage   79.43%   79.28%   -0.15%
==========================================
  Files           8        8
  Lines         530      531       +1
  Branches       35       42       +7
==========================================
  Hits          421      421
- Misses        109      110       +1

Impacted Files
Coverage Δ

...main/scala/ch.epfl.scala.accessible/Describe.scala
97.53% <0%> (-0.31%)
:arrow_down:

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 d3e101f...c1122c5. Read the comment docs.


Stuck in Voting Configuration settings if Activation Time is set too soon.

If I set the activation time to within a couple hours of now, then I can't hit save or exit out of the dialog.
This is very confusing as there are no warnings anywhere. This behavior either shouldn't be there, or if there is a reason for not allowing an activation time within this period, that time should just not be selectable.

Weird, cause it lets me do it.

Ah I see the issue: It's only when you set an activation time earlier in the same day.
The dialogue should either not let you set a time earlier than now, or give a warning when you do.


Fix crossOrigin for resources on same server

Hi,
Since<PHONE_NUMBER>88eed3f44a26e6116fad8ce42f2197 the module uses url as a dependency, which cause an issue since url returns null when the port is not defined. Whereas window.location.port returns an empty string ''. (https://github.com/englercj/resource-loader/blob/fb943287ccdd66a2c7055b0796b9d605b2f30874/src/Resource.js#L556)
The module used anonymous even if the resources were on the same server, which trigger a 401 error on my current project (it worked correctly with the previous version).
Thanks

Good catch!


Sync from apache/kafka (28 September 2019)

Conflicts:

.gitignore: addition of clients/src/generated-test was near
local additions for support-metrics.
checkstyle/suppressions.xml: upstream refactoring of exclusions
for generator were near the local changes for support-metrics.
gradle.properties: scala version bump caused a minor conflict
due to the kafka version change locally.
gradle/dependencies.gradle: bcpkix version bump was near avro
additions in the local version.

Committer Checklist (excluded from commit message)

[ ] Verify design and implementation
[ ] Verify test coverage and CI build status
[ ] Verify documentation (including upgrade notes)

Single unrelated flaky test failure:
kafka.server.FetchRequestDownConversionConfigTest.testV1FetchWithDownConversionDisabled
Restarted the build.

A different flaky test failure this time:
org.apache.kafka.streams.integration.TableTableJoinIntegrationTest.testLeftInner[caching enabled = true]

A different set of flaky tests failed:

org.apache.kafka.common.security.authenticator.SaslAuthenticatorTest.testValidSaslScramSha256
kafka.api.SaslGssapiSslEndToEndAuthorizationTest.testNoDescribeProduceOrConsumeWithoutTopicDescribeAcl

The downstream build succeeded this time, so will go ahead and merge.


Aria: new character sheet

Changes / Comments
This is a new character sheet for the RPG Aria by Elder Craft, released only one week ago.
I believe it has been made following all good practices.
Roll20 Requests
Comments are very helpful for reviewing the code changes. Please answer the relevant questions below in your comment.

[X] Does the pull request title have the sheet name(s)? Include each sheet name.
[ ] Is this a bug fix?
[ ] Does this add functional enhancements (new features or extending existing features) ?
[ ] Does this add or change functional aesthetics (such as layout or color scheme) ?
[ ] If changing or removing attributes, what steps have you taken, if any, to preserve player data ?
[X] If this is a new sheet, did you follow Building Character Sheets standards ?

If you do not know English. Please leave a comment in your native language.

Oh, OK, I read about that in the guidelines but I though using table for building.... actual tables would still be accepted?

Greetings @anis
We no longer accept characters sheets with layouts built in , https://roll20.zendesk.com/hc/en-us/articles/360037773453
These elements will need to be replaced to meet the require programming standards.

I'll wait for a definitive review and comply to it but I still stand my case: the requirements states that As a general standard a <table> element should only be used for tabular data which is my case.
I use two tables for... tabular data ! 😄

@anis The code standards are just fine here; as you've mentioned, you are using block elements and flexbox for layout and tables for tabular data.  This is perfectly fine.
However, another sheet for this has already been submitted, and we don't allow alternative versions of character sheets.  That sheet has been merged with this pull request: https://github.com/Roll20/roll20-character-sheets/pull/7485
If possible, could you work with the author of that sheet to determine the best way forward? (e.g. modifying and improving that sheet, or switching to this sheet if it is more fully featured and/or easier to maintain)
Thanks!

Closing this PR. If you are able to work something out with the other author, you can re-submit. If you do, please leave a comment describing the solution.

Sorry I let this PR pending.
Actually we've been in touch for weeks ago (before I opened this PR), and we agreed we were heading towards very different directions with our two sheets, and that was OK (in the sense his is kinda minimalistic while mine offers more automation for rolls and more).
He's not interested in using my sheet, I'm not interested in using his, and we don't think there's an easy opportunity to merge our works anyway.
I understand the policy of "no alternative version" (quite sad about it though) and I'll keep working on my sheet and reserve it to my own games.
Thanks.


[documentation update - easy task] easy_install is deprecated - remove from readme instructions

let's tell people to use bioconda or pip instead of easy_install.
Deprecation notice: https://setuptools.readthedocs.io/en/latest/easy_install.html
if you want to pick up this task

Take a look at the InterMine contributing guidelines
Comment on this issue stating that you intend to work on the task
When you're ready, add your work to the repo and create a pull request.

What to do if you need help
Mention @yochannah, tweet @yoyehudi, pop by to say hi on chat or if needed email<EMAIL_ADDRESS>Don't forget we're usually only available during uk office hours and will not be able to respond at other times :)

Hey! Can I take this up? :)

@Sanat-Mishra go for it!

Fixed by #57 💯


[JSONModel toJSONString] not using keyMapper

Let's assume I've got parent class
+(JSONKeyMapper*)keyMapper
{
    JSONKeyMapper *keyMapper = [JSONKeyMapper mapperFromUnderscoreCaseToCamelCase];

    return [keyMapper initWithDictionary:@{
                                           @"id" : @"objectId"
                                           }];
}

Now I would like to have raw jsonString or even dictionary using keys from keyMapper.
Now matter what I try to do I've got correct underscore names for keys BUT

@"object_id" : (int)0

instead of

id

You should never initialize Objective-C classes twice. In this case, you are doing so.
This initializes the keymapper:
JSONKeyMapper *keyMapper = [JSONKeyMapper mapperFromUnderscoreCaseToCamelCase];

Then this attempts to initialize it again. Doing this is not considered valid.
[keyMapper initWithDictionary:@{ @"id" : @"objectId" }];

What happens in this latter statement is that the instance will be entirely replaced and thus its behavior overridden. If I recall correctly, doing this can cause memory leaking or other similar issues.
There is currently no support for having layered/recursive key mapping. You could do this, however:
+ (JSONKeyMapper *)keyMapper
{
  JSONKeyMapper *baseKeyMapper = [JSONKeyMapper mapperFromUnderscoreCaseToCamelCase];

  return [JSONKeyMapper mapper:baseKeyMapper withExceptions:@{
    @"id" : @"object_id"
  }];
}

Note that the exceptions are not run after the existing "UnderscoreCaseToCamelCase" mapper. They bypass the base mapper entirely.


UI: Have an option to show X  number of last massages at the bottom/top

Not adding real value.  Hence closing it.


Product details cannot be displayed correctly

After clicking on a product and navigating to the product detail page, the product details are not correct.

Using method to get the color and size attributes in products. Now, app can show the correct color and size.

PS:
Before, the developer are tring to use data get from (http get) data in products/attributes/1/terms
That id is confused so i change another way.
Now, Related data location: product/attributes/id=1 for color,2 for size/options
But this location could directly get by http get, we have to find it in product data.


Filetype + realfile name

Adding original datafile name and treat it when os or app sends it with a "df:..." start...

Thank you! :+1:
Merging it right now so users can benefit from it and report any issues (if there are any) before I tag a new release.


SPM fails to build Shout: libssh2.h not found

On a relatively clean setup I get this error right after I embed Shout as a dep in my Package.swift:

swift build also fails with similar error.

Actually this is duplicate of issue #12. My bad I didn't look into closed issues. :( brew install libssh2 fixed the build.

I also had to reboot my computer after running brew install libssh2

Same issue ...
Any solution ?


Set up dockerfiles to run jdk/jdk

The issue of not being able to build "bleeding edge" jdk/jdk with docker came up in the OpenJ9 slack instance recently. We should look at adding suitable Dockerfiles to do this into the DockerFileCheck job.

Would this not be better suited in openjdk-build as that's where the Dockerfiles are? :-)

Done

As of #1705 , this should be fixed :-)
They were already there, just under the name jdk15, so I've just gone through and renamed it, and once jdk15 is released, we can make another set of Dockerfiles (and remove JDK14 from the DockerfileCheck job)


Future: Brave Battle Saga - The Legend of The Magic Warrior

The Steam game "Brave Battle Saga - The Legend of The Magic Warrior" is an officially translated version of the Taiwan-exclusive Mega Drive (Genesis) game "Barver Battle Saga: Tai Kong Zhan Shi"
The translated ROM is sitting in the game files.
The ROM can be found at "Steampath\steamapps\common\Brave Battle Saga - The Legend of The Magic Warrior\res".
It is the file named "game" with no extension (rename it and add the  ".md" extension to make it playable in emulators).
The MD5 is 565B679DC66DF1980927279DC20C435C and thus far NoIntro doesn't recognize it.

Merged in the Piko Interactive "issue":
https://github.com/shawngmc/game-extraction-toolbox/issues/52


[Misc] Update compressed tensors lifecycle to remove prefix from create_weights

Summary

Update compressed tensors to match the lifecycle of other quant methods for when unqunatized layers are initialized
Update when the scheme it selected to eliminate the need of prefix in create_weights

ToDo

Test against non-uniform models
Test against config with multiple config groups

/ready


fix(deps): update github-releases dependency mozilla/sops to v3.7.2

This PR contains the following updates:

Package
Update
Change

mozilla/sops
patch
3.7.1 -> 3.7.2

Release Notes

mozilla/sops
v3.7.2
Compare Source
Changes:

README updates (#861, #860)
Various test fixes (#909, #906, #1008)
Added Linux and Darwin arm64 releases (#911, #891)
Upgrade to go v1.17 (#1012)
Support SOPS_AGE_KEY environment variable (#1006)

Bug fixes:

Make sure comments in yaml files are not duplicated (#866)
Make sure configuration file paths work correctly relative to the config file in us (#853)

Configuration
📅 Schedule: At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.

[ ] If you want to rebase/retry this PR, click this checkbox.

This PR has been generated by Renovate Bot.

:tada: This PR is included in version 1.0.0 :tada:
The release is available on:

GitHub release
v1.0.0

Your semantic-release bot :package::rocket:


Safari 16.4 preventOutline / tests not working anymore

The new Safari version 16.4, released on 27.03, breaks the preventOutline test. currentcolor is returned instead of none :

I tried to test it with BrowserStack but they have only version 16.3.
Rlease notes: https://developer.apple.com/documentation/safari-release-notes/safari-16_4-release-notes
In MDN Docs I found:

We should also test if something has changed for the user.

Let me take a look at this, I have a Macbook collecting dust in the corner for just this reason.


ecl_navigation: 0.60.1-1 in 'indigo/distribution.yaml' [bloom]

Increasing version of package(s) in repository ecl_navigation to 0.60.1-1:

upstream repository: https://github.com/stonier/ecl_navigation.git
release repository: https://github.com/yujinrobot-release/ecl_navigation-release.git
distro file: indigo/distribution.yaml
bloom version: 0.5.20
previous version for package: 0.60.0-1

The doc job is now failing: http://build.ros.org/job/Idoc__ecl_navigation__ubuntu_trusty_amd64/7/console It looks like you changed the branch names recently. Please fix the doc and source entry.


Shouldn't ids:RequestMessage document its fields properly in the overview?

ids:RequestMessage is the basis for many other messages
Still the fields are not listed here:
https://github.com/International-Data-Spaces-Association/IDS-G/blob/main/Communication/Message-Types/README.md#idsrequestmessage
I would expect the fields like:
'@id', 'ids:securityToken' and more...
Any reason for this?
Same for https://github.com/International-Data-Spaces-Association/IDS-G/blob/main/Communication/Message-Types/README.md#idsresponsemessage
Thanks,
Matthias B.

Maybe the minimal documentation could be a link to this one here:
https://github.com/International-Data-Spaces-Association/IDS-G/tree/main/Communication/Message-Structure#idsmessage-properties


Optimized @condition decorator a bit.

This removes unnecessary get_last_modified() hook.

@David-Wobrock Thanks for checking :+1:


Implement custom locations for classes

Closes #46.

Thank you for your contribution @mathchu3!

Thank you, @mathchu3!


Issue in incremental linker

Start with (post #4334)
package helloworld

import scala.scalajs.js
import js.annotation._

trait A extends js.Any {
  def foo(x: js.UndefOr[Int] = js.undefined): Int
}

object Impl extends js.Object with A {
  def foo(x: js.UndefOr[Int]): Int = x.getOrElse(5)
}

object HelloWorld {
  def main(args: Array[String]): Unit = {
    println(Impl.foo())
  }
}

Prepare the following diff:
 }

 object Impl extends js.Object with A {
-  def foo(x: js.UndefOr[Int]): Int = x.getOrElse(5)
+  def foo(x: js.UndefOr[Int] = 6): Int = x.getOrElse(5)
 }

 object HelloWorld {

Run:
$  sbt
sbt:Scala.js> helloworld2_12/run
[info] Running helloworld.HelloWorld. Hit any key to interrupt.
5
// Apply change
sbt:Scala.js> helloworld2_12/run
[info] Compiling 1 Scala source to scala-js/examples/helloworld/.2.12/target/scala-2.12/classes ...
[info] Done compiling.
[info] Fast optimizing scala-js/examples/helloworld/.2.12/target/scala-2.12/helloworld-fastopt
[info] Running helloworld.HelloWorld. Hit any key to interrupt.
scala-js/examples/helloworld/.2.12/target/scala-2.12/helloworld-fastopt/main.js:1260
        var prep0 = ((rest[0] === (void 0)) ? $s_Lhelloworld_Impl$__foo$default$1__Lhelloworld_Impl$__sjs_js_$bar(this) : rest[0]);
                              ^

ReferenceError: $s_Lhelloworld_Impl$__foo$default$1__Lhelloworld_Impl$__sjs_js_$bar is not defined
    at $b_Lhelloworld_Impl$.foo (scala-js/examples/helloworld/src/main/scala/helloworld/HelloWorld.scala:16:7)
    at $c_Lhelloworld_HelloWorld$.main__AT__V (scala-js/examples/helloworld/src/main/scala/helloworld/HelloWorld.scala:21:21)
    at $s_Lhelloworld_HelloWorld__main__AT__V (scala-js/examples/helloworld/src/main/scala/helloworld/HelloWorld.scala:19:8)
    at scala-js/examples/helloworld/.2.12/target/scala-2.12/helloworld-fastopt/main.js:1827:1
    at scala-js/examples/helloworld/.2.12/target/scala-2.12/helloworld-fastopt/main.js:1828:4
    at Script.runInThisContext (vm.js:132:18)
    at Object.runInThisContext (vm.js:315:38)
    at [stdin]:8:25
    at Script.runInThisContext (vm.js:132:18)
    at Object.runInThisContext (vm.js:315:38)

Restarting sbt and deleting only the produced JS (no code is recompiled) produces the expected:
 $ sbt
sbt:Scala.js> helloworld2_12/run
[info] Fast optimizing scala-js/examples/helloworld/.2.12/target/scala-2.12/helloworld-fastopt
[info] Running helloworld.HelloWorld. Hit any key to interrupt.
6
[success] Total time: 6 s, completed Dec 16, 2020, 4:44:25 PM

Disabling the optimizer makes the issue go away.

I am starting to write a testbed for this. The problem only seems to occur if the static method is called from a JS method. I suspect that the optimizer wrongly removes a method if it doesn't see a call to it (because it doesn't optimizer JS methods).

The problem appears to be in the Info caching in the Refiner: If I replace caches(i).getInfo(member) in the following snippet with an uncached version, the problem vanishes.
https://github.com/scala-js/scala-js/blob/a27c22bc0bf15a84b14745231815ea0a4a12c90f/linker/shared/src/main/scala/org/scalajs/linker/frontend/Refiner.scala#L254-L270


DEP PHP Support in CMS5

Parent issue

https://github.com/silverstripe/silverstripe-framework/issues/10402

Requires

https://github.com/silverstripe/cwp-search/pull/51
https://github.com/silverstripe/cwp-core/pull/114


How can I access the Solution Version Number so i can display it in my app?

[Enter feedback here]

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

ID: 69679340-d7cb-4a95-b2da-7b09377baaa8
Version Independent ID: 11469a16-835d-ebb6-2285-4f9d41a7235b
Content: Managing Project and Solution Properties - Visual Studio for Mac
Content Source: mac/managing-solutions-and-project-properties.md
Product: visual-studio-mac
Technology: vs-ide-general
GitHub Login: @heiligerdankgesang
Microsoft Alias: dominicn

@bitwisesys -- thank you for your question.  Please consider these resources:

Visual Studio on Q&A
Visual Studio MSDN Forum
Stack Overflow
Reddit

@heiligerdankgesang -- please look into this issue.


What is Overview for?

What is the Overview tab for?
It just has the date.
This is probably low priority, but just wondering?
You could also add the date to MyDay and have that be the default view?

Hi @RobotXLabs,
The overview feature has not been completed yet. It will eventually contain information about your upcoming assignments, and possibly your schedule. PlanHub is also in a public beta phase, and is in no means a finished project. If you have any ideas about what content can go on the overview page, you can tell us by replying to this issue or clicking the lightbulb button in the PlanHub app.
As for MyDay, that could be possible once MyDay is finished.
Thanks for your feedback!

Also @nywillb this is me (c22am)

@RobotXLabs I know, I looked at your profile and saw back to drive.


fix: Add nullability annotations to some properties not set in constructor

This will let ngx-codemirror work fine for applications compiling in
strict mode. Optional is used for _differ and codeMirror which already
have guards around usage. ref is asserted to be non-null since it's set
by ElementRef.

:tada: This PR is included in version 3.1.3 :tada:
The release is available on:

npm package (@latest dist-tag)
GitHub release

Your semantic-release bot :package::rocket:


Cannot use GPU when output.shape[1] * nnz(a) > 2^31

When I use the gcn layer, I always meets this problem.
InvalidArgumentError: 2 root error(s) found.
(0) Invalid argument: Cannot use GPU when output.shape[1] * nnz(a) > 2^31
[[node graph_convolution_23/SparseTensorDenseMatMul/SparseTensorDenseMatMul (defined at /home/labadmin/anaconda2/lib/python2.7/site-packages/keras/backend/tensorflow_backend.py:1083) ]]
[[loss_3/add_2/_677]]
(1) Invalid argument: Cannot use GPU when output.shape[1] * nnz(a) > 2^31
[[node graph_convolution_23/SparseTensorDenseMatMul/SparseTensorDenseMatMul (defined at /home/labadmin/anaconda2/lib/python2.7/site-packages/keras/backend/tensorflow_backend.py:1083) ]]
0 successful operations.
0 derived errors ignored.

I meet this problem too ！

hello, do you solve it? can you share your method? thanks

No

You can run your code on CPU.
------------------ 原始邮件 ------------------
发件人<EMAIL_ADDRESS>发送时间: 2019年12月14日(星期六) 中午11:06
收件人<EMAIL_ADDRESS>抄送: "kui"<1548366814<EMAIL_ADDRESS>主题: Re: [tkipf/keras-gcn] Cannot use GPU when output.shape[1] * nnz(a) > 2^31 (#51)
hello, do you solve it? can you share your method? thanks
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

Is there any solution on this issue?

@innekemayachita Have you found anything maybe?

You can cast the sparse matrix to dense matrix and use tf.matmul

Same problem here.

You can cast the sparse matrix to dense matrix and use tf.matmul
But if we have a large matrix with most of zero, we would like to use sparse matrix, so shouldn't cast to dense matrix

I had this problem on tensorflow 2.4.1, it went away when I upgraded to 2.5 + cuda lib v11; I don't know if the trouble was with the tensorflow version, cuda, or both.


Broken again (Upping a service after forcefully removing not longer works #3037)

Removing of Stack Name is broken again in Rancher v0.51.0 and Rancher Compose v0.7.0.
Original issue #3037.
Workaround mentioned in #3037 still valid.

The issue in #3037 was that if you had an old service that was removed but still in your DB, adding a service with the same name was throwing the "notunique" error.
Can you provide the rancher-compose error that you see this time?

@dsvmacdonald Closing this issue as I haven't heard back. If you are still having issues, can you provide more information and re-open?


Monitor mirrormaker connectedness, not uptime

We're now monitoring MirrorMaker hearbeat, which is the best proxy I could find for "is mirrormaker connected".
It's still not perfect, though -- if MM is connected, but the firewall rule is changed to disallow new TCP connections, and one then selectively kills one of the many mirrormaker TCP connections, unless it's the connection on which the heartbeats are sent/received, this metric won't notice the degradation.


Mention 'json-streamer' as alternative?

Hi David,
I'm the developer of the json-streamer gem which is based on your implementation. It spares the need to create your own callbacks for parsing (such as start_document, end_document, key, value, etc.). I think it's worth a mention as an alternative. Let me know what you think.
Thanks,
Csaba

looks awesome in that it fills exactly my use case: it can replace the simple parse i had to write using son-stream's callbacks!

Neat gem! I'd like to keep the list of alternatives to full JSON parsers, though. The json-streamer gem is a specialized filtering parser, rather than a drop-in replacement for full JSON parsing.

It can easily be used as a drop-in replacement the following way: streamer.get(nesting_level:0)
There's a note of this in the README but I can also highlight this feature if that's the only reason keeping you.
Either way my reason for asking is to help out others who stumble upon the same issue that I did (hence the gem) and I think this thread can attest that they would find it helpful - even if it involves some amount of clarification about the differences. In light of this would you reconsider?


kuro: init at 8.1.8

Description of changes
kuro: init at 8.1.8

Things done

Built on platform(s)

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

[ ] For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
[x] 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

[x] 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.05 Release Notes (or backporting 22.11 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
[ ] (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes

[x] Fits CONTRIBUTING.md.

Previously, because of some misunderstandings about the use input-methods on electron apps  on nixos, multiple force pushes were performed
Now this pull request is ready for review!

Kuro has been updated to 9.0.0, So I have updated it to latest version.
This package ready for review.


setTurbolinksIsReady launch a vistit

I found that after a cold boot, it call a setTurbolinksIsReady
https://github.com/turbolinks/turbolinks-android/blob/79bb46cb9d942909288b7632a50beafc50aab97c/turbolinks/src/main/assets/js/turbolinks_bridge.js#L6
Then call a visitCurrentLocationWithTurbolinks in setTurbolinksIsReady
https://github.com/turbolinks/turbolinks-android/blob/79bb46cb9d942909288b7632a50beafc50aab97c/turbolinks/src/main/java/com/basecamp/turbolinks/TurbolinksSession.java#L562
It cause two problem:

After app boot, it visit same url twice, for example:

08-24 00:06:16.208 32063-32063/org.ruby_china.rubychina D/TurbolinksLog: visit called
08-24 00:06:16.211 32063-32063/org.ruby_china.rubychina D/TurbolinksLog: TurbolinksSession background: null
08-24 00:06:16.212 32063-32063/org.ruby_china.rubychina D/TurbolinksLog: showProgress called
08-24 00:06:16.212 32063-32063/org.ruby_china.rubychina D/TurbolinksLog: Cold booting: http://<IP_ADDRESS>:3000/topics
08-24 00:06:16.235 32063-32063/org.ruby_china.rubychina I/cr_Ime: ImeThread is not enabled.
08-24 00:06:16.277 32063-32131/org.ruby_china.rubychina D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
08-24 00:06:16.365 32063-32131/org.ruby_china.rubychina I/OpenGLRenderer: Initialized EGL, version 1.4
08-24 00:06:16.423 32063-32143/org.ruby_china.rubychina E/libEGL: validate_display:255 error 3008 (EGL_BAD_DISPLAY)
08-24 00:06:16.495 32063-32143/org.ruby_china.rubychina W/VideoCapabilities: Unrecognized profile<PHONE_NUMBER> for video/avc
08-24 00:06:16.528 32063-32143/org.ruby_china.rubychina I/VideoCapabilities: Unsupported profile 4 for video/mp4v-es
08-24 00:06:18.524 32063-32063/org.ruby_china.rubychina W/cr_BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid: 32063
08-24 00:06:21.999 32063-32063/org.ruby_china.rubychina I/chromium: [INFO:CONSOLE(48)] "Desktop notifications are not supported for this Browser/OS version yet.", source: http://<IP_ADDRESS>:3000/assets/notifier.self.js?body=1 (48)
08-24 00:06:22.148 32063-32063/org.ruby_china.rubychina W/cr_BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid: 32063
08-24 00:06:22.318 32063-32063/org.ruby_china.rubychina D/TurbolinksLog: Bridge injected
08-24 00:06:22.796 32063-32063/org.ruby_china.rubychina D/TurbolinksLog: TurbolinksSession is ready
08-24 00:06:22.797 32063-32063/org.ruby_china.rubychina D/TurbolinksLog: Visiting current stored location: http://<IP_ADDRESS>:3000/topics
08-24 00:06:22.848 32063-32249/org.ruby_china.rubychina D/TurbolinksLog: visitStarted called
08-24 00:06:22.865 32063-32063/org.ruby_china.rubychina W/cr_BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid: 32063
08-24 00:06:23.816 32063-32063/org.ruby_china.rubychina I/chromium: [INFO:CONSOLE(238)] "WebSocket connection to 'ws://<IP_ADDRESS>:3000/cable' failed: Error during WebSocket handshake: Unexpected response code: 404", source: http://<IP_ADDRESS>:3000/assets/action_cable.self.js?body=1 (238)
08-24 00:06:23.868 32063-32249/org.ruby_china.rubychina D/TurbolinksLog: visitRequestCompleted called
08-24 00:06:23.953 32063-32249/org.ruby_china.rubychina D/TurbolinksLog: visitCompleted called
08-24 00:06:24.032 32063-32249/org.ruby_china.rubychina D/TurbolinksLog: visitRendered called, hiding progress view for identifier: 9e2d5a05-07cb-45b1-ae2b-78b9227ba58d
08-24 00:06:24.044 32063-32063/org.ruby_china.rubychina D/TurbolinksLog: Hiding progress view for visitIdentifier: 9e2d5a05-07cb-45b1-ae2b-78b9227ba58d, currentVisitIdentifier: 9e2d5a05-07cb-45b1-ae2b-78b9227ba58d
08-24 00:06:24.045 32063-32063/org.ruby_china.rubychina D/TurbolinksLog: Progress view removed

After submit form via http and render a new page, it revisit location before submit.

Is it an expected behavior? And should I submit all form via xhr?

Hi, you're correct re: the sequence of calls and the double hit on the first URL. This isn't ideal but it was a tradeoff we made to keep the flow control simpler.
What we found was that by piping all visits through TL (even the first cold boot URL) it significantly simplified the checks needed to check for the state of the webview, when to hide progress views, etc.
It's my least favorite part of the code, but it's proven to be the most stable.
Re: forms, submitting via XHR/remotely should do the trick.
Thanks!

Please reopen this issue .... @lateplate

Happy to reopen, but wondering to what end? It's a fairly deep, integral part of the code base, and unlikely something we will be addressing. If there is a pull request or more discussion, we can keep it going in there.

I appreciate this library is deprecated but - my 2c - the double loading introduces complications when you wish to open a TB webview using an OAuth single use code. The request will fail the second time as the code no longer exists.


Remove fontenc

With fontenc I got problems displaying the german letter eszett (ß). Umlauts worked fine, but ß got shown as SS. It turns out that fontenc is not recommended for use with XeTeX, see for example http://tex.stackexchange.com/a/44701 and http://tex.stackexchange.com/questions/317382/how-to-change-the-fonts-of-this-document.
I've also removed the configure font section, everything seems to work well out of the box.
Includes a small debug chapter to show the problem.

@axitdn seems to have related problems with Vietnamese, https://github.com/softcover/softcover/pull/172

Completely remove the fontenc package.
Use the fontspec instead.
Remove the Configure fonts section.
Un-comment the line \usepackage{polyglossia} in the preamble.tex file.

This really saved my day.

Thanks for the heads-up. The kind of change you're proposing makes me
very nervous—messing
with fonts in a part of the system that's been stable for years is easily
the kind of thing that could massively break existing documents.
And indeed, I've confirmed that replacing fontenc with fontspec completely
changes the fonts in several of the tutorials I maintain. Would it be
possible to get everything to work with fontspec as well? Probably, but
given that everything is working on my end doing so is way, way down in my
priority queue.
I'm open to pull requests in this direction, but only if the preservation
of existing fonts has been thoroughly tested. In particular, I would want
to see The Softcover Book source
https://github.com/softcover/softcover_book built to PDF using both the
current system and the proposed updated system, carefully compared to
ensure that there are no significant diffs in appearance.
A simpler solution to the eszett (ß) problem reported by Matthias Berth is
to define a new Unicode command in latex_styles/custom_pdf.sty (as described
http://manual.softcover.io/book/customization#sec-pdf_style in the
Softcover manual):
\newunicodechar{ß}{\ss}
With that definition, the eszett should display properly in PDF documents.
(My apologies to Matthias for not answering this question earlier.)
Hope this helps,
Michael
On Sat, Mar 4, 2017 at 6:46 AM, samdx<EMAIL_ADDRESS>wrote:

Completely remove the fontenc package.
Use the fontspec instead.
Remove the Configure fonts section.
Un-comment the line \usepackage{polyglossia} in the preamble.tex
file.

This really saved my day.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/softcover/softcover/pull/178#issuecomment-284155771,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAAYWK3q6zT_18hxQ8S5NA6qdF5gPhquks5riXk9gaJpZM4MGaD5
.

--
Michael Hartl
michaelhartl.com

Confirm: The book has been built successfully after those changes has been made in Softcover.
Both of build:{pdf,html,mobi,epub,all} provided the outpout files without any error occurred. Except for the pdf build progress, it seems that there are too much overfull hbox warning from build log.

Thanks for the PR. As you can see from the attached before and after screenshots, the resulting PDF documents differ substantially in their fonts. I'd prefer to avoid accepting pull requests that don't preserve the current fonts (almost) exactly.


Add enrichment metadata

This adds two different implementations for getting log enrichment metadata from OneAgent. One requires the Go code module be injected (but doesn't require use of cgo); the other does not require the Go code module be injected, but requires use of cgo on Linux.

I did not add an example for the new functionality, because I don't think it would add any value. Let me know if you want me to add one anyway.
We need to improve the documentation with regards to required OneAgent versions. As soon as we have more than one feature, "the SDK" doesn't require a particular OneAgent version, but "feature A" and "feature B" may require different ones.
Should all functions be documented in the README as well as the source code? Since documentation will be generated automatically on pkg.go.dev for the module, I suggest we put as much documentation as possible in source code instead of the readme (and link to pkg.go.dev from the latter).

ONE-75361

Ad 1:
To be consistent I would add an example. Also consider to provide a minimal docker file which sets up gcc to be able to build an app on Linux which requires cgo.
Ad 2:
Yes, the native/enrichment API would also work with older OneAgent versions and is independent of the Go SDK API instrumented by the Go agent. I propose to add the required OneAgent version to the function/package documentation.
Ad 3:
That's something we should discuss with @z1c0, because this would not match with the documentation guidelines of other agent SDKs. However, as you said pkg.go.dev generates nice documentation of the API automatically which is what Go developers usually expect.

Consistent with the one thing that already exists, I don't see the value in that. We already link to documentation that shows how the returned values can be used, so a minimal example would probably consist of printing a map...
My thoughts exactly.
We should definitely stick with what's common for Go libraries, not try and conform to some arbitrary guidelines just for the sake of being consistent with completely unrelated SDKs.

@z1c0 to add this functionality to the Go SDK was discussed with our PM and LPE. This mechanism is only necessary for Golang, because the approach of the process agent to provide the magic file works out of the box for other technologies, please see ONE-75361 for more details.
I was not aware of https://github.com/Dynatrace/OneAgent-SDK, or forgot about it... should we add a specification despite the fact that this is only necessary for Golang?

However, I would still appreciate a brief mention of the feature in the README for sake of consistency with other OneAgent SDKs.

Sure, we'll add that in a separate PR when we overhaul the documentation.


Update Date::setOptions() -> fix phpdoc

@return Options is invalid (no such class etc).
Method either returns an array or void.
Zend Framework 1 reaches its End of Life (EOL) and is no longer maintained.
No Pull Requests will be accepted.
https://framework.zend.com/blog/2016-06-28-zf1-eol.html

I understand the change from Options to array since it isn't an Options instance. But why the void, as far as I can tell void is impossible to get as a return here? The instance variable $_options is a private static array which doesn't change and that's the only return condition for the function?

Hi - looking at https://github.com/Shardj/zf1-future/blob/e9f3dd85a7b89aa287a6cbff52301ce182d5689c/library/Zend/Date.php#L238

If the $options parameter is empty, the method returns self::$_options (array)
If the $options parameter is non-empty, then no return is reached - so presumably it is accurate to say 'void'?

Sorry you're absolutely right, I wasn't looking properly the first time

Thank you :)


Using OpenAI Latest Embeddings In A RAG System With MongoDB

Summary
Briefly describe the changes and the goal of this PR. Make sure the PR title summarizes the changes effectively.
Motivation
Why are these changes necessary? How do they improve the cookbook?
The primary motivation behind these updates is to stay up to date with the latest OpenAI developments and harness the improved performance and efficiency offered by OpenAI's new embedding models. By integrating these embeddings into our RAG system, we aim to achieve:

Enhanced accuracy in text embeddings, leading to more relevant and precise retrievals in the RAG system.
Showcase the MongoDB's movies dataset for proof of concept RAG demos
Exploration of the expanded capabilities of OpenAI's models in diverse use-cases.

For new content
When contributing new content, read through our contribution guidelines, and mark the following action items as completed:

[x] I have added a new entry in registry.yaml (and, optionally, in authors.yaml) so that my content renders on the cookbook website.
[x] I have conducted a self-review of my content based on the contribution guidelines:

[x] Relevance: This content is related to building with OpenAI technologies and is useful to others.
[x] Uniqueness: I have searched for related examples in the OpenAI Cookbook, and verified that my content offers new insights or unique information compared to existing documentation.
[x] Spelling and Grammar: I have checked for spelling or grammatical mistakes.
[x] Clarity: I have done a final read-through and verified that my submission is well-organized and easy to understand.
[x] Correctness: The information I include is correct and all of my code executes successfully.
[x] Completeness: I have explained everything fully, including all necessary references and citations.

We will rate each of these areas on a scale from 1 to 4, and will only accept contributions that score 3 or higher on all areas. Refer to our contribution guidelines for more details.

@simonpfish can you please review this?


Alternative for using ValueChoice as a boolean

Describe the issue:
Hello there,
Here I am trying to define a search space using nni v2.7 and I came across a concern.
It happened multiple times that I wanted to define mutations using a ValueChoice object and followingly using it in an if-else-clause. This throws an error every time, saying this is not the intended use of ValueChoice.
One simplified example would be the choice of using BatchNormalization; I attempted:
'''
bn_choice = nn.ValueChoice([0,1], label="bn_choice")
if bn_choice==1:
self.bn = nn.BatchNorm2d(128)
'''
in init
and
'''
if self.bn:
x = self.bn(x)
'''
in forward
Is there an alternative way to define this?
Thanks in advance!
Environment:

NNI version:
Training service (local|remote|pai|aml|etc):
Client OS:
Server OS (for remote mode only):
Python version:
PyTorch/TensorFlow version:
Is conda/virtualenv/venv used?:
Is running in Docker?:

Configuration:

Experiment config (remember to remove secrets!):
Search space:

Log message:

nnimanager.log:
dispatcher.log:
nnictl stdout and stderr:

How to reproduce it?:

Thanks for the quick reply!
Using the condition to turn a ValueChoice Object to a bool object throws an error: keyword can't be an expression.
Using LayerChoice works for one layer, but it does not seem to work as a decision for multiple layers. What I mean is, that I want a binary choice which decides for multiple layers in the network if it will use BatchNorm or Identity. So I thought to try using the same label:
self.layer3 = nn.LayerChoice([nn.BatchNorm2d(64),nn.Identity()], label="bn_choice")
self.layer6 = nn.LayerChoice([nn.BatchNorm2d(128),nn.Identity()], label="bn_choice")
but when test running experiments the trials fail immediately...
Any other ideas?

keyword can't be an expression.

I need more traceback on this error.

but when test running experiments the trials fail immediately...

I need stderr and trial's log for the failed trials.

and later using bool_bn_choice in if-else still throws:

You should never use if-else branch. ValueChoice.condition works like tf.cond. You need to write something like:
branch_a = nn.Sequential(..., ...)
branch_b = nn.Sequential(..., ..., BN)
self.block = nn.ValueChoice.condition(nn.ValueChoice([False, True], branch_a, branch_b)

I don't know whether putting modules into nn.ValueChoice.condition works, but you can try.

RuntimeError: only batches of spatial targets supported (3D tensors) but got targets of dimension: 1

Your output is a one-dimensional tensor, but you are trying to use pl.Classification, if my guess is correct. Classification doesn't work like this.

Are there any larger examples (with more variety in possibilities of how to use different mutator functions) for search spaces than the example notebooks?

There is a space hub here. But it's in a preview state.

Thanks for all the help.
Trying to use it like this:
branch_a = nn.Sequential(nn.Conv2d(64, 128, 3, stride=1,padding=1),nn.ReLU(),nn.MaxPool2d(2, 2))
branch_b = nn.Sequential(nn.Conv2d(64, 128, 3, stride=1,padding=1),nn.ReLU(),nn.BatchNorm2d(128),nn.MaxPool2d(2, 2))
self.block = nn.ValueChoice.condition(nn.ValueChoice([False, True], branch_a, branch_b))
throws:
TypeError                                 Traceback (most recent call last)
 in
119
120
--> 121 model = Net()
~/opt/anaconda3/lib/python3.7/site-packages/nni/retiarii/serializer.py in init(self, *args, **kwargs)
123             self._model_namespace = ModelNamespace()
124             with self._model_namespace:
--> 125                 super().init(*args, **kwargs)
126
127     _copy_class_wrapper_attributes(wrapper, reset_wrapper)
~/opt/anaconda3/lib/python3.7/site-packages/nni/common/serializer.py in new_init(self, *args, **kwargs)
429                     self,
430                     *[_argument_processor(arg) for arg in args],
--> 431                     **{kw: _argument_processor(arg) for kw, arg in kwargs.items()}
432                 )
433                 inject_trace_info(self, base, args, kwargs)
 in init(self)
104         branch_a = nn.Sequential(nn.Conv2d(64, 128, 3, stride=1,padding=1),nn.ReLU(),nn.MaxPool2d(2, 2))
105         branch_b = nn.Sequential(nn.Conv2d(64, 128, 3, stride=1,padding=1),nn.ReLU(),nn.BatchNorm2d(128),nn.MaxPool2d(2, 2))
--> 106         self.block = nn.ValueChoice.condition(nn.ValueChoice([False, True], branch_a, branch_b))
107         self.conv1 = nn.Conv2d(3, 64, 3, stride=1,padding=1)
108         self.conv2 = nn.Conv2d(128, 256, 3, stride=1,padding=1)
~/opt/anaconda3/lib/python3.7/site-packages/nni/retiarii/nn/pytorch/mutation_utils.py in new(cls, *args, **kwargs)
22
23         try:
---> 24             return cls.create_fixed_module(*args, **kwargs)
25         except NoContextError:
26             return super().new(cls)
TypeError: create_fixed_module() takes 2 positional arguments but 4 were given
Another related question:
I am aware that in the documentation for ValueChoice it is specified that you can not use it in a for i in range(ValueChoice) way because it is a 'syntax sugar'. Is there an alternative to this?
Specifically I want the search space to have a number of blocks to choose from (like in ResNets or NasNet) but use different number and sequences of them. A way I thought I could make that happen is by using for i in range(ValueChoice[1,2,3,4]) and then add blocks accordingly... Is there a way to achieve what I just described?
PS: Are there any large search spaces already defined for CIFAR-10 I could use (with the TPE strategy)?

Also, do you have any idea why this model:
class ReLUConvBN(nn.Sequential):
def init(self, in_size, out_size, kernel_size, stride, padding):
super().init(
nn.ReLU(),
nn.Conv2d(in_size, out_size, kernel_size, stride=stride,padding=padding),
nn.BatchNorm2d(out_size))
class ReLUConv(nn.Sequential):
def init(self, in_size, out_size, kernel_size, stride, padding):
super().init(
nn.ReLU(),
nn.Conv2d(in_size, out_size, kernel_size, stride=stride,padding=padding))
@model_wrapper
class Net(nn.Module):
def init(self):
super().init()
    self.block = nn.LayerChoice([ReLUConvBN(64,128,3,1,1),ReLUConv(64,128,3,1,1)])
    self.conv1 = nn.Conv2d(3, 64, 3, stride=1,padding=1)
    self.conv2 = nn.Conv2d(128, 256, 3, stride=1,padding=1)
    self.pool = nn.MaxPool2d(2, 2)
    self.fc1 = nn.Linear(256*8*8,120)
    self.fc2 = nn.Linear(120,10)

def forward(self, x):
    x = F.relu(self.conv1(x))
    x = self.pool(x)
    x = self.block(x)
    x = self.pool(x)
    x = F.relu(self.conv2(x))
    x = self.fc1(x)
    x = self.fc2(x)
    return x

model = Net()
throws this error in stderr:
/Users/simonhuesgen/opt/anaconda3/lib/python3.7/site-packages/pytorch_lightning/trainer/data_loading.py:133: UserWarning: The dataloader, val_dataloader 0, does not have many workers which may be a bottleneck. Consider increasing the value of the num_workers argument(try 8 which is the number of cpus on this machine) in theDataLoader` init to improve performance.
f"The dataloader, {name}, does not have many workers which may be a bottleneck."
Traceback (most recent call last):
File "/Users/simonhuesgen/opt/anaconda3/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/Users/simonhuesgen/opt/anaconda3/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/Users/simonhuesgen/opt/anaconda3/lib/python3.7/site-packages/nni/retiarii/trial_entry.py", line 28, in
engine.trial_execute_graph()
File "/Users/simonhuesgen/opt/anaconda3/lib/python3.7/site-packages/nni/retiarii/execution/base.py", line 146, in trial_execute_graph
graph_data.evaluator._execute(model_cls)
File "/Users/simonhuesgen/opt/anaconda3/lib/python3.7/site-packages/nni/retiarii/evaluator/pytorch/lightning.py", line 119, in _execute
return self.fit(model_cls)
File "/Users/simonhuesgen/opt/anaconda3/lib/python3.7/site-packages/nni/retiarii/evaluator/pytorch/lightning.py", line 148, in fit
return self.trainer.fit(self.module, self.train_dataloader, self.val_dataloaders)
File "/Users/simonhuesgen/opt/anaconda3/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py", line 741, in fit
self._fit_impl, model, train_dataloaders, val_dataloaders, datamodule, ckpt_path
File "/Users/simonhuesgen/opt/anaconda3/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py", line 685, in _call_and_handle_interrupt
return trainer_fn(*args, **kwargs)
File "/Users/simonhuesgen/opt/anaconda3/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py", line 777, in _fit_impl
self._run(model, ckpt_path=ckpt_path)
File "/Users/simonhuesgen/opt/anaconda3/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py", line 1199, in _run
self._dispatch()
File "/Users/simonhuesgen/opt/anaconda3/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py", line 1279, in _dispatch
self.training_type_plugin.start_training(self)
File "/Users/simonhuesgen/opt/anaconda3/lib/python3.7/site-packages/pytorch_lightning/plugins/training_type/training_type_plugin.py", line 202, in start_training
self._results = trainer.run_stage()
File "/Users/simonhuesgen/opt/anaconda3/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py", line 1289, in run_stage
return self._run_train()
File "/Users/simonhuesgen/opt/anaconda3/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py", line 1311, in _run_train
self._run_sanity_check(self.lightning_module)
File "/Users/simonhuesgen/opt/anaconda3/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py", line 1375, in _run_sanity_check
self._evaluation_loop.run()
File "/Users/simonhuesgen/opt/anaconda3/lib/python3.7/site-packages/pytorch_lightning/loops/base.py", line 145, in run
self.advance(*args, **kwargs)
File "/Users/simonhuesgen/opt/anaconda3/lib/python3.7/site-packages/pytorch_lightning/loops/dataloader/evaluation_loop.py", line 110, in advance
dl_outputs = self.epoch_loop.run(dataloader, dataloader_idx, dl_max_batches, self.num_dataloaders)
File "/Users/simonhuesgen/opt/anaconda3/lib/python3.7/site-packages/pytorch_lightning/loops/base.py", line 145, in run
self.advance(*args, **kwargs)
File "/Users/simonhuesgen/opt/anaconda3/lib/python3.7/site-packages/pytorch_lightning/loops/epoch/evaluation_epoch_loop.py", line 122, in advance
output = self._evaluation_step(batch, batch_idx, dataloader_idx)
File "/Users/simonhuesgen/opt/anaconda3/lib/python3.7/site-packages/pytorch_lightning/loops/epoch/evaluation_epoch_loop.py", line 217, in _evaluation_step
output = self.trainer.accelerator.validation_step(step_kwargs)
File "/Users/simonhuesgen/opt/anaconda3/lib/python3.7/site-packages/pytorch_lightning/accelerators/accelerator.py", line 239, in validation_step
return self.training_type_plugin.validation_step(*step_kwargs.values())
File "/Users/simonhuesgen/opt/anaconda3/lib/python3.7/site-packages/pytorch_lightning/plugins/training_type/training_type_plugin.py", line 219, in validation_step
return self.model.validation_step(*args, **kwargs)
File "/Users/simonhuesgen/opt/anaconda3/lib/python3.7/site-packages/nni/retiarii/evaluator/pytorch/lightning.py", line 196, in validation_step
y_hat = self(x)
File "/Users/simonhuesgen/opt/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl
return forward_call(*input, **kwargs)
File "/Users/simonhuesgen/opt/anaconda3/lib/python3.7/site-packages/nni/retiarii/evaluator/pytorch/lightning.py", line 182, in forward
y_hat = self.model(x)
File "/Users/simonhuesgen/opt/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl
return forward_call(*input, **kwargs)
File "/Users/simonhuesgen/thesis/_generated_model/1HV7IN.py", line 73, in forward
_fc1 = self._fc1(_relu15)
File "/Users/simonhuesgen/opt/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl
return forward_call(*input, **kwargs)
File "/Users/simonhuesgen/opt/anaconda3/lib/python3.7/site-packages/torch/nn/modules/linear.py", line 103, in forward
return F.linear(input, self.weight, self.bias)
RuntimeError: mat1 and mat2 shapes cannot be multiplied (262144x8 and 16384x120)
I checked multiple times and cannot find out why it should end in different matrix shapes...

Your traceback looks awful. I can barely read. Could you wrap it with markdown syntax?

I'm sorry this is embarrassing. How do I do that?

Your traceback looks awful. I can barely read. Could you wrap it with markdown syntax?

Hope it is better now

nn.ValueChoice.condition(nn.ValueChoice([False, True], branch_a, branch_b))

Probably it should be nn.ValueChoice.condition(nn.ValueChoice([False, True]), branch_a, branch_b)
if kernel_size==1:
            padding = 0
        elif kernel_size==3:
            padding = 1

This is equivalent to:
kernel_size = nn.ValueChoice([1, 3])
padding = kernel_size // 2

for i in range(ValueChoice) way because it is a 'syntax sugar'. Is there an alternative to this?

I think the documentation made it clear that you should use nn.Repeat.

Are there any large search spaces already defined for CIFAR-10 I could use

Have you looked at space hub? Although I had almost no confidence in it...

But it throws an AssertionError when running a test experiment:

It's probably related to the layer_size here. What's your layer_size here?

Is there a way to access the chosen Layer from LayerChoice? e.g. if a future step of the model depends on which layer has been chosen

In the trial, when a layer choice is created, it's just the chosen layer. You can check the layer with isinstance.

maybe you can try "ModelParameterChoice" ,which according to the doc:
"It’s quite similar to ValueChoice, but unlike ValueChoice, it always returns a fixed value, even at the construction of base model.
This makes it highly flexible (e.g., can be used in for-loop, if-condition, as argument of any function)"


Secured event delivery to functions with AAD

Hi, I have been following the documentation page  Secure WebHook delivery with Azure AD in Azure Event Grid - Azure Event Grid. I understand it is for webhook and not azure functions.
But how do we achieve this for a function?
The issue is, when I deploy a function as an event handler for a system topic (Azure subscription) subscription, the event delivery fails.
Steps:

Deploy a function app
Give it a system-assigned identity
Enable authentication, ensure Log in with Azure Active Directory is selected

From function's Integration start creating event grid subscription

Create an event grid triggered function (just default one will do)
Create Azure subscription as an Event Grid source system topic if it doesn't already exist
Create event subscription (notice there is no AAD Authentication option

The event grid graph shows events matched, but all event delivery fails. If I enable Allow Anonymous requests (no action) the event delivery works.

Any ideas on how best to get the system topic to be able to submit events as an AAD logged in application/service-principal?
I have added the JSON ARM template for the function, in case it is useful. Please note you will have to replace the values in it before deploying.

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

ID: a9f056c1-cf62-d72b-0ee2-49cffdefbe59
Version Independent ID: ffc6723a-87e8-8e5e-3128-897a6a56bacf
Content: Secure WebHook delivery with Azure AD in Azure Event Grid - Azure Event Grid
Content Source: articles/event-grid/secure-webhook-delivery.md
Service: event-grid
GitHub Login: @spelluru
Microsoft Alias: spelluru

@realrubberduckdev, Thank you for your feedback! We will review and update as appropriate.

@realrubberduckdev This is currently applicable for WebHook endpoints and since Azure Function exposes an endpoint itself, this is still possible by manually fetching the endpoint from the function page as below

This can also be done in ARM Templates as shared here.

Hi @PramodValavala-MSFT Thanks for your response.
Is there no way of using a function instead of the URL in a case of AAD authorized access?
I have tried that ARM template, but the handshaking fails, presumably due to event grid not being able to Log in with Azure Active Directory.
The ARM template works if I enable Allow Anonymous requests (no action).

@realrubberduckdev Unfortunately, there is no way to do this as of today but might be supported in the future. Please feel free to create a feature request on UserVoice to add support for this.
Irrespective of the type of topic, an event subscription is the same in all regards. The WebHook would be the way to go for now.
Another alternative that you could consider would be to trigger your function using service bus or storage queues, and then leverage event delivery with managed identity to these services.

Thank you. Just to clarify, I did try the webhook way. But in case of a system topic subscription, we do not get the AAD Authentication option. I think that is why it fails at handshaking. Or does that work for you?
Please note that the function app needs the caller to be able to login to Azure AD. Is that implicitly handled by the system topic? As we do not get an option to create identity etc. The event delivery with managed identity will not directly apply to system topics, as far as I understand.
I see your alternative could work, i.e. using a storage queue in between the system topic and function. Without any other way, I might try that.

Thank you. Just to clarify, I did try the webhook way. But in case of a system topic subscription, we do not get the AAD Authentication option. I think that is why it fails at handshaking. Or does that work for you?

I actually do see it when I select WebHook as the endpoint, even for a system topic. And I can confirm the token is included in the request made to the function.
But I seemed to have been missing the point about using the Authentication / Authorization feature of the Azure Function along with Event Grid AAD Authentication.
Considering the authentication flow used by Functions, this won't work out of the box.
Instead, you would either have to validate the token in code or place your functions behind APIM, which can perform the validation.

The event delivery with managed identity will not directly apply to system topics, as far as I understand.

This is actually true. My bad.

Thank you @PramodValavala-MSFT for checking into this. Very helpful. The APIM might be the way for me, will try it. Closing this issue.


Run swiftformat

The inconsistency with our other repos is driving me a bit crazy, I'd like to propose swiftformat'ing the repo.
Checklist
Please do the following before merging:

[ ] Ensure any public-facing changes are reflected in the changelog. Include them in the Main section.

I'm good with this, but last time we did this (I think in Blueprint?) it caused massive pain for integrating longer running PRs because it basically multiplied conflicts a ton, to the point they basically had to be manually replayed / re-created. Might be good to wait to land this still some of the recent, in progress PRs are in

Yep, fine waiting


flutter build aar failed with exit code 1

Running flutter build aar for a module including url_launcher exits with an error.
Steps to Reproduce

Add url_launcher (any version) to pubspec.yaml
Update .android/build.gradle to specify

dependencies {
    classpath 'com.android.tools.build:gradle:3.4.2'
}

Update gradle-wrapper

distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip

Run flutter build aar or flutter build aar --debug

Logs

Running flutter build aar -v produces a lot of logs, but the following is the printed error.
[ +388 ms] Running Gradle task 'assembleAarRelease'... (completed in 0.9s)
[   +5 ms] "flutter aar" took 2,912ms.
Gradle task assembleAarRelease failed with exit code 1

#0      throwToolExit (package:flutter_tools/src/base/common.dart:28:3)
#1      buildGradleAar (package:flutter_tools/src/android/gradle.dart:577:5)
#2      _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:71:64)
#3      _rootRunUnary (dart:async/zone.dart:1132:38)
#4      _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#5      _FutureListener.handleValue (dart:async/future_impl.dart:137:18)
#6      Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:678:45)
#7      Future._propagateToListeners (dart:async/future_impl.dart:707:32)
#8      Future._completeWithValue (dart:async/future_impl.dart:522:5)
#9      _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:30:15)
#10     _completeOnAsyncReturn (dart:async-patch/async_patch.dart:288:13)
#11     runCommandAndStreamOutput (package:flutter_tools/src/base/process.dart)
#12     _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:71:64)
#13     _rootRunUnary (dart:async/zone.dart:1132:38)
#14     _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#15     _FutureListener.handleValue (dart:async/future_impl.dart:137:18)
#16     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:678:45)
#17     Future._propagateToListeners (dart:async/future_impl.dart:707:32)
#18     Future._completeWithValue (dart:async/future_impl.dart:522:5)
#19     Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:552:7)
#20     _rootRun (dart:async/zone.dart:1124:13)
#21     _CustomZone.run (dart:async/zone.dart:1021:19)
#22     _CustomZone.runGuarded (dart:async/zone.dart:923:7)
#23     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:963:23)
#24     _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#25     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#26     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:116:13)
#27     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:173:5)

$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, v1.8.5-pre.145, on Mac OS X 10.14.6 18G87, locale en-US)

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 10.3)
[✓] Android Studio (version 3.4)
[!] IntelliJ IDEA Ultimate Edition (version 2018.2.5)
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
[!] IntelliJ IDEA Community Edition (version 2018.2.4)
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
[✓] VS Code (version 1.37.0)
[✓] Connected device (1 available)

! Doctor found issues in 2 categories.

NOTE: It builds fine with url_launcher when using gradle 3.2.1, but the resulting aar will not work in my native app.

@blasten

I wasn't able to reproduce this issue on stable or master with the suggested Gradle version.
Also, the Flutter tool overrides the .android directory, so the latest supported Gradle version is 5.6.2, and Android Gradle plugin: 3.5.0.
Please feel free to re-open the issue if it's happening.


Is need provider with manual get tenant service?

Hi @sandeepsuvit ,
Thank you very much for developing this interesting module for multi tenancy and its helping me a lot.
All service need request context, because scope of "TENANT-CONTEXT"
Request context be destroy when i called method of tenant service because i use Subscription Publishing Mode.
[error] req is undefine
so i write this
export type ManualGetModelFn<T> = (tenanId: string) => Promise<Model<T>>;
export function ManualTennecyModel(entity: string): ParameterDecorator {
    return InjectManualGetFn(entity);
}
//manual service
export class xxxManualService {
    constructor(
        @ManualTennecyModel(xxxEntity.name)
        private readonly manualGetfn: ManualGetModelFn<xxxEntity>
    ) {}
    async select(tenantId: string) {
        await this.bookUseDataRepos.setModel(tenantId);
        return this;
    }
}
//manual service usage
export class usageService {
    constructor(private readonly xxxManualService: xxxManualService) {}
    getTenantService(tenantId: string): Promise<xxxManualService> {
        return this.xxxManualService.select(tenantId);
    }
    call() {
        this.getTenantService(organId)
            .then((service) => {
                //...use service do something
            })
            .catch(console.error);
    }
}

Manual service will not spread [request] scope.
If need i will submit the pr.
A question
Can we improve the performance of tenant mode by saving service instances or manually obtaining models?
Thanks for all of your efforts. Looking forward to your reply :)

@xiaokhkh thanks for writing in. Yes you are correct the tenant can be resolved only by a request context until its available (since the information of the tenant is embedded inside the request context). But i did't get you last point on Can we improve the performance of tenant mode by saving service instances or manually obtaining models? - Are you saying you have a solution for this and you want to submit a pr?

@sandeepsuvit pr is about manual get model above the above requirements.
The last question is the idea when doing the above requirements. but it has not been fully implemented.
I might achieve it(improve the performance) in the direction or other idea?

@xiaokhkh your solution looks promising. I can evaluate it if you can provide a working example.

Hi guys, an example of use when I add a service to a Bull queue:
myapi | 2023-03-22T04:09:56.482Z ioredis:redis write command[<IP_ADDRESS>:6379]: 0 -> hmset('xxx:mail-queue:9,attemptsMade,1,stacktrace,["TypeError: req.get is not a function\n at Function.getTenantFromRequest (/home/node/app/node_modules/@needle-innovision/nestjs-tenancy/dist/tenancy-core ...
The request context is not available...  I believe the solution would be to pass the tenantId manually from the Job parameters.


Online status is broken

The online status feature no longer works.  There is no dot or ring shown to show whether people are online or offline in the recent versions of WhatsApp. Are you able to fix this please?

Just fixed it with #18
Thank you for your feedback, please report if there are any new issues.

Thanks. Installed 1.17. Restoring and closed WhatsApp out. However no online indicators show either as dot or ring. Using WhatsApp 2.20.11


Change TaggedTable._into_dataloader_with_classes to use to_numpy() instead of values

Is your feature request related to a problem?
Currently, the method uses DataFrame.values to convert a pandas DataFrame into a PyTorch Tensor. It is recommended to use DataFrame.to_numpy() instead, as this does the same, but DataFrame.values could be deprecated soon. In the documentation from DataFrame.values it is also recommended to use DataFrame.to_numpy instead.
Desired solution
Change lines 902 and 911 from torch.Tensor(self.features._data.values), to torch.Tensor(self.features._data.to_numpy),
Possible alternatives (optional)
No response
Screenshots (optional)
No response
Additional Context (optional)
No response

Polars, which we now use for our tabular containers, also has a direct DataFrame.to_torch.

Has been done as part of #752.


Cannot install Kicost on Windows

and documentation link gives a 404 error.
Steps performed:

clone the Kicost repo
invoke python setup.py build
invoke python setup.py install
Invoke kicost

Z:\git\KiCost>kicost
Traceback (most recent call last):
  File "C:\Python37\Scripts\kicost-script.py", line 6, in <module>
    from pkg_resources import load_entry_point
  File "C:\Python37\lib\site-packages\pkg_resources\__init__.py", line 3191, in <module>
    @_call_aside
  File "C:\Python37\lib\site-packages\pkg_resources\__init__.py", line 3175, in _call_aside
    f(*args, **kwargs)
  File "C:\Python37\lib\site-packages\pkg_resources\__init__.py", line 3204, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "C:\Python37\lib\site-packages\pkg_resources\__init__.py", line 583, in _build_master
    ws.require(__requires__)
  File "C:\Python37\lib\site-packages\pkg_resources\__init__.py", line 900, in require
    needed = self.resolve(parse_requirements(requirements))
  File "C:\Python37\lib\site-packages\pkg_resources\__init__.py", line 786, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'babel>=2.6' distribution was not found and is required by kicost

Note: Wheel==0.23.0 has already been installed from requirement.py.
Are the other packages also required?
Z:\git\KiCost>pip install babel==2.6
Collecting babel==2.6
  Downloading https://files.pythonhosted.org/packages/b8/ad/c6f60602d3ee3d92fbed87675b6fb6a6f9a38c223343ababdb44ba201f10/Babel-2.6.0-py2.py3-none-any.whl (8.1MB)
     |████████████████████████████████| 8.1MB 3.3MB/s
Requirement already satisfied: pytz>=0a in c:\python37\lib\site-packages (from babel==2.6) (2019.2)
ERROR: kicost 1.1.2 requires beautifulsoup4>=4.3.2, which is not installed.
ERROR: kicost 1.1.2 requires CurrencyConverter>=0.13, which is not installed.
ERROR: kicost 1.1.2 requires future, which is not installed.
ERROR: kicost 1.1.2 requires lxml>=3.7.2, which is not installed.
ERROR: kicost 1.1.2 requires requests>=2.18.4, which is not installed.
ERROR: kicost 1.1.2 requires tqdm>=4.30.0, which is not installed.
ERROR: kicost 1.1.2 requires XlsxWriter>=0.7.3, which is not installed.
Installing collected packages: babel
Successfully installed babel-2.6.0

Should all these be added to the requirements.txt file?

Note: after installing all these packages by hand plus wxPython, KiCost starts successfully.

All KiCost requirements are listed by requirements variable at setup.py file. But I am not a expert in Python package and this file was present some issues, since I added the post_install_setup() function to run some after installation configurations (this version is beta and not officially on PyPI).
Basically, now it is needed to install the pywin32 in the Windows case and run kicost --setup command line, that make all the configuration integration Eeschema-KiCost (add KiCost to BOm list, add the standards fields, save the typing from user, add a shortcut to KiCost in case of GUI installation, ...).
Is the command kicost --setup working for you?

Sorry I'm no expert in Python...
By following this, it installs the dependencies: https://stackoverflow.com/questions/1471994/what-is-setup-py
Now only wsPython is missing, which can be solved by uncommenting the line in setup.py.
After doing this and running pip install . KiCost can be launched.

@romain145, which line did you uncomment? which OS did you try?
If Windows, did I automatically get pywin32 python package? (wsPython is not automatically installed, some users ask me to do that, but I have to be asked on KiCost installation with you want to download thi package).

Installation with pip fails on a new windows system.
Steps to reproduce:

Install Python 3.8.3, and add it to the environment variables
pip install kicost #this installs kicost1.1.4 and its dependencies
run kicost #this gives the following error

C:\Users\Romain>kicost
You don't have the wxPython dependence to run the GUI interface. Run once of the follow commands in terminal to install them:
pip3 install -U wxPython # For Windows & macOS
pip install -U -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-16.04 wxPython # For Linux 16.04
Or download from last version from <https://wxpython.org/pages/downloads/>

pip3 install -U wxPython
run kicost #this gives the following error

C:\Users\Romain>kicost
Traceback (most recent call last):
  File "C:\Users\Romain\AppData\Local\Programs\Python\Python38-32\Scripts\kicost-script.py", line 11, in <module>
    load_entry_point('kicost==1.1.4', 'console_scripts', 'kicost')()
  File "c:\users\romain\appdata\local\programs\python\python38-32\lib\site-packages\kicost\__main__.py", line 253, in main
    kicost_gui() # Use the user gui if no input is given.
  File "c:\users\romain\appdata\local\programs\python\python38-32\lib\site-packages\kicost\kicost_gui.py", line 1065, in kicost_gui
    frame = formKiCost(None)
  File "c:\users\romain\appdata\local\programs\python\python38-32\lib\site-packages\kicost\kicost_gui.py", line 367, in __init__
    fgSizer1.Add(self.m_gauge_process, 1, wx.ALL|wx.EXPAND|wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL, 5)
wx._core.wxAssertionError: C++ assertion "!(flags & (wxALIGN_BOTTOM | wxALIGN_CENTRE_VERTICAL)) || !(flags & (wxALIGN_RIGHT | wxALIGN_CENTRE_HORIZONTAL))" failed at ..\..\src\common\sizer.cpp(1453) in wxGridSizer::DoInsert(): wxEXPAND flag will be overridden by alignment flags```

Please, report kicost --info information (with some library versions).

C:\Users\Romain>kicost --info KiCost v.1.1.4.at Python 3.8.3.on Windows-10-10.0.19041-SP0(32bit).Graphical library: 4.1.0 msw (phoenix) wxWidgets 3.1.4.

Are KiCost working fine as CLI (terminal) interface?

@hildogjr I've just installed KiCost and seeing the same issue. Installed via pip. Seems like a long time for the Kitspace server to be offline?
KiCost v.1.1.4.at Python 3.8.6.on Windows-10-10.0.19041-SP0(64bit).Graphical library: 4.1.0 msw (phoenix) wxWidgets 3.1.4.

Yes, before was reported two behaviours:

Not running even in CLI mode (server problem).
The GUI needs to be fix, so this issue here is duplicated from #412

I will close this, since already exist a ticket open for.


[Unraid] Captcha being asked and games not redeemed

Describe the bug
Captcha bypass not taken into account

Games not redeemed

Screenshots or Logs
(node:64) UnhandledPromiseRejectionWarning: Error: Protocol error (Input.dispatchKeyEvent): Target closed.
at /usr/app/node_modules/puppeteer/src/common/Connection.ts:291:57
at new Promise ()
at CDPSession.send (/usr/app/node_modules/puppeteer/src/common/Connection.ts:290:12)
at next (/usr/app/node_modules/puppeteer-extra-plugin-stealth/evasions/sourceurl/index.js:32:41)
at CDPSession.send (/usr/app/node_modules/puppeteer-extra-plugin-stealth/evasions/sourceurl/index.js:57:18)
at Keyboard.up (/usr/app/node_modules/puppeteer/src/common/Input.ts:182:24)
at Keyboard.press (/usr/app/node_modules/puppeteer/src/common/Input.ts:276:16)
at runMicrotasks ()
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at Keyboard.type (/usr/app/node_modules/puppeteer/src/common/Input.ts:241:9)
(Use node --trace-warnings ... to show where the warning was created)
(node:64) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:64) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
[2021-10-04 23:30:46.863 +0200] INFO (64 on 94763ed2458f): Successfully logged in fresh
user: ""
[2021-10-04 23:30:48.395 +0200] INFO (64 on 94763ed2458f): Available free games
user: ""
availableGames: [
"Europa Universalis IV"
]
[2021-10-04 23:30:48.712 +0200] WARN (64 on 94763ed2458f): Failed to authenticate with GraphQL API, trying again
user: ""
[2021-10-04 23:30:52.732 +0200] ERROR (64 on 94763ed2458f): Sid returned null
Error: Sid returned null
at Login.refreshAndSid (/usr/app/src/login.ts:80:24)
at runMicrotasks ()
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at FreeGames.ownsGame (/usr/app/src/free-games.ts:183:9)
at async Promise.all (index 0)
at FreeGames.getPurchasableFreeGames (/usr/app/src/free-games.ts:199:23)
at FreeGames.getAllFreeGames (/usr/app/src/free-games.ts:252:30)
at redeemAccount (/usr/app/src/index.ts:22:20)
at async Promise.all (index 0)
at main (/usr/app/src/index.ts:53:5)
Additional context

Using Unraid, latest docker version
Once captcha is entered I can see the MFA get filled and then Session complete! Browser has closed.
Looks like connexion is ok, though cookie doesn't seem to work, as well as the hcaptcha bypass and games does not get redeemed.
Tried 3 accounts, none works.
Tried importing cookie, same thing happen : Captcha - MFA - Error

A bit of a facepalm moment here. I just forgot an await...
Anyway, thanks much for the report. You should be able to pull the new version when the build finishes in a few minutes.


Custom formatting or abi

Thanks for the work on this class.
One short coming is that there is no way to do custom formatting of money values.
I either need the ability to obtain the integer and fractional parts separately so that I can then create a custom format or the library needs the ability to provide at least a set of common formats.
e.g.
$10.00 USD
10.00 USD
$10.00
$10 USD
$10
10
There a also cases where you want to create abbreviations. For instance in stock market apps we presented large numbers to 6 digits max.
e.g.
10K
1.2M
I will push a commit which at least allows a user to get the integer and factional parts.

Hello, @bsutton.
There is the API for encoding/decoding any representation of Money.
Check methods Money.decoding() and Money.encoded() and the interfaces MoneyEncoder & MoneyDecoder.
You can also see the tests as a simplified example: https://github.com/LitGroup/money.dart/blob/master/test/money_coding_test.dart

I think that this needs some more documentation as even after reading the
test units it not at all clear what the intent of the encoders are.
I've got some doc changes I will push tomorrow that I think make the usage
of the main classes more approachable. I will have a closer look at the
encoders as well.
On Mon, 23 Sep 2019, 10:01 pm Roman Shamritskiy<EMAIL_ADDRESS>wrote:

Hello, @bsutton https://github.com/bsutton.
There is the API for encoding/decoding any representation of Money.
Check methods Money.decoding() and Money.encoded() and the interfaces
MoneyEncoder & MoneyDecoder.
You can also see the tests as a simplified example:
https://github.com/LitGroup/money.dart/blob/master/test/money_coding_test.dart
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/LitGroup/money.dart/issues/37?email_source=notifications&email_token=AAG32OAVJNWOJE57MV6H2VTQLCVZHA5CNFSM4IZFASX2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7KT27I#issuecomment-534068605,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAG32OD3XJCSPNVQBE74T43QLCVZHANCNFSM4IZFASXQ
.

I've just pushed documentation changes and added a new method Money.format(String pattern).
Hopefully you like it :)