Bank code. See <a
href="http://es.wikipedia.org/w/index.php?title=CLABE&oldid=71482742#C.C3.B3digo_de_Banco">this</a> for an
incomplete list as of December, 2013.
2928
public Card bankCode(final Integer bankCode) {
        if (bankCode == null) {
            this.bankCode = null;
        } else {
            this.bankCode = String.format("%03d", bankCode);
        }
        return this;
    }
695728
def currencies(self):
        """"""
        return [m.currency.code for m in self.monies() if m.amount]
791899
public function getCodigoBancoComDv()
    {
        $codigoBanco = $this->getCodigoBanco();

        $semX = [BoletoContract::COD_BANCO_CEF];
        $x10 = in_array($codigoBanco, $semX) ? 0 : 'X';

        return $codigoBanco . '-' . Util::modulo11($codigoBanco, 2, 9, 0, $x10);
    }
571093
public function hashCode()
    {
        $validPk = null !== $this->getStructureNodeId() &&
            null !== $this->getParentId();

        $validPrimaryKeyFKs = 2;
        $primaryKeyFKs = [];

        //relation structure_node_parent_fk_node to table kk_trixionary_structure_node
        if ($this->aStructureNodeRelatedByStructureNodeId && $hash = spl_object_hash($this->aStructureNodeRelatedByStructureNodeId)) {
            $primaryKeyFKs[] = $hash;
        } else {
            $validPrimaryKeyFKs = false;
        }

        //relation structure_node_parent_fk_parent to table kk_trixionary_structure_node
        if ($this->aStructureNodeRelatedByParentId && $hash = spl_object_hash($this->aStructureNodeRelatedByParentId)) {
            $primaryKeyFKs[] = $hash;
        } else {
            $validPrimaryKeyFKs = false;
        }

        if ($validPk) {
            return crc32(json_encode($this->getPrimaryKey(), JSON_UNESCAPED_UNICODE));
        } elseif ($validPrimaryKeyFKs) {
            return crc32(json_encode($primaryKeyFKs, JSON_UNESCAPED_UNICODE));
        }

        return spl_object_hash($this);
    }
993924
public static function gerar()
    {
        $cpf = array ();
        for ($i = 0; $i < 9; $i++) {
            $cpf[$i] = rand(0, 9);
        }

        // Primeiro dígito
        $soma = 0;
        for ($i = 0; $i < 9; $i++) {
            $soma += ((10 - $i) * $cpf[$i]);
        }
        $d1 = 11 - ($soma % 11);
        if ($d1 >= 10) {
            $d1 = 0;
        }
        $cpf[9] = $d1;

        // Segundo Dígito
        $soma = 0;
        for ($i = 0; $i < 10; $i++) {
            $soma += ((11 - $i) * $cpf[$i]);
        }
        $d2 = 11 - ($soma % 11);
        if ($d2 >= 10) {
            $d2 = 0;
        }
        $cpf[10] = $d2;

        return static::formatar(implode("", $cpf));
    }
160913
public function hashCode()
    {
        $validPk = null !== $this->getCategoryId() &&
            null !== $this->getPageId();

        $validPrimaryKeyFKs = 2;
        $primaryKeyFKs = [];

        //relation c2p_fk_904832 to table category
        if ($this->aCategory && $hash = spl_object_hash($this->aCategory)) {
            $primaryKeyFKs[] = $hash;
        } else {
            $validPrimaryKeyFKs = false;
        }

        //relation c2p_fk_c9a38a to table page
        if ($this->aPage && $hash = spl_object_hash($this->aPage)) {
            $primaryKeyFKs[] = $hash;
        } else {
            $validPrimaryKeyFKs = false;
        }

        if ($validPk) {
            return crc32(json_encode($this->getPrimaryKey(), JSON_UNESCAPED_UNICODE));
        } elseif ($validPrimaryKeyFKs) {
            return crc32(json_encode($primaryKeyFKs, JSON_UNESCAPED_UNICODE));
        }

        return spl_object_hash($this);
    }
