This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"recommendations": [ | |
"charliermarsh.ruff" | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Stops other media elements from playing when a media element starts playing. | |
* | |
* @param {HTMLMediaElement[]} mediaElems - An array of HTML media elements. | |
* | |
* @example | |
* | |
* // Stop other media elements when one starts playing | |
* const allMediaElems = document.querySelectorAll("audio, video"); | |
* stopOtherMedia(allMediaElems); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import parsePhoneNumber from "libphonenumber-js"; | |
/** | |
* The available formatting properties for formatting a phone number. | |
*/ | |
type FormatPhoneNumberProperty = "NATIONAL" | "INTERNATIONAL" | "RFC3966"; | |
/** | |
* Represents the arguments for formatting a phone number. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import parsePhoneNumber from "libphonenumber-js"; | |
/** | |
* @typedef {Object} FormatPhoneNumberType - creates a new type named "FormatPhoneNumberType" | |
* @property {string} number - The phone number to format. | |
* @property {"NATIONAL" | "INTERNATIONAL" | "RFC3966"} [property="INTERNATIONAL"] - The desired formatting property. | |
*/ | |
/** | |
* Formats a phone number using the libphonenumber-js library. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"recommendations": [ | |
"ms-python.python", | |
"ms-python.pylint", | |
"ms-python.black-formatter", | |
"ms-python.isort" | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
def array_unique(arr): | |
""" | |
Return an array containing unique values from a given array. | |
Args: | |
arr (list or numpy.ndarray): The input array. | |
Returns: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
def list_unique(arr): | |
""" | |
Return a list containing unique values from a given array. | |
Args: | |
arr (list or numpy.ndarray): The input list. | |
Returns: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import unicodedata | |
DIACRITICS_MAP = { | |
"À": "A", | |
"Ĕ": "E", | |
"Ļ": "L", | |
"Ś": "S", | |
"Ź": "Z", | |
"ē": "e", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def dict_unique(dict): | |
""" | |
Return a dictionary containing unique values from a given dictionary. | |
Args: | |
dict (dict): The input dictionary. | |
Returns: | |
dict: A new dictionary with unique values. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Represents the arguments for formatting a currency display name with internationalization. | |
*/ | |
export interface I18nFormatDisplayNamesArgs { | |
/** | |
* The locale to use for formatting the display name. Defaults to "en-US". | |
*/ | |
locale?: keyof typeof Intl.Locale; | |
/** | |
* The currency code for which to retrieve the display name. |
NewerOlder