feat: expose replica space usage

Signed-off-by: Tiago Castro<EMAIL_ADDRESS>

bors merge


do not quote process name as it can consist of several (un)quoted parts

Pull Request (PR) description
The vrrp_track_process template puts quotes around the proc_name value.
This is problematic, because the the process name can consist of a combination of several (un)quoted strings.
Below an extract of the allowed syntax of the process value in the keepalived.conf manpage:
process <STRING>|<QUOTED_STRING> [<STRING>|<QUOTED_STRING> ...].
Because of the added quotes, I faced a failing vrrp_track_process check.
Removal of the hardcoded quotes in the template will output the value exactly as intended by the user of the module.
This Pull Request (PR) fixes the following issues
n/a

Thanks @imp-
I am not sure if we should consider this backward incompatible…  The existing test where not really accurate, do you mind fixing them by adding anchors and test cases with quotes that would have failed before your patch?


WIP - Converting the pulse library from complex amp to amp+angle

Summary
We convert the symbolic pulses in the pulse library from a complex amp to real (float) amp+angle. i.e., instead of calling (for example):
Gaussian(duration=25, sigma=4, amp=0.5j),
one should call:
Gaussian(duration=25, sigma=4, amp=0.5, angle = np.pi/2).
Backward compatibility is maintained, and deprecation warnings are raised when the previous API is used.
This work is in progress and presented here for comments. See below some questions.
Details and comments
So far, only the Gaussian class was fully implemented. The other classes will be completed in a similar fashion, if no objections are raised.
Most of the changes are straight forward, and simply allow for either a complex amp or real amp+angle input parameters. However, some appearance issues arise because of the backward compatibility. To ensure the compatibility, the 'parameters' dictionary remained the same with the entry "amp" representing the complex amplitude. This means that a user using gauss_pulse = Gaussian(duration=25, sigma=4, amp=0.5, angle = np.pi/2) and then gauss_pulse.amp will receive 0.5j and not 0.5 as he might expect.
To avoid the confusion, an 'amp' property was added directly to the SymbolicPulse class, with a deprecation warning. An additional  'amp_angle' property was similarly added to the class and it returns the (amp,angle) tuple. In the future the second property could be removed, and the parameters dictionary could include directly the (amp,angle) tuple.
(It should be noted that if someone has used the SymbolicPulse class with float 'amp' parameter - this fix will yield unnecessary warnings for him. However, no such examples currently exist in the library)
Tests were added to make sure warnings and errors are raised in the appropriate scenarios, and that the pulses created with both API choices are the same.
Questions and Decisions

The name amp_angle is temporary. Feel free to suggest a better one if you have it.
Relating to the previous question, what should repr include now? The complex amp? amp,angle tuple? Something else?
Previous tests now raise deprecation warnings, should I update them now, or should this be done only when the deprecation is completed?

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

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

Pull Request Test Coverage Report for Build<PHONE_NUMBER>

53 of 66 (80.3%)  changed or added relevant lines in 4 files are covered.
509 unchanged lines in 60 files lost coverage.
Overall coverage increased (+0.2%) to 84.565%

Changes Missing Coverage
Covered Lines
Changed/Added Lines
%

qiskit/pulse/library/symbolic_pulses.py
38
40
95.0%

qiskit/qpy/binary_io/schedules.py
4
15
26.67%

Files with Coverage Reduction
New Missed Lines
%

qiskit/algorithms/gradients/spsa_estimator_gradient.py
1
95.83%

qiskit/algorithms/gradients/param_shift_estimator_gradient.py
1
95.83%

qiskit/algorithms/gradients/spsa_sampler_gradient.py
1
96.23%

qiskit/tools/parallel.py
1
83.08%

qiskit/quantum_info/operators/symplectic/sparse_pauli_op.py
1
90.67%

qiskit/algorithms/gradients/param_shift_sampler_gradient.py
1
95.92%

qiskit/circuit/library/generalized_gates/linear_function.py
1
98.36%

src/nlayout.rs
1
75.0%

src/sabre_swap/sabre_dag.rs
1
97.14%

qiskit/algorithms/gradients/lin_comb_sampler_gradient.py
1
96.77%

Totals

Change from base Build<PHONE_NUMBER>:
0.2%

Covered Lines:
62667

Relevant Lines:
74105

💛  - Coveralls


RDKTV-12796:Move iarmmgrs oem patches

@apatel859  Please help merge after RM confirmation.

@apatel859 Please help merge after RM confirmation.

the jira is not yet verified . after that it should go to RM approval

@apatel859 the changes are now approved to be merged to xumo_1. Please help merge this change

Closing older PRs. Pls bring to latest sprint or topic branch.


Unfinished Card Component

Whoever gets assigned this should finish the Card Component according to the design specifications on the Figma. Make sure you put the component on the index.js page with some dummy data, so we can see it in the Preview Deployment.

I can go ahead and finish it since I started it

thanks ella, tag me in discord or slack if you need any help. you don't need to add the second variant of this component just yet but make sure to add a prop for the gold, silver, and bronze outlines.

This should have been closed when #23, no clue why it didn't. Perhaps the pr title name shouldn't be between the close keyword and the reference id.


search functionality

Implement search functionality that allows users to search by title. Check out the docs for the search endpoint.

Completed this issue implementation, only that I have decided to only query first 20 items.


Added spfx sample for Employee Spotlight webpart

Added the sample webpart code to display the Employee Spotlight details
from a configured list using javascript and SharePoint framework

Q
A

Bug fix?
no

New feature?
no

New sample?
yes

Related issues?
fixes #X, partially #Y, mentioned in #Z

What's in this Pull Request?
A Simple Web Part that demonstrates the use of SharePoint Framework for show casing Employee Spotlight. The web part pulls data from a configured SharePoint list and User Profile service. Also the web part has many configuration options such as Background, font colors, Slider control options, Source list selection.

@brk114,
Thanks for your contribution.
To ensure that the project team has proper rights to use your work, please complete the Contribution License Agreement at https://cla.microsoft.com.
It will cover your contributions to all Microsoft-managed open source projects.
Thanks,
Microsoft Pull Request Bot

@brk114, thanks for signing the contribution license agreement. We will now validate the agreement and then the pull request.
Thanks, Microsoft Pull Request Bot

Hi Microsoft spfx webparts dev team,
Its been 29 days since i submitted the pull request. Can i get the update on review of this pull request submission?

@manishgarg1 @VesaJuvonen?

thx Ravi, appreciated. Sorry for the delay due to vacations across the PnP team. Great sample.


How should I import AOS with webpack ?

I've tried:
import { AOS } from 'aos';

import * as AOS from 'aos';

the error is always:
Cannot find name 'aos'

import * as AOS from 'aos/dist/aos.js';

did it

You should be able to simply: import AOS from 'aos' this is how I use it and it works fine :)

I also tried to run aos with webpack and I imported aos in my entry.js like that
import AOS from '../../../node_modules/aos/dist/aos.js'
than I added at the and of my HTML file this
<script> AOS.init({ easing: 'ease-in-out-sine' }); </script>
But I also get Uncaught ReferenceError: AOS is not defined

Similar to what was noted here, to stop the AOS is not defined error I too just had to add the require line above the init like so:
var AOS = require('aos');
AOS.init();

Otherwise as @michalsnik said you should just be able to import AOS as per the docs,  import AOS from 'aos'. But I wonder if the var setup line needs to be added to the documentation? Not sure why some folks need that and some do not. But I'm far from a webpack expert.

this work fine.... only add
import AOS from 'aos';
import 'aos/dist/aos.css';
AOS.init();

Where to write import AOS from 'aos' ?
In my Javascript or html or css plzz specify the position..

In my situation at first
import AOS from 'aos';
and
AOS.init();
were in different files. Then I put the import statement in the same file with AOS call and now it seems working fine.

i get this error when i try : import AOS from 'aos'
Error resolving module specifier “aos”. Relative module specifiers must start with “./”, “../” or “/”.

i understand my problème, it was i forgot run  :  npm run build
am using npm with webpack

For me the problem was not installing types;
npm install --save @types/aos

this work fine.... only add
import AOS from 'aos'; import 'aos/dist/aos.css';
AOS.init();

where should I add this?


Refactored Code

Globalized the GitHub API URL

@CodiumAI-Agent /describe

Title
Globalization of GitHub API URL in Python functions

Type
Enhancement

Description
This PR focuses on the refactoring of the Python code in the 'functions.py' file. The GitHub API URL, which was previously hardcoded in multiple functions, has been globalized and stored in a constant variable 'URL'. This change enhances the maintainability of the code, as any future changes to the API URL will only need to be made in one place.

PR changes walkthrough
Relevant files                                                                                Enhancement1 files

functions.py

        functions.py
The GitHub API URL has been globalized and stored in a constant variable 'URL'. This URL is now used in the 'get_user', 'validate_alx', and 'get_all_repos' functions, replacing the previously hardcoded API URLs.

 +4/-3

___
## User description
Globalized the GitHub API URL


Time zone of the publish_date_time

I wonder what's the time zone of the publish time that get from the article.publish_date.

From extractors.py, lines 173-180
        3 strategies for publishing date extraction. The strategies
        are descending in accuracy and the next strategy is only
        attempted if a preferred one fails.
        1. Pubdate from URL
        2. Pubdate from metadata
        3. Raw regex searches in the HTML + added heuristics


Various tweaks on UI