1370360
public static function reset() {
		$alnum = '[A-Fa-f0-9]';
		$class = get_called_class();
		Filters::clear($class);

		static::$_rules = [
			'alphaNumeric' => '/^[\p{Ll}\p{Lm}\p{Lo}\p{Lt}\p{Lu}\p{Nd}]+$/mu',
			'blank'        => '/[^\\s]/',
			'creditCard'   => [
				'amex'     => '/^3[4|7]\\d{13}$/',
				'bankcard' => '/^56(10\\d\\d|022[1-5])\\d{10}$/',
				'diners'   => '/^(?:3(0[0-5]|[68]\\d)\\d{11})|(?:5[1-5]\\d{14})$/',
				'disc'     => '/^(?:6011|650\\d)\\d{12}$/',
				'electron' => '/^(?:417500|4917\\d{2}|4913\\d{2})\\d{10}$/',
				'enroute'  => '/^2(?:014|149)\\d{11}$/',
				'jcb'      => '/^(3\\d{4}|2100|1800)\\d{11}$/',
				'maestro'  => '/^(?:5020|6\\d{3})\\d{12}$/',
				'mc'       => '/^5[1-5]\\d{14}$/',
				'solo'     => '/^(6334[5-9][0-9]|6767[0-9]{2})\\d{10}(\\d{2,3})?$/',
				'switch'   => '/^(?:49(03(0[2-9]|3[5-9])|11(0[1-2]|7[4-9]|8[1-2])|36[0-9]{2})' .
				              '\\d{10}(\\d{2,3})?)|(?:564182\\d{10}(\\d{2,3})?)|(6(3(33[0-4]' .
				              '[0-9])|759[0-9]{2})\\d{10}(\\d{2,3})?)$/',
				'visa'     => '/^4\\d{12}(\\d{3})?$/',
				'voyager'  => '/^8699[0-9]{11}$/',
				'fast'     => '/^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6011[0-9]{12}|3' .
				              '(?:0[0-5]|[68][0-9])[0-9]{11}|3[47][0-9]{13})$/'
			],
			'date'         => [
				'dmy'      => '%^(?:(?:31(\\/|-|\\.|\\x20)(?:0?[13578]|1[02]))\\1|(?:(?:29|30)' .
				              '(\\/|-|\\.|\\x20)(?:0?[1,3-9]|1[0-2])\\2))(?:(?:1[6-9]|[2-9]\\d)?' .
				              '\\d{2})$|^(?:29(\\/|-|\\.|\\x20)0?2\\3(?:(?:(?:1[6-9]|[2-9]\\d)?' .
				              '(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])' .
				              '00))))$|^(?:0?[1-9]|1\\d|2[0-8])(\\/|-|\\.|\\x20)(?:(?:0?[1-9])|' .
				              '(?:1[0-2]))\\4(?:(?:1[6-9]|[2-9]\\d)?\\d{2})$%',
				'mdy'      => '%^(?:(?:(?:0?[13578]|1[02])(\\/|-|\\.|\\x20)31)\\1|(?:(?:0?[13-9]|' .
				              '1[0-2])(\\/|-|\\.|\\x20)(?:29|30)\\2))(?:(?:1[6-9]|[2-9]\\d)?\\d' .
				              '{2})$|^(?:0?2(\\/|-|\\.|\\x20)29\\3(?:(?:(?:1[6-9]|[2-9]\\d)?' .
				              '(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])' .
				              '00))))$|^(?:(?:0?[1-9])|(?:1[0-2]))(\\/|-|\\.|\\x20)(?:0?[1-9]|1' .
				              '\\d|2[0-8])\\4(?:(?:1[6-9]|[2-9]\\d)?\\d{2})$%',
				'ymd'      => '%^(?:(?:(?:(?:(?:1[6-9]|[2-9]\\d)?(?:0[48]|[2468][048]|[13579]' .
				              '[26])|(?:(?:16|[2468][048]|[3579][26])00)))(\\/|-|\\.|\\x20)' .
				              '(?:0?2\\1(?:29)))|(?:(?:(?:1[6-9]|[2-9]\\d)?\\d{2})(\\/|-|\\.|' .
				              '\\x20)(?:(?:(?:0?[13578]|1[02])\\2(?:31))|(?:(?:0?[1,3-9]|1[0-2])' .
				              '\\2(29|30))|(?:(?:0?[1-9])|(?:1[0-2]))\\2(?:0?[1-9]|1\\d|2[0-8]' .
				              '))))$%',
				'dMy'      => '/^((31(?!\\ (Feb(ruary)?|Apr(il)?|June?|(Sep(?=\\b|t)t?|Nov)' .
				              '(ember)?)))|((30|29)(?!\\ Feb(ruary)?))|(29(?=\\ Feb(ruary)?\\ ' .
				              '(((1[6-9]|[2-9]\\d)(0[48]|[2468][048]|[13579][26])|((16|[2468]' .
				              '[048]|[3579][26])00)))))|(0?[1-9])|1\\d|2[0-8])\\ (Jan(uary)?|' .
				              'Feb(ruary)?|Ma(r(ch)?|y)|Apr(il)?|Ju((ly?)|(ne?))|Aug(ust)?|' .
				              'Oct(ober)?|(Sep(?=\\b|t)t?|Nov|Dec)(ember)?)\\ ((1[6-9]|[2-9]' .
				              '\\d)\\d{2})$/',
				'Mdy'      => '/^(?:(((Jan(uary)?|Ma(r(ch)?|y)|Jul(y)?|Aug(ust)?|Oct(ober)?' .
				              '|Dec(ember)?)\\ 31)|((Jan(uary)?|Ma(r(ch)?|y)|Apr(il)?|Ju((ly?)' .
				              '|(ne?))|Aug(ust)?|Oct(ober)?|(Sept|Nov|Dec)(ember)?)\\ (0?[1-9]' .
				              '|([12]\\d)|30))|(Feb(ruary)?\\ (0?[1-9]|1\\d|2[0-8]|(29(?=,?\\ ' .
				              '((1[6-9]|[2-9]\\d)(0[48]|[2468][048]|[13579][26])|((16|[2468]' .
				              '[048]|[3579][26])00)))))))\\,?\\ ((1[6-9]|[2-9]\\d)\\d{2}))$/',
				'My'       => '%^(Jan(uary)?|Feb(ruary)?|Ma(r(ch)?|y)|Apr(il)?|Ju((ly?)|(ne?))|' .
				              'Aug(ust)?|Oct(ober)?|(Sep(?=\\b|t)t?|Nov|Dec)(ember)?)\\ ((1[6-9]' .
				              '|[2-9]\\d)\\d{2})$%',
				'my'       => '%^(0?[1-9]|1[012])([- /.])((1[6-9])|([2-9]\\d)\\d{2})$%'
			],
			'ip' => function($value, $format = null, array $options = []) {
				$options += ['flags' => []];
				return (boolean) filter_var($value, FILTER_VALIDATE_IP, $options);
			},
			'money'        => [
				'right'    => '/^(?!0,?\d)(?:\d{1,3}(?:([, .])\d{3})?(?:\1\d{3})*|(?:\d+))' .
				              '((?!\1)[,.]\d{2})?(?<!\x{00a2})\p{Sc}?$/u',
				'left'     => '/^(?!\x{00a2})\p{Sc}?(?!0,?\d)(?:\d{1,3}(?:([, .])\d{3})?' .
				              '(?:\1\d{3})*|(?:\d+))((?!\1)[,.]\d{2})?$/u'
			],
			'notEmpty'     => '/[^\s]+/m',
			'phone'        => '/^\+?[0-9\(\)\-]{10,20}$/',
			'postalCode'   => '/(^|\A\b)[A-Z0-9\s\-]{5,}($|\b\z)/i',
			'regex'        => '/^(?:([^[:alpha:]\\\\{<\[\(])(.+)(?:\1))|(?:{(.+)})|(?:<(.+)>)|' .
			                  '(?:\[(.+)\])|(?:\((.+)\))[gimsxu]*$/',
			'time'         => '%^((0?[1-9]|1[012])(:[0-5]\d){0,2}([AP]M|[ap]m))$|^([01]\d|2[0-3])' .
			                  '(:[0-5]\d){0,2}$%',
			'boolean'      => function($value) {
				$bool = is_bool($value);
				$filter = filter_var($value, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE);
				return ($bool || $filter !== null || empty($value));
			},
			'decimal' => function($value, $format = null, array $options = []) {
				if (isset($options['precision'])) {
					$precision = strlen($value) - strrpos($value, '.') - 1;

					if ($precision !== (int) $options['precision']) {
						return false;
					}
				}
				return (filter_var($value, FILTER_VALIDATE_FLOAT, FILTER_NULL_ON_FAILURE) !== null);
			},
			'inList' => function($value, $format, $options) {
				$options += ['list' => []];
				$strict = is_bool($value) || $value === '';
				return in_array($value, $options['list'], $strict);
			},
			'lengthBetween' => function($value, $format, $options) {
				$length = strlen($value);
				$options += ['min' => 1, 'max' => 255];
				return ($length >= $options['min'] && $length <= $options['max']);
			},
			'luhn' => function($value) {
				if (empty($value) || !is_string($value)) {
					return false;
				}
				$sum = 0;
				$length = strlen($value);

				for ($position = 1 - ($length % 2); $position < $length; $position += 2) {
					$sum += $value[$position];
				}
				for ($position = ($length % 2); $position < $length; $position += 2) {
					$number = $value[$position] * 2;
					$sum += ($number < 10) ? $number : $number - 9;
				}
				return ($sum % 10 === 0);
			},
			'numeric' => function($value) {
				return is_numeric($value);
			},
			'inRange' => function($value, $format, $options) {
				$defaults = ['upper' => null, 'lower' => null];
				$options += $defaults;

				if (!is_numeric($value)) {
					return false;
				}
				switch (true) {
					case ($options['upper'] !== null && $options['lower'] !== null):
						return ($value >= $options['lower'] && $value <= $options['upper']);
					case ($options['upper'] !== null):
						return ($value <= $options['upper']);
					case ($options['lower'] !== null):
						return ($value >= $options['lower']);
				}
				return is_finite($value);
			},
			'uuid' => "/^{$alnum}{8}-{$alnum}{4}-{$alnum}{4}-{$alnum}{4}-{$alnum}{12}$/",
			'email' => function($value) {
				return filter_var($value, FILTER_VALIDATE_EMAIL);
			},
			'url' => function($value, $format = null, array $options = []) {
				$options += ['flags' => []];
				return (boolean) filter_var($value, FILTER_VALIDATE_URL, $options);
			}
		];

		$isEmpty = function($params, $next) {
			extract($params);
			return (empty($value) && $value !== '0') ? false : $next($params);
		};

		Filters::apply($class, 'alphaNumeric', $isEmpty);
		Filters::apply($class, 'notEmpty', $isEmpty);

		Filters::apply($class, 'creditCard', function($params, $next) {
			extract($params);
			$options += ['deep' => false];

			if (strlen($value = str_replace(['-', ' '], '', $value)) < 13) {
				return false;
			}
			$params['value'] = $value;

			if (!$next($params)) {
				return false;
			}
			return $options['deep'] ? Validator::isLuhn($value) : true;
		});

		Filters::apply($class, 'email', function($params, $next) {
			extract($params);

			$defaults = ['deep' => false];
			$options += $defaults;

			if (!$next($params)) {
				return false;
			}
			if (!$options['deep']) {
				return true;
			}
			list($prefix, $host) = explode('@', $params['value']);

			$mxhosts = [];
			if (getmxrr($host, $mxhosts)) {
				return is_array($mxhosts);
			}
			return false;
		});
	}
