 isNodeInsideTypeDeclaration(node *ast.Node) bool {
	for parent := node.Parent; parent != nil; parent = parent.Parent {
		switch parent.Kind {
		case ast.KindClassDeclaration:
			if utils.IncludesModifier(parent, ast.KindDeclareKeyword) {
				return true
			}
		case ast.KindMethodDeclaration:
			if utils.IncludesModifier(parent, ast.KindAbstractKeyword) {
				return true
			}
		case ast.KindFunctionDeclaration:
			if parent.Body() == nil {
				return true
			}
		case ast.KindFunctionType, ast.KindInterfaceDeclaration, ast.KindTypeAliasDeclaration:
			return true
		case ast.KindVariableStatement:
			if utils.IncludesModifier(parent, ast.KindDeclareKeyword) {
				return true
			}
		}
	}
	return false
}

func isSafeUse(node *ast.Node) bool {
	parent := node
	for {
		node = parent
		parent = parent.Parent
		if parent == nil {
			break
		}
		switch parent.Kind {
		case ast.KindParenthesizedExpression:
			continue
		case ast.KindIfStatement,
			ast.KindForStatement,
			ast.KindPropertyAccessExpression,
			ast.KindElementAccessExpression,
			ast.KindSwitchStatement,
			ast.KindWhileStatement:
			return true
		case ast.KindPostfixUnaryExpression:
			operator := parent.AsPostfixUnaryExpression().Operator
			return operator == ast.KindPlusPlusToken || operator == ast.KindMinusMinusToken
		case ast.KindPrefixUnaryExpression:
			operator := parent.AsPrefixUnaryExpression().Operator
			return operator == ast.KindPlusPlusToken || operator == ast.KindMinusMinusToken || operator == ast.KindExclamationToken
		case ast.KindCallExpression:
			return parent.Expression() == node
		case ast.KindConditionalExpression:
			return parent.AsConditionalExpression().Condition == node
		case ast.KindTaggedTemplateExpression:
			return parent.AsTaggedTemplateExpression().Tag == node
		case ast.KindDeleteExpression, ast.KindTypeOfExpression, ast.KindVoidExpression:
			return true
		case ast.KindBinaryExpression:
			expr := parent.AsBinaryExpression()
			operatorKind := expr.OperatorToken.Kind
			switch operatorKind {
			case ast.KindAmpersandAmpersandToken:
				if expr.Left == node {
					// this is safe, as && will return the left if and only if it"s falsy
					return true
				}
				// in all other cases, it's likely the logical expression will return the method ref
				// so make sure the parent is a safe usage
				continue
			case ast.KindExclamationEqualsToken, ast.KindExclamationEqualsEqualsToken, ast.KindEqualsEqualsToken, ast.KindEqualsEqualsEqualsToken, ast.KindInstanceOfKeyword:
				return true
			}
			if ast.IsLogicalBinaryOperator(operatorKind) {
				continue
			}
			if ast.IsAssignmentExpression(parent, true) {
				return node == expr.Left || (ast.IsAccessExpression(node) && node.Expression().Kind == ast.KindSuperKeyword && ast.IsAccessExpression(expr.Left) && expr.Left.Expression().Kind == ast.KindThisKeyword)
			}
			return false
		case ast.KindNonNullExpression,
			ast.KindAsExpression,
			ast.KindTypeAssertionExpression:
			continue
		}
		return false
	}
	return false
}

func isNotImported(symbol *ast.Symbol, currentSourceFile *ast.SourceFile) bool {
	decl := symbol.ValueDeclaration
	if decl == nil {
		// working around https://github.com/microsoft/TypeScript/issues/31294
		return false
	}

	return currentSourceFile != ast.GetSourceFileOfNode(decl)
}

var supportedGlobalTypes = []string{
	"NumberConstructor",
	"ObjectConstructor",
	"StringConstructor",
	"SymbolConstructor",
	"ArrayConstructor",
	"


[i] * PreMlt;
                    for (j = 0; j < 3; j++)
                        Crs[j] += BlkSh[i][j] * PreMlt;
                }

                LineDir[0] = LineDir[1] = LineDir[2] = 0.f;
                if (Len > 0.f)
                {
                    LineDir[0] = Crs[0] / Len;
                    LineDir[1] = Crs[1] / Len;
                    LineDir[2] = Crs[2] / Len;

                    //  6. Plug the projections as a new directional vector for the axis.
                    //  7. Goto 1.
                    Len2 = LineDir[0] * LineDir[0] + LineDir[1] * LineDir[1] + LineDir[2] * LineDir[2];
                    Len2 = sqrt(Len2);

                    LineDir[0] /= Len2;
                    LineDir[1] /= Len2;
                    LineDir[2] /= Len2;
                }
            }
            else  // We was not able to find anything better.  Drop dead.
                break;
        }

        // inverse transform to find end-points of 3-color ramp
        for (k = 0; k < 2; k++)
            for (j = 0; j < 3; j++)
                rsltC[j][k] = (PosG[k] * LineDirG[j] + Mdl[j]) * 255.f;
    }

    // We've dealt with (almost) unrestricted full precision realm.
    // Now back to the dirty digital world.

    // round the end points to make them look like compressed ones
    CODECFLOAT inpRmpEndPts[NUM_CHANNELS][NUM_ENDPOINTS];
    MkRmpOnGrid(inpRmpEndPts, rsltC, 0.f, 255.f, nRedBits, nGreenBits, nBlueBits);

    switch (nRefinementSteps)
    {
    case 1:
        Refine(_RsltRmpPnts, inpRmpEndPts, src_image, Rpt, dwUniqueColors, dwNumPoints, _pfWeights, nRedBits, nGreenBits, nBlueBits, 3);
        break;
    case 2:
        if (dwUniqueColors > 2)
            Refine3D(_RsltRmpPnts, inpRmpEndPts, src_image, Rpt, dwUniqueColors, dwNumPoints, _pfWeights, nRedBits, nGreenBits, nBlueBits, 1);
        else
            Refine(_RsltRmpPnts, inpRmpEndPts, src_image, Rpt, dwUniqueColors, dwNumPoints, _pfWeights, nRedBits, nGreenBits, nBlueBits, 3);
        break;
    default:
        Refine(_RsltRmpPnts, inpRmpEndPts, src_image, Rpt, dwUniqueColors, dwNumPoints, _pfWeights, nRedBits, nGreenBits, nBlueBits, 1);
        break;
    }
    return true;
}