display tokens as set in stakingDenom instead of upper case or lower case in various places
add pricePrecision setting (default is 2), so tokens with lower price can be displayed instead of showing $0.00
add powerReduction setting (default is null, which fallbacks to stakingFraction) to fix the voting power calculation in proposals (#215 )
add stakingDenomPlural setting (default is null, which fallbacks to ${stakingDenom}s) to allow setting the text of the plural form of the token. This also fixes the additional newline in account delegation list table header.

Rebased, the commit for price precision is removed.


Upgrade @nomiclabs/buidle to 1.4.6

Run npm upgrade
There's a fix to the buidlerevm tracing bug is included in this release. So we'll have a better error message for tracing contract revert after this upgrade.

Merging without review because we have no important codebase change in this PR


quasselcore doesn't work because qt5 libs don't have sqlite plugin enabled

I'm on NixOS unstable, the relevant configuration is just services.quassel.enable = true
here's the journalctl logs
Sep 02 15:40:16 thufir systemd[1]: Started Quassel IRC client daemon.
Sep 02 15:40:16 thufir quasselcore[18374]: ()
Sep 02 15:40:16 thufir quasselcore[18374]: Could not initialize any storage backend! Exiting...
Sep 02 15:40:16 thufir quasselcore[18374]: Currently, Quassel supports SQLite3 and PostgreSQL. You need to build your
Sep 02 15:40:16 thufir quasselcore[18374]: Qt library with the sqlite or postgres plugin enabled in order for quasselcore
Sep 02 15:40:16 thufir quasselcore[18374]: to work.

I suspect this might be a special case of "QT_PLUGIN_PATH mechanisms do not work from within systemd services"

cc @ttuegel

Does the Quassel service actually install the daemon into the system environment, or does just put an absolute store path in ExecPath= for the service? If the latter, it (unfortunately) should not be expected to work. If the former, we are probably assuming something is set in the environment that systemd doesn't do.

Quassel puts its store path in ExecPath=. I guess that https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/x11/display-managers/sddm.nix is a good example of a Qt service.

@ttuegel what does "install the daemon into the system environment" mean in this context?

@DIzFer It means environment.systemPackages = [ sddm ]; and execCmd = "exec /run/current-system/sw/bin/sddm"; in the sddm example.
quasselcore also works as a service with this preFixup in pkgs/applications/networking/irc/quassel/default.nix:
preFixup = lib.optionalString buildCore ''
  wrapProgram "$out/bin/quasselcore" --suffix PATH : "${qtbase.bin}/bin"
''


GridView inside ExpansionTile with PageStorageKey throws type cast error

Description
I try to have an GridView inside an ExpansionTile wrapped in a Sliverlist. To persist the state of the ExpansionTile I added a PageStorageKey but by expanding the ExpanstionTile, after collapsing it, an error is thrown
Steps to Reproduce

Execute flutter run on the code sample

Expected results:
No error.
Actual results:
The following error is thrown upon expanding the ExpansionTile:
The following _CastError was thrown building GridView(scrollDirection: vertical, primary: using primary controller, NeverScrollableScrollPhysics, shrinkWrap: shrink-wrapping, dependencies: [MediaQuery, PrimaryScrollController]):
type 'bool' is not a subtype of type 'double?' in type cast

Code sample
import 'package:flutter/material.dart';

void main() {
  runApp(const TestScreen());
}

class TestScreen extends StatelessWidget {
  const TestScreen({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Welcome to Flutter',
      home: Scaffold(
        body: CustomScrollView(
          physics: const BouncingScrollPhysics(),
          slivers: [
            // SliverAppBar comes here
            SliverList(
                delegate: SliverChildListDelegate([
              _expansionTile(),
            ]))
          ],
        ),
      ),
    );
  }

  Widget _expansionTile() {
    return ExpansionTile(
      initiallyExpanded: true,
      key: const PageStorageKey("some-key"), // <-- produces the error
      title: const Text("Expansoion Tile"),
      children: [_grid()],
    );
  }

  Widget _grid() {
    return GridView.count(
      shrinkWrap: true,
      crossAxisCount: 3,
      physics: const NeverScrollableScrollPhysics(),
      children: const [
        Text("1"),
        Text("2"),
        Text("3"),
        Text("4"),
        Text("5"),
      ],
    );
  }
}

Hi @lukaskirner, Thanks for filing the issue, I am able to reproduce the issue on stable and the master channel error is thrown when collapsing the expansionTile.

The following _CastError was thrown building GridView(scrollDirection: vertical, primary: using
primary controller, NeverScrollableScrollPhysics, shrinkWrap: shrink-wrapping, dependencies:
[MediaQuery, PrimaryScrollController]):
type 'bool' is not a subtype of type 'double?' in type cast

code sample
import 'package:flutter/material.dart';

void main() {
  runApp(const TestScreen());
}

class TestScreen extends StatelessWidget {
  const TestScreen({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Welcome to Flutter',
      home: Scaffold(
        body: CustomScrollView(
          physics: const BouncingScrollPhysics(),
          slivers: [
            // SliverAppBar comes here
            const SliverToBoxAdapter(
              child: SizedBox(
                height: kToolbarHeight,
              ),
            ),
            SliverList(
                delegate: SliverChildListDelegate([
              _expansionTile(),
            ]))
          ],
        ),
      ),
    );
  }

  Widget _expansionTile() {
    return ExpansionTile(
      initiallyExpanded: true,
      key: const PageStorageKey("some-key"), // <-- produces the error
      title: const Text("Expansoion Tile"),
      children: [_grid()],
    );
  }

  Widget _grid() {
    return GridView.count(
      shrinkWrap: true,
      crossAxisCount: 3,
      physics: const NeverScrollableScrollPhysics(),
      children: const [
        Text("1"),
        Text("2"),
        Text("3"),
        Text("4"),
        Text("5"),
      ],
    );
  }
}

flutter doctor -v
[✓] Flutter (Channel master, 2.10.0-1.0.pre.339, on macOS 12.1 21C52 darwin-arm, locale en-GB)
    • Flutter version 2.10.0-1.0.pre.339 at /Users/mahesh/Documents/flutter_master
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 1c673b28ad (2 days ago), 2022-01-31 02:20:13 -0500
    • Engine revision c6e12eb12b
    • Dart version 2.17.0 (build 2.17.0-67.0.dev)
    • DevTools version 2.10.0-dev.1

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/mahesh/Library/Android/sdk
    • Platform android-31, build-tools 31.0.0
    • ANDROID_HOME = /Users/mahesh/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.10.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)

[✓] IntelliJ IDEA Community Edition (version 2021.2.1)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 60.1.4
    • Dart plugin version 212.5080.8

[✓] VS Code (version 1.63.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.34.0

[✓] Connected device (4 available)
    • Redmi K20 Pro (mobile) • <IP_ADDRESS>:5555                     • android-arm64  • Android 11 (API 30)
    • iPhone 12 Pro (mobile) • 14F40EC6-3B73-469A-A1C0-8CF0B152290F • ios            •
      com.apple.CoreSimulator.SimRuntime.iOS-14-5 (simulator)
    • macOS (desktop)        • macos                                • darwin-arm64   • macOS 12.1 21C52
      darwin-arm
    • Chrome (web)           • chrome                               • web-javascript • Google Chrome
      97.0.4692.99

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

[✓] Flutter (Channel stable, 2.8.1, on macOS 12.1 21C52 darwin-arm, locale en-GB)
    • Flutter version 2.8.1 at /Users/mahesh/Documents/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 77d935af4d (7 weeks ago), 2021-12-16 08:37:33 -0800
    • Engine revision 890a5fca2e
    • Dart version 2.15.1

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/mahesh/Library/Android/sdk
    • Platform android-31, build-tools 31.0.0
    • ANDROID_HOME = /Users/mahesh/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.10.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)

[✓] IntelliJ IDEA Community Edition (version 2021.2.1)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 60.1.4
    • Dart plugin version 212.5080.8