91531
final protected function cards() {
		$r = []; /** @var array(string => string) $r */
		$m = $this->m(); /** @var Method $m */
		/**
		 * 2017-07-28
		 * The `$m instanceof Method` check is for the «Square» module:
		 * its server part does not use the Df_StripeClone module, but the client part does use it.
		 * So we need this the `$m instanceof Method` check to evade the error:
		 * «Cannot instantiate abstract class Df\StripeClone\Facade\Customer
		 * in mage2pro/core/Payment/Facade.php:88»: https://github.com/mage2pro/square/issues/2
		 * 
		 * 2018-11-13
		 * Currently, in all modules except one (TBCBank) $customerData is just a customer identifier (a string).
		 * But out framework supports $customerData of artibutrary structure, and the TBCBank module uses it:
		 * $data has the following structure there:
		 *	{
		 *		"4349958401": {
		 *			"CARD_NUMBER": "5***********1223",
		 *			"RECC_PMNT_EXPIRY": "1019"
		 *		},
		 *		"1779958449": {
		 *			"CARD_NUMBER": "4***********3333",
		 *			"RECC_PMNT_EXPIRY": "1120"
		 *		}
		 *	}
		 * The top-level keys are bank card tokens there, 
		 * and their values form the corresponding bank card labels.
		 * So the TBCBank module (unlike the rest modules) does not do any API requests
		 * to retrieve a customer's saved cards.
		 */
		/** @var string|null|array(string => mixed) $customerData */
		if ($m instanceof Method && ($customerData = df_ci_get($this->m()))) {
			$this->s()->init();
			$fc = FCustomer::s($m); /** @var FCustomer $fc */
			// 2018-11-14 $customer is an array for TBCBank: it is the same as $customerData (see above).
			if (!($customer = $fc->get($customerData))/** @var object|array(string => mixed) $customer */) {
				// 2017-02-24
				// We could be here, for example, if the store's administrator has changed
				// his Stripe account in the module's settings: https://mage2.pro/t/3337
				df_ci_save($this->m(), null);
			}
			else {
				$r = array_map(function(Card $c) use($m) {
					/**
					 * 2017-07-24
					 * Unfortunately, the one-liner fails on PHP 5.6.30:
					 * return ['id' => $c->id(), 'label' => (CF::s($m, $c))->label()];
					 * «syntax error, unexpected '->' (T_OBJECT_OPERATOR), expecting ']'»
					 * https://github.com/mage2pro/core/issues/16
					 * See also: https://github.com/mage2pro/core/issues/15
					 *
					 * 2017-07-31
					 * Interestingly, the following code works on all PHP versions >= 5.4.0:
					 * class A {function f() {return __METHOD__;}
					 * echo (new A)->f();
					 * https://3v4l.org/nANqg
					 *
					 * The following code works on all PHP versions >= 5.0.0:
					 *	class A {
					 *		function f() {return __METHOD__;}
					 *		static function s() {return new self;}
					 *	}
					 *	echo A::s()->f();
					 * https://3v4l.org/1qr48
					 *
					 * The same is true for the following code:
					 *	class A {
					 *		function f() {return $this->_v;}
					 *		final protected function __construct($v) {$this->_v = $v;}
					 *		private $_v;
					 *		final static function s($v) {return new self($v);}
					 *	}
					 *	echo A::s('test')->f();
					 * https://3v4l.org/2E8H6
					 *
					 * So, I was unable to reproduce the issue...
					 * Maybe the problem customer uses a non-standard (patched) PHP version?
					 *
					 * 2017-11-08
					 * Note 1.
					 * One-liners like (!($e = $a->e())->b()) are really not supported by PHP < 7:
					 * https://3v4l.org/lJjvS
					 * Note 2.
					 * At the same time, some `))->` one-liners are supported by PHP >= 5.4, e.g:
					 * static function p() {return (new self())->b();}
					 * https://3v4l.org/LJlDE
					 * Note 3.
					 * If we add extra brackets to the code from the Note 2,
					 * then the code will be incompatible with PHP < 7:
					 * static function p() {return ((new self()))->b();}
					 */
					$cf = CF::s($m, $c); /** @var CF $cf */
					return ['id' => $c->id(), 'label' => $cf->label()];
				}, $fc->cardsActive($customer));
			}
		}
		// 2018-11-14
		// It is important, because otherwise this.cards.length will return `undefined` on frontend:
		// https://github.com/mage2pro/core/blob/3.11.1/Payment/view/frontend/web/card.js#L207
		return array_values($r);
	}
