<commit_before>#!/usr/bin/python
try:
  from sht1x.Sht1x import Sht1x as SHT1x
  import sys
  dataPin = 35
  clkPin = 33
  sht1x = SHT1x(dataPin, clkPin, SHT1x.GPIO_BOARD)


  def usage():
      print 'Usage python sht11.py [options]'
      print ' '
      print '[options]'
      print '-h , --humidity                 Displays the Humidity '
      print '-t , --temperature              Displays the Temperature'    

   
  args = len(sys.argv)
  if (args == 1):
     print "0"
  while ( args > 1):
     args -= 1   

     if(sys.argv[args] == "-h" or sys.argv[args] == "--humidity"):
        humidity = sht1x.read_humidity()  
        print("{0:.2f}".format(humidity))
     elif(sys.argv[args] == "-t" or sys.argv[args] == "--temperature"):
        temperature = sht1x.read_temperature_C()
        print("{0:.2f}".format(temperature))
     elif(sys.argv[args] == "-a" or sys.argv[args] == "--available"):
        print SHT1x.GPIO_BOARD
     else:
        usage()

except Exception:
   pass

 

<commit_msg>ignore errors for sht11<commit_after>#!/usr/bin/python
from contextlib import contextmanager
import warnings

def sht11():
  from sht1x.Sht1x import Sht1x as SHT1x
  import sys
  dataPin = 35
  clkPin = 33
  sht1x = SHT1x(dataPin, clkPin, SHT1x.GPIO_BOARD)


  def usage():
      print 'Usage python sht11.py [options]'
      print ' '
      print '[options]'
      print '-h , --humidity                 Displays the Humidity '
      print '-t , --temperature              Displays the Temperature'    

   
  args = len(sys.argv)
  if (args == 1):
     print "0"
  while ( args > 1):
     args -= 1   

     if(sys.argv[args] == "-h" or sys.argv[args] == "--humidity"):
        humidity = sht1x.read_humidity()  
        print("{0:.2f}".format(humidity))
     elif(sys.argv[args] == "-t" or sys.argv[args] == "--temperature"):
        temperature = sht1x.read_temperature_C()
        print("{0:.2f}".format(temperature))
     else:
        usage()


try:
  warnings.filterwarnings("ignore")
  sht11()
except:
  pass

{'fraction_non_alphanumeric': 0.14849531327084362, 'fraction_numerical': 0.026147015293537246, 'mean_word_length': 2.2657004830917873, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4348617', 'n_tokens_mistral': 763, 'n_tokens_neox': 711, 'n_words': 165}