[✓] VS Code (version 1.63.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.34.0

[✓] Connected device (4 available)
    • Redmi K20 Pro (mobile) • <IP_ADDRESS>:5555                     • android-arm64  • Android 11 (API 30)
    • iPhone 12 Pro (mobile) • 14F40EC6-3B73-469A-A1C0-8CF0B152290F • ios            •
      com.apple.CoreSimulator.SimRuntime.iOS-14-5 (simulator)
    • macOS (desktop)        • macos                                • darwin-arm64   • macOS 12.1 21C52
      darwin-arm
    • Chrome (web)           • chrome                               • web-javascript • Google Chrome
      97.0.4692.99

• No issues found!

flutter run
mahesh@Maheshs-MacBook-Air-M1 assets % flutter run

┌─────────────────────────────────────────────────────────┐
│ A new version of Flutter is available!                  │
│                                                         │
│ To update to the latest version, run "flutter upgrade". │
└─────────────────────────────────────────────────────────┘
Could not load custom device from config index 0: Expected enabled to be a boolean.
Changing current working directory to: /Users/mahesh/Desktop/counter
Multiple devices found:
Redmi K20 Pro (mobile) • <IP_ADDRESS>:5555                     • android-arm64  • Android 11 (API 30)
iPhone 12 Pro (mobile) • 14F40EC6-3B73-469A-A1C0-8CF0B152290F • ios            •
com.apple.CoreSimulator.SimRuntime.iOS-14-5 (simulator)
macOS (desktop)        • macos                                • darwin-arm64   • macOS 12.1 21C52 darwin-arm
Chrome (web)           • chrome                               • web-javascript • Google Chrome 97.0.4692.99
[1]: Redmi K20 Pro (<IP_ADDRESS>:5555)
[2]: iPhone 12 Pro (14F40EC6-3B73-469A-A1C0-8CF0B152290F)
[3]: macOS (macos)
[4]: Chrome (chrome)
Please choose one (To quit, press "q/Q"): 1
Running "flutter pub get" in counter...                             4.1s
Launching lib/main.dart on Redmi K20 Pro in debug mode...
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Running Gradle task 'assembleDebug'...                             63.7s
✓  Built build/app/outputs/flutter-apk/app-debug.apk.
Installing build/app/outputs/flutter-apk/app.apk...                21.0s
Syncing files to device Redmi K20 Pro...                           152ms
I/example.counte(19508): ProcessProfilingInfo new_methods=1111 is saved saved_to_disk=1 resolve_classes_delay=8000

Flutter run key commands.
r Hot reload. 🔥🔥🔥
R Hot restart.
h List all available interactive commands.
d Detach (terminate "flutter run" but leave application running).
c Clear the screen
q Quit (terminate the application on the device).

💪 Running with sound null safety 💪

An Observatory debugger and profiler on Redmi K20 Pro is available at: http://<IP_ADDRESS>:60126/kbUaxXDGESU=/
The Flutter DevTools debugger and profiler on Redmi K20 Pro is available at:
http://<IP_ADDRESS>:9101?uri=http://<IP_ADDRESS>:60126/kbUaxXDGESU=/
D/MIUIInput(19508): [MotionEvent] ViewRootImpl { action=ACTION_DOWN, id[0]=0, pointerCount=1, eventTime=73454897, downTime=73454897 } moveCount:0
W/MirrorManager(19508): this model don't Support
D/MIUIInput(19508): [MotionEvent] ViewRootImpl { action=ACTION_UP, id[0]=0, pointerCount=1, eventTime=73454961, downTime=73454897 } moveCount:0
D/MIUIInput(19508): [MotionEvent] ViewRootImpl { action=ACTION_DOWN, id[0]=0, pointerCount=1, eventTime=73455736, downTime=73455736 } moveCount:0
D/MIUIInput(19508): [MotionEvent] ViewRootImpl { action=ACTION_UP, id[0]=0, pointerCount=1, eventTime=73455801, downTime=73455736 } moveCount:0

══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
The following _CastError was thrown building GridView(scrollDirection: vertical, primary: using
primary controller, NeverScrollableScrollPhysics, shrinkWrap: shrink-wrapping, dependencies:
[MediaQuery, PrimaryScrollController]):
type 'bool' is not a subtype of type 'double?' in type cast

The relevant error-causing widget was:
  GridView GridView:file:///Users/mahesh/Desktop/counter/lib/main.dart:44:21

When the exception was thrown, this was the stack:
#0      ScrollPosition.restoreScrollOffset (package:flutter/src/widgets/scroll_position.dart:424:103)
#1      new ScrollPosition (package:flutter/src/widgets/scroll_position.dart:108:7)
#2      new ScrollPositionWithSingleContext
(package:flutter/src/widgets/scroll_position_with_single_context.dart:56:8)
#3      ScrollController.createScrollPosition (package:flutter/src/widgets/scroll_controller.dart:233:12)
#4      ScrollableState._updatePosition (package:flutter/src/widgets/scrollable.dart:423:44)
#5      ScrollableState.didChangeDependencies (package:flutter/src/widgets/scrollable.dart:455:5)
#6      StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4948:11)
#7      ComponentElement.mount (package:flutter/src/widgets/framework.dart:4763:5)
...     Normal element mounting (7 frames)
#14     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3823:14)
#15     MultiChildRenderObjectElement.inflateWidget (package:flutter/src/widgets/framework.dart:6452:36)
#16     MultiChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:6463:32)
...     Normal element mounting (21 frames)
#37     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3823:14)
#38     Element.updateChild (package:flutter/src/widgets/framework.dart:3573:18)
#39     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6321:14)
#40     Element.updateChild (package:flutter/src/widgets/framework.dart:3534:15)
#41     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6321:14)
#42     Element.updateChild (package:flutter/src/widgets/framework.dart:3534:15)
#43     RenderObjectElement.updateChildren (package:flutter/src/widgets/framework.dart:5817:32)
#44     MultiChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6475:17)
#45     Element.updateChild (package:flutter/src/widgets/framework.dart:3534:15)
#46     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6321:14)
#47     Element.updateChild (package:flutter/src/widgets/framework.dart:3534:15)
#48     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6321:14)
#49     Element.updateChild (package:flutter/src/widgets/framework.dart:3534:15)
#50     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4814:16)
#51     Element.rebuild (package:flutter/src/widgets/framework.dart:4511:5)
#52     StatelessElement.update (package:flutter/src/widgets/framework.dart:4868:5)
#53     Element.updateChild (package:flutter/src/widgets/framework.dart:3534:15)
#54     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4814:16)
#55     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4962:11)
#56     Element.rebuild (package:flutter/src/widgets/framework.dart:4511:5)
#57     StatefulElement.update (package:flutter/src/widgets/framework.dart:4994:5)
#58     Element.updateChild (package:flutter/src/widgets/framework.dart:3534:15)
#59     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4814:16)
#60     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4962:11)
#61     Element.rebuild (package:flutter/src/widgets/framework.dart:4511:5)
#62     BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2713:19)
#63     WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:882:21)
#64     RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:363:5)
#65     SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1144:15)
#66     SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1081:9)
#67     SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:995:5)
#71     _invoke (dart:ui/hooks.dart:151:10)
#72     PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:308:5)
#73     _drawFrame (dart:ui/hooks.dart:115:31)
(elided 3 frames from dart:async)

════════════════════════════════════════════════════════════════════════════════════════════════════
D/MIUIInput(19508): [MotionEvent] ViewRootImpl { action=ACTION_DOWN, id[0]=0, pointerCount=1, eventTime=73457063, downTime=73457063 } moveCount:0
D/MIUIInput(19508): [MotionEvent] ViewRootImpl { action=ACTION_UP, id[0]=0, pointerCount=1, eventTime=73457137, downTime=73457063 } moveCount:0
D/MIUIInput(19508): [MotionEvent] ViewRootImpl { action=ACTION_DOWN, id[0]=0, pointerCount=1, eventTime=73457640, downTime=73457640 } moveCount:0
D/MIUIInput(19508): [MotionEvent] ViewRootImpl { action=ACTION_UP, id[0]=0, pointerCount=1, eventTime=73457706, downTime=73457640 } moveCount:0

Another exception was thrown: type 'bool' is not a subtype of type 'double?' in type cast
D/MIUIInput(19508): [MotionEvent] ViewRootImpl { action=ACTION_DOWN, id[0]=0, pointerCount=1, eventTime=73458422, downTime=73458422 } moveCount:0
D/MIUIInput(19508): [MotionEvent] ViewRootImpl { action=ACTION_UP, id[0]=0, pointerCount=1, eventTime=73458496, downTime=73458422 } moveCount:0
D/MIUIInput(19508): [MotionEvent] ViewRootImpl { action=ACTION_DOWN, id[0]=0, pointerCount=1, eventTime=73459902, downTime=73459902 } moveCount:0
D/MIUIInput(19508): [MotionEvent] ViewRootImpl { action=ACTION_UP, id[0]=0, pointerCount=1, eventTime=73459975, downTime=73459902 } moveCount:0

Another exception was thrown: type 'bool' is not a subtype of type 'double?' in type cast
D/MIUIInput(19508): [MotionEvent] ViewRootImpl { action=ACTION_DOWN, id[0]=0, pointerCount=1, eventTime=73460918, downTime=73460918 } moveCount:0
D/MIUIInput(19508): [MotionEvent] ViewRootImpl { action=ACTION_UP, id[0]=0, pointerCount=1, eventTime=73460966, downTime=73460918 } moveCount:0

Thx. This also happens with ListView.

Can you post the full stack trace that shows at what line this crashes?

Sure.

Stack Trace
════════ Exception caught by widgets library ═══════════════════════════════════
The following _CastError was thrown building GridView(scrollDirection: vertical, primary: using primary controller, NeverScrollableScrollPhysics, shrinkWrap: shrink-wrapping, dependencies: [PrimaryScrollController, MediaQuery]):
type 'bool' is not a subtype of type 'double?' in type cast

The relevant error-causing widget was
GridView
lib/main.dart:60
When the exception was thrown, this was the stack
#0      ScrollPosition.restoreScrollOffset
package:flutter/…/widgets/scroll_position.dart:424
#1      new ScrollPosition
package:flutter/…/widgets/scroll_position.dart:108
#2      new ScrollPositionWithSingleContext
package:flutter/…/widgets/scroll_position_with_single_context.dart:56
#3      ScrollController.createScrollPosition
package:flutter/…/widgets/scroll_controller.dart:233
#4      ScrollableState._updatePosition
package:flutter/…/widgets/scrollable.dart:423
#5      ScrollableState.didChangeDependencies
package:flutter/…/widgets/scrollable.dart:455
#6      StatefulElement._firstBuild
package:flutter/…/widgets/framework.dart:4749
#7      ComponentElement.mount
package:flutter/…/widgets/framework.dart:4561
...     Normal element mounting (7 frames)
#14     Element.inflateWidget
package:flutter/…/widgets/framework.dart:3631
#15     MultiChildRenderObjectElement.inflateWidget
package:flutter/…/widgets/framework.dart:6261
#16     MultiChildRenderObjectElement.mount
package:flutter/…/widgets/framework.dart:6272
...     Normal element mounting (19 frames)
#35     Element.inflateWidget
package:flutter/…/widgets/framework.dart:3631
#36     Element.updateChild
package:flutter/…/widgets/framework.dart:3383
#37     SingleChildRenderObjectElement.update
package:flutter/…/widgets/framework.dart:6130
#38     Element.updateChild
package:flutter/…/widgets/framework.dart:3370
#39     SingleChildRenderObjectElement.update
package:flutter/…/widgets/framework.dart:6130
#40     Element.updateChild
package:flutter/…/widgets/framework.dart:3370
#41     RenderObjectElement.updateChildren
package:flutter/…/widgets/framework.dart:5626
#42     MultiChildRenderObjectElement.update
package:flutter/…/widgets/framework.dart:6284
#43     Element.updateChild
package:flutter/…/widgets/framework.dart:3370
#44     SingleChildRenderObjectElement.update
package:flutter/…/widgets/framework.dart:6130
#45     Element.updateChild
package:flutter/…/widgets/framework.dart:3370
#46     SingleChildRenderObjectElement.update
package:flutter/…/widgets/framework.dart:6130
#47     Element.updateChild
package:flutter/…/widgets/framework.dart:3370
#48     ComponentElement.performRebuild
package:flutter/…/widgets/framework.dart:4613
#49     Element.rebuild
package:flutter/…/widgets/framework.dart:4311
#50     StatelessElement.update
package:flutter/…/widgets/framework.dart:4669
#51     Element.updateChild
package:flutter/…/widgets/framework.dart:3370
#52     ComponentElement.performRebuild
package:flutter/…/widgets/framework.dart:4613
#53     StatefulElement.performRebuild
package:flutter/…/widgets/framework.dart:4763
#54     Element.rebuild
package:flutter/…/widgets/framework.dart:4311
#55     StatefulElement.update
package:flutter/…/widgets/framework.dart:4795
#56     Element.updateChild
package:flutter/…/widgets/framework.dart:3370
#57     ComponentElement.performRebuild
package:flutter/…/widgets/framework.dart:4613
#58     StatefulElement.performRebuild
package:flutter/…/widgets/framework.dart:4763
#59     Element.rebuild
package:flutter/…/widgets/framework.dart:4311
#60     BuildOwner.buildScope
package:flutter/…/widgets/framework.dart:2578
#61     WidgetsBinding.drawFrame
package:flutter/…/widgets/binding.dart:882
#62     RendererBinding._handlePersistentFrameCallback
package:flutter/…/rendering/binding.dart:363
#63     SchedulerBinding._invokeFrameCallback
package:flutter/…/scheduler/binding.dart:1145
#64     SchedulerBinding.handleDrawFrame
package:flutter/…/scheduler/binding.dart:1082
#65     SchedulerBinding._handleDrawFrame
package:flutter/…/scheduler/binding.dart:996
#69     _invoke (dart:ui[/hooks.dart:150:10]())
#70     PlatformDispatcher._drawFrame (dart:ui[/platform_dispatcher.dart:270:5]())
#71     _drawFrame (dart:ui[/hooks.dart:114:31]())
(elided 3 frames from dart:async)
════════════════════════════════════════════════════════════════════════════════

type 'bool' is not a subtype of type 'double?' in type cast is thrown here:
https://github.com/flutter/flutter/blob/221235c7ed1aad465b4c4a6c2d6277c954df5ccc/packages/flutter/lib/src/widgets/scroll_position.dart#L424
Reason
The reason this error is because when providing PageStorageKey to ExpansionTile, this key used to main state for ExpansionTile, which retrieves bool value from page storage for _isExpanded local variable.
https://github.com/flutter/flutter/blob/221235c7ed1aad465b4c4a6c2d6277c954df5ccc/packages/flutter/lib/src/material/expansion_tile.dart#L299
Which is also inherited by ListView or Grid View (any scrollable) to reset their position on rebuild here:
https://github.com/flutter/flutter/blob/221235c7ed1aad465b4c4a6c2d6277c954df5ccc/packages/flutter/lib/src/widgets/scroll_position.dart#L424
bool page storage key is passed to restoreScrollOffset in scroll_position.dart, which expects a double value. hence the error.
I will file a troubleshooting doc PR for this.
Related to https://github.com/flutter/flutter/issues/10867https://github.com/flutter/flutter/issues/10868

This also happens if you have an ExpansionTitle with a child of TextField like this
    return TextField(
      controller: TextEditingController(text: value),
      readOnly: true,
      key: key,
      style: style,
      textAlign: textAlign,
      decoration: InputDecoration(
        labelText: label,
        labelStyle: const TextStyle(color: Colors.blueGrey),
        border: InputBorder.none,
      ),
    );

Placing a key PageStorageKey in all my TextFields is a less than ideal solution. Would it be a better solution to make the code @TahaTesser post have a try and catch ? Maybe use a custom state object? How does PageStorage know that the double it's reading is the double it created?

@igloo12
Thanks for the comment, I agree, I'll come back to this in the near future for a solution without adding keys to children widgets.

This is also happening if SingleChildScrollView is having PaginatedDataTable as child with both having PageStorageKey. The pagestoragekey for the paginateddatatable throws a casting error of "type 'double' is not a subtype of type 'int?' in type cast".

@TahaTesser
hi any progress here?

Reason
The reason this error is because when providing PageStorageKey to ExpansionTile, this key used to main state for ExpansionTile, which retrieves bool value from page storage for _isExpanded local variable.
https://github.com/flutter/flutter/blob/221235c7ed1aad465b4c4a6c2d6277c954df5ccc/packages/flutter/lib/src/material/expansion_tile.dart#L299
Which is also inherited by ListView or Grid View (any scrollable) to reset their position on rebuild here:
https://github.com/flutter/flutter/blob/221235c7ed1aad465b4c4a6c2d6277c954df5ccc/packages/flutter/lib/src/widgets/scroll_position.dart#L424
bool page storage key is passed to restoreScrollOffset in scroll_position.dart, which expects a double value. hence the error.

Why not just let the user handle the state and set _isExpanded to whatever is provided to the widget via initiallyExpanded, changing expansion_tile.dart like so:
_isExpanded = widget.initiallyExpanded;


Add chat model open ai proxy url params

Add Proxy URL option for Open AI chat model

awesome! are you able to test is using proxy?

great, i will try

Add Proxy URL option for Open AI chat model

I have setup a squid server as proxy and it's worked, hope this can help anyone got this open ai api error: unsupported_country_region_territory

I have setup a squid server as proxy and it's worked, hope this can help anyone got this open ai api error: unsupported_country_region_territory

what time the commit will merge to main branch?

I have setup a squid server as proxy and it's worked, hope this can help anyone got this open ai api error: unsupported_country_region_territory

what time the commit will merge to main branch?

i dont have any permission to merge so anyone can help?

thanks @thanhtung100397

what to use the param?
i have build a proxy for openai.

thanks @thanhtung100397

what to use the param? i have build a proxy for openai.
this is error log 2024-09-10 09:25:36 [INFO]: [server]: Chatflow dc4c428f-5278-465e-ad9a-bf6b3bdb5074 added into ChatflowPool 2024-09-10 09:27:01 [ERROR]: [server]: Error: Connection error. Error: Connection error. at OpenAI.makeRequest (/Users/dexwang/sourcecode/Flowise/node_modules/.pnpm/openai@4.51.0_encoding@0.1.13/node_modules/openai/core.js:304:19) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async /Users/dexwang/sourcecode/Flowise/node_modules/.pnpm/@langchain+openai@0.0.30_encoding@0.1.13_langchain@0.2.11_@aws-sdk+client-s3@3.529.1_@aws-sdk_xdehwmr5gttavnvrwzf5jjmfv4/node_modules/@langchain/openai/dist/chat_models.cjs:760:29 at async RetryOperation._fn (/Users/dexwang/sourcecode/Flowise/node_modules/.pnpm/p-retry@4.6.2/node_modules/p-retry/index.js:50:12)

You can follow my step

Here is the sample input for proxy url
(proxy without user/pass): http://<IP_ADDRESS>:3128
(proxy with user/pass): http://user:pass@<IP_ADDRESS>:3128

Hi, do I need to fill in the proxy URL every time I use OpenAI API?
Is there a better way to management?

Hi, do I need to fill in the proxy URL every time I use OpenAI API? Is there a better way to management?

At the moment, you need to input proxy url for every new ChatOpenAI node added to chatflow
I know it's better if we have a new ui to manage proxy url globaly... just like api key management ui


python REPL tool not working the for code execution

Checked other resources

[X] I added a very descriptive title to this issue.
[X] I searched the LangGraph/LangChain documentation with the integrated search.
[X] I used the GitHub search to find a similar question and didn't find it.
[X] I am sure that this is a bug in LangGraph/LangChain rather than my code.
[X] I am sure this is better as an issue rather than a GitHub discussion, since this is a LangGraph bug and not a design question.

Example Code
This is the requirement.
How to run/execute Python codes using the pythonRepl tool?
The tool should be one node in the graph.
The just above node creates the Python code and pass to the node that contains the pythonRepl tool
code I tried
from langchain_experimental.utilities import PythonREPL
from langchain_core.tools import tool
repl = PythonREPL()

@tool
def python_repl(code):
    """
    Use this to execute python code without any kind of error.

    """
    try:
        print("Result of code execution here")
        result = repl.run(code)
        print("Result of code execution",result)
    except BaseException as e:
        return f"Failed to execute. Error :  {repr(e)}"

    return f"{result}"

def codeExecution(cls, state: State) -> State:
        codeToExecute = state['codeToExecute']
        print("codeToExecute")
        print(codeToExecute)
        llm_with_tools = llm.bind_tools([python_repl])
        messages = [
            SystemMessage(
                content=""" You have got the task to execute code. Use the python_repl tool to execute it. I will a message and your task is to detect if it was successfully run or produced an error.
                    If the code produced an error just return "True". If it was successfully executed, return "False" """
            ),
            HumanMessage(content=codeToExecute),
        ]
        ai_msg = llm_with_tools.invoke(messages)
        messages.append(ai_msg)
        for tool_call in ai_msg.tool_calls:
            selected_tool = {"python_repl": python_repl}[tool_call["name"].lower()]
            tool_output = selected_tool.invoke(tool_call["args"])
            state["error_message"] = tool_output
            messages.append(ToolMessage(tool_output, tool_call_id=tool_call["id"]))

        result = llm_with_tools.invoke(messages)
        state["error"] = result.content
        return state

Error Message and Stack Trace (if applicable)
File "<path>.local/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/exec_code.py", line 88, in exec_func_with_error_handling
    result = func()
  File "<path>.local/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 579, in code_to_exec
    exec(code, module.__dict__)
  File "<path>file", line 85, in <module>
    executeGraph(taskSpecificGraph,query,st.session_state.datasetColumnNames,st.session_state.datasetPath)
  File "<path>file.py", line 368, in executeGraph
    graphExecutionResult = taskSpecificGraph.invoke({"query": query,"datasetColumnNames":datasetColumnNames,"datasetPath":datasetPath,"iterations": 1})
  File "<path>.local/lib/python3.9/site-packages/langgraph/pregel/__init__.py", line 1263, in invoke
    for chunk in self.stream(
  File "<path>.local/lib/python3.9/site-packages/langgraph/pregel/__init__.py", line 948, in stream
    _panic_or_proceed(done, inflight, loop.step)
  File "<path>.local/lib/python3.9/site-packages/langgraph/pregel/__init__.py", line 1349, in _panic_or_proceed
    raise exc
  File "<path>.local/lib/python3.9/site-packages/langgraph/pregel/executor.py", line 60, in done
    task.result()
  File "/usr/lib/python3.9/concurrent/futures/_base.py", line 439, in result
    return self.__get_result()
  File "/usr/lib/python3.9/concurrent/futures/_base.py", line 391, in __get_result
    raise self._exception
  File "/usr/lib/python3.9/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "<path>.local/lib/python3.9/site-packages/langgraph/pregel/retry.py", line 25, in run_with_retry
    task.proc.invoke(task.input, task.config)
  File "<path>.local/lib/python3.9/site-packages/langchain_core/runnables/base.py", line 2878, in invoke
    input = context.run(step.invoke, input, config)
  File "<path>.local/lib/python3.9/site-packages/langgraph/utils.py", line 102, in invoke
    ret = context.run(self.func, input, **kwargs)
  File "<path>.local/lib/python3.9/site-packages/langgraph/graph/graph.py", line 82, in _route
    return self._finish(writer, input, result)
  File "<path>.local/lib/python3.9/site-packages/langgraph/graph/graph.py", line 109, in _finish
    destinations = [r if isinstance(r, Send) else self.ends[r] for r in result]
  File "<path>.local/lib/python3.9/site-packages/langgraph/graph/graph.py", line 109, in <listcomp>
    destinations = [r if isinstance(r, Send) else self.ends[r] for r in result]
KeyError: None

### Description

How to run/execute Python codes using the pythonRepl tool?
The tool should be one node in the graph.
The just above node creates the Python code and pass to the node that contains the pythonRepl tool
If any error occurs, we should get the error message also from the tool

### System Info

ubuntu OS
langchain==0.2.16
langchain-community==0.2.16
langchain-core==0.2.39
langchain-experimental==0.0.64
langgraph==0.1.14
langgraph-checkpoint==1.0.11

It is recommended to first upgrade the package.
And use the prebuilt ToolNode (from langgraph.prebuilt import ToolNode) to handle the ToolMessage part.

@gbaian10 upgrade to which version? the latest langgraph versions are seems unstable

Version 0.2.x has been out for a while and should be stable.
Additionally, langchain_core has reached version 0.3.x.

Here is the code i tried
from langchain_core.messages import HumanMessage, SystemMessage,ToolMessage
def read_code_from_file(file_path: str) -> str:
    with open(file_path, "r") as file:
        code = file.read()
    return code

def write_code_to_file(file_path: str, code: str):
    with open(file_path, "w") as file:
        file.write(code)

from typing import Annotated
from langchain_experimental.utilities import PythonREPL
from langchain_core.tools import tool

repl = PythonREPL()

@tool
def python_repl(code: Annotated[str, "filename to read the code from"]):
    """Use this to execute python code read from a file. If you want to see the output of a value,
    Make sure that you read the code from correctly
    you should print it out with `print(...)`. This is visible to the user."""

    try:
        result = repl.run(code)
        print("RESULT CODE EXECUTION:", result)
    except BaseException as e:
        return f"Failed to execute. Error: {repr(e)}"
    return f"Executed:\n```python\n{code}\n```\nStdout: {result}"

from langchain_openai import AzureChatOpenAI
model = AzureChatOpenAI(
)
model_with_tools = model.bind_tools([python_repl])

from typing import TypedDict

class AgentState(TypedDict):
    error: bool
    error_message: str
    file_path: str
    code: str
    iterations: int

def identify_filepath(state: AgentState):
    state["file_path"] = 'testscript.py'
    return state

def execute_code_with_model(state: AgentState):
    code = read_code_from_file(state["file_path"])
    print("code iss")
    print(code)
    model_with_tools = model.bind_tools([python_repl])

    messages = [
        SystemMessage(
            content=""" You have got the task to execute code. Use the python_repl tool to execute it. I will give the message and your task is to detect if it was successfully run or produced an error.
            If the code produced an error just return 'True'. If it was sucessfully executed, return 'False'"""
        ),
        HumanMessage(content=code),
    ]

    ai_msg = model_with_tools.invoke(messages)
    messages.append(ai_msg)
    for tool_call in ai_msg.tool_calls:
        print("tool_call")
        print(tool_call)
        selected_tool = {"python_repl": python_repl}[tool_call["name"].lower()]
        tool_output = selected_tool.invoke(tool_call["args"])
        state["error_message"] = tool_output
        messages.append(ToolMessage(tool_output, tool_call_id=tool_call["id"]))

    result = model_with_tools.invoke(messages)
    print("EVALUATION RESULT:", result)
    state["error"] = result.content
    return state

def rewrite_code(state: AgentState):

    code = state["code"]
    error = state["error_message"]
    state["iterations"] += 1
    messages = [
        SystemMessage(
            content="You can to analyze the following code and error provided in the usermessage. Your task is to fix that code and provide the user the correct new code. VERY IMPORTANT: ONLY RETURN THE UPDATED CODE, NOTHING ELSE! Dont use a markdown style, just the code as Text"
        ),
        HumanMessage(content=f"Code: {code} | Error: {error}"),
    ]
    ai_msg = model.invoke(messages)
    print("NEW SUGGESTED CODE:", ai_msg.content)
    write_code_to_file(file_path=f'{state["file_path"]}', code=ai_msg.content)
    state["code"] = ai_msg.content
    return state

def next_step(state: AgentState):
    if state["iterations"] > 3:
        print("Max Iterations done.... Exit Agent")
        return "max_iterations"
    if state["error"] == "True":
        print(f"Error in {state['file_path']}. {state['iterations']} tries done")
        return "error"
    if state["error"] == "False":
        print(
            f"Code was probably fixed... check out {state['file_path']} if it is correct"
        )
        return "ok"

from langgraph.graph import END, StateGraph

workflow = StateGraph(AgentState)

workflow.add_node("identify_filepath", identify_filepath)
workflow.add_node("execute_code_with_model", execute_code_with_model)
workflow.add_node("rewrite_code", rewrite_code)

workflow.set_entry_point("identify_filepath")
workflow.add_edge("identify_filepath", "execute_code_with_model")

workflow.add_conditional_edges(
    "execute_code_with_model",
    next_step,
    {"error": "rewrite_code", "ok": END, "max_iterations": END},
)
workflow.add_edge("rewrite_code", "execute_code_with_model")
app = workflow.compile()

app.invoke({"iterations": 1})

I haven't looked at the content above yet, but I just wrote one.
You can try it to see if it's the result you want.
from dotenv import load_dotenv
from langchain_core.prompts import ChatPromptTemplate
from langchain_core.tools import tool
from langchain_experimental.utilities import PythonREPL
from langchain_openai import ChatOpenAI
from langgraph.graph import START, MessagesState, StateGraph
from langgraph.prebuilt import ToolNode, tools_condition

load_dotenv()
repl = PythonREPL()

@tool
def python_repl(code: str) -> str:
    """Use this to execute python code."""
    try:
        print("Result of code execution here")
        result = repl.run(code)
        print(result)
    except BaseException as e:
        return f"Failed to execute. Error :  {e!r}"
    else:
        return f"Result of code execution {result}"

system_content = """
You have got the task to execute code.
Use the python_repl tool to execute it.
I will a message and your task is to detect if it was successfully run or produced an error.
If the code produced an error just return "True" (Example: SyntaxError, ZeroDivisionError, ...).
If it was successfully executed, return "False"
"""
prompt = ChatPromptTemplate([("system", system_content), ("placeholder", "{messages}")])
tools = [python_repl]
llm = ChatOpenAI(model="gpt-4o-mini")
llm_with_tools = llm.bind_tools(tools)
chain = prompt | llm_with_tools

def code_to_execution(state: MessagesState) -> MessagesState:
    outputs = chain.invoke({"messages": state["messages"]})
    return {"messages": outputs}

workflow = StateGraph(MessagesState)
workflow.add_node("has_error", code_to_execution)
workflow.add_node("tools", ToolNode(tools=tools))

workflow.add_edge(START, "has_error")
workflow.add_conditional_edges("has_error", tools_condition)
workflow.add_edge("tools", "has_error")

app = workflow.compile()

if __name__ == "__main__":
    outputs = app.invoke({"messages": [("human", "print('Hello World')")]})
    print(outputs["messages"][-1].content)

    outputs = app.invoke({"messages": [("human", "1 + ")]})
    print(outputs["messages"][-1].content)

    outputs = app.invoke({"messages": [("human", "1 + '1'")]})
    print(outputs["messages"][-1].content)

    outputs = app.invoke({"messages": [("human", "1 / 0")]})
    print(outputs["messages"][-1].content)

Nothing happened.
I put a sample Python program to save a txt file
import os
my_string = "This is a sample string to be saved in a file."
file_name = "output.txt"
with open(file_name, "w") as file:
    file.write(my_string)
print(f"String saved in {os.path.join(os.getcwd(), file_name)}")

And passed to the app.
current_program = """
import os
my_string = "This is a sample string to be saved in a file."
file_name = "output.txt"
with open(file_name, "w") as file:
    file.write(my_string)
print(f"String saved in {os.path.join(os.getcwd(), file_name)}")
"""

outputs = app.invoke({"messages": [("human", current_program)]})
print(outputs["messages"][-1].content)

This is the response
content='' additional_kwargs={'tool_calls': [{'id': 'call_LgBNd46hctrnufN1RagRaAEL', 'function': {'arguments': 'from typing import Any\nfrom functions import python_repl\n\ndef execute_code() -> Any:\n    code = """\nimport os\nmy_string = "This is a sample string to be saved in a file."\nfile_name = "output.txt"\nwith open(file_name, "w") as file:\n    file.write(my_string)\nprint(f"String saved in {os.path.join(os.getcwd(), file_name)}")\n    """\n    try:\n        python_repl(code=code)\n    except Exception as e:\n        return str(e)\n    else:\n        return True\n\n\nexecute_code()', 'name': 'python'}, 'type': 'function'}], 'refusal': None} response_metadata={'token_usage': {'completion_tokens': 121, 'prompt_tokens': 197, 'total_tokens': 318, 'completion_tokens_details': None, 'prompt_tokens_details': None}, 'model_name': 'gpt-35-turbo', 'system_fingerprint': None, 'finish_reason': 'tool_calls', 'logprobs': None, 'content_filter_results': {}} id='run-3bfde0a4-baa1-4b87-bde1-1831f640d9cc-0' invalid_tool_calls=[{'name': 'python', 'args': 'from typing import Any\nfrom functions import python_repl\n\ndef execute_code() -> Any:\n    code = """\nimport os\nmy_string = "This is a sample string to be saved in a file."\nfile_name = "output.txt"\nwith open(file_name, "w") as file:\n    file.write(my_string)\nprint(f"String saved in {os.path.join(os.getcwd(), file_name)}")\n    """\n    try:\n        python_repl(code=code)\n    except Exception as e:\n        return str(e)\n    else:\n        return True\n\n\nexecute_code()', 'id': 'call_LgBNd46hctrnufN1RagRaAEL', 'error': 'Function python arguments:\n\nfrom typing import Any\nfrom functions import python_repl\n\ndef execute_code() -> Any:\n    code = """\nimport os\nmy_string = "This is a sample string to be saved in a file."\nfile_name = "output.txt"\nwith open(file_name, "w") as file:\n    file.write(my_string)\nprint(f"String saved in {os.path.join(os.getcwd(), file_name)}")\n    """\n    try:\n        python_repl(code=code)\n    except Exception as e:\n        return str(e)\n    else:\n        return True\n\n\nexecute_code()\n\nare not valid JSON. Received JSONDecodeError Expecting value: line 1 column 1 (char 0)', 'type': 'invalid_tool_call'}] usage_metadata={'input_tokens': 197, 'output_tokens': 121, 'total_tokens': 318, 'input_token_details': {}, 'output_token_details': {}}

And could not see any saved file in my local directory.

I executed it normally, but I see you're using a different model.I think the model might have changed the code.
You should check LangSmith to see what happened.
However, I see your code.
You might execute some private behavior code, which shouldn't be passed to the LLM, and there are also concerns about the model changing the code.
So I suggest using InjectedState to avoid passing the code to the LLM.
I adjusted the code as follows; you can try it out.
from typing import Annotated

from dotenv import load_dotenv
from langchain_core.prompts import ChatPromptTemplate
from langchain_core.tools import tool
from langchain_experimental.utilities import PythonREPL
from langchain_openai import ChatOpenAI
from langgraph.graph import START, MessagesState, StateGraph
from langgraph.prebuilt import InjectedState, ToolNode, tools_condition

load_dotenv()
repl = PythonREPL()

class State(MessagesState):
    code: str

@tool
def python_repl(state: Annotated[State, InjectedState]) -> str:
    """Use this to execute python code."""
    try:
        print("Result of code execution here")
        result = repl.run(state["code"])
        print(result)
    except BaseException as e:
        return f"Failed to execute. Error :  {e!r}"
    else:
        return f"Result of code execution {result}"

system_content = """If the user requests to execute code to call 'python_repl' tool

If the code produced an error just return "True" (Example: SyntaxError, ZeroDivisionError, ...).
If it was successfully executed, return "False"
"""
prompt = ChatPromptTemplate([("system", system_content), ("placeholder", "{messages}")])
tools = [python_repl]
llm = ChatOpenAI(model="gpt-4o-mini")
llm_with_tools = llm.bind_tools(tools)
chain = prompt | llm_with_tools

def code_to_execution(state: State) -> State:
    outputs = chain.invoke({"messages": state["messages"]})
    return {"messages": outputs}

workflow = StateGraph(State)
workflow.add_node("has_error", code_to_execution)
workflow.add_node("tools", ToolNode(tools=tools))

workflow.add_edge(START, "has_error")
workflow.add_conditional_edges("has_error", tools_condition)
workflow.add_edge("tools", "has_error")

app = workflow.compile()

current_program = """
import os
my_string = "This is a sample string to be saved in a file."
file_name = "output.txt"
with open(file_name, "w") as file:
    file.write(my_string)
print(f"String saved in {os.path.join(os.getcwd(), file_name)}")
"""

if __name__ == "__main__":
    outputs = app.invoke(
        {"messages": [("human", "Run this code.")], "code": current_program}
    )
    print(outputs["messages"][-1].content)

However, I believe the normal use case should be that you use natural language to make requests to the LLM, which then converts them into code.
Then execute this code through the REPL to verify its effectiveness.

@gbaian10
I am using  gpt3.5 via AzureChatOpenAI and in your code I can see it is gpt-4o-mini via ChatOpenAI.
Will it cause any issue?

gpt-3.5 isn't smart enough; in the original logic, it needs to echo the code from your request.
During this output process, the code might become different from what you originally intended.
I suggest checking the process in LangSmith.
In your example, you've already prepared the correct or incorrect code. We shouldn't need the model to repeat the code, as this might cause errors and make the response lengthy.
The model only needs to know when to call the tool and when it has executed and obtained the results to provide an answer.


Redundant LINENUMBER opcodes may be removed

This is the bytecode for my Java method:
  // access flags 0x1
  public plain()J
  @Lorg/openjdk/jmh/annotations/Benchmark;()
   L0
    LINENUMBER 62 L0
    LCONST_0
    LSTORE 1
   L1
    LINENUMBER 63 L1
    ICONST_0
    ISTORE 3
   L2
   FRAME APPEND [J I]
    ILOAD 3
    GETSTATIC org/eolang/benchmark/Big.VALUES : [Ljava/lang/Object;
    ARRAYLENGTH
    IF_ICMPGE L3
   L4
    LINENUMBER 64 L4
    GETSTATIC org/eolang/benchmark/Big.VALUES : [Ljava/lang/Object;
    ILOAD 3
    AALOAD
    CHECKCAST java/lang/String
    INVOKEVIRTUAL java/lang/String.trim ()Ljava/lang/String;
    ASTORE 4
   L5
    LINENUMBER 65 L5
    ALOAD 4
    INVOKEVIRTUAL java/lang/String.length ()I
    ICONST_4
    IF_ICMPEQ L6
   L7
    LINENUMBER 66 L7
    GOTO L8
   L6
    LINENUMBER 68 L6
   FRAME APPEND [java/lang/String]
    LLOAD 1
    ALOAD 4
    BIPUSH 16
    INVOKESTATIC java/lang/Long.parseLong (Ljava/lang/String;I)J
    LCONST_1
    LADD
    LADD
    LSTORE 1
   L8
    LINENUMBER 63 L8
   FRAME CHOP 1
    IINC 3 1
    GOTO L2
   L3
    LINENUMBER 70 L3
   FRAME CHOP 1
    LLOAD 1
    LRETURN
   L9
    LOCALVARIABLE str Ljava/lang/String; L5 L8 4
    LOCALVARIABLE idx I L2 L3 3
    LOCALVARIABLE this Lorg/eolang/benchmark/Big; L0 L9 0
    LOCALVARIABLE acc J L1 L9 1
    MAXSTACK = 6
    MAXLOCALS = 5

I see many LINENUMBER opcodes (actually, one per every Java line), which are not necessary and may easily be eliminated before translating this code to XMIR. This will simplify XMIR and increase its readability (and speed of processing).

@yegor256 We don't save line numbers in XMIR representation. We have it only in the listing element (that exists only for informational purposes)

@yegor256 Indeed. You are almost right.  Actually, we have both of them: 1) line numbers and 2) labels. We don't convert line numbers to labels. We have both of them independently. Usually labels serve as target points for other jump instructions, for example as for goto in your example:
L2
...
GOTO L2

But sometimes, there are labels that are only targets for lines:
L0
...
LINENUMBER 62 L0

We can try to remove these labels that are used only by line entries, and it will indeed reduce the size of xmir and might even speed up the entire pipeline a bit. However, I’m afraid that, in this case, we might need to perform an analysis that could negate the possible performance boost. At least I can try.

@volodya-lombrozo if GOTO is the only opcode that uses labels, it seems, you can easily (and quickly) find unused labels

@yegor256 Labels might be used by try-catch statements as well. The exception table is placed separately from the instructions set. This might complicate things a bit. Moreover, labels might serve some other purposes which we don't see for now. I will try to do to remove such label. But, please, don't underestimate the problem:

you can easily (and quickly) find unused labels

We don't know yet.

@yegor256 the puzzle #893 is still not solved.

@rultor release, tag is 0.6.20, title is 0.6.20

@rultor release, tag is 0.6.20, title is 0.6.20

@volodya-lombrozo OK, I will release it now. Please check the progress here.

@rultor release, tag is 0.6.20, title is 0.6.20

@volodya-lombrozo Done! FYI, the full log is here (took me 17min).

@yegor256 Would you mind trying the new 0.6.20 version, please?

@yegor256 friendly reminder

@yegor256 the only puzzle #893 is solved here.


feat(wb): support --dry / -d

Allow users to check what commands will be executed

Done via 97025d6730ee21c35d3407cf13e5819574500f05


Add specs for accept multiple direct paths

Merged in upstream https://github.com/fastlane-community/xcov/pull/196


Create Parking Areas Info sub-screen for the management GUI

As described in issue #93, the second screen of the management's manually edit feature contains the current information about the selected parking slot area(#94) such as sticker color, number of free parking slots, total parking slots, etc.
It also has an 'Update' button leading to the screen in issue #96, and a 'Back' button leading to the screen in issue #94.
The issue will be closed when the screen is ready.

This sub-screen is integrated in the main manager panel, so we can consider it as done.
@matityahuinba (#93) please pay attention that we will need a function to collect the data (parking areas info about slots) from the server so that we will be able to show them.
The GUI is set and therefore I'm closing the issue.


Adds support for create-react-native-app, Expo, and more!

If you have an existing project and still want to use ignite:
ignite attach
This works great for:

create-react-native-app
Expo
create-react-app
normal React JS projects
empty directories ( not even joking! you can use this with other programming languages.  :O )

Gluegun FTW.

Go home CI. You're drunk.

Still investigating why CI is failing. It can't finish installing npm packages.

Ok, i just cleared the cache on Semaphore.  ¯\(ツ)/¯

I was just about to create this issue! Thanks Steve! Excited to see this happening :)

After running ignite attach and try to add the generators.


Forward/rel/6.4

@ironman-machine

Hello @electrachong
Starting end to end procedure using the following payload:
{"REPO_NAME": "S3", "SCALITY_S3_BRANCH": "forward/rel/6.4", "DEFAULT_BRANCH": "master"}
Please follow http://ci.ironmann.io/gh/scality/Integration/8925 for CI status.

closed in favor of https://github.com/scality/S3/pull/574


Alpine image build time unnecessarily blocks ci workflow

The alpine image takes about 35 minutes to build in travis-ci and between 30 minutes and another hour on Docker Hub. Some changes (README.md, anything in bin/, etc.) don't require running the full test suite.
Create a script to control which travis-ci tests are executed based on which files have been updated.

I've merged #46 as a first attempt at this.

...through #52.

So far so good. There's still something odd with the branch names in PR builds I need to look into but it looks like the correct tests are running.

Also #58 through #62. Everything is looking good, branch names all seem correct and all the correct tests appear to run. Closing.


Fix Fix the issue when string col has mixed plain and dict encoding in different stripes.

Proposed changes
backport #34146
Further comments
If this is a relatively large or complex change, kick off the discussion at<EMAIL_ADDRESS>by explaining why you chose the solution you did and what alternatives you considered, etc...

run buildall

run buildall


Add CICS transaction list

CICS is an application server running on IBM mainframes. This PR adds a list of the default and demo IBM transactions.
Think of transactions like paths/pages on a web server.

Thank you!
And sorce (from the PR) ~ https://www.ibm.com/support/knowledgecenter/SSGMCP_5.4.0/reference/transactions/dfha726.html


Will Toon first map post

Uploaded a portfolio post for the first map. Unfortunately, I ran into some issues exporting the geometry for CU (and other locations) from OpenStreetMap. If you guys found any specific ways to enter your points of interest to do this, please let me know as I currently just have an unexciting map with a point!

Thanks @WillToon I went ahead and merged!


⚠ Bofrost.at has degraded performance

In 4a69021, Bofrost.at (https://www.bofrost.at) experienced degraded performance:

HTTP code: 200
Response time: 2957 ms

Resolved: Bofrost.at performance has improved in 4871093 after 13 minutes.


Using with Formik's field.onBlur and form.touched is resetting formik errors

Environment

Tech
Version

material-ui-pickers
2.0.5

material-ui
3.7.1

React
16.7.0

Browser
Chrome 71.0

Peer library
moment 2.23.0 and @date-io/moment 0.0.2

Steps to reproduce

Use Formik's Field component in combination with your DatePicker component
Pass Formik's onBlur to the DatePicker
Change the date to an invalid value and see no error

Expected behavior

See an error
Actual behavior

No error
Live example

https://codesandbox.io/s/xv73w1vvrw
In this code there are 2 components:

MyDateFormField This one has no onBlur
MyOtherDateFormField This one uses onBlur and form.touched

When you now make the date invalid (for example: just insert a letter). Then you can see, that the first DatePicker shows an error, but the second one doesn't. Even worse: The second one also removes all errors from the first one.
I've also added a console.log inside both components. There you can see, that for the second (the broken one) it makes 3 outputs for every change to the field. And even more weird it outputs false, true, false for showError (and accordingly undefined, Invalid Date Format, undefined for the fieldError variable.
I'm not sure what's going on there. Or am I just "using it wrong"?

Fixed in v3


⚠ ClamAV has degraded performance

In 0bf43bf, ClamAV (https://spamassassin.apache.org/) experienced degraded performance:

HTTP code: 200
Response time: 80 ms

Resolved: ClamAV performance has improved in b5f3ba9.


In Docker: unknown short flag '-b', try --help

telly release with the issue:

Container fails. Latest docker version from 05.09.2018
Last working telly release (if known):
before move to tellytv/telly
Operating environment (Docker/Windows/Linux/QNAP, etc.):

Docker on Debian 9 with Docker 18.06.1-ce
docker-compose 1.21.2
Description of problem:
Container immediately fails.
$ docker logs docker-compose_telly_1
app: error: unknown short flag '-b', try --help
Can not execute any commands via docker exec as it is immediately failing
docker-compose.yml:
version: '3'
services:
telly:
image: tellytv/telly
ports:
- 6077:6077
environment:
- TZ=Europe/Paris
- TELLY_IPTV_PLAYLIST=https://api.init7.net/tvchannels.m3u
- TELLY_WEB_LISTEN_ADDRESS=telly:6077
- TELLY_IPTV_STREAMS=1
- TELLY_DISCOVERY_FRIENDLYNAME=Tuner1
- TELLY_DISCOVERY_DEVICEID=12345699
command: -base=telly:6077

**telly or docker log:**

app: error: unknown short flag '-b', try --help

This is actually not required to get it running in Docker. I see you are using the master branch, I recommend also checking out the dev version: https://github.com/tellytv/telly/tree/dev
This has some improvements like a config file instead of env variables.

Thanks. Moved to the dev-ffmpeg branch and got it working


KMeans Clustering Data Type Error

I am attempting to execute the following code.
##############################
from sklearn.datasets import make_blobs
from dask_ml.cluster import KMeans
x, y = make_blobs(n_samples = 100000, n_features = 2)
model = KMeans()
model.fit(x)
##############################
But it generates the following error.
##############################
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\tl928yx\AppData\Local\Programs\Python\Python37\lib\site-packages\dask_ml\cluster\k_means.py", line 199, in fit
tol=self.tol,
File "C:\Users\tl928yx\AppData\Local\Programs\Python\Python37\lib\site-packages\dask_ml\cluster\k_means.py", line 270, in k_means
init_max_iter=init_max_iter,
File "C:\Users\tl928yx\AppData\Local\Programs\Python\Python37\lib\site-packages\dask_ml\cluster\k_means.py", line 518, in _kmeans_single_lloyd
max_iter=init_max_iter,
File "C:\Users\tl928yx\AppData\Local\Programs\Python\Python37\lib\site-packages\dask_ml\cluster\k_means.py", line 361, in k_init
return init_scalable(X, n_clusters, random_state, max_iter, oversampling_factor)
File "C:\Users\tl928yx\AppData\Local\Programs\Python\Python37\lib\site-packages\dask_ml\utils.py", line 334, in wraps
results = f(*args, **kwargs)
File "C:\Users\tl928yx\AppData\Local\Programs\Python\Python37\lib\site-packages\dask_ml\cluster\k_means.py", line 459, in init_scalable
rng2 = random_state.randint(0, 2 ** 32 - 1, chunks=()).compute().item()
File "C:\Users\tl928yx\AppData\Local\Programs\Python\Python37\lib\site-packages\dask\array\random.py", line 336, in randint
size=size, chunks=chunks)
File "C:\Users\tl928yx\AppData\Local\Programs\Python\Python37\lib\site-packages\dask\array\random.py", line 122, in _wrap
**small_kwargs).dtype
File "mtrand.pyx", line 991, in mtrand.RandomState.randint
ValueError: high is out of bounds for int32
##############################
Python Version 3.7.0
Dask Version 0.19.2
Dask_ml Version 0.10.0
Dask-glm Version 0.1.0
##############################
Thank you

Hrm I thought we fixed all these...
https://github.com/dask/dask-ml/blob/master/dask_ml/cluster/k_means.py#L459 should be
        rng2 = random_state.randint(0, np.iinfo('i4').max, - 1, chunks=()).compute().item()

and that compute should probably use the scheduler='single-threaded' keyword.

FYI, you can work around this for now my specifying model=KMeans(random_state=0) or any integer.

Thank you for the quick response.  Changing line 459 is resulting in the following error.
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\tl928yx\AppData\Local\Programs\Python\Python37\lib\site-packages\dask_ml\cluster\k_means.py", line 199, in fit
tol=self.tol,
File "C:\Users\tl928yx\AppData\Local\Programs\Python\Python37\lib\site-packages\dask_ml\cluster\k_means.py", line 270, in k_means
init_max_iter=init_max_iter,
File "C:\Users\tl928yx\AppData\Local\Programs\Python\Python37\lib\site-packages\dask_ml\cluster\k_means.py", line 518, in _kmeans_single_lloyd
max_iter=init_max_iter,
File "C:\Users\tl928yx\AppData\Local\Programs\Python\Python37\lib\site-packages\dask_ml\cluster\k_means.py", line 361, in k_init
return init_scalable(X, n_clusters, random_state, max_iter, oversampling_factor)
File "C:\Users\tl928yx\AppData\Local\Programs\Python\Python37\lib\site-packages\dask_ml\utils.py", line 334, in wraps
results = f(*args, **kwargs)
File "C:\Users\tl928yx\AppData\Local\Programs\Python\Python37\lib\site-packages\dask_ml\cluster\k_means.py", line 459, in init_scalable
rng2 = random_state.randint(0, np.iinfo('i4').max, - 1, chunks=()).compute().item()
File "C:\Users\tl928yx\AppData\Local\Programs\Python\Python37\lib\site-packages\dask\array\random.py", line 336, in randint
size=size, chunks=chunks)
File "C:\Users\tl928yx\AppData\Local\Programs\Python\Python37\lib\site-packages\dask\array\random.py", line 75, in _wrap
dtype=kwargs.get('dtype', np.float64))
File "C:\Users\tl928yx\AppData\Local\Programs\Python\Python37\lib\site-packages\dask\array\core.py", line 2154, in normalize_chunks
"Got chunks=%s, shape=%s" % (chunks, shape))
ValueError: Chunks and shape must be of the same length/dimension. Got chunks=(), shape=(-1,)

