uid
stringlengths
24
24
split
stringclasses
1 value
category
stringclasses
2 values
content
stringlengths
5
482k
signature
stringlengths
1
14k
suffix
stringlengths
1
482k
prefix
stringlengths
9
14k
prefix_token_count
int64
3
5.01k
prefix_token_budget
int64
64
256
element_token_count
int64
1
292k
signature_token_count
int64
1
5.01k
prefix_context_token_count
int64
0
255
repo
stringlengths
7
112
path
stringlengths
4
208
language
stringclasses
1 value
name
stringlengths
1
218
qualname
stringlengths
1
218
start_line
int64
1
26.7k
end_line
int64
1
26.7k
signature_start_line
int64
1
26.7k
signature_end_line
int64
1
26.7k
source_hash
stringlengths
40
40
source_dataset
stringclasses
1 value
source_split
stringclasses
1 value
18f63e8dff3329afbe3ee286
train
function
def _vision_transformer( patch_size: int, num_layers: int, num_heads: int, hidden_dim: int, mlp_dim: int, weights: Optional[WeightsEnum], progress: bool, **kwargs: Any, ) -> VisionTransformer: if weights is not None: _ovewrite_named_param(kwargs, "num_classes", len(weights.me...
def _vision_transformer( patch_size: int, num_layers: int, num_heads: int, hidden_dim: int, mlp_dim: int, weights: Optional[WeightsEnum], progress: bool, **kwargs: Any, ) -> VisionTransformer:
if weights is not None: _ovewrite_named_param(kwargs, "num_classes", len(weights.meta["categories"])) if isinstance(weights.meta["size"], int): _ovewrite_named_param(kwargs, "image_size", weights.meta["size"]) elif isinstance(weights.meta["size"], Sequence): if len(we...
x = self.encoder(x) # Classifier "token" as used by standard language architectures x = x[:, 0] x = self.heads(x) return x def _vision_transformer( patch_size: int, num_layers: int, num_heads: int, hidden_dim: int, mlp_dim: int, weights: Optional[WeightsEnum],...
101
101
337
61
39
YosuaMichael/vision
torchvision/models/vision_transformer.py
Python
_vision_transformer
_vision_transformer
279
318
279
288
24f28397cd31f176b8b9d69b594327d32cf2d695
bigcode/the-stack
train
98bfbfffe1712483024ed315
train
function
@handle_legacy_interface(weights=("pretrained", ViT_B_32_Weights.IMAGENET1K_V1)) def vit_b_32(*, weights: Optional[ViT_B_32_Weights] = None, progress: bool = True, **kwargs: Any) -> VisionTransformer: """ Constructs a vit_b_32 architecture from `"An Image is Worth 16x16 Words: Transformers for Image Recogni...
@handle_legacy_interface(weights=("pretrained", ViT_B_32_Weights.IMAGENET1K_V1)) def vit_b_32(*, weights: Optional[ViT_B_32_Weights] = None, progress: bool = True, **kwargs: Any) -> VisionTransformer:
""" Constructs a vit_b_32 architecture from `"An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale" <https://arxiv.org/abs/2010.11929>`_. Args: weights (ViT_B_32_Weights, optional): The pretrained weights for the model progress (bool): If True, displays a progress ...
kwargs, ) @handle_legacy_interface(weights=("pretrained", ViT_B_32_Weights.IMAGENET1K_V1)) def vit_b_32(*, weights: Optional[ViT_B_32_Weights] = None, progress: bool = True, **kwargs: Any) -> VisionTransformer:
66
66
221
62
4
YosuaMichael/vision
torchvision/models/vision_transformer.py
Python
vit_b_32
vit_b_32
485
506
485
486
4bddff926162e6a673f3cc62ef7bf31c6cd87ec3
bigcode/the-stack
train
03c848d437fa48c1235d52b7
train
function
def interpolate_embeddings( image_size: int, patch_size: int, model_state: "OrderedDict[str, torch.Tensor]", interpolation_mode: str = "bicubic", reset_heads: bool = False, ) -> "OrderedDict[str, torch.Tensor]": """This function helps interpolating positional embeddings during checkpoint loading...
def interpolate_embeddings( image_size: int, patch_size: int, model_state: "OrderedDict[str, torch.Tensor]", interpolation_mode: str = "bicubic", reset_heads: bool = False, ) -> "OrderedDict[str, torch.Tensor]":
"""This function helps interpolating positional embeddings during checkpoint loading, especially when you want to apply a pre-trained model on images with different resolution. Args: image_size (int): Image size of the new model. patch_size (int): Patch size of the new model. model_...
) def vit_h_14(*, weights: Optional[ViT_H_14_Weights] = None, progress: bool = True, **kwargs: Any) -> VisionTransformer: """ Constructs a vit_h_14 architecture from `"An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale" <https://arxiv.org/abs/2010.11929>`_. Args: w...
256
256
874
57
199
YosuaMichael/vision
torchvision/models/vision_transformer.py
Python
interpolate_embeddings
interpolate_embeddings
580
655
580
586
66d288fb6c38cf1eb40a5e1f3d1fa084566ed4a3
bigcode/the-stack
train
a6c8b36903944d1ea4aec754
train
class
class ViT_L_16_Weights(WeightsEnum): IMAGENET1K_V1 = Weights( url="https://download.pytorch.org/models/vit_l_16-852ce7e3.pth", transforms=partial(ImageClassification, crop_size=224, resize_size=242), meta={ **_COMMON_META, "num_params": 304326632, "size": ...
class ViT_L_16_Weights(WeightsEnum):
IMAGENET1K_V1 = Weights( url="https://download.pytorch.org/models/vit_l_16-852ce7e3.pth", transforms=partial(ImageClassification, crop_size=224, resize_size=242), meta={ **_COMMON_META, "num_params": 304326632, "size": (224, 224), "min_size": (...
": (224, 224), "min_size": (224, 224), "recipe": "https://github.com/pytorch/vision/tree/main/references/classification#vit_b_32", "acc@1": 75.912, "acc@5": 92.466, }, ) DEFAULT = IMAGENET1K_V1 class ViT_L_16_Weights(WeightsEnum):
92
92
309
12
79
YosuaMichael/vision
torchvision/models/vision_transformer.py
Python
ViT_L_16_Weights
ViT_L_16_Weights
389
420
389
389
22c40955ae301c18029cf309de279a04fc2704c0
bigcode/the-stack
train
94314ab76ae2bb98e054bd93
train
class
class ViT_B_16_Weights(WeightsEnum): IMAGENET1K_V1 = Weights( url="https://download.pytorch.org/models/vit_b_16-c867db91.pth", transforms=partial(ImageClassification, crop_size=224), meta={ **_COMMON_META, "num_params": 86567656, "size": (224, 224), ...
class ViT_B_16_Weights(WeightsEnum):
IMAGENET1K_V1 = Weights( url="https://download.pytorch.org/models/vit_b_16-c867db91.pth", transforms=partial(ImageClassification, crop_size=224), meta={ **_COMMON_META, "num_params": 86567656, "size": (224, 224), "min_size": (224, 224), ...
": InterpolationMode.BILINEAR, } _COMMON_SWAG_META = { **_COMMON_META, "publication_year": 2022, "recipe": "https://github.com/facebookresearch/SWAG", "license": "https://github.com/facebookresearch/SWAG/blob/main/LICENSE", "interpolation": InterpolationMode.BICUBIC, } class ViT_B_16_Weights(Weight...
90
90
301
12
78
YosuaMichael/vision
torchvision/models/vision_transformer.py
Python
ViT_B_16_Weights
ViT_B_16_Weights
338
369
338
338
8dc846c32c5f5a5b57ad3b6f9bcbbfd2559d8501
bigcode/the-stack
train
8ed7f246c8fb9cfdce777f6e
train
function
@handle_legacy_interface(weights=("pretrained", ViT_B_16_Weights.IMAGENET1K_V1)) def vit_b_16(*, weights: Optional[ViT_B_16_Weights] = None, progress: bool = True, **kwargs: Any) -> VisionTransformer: """ Constructs a vit_b_16 architecture from `"An Image is Worth 16x16 Words: Transformers for Image Recogni...
@handle_legacy_interface(weights=("pretrained", ViT_B_16_Weights.IMAGENET1K_V1)) def vit_b_16(*, weights: Optional[ViT_B_16_Weights] = None, progress: bool = True, **kwargs: Any) -> VisionTransformer:
""" Constructs a vit_b_16 architecture from `"An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale" <https://arxiv.org/abs/2010.11929>`_. Args: weights (ViT_B_16_Weights, optional): The pretrained weights for the model progress (bool): If True, displays a progress ...
AG_V1 @handle_legacy_interface(weights=("pretrained", ViT_B_16_Weights.IMAGENET1K_V1)) def vit_b_16(*, weights: Optional[ViT_B_16_Weights] = None, progress: bool = True, **kwargs: Any) -> VisionTransformer:
66
66
221
62
3
YosuaMichael/vision
torchvision/models/vision_transformer.py
Python
vit_b_16
vit_b_16
461
482
461
462
168e6019cd497abcd3527431b26769ba421ba19d
bigcode/the-stack
train
2ba9706c32da28e4851f283f
train
function
def doCreateRsgAsGroup(args, parsed_globals): g_param = parse_global_arg(parsed_globals) if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]: cred = credential.CVMRoleCredential() elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]: ...
def doCreateRsgAsGroup(args, parsed_globals):
g_param = parse_global_arg(parsed_globals) if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]: cred = credential.CVMRoleCredential() elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]: cred = credential.STSAssumeRoleCredent...
erInfo']['to']: break cur_time = time.time() if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']: raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' % (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['Options...
177
177
590
12
165
tencentcloudapi-test/tencentcloud-cli
tccli/services/tiems/tiems_client.py
Python
doCreateRsgAsGroup
doCreateRsgAsGroup
116
161
116
116
24f110c2263d404e2d96754a08f2b4467c595626
bigcode/the-stack
train
37d3953564133e942f2c2ae6
train
function
def doDeleteResourceGroup(args, parsed_globals): g_param = parse_global_arg(parsed_globals) if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]: cred = credential.CVMRoleCredential() elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')...
def doDeleteResourceGroup(args, parsed_globals):
g_param = parse_global_arg(parsed_globals) if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]: cred = credential.CVMRoleCredential() elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]: cred = credential.STSAssumeRoleCredent...
erInfo']['to']: break cur_time = time.time() if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']: raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' % (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['Options...
175
175
584
10
165
tencentcloudapi-test/tencentcloud-cli
tccli/services/tiems/tiems_client.py
Python
doDeleteResourceGroup
doDeleteResourceGroup
884
929
884
884
8a9f8de87d05ecfb68ce7c8a1ea61e2ce721ed3c
bigcode/the-stack
train
48908543516dd0834252c4f7
train
function
def doDescribeRsgAsGroups(args, parsed_globals): g_param = parse_global_arg(parsed_globals) if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]: cred = credential.CVMRoleCredential() elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')...
def doDescribeRsgAsGroups(args, parsed_globals):
g_param = parse_global_arg(parsed_globals) if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]: cred = credential.CVMRoleCredential() elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]: cred = credential.STSAssumeRoleCredent...
erInfo']['to']: break cur_time = time.time() if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']: raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' % (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['Options...
177
177
592
12
165
tencentcloudapi-test/tencentcloud-cli
tccli/services/tiems/tiems_client.py
Python
doDescribeRsgAsGroups
doDescribeRsgAsGroups
1,172
1,217
1,172
1,172
23b727f14eb3a5d35f6b97da225b53c232ec9667
bigcode/the-stack
train
9236aa44c42fc57d2d9585a8
train
function
def doUpdateJob(args, parsed_globals): g_param = parse_global_arg(parsed_globals) if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]: cred = credential.CVMRoleCredential() elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]: ...
def doUpdateJob(args, parsed_globals):
g_param = parse_global_arg(parsed_globals) if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]: cred = credential.CVMRoleCredential() elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]: cred = credential.STSAssumeRoleCredent...
erInfo']['to']: break cur_time = time.time() if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']: raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' % (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['Options...
174
174
581
9
165
tencentcloudapi-test/tencentcloud-cli
tccli/services/tiems/tiems_client.py
Python
doUpdateJob
doUpdateJob
788
833
788
788
7f91f289b2f396c5e08df57cd7b997cd2e584b9f
bigcode/the-stack
train
fceb8bf995d101b6706b388f
train
function
def doCreateRuntime(args, parsed_globals): g_param = parse_global_arg(parsed_globals) if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]: cred = credential.CVMRoleCredential() elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]: ...
def doCreateRuntime(args, parsed_globals):
g_param = parse_global_arg(parsed_globals) if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]: cred = credential.CVMRoleCredential() elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]: cred = credential.STSAssumeRoleCredent...
erInfo']['to']: break cur_time = time.time() if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']: raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' % (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['Options...
174
174
581
9
165
tencentcloudapi-test/tencentcloud-cli
tccli/services/tiems/tiems_client.py
Python
doCreateRuntime
doCreateRuntime
500
545
500
500
2e78012028d61038e58e333234415021ed4be09e
bigcode/the-stack
train
0c9c187fddf0f829eb953254
train
function
def doDeleteJob(args, parsed_globals): g_param = parse_global_arg(parsed_globals) if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]: cred = credential.CVMRoleCredential() elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]: ...
def doDeleteJob(args, parsed_globals):
g_param = parse_global_arg(parsed_globals) if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]: cred = credential.CVMRoleCredential() elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]: cred = credential.STSAssumeRoleCredent...
erInfo']['to']: break cur_time = time.time() if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']: raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' % (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['Options...
174
174
581
9
165
tencentcloudapi-test/tencentcloud-cli
tccli/services/tiems/tiems_client.py
Python
doDeleteJob
doDeleteJob
1,028
1,073
1,028
1,028
18dfb6b53a040080652ce97a754842590022ef2e
bigcode/the-stack
train
72f3c83a74b4f9ad97387744
train
function
def doDeleteRsgAsGroup(args, parsed_globals): g_param = parse_global_arg(parsed_globals) if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]: cred = credential.CVMRoleCredential() elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]: ...
def doDeleteRsgAsGroup(args, parsed_globals):
g_param = parse_global_arg(parsed_globals) if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]: cred = credential.CVMRoleCredential() elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]: cred = credential.STSAssumeRoleCredent...
erInfo']['to']: break cur_time = time.time() if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']: raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' % (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['Options...
177
177
590
12
165
tencentcloudapi-test/tencentcloud-cli
tccli/services/tiems/tiems_client.py
Python
doDeleteRsgAsGroup
doDeleteRsgAsGroup
260
305
260
260
79747d82ca9379138c19be6c84208c645fc387ac
bigcode/the-stack
train
4bc8d3ac8b2b6ddc9ef9373e
train
function
def doDescribeServiceConfigs(args, parsed_globals): g_param = parse_global_arg(parsed_globals) if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]: cred = credential.CVMRoleCredential() elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '...
def doDescribeServiceConfigs(args, parsed_globals):
g_param = parse_global_arg(parsed_globals) if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]: cred = credential.CVMRoleCredential() elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]: cred = credential.STSAssumeRoleCredent...
erInfo']['to']: break cur_time = time.time() if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']: raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' % (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['Options...
175
175
586
10
165
tencentcloudapi-test/tencentcloud-cli
tccli/services/tiems/tiems_client.py
Python
doDescribeServiceConfigs
doDescribeServiceConfigs
1,124
1,169
1,124
1,124
5a628f20fc38c05c978c85adea5fbfc4163c88de
bigcode/the-stack
train
54a4ca9e993e0c36bfe14b56
train
function
def doDescribeInstances(args, parsed_globals): g_param = parse_global_arg(parsed_globals) if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]: cred = credential.CVMRoleCredential() elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:...
def doDescribeInstances(args, parsed_globals):
g_param = parse_global_arg(parsed_globals) if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]: cred = credential.CVMRoleCredential() elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]: cred = credential.STSAssumeRoleCredent...
erInfo']['to']: break cur_time = time.time() if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']: raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' % (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['Options...
174
174
583
9
165
tencentcloudapi-test/tencentcloud-cli
tccli/services/tiems/tiems_client.py
Python
doDescribeInstances
doDescribeInstances
596
641
596
596
9943274b7092ba3e701e7a254399917d870f6132
bigcode/the-stack
train
34b7a2593a3803643c00ad9a
train
function
def action_caller(): return ACTION_MAP
def action_caller():
return ACTION_MAP
doDeleteJob, "EnableRsgAsGroup": doEnableRsgAsGroup, "DescribeServiceConfigs": doDescribeServiceConfigs, "DescribeRsgAsGroups": doDescribeRsgAsGroups, } AVAILABLE_VERSION_LIST = [ "v20190416", ] def action_caller():
64
64
10
5
59
tencentcloudapi-test/tencentcloud-cli
tccli/services/tiems/tiems_client.py
Python
action_caller
action_caller
1,265
1,266
1,265
1,265
20addfd11789b92d414edf7d90d076e7dede3ce4
bigcode/the-stack
train
3d2996df170985986690be07
train
function
def doDisableRsgAsGroup(args, parsed_globals): g_param = parse_global_arg(parsed_globals) if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]: cred = credential.CVMRoleCredential() elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:...
def doDisableRsgAsGroup(args, parsed_globals):
g_param = parse_global_arg(parsed_globals) if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]: cred = credential.CVMRoleCredential() elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]: cred = credential.STSAssumeRoleCredent...
erInfo']['to']: break cur_time = time.time() if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']: raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' % (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['Options...
177
177
590
12
165
tencentcloudapi-test/tencentcloud-cli
tccli/services/tiems/tiems_client.py
Python
doDisableRsgAsGroup
doDisableRsgAsGroup
404
449
404
404
67e50f1ab66fd5a8e088d4340451b6b20ced5912
bigcode/the-stack
train
d26d859d95d721ded23f89c7
train
function
def doUpdateService(args, parsed_globals): g_param = parse_global_arg(parsed_globals) if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]: cred = credential.CVMRoleCredential() elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]: ...
def doUpdateService(args, parsed_globals):
g_param = parse_global_arg(parsed_globals) if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]: cred = credential.CVMRoleCredential() elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]: cred = credential.STSAssumeRoleCredent...
erInfo']['to']: break cur_time = time.time() if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']: raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' % (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['Options...
174
174
581
9
165
tencentcloudapi-test/tencentcloud-cli
tccli/services/tiems/tiems_client.py
Python
doUpdateService
doUpdateService
452
497
452
452
ab48c2be6e09ca1d4b7bdeb86b8212696b0f758f
bigcode/the-stack
train
d51bdf670bc62b13e1135d64
train
function
def doCreateJob(args, parsed_globals): g_param = parse_global_arg(parsed_globals) if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]: cred = credential.CVMRoleCredential() elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]: ...
def doCreateJob(args, parsed_globals):
g_param = parse_global_arg(parsed_globals) if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]: cred = credential.CVMRoleCredential() elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]: cred = credential.STSAssumeRoleCredent...
erInfo']['to']: break cur_time = time.time() if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']: raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' % (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['Options...
174
174
581
9
165
tencentcloudapi-test/tencentcloud-cli
tccli/services/tiems/tiems_client.py
Python
doCreateJob
doCreateJob
836
881
836
836
6207c3d3c8b3b7faf9f91e4aadf144959c432d6c
bigcode/the-stack
train
0b2d73f592246a779be67c5a
train
function
def parse_global_arg(parsed_globals): g_param = parsed_globals is_exist_profile = True if not parsed_globals["profile"]: is_exist_profile = False g_param["profile"] = "default" configure_path = os.path.join(os.path.expanduser("~"), ".tccli") is_conf_exist, conf_path = Utils.file_ex...
def parse_global_arg(parsed_globals):
g_param = parsed_globals is_exist_profile = True if not parsed_globals["profile"]: is_exist_profile = False g_param["profile"] = "default" configure_path = os.path.join(os.path.expanduser("~"), ".tccli") is_conf_exist, conf_path = Utils.file_existed(configure_path, g_param["profile...
AsGroup": doDeleteRsgAsGroup, "UpdateRsgAsGroup": doUpdateRsgAsGroup, "DeleteServiceConfig": doDeleteServiceConfig, "DisableRsgAsGroup": doDisableRsgAsGroup, "UpdateService": doUpdateService, "CreateRuntime": doCreateRuntime, "DescribeServices": doDescribeServices, "DescribeInstances": doDes...
256
256
1,032
7
248
tencentcloudapi-test/tencentcloud-cli
tccli/services/tiems/tiems_client.py
Python
parse_global_arg
parse_global_arg
1,269
1,365
1,269
1,269
e7f233035dc3fbdc2023326d3a9b3053c78023f9
bigcode/the-stack
train
4aaade3666efa9126e1a3c04
train
function
def doDeleteServiceConfig(args, parsed_globals): g_param = parse_global_arg(parsed_globals) if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]: cred = credential.CVMRoleCredential() elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')...
def doDeleteServiceConfig(args, parsed_globals):
g_param = parse_global_arg(parsed_globals) if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]: cred = credential.CVMRoleCredential() elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]: cred = credential.STSAssumeRoleCredent...
erInfo']['to']: break cur_time = time.time() if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']: raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' % (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['Options...
175
175
584
10
165
tencentcloudapi-test/tencentcloud-cli
tccli/services/tiems/tiems_client.py
Python
doDeleteServiceConfig
doDeleteServiceConfig
356
401
356
356
9c43038a1bf7ec826d08e1a9c1948d2111e77c7b
bigcode/the-stack
train
f57a907fb50158897370a8cb
train
function
def doCreateServiceConfig(args, parsed_globals): g_param = parse_global_arg(parsed_globals) if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]: cred = credential.CVMRoleCredential() elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')...
def doCreateServiceConfig(args, parsed_globals):
g_param = parse_global_arg(parsed_globals) if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]: cred = credential.CVMRoleCredential() elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]: cred = credential.STSAssumeRoleCredent...
erInfo']['to']: break cur_time = time.time() if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']: raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' % (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['Options...
175
175
584
10
165
tencentcloudapi-test/tencentcloud-cli
tccli/services/tiems/tiems_client.py
Python
doCreateServiceConfig
doCreateServiceConfig
68
113
68
68
75653a5fce4c66493bd90ac681f8fffeee7a736d
bigcode/the-stack
train
ad7b928fd88221f47a765672
train
function
def doEnableRsgAsGroup(args, parsed_globals): g_param = parse_global_arg(parsed_globals) if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]: cred = credential.CVMRoleCredential() elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]: ...
def doEnableRsgAsGroup(args, parsed_globals):
g_param = parse_global_arg(parsed_globals) if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]: cred = credential.CVMRoleCredential() elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]: cred = credential.STSAssumeRoleCredent...
erInfo']['to']: break cur_time = time.time() if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']: raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' % (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['Options...
177
177
590
12
165
tencentcloudapi-test/tencentcloud-cli
tccli/services/tiems/tiems_client.py
Python
doEnableRsgAsGroup
doEnableRsgAsGroup
1,076
1,121
1,076
1,076
0c48da046a0e1f1526af6fa54157655fa0857d46
bigcode/the-stack
train
f26653ff322c10ee05b9a183
train
function
def doDeleteService(args, parsed_globals): g_param = parse_global_arg(parsed_globals) if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]: cred = credential.CVMRoleCredential() elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]: ...
def doDeleteService(args, parsed_globals):
g_param = parse_global_arg(parsed_globals) if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]: cred = credential.CVMRoleCredential() elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]: cred = credential.STSAssumeRoleCredent...
erInfo']['to']: break cur_time = time.time() if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']: raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' % (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['Options...
174
174
581
9
165
tencentcloudapi-test/tencentcloud-cli
tccli/services/tiems/tiems_client.py
Python
doDeleteService
doDeleteService
212
257
212
212
953bb27839cd4e54d2f4c7b37067dd5c51a3e541
bigcode/the-stack
train
6b20cfbdb92314c9e6f3e054
train
function
def doUpdateRsgAsGroup(args, parsed_globals): g_param = parse_global_arg(parsed_globals) if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]: cred = credential.CVMRoleCredential() elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]: ...
def doUpdateRsgAsGroup(args, parsed_globals):
g_param = parse_global_arg(parsed_globals) if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]: cred = credential.CVMRoleCredential() elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]: cred = credential.STSAssumeRoleCredent...
erInfo']['to']: break cur_time = time.time() if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']: raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' % (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['Options...
177
177
590
12
165
tencentcloudapi-test/tencentcloud-cli
tccli/services/tiems/tiems_client.py
Python
doUpdateRsgAsGroup
doUpdateRsgAsGroup
308
353
308
308
22c8f573b8f3dd4fd68a504a6f7c027830b70bb4
bigcode/the-stack
train
05299da03bfb9a7e8434699b
train
function
def doDescribeRuntimes(args, parsed_globals): g_param = parse_global_arg(parsed_globals) if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]: cred = credential.CVMRoleCredential() elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]: ...
def doDescribeRuntimes(args, parsed_globals):
g_param = parse_global_arg(parsed_globals) if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]: cred = credential.CVMRoleCredential() elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]: cred = credential.STSAssumeRoleCredent...
erInfo']['to']: break cur_time = time.time() if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']: raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' % (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['Options...
176
176
589
11
165
tencentcloudapi-test/tencentcloud-cli
tccli/services/tiems/tiems_client.py
Python
doDescribeRuntimes
doDescribeRuntimes
692
737
692
692
aa031f8f028322c96c5816018fa250f415c0801f
bigcode/the-stack
train
d49079ed3d1cedbf568aa978
train
function
def doDeleteInstance(args, parsed_globals): g_param = parse_global_arg(parsed_globals) if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]: cred = credential.CVMRoleCredential() elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]: ...
def doDeleteInstance(args, parsed_globals):
g_param = parse_global_arg(parsed_globals) if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]: cred = credential.CVMRoleCredential() elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]: cred = credential.STSAssumeRoleCredent...
erInfo']['to']: break cur_time = time.time() if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']: raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' % (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['Options...
174
174
581
9
165
tencentcloudapi-test/tencentcloud-cli
tccli/services/tiems/tiems_client.py
Python
doDeleteInstance
doDeleteInstance
164
209
164
164
21e0d57f71305e02c38fffa6f8a8c1dc6ca4345e
bigcode/the-stack
train
6931f478ac622553723530bd
train
function
def doDescribeRsgAsGroupActivities(args, parsed_globals): g_param = parse_global_arg(parsed_globals) if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]: cred = credential.CVMRoleCredential() elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace(...
def doDescribeRsgAsGroupActivities(args, parsed_globals):
g_param = parse_global_arg(parsed_globals) if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]: cred = credential.CVMRoleCredential() elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]: cred = credential.STSAssumeRoleCredent...
erInfo']['to']: break cur_time = time.time() if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']: raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' % (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['Options...
178
178
595
13
165
tencentcloudapi-test/tencentcloud-cli
tccli/services/tiems/tiems_client.py
Python
doDescribeRsgAsGroupActivities
doDescribeRsgAsGroupActivities
740
785
740
740
95dfdb8d348cddeaf934db18895008f2fd002556
bigcode/the-stack
train
cf192c509effc86a7c95b8cc
train
function
def doDeleteRuntime(args, parsed_globals): g_param = parse_global_arg(parsed_globals) if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]: cred = credential.CVMRoleCredential() elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]: ...
def doDeleteRuntime(args, parsed_globals):
g_param = parse_global_arg(parsed_globals) if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]: cred = credential.CVMRoleCredential() elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]: cred = credential.STSAssumeRoleCredent...
erInfo']['to']: break cur_time = time.time() if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']: raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' % (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['Options...
174
174
581
9
165
tencentcloudapi-test/tencentcloud-cli
tccli/services/tiems/tiems_client.py
Python
doDeleteRuntime
doDeleteRuntime
932
977
932
932
282fd70b8c037b88e095be6947bc7796ba5c1b59
bigcode/the-stack
train
b2c442ce5cb9e3afc4e8f1c5
train
function
def doDescribeServices(args, parsed_globals): g_param = parse_global_arg(parsed_globals) if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]: cred = credential.CVMRoleCredential() elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]: ...
def doDescribeServices(args, parsed_globals):
g_param = parse_global_arg(parsed_globals) if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]: cred = credential.CVMRoleCredential() elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]: cred = credential.STSAssumeRoleCredent...
erInfo']['to']: break cur_time = time.time() if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']: raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' % (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['Options...
174
174
583
9
165
tencentcloudapi-test/tencentcloud-cli
tccli/services/tiems/tiems_client.py
Python
doDescribeServices
doDescribeServices
548
593
548
548
218e32bd37343f72486fc94331797cee5ef6bb61
bigcode/the-stack
train
893a063bb4958645eb078fd3
train
function
def doDescribeResourceGroups(args, parsed_globals): g_param = parse_global_arg(parsed_globals) if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]: cred = credential.CVMRoleCredential() elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '...
def doDescribeResourceGroups(args, parsed_globals):
g_param = parse_global_arg(parsed_globals) if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]: cred = credential.CVMRoleCredential() elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]: cred = credential.STSAssumeRoleCredent...
erInfo']['to']: break cur_time = time.time() if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']: raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' % (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['Options...
175
175
586
10
165
tencentcloudapi-test/tencentcloud-cli
tccli/services/tiems/tiems_client.py
Python
doDescribeResourceGroups
doDescribeResourceGroups
644
689
644
644
519c6efaf919b03d06bf32097f24bdaa198cea6a
bigcode/the-stack
train
e6bda1b0637699d5dc79dcff
train
function
def doCreateService(args, parsed_globals): g_param = parse_global_arg(parsed_globals) if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]: cred = credential.CVMRoleCredential() elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]: ...
def doCreateService(args, parsed_globals):
g_param = parse_global_arg(parsed_globals) if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]: cred = credential.CVMRoleCredential() elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]: cred = credential.STSAssumeRoleCredent...
# -*- coding: utf-8 -*- import os import sys import six import json import tccli.options_define as OptionsDefine import tccli.format_output as FormatOutput from tccli import __version__ from tccli.utils import Utils from tccli.exceptions import ConfigurationError, ClientError, ParamError from tencentcloud.common import...
159
174
581
9
149
tencentcloudapi-test/tencentcloud-cli
tccli/services/tiems/tiems_client.py
Python
doCreateService
doCreateService
20
65
20
20
ffaf705d7e7979961c802e5c798a2bef7cf6ebf6
bigcode/the-stack
train
0d4a82753250394b045df05d
train
function
def doExposeService(args, parsed_globals): g_param = parse_global_arg(parsed_globals) if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]: cred = credential.CVMRoleCredential() elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]: ...
def doExposeService(args, parsed_globals):
g_param = parse_global_arg(parsed_globals) if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]: cred = credential.CVMRoleCredential() elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]: cred = credential.STSAssumeRoleCredent...
erInfo']['to']: break cur_time = time.time() if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']: raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' % (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['Options...
174
174
583
9
165
tencentcloudapi-test/tencentcloud-cli
tccli/services/tiems/tiems_client.py
Python
doExposeService
doExposeService
980
1,025
980
980
2f99a2a238d0408a00e683d26dbedb1e845e8a00
bigcode/the-stack
train
d096b738ffdfa57788dd70a0
train
class
class FavoriteForm(FlaskForm): pass
class FavoriteForm(FlaskForm):
pass
コメント内容", validators=[DataRequired(), Length(max=BODY_MAX_LENGTH)], ) class OnymousResForm(FlaskForm): body = TextAreaField( "コメント内容", validators=[DataRequired(), Length(max=BODY_MAX_LENGTH)], ) class FavoriteForm(FlaskForm):
64
64
11
8
56
suwa808/sixchan
sixchan/main/forms.py
Python
FavoriteForm
FavoriteForm
37
38
37
37
8d59c59dfbbb587c6f36bb5a2fe73ed9f5ff2f07
bigcode/the-stack
train
fc2402d6707ab7a60c841370
train
class
class AnonymousResForm(FlaskForm): anon_name = StringField( "名前(省略可)", validators=[Length(max=ANON_NAME_MAX_LENGTH)], ) anon_email = StringField( "メールアドレス(省略可)", validators=[Optional(), Email()], ) body = TextAreaField( "コメント内容", validators=[DataRequir...
class AnonymousResForm(FlaskForm):
anon_name = StringField( "名前(省略可)", validators=[Length(max=ANON_NAME_MAX_LENGTH)], ) anon_email = StringField( "メールアドレス(省略可)", validators=[Optional(), Email()], ) body = TextAreaField( "コメント内容", validators=[DataRequired(), Length(max=BODY_MAX_LENGTH)],...
import DataRequired from wtforms.validators import Email from wtforms.validators import Length from wtforms.validators import Optional from sixchan.config import ANON_NAME_MAX_LENGTH from sixchan.config import BODY_MAX_LENGTH from sixchan.config import THREAD_NAME_MAX_LENGTH class AnonymousResForm(FlaskForm):
64
64
92
9
54
suwa808/sixchan
sixchan/main/forms.py
Python
AnonymousResForm
AnonymousResForm
15
27
15
15
64c4ab4f6f61ebe67db143b29884f188a2b1acb9
bigcode/the-stack
train
35fdb8fef39802d2fb0a1389
train
class
class AnonymousThreadForm(FlaskForm): thread_name = StringField( "スレッド名", validators=[Length(max=THREAD_NAME_MAX_LENGTH)], ) anon_name = StringField( "名前(省略可)", validators=[Length(max=ANON_NAME_MAX_LENGTH)], ) anon_email = StringField( "メールアドレス(省略可)", ...
class AnonymousThreadForm(FlaskForm):
thread_name = StringField( "スレッド名", validators=[Length(max=THREAD_NAME_MAX_LENGTH)], ) anon_name = StringField( "名前(省略可)", validators=[Length(max=ANON_NAME_MAX_LENGTH)], ) anon_email = StringField( "メールアドレス(省略可)", validators=[Optional(), Email()], ...
BODY_MAX_LENGTH)], ) class OnymousResForm(FlaskForm): body = TextAreaField( "コメント内容", validators=[DataRequired(), Length(max=BODY_MAX_LENGTH)], ) class FavoriteForm(FlaskForm): pass class AnonymousThreadForm(FlaskForm):
64
64
119
9
54
suwa808/sixchan
sixchan/main/forms.py
Python
AnonymousThreadForm
AnonymousThreadForm
41
57
41
41
39995b3c57a1a13fe14055be8a650480673ebe3c
bigcode/the-stack
train
1eedd3d538f05eff77301f94
train
class
class OnymousResForm(FlaskForm): body = TextAreaField( "コメント内容", validators=[DataRequired(), Length(max=BODY_MAX_LENGTH)], )
class OnymousResForm(FlaskForm):
body = TextAreaField( "コメント内容", validators=[DataRequired(), Length(max=BODY_MAX_LENGTH)], )
anon_email = StringField( "メールアドレス(省略可)", validators=[Optional(), Email()], ) body = TextAreaField( "コメント内容", validators=[DataRequired(), Length(max=BODY_MAX_LENGTH)], ) class OnymousResForm(FlaskForm):
64
64
38
11
53
suwa808/sixchan
sixchan/main/forms.py
Python
OnymousResForm
OnymousResForm
30
34
30
30
6502ab02b8a3647421fe15fef7102104a66e6486
bigcode/the-stack
train
40070b8b96a18fb380cdf57d
train
class
class OnymousThreadForm(FlaskForm): thread_name = StringField( "スレッド名", validators=[Length(max=THREAD_NAME_MAX_LENGTH)], ) body = TextAreaField( "コメント内容", validators=[DataRequired(), Length(max=BODY_MAX_LENGTH)], )
class OnymousThreadForm(FlaskForm):
thread_name = StringField( "スレッド名", validators=[Length(max=THREAD_NAME_MAX_LENGTH)], ) body = TextAreaField( "コメント内容", validators=[DataRequired(), Length(max=BODY_MAX_LENGTH)], )
anon_email = StringField( "メールアドレス(省略可)", validators=[Optional(), Email()], ) body = TextAreaField( "コメント内容", validators=[DataRequired(), Length(max=BODY_MAX_LENGTH)], ) class OnymousThreadForm(FlaskForm):
64
64
65
11
53
suwa808/sixchan
sixchan/main/forms.py
Python
OnymousThreadForm
OnymousThreadForm
60
68
60
60
cbd089064c1d944b1155e8a724846bd7237a54ec
bigcode/the-stack
train
71e795f56ce2260146a3721f
train
class
class ReportForm(FlaskForm): reason = SelectField("報告理由", coerce=str, validators=[DataRequired()]) detail = TextAreaField("詳細", validators=[Length(max=BODY_MAX_LENGTH)])
class ReportForm(FlaskForm):
reason = SelectField("報告理由", coerce=str, validators=[DataRequired()]) detail = TextAreaField("詳細", validators=[Length(max=BODY_MAX_LENGTH)])
Form): thread_name = StringField( "スレッド名", validators=[Length(max=THREAD_NAME_MAX_LENGTH)], ) body = TextAreaField( "コメント内容", validators=[DataRequired(), Length(max=BODY_MAX_LENGTH)], ) class ReportForm(FlaskForm):
64
64
45
8
56
suwa808/sixchan
sixchan/main/forms.py
Python
ReportForm
ReportForm
71
73
71
71
08c6561ddd125cf59056ae0f770fa7a06dc026e2
bigcode/the-stack
train
4cd33d2cc95f75371c9232c9
train
class
class AuthMiddleware(MiddlewareMixin): def process_request(self, request): print(request.body) token = request.headers.get("Token", "") try: token = jwt.decode(token, 'onlinemusic', algorithms=['HS256']) user = MyUser() user.id = token['uid'] ...
class AuthMiddleware(MiddlewareMixin):
def process_request(self, request): print(request.body) token = request.headers.get("Token", "") try: token = jwt.decode(token, 'onlinemusic', algorithms=['HS256']) user = MyUser() user.id = token['uid'] user.username = token['name'] ...
from django.contrib.auth.models import AbstractUser from django.utils.deprecation import MiddlewareMixin import jwt class MyUser(object): id = 0 username = '' is_anonymous = True is_authenticated = False class AuthMiddleware(MiddlewareMixin):
56
64
112
7
48
dgut-group-ten/song
apps/other/middleware.py
Python
AuthMiddleware
AuthMiddleware
13
28
13
14
bfdfa073ec23b03de5f40795548b6311f23b7956
bigcode/the-stack
train
d4c0dba0a2d1cc084c1bcf3c
train
class
class MyUser(object): id = 0 username = '' is_anonymous = True is_authenticated = False
class MyUser(object):
id = 0 username = '' is_anonymous = True is_authenticated = False
from django.contrib.auth.models import AbstractUser from django.utils.deprecation import MiddlewareMixin import jwt class MyUser(object):
26
64
28
5
20
dgut-group-ten/song
apps/other/middleware.py
Python
MyUser
MyUser
6
10
6
6
0ca15e6745b52a55915ee329345e70b699718528
bigcode/the-stack
train
9405d775222dc44f8887f0d3
train
function
def compute(): def count_reversibles(numdigits): if numdigits % 2 == 0: return 20 * 30**(numdigits // 2 - 1) elif numdigits % 4 == 3: return 100 * 500**((numdigits - 3) // 4) elif numdigits % 4 == 1: return 0 else: raise AssertionError() ans = sum(count_reversibles(d) for d in range(2, 10)) ret...
def compute():
def count_reversibles(numdigits): if numdigits % 2 == 0: return 20 * 30**(numdigits // 2 - 1) elif numdigits % 4 == 3: return 100 * 500**((numdigits - 3) // 4) elif numdigits % 4 == 1: return 0 else: raise AssertionError() ans = sum(count_reversibles(d) for d in range(2, 10)) return str(ans)
in all, there are 5 * 20^((n + 1)/4) * 25^((n - 3)/4) = 100 * 500^((n - 3)/4) # reversible n-digit numbers when n = 3 mod 4. def compute():
64
64
118
3
61
xianlinfeng/project_euler_python3
solutions/p145.py
Python
compute
compute
119
131
119
119
755929753ed0a85f9d49bb68ef097c0c5a41795b
bigcode/the-stack
train
d7e1487d7b5b6d8769eb1d07
train
function
def get_clean_num(num): """ Get the closest clean number match to num with bases 1, 2, 5. Args: num: the number Returns: the closest number """ if num == 0: return 0 sign = num > 0 and 1 or -1 exp = get_exp(num) nums = numpy.array((1, 2, 5, 10))*(10**exp) return...
def get_clean_num(num):
""" Get the closest clean number match to num with bases 1, 2, 5. Args: num: the number Returns: the closest number """ if num == 0: return 0 sign = num > 0 and 1 or -1 exp = get_exp(num) nums = numpy.array((1, 2, 5, 10))*(10**exp) return sign*nums[numpy.argmin(...
Get the exponent of the number in base 10. Args: num: the floating point number Returns: the exponent as an integer """ if num == 0: return 0 return int(math.floor(math.log10(abs(num)))) def get_clean_num(num):
63
64
119
6
57
v1259397/cosmic-gnuradio
gnuradio-3.7.13.4/gr-wxgui/python/wxgui/common.py
Python
get_clean_num
get_clean_num
193
207
193
193
7a05a9a2071c3a1399de90ae51d35cf5fa7cbca6
bigcode/the-stack
train
5421a5b75b7b9f8e445d340e
train
function
def get_min_max(samples): """ Get the minimum and maximum bounds for an array of samples. Args: samples: the array of real values Returns: a tuple of min, max """ factor = 2.0 mean = numpy.average(samples) std = numpy.std(samples) fft = numpy.abs(numpy.fft.fft(sampl...
def get_min_max(samples):
""" Get the minimum and maximum bounds for an array of samples. Args: samples: the array of real values Returns: a tuple of min, max """ factor = 2.0 mean = numpy.average(samples) std = numpy.std(samples) fft = numpy.abs(numpy.fft.fft(samples - mean)) envelope =...
10**exp)) return { -5: -10, -2: -5, -1: -2, 1: .5, 2: 1, 5: 2, }[coeff]*(10**exp) def get_min_max(samples):
64
64
127
6
58
v1259397/cosmic-gnuradio
gnuradio-3.7.13.4/gr-wxgui/python/wxgui/common.py
Python
get_min_max
get_min_max
256
272
256
256
a83442d953be42c1fd2d365e0778916127590935
bigcode/the-stack
train
48b5b0ea9c37751e160649b2
train
class
class input_watcher(gru.msgq_runner): """ Input watcher thread runs forever. Read messages from the message queue. Forward messages to the message handler. """ def __init__ (self, msgq, controller, msg_key, arg1_key='', arg2_key=''): self._controller = controller self._msg_key = ...
class input_watcher(gru.msgq_runner):
""" Input watcher thread runs forever. Read messages from the message queue. Forward messages to the message handler. """ def __init__ (self, msgq, controller, msg_key, arg1_key='', arg2_key=''): self._controller = controller self._msg_key = msg_key self._arg1_key = arg1_...
the object to get new setter and getter methods controller: the pubsub controller """ for key in controller.keys(): _register_access_method(destination, controller, key) ################################################## # Input Watcher Thread ################################################## from gn...
64
64
183
10
53
v1259397/cosmic-gnuradio
gnuradio-3.7.13.4/gr-wxgui/python/wxgui/common.py
Python
input_watcher
input_watcher
153
169
153
153
319612fa48311c64e9e0bba31a53829123cc33d4
bigcode/the-stack
train
da6333638e65fb118b018a4b
train
function
def get_min_max_fft(fft_samps): """ Get the minimum and maximum bounds for an array of fft samples. Args: samples: the array of real values Returns: a tuple of min, max """ # get the peak level (max of the samples) peak_level = numpy.max(fft_samps) # separate noise samp...
def get_min_max_fft(fft_samps):
""" Get the minimum and maximum bounds for an array of fft samples. Args: samples: the array of real values Returns: a tuple of min, max """ # get the peak level (max of the samples) peak_level = numpy.max(fft_samps) # separate noise samples noise_samps = numpy.sort...
(numpy.fft.fft(samples - mean)) envelope = 2*numpy.max(fft)/len(samples) ampl = max(std, envelope) or 0.1 return mean - factor*ampl, mean + factor*ampl def get_min_max_fft(fft_samps):
64
64
175
10
53
v1259397/cosmic-gnuradio
gnuradio-3.7.13.4/gr-wxgui/python/wxgui/common.py
Python
get_min_max_fft
get_min_max_fft
275
296
275
275
ab0980b35bec42c9c45c85e3882a671ca0323f3e
bigcode/the-stack
train
0ec575854f91751fede6ab9b
train
class
class wxgui_hb(object): """ The wxgui hier block helper/wrapper class: A hier block should inherit from this class to make use of the wxgui connect method. To use, call wxgui_connect in place of regular connect; self.win must be defined. The implementation will conditionally enable the copy block af...
class wxgui_hb(object):
""" The wxgui hier block helper/wrapper class: A hier block should inherit from this class to make use of the wxgui connect method. To use, call wxgui_connect in place of regular connect; self.win must be defined. The implementation will conditionally enable the copy block after the source (self). ...
you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. # # GNU Radio is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied w...
212
212
708
7
205
v1259397/cosmic-gnuradio
gnuradio-3.7.13.4/gr-wxgui/python/wxgui/common.py
Python
wxgui_hb
wxgui_hb
32
115
32
32
520c055a0edc48e88594d31703723c62605e73d1
bigcode/the-stack
train
62a737e11146ed772b425663
train
function
def get_clean_incr(num): """ Get the next higher clean number with bases 1, 2, 5. Args: num: the number Returns: the next higher number """ num = get_clean_num(num) exp = get_exp(num) coeff = int(round(num/10**exp)) return { -5: -2, -2: -1, -...
def get_clean_incr(num):
""" Get the next higher clean number with bases 1, 2, 5. Args: num: the number Returns: the next higher number """ num = get_clean_num(num) exp = get_exp(num) coeff = int(round(num/10**exp)) return { -5: -2, -2: -1, -1: -.5, 1: 2, ...
0 and 1 or -1 exp = get_exp(num) nums = numpy.array((1, 2, 5, 10))*(10**exp) return sign*nums[numpy.argmin(numpy.abs(nums - abs(num)))] def get_clean_incr(num):
63
64
127
7
56
v1259397/cosmic-gnuradio
gnuradio-3.7.13.4/gr-wxgui/python/wxgui/common.py
Python
get_clean_incr
get_clean_incr
210
230
210
210
22715e868067f2027278dc0ce1c661c996e6a8c3
bigcode/the-stack
train
050bc1dbaf92521f96abd5f4
train
function
def get_exp(num): """ Get the exponent of the number in base 10. Args: num: the floating point number Returns: the exponent as an integer """ if num == 0: return 0 return int(math.floor(math.log10(abs(num))))
def get_exp(num):
""" Get the exponent of the number in base 10. Args: num: the floating point number Returns: the exponent as an integer """ if num == 0: return 0 return int(math.floor(math.log10(abs(num))))
arg1_key] = msg.arg1() if self._arg2_key: self._controller[self._arg2_key] = msg.arg2() self._controller[self._msg_key] = msg.to_string() ################################################## # Shared Functions ################################################## import numpy import math def get_exp(num):
64
64
64
5
58
v1259397/cosmic-gnuradio
gnuradio-3.7.13.4/gr-wxgui/python/wxgui/common.py
Python
get_exp
get_exp
179
190
179
179
519f912c93a1409e2b5c12ad8a0b90981837bbcb
bigcode/the-stack
train
29015c34293c1704c1ad1359
train
function
def get_clean_decr(num): """ Get the next lower clean number with bases 1, 2, 5. Args: num: the number Returns: the next lower number """ num = get_clean_num(num) exp = get_exp(num) coeff = int(round(num/10**exp)) return { -5: -10, -2: -5, -1...
def get_clean_decr(num):
""" Get the next lower clean number with bases 1, 2, 5. Args: num: the number Returns: the next lower number """ num = get_clean_num(num) exp = get_exp(num) coeff = int(round(num/10**exp)) return { -5: -10, -2: -5, -1: -2, 1: .5, ...
**exp)) return { -5: -2, -2: -1, -1: -.5, 1: 2, 2: 5, 5: 10, }[coeff]*(10**exp) def get_clean_decr(num):
64
64
127
7
57
v1259397/cosmic-gnuradio
gnuradio-3.7.13.4/gr-wxgui/python/wxgui/common.py
Python
get_clean_decr
get_clean_decr
233
253
233
233
846817f09610baf780cff3f1151318472e82628f
bigcode/the-stack
train
fdc0aae8c243cfc2190f5202
train
function
def _register_access_method(destination, controller, key): """ Helper function for register access methods. This helper creates distinct set and get methods for each key and adds them to the destination object. """ def set(value): controller[key] = value setattr(destination, 'set_'+key, set)...
def _register_access_method(destination, controller, key):
""" Helper function for register access methods. This helper creates distinct set and get methods for each key and adds them to the destination object. """ def set(value): controller[key] = value setattr(destination, 'set_'+key, set) def get(): return controller[key] setattr(destinat...
notebooks win.Bind(wx.EVT_UPDATE_UI, handler) ################################################## # Helpful Functions ################################################## # A macro to apply an index to a key index_key = lambda key, i: "%s_%d" % (key, i+1) def _register_access_method(destination, controller, key...
64
64
86
11
53
v1259397/cosmic-gnuradio
gnuradio-3.7.13.4/gr-wxgui/python/wxgui/common.py
Python
_register_access_method
_register_access_method
125
134
125
125
1087e1e1de319215c6ffc81e4e6d17d40f282723
bigcode/the-stack
train
72da0ab750e5cbf596c80d92
train
function
def register_access_methods(destination, controller): """ Register setter and getter functions in the destination object for all keys in the controller. Args: destination: the object to get new setter and getter methods controller: the pubsub controller """ for key in controller.key...
def register_access_methods(destination, controller):
""" Register setter and getter functions in the destination object for all keys in the controller. Args: destination: the object to get new setter and getter methods controller: the pubsub controller """ for key in controller.keys(): _register_access_method(destination, controller, ...
for each key and adds them to the destination object. """ def set(value): controller[key] = value setattr(destination, 'set_'+key, set) def get(): return controller[key] setattr(destination, 'get_'+key, get) def register_access_methods(destination, controller):
64
64
70
8
56
v1259397/cosmic-gnuradio
gnuradio-3.7.13.4/gr-wxgui/python/wxgui/common.py
Python
register_access_methods
register_access_methods
137
145
137
137
b02d783eb91613168933c7b10b44ab3807c166ce
bigcode/the-stack
train
365f13acfe92f14ca3e79baf
train
class
class AutoARIMA(_OptionalForecastingHorizonMixin, _SktimeForecaster): """Automatically discover the optimal order for an ARIMA model. The auto-ARIMA process seeks to identify the most optimal parameters for an ARIMA model, settling on a single fitted ARIMA model. This process is based on the commonly-u...
class AutoARIMA(_OptionalForecastingHorizonMixin, _SktimeForecaster):
"""Automatically discover the optimal order for an ARIMA model. The auto-ARIMA process seeks to identify the most optimal parameters for an ARIMA model, settling on a single fitted ARIMA model. This process is based on the commonly-used R function, forecast::auto.arima [3]. Auto-ARIMA works by...
#!/usr/bin/env python3 -u # -*- coding: utf-8 -*- # copyright: sktime developers, BSD-3-Clause License (see LICENSE file) __author__ = ["Markus Löning"] __all__ = ["AutoARIMA"] import pandas as pd # type: ignore from sktime.forecasting.base._base import DEFAULT_ALPHA from sktime.forecasting.base._sktime import _Skt...
149
256
4,456
18
131
timcashion/sktime
sktime/forecasting/arima.py
Python
AutoARIMA
AutoARIMA
18
462
18
18
e1235662d79f325d3185a81915e3019e588b307c
bigcode/the-stack
train
038039995540947b79fc5774
train
function
def get_opts(): from SCons.Variables import BoolVariable return [ ( "IPHONEPATH", "Path to iPhone toolchain", "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain", ), ("IPHONESDK", "Path to the iPhone SDK", ""), Boo...
def get_opts():
from SCons.Variables import BoolVariable return [ ( "IPHONEPATH", "Path to iPhone toolchain", "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain", ), ("IPHONESDK", "Path to the iPhone SDK", ""), BoolVariable("ios_e...
": if get_darwin_sdk_version("iphone") < 13.0: print("Detected iOS SDK version older than 13") return False return True elif "OSXCROSS_IOS" in os.environ: return True return False def get_opts():
64
64
103
4
59
dsrw/godot
platform/iphone/detect.py
Python
get_opts
get_opts
26
38
26
26
cbf43b980b29c791b1316a2908c9e910084fa136
bigcode/the-stack
train
5760afc25381be68db5face6
train
function
def get_flags(): return [ ("tools", False), ]
def get_flags():
return [ ("tools", False), ]
Developer/Toolchains/XcodeDefault.xctoolchain", ), ("IPHONESDK", "Path to the iPhone SDK", ""), BoolVariable("ios_exceptions", "Enable exceptions", False), ("ios_triple", "Triple for ios toolchain", ""), ] def get_flags():
63
64
15
4
59
dsrw/godot
platform/iphone/detect.py
Python
get_flags
get_flags
41
44
41
41
a3bfd3bf85ad23a35a86d6c358c8c466fe0157bf
bigcode/the-stack
train
b9682cb55fa798f8df754b36
train
function
def get_name(): return "iOS"
def get_name():
return "iOS"
import os import sys from methods import detect_darwin_sdk_path, get_darwin_sdk_version def is_active(): return True def get_name():
35
64
10
4
30
dsrw/godot
platform/iphone/detect.py
Python
get_name
get_name
10
11
10
10
5920188ff08057e50e7b1cdcb5110ed082e3c376
bigcode/the-stack
train
2a8210e9b15956144bf32709
train
function
def configure(env): ## Build type if env["target"].startswith("release"): env.Append(CPPDEFINES=["NDEBUG", ("NS_BLOCK_ASSERTIONS", 1)]) if env["optimize"] == "speed": # optimize for speed (default) env.Append(CCFLAGS=["-O2", "-ftree-vectorize", "-fomit-frame-pointer"]) ...
def configure(env): ## Build type
if env["target"].startswith("release"): env.Append(CPPDEFINES=["NDEBUG", ("NS_BLOCK_ASSERTIONS", 1)]) if env["optimize"] == "speed": # optimize for speed (default) env.Append(CCFLAGS=["-O2", "-ftree-vectorize", "-fomit-frame-pointer"]) env.Append(LINKFLAGS=["-O2"]) e...
import os import sys from methods import detect_darwin_sdk_path, get_darwin_sdk_version def is_active(): return True def get_name(): return "iOS" def can_build(): if sys.platform == "darwin": if get_darwin_sdk_version("iphone") < 13.0: print("Detected iOS SDK version older than 13"...
241
256
1,596
9
232
dsrw/godot
platform/iphone/detect.py
Python
configure
configure
47
184
47
49
7037d5ad2af96510a89cbfe721ece9d82c3d1473
bigcode/the-stack
train
de517865ca340c1f737176ed
train
function
def is_active(): return True
def is_active():
return True
import os import sys from methods import detect_darwin_sdk_path, get_darwin_sdk_version def is_active():
27
64
8
4
22
dsrw/godot
platform/iphone/detect.py
Python
is_active
is_active
6
7
6
6
d105ad7a15e8516c9f70e3f53bf5f5044d4fd2d0
bigcode/the-stack
train
c516ca756763321e2db3b468
train
function
def can_build(): if sys.platform == "darwin": if get_darwin_sdk_version("iphone") < 13.0: print("Detected iOS SDK version older than 13") return False return True elif "OSXCROSS_IOS" in os.environ: return True return False
def can_build():
if sys.platform == "darwin": if get_darwin_sdk_version("iphone") < 13.0: print("Detected iOS SDK version older than 13") return False return True elif "OSXCROSS_IOS" in os.environ: return True return False
import os import sys from methods import detect_darwin_sdk_path, get_darwin_sdk_version def is_active(): return True def get_name(): return "iOS" def can_build():
45
64
72
4
41
dsrw/godot
platform/iphone/detect.py
Python
can_build
can_build
14
23
14
14
e1d66af93bdf82106f2a126f4aa8b8f4a35ea71d
bigcode/the-stack
train
0ca3da397affa0fe084e0e1a
train
class
class CannotConnect(Exception): """ Error to indicate we cannot connect. Currently only used by the connection test. """
class CannotConnect(Exception):
""" Error to indicate we cannot connect. Currently only used by the connection test. """
}', " + f"firmware_version='{self.firmware_version}', " + f"wifi_firmware_version='{self.wifi_firmware_version}', " + f"is_on={self.is_on}, mode={self.mode}, fan_speed={self.fan_speed}>" ) class CannotConnect(Exception):
64
64
26
5
59
mfrister/phipsair
phipsair/purifier.py
Python
CannotConnect
CannotConnect
92
97
92
92
ab2b4c68524a47e86eccd61fedbf9a98dce59b38
bigcode/the-stack
train
75df8026884467b9f9b605f2
train
class
class _Command: def __init__(self, data: dict[str, Union[str, int, bool]], result: Future[Union[bool, None]]): self.data = data self.result = result
class _Command:
def __init__(self, data: dict[str, Union[str, int, bool]], result: Future[Union[bool, None]]): self.data = data self.result = result
.wifi_firmware_version}', " + f"is_on={self.is_on}, mode={self.mode}, fan_speed={self.fan_speed}>" ) class CannotConnect(Exception): """ Error to indicate we cannot connect. Currently only used by the connection test. """ class _Command:
63
64
46
4
59
mfrister/phipsair
phipsair/purifier.py
Python
_Command
_Command
100
103
100
100
4fe608a2bf68e4853fd59972ba6c73902c672b7d
bigcode/the-stack
train
c195fd494095d28628bd22ce
train
class
class Status: """Status represents the air purifier status in a form easily usable by the fan entity.""" def __init__( self, device_id: str, name: str, model: str, firmware_version: str, wifi_firmware_version: str, is_on: bool, mode: Mode, ...
class Status:
"""Status represents the air purifier status in a form easily usable by the fan entity.""" def __init__( self, device_id: str, name: str, model: str, firmware_version: str, wifi_firmware_version: str, is_on: bool, mode: Mode, fan_speed: Fa...
""" FanSpeed represents the different fan speeds reported by the device. The values are the values exposed by the device's JSON API, for convenience when converting the JSON. """ Off = "0" Silent = "s" Speed1 = "1" Speed2 = "2" Speed3 = "3" Turbo = "t" class Status:
82
82
276
3
79
mfrister/phipsair
phipsair/purifier.py
Python
Status
Status
54
89
54
54
853145ab6dce45ae694b1b5bae87a13449e90ee1
bigcode/the-stack
train
f7b28c6a23dd20eef37e4c7f
train
class
@enum.unique class Mode(enum.Enum): """ Mode represents the purifier operation modes. The modes define how speed is controlled by the purifier itself. Only Sleep mode also turns off lights on the device. The values are the values exposed by the device's JSON API, for convenience when converting ...
@enum.unique class Mode(enum.Enum):
""" Mode represents the purifier operation modes. The modes define how speed is controlled by the purifier itself. Only Sleep mode also turns off lights on the device. The values are the values exposed by the device's JSON API, for convenience when converting the JSON. """ Manual = "M...
from asyncio.futures import Future from asyncio.tasks import FIRST_COMPLETED from collections.abc import Callable from datetime import datetime, timedelta, timezone from typing import Union from phipsair import CoAPClient _LOGGER = logging.getLogger(__name__) @enum.unique class Mode(enum.Enum):
64
64
103
9
55
mfrister/phipsair
phipsair/purifier.py
Python
Mode
Mode
18
34
18
19
1ef63f084f3c072331ee5b0d5d00a5e78e98e8ff
bigcode/the-stack
train
ed0bcd0b8c38c18d869500c7
train
class
class PersistentClient: """ PersistentClient attempts to provide reliable communication with the Air Purifier. It does so by more or less aggressively timing out requests and retrying them. It also provides an interface with Python data types, abstracting from the purifier-provided JSON structures...
class PersistentClient:
""" PersistentClient attempts to provide reliable communication with the Air Purifier. It does so by more or less aggressively timing out requests and retrying them. It also provides an interface with Python data types, abstracting from the purifier-provided JSON structures. Note: Do NOT use ...
are usually extracted from the JSON provided by the purifier. """ self.device_id = device_id self.name = name self.model = model self.firmware_version = firmware_version self.wifi_firmware_version = wifi_firmware_version self.is_on = is_on self.mode = mod...
256
256
1,879
4
251
mfrister/phipsair
phipsair/purifier.py
Python
PersistentClient
PersistentClient
106
332
106
106
c4ac40b8aecf31be1d641a7df3669af375100196
bigcode/the-stack
train
481c6bd61e32c98c8e039f09
train
class
@enum.unique class FanSpeed(enum.Enum): """ FanSpeed represents the different fan speeds reported by the device. The values are the values exposed by the device's JSON API, for convenience when converting the JSON. """ Off = "0" Silent = "s" Speed1 = "1" Speed2 = "2" Speed3 = "...
@enum.unique class FanSpeed(enum.Enum):
""" FanSpeed represents the different fan speeds reported by the device. The values are the values exposed by the device's JSON API, for convenience when converting the JSON. """ Off = "0" Silent = "s" Speed1 = "1" Speed2 = "2" Speed3 = "3" Turbo = "t"
the values exposed by the device's JSON API, for convenience when converting the JSON. """ Manual = "M" Auto = "P" Allergen = "A" Sleep = "S" BacteriaVirus = "B" @enum.unique class FanSpeed(enum.Enum):
64
64
89
10
54
mfrister/phipsair
phipsair/purifier.py
Python
FanSpeed
FanSpeed
37
51
37
38
6ced5c5fe4e2cef845e198d15377f824a53f6dbe
bigcode/the-stack
train
6e46df8f9a47c0ad24b74934
train
class
class SelLibLocalFileDetector(FileDetector): def __init__(self): self.selenium_file_detector = LocalFileDetector() def is_local_file(self, *keys): if self.choose_file(): return self.selenium_file_detector.is_local_file(*keys) return None def choose_file(self): ...
class SelLibLocalFileDetector(FileDetector):
def __init__(self): self.selenium_file_detector = LocalFileDetector() def is_local_file(self, *keys): if self.choose_file(): return self.selenium_file_detector.is_local_file(*keys) return None def choose_file(self): try: sl = self._get_sl() e...
either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from robot.libraries.BuiltIn import BuiltIn from selenium.webdriver.remote.file_detector import FileDetector, LocalFileDetector import TestProjectSeleniumLibrary class SelLibLocalFileDetec...
64
64
153
9
54
DavidG8168/TestProjectRobotSeleniumLibrary
src/TestProjectSeleniumLibrary/keywords/webdrivertools/sl_file_detector.py
Python
SelLibLocalFileDetector
SelLibLocalFileDetector
22
45
22
23
930b55565741f6b25a5117c0656dfd96c6ed9dff
bigcode/the-stack
train
0955022debd214f4092d74c9
train
function
def read(fname): file_path = os.path.join(os.path.dirname(__file__), fname) return codecs.open(file_path, encoding='utf-8').read()
def read(fname):
file_path = os.path.join(os.path.dirname(__file__), fname) return codecs.open(file_path, encoding='utf-8').read()
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import codecs from setuptools import setup def read(fname):
29
64
34
4
24
blueyed/pytest-travis-fold
setup.py
Python
read
read
9
11
9
9
6dd64e2792e2f061707f95873f51580be5f7dd7b
bigcode/the-stack
train
a0115e9a8432d3178f771e1a
train
class
class CloudJob(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ """ Attributes: swagger_types (dict): The key is attribute name and the value is attribute type. attribute_map (dict): Th...
class CloudJob(object):
"""NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ """ Attributes: swagger_types (dict): The key is attribute name and the value is attribute type. attribute_map (dict): The key is attribute name ...
# coding: utf-8 """ Isilon SDK Isilon SDK - Language bindings for the OneFS API # noqa: E501 OpenAPI spec version: 5 Contact: sdk@isilon.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 import six class CloudJob(object):
86
256
867
5
80
mohitjain97/isilon_sdk_python
isi_sdk_8_1_0/isi_sdk_8_1_0/models/cloud_job.py
Python
CloudJob
CloudJob
20
148
20
20
34d3d425dfe746a02c8f8861a42dbc10adcf1107
bigcode/the-stack
train
b959ee7634559143b5eb14ff
train
class
class Migration(migrations.Migration): dependencies = [ ('instalacion', '0001_initial'), ] operations = [ migrations.AddField( model_name='instalacion', name='network_meraky_id', field=models.CharField(default='', max_length=255), ), ]
class Migration(migrations.Migration):
dependencies = [ ('instalacion', '0001_initial'), ] operations = [ migrations.AddField( model_name='instalacion', name='network_meraky_id', field=models.CharField(default='', max_length=255), ), ]
# Generated by Django 2.2.13 on 2020-12-01 10:59 from django.db import migrations, models class Migration(migrations.Migration):
38
64
65
7
30
joelsegoviacrespo/control_aforo_migrado
instalacion/migrations/0002_instalacion_network_meraky_id.py
Python
Migration
Migration
6
18
6
7
1cf00de84332266b2f5dc0c290e702c9a3b18be8
bigcode/the-stack
train
9549176b4f5857529a0b2711
train
class
@testRun(macro_name="ct", macro_params=['.1'], wait_timeout=2.5) @testRun(macro_name="ct", macro_params=['.3'], wait_timeout=2.5) @testStop(macro_name="ct", macro_params=['1'], stop_delay=.1, wait_timeout=3.5) # TODO: uncomment these test when bug-474 is fixed: # https://sourceforge.net/p/sardana/tickets/474/ #@testRun...
@testRun(macro_name="ct", macro_params=['.1'], wait_timeout=2.5) @testRun(macro_name="ct", macro_params=['.3'], wait_timeout=2.5) @testStop(macro_name="ct", macro_params=['1'], stop_delay=.1, wait_timeout=3.5) # TODO: uncomment these test when bug-474 is fixed: # https://sourceforge.net/p/sardana/tickets/474/ #@testRun...
"""Test of ct macro. It verifies that macro ct can be executed. It inherits from RunStopMacroTestCase and from unittest.TestCase. It tests two executions of the ct macro with two different input parameters. Then it does another execution and it tests if the execution can be aborted. """ ...
@testRun(macro_name="ct", macro_params=['.1'], wait_timeout=2.5) @testRun(macro_name="ct", macro_params=['.3'], wait_timeout=2.5) @testStop(macro_name="ct", macro_params=['1'], stop_delay=.1, wait_timeout=3.5) # TODO: uncomment these test when bug-474 is fixed: # https://sourceforge.net/p/sardana/tickets/474/ #@testRun...
176
74
247
176
0
tacaswell/sardana
src/sardana/macroserver/macros/test/test_ct.py
Python
CtTest
CtTest
34
51
34
43
0fd58da3ed51b2dfe98468de4481d4ef1630b0da
bigcode/the-stack
train
95080adf19d5d990947a8211
train
class
class _FindDefinitionKeywordCollector(object): def __init__(self, match_name): from robotframework_ls.impl.string_matcher import RobotStringMatcher from robotframework_ls.impl.string_matcher import ( build_matchers_with_resource_or_library_scope, ) self.match_name = matc...
class _FindDefinitionKeywordCollector(object):
def __init__(self, match_name): from robotframework_ls.impl.string_matcher import RobotStringMatcher from robotframework_ls.impl.string_matcher import ( build_matchers_with_resource_or_library_scope, ) self.match_name = match_name self.matches = [] self....
[int] = None def __str__(self): return "_DefinitionFromVariable(%s[%s, %s:%s])" % ( self.variable_found.__class__.__name__, self.variable_found.variable_name, self.source, self.lineno, ) __repr__ = __str__ def __typecheckself__(self) -> None...
96
96
322
8
88
mrdimfox/robotframework-lsp
robotframework-ls/src/robotframework_ls/impl/find_definition.py
Python
_FindDefinitionKeywordCollector
_FindDefinitionKeywordCollector
168
219
168
168
dc7d79de168aac01254697ff41a2ff74492a0e2f
bigcode/the-stack
train
978abd8bedaf2ae7dfaaf7f1
train
function
def find_keyword_definition( completion_context: ICompletionContext, token_info: TokenInfo ) -> Optional[Sequence[IKeywordDefinition]]: """ Find a definition only considering Keywords. The token info must be already computed and must match the completion context location. """ from robotfram...
def find_keyword_definition( completion_context: ICompletionContext, token_info: TokenInfo ) -> Optional[Sequence[IKeywordDefinition]]:
""" Find a definition only considering Keywords. The token info must be already computed and must match the completion context location. """ from robotframework_ls.impl.collect_keywords import collect_keywords from robotframework_ls.impl import ast_utils token = ast_utils.get_keyword_n...
DefinitionFromVariable(variable_found) self.matches.append(definition) def __typecheckself__(self) -> None: _: IVariablesCollector = check_implements(self) def find_keyword_definition( completion_context: ICompletionContext, token_info: TokenInfo ) -> Optional[Sequence[IKeywordDefinition]]:
64
64
133
28
36
mrdimfox/robotframework-lsp
robotframework-ls/src/robotframework_ls/impl/find_definition.py
Python
find_keyword_definition
find_keyword_definition
240
257
240
242
264dd56fc03a3f0f2245dff705053d842e4f56b4
bigcode/the-stack
train
0f780031fe59c9469b0a5a6d
train
function
def find_definition_extended( completion_context: ICompletionContext, ) -> Optional[_DefinitionInfo]: """ :note: Definitions may be found even if a given source file no longer exists at this place (callers are responsible for validating entries). """ from robotframework_ls.impl impor...
def find_definition_extended( completion_context: ICompletionContext, ) -> Optional[_DefinitionInfo]:
""" :note: Definitions may be found even if a given source file no longer exists at this place (callers are responsible for validating entries). """ from robotframework_ls.impl import ast_utils from robotframework_ls.impl.string_matcher import RobotStringMatcher from robotframewo...
token = ast_utils.get_keyword_name_token(token_info.node, token_info.token) if token is not None: collector = _FindDefinitionKeywordCollector(token.value) collect_keywords(completion_context, collector) return collector.matches return None def find_definition(completion_context: ...
175
175
585
20
154
mrdimfox/robotframework-lsp
robotframework-ls/src/robotframework_ls/impl/find_definition.py
Python
find_definition_extended
find_definition_extended
277
359
277
279
234f25de29165ea777fce723a6fa9bcd18e9454d
bigcode/the-stack
train
a3fbff489d0d1f757b475e10
train
function
def find_definition(completion_context: ICompletionContext) -> Sequence[IDefinition]: definition_info = find_definition_extended(completion_context) if definition_info is None: return [] return definition_info.definitions
def find_definition(completion_context: ICompletionContext) -> Sequence[IDefinition]:
definition_info = find_definition_extended(completion_context) if definition_info is None: return [] return definition_info.definitions
_name_token(token_info.node, token_info.token) if token is not None: collector = _FindDefinitionKeywordCollector(token.value) collect_keywords(completion_context, collector) return collector.matches return None def find_definition(completion_context: ICompletionContext) -> Sequence[IDefi...
64
64
46
18
45
mrdimfox/robotframework-lsp
robotframework-ls/src/robotframework_ls/impl/find_definition.py
Python
find_definition
find_definition
260
264
260
260
65f5442079650fec62caa489da81a04bf92ba6b5
bigcode/the-stack
train
a866a0c3d4653cfe86469362
train
class
class _FindDefinitionVariablesCollector(object): def __init__(self, sel, token, robot_string_matcher): self.matches = [] self.sel = sel self.token = token self.matcher = robot_string_matcher def accepts(self, variable_name): return self.matcher.is_same_robot_name(variabl...
class _FindDefinitionVariablesCollector(object):
def __init__(self, sel, token, robot_string_matcher): self.matches = [] self.sel = sel self.token = token self.matcher = robot_string_matcher def accepts(self, variable_name): return self.matcher.is_same_robot_name(variable_name) def on_variable(self, variable_found...
: str, lineno: int, end_lineno: int, col_offset: int, end_col_offset: int, ): pass def __typecheckself__(self) -> None: _: IKeywordCollector = check_implements(self) class _FindDefinitionVariablesCollector(object):
64
64
118
8
56
mrdimfox/robotframework-lsp
robotframework-ls/src/robotframework_ls/impl/find_definition.py
Python
_FindDefinitionVariablesCollector
_FindDefinitionVariablesCollector
222
237
222
222
61993d948bd80614dfb7c2ace64e1346f6d75bf5
bigcode/the-stack
train
825c21663b59130b9cc7ecc8
train
class
class _DefinitionFromLibrary(object): def __init__(self, library_doc): """ :param LibraryDoc library_info: """ self.keyword_name = "" self.library_doc = library_doc self.source = library_doc.source # Note: line/offsets 0-based. self.lineno = 0 ...
class _DefinitionFromLibrary(object):
def __init__(self, library_doc): """ :param LibraryDoc library_info: """ self.keyword_name = "" self.library_doc = library_doc self.source = library_doc.source # Note: line/offsets 0-based. self.lineno = 0 self.end_lineno = 0 self.col_o...
[%s, %s:%s]" % ( self.keyword_name, self.source, self.lineno, ) __repr__ = __str__ def __typecheckself__(self) -> None: _: IKeywordDefinition = check_implements(self) class _DefinitionFromLibrary(object):
64
64
196
7
57
mrdimfox/robotframework-lsp
robotframework-ls/src/robotframework_ls/impl/find_definition.py
Python
_DefinitionFromLibrary
_DefinitionFromLibrary
47
72
47
47
5da14f40824eb62036347ba9ccd4aedab2be7b7d
bigcode/the-stack
train
4f95abd6400173dcbd9b2d9b
train
class
class _DefinitionFromVariable(object): def __init__(self, variable_found): """ :param IVariableFound variable_found: """ self.variable_found = variable_found self.keyword_name = "" self.source = variable_found.source self.lineno = variable_found.lineno ...
class _DefinitionFromVariable(object):
def __init__(self, variable_found): """ :param IVariableFound variable_found: """ self.variable_found = variable_found self.keyword_name = "" self.source = variable_found.source self.lineno = variable_found.lineno self.end_lineno = variable_found.end_...
: Optional[int] = None def __str__(self): return "DefinitionFromVariableImport[%s]" % (self.source,) __repr__ = __str__ def __typecheckself__(self) -> None: _: IDefinition = check_implements(self) class _DefinitionFromVariable(object):
67
67
225
7
60
mrdimfox/robotframework-lsp
robotframework-ls/src/robotframework_ls/impl/find_definition.py
Python
_DefinitionFromVariable
_DefinitionFromVariable
135
165
135
135
54f47454a44f9e75d833982f87530632e1ad3ea7
bigcode/the-stack
train
54589b5f456f729713e4583e
train
class
class _DefinitionFromVariableImport(object): def __init__(self, variables_doc): """ :param RobotDocument variables_doc: """ from robocorp_ls_core import uris self.keyword_name = "" self.variables_doc = variables_doc self.source = uris.to_fs_path(variables_doc...
class _DefinitionFromVariableImport(object):
def __init__(self, variables_doc): """ :param RobotDocument variables_doc: """ from robocorp_ls_core import uris self.keyword_name = "" self.variables_doc = variables_doc self.source = uris.to_fs_path(variables_doc.uri) # Note: line/offsets 0-based. ...
] = None def __str__(self): return "DefinitionFromResource[%s]" % (self.source,) __repr__ = __str__ def __typecheckself__(self) -> None: _: IDefinition = check_implements(self) class _DefinitionFromVariableImport(object):
64
64
215
8
56
mrdimfox/robotframework-lsp
robotframework-ls/src/robotframework_ls/impl/find_definition.py
Python
_DefinitionFromVariableImport
_DefinitionFromVariableImport
105
132
105
105
f7911e96b0673f53917258509d76f128c5718bf8
bigcode/the-stack
train
906d811a7fdc59fe64f4c380
train
class
class _DefinitionFromResource(object): def __init__(self, resource_doc): """ :param RobotDocument resource_doc: """ from robocorp_ls_core import uris self.keyword_name = "" self.resource_doc = resource_doc self.source = uris.to_fs_path(resource_doc.uri) ...
class _DefinitionFromResource(object):
def __init__(self, resource_doc): """ :param RobotDocument resource_doc: """ from robocorp_ls_core import uris self.keyword_name = "" self.resource_doc = resource_doc self.source = uris.to_fs_path(resource_doc.uri) # Note: line/offsets 0-based. ...
[int] = None def __str__(self): return "DefinitionFromLibrary[%s]" % (self.source,) __repr__ = __str__ def __typecheckself__(self) -> None: _: IDefinition = check_implements(self) class _DefinitionFromResource(object):
64
64
212
7
57
mrdimfox/robotframework-lsp
robotframework-ls/src/robotframework_ls/impl/find_definition.py
Python
_DefinitionFromResource
_DefinitionFromResource
75
102
75
75
d63900167e448063541f8a7b19a3536a5f0f22d8
bigcode/the-stack
train
eac6cd04a051ba218c7162a0
train
class
class _DefinitionFromKeyword(object): def __init__(self, keyword_found: IKeywordFound): self.keyword_found = keyword_found self.keyword_name = keyword_found.keyword_name self.source = keyword_found.source self.lineno = keyword_found.lineno self.end_lineno = keyword_found.end...
class _DefinitionFromKeyword(object):
def __init__(self, keyword_found: IKeywordFound): self.keyword_found = keyword_found self.keyword_name = keyword_found.keyword_name self.source = keyword_found.source self.lineno = keyword_found.lineno self.end_lineno = keyword_found.end_lineno self.col_offset = keyw...
, IKeywordFound, ) from robocorp_ls_core.protocols import check_implements from typing import Optional, Sequence from robocorp_ls_core.lsp import RangeTypedDict _RF_VARIABLE = re.compile(r"([$|&|@]{[\w\s]+})") class _DefinitionFromKeyword(object):
66
66
223
7
59
mrdimfox/robotframework-lsp
robotframework-ls/src/robotframework_ls/impl/find_definition.py
Python
_DefinitionFromKeyword
_DefinitionFromKeyword
18
44
18
18
5270e2aa5bee5450468b252b1fd4eea4a474b1ff
bigcode/the-stack
train
a117bb2ad5e8630ea28e034c
train
class
class _DefinitionInfo: def __init__( self, definitions: Sequence[IDefinition], origin_selection_range: Optional[RangeTypedDict] = None, ): self.definitions = definitions self.origin_selection_range = origin_selection_range
class _DefinitionInfo:
def __init__( self, definitions: Sequence[IDefinition], origin_selection_range: Optional[RangeTypedDict] = None, ): self.definitions = definitions self.origin_selection_range = origin_selection_range
_context, collector) return collector.matches return None def find_definition(completion_context: ICompletionContext) -> Sequence[IDefinition]: definition_info = find_definition_extended(completion_context) if definition_info is None: return [] return definition_info.definitions class ...
64
64
55
5
58
mrdimfox/robotframework-lsp
robotframework-ls/src/robotframework_ls/impl/find_definition.py
Python
_DefinitionInfo
_DefinitionInfo
267
274
267
267
a8ea380d5b5bbb6b2c37a469c4c94b87c4230809
bigcode/the-stack
train
e6268bdb20460006e7ed0d4f
train
function
def print_dict(dict_to_print, indent=0): """ Neatly print a dictionary with indentation for nesting. This function prints a dictionary with items visually indented according to their nesting. Multiple nesting and sub-nesting levels are supported. Args: dict_to_print (dict): T...
def print_dict(dict_to_print, indent=0):
""" Neatly print a dictionary with indentation for nesting. This function prints a dictionary with items visually indented according to their nesting. Multiple nesting and sub-nesting levels are supported. Args: dict_to_print (dict): The dictionary to print. The dictionary en...
') if nrel_cluster == 'eagle': hpc_run = True else: hpc_run = False print('It looks like you\'re running this notebook on a laptop.') print('Operations requiring HPC resources will be disabled.') return hpc_run def print_dict(dict_to_print, indent=0):
72
72
241
11
60
NREL/VirtualEngineering
vebio/Utilities.py
Python
print_dict
print_dict
37
69
37
37
8f7d2bf9a185acb988be37b1074a3ee4d050f817
bigcode/the-stack
train
d00055a7a11817c2b754fd1b
train
function
def get_host_computer(): """ Check if environment is running on the HPC. This function queries an environment variable, ``NREL_CLUSTER`` and if the pattern "eagle" is found, sets the variable ``hpc_run`` to True to allow the submission CFD jobs from the Notebook. Note that the particular pattern ...
def get_host_computer():
""" Check if environment is running on the HPC. This function queries an environment variable, ``NREL_CLUSTER`` and if the pattern "eagle" is found, sets the variable ``hpc_run`` to True to allow the submission CFD jobs from the Notebook. Note that the particular pattern "eagle" is found to corre...
import os import yaml def get_host_computer():
12
64
211
6
5
NREL/VirtualEngineering
vebio/Utilities.py
Python
get_host_computer
get_host_computer
4
34
4
4
139f19150b652ff7944cc5d374dff3b69b3fef2f
bigcode/the-stack
train
f6bc00e2737f74e3eb9979b8
train
function
def yaml_to_dict(yaml_filename, verbose=False): """ Read a YAML file and store as a dictionary. This function reads an input YAML file and stores the contents as a Python dictionary, where all necessary relationships and keynames are preserved as shown in the YAML file. Args: yaml_fil...
def yaml_to_dict(yaml_filename, verbose=False):
""" Read a YAML file and store as a dictionary. This function reads an input YAML file and stores the contents as a Python dictionary, where all necessary relationships and keynames are preserved as shown in the YAML file. Args: yaml_filename (str): The YAML filename to re...
Writing the Dictionary:') print_dict(dictionary_to_write) print('To the File: %s\n' % (yaml_filename)) with open(yaml_filename, 'w') as fp: yaml.dump(dictionary_to_write, fp, sort_keys=False) def yaml_to_dict(yaml_filename, verbose=False):
64
64
186
11
53
NREL/VirtualEngineering
vebio/Utilities.py
Python
yaml_to_dict
yaml_to_dict
139
166
139
139
36f874c64c54ac12696828308a80c41278a1487f
bigcode/the-stack
train
7405c62f7026328e84acb0a8
train
function
def dict_to_yaml(dictionary_to_write, yaml_filename, merge_with_existing=False, verbose=False): """ Write an input dictionary to a YAML file. This function takes an input dictionary and writes it directly to a YAML file, preserving any nesting and keyname relationships. For example an input dictionary...
def dict_to_yaml(dictionary_to_write, yaml_filename, merge_with_existing=False, verbose=False):
""" Write an input dictionary to a YAML file. This function takes an input dictionary and writes it directly to a YAML file, preserving any nesting and keyname relationships. For example an input dictionary:: input_dict = {'parent_1': {'a': 2, 'b': 3}, 'parent_2': {'a': ...
If not included, the default indentation of 0 is used. Non-zero values of indent effectively shift the output to the right. Returns: None """ for key, value in dict_to_print.items(): if type(value) is dict: for j in range(indent): print(' ', end=...
151
151
505
19
132
NREL/VirtualEngineering
vebio/Utilities.py
Python
dict_to_yaml
dict_to_yaml
72
136
72
72
a451dd511f024ce5527eda640ad41f1353589cc7
bigcode/the-stack
train
721089295f36b2468343141d
train
function
@bot.command(name="resume", help="Resumes the song") async def resume(ctx: Context): voice_client = ctx.message.guild.voice_client if voice_client.is_paused(): await voice_client.resume() else: await ctx.send("The bot was not playing anything before this. Use play command")
@bot.command(name="resume", help="Resumes the song") async def resume(ctx: Context):
voice_client = ctx.message.guild.voice_client if voice_client.is_paused(): await voice_client.resume() else: await ctx.send("The bot was not playing anything before this. Use play command")
voice_client = ctx.message.guild.voice_client if voice_client.is_playing(): await voice_client.pause() else: await ctx.send("The bot is not playing anything at the moment.") @bot.command(name="resume", help="Resumes the song") async def resume(ctx: Context):
63
64
66
21
42
kantharos-net/kantharos-bot
src/kantharos_bot/commands/music_stream.py
Python
resume
resume
73
79
73
74
230515f5606081a03b54d1162882e7dc7132f0d6
bigcode/the-stack
train
32f4c2fce7068e23bad1610c
train
function
@bot.command(name="music", help=load_help("music")) async def music(ctx: Context, link: str = ""): cfg: Dict[str, Any] = load_config() logging.info("Provided yt link: {}".format(link)) logging.info("Config: {}".format(cfg)) if link == "": await ctx.send("Please provide a valid link") r...
@bot.command(name="music", help=load_help("music")) async def music(ctx: Context, link: str = ""):
cfg: Dict[str, Any] = load_config() logging.info("Provided yt link: {}".format(link)) logging.info("Config: {}".format(cfg)) if link == "": await ctx.send("Please provide a valid link") return video: YouTube = YouTube(link) m: str = "Video data:\nTitle: {title}\nChannel: {aut...
load_config from kantharos_bot.utils.load_help import load_help from kantharos_bot.utils.yt_source import YTDLSource from pytube import YouTube @bot.command(name="music", help=load_help("music")) async def music(ctx: Context, link: str = ""):
64
64
153
27
36
kantharos-net/kantharos-bot
src/kantharos_bot/commands/music_stream.py
Python
music
music
27
47
27
28
9b38abc853e13829b0b5f19131280dc21bc942ed
bigcode/the-stack
train
a4481c314f997740ac244c64
train
function
@bot.command(name="play", help="To play song") async def play(ctx: Context, url: str): try: server = ctx.message.guild voice_channel = server.voice_client async with ctx.typing(): filename = await YTDLSource.from_url(url, loop=bot.loop) voice_channel.play(FFmpegPCMAu...
@bot.command(name="play", help="To play song") async def play(ctx: Context, url: str):
try: server = ctx.message.guild voice_channel = server.voice_client async with ctx.typing(): filename = await YTDLSource.from_url(url, loop=bot.loop) voice_channel.play(FFmpegPCMAudio(executable="ffmpeg", source=filename)) await ctx.send("**Now playing:** {}"...
: {length} seconds" response: str = m.format( title=video.title, author=video.author, length=video.length, ) await ctx.send(response) @bot.command(name="play", help="To play song") async def play(ctx: Context, url: str):
64
64
126
24
40
kantharos-net/kantharos-bot
src/kantharos_bot/commands/music_stream.py
Python
play
play
50
61
50
51
f93146917a5a0ee2b6b031e703758d0831f208b8
bigcode/the-stack
train
98914c41c930f5c521f2cb0a
train
function
@bot.command(name="pause", help="This command pauses the song") async def pause(ctx: Context): voice_client = ctx.message.guild.voice_client if voice_client.is_playing(): await voice_client.pause() else: await ctx.send("The bot is not playing anything at the moment.")
@bot.command(name="pause", help="This command pauses the song") async def pause(ctx: Context):
voice_client = ctx.message.guild.voice_client if voice_client.is_playing(): await voice_client.pause() else: await ctx.send("The bot is not playing anything at the moment.")
filename)) await ctx.send("**Now playing:** {}".format(filename)) except Exception as e: await ctx.send("The bot is not connected to a voice channel. Exception: {}".format(e)) @bot.command(name="pause", help="This command pauses the song") async def pause(ctx: Context):
64
64
64
22
42
kantharos-net/kantharos-bot
src/kantharos_bot/commands/music_stream.py
Python
pause
pause
64
70
64
65
c4d08733fd8eabda2c60c7a277dda1acda01d2da
bigcode/the-stack
train
151a85930d6c5a349f6ab586
train
function
@bot.command(name="stop", help="Stops the song") async def stop(ctx: Context): voice_client = ctx.message.guild.voice_client if voice_client.is_playing(): await voice_client.stop() else: await ctx.send("The bot is not playing anything at the moment.")
@bot.command(name="stop", help="Stops the song") async def stop(ctx: Context):
voice_client = ctx.message.guild.voice_client if voice_client.is_playing(): await voice_client.stop() else: await ctx.send("The bot is not playing anything at the moment.")
voice_client = ctx.message.guild.voice_client if voice_client.is_paused(): await voice_client.resume() else: await ctx.send("The bot was not playing anything before this. Use play command") @bot.command(name="stop", help="Stops the song") async def stop(ctx: Context):
64
64
62
20
44
kantharos-net/kantharos-bot
src/kantharos_bot/commands/music_stream.py
Python
stop
stop
82
88
82
83
29e1333d93c5ca3464537a377d84c78d786680c0
bigcode/the-stack
train
2f54d0b097ec307bf21c1683
train
function
def fill_dim_list(path_1: str, path_2: str) -> Tuple[list, list]: """ 根据输入csv文件的路径,返回两个填满[(dim_code, dim_name), (dim_code, dim_name), ...]的列表 Args: path_1: path_2: Returns: """ list_1 = [] list_2 = [] list_extend_1 = list_1.extend list_extend_2 = list...
def fill_dim_list(path_1: str, path_2: str) -> Tuple[list, list]:
""" 根据输入csv文件的路径,返回两个填满[(dim_code, dim_name), (dim_code, dim_name), ...]的列表 Args: path_1: path_2: Returns: """ list_1 = [] list_2 = [] list_extend_1 = list_1.extend list_extend_2 = list_2.extend with open(path_1, encoding="utf8") as file: ...
@Project : robust_python # @File : basic_compare.py # @Version : V0.0.1 # @Desc : ? import csv from typing import Tuple from std_module.handy_tools import pairs def _trans_parentheses(str_in: str) -> str: str_in = str_in.replace(")", ")") str_in = str_in.replace("(", "(") ...
116
116
389
22
93
lukasdean/robust_python
data_processing/compare_data/basic_compare.py
Python
fill_dim_list
fill_dim_list
23
71
23
23
dbbf166e01706829c5199d8931151ca94b1faa02
bigcode/the-stack
train
3573ac0056977fa8de8fc3a8
train
function
def compare_data(list_in_dlmu: list, dict_std: dict) -> Tuple[list, list]: list_mapped = [] list_unmapped = [] list_mapped_append = list_mapped.append list_unmapped_append = list_unmapped.append get_std = dict_std.get for dlmu_code, dlmu_name in list_in_dlmu: if get_std(dl...
def compare_data(list_in_dlmu: list, dict_std: dict) -> Tuple[list, list]:
list_mapped = [] list_unmapped = [] list_mapped_append = list_mapped.append list_unmapped_append = list_unmapped.append get_std = dict_std.get for dlmu_code, dlmu_name in list_in_dlmu: if get_std(dlmu_name): list_mapped_append((dlmu_code, dlmu_name, get_std(dlmu_...
2: list_extend_2( list(pairs(iter((tmp_list[-3], _trans_parentheses(tmp_list[-1]))))) ) return list_1, list_2 def compare_data(list_in_dlmu: list, dict_std: dict) -> Tuple[list, list]:
64
64
139
22
41
lukasdean/robust_python
data_processing/compare_data/basic_compare.py
Python
compare_data
compare_data
74
90
74
75
6ef50370e3ec3672605d450e4cf74851f9dcf7a4
bigcode/the-stack
train
15a4998a6ff22c2049745fbf
train
function
def _trans_parentheses(str_in: str) -> str: str_in = str_in.replace(")", ")") str_in = str_in.replace("(", "(") return str_in
def _trans_parentheses(str_in: str) -> str:
str_in = str_in.replace(")", ")") str_in = str_in.replace("(", "(") return str_in
Project : robust_python # @File : basic_compare.py # @Version : V0.0.1 # @Desc : ? import csv from typing import Tuple from std_module.handy_tools import pairs def _trans_parentheses(str_in: str) -> str:
64
64
42
13
50
lukasdean/robust_python
data_processing/compare_data/basic_compare.py
Python
_trans_parentheses
_trans_parentheses
16
20
16
16
f1d7b1b82566bc8b9e76cf38ba6310ca1103b72a
bigcode/the-stack
train
176100ccbb67c54e99399b2d
train
function
def write_csv(list_in: list, path: str): # print(list_in) # 升序排序 def sort_asc(unsorted_list: list): for i in range(0, len(unsorted_list)): low = i for j, tmp_tuple in enumerate(unsorted_list): code, name = tmp_tuple[0], tmp_tuple[1] ...
def write_csv(list_in: list, path: str): # print(list_in) # 升序排序
def sort_asc(unsorted_list: list): for i in range(0, len(unsorted_list)): low = i for j, tmp_tuple in enumerate(unsorted_list): code, name = tmp_tuple[0], tmp_tuple[1] if int(code) < int(unsorted_list[low][0]): unsorted_list[l...
_name, get_std(dlmu_name), dlmu_name)) else: list_unmapped_append((dlmu_code, dlmu_name)) return list_mapped, list_unmapped def write_csv(list_in: list, path: str): # print(list_in) # 升序排序
64
64
180
25
38
lukasdean/robust_python
data_processing/compare_data/basic_compare.py
Python
write_csv
write_csv
93
114
93
97
ae70c23cd1f355788f9a483295f081fe5037e223
bigcode/the-stack
train
28aa4d365733ea248737e9fd
train
function
def tuftestyle(ax): """Styles an axes object to have minimalist graph features""" #ax.grid(True, 'major', color='w', linestyle='-', linewidth=1.5,alpha=0.6) #ax.patch.set_facecolor('white') ax.set_axisbelow(True) ax.spines["right"].set_visible(False) ax.spines["top"].set_visible(False)...
def tuftestyle(ax):
"""Styles an axes object to have minimalist graph features""" #ax.grid(True, 'major', color='w', linestyle='-', linewidth=1.5,alpha=0.6) #ax.patch.set_facecolor('white') ax.set_axisbelow(True) ax.spines["right"].set_visible(False) ax.spines["top"].set_visible(False) ax.spines["bott...
import matplotlib def tuftestyle(ax):
9
89
298
5
3
ucbrise/snoopy
scripts/fig/tufte.py
Python
tuftestyle
tuftestyle
3
30
3
3
7dc6492fc3417ab49eab5b145e2f941d2f953b0c
bigcode/the-stack
train
95c46cc835e9050afdfada12
train
class
class DataGenerator(Sequence): def __init__(self, dataset_name, dataset_fold, subset, batch_size=32, reshuffle=False, shuffle_indiv_order=False, sample_method = 'central', **data_kwargs): if dataset_name == 'UT': dataset = UT self.pos...
class DataGenerator(Sequence):
def __init__(self, dataset_name, dataset_fold, subset, batch_size=32, reshuffle=False, shuffle_indiv_order=False, sample_method = 'central', **data_kwargs): if dataset_name == 'UT': dataset = UT self.pose_style = 'OpenPose' el...
import os import numpy as np from keras.utils import Sequence from datasets import UT, SBU, NTU, NTU_V2 from misc.data_io import get_data class DataGenerator(Sequence):
44
256
1,272
6
37
FoteiniD/inter-rel-net
src/datasets/data_generator.py
Python
DataGenerator
DataGenerator
9
132
9
9
c9a27d7d3ffa42af5633a6da46ab6d088505e178
bigcode/the-stack
train
7d35261669e335f7a27b09af
train
class
class DataGeneratorSeq(Sequence): def __init__(self, dataset_name, dataset_fold, subset, batch_size=32, reshuffle=False, shuffle_indiv_order=False, pad_sequences = False, maxlen=None, padding='pre', buffer_data = False, **data_kwargs): if data...
class DataGeneratorSeq(Sequence):
def __init__(self, dataset_name, dataset_fold, subset, batch_size=32, reshuffle=False, shuffle_indiv_order=False, pad_sequences = False, maxlen=None, padding='pre', buffer_data = False, **data_kwargs): if dataset_name == 'UT': data...
_y = np.array(batch_y) if self.shuffle_indiv_order: ### Always swap half of the batch num_joints = len(batch_x)//2 p1_joints = list(range(num_joints)) p2_joints = list(range(num_joints, num_joints*2)) swap_index = sorted(np.random.choice(list(...
256
256
1,216
7
249
FoteiniD/inter-rel-net
src/datasets/data_generator.py
Python
DataGeneratorSeq
DataGeneratorSeq
134
261
134
134
b01fb506d7b94495e2a806e911d2d7fd3b2768e9
bigcode/the-stack
train
44ee174128f9d4352c5d0189
train
class
class TestLinter(TestCase, DatabaseTestMixin): def test_empty_tables(self): reports = check_empty_tables(self.connection) # only include tables from our test case reports = [ report for report in reports if report.table_name.startswith('0089_') ] pr...
class TestLinter(TestCase, DatabaseTestMixin):
def test_empty_tables(self): reports = check_empty_tables(self.connection) # only include tables from our test case reports = [ report for report in reports if report.table_name.startswith('0089_') ] print(list(map(str, reports))) self.asser...
from __future__ import print_function from unittest import TestCase from indexdigest.linters.linter_0089_empty_tables import check_empty_tables from indexdigest.test import DatabaseTestMixin class TestLinter(TestCase, DatabaseTestMixin):
51
64
137
11
39
macbre/index-digest
indexdigest/test/linters/test_0089_empty_tables.py
Python
TestLinter
TestLinter
9
26
9
10
5af5961dde1c33d68a7008879574d7a8cf12948e
bigcode/the-stack
train
7a6787b5753170d92a9637f5
train
function
def configdocs(): return '''CONFIGDOCS The Shipyard Buffer Documents Supported Commands: shipyard commit configdocs shipyard create configdocs shipyard get configdocs'''
def configdocs():
return '''CONFIGDOCS The Shipyard Buffer Documents Supported Commands: shipyard commit configdocs shipyard create configdocs shipyard get configdocs'''
committed configuration documents. update_site: Triggers the initial deployment of a site, using the latest committed configuration documents. redeploy_server: Using parameters to indicate which server(s), triggers a redeployment of servers to the last committed design and ...
63
64
41
4
59
att-comdev/shipyard
src/bin/shipyard_client/shipyard_client/cli/help/output.py
Python
configdocs
configdocs
49
56
49
49
a1cf0ac55db6b64f1bc1b1693274504ffd217330
bigcode/the-stack
train
7eb1a25b41b6f1822bdd15cc
train
function
def logs(): return '''LOGS Allows users to query and view logs using Shipyard Supported Commands: shipyard logs step'''
def logs():
return '''LOGS Allows users to query and view logs using Shipyard Supported Commands: shipyard logs step'''
redeployment of servers to the last committed design and secrets. ''' def configdocs(): return '''CONFIGDOCS The Shipyard Buffer Documents Supported Commands: shipyard commit configdocs shipyard create configdocs shipyard get configdocs''' def logs():
63
64
29
3
60
att-comdev/shipyard
src/bin/shipyard_client/shipyard_client/cli/help/output.py
Python
logs
logs
59
64
59
59
15e40a6dd9975bfa7016be69fc0bdfb346b15094
bigcode/the-stack
train