[bug] mkdocstrings-python not publishing docstrings for function overloads

Confirm this is an issue with the Python library and not an underlying OpenAI API

[X] This is an issue with the Python library

Describe the bug
Integrated mkdocstrings-insiders in #1 to get chat.completions.create() function signature overloads published, but the docstrings for the overloads aren't being published. To get docstrings to publish at all, I had to add docs to the overloaded function.
Not sure whether this is as-designed, expected, or a bug in mkdocstrings, but it warrants investigation. To note, the signatures for the overloads ARE published as expected (they weren't before moving to -insiders), but not their docstrings.
At the very least, I need to take a good look at chat.completions.create() and see how best to workaround it. Right now I'm likely not listing everything that needs listing in the attribute or arg lists for the overloaded create() function.
To Reproduce

Use computer
Profit

Code snippets
No response
OS
macOS
Python version
Python 3.11.7
Library version
openai v1.13.0

mkdocstrings maintainer here, chiming in :) I'm not a big user of overloads, so I initially decided to stack signatures and render only the doctstring of the implementation. I wasn't aware people wrote do strings in the overloads. How would you like them to be rendered? Stacked signatures, like now, and concatenated do strings? In source order or implementation first? Any feedback/suggestion is welcome!

Wow - hi, @pawamoy! Great to hear from you. 🙂
Before I answer how I'd like it rendered, we should probably determine whether making a change to mkdocstrings is even the right thing to do. I'm not exactly Python expert, so I'd first defer to someone with more experience than I whether doc'ing overloads is Pythonic, an anti-pattern, or somewhere in between. I'd hate to have you or someone else spend time hacking support into mkdocstrings for something someone shouldn't be doing in the first place.
The code that surfaced the issue is here in completions.Create() and its overloads:
https://github.com/openai/openai-python/blob/a7115b5f33acd27326e5f78e19beb0d73bd3268e/src/openai/resources/chat/completions.py#L41-L696
They're using https://github.com/stainless-api to generate their SDKs, so presumably the docstrings-in-the-overloads behavior is coming from the Stainless SDK generator. I don't know whether that's a knob they can tweak in Stainless of if WYSIWG and that's that, but every overload is getting the full pile of docstrings and the implementation gets none.
My gut feeling as a dev is that I'd expect either all the docstrings to be in the implementation, or most would be in the implementation and then only specializations would appear in the overloads. But, as I say, I'd want someone who's been deep into Python for awhile to make the call on which (if either) is the most Pythonic.

Thank you for sharing this very useful context!
To me, the most Pythonic thing to do is to write everything in the implementation doctstring, and nothing in the overloads. That's because once you're in the REPL (Python interactive interpreter), or more generally at runtime, only the implementation is visible, since it shadows the overloads. Overloads are only visible to static analysis tools.
In the current situation, trying to print help for the create method would show nothing except the signature of the method:
>>> help(Completions.create)
create(...) -> ...

...whereas if the docstring was written in the implementation docstring, it'd be printed nicely. That's also why every parameter from every overload should be documented there: otherwise these docs would be lost at runtime.
So, I'd definitely recommend checking out if the stainless-api can instead add the docstring to the final implementation rather than the overloads. Bonus: it'll remove many duplicated lines :)

Agreed on all points. Just did a diff on the docstrings that are in the overloads, and except for the position of stream in the arg list, they're identical.

So, I'd definitely recommend checking out if the stainless-api can instead add the docstring to the final implementation rather than the overloads. Bonus: it'll remove many duplicated lines :)

Stainless is a bit of a black box to me since I'm neither on their team nor OpenAI's, so I think the best we can do is check with @rattrayalex to see if this is an as-designed/won't fix thing, or if it should be submitted as an issue somewhere.
Either way, I'm kinda twice-removed from the library, so even if there's a knob to turn in Stainless that'd stuff the docstring into the implementation rather than the overloads, that would be a knob OpenAI would have to turn. Said knob is well outside my reach. 😛

Hi there. You're welcome to open an issue on the openai-python repo to add a docstring to the implementation and we may do that.
However, I would urge you to consider displaying the overloaded docstring in preference of the implementation docstring when both exist. The reason is simple: the overloaded docstring documents the function as the user is calling it!
e.g.,
@overload
def foo(a: str, b: int):
  '''
  Args:
    a  : a string that does A stuff
    b  : an integer that does B stuff

@overload
def foo(c: str, d: int):
  '''
  Args:
    c  : a string that does C stuff
    d  : an integer that does D stuff

I would want to be ale to see proper docs for this.

@rattrayalex thanks for chiming in!
What do you think of the fact that such docstrings are lost at runtime, and therefore cannot be displayed to users in a REPL or in a Jupyter notebook?
Also, to continue with your example, since the implementation will declare all these parameters anyway (a, b, c, and d), why not add document them only once, in the implementation?
Besides, for this particular issue, @mmacy diff'd the docstrings, and they all have the same parameters (the only thing that differs is the position of the stream parameter).

I see that Ruff recommends against adding docstrings to overloads:

Function decorated with @overload shouldn't contain a docstringRuffD418

In the end maybe I'd recommend doing something like this:
from typing import overload

@overload
def f(a: int, b: str, x: bool) -> str:
    """Specific summary.

    Specific body.

    Args:
        a: Specific description.
        b: Specific description.
        x: Common description.
    """
    ...

@overload
def f(c: int, d: str, x: bool) -> str:
    """Specific summary.

    Specific body.

    Args:
        c: Specific description.
        d: Specific description.
        x: Common description.
    """
    ...

def f(
    x: bool,
    a: int | None = None,
    b: str | None = None,
    c: int | None = None,
    d: str | None = None,
) -> str:
    """Generic summary.

    Generic body.

    Args:
        a: Generic description.
        b: Generic description.
        c: Generic description.
        d: Generic description.
        x: Common description.
    """
    return b or d

I'd just have to find the best way to render that in docs :slightly_smiling_face:

Terrific, thank you! Appreciate the research and thoughtfulness here. I agree with your proposal about we should do and I'll file a ticket internally. It might be less trivial than you'd think but we would like to do it in our case.
Regardless, glad to hear that you'll look into supporting the overloads!

Love the collaboration on this, @pawamoy and @rattrayalex.

Ruff recommends against adding docstrings to overloads (though they do not really explain why)

I would guess that rule is as much about providing "defensive" guidance rather it being a technical thing. With the way the @overload decorator behaves in Python, specifically this (emphasis mine):

@overload-decorated definitions are for the benefit of the type checker only, since they will be overwritten by the non-@overload-decorated definition.

It's probably a measure ensure the function implementation ALWAYS has a docstring, since without that rule, we can end up in a situation like this where the implementation has none but the decorator-marked functions do, but they get overwritten.
Also, it looks like we're not the only ones discussing how to handle @overload-decorated function docstrings:
https://github.com/sphinx-doc/sphinx/issues/7787


[ReleaseTesting] Negative Power down the node where the VM is getting replaced by the restore

Description
Content refer to Qase HV-57
Steps

Initiate a restore with existing VM.
While the restore is in progress and VM is starting on a node, shut down the node

Expected Results
You should get an err

Setup 3 nodes harvester-v1.2.2-rc3

 Create a VM w/ additional disk and some data

 Take VM backup and shutdown VM

Take backup

Shutdown VM

 Observing pod/virt-launcher-VMNAME to get node info ASAP

Initiate a restore with existing VM.

While the restore is in progress and VM is starting on a node, shut down the node

You should get an err

 :red_circle: Trial 1

Only warning and VM is restored on another node.

Got FailedAttachVolume warning and then VM was restored on another node

 :red_circle: Trial 2

Before

Only got FailedAttachVolume warning

Warning  FailedAttachVolume  63s (x6 over 2m8s)    attachdetach-controller  AttachVolume.Attach failed for volume "pvc-e91d9fb1-d7dc-4d01-bc71-940 │
│ 096c42e6b" : rpc error: code = Internal desc = Bad response statusCode [500]. Status [500 Internal Server Error]. Body: [code=Internal Server Error, │
│  detail=, message=unable to attach volume pvc-e91d9fb1-d7dc-4d01-bc71-940096c42e6b to harvester-node-1: node harvester-node-1 is not ready, couldn't │
│  attach volume pvc-e91d9fb1-d7dc-4d01-bc71-940096c42e6b to it] from [http://longhorn-backend:9500/v1/volumes/pvc-e91d9fb1-d7dc-4d01-bc71-940096c42e6 │
│ b?action=attach]                                                                                │
│   Warning  FailedAttachVolume  62s (x8 over 2m10s)   attachdetach-controller  AttachVolume.Attach failed for volume "pvc-3c6ca72d-c604-48fe-aad6-fa6 │
│ 28f52fe12" : rpc error: code = Internal desc = Bad response statusCode [500]. Status [500 Internal Server Error]. Body: [code=Internal Server Error, │
│  detail=, message=unable to attach volume pvc-3c6ca72d-c604-48fe-aad6-fa628f52fe12 to harvester-node-1: node harvester-node-1 is not ready, couldn't │
│  attach volume pvc-3c6ca72d-c604-48fe-aad6-fa628f52fe12 to it] from [http://longhorn-backend:9500/v1/volumes/pvc-3c6ca72d-c604-48fe-aad6-fa628f52fe1 │
│ 2?action=attach]

And VM was restored on another node afte a while

Got FailedAttachVolume warning and then VM was restored on another node

 :red_circle: Trial 3

Before

Restore

After
Restore to node-1 fail

And VM was restored to node-2

Got FailedAttachVolume warning and then VM was restored on another node


Separate preset from config

Is your feature request related to a problem? Please describe.

The IBeaconConfig object has become a catch-all object to house many things. Many functions/modules/etc require a config object, and its not immediately clear why.
The IBeaconSSZTypes object is seemingly overly abstract. In practice, we only ever need a single copy of all ssz types, and ssz types don't change. (They only change in testing, when we use the minimal config)
Our organization, the naming, diverges from the spec. It could be more closely aligned if we try.

Describe the solution you'd like
With the introduction of ethereum/eth2.0-specs#2390, we may simplify our code by moving much of the config logic into static imports.
I also recommend using this opportunity to realign our naming with the spec. This will make it much easier for new contributors to pick up our code.
Specifically, we can separate our IBeaconParams into two interfaces, eg: IBeaconPreset and IBeaconConfig
The IBeaconContig being the run-time params
The IBeaconPreset being the 'compile-time' params
IBeaconPreset may be exposed like:
preset.ts
// Use environment variable or other means to switch presets
if (process.env.LODESTAR_PRESET === "mainnet") {
  exports = require("./mainnet"):
} else ...

The preset values can then be accessed like "constants"
import {SYNC_COMMITTEE_SIZE} from "@chainsafe/lodestar-preset";
...

The presets include all variables needed to create SSZ types. So then SSZ types can be exported/imported in the same way:
import {Root, phase0} from "@chainsafe/lodestar-ssz-types";
Root.equals(...);
phase0.BeaconState.hashTreeRoot(...);