Sorry, typo in my code snippet. Fixed.

Works!  Thank you!


To add ability to search for list of controls by attribute in page object

For now if it’s necessary to find list of controls in page object the only way is to use direct call of FindList<> from parent container while single controls could be found by [Find] attribute.

done in c9bc4b3


Flow doesn't seem to understand default values in array destructuring

From the Firefox console:
const [a, b = {}, c = {}] = [1, {a: 1}];
a
1
b
Object { a: 1 }
c
Object {  }

https://tryflow.org/?code=Y29uc3QgW2EsIGIgPSB7fSwgYyA9IHt9XSA9IFsxLCB7YTogMX1dOw==
in flow:
assignment of identifier `c`. Could not resolve name

Thanks for the report!

the default causes flow to parse the default and subsequent array elements as a sequence expression.
slightly simpler repro: https://flowtype.org/try/#0PQKgBAAgZgNg9gdzCYAoVBjOA7AzgFzAG0BDAXgEYAaDAXTDOOrACZaBuIA
check out the AST. the right side of the AssignmentPattern is incorrectly a SequenceExpression.


wildfly component gets broken after storage is added

Steps to reproduce
git clone https://github.com/marekjelen/katacoda-odo-backend.git
cd /katacoda-odo-backend.
odo create wildfly
odo push
odo url create

