def configure_side_bar(self): self.configurations.append(Nav(frame=self, controller=config1.Config1(self.joystick))) self.configurations.append(Nav(frame=self, controller=config2.Config2(self.joystick))) self.configurations.append(Nav(frame=self, controller=config3.Config3(self.joystick))) self.configurations.append(Nav(frame=self, controller=config4.Config4(self.joystick))) for c in range(4): self.configurations[c].config(text=self.configurations[c].controller.name, borderwidth=3, relief="raised") self.configurations[c].grid(row=c, column=0, stick=N+W+E+S) self.configurations[c].bind("<Button-1>", lambda e, i=c: self.set_config(i)) self.configurations[self.selected].config(bg="blue", relief="sunken")
def __init__(self): """ load libraries """ from build.bundle import Bundle from nav import Nav self.bundle = Bundle() self.nav = Nav()
import dash import dash_bootstrap_components as dbc import dash_html_components as html import dash_core_components as dcc colors = {'background': '#111111', 'text': '#FF603F', 'footer': '#B8B8B8'} from navbar import Navbar navbar = Navbar() from nav import Nav nav = Nav() user_app = dbc.Card([ dbc.CardHeader(html.H2("Hate Speech Automatic Detector"), style={ 'textAlign': 'center', 'color': colors['text'], 'margin-top': "10px", 'margin-down': "15px" }), dbc.CardBody([ html. P('''Hate speech is any form of expression through which speakers intend to vilify, humiliate, or incite hatred against a group or a class of persons on the basis of race, religion, skin color sexual identity, gender identity, ethnicity, disability, or national origin. '''), html. P('''This application will allow you to check whether a certain type of text in English can be considered as hate speech, as an offensive language or neither.''' ), dbc.Input(id='input_text', className="mb-3",
from nav import Nav AI = Nav() #print(AI.location) #AI.markWall(3) #AI.markVisited((4,4)) x = AI.calculate() ''' 0,0 --> 1,0 UP 1. blackout() --> void 2. Undo action 3. calculate() --> will give you a list of commands 4. proceed when you call black out 1. wall off dest., mark as visited 2. Revert back to previous position (0,0) 2. calculate(): calculate how to go to next closest unvisited square 3. Return a set of commands '''
import logging from nav import Nav, WaypointNav import sys logging.basicConfig(level=logging.INFO) input_file = 'input' if len(sys.argv) >= 2: input_file = sys.argv[1] with open(input_file) as fin: my_input = [l.strip() for l in fin.readlines()] n = Nav() wn = WaypointNav() for line in my_input: n.move(line) wn.move(line) logging.info("Part 1: manhattan distance {}".format(n.manhattan())) logging.info("Part 2: manhattan distance {}".format(wn.manhattan()))