file_path
stringlengths
3
280
file_language
stringclasses
66 values
content
stringlengths
1
1.04M
repo_name
stringlengths
5
92
repo_stars
int64
0
154k
repo_description
stringlengths
0
402
repo_primary_language
stringclasses
108 values
developer_username
stringlengths
1
25
developer_name
stringlengths
0
30
developer_company
stringlengths
0
82
translation/fairseq/modules/linearized_convolution.py
Python
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. import torch import torch.nn.funct...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/fairseq/modules/multihead_attention.py
Python
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. import torch from torch import nn ...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/fairseq/modules/scalar_bias.py
Python
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. # import torch class ScalarBias(...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/fairseq/modules/sinusoidal_positional_embedding.py
Python
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. import math import torch import t...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/fairseq/multiprocessing_pdb.py
Python
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. import multiprocessing import os i...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/fairseq/optim/__init__.py
Python
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. import importlib import os from ....
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/fairseq/optim/adagrad.py
Python
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. import torch.optim from . import ...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/fairseq/optim/adam.py
Python
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. import math import torch import to...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/fairseq/optim/fairseq_optimizer.py
Python
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. import math import torch class ...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/fairseq/optim/fp16_optimizer.py
Python
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. import torch from fairseq import ...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/fairseq/optim/lr_scheduler/__init__.py
Python
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. import importlib import os from ....
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/fairseq/optim/lr_scheduler/cosine_lr_scheduler.py
Python
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. import math from . import Fairseq...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/fairseq/optim/lr_scheduler/fairseq_lr_scheduler.py
Python
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. from .. import FairseqOptimizer ...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/fairseq/optim/lr_scheduler/fixed_schedule.py
Python
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. from . import FairseqLRScheduler, ...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/fairseq/optim/lr_scheduler/inverse_square_root_schedule.py
Python
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. from . import FairseqLRScheduler, ...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/fairseq/optim/lr_scheduler/reduce_lr_on_plateau.py
Python
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. import torch.optim.lr_scheduler f...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/fairseq/optim/lr_scheduler/triangular_lr_scheduler.py
Python
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. import math from . import Fairseq...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/fairseq/optim/nag.py
Python
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. from torch.optim.optimizer import ...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/fairseq/optim/sgd.py
Python
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. import torch.optim from . import ...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/fairseq/options.py
Python
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. import argparse import torch fro...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/fairseq/progress_bar.py
Python
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. """ Wrapper around various loggers...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/fairseq/search.py
Python
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. import torch class Search(object...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/fairseq/sequence_generator.py
Python
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. import math import torch from fa...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/fairseq/sequence_scorer.py
Python
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. import torch from fairseq import ...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/fairseq/tasks/__init__.py
Python
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. import argparse import importlib i...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/fairseq/tasks/fairseq_task.py
Python
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. from fairseq.data import data_util...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/fairseq/tasks/language_modeling.py
Python
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. import itertools import numpy as n...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/fairseq/tasks/translation.py
Python
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. import itertools import numpy as n...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/fairseq/tokenizer.py
Python
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. from collections import Counter im...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/fairseq/trainer.py
Python
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. """ Train a network across multipl...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/fairseq/utils.py
Python
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. from collections import defaultdic...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/generate.py
Python
#!/usr/bin/env python3 -u # Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. """ Trans...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/interactive.py
Python
#!/usr/bin/env python3 -u # Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. """ Trans...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/macaron-scripts/data-preprocessing/prepare-iwslt14.sh
Shell
#!/usr/bin/env bash # # Adapted from https://github.com/facebookresearch/MIXER/blob/master/prepareData.sh echo 'Cloning Moses github repository (for tokenization scripts)...' git clone https://github.com/moses-smt/mosesdecoder.git echo 'Cloning Subword NMT repository (for BPE pre-processing)...' git clone https://git...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/macaron-scripts/data-preprocessing/prepare-wmt14en2de.sh
Shell
#!/usr/bin/env bash # Adapted from https://github.com/pytorch/fairseq/blob/v0.6.0/examples/translation/prepare-wmt14en2de.sh echo 'Cloning Moses github repository (for tokenization scripts)...' git clone https://github.com/moses-smt/mosesdecoder.git echo 'Cloning Subword NMT repository (for BPE pre-processing)...' gi...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/macaron-scripts/test/test-iwslt14.sh
Shell
#!/usr/bin/env bash CODE_PATH=. cd $CODE_PATH export PYTHONPATH=$CODE_PATH:$PYTHONPATH PROBLEM=iwslt14_de_en ARCH=transformer_iwslt_de_en_macaron_v2 BEAM_SIZE=5 LPEN=1.0 DATA_PATH=data-bin/iwslt14.tokenized.de-en.joined/ MOSES_PATH=macaron-scripts/data-preprocessing/mosesdecoder OUTPUT_PATH=log/$PROBLEM/$ARCH TRANS_...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/macaron-scripts/test/test-wmt14-base.sh
Shell
#!/usr/bin/env bash CODE_PATH=. cd $CODE_PATH export PYTHONPATH=$CODE_PATH:$PYTHONPATH PROBLEM=wmt14_en_de ARCH=transformer_wmt_en_de_macaron_v2 SRC=en TGT=de BEAM_SIZE=4 LPEN=0.6 DATA_PATH=data-bin/wmt14_en_de_joined_dict TEST_DATA_PATH=$DATA_PATH/raw-test MOSES_PATH=macaron-scripts/data-preprocessing/mosesdecoder ...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/macaron-scripts/test/test-wmt14-big.sh
Shell
#!/usr/bin/env bash CODE_PATH=. cd $CODE_PATH export PYTHONPATH=$CODE_PATH:$PYTHONPATH PROBLEM=wmt14_en_de ARCH=transformer_wmt_en_de_big_t2t_macaron SRC=en TGT=de BEAM_SIZE=4 LPEN=0.6 DATA_PATH=data-bin/wmt14_en_de_joined_dict TEST_DATA_PATH=$DATA_PATH/raw-test MOSES_PATH=macaron-scripts/data-preprocessing/mosesdec...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/macaron-scripts/train/train-iwslt14.sh
Shell
#!/usr/bin/env bash CODE_PATH=. cd $CODE_PATH export PYTHONPATH=$CODE_PATH:$PYTHONPATH model=transformer PROBLEM=iwslt14_de_en ARCH=transformer_iwslt_de_en_macaron_v2 DATA_PATH=data-bin/iwslt14.tokenized.de-en.joined/ OUTPUT_PATH=log/$PROBLEM/$ARCH mkdir -p $OUTPUT_PATH python train.py $DATA_PATH \ --seed 1 \ --...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/macaron-scripts/train/train-wmt14-base.sh
Shell
#!/usr/bin/env bash CODE_PATH=. cd $CODE_PATH export PYTHONPATH=$CODE_PATH:$PYTHONPATH model=transformer PROBLEM=wmt14_en_de ARCH=transformer_wmt_en_de_macaron_v2 DATA_PATH=data-bin/wmt14_en_de_joined_dict/ OUTPUT_PATH=log/$PROBLEM/$ARCH mkdir -p $OUTPUT_PATH # Assume training on 4 P40 GPUs. Change the --max-tokens...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/macaron-scripts/train/train-wmt14-big-distributed.sh
Shell
#!/usr/bin/env bash CODE_PATH=. cd $CODE_PATH export PYTHONPATH=$CODE_PATH:$PYTHONPATH model=transformer PROBLEM=wmt14_en_de ARCH=transformer_wmt_en_de_big_t2t_macaron DATA_PATH=data-bin/wmt14_en_de_joined_dict/ OUTPUT_PATH=log/$PROBLEM/$ARCH mkdir -p $OUTPUT_PATH # Example usage with 8 * 4 = 32 P40 GPUs. Change th...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/macaron-scripts/train/train-wmt14-big.sh
Shell
#!/usr/bin/env bash CODE_PATH=. cd $CODE_PATH export PYTHONPATH=$CODE_PATH:$PYTHONPATH model=transformer PROBLEM=wmt14_en_de ARCH=transformer_wmt_en_de_big_t2t_macaron DATA_PATH=data-bin/wmt14_en_de_joined_dict/ OUTPUT_PATH=log/$PROBLEM/$ARCH mkdir -p $OUTPUT_PATH # Assume training on 4 P40 GPUs. Change the --max-t...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/multiprocessing_train.py
Python
#!/usr/bin/env python3 -u # Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. import o...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/preprocess.py
Python
#!/usr/bin/env python3 # Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. """ Data pre...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/score.py
Python
#!/usr/bin/env python3 # Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. """ BLEU sco...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/scripts/average_checkpoints.py
Python
#!/usr/bin/env python3 import argparse import collections import torch import os import re def average_checkpoints(inputs): """Loads checkpoints from inputs and returns a model with averaged weights. Args: inputs: An iterable of string paths of checkpoints to load from. Returns: A dict of s...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/scripts/build_sym_alignment.py
Python
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. # """ Use this script in order to ...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/scripts/convert_dictionary.lua
Lua
-- Copyright (c) 2017-present, Facebook, Inc. -- All rights reserved. -- -- This source code is licensed under the license found in the LICENSE file in -- the root directory of this source tree. An additional grant of patent rights -- can be found in the PATENTS file in the same directory. -- -- Usage: convert_dictiona...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/scripts/convert_model.lua
Lua
-- Copyright (c) 2017-present, Facebook, Inc. -- All rights reserved. -- -- This source code is licensed under the license found in the LICENSE file in -- the root directory of this source tree. An additional grant of patent rights -- can be found in the PATENTS file in the same directory. -- -- Usage: convert_model.lu...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/scripts/read_binarized.py
Python
#!/usr/bin/env python3 # Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. # import ar...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/setup.py
Python
#!/usr/bin/env python3 # Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. from setupt...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/tests/test_average_checkpoints.py
Python
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. import collections import os impor...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/tests/test_backtranslation_dataset.py
Python
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. import argparse import unittest i...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/tests/test_binaries.py
Python
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. import contextlib from io import S...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/tests/test_character_token_embedder.py
Python
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. import torch import unittest from...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/tests/test_convtbc.py
Python
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. import torch import unittest from ...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/tests/test_dictionary.py
Python
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. import tempfile import unittest i...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/tests/test_iterators.py
Python
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. import unittest from fairseq.data...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/tests/test_label_smoothing.py
Python
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. import argparse import copy import...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/tests/test_reproducibility.py
Python
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. import contextlib from io import S...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/tests/test_sequence_generator.py
Python
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. import argparse import unittest i...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/tests/test_sequence_scorer.py
Python
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. import argparse import unittest i...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/tests/test_train.py
Python
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. import contextlib from io import S...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/tests/test_utils.py
Python
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. import unittest import torch fro...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/tests/utils.py
Python
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. import argparse import torch from...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
translation/train.py
Python
#!/usr/bin/env python3 -u # Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. """ Train...
zhuohan123/macaron-net
147
Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View"
Python
zhuohan123
Zhuohan Li
vLLM / Meta
src/AssertableHtmlServiceProvider.php
PHP
<?php declare(strict_types=1); namespace Ziadoz\AssertableHtml; use Illuminate\Support\ServiceProvider; use Illuminate\Support\Traits\Macroable; use Illuminate\Testing\TestComponent; use Illuminate\Testing\TestResponse; use Illuminate\Testing\TestView; use Ziadoz\AssertableHtml\Mixins\TestComponentMixins; use Ziadoz...
ziadoz/assertable-html
4
Assertable HTML is an elegantly designed PHPUnit library that makes performing assertions on HTML responses from PHP and Laravel applications quick and enjoyable.
PHP
ziadoz
Jamie York
src/Concerns/Asserts/AssertsAttributesList.php
PHP
<?php declare(strict_types=1); namespace Ziadoz\AssertableHtml\Concerns\Asserts; use PHPUnit\Framework\Assert as PHPUnit; use Ziadoz\AssertableHtml\Support\Whitespace; trait AssertsAttributesList { /* |-------------------------------------------------------------------------- | Assert Attributes |--...
ziadoz/assertable-html
4
Assertable HTML is an elegantly designed PHPUnit library that makes performing assertions on HTML responses from PHP and Laravel applications quick and enjoyable.
PHP
ziadoz
Jamie York
src/Concerns/Asserts/AssertsClassesList.php
PHP
<?php declare(strict_types=1); namespace Ziadoz\AssertableHtml\Concerns\Asserts; use PHPUnit\Framework\Assert as PHPUnit; trait AssertsClassesList { /* |-------------------------------------------------------------------------- | Assert Class |--------------------------------------------------------...
ziadoz/assertable-html
4
Assertable HTML is an elegantly designed PHPUnit library that makes performing assertions on HTML responses from PHP and Laravel applications quick and enjoyable.
PHP
ziadoz
Jamie York
src/Concerns/Asserts/AssertsDocument.php
PHP
<?php declare(strict_types=1); namespace Ziadoz\AssertableHtml\Concerns\Asserts; use PHPUnit\Framework\Assert as PHPUnit; trait AssertsDocument { /* |-------------------------------------------------------------------------- | Assert Title |-----------------------------------------------------------...
ziadoz/assertable-html
4
Assertable HTML is an elegantly designed PHPUnit library that makes performing assertions on HTML responses from PHP and Laravel applications quick and enjoyable.
PHP
ziadoz
Jamie York
src/Concerns/Asserts/AssertsElement.php
PHP
<?php declare(strict_types=1); namespace Ziadoz\AssertableHtml\Concerns\Asserts; use PHPUnit\Framework\Assert as PHPUnit; use Ziadoz\AssertableHtml\Dom\AssertableAttributesList; use Ziadoz\AssertableHtml\Dom\AssertableClassesList; use Ziadoz\AssertableHtml\Dom\AssertableElement; use Ziadoz\AssertableHtml\Dom\Asserta...
ziadoz/assertable-html
4
Assertable HTML is an elegantly designed PHPUnit library that makes performing assertions on HTML responses from PHP and Laravel applications quick and enjoyable.
PHP
ziadoz
Jamie York
src/Concerns/Asserts/AssertsElementsList.php
PHP
<?php declare(strict_types=1); namespace Ziadoz\AssertableHtml\Concerns\Asserts; use OutOfBoundsException; use PHPUnit\Framework\Assert as PHPUnit; trait AssertsElementsList { /* |-------------------------------------------------------------------------- | Assert Elements |--------------------------...
ziadoz/assertable-html
4
Assertable HTML is an elegantly designed PHPUnit library that makes performing assertions on HTML responses from PHP and Laravel applications quick and enjoyable.
PHP
ziadoz
Jamie York
src/Concerns/Asserts/AssertsText.php
PHP
<?php declare(strict_types=1); namespace Ziadoz\AssertableHtml\Concerns\Asserts; use PHPUnit\Framework\Assert as PHPUnit; trait AssertsText { /* |-------------------------------------------------------------------------- | Assert Text |----------------------------------------------------------------...
ziadoz/assertable-html
4
Assertable HTML is an elegantly designed PHPUnit library that makes performing assertions on HTML responses from PHP and Laravel applications quick and enjoyable.
PHP
ziadoz
Jamie York
src/Concerns/AssertsMany.php
PHP
<?php declare(strict_types=1); namespace Ziadoz\AssertableHtml\Concerns; use PHPUnit\Framework\AssertionFailedError; trait AssertsMany { /** Perform many PHPUnit assertions in a callback, but capture any failures into a single exception. */ public function assertMany(callable $callback, ?string $message = n...
ziadoz/assertable-html
4
Assertable HTML is an elegantly designed PHPUnit library that makes performing assertions on HTML responses from PHP and Laravel applications quick and enjoyable.
PHP
ziadoz
Jamie York
src/Concerns/IdentifiesElement.php
PHP
<?php declare(strict_types=1); namespace Ziadoz\AssertableHtml\Concerns; use Dom\Element; use Ziadoz\AssertableHtml\Support\Whitespace; trait IdentifiesElement { /** Return a simple identifying selector for the given element (e.g. p#foo.bar.baz) */ public function identifier(): string { return i...
ziadoz/assertable-html
4
Assertable HTML is an elegantly designed PHPUnit library that makes performing assertions on HTML responses from PHP and Laravel applications quick and enjoyable.
PHP
ziadoz
Jamie York
src/Concerns/Targetable.php
PHP
<?php declare(strict_types=1); namespace Ziadoz\AssertableHtml\Concerns; use Ziadoz\AssertableHtml\Dom\AssertableDocument; use Ziadoz\AssertableHtml\Dom\AssertableElement; use Ziadoz\AssertableHtml\Dom\AssertableElementsList; trait Targetable { /** * Scope the first assertable element within the current as...
ziadoz/assertable-html
4
Assertable HTML is an elegantly designed PHPUnit library that makes performing assertions on HTML responses from PHP and Laravel applications quick and enjoyable.
PHP
ziadoz
Jamie York
src/Concerns/Whenable.php
PHP
<?php declare(strict_types=1); namespace Ziadoz\AssertableHtml\Concerns; trait Whenable { /** * Return a value if the given condition is true, otherwise return a default. * * @param callable(static $assertable): bool|bool $condition * @param callable(static $assertable): callable $callbac...
ziadoz/assertable-html
4
Assertable HTML is an elegantly designed PHPUnit library that makes performing assertions on HTML responses from PHP and Laravel applications quick and enjoyable.
PHP
ziadoz
Jamie York
src/Concerns/Withable.php
PHP
<?php declare(strict_types=1); namespace Ziadoz\AssertableHtml\Concerns; trait Withable { /** * Scope with the current assertable, mostly for readability purposes. * * @param callable(static $assertable): void $callback */ public function with(callable $callback): static { $...
ziadoz/assertable-html
4
Assertable HTML is an elegantly designed PHPUnit library that makes performing assertions on HTML responses from PHP and Laravel applications quick and enjoyable.
PHP
ziadoz
Jamie York
src/Contracts/PromotableAssertableElement.php
PHP
<?php declare(strict_types=1); namespace Ziadoz\AssertableHtml\Contracts; use Dom\Element; use Dom\HTMLElement; interface PromotableAssertableElement { /** Return if the HTML element should be promoted by this element-specific assertable element. */ public static function shouldPromote(HTMLElement|Element $...
ziadoz/assertable-html
4
Assertable HTML is an elegantly designed PHPUnit library that makes performing assertions on HTML responses from PHP and Laravel applications quick and enjoyable.
PHP
ziadoz
Jamie York
src/Dom/AssertableAttributesList.php
PHP
<?php declare(strict_types=1); namespace Ziadoz\AssertableHtml\Dom; use ArrayAccess; use Countable; use Dom\NamedNodeMap; use InvalidArgumentException; use IteratorAggregate; use OutOfBoundsException; use RuntimeException; use Traversable; use Ziadoz\AssertableHtml\Concerns\Asserts\AssertsAttributesList; use Ziadoz\...
ziadoz/assertable-html
4
Assertable HTML is an elegantly designed PHPUnit library that makes performing assertions on HTML responses from PHP and Laravel applications quick and enjoyable.
PHP
ziadoz
Jamie York
src/Dom/AssertableClassesList.php
PHP
<?php declare(strict_types=1); namespace Ziadoz\AssertableHtml\Dom; use ArrayAccess; use Countable; use Dom\TokenList; use InvalidArgumentException; use IteratorAggregate; use OutOfBoundsException; use RuntimeException; use Stringable; use Traversable; use Ziadoz\AssertableHtml\Concerns\Asserts\AssertsClassesList; ...
ziadoz/assertable-html
4
Assertable HTML is an elegantly designed PHPUnit library that makes performing assertions on HTML responses from PHP and Laravel applications quick and enjoyable.
PHP
ziadoz
Jamie York
src/Dom/AssertableDocument.php
PHP
<?php declare(strict_types=1); namespace Ziadoz\AssertableHtml\Dom; use Dom\Document; use Dom\HTMLDocument; use ErrorException; use PHPUnit\Framework\Assert as PHPUnit; use Ziadoz\AssertableHtml\Concerns\Asserts\AssertsDocument; use Ziadoz\AssertableHtml\Concerns\Targetable; use Ziadoz\AssertableHtml\Concerns\Whenab...
ziadoz/assertable-html
4
Assertable HTML is an elegantly designed PHPUnit library that makes performing assertions on HTML responses from PHP and Laravel applications quick and enjoyable.
PHP
ziadoz
Jamie York
src/Dom/AssertableElement.php
PHP
<?php declare(strict_types=1); namespace Ziadoz\AssertableHtml\Dom; use Dom\Element; use Dom\HTMLElement; use PHPUnit\Framework\Assert as PHPUnit; use Ziadoz\AssertableHtml\Concerns\Asserts\AssertsElement; use Ziadoz\AssertableHtml\Concerns\IdentifiesElement; use Ziadoz\AssertableHtml\Concerns\Targetable; use Ziadoz...
ziadoz/assertable-html
4
Assertable HTML is an elegantly designed PHPUnit library that makes performing assertions on HTML responses from PHP and Laravel applications quick and enjoyable.
PHP
ziadoz
Jamie York
src/Dom/AssertableElementPromoter.php
PHP
<?php declare(strict_types=1); namespace Ziadoz\AssertableHtml\Dom; use Dom\Element; use Dom\HTMLElement; use Ziadoz\AssertableHtml\Contracts\PromotableAssertableElement; use Ziadoz\AssertableHtml\Dom\Elements\AssertableForm; final readonly class AssertableElementPromoter { private const array CUSTOM_ELEMENTS =...
ziadoz/assertable-html
4
Assertable HTML is an elegantly designed PHPUnit library that makes performing assertions on HTML responses from PHP and Laravel applications quick and enjoyable.
PHP
ziadoz
Jamie York
src/Dom/AssertableElementsList.php
PHP
<?php declare(strict_types=1); namespace Ziadoz\AssertableHtml\Dom; use ArrayAccess; use Countable; use Dom\Element; use Dom\HTMLCollection; use Dom\HTMLElement; use Dom\NodeList; use InvalidArgumentException; use IteratorAggregate; use OutOfBoundsException; use RuntimeException; use Traversable; use Ziadoz\Assertab...
ziadoz/assertable-html
4
Assertable HTML is an elegantly designed PHPUnit library that makes performing assertions on HTML responses from PHP and Laravel applications quick and enjoyable.
PHP
ziadoz
Jamie York
src/Dom/AssertableText.php
PHP
<?php declare(strict_types=1); namespace Ziadoz\AssertableHtml\Dom; use Stringable; use Ziadoz\AssertableHtml\Concerns\Asserts\AssertsText; use Ziadoz\AssertableHtml\Support\Whitespace; final readonly class AssertableText implements Stringable { use AssertsText; /** Create assertable text. */ public fu...
ziadoz/assertable-html
4
Assertable HTML is an elegantly designed PHPUnit library that makes performing assertions on HTML responses from PHP and Laravel applications quick and enjoyable.
PHP
ziadoz
Jamie York
src/Dom/Elements/AssertableForm.php
PHP
<?php declare(strict_types=1); namespace Ziadoz\AssertableHtml\Dom\Elements; use Dom\Element; use Dom\HTMLElement; use Ziadoz\AssertableHtml\Concerns\AssertsMany; use Ziadoz\AssertableHtml\Contracts\PromotableAssertableElement; use Ziadoz\AssertableHtml\Dom\AssertableElement; readonly class AssertableForm extends A...
ziadoz/assertable-html
4
Assertable HTML is an elegantly designed PHPUnit library that makes performing assertions on HTML responses from PHP and Laravel applications quick and enjoyable.
PHP
ziadoz
Jamie York
src/Exceptions/UnableToCreateAssertableDocument.php
PHP
<?php declare(strict_types=1); namespace Ziadoz\AssertableHtml\Exceptions; use Exception; class UnableToCreateAssertableDocument extends Exception { }
ziadoz/assertable-html
4
Assertable HTML is an elegantly designed PHPUnit library that makes performing assertions on HTML responses from PHP and Laravel applications quick and enjoyable.
PHP
ziadoz
Jamie York
src/Mixins/TestComponentMixins.php
PHP
<?php declare(strict_types=1); namespace Ziadoz\AssertableHtml\Mixins; use Closure; use Ziadoz\AssertableHtml\Dom\AssertableDocument; class TestComponentMixins { /** Return an assertable HTML element of the component. */ public function assertableHtml(): Closure { return function (int $options =...
ziadoz/assertable-html
4
Assertable HTML is an elegantly designed PHPUnit library that makes performing assertions on HTML responses from PHP and Laravel applications quick and enjoyable.
PHP
ziadoz
Jamie York
src/Mixins/TestResponseMixins.php
PHP
<?php declare(strict_types=1); namespace Ziadoz\AssertableHtml\Mixins; use Closure; use Symfony\Component\HttpFoundation\StreamedResponse; use Ziadoz\AssertableHtml\Dom\AssertableDocument; class TestResponseMixins { /** Get the response HTML content. */ public function getHtmlContent(): Closure { ...
ziadoz/assertable-html
4
Assertable HTML is an elegantly designed PHPUnit library that makes performing assertions on HTML responses from PHP and Laravel applications quick and enjoyable.
PHP
ziadoz
Jamie York
src/Mixins/TestViewMixins.php
PHP
<?php declare(strict_types=1); namespace Ziadoz\AssertableHtml\Mixins; use Closure; use Ziadoz\AssertableHtml\Dom\AssertableDocument; class TestViewMixins { /** Return an assertable HTML document of the view. */ public function assertableHtml(): Closure { return function (int $options = LIBXML_H...
ziadoz/assertable-html
4
Assertable HTML is an elegantly designed PHPUnit library that makes performing assertions on HTML responses from PHP and Laravel applications quick and enjoyable.
PHP
ziadoz
Jamie York
src/Support/Whitespace.php
PHP
<?php declare(strict_types=1); namespace Ziadoz\AssertableHtml\Support; class Whitespace { /** Normalise the whitespace of the given string. @link: https://github.com/symfony/symfony/pull/48940 */ public static function normalise(string $string): string { return trim(preg_replace("/[ \n\r\t\x0C]{...
ziadoz/assertable-html
4
Assertable HTML is an elegantly designed PHPUnit library that makes performing assertions on HTML responses from PHP and Laravel applications quick and enjoyable.
PHP
ziadoz
Jamie York
src/Traits/AssertsHtml.php
PHP
<?php declare(strict_types=1); namespace Ziadoz\AssertableHtml\Traits; use Ziadoz\AssertableHtml\Dom\AssertableDocument; trait AssertsHtml { /** Return a configured assertable HTML document. */ public function assertableHtml(string $html, int $options = 0, ?string $overrideEncoding = null): AssertableDocume...
ziadoz/assertable-html
4
Assertable HTML is an elegantly designed PHPUnit library that makes performing assertions on HTML responses from PHP and Laravel applications quick and enjoyable.
PHP
ziadoz
Jamie York
css/app.css
CSS
@layer reset, theme, layout; /* @link: https://www.joshwcomeau.com/css/custom-css-reset/ */ @layer reset { *, *::before, *::after { box-sizing: border-box; } * { margin: 0; } body { line-height: 1.5; -webkit-font-smoothing: antialiased; } img, pict...
ziadoz/utf8-to-bytes
2
A webpage that displays UTF-8 strings as individual bytes.
JavaScript
ziadoz
Jamie York
index.html
HTML
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>UTF-8 to Bytes</title> <link rel="icon" href="./favicon.ico" type="image/x-icon"> <link rel="stylesheet" href="./css/app.css"> <script type="importmap"> ...
ziadoz/utf8-to-bytes
2
A webpage that displays UTF-8 strings as individual bytes.
JavaScript
ziadoz
Jamie York
js/app.js
JavaScript
import CharToBytes from 'char-to-bytes'; import ready from 'ready'; import { strToChars } from 'utf8'; customElements.define('char-to-bytes', CharToBytes); // Render the results. const render = (query) => { const chars = strToChars(query); const output = document.querySelector('.results'); Array.from(doc...
ziadoz/utf8-to-bytes
2
A webpage that displays UTF-8 strings as individual bytes.
JavaScript
ziadoz
Jamie York
js/elements/char-to-bytes.js
JavaScript
import { binToDec, binToHex, byteToBin, charToBytes, charToName, parseBin, strToCodePoints } from 'utf8'; import { codePointToHex } from '../modules/utf8.mjs'; export default class CharToBytes extends HTMLElement { #char = ''; #charBin = ''; #charHex = ''; #charDec = ''; #charName = ''; #bytes ...
ziadoz/utf8-to-bytes
2
A webpage that displays UTF-8 strings as individual bytes.
JavaScript
ziadoz
Jamie York
js/modules/ready.mjs
JavaScript
// @see: https://javascript.info/onload-ondomcontentloaded export default function ready(callback) { if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', callback); } else { callback(); } }
ziadoz/utf8-to-bytes
2
A webpage that displays UTF-8 strings as individual bytes.
JavaScript
ziadoz
Jamie York
js/modules/utf8.mjs
JavaScript
// @link: https://www.unicode.org/Public/UCD/latest/ucd/UnicodeData.txt // @link: https://www.unicode.org/Public/emoji/latest/emoji-sequences.txt // @link: https://jakearchibald.com/2025/importing-vs-fetching-json/ import database from './database.json' with { type: 'json' }; // @link: https://stackoverflow.com/a/6230...
ziadoz/utf8-to-bytes
2
A webpage that displays UTF-8 strings as individual bytes.
JavaScript
ziadoz
Jamie York
public/electron.js
JavaScript
const url = require('url'); const http = require('http'); const path = require('path'); const { autoUpdater } = require('electron-updater'); const { app, BrowserWindow } = require('electron'); const { setMainMenu } = require('./menu'); let mainWindow; function createWindow() { mainWindow = new BrowserWindow({ ...
ziishaned/deployer
66
Cross-platform application to deploy your applications through Jenkins.
JavaScript
ziishaned
Zeeshan Ahmad