# go to `<url>/counter`
# counter works

odo storage create data --path /data --size 100M

# wait a bit
# go to `<url>/counter`
# 404 - Not Found

odo push
# go to `<url>/counter`
# counter works

Reason why component gets broken is because widlfly assemble script moves compiled files to  /wildfly/standalone/deployments
Moving all war artifacts from /opt/app-root/src/target directory into /wildfly/standalone/deployments for later deployment...
'/opt/app-root/src/target/ROOT.war' -> '/wildfly/standalone/deployments/ROOT.war'
removed '/opt/app-root/src/target/ROOT.war'

Path /wildfly/standalone/deployments is not backed by persistent volume, so when deploymentConfig is modified (new mount is added) and new deployment is triggered we lose all data that were not in persistent volume.
This is wildfly specific issue. When I tested this with nodejs or php images everything was ok, as they leave and serve all data from /opt/app-root/ and we create persistent volume for this path by default.

c) is a generic solution and should work for every assemble script that is copying compiled or processed artifacts away from /opt/app-root/.
The only downside of this that I can think of right now is that It shows down container startup time (component creation time)

I forgot that wildfly script moves files from its original location. So to this approach won't work :-(

@kadel I think we should look into having a pre-backed  image with a supervisor in go (this could be a good start: https://github.com/ochinchina/supervisord) and have all the required logic scripts in that init-container image.
Then any preparation for any s2i image would be as simple as run this initContainer (or possibly 2 initContainers)
@grahamdumpleton, it would be awesome if you get to help us make this task as lean as possible

@cdrage can you please verify if this is still an issue with new supevisord?
I expect that nothing changed here. We should start looking into the solution as this will be part of https://github.com/redhat-developer/odo/issues/807

@kadel
I can confirm that this still does not work..
``sh
github.com/redhat-developer/odo  master ✔                                                                                1h20m
▶ ./odo push
Pushing changes to component: wildfly
Please wait, building component....

set -eo pipefail
'[' -f /opt/app-root/src/.s2i/bin/assemble ']'
'[' -f /usr/local/s2i/assemble ']'
/usr/libexec/s2i/assemble
cp: cannot stat '/opt/s2i/destination/src/.': No such file or directory
Found pom.xml... attempting to build with 'mvn package -Popenshift -DskipTests -B -s /opt/app-root/src/.m2/settings.xml'
Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-17T18:33:14Z)
Maven home: /usr/local/apache-maven-3.5.4
Java version: 1.8.0_181, vendor: Oracle Corporation, runtime: /usr/lib/jvm/java-1.8.0-openjdk-<IP_ADDRESS>-3.b13.el7_5.x86_64/jre
Default locale: en_US, platform encoding: ANSI_X3.4-1968
OS name: "linux", version: "3.10.0-862.6.3.el7.x86_64", arch: "amd64", family: "unix"
[INFO] Scanning for projects...
[INFO]
[INFO] -------------------< eu.mjelen.katacoda.odo:backend >-------------------
[INFO] Building PersistentStorageCounterServlet 1
[INFO] --------------------------------[ war ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ backend ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /opt/app-root/src/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ backend ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ backend ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /opt/app-root/src/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ backend ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ backend ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-war-plugin:2.3:war (default-war) @ backend ---
failed to push component: wildfly

``

@kadel @cdrage This problem can be easily bypassed by providing along the sources a modified .s2i/bin/assemble that instead of move does a copy. We should probably also do a PR to the wildfly image so that every version copies those files instead of moving, but we need to think this can be a problem and we should look into proper solutions.
IMHO we will need to provide a dedicated supervisor process that will have intelligence, and that will also be able to be configured to alter this intelligent behavior in some cases.
Also, I found while doing some tests in online a couple of things, which might need to go to a different issue, but wanted to mention here.

Deployment should need to be changed from rolling to recreate. This is probably something that should go to the config, but IMHO for inner loop development, by default recreate should be preferred anyways.
While building with maven in a container in online (500 MB by default), the -Xmx parameter was configured too low. I needed to alter the memory configured to the container. There's currently no way to alter the deployment. We need to work on these CLI flags to modify behavior, memory/cpu being the most critical one.

FWIW. Many S2I images originally used cp in assemble. I said I disagreed with them when they changed to using mv and one of the reasons was that assemble would break when there were no files. They may not want to change it back to cp.

@GrahamDumpleton Is there any way to prevent this behaviour? Any env variable or any suggestion to prevent this?

review: @kadel @surajnarwade

Me and @mik-dass tried to debug this problem with some hacks (those might be the practical one),
Solution 1:

we modified assemble-and-restart and run script as per following:

assemble-and-restart

cd /opt/app-root
mkdir backup
cd backup
cp -rvf /wildfly/standalone/deployments/* .

run

if [ -e /wildfly/standalone/deployments/ROOT.war ]; then
    echo "ok"
else
     echo "copying binaries"
     cd /opt/app-root/backup
     cp -rvf  * /wildfly/standalone/deployments/

fi

after this we did,

odo create wildfly
odo push
odo url create
# check for output on url/counter, refresh 5 times
odo storage create data --path /data --size 100M

after this pod will restart, binaries will be copied to /wildfly/standalone/deployments, Now if you check url/counter (we expect number 6 should appear but it's 1), because this code https://github.com/marekjelen/katacoda-odo-backend.git stores counter in /data/counter.txt which vanishes while new  deployment.

so we should store /data as well before hand, but again I assume this directory is application specific and may vary.

That's our findings
cc @kadel  @jorgemoralespou @cmoulliard @geoand @metacosm @mik-dass @cdrage

after this pod will restart, binaries will be copied to /wildfly/standalone/deployments, Now if you check url/counter (we expect number 6 should appear but it's 1), because this code https://github.com/marekjelen/katacoda-odo-backend.git stores counter in /data/counter.txt which vanishes while new  deployment.

that is correct behavior. The counter will be restarted after storage is added. But if any additional restarts after storage was added will keep counter value.
@surajnarwade @mik-dass is there a way to detect that the s2i image is using a special directory to store artifacts? Maybe some label?

after this pod will restart, binaries will be copied to /wildfly/standalone/deployments, Now if you check url/counter (we expect number 6 should appear but it's 1), because this code https://github.com/marekjelen/katacoda-odo-backend.git stores counter in /data/counter.txt which vanishes while new  deployment.

that is correct behavior. The counter will be restarted after storage is added. But if any additional restarts after storage was added will keep counter value.
@surajnarwade @mik-dass is there a way to detect that the s2i image is using a special directory to store artifacts? Maybe some label?

Relates to the discussion in 869 perhaps

@geoand yes, the same mechanism could be used here.
The question is if there is such label that will help us to find the right directory.
@surajnarwade @mik-dass have you find something?

@kadel I would need to dig further, but from the quick checks I did, there did seem to be proper s2i labels we could utilize

It looks like there is com.redhat.deployments-dir label that points to that dir.

I am pretty sure that if we go down the go binary route, we will be able to make supervisord work seamlessly with s2i in a maintainable manner (much more than the bash scripts that test for the presence directories :P )

@kadel , we already discussed about this label: com.redhat.deployments-dir

also this might be the issue only in case of language runtimes which generates artifacts, and we should also mention that if someone is using custom imagestream, please use this labels there

this label is not label in imagestream but container (docker) image label

@mik-dass  - will work on odo/client side
@surajnarwade  - initContainer / cluster side

I'll be happy to assist with this one should anyone need it

reopening as odo main repository has not been updated with new image yet

🎉


T536, T537, & T538 are co-mingled

It looks like T536 was merged with the log for T537. Can we re-merge it with the correct log file? There are no annotations for T537 but all the annotations for T536 & T538 are in VARS under that dive #.
Reported previously in JIRA #VARS-626 and #VARS-741.
Also, the metadata for the video resolution for the T536 files is showing up as HD instead of SD when  browsing to the files in the VAM.

Links to JIRA issues:

https://mbari1.atlassian.net/browse/VARS-626
https://mbari1.atlassian.net/browse/VARS-741

Sanity checks. Here's the URLs to inspect the video assets for the dives:

http://m3.shore.mbari.org/vam/v1/videosequences/name/Tiburon 0536
http://m3.shore.mbari.org/vam/v1/videosequences/name/Tiburon 0537
http://m3.shore.mbari.org/vam/v1/videosequences/name/Tiburon 0538

The video tapes for all 3 dives are all in Tiburon -537

Proposed Fix for T0536. Tested on fog server:
UPDATE videos SET video_sequence_uuid = '67282c6d-adda-4d79-9726-7fbbd6a0caaa'
WHERE video_sequence_uuid = '9b614cca-3e6b-4aa7-ae48-2967cb4ab35f' AND name LIKE 'T0536-%'

Proposed fix for T0538. Tested on fog server:
UPDATE videos SET video_sequence_uuid = '379ffa5b-c3fc-4c2e-9079-e6479685aada'
WHERE video_sequence_uuid = '9b614cca-3e6b-4aa7-ae48-29

Output from fixes:
[2023-12-12 11:16:29] Connected
M3_VIDEO_ASSETS> use M3_VIDEO_ASSETS
[2023-12-12 11:16:29] [S0001][5701] Changed database context to 'M3_VIDEO_ASSETS'.
[2023-12-12 11:16:29] completed in 11 ms
M3_VIDEO_ASSETS> UPDATE videos SET video_sequence_uuid = '67282c6d-adda-4d79-9726-7fbbd6a0caaa'
                 WHERE video_sequence_uuid = '9b614cca-3e6b-4aa7-ae48-2967cb4ab35f' AND name LIKE 'T0536-%'
[2023-12-12 11:16:29] 9 rows affected in 58 ms

M3_VIDEO_ASSETS> UPDATE videos SET video_sequence_uuid = '379ffa5b-c3fc-4c2e-9079-e6479685aada'
                 WHERE video_sequence_uuid = '9b614cca-3e6b-4aa7-ae48-2967cb4ab35f' AND name LIKE 'T0538-%'
[2023-12-12 11:17:53] 9 rows affected in 11 ms

Using the m3-merge project to correct the start timestamps and re-merge. Timestamps for the tape vide references have been corrected using:
cd m3-merge
sbt pack
cd target/pack/bin
mv ../conf/production.conf ../conf/application.conf
adjust_tape_timestamps "Tiburon" 536
adjust_tape_timestamps "Tiburon" 537
adjust_tape_timestamps "Tiburon" 538

These dives have been remerged using:
merge_rov "Tiburon" 536
merge_rov "Tiburon" 537  # Does nothing as there's no new data to remerge
merge_rov "Tiburon" 538

@KSchlining Everything should be good now. Take a look and let me know and I'll close the issue if all is well.

@hohonuuli associated with this, see attached screenshot, can we edit the tape start and end parameters and/or duration parameters? Here this one says tape is duration 14 hours (dive was that long but not tape). We're seeing a lot of errors for tape start and end times and it is causing issues for new IMES files and old annotations. It may have to be a manual edit and I can take those on as I go through issue tapes.

I think just opening the tape in VARS and then switching to another will fix the 536, 537, and 538 dives. But I'll double check.

I think those tapes have dive start and end times instead of just tape duration :)

@kwalz I've moved the issue regarding duration parameters to #85 as a separate issue. So just review the tape dimensions in this issue, so I can close it.

Tapes only have start times and durations. The end time is calculated from those.

@kwalz I've moved the issue regarding duration parameters to #85 as a separate issue. So just review the tape dimensions in this issue, so I can close it.

@kwalz @KSchlining Has this been fixed? OK to close this issue?

T538 still has issues, I'll try to troubleshoot and report back here with more info, please keep this ticket open.

Tapes are no longer co-mingled (fixed remaining ones with issues using ./adjust_tape_timestamps pessimistic and ./set-tape-time) but T537 and T538 SD tape assets are listed as 1920x1080 in registry — they are SD tapes so issue is related to issue #84, I made a comment there so will close this issue.


Add num_scanners to frontend location page for devices/families

The by_location endpoint has a num_scanners field which tells us how many Find3 scanners saw this device.
The React frontend page (e.g. http://localhost:8005/view/location/family_name/wifi-02:9f:c2:7d:66:08) should also expose this field as well.

7f2aa772fe61862dbda5d892007d20c1cf0e7d4c shows the raw sensor data, which also has this information about number of scanners


Improve memory management

Description
In the rust implementation, when passing the object, often it is using clone so that borrow constraint does not get violated.
However, instead, it should carefully check where it can be passed by reference and try to re-use the allocated data for performance and efficiency.

One idea is to increase the usage of Rc

Acceptance Criteria

Reduce number of copy happens in the code
All tests and public interfaces should remained the same

Superseded by #37


Clean Key/Track implementation for animations

I started the implementation of #61897 but it was overly complicated and i had to write a lot of code to implement simple things.
This is a proposal of refactor/simplify this part.
This first commit is a more coherent implementation for Tracks and Keys. Now always use template form.
Next part will be to remove a lot of redundant code around that change.
I opened this draft to get early feedbacks and be noticed if someone is already working on refactoring that part. I found nothing yet but there is a lot of PR.

@TokageItLab Is there any chance of this being merged before any big change on AnimationPlayer ?
I checked the amount of works needed to rebase and with the duplicate code all around it's pretty big. I can spend more time on maintaining this but i did not get any feedback (except being pushed back to 4.x) so i may drop it completly and have it on my own version of the engine.


Split out arrow-buffer crate (#2594)

Which issue does this PR close?

Part of #2594.
Rationale for this change

Begins the process of gradually exploding this crate, to help with compile times, codesize, etc...
What changes are included in this PR?

Splits the arrow buffer types into their own crate. This is mostly mechanical but there are some breaking changes
Are there any user-facing changes?
Yes, hopefully none that are controversial

BTW I plan to test this change out against DataFusion

cd /Users/alamb/Software/arrow-datafusion && RUST_BACKTRACE=1 CARGO_TARGET_DIR=/Users/alamb/Software/df-target  nice cargo test --all
    Updating git repository `https://github.com/tustvold/arrow-rs.git`
    Updating git submodule `https://github.com/apache/parquet-testing.git`
    Updating git submodule `https://github.com/apache/arrow-testing`
    Updating crates.io index
   Compiling parquet v22.0.0 (https://github.com/tustvold/arrow-rs.git?rev=f47a878#f47a8784)
   Compiling arrow-buffer v22.0.0 (https://github.com/tustvold/arrow-rs.git?rev=f47a878#f47a8784)
   Compiling arrow-flight v22.0.0 (https://github.com/tustvold/arrow-rs.git?rev=f47a878#f47a8784)
   Compiling arrow v22.0.0 (https://github.com/tustvold/arrow-rs.git?rev=f47a878#f47a8784)
   Compiling fuzz-utils v0.1.0 (/Users/alamb/Software/arrow-datafusion/datafusion/core/fuzz-utils)
   Compiling datafusion-common v12.0.0 (/Users/alamb/Software/arrow-datafusion/datafusion/common)
   Compiling datafusion-expr v12.0.0 (/Users/alamb/Software/arrow-datafusion/datafusion/expr)
   Compiling datafusion-row v12.0.0 (/Users/alamb/Software/arrow-datafusion/datafusion/row)
   Compiling datafusion-physical-expr v12.0.0 (/Users/alamb/Software/arrow-datafusion/datafusion/physical-expr)
   Compiling datafusion-sql v12.0.0 (/Users/alamb/Software/arrow-datafusion/datafusion/sql)
   Compiling datafusion-jit v12.0.0 (/Users/alamb/Software/arrow-datafusion/datafusion/jit)
   Compiling datafusion-optimizer v12.0.0 (/Users/alamb/Software/arrow-datafusion/datafusion/optimizer)
   Compiling datafusion v12.0.0 (/Users/alamb/Software/arrow-datafusion/datafusion/core)
   Compiling datafusion-proto v12.0.0 (/Users/alamb/Software/arrow-datafusion/datafusion/proto)
   Compiling datafusion-benchmarks v12.0.0 (/Users/alamb/Software/arrow-datafusion/benchmarks)
   Compiling datafusion-examples v12.0.0 (/Users/alamb/Software/arrow-datafusion/datafusion-examples)

Seems to work well 👍
diff --git a/Cargo.toml b/Cargo.toml
index b5a7989d9..713c4844b 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -37,6 +37,6 @@ lto = true

 # TEMP
 [patch.crates-io]
-arrow = {  git = "https://github.com/apache/arrow-rs.git", rev="51466634f11b7d965ca3c912835c91e0f84a6c92"}
-parquet = {  git = "https://github.com/apache/arrow-rs.git", rev="51466634f11b7d965ca3c912835c91e0f84a6c92" }
-arrow-flight = {  git = "https://github.com/apache/arrow-rs.git", rev="51466634f11b7d965ca3c912835c91e0f84a6c92" }
+arrow = {  git = "https://github.com/tustvold/arrow-rs.git", rev="f47a878"}
+parquet = {  git = "https://github.com/tustvold/arrow-rs.git", rev="f47a878" }
+arrow-flight = {  git = "https://github.com/tustvold/arrow-rs.git", rev="f47a878" }

eq Float32              time:   [44.005 µs 44.131 µs 44.276 µs]
                        change: [+137.97% +138.88% +139.85%] (p = 0.00 < 0.05)
                        Performance has regressed.
Found 6 outliers among 100 measurements (6.00%)
  6 (6.00%) high mild

eq scalar Float32       time:   [40.772 µs 40.865 µs 40.967 µs]
                        change: [+419.00% +420.49% +422.13%] (p = 0.00 < 0.05)
                        Performance has regressed.
Found 3 outliers among 100 measurements (3.00%)
  1 (1.00%) low mild
  2 (2.00%) high mild

Sigh...

Maybe it is time to sprinkle some #[inline] to get cross crate inlining

If only it were that simple :cry:

FWIW, I'm very in favor of this splitting up into smaller crates. We use a small abstraction layer over arrow buffers or plain vectors and this could reduce the compilation times for that usecase significantly.
Regarding benchmarks, do we actually run these with LTO? My current understanding is that without LTO the inline annotation is required for cross-crate inlining, but with LTO enabled inlining would work in more cases. I think most applications that then use these crates would be compiled with LTO.

At least in theory LTO is only needed for cross-crate inlining of non-inline annotated functions, and even then generic functions should be inlined anyway as a consequence of monomorphisation.
The simple fix is just to move collect_bool into the comparison kernels, but I'm curious to understand what is going on as it may have implications down the line

Docs failure is related to https://github.com/rust-lang/rust/issues/101844, it runs fine on an older nightly