The General Question  What is the python3.5+ syntax for calling a function that accepts *args, where *args references a variable with multiple items.     I am self taught python; I can't help but think I am missing something rather elementary about how *args works. Feel free to point me to some necessary reading.   A Specific Question  When sorting a list of lists by columns using operator.itemgetter(*items), how can I provide *items variably?  Sample List  import operator  records = [     ['0055613893 ', 'AP', 'BU', 'AA', '00005000012404R'],     ['0048303110 ', 'MM', 'BU', 'AB', '00028230031385R'],     ['0044285346 ', 'AP', 'BU', 'AA', '00062240050078R'],     ['0048303108 ', 'MO', 'BU', 'AF', '00047780036604R'],     ['0048751228 ', 'AP', 'ME', 'AC', '00000750013177R'],     ['0045059521 ', 'AR', 'YT', 'AB', '00005430014570R'] ]   If I wanted to sort this particular recordset by the 3rd column and then by the 1st column I would:  records.sort(key=operator.itemgetter(3, 1))  This, of course, works as one would expect.  What I'm getting at is how can I provide the "3, 1" to itemgetter() variably?  i.e.:  indices = {insert some code here to provide itemgetter() what it needs} records.sort(key=operator.itemgetter(indices))  I've Tried:  tuple:   indices = (3, 1)  or  indices = 3, 1  TypeError: list indices must be integers or slices, not tuple  list:   indices = [3, 1]  TypeError: list indices must be integers or slices, not list     It's never too late to be humbled by the basics. Thanks in advance for assisting in filling this gap in my python foundation.
In the following method definitions, what does the * and ** do for param2?  def foo(param1, *param2): def bar(param1, **param2):
Real definition of "countable set" What is the difference between "is subject to" and "is subjected to"? I found the following sentence on the U.S. Customs and Border Protection website:     All persons, baggage, and other merchandise arriving in or leaving the   United States are subject to inspection and search by CBP officers.   I would like to know whether changing "subject" to "subjected" will change the meaning of the sentence. I created a custom module in drupal 8. And I am trying to add js and css file in  my_module.libraries.yml file using this   lrv_key:   version: 1.x   js:     js/lrv.js: {}        dependencies:       - core/jquery       - core/drupalSettings   css:     theme:       css/lrv.css: {}   But it doesnt work. I've installed drush in /usr/local/lib/drush/drush and composer in /usr/local/bin/composer.  When I try to run drush /usr/local/lib/drush/drush I get the following:     /usr/local/lib/drush/drush: line 129: /Applications/MAMP/bin/php/php5.2.17/bin: is a directory /usr/local/lib/drush/drush: line 129: exec: /Applications/MAMP/bin/php/php5.2.17/bin: cannot execute: Undefined error: 0 –    OR the following:     Unable to load autoload.php. Drush now requires Composer in order to install its depedencies and autoload classes. Please see README.md   What am I doing wrong? I'd like to install drush to use with MAMP if anyone has any suggestions. I've done through the readme and nothing seems to be working. Use nmcli to modify VPN password? With nmcli, I can modify VPN data like this:  nmcli con modify myvpn vpn.data 'refuse-pap = yes, user = xxx'   So I'm wondering if I can set password this way as well? Regular cast vs. static_cast vs. dynamic_cast Can I exclude spam domains from my search results? Sometimes when I search for something, there are plenty of links to sites with no content (those who only have the premade templates which the search terms), spammers, and leechers (as in copying content from other sites, like B r o t h e r s o f t who leeches on SoftPedia.com).  How come they have such a high ranking without any original content (furthermore, why are they not simply banned from the results)?  And also, is there some way of filtering them out? Like for example completely exclude a domain from search results? I have two related problems that are causing me big trouble:  Let $\;a_1,...,a_n\in\Bbb R\;,\;\;a_i\neq 0\;\;\forall\;i\;$ , and let $\;b_1,...,b_n\in\Bbb R\;,\;\;b_i\neq b_j\;\;\forall\,i\neq j\;$ .  (1) Prove that the equation  $$a_1x^{b_1}+\ldots+a_nx^{b_n}=0$$  has at most $\;n-1\;$ different zeros in $\;(0,\infty)\;$ (Hint: Use induction)  (2) Prove that the equation  $$a_1e^{b_1x}+\ldots+a_ne^{b_nx}=0$$  has at most $\;n-1\;$ different zeros in $\;\Bbb R\;$ .  Now, the following is what I've done so far: for a differentiable function $\;f\;$ ,  I can prove that if $\;f'(x)=0\;$ has $\;n-1\;$ different zeros, then $\;f(x)\;$ has at most $\;n\;$ different zeros, using the mean value theorem, say.  But I can't see how to use induction in this case: if I differentiate in the first problem, I get $$0=f'(x)=a_1b_1x^{b_1-1}+\ldots +a_nb_nx^{b_n-1}=\frac1x\sum_{i=1}^na_ib_ix^{b_i}$$  ...and now?! How does induction kick in here? I though perhap something like: if we suppose WLOG $\;b_1&lt;b_2&lt;...&lt;b_n\;$ , then perhaps inducting on $\;\lfloor b_n\rfloor\;$, but it gets messy and blurry if $\;b_n&lt;0\;$...  Any help, hints are very much appreciated. When is a gerund supposed to be preceded by a possessive adjective/determiner? I assume that the following sentences are grammatically correct:   He resents your being more popular than he is. Most of the members paid their dues without my asking them. They objected to the youngest girl's being given the command position. What do you think about his buying such an expensive car? We were all sorry about Jane's losing her parents like that.   I'm still getting used to this possessive gerund structure. It sounded so weird to me at first. Is the structure used in both formal and informal contexts? Are there any alternative structures that result in the same meaning and are more frequently used? (Examples taken from ) If my question gets migrated to another site, is it possible somehow to reverse it back to the original site? The use of imaginary and complex values comes up in many physics and engineering derivations. I have a question about that: Is the use of complex numbers simply to make the process of derivation easier, or is it an essential ingredient, without which it would be impossible to derive some results?   I can identify two different settings where the answer may be different:   It doesn't look like it is mandatory for results in Newtonian mechanics, General Relativity and classical electrodynamics. Can we say the same thing about quantum mechanics either way for sure?   Could this be a difference in quantum mechanics over the classical picture? I have a set of values $x$ and $y$ which are theoretically related exponentially:  $y = ax^b$  One way to obtain the coefficients is by applying natural logarithms in both sides and fitting a linear model:  &gt; fit &lt;- lm(log(y)~log(x)) &gt; a &lt;- exp(fit$coefficients[1]) &gt; b &lt;- fit$coefficients[2]   Another way to obtain this is using a nonlinear regression, given a theoretical set of start values:  &gt; fit &lt;- nls(y~a*x^b, start=c(a=50, b=1.3))   My tests show better and more theory-related results if I apply the second algorithm. However, I would like to know the statistical meaning and implications of each method.  Which of them is better? Do "twice as high xxxxx as" , "twice as high" and "twice higher" mean the same thing? Product of invertibles in $\Bbb Z_n$ [Wilson's Theorem generalization] How can we compute the product of all invertibles in $\Bbb Z_n$?  In the special case $n=p$ where $p$ is a prime it is Wilson's theorem. By pairing inverses it reduces to computing the product of all $a$ such that $a^2\equiv 1\pmod{n}.\,$  How can we do that? Possible Duplicates:             does anyone know a free software that will graph the directories on my hard drive and sort them in order of largest size?  or provide me a solution for me to quickly determine what drives/ files are consuming my hard drive space? Induced metric on a null hypersurface I'm shooting with a Nikon 810, and my night shots often have a strong moire when I export them from Lightroom at 640x640 (optimized for Instagram).   This photo was shot at f2.8, ISO 4000, 15 seconds with a Nikkor 17-35mm. Does anyone know why this is happening?? Prove $-(-a)=a$ using only ordered field axioms Glassware with scratched/etched surfaces generate more bubbles (, ). Why these rough surfaces allow easier heterogeneous nucleation? Creating A Bootable USB Of Windows 8.1 On OS X? Reasons for wanting create such a usb include:   PC is unbootable and you want to prepare a bootable USB using the ISO file that you have on your external hard drive. to install Windows 8.1 on Mac without Boot Camp.   What are the necessary steps to create such a Windows 8.1 bootable usb on a Mac ?