title: How to deal with method takes 1 positional argument but 2 were given in functional code?
body: <p>I have made a very small function to clear a Google Calendar using the API. The API generally works.The reference code from Google Developer pages is as so:</p>
  <pre><code>service.calendars().clear('primary').execute()
  </code></pre>
  <p>and my function is as so:</p>
  <pre><code>def clear_gcal(service): 
      someCal = '''my_calendar_address''' 
      service.calendars().clear(someCal).execute()
      print(&quot;Some Google Cal cleared&quot;)
  </code></pre>
  <p>Running this with a service variable that works (I use it to add to the calendar too with no errors, I get &quot;TypeError: method() takes 1 positional argument but 2 were given&quot;.All solutions to this I find uses self in OOP, but my code is just functional (and I prefer it that way for this), so how can I deal with this, seemingly pretty common error type? Thank You,</p>
  <pre><code>Traceback (most recent call last):
  
  File &quot;&lt;ipython-input-87-d7bf7ff34210&gt;&quot;, line 1, in &lt;module&gt; runfile('C:/Users/b017646/ExportCal/main.py', wdir='C:/Users/b017646/ExportCal')
  
  File &quot;C:\ProgramData\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py&quot;, line 827, in runfile execfile(filename, namespace)
  
  File &quot;C:\ProgramData\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py&quot;, line 110, in execfile exec(compile(f.read(), filename, 'exec'), namespace)
  
  File &quot;C:/Users/b017646/ExportCal/main.py&quot;, line 17, in &lt;module&gt; gcal.clear_gcal(service)
  
  File &quot;C:\Users\b017646\ExportCal\gcal.py&quot;, line 48, in clear_gcal service.calendars().clear(deaCal).execute()
  
  TypeError: method() takes 1 positional argument but 2 were given
  </code></pre>
  <p><strong>GregersDK</strong></p>