parameters: (self)
docstring: initialize system resources
docstring_summary: initialize system resources
docstring_tokens: initialize system resources
function: def init_resources(self):
          """initialize system resources"""
          if resource is None:
              self.log.debug('Ignoring min_open_files_limit because the limit cannot be adjusted (for example, on Windows)')
              return
  
          old_soft, old_hard = resource.getrlimit(resource.RLIMIT_NOFILE)
          soft = self.min_open_files_limit
          hard = old_hard
          if old_soft < soft:
              if hard < soft:
                  hard = soft
              self.log.debug(
                  'Raising open file limit: soft {}->{}; hard {}->{}'.format(old_soft, soft, old_hard, hard)
              )
              resource.setrlimit(resource.RLIMIT_NOFILE, (soft, hard))
function_tokens: def init_resources ( self ) : if resource is None : self . log . debug ( 'Ignoring min_open_files_limit because the limit cannot be adjusted (for example, on Windows)' ) return old_soft , old_hard = resource . getrlimit ( resource . RLIMIT_NOFILE ) soft = self . min_open_files_limit hard = old_hard if old_soft < soft : if hard < soft : hard = soft self . log . debug ( 'Raising open file limit: soft {}->{}; hard {}->{}' . format ( old_soft , soft , old_hard , hard ) ) resource . setrlimit ( resource . RLIMIT_NOFILE , ( soft , hard ) )