459324
public function getCurrencyCode()
    {
        if (!isset($this->currency, $this->assignment->bank)) {
            return null;
        }

        return CurrencyCode::getInstance([
            'currency' => $this->currency->id,
            'bank' => $this->assignment->bank->id
        ]);
    }
804948
def ls(bank):
    '''
    
    '''
    _init_client()
    query = "SELECT etcd_key FROM {0} WHERE bank='{1}'".format(
        _table_name, bank)
    cur, _ = run_query(client, query)
    out = [row[0] for row in cur.fetchall()]
    cur.close()
    return out
281590
def get_DB_references(self):
        ''' 
        '''

        _database_names = {
            'GB'    :  'GenBank',
            'PDB'   :  'Protein Data Bank',
            'UNP'   :  'UNIPROT',
            'NORINE':  'Norine',
            'TREMBL': 'UNIPROT',
        }

        DBref = {}
        for l in self.parsed_lines["DBREF "]: # [l for l in self.lines if l.startswith('DBREF')]
            pdb_id = l[7:11]
            chain_id = l[12]
            seqBegin = int(l[14:18])
            insertBegin = l[18]
            seqEnd = int(l[20:24])
            insertEnd = l[24]
            database = _database_names[l[26:32].strip()]
            dbAccession = l[33:41].strip()
            dbIdCode = l[42:54].strip()
            dbseqBegin = int(l[55:60])
            idbnsBeg = l[60]
            dbseqEnd = int(l[62:67])
            dbinsEnd = l[67]

            DBref[pdb_id] = DBref.get(pdb_id, {})
            DBref[pdb_id][database] = DBref[pdb_id].get(database, {})
            if DBref[pdb_id][database].get(chain_id):
                if not(DBref[pdb_id][database][chain_id]['dbAccession'] == dbAccession and DBref[pdb_id][database][chain_id]['dbIdCode'] == dbIdCode):
                    raise PDBParsingException('This code needs to be generalized. dbIdCode should really be a list to handle chimera cases.')
            else:
                DBref[pdb_id][database][chain_id] = {'dbAccession'   :   dbAccession, 'dbIdCode'      :   dbIdCode, 'PDBtoDB_mapping' : []}

            DBref[pdb_id][database][chain_id]['PDBtoDB_mapping'].append(
                {'PDBRange'      :   ("%d%s" % (seqBegin,  insertBegin), "%d%s" % (seqEnd,  insertEnd)),
                'dbRange'       :   ("%d%s" % (dbseqBegin, idbnsBeg), "%d%s" % (dbseqEnd, dbinsEnd)),
                }
            )
        return DBref
