Late evaluation of function parameters

There is a HUGE megathread on the Python-Ideas mailing list regarding PEP 671 for late evaluation ("late-binding") of function default values for function parameters.

Default values are evaluated once, when the def statement runs, and the value is cached in the function object. That is fast and efficient, but it can be surprising for mutable default values like lists. I expect that most people have been bitten by the def func(arg=[]) gotcha at least once, despite the FAQ about it.

Changing the current behaviour is off the table, so don't even ask for it. Backwards compatibility means that it will not change. Rants about how it's "wrong" are also pointless: there are good reasons for the behaviour, even if it is sometimes surprising.

But how do people feel about adding a second mechanism to Python to provide defaults which are evaluated on-call, instead of only once? What sort of features would you want?

E.g. should the default expression be evaluated in the surrounding scope, the caller's scope, the function's internal scope? Should you be able to mix early and late bound defaults? Use the walrus operator in default values? If so, where does the variable get stored? Should the default expression be introspectable? Should you be able to call it externally?

Please read (or at least skim) the thread of Python-Ideas, many of these points have been discussed but there is no consensus of what the correct behaviour or syntax should be.

See also another relevant thread here.

πŸ‘︎ 16
πŸ’¬︎
πŸ‘€︎ u/stevenjd
πŸ“…︎ Dec 09 2021
🚨︎ report
Non-Instrumental Test for the Evaluation of Tongue Function cureus.com/articles/72673…
πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/CureusJournal
πŸ“…︎ Jan 03 2022
🚨︎ report
Function of Letters of Recommendation other than objective evaluation?

I understand the basic function of LoRs, but a weird question just came to my mind.

If I got very strong LoRs (for example, letters from a department chair who has tremendous impacts in the field/a chief editor of an influential academic journal/a manager of a leading company), would the admissions team feel that if the admission was denied, the letter writers could be somewhat embarrassed and lost potential opportunities for future collaboration, so that the team would want to guarantee an admission? I understand that the denial can be attributed to a personal issue (the applicant), but the fact that the letter writers have agreed to write the letter in part proves that the writers believe in the applicant. So I was wondering whether a very strong LoR could have such effects in admissions.

πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/fatkillerfatty
πŸ“…︎ Dec 07 2021
🚨︎ report
Evaluation of Lauricella Hypergeometric Function

I've been working on a problem and it seems like the integral that I've hit a wall with has got a name: Lauricella Hypergeometric Function (series?) F_D

How does one go about evaluating this function for numerical values? Is there some mathematical software I can use to generate values or some nice approximation that I can code up?

πŸ‘︎ 6
πŸ’¬︎
πŸ‘€︎ u/calculo2718
πŸ“…︎ Nov 06 2021
🚨︎ report
Routine evaluation, retry!

Hi again,

I’m basically re-posting the same post that I put up 114 days ago, because I didn’t really get any responses and I have no idea what I’m doing. I’ve gone as far as I can with my own research, but what I need now is advice from people who have used these products before.

I’m looking to expand to a full skin care routine focused on anti-aging with a little bit of acne/decongestion. I will be getting a sunscreen from outside of the Deceim product line, so I won’t be going over that. I won't be using a peptide because I'm planning on adding in a direct acid. Additionally I am actively trying to conceive, so I can't use retinols and a few other The Ordinary items.

What I need some help with is routine and weekly frequency. I already used the guides on Deceim's site and in this sub's wiki to set up the order of the routine and verify compatibility but I want to check with people that know what it’s like to use these products, and make sure I'm not being excessive. I really want to get on top of my bad skin genetics and start doing preventative care.

