Given a representation of the board, returns a list of open spaces.
769896
def get_open_spaces(board):
  """"""
  open_spaces = []
  for i in range(3):
    for j in range(3):
      if board[i][j] == 0:
        open_spaces.append(encode_pos(i, j))
  return open_spaces
531476
def _get_color_list():
    """"""
    if 'axes.prop_cycle' in plt.rcParams:
        return [p['color'] for p in list(plt.rcParams['axes.prop_cycle'])]
    else:
        return plt.rcParams['axes.color_cycle']
115632
def rect_list(self):
        
        rectangle_list = []
        for r in self:
            rectangle_list.append((r.x, r.y, r.width, r.height, r.rid))

        return rectangle_list
802133
def _container_candidates(self):
        
        if not self._rectangles:
            return []

        if self._rotation:
            sides = sorted(side for rect in self._rectangles for side in rect)
            max_height = sum(max(r[0], r[1]) for r in self._rectangles)
            min_width = max(min(r[0], r[1]) for r in self._rectangles)
            max_width = max_height
        else:
            sides = sorted(r[0] for r in self._rectangles)
            max_height = sum(r[1] for r in self._rectangles)
            min_width = max(r[0] for r in self._rectangles)
            max_width = sum(sides)
        
        if self._max_width and self._max_width < max_width:
            max_width = self._max_width

        if self._max_height and self._max_height < max_height:
            max_height = self._max_height

        assert(max_width>min_width)
 
        # Generate initial container widths
        candidates = [max_width, min_width]

        width = 0
        for s in reversed(sides):
            width += s
            candidates.append(width)
        
        width = 0
        for s in sides:
            width += s
            candidates.append(width)

        candidates.append(max_width)
        candidates.append(min_width)
      
        # Remove duplicates and widths too big or small
        seen = set()
        seen_add = seen.add
        candidates = [x for x in candidates if not(x in seen or seen_add(x))] 
        candidates = [x for x in candidates if not(x>max_width or x<min_width)]
        
        # Remove candidates too small to fit all the rectangles
        min_area = sum(r[0]*r[1] for r in self._rectangles)
        return [(c, max_height) for c in candidates if c*max_height>=min_area]
1331242
def rowsWithin(self, bbox):
        ''
        ret = {}
        for y in range(bbox.ymin, bbox.ymax+1):
            for x in range(bbox.xmin, bbox.xmax+1):
                for attr, rows in self.pixels[y][x].items():
                    if attr not in self.hiddenAttrs:
                        for r in rows:
                            ret[id(r)] = r
        return list(ret.values())
579970
def areas_for_select(organization)
      return organization.areas if organization.area_types.blank?
      return organization.areas if organization.area_types.all? { |at| at.area_ids.empty? }

      organization.area_types
    end
1022817
def board_fen(self, *, promoted: Optional[bool] = False) -> str:
        
        builder = []
        empty = 0

        for square in SQUARES_180:
            piece = self.piece_at(square)

            if not piece:
                empty += 1
            else:
                if empty:
                    builder.append(str(empty))
                    empty = 0
                builder.append(piece.symbol())
                if promoted and BB_SQUARES[square] & self.promoted:
                    builder.append("~")

            if BB_SQUARES[square] & BB_FILE_H:
                if empty:
                    builder.append(str(empty))
                    empty = 0

                if square != H1:
                    builder.append("/")

        return "".join(builder)
3816
def items(self):
        ""
        return (list(self._pb.IntMap.items()) + list(self._pb.StringMap.items()) +
                list(self._pb.FloatMap.items()) + list(self._pb.BoolMap.items()))
1269827
def list_boards(self):
        """"""

        # Print table
        click.echo('\nSupported boards:\n')

        BOARDLIST_TPL = ('{board:25} {fpga:20} {type:<5} {size:<5} {pack:<10}')
        terminal_width, _ = click.get_terminal_size()

        click.echo('-' * terminal_width)
        click.echo(BOARDLIST_TPL.format(
            board=click.style('Board', fg='cyan'), fpga='FPGA', type='Type',
            size='Size', pack='Pack'))
        click.echo('-' * terminal_width)

        for board in self.boards:
            fpga = self.boards.get(board).get('fpga')
            click.echo(BOARDLIST_TPL.format(
                board=click.style(board, fg='cyan'),
                fpga=fpga,
                type=self.fpgas.get(fpga).get('type'),
                size=self.fpgas.get(fpga).get('size'),
                pack=self.fpgas.get(fpga).get('pack')))

        click.secho(BOARDS_MSG, fg='green')
554705
def get_field_list(self):
        

        list_out = []
        for field in self.fields:
            list_out.append(field)

        return list_out
418316
def getEmptyCells(self):
        """"""
        return [(x, y)
                for x in self.__size_range
                for y in self.__size_range if self.getCell(x, y) == 0]
1179900
def asList(self):
        
        return [self._red, self._green, self._blue, self._alpha]
1193676
def pose_to_list(pose):
    
    if type(pose) == geometry_msgs.msg.PoseStamped:
        return [[
            pose.pose.position.x, pose.pose.position.y, pose.pose.position.z
        ], [
            pose.pose.orientation.x, pose.pose.orientation.y,
            pose.pose.orientation.z, pose.pose.orientation.w
        ]]
    elif type(pose) == geometry_msgs.msg.Pose:
        return [[pose.position.x, pose.position.y, pose.position.z], [
            pose.orientation.x, pose.orientation.y, pose.orientation.z,
            pose.orientation.w
        ]]
    else:
        raise Exception("pose_to_list: parameter of type %s unexpected",
                        str(type(pose)))
931633
def tablespace_list(user=None, host=None, port=None, maintenance_db=None,
                    password=None, runas=None):
    '''
    
    '''

    ret = {}

    query = (
        'SELECT spcname as "Name", pga.rolname as "Owner", spcacl as "ACL", '
        'spcoptions as "Opts", pg_tablespace_location(pgts.oid) as "Location" '
        'FROM pg_tablespace pgts, pg_roles pga WHERE pga.oid = pgts.spcowner'
    )

    rows = __salt__['postgres.psql_query'](query, runas=runas, host=host,
                                           user=user, port=port,
                                           maintenance_db=maintenance_db,
                                           password=password)

    for row in rows:
        ret[row['Name']] = row
        ret[row['Name']].pop('Name')

    return ret
164997
def verticals(self):
        
        vertical_shifts = set(izip_longest([], map(
            lambda i: i - self.y, range(self.board.height)), fillvalue=0))
        vertical_shifts.discard((0, 0))
        return vertical_shifts
190807
def resource_list(cls):
        
        items = cls.list()
        ret = [vlan['name'] for vlan in items]
        ret.extend([str(vlan['id']) for vlan in items])
        return ret
1145967
def ranges(self):
        
        ranges = self._target.getRanges()
        return map(SheetAddress._from_uno, ranges)