This would let us simplify our current IBeaconConfig to be IBeaconConfig & IBeaconForkInfo or similar.
Note that the types are no longer included here!
eg:
// Now IBeaconConfig can be the thing named 'config' in the specs, ie the runtime configuration
interface IBeaconConfig {
  SECONDS_PER_SLOT: number;
  ...
}
interface IBeaconForkInfo {
  forks: {[K in ForkName]: IForkInfo};
  getForkInfo(slot: Slot): IForkInfo;
  ...
}

// what was previously called IBeaconConfig can be the union or similar of these two
// Or we can keep them separate? up to us
interface INewIBeaconConfig = IBeaconConfig & IBeaconForkInfo;

Many downstream functions pass in a config just do hash/serialize/etc a type, they can all be simplified:
// before
function getFoo(config: IBeaconConfig, data) {
  config.types.Root.equals(...);
  }

// after
import {Root} from "@chainsafe/lodestar-ssz-types";
function getFoo(data) {
  Root.equals(...);
}

The one hiccup here that would need to be worked thru is how ssz types vs typescript types are exported/imported so not to step on one another:
eg:
import {Root} from "@chainsafe/lodestar-types";
// Root is a typescript type (doesn't actually exist in javascript)
import {Root} from "@chainsafe/lodestar-ssz-types";
// Root is an ssz type (eg: a javascript object with methods)

// how should this naming conflict be resolved??

Open discussion items:

Naming? standardize to spec? eg: "preset", "config", etc
Packages? unify packages? how to organize code: "preset", "config", "fork", "types" (ts and ssz)
How to handle import clash between ts and ssz types

Describe alternatives you've considered
status quo? This update intentionally limits the flexibility and number of IBeaconSSZTypes instantiated in a single javascript process (to 1). If that was an issue for some reason, we wouldn't want to do this.
Additional context
ethereum/eth2.0-specs#2390

This is great but I would work by steps:

Split params following ethereum/eth2.0-specs#2390, keep using the config object everywhere. Rename following the spec
Figure out latter how to deal with the issues you mentioned about name clashing (e.g. Root), etc.

How to handle import clash between ts and ssz types

I prefer Root for typescript type and RootType (or RootSSZType) for ssz type, that should make it easier to understand for new contributors


I have a problem

I wanna add an entity to minecraft ,
The behavior pack works successfully but the resource pack doesn't work

Hi, @MinecraftAddons123. I just added a new Troubleshooting section to the Resource Pack. Take a look and let me know if this was helpful.
I'm happy to answer more questions if needed.
https://docs.microsoft.com/en-us/minecraft/creator/documents/resourcepack#troubleshooting

Hi, @MinecraftAddons123, I'm going to close this issue, but feel free to reply with more questions.


Make multiple block actions for survey, form block work on the same page.

See #1854 for a new bug related to this one.

FYI this has been fixed.


SyntaxError located at a line that does not exist

Description
What steps will reproduce the problem?

Was writing code, suddenly Spyder claimed I had an 'unterminated triple-quoted string literal' located at a line that didn't exist (i.e. my code ended at around line 390, it claimed the error was at line 444). I tried to delete the chunks of the code to firgure out where exactly the error was, but even when I deleted all of the code on the file it still claimed I had the 'unterminated string literal'.
I'm not sure how to reproduce it - maybe I can paste the entire code?
Here it is:
6.0001 Problem Set 3

The 6.0001 Word Game
Created by: Kevin Luu  and Jenna Wiens