I am currently using niaminacide and NMF + HA every morning and evening. I use the squalane cleanser and the SDSM2 face mist (from Deciem's NIOD line). There are four other items I’ve been considering getting:

  • Rosehip oil
  • Resveratrol 3% ferulic acid 3%
  • Azelaic Acid Suspension 10%
  • ascorbyl glucoside 12%.

So all together, I will have a cleanser, a few hydrators, an antioxidant, a vitamin/mineral (niaminacide), a direct acid, and vitamin C (and sunscreen). Not using peptides or retinol at this time. Below is my plan for a routine. I welcome thoughts, critiques, suggestions.

AM

  1. Squalane Cleanser
  2. SDSM2 mist
  3. Niaminacide
  4. Resveratrol - 2 drops mixed with step 5
  5. NMF + HA
  6. A sunscreen - TBD

PM

  1. Squalane cleanser
  2. SDSM2 mist
  3. Ascorbyl glucoside 12%
  4. Azelaic Acid Suspension 10%
  5. Resveratrol - 2 drops added to #7
  6. Rose hip oil - a few drops added to #7
  7. NMF + HA

My questions are as follows...

  • Can I do niaminacide and ascorbyl glucoside at the same time? This is not the L-AA version of vitamin C, and I didn’t see anything saying that it wasn’t compatible on Deceim's website. For now I have one in the AM and one in the PM, unless told otherwise.

  • Are there any of these I should be incorporating slower than normal, such as once a week or every other day? Has anyone experienced issues with using all of these together? Or has anyone had a better experience using these

... keep reading on reddit ➑

πŸ‘︎ 2
πŸ’¬︎
πŸ“…︎ Oct 14 2021
🚨︎ report
Is there a future for micro firms (1-3 people) that do mostly routine accounting functions for small local businesses (payroll, payroll tax deposits, preparing 941s, sales taxes, income tax returns)?

The reason I ask this is because I currently work at a micro firm, and my boss is planning on having me take over his clients within the next 5 or so years when he retires. I currently have a job offer at a mid size public accounting firm, with an agreement to start in May. I’m having second thoughts about moving, however, as the idea of taking over and owning my own practice is pretty appealing.

I just don’t know if the things I do on a daily basis are immune to automation in the coming years. Further, I have never received any kind of formal training or very valuable experience with this firm, so if I wanted to offer things like audits or compilations, reviews etc. I don’t know if I could just learn those skills myself through trial and error, or if I would need to leave my current firm and figure out how they do it at bigger firms to be able to offer services that are safe from automation down the line

πŸ‘︎ 5
πŸ’¬︎
πŸ‘€︎ u/IdyotWind
πŸ“…︎ Jan 10 2022
🚨︎ report
Calling timestamp functions from GPIO interrupt routine ?

I'm trying to write a library for handling push button debouncing and long press/short press events.

Having looked at Arduino libraries that do the same using millis function often called from ISR.

In the case of pico, can the get_absolute_time function be called from the GPIO interrupt routine ? How is the overflow handled for this function ?

πŸ‘︎ 4
πŸ’¬︎
πŸ“…︎ Jan 16 2022
🚨︎ report
Where would an absolute beginner to neural networks start when trying to learn how to build a NNUE evaluation function?
πŸ‘︎ 9
πŸ’¬︎
πŸ‘€︎ u/haddock420
πŸ“…︎ Sep 01 2021
🚨︎ report
ob-grpc - Grpc evaluation functions for org-babel

I made a package for executing grpc requests through org-babel. It relies on grpcurl.

https://github.com/shsms/ob-grpc

It is still very basic, doesn't support streaming methods, authentication, etc.

There are instructions in the README. This is my first package, so code review, suggestions, pull requests are all welcome!

πŸ‘︎ 8
πŸ’¬︎
πŸ‘€︎ u/shsms
πŸ“…︎ Sep 05 2021
🚨︎ report
Need routine to function but become stir-crazy pretty quickly

Can any of y’all relate to this? When I don’t have a routine I feel myself become agitated more often, i feel more depressed, and really anxious. But when I do fall into a routine, I pretty soon get sick of it and I want to do something spontaneous. The only thing is that I almost immediately regret wanting to be spontaneous & ill wish I had just stuck to my routine…. πŸ˜…

πŸ‘︎ 100
πŸ’¬︎
πŸ‘€︎ u/narutonoodle
πŸ“…︎ Oct 27 2021
🚨︎ report
ob-grpc: Grpc evaluation functions for org-babel github.com/shsms/ob-grpc
πŸ‘︎ 3
πŸ’¬︎
πŸ‘€︎ u/fakecreditcard
πŸ“…︎ Sep 10 2021
🚨︎ report
For the season, A snowy hillside scene that came from my iterative function routine. I’ve placed it in a tessellated pattern. Math is cool.
πŸ‘︎ 10
πŸ’¬︎
πŸ‘€︎ u/burgemh
πŸ“…︎ Dec 19 2021
🚨︎ report
Optimal Routine For Best Brain Function?

What Is Your Routine For Optimal Brain Function?

i.e. meditation, keto, supps, fasting, exercise, etc.

πŸ‘︎ 7
πŸ’¬︎
πŸ“…︎ Nov 24 2021
🚨︎ report
Wargame Match Evaluator and Evaluation Function

In this post I would like to share and discuss a tool I have made to help evaluate my matches. Its pretty much just an excel spreadsheet, the interesting stuff in my opinion is the math. Take note that this tool is only used to analyze games consisting of players 1-8 with no more than 4 players on each side.

Here is the link to the spreadsheet

This uses scripts to do some of its work, so the spreadsheet will probably ask you for permissions when you hit the buttons. This means that you must login with your google account and copy the spreadsheet to your account to use it (If someone knows how I can do this without compromising your anonymity, let me know). If the spreadsheet doesn't ask you for permissions then you can go to the script editor (Tools>Script Editor) and manually run a script in which case it should ask you for permissions.

Grant them if you wish. I am a random internet person and make no gurantees as to your personal digital safety.

For those of you who do not have a google account, this is what you will see. This spreadsheet consists of four tabs;

  • Dashboard - This is a page of graphs, after you have input data.
  • final_data - This is some reference data I shamelessly stole from here
  • frameManu - This is a template that the scripts use to build out the game state data based on your input in the next tab (MatchOverview).
  • MatchOverview - This tab holds all the game state data for the match and weaves the frames together in a coherent way.

What happens is the user (you) puts your data in the tab "MatchOverview". This includes the number of players, the time limit, the victory points, and the frames that you would like to evaluate. Then you hit a button which cascades that input data through some scripts which format the rest of the tabs accordingly. It can not be that simple, of course. How does the spreadsheet get the information from your game?

Unfortunately this can only be done with manual action, which is why we will use the frames system. Once you hit the "Insert Frames" button on the "MatchOverview" tab then a series will be recorded in the same tab. Suddenly a new tab will open up and it will be called "Frame1". What is going on here?

Because I was not able to find an easy way to automate this process, you will need to go to your replay to

... keep reading on reddit ➑

πŸ‘︎ 52
πŸ’¬︎
πŸ‘€︎ u/T3hmann518
πŸ“…︎ Mar 31 2021
🚨︎ report
Renal function in patients following a low carbohydrate diet for type 2 diabetes: a review of the literature and analysis of routine clinical data from a primary care service over 7 years journals.lww.com/co-endoc…
πŸ‘︎ 37
πŸ’¬︎
πŸ‘€︎ u/dem0n0cracy
πŸ“…︎ Oct 02 2021
🚨︎ report
Physically Unclonable Functions: Classification, Evaluation, and Tradeoffs in PUFs - Technical Articles allaboutcircuits.com/tech…
πŸ‘︎ 5
πŸ’¬︎
πŸ‘€︎ u/allaboutcircuits
πŸ“…︎ Jul 19 2021
🚨︎ report
Physically Unclonable Functions: Classification, Evaluation, and Tradeoffs in PUFs - Technical Articles allaboutcircuits.com/tech…
πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/allaboutcircuits
πŸ“…︎ Jul 19 2021
🚨︎ report
I need a daily routine to function, but routine feels like a prison. What do I do lol

Having a daily routine...

Pros Cons
reliable + less messy painfully boring + feels like I'm on a leash
more productive tiring + delicate to maintain; when one part of the routine is disrupted, everything else afterwards is disrupted
a necessary adult habit people with ADHD thrive in chaos
good for your circadian rhythm, making your brain much more efficient get's messed up every time you change any part of your life, or even after one late night out
designated time for every task means I don't forget things maintaining the routine turns into it's own separate task, despite supposedly making daily life easier
not worrying about forgetting anything = less anxiety + more mental energy + better memory in the past, has always been ultimately unrealistic

I want to be free! But I also want to be functional! I imagine other people have the same problem. I'm curious what others have to say on this?

πŸ‘︎ 379
πŸ’¬︎
πŸ‘€︎ u/puppydogbrain
πŸ“…︎ Jun 24 2021
🚨︎ report
Libraries for self-play and slow evaluation functions

Hey folks. This one is about self-play and slow evaluation functions for AIs that play against each other. I could roll my own solution here but surely something already exists? My AI game already exists and works great so this is a practical question.

  • A list of floats, a vector describes the parameters of one AI.
  • We can compare vector X to vector Y, by having two corresponding AIs play games against each other, and get a score [0,1] where 0.2 means X did great.
  • It takes 5 minutes on my machine to compare X and Y.
  • There's no way to get an absolute score for one vector X. It must be compared to another vector.

How do we find better and better AI parameters? Can history be useful upon reruns? What open source tools exist to do this?

I already have all the self-play and tournament infrastructure code working. This is the last piece and it just feels like there must be an out of the box solution for this out there already. How to explore this parameter space. If I write this code from scratch it seems wasteful (and likely sub-optimal compared to what others have done). Given all the great ML tools out there already... I'm sure that just a few lines of Python with the right functions from the right library could do this.

Or not..? Do I really need to hand-roll this?

Any recommendations? Thoughts?

Thanks!

πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/Zulban
πŸ“…︎ Jun 02 2021
🚨︎ report
Echocardiographic evaluation of the effect of poor blood glucose control on left ventricular function and ascending aorta elasticity

https://www.sciencedirect.com/science/article/abs/pii/S1056872721001215

Echocardiographic evaluation of the effect of poor blood glucose control on left ventricular function and ascending aorta elasticity

Author links open overlay panelXiang-TingSongYi-FeiRui Show more Outline Share Cite https://doi.org/10.1016/j.jdiacomp.2021.107943 Get rights and content

Abstract

Background and aims Type 2 diabetes mellitus (T2DM) is associated with high cardiovascular risk. Preclinical left ventricular (LV) dysfunction and subclinical arterial stiffness have been documented in patients with T2DM. The aims of this study were to investigate whether there were any differences in LV function and ascending aorta elasticity between T2DM patients with controlled [defined as glycosylated hemoglobin (HbA1c) <6.5%] and uncontrolled (HbA1c β‰₯6.5%) blood glucose.

Methods We studied 86 T2DM patients: 42 T2DM patients with controlled blood glucose (controlled T2DM group) and 44 T2DM patients with uncontrolled blood glucose (uncontrolled T2DM group), and 40 healthy subjects as control. They all underwent transthoracic echocardiography examination, LV systolic function was evaluated by global longitudinal strain (GLS) and LV diastolic function was defined as the ratio of the early diastolic transmitral flow velocity (E) to average mitral annular velocity ( ). Ascending aorta inner diameters and brachial blood pressure were measured to calculate ascending aorta elastic parameters: compliance (C), distensibility (D), strain (S), stiffness index (SI), Peterson's elastic modulus (EM).

Results Compared to control, T2DM patients had reduced GLS, increased E/e Μ… and impaired ascending aorta elasticity. Furthermore, LV function and ascending aorta elasticity were more severely damaged in uncontrolled T2DM group compared with controlled T2DM group. By Pearson correlation analysis, the level of HbA1c was independently associated with the parameters of the LV function and ascending aorta elasticity.

Conclusions T2DM can impair the LV myocardial function and ascending aorta elastic properties, which may be further impaired by poor blood glucose control.

Keywords EchocardiographyType 2 diabetes mellitusLeft ventricularFunctionAscending aortaElasticity

πŸ‘︎ 3
πŸ’¬︎
πŸ‘€︎ u/dem0n0cracy
πŸ“…︎ May 04 2021
🚨︎ report
Is there a way to turn on the 'Protect battery' function when charging overnight and have it turn off automatically an hour before I wake up? I can't seem to find away with Bixby Routines?
πŸ‘︎ 3
πŸ’¬︎
πŸ‘€︎ u/WilliamTheGreat-
πŸ“…︎ Sep 17 2021
🚨︎ report
Functional evaluation of the P681H mutation on the proteolytic activation of the SARS-CoV-2 variant B.1.1.7 (Alpha) spike cell.com/iscience/fulltex…
πŸ‘︎ 3
πŸ’¬︎
πŸ‘€︎ u/Peeecee7896
πŸ“…︎ Jan 16 2022
🚨︎ report
Google has added a Delay function to routines

Hopefully someone finds this when they Google it. I'm not sure when it happened but I'm very glad they did it.

You can now add a delay in between steps in a routine in Google Home.

Create/Edit a routine, +Add Action -> Delay Start

πŸ‘︎ 11
πŸ’¬︎
πŸ‘€︎ u/Toadfish91
πŸ“…︎ Oct 19 2021
🚨︎ report
Renal function in patients following a low carbohydrate diet for type 2 diabetes a review of the literature and analysis of routine clinical data from a primary care service over 7 years

Renal function in patients following a low carbohydrate diet for type 2 diabetes a review of the literature and analysis of routine clinical data from a primary care service over 7 years

Unwin, Davida; Unwin, Jena; Crocombe, Dominicb; Delon, Christinec; Guess, Nicolad; Wong, Christophere Author Information Current Opinion in Endocrinology & Diabetes and Obesity: July 22, 2021 - Volume - Issue - doi: 10.1097/MED.0000000000000658

Abstract

Purpose of review

People with T2 Diabetes (T2D) who follow a low carbohydrate diet (LCD) may increase their dietary protein intake. Dietary protein can modulate renal function so there is debate about its role in renal disease. There is concern that higher protein intakes may promote renal damage, and that LCDs themselves may impact on cardiovascular risk. We review the evidence around LCDs, renal and cardiovascular risk factors and compare to results obtained in a real-world, primary care setting.

Recent findings

Chronic kidney disease (CKD) is a well-recognised microvascular complication of T2D caused in part by; chronically increased glomerular pressure, hyperfiltration, increased blood pressure and advanced glycation end products. Hyperglycemia can be seen as central to all of these factors. A LCD is an effective first step in its correction as we demonstrate in our real-world cohort.

Summary

We found evidence that LCDs for people with T2D may improve many renal and cardiovascular risk factors. In our own LCD cohort of 143 patients with normal renal function or only mild CKD, over an average of 30 months the serum creatinine improved by a significant mean of 4.7 (14.9) ΞΌmol/L. What remains to be shown is the effect of the approach on people with T2D and moderate/severe CKD.

https://journals.lww.com/co-endocrinology/abstract/9000/renal_function_in_patients_following_a_low.99181.aspx

πŸ‘︎ 81
πŸ’¬︎
πŸ‘€︎ u/dem0n0cracy
πŸ“…︎ Aug 03 2021
🚨︎ report
The Value of Ketone Bodies in the Evaluation of Kidney Function in Patients with Type 2 Diabetes Mellitus. (Pub Date: 2021)

https://doi.org/10.1155/2021/5596125

https://pubmed.ncbi.nlm.nih.gov/33937415

Abstract

Objectives

Recent studies have shown that the slightly elevated circulating levels of ketone bodies (KBs) played a significant role in the treatment of various diseases. This study is aimed at investigating the association between different levels of KBs and kidney function in patients with type 2 diabetes mellitus (T2DM).

Methods

A retrospective study of 955 patients with T2DM (426 women and 529 men) admitted to our hospital from December 2017 to September 2019 was conducted. Patients were divided into different groups in line with the levels of KBs (low-normal group: 0.02-0.04 mmol/L, middle-normal group: 0.05-0.08 mmol/L, high-normal group: 0.09-0.27 mmol/L, and slightly elevated group: >0.27 and <3.0 mmol/L).

Results

In the present study, individuals with high-normal levels of KBs had the lowest risk of diabetic kidney disease (DKD) and increased peak systolic velocity (PSV), those with middle-normal levels of KBs had the lowest risk of increased renal arterial resistive index (RI), with a positive correlation between increasedΞ± 1-microglobulin and KB concentration. In addition, the indicators of glomerulus, renal tubules, and renal arteries were all poor with slightly elevated circulating levels of KBs, and KB concentration lower than 0.09 mmol/L can be applied as the threshold for low risk of renal function damage.

Conclusions

In summary, slightly elevated circulating levels of ketone bodies are not of benefit for renal function in patients with type 2 diabetes mellitus.

------------------------------------------ Info ------------------------------------------

Open Access: True

Authors: Yimei Li - Yongze Zhang - Ximei Shen - Fengying Zhao - Sunjie Yan -

Additional links:

https://downloads.hindawi.com/journals/jdr/2021/5596125.pdf

https://www.ncbi.nlm.nih.gov/pmc/articles/PMC8055418

πŸ‘︎ 5
πŸ’¬︎
πŸ‘€︎ u/Ricosss
πŸ“…︎ May 04 2021
🚨︎ report
How to do self contained co-routines using local functions

I wrote up a quick gist outlining how I use local functions to remove all of the extra private IEnumerator methods from my code whose only function is to hold the coroutine iterator block. I much prefer the readability of having the coroutine start code and iterator block in the same method and I found local functions to be a good way of doing that.

https://gist.github.com/cado1982/f363bf959a864632bf78478066c4b9d0

πŸ‘︎ 4
πŸ’¬︎
πŸ‘€︎ u/AttentiveUnicorn
πŸ“…︎ Oct 19 2021
🚨︎ report
Help with functions homework and text evaluation

I am currently doing my homework on functions, and the goal is to find the words that surround the keyword the most often (the collocates). For example, if a name is often surrounded by the words warrior and war, it could mean the keyword is related to war.

Here is the question i am stuck on word for word : First, write a function called collocates_list() that compiles all of the words that appear within N places of a keyword in a given text file.

Here is the block of code I have so far, but I don't know why it gives me some letters...

import nltk
def collocates_list(filename, keyword, N=2): 
    with open(filename, 'r') as f: 
        file_text = f.read().lower()
    file_tokens = nltk.word_tokenize(file_text)
    file_words = [token for token in file_tokens if any(c.isalpha() for c in token)]

    file_words_clean = []
    for token in file_words:
        if token[-1:] == '.':
            file_words_clean.append(token[:-1])
    else:
        file_words_clean.append(token)
        
    key_list = word_locations_list(keyword, file_words_clean)

    return key_list
print(collocates_list('prideprejudice.txt', 'pride', N=4))

P.S. I know there is some functions already defined in the block of code to make it work, but this post would be too long with it. I just don't understand the question entirely.

πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/bullz3y3_vinny
πŸ“…︎ Feb 28 2021
🚨︎ report
React Re-rendering: Functions Calls and Lazy Evaluation medium.com/doctolib/the-s…
πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/joboccara
πŸ“…︎ May 12 2021
🚨︎ report
Can you combine MCTS with an evaluation function

Is it possible to use a simple evaluation function to make MCTS run faster and require less training (even if it slightly suffers in performance)?

Thank you

πŸ‘︎ 9
πŸ’¬︎
πŸ‘€︎ u/physicsman2606
πŸ“…︎ Jan 19 2021
🚨︎ report
If you have a goal and commitment to the process of developing yourself to make it better than the best, you have to trouble yourself regularly, by changing your habits, routine behaviors,the pursuit of the dream,and the evaluation of your relationships, keep changing
πŸ‘︎ 2
πŸ’¬︎
πŸ“…︎ Apr 15 2021
🚨︎ report
The intromission function of the foreskin (August 2002) "To evaluate this observation an artificial introitus was mounted on a scales. Repeated measurements showed a 10-fold reduction of force on entry with an initially unretracted foreskin as compared to entry with a retracted foreskin. " sciencedirect.com/science…
πŸ‘︎ 25
πŸ’¬︎
πŸ“…︎ Jan 10 2022
🚨︎ report

Please note that this site uses cookies to personalise content and adverts, to provide social media features, and to analyse web traffic. Click here for more information.