import time
import sys
import os
from tspapi import API


class Common(object):
    def __init__(self, ):
        self.api = API()
        self.usage_args = ""

    @staticmethod
    def usage(self, args):
        sys.stderr.write("usage: {0} {1}\n".format(os.path.basename(sys.argv[0]), args))

    def send_measurements(self, measurements):
        """
        Sends measurements using the Measurement API

        :param measurements:
        :return: None
        """
        self.api.measurement_create_batch(measurements)

    def run(self):
        """
        Main loop
        """
        while True:
            print("Doing absolutely nothing")
            time.sleep(self.interval)

import time
import sys
import os
from tspapi import API


class Common(object):
    def __init__(self, ):
        self.api = API()
        self.usage_args = ""
        # Set our application id from the environment variable
        self.appl_id = os.environ['TSI_APPL_ID']

    @staticmethod
    def usage(args):
        sys.stderr.write("usage: {0} {1}\n".format(os.path.basename(sys.argv[0]), args))

    def send_measurements(self, measurements):
        """
        Sends measurements using the Measurement API

        :param measurements:
        :return: None
        """
        self.api.measurement_create_batch(measurements)

    def run(self):
        """
        Main loop
        """
        while True:
            print("Doing absolutely nothing")
            time.sleep(self.interval)

Add application id and static method for usage
Add application id and static method for usage

  import time
  import sys
  import os
  from tspapi import API
  
  
  class Common(object):
      def __init__(self, ):
          self.api = API()
          self.usage_args = ""
+         # Set our application id from the environment variable
+         self.appl_id = os.environ['TSI_APPL_ID']
  
      @staticmethod
-     def usage(self, args):
+     def usage(args):
          sys.stderr.write("usage: {0} {1}\n".format(os.path.basename(sys.argv[0]), args))
  
      def send_measurements(self, measurements):
          """
          Sends measurements using the Measurement API
  
          :param measurements:
          :return: None
          """
          self.api.measurement_create_batch(measurements)
  
      def run(self):
          """
          Main loop
          """
          while True:
              print("Doing absolutely nothing")
              time.sleep(self.interval)
  
Add application id and static method for usage
## Code Before:
import time
import sys
import os
from tspapi import API


class Common(object):
    def __init__(self, ):
        self.api = API()
        self.usage_args = ""

    @staticmethod
    def usage(self, args):
        sys.stderr.write("usage: {0} {1}\n".format(os.path.basename(sys.argv[0]), args))

    def send_measurements(self, measurements):
        """
        Sends measurements using the Measurement API

        :param measurements:
        :return: None
        """
        self.api.measurement_create_batch(measurements)

    def run(self):
        """
        Main loop
        """
        while True:
            print("Doing absolutely nothing")
            time.sleep(self.interval)

## Instruction:
Add application id and static method for usage
## Code After:
import time
import sys
import os
from tspapi import API


class Common(object):
    def __init__(self, ):
        self.api = API()
        self.usage_args = ""
        # Set our application id from the environment variable
        self.appl_id = os.environ['TSI_APPL_ID']

    @staticmethod
    def usage(args):
        sys.stderr.write("usage: {0} {1}\n".format(os.path.basename(sys.argv[0]), args))

    def send_measurements(self, measurements):
        """
        Sends measurements using the Measurement API

        :param measurements:
        :return: None
        """
        self.api.measurement_create_batch(measurements)

    def run(self):
        """
        Main loop
        """
        while True:
            print("Doing absolutely nothing")
            time.sleep(self.interval)