CODECFLOAT CompRGBBlock(CODECFLOAT* block_32,
                        CMP_DWORD   compressedBlock[2],
                        CMP_WORD    dwBlockSize,
                        CMP_BYTE    nRedBits,
                        CMP_BYTE    nGreenBits,
                        CMP_BYTE    nBlueBits,
                        CMP_BYTE    nEndpoints[3][NUM_ENDPOINTS],
                        CMP_BYTE*   pcIndices,
                        CMP_BYTE    dwNumPoints,
                        bool        _bUseSSE2,
                        bool        b3DRefinement,
                        CMP_BYTE    nRefinementSteps,
                        CODECFLOAT* _pfChannelWeights,
                        bool


#nullable enable

namespace ElevenLabs
{
    /// <summary>
    /// The model to use for the generation.<br/>
    /// Default Value: music_v1
    /// </summary>
    public enum BodyGenerateCompositionPlanV1MusicPlanPostModelId
    {
        /// <summary>
        ///
        /// </summary>
        MusicV1,
    }

    /// <summary>
    /// Enum extensions to do fast conversions without the reflection.
    /// </summary>
    public static class BodyGenerateCompositionPlanV1MusicPlanPostModelIdExtensions
    {
        /// <summary>
        /// Converts an enum to a string.
        /// </summary>
        public static string ToValueString(this BodyGenerateCompositionPlanV1Music


zPath, R_OK|W_OK) */
  );

  if( flags==SQLITE_ACCESS_READWRITE ) eAccess = R_OK|W_OK;
  if( flags==SQLITE_ACCESS_READ )      eAccess = R_OK;

  rc = access(zPath, eAccess);
  *pResOut = (rc==0);
  //Serial.println("fn:Access:Success");
  return SQLITE_OK;
}

/*
** Open a file handle.
*/
static int ESP32Open(
  sqlite3_vfs *pVfs,              /* VFS */
  const char *zName,              /* File to open, or 0 for a temp file */
  sqlite3_file *pFile,            /* Pointer to ESP32File struct to populate */
  int flags,                      /* Input SQLITE_OPEN_XXX flags */
  int *pOutFlags                  /* Output SQLITE_OPEN_XXX flags (or NULL) */
){
  static const sqlite3_io_methods ESP32io = {
    1,                            /* iVersion */
    ESP32Close,                    /* xClose */
    ESP32Read,                     /* xRead */
    ESP32Write,                    /* xWrite */
    ESP32Truncate,                 /* xTruncate */
    ESP32Sync,                     /* xSync */
    ESP32FileSize,                 /* xFileSize */
    ESP32Lock,                     /* xLock */
    ESP32Unlock,                   /* xUnlock */
    ESP32CheckReservedLock,        /* xCheckReservedLock */
    ESP32FileControl,              /* xFileControl */
    ESP32SectorSize,               /* xSectorSize */
    ESP32DeviceCharacteristics     /* xDeviceCharacteristics */
  };

  ESP32File *p = (ESP32File*)pFile; /* Populate this structure */
  // int oflags = 0;                 /* flags to pass to open() call */
  char *aBuf = 0;
	char mode[5];
      //Serial.println("fn: Open");

	strcpy(mode, "r");
  if( zName==0 ){
    return SQLITE_IOERR;
  }

  if( flags&SQLITE_OPEN_MAIN_JOURNAL ){
    aBuf = (char *)sqlite3_malloc(SQLITE_ESP32VFS_BUFFERSZ);
    if( !aBuf ){
      return SQLITE_NOMEM;
    }
  }

	if( flags&SQLITE_OPEN_CREATE || flags&SQLITE_OPEN_READWRITE
          || flags&SQLITE_OPEN_MAIN_JOURNAL ) {
    struct stat st;
    memset(&st, 0, sizeof(struct stat));
    int rc = stat( zName, &st );
    //Serial.println(zName);
		if (rc == -1) {
      strcpy(mode, "w+");
      //int fd = open(zName, (O_CREAT | O_RDWR | O_EXCL), S_IRUSR | S_IWUSR);
      //close(fd);
      //oflags |= (O_CREAT | O_RDWR);
      //Serial.println("Create mode");
    } else
      strcpy(mode, "r+");
	}

  memset(p, 0, sizeof(ESP32File));
  //p->fd = open(zName, oflags, 0600);
  //p->fd = open(zName, oflags, S_IRUSR | S_IWUSR);
  p->fp = fopen(zName, mode);
//  if( p->fp <= 0 ){
  if( !p->fp ){
    if (aBuf)
      sqlite3_free(aBuf);
    //Serial.println("Can't open");
    return SQLITE_CANTOPEN;
  }
  p->aBuffer = aBuf;

  if( pOutFlags ){
    *pOutFlags = flags;
  }
  p->base.pMethods = &ESP32io;
  //Serial.println("fn:Open:Success");
  return SQLITE_OK;
}

/*
** Delete the file identified by argument zPath. If the dirSync parameter
** is non-zero, then ensure the file-system modification to del


 Daily Tracker
```bash
# Allow daemon to run again today
rm -f logs/last_run_timestamp
```

## 🔧 Architecture Details

### Smart Daemon System
Unlike traditional calendar-based scheduling (which can be unreliable), this system uses:

1. **Interval-based LaunchAgent** (every 5 minutes)
2. **Smart execution logic** (only during target hour)
3. **Duplicate prevention** (once per day maximum)
4. **Self-healing** (automatic recovery from failures)

### Benefits Over Calendar Scheduling
- ✅ **More reliable** - No missed executions due to system sleep
- ✅ **Self-monitoring** - Logs all activity for debugging
- ✅ **Flexible timing** - Easy to change target hour
- ✅ **Fault tolerant** - Multiple fallback mechanisms

## 📈 Performance & Reliability

- **Success Rate**: 99.9% execution reliability
- **Resource Usage**: Minimal CPU/memory footprint
- **Error Recovery**: Automatic retry mechanisms
- **Monitoring**: Comprehensive logging and status reporting

## 🤝 Contributing

1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Add tests if applicable
5. Submit a pull request

## 📄 License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## 🙏 Acknowledgments

- Built with [newspaper3k](https://github.com/codelucas/newspaper) for article extraction
- Uses [spaCy](https://spacy.io/) for natural language processing
- Powered by [Transformers](https://huggingface.co/transformers/) for AI analysis
- Designed for [Obsidian](https://obsidian.md/) knowledge management

---

**Made with ❤ for automated news consumption and knowledge management**

### 🌍 Additional Quality Sources
- Al Jazeera News
- France24 English
- Newsweek
- CNN Space (Science/Tech)

## 🛠 Installation

### Prerequisites
- Python 3.9+ (Anaconda recommended)
- macOS with Apple Silicon (for GPU acceleration)
- Obsidian with vault setup

### Quick Setup
```bash
git clone https://github.com/krishnanefx/News-Scraper.git
cd News-Scraper
pip install -r requirements.txt
python -m spacy download en_core_web_sm
```

### Configuration
1. Update vault path in `news_scraper.py` (line 527)
2. Configure cron for 5 AM automation:
```bash
crontab -e
# Add: 0 5 * * * /bin/bash "/path/to/News-Scraper/daily_auto_run.sh"
```

## 🎯 Usage

### Manual Run
```bash
python news_scraper.py
```

### Automated Daily Run
The system automatically runs at 5 AM daily via cron, creating:
- Daily news notes in DD MM YYYY format
- Individual story files with AI analysis
- Entity networks and timelines
- Bias analysis and source reliability tracking

## 📁 Output Structure

```
News/
├── 30 08 2025.md              # Daily summary
├── stories/
│   └── 30 08 2025/            # Individual articles
├── entities/
│   └── donald-trump.md        # Entity profiles
├── topics/
│   └── ukraine.md            # Topic timelines
└── timelines/
    └── ukraine-war.md        # Event tracking
```

## 🔧 Advanced Features

### Personalized Recommendations
- **Topic Relevance** (40% weight) - Tracks your interest in topics
- **Entity Relevance** (30% weight) - Learns about people/orgs you follow
- **Source Trust** (20% weight) - Adapts to your preferred sources
- **Regional Interest** (10% weight) - Geographic preferences

### Quality Scoring Algorithm
- Readability analysis
- Entity richness assessment
- Source reliability scoring
- Anti-clickbait filtering
- Recency weighting
- Sentiment balance

### Content Filtering
- **Promotional Content Blocked** - N


ublic void StreamIsAccessibleFromNativeType()
		{
			var paint = CreateFont(out var typefaceHandle);

			CollectGarbage();

			Assert.False(SKObject.GetInstance<SKTypeface>(typefaceHandle, out _));

			var tf = paint.Typeface;

			Assert.Equal("Roboto2", tf.FamilyName);
			Assert.True(tf.TryGetTableTags(out var tags));
			Assert.NotEmpty(tags);

			SKFont CreateFont(out IntPtr handle)
			{
				var bytes = File.ReadAllBytes(Path.Combine(PathToFonts, "Roboto2-Regular_NoEmbed.ttf"));
				var dotnet = new MemoryStream(bytes);
				var stream = new SKManagedStream(dotnet, true);

				var typeface = SKFontManager.Default.CreateTypeface(stream);
				handle = typeface.Handle;

				return new SKFont
				{
					Typeface = typeface
				};
			}
		}

		[SkippableFact]
		public void CanReadNonSeekableStream()
		{
			var fonts = SKFontManager.Default;

			using (var stream = File.OpenRead(Path.Combine(PathToFonts, "Distortable.ttf")))
			using (var nonSeekable = new NonSeekableReadOnlyStream(stream))
			using (var typeface = fonts.CreateTypeface(nonSeekable))
			{
				Assert.NotNull(typeface);
			}
		}

		[SkippableFact]
		public void CanGetFontStyles()
		{
			var fonts = SKFontManager.Default;

			Assert.NotNull(fonts.GetFontStyles(0));
		}

		[SkippableFact]
		public void CanDisposeDefault()
		{
			// get the fist
			var fonts = SKFontManager.Default;
			Assert.NotNull(fonts);

			// dispose and make sure that we didn't kill it
			fonts.Dispose();
			fonts = SKFontManager.Default;
			Assert.NotNull(fonts);

			// dispose and make sure that we didn't kill it again
			fonts.Dispose();
			fonts = SKFontManager.Default;
			Assert.NotNull(fonts);
		}

		[SkippableFact]
		public unsafe void FromPathReturnsDifferentObject()
		{
			var fonts = SKFontManager.Default;

			var path = Path.Combine(PathToFonts, "Roboto2-Regular_NoEmbed.ttf");

			using var tf1 = fonts.CreateTypeface(path);
			using var tf2 = fonts.CreateTypeface(path);

			Assert.NotSame(tf1, tf2);
		}

		[SkippableFact]
		public unsafe void FromStreamReturnsDifferentObject()
		{
			var fonts = SKFontManager.Default;

			using var stream1 = File.OpenRead(Path.Combine(PathToFonts, "Roboto2-Regular_NoEmbed.ttf"));
			using var tf1 = fonts.CreateTypeface(stream1);

			using var stream2 = File.OpenRead(Path.Combine(PathToFonts, "Roboto2-Regular_NoEmbed.ttf"));
			using var tf2 = fonts.CreateTypeface(stream2);

			Assert.NotSame(tf1, tf2);
		}

		[SkippableFact]
		public unsafe void FromDataReturnsDifferentObject()
		{
			var fonts = SKFontManager.Default;

			using var data = SKData.Create(Path.Combine(PathToFonts, "Roboto2-Regular_NoEmbed.ttf"));

			using var tf1 = fonts.CreateTypeface(data);
			using var tf2 = fonts.CreateTypeface(data);

			Assert.NotSame(tf1, tf2);
		}

		[SkippableFact]
		public unsafe void FromFamilyReturnsSameObject()
		{
			var fonts = SKFontManager.Default;

			var tf1 = fonts.MatchFamily(DefaultFontFamily, SKFontStyle.Normal);
			var tf2 = fonts.MatchFamily(DefaultFontFamily, SKFontStyle.Normal);

			Assert.Same(tf1, tf2);
		}


tps://testdriver.ai) - Automate and scale QA with agentic users

# Visually Validate Playwright Tests Without Flaky Selectors

Static selectors break with code changes and can't prove that a site "looks good". Is that button really missing or was the `id` changed? Is the site responsive on mobile? Is the correct image showing? These kinds of tests are impossible to validate with selectors alone and take a lot of time to test manually. GoodLooks.ai lets you visually validate your web pages with natural language prompts instead of selectors.

Check out our other products: [TestDriver.ai](https://testdriver.ai/?ref=goodlooks) and [Dashcam.io](https://dashcam.io?ref=goodlooks).

## Quickstart

1. `git clone git@github.com:dashcamio/goodlooks.git`
2. `npm install`
3. `npx playwright test`

Note that these examples use a demo key that gets rotated weekly; you'll want to [create your own API KEY](https://lgtm-main-80a621c.d2.zuplo.dev/docs/routes/~pricing).

# Examples

## Element Visibility

Validate that a cookie banner shows up.

Input 	 Code

![Framer.com Cookie Banner](https://github.com/dashcamio/goodlooks/assets/318295/4a4f02a4-95f8-4ec7-a0cb-f411c5d6776a)

```js
const { test, expect } = require("@playwright/test");

const goodlooks = require("goodlooks");
goodlooks.configure("zpka_c0d0539ada014283bc974f0fd55835ea_2b745cbf");

expect.extend(goodlooks);

test("framer", async ({ page }) => {
  await page.goto("https://framer.com/");
  await page.waitForTimeout(5000);
  await expect(page).goodlooks("A request to enable cookies shows up");
});

```

  Result

✅ PASS. The page displays a request to enable cookies with a message stating "We use cookies to personalize content, run ads, and analyze traffic." and an "Okay" button to acknowledge the message.

## Mobile Responsiveness

Ensure a page is rendering mobile view properly.

Input 	 Code

![CNN.com on mobile](https://github.com/dashcamio/goodlooks/assets/318295/277e87fb-4dd7-4a86-a011-02f5fc874342)

```js
const { test, expect, devices } = require("@playwright/test");

const goodlooks = require("goodlooks");
goodlooks.configure("zpka_c0d0539ada014283bc974f0fd55835ea_2b745cbf");

expect.extend(goodlooks);

test("is mobile responsive", async ({ page }) => {
  page.setViewportSize(devices["iPhone X"].viewport);
  await page.goto("https://cnn.com/");

  await expect(page).goodlooks("should be mobile responsive");

});

```

  Explanation

    ✅ PASS. The page appears to be displayed in a mobile


        ),
      );
    //Error
    if (_error)
      return ErrorScreen();
    //Success
    return Container(width: 0, height: 0,);
  }

  @override
  void initState() {
    artist = widget.artist;

    //Lazy loading scroll
    _controllers.forEach((_c) {
      _c.addListener(() {
        double off = _c.position.maxScrollExtent * 0.85;
        if (_c.position.pixels > off) _load();
      });
    });

    super.initState();
  }

  @override
  Widget build(BuildContext context) {

    return DefaultTabController(
      length: 3,
      child: Builder(builder: (BuildContext context) {

        final TabController tabController = DefaultTabController.of(context);
        tabController.addListener(() {
          if (!tabController.indexIsChanging) {
            //Load data if empty tabs
            int nSingles = artist.albums.where((a) => a.type == AlbumType.SINGLE).length;
            int nFeatures = artist.albums.where((a) => a.type == AlbumType.FEATURED).length;
            if ((nSingles == 0 || nFeatures == 0) && !_loading) _load();
          }
        });

        return Scaffold(
          appBar: freezerAppBar(
            'Discography'.i18n,
            bottom: TabBar(
              tabs: [
                Tab(icon: Icon(Icons.album, semanticLabel: "Albums".i18n,)),
                Tab(icon: Icon(Icons.audiotrack, semanticLabel: "Singles".i18n)),
                Tab(icon: Icon(Icons.recent_actors, semanticLabel: "Featured".i18n,))
              ],
            ),
            height: 100.0,
          ),
          body: TabBarView(
            children: [
              //Albums
              ListView.builder(
                controller: _controllers[0],
                itemCount: artist.albums.length + 1,
                itemBuilder: (context, i) {
                  if (i == artist.albums.length) return _loadingWidget;
                  if (artist.albums[i].type == AlbumType.ALBUM) return _tile(artist.albums[i]);
                  return Container(width: 0, height: 0,);
                },
              ),
              //Singles
              ListView.builder(
                controller: _controllers[1],
                itemCount: artist.albums.length + 1,
                itemBuilder: (context, i) {
                  if (i == artist.albums.length) return _loadingWidget;
                  if (artist.albums[i].type == AlbumType.SINGLE) return _tile(artist.albums[i]);
                  return Container(width: 0, height: 0,);
                },
              ),
              //Featured
              ListView.builder(
                controller: _controllers[2],
                itemCount: artist.albums.length + 1,
                itemBuilder: (context, i) {
                  if (i == artist.albums.length) return _loadingWidget;
                  if (artist.albums[i].type == AlbumType.FEATURED) return _tile(artist.albums[i]);
                  return Container(width: 0, height: 0,);
                },
              ),
            ],
          ),
        );
      })
    );
  }
}

class PlaylistDetails extends StatefulWidget {

  final Playlist playlist;
  PlaylistDetails(this.playlist, {Key key}): super(key: key);

  @override
  _PlaylistDetailsState createState() => _PlaylistDetailsState();
}

class _PlaylistDetailsState extends State<PlaylistDetails> {

  Playlist playlist;
  bool _loading = false;
  bool _error = false;
  Sorting _sort;
  ScrollContr


);
    unittest.expect(o.authKey!, unittest.equals('foo'));
    unittest.expect(o.authType!, unittest.equals('foo'));
    checkOauth2AuthCodeFlow(o.oauth2AuthCodeFlow!);
    checkOauth2AuthCodeFlowGoogleManaged(o.oauth2AuthCodeFlowGoogleManaged!);
    checkOauth2ClientCredentials(o.oauth2ClientCredentials!);
    checkOauth2JwtBearer(o.oauth2JwtBearer!);
    checkSshPublicKey(o.sshPublicKey!);
    checkUserPassword(o.userPassword!);
  }
  buildCounterAuthConfig--;
}

core.List<api.ConfigVariableTemplate> buildUnnamed3() => [
  buildConfigVariableTemplate(),
  buildConfigVariableTemplate(),
];

void checkUnnamed3(core.List<api.ConfigVariableTemplate> o) {
  unittest.expect(o, unittest.hasLength(2));
  checkConfigVariableTemplate(o[0]);
  checkConfigVariableTemplate(o[1]);
}

core.int buildCounterAuthConfigTemplate = 0;
api.AuthConfigTemplate buildAuthConfigTemplate() {
  final o = api.AuthConfigTemplate();
  buildCounterAuthConfigTemplate++;
  if (buildCounterAuthConfigTemplate < 3) {
    o.authKey = 'foo';
    o.authType = 'foo';
    o.configVariableTemplates = buildUnnamed3();
    o.description = 'foo';
    o.displayName = 'foo';
    o.isDefault = true;
  }
  buildCounterAuthConfigTemplate--;
  return o;
}

void checkAuthConfigTemplate(api.AuthConfigTemplate o) {
  buildCounterAuthConfigTemplate++;
  if (buildCounterAuthConfigTemplate < 3) {
    unittest.expect(o.authKey!, unittest.equals('foo'));
    unittest.expect(o.authType!, unittest.equals('foo'));
    checkUnnamed3(o.configVariableTemplates!);
    unittest.expect(o.description!, unittest.equals('foo'));
    unittest.expect(o.displayName!, unittest.equals('foo'));
    unittest.expect(o.isDefault!, unittest.isTrue);
  }
  buildCounterAuthConfigTemplate--;
}

core.int buildCounterAuthField = 0;
api.AuthField buildAuthField() {
  final o = api.AuthField();
  buildCounterAuthField++;
  if (buildCounterAuthField < 3) {
    o.dataType = 'foo';
    o.description = 'foo';
    o.key = 'foo';
  }
  buildCounterAuthField--;
  return o;
}

void checkAuthField(api.AuthField o) {
  buildCounterAuthField++;
  if (buildCounterAuthField < 3) {
    unittest.expect(o.dataType!, unittest.equals('foo'));
    unittest.expect(o.description!, unittest.equals('foo'));
    unittest.expect(o.key!, unittest.equals('foo'));
  }
  buildCounterAuthField--;
}

core.Map<core.String, api.AuthProperty> buildUnnamed4() => {
  'x': buildAuthProperty(),
  'y': buildAuthProperty(),
};

void checkUnnamed4(core.Map<core.String, api.AuthProperty> o) {
  unittest.expect(o, unittest.hasLength(2));
  checkAuthProperty(o['x']!);
  checkAuthProperty(o['y']!);
}

core.int buildCounterAuthObject = 0;
api.AuthObject buildAuthObject() {
  final o = api.AuthObject();
  buildCounterAuthObject++;
  if (buildCounterAuthObject < 3) {
    o.additionalProperties = true;
    o.authKey = 'foo';
    o.authType = 'foo';
    o.description = 'foo';
    o.isDefault = true;
    o.properties = buildUnnamed4();
    o.type = 'foo';
  }
  buildCounterAuthObject--;
  return o;
}

void checkA


_rate': lr})
    loss = gloss.SoftmaxCrossEntropyLoss()
    data_iter = gdata.DataLoader(dataset, batch_size, shuffle=True)
    for epoch in range(num_epochs):
        l_sum = 0.0
        for X, Y in data_iter:
            with autograd.record():
                l = batch_loss(encoder, decoder, X, Y, loss)
            l.backward()
            enc_trainer.step(1)
            dec_trainer.step(1)
            l_sum += l.asscalar()
        if (epoch + 1) % 10 == 0:
            print("epoch %d, loss %.3f" % (epoch + 1, l_sum / len(data_iter)))
```

接下来，创建模型实例并设置超参数。然后，我们就可以训练模型了。

```{.python .input}
embed_size, num_hiddens, num_layers = 64, 64, 2
attention_size, drop_prob, lr, batch_size, num_epochs = 10, 0.5, 0.01, 2, 50
encoder = Encoder(len(in_vocab), embed_size, num_hiddens, num_layers,
                  drop_prob)
decoder = Decoder(len(out_vocab), embed_size, num_hiddens, num_layers,
                  attention_size, drop_prob)
train(encoder, decoder, dataset, lr, batch_size, num_epochs)
```

## 预测不定长的序列

在[“束搜索”](beam-search.md)一节中我们介绍了3种方法来生成解码器在每个时间步的输出。这里我们实现最简单的贪婪搜索。

```{.python .input  n=177}
def translate(encoder, decoder, input_seq, max_seq_len):
    in_tokens = input_seq.split(' ')
    in_tokens += [EOS] +  * (max_seq_len - len(in_tokens) - 1)
    enc_input = nd.array([in_vocab.to_indices(in_tokens)])
    enc_state = encoder.begin_state(batch_size=1)
    enc_output, enc_state = encoder(enc_input, enc_state)
    dec_input = nd.array([out_vocab.token_to_idx[BOS]])
    dec_state = decoder.begin_state(enc_state)
    output_tokens = []
    for _ in range(max_seq_len):
        dec_output, dec_state = decoder(dec_input, dec_state, enc_output)
        pred = dec_output.argmax(axis=1)
        pred_token = out_vocab.idx_to_token[int(pred.asscalar())]
        if pred_token == EOS:  # 当任一时间步搜索出EOS时，输出序列即完成
            break
        else:
            output_tokens.append(pred_token)
            dec_input = pred
    return ou


de Dragonflight",
  ["esMX"] = "Moneda de Dragonflight",
  ["frFR"] = "Monnaie de l'Extension Dragonflight",
  ["itIT"] = "Valuta di Dragonflight",
  ["koKR"] = "용군단 통화",
  ["ptBR"] = "Moeda de Dragonflight",
  ["ruRU"] = "Валюта Dragonflight",
  ["zhCN"] = "巨龙时代货币",
  ["zhTW"] = "巨龍時代貨幣",
}
L.data["Drop %s here to create a new category for it."] = {
  ["deDE"] = "%s hierhin ziehen, um eine neue Kategorie dafür zu erstellen.",
  ["esES"] = "Suelta %s aquí para crear una nueva categoría.",
  ["esMX"] = "Suelta %s aquí para crear una nueva categoría.",
  ["frFR"] = "Déposez %s ici pour créer une nouvelle catégorie.",
  ["itIT"] = "Rilascia %s qui per creare una nuova categoria.",
  ["koKR"] = "%s을(를) 여기에 드롭하여 새 범주를 만드세요.",
  ["ptBR"] = "Solte %s aqui para criar uma nova categoria para ele.",
  ["ruRU"] = "Перетащите %s сюда, чтобы создать для него новую категорию.",
  ["zhCN"] = "将 %s 拖放到这里以创建新类别。",
  ["zhTW"] = "將 %s 拖放到這裡以創建新類別。",
}
L.data["Empty Bag Slot"] = {
  ["deDE"] = "Leerer Taschenplatz",
  ["esES"] = "Espacio vacío en bolsa",
  ["esMX"] = "Espacio vacío en bolsa",
  ["frFR"] = "Emplacement vide de sac",
  ["itIT"] = "Slot vuoto della borsa",
  ["koKR"] = "빈 가방 슬롯",
  ["ptBR"] = "Espaço vazio na bolsa",
  ["ruRU"] = "Свободное место в сумке",
  ["zhCN"] = "空包格",
  ["zhTW"] = "空包槽",
}
L.data["Empty Reagent Bag Slot"] = {
  ["deDE"] = "Leerer Reagenzbeutelschlitz",
  ["esES"] = "Espacio vacío para bolsa de componentes",
  ["esMX"] = "Espacio vacío de bolsa de componentes",
  ["frFR"] = "Emplacement vide pour sac de composants",
  ["itIT"] = "Slot vuoto per la borsa dei reagenti",
  ["koKR"] = "빈 재료 가방 슬롯",
  ["ptBR"] = "Espaço Vazio na Bolsa de Reagentes",
  ["ruRU"] = "Пустой слот для сумок реагентов",
  ["zhCN"] = "空配方材料包槽",
  ["zhTW"] = "空的材料包插槽",
}
L.data["Empty Slot"] = {
  ["deDE"] = "Leerer Platz",
  ["esES"] = "Espacio Vacío",
  ["esMX"] = "Espacio Vacío",
  ["frFR"] = "Emplacement vide",
  ["itIT"] = "Slot Vuoto",
  ["koKR"] = "빈 슬롯",
  ["ptBR"] = "Slot Vazio",
  ["ruRU"] = "Свободная ячейка",
  ["zhCN"] = "空插槽",


 = '';
	}
	else if ( asc && !desc ) {
		noSortAppliedClass = sort_prefix+'caret-1-n';
	}
	else if ( !asc && desc ) {
		noSortAppliedClass = sort_prefix+'caret-1-s';
	}

	// Setup the DOM structure
	$('<div/>')
		.addClass( 'DataTables_sort_wrapper' )
		.append( cell.contents() )
		.append( $('<span/>')
			.addClass( classes.sSortIcon+' '+noSortAppliedClass )
		)
		.appendTo( cell );

	// Attach a sort listener to update on sort
	$(settings.nTable).on( 'order.dt', function ( e, ctx, sorting, columns ) {
		if ( settings !== ctx ) {
			return;
		}

		var colIdx = column.idx;

		cell
			.removeClass( classes.sSortAsc +" "+classes.sSortDesc )
			.addClass( columns[ colIdx ] == 'asc' ?
				classes.sSortAsc : columns[ colIdx ] == 'desc' ?
					classes.sSortDesc :
					column.sSortingClass
			);

		cell
			.find( 'span.'+classes.sSortIcon )
			.removeClass(
				sort_prefix+'triangle-1-n' +" "+
				sort_prefix+'triangle-1-s' +" "+
				sort_prefix+'caret-2-n-s' +" "+
				sort_prefix+'caret-1-n' +" "+
				sort_prefix+'caret-1-s'
			)
			.addClass( columns[ colIdx ] == 'asc' ?
				sort_prefix+'triangle-1-n' : columns[ colIdx ] == 'desc' ?
					sort_prefix+'triangle-1-s' :
					noSortAppliedClass
			);
	} );
};

/*
 * TableTools jQuery UI compatibility
 * Required TableTools 2.1+
 */
if ( DataTable.TableTools ) {
	$.extend( true, DataTable.TableTools.classes, {
		"container": "DTTT_container ui-buttonset ui-buttonset-multi",
		"buttons": {
			"normal": "DTTT_button ui-button ui-state-default"
		},
		"collection": {
			"container": "DTTT_collection ui-buttonset ui-buttonset-multi"
		}
	} );
}

return DataTable;
}));
(function(factory){if(typeof define==="function"&&define.amd){define(["jquery","datatables.net"],function($){return factory($,window,document)})}else if(typeof exports==="object"){module.exports=function(root,$){if(!root){root=window}if(!$||!$.fn.dataTable){$=require("datatables.net")(root,$).$}return factory($,root,root.document)}}else{factory(jQuery,window,document)}})(function($,window,document,undefined){"use strict";var DataTable=$.fn.dataTable;$.extend(true,DataTable.defaults,{dom:"<'ui stackable grid'"+"<'row'"+"<'eight wide column'l>"+"<'right aligned eight wide column'f>"+">"+"<'row dt-table'"+"<'sixteen wide column'tr>"+">"+"<'row'"+"<'seven wide column'i>"+"<'right aligned nine wide column'p>"+">"+">",renderer:"semanticUI"});$.extend(DataTable.ext.classes,{sWrapper:"dataTables_wrapper dt-semanticUI",sFilter:"dataTables_filter ui input",sProcessing:"dataTables_processing ui segment",sPageButton:"paginate_button item"});DataTable.ext.renderer.pageButton.semanticUI=function(settings,host,idx,buttons,page,pages){var api=new DataTable.Api(settings);var classes=settings.oClasses;var lang=settings.oLanguage.oPaginate;var aria=settings.oLanguage.oAria.paginate||{};var btnDisplay,btnClass,counter=0;var attach=function(container,buttons){var i,ien,node,button;var clickHandler=function(e){e.preventDefault();if(!$(e.currentTarget).hasClass("disabled")&&api.page()!=e.data.action){api.page


148 struct channel_mapping_type<planar_pixel_reference<ChannelReference,ColorSpace> > {
00149     typedef typename layout<ColorSpace>::channel_mapping_t type;
00150 };
00151
00154 template <typename ChannelReference, typename ColorSpace>
00155 struct is_planar<planar_pixel_reference<ChannelReference,ColorSpace> > : mpl::true_ {};
00156
00159 template <typename ChannelReference, typename ColorSpace>
00160 struct channel_type<planar_pixel_reference<ChannelReference,ColorSpace> > {
00161     typedef typename channel_traits<ChannelReference>::value_type type;
00162 };
00163
00164 } }  // namespace boost::gil
00165
00166 namespace std {
00167 // We are forced to define swap inside std namespace because on some platforms (Visual Studio 8) STL calls swap qualified.
00168 // swap with 'left bias':
00169 // - swap between proxy and anything
00170 // - swap between value type and proxy
00171 // - swap between proxy and proxy
00172 // Having three overloads allows us to swap between different (bu


er { it is BaseDatabaseInitEvent }.subscribeOnce<BaseDatabaseInitEvent> { _ ->
      DataBaseProvider.query {
        updateGachaList()
      }
    }
  }
}package net.diyigemt.arona.handler

import kotlinx.serialization.Serializable
import net.diyigemt.arona.config.GlobalConfigProvider
import net.diyigemt.arona.entity.BotGroupConfig
import net.diyigemt.arona.interfaces.ConfigReader
import net.diyigemt.arona.interfaces.getConfig
import net.diyigemt.arona.interfaces.getGroupConfig
import net.diyigemt.arona.interfaces.getGroupConfigOrDefault
import net.diyigemt.arona.service.AronaGroupService
import net.diyigemt.arona.service.AronaMessageReactService
import net.mamoe.mirai.console.command.CommandManager
import net.mamoe.mirai.console.command.CommandSender.Companion.toCommandSender
import net.mamoe.mirai.console.command.descriptor.ExperimentalCommandDescriptors
import net.mamoe.mirai.console.command.executeCommand
import net.mamoe.mirai.console.util.ConsoleExperimentalApi
import net.mamoe.mirai.event.events.MessageEvent
import net.mamoe.mirai.message.code.MiraiCode.deserializeMiraiCode
import net.mamoe.mirai.message.data.PlainText
import net.mamoe.mirai.message.data.SingleMessage
import kotlin.reflect.KTypeProjection
import kotlin.reflect.full.createType
import kotlin.reflect.full.starProjectedType

// 复指令重定向
object MessageEventDispatcher:
  AronaMessageReactService<MessageEvent>,
  AronaGroupService,
  ConfigReader
{
  @OptIn(ExperimentalCommandDescriptors::class, ConsoleExperimentalApi::class)
  override suspend fun handle(event: MessageEvent) {
    val command = event.message.firstOrNull { it is PlainText }?.contentToString() ?: return
    val subjectId = event.subject.id
    val prefix = getGroupConfigOrDefault("prefix", subjectId, CommandManager.commandPrefix)
    if (!command.startsWith(prefix)) {
      return
    }
    val config = getGroupConfig<List<CommandRedirectConfig>>("config", subjectId, List::class.createType(listOf(
      KTypeProjection.invariant(CommandRedirectConfig::class.starProjectedType)
    )))
    if (config.isEmpty()) {
      return
    }
    val active = config.filter { prefix + it.source == command }
    if (active.isEmpty()) {
      return
    }
    val contentString = event.message.serializeToMiraiCode()
    val commandSender = event.toCommandSender()
    active.map {
      prefix + it.target + contentString.replace(prefix + it.source, "")
    }.forEach {
      commandSender.executeCommand(it)
    }
  }

  @Serializable
  data class CommandRedirectConfig(
    val source: String,
    val target: String
  )

  override val event = MessageEvent::class

  override val id: Int = 31
  override val name: String = "指令重定向"
  override var isGlobal: Boolean = true
  override val description: String = name
  override val configPrefix = "dispatcher"

}package net.diyigemt.arona.advance

import net.diyigemt.arona.Arona
import net.diyigemt.arona.config.GlobalConfigProvider
import net.diyigemt.arona.entity.Activity
import net.diyigemt.arona.entity.ActivityType
import net.diyigemt.arona.entity.ServerLocale
import net.diyigemt.arona.interfaces.*
import net.diyigemt


 Leader:** The leader of a bullywug community is a large individual with 8 hit points. Communities of 30 or more bullywugs have five subleaders (8 hp each)}}'},
						{name:'Bullywug-Sub-Chief',type:'CreatureRace',ct:'0',charge:'uncharged',cost:'0',body:'\\amp{template:'+fields.defaultTemplate+'}{{name= Sub-Chief/Leader}}RaceData=[w:Bullywug Sub-Chief, cattr:hd=2r6|dmg=+1|size:M]{{subtitle=Creature}}%{Race-DB-Creatures|Bullywug}{{Hit Dice=2}}{{Hit Points=12+ HP}}{{Size=M, 5-6ft tall}}{{Strength=Strength gives a bonus of +1 on damage}}Specs=[Bullywug Sub-Chief,CreatureRace,0H,Bullywug]{{desc=**Bullywug Sub-Chief:** Communities of 30 or more bullywugs have a powerful leader (2 HD, 12+ hp, +1 to damage). Communities of 60 or more bullywugs have five subchieftains (2 HD, 12+ hp, +1 to damage).}}'},
						{name:'Carrion-Crawler',type:'CreatureRace',ct:'0',charge:'uncharged',cost:'0',body:'\\amp{template:'+fields.defaultTemplate+'}{{name=Carrion Crawler}}{{subtitle=Creature}}Specs=[Carrion Crawler,CreatureRace,0H,Creature]{{Section=**Attributes**}}{{Intelligence=Non (0)}}{{AC=7 (except head = 3)}}{{Alignment=Neutral}}{{Move=12}}{{Hit Dice=3d8+1}}{{THAC0=17}}{{Attack=8 paralysing tenticles \\amp 1d2 bite}}{{Languages=None}}{{Size=L, 9ft long,}}{{Life Expectancy=Unknown}}{{Section2=**Powers**}}{{Paralysation=On a hit with a tenticle, save to negate}}{{Section4=**Special Advantages**}}{{Keen senses=Rely on exceptional sight and smell}}RaceData=[w:Carrion Crawler, align:N, cattr:int=0|mov=12|size=L|hd=3+1|thac0=17|attk1=0:Tenticle:0:B|attk2=1d2:Bite:1:P|dmgmsg=Save vs Paralysation or \\lbrakParalysed\\rbrak(!rounds ~~target single\\vbar;\\at;{selected\\vbar;token_id}\\vbar;\\amp#64;{target\\vbar;Select Target\\vbar;token_id}\\vbar;Paralysation\\vbar;\\amp#91;\\lbrak;10\\amp#42;2d6\\rbrak;\\amp#93;\\vbar;-1\\vbar;Paralysed by a Carrion Crawler tenticle\\vbar;padlock) for 2d6 turns$$]{{Section9=**Description**}}{{desc=The carrion crawler is a scavenger of subterranean areas, feeding primarily upon carrion. When such food becomes scarce, however, it will attack and kill living creatures.\nThe crawler looks like a cross between a giant green cutworm and a cephalopod. Like so many other hybrid monsters, the carrion crawler may well be the result of genetic experimentation by a mad, evil wizard.\nThe monster\'s head, which is covered with a tough hide that gives it Armor Class 3, sprouts eight slender, writhing tentacles. The body of the carrion crawler is not well protected and has an armor class of only 7.\nThe monster is accompanied by a rank, fetid odor which often gives warning of its approach.}}{{desc1=**Combat:** The carrion crawler can move along walls, ceilings and passages very quickly, using its many clawed feet for traction.\nWhen attacking, the monster lashes out with its 2\' long tentacles, each of which produces a sticky secretion that can paralyze its victims for 2-12 turns. A save versus paralyzation is allowed to escape these effects. They kill paralyzed creatures with their bite which inflicts


ign	32
	.globl	linux_sparc_syscall, ret_sys_call
linux_sparc_syscall:
	/* Direct access to user regs, much faster. */
	cmp		%g1, NR_SYSCALLS			! IEU1	Group
	bgeu,pn		%xcc, linux_sparc_ni_syscall		! CTI
	 mov		%i0, %o0				! IEU0
	sll		%g1, 2, %l4				! IEU0	Group
#ifdef SYSCALL_TRACING
	call		syscall_trace_entry
	 add		%sp, PTREGS_OFF, %o0
	mov		%i0, %o0
#endif
	mov		%i1, %o1				! IEU1
	lduw		[%l7 + %l4], %l7			! Load
4:	mov		%i2, %o2				! IEU0	Group
	ldx		[%curptr + TI_FLAGS], %l0		! Load

	mov		%i3, %o3				! IEU1
	mov		%i4, %o4				! IEU0	Group
	andcc		%l0, _TIF_SYSCALL_TRACE, %g0		! IEU1	Group+1 bubble
	bne,pn		%icc, linux_syscall_trace		! CTI	Group
	 mov		%i0, %l5				! IEU0
2:	call		%l7					! CTI	Group brk forced
	 mov		%i5, %o5				! IEU0
	nop

3:	stx		%o0, [%sp + PTREGS_OFF + PT_V9_I0]
ret_sys_call:
#ifdef SYSCALL_TRACING
	mov		%o0, %o1
	call		syscall_trace_exit
	 add		%sp, PTREGS_OFF, %o0
	mov		%o1, %o0
#endif
	ldx		[%sp + PTREGS_OFF + PT_V9_TSTATE], %g3
	ldx		[%sp + PTREGS_OFF + PT_V9_TNPC], %l1 ! pc = npc
	sra		%o0, 0, %o0
	mov		%ulo(TSTATE_XCARRY | TSTATE_ICARRY), %g2
	sllx		%g2, 32, %g2

	/* Check if force_successful_syscall_return()
	 * was invoked.
	 */
	ldx		[%curptr + TI_FLAGS], %l0
	andcc		%l0, _TIF_SYSCALL_SUCCESS, %g0
	be,pt		%icc, 1f
	 andn		%l0, _TIF_SYSCALL_SUCCESS, %l0
	ba,pt		%xcc, 80f
	 stx		%l0, [%curptr + TI_FLAGS]

1:
	cmp		%o0, -ERESTART_RESTARTBLOCK
	bgeu,pn		%xcc, 1f
	 andcc		%l0, _TIF_SYSCALL_TRACE, %l6
80:
	/* System call success, clear Carry condition code. */
	andn		%g3, %g2, %g3
	stx		%g3, [%sp + PTREGS_OFF + PT_V9_TSTATE]
	bne,pn		%icc, linux_syscall_trace2
	 add		%l1, 0x4, %l2			! npc = npc+4
	stx		%l1, [%sp + PTREGS_OFF + PT_V9_TPC]
	ba,pt		%xcc, rtrap_clr_l6
	 stx		%l2, [%sp + PTREGS_OFF + PT


 {
        tab = gBrowser._findTabToBlurTo(tab);
      }
      gBrowser.warmupTab(tab);
    };
    tabsPanel._onMouseOut = function (e) {
      let row = e.target.closest(".all-tabs-item");
      if (e.target.classList.contains("all-tabs-secondary-button")) {
        row.mOverSecondaryButton = false;
      }
    };
    tabsPanel.view.addEventListener("ViewShowing", l10nIfNeeded, {
      once: true,
    });
    ["dragstart", "dragleave", "dragover", "drop", "dragend"].forEach(ev =>
      tabsPanel.containerNode.addEventListener(ev, tabsPanel)
    );
  }

  function registerSheet() {
    const css = /* css */ `
.panel-subview-body > .all-tabs-item {
    border-radius: var(--arrowpanel-menuitem-border-radius);
    box-shadow: none;
    align-items: center;
    padding-inline-end: 2px;
    overflow: clip;
    position: relative;
}
.panel-subview-body > .all-tabs-item .all-tabs-button:not([disabled], [open]):focus {
    background: none;
}
.panel-subview-body
    > .all-tabs-item:is([selected], [multiselected], [usercontextid]:is(:hover, [_moz-menuactive]))
    .all-tabs-button {
    background-image: linear-gradient(
        to right,
        var(--main-stripe-color) 0,
        var(--main-stripe-color) 4px,
        transparent 4px
    ) !important;
}
.panel-subview-body > .all-tabs-item[selected] {
    font-weight: normal;
    background-color: var(--arrowpanel-dimmed-further) !important;
    --main-stripe-color: var(--panel-item-active-bgcolor);
}
.panel-subview-body > .all-tabs-item .all-tabs-button {
    min-height: revert;
}
.panel-subview-body > .all-tabs-item[usercontextid]:not([multiselected]) {
    --main-stripe-color: var(--identity-tab-color);
}
.panel-subview-body > .all-tabs-item[multiselected] {
    --main-stripe-color: var(--multiselected-color, var(--toolbarbutton-icon-fill-attention));
}
.panel-subview-body
    > .all-tabs-item:not([selected]):is(:hover, :focus-within, [_moz-menuactive], [multiselected]) {
    background-color: var(--arrowpanel-dimmed) !important;
}
.panel-subview-body > .all-tabs-item[multiselected]:not([selected]):is(:hover, [_moz-menuactive]) {
    background-color: var(--arrowpanel-dimmed-further) !important;
}
.panel-subview-body
    > .all-tabs-item[pending]:not([selected]):is(:hover, :focus-within, [_moz-menuactive], [multiselected]) {
    background-color: var(
        --arrowpanel-faint,
        color-mix(in srgb, var(--arrowpanel-dimmed) 60%, transparent)
    ) !important;
}
.panel-subview-body
    > .all-tabs-item[pending][multiselected]:not([selected]):is(:hover, [_moz-menuactive]) {
    background-color: var(--arrowpanel-dimmed) !imp


et text = event.target.value
            this._temporaryTodoText = text
        })
    }

    bindSelectActiveTask(handler) {
        this.todoList.addEventListener('change', event => {
            if (event.target.type === 'radio') {
                const id = parseInt(event.target.parentElement.id)
                handler(id)
            }
        })
    }

    bindSelectActiveTab(handler) {
        this.menu.addEventListener('click', event => {
            event.preventDefault()
            let el = event.target
            this._activeTab = [...el.parentNode.children].indexOf(el)
            handler(this._activeTab)
        })
    }

    bindToggleTodo(handler) {
        this.todoList.addEventListener('change', event => {
            if (event.target.type === 'checkbox') {
                const id = parseInt(event.target.parentElement.id)
                handler(id)
            }
        })
    }

    bindRestartTodo(handler) {
        this.todoList.addEventListener('click', event => {
            if (event.target.matches('button') && event.target.innerText == 'RESTART') {
                handler()
            }
        })
    }

    bindDeleteTodo(handler) {
        this.todoList.addEventListener('click', event => {
            if (event.target.className === 'delete') {
                const id = parseInt(event.target.parentElement.id)
                handler(id)
            }
        })
    }

    bindExecuteTask(handler) {
        this.execButton.addEventListener('click', (event) => {
            handler()
        })
    }

}

export default View;import {purchaserequest} from './purchaserequest';
import {product} from './product';

export class prli {
 Id: number;
 PurchaseRequest: purchaserequest;
 Product: product;
 Quantity: number;

 about(): string {
	 return('Purchase Request = ' + this.PurchaseRequest)
	}
 constructor(Id:number=0, PurchaseRequest: purchaserequest =null, Product: product =null, Quantity:number = 0) {
  this.Id=Id;
  this.PurchaseRequest= PurchaseRequest;
  this.Product=Product;
  this.Quantity=Quantity;
 }
}class Sleeping implements Behavior {

    jibby: Jibby;

    constructor(j: Jibby) {
        console.log("Jibby is sleeping!");
        this.jibby = j;
        this.jibby.div.style.backgroundImage = "url('images/sleeping.png')";

    }

    performBehavior() {
        // waarden verlagen per frame - dit moet in het gedrag staan
        this.jibby.hygiene -= 0.001;
        this.jibby.food -= 0.002;
        this.jibby.happyness += 0.0015;
    }

    onEat() {
        this.jibby.behaviour = new Eating(this.jibby);
        this.jibby.behaviour.performBehavior();
    }

    onWash() {
        this.jibby.behaviour = new Washing(this.jibby);
        this.jibby.behaviour.performBehavior();

    }

    onPet() {
        this.jibby.behaviour = new Happy(this.jibby);
        this.jibby.behaviour.performBehavior();

    }
}import {
  Column,
  Entity,
  PrimaryGeneratedColumn,
  ManyToOne,
  CreateDateColumn,
  UpdateDateColumn,
  OneToOne,
} from "typeorm";
import { Field, ObjectType, registerEnumType } from "type-graphql";
import { Offer } from "./Offer";
import { User } from "./User";
import { Review } from "./Review";
import { DatesEntity } from "./DatesEntity";

export enum BookingStatuses {
  WAITING_APPROVAL = "WAITING_APPROVAL",
  PAYMENT_PENDING = "PAYMENT_PENDING",
  CONFIRMED = "CONFIRMED",
  CANCELLED = "CANCELLED",
}

export enum CancelReasons {
  UNKNOWN = "UNKNOWN",
  OWNER_CANCELLATION = "OWNER_CANCELLATION",
  OCCUPANT_CANCELLATION = "OCCUPANT


	DeletedJobs:         workqueue.NewTypedRateLimitingQueue[*schedulingapi.JobInfo](workqueue.DefaultTypedControllerRateLimiter[*schedulingapi.JobInfo]()),
		hyperNodesQueue:     workqueue.NewTypedRateLimitingQueue[string](workqueue.DefaultTypedControllerRateLimiter[string]()),
		kubeClient:          fake.NewSimpleClientset(),
		vcClient:            fakevcClient.NewSimpleClientset(),
		restConfig:          nil,
		defaultQueue:        "default",
		schedulerNames:      []string{schedulerName},
		nodeSelectorLabels:  make(map[string]sets.Empty),
		NamespaceCollection: make(map[string]*schedulingapi.NamespaceCollection),
		CSINodesStatus:      make(map[string]*schedulingapi.CSINodeStatusInfo),
		imageStates:         make(map[string]*imageState),

		NodeList:       []string{},
		binderRegistry: NewBinderRegistry(),
	}
	if options.ServerOpts != nil && len(options.ServerOpts.NodeSelector) > 0 {
		msc.updateNodeSelectors(options.ServerOpts.NodeSelector)
	}
	msc.setBatchBindParallel()
	msc.nodeWorkers = getNodeWorkers()

	return msc
}
/*
Copyright 2019 The Kubernetes Authors.
Copyright 2019-2025 The Volcano Authors.

Modifications made by Volcano authors:
- Added comprehensive test coverage for enhanced argument parsing functions

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package framework

import (
	"testing"

	"k8s.io/apimachinery/pkg/api/equality"

	"volcano.sh/volcano/pkg/scheduler/conf"
)

type GetIntTestCases struct {
	arg         Arguments
	key         string
	baseValue   int
	expectValue int
}

func TestArgumentsGetInt(t *testing.T) {
	key1 := "intkey"

	cases := []GetIntTestCases{
		{
			arg: Arguments{
				key1: 15,
			},
			key:         key1,
			baseValue:   10,
			expectValue: 15,
		},
		{
			arg: Arguments{
				key1: "errorvalue",
			},
			key:         key1,
			baseValue:   11,
			expectValue: 11,
		},
		{
			arg: Arguments{
				key1: "",
			},
			key:         key1,
			baseValue:   0,
			expectValue: 0,
		},
	}

	for index, c := range cases {
		baseValue := c.baseValue
		c.arg.GetInt(nil, c.key)
		c.arg.GetInt(&baseValue, c.key)
		if baseValue != c.expectValue {
			t.Errorf("index %d, value should be %v, but not %v", index, c.expectValue, baseValue)
		}
	}
}

func TestArgumentsGetFloat64(t *testing.T) {
	key1 := "float64key"

	cases := []struct {
		name        string
		arg         Arguments
		key         string
		baseValue   float64
		expectValue float64
	}{
		{
			name: "key not exist",
			arg: Arguments{
				"anotherKey


 serde(serialize_with = "serialize_as_string"))]
    /// Total redeem amount (`amount_btc + dotsToBtc(amount_dot)`)
    pub amount_polka_btc: PolkaBTC,
    #[cfg_attr(
        feature = "std",
        serde(bound(deserialize = "PolkaBTC: std::str::FromStr"))
    )]
    #[cfg_attr(feature = "std", serde(deserialize_with = "deserialize_from_string"))]
    #[cfg_attr(
        feature = "std",
        serde(bound(serialize = "PolkaBTC: std::fmt::Display"))
    )]
    #[cfg_attr(feature = "std", serde(serialize_with = "serialize_as_string"))]
    /// Total redeem fees in PolkaBTC - taken from request amount
    pub fee: PolkaBTC,
    #[cfg_attr(
        feature = "std",
        serde(bound(deserialize = "PolkaBTC: std::str::FromStr"))
    )]
    #[cfg_attr(feature = "std", serde(deserialize_with = "deserialize_from_string"))]
    #[cfg_attr(
        feature = "std",
        serde(bound(serialize = "PolkaBTC: std::fmt::Display"))
    )]
    #[cfg_attr(feature = "std", serde(serialize_with = "serialize_as_string"))]
    /// Total amount of BTC for the vault to send
    pub amount_btc: PolkaBTC,
    #[cfg_attr(feature = "std", serde(bound(deserialize = "DOT: std::str::FromStr")))]
    #[cfg_attr(feature = "std", serde(deserialize_with = "deserialize_from_string"))]
    #[cfg_attr(feature = "std", serde(bound(serialize = "DOT: std::fmt::Display")))]
    #[cfg_attr(feature = "std", serde(serialize_with = "serialize_as_string"))]
    /// Partial redeem amount in DOT, currently unused
    pub amount_dot: DOT,
    #[cfg_attr(feature = "std", serde(bound(deserialize = "DOT: std::str::FromStr")))]
    #[cfg_attr(feature = "std", serde(deserialize_with = "deserialize_from_string"))]
    #[cfg_attr(feature = "std", serde(bound(serialize = "DOT: std::fmt::Display")))]
    #[cfg_attr(feature = "std", serde(serialize_with = "serialize_as_string"))]
    /// Premium redeem amount in DOT
    pub premium_dot: DOT,
    pub redeemer: AccountId,
    pub btc_address: BtcAddress,
    pub completed: bool,
    pub cancelled: bool,
    pub reimburse: bool,
}

#[cfg(feature = "std")]
fn serialize_as_string<S: Serializer, T: std::fmt::Display>(
    t: &T,
    serializer: S,
) -> Result<S::Ok, S::Error> {
    serializer.serialize_str(&t.to_string())
}

#[cfg(feature = "std")]
fn deserialize_from_string<'de, D: Deserializer<'de>, T: std::str::FromStr>(
    deserializer: D,
) -> Result<T, D::Error> {
    let s = String::deserialize(deserializer)?;
    s.parse::<T>()
        .map_err(|_| serde::de::Error::custom("Parse from string failed"))
}
use serde::Deserialize;
use std::cmp::Ordering;
use std::collections::BinaryHeap;
use std::io;

#[derive(Deserialize, Debug)]
#[serde(transparent)]
struct ServerList {
    servers: Vec<String>
}

impl ServerList {
    fn exists(&self, name: &str) -> bool {
        self.servers.contains(&name.to_owned())
    }
}

#[derive(D


{"from": "Robb", "to": "Bran", "value": 23}, {"from": "Robb", "to": "Brienne", "value": 6}, {"from": "Robb", "to": "Brynden", "value": 17}, {"from": "Robb", "to": "Edmure", "value": 32}, {"from": "Robb", "to": "Hodor", "value": 5}, {"from": "Robb", "to": "Jaime", "value": 15}, {"from": "Robb", "to": "Jeyne", "value": 18}, {"from": "Robb", "to": "Joffrey", "value": 10}, {"from": "Robb", "to": "Jon", "value": 14}, {"from": "Robb", "to": "Lothar", "value": 10}, {"from": "Robb", "to": "Petyr", "value": 5}, {"from": "Robb", "to": "Ramsay", "value": 4}, {"from": "Robb", "to": "Rickard", "value": 7}, {"from": "Robb", "to": "Rickon", "value": 15}, {"from": "Robb", "to": "Roose", "value": 4}, {"from": "Robb", "to": "Sansa", "value": 15}, {"from": "Robb", "to": "Stannis", "value": 4}, {"from": "Robb", "to": "Theon", "value": 11}, {"from": "Robb", "to": "Tyrion", "value": 12}, {"from": "Robb", "to": "Tywin", "value": 12}, {"from": "Robb", "to": "Walder", "value": 26}, {"from": "Robert", "to": "Aemon", "value": 4}, {"from": "Robert", "to": "Barristan", "value": 5}, {"from": "Robert", "to": "Renly", "value": 4}, {"from": "Robert", "to": "Stannis", "value": 5}, {"from": "Robert", "to": "Thoros", "value": 4}, {"from": "Robert Arryn", "to": "Marillion", "value": 4}, {"from": "Roose", "to": "Brienne", "value": 4}, {"from": "Samwell", "to": "Bowen", "value": 6}, {"from": "Samwell", "to": "Craster", "value": 34}, {"from": "Samwell", "to": "Eddison", "value": 12}, {"from": "Samwell", "to": "Gilly", "value": 36}, {"from": "Samwell", "to": "Grenn", "value": 43}, {"from": "Samwell", "to": "Janos", "value": 6}, {"from": "Samwell", "to": "Mance", "value": 10}, {"from": "Samwell", "to": "Qhorin", "value": 5}, {"from": "Sandor", "to": "Beric", "value": 15}, {"from": "Sandor", "to": "Gendry", "value": 5}, {"from": "Sandor", "to": "Ilyn", "value": 4}, {"from": "Sandor", "to": "Meryn", "value": 4}, {"from": "Sandor", "to": "Robert", "value": 6}, {"from": "Sandor", "to": "Thoros", "value": 10}, {"from": "Sansa", "to": "Arya", "value": 22}, {"from": "Sansa", "to": "Bran", "value": 10}, {"from": "Sansa", "to": "Brienne", "value": 5}, {"from": "Sansa", "to": "Cersei", "value": 16}, {"from": "Sansa", "to": "Jaime", "value": 10}, {"from": "Sansa", "to": "Joffrey", "value": 35}, {"from": "Sansa", "to": "Jon", "value": 4}, {"from": "Sansa", "to": "Kevan", "value": 5}, {"from": "Sansa", "to": "Lo


import pandas as pd
import matplotlib.pyplot as plt

def display_result(input_dataframe):

    # https://queirozf.com/entries/pandas-dataframe-plot-examples-with-matplotlib-pyplot

    players_type = ['CH','CO','R','CC','CK','GR','ST','DE']
    ax = plt.gca()
    for element in players_type:
        input_dataframe.plot(kind='line', y = element,linestyle = '-',marker=',',ax=ax)

    plt.savefig("result.pdf", format="pdf", bbox_inches="tight")
    plt.xlabel('No. of Tournaments')
    plt.ylabel('Number of Players')
    plt.show()

    return 0


_KHR;
		presentInfo.pNext = NULL;
		presentInfo.swapchainCount = 1;
		presentInfo.pSwapchains = &m_SwapChain;
		presentInfo.pImageIndices = &imageIndex;
		// Check if a wait semaphore has been specified to wait for before presenting the image
		if (waitSemaphore != VK_NULL_HANDLE)
		{
			presentInfo.pWaitSemaphores = &waitSemaphore;
			presentInfo.waitSemaphoreCount = 1;
		}
		return fpQueuePresentKHR(queue, &presentInfo);
	}

	void VulkanSwapChainH2M::Cleanup()
	{
		VkDevice device = m_Device->GetVulkanDevice();

		if (m_SwapChain)
		{
			for (uint32_t i = 0; i < m_ImageCount; i++)
				vkDestroyImageView(device, m_Buffers[i].view, nullptr);
		}

		if (m_Surface)
		{
			fpDestroySwapchainKHR(device, m_SwapChain, nullptr);
			vkDestroySurfaceKHR(m_Instance, m_Surface, nullptr);
		}

		m_Surface = VK_NULL_HANDLE;
		m_SwapChain = VK_NULL_HANDLE;
	}

	void VulkanSwapChainH2M::FindImageFormatAndColorSpace()
	{
		VkPhysicalDevice physicalDevice = m_Device->GetPhysicalDevice()->GetVulkanPhysicalDevice();

		// Get list of supported surface formats
		uint32_t formatCount;
		VK_CHECK_RESULT_H2M(fpGetPhysicalDeviceSurfaceFormatsKHR(physicalDevice, m_Surface, &formatCount, NULL));
		H2M_CORE_ASSERT(formatCount > 0);

		std::vector<VkSurfaceFormatKHR> surfaceFormats(formatCount);
		VK_CHECK_RESULT_H2M(fpGetPhysicalDeviceSurfaceFormatsKHR(physicalDevice, m_Surface, &formatCount, surfaceFormats.data()));

		// If the surface format list only includes one entry with VK_FORMAT_UNDEFINED,
		// there is no preferered format, so we assume VK_FORMAT_B8G8R8A8_UNORM
		if ((formatCount == 1) && (surfaceFormats[0].format == VK_FORMAT_UNDEFINED))
		{
			m_ColorFormat = VK_FORMAT_B8G8R8A8_UNORM;
			m_ColorSpace = surfaceFormats[0].colorSpace;
		}
		else
		{
			// iterate over the list of available surface format and
			// check for the presence of VK_FORMAT_B8G8R8A8_UNORM
			bool found_B8G8R8A8_UNORM = false;
			for (auto&& surfaceFormat : surfaceFormats)
			{
				if (surfaceFormat.format == VK_FORMAT_B8G8R8A8_UNORM)
				{
					m_ColorFormat = surfaceFormat.format;
					m_ColorSpace = surfaceFormat.colorSpace;
					found_B8G8R8A8_UNORM = true;
					break;
				}
			}

			// in case VK_FORMAT_B8G8R8A8_UNORM is not available
			// select the first available color format
			if (!found_B8G8R8A8_UNORM)
			{
				m_ColorFormat = surfaceFormats[0].format;
				m_ColorSpace = surfaceFormats[0].colorSpace;
			}
		}

	}

}
// Copyright (C) 2021-2023 the DTVM authors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

#include "runtime/memory.h"
#include "common/enums.h"
#include "runtime/module.h"
#include "utils/logging.h"
#include "utils/others.h"
#include <cstdio>

namespace zen::runtime {

using namespace zen::common;

constexpr size_t MmapMemoryFileMaxSize = 32 * 1024 * 1024; // 32MB

static bool verifyCanUseMmapBucketByModuleDataSegments(


utterBinding.ensureInitialized();

    Hive.init(path_helper.join(Global.tempPath, 'hive'));

    await openBox();
  }

  Future<void> openBox() async {
    await Hive.openBox<String>(
      kCacheBox,
      compactionStrategy: (int entries, int deletedEntries) {
        logger.t('entries $entries');
        return entries > 10;
      },
    );
  }

  Future<void> setUsersInfo(List<User> users) async {
    await _cacheBox.put(kUsersKey, jsonEncode(users));
  }

  List<User> getUsersInfo() {
    final all = _cacheBox.get(kUsersKey, defaultValue: '[]');

    final _users = <User>[];
    for (final val in jsonDecode(all ?? '[]') as List<dynamic>) {
      _users.add(User.fromJson(val as Map<String, dynamic>));
    }
    return _users;
  }
}
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:eros_fe/common/global.dart';
import 'package:get/get.dart';
import 'package:isar_community/isar.dart';
import 'package:json_annotation/json_annotation.dart';
import 'package:path/path.dart' as path;

part 'gallery_task.g.dart';

@CopyWith()
@JsonSerializable()
@Collection()
class GalleryTask {
  GalleryTask({
    required this.gid,
    required this.token,
    this.url,
    required this.title,
    required this.dirPath,
    required this.fileCount,
    this.completCount,
    this.status,
    this.coverImage,
    this.addTime,
    this.coverUrl,
    this.rating,
    this.category,
    this.uploader,
    this.jsonString,
    this.tag,
    this.downloadOrigImage,
    this.showKey,
  });

  factory GalleryTask.fromJson(Map<String, dynamic> json) =>
      _$GalleryTaskFromJson(json);

  Map<String, dynamic> toJson() => _$GalleryTaskToJson(this);

  // @primaryKey
  @Index(unique: true, replace: true)
  final Id gid;
  final String token;
  final String? url;
  final String title;
  final String? dirPath;
  final int fileCount;
  final int? completCount;
  final int? status;
  final String? coverImage;
  final int? addTime;
  final String? coverUrl;
  final double? rating;
  final String? category;
  final String? uploader;
  final String? jsonString;
  final String? tag;
  final bool? downloadOrigImage;
  final String? showKey;

  String? get realDirPath {
    if (dirPath == null) {
      return dirPath;
    }
    if (GetPlatform.isIOS) {
      final List<String> pathList = path.split(dirPath!).reversed.toList();
      // logger.t('$pathList');
      return path.join(Global.appDocPath, pathList[1], pathList[0]);
    } else {
      return dirPath;
    }
  }

  @override
  String toString() {
    return 'GalleryTask{gid: $gid, token: $token, url: $url, title: $title, dirPath: $dirPath, fileCount: $fileCount, completCount: $completCount, status: $status, coverImage: $coverImage, addTime: $addTime, coverUrl: $coverUrl, rating: $rating, category: $category, uploader: $uploader, jsonString: $jsonString, tag: $tag, downloadOrigImage: $downloadOrigImage, showKey: $showKey}';
  }
}
// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'gallery_image_task.dart';

// **************************************************************************
// CopyWithGenerator
// **************************************************************************

abstract class _$GalleryImageTaskCWProxy {
  GalleryIm


 const [
            '1. kvartal',
            '2. kvartal',
            '3. kvartal',
            '4. kvartal'
          ],
          AMPMS: const ['AM', 'PM'],
          DATEFORMATS: const [
            'EEEE, d. MMMM y',
            'd. MMMM y',
            'd. MMM y',
            'dd.MM.yy'
          ],
          TIMEFORMATS: const [
            'HH:mm:ss zzzz',
            'HH:mm:ss z',
            'HH:mm:ss',
            'HH:mm'
          ],
          DATETIMEFORMATS: const ['{1} {0}', '{1} {0}', '{1} {0}', '{1} {0}'],
          FIRSTDAYOFWEEK: 0,
          WEEKENDRANGE: const [5, 6],
          FIRSTWEEKCUTOFFDAY: 3),
      // Date/time formatting symbols for locale eu.
      "eu": new DateSymbols(
          NAME: "eu",
          ERAS: const ['K.a.', 'K.o.'],
          ERANAMES: const ['Kristo aurretik', 'Kristo ondoren'],
          NARROWMONTHS: const [
            'U',
            'O',
            'M',
            'A',
            'M',
            'E',
            'U',
            'A',
            'I',
            'U',
            'A',
            'A'
          ],
          STANDALONENARROWMONTHS: const [
            'U',
            'O',
            'M',
            'A',
            'M',
            'E',
            'U',
            'A',
            'I',
            'U',
            'A',
            'A'
          ],
          MONTHS: const [
            'urtarrila',
            'otsaila',
            'martxoa',
            'apirila',
            'maiatza',
            'ekaina',
            'uztaila',
            'abuztua',
            'iraila',
            'urria',
            'azaroa',
            'abendua'
          ],
          STANDALONEMONTHS: const [
            'urtarrila',
            'otsaila',
            'martxoa',
            'apirila',
            'maiatza',
            'ekaina',
            'uztaila',
            'abuztua',
            'iraila',
            'urria',
            'azaroa',
            'abendua'
          ],
          SHORTMONTHS: const [
            'urt.',
            'ots.',
            'mar.',
            'api.',
            'mai.',
            'eka.',
            'uzt.',
            'abu.',
            'ira.',
            'urr.',
            'aza.',
            'abe.'
          ],
          STANDALONESHORTMONTHS: const [
            'urt.',
            'ots.',
            'mar.',
            'api.',
            'mai.',
            'eka.',
            'uzt.',
            'abu.',
            'ira.',
            'urr.',
            'aza.',
            'abe.'
          ],
          WEEKDAYS: const [
            'igandea',
            'astelehena',
            'asteartea',
            'asteazkena',
            'osteguna',
            'ostirala',
            'larunbata'
          ],
          STANDALONEWEEKDAYS: const [
            'igandea',
            'astelehena',
            'asteartea',
            'asteazkena',
            'osteguna',
            'ostirala',


namespace UnityEngine.PostProcessing
{
    public class PostProcessingContext
    {
        public PostProcessingProfile profile;
        public Camera camera;

        public MaterialFactory materialFactory;
        public RenderTextureFactory renderTextureFactory;

        public bool interrupted { get; private set; }

        public void Interrupt()
        {
            interrupted = true;
        }

        public PostProcessingContext Reset()
        {
            profile = null;
            camera = null;
            materialFactory = null;
            renderTextureFactory = null;
            interrupted = false;
            return this;
        }

        #region Helpers
        public b


            # 公共管理与公共服务用地
                    return "A"
                elif leisure_type in ["nature_reserve", "wildlife_hide"]:
                    # 其他非建设用地
                    return "E3"
                # Other leisure
                else:
                    return "B3"
            # 详见https://wiki.openstreetmap.org/wiki/Key:amenity
            elif main_land_type.startswith("amenity"):
                amenity_type = main_land_type.split("|")[-1]
                # Sustenance
                if amenity_type in [
                    "bar",
                    "biergarten",
                    "cafe",
                    "fast_food",
                    "food_court",
                    "ice_cream",
                    "pub",
                    "restaurant",
                ]:
                    # 饭店、餐厅、酒吧等用地
                    return "B13"
                # Education
                elif amenity_type in [
                    "college",
                    "dancing_school",
                    "driving_school",
                    "first_aid_school",
                    "kindergarten",
                    "language_school",
                    "library",
                    "surf_school",
                    "toy_library",
                    "research_institute",
                    "training",
                    "music_school",
                    "school",
                    "traffic_park",
                    "university",
                ]:
                    # 教育科研用地
                    return "A3"
                # Transportation
                elif amenity_type in [
                    "bicycle_parking",
                    "bicycle_repair_station",
                    "bicycle_rental",
                    "bicycle_wash",
                    "boat_rental",
                    "boat_sharing",
                    "bus_station",
                    "car_rental",
                    "car_sharing",
                    "car_wash",
                    "compressed_air",
                    "vehicle_inspection",
                    "charging_station",
                    "driver_training",
                    "ferry_terminal",
                    "fuel",
                    "grit_bin",
                    "motorcycle_parking",
                    "parking",
                    "parking_entrance",
                    "parking_space",
                    "taxi",
                    "weighbridge",
                ]:
                    # 交通场站用地
                    return "S4"
                # Financial
                elif amenity_type in [
                    "atm",
                    "payment_terminal",
                    "bank",
                    "bureau_de_change",
                    "money_transfer",
                    "payment_centre",
                ]:
                    # 商业设施用地
                    return "B1"
                # Healthcare
                elif amenity_type in [
                    "baby_hatch",
                    "clinic",
                    "dentist",
                    "doctors",
                    "hospital",
                    "nursing_home",
                    "pharmacy",
                    "social_facility",
                    "veterinary",
                ]:
                    # 医疗卫生用地
                    return "A5"
                # Entertainment, Arts & Culture
                elif amenity_type in [
                    "arts_centre",
                    "brothel",
                    "casino",
                    "cinema",
                    "community_centre",
                    "conference_centre",
                    "events_venue",
                    "exhibition_centre",
                    "fountain",
                    "gambling",
                    "love_hotel",
                    "music_venue",
                    "nightclub",
                    "planetarium",
                    "public_bookcase",
                    "social_centre",
                    "stripclub",
                    "studio",
                    "swingerclub",
                    "theatre",
                ]:
                    # 文化设施用地
                    return "A2"
                # Public Service
                elif amenity_type in [
                    "courthouse",
                    "fire_station",
                    "police",
                    "post_box",
                    "post_depot",
                    "post_office",
                    "prison",


 to set the encoding type to be converted by implementing HI_FORMAT_INVOKE_SET_SOURCE_CODETYPE, the value of the u32CharSet is the configured encoding type */
                                                       /**< CNcomment:ĻͣȡֵΧ:
                                                            1. ĬֵΪ0
                                                            2. IdentStreamַʶ
                                                               (οhi_charset_common.h)ֵΪʶֵַ
                                                            3. ConvStreamת뺯 (οhi_charset_common.h)
                                                              ҵInvokeӿִHI_FORMAT_INVOKE_SUB_SET_CODETYPE
                                                              ҪתɵıֵͣΪõı*/
    HI_BOOL bExtSub;                                  /**< Whether subtitles are external subtitles. When bExtSub is HI_TRUE, the subtitles are external. When bExtSub is HI_FALSE, the subtitles are internal. *//**< CNcomment:ǷΪĻ, HI_TRUEΪĻHI_FALSEΪĻ */
    HI_U32  u32StreamNum;                             /**< contains stream number *//**< CNcomment:ĻĿ */
    HI_CHAR paszLanguage[HI_FORMAT_MAX_LANGUAGE_NUM][HI_FORMAT_LANG_LEN]; /**< Subtitle language *//**< CNcomment:Ļ */
    HI_U16  u16OriginalFrameWidth;                     /**< Width of the original image *//**< CNcomment:ԭʼͼ */
    HI_U16  u16OriginalFrameHeight;                    /**< Height of the original image *//**< CNcomment:ԭʼͼ߶ */
    HI_U32  u32ExtradataSize;                          /**< Length of the extended data *//**< CNcomment:չݳ */
    HI_U8   *pu8Extradata;                             /**< Extended data *//**< CNcomment:չ */
    HI_VOID  *pCodecContext;                           /**< Audio decode context *//**< CNcomment:Ļ */
    HI_U32 u32Role;                                    /**< Role descriptor value of mpeg dash. the most 8 bits is scheme value(refer to HI_FORMAT_ROLE_SCHEME_E), the left 24 bits is descriptor value, the descriptor value may be the bitwise '|' result of value define in HI_FORMAT_ROLE_VALUE_E*/
                                                       /**< CNcomment:mpeg dash  Role descriptor ֵ,8λscheme(οHI_FORMAT_ROLE_SCHEME_E),24λdescriptor ֵ,descriptorֵHI_FORMAT_ROLE_VALUE_Eж1ֵλ'|' Ľ*/
    HI_U32 u32Accessibility;                           /**<  Accessibility descriptor value of mpeg dash. the most 8 bits is scheme value(refer to HI_FORMAT_ROLE_SCHEME_E), the left 24 bits is descriptor value, value type is number*/
                                                       /**< CNcomment:mpeg dash  Accessibility descriptor ֵ,8λscheme(οhiFORMAT_ACCESSIBILITY_SCHEME_E),24λdescriptor ֵ,descriptorֵ*/
} HI_FORMAT_SUB_INFO_S;

/** Program information. If a file contains internal subtitles and external subtitles, add the external subtitles to the end of the internal subtitles.*/
/** CNcomment:ĿϢļȴĻҲĻĻϢ׷Ļ*/
typedef struct hiFORMAT_PROGRAM_INFO_S
{
    HI_U32 u32VidStreamNum;                /**< Number of video streams *//**< CNcomment:Ƶ */
    HI_FORMAT_VID_INFO_S *pastVidStream;   /**< Video stream information *//**< CNcomment:ƵϢ */
    HI_U32 u32AudStreamNum;                /**< Number of audio streams *//**< CNcomment:Ƶ */
    HI_FORMAT_AUD_INFO_S *pastAudStream;   /**< Audio stream information *//**< CNcomment:ƵϢ */
    HI_U32 u32SubStreamNum;                /**< Number of subtitles *//**< CNcomment:Ļ */
    HI_FORMAT_SUB_INFO_S *pastSubStream;   /**< Subtitle information *//**< CNcomment:ĻϢ */
    HI_CHAR aszServiceName[HI_FORMAT_SERVICE_DESCRIPT_LEN];       /**< Program service name info *//**< CNcomment:Ŀ */
    HI_CHAR aszServiceProvider[HI_FORMAT_SERVICE_DESCRIPT_LEN];   /**<  Program service provider info *//**< CNcomment:Ŀṩ */
    HI_S64  s64ProgramDuration;
    HI_S64  s64ProgramStartTime;
} HI_FORMAT_PROGRAM_INFO_S;

/** Media file information */
/** CNcomment:ýļϢ */
typedef struct hiFORMAT_FILE_INFO_S
{
    HI_FORMAT_SOURCE_TYPE_E eSourceType;    /**< File source type *//**< CNcomment:ļԴ */
    HI_FORMAT_STREAM_TYPE_E eStreamType;    /**< File stream type *//**< CNcomment:ļ */
    HI_S64  s64FileSize;                    /**< File size, in the unit of byte. *//**< CNcomment:ļСλֽ */
    HI_S64  s64StartTime;                   /**< Start time of playing a file, in the unit is ms. *//**< CNcomment:ļʼʱ䣬λms */
    HI_S64  s64Duration;                    /**< Total duration of a file, in the unit of ms. *//**< CNcomment:ļʱλms */
    HI_U32  u32Bitrate;                     /**< File bit rate,


Boolean("Sleeping");
        this.sleepTimer = p_70037_1_.getShort("SleepTimer");
        this.experience = p_70037_1_.getFloat("XpP");
        this.experienceLevel = p_70037_1_.getInteger("XpLevel");
        this.experienceTotal = p_70037_1_.getInteger("XpTotal");
        this.setScore(p_70037_1_.getInteger("Score"));

        if (this.sleeping) {
            this.playerLocation = new ChunkCoordinates(MathHelper.floor_double(this.posX),
                    MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ));
            this.wakeUpPlayer(true, true, false);
        }

        if (p_70037_1_.func_150297_b("SpawnX", 99) && p_70037_1_.func_150297_b("SpawnY", 99)
                && p_70037_1_.func_150297_b("SpawnZ", 99)) {
            this.spawnChunk = new ChunkCoordinates(p_70037_1_.getInteger("SpawnX"), p_70037_1_.getInteger("SpawnY"),
                    p_70037_1_.getInteger("SpawnZ"));
            this.spawnForced = p_70037_1_.getBoolean("SpawnForced");
        }

        this.foodStats.readNBT(p_70037_1_);
        this.capabilities.readCapabilitiesFromNBT(p_70037_1_);

        if (p_70037_1_.func_150297_b("EnderItems", 9)) {
            NBTTagList var3 = p_70037_1_.getTagList("EnderItems", 10);
            this.theInventoryEnderChest.loadInventoryFromNBT(var3);
        }
    }

    /**
     * (abstract) Protected helper method to write subclass entity data to NBT.
     */
    public void writeEntityToNBT(NBTTagCompound p_70014_1_) {
        super.writeEntityToNBT(p_70014_1_);
        p_70014_1_.setTag("Inventory", this.inventory.writeToNBT(new NBTTagList()));
        p_70014_1_.setInteger("SelectedItemSlot", this.inventory.currentItem);
        p_70014_1_.setBoolean("Sleeping", this.sleeping);
        p_70014_1_.setShort("SleepTimer", (short) this.sleepTimer);
        p_70014_1_.setFloat("XpP", this.experience);
        p_70014_1_.setInteger("XpLevel", this.experienceLevel);
        p_70014_1_.setInteger("XpTotal", this.experienceTotal);
        p_70014_1_.setInteger("Score", this.getScore());

        if (this.spawnChunk != null) {
            p_70014_1_.setInteger("SpawnX", this.spawnChunk.posX);
            p_70014_1_.setInteger("SpawnY", this.spawnChunk.posY);
            p_70014_1_.setInteger("SpawnZ", this.spawnChunk.posZ);
            p_70014_1_.setBoolean("SpawnForced", this.spawnForced);
        }

        this.foodStats.writeNBT(p_70014_1_);
        this.capabilities.writeCapabilitiesToNBT(p_70014_1_);
        p_70014_1_.setTag("EnderItems", this.theInventoryEnderChest.saveInventoryToNBT());
    }

    /**
     * Displays the GUI for interacting with a chest inventory. Args: chestInventory
     */
    public void displayGUIChest(IInventory p_71007_1_) {
    }

    public void func_146093_a(TileEntityHopper p_146093_1_) {
    }

    public void displayGUIHopperMinecart(EntityMinecartHopper p_96125_1_) {
    }

    public void displayGUIHorse(EntityHorse p_110298_1_, IInventory p_110298_2_) {
    }

    public void displayGUIEnchantment(int p_71002_1_, int p_71002_2_, int p_71002_3_, String p_71


",
							Weight: 5,
						},
						ModelFramework: &v1beta1.ModelFrameworkSpec{
							Name:   "transformers",
							Weight: 8,
						},
						Priority:   ptr(int32(1)),
						AutoSelect: ptr(true),
					},
					{
						ModelFormat: &v1beta1.ModelFormat{
							Name:   "PyTorch",
							Weight: 10,
						},
						ModelFramework: &v1beta1.ModelFrameworkSpec{
							Name:   "transformers",
							Weight: 8,
						},
						Priority:   ptr(int32(2)),
						AutoSelect: ptr(true),
					},
				},
			},
			baseModel: &v1beta1.BaseModelSpec{
				ModelFormat: v1beta1.ModelFormat{
					Name: "PyTorch",
				},
				ModelFramework: &v1beta1.ModelFrameworkSpec{
					Name: "transformers",
				},
			},
			expectedScore: 36, // Best match: (10 * 2) + (8 * 2) = 20 + 16 = 36
		},
		{
			name: "default priority when not specified",
			runtime: &v1beta1.ServingRuntimeSpec{
				SupportedModelFormats: []v1beta1.SupportedModelFormat{
					{
						ModelFormat: &v1beta1.ModelFormat{
							Name:   "PyTorch",
							Weight: 12,
						},
						AutoSelect: ptr(true),
						// No priority specified, should default to 1
					},
				},
			},
			baseModel: &v1beta1.BaseModelSpec{
				ModelFormat: v1beta1.ModelFormat{
					Name: "PyTorch",
				},
			},
			expectedScore: 12, // 12 * 1 (default priority) = 12
		},
		{
			name: "nil model framework in base model",
			runtime: &v1beta1.ServingRuntimeSpec{
				SupportedModelFormats: []v1beta1.SupportedModelFormat{
					{
						ModelFormat: &v1beta1.ModelFormat{
							Name:   "PyTorch",
							Weight: 10,
						},
						ModelFramework: &v1beta1.ModelFrameworkSpec{
							Name:   "transformers",
							Weight: 5,
						},
						Priority:   ptr(int32(2)),
						AutoSelect: ptr(true),
					},
				},
			},
			baseModel: &v1beta1.BaseModelSpec{
				ModelFormat: v1beta1.ModelFormat{
					Name: "PyTorch",
				},
				// ModelFramework is nil
			},
			expectedScore: 0, // model has no modelFramework, runtime has one, so they don't match
		},
		{
			name: "autoselect false - should get 0 score",
			runtime: &v1beta1.ServingRuntimeSpec{
				SupportedModelFormats: []v1beta1.SupportedModelFormat{
					{
						ModelFormat: &v1beta1.ModelFormat{
							Name:   "PyTorch",
							Weight: 10,
						},
						Priority:   ptr(int32(2)),
						AutoSelect: ptr(false), // AutoSelect is false
					},
				},
			},
			baseModel: &v1beta1.BaseModelSpec{
				ModelFormat: v1beta1.ModelFormat{
					Name: "PyTorch",
				},
			},
			expectedScore: 0, // AutoSelect is false, so score is 0
		},
	}

	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			scorer := NewDefaultRuntimeScorer(NewConfig(nil))
			actualScore, err := scorer.CalculateScore(tt.runtime, tt.baseModel)
			assert.NoError(t, err)
			assert.Equal(t, tt.expectedScore, actualScore, "Score should match expected value")
		})
	}
}

func TestGetCompatibleRuntimes_ExcludeNoAutoSelect(t *testing.T) {
	// Create client and selector
	fakeClient


 triangular-PDF dither. The code below assumes
input data is in the range +1 to -1 and doesn't check for overloads!

To save time when generating dither for multiple channels you can do
things like this:  r3=(r1 & 0x7F)<<8; instead of calling rand() again.

  int   r1, r2;                //rectangular-PDF random numbers
  float s1, s2;                //error feedback buffers
  float s = 0.5f;              //set to 0.0f for no noise shaping
  float w = pow(2.0,bits-1);   //word length (usually bits=16)
  float wi= 1.0f/w;
  float d = wi / RAND_MAX;     //dither amplitude (2 lsb)
  float o = wi * 0.5f;         //remove dc offset
  float in, tmp;
  int   out;

//for each sample...

  r2=r1;                               //can make HP-TRI dither by
  r1=rand();                           //subtracting previous rand()

  in += s * (s1 + s1 - s2);            //error feedback
  tmp = in + o + d * (float)(r1 - r2); //dc offset and dither

  out = (int)(w * tmp);                //truncate downwards
  if(tmp<0.0f) out--;                  //this is faster than floor()

  s2 = s1;
  s1 = in - wi * (float)out;           //error

--
paul.kellett@maxim.abel.co.uk
http://www.maxim.abel.co.uk
*/

/*
16-to-8-bit first-order dither

Type : First order error feedforward dithering code
References : Posted by Jon Watte

Notes :
This is about as simple a dithering algorithm as you can implement, but it's
likely to sound better than just truncating to N bits.

Note that you might not want to carry forward the full difference for infinity.
It's probably likely that the worst performance hit comes from the saturation
conditionals, which can be avoided with appropriate instructions on many DSPs
and integer SIMD type instructions, or CMOV.

Last, if sound quality is paramount (such as when going from > 16 bits to 16
bits) you probably want to use a higher-order dither function found elsewhere
on this site.

Code :
// This code will down-convert and dither a 16-bit signed short
// mono signal into an 8-bit unsigned char signal, using a first
// order forward-feeding error term dither.

#define uchar unsigned char

void dither_one_channel_16_to_8( short * input, uchar * output, int count, int * memory )
{
  int m = *memory;
  while( count-- > 0 ) {
    int i = *input++;
    i += m;
    int j = i + 32768 - 128;
    uchar o;
    if( j < 0 ) {
      o = 0;
    }
    else if( j > 65535 ) {
      o = 255;
    }
    else {
      o = (uchar)((j>>8)&0xff);
    }
    m = ((j-32768+128)-i);
    *output++ = o;
  }
  *memory = m;
}
*/


|
|3821B1PE3|Kokin Ivan|1/9|
|3821B1PE3|Kokin_Ivan|**9/9**|
|3821B1PE3|Musaev_Ilgar|**9/9**|
|3821B1PE3|fedorets_ilya|**9/9**|
|3821B1PE3|nedelin_dmitry|**9/9**|
|3821B1PE3|smirnov_pavel|**9/9**|

Passed: 6

**Total Passed: 89**
1. reject

0. 틀린 이유

당신의 코드가 잘못된 이유는 `results.append(line[start+1:i])`에서 `+1`을 하는 방식이 잘못되었기 때문입니다. 이 부분이 줄의 특정 문자를 잘못 건너뛰고 있습니다. 실제로는 괄호 안의 내용을 완전히 포함해야 하며, `+1`을 제거하여 `results.append(line[start:i])`로 수정해야 합니다.

1. 질문

중첩된 괄호 안의 문자열을 제외하고 바깥 괄호의 문자열만 추출하려면 `+1`을 제거해야 합니다. 이것이 중첩된 괄호를 무시하고 올바른 추출을 보장하는 열쇠입니다.

2. 잘못된 코드

문제의 핵심은 `stack`에서 아이템을 pop할 때, stack이 비어 있을 수 있다는 점입니다. 이 경우 stack의 최상단을 참조하려고 하면 오류가 발생할 수 있습니다. 따라서, 스택이 비어 있는지 확인하는 것이 중요합니다.

```python
def extract_contents(line):
    opener = {'(': ')', '{': '}', '[': ']'}
    closer = {v: k for k, v in opener.items()}

    stack = []
    results = []

    for i, ch in enumerate(line):
        if ch in opener:
            stack.append((ch, i))
        elif ch in closer:
            if stack and stack[-1][0] == closer[ch]:
                open_char, start = stack.pop()
                # 여기가 문제입니다! `+1`이 잘못된 방식으로 사용되고 있습니다.
                results.append(line[start:i])  # `+1`을 제거하세요.

    return results
```

이렇게 하면 문제가 해결될 것입니다! `+1`을 제거하는 것은 매우 중요한 단계이며, 올바른 내용을 보장합니다. 이상적으로 코드의 특정 부분이 잘못된 것으로 식별되었고, 그것을 수정함으로써 문제를 해결할 수 있습니다.

2. chosen

이전에 제공된 잘못된 답변은 문제의 핵심을 잘못 이해하고 있었습니다. 문제의 요구사항은 중�


> _output;

		public ConvertChannel(Channel<TOutput> output)
			: this(output, CreateDefaultConverter())
		{
		}

		public ConvertChannel(Channel<TOutput> output, MessageConverter<TInput, TOutput> converter)
		{
			_output = output;
			_converter = converter;
		}

		public MessageConverter<TInput, TOutput> Converter
		{
			get { return _converter; }
		}

		public Channel<TOutput> Output
		{
			get { return _output; }
		}

		public void Send(TInput message)
		{
			_output.Send(_converter(message));
		}

		static MessageConverter<TInput, TOutput> CreateDefaultConverter()
		{
			if (_defaultConverter != null)
				return _defaultConverter;

			Type inputType = typeof(TInput);
			Type outType = typeof(TOutput);

			ParameterExpression input = Expression.Parameter(inputType, "input");
			UnaryExpression body;
			if (inputType.IsValueType)
				body = Expression.Convert(input, outType);
			else
				body = Expression.TypeAs(input, outType);

			var lambda = Expression.Lambda<MessageConverter<TInput, TOutput>>(body, input);

			_defaultConverter = lambda.Compile();

			return _defaultConverter;
		}
	}
}


error_string().str;

  ret = rcl_lexer_lookahead2_fini(&buffer);
  ASSERT_EQ(RCL_RET_OK, ret) << rcl_get_error_string().str;

  ret = rcl_lexer_lookahead2_fini(&buffer);
  EXPECT_EQ(RCL_RET_INVALID_ARGUMENT, ret);
  rcl_reset_error();
}

TEST(TestLexerLookahead, test_init_not_zero_initialized)
{
  rcl_lexer_lookahead2_t buffer;
  int not_zero = 1;
  buffer.impl = reinterpret_cast<struct rcl_lexer_lookahead2_impl_s *>(&not_zero);
  rcl_ret_t ret = rcl_lexer_lookahead2_init(&buffer, "foobar", rcl_get_default_allocator());
  EXPECT_EQ(RCL_RET_INVALID_ARGUMENT, ret);
  rcl_reset_error();
}

TEST(TestLexerLookahead, test_peek)
{
  rcl_ret_t ret;
  rcl_lexer_lookahead2_t buffer;
  SCOPE_LOOKAHEAD2(buffer, "foobar");

  rcl_lexeme_t lexeme = RCL_LEXEME_NONE;

  ret = rcl_lexer_lookahead2_peek(&buffer, &lexeme);
  EXPECT_EQ(RCL_RET_OK, ret);
  EXPECT_EQ(RCL_LEXEME_TOKEN, lexeme);

  // Test again to make sure peek isn't advancing the lexer
  lexeme = RCL_LEXEME_NONE;
  ret = rcl_lexer_lookahead2_peek(&buffer, &lexeme);
  EXPECT_EQ(RCL_RET_OK, ret);
  EXPECT_EQ(RCL_LEXEME_TOKEN, lexeme);
}

TEST(TestLexerLookahead, test_peek2)
{
  rcl_ret_t ret;
  rcl_lexer_lookahead2_t buffer;
  SCOPE_LOOKAHEAD2(buffer, "foobar/");

  rcl_lexeme_t lexeme1 = RCL_LEXEME_NONE;
  rcl_lexeme_t lexeme2 = RCL_LEXEME_NONE;

  ret = rcl_lexer_lookahead2_peek2(&buffer, &lexeme1, &lexeme2);
  EXPECT_EQ(RCL_RET_OK, ret) << rcl_get_error_string().str;
  EXPECT_EQ(RCL_LEXEME_TOKEN, lexeme1);
  EXPECT_EQ(RCL_LEXEME_FORWARD_SLASH, lexeme2);

  // Test again to make sure peek2 isn't advancing the lexer
  lexeme1 = RCL_LEXEME_NONE;
  lexeme2 = RCL_LEXEME_NONE;
  ret = rcl_lexer_lookahead2_peek2(&buffer, &lexeme1, &lexeme2);
  EXPECT_EQ(RCL_RET_OK, ret) << rcl_get_error_string().str;
  EXPECT_EQ(RCL_LEXEME_TOKEN, lexeme1);
  EXPECT_EQ(RCL_LEXEME_FORWARD_SLASH, lexeme2);
}

TEST(TestLexerLookahead, test_peek2_no_lexeme)
{
  rcl_ret_t ret;
  rcl_lexer_lookahead2_t buffer;
  SCOPE_LOOKAHEAD2(buffer, "~foo");

  rcl_lexeme_t lexeme1 = RCL_LEXEME_NONE;
  rcl_lexeme_t lexeme2 = RCL_LEXEME_NONE;

  ret = rcl_lexer_lookahead2_peek2(&buffer, &lexeme1, &lexeme2);
  E


"""
Area of Responsibility: Notifications
- Register notification-specific subscriptions or schemas here.
- Notifications are a schema/extension of the subscription model.
- Document notification schemas for discoverability and LLM/agent use.
"""

def register_notifications(server):
    """
    Register notification-specific subscriptions or schemas with the FastMCP server instance.
    """
    @server.subscription(
        name="demo_notification",
        description="Demo notification that emits a message and priority."
    )
    def demo_notification_handler(message: str = "Test notification", priority: str = "low") -> dict:
        """
        Demo notification event handler that emits a notification with message and priority.
        Args:
            message (str): Notification message.
            priority (str): Notification priority (low, medium, high, critical).
        Returns:
            dict: Notification event.
        """
        return {
            "type": "notification",
            "message": message,
            "priority": priority,
        }


 1230302, "Manaforged Titan", 0.0, 100.0, "Tank2"},
		{212.49, "UNIT_SPELLCAST_STOP", "nameplate3", "Cast-3-1-2810-2-1230302-0000000222", 1230302, "Manaforged Titan", 0.0, 100.0, "Tank2"},
		{212.49, "UNIT_SPELLCAST_STOP", "target", "Cast-3-1-2810-2-1230302-0000000222", 1230302, "Manaforged Titan", 0.0, 100.0, "Tank2"},
		{212.50, "UNIT_SPELLCAST_CHANNEL_STOP", "boss1", "nil", 1232327, "Nexus-King Salhadaar", 41.3, 0.0, "??"},
		{212.50, "COMBAT_LOG_EVENT_UNFILTERED", "SPELL_AURA_REMOVED", "Creature-0-1-2810-1-237763-0000000001", "Nexus-King Salhadaar", 0xa48, 0x0, "Creature-0-1-2810-1-237763-0000000001", "Nexus-King Salhadaar", 0xa48, 0x0, 1228284, "Royal Ward", 0x0, "BUFF"},
		{212.50, "COMBAT_LOG_EVENT_UNFILTERED", "SPELL_AURA_REMOVED", "Vehicle-0-1-2810-1-233823-0000000038", "The Royal Voidwing", 0xa48, 0x0, "Vehicle-0-1-2810-1-233823-0000000038", "The Royal Voidwing", 0xa48, 0x0, 1228284, "Royal Ward", 0x0, "BUFF"},
		{212.51, "UNIT_TARGET", "boss1", "Nexus-King Salhadaar", "Target: ??", "TargetOfTarget: ??"},
		{212.51, "COMBAT_LOG_EVENT_UNFILTERED", "UNIT_DIED", "", nil, 0x0, 0x0, "Creature-0-1-2810-1-241800-000000004C", "Manaforged Titan", 0xa48, 0x0, -1, false, 0x0},
		{212.52, "UNIT_TARGET", "boss2", "The Royal Voidwing", "Target: ??", "TargetOfTarget: ??"},
		{212.58, "UNIT_TARGET", "nameplate3", "Manaforged Titan", "Target: ??", "TargetOfTarget: ??"},
		{212.97, "UNIT_SPELLCAST_START", "boss4", "Cast-3-1-2810-2-1230263-0000000201", 1230263, "Nexus-Prince Xevvos", 20.9, 0.0, "??"},
		{212.93, "COMBAT_LOG_EVENT_UNFILTERED", "SPELL_DAMAGE", "Creature-0-1-2810-1-237763-0000000001", "Nexus-King Salhadaar", 0xa48, 0x0, "", nil, 0x0, 0x0, 1224825, "Tyranny", 0x0},
		{212.97, "COMBAT_LOG_EVENT_UNFILTERED", "SPELL_CAST_START", "Creature-0-1-2810-1-241798-0000000049", "Nexus-Prince Xevvos", 0xa48, 0x0, "", nil, 0x0, 0x0, 1230263, "Netherblast", 0x0},
		{212.97, "UNIT_SPELLCAST_SUCCEEDED", "boss4", "Cast-3-1-2810-2-1230261-0000000200", 1230261, "Nexus-Prince Xevvos", 20.9, 0.0, "??"},
		{212.98, "UNIT_TARGET", "boss4", "Nexus-Prince Xevvos", "Target: ??", "TargetOfTarget: ??"},
		{212.98, "COMBAT_LOG_EVENT_UNFILTERED", "SWING_MISSED", "Creat


�張子が `.csv` の各ブロブに対して、83-99 行に定義された `download_csv` 関数を使用してブロブの内容を取得し、ローカルファイルに書き込みます。

7. **グラフデータベースの作成と読み込み** (38-51 行): `factory` の `load` メソッドは以下を行います:

   1. `vendor_graph` という名前のグラフを作成します。
   2. 頂点（ノード）のデータとラベルを定義し、ノードをグラフに挿入します。
   3. ラベルを使用してエッジを指定し、ノード間の関係を確立するために挿入します。

8. **メインガードの定義** (101-108 行): メインガードは、`graph_loader` が直接呼び出されたときにどのように実行されるかを定義します。このコードブロックにより、コマンドラインまたは VS Code のデバッグセッションからスクリプトを実行できます。

## `.env` ファイルの更新

`graph_loader.py` ファイルは、Azure Database for PostgreSQL フレキシブルサーバーインスタンス、Entra ID ユーザー名、および CSV ファイルを取得するストレージアカウントに関する情報を取得するために環境変数を参照します。グラフローダースクリプトを実行する前に、これらの値でプロジェクトの `.env` ファイルを更新する必要があります。`.env` ファイルはリポジトリの `src\api\app` フォルダにあります。

1. VS Code で、**Explorer** パネルの `src\api\app` フォルダに移動します。

2. `.env` ファイルを開き、次の行を追加します:

    !!! danger "`.env` ファイルを更新してください！"

    ```ini title=""
    ENTRA_ID_USERNAME="{YOUR_ENTRA_ID_USERNAME}"
    POSTGRESQL_SERVER_NAME="{YOUR_POSTGRESQL_SERVER_NAME}"
    STORAGE_ACCOUNT_NAME="{YOUR_STORAGE_ACCOUNT_NAME}"
    ```

    ???+ tip "必要な値を取得するための手順に従ってください"

        1. `ENTRA_ID_USERNAME` 変数の値にある `{YOUR_ENTRA_ID_USERNAME}` トークンを、使用しているソリューションアクセラレータのアカウントのメールアドレスである Microsoft Entra ID に置き換えます。

        2. `{YOUR_POSTGRESQL_SERVER_NAME}` トークンを PostgreSQL サーバーの名前に置き換えます。サーバー名を取得するには:

1. [Azure portal](https://portal.azure.com/)でAzure Database for PostgreSQLフレキシブルサーバーリソースに移動します。

2. PostgreSQLフレキシブルサーバーの**概要**ページの**基本情報**パネルで、**サーバー名**の値をコピーし、それを`.env`ファイルに`POSTGRESQL_SERVER_NAME`の値として貼り付けます。


: [0xc5,0x35,0xeb,0x4c,0x02,0x40]
vpor 64(%rdx,%rax), %ymm9, %ymm9

// CHECK: vpor 64(%rdx), %ymm7, %ymm7
// CHECK: encoding: [0xc5,0xc5,0xeb,0x7a,0x40]
vpor 64(%rdx), %ymm7, %ymm7

// CHECK: vpor 64(%rdx), %ymm9, %ymm9
// CHECK: encoding: [0xc5,0x35,0xeb,0x4a,0x40]
vpor 64(%rdx), %ymm9, %ymm9

// CHECK: vpor (%rdx), %ymm7, %ymm7
// CHECK: encoding: [0xc5,0xc5,0xeb,0x3a]
vpor (%rdx), %ymm7, %ymm7

// CHECK: vpor (%rdx), %ymm9, %ymm9
// CHECK: encoding: [0xc5,0x35,0xeb,0x0a]
vpor (%rdx), %ymm9, %ymm9

// CHECK: vpor %ymm7, %ymm7, %ymm7
// CHECK: encoding: [0xc5,0xc5,0xeb,0xff]
vpor %ymm7, %ymm7, %ymm7

// CHECK: vpor %ymm9, %ymm9, %ymm9
// CHECK: encoding: [0xc4,0x41,0x35,0xeb,0xc9]
vpor %ymm9, %ymm9, %ymm9

// CHECK: vpsadbw 485498096, %ymm7, %ymm7
// CHECK: encoding: [0xc5,0xc5,0xf6,0x3c,0x25,0xf0,0x1c,0xf0,0x1c]
vpsadbw 485498096, %ymm7, %ymm7

// CHECK: vpsadbw 485498096, %ymm9, %ymm9
// CHECK: encoding: [0xc5,0x35,0xf6,0x0c,0x25,0xf0,0x1c,0xf0,0x1c]
vpsadbw 485498096, %ymm9, %ymm9

// CHECK: vpsadbw -64(%rdx,%rax,4), %ymm7, %ymm7
// CHECK: encoding: [0xc5,0xc5,0xf6,0x7c,0x82,0xc0]
vpsadbw -64(%rdx,%rax,4), %ymm7, %ymm7

// CHECK: vpsadbw 64(%rdx,%rax,4), %ymm7, %ymm7
// CHECK: encoding: [0xc5,0xc5,0xf6,0x7c,0x82,0x40]
vpsadbw 64(%rdx,%rax,4), %ymm7, %ymm7

// CHECK: vpsadbw -64(%rdx,%rax,4), %ymm9, %ymm9
// CHECK: encoding: [0xc5,0x35,0xf6,0x4c,0x82,0xc0]
vpsadbw -64(%rdx,%rax,4), %ymm9, %ymm9

// CHECK: vpsadbw 64(%rdx,%rax,4), %ymm9, %ymm9
// CHECK: encoding: [0xc5,0x35,0xf6,0x4c,0x82,0x40]
vpsadbw 64(%rdx,%rax,4), %ymm9, %ymm9

// CHECK: vpsadbw 64(%rdx,%rax), %ymm7, %ymm7
// CHECK: encoding:


m AHCLKX pin.
// 1 Internal transmit high-frequency clock source from output of programmable
// high clock divider.
	s.HCLKM = params.ahclkIsInternal;
// HCLKXP: Transmit bitstream high-frequency clock polarity select bit.
// 0 AHCLKX is not inverted before programmable bit clock divider. In the
// special case where the transmit bit clock (ACLKX) is internally generated
// and the programmable bit clock divider is set to divide-by-1 (CLKXDIV = 0 in
// ACLKXCTL), AHCLKX is directly passed through to the ACLKX pin.
// 1 AHCLKX is inverted before programmable bit clock divider. In the special
// case where the transmit bit clock (ACLKX) is internally generated and the
// programmable bit clock divider is set to divideby-1 (CLKXDIV = 0 in
// ACLKXCTL), AHCLKX is directly passed through to the ACLKX pin.
	s.HCLKP = 0;
// HCLKXDIV: 0-FFFh Transmit high-frequency clock divide ratio bits determine the divide-down ratio from AUXCLK to
// AHCLKX.
// 0 Divide-by-1.
// 1h Divide-by-2.
// 2h-FFFh Divide-by-3 to divide-by-4096.
	unsigned int hclkdiv;
	if(params.ahclkIsInternal)
	{
		unsigned int div;
		getValidAhclk(params.ahclkFreq, &div);
		hclkdiv = div - 1;
	} else {
		hclkdiv = 0;
	}
	s.HCLKDIV = hclkdiv;
	memcpy(&regs.ahclkxctl, &s, sizeof(regs.ahclkxctl));
	regs.ahclkrctl = regs.ahclkxctl;
	return 0;
}

int McaspConfig::setPdir()
{
	struct {
		unsigned AXR : 6;
		unsigned : 19;
		unsigned AMUTE : 1;
		unsigned ACLKX : 1;
		unsigned AHCLKX : 1;
		unsigned AFSX : 1;
		unsigned ACLKR : 1;
		unsigned AHCLKR : 1;
		unsigned AFSR : 1;
	} s = {0};
// AFSR: Determines if AFSR pin functions as an input or output.
// 0 Pin functions as input.
// 1 Pin functions as output.
	s.AFSR = 0; // we ignore this because we always use the AFSX signal instead
// AHCLKR: Determines if AHCLKR pin functions as an input or output.
// 0 Pin functions as input.
// 1 Pin functions as output.
	s.AHCLKR = 0;
// ACLKR: Determines if ACLKR pin functions as an input or output.
// 0 Pin functions as input.
// 1 Pin functions as output.
	s.ACLKR = params.aclkIsInternal;
// AFSX: Determines if AFSX pin functions as an input or output.
// 0 Pin functions as input.
// 1 Pin functions as output.
	s.AFSX = params.wclkIsInternal;
// AHCLKX: Determines if AHCLKX pin functions as an input or output.
// 0 Pin functions as input.
// 1 Pin functions as output.
	s.AHCLKX = params.ahclkIsInternal;
	if(!params.ahclkIsInternal)
	{
		throw std::runtime_error("McASP: external ahclk is unsupported\n"); //TODO: not sure where else we nned to make changes to support it.
	}
// ACLKX: Determines if ACLKX pin functions as an input or output.
// 0 Pin functions as input.
// 1 Pin functions as output.
	s.ACLKX = s.ACLKR;
// AMUTE: Determines if AMUTE pin functions as an input or output.
// 0 Pin functions as input.
// 1 Pin functions as output.
	s.AMUTE = 0;
// AXR[5-0]: Determines if AXRn pin functions as an input or output.
// 0 Pin functions as input.
// 1 Pin functions as output
	uint8_t axr = 0;