Name          :
Collaborators :
Time spent    :
import math
import random
import string
VOWELS = 'aeiou'
CONSONANTS = 'bcdfghjklmnpqrstvwxyz'
HAND_SIZE = 7
SCRABBLE_LETTER_VALUES = {
'a': 1, 'b': 3, 'c': 3, 'd': 2, 'e': 1, 'f': 4, 'g': 2, 'h': 4, 'i': 1, 'j': 8, 'k': 5, 'l': 1, 'm': 3, 'n': 1, 'o': 1, 'p': 3, 'q': 10, 'r': 1, 's': 1, 't': 1, 'u': 1, 'v': 4, 'w': 4, 'x': 8, 'y': 4, 'z': 10, '*': 0}
-----------------------------------
Helper code
(you don't need to understand this helper code)
WORDLIST_FILENAME = "words.txt"
def load_words():
"""
Returns a list of valid words. Words are strings of lowercase letters.
Depending on the size of the word list, this function may
take a while to finish.
"""

print("Loading word list from file...")
# inFile: file
inFile = open(WORDLIST_FILENAME, 'r')
# wordlist: list of strings
wordlist = []
for line in inFile:
    wordlist.append(line.strip().lower())
print("  ", len(wordlist), "words loaded.")
return wordlist

def get_frequency_dict(sequence):
"""
Returns a dictionary where the keys are elements of the sequence
and the values are integer counts, for the number of times that
an element is repeated in the sequence.
sequence: string or list
return: dictionary
"""

# freqs: dictionary (element_type -> int)
freq = {}
for x in sequence:
    freq[x] = freq.get(x,0) + 1
return freq

(end of helper code)
-----------------------------------
word_list = load_words()

Problem #1: Scoring a word

def get_word_score(word, n):
"""
Returns the score for a word. Assumes the word is a
valid word.
You may assume that the input word is always either a string of letters,
or the empty string "". You may not assume that the string will only contain
lowercase letters, so you will have to handle uppercase and mixed case strings
appropriately.

The score for a word is the product of two components:

The first component is the sum of the points for letters in the word.
The second component is the larger of:
        1, or
        7*wordlen - 3*(n-wordlen), where wordlen is the length of the word
        and n is the hand length when the word was played

Letters are scored as in Scrabble; A is worth 1, B is
worth 3, C is worth 3, D is worth 2, E is worth 1, and so on.

word: string
n: int >= 0
returns: int >= 0
"""
score = 0
word = word.lower()
for char in word:
    x = int(SCRABBLE_LETTER_VALUES[char])
    score += x
score2 = (7 * len(word)) - (3 * (n - len(word)))
if score2 >= 1:
    score *= score2
return score

Make sure you understand how this function works and what it does!

def display_hand(hand):
"""
Displays the letters currently in the hand.
For example:
   display_hand({'a':1, 'x':2, 'l':3, 'e':1})
Should print out something like:
   a x x l l l e
The order of the letters is unimportant.

hand: dictionary (string -> int)
"""

for letter in hand.keys():
    for j in range(hand[letter]):
         print(letter, end=' ')      # print all on the same line
print()                              # print an empty line

Make sure you understand how this function works and what it does!
You will need to modify this for Problem #4.

def deal_hand(n):
"""
Returns a random hand containing n lowercase letters.
ceil(n/3) letters in the hand should be VOWELS (note,
ceil(n/3) means the smallest integer not less than n/3).
Hands are represented as dictionaries. The keys are
letters and the values are the number of times the
particular letter is repeated in that hand.

n: int >= 0
returns: dictionary (string -> int)
"""

hand={}
num_vowels = int(math.ceil(n / 3)) - 1

for i in range(num_vowels):
    x = random.choice(VOWELS)
    hand[x] = hand.get(x, 0) + 1

for i in range(num_vowels, n):
    x = random.choice(CONSONANTS)
    hand[x] = hand.get(x, 0) + 1

hand['*'] = 1

return hand

Problem #2: Update a hand by removing letters

def update_hand(hand, word):
"""
Does NOT assume that hand contains every letter in word at least as
many times as the letter appears in word. Letters in word that don't
appear in hand should be ignored. Letters that appear in word more times
than in hand should never result in a negative count; instead, set the
count in the returned hand to 0 (or remove the letter from the
dictionary, depending on how your code is structured).
Updates the hand: uses up the letters in the given word
and returns the new hand, without those letters in it.

Has no side effects: does not modify hand.

word: string
hand: dictionary (string -> int)
returns: dictionary (string -> int)
"""
new_hand = hand.copy()
word1 = word.lower()
for char in word1:
    if char in hand.copy():
        if new_hand[char] == 0:
            continue
        else:
            new_hand[char] -= 1
return new_hand

Problem #3: Test word validity

def is_valid_word(word, hand, word_list):
"""
Returns True if word is in the word_list and is entirely
composed of letters in the hand. Otherwise, returns False.
Does not mutate hand or word_list.
word: string
hand: dictionary (string -> int)
word_list: list of lowercase strings
returns: boolean
"""
word1 = word.lower()
new_hand = hand.copy()
wildcard = False
for char in word1:
    if char not in hand.copy():
        return False
    else:
        new_hand[char] -= 1
        if new_hand[char] < 0:
            return False
    if char == '*':
        wildcard = True
vowels = ['a', 'e', 'i', 'o', 'u']
if wildcard == True:
    for e in vowels:
        word2 = word1.replace('*', e)
        for e in word_list:
            if e == word2:
                return True
    else:
        return False
else:
    for e in word_list:
        if e == word1:
            return True
    else:
        return False

Problem #5: Playing a hand

def calculate_handlen(hand):
"""
Returns the length (number of letters) in the current hand.
hand: dictionary (string-> int)
returns: integer
"""

pass  # TO DO... Remove this line when you implement this function

def play_hand(hand, word_list):
"""
Allows the user to play the given hand, as follows:

* The hand is displayed.

* The user may input a word.

* When any word is entered (valid or invalid), it uses up letters
  from the hand.

* An invalid word is rejected, and a message is displayed asking
  the user to choose another word.

* After every valid word: the score for that word is displayed,
  the remaining letters in the hand are displayed, and the user
  is asked to input another word.

* The sum of the word scores is displayed when the hand finishes.

* The hand finishes when there are no more unused letters.
  The user can also finish playing the hand by inputing two
  exclamation points (the string '!!') instead of a word.

  hand: dictionary (string -> int)
  word_list: list of lowercase strings
  returns: the total score for the hand

"""

# BEGIN PSEUDOCODE <-- Remove this comment when you implement this function
# Keep track of the total score

# As long as there are still letters left in the hand:

    # Display the hand

    # Ask user for input

    # If the input is two exclamation points:

        # End the game (break out of the loop)

    # Otherwise (the input is not two exclamation points):

        # If the word is valid:

            # Tell the user how many points the word earned,
            # and the updated total score

        # Otherwise (the word is not valid):
            # Reject invalid word (print a message)

        # update the user's hand by removing the letters of their inputted word

# Game is over (user entered '!!' or ran out of letters),
# so tell user the total score

# Return the total score as result of function

Problem #6: Playing a game

procedure you will use to substitute a letter in a hand

def substitute_hand(hand, letter):
"""
Allow the user to replace all copies of one letter in the hand (chosen by user)
with a new letter chosen from the VOWELS and CONSONANTS at random. The new letter
should be different from user's choice, and should not be any of the letters
already in the hand.
If user provide a letter not in the hand, the hand should be the same.

Has no side effects: does not mutate hand.

For example:
    substitute_hand({'h':1, 'e':1, 'l':2, 'o':1}, 'l')
might return:
    {'h':1, 'e':1, 'o':1, 'x':2} -> if the new letter is 'x'
The new letter should not be 'h', 'e', 'l', or 'o' since those letters were
already in the hand.

hand: dictionary (string -> int)
letter: string
returns: dictionary (string -> int)
"""

pass  # TO DO... Remove this line when you implement this function

def play_game(word_list):
"""
Allow the user to play a series of hands
* Asks the user to input a total number of hands

* Accumulates the score for each hand into a total score for the
  entire series

* For each hand, before playing, ask the user if they want to substitute
  one letter for another. If the user inputs 'yes', prompt them for their
  desired letter. This can only be done once during the game. Once the
  substitue option is used, the user should not be asked if they want to
  substitute letters in the future.

* For each hand, ask the user if they would like to replay the hand.
  If the user inputs 'yes', they will replay the hand and keep
  the better of the two scores for that hand.  This can only be done once
  during the game. Once the replay option is used, the user should not
  be asked if they want to replay future hands. Replaying the hand does
  not count as one of the total number of hands the user initially
  wanted to play.

        * Note: if you replay a hand, you do not get the option to substitute
                a letter - you must play whatever hand you just had.

* Returns the total score for the series of hands

word_list: list of lowercase strings
"""

print("play_game not implemented.") # TO DO... Remove this line when you implement this function

Build data structures used for entire session and play game
Do not remove the "if name == 'main':" line - this code is executed
when the program is run directly, instead of through an import statement

if name == 'main':
word_list = load_words()
play_game(word_list)
for is_valid_word
"""
failure=False
# test 1
hand = {'a': 1, 'r': 1, 'e': 1, 'j': 2, 'm': 1, '*': 1}
word = "e*m"

if is_valid_word(word, hand, word_list):
    print("FAILURE: test_is_valid_word() with wildcards")
    print("\tExpected False, but got True for word: '" + word + "' and hand:", hand)

    failure = True

# test 2
hand = {'n': 1, 'h': 1, '*': 1, 'y': 1, 'd':1, 'w':1, 'e': 2}
word = "honey"

if is_valid_word(word, hand, word_list):
    print("FAILURE: test_is_valid_word() with wildcards")
    print("\tExpected False, but got True for word: '"+ word +"' and hand:", hand)

    failure = True

# test 3
hand = {'n': 1, 'h': 1, '*': 1, 'y': 1, 'd':1, 'w':1, 'e': 2}
word = "h*ney"

if not is_valid_word(word, hand, word_list):
    print("FAILURE: test_is_valid_word() with wildcards")
    print("\tExpected True, but got False for word: '"+ word +"' and hand:", hand)

    failure = True

# test 4
hand = {'c': 1, 'o': 1, '*': 1, 'w': 1, 's':1, 'z':1, 'y': 2}
word = "c*wz"

if is_valid_word(word, hand, word_list):
    print("FAILURE: test_is_valid_word() with wildcards")
    print("\tExpected False, but got True for word: '"+ word +"' and hand:", hand)

    failure = True

# dictionary of words and scores WITH wildcards
words = {("h*ney", 7):290, ("c*ws", 6):176, ("wa*ls", 7):203}
for (word, n) in words.keys():
    score = get_word_score(word, n)
    if score != words[(word, n)]:
        print("FAILURE: test_get_word_score() with wildcards")
        print("\tExpected", words[(word, n)], "points but got '" + \
              str(score) + "' for word '" + word + "', n=" + str(n))
        failure=True

if not failure:
    print("SUCCESS: test_wildcard()"

Traceback
Traceback (most recent call last):
  File "C:\Users\jell2\anaconda3\Lib\site-packages\spyder\plugins\editor\panels\scrollflag.py", line 176, in paintEvent
    scale_factor = groove_rect.height() / self.get_scrollbar_value_height()
                   ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ZeroDivisionError: division by zero

QTextCursor::setPosition: Position '-1' out of range
Traceback (most recent call last):
  File "C:\Users\jell2\anaconda3\Lib\site-packages\spyder\plugins\editor\panels\scrollflag.py", line 176, in paintEvent
    scale_factor = groove_rect.height() / self.get_scrollbar_value_height()
                   ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ZeroDivisionError: division by zero
Traceback (most recent call last):
  File "C:\Users\jell2\anaconda3\Lib\site-packages\spyder\plugins\editor\panels\scrollflag.py", line 176, in paintEvent
    scale_factor = groove_rect.height() / self.get_scrollbar_value_height()
                   ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ZeroDivisionError: division by zero
Traceback (most recent call last):
  File "C:\Users\jell2\anaconda3\Lib\site-packages\spyder\plugins\editor\panels\scrollflag.py", line 176, in paintEvent
    scale_factor = groove_rect.height() / self.get_scrollbar_value_height()
                   ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ZeroDivisionError: division by zero
Traceback (most recent call last):
  File "C:\Users\jell2\anaconda3\Lib\site-packages\spyder\plugins\editor\panels\scrollflag.py", line 176, in paintEvent
    scale_factor = groove_rect.height() / self.get_scrollbar_value_height()
                   ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ZeroDivisionError: division by zero
Traceback (most recent call last):
  File "C:\Users\jell2\anaconda3\Lib\site-packages\spyder\plugins\editor\panels\scrollflag.py", line 176, in paintEvent
    scale_factor = groove_rect.height() / self.get_scrollbar_value_height()
                   ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ZeroDivisionError: division by zero
Traceback (most recent call last):
  File "C:\Users\jell2\anaconda3\Lib\site-packages\spyder\plugins\editor\panels\scrollflag.py", line 176, in paintEvent
    scale_factor = groove_rect.height() / self.get_scrollbar_value_height()
                   ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ZeroDivisionError: division by zero
Traceback (most recent call last):
  File "C:\Users\jell2\anaconda3\Lib\site-packages\spyder\plugins\editor\panels\scrollflag.py", line 176, in paintEvent
    scale_factor = groove_rect.height() / self.get_scrollbar_value_height()
                   ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ZeroDivisionError: division by zero
Traceback (most recent call last):
  File "C:\Users\jell2\anaconda3\Lib\site-packages\spyder\plugins\editor\panels\scrollflag.py", line 176, in paintEvent
    scale_factor = groove_rect.height() / self.get_scrollbar_value_height()
                   ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ZeroDivisionError: division by zero
Traceback (most recent call last):
  File "C:\Users\jell2\anaconda3\Lib\site-packages\spyder\plugins\editor\panels\scrollflag.py", line 176, in paintEvent
    scale_factor = groove_rect.height() / self.get_scrollbar_value_height()
                   ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ZeroDivisionError: division by zero
Traceback (most recent call last):
  File "C:\Users\jell2\anaconda3\Lib\site-packages\spyder\plugins\editor\panels\scrollflag.py", line 176, in paintEvent
    scale_factor = groove_rect.height() / self.get_scrollbar_value_height()
                   ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ZeroDivisionError: division by zero
Traceback (most recent call last):
  File "C:\Users\jell2\anaconda3\Lib\site-packages\spyder\plugins\editor\panels\scrollflag.py", line 176, in paintEvent
    scale_factor = groove_rect.height() / self.get_scrollbar_value_height()
                   ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ZeroDivisionError: division by zero
Traceback (most recent call last):
  File "C:\Users\jell2\anaconda3\Lib\site-packages\spyder\plugins\editor\panels\scrollflag.py", line 176, in paintEvent
    scale_factor = groove_rect.height() / self.get_scrollbar_value_height()
                   ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ZeroDivisionError: division by zero

Versions

Spyder version: 5.4.3  (conda)
Python version: 3.11.7 64-bit
Qt version: 5.15.2
PyQt5 version: 5.15.10
Operating System: Windows 10

Dependencies
# Mandatory:
atomicwrites >=1.2.0                             :  1.4.0 (OK)
chardet >=2.0.0                                  :  4.0.0 (OK)
cloudpickle >=0.5.0                              :  2.2.1 (OK)
cookiecutter >=1.6.0                             :  2.5.0 (OK)
diff_match_patch >=20181111                      :  20200713 (OK)
intervaltree >=3.0.2                             :  3.1.0 (OK)
IPython >=7.31.1,<9.0.0,!=8.8.0,!=8.9.0,!=8.10.0 :  8.20.0 (OK)
jedi >=0.17.2,<0.19.0                            :  0.18.1 (OK)
jellyfish >=0.7                                  :  1.0.1 (OK)
jsonschema >=3.2.0                               :  4.19.2 (OK)
keyring >=17.0.0                                 :  23.13.1 (OK)
nbconvert >=4.0                                  :  7.10.0 (OK)
numpydoc >=0.6.0                                 :  1.5.0 (OK)
paramiko >=2.4.0                                 :  2.8.1 (OK)
parso >=0.7.0,<0.9.0                             :  0.8.3 (OK)
pexpect >=4.4.0                                  :  4.8.0 (OK)
pickleshare >=0.4                                :  0.7.5 (OK)
psutil >=5.3                                     :  5.9.0 (OK)
pygments >=2.0                                   :  2.15.1 (OK)
pylint >=2.5.0,<3.0                              :  2.16.2 (OK)
pylint_venv >=2.1.1                              :  2.3.0 (OK)
pyls_spyder >=0.4.0                              :  0.4.0 (OK)
pylsp >=1.7.2,<1.8.0                             :  1.7.2 (OK)
pylsp_black >=1.2.0                              :  1.2.1 (OK)
qdarkstyle >=3.0.2,<3.2.0                        :  3.0.2 (OK)
qstylizer >=0.2.2                                :  0.2.2 (OK)
qtawesome >=1.2.1                                :  1.2.2 (OK)
qtconsole >=5.4.2,<5.5.0                         :  5.4.2 (OK)
qtpy >=2.1.0                                     :  2.4.1 (OK)
rtree >=0.9.7                                    :  1.0.1 (OK)
setuptools >=49.6.0                              :  68.2.2 (OK)
sphinx >=0.6.6                                   :  5.0.2 (OK)
spyder_kernels >=2.4.3,<2.5.0                    :  2.4.4 (OK)
textdistance >=4.2.0                             :  4.2.1 (OK)
three_merge >=0.1.1                              :  0.1.1 (OK)
watchdog >=0.10.3                                :  2.1.6 (OK)
zmq >=22.1.0                                     :  25.1.2 (OK)

# Optional:
cython >=0.21                                    :  None (NOK)
matplotlib >=3.0.0                               :  3.8.0 (OK)
numpy >=1.7                                      :  1.26.4 (OK)
pandas >=1.1.1                                   :  2.1.4 (OK)
scipy >=0.17.0                                   :  1.11.4 (OK)
sympy >=0.7.3                                    :  1.12 (OK)

Description
What steps will reproduce the problem?
Was writing code, suddenly Spyder claimed I had an 'unterminated triple-quoted string literal' located at a line that didn't exist (i.e. my code ended at around line 390, it claimed the error was at line 444). I tried to delete the chunks of the code to firgure out where exactly the error was, but even when I deleted all of the code on the file it still claimed I had the 'unterminated string literal'.
I'm not sure how to reproduce it - maybe I can paste the entire code?
Here it is:
6.0001 Problem Set 3
The 6.0001 Word Game
Created by: Kevin Luu and Jenna Wiens
Name :
Collaborators :
Time spent :
import math import random import string
VOWELS = 'aeiou' CONSONANTS = 'bcdfghjklmnpqrstvwxyz' HAND_SIZE = 7
SCRABBLE_LETTER_VALUES = { 'a': 1, 'b': 3, 'c': 3, 'd': 2, 'e': 1, 'f': 4, 'g': 2, 'h': 4, 'i': 1, 'j': 8, 'k': 5, 'l': 1, 'm': 3, 'n': 1, 'o': 1, 'p': 3, 'q': 10, 'r': 1, 's': 1, 't': 1, 'u': 1, 'v': 4, 'w': 4, 'x': 8, 'y': 4, 'z': 10, '*': 0}
-----------------------------------
Helper code
(you don't need to understand this helper code)
WORDLIST_FILENAME = "words.txt"
def load_words(): """ Returns a list of valid words. Words are strings of lowercase letters.
Depending on the size of the word list, this function may
take a while to finish.
"""

print("Loading word list from file...")
# inFile: file
inFile = open(WORDLIST_FILENAME, 'r')
# wordlist: list of strings
wordlist = []
for line in inFile:
    wordlist.append(line.strip().lower())
print("  ", len(wordlist), "words loaded.")
return wordlist

def get_frequency_dict(sequence): """ Returns a dictionary where the keys are elements of the sequence and the values are integer counts, for the number of times that an element is repeated in the sequence.
sequence: string or list
return: dictionary
"""

# freqs: dictionary (element_type -> int)
freq = {}
for x in sequence:
    freq[x] = freq.get(x,0) + 1
return freq

(end of helper code)
-----------------------------------
word_list = load_words()
Problem #1: Scoring a word
def get_word_score(word, n): """ Returns the score for a word. Assumes the word is a valid word.
You may assume that the input word is always either a string of letters,
or the empty string "". You may not assume that the string will only contain
lowercase letters, so you will have to handle uppercase and mixed case strings
appropriately.

The score for a word is the product of two components:

The first component is the sum of the points for letters in the word.
The second component is the larger of:
        1, or
        7*wordlen - 3*(n-wordlen), where wordlen is the length of the word
        and n is the hand length when the word was played

Letters are scored as in Scrabble; A is worth 1, B is
worth 3, C is worth 3, D is worth 2, E is worth 1, and so on.

word: string
n: int >= 0
returns: int >= 0
"""
score = 0
word = word.lower()
for char in word:
    x = int(SCRABBLE_LETTER_VALUES[char])
    score += x
score2 = (7 * len(word)) - (3 * (n - len(word)))
if score2 >= 1:
    score *= score2
return score

Make sure you understand how this function works and what it does!
def display_hand(hand): """ Displays the letters currently in the hand.
For example:
   display_hand({'a':1, 'x':2, 'l':3, 'e':1})
Should print out something like:
   a x x l l l e
The order of the letters is unimportant.

hand: dictionary (string -> int)
"""

for letter in hand.keys():
    for j in range(hand[letter]):
         print(letter, end=' ')      # print all on the same line
print()                              # print an empty line

Make sure you understand how this function works and what it does!
You will need to modify this for Problem #4.
def deal_hand(n): """ Returns a random hand containing n lowercase letters. ceil(n/3) letters in the hand should be VOWELS (note, ceil(n/3) means the smallest integer not less than n/3).
Hands are represented as dictionaries. The keys are
letters and the values are the number of times the
particular letter is repeated in that hand.

n: int >= 0
returns: dictionary (string -> int)
"""

hand={}
num_vowels = int(math.ceil(n / 3)) - 1

for i in range(num_vowels):
    x = random.choice(VOWELS)
    hand[x] = hand.get(x, 0) + 1

for i in range(num_vowels, n):
    x = random.choice(CONSONANTS)
    hand[x] = hand.get(x, 0) + 1

hand['*'] = 1

return hand

Problem #2: Update a hand by removing letters
def update_hand(hand, word): """ Does NOT assume that hand contains every letter in word at least as many times as the letter appears in word. Letters in word that don't appear in hand should be ignored. Letters that appear in word more times than in hand should never result in a negative count; instead, set the count in the returned hand to 0 (or remove the letter from the dictionary, depending on how your code is structured).
Updates the hand: uses up the letters in the given word
and returns the new hand, without those letters in it.

Has no side effects: does not modify hand.

word: string
hand: dictionary (string -> int)
returns: dictionary (string -> int)
"""
new_hand = hand.copy()
word1 = word.lower()
for char in word1:
    if char in hand.copy():
        if new_hand[char] == 0:
            continue
        else:
            new_hand[char] -= 1
return new_hand

Problem #3: Test word validity
def is_valid_word(word, hand, word_list): """ Returns True if word is in the word_list and is entirely composed of letters in the hand. Otherwise, returns False. Does not mutate hand or word_list.
word: string
hand: dictionary (string -> int)
word_list: list of lowercase strings
returns: boolean
"""
word1 = word.lower()
new_hand = hand.copy()
wildcard = False
for char in word1:
    if char not in hand.copy():
        return False
    else:
        new_hand[char] -= 1
        if new_hand[char] < 0:
            return False
    if char == '*':
        wildcard = True
vowels = ['a', 'e', 'i', 'o', 'u']
if wildcard == True:
    for e in vowels:
        word2 = word1.replace('*', e)
        for e in word_list:
            if e == word2:
                return True
    else:
        return False
else:
    for e in word_list:
        if e == word1:
            return True
    else:
        return False

Problem #5: Playing a hand
def calculate_handlen(hand): """ Returns the length (number of letters) in the current hand.
hand: dictionary (string-> int)
returns: integer
"""

pass  # TO DO... Remove this line when you implement this function

def play_hand(hand, word_list):
"""
Allows the user to play the given hand, as follows:

* The hand is displayed.

* The user may input a word.

* When any word is entered (valid or invalid), it uses up letters
  from the hand.

* An invalid word is rejected, and a message is displayed asking
  the user to choose another word.

* After every valid word: the score for that word is displayed,
  the remaining letters in the hand are displayed, and the user
  is asked to input another word.

* The sum of the word scores is displayed when the hand finishes.

* The hand finishes when there are no more unused letters.
  The user can also finish playing the hand by inputing two
  exclamation points (the string '!!') instead of a word.

  hand: dictionary (string -> int)
  word_list: list of lowercase strings
  returns: the total score for the hand

"""

# BEGIN PSEUDOCODE <-- Remove this comment when you implement this function
# Keep track of the total score

# As long as there are still letters left in the hand:

    # Display the hand

    # Ask user for input

    # If the input is two exclamation points:

        # End the game (break out of the loop)

    # Otherwise (the input is not two exclamation points):

        # If the word is valid:

            # Tell the user how many points the word earned,
            # and the updated total score

        # Otherwise (the word is not valid):
            # Reject invalid word (print a message)

        # update the user's hand by removing the letters of their inputted word

# Game is over (user entered '!!' or ran out of letters),
# so tell user the total score

# Return the total score as result of function

Problem #6: Playing a game
procedure you will use to substitute a letter in a hand
def substitute_hand(hand, letter): """ Allow the user to replace all copies of one letter in the hand (chosen by user) with a new letter chosen from the VOWELS and CONSONANTS at random. The new letter should be different from user's choice, and should not be any of the letters already in the hand.
If user provide a letter not in the hand, the hand should be the same.

Has no side effects: does not mutate hand.

For example:
    substitute_hand({'h':1, 'e':1, 'l':2, 'o':1}, 'l')
might return:
    {'h':1, 'e':1, 'o':1, 'x':2} -> if the new letter is 'x'
The new letter should not be 'h', 'e', 'l', or 'o' since those letters were
already in the hand.

hand: dictionary (string -> int)
letter: string
returns: dictionary (string -> int)
"""

pass  # TO DO... Remove this line when you implement this function

def play_game(word_list): """ Allow the user to play a series of hands
* Asks the user to input a total number of hands

* Accumulates the score for each hand into a total score for the
  entire series

* For each hand, before playing, ask the user if they want to substitute
  one letter for another. If the user inputs 'yes', prompt them for their
  desired letter. This can only be done once during the game. Once the
  substitue option is used, the user should not be asked if they want to
  substitute letters in the future.

* For each hand, ask the user if they would like to replay the hand.
  If the user inputs 'yes', they will replay the hand and keep
  the better of the two scores for that hand.  This can only be done once
  during the game. Once the replay option is used, the user should not
  be asked if they want to replay future hands. Replaying the hand does
  not count as one of the total number of hands the user initially
  wanted to play.

        * Note: if you replay a hand, you do not get the option to substitute
                a letter - you must play whatever hand you just had.

* Returns the total score for the series of hands

word_list: list of lowercase strings
"""

print("play_game not implemented.") # TO DO... Remove this line when you implement this function

Build data structures used for entire session and play game
Do not remove the "if name == 'main':" line - this code is executed
when the program is run directly, instead of through an import statement
if name == 'main': word_list = load_words() play_game(word_list) for is_valid_word """ failure=False
# test 1
hand = {'a': 1, 'r': 1, 'e': 1, 'j': 2, 'm': 1, '*': 1}
word = "e*m"

if is_valid_word(word, hand, word_list):
    print("FAILURE: test_is_valid_word() with wildcards")
    print("\tExpected False, but got True for word: '" + word + "' and hand:", hand)

    failure = True

# test 2
hand = {'n': 1, 'h': 1, '*': 1, 'y': 1, 'd':1, 'w':1, 'e': 2}
word = "honey"

if is_valid_word(word, hand, word_list):
    print("FAILURE: test_is_valid_word() with wildcards")
    print("\tExpected False, but got True for word: '"+ word +"' and hand:", hand)

    failure = True

# test 3
hand = {'n': 1, 'h': 1, '*': 1, 'y': 1, 'd':1, 'w':1, 'e': 2}
word = "h*ney"

if not is_valid_word(word, hand, word_list):
    print("FAILURE: test_is_valid_word() with wildcards")
    print("\tExpected True, but got False for word: '"+ word +"' and hand:", hand)

    failure = True

# test 4
hand = {'c': 1, 'o': 1, '*': 1, 'w': 1, 's':1, 'z':1, 'y': 2}
word = "c*wz"

if is_valid_word(word, hand, word_list):
    print("FAILURE: test_is_valid_word() with wildcards")
    print("\tExpected False, but got True for word: '"+ word +"' and hand:", hand)

    failure = True

# dictionary of words and scores WITH wildcards
words = {("h*ney", 7):290, ("c*ws", 6):176, ("wa*ls", 7):203}
for (word, n) in words.keys():
    score = get_word_score(word, n)
    if score != words[(word, n)]:
        print("FAILURE: test_get_word_score() with wildcards")
        print("\tExpected", words[(word, n)], "points but got '" + \
              str(score) + "' for word '" + word + "', n=" + str(n))
        failure=True

if not failure:
    print("SUCCESS: test_wildcard()"

Traceback
Traceback (most recent call last):
  File "C:\Users\jell2\anaconda3\Lib\site-packages\spyder\plugins\editor\panels\scrollflag.py", line 176, in paintEvent
    scale_factor = groove_rect.height() / self.get_scrollbar_value_height()
                   ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ZeroDivisionError: division by zero

QTextCursor::setPosition: Position '-1' out of range
Traceback (most recent call last):
  File "C:\Users\jell2\anaconda3\Lib\site-packages\spyder\plugins\editor\panels\scrollflag.py", line 176, in paintEvent
    scale_factor = groove_rect.height() / self.get_scrollbar_value_height()
                   ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ZeroDivisionError: division by zero
Traceback (most recent call last):
  File "C:\Users\jell2\anaconda3\Lib\site-packages\spyder\plugins\editor\panels\scrollflag.py", line 176, in paintEvent
    scale_factor = groove_rect.height() / self.get_scrollbar_value_height()
                   ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ZeroDivisionError: division by zero
Traceback (most recent call last):
  File "C:\Users\jell2\anaconda3\Lib\site-packages\spyder\plugins\editor\panels\scrollflag.py", line 176, in paintEvent
    scale_factor = groove_rect.height() / self.get_scrollbar_value_height()
                   ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ZeroDivisionError: division by zero
Traceback (most recent call last):
  File "C:\Users\jell2\anaconda3\Lib\site-packages\spyder\plugins\editor\panels\scrollflag.py", line 176, in paintEvent
    scale_factor = groove_rect.height() / self.get_scrollbar_value_height()
                   ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ZeroDivisionError: division by zero
Traceback (most recent call last):
  File "C:\Users\jell2\anaconda3\Lib\site-packages\spyder\plugins\editor\panels\scrollflag.py", line 176, in paintEvent
    scale_factor = groove_rect.height() / self.get_scrollbar_value_height()
                   ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ZeroDivisionError: division by zero
Traceback (most recent call last):
  File "C:\Users\jell2\anaconda3\Lib\site-packages\spyder\plugins\editor\panels\scrollflag.py", line 176, in paintEvent
    scale_factor = groove_rect.height() / self.get_scrollbar_value_height()
                   ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ZeroDivisionError: division by zero
Traceback (most recent call last):
  File "C:\Users\jell2\anaconda3\Lib\site-packages\spyder\plugins\editor\panels\scrollflag.py", line 176, in paintEvent
    scale_factor = groove_rect.height() / self.get_scrollbar_value_height()
                   ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ZeroDivisionError: division by zero
Traceback (most recent call last):
  File "C:\Users\jell2\anaconda3\Lib\site-packages\spyder\plugins\editor\panels\scrollflag.py", line 176, in paintEvent
    scale_factor = groove_rect.height() / self.get_scrollbar_value_height()
                   ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ZeroDivisionError: division by zero
Traceback (most recent call last):
  File "C:\Users\jell2\anaconda3\Lib\site-packages\spyder\plugins\editor\panels\scrollflag.py", line 176, in paintEvent
    scale_factor = groove_rect.height() / self.get_scrollbar_value_height()
                   ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ZeroDivisionError: division by zero
Traceback (most recent call last):
  File "C:\Users\jell2\anaconda3\Lib\site-packages\spyder\plugins\editor\panels\scrollflag.py", line 176, in paintEvent
    scale_factor = groove_rect.height() / self.get_scrollbar_value_height()
                   ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ZeroDivisionError: division by zero
Traceback (most recent call last):
  File "C:\Users\jell2\anaconda3\Lib\site-packages\spyder\plugins\editor\panels\scrollflag.py", line 176, in paintEvent
    scale_factor = groove_rect.height() / self.get_scrollbar_value_height()
                   ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ZeroDivisionError: division by zero
Traceback (most recent call last):
  File "C:\Users\jell2\anaconda3\Lib\site-packages\spyder\plugins\editor\panels\scrollflag.py", line 176, in paintEvent
    scale_factor = groove_rect.height() / self.get_scrollbar_value_height()
                   ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ZeroDivisionError: division by zero

Versions

Spyder version: 5.4.3  (conda)
Python version: 3.11.7 64-bit
Qt version: 5.15.2
PyQt5 version: 5.15.10
Operating System: Windows 10

Dependencies
# Mandatory:
atomicwrites >=1.2.0                             :  1.4.0 (OK)
chardet >=2.0.0                                  :  4.0.0 (OK)
cloudpickle >=0.5.0                              :  2.2.1 (OK)
cookiecutter >=1.6.0                             :  2.5.0 (OK)
diff_match_patch >=20181111                      :  20200713 (OK)
intervaltree >=3.0.2                             :  3.1.0 (OK)
IPython >=7.31.1,<9.0.0,!=8.8.0,!=8.9.0,!=8.10.0 :  8.20.0 (OK)
jedi >=0.17.2,<0.19.0                            :  0.18.1 (OK)
jellyfish >=0.7                                  :  1.0.1 (OK)
jsonschema >=3.2.0                               :  4.19.2 (OK)
keyring >=17.0.0                                 :  23.13.1 (OK)
nbconvert >=4.0                                  :  7.10.0 (OK)
numpydoc >=0.6.0                                 :  1.5.0 (OK)
paramiko >=2.4.0                                 :  2.8.1 (OK)
parso >=0.7.0,<0.9.0                             :  0.8.3 (OK)
pexpect >=4.4.0                                  :  4.8.0 (OK)
pickleshare >=0.4                                :  0.7.5 (OK)
psutil >=5.3                                     :  5.9.0 (OK)
pygments >=2.0                                   :  2.15.1 (OK)
pylint >=2.5.0,<3.0                              :  2.16.2 (OK)
pylint_venv >=2.1.1                              :  2.3.0 (OK)
pyls_spyder >=0.4.0                              :  0.4.0 (OK)
pylsp >=1.7.2,<1.8.0                             :  1.7.2 (OK)
pylsp_black >=1.2.0                              :  1.2.1 (OK)
qdarkstyle >=3.0.2,<3.2.0                        :  3.0.2 (OK)
qstylizer >=0.2.2                                :  0.2.2 (OK)
qtawesome >=1.2.1                                :  1.2.2 (OK)
qtconsole >=5.4.2,<5.5.0                         :  5.4.2 (OK)
qtpy >=2.1.0                                     :  2.4.1 (OK)
rtree >=0.9.7                                    :  1.0.1 (OK)
setuptools >=49.6.0                              :  68.2.2 (OK)
sphinx >=0.6.6                                   :  5.0.2 (OK)
spyder_kernels >=2.4.3,<2.5.0                    :  2.4.4 (OK)
textdistance >=4.2.0                             :  4.2.1 (OK)
three_merge >=0.1.1                              :  0.1.1 (OK)
watchdog >=0.10.3                                :  2.1.6 (OK)
zmq >=22.1.0                                     :  25.1.2 (OK)

# Optional:
cython >=0.21                                    :  None (NOK)
matplotlib >=3.0.0                               :  3.8.0 (OK)
numpy >=1.7                                      :  1.26.4 (OK)
pandas >=1.1.1                                   :  2.1.4 (OK)
scipy >=0.17.0                                   :  1.11.4 (OK)
sympy >=0.7.3                                    :  1.12 (OK)

Never mind,  the code wasn't showing up properly on my screen. I have found & solved the issue after copying & pasting the entire code a second time.


zoomToRectangle - service is zooming without dragging

When preforming zoomToRectangle.activate method and clicking on the map without dragging, the service makes an unpredictable behavior :

Sometimes it zooms to a random location in map.
Sometimes the service is max zooming to the cursor's current location over the map
Sometimes it doesn't do anything at all - that is the desired behavior

Please assist and stabilize this service.

Thanks for submitting the issue, we will check it.

Solved in master branch - next release will be out very soon :)


Training infrastructure

Hi,
I was wondering if there is any guideline regarding the suggested infrastructure to run the training using this library.
I've read this but would be great to have more info! I was thinking to use GKE but not really sure how to make the setup.
Thanks!

It is easiest to just train one policy on one Linux machine, with many cpu cores. Doesn't matter if that is a local desktop or google cloud instance or whatever.

ok thanks. I'm running a simulation on my 8 cores ubuntu machine. After 1.5h, around ~1M step were computed, so it should takes around 6 days to reach 100M steps. I probably need a better machine :)

Indeed. I'm using the AMD Ryzen 3900, with 12 cores/24 threads, takes 3 days for 200Mln samples. I would go for AMD 3990x threadripper nowadays. Hopefully we find some faster learning method, perhaps based on the new tiny differentiable simulator (TDS).

Time to buy a new machine. thanks for your setup suggestions!


fix: runlevel not having the same status as group in run.json

With this PR, we enable any string in run.json "runlevel", making it equivalent to "group". In case the two of them are configured and their values differ, the revision will be set as WONTGO.

i would also be fine to just klll group adn wait for state v3 before doing such vocabulary change

As runlevel only supports data root, platform or app values, open that to other possible values would make the new containers incompatible with old devices. I think that's a good enough reason to keep runlevel the way it is and start using group, which has more flexibility as it allows any value

As runlevel only supports data root, platform or app values, open that to other possible values would make the new containers incompatible with old devices. I think that's a good enough reason to keep runlevel the way it is and start using group, which has more flexibility as it allows any value


'fxcored query slashing signing-info' no longer works as expected

As suggested at https://github.com/FunctionX/fx-core/issues/55, we should use fxcored q slashing signing-info instead of `fxcored query slashing signing-info
Affected docs pages:

https://functionx.gitbook.io/home/f-x-core-tutorials/f-x-cored-commands-documentation#signing-info
https://functionx.gitbook.io/home/validators/validator-setup#track-validator-signing-information

The documentation has been updated, thanks


dependency issue

Hi there,
with latest go implementation, trying to compile the source file leads to the download of ten of packages from various github repository, everything was working fine with dnscrypt-proxy-2.0.19, any ideas what could be going wrong? Any advice appreciated!
go: finding github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da go: finding github.com/jedisct1/go-dnsstamps v0.0.0-20190303171121-de46dd0ba576 go: finding github.com/kardianos/service v1.0.0 go: finding github.com/hashicorp/golang-lru v0.5.1 go: finding github.com/jedisct1/go-minisign v0.0.0-20180516093733-f4dbde220b4f go: finding github.com/facebookgo/atomicfile v0.0.0-20151019160806-2de1f203e7d
Cheers,
Chris.

2.0.19 was vendoring deps, while since 2.0.20 it is using Go modules.
What is the issue exactly? Your code snippet doesn's show any error, it is fetching dependencies as expected.

Arg! I am packaging it for a distro, which means security issues forbid us to compile source codes fetching other sources from the internet. I guess I'll have to either package missing go modules or vendor deps myself then.
Thanks for the explanations!
Would be nice to have a switch somewhere disabling auto-fetching and triggering an error for missing deps though!
Cheers,
Chris.

The vendor directory is still here.

I guess it is not up to date with golangv  1.12, get some compilation errors with 1.12, while it compiles fine with 1.11.
``
vendor/vendor/golang.org/x/net/idna
src/vendor/vendor/golang.org/x/net/idna/idna.go:338:51: invalid operation: bidirule.DirectionString(u) != "vendor/vendor/vendor/golang.org/x/text/unicode/bidi".LeftToRight (mismatched types "vendor/vendor/vendor/vendor/golang.org/x/text/unicode/bidi".Direction and "vendor/vendor/vendor/golang.org/x/text/unicode/bidi".Direction)
src/vendor/vendor/golang.org/x/net/idna/idna.go:397:44: invalid operation: bidirule.DirectionString(mapped) == "vendor/vendor/vendor/golang.org/x/text/unicode/bidi".RightToLeft (mismatched types "vendor/vendor/vendor/vendor/golang.org/x/text/unicode/bidi".Direction and "vendor/vendor/vendor/golang.org/x/text/unicode/bidi".Direction)
vendor/golang.org/x/net/idna
src/vendor/golang.org/x/net/idna/idna.go:338:51: invalid operation: bidirule.DirectionString(u) != "vendor/vendor/golang.org/x/text/unicode/bidi".LeftToRight (mismatched types "vendor/vendor/vendor/golang.org/x/text/unicode/bidi".Direction and "vendor/vendor/golang.org/x/text/unicode/bidi".Direction)
src/vendor/golang.org/x/net/idna/idna.go:397:44: invalid operation: bidirule.DirectionString(mapped) == "vendor/vendor/golang.org/x/text/unicode/bidi".RightToLeft (mismatched types "vendor/vendor/vendor/golang.org/x/text/unicode/bidi".Direction and "vendor/vendor/golang.org/x/text/unicode/bidi".Direction)
''

These were built using Go 1.12.1

Finally succeeded to compile, I had to remove the go.mod and go.sum files, plus, some minor changes between 1.11 and 1.12.1 were interfering. I am closing, would be nice if you could still keep that vendor directory there in future versions.
Thanks,
Cheers,Chris.

Arg! I am packaging it for a distro, which means security issues forbid us to compile source codes fetching other sources from the internet. I guess I'll have to either package missing go modules or vendor deps myself then.
Thanks for the explanations!
Would be nice to have a switch somewhere disabling auto-fetching and triggering an error for missing deps though!
Cheers,
Chris.

Which distro?
As a Go packager, you should be aware of the move to Go modules, which causes difficulties for us packagers. It will be the default for Go 1.13 in August.

Finally succeeded to compile, I had to remove the go.mod and go.sum files, plus, some minor changes between 1.11 and 1.12.1 were interfering. I am closing, would be nice if you could still keep that vendor directory there in future versions.
Thanks,
Cheers,Chris.

You shouldn't do that but instead pass the environment variable GO111MODULE=off

Thanks for the info, this is for Mageia and we have only a few modules already packaged, which indeed makes it a hell if modules are the only option.
In addition, I am not familiar with go, was just packaging dnscrypt-proxy v1 and was forced to step up to play with "go" for v2 :-/


Move homepage-hero.svg to an img tag

While testing our main branch (https://twbs-bootstrap.netlify.app) on Firefox for Android, I noticed that when the docs menu is opening/closing, the transition is very sluggish. Chrome has better performance, but it's still a little sluggish. Now, the device I use is not a low end I believe, Samsung Galaxy S9, and I also tested out a Galaxy S20, both with Firefox and Chrome.
I believe this fixes the issue since it reduces layout reflows. As a bonus, the image will be cached. I used an empty alt attribute since I believe the image is decorative only, but @patrickhlauke let me know if something else is needed.
Note that we didn't see the issue before because we were using a horizontal navbar approach.
@mdo I added this in the alpha2 project because its effect is pretty big.
Preview: https://deploy-preview-31761--twbs-bootstrap.netlify.app/

I made 2 recordings but apparently the issue is not so visible there so the following is a little moot. The problem does exist in real life, though:

Main
This branch

We might need to revert or at least revisit this—the homepage image is all blurry in Safari (mobile and desktop). I didn't notice it until just tonight.

I don't have a machine with Safari, but can you try locally with just reverting the optimize patch? Also, can you try with the original dimensions in the img tag?

Tried dimensions changes, but no difference. Opening the new image in a new tab, there's no issue. Seems to be because SVGs in an img tag render the SVG as a bitmap vs actually vector.

Sounds like a browser bug for sure... I don't mind reverting this temporarily, but keep in mind that the previous solution is too CPU hungry and low to mid devices will have a pretty poor experience.

https://stackoverflow.com/questions/43546754/svg-icons-in-safari-are-blurred
https://stackoverflow.com/questions/24439705/svgs-are-displaying-blurry-in-safari
https://github.com/airbnb/lottie-web/issues/1976

Someone should really report this bug. That being said, please try and see if we can work around it (I can't test it myself since I don't own a device with Safari), otherwise let me know and I will revert it.


Add GitHub action to create apk release

When:

successful merge into master branch
manually

The release should show up in the releases section of the repository.
Investigate here - https://github.com/marketplace?type=actions&query=android+

This should be parameterized to allow for both Pyrrha and Prometeo builds, pulling from different properties files. The code itself can continue to have names such as PyrrhaApplication as this is upstream.

Also a good tutorial here: https://www.freecodecamp.org/news/use-github-actions-to-automate-android-development/


QD with immediate msgs hangs

Original author: Harshitha Menon
Original issue: https://charm.cs.illinois.edu/redmine/issues/660

I have created a small test case extending Eric Mikida's testcase (https://charm.cs.illinois.edu/redmine/issues/596) to reproduce the hang.

Original date: 2015-08-27 21:06:30

Immediate message should be placed in nodequeue in multicore context, then executed normally.

Original author: Nikhil Jain
Original date: 2015-09-03 05:45:59

I am not able to reproduce this hang on Mac OSX Yosemite. Tried with and without production. Any particular flag/condition needed to reproduce?

Original author: Harshitha Menon
Original date: 2015-09-03 13:51:17

I believe that I had tried it with net-linux build without any special flags. I am unable to find the directory I worked on so can't be sure.

Original author: Nikhil Jain
Original date: 2015-09-03 14:25:14

Ah, my bad. I should see both expedited and immediate msgs. I think I have reproduced the bug now. Thanks!

Original author: Nikhil Jain
Original date: 2015-09-03 15:39:41

This commit most likely fixed this issue too: ~~https://charm.cs.illinois.edu/gerrit/#/c/442/~~ https://github.com/UIUC-PPL/charm/commit/2d0a5a05d5494a76bf38a7b1f8dad7630d914b6a


Possible problem with Duplex streams?

Thanks so much for this module--I think it is really handy for stream pipelines.
However, I think there might be a problem (that I've experienced) with how duplex streams are handled.
Duplex streams emit both "end" and "finish" events, which means that a duplex stream isn't really "done" until both events are fired.
Right now, this module resolves the stream when either an "end" or a "finish" event fires, like this:
stream.on("end", resolve);
stream.on("close", resolve);
stream.on("finish", resolve);

However, because a duplex is both "writable" and "readable", the "finish" event might be fired, resolving the promise, before the readable side of the stream ends. If an error happens between the "finish" and the "end" events, the promise for that stream will not be rejected. It has already been resolved--a call to "reject" does not change the state.
I think the fix would be to check if the stream is an instance of "Duplex" and then wait for both events to be fired before resolving the promise.
Something like this maybe?
var readableEnded = false;
var writableFinished = false;
var streamIsDuplex = stream instanceof Duplex;

function resolver (result) {
     // If the stream is a duplex, we wait until both "end" and
    // "finish" are fired. Otherwise, we can go ahead and resolve.
     if (!streamIsDuplex || (readableEnded && writableFinished)) {
          resolve(result);
     }
}

// error event handler rejects promise

stream.on("end", function (result) {
   readableEnded = true;
   resolver(result);
});
stream.on("finish", function (result) {
   writableFinished = true;
   resolver(result);
});
stream.on("close", resolve);

Once again, thanks for making this module.

const duplexEvents = ['finish', 'end'].map(on);
const duplexResolved = streamIsDuplex ? Promise.all(duplexEvents) : Promise.race(duplexEvents);
Promise.race(['error', 'close'].map(on).concat(duplexResolved));

Just put dev-null[0] stream at the end of your list of streams, instead of the duplex/transform stream.
[0] https://www.npmjs.com/package/dev-null

Should be fixed in v2.1.2 (see #14).


New Feature Request-  'jsFilePath'

Feature Request
A nice feature would be the ability to set the javascript file path.
Example
Currently, the path for a js file from /dist/views/index.html is index.js.
An option, such as jsFilePath : '/dist/js/' would change index.js to /dist/js/index.js.
My particular issue
I'm currently vulcanizing my components all the way to the top level html file. As a result, my view at /dist/views/index.html has a path of / and it looks for http://myhost.com/index.js which doesn't exist.
Thanks Team!

+1 for this feature, especially when dealing with multiple source files in gulp.  By using gulp-foreach, this is my current fix to this:
return gulp.src(...) // Many source files
        .pipe(vulcanize(...))
        .pipe(gulpForeach((stream, file) => {
            const jsFileName = getCorrectPath(file);
            return stream.pipe(crisper({
                jsFileName: jsFileName
            }));
        }))
        .pipe(gulp.dest(...));

It would be nice to eliminate this messy workaround.

This is necessary for pushState -- the path must be "/index.js"


How to update chart?

What is the proper way to update the chart after it has been drawn?
I need to update the chart width and quite find a solution for it.
The manual says it is as simple as flamegraph.update() but I still wasn't able to update it.
Probably I misunderstand the concept
Below code draws chart just fine.
function flame_chart(flame_tree) {

    var flame_chart = flamegraph()
        .width(500)

    d3.select("#flame-chart")
        .datum(flame_tree)
        .call(flame_chart)
}

I expect this code to update the chart width (but it doesn't)
function flame_chart(flame_tree) {

    var flame_chart = flamegraph()
        .width(1000)
        .update()

    d3.select("#flame-chart")
        .datum(flame_tree)
        .call(flame_chart)
}

It looks like the SVG container width wasn't updated on chart.update()
The fix is as following:
document.getElementById('flame-chart').children[0].setAttribute("width", "1000px")

Duplicate #146. Closing.


Add ExecuteReader method that let query database without binding to a class

Unit test
Async support

Note : I can't execute all unit tests because the file sqlite3.dll is missing.


Use the Facebook SDK in another language

Enabling the use of the Facebook SDK in another language.
Currently only the en_US lang can be used in: https://github.com/mediaelement/mediaelement/blob/master/src/js/renderers/facebook.js#L354
Is it possible to change it by retrieving the value of the lang attribute of the html element and / or via the options.
And also if the SDK has already been loaded by other previous scripts (ex: like button, share, ...) it is possible not to load it since it will overwrite previous configurations?
Thanks

It certainly can be integrated as an option; I'll explore this renderer soon and push the change. Thanks

Please download the master branch and test this configuration:
new MediaElementPlayer('playerID', {
     facebook: {
        appId: '',
	xfbml: true,
	version: 'v2.10',
        // New parameter to load SDK language
	lang: 'en_US'
     }
});

I refactor the Facebook renderer and now it will check if the FB object exists; if so, it will use the current configuration. Otherwise, it loads the SDK properly. Thanks for reporting this and please star the project to support it

thanks for the fix it works very well


Hex Editor: Unclear in multi-selection that Data Inspector still showing first item not highlighted item

Testing #114952
If you shift+right arrow to multi-select in the hex editor, the Data Inspector keeps the data for the first item in the selection and not the highlighted item. It is unclear in the Data Inspector view which item it is reporting on.

Duplicate of https://github.com/microsoft/vscode-hexeditor/issues/207

Duplicate of https://github.com/microsoft/vscode-hexeditor/issues/207


Service request: Fizy

From Launchpad bug #1010101 by Şâkir Aşçı:
fizy is a music cloud service that provides a wide range of songs to the listeners. It has 600,000 daily visitors and it was designated as the best music search engine by Mashable Awards in 2011. Both Pandora and Rdio are restricted in most countries and listeners out of USA are not able to use those cloud services. Therefore, adding fizy to the cloud list would enhance the quality and audience range of Nuvola Player.
Homepage: http://fizy.com/
Wikipedia: https://en.wikipedia.org/wiki/Fizy
Note to self: "we're sorry. fizy is currently only available in turkey. " :-(

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

This ticket is ancient and I'm not sure whether it is still relevant. If anybody is interested in this service, please create a new ticket :+1:


Add Test to PeriodicHandler

Add Test to PeriodicHandler to check the destruction does not wait the period
Signed-off-by: jparisu<EMAIL_ADDRESS>

Already added in PR #167


Simplify roles query for performance

A short explanation of the proposed change:
Replace UNION-ed subqueries with single subquery and WHERE OR clause
An explanation of the use cases your change solves
The many UNIONs (14 in total) were causing these queries to be extremely complex and slow on our largest landscapes resulting in impact to other queries being made (lots of temp blocks being written). This change simplifies the query so much it no longer needs temp blocks.
Added context
The backing dataset for the Role class uses a UNION between all the
different org and space roles where the organization_id is -1 for space
roles and vice versa. This means that no role can have both a space_id
and an org_id so doing a SELECT WHERE space_id IN (space_ids) and UNION
that to SELECT WHERE org_id in (org_ids) can be replaced by just a
single select with an OR in the query clause
In our largest environments this reduced the complexity of this query
(using EXPLAIN ANALYZE) by nearly 30x

[x] I have reviewed the contributing guide

[x] I have viewed, signed, and submitted the Contributor License Agreement

[x] I have made this pull request to the main branch

[x] I have run all the unit tests using bundle exec rake

[x] I have run CF Acceptance Tests

Ran CATS on PR. Hit the endpoint a few different ways.  Examined CCNG's logs. Everything looks good!


pin qiskit nature to <=0.6.2

Summary
See #87
Details and comments

just saw this is taken care of in #86


Cursor jumping to end on edit with react

http://jsbin.com/siyusux/1/edit?html,js,output
enter a longer number like 34,400.32 then try to edit at the beginning of the number and it always jumps to the end :(

This PR #262  Seems to be to fix this issue, but I don't see that it was ever merged.  I'm more than happy to test and help out here if I can.

Thanks @jlaustill A few fixes for the cursor has been merged. Would you test this? https://jsfiddle.net/nosir/kbaxx64s/
It looks good to me.

Can't reproduce again, will close this, please let me know if you still have issue with the url above.


Debug Failure prevents renaming imports on file move

TypeScript Version:  3.9.7

Search Terms:
update imports on rename, update imports on file move
Expected behavior:
When renaming a typescript file/folder in VS code, import statements pointing at the file in question should be updated.
Actual behavior:
Although this used to work, I am now running into an issue where the imports are no longer being updated.
I ran tsserver with verbose logs, and noticed the following issue which seems related to the behavior I'm seeing (entire log file uploaded too, you can see this around line 5246 of tsserver.log):
Info 2254 [12:43:47.630] event:
    {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"c:/AIMDev/CI-Web/libs/lib-forms/tsconfig.spec.json"}}
Info 2255 [12:43:47.630] event:
    {"seq":0,"type":"event","event":"telemetry","body":{"telemetryEventName":"projectInfo","payload":{"projectId":"e17614f21b281be9dace752d26bd0c1eef44fe366fc005e02deb7ef7b1277935","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":3,"tsSize":3450,"tsx":0,"tsxSize":0,"dts":87,"dtsSize":1935892,"deferred":0,"deferredSize":0},"compilerOptions":{"baseUrl":"","declaration":false,"emitDecoratorMetadata":true,"experimentalDecorators":true,"importHelpers":true,"lib":["es2017","dom"],"module":"commonjs","moduleResolution":"node","paths":"","preserveSymlinks":true,"resolveJsonModule":true,"rootDir":"","skipLibCheck":true,"sourceMap":true,"strict":true,"target":"es6","typeRoots":[""],"outDir":"","types":["",""]},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":true,"files":true,"include":true,"exclude":true,"compileOnSave":false,"configFileName":"other","projectType":"configured","languageServiceEnabled":true,"version":"3.9.7"}}}
Err 2256  [12:43:48.478] Exception on executing command {"seq":255,"type":"request","command":"getEditsForFileRename","arguments":{"oldFilePath":"c:/AIMDev/CI-Web/libs/lib-forms/src/lib/i18n/lib-forms-messages.service.ts","newFilePath":"c:/AIMDev/CI-Web/libs/lib-forms/src/lib/i18n/aim-forms-messages.service.ts"}}:

    Debug Failure.

    Error: Debug Failure.
        at c:\Users\A9FZGZZ\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:117897:61
        at forEachProperty (c:\Users\A9FZGZZ\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:118061:17)
        at updateTsconfigFiles (c:\Users\A9FZGZZ\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:117887:9)
        at c:\Users\A9FZGZZ\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:117851:13
        at Function.ChangeTracker.with (c:\Users\A9FZGZZ\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:126223:17)
        at Object.getEditsForFileRename (c:\Users\A9FZGZZ\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:117850:49)
        at Proxy.getEditsForFileRename (c:\Users\A9FZGZZ\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:139227:23)
        at c:\Users\A9FZGZZ\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:149297:146
        at c:\Users\A9FZGZZ\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:147536:36
        at c:\Users\A9FZGZZ\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:144905:25
        at Map.forEach (<anonymous>)
        at ProjectService.forEachProject (c:\Users\A9FZGZZ\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:144898:41)
        at ProjectService.forEachEnabledProject (c:\Users\A9FZGZZ\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:144903:22)
        at combineProjectOutputFromEveryProject (c:\Users\A9FZGZZ\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:147535:28)
        at IOSession.Session.getEditsForFileRename (c:\Users\A9FZGZZ\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:149297:31)
        at Session.handlers.ts.createMapFromTemplate._a.<computed> (c:\Users\A9FZGZZ\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:148075:61)
        at c:\Users\A9FZGZZ\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:149555:88
        at IOSession.Session.executeWithRequestId (c:\Users\A9FZGZZ\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:149546:28)
        at IOSession.Session.executeCommand (c:\Users\A9FZGZZ\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:149555:33)
        at IOSession.Session.onMessage (c:\Users\A9FZGZZ\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:149579:35)
        at Interface.<anonymous> (c:\Users\A9FZGZZ\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:150895:27)
        at Interface.emit (events.js:203:13)
        at Interface._onLine (readline.js:316:10)
        at Interface._normalWrite (readline.js:461:12)
        at Socket.ondata (readline.js:172:10)
        at Socket.emit (events.js:203:13)
        at addChunk (_stream_readable.js:295:12)
        at readableAddChunk (_stream_readable.js:276:11)
        at Socket.Readable.push (_stream_readable.js:210:10)
        at Pipe.onStreamRead (internal/stream_base_commons.js:166:17)

I have also attached the other tsserver.log file (named tsserver2.log in this issue). It didn't contain any explicit errors, but did contain the following:
Info 302  [12:46:46.283] Project '/dev/null/inferredProject1*' (Inferred)
Info 302  [12:46:46.283] 	Files (0) NoProgram

Perhaps it's related, perhaps not.
Playground Link: n/a
Related Issues:
https://github.com/microsoft/TypeScript/issues/28771 (Mac specific)
https://github.com/microsoft/TypeScript/issues/30535 (performance-related)
https://github.com/microsoft/TypeScript/issues/26927 (Seems this issue was fixed back in 2018, I'm definitely on a newer version of TS)
https://github.com/microsoft/TypeScript/issues/24857
Attachments:
tsserver.log
tsserver2.log

I'm getting the same error when renaming a file in a fairly small monorepo using project references. Feel free to use that project to reproduce the issue. I suspect it may have something to do with project references because I'm able to rename/refactor without issue in a project with a single tsconfig.json.
Here's the TypeScript server log when attempting to rename lib/string/src/concat.ts to lib/string/src/concatenate.ts: rename-error.txt
The file rename is successful, but references are not updated as expected.
I also tested this in WebStorm which was able to perform the above refactor successfully.

I can confirm that renaming imports still is not working in v1.52.1

I can confirm that renaming imports still is not working in v1.52.1


Allow "jsonl" data type signifier

Feature request
load_dataset currently does not accept jsonl as type but only json.
Motivation
I was working with one of the run_translation scripts and used my own datasets (.jsonl) as train_dataset. But the default code did not work because
FileNotFoundError: Couldn't find a dataset script at jsonl\jsonl.py or any data file in the same directory. Couldn't find 'jsonl' on the Hugging Face Hub either: FileNotFoundError: Dataset 'jsonl' doesn't exist on the Hub. If the repo is private or gated, make sure to log in with `huggingface-cli login`.

The reason is because the script has these lines to extract the data type by its extension. Therefore, the derived type is jsonl which is not recognized by datasets as the error above shows.
https://github.com/huggingface/transformers/blob/ade26bf9912f69e2110137443e4406d7dbe253e7/examples/pytorch/translation/run_translation.py#L342-L356
I suppose you could argue that this is the script's fault (in which case I'll do a PR over at transformers) but it makes sense to me to add jsonl as an alias to json in datasets.
Your contribution
At the moment I cannot work on this. I think it can be as "easy" as having an alias for json, namely jsonl.

You can use "json" instead. It doesn't work by extension names, but rather by dataset builder names, e.g. "text", "imagefolder", etc. I don't think the example in transformers is correct because of that

Yes, I understand the reasoning but this issue is to propose that the example in transformers (while incorrect) "makes sense" in terms of user expectation. So the question is whether it would be possible to add "aliases" for common types (like "json" and "text") based on common extensions (like jsonl and txt)?


Fix issue with Installed Apps trying to load invalid action links

Closes #6380
What's Changed
Catch NoReverseMatch exception.

Screenshots

TODO

[x] Explanation of Change(s)
[x] Added change log fragment(s) (for more information see the documentation)
[x] Attached Screenshots, Payload Example
[x] Unit, Integration Tests
[x] Documentation Updates (when adding/changing features)
[x] Example App Updates (when adding/changing features)
[x] Outline Remaining Work, Constraints from Design

Any chance a similar fix is needed for /api/apps/installed-apps/?

Any chance a similar fix is needed for /api/apps/installed-apps/?

It's already in the API view.
    @staticmethod
    def _get_app_data(app_config):
        try:
            home_url = reverse(app_config.home_view_name)
        except NoReverseMatch:
            home_url = None
        try:
            config_url = reverse(app_config.config_view_name)
        except NoReverseMatch:
            config_url = None
        try:
            docs_url = reverse(app_config.docs_view_name)
        except NoReverseMatch:
            docs_url = None


ENDOC-721 Refresh the angular MFE tutorial

@jyunmitch Probably good enough for you to eyeball this one but I did create a tutorial bundle for this one - http://pbcdev.k8s-entando.org/entando-de-app/en/entando_hub.page#/bundlegroup/70


no scroll bar in the saved tool bar tab

mc version is 1.19.4 and BSH version is 1.0.0, also maybe make it possible to move the arrow/button things to the other side

Hi! Please make sure you are running the latest version (1.1.2 which is only for 1.20.1)
Also, the arrows and save icon are not from my mod, probably some other mod you have

is the fix for the scroll bar not simple to back port?, also is it not bsh that adds the other saved hotbars? i thought it was, sorry for that

No its not hard to backport in this case specifically but everything has moreso moved to 1.20 at this point, would recommend just updating


[XEB] Optimize/characterize by pair

Add a new method to perform optimization of angles (aka characterization) by pair. This is essential for "parallel" XEB. At it's heart, this is simply a "groupby" operation on the dataframe before calling the characterize function. There are additional code changes:

Lots of boilerplate for making a "closure class" so we can optimize by pair in parallel. This is an embarrassingly parallel operation, and it's important when doing very "wide" (i.e. lots of pairs) calibrations.
The least-squares estimation of individual (one pair, one cycle depth) fidelities involved using pandas apply, which turned out to be very slow! I profiled the benchmark function on a test workflow. It was taking 7.87 seconds, of which 5.3s were cumulative inside the apply function. The rest of it involved simulating the many circuits. benchmark_... is called during the optimization's objective function so it's performance critical. With the change, the call was a total of 2.5s and the least-squares estimation no longer appeared in the top many cumulative-time profiling calls.
Bug fix if you tried to do parallel XEB on a device that couldn't do all four layers. With added test.
The result of the characterize_.. function has been beefed up to be a dataclass with more fields. Not only do you get the optimization results, but a nicer dictionary of angles and a dataframe of the refit fidelities. This simplifies one of the older notebooks. This data is also per-pair so you can do parallel xeb effectively
An exponential decay fitting function, taken from experiments.cross_entropy_benchmarking, which will be deprecated, #3775
Some helpful pandas magic wrapped with nice function names to simplify plotting

I consider the comments minor and I'll LGTM it now.

Re dataframes and testing experimental/workflow code in general: I think the notebooks (which thanks to @balopat are now run against cirq master on each PR!) are super helpful for making sure the whole flow works as expected. You can already see in the "unit" tests that I have to basically mock out a whole experiment to test a given part. This is expected from the more "workflow-type" functionality in this suite of PRs. The unit behavior is simple and tested elsewhere (generating random circuits, simulating them, executing them ... this is all covered well in cirq!)

PTAL (I know you already approved, but I'll give you a chance to respond to my responses anyways)


[PE-D][Tester B] The addf command error message is not informative

Using the addf command, I attempted to add "fish soup" into the program. This input failed and the error message is as follows:

I know the input was invalid because I could see from my screenshot that the ingredient flag was used incorrectly (also because I did it intentionally). However, a user who had a typo might not know where the input went wrong at all. This might be frustrating to use since it takes a substantial amount of time to fill in the form only for the input to be invalid and the whole input deleted.
There is no such issue when using the CLI however, as it displays where I went wrong and my input remains as is.

The bug in exception handling persists, however.

Labels: severity.Medium type.FeatureFlaw
original: Jxleejiaxin/ped#4

Fixed in #245


Fix for #1108: Serialization of 'Closure' is not allowed

Allows for changes in Symfony serialization in 4.x, where json_encode has been replaced by serialize and an error is thrown if a closure is found. This replaces the service container object as a Definition argument with a Symfony DI Reference that can be serialized.

Having had a look through the features, I'm not too sure what the best approach for a test for this would be, but happy to take some direction.

For context, in case anyone is having similar issues: Behat-Laravel-Extension#78 was what led to this PR - in the meantime, following the instructions there should (as a stop-gap) get Behat working for Laravel >=5.6.

It would be great to merge this PR

Yep looks good, thank you

Thanks @philtweir!

Thanks @ciaranmcnulty !


Use echarts for building chart component instead of recharts

What this PR does / why we need it:
https://echarts.apache.org/en/index.html
echars can draw more graphical charts.
It is well documented and easy to customize.
So I switch library for render chats to this.

Which issue(s) this PR fixes:
Fixes #
Does this PR introduce a user-facing change?:
Insight is under development and is not yet visible to users.
So this is maybe NONE.

NONE

/approve


feat: Add base events aggregator

[WIP]
TODO:

[ ] Use events API key (the one they send in the request body
[ ] Use an actual background job (?)
[ ] Discuss if we really need redis
[ ] Add Docker file and deploy to staging

This seem to be working. This version basically receives the events acting as proxy and stores them before sending them in digestible batches to the Mavis API. Pretty much the same as a CloudFlare worker

We definetely don't need redis for this @TheJarX, so lets not add it.
Few reasons why we don't:

These are analytical events, so while they are important, it won't be the end of the world if some are lost for some reason


Add use case of ifremer in demo.tex

too long?

I think it's fine. If it's too detailed, perhaps we should have some discussion of these in section 1


Add onEvent for source

I added onEvent() for sources, which is the same as filers.

Thanks.

Using this feature, I created dictionary source!
https://github.com/matsui54/ddc-dictionary


Update post URL

Please update the URL of the post that was added in #169.
Post URL: https://dev.to/alexliesenfeld/rust-http-testing-with-httpmock-2mc1
Author Name: Alexander Liesenfeld
Categories:: Web and Network Services

Done. See https://readrust.net/search?q=Rust+HTTP+Testing+with+httpmock to confirm


[Bug]When the tenant associated with the user is not public, login is not possible.

What happened
I deployed inlong-1.12.0 using docker-compose
then I create a new tenant named shujugl ，and a new user named shuju-admin.
No matter whether the user shuju-admin is an administrator, a common user, or a tenant administrator, the user cannot log in.
The login page is displayed immediately after the user logs in
What you expected to happen
.
How to reproduce
.
Environment
No response
InLong version
1.12.0
InLong Component
InLong Dashboard
Are you willing to submit PR?

[ ] Yes, I am willing to submit a PR!

Code of Conduct

[X] I agree to follow this project's Code of Conduct

@lordk911 please try the latest 1.13.0 version, and give steps to reproduce the issue, thanks.

Close this issue since there has been no feedback for a long time, and feel free to re-open it if needed.


core: get transactions from dao when mempool should not be used

All of these places deal strictly with the chain and shouldn't ever be
bothered with mempool. It also fixes a deadlock on reverification of
non-standard tx:
1 @ 0x42f62f 0x43fbe9 0x43fbbf 0x43f95d 0x967059 0x966f66 0x972c7c 0x974e13 0x97a5d9 0x97bdf0 0x976147 0x966cc0 0x970f70 0x96c8cb 0x9ba858 0x45ca51
	0x43f95c	sync.runtime_SemacquireMutex+0x3c							/usr/local/go/src/runtime/sema.go:71
	0x967058	sync.(*RWMutex).RLock+0x128								/usr/local/go/src/sync/rwmutex.go:50
	0x966f65	github.com/CityOfZion/neo-go/pkg/core/mempool.(*Pool).TryGetValue+0x35			/go/src/github.com/CityOfZion/neo-go/pkg/core/mempool/mem_pool.go:229
	0x972c7b	github.com/CityOfZion/neo-go/pkg/core.(*Blockchain).GetTransaction+0x4b			/go/src/github.com/CityOfZion/neo-go/pkg/core/blockchain.go:782
	0x974e12	github.com/CityOfZion/neo-go/pkg/core.(*Blockchain).References+0x132			/go/src/github.com/CityOfZion/neo-go/pkg/core/blockchain.go:944
	0x97a5d8	github.com/CityOfZion/neo-go/pkg/core.(*Blockchain).GetScriptHashesForVerifying+0x58	/go/src/github.com/CityOfZion/neo-go/pkg/core/blockchain.go:1410
	0x97bdef	github.com/CityOfZion/neo-go/pkg/core.(*Blockchain).verifyTxWitnesses+0x4f		/go/src/github.com/CityOfZion/neo-go/pkg/core/blockchain.go:1545
	0x976146	github.com/CityOfZion/neo-go/pkg/core.(*Blockchain).isTxStillRelevant+0x216		/go/src/github.com/CityOfZion/neo-go/pkg/core/blockchain.go:1067
	0x966cbf	github.com/CityOfZion/neo-go/pkg/core/mempool.(*Pool).RemoveStale+0xff			/go/src/github.com/CityOfZion/neo-go/pkg/core/mempool/mem_pool.go:208
	0x970f6f	github.com/CityOfZion/neo-go/pkg/core.(*Blockchain).storeBlock+0x2ecf			/go/src/github.com/CityOfZion/neo-go/pkg/core/blockchain.go:614
	0x96c8ca	github.com/CityOfZion/neo-go/pkg/core.(*Blockchain).AddBlock+0xea			/go/src/github.com/CityOfZion/neo-go/pkg/core/blockchain.go:308
	0x9ba857	github.com/CityOfZion/neo-go/pkg/network.(*blockQueue).run+0x157			/go/src/github.com/CityOfZion/neo-go/pkg/network/blockqueue.go:48

Nope, I don't think it'll make any difference for restore scenario because we have an empty mempool there and I've never seen it in pprof.


consider change namespace to GF

Current namespace is GFDN (GreatFriends Developer Network) that is not well-kknown name.
GF is shorter and come from the web site domain name should by better.

also change organization name from greatfriends to GreatFriends

or uses full name? GreatFriends.ThaiBahtText

OK, I chose GreatFriends for the namespace because
using GreatFriends; // is meaningful and funny.
but package name on NuGet should be shorter by remove namespace out of the name.


Properly filter out unknown keys for clone/resub

Fixes #7909
Yet another PR on the clone/resubmit subject (there must be something wrong with me!)
Fixes a few issues, besides the one changing the dict that we're iterating over.

Task1/Step1 are known args, so first check whether the key matches that regex and remove unsupported inner keys
really remove inner keys :)
ReReco has no inner chain definition, so it would check against None

Sorry about that. Still to be tested on my VM, but unit tests are Ok.

test this please

test this please

@ticoann those 2 jenkins results above ran on the same code, so I assume we are good to merge it (unless you want to wait for the next run).
I ran tests on my VM and it should be fine now, I hope :)
After you merge it, can you cut a new tag (pre8?)? I can then make a new cmsdist request tomorrow morning. Thanks!

test this please


React Training page is down

Test Case
"Get Training" page on react router website is down.
Steps to reproduce
Go to "https://reacttraining.com/react-router/"
Click on "Get Training"
Expected Behavior
Training page should be rendered.
Actual Behavior
Blank page is rendered with an error in console.

Seems to work just fine from my machine. But also just in general:
https://downforeveryoneorjustme.com/reacttraining.com
https://isitdownorjust.me/reacttraining-com/
And down.com also reports it as "up".

This issue persists. If you have the low-tracking-blocking in firefox on, the website stays black except for the menu.

Same for me, except I get 522. Works when I run it through proxy