1116839
def bank_identifier(self):
        """"""
        end = get_iban_spec(self.country_code).bban_split_pos + 4
        return self._id[4:end]
729247
public function hashCode()
    {
        $validPk = null !== $this->getCategoryId() &&
            null !== $this->getMediaId();

        $validPrimaryKeyFKs = 2;
        $primaryKeyFKs = [];

        //relation c2m_fk_904832 to table category
        if ($this->aCategory && $hash = spl_object_hash($this->aCategory)) {
            $primaryKeyFKs[] = $hash;
        } else {
            $validPrimaryKeyFKs = false;
        }

        //relation c2m_fk_32dfd1 to table media
        if ($this->aMedia && $hash = spl_object_hash($this->aMedia)) {
            $primaryKeyFKs[] = $hash;
        } else {
            $validPrimaryKeyFKs = false;
        }

        if ($validPk) {
            return crc32(json_encode($this->getPrimaryKey(), JSON_UNESCAPED_UNICODE));
        } elseif ($validPrimaryKeyFKs) {
            return crc32(json_encode($primaryKeyFKs, JSON_UNESCAPED_UNICODE));
        }

        return spl_object_hash($this);
    }
1000358
function isTokenChar(code) {
  return code === 0x21                // '!'
    || code >= 0x23 && code <= 0x27   // '#', '$', '%', '&', '''
    || code === 0x2A                  // '*'
    || code === 0x2B                  // '+'
    || code === 0x2D                  // '-'
    || code === 0x2E                  // '.'
    || code >= 0x30 && code <= 0x39   // 0-9
    || code >= 0x41 && code <= 0x5A   // A-Z
    || code >= 0x5E && code <= 0x7A   // '^', '_', '`', a-z
    || code === 0x7C                  // '|'
    || code === 0x7E;                 // '~'
}
1052628
public static function getCurrencyList()
    {
        return [
            'EUR' => ['name' => 'Euro',                  'code' => 978, 'fraction' => 2],
            'USD' => ['name' => 'Dollar Américain',      'code' => 840, 'fraction' => 2],
            'CHF' => ['name' => 'Franc Suisse',          'code' => 756, 'fraction' => 2],
            'GBP' => ['name' => 'Livre Sterling',        'code' => 826, 'fraction' => 2],
            'CAD' => ['name' => 'Dollar Canadien',       'code' => 124, 'fraction' => 2],
            'JPY' => ['name' => 'Yen',                   'code' => 392, 'fraction' => 0],
            'MXN' => ['name' => 'Peso Mexicain',         'code' => 484, 'fraction' => 2],
            'TRY' => ['name' => 'Nouvelle Livre Turque', 'code' => 949, 'fraction' => 2],
            'AUD' => ['name' => 'Dollar Australien',     'code' => 036, 'fraction' => 2],
            'NZD' => ['name' => 'Dollar Néo-Zélandais',  'code' => 554, 'fraction' => 2],
            'NOK' => ['name' => 'Couronne Norvégienne',  'code' => 578, 'fraction' => 2],
            'BRL' => ['name' => 'Real Brésilien',        'code' => 986, 'fraction' => 2],
            'ARS' => ['name' => 'Peso Argentin',         'code' => 032, 'fraction' => 2],
            'KHR' => ['name' => 'Riel',                  'code' => 116, 'fraction' => 2],
            'TWD' => ['name' => 'Dollar de Taiwan',      'code' => 901, 'fraction' => 2],
            'SEK' => ['name' => 'Couronne Suédoise',     'code' => 752, 'fraction' => 2],
            'DKK' => ['name' => 'Couronne Danoise',      'code' => 208, 'fraction' => 2],
            'KRW' => ['name' => 'Won',                   'code' => 410, 'fraction' => 0],
            'SGD' => ['name' => 'Dollar de Singapour',   'code' => 702, 'fraction' => 2],
            'XPF' => ['name' => 'Franc Polynésien',      'code' => 953, 'fraction' => 0],
            'XOF' => ['name' => 'Franc CFA',             'code' => 952, 'fraction' => 0],
        ];
    }
