file stringlengths 8 116 | function stringlengths 2 72 | version_data listlengths 2 2 | diff_code stringlengths 87 17.4k | diff_docstring stringlengths 31 12k | whitespace_only_code bool 1
class | whitespace_only_docstring bool 1
class | file_path stringlengths 9 116 | filename stringlengths 5 52 | project stringclasses 100
values | owner stringclasses 96
values |
|---|---|---|---|---|---|---|---|---|---|---|
research_object_detection_models_ssd_efficientnet_bifpn_feature_extractor.py | SSDEfficientNetB0BiFPNKerasFeatureExtractor.__init__ | [
{
"version": "v4",
"docstring_lines": {
"start_line": 871,
"end_line": 915
},
"code_lines": {
"start_line": 915,
"end_line": 934
},
"commit_date_time": "2022-01-11 01:25:04",
"commit_sha": "84c0e81fe9683dbdd5ee6b088fa756302f60dc25",
"commit_message": "Update d... | def __init__(self,
is_training,
depth_multiplier,
min_depth,
pad_to_multiple,
conv_hyperparams,
freeze_batchnorm,
inplace_batchnorm_update,
bifpn_min_level=3,
bifpn_... | SSD Keras EfficientNet-b0 BiFPN (EfficientDet-d0) Feature Extractor.
Args:
is_training: whether the network is in training mode.
depth_multiplier: unsupported by EfficientNetBiFPN. float, depth
multiplier for the feature extractor.
min_depth: minimum feature extractor depth.... | false | false | research/object_detection/models/ssd_efficientnet_bifpn_feature_extractor.py | ssd_efficientnet_bifpn_feature_extractor.py | models | tensorflow |
django_contrib_admin_views_main.py | ChangeList.get_ordering_field | [
{
"version": "v250",
"docstring_lines": {
"start_line": 356,
"end_line": 363
},
"code_lines": {
"start_line": 363,
"end_line": 378
},
"commit_date_time": "2023-07-07 05:08:28",
"commit_sha": "d569c1dcfeb26ca9ee391e5dfeadedf2b5ed4253",
"commit_message": "Fixed ... | def get_ordering_field(self, field_name):
try:
field = self.lookup_opts.get_field(field_name)
return field.name
except FieldDoesNotExist:
# See whether field_name is a name of a non-field
# that allows sorting... | Return the proper model field name corresponding to the given
field_name to use for ordering. field_name may either be the name of a
- proper model field or the name of a method (on the admin or model) or a
- callable with the 'admin_order_field' attribute. Return None if no
+ proper... | false | false | django/contrib/admin/views/main.py | main.py | django | django |
readthedocs_oauth_services_base.py | Service.for_user | [
{
"version": "v2",
"docstring_lines": {
"start_line": 33,
"end_line": 35
},
"code_lines": {
"start_line": 35,
"end_line": 43
},
"commit_date_time": "2016-01-04 19:35:47",
"commit_sha": "335b26cb03bb9a542a86f01c0bce9c0d94b0e0f8",
"commit_message": "Remove extra... | def for_user(cls, user):
try:
- account = SocialAccount.objects.get(
? ^ ^
+ accounts = SocialAccount.objects.filter(
? + ^^^^ ^
user=user,
provider... | - Create instance if user has an account for the provider
? ^ ^ ^
+ Return a list of instances if user has an account for the provider
? ^^^^ ^^ ++++ ^^^ +
| false | false | readthedocs/oauth/services/base.py | base.py | readthedocs.org | readthedocs |
readthedocs_oauth_services_base.py | Service.send_build_status | [
{
"version": "v45",
"docstring_lines": {
"start_line": 189,
"end_line": 196
},
"code_lines": {
"start_line": 196,
"end_line": 210
},
"commit_date_time": "2020-09-08 08:18:25",
"commit_sha": "30168286a4311c64ab7476778afcc39aa92a6785",
"commit_message": "Use org... | - def send_build_status(self, build, commit, state):
+ def send_build_status(self, build, commit, state, link_to_build=False):
? +++++++++++++++++++++
raise NotImplementedError | Create commit status for project.
:param build: Build to set up commit status for
:type build: Build
:param commit: commit sha of the pull/merge request
:type commit: str
:param state: build state failure, pending, or success.
:type state: str
+ :... | false | false | readthedocs/oauth/services/base.py | base.py | readthedocs.org | readthedocs |
readthedocs_oauth_services_base.py | Service.setup_webhook | [
{
"version": "v31",
"docstring_lines": {
"start_line": 230,
"end_line": 238
},
"code_lines": {
"start_line": 238,
"end_line": 239
},
"commit_date_time": "2019-07-24 15:26:24",
"commit_sha": "49716a7e7134d0e6a7383aa923925b3bc121e445",
"commit_message": "commit ... | - def setup_webhook(self, project):
+ def setup_webhook(self, project, integration=None):
? ++++++++++++++++++
raise NotImplementedError | Setup webhook for project.
:param project: project to set up webhook for
:type project: Project
+ :param integration: Integration for the project
+ :type integration: Integration
:returns: boolean based on webhook set up success, and requests Response object
... | false | false | readthedocs/oauth/services/base.py | base.py | readthedocs.org | readthedocs |
readthedocs_oauth_services_base.py | Service.sync | [
{
"version": "v44",
"docstring_lines": {
"start_line": 189,
"end_line": 197
},
"code_lines": {
"start_line": 197,
"end_line": 221
},
"commit_date_time": "2020-09-03 20:10:17",
"commit_sha": "4c146fe8e00dd9e5945530ee4588b840a051e320",
"commit_message": "Fix bad... | def sync(self):
remote_repositories = self.sync_repositories()
remote_organizations, remote_repositories_organizations = self.sync_organizations()
# Delete RemoteRepository where the user doesn't have access anymore
# (skip RemoteRepository t... | Sync repositories (RemoteRepository) and organizations (RemoteOrganization).
- creates a new RemoteRepository/Organization per new repository
- updates fields for existing RemoteRepository/Organization
- - deletes old RemoteRepository/Organization that are not present
+ - delete... | false | false | readthedocs/oauth/services/base.py | base.py | readthedocs.org | readthedocs |
libs_core_langchain_core_example_selectors_semantic_similarity.py | MaxMarginalRelevanceExampleSelector.from_examples | [
{
"version": "v22",
"docstring_lines": {
"start_line": 216,
"end_line": 232
},
"code_lines": {
"start_line": 232,
"end_line": 243
},
"commit_date_time": "2024-03-26 14:06:43",
"commit_sha": "a9457d269e50690245c756781bcd44ba084549c8",
"commit_message": "core: A... | def from_examples(
cls,
examples: List[dict],
embeddings: Embeddings,
vectorstore_cls: Type[VectorStore],
k: int = 4,
input_keys: Optional[List[str]] = None,
fetch_k: int = 20,
+ example_keys: Optional[List[str]] = None,
+ vectorsto... | Create k-shot example selector using example list and embeddings.
- Reshuffles examples dynamically based on query similarity.
? ^^^^^^^^^^^ ^^
+ Reshuffles examples dynamically based on Max Marginal Relevance.
? ... | false | false | libs/core/langchain_core/example_selectors/semantic_similarity.py | semantic_similarity.py | langchain | langchain-ai |
scripts_extract.py | Extract.process | [
{
"version": "v79",
"docstring_lines": {
"start_line": 56,
"end_line": 58
},
"code_lines": {
"start_line": 58,
"end_line": 69
},
"commit_date_time": "2019-10-13 22:50:28",
"commit_sha": "70ee1252833bdad60960f5191116bd6f67b37b4a",
"commit_message": "Serialize m... | def process(self):
-
? -
+
+
logger.info('Starting, this may take a while...')
+ # from lib.queue_manager import queue_manager
# queue_manager.debug_monitor(3)
- self.threaded_io("load")
+ self._threaded_redirector("load")
? ... | - Perform the extraction process
+ The entry point for triggering the Extraction Process.
+
+ Should only be called from :class:`lib.cli.ScriptExecutor` | false | false | scripts/extract.py | extract.py | faceswap | deepfakes |
scripts_extract.py | Extract.align_face | [
{
"version": "v48",
"docstring_lines": {
"start_line": 191,
"end_line": 193
},
"code_lines": {
"start_line": 193,
"end_line": 208
},
"commit_date_time": "2018-11-25 17:58:08",
"commit_sha": "3df1371070a7a822e0d59256c5e5711cd3378cb8",
"commit_message": "Fix fac... | - def align_face(faces, align_eyes, size, padding=48):
+ def align_face(self, faces, align_eyes, size, filename, padding=48):
? ++++++ ++++++++++
final_faces = list()
image = faces["image"]
landmarks = faces["landmarks"]
detecte... | - Align the detected face
+ Align the detected face and add the destination file path | false | false | scripts/extract.py | extract.py | faceswap | deepfakes |
scripts_extract.py | Extract._output_faces | [
{
"version": "v103",
"docstring_lines": {
"start_line": 273,
"end_line": 286
},
"code_lines": {
"start_line": 286,
"end_line": 307
},
"commit_date_time": "2022-05-16 22:26:42",
"commit_sha": "0d23714875f81ddabdbe8f4e40bef6e5f29eeb19",
"commit_message": "bugfix... | - def _output_faces(self, saver: ImagesSaver, extract_media: ExtractMedia) -> None:
+ def _output_faces(self, saver: Optional[ImagesSaver], extract_media: ExtractMedia) -> None:
? +++++++++ +
- logger.trace("Outputting faces for %s", extract_media... | Output faces to save thread
Set the face filename based on the frame name and put the face to the
:class:`~lib.image.ImagesSaver` save queue and add the face information to the alignments
data.
Parameters
----------
- saver: lib.images.ImagesSaver
+ ... | false | false | scripts/extract.py | extract.py | faceswap | deepfakes |
scripts_extract.py | Extract._output_processing | [
{
"version": "v93",
"docstring_lines": {
"start_line": 237,
"end_line": 248
},
"code_lines": {
"start_line": 248,
"end_line": 261
},
"commit_date_time": "2020-05-13 11:28:30",
"commit_sha": "92bc9af9577a042e368169eb74c8a432708050f4",
"commit_message": "Extract... | def _output_processing(self, extract_media, size):
for face in extract_media.detected_faces:
face.load_aligned(extract_media.image, size=size)
-
+ face.thumbnail = generate_thumbnail(face.aligned_face, size=80, quality=60)
self._post_process.do_act... | Prepare faces for output
- Loads the aligned face, perform any processing actions and verify the output.
? ------------
+ Loads the aligned face, generate the thumbnail, perform any processing actions and verify
? ... | false | false | scripts/extract.py | extract.py | faceswap | deepfakes |
scripts_extract.py | Filter._validate_inputs | [
{
"version": "v113",
"docstring_lines": {
"start_line": 169,
"end_line": 181
},
"code_lines": {
"start_line": 181,
"end_line": 207
},
"commit_date_time": "2022-10-31 18:25:32",
"commit_sha": "1d1face00d9476896e7857d3976afce383585d1b",
"commit_message": "Update... | def _validate_inputs(cls,
- filter_files: Optional[Union[str, List[str]]],
? ----------- -
+ filter_files: Optional[List[str]],
- nfilter_files: Optional[Union[str, List[str]]]) -> Tupl... | Validates that the given filter/nfilter files exist, are image files and are unique
Parameters
----------
- filter_files: str, list or ``None``
? -----
+ filter_files: list or ``None``
The list of filter file(s) passed in as command line argu... | false | false | scripts/extract.py | extract.py | faceswap | deepfakes |
python_ray_autoscaler_v2_instance_manager_instance_storage.py | InstanceStorage.get_instances | [
{
"version": "v2",
"docstring_lines": {
"start_line": 32,
"end_line": 35
},
"code_lines": {
"start_line": 35,
"end_line": 48
},
"commit_date_time": "2023-07-25 04:10:05",
"commit_sha": "006a43ea6c395d619036362a30694f0603d6cba0",
"commit_message": "[autoscaler ... | def get_instances(
self,
instance_ids: List[str] = None,
status_filter: Set[int] = None,
- ray_status_filter: Set[int] = None,
) -> Tuple[Dict[str, Instance], int]:
instance_ids = instance_ids or []
status_filter = status_filter or ... | Get instances from the storage.
Args:
instance_ids: A list of instance ids to be retrieved. If empty, all
instances will be retrieved.
status_filter: Only instances with the specified status will be returned.
- ray_status_filter: Only instances wi... | false | false | python/ray/autoscaler/v2/instance_manager/instance_storage.py | instance_storage.py | ray | ray-project |
plugins_Camera.py | isValid | [
{
"version": "v4",
"docstring_lines": {
"start_line": 110,
"end_line": 116
},
"code_lines": {
"start_line": 116,
"end_line": 117
},
"commit_date_time": "2019-02-10 12:18:27",
"commit_sha": "78ce4990a703ed55ecfbaf43f9510fbf96da7b36",
"commit_message": "feat(插件)... | - def isValid(text, parsed=None):
+ def isValid(text, parsed=None, immersiveMode=None):
? ++++++++++++++++++++
return any(word in text for word in ["拍照", "拍张照"]) | Returns True if input is related to the time.
Arguments:
text -- user-input, typically transcribed speech
+ parsed -- NLU structure parsed by Baidu UNIT
+ immersiveMode -- current immersive mode | false | false | plugins/Camera.py | Camera.py | wukong-robot | wzpan |
homeassistant_components_alarm_control_panel___init__.py | AlarmControlPanel.async_alarm_arm_away | [
{
"version": "v26",
"docstring_lines": {
"start_line": 186,
"end_line": 188
},
"code_lines": {
"start_line": 188,
"end_line": 191
},
"commit_date_time": "2016-12-21 14:12:26",
"commit_sha": "f18a88c2d4ea786d87b873632a1cbb9781d8b9c6",
"commit_message": "Bugfix ... | def async_alarm_arm_away(self, code=None):
+
- yield from self.hass.loop.run_in_executor(
? ^^ ^^^^ ^^
+ return self.hass.loop.run_in_executor(
? ^ ^^ ^
None, self.alarm_arm_away, code) | Send arm away command.
+
+ This method must be run in the event loop and returns a coroutine. | false | false | homeassistant/components/alarm_control_panel/__init__.py | __init__.py | core | home-assistant |
official_vision_modeling_layers_edgetpu.py | _non_max_suppression_as_is | [
{
"version": "v1",
"docstring_lines": {
"start_line": 265,
"end_line": 302
},
"code_lines": {
"start_line": 302,
"end_line": 328
},
"commit_date_time": "2022-11-29 08:57:01",
"commit_sha": "5938a7181b778fd574859cf942cd824a5710ce03",
"commit_message": "Internal... | def _non_max_suppression_as_is(boxes: tf.Tensor,
scores: tf.Tensor,
output_size: int,
- iou_threshold: float = 0.5) -> tf.Tensor:
? ^^^^^^^^^^^^^^^
+ ... | Selects a subset of boxes which have highest score among IOU-similar boxes.
Args:
boxes: A 2-D+ float `Tensor` of shape `[...batch_dims, num_boxes, 4]`.
scores: A 1-D+ float `Tensor` of shape `[...batch_dims, num_boxes]`
representing a single score corresponding to each box (each row of box... | false | false | official/vision/modeling/layers/edgetpu.py | edgetpu.py | models | tensorflow |
django_contrib_auth___init__.py | logout | [
{
"version": "v12",
"docstring_lines": {
"start_line": 62,
"end_line": 65
},
"code_lines": {
"start_line": 65,
"end_line": 76
},
"commit_date_time": "2007-07-13 05:03:33",
"commit_sha": "6335317a423c9533a13d741c673fc45d1f052121",
"commit_message": "Fixed #3505... | def logout(request):
+ request.session.flush()
- try:
- del request.session[SESSION_KEY]
- except KeyError:
- pass
- try:
- del request.session[BACKEND_SESSION_KEY]
- except KeyError:
- pass
if hasattr(request, 'user'):
from djan... | - Remove the authenticated user's ID from the request.
? ^
+ Removes the authenticated user's ID from the request and flushes their
? + ^^^^^^^^^^^^^^^^^^
+ session data. | false | false | django/contrib/auth/__init__.py | __init__.py | django | django |
sklearn_feature_extraction_image.py | extract_patches | [
{
"version": "v68",
"docstring_lines": {
"start_line": 185,
"end_line": 214
},
"code_lines": {
"start_line": 214,
"end_line": 236
},
"commit_date_time": "2012-11-29 12:10:40",
"commit_sha": "b5f347eb082aa1e33142bcdc9eb340d743423e62",
"commit_message": "removed... | def extract_patches(arr, patch_shape=8, extraction_step=1):
+
arr_ndim = arr.ndim
if isinstance(patch_shape, numbers.Number):
patch_shape = tuple([patch_shape] * arr_ndim)
if isinstance(extraction_step, numbers.Number):
extraction_step = tuple([extraction_step] ... | Extracts patches of any n-dimensional array in place using strides.
Given an n-dimensional array it will return a 2n-dimensional array with
the first n dimensions indexing patch position and the last n indexing
the patch content. This operation is immediate (O(1)). A reshape
performed on th... | false | false | sklearn/feature_extraction/image.py | image.py | scikit-learn | scikit-learn |
sklearn_feature_extraction_image.py | PatchExtractor.transform | [
{
"version": "v121",
"docstring_lines": {
"start_line": 495,
"end_line": 535
},
"code_lines": {
"start_line": 535,
"end_line": 545
},
"commit_date_time": "2023-02-07 13:44:06",
"commit_sha": "ba16dbe72b3edfc40b8a82deb132d8dede5904cf",
"commit_message": "MAINT ... | def transform(self, X):
+ X = self._validate_data(
+ X=X,
+ ensure_2d=False,
+ allow_nd=True,
+ ensure_min_samples=1,
+ ensure_min_features=1,
+ reset=False,
+ )
- self.random_state = check_random_sta... | Transform the image samples in `X` into a matrix of patch data.
Parameters
----------
X : ndarray of shape (n_samples, image_height, image_width) or \
- (n_samples, image_height, image_width, n_channels)
+ (n_samples, image_height, image_width, n_channels)
... | false | false | sklearn/feature_extraction/image.py | image.py | scikit-learn | scikit-learn |
speechbrain_decoders_seq2seq.py | S2SBeamSearcher._check_attn_shift | [
{
"version": "v118",
"docstring_lines": {
"start_line": 520,
"end_line": 545
},
"code_lines": {
"start_line": 545,
"end_line": 819
},
"commit_date_time": "2021-02-12 07:57:28",
"commit_sha": "e4e57e7766257faf56bbc81db6045ba4a40bc9b9",
"commit_message": "Add ct... | def _check_attn_shift(self, attn, prev_attn_peak):
-
# Block the candidates that exceed the max shift
_, attn_peak = torch.max(attn, dim=1)
lt_cond = attn_peak <= (prev_attn_peak + self.max_attn_shift)
mt_cond = attn_peak > (prev_attn_peak - self.... | This method checks whether attention shift is more than attn_shift.
- Parameters
+ Arguments
- ----------
? -
+ ---------
attn : torch.Tensor
The attention to be checked.
prev_attn_peak : torch.Tensor
The previous att... | false | false | speechbrain/decoders/seq2seq.py | seq2seq.py | speechbrain | speechbrain |
speechbrain_decoders_seq2seq.py | S2SBeamSearcher._get_top_score_prediction | [
{
"version": "v119",
"docstring_lines": {
"start_line": 504,
"end_line": 530
},
"code_lines": {
"start_line": 530,
"end_line": 802
},
"commit_date_time": "2021-02-14 14:25:37",
"commit_sha": "b8fd3882b8b880a753a70331ac4d854246ff8b9c",
"commit_message": "decode... | def _get_top_score_prediction(self, hyps_and_scores, topk):
- predictions, top_log_probs, top_scores = [], [], []
? ^^^^^^^^^
+ top_hyps, top_log_probs, top_scores, top_lengths = [], [], [], []
? ++ ^^^^ +++++++++++++ ++++
... | This method sorts the scores and return corresponding hypothesis and log probs.
Arguments
---------
hyps_and_scores : list
To store generated hypotheses and scores.
topk : int
Number of hypothesis to return.
Returns
-------
... | false | false | speechbrain/decoders/seq2seq.py | seq2seq.py | speechbrain | speechbrain |
speechbrain_decoders_seq2seq.py | S2SBeamSearcher._check_eos_threshold | [
{
"version": "v155",
"docstring_lines": {
"start_line": 516,
"end_line": 531
},
"code_lines": {
"start_line": 531,
"end_line": 537
},
"commit_date_time": "2023-08-07 16:07:43",
"commit_sha": "4fb73fdee65104b87150aa46f122a7eb889c2643",
"commit_message": "remove... | def _check_eos_threshold(self, log_probs):
-
max_probs, _ = torch.max(log_probs, dim=-1)
eos_probs = log_probs[:, self.eos_index]
cond = eos_probs > (self.eos_threshold * max_probs)
return cond | This method checks whether eos log-probabilities exceed threshold.
Arguments
---------
log_probs : torch.Tensor
The log-probabilities.
- Return
+ Returns
? +
------
cond : torch.BoolTensor
Each element r... | false | false | speechbrain/decoders/seq2seq.py | seq2seq.py | speechbrain | speechbrain |
speechbrain_decoders_seq2seq.py | S2SBaseSearcher.forward | [
{
"version": "v159",
"docstring_lines": {
"start_line": 1480,
"end_line": 1524
},
"code_lines": {
"start_line": 1524,
"end_line": 1535
},
"commit_date_time": "2024-03-21 16:22:51",
"commit_sha": "341e35c3bc0c2ff3b9c6257c7bb231a23891df30",
"commit_message": "Ch... | def forward(self, enc_states, wav_len):
raise NotImplementedError
+ return | This method should implement the forward algorithm of decoding method.
Arguments
---------
enc_states : torch.Tensor
The precomputed encoder states to be used when decoding.
(ex. the encoded speech representation to be attended).
wav_len : torch.T... | false | false | speechbrain/decoders/seq2seq.py | seq2seq.py | speechbrain | speechbrain |
speechbrain_decoders_seq2seq.py | _model_decode | [
{
"version": "v93",
"docstring_lines": {
"start_line": 1082,
"end_line": 1092
},
"code_lines": {
"start_line": 1092,
"end_line": 1096
},
"commit_date_time": "2020-11-21 20:07:34",
"commit_sha": "d9383bf0677010af0a8a6a6a7b27909fcc62c183",
"commit_message": "add... | - def _model_decode(model, softmax, fc, inp_tokens, memory, enc_states):
+ def _model_decode(
+ model, softmax, fc, inp_tokens, memory, enc_states, temperature
+ ):
memory = _update_mem(inp_tokens, memory)
pred = model.decode(memory, enc_states)
- prob_dist = softmax(fc(pred))
+ pr... | This function implements 1 decode step for the transformer searches
Arguements:
-----------
model: torch class
Transformer model
softmax: torch class
softmax fuction
fc: torch class
output linear layer
inp_token: tensor
predicted token fro... | false | false | speechbrain/decoders/seq2seq.py | seq2seq.py | speechbrain | speechbrain |
speechbrain_decoders_seq2seq.py | S2SWhisperBeamSearch.reset_mem | [
{
"version": "v133",
"docstring_lines": {
"start_line": 1378,
"end_line": 1380
},
"code_lines": {
"start_line": 1380,
"end_line": 1382
},
"commit_date_time": "2022-11-26 18:23:53",
"commit_sha": "e772ebe39ab52c885e8e960c94504085933db807",
"commit_message": "ad... | def reset_mem(self, batch_size, device):
+ return torch.tensor([self.decoder_input_tokens] * batch_size).to(device)
- # TODO: '<|startoftranscript|><|en|>'. Need to let the possibility to modify the second value at least.
- return torch.tensor([[50258, 50259]] * batch_size).to(devic... | - Needed to reset the memory during beamsearch.
+ This method set the first tokens to be decoder_input_tokens during search. | false | false | speechbrain/decoders/seq2seq.py | seq2seq.py | speechbrain | speechbrain |
speechbrain_decoders_seq2seq.py | S2SGreedySearcher._get_top_prediction | [
{
"version": "v163",
"docstring_lines": {
"start_line": 230,
"end_line": 252
},
"code_lines": {
"start_line": 252,
"end_line": 280
},
"commit_date_time": "2024-04-12 01:20:13",
"commit_sha": "071b743520e5c2497d46dc6301b5d0957ab08121",
"commit_message": "Revert... | def _get_top_prediction(self, hyps, scores, log_probs):
batch_size = hyps.size(0)
max_length = hyps.size(1)
top_lengths = [max_length] * batch_size
# Collect lengths of top hyps
for pred_index in range(batch_size):
pred = hyps[pr... | This method sorts the scores and return corresponding hypothesis and log probs.
Arguments
---------
hyps : torch.Tensor (batch, max length of token_id sequences)
This tensor stores the predicted hypothesis.
scores : torch.Tensor (batch)
The score ... | false | false | speechbrain/decoders/seq2seq.py | seq2seq.py | speechbrain | speechbrain |
manimlib_mobject_mobject.py | Mobject.null_point_align | [
{
"version": "v229",
"docstring_lines": {
"start_line": 952,
"end_line": 956
},
"code_lines": {
"start_line": 956,
"end_line": 961
},
"commit_date_time": "2019-02-12 05:18:08",
"commit_sha": "86d3ade0ef356d02bc232e509ae12b5b08568331",
"commit_message": "Change... | def null_point_align(self, mobject):
- if self.submobjects:
+ for m1, m2 in (self, mobject), (mobject, self):
+ if m1.has_no_points() and m2.has_points():
- mobject.push_self_into_submobjects()
? ^^^^^^
+ m2.push_se... | - If self has no points, but needs to align
- with mobject, which has points
+ If a mobject with points is being aligned to
+ one without, treat both as groups, and push
+ the one with points into its own submobjects
+ list. | false | false | manimlib/mobject/mobject.py | mobject.py | manim | 3b1b |
readthedocs_oauth_migrations_0003_move_github.py | forwards_move_repos | [
{
"version": "v15",
"docstring_lines": {
"start_line": 25,
"end_line": 27
},
"code_lines": {
"start_line": 27,
"end_line": 156
},
"commit_date_time": "2019-01-21 17:16:25",
"commit_sha": "5798557a0d60635b925aa143370738804727cc83",
"commit_message": "isort over... | def forwards_move_repos(apps, schema_editor):
db = schema_editor.connection.alias
# Organizations
GithubOrganization = apps.get_model('oauth', 'GithubOrganization')
BitbucketTeam = apps.get_model('oauth', 'BitbucketTeam')
RemoteOrganization = apps.get_model('oauth', 'RemoteOrga... | - Moves OAuth repos
+ Moves OAuth repos.
? +
| false | false | readthedocs/oauth/migrations/0003_move_github.py | 0003_move_github.py | readthedocs.org | readthedocs |
libs_langchain_langchain_smith_evaluation_string_run_evaluator.py | StringRunEvaluatorChain.from_run_and_data_type | [
{
"version": "v5",
"docstring_lines": {
"start_line": 337,
"end_line": 362
},
"code_lines": {
"start_line": 362,
"end_line": 393
},
"commit_date_time": "2023-07-21 16:20:24",
"commit_sha": "f35db9f43e2301d63c643e01251739e7dcfb6b3b",
"commit_message": "(WIP) se... | def from_run_and_data_type(
cls,
evaluator: StringEvaluator,
- run_type: RunTypeEnum,
+ run_type: str,
data_type: DataType,
input_key: Optional[str] = None,
prediction_key: Optional[str] = None,
reference_key: Optional[str] = None,
... | Create a StringRunEvaluatorChain from an evaluator and the run and dataset types.
This method provides an easy way to instantiate a StringRunEvaluatorChain, by
taking an evaluator and information about the type of run and the data.
The method supports LLM and chain runs.
... | false | false | libs/langchain/langchain/smith/evaluation/string_run_evaluator.py | string_run_evaluator.py | langchain | langchain-ai |
samcli_commands_local_lib_local_api_service.py | LocalApiService._print_routes | [
{
"version": "v18",
"docstring_lines": {
"start_line": 22,
"end_line": 32
},
"code_lines": {
"start_line": 32,
"end_line": 44
},
"commit_date_time": "2023-11-21 01:51:45",
"commit_sha": "c3e154763d758e17ffa86eb7d05ddcc9b27a095e",
"commit_message": "add --disab... | - def _print_routes(routes, host, port):
+ def _print_routes(routes, host, port, ssl_enabled=False):
? +++++++++++++++++++
print_lines = []
+ protocol = "https" if ssl_enabled else "http"
for route in routes:
... | Helper method to print the APIs that will be mounted. This method is purely for printing purposes.
This method takes in a list of Route Configurations and prints out the Routes grouped by path.
Grouping routes by Function Name + Path is the bulk of the logic.
Example output:
... | false | false | samcli/commands/local/lib/local_api_service.py | local_api_service.py | aws-sam-cli | aws |
python_ccxt_gate.py | gate.fetch_deposits | [
{
"version": "v561",
"docstring_lines": {
"start_line": 5664,
"end_line": 5677
},
"code_lines": {
"start_line": 5677,
"end_line": 5759
},
"commit_date_time": "2023-09-22 10:50:45",
"commit_sha": "ce7ee6b69fb1d5bc86bc802a95add226a59a9d3d",
"commit_message": "4.... | def fetch_deposits(self, code: Optional[str] = None, since: Optional[int] = None, limit: Optional[int] = None, params={}):
self.load_markets()
+ paginate = False
+ paginate, params = self.handle_option_and_params(params, 'fetchDeposits', 'paginate')
+ ... | fetch all deposits made to an account
:param str code: unified currency code
:param int [since]: the earliest time in ms to fetch deposits for
:param int [limit]: the maximum number of deposits structures to retrieve
+ :param int [params.until]: end time in ms
:param di... | false | false | python/ccxt/gate.py | gate.py | ccxt | ccxt |
python_ccxt_gate.py | gate.fetch_ohlcv | [
{
"version": "v431",
"docstring_lines": {
"start_line": 2118,
"end_line": 2127
},
"code_lines": {
"start_line": 2127,
"end_line": 2158
},
"commit_date_time": "2022-06-16 13:07:09",
"commit_sha": "79875da007ed3a880b5b4674d307fe052c269a44",
"commit_message": "1.... | def fetch_ohlcv(self, symbol, timeframe='1m', since=None, limit=None, params={}):
self.load_markets()
market = self.market(symbol)
price = self.safe_string(params, 'price')
request = {}
request, params = self.prepare_request(market, No... | fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
:param str symbol: unified symbol of the market to fetch OHLCV data for
:param str timeframe: the length of time each candle represents
:param int|None since: timestamp in ms o... | false | false | python/ccxt/gate.py | gate.py | ccxt | ccxt |
python_ccxt_gate.py | gate.fetch_transaction_fees | [
{
"version": "v464",
"docstring_lines": {
"start_line": 1639,
"end_line": 1645
},
"code_lines": {
"start_line": 1645,
"end_line": 1683
},
"commit_date_time": "2022-10-27 13:54:43",
"commit_sha": "bf3f471eb899c81b4a7397fd132e11f931c87cbb",
"commit_message": "2.... | def fetch_transaction_fees(self, codes=None, params={}):
self.load_markets()
response = self.privateWalletGetWithdrawStatus(params)
#
# {
# "currency": "MTN",
# "name": "Medicalchain",
# "nam... | fetch transaction fees
+ see https://www.gate.io/docs/developers/apiv4/en/#retrieve-withdrawal-status
:param [str]|None codes: not used by gate fetchTransactionFees()
:param dict params: extra parameters specific to the gate api endpoint
:returns dict: a list of `fee structures <... | false | false | python/ccxt/gate.py | gate.py | ccxt | ccxt |
python_ccxt_gate.py | gate.fetch_tickers | [
{
"version": "v469",
"docstring_lines": {
"start_line": 1961,
"end_line": 1967
},
"code_lines": {
"start_line": 1967,
"end_line": 1978
},
"commit_date_time": "2022-11-21 05:05:28",
"commit_sha": "8c0fdc6e4b680360200a6b4855d035b3907abae1",
"commit_message": "2.... | def fetch_tickers(self, symbols=None, params={}):
self.load_markets()
+ symbols = self.market_symbols(symbols)
+ first = self.safe_string(symbols, 0)
+ market = None
+ if first is not None:
+ market = self.market(first)
- t... | fetches price tickers for multiple markets, statistical calculations with the information calculated over the past 24 hours each market
+ see https://www.gate.io/docs/developers/apiv4/en/#get-details-of-a-specifc-order
+ see https://www.gate.io/docs/developers/apiv4/en/#list-futures-tickers
+ ... | false | false | python/ccxt/gate.py | gate.py | ccxt | ccxt |
python_ccxt_gate.py | gate.fetch_ticker | [
{
"version": "v531",
"docstring_lines": {
"start_line": 2045,
"end_line": 2051
},
"code_lines": {
"start_line": 2051,
"end_line": 2063
},
"commit_date_time": "2023-06-07 10:21:52",
"commit_sha": "de322ef35b7d35ef3a6e46a15dac8e0a56a472e7",
"commit_message": "3.... | def fetch_ticker(self, symbol: str, params={}):
self.load_markets()
market = self.market(symbol)
request, query = self.prepare_request(market, None, params)
method = self.get_supported_mapping(market['type'], {
'spot': 'publicSpotG... | fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
+ see https://www.gate.io/docs/developers/apiv4/en/#get-details-of-a-specifc-order
+ see https://www.gate.io/docs/developers/apiv4/en/#list-futures-tickers
+ see https... | false | false | python/ccxt/gate.py | gate.py | ccxt | ccxt |
python_ccxt_gate.py | gate.fetch_deposit_address | [
{
"version": "v601",
"docstring_lines": {
"start_line": 1877,
"end_line": 1884
},
"code_lines": {
"start_line": 1884,
"end_line": 1928
},
"commit_date_time": "2023-12-13 09:56:56",
"commit_sha": "a562de514042d0d2c336088a0eba06920bf01f76",
"commit_message": "4.... | def fetch_deposit_address(self, code: str, params={}):
self.load_markets()
currency = self.currency(code)
+ rawNetwork = self.safe_string_upper(params, 'network')
+ params = self.omit(params, 'network')
request = {
'currency'... | fetch the deposit address for a currency associated with self account
:see: https://www.gate.io/docs/developers/apiv4/en/#generate-currency-deposit-address
:param str code: unified currency code
:param dict [params]: extra parameters specific to the exchange API endpoint
+ :param... | false | false | python/ccxt/gate.py | gate.py | ccxt | ccxt |
python_ccxt_gate.py | gate.fetch_order | [
{
"version": "v525",
"docstring_lines": {
"start_line": 3631,
"end_line": 3642
},
"code_lines": {
"start_line": 3642,
"end_line": 3666
},
"commit_date_time": "2023-05-27 11:43:59",
"commit_sha": "123e72663fc3f9f373473c21d19b47bd5a8b4460",
"commit_message": "Me... | def fetch_order(self, id: str, symbol: Optional[str] = None, params={}):
self.load_markets()
stop = self.safe_value_2(params, 'is_stop_order', 'stop', False)
params = self.omit(params, ['is_stop_order', 'stop'])
clientOrderId = self.safe_string_... | Retrieves information on an order
+ see https://www.gate.io/docs/developers/apiv4/en/#get-a-single-order
+ see https://www.gate.io/docs/developers/apiv4/en/#get-a-single-order-2
+ see https://www.gate.io/docs/developers/apiv4/en/#get-a-single-order-3
+ see https://www.gate.io/docs/deve... | false | false | python/ccxt/gate.py | gate.py | ccxt | ccxt |
python_ccxt_gate.py | gate.edit_order | [
{
"version": "v582",
"docstring_lines": {
"start_line": 3854,
"end_line": 3866
},
"code_lines": {
"start_line": 3866,
"end_line": 3919
},
"commit_date_time": "2023-11-12 11:59:28",
"commit_sha": "df3d45094f86ee922e15dc039191ccd6cf33e05a",
"commit_message": "Me... | def edit_order(self, id: str, symbol, type, side, amount=None, price=None, params={}):
self.load_markets()
market = self.market(symbol)
- if not market['spot']:
- raise BadRequest(self.id + ' editOrder() supports only spot markets')
ma... | edit a trade order, gate currently only supports the modification of the price or amount fields
:see: https://www.gate.io/docs/developers/apiv4/en/#amend-an-order
+ :see: https://www.gate.io/docs/developers/apiv4/en/#amend-an-order-2
:param str id: order id
:param str symbol: uni... | false | false | python/ccxt/gate.py | gate.py | ccxt | ccxt |
python_ccxt_gate.py | gate.fetch_funding_rate_history | [
{
"version": "v587",
"docstring_lines": {
"start_line": 6162,
"end_line": 6173
},
"code_lines": {
"start_line": 6173,
"end_line": 6230
},
"commit_date_time": "2023-11-16 12:46:12",
"commit_sha": "8d2f99100013351c73cf0629d66e28e7a2e45c0a",
"commit_message": "Me... | def fetch_funding_rate_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
- self.check_required_symbol('fetchFundingRateHistory', symbol)
+ if symbol is None:
+ raise ArgumentsRequired(self.id + ' fetchFundingRateHistory() r... | fetches historical funding rate prices
:see: https://www.gate.io/docs/developers/apiv4/en/#funding-rate-history
:param str symbol: unified symbol of the market to fetch the funding rate history for
:param int [since]: timestamp in ms of the earliest funding rate to fetch
- :param... | false | false | python/ccxt/gate.py | gate.py | ccxt | ccxt |
libs_langchain_langchain_load_serializable.py | Serializable.lc_attributes | [
{
"version": "v11",
"docstring_lines": {
"start_line": 61,
"end_line": 66
},
"code_lines": {
"start_line": 66,
"end_line": 70
},
"commit_date_time": "2023-09-28 14:24:51",
"commit_sha": "5c1f462bb95b6d87a3f7b727effee00a09046c74",
"commit_message": "Implement b... | def lc_attributes(self) -> Dict:
-
return {} | - Return a list of attribute names that should be included in the
? ^^^^^^^^^^
+ List of attribute names that should be included in the serialized kwargs.
? ^ +++++++++++++++++++
+
- serialized kwargs. These attributes must be accepted by the
? -----... | false | false | libs/langchain/langchain/load/serializable.py | serializable.py | langchain | langchain-ai |
python_ccxt_poloniexfutures.py | poloniexfutures.fetch_ohlcv | [
{
"version": "v104",
"docstring_lines": {
"start_line": 654,
"end_line": 664
},
"code_lines": {
"start_line": 664,
"end_line": 695
},
"commit_date_time": "2023-02-11 17:54:19",
"commit_sha": "9d6bfdbda6a0c0a7d5ce36fd1c912c6f097623df",
"commit_message": "2.7.87... | def fetch_ohlcv(self, symbol, timeframe='1m', since=None, limit=None, params={}):
self.load_markets()
market = self.market(symbol)
marketId = market['id']
+ parsedTimeframe = self.safe_integer(self.timeframes, timeframe)
request = {
... | fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
see https://futures-docs.poloniex.com/#k-chart
:param str symbol: unified symbol of the market to fetch OHLCV data for
:param str timeframe: the length of time each candle repr... | false | false | python/ccxt/poloniexfutures.py | poloniexfutures.py | ccxt | ccxt |
python_ccxt_poloniexfutures.py | poloniexfutures.set_margin_mode | [
{
"version": "v145",
"docstring_lines": {
"start_line": 1623,
"end_line": 1631
},
"code_lines": {
"start_line": 1631,
"end_line": 1642
},
"commit_date_time": "2024-02-02 16:44:39",
"commit_sha": "65b2462c6c260981a24e3cc5ac2fd72b3b6937b0",
"commit_message": "fi... | - def set_margin_mode(self, marginMode, symbol, params={}):
+ def set_margin_mode(self, marginMode: str, symbol: str = None, params={}):
? +++++ ++++++++++++
if symbol is None:
raise ArgumentsRequired(self.id + ' setMar... | set margin mode to 'cross' or 'isolated'
:see: https://futures-docs.poloniex.com/#change-margin-mode
- :param int marginMode: 0(isolated) or 1(cross)
? ^^
+ :param str marginMode: "0"(isolated) or "1"(cross)
? ^ + + + + +
:pa... | false | false | python/ccxt/poloniexfutures.py | poloniexfutures.py | ccxt | ccxt |
Lib_traceback.py | tb_lineno | [
{
"version": "v27",
"docstring_lines": {
"start_line": 280,
"end_line": 284
},
"code_lines": {
"start_line": 284,
"end_line": 302
},
"commit_date_time": "2002-06-02 03:04:52",
"commit_sha": "10ff706e2788a7c7ef9f8ea0108a5ede625fedad",
"commit_message": "Replace... | def tb_lineno(tb):
- # Coded by Marc-Andre Lemburg from the example of PyCode_Addr2Line()
- # in compile.c.
- # Revised version by Jim Hugunin to work with JPython too.
-
- c = tb.tb_frame.f_code
- if not hasattr(c, 'co_lnotab'):
- return tb.tb_lineno
? ----
+ return tb... | Calculate correct line number of traceback given in tb.
- Even works with -O on.
+ Obsolete in 2.3. | false | false | Lib/traceback.py | traceback.py | cpython | python |
Lib_traceback.py | print_exception | [
{
"version": "v14",
"docstring_lines": {
"start_line": 97,
"end_line": 105
},
"code_lines": {
"start_line": 105,
"end_line": 114
},
"commit_date_time": "2000-02-04 15:28:42",
"commit_sha": "e7b146fb3bdca62a0d5ecc06dbf3348e5a4fe757",
"commit_message": "The thir... | def print_exception(etype, value, tb, limit=None, file=None):
if not file:
file = sys.stderr
if tb:
- _print(file, 'Traceback (innermost last):')
? -----
+ _print(file, 'Traceback (most recent call last):')
? ++++++++++++
print_tb(tb, l... | Print exception information and up to 'limit' stack trace entries
from the traceback 'tb' to 'file'. This differs from print_tb() in
the following ways: (1) if traceback is not None, it prints a header
- "Traceback (innermost last):"; (2) it prints the exception type and
? -----
+ "Traceback (m... | false | false | Lib/traceback.py | traceback.py | cpython | python |
Lib_traceback.py | print_exc | [
{
"version": "v148",
"docstring_lines": {
"start_line": 181,
"end_line": 183
},
"code_lines": {
"start_line": 183,
"end_line": 184
},
"commit_date_time": "2023-05-01 07:32:04",
"commit_sha": "487f55d5801a9ae7d79d37e259e8c377c9acd39b",
"commit_message": "gh-103... | def print_exc(limit=None, file=None, chain=True):
- print_exception(*sys.exc_info(), limit=limit, file=file, chain=chain)
? - ^ --
+ print_exception(sys.exception(), limit=limit, file=file, chain=chain)
? ^^^ +
| - Shorthand for 'print_exception(*sys.exc_info(), limit, file, chain)'.
? - ^ --
+ Shorthand for 'print_exception(sys.exception(), limit, file, chain)'.
? ^^^ +
| false | false | Lib/traceback.py | traceback.py | cpython | python |
Lib_traceback.py | print_last | [
{
"version": "v146",
"docstring_lines": {
"start_line": 190,
"end_line": 192
},
"code_lines": {
"start_line": 192,
"end_line": 200
},
"commit_date_time": "2022-11-12 23:37:25",
"commit_sha": "57be5459593bbd09583317ebdafc4d58ae51dbf4",
"commit_message": "gh-991... | def print_last(limit=None, file=None, chain=True):
- if not hasattr(sys, "last_type"):
+ if not hasattr(sys, "last_exc") and not hasattr(sys, "last_type"):
raise ValueError("no last exception")
+
+ if hasattr(sys, "last_exc"):
+ print_exception(sys.last_exc, limit, file, chain)
+... | - This is a shorthand for 'print_exception(sys.last_type,
? ^^
+ This is a shorthand for 'print_exception(sys.last_exc, limit, file, chain)'.
? +++++++++ ^^^^^ +++++++++
- sys.last_value, sys.last_traceback, limi... | false | false | Lib/traceback.py | traceback.py | cpython | python |
Lib_traceback.py | format_tb | [
{
"version": "v84",
"docstring_lines": {
"start_line": 91,
"end_line": 93
},
"code_lines": {
"start_line": 93,
"end_line": 94
},
"commit_date_time": "2013-09-15 22:15:56",
"commit_sha": "173a157e725579eec1f28f8c9d53d6761ba6c79f",
"commit_message": "#1565525: A... | def format_tb(tb, limit=None):
- return format_list(extract_tb(tb, limit=limit))
? ------
+ return format_list(extract_tb(tb, limit)) | - A shorthand for 'format_list(extract_tb(tb, limit)).
+ A shorthand for 'format_list(extract_tb(tb, limit))'.
? +
| false | false | Lib/traceback.py | traceback.py | cpython | python |
Lib_traceback.py | FrameSummary.__init__ | [
{
"version": "v89",
"docstring_lines": {
"start_line": 298,
"end_line": 300
},
"code_lines": {
"start_line": 300,
"end_line": 301
},
"commit_date_time": "2015-03-05 02:45:01",
"commit_sha": "2f0441f03f71c658148bff60be46585f56670d1f",
"commit_message": "Remaini... | - def __init__(self, filename, lineno, name, lookup_line=True, locals=None,
? -------------
+ def __init__(self, filename, lineno, name, *, lookup_line=True,
? +++
- line=None):
+ locals=None,... | Construct a FrameSummary.
:param lookup_line: If True, `linecache` is consulted for the source
code line. Otherwise, the line will be looked up when first needed.
:param locals: If supplied the frame locals, which will be captured as
- strings.
+ object rep... | false | false | Lib/traceback.py | traceback.py | cpython | python |
rich_table.py | Table.add_column | [
{
"version": "v136",
"docstring_lines": {
"start_line": 513,
"end_line": 523
},
"code_lines": {
"start_line": 523,
"end_line": 547
},
"commit_date_time": "2021-01-23 14:30:54",
"commit_sha": "449c1fbb29cb65b3fa02c219ee7b983f82511f9a",
"commit_message": "optimi... | def add_column(
self,
header: "RenderableType" = "",
footer: "RenderableType" = "",
*,
header_style: StyleType = None,
footer_style: StyleType = None,
style: StyleType = None,
justify: "JustifyMethod" = "left",
overflow: "Overfl... | Add a column to the table.
Args:
header (RenderableType, optional): Text or renderable for the header.
Defaults to "".
footer (RenderableType, optional): Text or renderable for the footer.
Defaults to "".
- header_style (Union[st... | false | false | rich/table.py | table.py | rich | Textualize |
rich_table.py | Table.grid | [
{
"version": "v138",
"docstring_lines": {
"start_line": 211,
"end_line": 222
},
"code_lines": {
"start_line": 222,
"end_line": 233
},
"commit_date_time": "2021-01-26 22:13:11",
"commit_sha": "99e4f2863a39d535b15114040dcf8a09029a640a",
"commit_message": "optimi... | def grid(
cls,
+ *headers: Union[Column, str],
padding: PaddingDimensions = 0,
collapse_padding: bool = True,
pad_edge: bool = False,
expand: bool = False,
) -> "Table":
return cls(
+ *headers,
bo... | Get a table with no lines, headers, or footer.
Args:
+ *headers (Union[Column, str]): Column headers, either as a string, or :class:`~rich.table.Column` instance.
padding (PaddingDimensions, optional): Get padding around cells. Defaults to 0.
collapse_padding (bool... | false | false | rich/table.py | table.py | rich | Textualize |
rich_table.py | Table._calculate_column_widths | [
{
"version": "v78",
"docstring_lines": {
"start_line": 302,
"end_line": 369
},
"code_lines": {
"start_line": 369,
"end_line": 448
},
"commit_date_time": "2020-06-04 15:49:39",
"commit_sha": "2c9e2060210773e4b763feca8784cd69ac3d064e",
"commit_message": "overflo... | def _calculate_column_widths(
self, console: "Console", max_width: int, minimums: bool = False
) -> List[int]:
columns = self.columns
width_ranges = [
- self._measure_column(console, column_index, column, max_width)
? ... | - Calculate the widths of each column.
+ Calculate the widths of each column, including padding, not including borders. | false | false | rich/table.py | table.py | rich | Textualize |
Lib_pathlib__abc.py | PurePathBase.match | [
{
"version": "v211",
"docstring_lines": {
"start_line": 445,
"end_line": 448
},
"code_lines": {
"start_line": 448,
"end_line": 463
},
"commit_date_time": "2024-01-20 03:06:00",
"commit_sha": "1e610fb05fa4ba61a759b68461f1a9aed07622fc",
"commit_message": "GH-113... | def match(self, path_pattern, *, case_sensitive=None):
if not isinstance(path_pattern, PurePathBase):
path_pattern = self.with_segments(path_pattern)
if case_sensitive is None:
case_sensitive = _is_case_sensitive(self.pathmod)
... | - Return True if this path matches the given pattern.
+ Return True if this path matches the given pattern. If the pattern is
? ++++++++++++++++++
+ relative, matching is done from the right; otherwise, the entire path
+ is matched. The recursive wildc... | false | false | Lib/pathlib/_abc.py | _abc.py | cpython | python |
Lib_pathlib__abc.py | _select_recursive | [
{
"version": "v217",
"docstring_lines": {
"start_line": 93,
"end_line": 95
},
"code_lines": {
"start_line": 95,
"end_line": 120
},
"commit_date_time": "2024-02-06 02:48:18",
"commit_sha": "1b1f8398d0ffe3c8ba2cca79d0c0f19a6a34e72a",
"commit_message": "GH-106747... | - def _select_recursive(parent_paths, dir_only, follow_symlinks):
+ def _select_recursive(parent_paths, dir_only, follow_symlinks, match):
? +++++++
+
if follow_symlinks is None:
follow_symlinks = False
for parent_path in pa... | - Yield given paths and all their subdirectories, recursively.
? ^^^ - ^^^^^^^ ^
+ Yield given paths and all their children, recursively, filtering by
? ^^^^ ^ ^^^^^^^^^^^^^^
+ string and type. | false | false | Lib/pathlib/_abc.py | _abc.py | cpython | python |
python_ray_tune_schedulers_resource_changing_scheduler.py | evenly_distribute_cpus_gpus_distributed | [
{
"version": "v9",
"docstring_lines": {
"start_line": 213,
"end_line": 288
},
"code_lines": {
"start_line": 288,
"end_line": 321
},
"commit_date_time": "2022-01-30 02:41:57",
"commit_sha": "7f1bacc7dc9caf6d0ec042e39499bbf1d9a7d065",
"commit_message": "[CI] For... | def evenly_distribute_cpus_gpus_distributed(
trial_runner: "trial_runner.TrialRunner",
trial: Trial,
result: Dict[str, Any],
scheduler: "ResourceChangingScheduler",
) -> Union[None, PlacementGroupFactory]:
- return _DistributeResources(add_bundles=True)(
+ if log_onc... | - This is a basic resource allocating function.
+ This is a basic uniform resource allocating function.
? ++++++++
The function naively balances free resources (CPUs and GPUs) between
trials, giving them all equal priority, ensuring that all resources
are always being used. The free... | false | false | python/ray/tune/schedulers/resource_changing_scheduler.py | resource_changing_scheduler.py | ray | ray-project |
conans_test_integration_command_v2_test_cache_clean.py | test_cache_multiple_builds_same_prev_clean | [
{
"version": "v6",
"docstring_lines": {
"start_line": 62,
"end_line": 66
},
"code_lines": {
"start_line": 66,
"end_line": 87
},
"commit_date_time": "2023-07-11 09:20:34",
"commit_sha": "e7ead306037a3fb14e3a82b3da801b6b62b055c4",
"commit_message": "Tests/more r... | def test_cache_multiple_builds_same_prev_clean():
c = TestClient()
c.save({"conanfile.py": GenConanfile("pkg", "0.1")})
c.run("create .")
create_out = c.out
c.run("cache path pkg/0.1:da39a3ee5e6b4b0d3255bfef95601890afd80709")
path1 = str(c.stdout)
assert ... | - Different consecutive builds will create different folders, even if for the
? ---- ^ ^^ - --------
+ Different consecutive builds will create exactly the same folder, for the
? ^^^^^^^^^ ^^^^^
- same exact prev, leaving tra... | false | false | conans/test/integration/command_v2/test_cache_clean.py | test_cache_clean.py | conan | conan-io |
deepspeed___init__.py | add_config_arguments | [
{
"version": "v2",
"docstring_lines": {
"start_line": 110,
"end_line": 117
},
"code_lines": {
"start_line": 117,
"end_line": 120
},
"commit_date_time": "2020-02-03 18:55:19",
"commit_sha": "b18eae24e897f4844df33eb3688e206ff27cbf2b",
"commit_message": "Fixing f... | def add_config_arguments(parser):
- parser = add_core_arguments(parser)
+ parser = _add_core_arguments(parser)
? +
return parser | - r"""Updates the parser to parse DeepSpeed arguments
+ r"""Update the argument parser to enabling parsing of DeepSpeed command line arguments.
+ The set of DeepSpeed arguments include the following:
+ 1) --deepspeed: boolean flag to enable DeepSpeed
+ 2) --deepspeed_config <json file path>: pat... | false | false | deepspeed/__init__.py | __init__.py | DeepSpeed | microsoft |
deepspeed___init__.py | init_inference | [
{
"version": "v39",
"docstring_lines": {
"start_line": 247,
"end_line": 299
},
"code_lines": {
"start_line": 299,
"end_line": 329
},
"commit_date_time": "2022-08-30 23:39:34",
"commit_sha": "afdc72879f66c419ee02d32decf07185506bff85",
"commit_message": "Ds-infe... | def init_inference(model,
triangular_masking=True,
mp_size=1,
training_mp_size=1,
mpu=None,
ep_group=None,
expert_mp_group=None,
checkpoint=None,
dtyp... | Initialize the DeepSpeed InferenceEngine.
Arguments:
model: Required: nn.module class before apply any wrappers
triangular_masking: Required: this shows the type of masking for attention scores in transformer layer
note that the masking is application specific.
... | false | false | deepspeed/__init__.py | __init__.py | DeepSpeed | microsoft |
deepspeed___init__.py | initialize | [
{
"version": "v26",
"docstring_lines": {
"start_line": 69,
"end_line": 117
},
"code_lines": {
"start_line": 117,
"end_line": 159
},
"commit_date_time": "2021-05-24 08:10:39",
"commit_sha": "ed3de0c21b1fea330de9c1a78a23ca33f340ef20",
"commit_message": "Quantiza... | def initialize(args=None,
- model=None,
- optimizer=None,
- model_parameters=None,
- training_data=None,
- lr_scheduler=None,
+ model: torch.nn.Module = None,
+ optimizer: Optional[Union[Optimizer,
+ ... | Initialize the DeepSpeed Engine.
Arguments:
args: an object containing local_rank and deepspeed_config fields.
This is optional if `config` is passed.
model: Required: nn.module class before apply any wrappers
- optimizer: Optional: a user defined optimizer, th... | false | false | deepspeed/__init__.py | __init__.py | DeepSpeed | microsoft |
official_core_input_reader.py | InputReader.__init__ | [
{
"version": "v46",
"docstring_lines": {
"start_line": 232,
"end_line": 258
},
"code_lines": {
"start_line": 258,
"end_line": 347
},
"commit_date_time": "2023-04-05 07:51:48",
"commit_sha": "c47682c9381220a5030a8802ee6a60de5e69eba3",
"commit_message": "Interna... | - def __init__(self,
? -----
+ def __init__(
+ self,
- params: cfg.DataConfig,
? ---------
+ params: cfg.DataConfig,
- dataset_fn=tf.data.TFRecordDataset,
? ---------
+ dataset_fn=tf.data.TFRecordDataset,
- decoder_fn: Optional[Callable[...,... | Initializes an InputReader instance.
Args:
params: A config_definitions.DataConfig object.
dataset_fn: A `tf.data.Dataset` that consumes the input files. For
example, it can be `tf.data.TFRecordDataset`.
decoder_fn: An optional `callable` that takes the serialized data strin... | false | false | official/core/input_reader.py | input_reader.py | models | tensorflow |
openbb_platform_openbb_package_index.py | ROUTER_index.market | [
{
"version": "v20",
"docstring_lines": {
"start_line": 199,
"end_line": 288
},
"code_lines": {
"start_line": 288,
"end_line": 316
},
"commit_date_time": "2024-02-22 19:06:57",
"commit_sha": "274a027bf55104c64c86b35b457c66e6fad85943",
"commit_message": "[Featur... | def market(
self,
symbol: Annotated[
Union[str, List[str]],
OpenBBCustomParameter(
- description="Symbol to get data for. Multiple items allowed: yfinance."
+ description="Symbol to get data for. Multiple items allowed for provider(s): yf... | Historical Market Indices.
Parameters
----------
symbol : Union[str, List[str]]
- Symbol to get data for. Multiple items allowed: yfinance.
+ Symbol to get data for. Multiple items allowed for provider(s): yfinance.
? ... | false | false | openbb_platform/openbb/package/index.py | index.py | OpenBBTerminal | OpenBB-finance |
openbb_platform_openbb_package_index.py | ROUTER_index.available | [
{
"version": "v8",
"docstring_lines": {
"start_line": 21,
"end_line": 21
},
"code_lines": {
"start_line": 22,
"end_line": 24
},
"commit_date_time": "2023-12-15 14:08:15",
"commit_sha": "324d2abd664c7915222ee656844b32af5d8ae84a",
"commit_message": "sync descrip... | - def available(self, provider: Optional[Literal["fmp"]] = None, **kwargs) -> OBBject:
+ def available(
+ self, provider: Optional[Literal["fmp", "yfinance"]] = None, **kwargs
+ ) -> OBBject:
# noqa: E501
return self._run(
"/index/available",
*... | Available Indices. Available indices for a given provider.
Parameters
----------
- provider : Optional[Literal['fmp']]
+ provider : Optional[Literal['fmp', 'yfinance']]
? ++++++++++++
The provider to use for the query, by d... | false | false | openbb_platform/openbb/package/index.py | index.py | OpenBBTerminal | OpenBB-finance |
luigi_scheduler.py | CentralPlannerScheduler.__init__ | [
{
"version": "v95",
"docstring_lines": {
"start_line": 421,
"end_line": 429
},
"code_lines": {
"start_line": 429,
"end_line": 442
},
"commit_date_time": "2015-02-15 03:33:32",
"commit_sha": "b08b5d263bb71acc2ca6d63ebf1cef69f839a3eb",
"commit_message": "top10ar... | - def __init__(self, config=None, resources=None, task_history=None, **kwargs):
+ def __init__(self, config=None, resources=None, task_history_impl=None, **kwargs):
? +++++
self._config = config or scheduler(**kwargs... | - (all arguments are in seconds)
- Keyword Arguments:
? --------
+ Keyword Arguments:
+ :param config: an object of class "scheduler" or None (in which the global instance will be used)
+ :param resources: a dict of str->int constraints
+ :param task_history_override: ignore config and ... | false | false | luigi/scheduler.py | scheduler.py | luigi | spotify |
chainer_device_resident.py | DeviceResident.device | [
{
"version": "v5",
"docstring_lines": {
"start_line": 37,
"end_line": 39
},
"code_lines": {
"start_line": 39,
"end_line": 52
},
"commit_date_time": "2019-03-12 09:46:36",
"commit_sha": "eeacfa7f31281e01a476f7dbeb0996c6b26bea09",
"commit_message": "Rename _link... | def device(self):
- if self._device is None:
- visitor = _GetSoleDeviceVisitor()
- self.device_resident_accept(visitor)
- sole_device = visitor.sole_device
- if sole_device is None:
- self._device = self._MIXED_DEVICE
- els... | - Returns the sole device
? -----
+ Returns the device | false | false | chainer/device_resident.py | device_resident.py | chainer | chainer |
chainer_device_resident.py | DeviceResident.to_gpu | [
{
"version": "v17",
"docstring_lines": {
"start_line": 76,
"end_line": 89
},
"code_lines": {
"start_line": 89,
"end_line": 99
},
"commit_date_time": "2019-04-10 07:10:24",
"commit_sha": "1d70566c4dba04559275640b1ff0d0850056e4b4",
"commit_message": "Fix stack o... | def to_gpu(
self,
device=None, # type: tp.Optional[types.CudaDeviceSpec]
):
# type: (...) -> 'DeviceResident'
cuda.check_cuda_available()
cuda_device = cuda._get_device_or_current(device)
device = chainer.backends.cuda... | Copies parameter variables and persistent values to GPU.
This method does not handle non-registered attributes. If some of such
attributes must be copied to GPU, the link implementation must
override :meth:`Link.to_device` to do so.
+ .. warning::
+
+ This meth... | false | false | chainer/device_resident.py | device_resident.py | chainer | chainer |
chainer_device_resident.py | DeviceResident.device_resident_accept | [
{
"version": "v22",
"docstring_lines": {
"start_line": 83,
"end_line": 96
},
"code_lines": {
"start_line": 96,
"end_line": 106
},
"commit_date_time": "2019-05-22 02:05:52",
"commit_sha": "214a1a02480024faf8184f94f79bf272eac549aa",
"commit_message": "Check devi... | def device_resident_accept(self, visitor):
-
visitor.visit_device_resident(self) | Applies the visitor to all the device objects in this instance.
-
- Args:
- visitor(~chainer.device_resident.DeviceResidentsVisitor): Visitor.
-
- This method should be overridden if the concrete class has custom
- sub-hierarchy of device resident objects. | false | false | chainer/device_resident.py | device_resident.py | chainer | chainer |
chainer_device_resident.py | DeviceResident.to_intel64 | [
{
"version": "v28",
"docstring_lines": {
"start_line": 94,
"end_line": 112
},
"code_lines": {
"start_line": 112,
"end_line": 122
},
"commit_date_time": "2019-08-15 15:43:33",
"commit_sha": "9441f36558a8d62f097b221a0edd9d7647e3248e",
"commit_message": "Raise Fu... | def to_intel64(self):
# type: () -> 'DeviceResident'
+
+
intel64.check_ideep_available()
visitor = _ToDeviceVisitor(
chainer.get_device(intel64.Intel64Device()),
entry_method_info=('to_intel64', {}),
starting_device_resident=... | Copies parameter variables and persistent values to CPU.
+
+ .. deprecated:: v7.0.0
+ Use :meth:`to_device` instead. | false | false | chainer/device_resident.py | device_resident.py | chainer | chainer |
rllib_utils_exploration_epsilon_greedy.py | EpsilonGreedy._get_tf_exploration_action_op | [
{
"version": "v4",
"docstring_lines": {
"start_line": 156,
"end_line": 161
},
"code_lines": {
"start_line": 161,
"end_line": 163
},
"commit_date_time": "2020-03-01 19:53:35",
"commit_sha": "83e06cd30a45245c2cb0e9f4bd924224b1581554",
"commit_message": "[RLlib] ... | def _get_tf_exploration_action_op(self, q_values, explore, timestep):
epsilon = self.epsilon_schedule(timestep if timestep is not None else
self.last_timestep)
# Get the exploit action as the one with the highest logit value.
... | - Tf method to produce the tf op for an epsilon exploration action.
? ^
+ TF method to produce the tf op for an epsilon exploration action.
? ^
Args:
q_values (Tensor): The Q-values coming from some q-model.
Returns:
tf.Tensor: The tf exploration-action op. | false | false | rllib/utils/exploration/epsilon_greedy.py | epsilon_greedy.py | ray | ray-project |
readthedocs_search_parsers.py | BaseParser._get_main_node | [
{
"version": "v4",
"docstring_lines": {
"start_line": 62,
"end_line": 73
},
"code_lines": {
"start_line": 73,
"end_line": 85
},
"commit_date_time": "2020-06-23 03:12:31",
"commit_sha": "9d5387d7f861217f18261dca692cccc6d988e3c5",
"commit_message": "Search: inde... | def _get_main_node(self, html):
body = html.body
main_node = body.css_first('[role=main]')
+ if main_node:
+ return main_node
+
+ main_node = body.css_first('main')
if main_node:
return main_node
# T... | Gets the main node from where to start indexing content.
The main node is tested in the following order:
- Try with a tag with the ``main`` role.
This role is used by several static sites and themes.
+ - Try the ``main`` tag.
- Try the first ``h1`` node and retu... | false | false | readthedocs/search/parsers.py | parsers.py | readthedocs.org | readthedocs |
readthedocs_search_parsers.py | GenericParser._is_section | [
{
"version": "v12",
"docstring_lines": {
"start_line": 195,
"end_line": 207
},
"code_lines": {
"start_line": 207,
"end_line": 217
},
"commit_date_time": "2022-06-16 19:14:27",
"commit_sha": "fe2f79c7624525f91cf8743f314ec0dc644ff7a7",
"commit_message": "Search:... | def _is_section(self, tag):
- is_header_tag = re.match(r'h\d$', tag.tag)
? ----- ^ ^
+ is_h_tag = re.match(r"h\d$", tag.tag)
? ^ ^
- return is_header_tag
+ return is_h_tag or tag.tag == "h... | Check if `tag` is a section (linkeable header).
- The tag is a section if it's a ``h`` tag.
+ The tag is a section if it's a ``h`` or a ``header`` tag.
? ++++++++++++++++
| false | false | readthedocs/search/parsers.py | parsers.py | readthedocs.org | readthedocs |
readthedocs_search_parsers.py | BaseParser._parse_section_content | [
{
"version": "v2",
"docstring_lines": {
"start_line": 134,
"end_line": 136
},
"code_lines": {
"start_line": 136,
"end_line": 148
},
"commit_date_time": "2020-06-23 01:51:33",
"commit_sha": "5080adcb2a9ce54c1d65ce1f28af6fd8c0641355",
"commit_message": "Search: ... | - def _parse_section_content(self, tag):
+ def _parse_section_content(self, tag, *, depth=0):
? ++++++++++++
+
+
contents = []
+ section_found = False
+
next_tag = tag
+ while next_tag:
- while next_tag and no... | Gets the content from tag till before a new section.
+
+ if depth > 0, recursively check for sections in all tag's children.
+
+ Returns a tuple with: the parsed content,
+ and a boolean indicating if a section was found. | false | false | readthedocs/search/parsers.py | parsers.py | readthedocs.org | readthedocs |
readthedocs_search_parsers.py | SphinxParser._generate_domains_data | [
{
"version": "v5",
"docstring_lines": {
"start_line": 416,
"end_line": 427
},
"code_lines": {
"start_line": 427,
"end_line": 448
},
"commit_date_time": "2020-08-17 19:00:48",
"commit_sha": "46381677dfbf93958be04e8ab272b231aa439ca9",
"commit_message": "Search: ... | def _generate_domains_data(self, body):
domain_data = {}
dl_tags = body.css('dl')
+ number_of_domains = 0
for dl_tag in dl_tags:
dt = dl_tag.css('dt')
dd = dl_tag.css('dd')
# len(dt) should be ... | Generate sphinx domain objects' docstrings.
Returns a dict with the generated data.
The returned dict is in the following form::
{
"domain-id-1": "docstrings for the domain-id-1",
"domain-id-2": "docstrings for the domain-id-2",
... | false | false | readthedocs/search/parsers.py | parsers.py | readthedocs.org | readthedocs |
readthedocs_search_parsers.py | GenericParser._clean_body | [
{
"version": "v15",
"docstring_lines": {
"start_line": 467,
"end_line": 474
},
"code_lines": {
"start_line": 474,
"end_line": 493
},
"commit_date_time": "2022-11-21 22:51:43",
"commit_sha": "a609d9a7c5af47ff750f4b0863f42bcb8ebad662",
"commit_message": "Search:... | def _clean_body(self, body):
nodes_to_be_removed = itertools.chain(
# Navigation nodes
body.css('nav'),
body.css('[role=navigation]'),
body.css('[role=search]'),
# Permalinks
body.css('.heade... | Removes nodes with irrelevant content before parsing its sections.
+
+ This method is documented here:
+ https://dev.readthedocs.io/page/search-integration.html#irrelevant-content
.. warning::
This will mutate the original `body`. | false | false | readthedocs/search/parsers.py | parsers.py | readthedocs.org | readthedocs |
Lib_imaplib.py | IMAP4.recent | [
{
"version": "v5",
"docstring_lines": {
"start_line": 444,
"end_line": 449
},
"code_lines": {
"start_line": 449,
"end_line": 457
},
"commit_date_time": "1998-05-05 03:08:46",
"commit_sha": "a986bb7e5c9597b4e9407502795e20f4a8855699",
"commit_message": "Take out... | def recent(self):
name = 'RECENT'
typ, dat = self._untagged_response('OK', name)
if dat[-1]:
return typ, dat
+ self.untagged_responses = {}
typ, dat = self._simple_command('NOOP')
return self._untagged_response(typ, name) | Prompt server for an update.
+
+ Flush all untagged responses.
(typ, [data]) = <instance>.recent()
'data' is None if no new messages,
else value of RECENT response. | false | false | Lib/imaplib.py | imaplib.py | cpython | python |
Lib_imaplib.py | IMAP4.select | [
{
"version": "v77",
"docstring_lines": {
"start_line": 626,
"end_line": 637
},
"code_lines": {
"start_line": 637,
"end_line": 656
},
"commit_date_time": "2005-07-05 04:20:07",
"commit_sha": "2dfc168bc3b92a0087a3a619b7f793240528936a",
"commit_message": "fixed t... | - def select(self, mailbox='INBOX', readonly=None):
? ^^^
+ def select(self, mailbox='INBOX', readonly=False):
? ^^^^
self.untagged_responses = {} # Flush old responses.
self.is_readonly ... | Select a mailbox.
Flush all untagged responses.
- (typ, [data]) = <instance>.select(mailbox='INBOX', readonly=None)
? ^^^
+ (typ, [data]) = <instance>.select(mailbox='INBOX', readonly=False)
? ... | false | false | Lib/imaplib.py | imaplib.py | cpython | python |
Lib_imaplib.py | IMAP4.open | [
{
"version": "v48",
"docstring_lines": {
"start_line": 1009,
"end_line": 1013
},
"code_lines": {
"start_line": 1013,
"end_line": 1017
},
"commit_date_time": "2002-06-01 14:18:47",
"commit_sha": "54f0222547b1e92cd018ef132307a6f793dc9505",
"commit_message": "SF ... | - def open(self, host, port):
+ def open(self, host = '', port = IMAP4_PORT):
? +++++ +++++++++++++
+ self.host = host
+ self.port = port
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- self.sock.connect((self.host, self.po... | - Setup connection to remote server on "host:port".
? -
+ Setup connection to remote server on "host:port"
+ (default: localhost:standard IMAP4 port).
This connection will be used by the routines:
read, readline, send, shutdown. | false | false | Lib/imaplib.py | imaplib.py | cpython | python |
Lib_imaplib.py | IMAP4.authenticate | [
{
"version": "v9",
"docstring_lines": {
"start_line": 676,
"end_line": 676
},
"code_lines": {
"start_line": 677,
"end_line": 690
},
"commit_date_time": "1998-05-29 18:08:48",
"commit_sha": "d659693b5b44ca8a8fa00945514ce9895132a0b3",
"commit_message": "Improve ... | - def authenticate(self, func):
+ def authenticate(self, mechanism, authobject):
- raise self.error('UNIMPLEMENTED')
+ mech = string.upper(mechanism)
+ cap = 'AUTH=%s' % mech
+ if not cap in self.capabilities:
+ raise self.error("Server doesn't allow %s authentication." % mech)
+ self.literal = _... | Authenticate command - requires response processing.
- UNIMPLEMENTED
+ 'mechanism' specifies which authentication mechanism is to
+ be used - it must appear in <instance>.capabilities in the
+ form AUTH=<mechanism>.
+
+ 'authobject' must be a callable object:
+
+ data = authobject(response)
+
+ I... | false | false | Lib/imaplib.py | imaplib.py | cpython | python |
Lib_imaplib.py | IMAP4.append | [
{
"version": "v13",
"docstring_lines": {
"start_line": 361,
"end_line": 365
},
"code_lines": {
"start_line": 365,
"end_line": 371
},
"commit_date_time": "1998-10-21 22:06:56",
"commit_sha": "04da10c7a2fa0bd060e8052a9fe3d47623324b94",
"commit_message": "Piers L... | def append(self, mailbox, flags, date_time, message):
name = 'APPEND'
+ if not mailbox:
+ mailbox = 'INBOX'
if flags:
if (flags[0],flags[-1]) != ('(',')'):
flags = '(%s)' % flags
else:
flags = None
if date_time:
date_time = Time2Internaldate(date_time)
else:
... | Append message to named mailbox.
(typ, [data]) = <instance>.append(mailbox, flags, date_time, message)
+
+ All args except `message' can be None. | false | false | Lib/imaplib.py | imaplib.py | cpython | python |
Lib_imaplib.py | IMAP4.search | [
{
"version": "v160",
"docstring_lines": {
"start_line": 651,
"end_line": 657
},
"code_lines": {
"start_line": 657,
"end_line": 664
},
"commit_date_time": "2015-07-30 20:59:02",
"commit_sha": "5ccc18f29844b55a43bf8f26dffeb39057477dea",
"commit_message": "Issue ... | def search(self, charset, *criteria):
name = 'SEARCH'
if charset:
+ if self.utf8_enabled:
+ raise IMAP4.error("Non-None charset not valid in UTF8 mode")
typ, dat = self._simple_command(name, 'CHARSET', charset, *criteria)
el... | Search mailbox for matching messages.
(typ, [data]) = <instance>.search(charset, criterion, ...)
'data' is space separated list of matching message numbers.
+ If UTF8 is enabled, charset MUST be None. | false | false | Lib/imaplib.py | imaplib.py | cpython | python |
Lib_imaplib.py | IMAP4.store | [
{
"version": "v20",
"docstring_lines": {
"start_line": 506,
"end_line": 510
},
"code_lines": {
"start_line": 510,
"end_line": 513
},
"commit_date_time": "2000-03-28 21:45:46",
"commit_sha": "93a7c0fe6b2186448ebe35a5af0ac3880d8f16fc",
"commit_message": "Fredrik... | - def store(self, message_set, command, flag_list):
? --- -
+ def store(self, message_set, command, flags):
+ if (flags[0],flags[-1]) != ('(',')'):
+ flags = '(%s)' % flags # Avoid quoting the flags
- typ, dat = self._simple_command('STORE', message_set, comma... | Alters flag dispositions for messages in mailbox.
- (typ, [data]) = <instance>.store(message_set, command, flag_list)
? --- -
+ (typ, [data]) = <instance>.store(message_set, command, flags) | false | false | Lib/imaplib.py | imaplib.py | cpython | python |
Lib_imaplib.py | Time2Internaldate | [
{
"version": "v155",
"docstring_lines": {
"start_line": 1393,
"end_line": 1402
},
"code_lines": {
"start_line": 1402,
"end_line": 1478
},
"commit_date_time": "2014-09-30 14:00:09",
"commit_sha": "fd9262cf2a044f6909530cdb565f38e13ff98263",
"commit_message": "Is... | def Time2Internaldate(date_time):
-
if isinstance(date_time, (int, float)):
- tt = time.localtime(date_time)
+ dt = datetime.fromtimestamp(date_time,
+ timezone.utc).astimezone()
- elif isinstance(date_time, (tuple, time.struct_time)):
? ... | Convert date_time to IMAP4 INTERNALDATE representation.
Return string in form: '"DD-Mmm-YYYY HH:MM:SS +HHMM"'. The
date_time argument can be a number (int or float) representing
seconds since epoch (as returned by time.time()), a 9-tuple
- representing local time (as returned by time.localti... | false | false | Lib/imaplib.py | imaplib.py | cpython | python |
homeassistant_helpers_discovery.py | async_load_platform | [
{
"version": "v6",
"docstring_lines": {
"start_line": 112,
"end_line": 127
},
"code_lines": {
"start_line": 127,
"end_line": 153
},
"commit_date_time": "2016-11-18 22:35:08",
"commit_sha": "c56f99baafac33483dd13699993d7da4ee5d7efd",
"commit_message": "Async mi... | def async_load_platform(hass, component, platform, discovered=None,
hass_config=None):
did_lock = False
+ if component not in hass.config.components:
- setup_lock = hass.data.get('setup_lock')
+ setup_lock = hass.data.get('setup_lock')
? ++++
- if set... | Load a component and platform dynamically.
Target components will be loaded and an EVENT_PLATFORM_DISCOVERED will be
fired to load the platform. The event will contain:
{ ATTR_SERVICE = LOAD_PLATFORM + '.' + <<component>>
ATTR_PLATFORM = <<platform>>
ATTR_DISCOVERED = ... | false | false | homeassistant/helpers/discovery.py | discovery.py | core | home-assistant |
lib_gui_display_analysis.py | Analysis.reset_session | [
{
"version": "v2",
"docstring_lines": {
"start_line": 423,
"end_line": 425
},
"code_lines": {
"start_line": 425,
"end_line": 436
},
"commit_date_time": "2018-12-06 12:22:19",
"commit_sha": "dacbcf38785a3ff0914084aa04ff080edc9d1972",
"commit_message": "Log GUI ... | def reset_session(self):
+ logger.debug("Reset current training session")
self.clear_session()
- if self.session.stats["iterations"] == 0:
+ session = get_config().session
+ if not session.initialized:
+ logger.debug("Training not running")
... | - Load previously saved sessions
+ Reset currently training sessions | false | false | lib/gui/display_analysis.py | display_analysis.py | faceswap | deepfakes |
lib_gui_display_analysis.py | Options.set_help | [
{
"version": "v19",
"docstring_lines": {
"start_line": 77,
"end_line": 79
},
"code_lines": {
"start_line": 79,
"end_line": 81
},
"commit_date_time": "2019-10-06 00:11:28",
"commit_sha": "5887cb5ac40c7c990e9a03d49fb708a490139de2",
"commit_message": "GUI Bugfix:... | def set_help(btntype):
logger.debug("Setting help")
hlp = ""
- if btntype == "reset":
? ^^^
+ if btntype == "reload":
? ^^^^
hlp = "Load/Refresh stats for the currently training session"
elif b... | - Set the helptext for option buttons
+ Set the help text for option buttons
? +
| false | false | lib/gui/display_analysis.py | display_analysis.py | faceswap | deepfakes |
lib_gui_display_analysis.py | Analysis.set_vars | [
{
"version": "v21",
"docstring_lines": {
"start_line": 56,
"end_line": 58
},
"code_lines": {
"start_line": 58,
"end_line": 60
},
"commit_date_time": "2019-12-31 17:27:45",
"commit_sha": "497779d2930c74b6099c1dc44c8f1e96edbf8d67",
"commit_message": "lib.gui\nCe... | def set_vars(self):
-
? -
+
+
- selected_id = tk.StringVar()
? - -
+ return dict(selected_id=tk.StringVar(),
? ++++++++++++ +
- return {"selected_id": selected_id}
+ refresh_graph=... | - Analysis specific vars
+ Set the analysis specific tkinter variables to :attr:`vars`.
+
+ The tracked variables are the global variables that:
+ * Trigger when a graph refresh has been requested.
+ * Trigger training is commenced or halted
+ * The variable holding the loca... | false | false | lib/gui/display_analysis.py | display_analysis.py | faceswap | deepfakes |
lib_gui_display_analysis.py | Analysis._set_callbacks | [
{
"version": "v22",
"docstring_lines": {
"start_line": 424,
"end_line": 426
},
"code_lines": {
"start_line": 426,
"end_line": 433
},
"commit_date_time": "2020-08-12 09:36:41",
"commit_sha": "d8557c1970939ee9bb90bd41edcd86c6fcf84d19",
"commit_message": "Faceswa... | def _set_callbacks(self):
self.vars["refresh_graph"].trace("w", self._update_current_session)
- self.vars["is_training"].trace("w", self._remove_current_session)
self.vars["analysis_folder"].trace("w", self._populate_from_folder) | Adds callbacks to update the analysis summary statistics and add them to :attr:`vars`
Training graph refresh - Updates the stats for the current training session when the graph
has been updated.
- When training is commenced - Removes the currently displayed session.
-
When... | false | false | lib/gui/display_analysis.py | display_analysis.py | faceswap | deepfakes |
python_ray_autoscaler__private_commands.py | attach_cluster | [
{
"version": "v104",
"docstring_lines": {
"start_line": 988,
"end_line": 1064
},
"code_lines": {
"start_line": 1064,
"end_line": 1082
},
"commit_date_time": "2020-10-09 19:34:29",
"commit_sha": "5ef1784024a3a049399fcc3f202c9a70e2b8dcb4",
"commit_message": "[Au... | def attach_cluster(config_file: str,
start: bool,
use_screen: bool,
use_tmux: bool,
override_cluster_name: Optional[str],
no_config_cache: bool = False,
new: bool = False,
- ... | Attaches to a screen for the specified cluster.
Arguments:
config_file: path to the cluster yaml
start: whether to start the cluster if it isn't up
use_screen: whether to use screen as multiplexer
use_tmux: whether to use tmux as multiplexer
override_cluster_... | false | false | python/ray/autoscaler/_private/commands.py | commands.py | ray | ray-project |
python_ray_autoscaler__private_commands.py | _get_running_head_node | [
{
"version": "v145",
"docstring_lines": {
"start_line": 1089,
"end_line": 1196
},
"code_lines": {
"start_line": 1196,
"end_line": 1366
},
"commit_date_time": "2021-08-06 03:18:42",
"commit_sha": "add6ceb3ec958834da53e28fe3fa2dea68992c7c",
"commit_message": "[D... | - def _get_running_head_node(config: Dict[str, Any],
+ def _get_running_head_node(
+ config: Dict[str, Any],
- printable_config_file: str,
? -------------------
+ printable_config_file: str,
- override_cluster_name: Optional[str],
? ----------------... | - Get a valid, running head node
+ Get a valid, running head node.
? +
+ Args:
+ config (Dict[str, Any]): Cluster Config dictionary
+ printable_config_file (str): Used for printing formatted CLI commands.
+ override_cluster_name (str): Passed to `get_or_create_... | false | false | python/ray/autoscaler/_private/commands.py | commands.py | ray | ray-project |
sklearn_model_selection__plot.py | LearningCurveDisplay.from_estimator | [
{
"version": "v7",
"docstring_lines": {
"start_line": 335,
"end_line": 495
},
"code_lines": {
"start_line": 495,
"end_line": 535
},
"commit_date_time": "2024-02-21 10:19:02",
"commit_sha": "e125e67bce7811eefb6f449918dc6aba596678ee",
"commit_message": "MAINT cl... | def from_estimator(
cls,
estimator,
X,
y,
*,
groups=None,
train_sizes=np.linspace(0.1, 1.0, 5),
cv=None,
scoring=None,
exploit_incremental_learning=False,
n_jobs=None,
pre_dispatch="all",
... | Create a learning curve display from an estimator.
Read more in the :ref:`User Guide <visualizations>` for general
information about the visualization API and :ref:`detailed
documentation <learning_curve>` regarding the learning curve
visualization.
Parameters
... | false | false | sklearn/model_selection/_plot.py | _plot.py | scikit-learn | scikit-learn |
src_lightning_pytorch_strategies_xla.py | XLAStrategy.all_gather | [
{
"version": "v144",
"docstring_lines": {
"start_line": 245,
"end_line": 254
},
"code_lines": {
"start_line": 254,
"end_line": 261
},
"commit_date_time": "2023-04-18 16:52:36",
"commit_sha": "47726391adc82efe3e0eadd333eba9813ad109e2",
"commit_message": "[TPU] ... | def all_gather(self, tensor: Tensor, group: Optional[Any] = None, sync_grads: bool = False) -> Tensor:
- if isinstance(tensor, Tensor) and tensor.dim() == 0:
+ if not self._launched:
+ return tensor
+ if not isinstance(tensor, Tensor):
+ raise NotI... | Function to gather a tensor from several distributed processes.
Args:
- tensor: tensor of shape (batch, ...)
- group: not available with TPUs
+ tensor: tensor to all-gather.
+ group: unused.
- sync_grads: flag that allows users to synchronize gr... | false | false | src/lightning/pytorch/strategies/xla.py | xla.py | pytorch-lightning | Lightning-AI |
Lib_email_quoprimime.py | header_encode | [
{
"version": "v22",
"docstring_lines": {
"start_line": 116,
"end_line": 143
},
"code_lines": {
"start_line": 143,
"end_line": 177
},
"commit_date_time": "2009-07-11 14:37:20",
"commit_sha": "c42f0addef96435f887b8e47719ccca5fd761bec",
"commit_message": "Merged ... | + def header_encode(header_bytes, charset='iso-8859-1'):
- def header_encode(header, charset="iso-8859-1", keep_eols=False,
- maxlinelen=76, eol=NL):
# Return empty headers unchanged
- if not header:
+ if not header_bytes:
? ++++++
- return header
... | Encode a single header line with quoted-printable (like) encoding.
Defined in RFC 2045, this `Q' encoding is similar to quoted-printable, but
used specifically for email header fields to allow charsets with mostly 7
bit characters (and some 8 bit) to remain more or less readable in non-RFC
... | false | false | Lib/email/quoprimime.py | quoprimime.py | cpython | python |
Lib_email_quoprimime.py | header_decode | [
{
"version": "v28",
"docstring_lines": {
"start_line": 315,
"end_line": 321
},
"code_lines": {
"start_line": 321,
"end_line": 323
},
"commit_date_time": "2011-03-24 16:19:26",
"commit_sha": "b938c8c25316b69f1d5df2c7880a9f6b87e7c2fa",
"commit_message": "#11606:... | def header_decode(s):
s = s.replace('_', ' ')
- return re.sub(r'=[a-fA-F0-9]{2}', _unquote_match, s, re.ASCII)
+ return re.sub(r'=[a-fA-F0-9]{2}', _unquote_match, s, flags=re.ASCII)
? ++++++
| Decode a string encoded with RFC 2045 MIME header `Q' encoding.
This function does not parse a full MIME header value encoded with
quoted-printable (like =?iso-8895-1?q?Hello_World?=) -- please use
- the high level email.Header class for that functionality.
? ^
+ the h... | false | false | Lib/email/quoprimime.py | quoprimime.py | cpython | python |
Lib_email_quoprimime.py | body_encode | [
{
"version": "v27",
"docstring_lines": {
"start_line": 152,
"end_line": 163
},
"code_lines": {
"start_line": 163,
"end_line": 228
},
"commit_date_time": "2011-03-23 19:25:55",
"commit_sha": "cafd79d904d19e90af375dbee43668f7dbf733d0",
"commit_message": "#11590:... | def body_encode(body, maxlinelen=76, eol=NL):
+
+
+ if maxlinelen < 4:
+ raise ValueError("maxlinelen must be at least 4")
if not body:
return body
+ # The last line may or may not end in eol, but all other lines do.
+ last_has_eol = (body[-1] in '\r\n')
- # ... | Encode with quoted-printable, wrapping at maxlinelen characters.
Each line of encoded text will end with eol, which defaults to "\\n". Set
this to "\\r\\n" if you will be using the result of this function directly
in an email.
- Each line will be wrapped at, at most, maxlinelen characters... | false | false | Lib/email/quoprimime.py | quoprimime.py | cpython | python |
ft_client_freqtrade_client_ft_rest_client.py | FtRestClient.pair_candles | [
{
"version": "v84",
"docstring_lines": {
"start_line": 401,
"end_line": 408
},
"code_lines": {
"start_line": 408,
"end_line": 415
},
"commit_date_time": "2024-03-31 07:37:52",
"commit_sha": "dcb9d5d611296a841a96b4c87780b7819fa2933c",
"commit_message": "Ft Rest... | - def pair_candles(self, pair, timeframe, limit=None):
+ def pair_candles(self, pair, timeframe, limit=None, columns=None):
? ++++++++++++++
params = {
"pair": pair,
"timeframe": timeframe,
}
... | Return live dataframe for <pair><timeframe>.
:param pair: Pair to get data for
:param timeframe: Only pairs with this timeframe available.
:param limit: Limit result to the last n candles.
+ :param columns: List of dataframe columns to return. Empty list will return OHLCV.
... | false | false | ft_client/freqtrade_client/ft_rest_client.py | ft_rest_client.py | freqtrade | freqtrade |
python_ccxt_cex.py | cex.create_order | [
{
"version": "v218",
"docstring_lines": {
"start_line": 721,
"end_line": 733
},
"code_lines": {
"start_line": 733,
"end_line": 794
},
"commit_date_time": "2023-12-01 21:17:06",
"commit_sha": "6fd31fd54b53fc5aaeca39897ac9c5626c92ad86",
"commit_message": "Merge ... | def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount, price=None, params={}):
- # for market buy it requires the amount of quote currency to spend
- if (type == 'market') and (side == 'buy'):
- if self.options['createMarketBuyOrderRe... | :see: https://docs.cex.io/#place-order
create a trade order
:see: https://cex.io/rest-api#place-order
:param str symbol: unified symbol of the market to create an order in
:param str type: 'market' or 'limit'
:param str side: 'buy' or 'sell'
:param float amo... | false | false | python/ccxt/cex.py | cex.py | ccxt | ccxt |
python_ccxt_cex.py | cex.fetch_closed_orders | [
{
"version": "v214",
"docstring_lines": {
"start_line": 1072,
"end_line": 1080
},
"code_lines": {
"start_line": 1080,
"end_line": 1087
},
"commit_date_time": "2023-11-16 12:46:12",
"commit_sha": "8d2f99100013351c73cf0629d66e28e7a2e45c0a",
"commit_message": "Me... | def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
- self.check_required_symbol('fetchClosedOrders', symbol)
+ if symbol is None:
+ raise ArgumentsRequired(self.id + ' fetchClosedOrders() requi... | fetches information on multiple closed orders made by the user
:param str symbol: unified market symbol of the market orders were made in
:param int [since]: the earliest time in ms to fetch orders for
:param int [limit]: the maximum number of order structures to retrieve
:para... | false | false | python/ccxt/cex.py | cex.py | ccxt | ccxt |
python_ray_data__internal_plan.py | ExecutionPlan.__init__ | [
{
"version": "v68",
"docstring_lines": {
"start_line": 524,
"end_line": 535
},
"code_lines": {
"start_line": 535,
"end_line": 618
},
"commit_date_time": "2023-04-28 21:36:50",
"commit_sha": "23d7e9fcfacf8d5cd238526b2a9bbced9fb84f73",
"commit_message": "[all_te... | def __init__(
self,
in_blocks: BlockList,
- stats: DatastreamStats,
? ----
+ stats: DatasetStats,
? +
- datastream_uuid=None,
? ----
+ dataset_uuid=None,
? +
*,
run_by_consum... | Create a plan with no transformation stages.
Args:
in_blocks: Base list of blocks.
stats: Stats for the base blocks.
- datastream_uuid: Datastream's UUID.
? ---- ----
+ dataset_uuid: Dataset's UUID.
? + ... | false | false | python/ray/data/_internal/plan.py | plan.py | ray | ray-project |
python_ray_data__internal_plan.py | ExecutionPlan.stats | [
{
"version": "v44",
"docstring_lines": {
"start_line": 611,
"end_line": 613
},
"code_lines": {
"start_line": 613,
"end_line": 615
},
"commit_date_time": "2023-02-15 19:34:49",
"commit_sha": "5e3004c53c44b76747976758bc7e5da5112363e4",
"commit_message": "Don't s... | def stats(self) -> DatasetStats:
- self.execute()
+
+ if not self._snapshot_stats:
+ return DatasetStats(stages={}, parent=None)
return self._snapshot_stats | - Return stats for this plan, forcing execution if needed.
+ Return stats for this plan.
+
+ If the plan isn't executed, an empty stats object will be returned. | false | false | python/ray/data/_internal/plan.py | plan.py | ray | ray-project |
python_ray_data__internal_plan.py | ExecutionPlan.is_read_only | [
{
"version": "v99",
"docstring_lines": {
"start_line": 706,
"end_line": 708
},
"code_lines": {
"start_line": 708,
"end_line": 710
},
"commit_date_time": "2024-01-04 20:45:10",
"commit_sha": "b7d71b26af535e8de9a358a80b5eebb79e35a879",
"commit_message": "[data] ... | - def is_read_only(self) -> bool:
+ def is_read_only(self, root_op: Optional[LogicalOperator] = None) -> bool:
+ if root_op is None:
- root_op = self._logical_plan.dag
+ root_op = self._logical_plan.dag
? ++++
return isinstance(root_op, Read) and len(root_op.input_depen... | - Return whether the underlying logical plan contains only a Read op.
+ Return whether the LogicalPlan corresponding to `root_op`
+ contains only a Read op. By default, the last operator of
+ the LogicalPlan is used. | false | false | python/ray/data/_internal/plan.py | plan.py | ray | ray-project |
python_ray_data__internal_plan.py | ExecutionPlan.execute | [
{
"version": "v56",
"docstring_lines": {
"start_line": 534,
"end_line": 546
},
"code_lines": {
"start_line": 546,
"end_line": 628
},
"commit_date_time": "2023-03-16 22:14:55",
"commit_sha": "c0e1631c45fba839bb6a717d766ec8fe1f9f2ba6",
"commit_message": "[Datase... | def execute(
self,
allow_clear_input_blocks: bool = True,
force_read: bool = False,
+ preserve_order: bool = False,
) -> BlockList:
context = DatasetContext.get_current()
if not ray.available_resources().get("CPU"):
if... | Execute this plan.
-
- This will always execute the plan using bulk execution.
Args:
allow_clear_input_blocks: Whether we should try to clear the input blocks
for each stage.
force_read: Whether to force the read stage to fully execute.
+ ... | false | false | python/ray/data/_internal/plan.py | plan.py | ray | ray-project |
python_ray_data__internal_plan.py | ExecutionPlan._run_with_new_execution_backend | [
{
"version": "v92",
"docstring_lines": {
"start_line": 856,
"end_line": 858
},
"code_lines": {
"start_line": 858,
"end_line": 886
},
"commit_date_time": "2023-11-29 18:08:04",
"commit_sha": "6f7378c9c6c79b28007a1613a2403d21ebdb5764",
"commit_message": "[data] ... | def _run_with_new_execution_backend(self) -> bool:
- from ray.data._internal.stage_impl import RandomizeBlocksStage
-
- # The read-equivalent stage is handled in the following way:
- # - Read only: handle with legacy backend
- # - Read->randomize_block_order: handle with ne... | Whether this plan should run with new backend.
+ By default, the new execution backend is now fully enabled
+ unless configured otherwise by the user. | false | false | python/ray/data/_internal/plan.py | plan.py | ray | ray-project |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.