/**
* @param {number[][]} grid
* @return {number[][]}
*/
var sortMatrix = function(grid) {
const n = grid.length;
// Helper to extract a matrix starting at (row, col)
function getMatrix(row, col) {
const matrix = [];
while (row < n && col < n) {
matrix.push(grid[row][col]);
row++;
col++;
}
return matrix;
}
// Helper to write a sorted matrix back into the grid
function setMatrix(row, col, sorted) {
# Disable KVM permanently (so VirtualBox can use AMD-V) and restore it later if you need QEMU/virt-manager again.
## Disable KVM so VirtualBox can use AMD-V
1. Create a blacklist file for KVM modules:<br>
`echo -e "blacklist kvm\nblacklist kvm_amd" | sudo tee /etc/modprobe.d/disable-kvm.conf`
2. Rebuild initramfs so the blacklist applies at early boot (needed on Ubuntu/Debian; harmless to run anyway):<br>
`sudo update-initramfs -u`
3. Reboot your system. After reboot, verify that kvm is not
---
# model.py
```python
from dataclasses import dataclass
from typing import Optional, Tuple, Literal
import torch
import torch.nn as nn
import torch.nn.functional as F
# --------------------------
# Config
# --------------------------
@dataclass
class CEMConfig:
# Input
feat_dim: int = 128 # frame feature size F
# Temporal encoder
hidden_size: int = 256 # GRU hidden (per direction)
num_layers: int = 1
dropout: float = 0.1
---
# model.py
```python
from dataclasses import dataclass
from typing import Dict, Tuple, Optional
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
# -------------------------
# Config
# -------------------------
@dataclass
class TriLanSphereConfig:
# Text
vocab_size: int = 32000
d_model: int = 256
max_len: int = 128
n_heads: int = 4
n_layers_text: int = 2
dropout: float = 0.1
# Spatial (objects + v
---
# model.py
```python
"""
AeroVISTA: Trajectory-Level Sightseeing Quality Scoring
-------------------------------------------------------
This module implements a compact PyTorch version of the AeroVISTA model:
- Semantic visual encoding (lightweight CNN by default; pluggable backbone)
- Attention-gated GRU for temporal aggregation
- Geospatial encoder for (x, y, z)
- Landmark Graph Integration (GCN-like)
- Permutation-invariant trajectory pooling
- Utility scoring with
---
# model.py
```python
from __future__ import annotations
from dataclasses import dataclass
from typing import Optional, List, Dict, Tuple
import torch
import torch.nn as nn
import torch.nn.functional as F
# ----------------------------
# Data containers
# ----------------------------
@dataclass
class Batch:
z: torch.Tensor # (B, T, d_z): multimodal/event features per step
c0: torch.Tensor # (B, d_c): initial competency (s
<div class="speeldata-container">
{% set pairs = (speeldata|length / 2)|round(0, 'floor') %}
{% if pairs > 0 %}
<div class="lines">
{% for i in 1..pairs %}
{% set shape_position = i is odd ? 'left' : 'right' %}
<div class="line-shape">
{% include 'partials/svg.twig' with {
attr_height:'250',
id:'vertical-line-' ~ shape_position,
ariaLabel:'Lange
---
# model.py
```python
# model.py
# Minimal SCAN + ACRS (PyTorch)
# MIT License
from __future__ import annotations
import math
from typing import Dict, Optional, Tuple
import torch
import torch.nn as nn
import torch.nn.functional as F
def _pairwise_diff(a: torch.Tensor, b: torch.Tensor) -> torch.Tensor:
"""
Compute pairwise differences a[:, :, None, :] - b[:, None, :, :]
a: (B, N, D)
b: (B, N, D)
return: (B, N, N, D)
"""
return a.u
---
## model.py
```python
# model.py
# A compact PyTorch implementation of NeuroSymNet-style stress detection.
# Components:
# - Physiological encoder: Conv1D + Positional encoding + BiGRU
# - Cycle-phase gating (sinusoidal phase embedding -> sigmoid gate)
# - Cross-channel attention
# - Symbolic temporal abstraction (↑/↓/→)
# - Temporal graph-style propagation (self-attention across time)
# - 3-class classifier head (+ helper ordinal loss and MC-dropout utilities)
from typin
# model.py
# SpineBERT: attention-driven behavioral recognition with biomechanical priors
# Minimal, self-contained PyTorch implementation inspired by the reference design.
# See equations and figures referenced in the accompanying README. :contentReference[oaicite:18]{index=18}
from dataclasses import dataclass
from typing import Optional, Tuple
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
# -----------------------------
# Utilities
# ------
# model.py
# Minimal reference implementation of SEEN + RPCS (PyTorch)
# Author: Legend Co., Ltd. (Savannah Banks) — reference implementation
# License: MIT
from __future__ import annotations
from dataclasses import dataclass
from typing import Optional, Tuple
import torch
import torch.nn as nn
import torch.nn.functional as F
# ----------------------------
# Utilities
# ----------------------------
class MLP(nn.Module):
def __init__(self, d_in: int, d_hidden: int, d_o
"""
AthlEthosNet (Minimal)
----------------------
A compact PyTorch module demonstrating:
- Dual-State Representation (moral `mu`, behavior `psi`)
- Mutually Influential (gated) updates
- Memory-Guided Behavioral Modeling (attention over moral history)
- Coherence regularizer (cosine alignment between projected moral & behavior)
Shapes (per forward step)
-------------------------
Inputs:
o_t: (B, obs_dim)
mu_tm1: (B, moral_dim)
psi_tm1: (B, beh_dim)
std::string vec_to_string(const std::vector<int>& vec)
{
return std::accumulate( std::next(vec.begin()), vec.end(),
std::to_string(vec.front()),
[](std::string acc, int b) { return std::move(acc) + ',' + std::to_string(b); }
);
};
std::cout << vec_to_string( {1,2,3,4} ) << std::endl;
# About me
I'm a junior Python data/AI developer with intermediate level, working on a project for which I need your
pedagogical and technical guidance on.
# Project description
I want to build an SQL Agent interact with thanks to a chatbot UI, and leave feedbacks.
The users are French native speakers, asking hence questions in French and being answered in French.
The database contains also data in French language.
# Your task
I want you to act as a senior Python developer spec
# collectstatic command with ignore list
# run manually:
# run from terminal
# manage.py collectstatic -v 2 -i "admin/*" -i "katan/*" -i "rest_framework/*" -i "debug_toolbar/*"
# or from django shell:
# collectstatic -v 2 -i admin/* -i katan/* -i rest_framework/* -i debug_toolbar/*
#!/usr/bin/env python
import os
import sys
from django.core.management import execute_from_command_line
project_name = "Django_project_4"
# Patterns to ignore
IGNORE_PATTERNS = [
"admin/*",
// pass in the parms required
var addThings = AddItems(true, 4, myList);
// Now it only requires the things
myThings.ForEach(addThings);
// The first set of parms are added to the currying func to return the final func
// item is projected out of the list it will be run in
private Action<Thing> AddItems(bool isTrue, int numberOfThings, List<Thing> list) =>
item => AddItemToList(isTrue, numberOfThings, list, item);
// The original method you want to curry the first three pars