100468
public function getAllElements()
    {
        $paymentSlipData = $this->paymentSlipData;

        $elements = [];
        // Place left bank lines
        if ($this->getDisplayBank()) {
            $lines = [
                $paymentSlipData->getBankName(),
                $paymentSlipData->getBankCity()
            ];
            $elements['bankLeft'] = [
                'lines' => $lines,
                'attributes' => $this->getBankLeftAttr()
            ];

            // Place right bank lines
            // Reuse lines from above
            $elements['bankRight'] = [
                'lines' => $lines,
                'attributes' => $this->getBankRightAttr()
            ];
        }

        // Place left recipient lines
        if ($this->getDisplayRecipient()) {
            $lines = [
                $paymentSlipData->getRecipientLine1(),
                $paymentSlipData->getRecipientLine2(),
                $paymentSlipData->getRecipientLine3(),
                $paymentSlipData->getRecipientLine4()
            ];
            $elements['recipientLeft'] = [
                'lines' => $lines,
                'attributes' => $this->getRecipientLeftAttr()
            ];

            // Place right recipient lines
            // Reuse lines from above
            $elements['recipientRight'] = [
                'lines' => $lines,
                'attributes' => $this->getRecipientRightAttr()
            ];
        }

        // Place left account number
        if ($this->getDisplayAccount()) {
            $lines = [$paymentSlipData->getAccountNumber()];
            $elements['accountLeft'] = [
                'lines' => $lines,
                'attributes' => $this->getAccountLeftAttr()
            ];

            // Place right account number
            // Reuse lines from above
            $elements['accountRight'] = [
                'lines' => $lines,
                'attributes' => $this->getAccountRightAttr()
            ];
        }

        // Place left amount in francs
        if ($this->getDisplayAmount()) {
            $lines = [$paymentSlipData->getAmountFrancs()];
            $elements['amountFrancsLeft'] = [
                'lines' => $lines,
                'attributes' => $this->getAmountFrancsLeftAttr()
            ];

            // Place right amount in francs
            // Reuse lines from above
            $elements['amountFrancsRight'] = [
                'lines' => $lines,
                'attributes' => $this->getAmountFrancsRightAttr()
            ];

            // Place left amount in cents
            $lines = [$paymentSlipData->getAmountCents()];
            $elements['amountCentsLeft'] = [
                'lines' => $lines,
                'attributes' => $this->getAmountCentsLeftAttr()
            ];

            // Place right amount in cents
            // Reuse lines from above
            $elements['amountCentsRight'] = [
                'lines' => $lines,
                'attributes' => $this->getAmountCentsRightAttr()
            ];
        }

        // Place left payer lines
        if ($this->getDisplayPayer()) {
            $lines = [
                $paymentSlipData->getPayerLine1(),
                $paymentSlipData->getPayerLine2(),
                $paymentSlipData->getPayerLine3(),
                $paymentSlipData->getPayerLine4()
            ];
            $elements['payerLeft'] = [
                'lines' => $lines,
                'attributes' => $this->getPayerLeftAttr()
            ];

            // Place right payer lines
            // Reuse lines from above
            $elements['payerRight'] = [
                'lines' => $lines,
                'attributes' => $this->getPayerRightAttr()
            ];
        }

        return $elements;
    }
440604
def validate_clabe(clabe: str) -> bool:
    
    return (clabe.isdigit() and
            len(clabe) == CLABE_LENGTH and
            clabe[:3] in BANKS.keys() and
            clabe[-1] == compute_control_digit(clabe))