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
191468b02d618be132be087d
train
class
@jsii.data_type(jsii_type="@aws-cdk/core.CfnAutoScalingScheduledAction", jsii_struct_bases=[], name_mapping={'ignore_unmodified_group_size_properties': 'ignoreUnmodifiedGroupSizeProperties'}) class CfnAutoScalingScheduledAction(): def __init__(self, *, ignore_unmodified_group_size_properties: typing.Optional[bool]=...
@jsii.data_type(jsii_type="@aws-cdk/core.CfnAutoScalingScheduledAction", jsii_struct_bases=[], name_mapping={'ignore_unmodified_group_size_properties': 'ignoreUnmodifiedGroupSizeProperties'}) class CfnAutoScalingScheduledAction():
def __init__(self, *, ignore_unmodified_group_size_properties: typing.Optional[bool]=None): """With scheduled actions, the group size properties of an Auto Scaling group can change at any time. When you update a stack with an Auto Scaling group and scheduled action, AWS CloudFormation alway...
._values == self._values def __ne__(self, rhs) -> bool: return not (rhs == self) def __repr__(self) -> str: return 'CfnAutoScalingRollingUpdate(%s)' % ', '.join(k + '=' + repr(v) for k, v in self._values.items()) @jsii.data_type(jsii_type="@aws-cdk/core.CfnAutoScalingScheduledAction", jsii_str...
121
121
405
51
70
chriscoombs/amazon-sagemaker-cdk-examples
dask-fargate/.env/lib/python3.6/site-packages/aws_cdk/core/__init__.py
Python
CfnAutoScalingScheduledAction
CfnAutoScalingScheduledAction
857
888
857
858
81b4984420b6a2ca612d4185ca2419af4a2a0552
bigcode/the-stack
train
0d60eca4d98d9cb4e99e0e19
train
class
@jsii.implements(IAspect) class RemoveTag(metaclass=jsii.JSIIMeta, jsii_type="@aws-cdk/core.RemoveTag"): """The RemoveTag Aspect will handle removing tags from this node and children.""" def __init__(self, key: str, *, apply_to_launched_instances: typing.Optional[bool]=None, exclude_resource_types: typing.Optio...
@jsii.implements(IAspect) class RemoveTag(metaclass=jsii.JSIIMeta, jsii_type="@aws-cdk/core.RemoveTag"):
"""The RemoveTag Aspect will handle removing tags from this node and children.""" def __init__(self, key: str, *, apply_to_launched_instances: typing.Optional[bool]=None, exclude_resource_types: typing.Optional[typing.List[str]]=None, include_resource_types: typing.Optional[typing.List[str]]=None, priority: typ...
the removal policy is not defined. default :default: - Default value is resource specific. To determine the default value for a resoure, please consult that specific resource's documentation. """ return self._values.get('default') def __eq__(self, rhs) -> bool: ...
173
173
578
31
142
chriscoombs/amazon-sagemaker-cdk-examples
dask-fargate/.env/lib/python3.6/site-packages/aws_cdk/core/__init__.py
Python
RemoveTag
RemoveTag
5,130
5,170
5,130
5,131
1cd0b703a6f06004c81357562e5a4b517a94c586
bigcode/the-stack
train
97699407c63fb69b49fec87e
train
class
class _IResolvableProxy(): """Interface for values that can be resolvable later. Tokens are special objects that participate in synthesis. """ __jsii_type__ = "@aws-cdk/core.IResolvable" @property @jsii.member(jsii_name="creationStack") def creation_stack(self) -> typing.List[str]: ...
class _IResolvableProxy():
"""Interface for values that can be resolvable later. Tokens are special objects that participate in synthesis. """ __jsii_type__ = "@aws-cdk/core.IResolvable" @property @jsii.member(jsii_name="creationStack") def creation_stack(self) -> typing.List[str]: """The creation stack of th...
Produce the Token's value at resolution time. :param context: - """ ... @jsii.member(jsii_name="toString") def to_string(self) -> str: """Return a string representation of this resolvable object. Returns a reversible string representation. """ ... class...
69
69
230
6
63
chriscoombs/amazon-sagemaker-cdk-examples
dask-fargate/.env/lib/python3.6/site-packages/aws_cdk/core/__init__.py
Python
_IResolvableProxy
_IResolvableProxy
4,147
4,176
4,147
4,147
a05201e800f614bbd13c527cf0d037132e423b01
bigcode/the-stack
train
3d87b9ce74921e837b703bd6
train
class
class Fn(metaclass=jsii.JSIIMeta, jsii_type="@aws-cdk/core.Fn"): """CloudFormation intrinsic functions. http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference.html.""" @jsii.member(jsii_name="base64") @classmethod def base64(cls, data: str) -> str: """The intr...
class Fn(metaclass=jsii.JSIIMeta, jsii_type="@aws-cdk/core.Fn"):
"""CloudFormation intrinsic functions. http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference.html.""" @jsii.member(jsii_name="base64") @classmethod def base64(cls, data: str) -> str: """The intrinsic function ``Fn::Base64`` returns the Base64 representation o...
in which this asset source resides. This can be a path to a file or a directory, dependning on the packaging type. """ return self._values.get('file_name') @property def packaging(self) -> "FileAssetPackaging": """Which type of packaging to perform.""" return s...
256
256
3,373
23
233
chriscoombs/amazon-sagemaker-cdk-examples
dask-fargate/.env/lib/python3.6/site-packages/aws_cdk/core/__init__.py
Python
Fn
Fn
2,549
2,861
2,549
2,549
2dff21e8f779cc5cddb2e41a9437eae88e734a63
bigcode/the-stack
train
cea4d8b7de946c5207ff5065
train
class
class ConstructNode(metaclass=jsii.JSIIMeta, jsii_type="@aws-cdk/core.ConstructNode"): """Represents the construct node in the scope tree.""" def __init__(self, host: "Construct", scope: "IConstruct", id: str) -> None: """ :param host: - :param scope: - :param id: - """ ...
class ConstructNode(metaclass=jsii.JSIIMeta, jsii_type="@aws-cdk/core.ConstructNode"):
"""Represents the construct node in the scope tree.""" def __init__(self, host: "Construct", scope: "IConstruct", id: str) -> None: """ :param host: - :param scope: - :param id: - """ jsii.create(ConstructNode, self, [host, scope, id]) @jsii.member(jsii_name=...
def code_deploy_lambda_alias_update(self) -> typing.Optional["CfnCodeDeployLambdaAliasUpdate"]: """To perform an AWS CodeDeploy deployment when the version changes on an AWS::Lambda::Alias resource, use the CodeDeployLambdaAliasUpdate update policy.""" return self._values.get('code_deploy_lambda_al...
256
256
2,403
25
231
chriscoombs/amazon-sagemaker-cdk-examples
dask-fargate/.env/lib/python3.6/site-packages/aws_cdk/core/__init__.py
Python
ConstructNode
ConstructNode
1,647
1,907
1,647
1,647
0bec12840690e9854a522ab7bcd6e647b20ba66e
bigcode/the-stack
train
26294d8c23947ff8ecec2eaf
train
class
@jsii.interface(jsii_type="@aws-cdk/core.INumberProducer") class INumberProducer(jsii.compat.Protocol): """Interface for lazy number producers.""" @staticmethod def __jsii_proxy_class__(): return _INumberProducerProxy @jsii.member(jsii_name="produce") def produce(self, context: "IResolveCon...
@jsii.interface(jsii_type="@aws-cdk/core.INumberProducer") class INumberProducer(jsii.compat.Protocol):
"""Interface for lazy number producers.""" @staticmethod def __jsii_proxy_class__(): return _INumberProducerProxy @jsii.member(jsii_name="produce") def produce(self, context: "IResolveContext") -> typing.Optional[jsii.Number]: """Produce the number value. :param context: - ...
IResolveContext") -> typing.Optional[typing.List[str]]: """Produce the list value. :param context: - """ return jsii.invoke(self, "produce", [context]) @jsii.interface(jsii_type="@aws-cdk/core.INumberProducer") class INumberProducer(jsii.compat.Protocol):
64
64
98
24
40
chriscoombs/amazon-sagemaker-cdk-examples
dask-fargate/.env/lib/python3.6/site-packages/aws_cdk/core/__init__.py
Python
INumberProducer
INumberProducer
4,053
4,066
4,053
4,054
a9c4e78f5732c49f59af48451c0053e2b0a17cc8
bigcode/the-stack
train
fa3148e47e39603d44207ef4
train
class
class ContextProvider(metaclass=jsii.JSIIMeta, jsii_type="@aws-cdk/core.ContextProvider"): """Base class for the model side of context providers. Instances of this class communicate with context provider plugins in the 'cdk toolkit' via context variables (input), outputting specialized queries for more...
class ContextProvider(metaclass=jsii.JSIIMeta, jsii_type="@aws-cdk/core.ContextProvider"):
"""Base class for the model side of context providers. Instances of this class communicate with context provider plugins in the 'cdk toolkit' via context variables (input), outputting specialized queries for more context variables (output). ContextProvider needs access to a Construct to hook into ...
ii.get(self, "defaultChild") @default_child.setter def default_child(self, value: typing.Optional["IConstruct"]): return jsii.set(self, "defaultChild", value) @jsii.enum(jsii_type="@aws-cdk/core.ConstructOrder") class ConstructOrder(enum.Enum): """In what order to return constructs.""" PREORD...
133
133
445
24
109
chriscoombs/amazon-sagemaker-cdk-examples
dask-fargate/.env/lib/python3.6/site-packages/aws_cdk/core/__init__.py
Python
ContextProvider
ContextProvider
1,918
1,964
1,918
1,918
e62ec4d647c742b2eed81696bb02021e25c695be
bigcode/the-stack
train
24069a651b2d0bca379242c1
train
class
@jsii.implements(ITokenResolver) class DefaultTokenResolver(metaclass=jsii.JSIIMeta, jsii_type="@aws-cdk/core.DefaultTokenResolver"): """Default resolver implementation. stability :stability: experimental """ def __init__(self, concat: "IFragmentConcatenator") -> None: """ :param co...
@jsii.implements(ITokenResolver) class DefaultTokenResolver(metaclass=jsii.JSIIMeta, jsii_type="@aws-cdk/core.DefaultTokenResolver"):
"""Default resolver implementation. stability :stability: experimental """ def __init__(self, concat: "IFragmentConcatenator") -> None: """ :param concat: - stability :stability: experimental """ jsii.create(DefaultTokenResolver, self, [concat]) ...
resolveToken") def resolve_token(self, t: "IResolvable", context: "IResolveContext", post_processor: "IPostProcessor") -> typing.Any: """Resolve a single token. :param t: - :param context: - :param post_processor: - """ return jsii.invoke(self, "resolveToken", [t, co...
116
116
388
35
81
chriscoombs/amazon-sagemaker-cdk-examples
dask-fargate/.env/lib/python3.6/site-packages/aws_cdk/core/__init__.py
Python
DefaultTokenResolver
DefaultTokenResolver
4,704
4,758
4,704
4,705
57c43701dc0e53da46c1ce778ffddd672f78ea5e
bigcode/the-stack
train
bb001d160d4ef241ee05efc7
train
class
@jsii.data_type(jsii_type="@aws-cdk/core.StackProps", jsii_struct_bases=[], name_mapping={'description': 'description', 'env': 'env', 'stack_name': 'stackName', 'tags': 'tags'}) class StackProps(): def __init__(self, *, description: typing.Optional[str]=None, env: typing.Optional["Environment"]=None, stack_name: ty...
@jsii.data_type(jsii_type="@aws-cdk/core.StackProps", jsii_struct_bases=[], name_mapping={'description': 'description', 'env': 'env', 'stack_name': 'stackName', 'tags': 'tags'}) class StackProps():
def __init__(self, *, description: typing.Optional[str]=None, env: typing.Optional["Environment"]=None, stack_name: typing.Optional[str]=None, tags: typing.Optional[typing.Mapping[str,str]]=None): """ :param description: A description of the stack. Default: - No description. :param env: The ...
stability :stability: experimental """ return jsii.get(self, "templateUrl") @property @jsii.member(jsii_name="urlSuffix") def url_suffix(self) -> str: """The Amazon domain suffix for the region in which this stack is defined.""" return jsii.get(self, "urlSuff...
189
189
631
53
136
chriscoombs/amazon-sagemaker-cdk-examples
dask-fargate/.env/lib/python3.6/site-packages/aws_cdk/core/__init__.py
Python
StackProps
StackProps
6,017
6,080
6,017
6,018
8f86115dc643be3ddd5c5851a20cc78cbd863bec
bigcode/the-stack
train
340c602f8b04c0badb01504e
train
class
@jsii.implements(IFragmentConcatenator) class StringConcat(metaclass=jsii.JSIIMeta, jsii_type="@aws-cdk/core.StringConcat"): """Converts all fragments to strings and concats those. Drops 'undefined's. """ def __init__(self) -> None: jsii.create(StringConcat, self, []) @jsii.member(jsii_nam...
@jsii.implements(IFragmentConcatenator) class StringConcat(metaclass=jsii.JSIIMeta, jsii_type="@aws-cdk/core.StringConcat"):
"""Converts all fragments to strings and concats those. Drops 'undefined's. """ def __init__(self) -> None: jsii.create(StringConcat, self, []) @jsii.member(jsii_name="join") def join(self, left: typing.Any, right: typing.Any) -> typing.Any: """Join the fragment on the left and...
: return 'StackProps(%s)' % ', '.join(k + '=' + repr(v) for k, v in self._values.items()) @jsii.implements(IFragmentConcatenator) class StringConcat(metaclass=jsii.JSIIMeta, jsii_type="@aws-cdk/core.StringConcat"):
64
64
146
34
30
chriscoombs/amazon-sagemaker-cdk-examples
dask-fargate/.env/lib/python3.6/site-packages/aws_cdk/core/__init__.py
Python
StringConcat
StringConcat
6,083
6,099
6,083
6,084
116d96c8dfeb4c34c9075eb934a0ed837086ebe9
bigcode/the-stack
train
dc8032bfdbc8e467e68ae588
train
class
@jsii.enum(jsii_type="@aws-cdk/core.FileAssetPackaging") class FileAssetPackaging(enum.Enum): """Packaging modes for file assets.""" ZIP_DIRECTORY = "ZIP_DIRECTORY" """The asset source path points to a directory, which should be archived using zip and and then uploaded to Amazon S3.""" FILE = "FILE" ...
@jsii.enum(jsii_type="@aws-cdk/core.FileAssetPackaging") class FileAssetPackaging(enum.Enum):
"""Packaging modes for file assets.""" ZIP_DIRECTORY = "ZIP_DIRECTORY" """The asset source path points to a directory, which should be archived using zip and and then uploaded to Amazon S3.""" FILE = "FILE" """The asset source path points to a single file, which should be uploaded to Amazon S3."""
self) def __repr__(self) -> str: return 'FileAssetLocation(%s)' % ', '.join(k + '=' + repr(v) for k, v in self._values.items()) @jsii.enum(jsii_type="@aws-cdk/core.FileAssetPackaging") class FileAssetPackaging(enum.Enum):
64
64
91
22
42
chriscoombs/amazon-sagemaker-cdk-examples
dask-fargate/.env/lib/python3.6/site-packages/aws_cdk/core/__init__.py
Python
FileAssetPackaging
FileAssetPackaging
2,492
2,498
2,492
2,493
d8ac69d0ff6fb6d136b0c4123f557f468a622f11
bigcode/the-stack
train
1e2d506961f11c4fe286ffcb
train
class
class _DependableTraitProxy(DependableTrait): @property @jsii.member(jsii_name="dependencyRoots") def dependency_roots(self) -> typing.List["IConstruct"]: """The set of constructs that form the root of this dependable. All resources under all returned constructs are included in the ordering...
class _DependableTraitProxy(DependableTrait): @property @jsii.member(jsii_name="dependencyRoots")
def dependency_roots(self) -> typing.List["IConstruct"]: """The set of constructs that form the root of this dependable. All resources under all returned constructs are included in the ordering dependency. stability :stability: experimental """ return jsii.g...
that form the root of this dependable. All resources under all returned constructs are included in the ordering dependency. stability :stability: experimental """ ... class _DependableTraitProxy(DependableTrait): @property @jsii.member(jsii_name="dependencyRoot...
64
64
93
26
38
chriscoombs/amazon-sagemaker-cdk-examples
dask-fargate/.env/lib/python3.6/site-packages/aws_cdk/core/__init__.py
Python
_DependableTraitProxy
_DependableTraitProxy
2,038
2,050
2,038
2,040
a8090cb8b14b309a82f55e5ac2d0858c55aad112
bigcode/the-stack
train
d80c6eff122b8e82a87909ec
train
class
@jsii.interface(jsii_type="@aws-cdk/core.ICfnConditionExpression") class ICfnConditionExpression(IResolvable, jsii.compat.Protocol): """Represents a CloudFormation element that can be used within a Condition. You can use intrinsic functions, such as ``Fn.conditionIf``, ``Fn.conditionEquals``, and ``Fn.cond...
@jsii.interface(jsii_type="@aws-cdk/core.ICfnConditionExpression") class ICfnConditionExpression(IResolvable, jsii.compat.Protocol):
"""Represents a CloudFormation element that can be used within a Condition. You can use intrinsic functions, such as ``Fn.conditionIf``, ``Fn.conditionEquals``, and ``Fn.conditionNot``, to conditionally create stack resources. These conditions are evaluated based on input parameters that you declar...
"IResolveContext") -> typing.Any: """Produce the Token's value at resolution time. :param context: - """ return jsii.invoke(self, "resolve", [context]) @jsii.member(jsii_name="toString") def to_string(self) -> str: """Return a string representation of this resolvable o...
124
125
419
29
95
chriscoombs/amazon-sagemaker-cdk-examples
dask-fargate/.env/lib/python3.6/site-packages/aws_cdk/core/__init__.py
Python
ICfnConditionExpression
ICfnConditionExpression
4,179
4,216
4,179
4,180
95a298c9794ab10b268091abf2040cc9d4093d0d
bigcode/the-stack
train
1f1376ddc6eab3a7acc2d113
train
class
@jsii.data_type(jsii_type="@aws-cdk/core.LazyAnyValueOptions", jsii_struct_bases=[], name_mapping={'display_hint': 'displayHint', 'omit_empty_array': 'omitEmptyArray'}) class LazyAnyValueOptions(): def __init__(self, *, display_hint: typing.Optional[str]=None, omit_empty_array: typing.Optional[bool]=None): ...
@jsii.data_type(jsii_type="@aws-cdk/core.LazyAnyValueOptions", jsii_struct_bases=[], name_mapping={'display_hint': 'displayHint', 'omit_empty_array': 'omitEmptyArray'}) class LazyAnyValueOptions():
def __init__(self, *, display_hint: typing.Optional[str]=None, omit_empty_array: typing.Optional[bool]=None): """Options for creating lazy untyped tokens. :param display_hint: Use the given name as a display hint. Default: - No hint :param omit_empty_array: If the produced value is an array...
""" :param producer: - :param options: - :param display_hint: Use the given name as a display hint. Default: - No hint """ options = LazyStringValueOptions(display_hint=display_hint) return jsii.sinvoke(cls, "stringValue", [producer, options]) @jsii.data_type(jsii_type=...
116
116
388
50
66
chriscoombs/amazon-sagemaker-cdk-examples
dask-fargate/.env/lib/python3.6/site-packages/aws_cdk/core/__init__.py
Python
LazyAnyValueOptions
LazyAnyValueOptions
4,909
4,947
4,909
4,910
df1953c6a3d416b6a5d06c899a36b83f92bfd6e3
bigcode/the-stack
train
040b2fcf603a9a754488a6e4
train
class
class CfnMapping(CfnRefElement, metaclass=jsii.JSIIMeta, jsii_type="@aws-cdk/core.CfnMapping"): """Represents a CloudFormation mapping.""" def __init__(self, scope: "Construct", id: str, *, mapping: typing.Optional[typing.Mapping[str,typing.Mapping[str,typing.Any]]]=None) -> None: """ :param sco...
class CfnMapping(CfnRefElement, metaclass=jsii.JSIIMeta, jsii_type="@aws-cdk/core.CfnMapping"):
"""Represents a CloudFormation mapping.""" def __init__(self, scope: "Construct", id: str, *, mapping: typing.Optional[typing.Mapping[str,typing.Mapping[str,typing.Any]]]=None) -> None: """ :param scope: - :param id: - :param props: - :param mapping: Mapping of key to a s...
CloudFormation ``{ Ref }`` for this element. If, by any chance, the intrinsic reference of a resource is not a string, you could coerce it to an IResolvable through ``Lazy.any({ produce: resource.ref })``. """ return jsii.get(self, "ref") class _CfnRefElementProxy(CfnRefElement, jsii...
117
117
390
30
86
chriscoombs/amazon-sagemaker-cdk-examples
dask-fargate/.env/lib/python3.6/site-packages/aws_cdk/core/__init__.py
Python
CfnMapping
CfnMapping
3,703
3,735
3,703
3,703
f922e89e060ab6ff7fd829ccdefb940acbcd249d
bigcode/the-stack
train
c43d74335d0fc0fac4e84c35
train
class
@jsii.data_type(jsii_type="@aws-cdk/core.ResolveOptions", jsii_struct_bases=[], name_mapping={'resolver': 'resolver', 'scope': 'scope', 'preparing': 'preparing'}) class ResolveOptions(): def __init__(self, *, resolver: "ITokenResolver", scope: "IConstruct", preparing: typing.Optional[bool]=None): """Options...
@jsii.data_type(jsii_type="@aws-cdk/core.ResolveOptions", jsii_struct_bases=[], name_mapping={'resolver': 'resolver', 'scope': 'scope', 'preparing': 'preparing'}) class ResolveOptions():
def __init__(self, *, resolver: "ITokenResolver", scope: "IConstruct", preparing: typing.Optional[bool]=None): """Options to the resolve() operation. NOT the same as the ResolveContext; ResolveContext is exposed to Token implementors and resolution hooks, whereas this struct is just to bund...
(self, "visit", [construct]) @property @jsii.member(jsii_name="key") def key(self) -> str: """The string key for the tag.""" return jsii.get(self, "key") @property @jsii.member(jsii_name="props") def _props(self) -> "TagProps": return jsii.get(self, "props") @jsii.data_...
131
131
439
47
84
chriscoombs/amazon-sagemaker-cdk-examples
dask-fargate/.env/lib/python3.6/site-packages/aws_cdk/core/__init__.py
Python
ResolveOptions
ResolveOptions
5,173
5,219
5,173
5,174
2c5fcac02b9440838312d6f2ef0289ac866151d3
bigcode/the-stack
train
6c44807fd7df6a9c98eda9d1
train
class
@jsii.implements(IResource) class Resource(Construct, metaclass=jsii.JSIIAbstractClass, jsii_type="@aws-cdk/core.Resource"): """A construct which represents an AWS resource.""" @staticmethod def __jsii_proxy_class__(): return _ResourceProxy def __init__(self, scope: "Construct", id: str, *, phy...
@jsii.implements(IResource) class Resource(Construct, metaclass=jsii.JSIIAbstractClass, jsii_type="@aws-cdk/core.Resource"):
"""A construct which represents an AWS resource.""" @staticmethod def __jsii_proxy_class__(): return _ResourceProxy def __init__(self, scope: "Construct", id: str, *, physical_name: typing.Optional[str]=None) -> None: """ :param scope: - :param id: - :param props...
not None: self._values["preparing"] = preparing @property def resolver(self) -> "ITokenResolver": """The resolver to apply to any resolvable tokens found.""" return self._values.get('resolver') @property def scope(self) -> "IConstruct": """The scope from which resolution is pe...
256
256
1,273
32
224
chriscoombs/amazon-sagemaker-cdk-examples
dask-fargate/.env/lib/python3.6/site-packages/aws_cdk/core/__init__.py
Python
Resource
Resource
5,222
5,306
5,222
5,223
51697a4078e7b6f980d7ef4f0c1dfbb4977e55fe
bigcode/the-stack
train
9370a078a723322a12434b15
train
class
@jsii.data_type(jsii_type="@aws-cdk/core.TimeConversionOptions", jsii_struct_bases=[], name_mapping={'integral': 'integral'}) class TimeConversionOptions(): def __init__(self, *, integral: typing.Optional[bool]=None): """Options for how to convert time to a different unit. :param integral: If ``tru...
@jsii.data_type(jsii_type="@aws-cdk/core.TimeConversionOptions", jsii_struct_bases=[], name_mapping={'integral': 'integral'}) class TimeConversionOptions():
def __init__(self, *, integral: typing.Optional[bool]=None): """Options for how to convert time to a different unit. :param integral: If ``true``, conversions into a larger time unit (e.g. ``Seconds`` to ``Mintues``) will fail if the result is not an integer. Default: true """ self....
class TagType(enum.Enum): STANDARD = "STANDARD" AUTOSCALING_GROUP = "AUTOSCALING_GROUP" MAP = "MAP" KEY_VALUE = "KEY_VALUE" NOT_TAGGABLE = "NOT_TAGGABLE" @jsii.data_type(jsii_type="@aws-cdk/core.TimeConversionOptions", jsii_struct_bases=[], name_mapping={'integral': 'integral'}) class TimeConversion...
89
89
299
37
52
chriscoombs/amazon-sagemaker-cdk-examples
dask-fargate/.env/lib/python3.6/site-packages/aws_cdk/core/__init__.py
Python
TimeConversionOptions
TimeConversionOptions
6,391
6,418
6,391
6,392
8f0cea91dcecf6f7e68a801bb106e022fbb3831f
bigcode/the-stack
train
ee3aef23c6156e12728c9940
train
class
class _IResolveContextProxy(): """Current resolution context for tokens.""" __jsii_type__ = "@aws-cdk/core.IResolveContext" @property @jsii.member(jsii_name="preparing") def preparing(self) -> bool: """True when we are still preparing, false if we're rendering the final output.""" re...
class _IResolveContextProxy():
"""Current resolution context for tokens.""" __jsii_type__ = "@aws-cdk/core.IResolveContext" @property @jsii.member(jsii_name="preparing") def preparing(self) -> bool: """True when we are still preparing, false if we're rendering the final output.""" return jsii.get(self, "preparing"...
"""Use this postprocessor after the entire token structure has been resolved. :param post_processor: - """ ... @jsii.member(jsii_name="resolve") def resolve(self, x: typing.Any) -> typing.Any: """Resolve an inner object. :param x: - """ ... clas...
74
74
248
7
67
chriscoombs/amazon-sagemaker-cdk-examples
dask-fargate/.env/lib/python3.6/site-packages/aws_cdk/core/__init__.py
Python
_IResolveContextProxy
_IResolveContextProxy
4,326
4,355
4,326
4,326
0a059767aad01f61405e6b45cff6beb14e4f1940
bigcode/the-stack
train
a03a405d8ba43d515946d311
train
class
class Aws(metaclass=jsii.JSIIMeta, jsii_type="@aws-cdk/core.Aws"): """Accessor for pseudo parameters. Since pseudo parameters need to be anchored to a stack somewhere in the construct tree, this class takes an scope parameter; the pseudo parameter values can be obtained as properties from an scoped obj...
class Aws(metaclass=jsii.JSIIMeta, jsii_type="@aws-cdk/core.Aws"):
"""Accessor for pseudo parameters. Since pseudo parameters need to be anchored to a stack somewhere in the construct tree, this class takes an scope parameter; the pseudo parameter values can be obtained as properties from an scoped object. """ @classproperty @jsii.member(jsii_name="ACCOUNT...
') def __eq__(self, rhs) -> bool: return isinstance(rhs, self.__class__) and rhs._values == self._values def __ne__(self, rhs) -> bool: return not (rhs == self) def __repr__(self) -> str: return 'ArnComponents(%s)' % ', '.join(k + '=' + repr(v) for k, v in self._values.items()) cl...
113
113
377
23
90
chriscoombs/amazon-sagemaker-cdk-examples
dask-fargate/.env/lib/python3.6/site-packages/aws_cdk/core/__init__.py
Python
Aws
Aws
672
717
672
672
53dcf300396fa24940b3ed12e59ba26096d0b0d3
bigcode/the-stack
train
ffcafae5077b79138682f079
train
class
@jsii.data_type(jsii_type="@aws-cdk/core.SecretsManagerSecretOptions", jsii_struct_bases=[], name_mapping={'json_field': 'jsonField', 'version_id': 'versionId', 'version_stage': 'versionStage'}) class SecretsManagerSecretOptions(): def __init__(self, *, json_field: typing.Optional[str]=None, version_id: typing.Opti...
@jsii.data_type(jsii_type="@aws-cdk/core.SecretsManagerSecretOptions", jsii_struct_bases=[], name_mapping={'json_field': 'jsonField', 'version_id': 'versionId', 'version_stage': 'versionStage'}) class SecretsManagerSecretOptions():
def __init__(self, *, json_field: typing.Optional[str]=None, version_id: typing.Optional[str]=None, version_stage: typing.Optional[str]=None): """Options for referencing a secret value from Secrets Manager. :param json_field: The key of a JSON field to retrieve. This can only be used if the secret ...
@classmethod def ssm_secure(cls, parameter_name: str, version: str) -> "SecretValue": """Use a secret value stored from a Systems Manager (SSM) parameter. :param parameter_name: The name of the parameter in the Systems Manager Parameter Store. The parameter name is case-sensitive. :param v...
183
183
612
56
127
chriscoombs/amazon-sagemaker-cdk-examples
dask-fargate/.env/lib/python3.6/site-packages/aws_cdk/core/__init__.py
Python
SecretsManagerSecretOptions
SecretsManagerSecretOptions
5,482
5,538
5,482
5,483
f251809ffbc8db1880ebfe8b7a5ae08877b98c58
bigcode/the-stack
train
309cbbb8126caa1556fbb717
train
class
@jsii.interface(jsii_type="@aws-cdk/core.IPostProcessor") class IPostProcessor(jsii.compat.Protocol): """A Token that can post-process the complete resolved value, after resolve() has recursed over it.""" @staticmethod def __jsii_proxy_class__(): return _IPostProcessorProxy @jsii.member(jsii_na...
@jsii.interface(jsii_type="@aws-cdk/core.IPostProcessor") class IPostProcessor(jsii.compat.Protocol):
"""A Token that can post-process the complete resolved value, after resolve() has recursed over it.""" @staticmethod def __jsii_proxy_class__(): return _IPostProcessorProxy @jsii.member(jsii_name="postProcess") def post_process(self, input: typing.Any, context: "IResolveContext") -> typing....
"IResolveContext") -> typing.Optional[jsii.Number]: """Produce the number value. :param context: - """ return jsii.invoke(self, "produce", [context]) @jsii.interface(jsii_type="@aws-cdk/core.IPostProcessor") class IPostProcessor(jsii.compat.Protocol):
64
64
131
24
40
chriscoombs/amazon-sagemaker-cdk-examples
dask-fargate/.env/lib/python3.6/site-packages/aws_cdk/core/__init__.py
Python
IPostProcessor
IPostProcessor
4,081
4,095
4,081
4,082
dc456f6f6dc765a31b71cef19725aa5d931cf5a6
bigcode/the-stack
train
388fe61610a763d0d1516a8b
train
class
@jsii.data_type(jsii_type="@aws-cdk/core.GetContextValueOptions", jsii_struct_bases=[GetContextKeyOptions], name_mapping={'provider': 'provider', 'props': 'props', 'dummy_value': 'dummyValue'}) class GetContextValueOptions(GetContextKeyOptions): def __init__(self, *, provider: str, props: typing.Optional[typing.Map...
@jsii.data_type(jsii_type="@aws-cdk/core.GetContextValueOptions", jsii_struct_bases=[GetContextKeyOptions], name_mapping={'provider': 'provider', 'props': 'props', 'dummy_value': 'dummyValue'}) class GetContextValueOptions(GetContextKeyOptions):
def __init__(self, *, provider: str, props: typing.Optional[typing.Mapping[str,typing.Any]]=None, dummy_value: typing.Any): """ :param provider: The context provider to query. :param props: Provider-specific properties. :param dummy_value: The value to return if the context value was...
return isinstance(rhs, self.__class__) and rhs._values == self._values def __ne__(self, rhs) -> bool: return not (rhs == self) def __repr__(self) -> str: return 'GetContextKeyResult(%s)' % ', '.join(k + '=' + repr(v) for k, v in self._values.items()) @jsii.data_type(jsii_type="@aws-cdk...
139
139
464
60
79
chriscoombs/amazon-sagemaker-cdk-examples
dask-fargate/.env/lib/python3.6/site-packages/aws_cdk/core/__init__.py
Python
GetContextValueOptions
GetContextValueOptions
2,948
3,002
2,948
2,949
d470e6539e55c10a197cea172de40f2103f58451
bigcode/the-stack
train
5acf0c207e774c4d4303cc20
train
class
class _ITemplateOptionsProxy(): """CloudFormation template options for a stack.""" __jsii_type__ = "@aws-cdk/core.ITemplateOptions" @property @jsii.member(jsii_name="description") def description(self) -> typing.Optional[str]: """Gets or sets the description of this stack. If provided, it wi...
class _ITemplateOptionsProxy():
"""CloudFormation template options for a stack.""" __jsii_type__ = "@aws-cdk/core.ITemplateOptions" @property @jsii.member(jsii_name="description") def description(self) -> typing.Optional[str]: """Gets or sets the description of this stack. If provided, it will be included in the CloudForma...
e.g. "AWS::Serverless-2016-10-31"). deprecated :deprecated: use ``transforms`` instead. stability :stability: deprecated """ ... @transform.setter def transform(self, value: typing.Optional[str]): ... @property @jsii.member(jsii_name="transform...
158
158
527
7
151
chriscoombs/amazon-sagemaker-cdk-examples
dask-fargate/.env/lib/python3.6/site-packages/aws_cdk/core/__init__.py
Python
_ITemplateOptionsProxy
_ITemplateOptionsProxy
4,537
4,595
4,537
4,537
425108aec21e094e07d6f7f8f08ceeeed013e565
bigcode/the-stack
train
ba096d5753225ee4e3aaaf34
train
class
class _IAspectProxy(): """Represents an Aspect.""" __jsii_type__ = "@aws-cdk/core.IAspect" @jsii.member(jsii_name="visit") def visit(self, node: "IConstruct") -> None: """All aspects can visit an IConstruct. :param node: - """ return jsii.invoke(self, "visit", [node])
class _IAspectProxy():
"""Represents an Aspect.""" __jsii_type__ = "@aws-cdk/core.IAspect" @jsii.member(jsii_name="visit") def visit(self, node: "IConstruct") -> None: """All aspects can visit an IConstruct. :param node: - """ return jsii.invoke(self, "visit", [node])
def __jsii_proxy_class__(): return _IAspectProxy @jsii.member(jsii_name="visit") def visit(self, node: "IConstruct") -> None: """All aspects can visit an IConstruct. :param node: - """ ... class _IAspectProxy():
64
64
82
6
58
chriscoombs/amazon-sagemaker-cdk-examples
dask-fargate/.env/lib/python3.6/site-packages/aws_cdk/core/__init__.py
Python
_IAspectProxy
_IAspectProxy
3,080
3,089
3,080
3,080
80c6f26f390eac1d2ef7981e1496996ca60b1391
bigcode/the-stack
train
61f0cb26d19351f4bd2bdbbd
train
class
class TreeInspector(metaclass=jsii.JSIIMeta, jsii_type="@aws-cdk/core.TreeInspector"): """Inspector that maintains an attribute bag.""" def __init__(self) -> None: jsii.create(TreeInspector, self, []) @jsii.member(jsii_name="addAttribute") def add_attribute(self, key: str, value: typing.Any) ->...
class TreeInspector(metaclass=jsii.JSIIMeta, jsii_type="@aws-cdk/core.TreeInspector"):
"""Inspector that maintains an attribute bag.""" def __init__(self) -> None: jsii.create(TreeInspector, self, []) @jsii.member(jsii_name="addAttribute") def add_attribute(self, key: str, value: typing.Any) -> None: """Adds attribute to bag. Keys should be added by convention to...
") @property @jsii.member(jsii_name="firstToken") def first_token(self) -> typing.Optional["IResolvable"]: return jsii.get(self, "firstToken") class TreeInspector(metaclass=jsii.JSIIMeta, jsii_type="@aws-cdk/core.TreeInspector"):
64
64
211
24
40
chriscoombs/amazon-sagemaker-cdk-examples
dask-fargate/.env/lib/python3.6/site-packages/aws_cdk/core/__init__.py
Python
TreeInspector
TreeInspector
6,637
6,658
6,637
6,637
78804d951cd5e9611241f6e866b211c3394d7f4f
bigcode/the-stack
train
aeaba3373aa3dae41b3e9c21
train
class
class vtkGIFTIReader(VTKPythonAlgorithmBase): """VTK-like GIFTI surface reader. """ def __init__(self): if not has_nibabel: raise AssertionError('vtkGIFTIReader requires nibabel.') super().__init__(nInputPorts=0, nOutputPorts=1, outputType='vtkPolyData'...
class vtkGIFTIReader(VTKPythonAlgorithmBase):
"""VTK-like GIFTI surface reader. """ def __init__(self): if not has_nibabel: raise AssertionError('vtkGIFTIReader requires nibabel.') super().__init__(nInputPorts=0, nOutputPorts=1, outputType='vtkPolyData') self.__FileName = '' self.__...
points, cells, data_array]) # else: g = nb.gifti.GiftiImage(darrays=[points, cells]) nb.save(g, opth) ############################################################################### # VTK Reader and Writer for GIFTI surfaces ############################################################################### c...
64
64
212
12
52
josemariamoreira/BrainSpace
brainspace/mesh/io_support/gifti_support.py
Python
vtkGIFTIReader
vtkGIFTIReader
65
93
65
65
eee4c643b38e2975d13507877da2c812bf1b9104
bigcode/the-stack
train
555e92c44a902d39e44962a9
train
function
@wrap_input(0) def _write_gifti(pd, opth): # TODO: what about pointdata? from nibabel.gifti.gifti import GiftiDataArray if not pd.has_only_triangle: raise ValueError('GIFTI writer only accepts triangles.') points = GiftiDataArray(data=pd.Points, intent=INTENT_POINTS) cells = GiftiDataArray...
@wrap_input(0) def _write_gifti(pd, opth): # TODO: what about pointdata?
from nibabel.gifti.gifti import GiftiDataArray if not pd.has_only_triangle: raise ValueError('GIFTI writer only accepts triangles.') points = GiftiDataArray(data=pd.Points, intent=INTENT_POINTS) cells = GiftiDataArray(data=pd.get_cells2D(), intent=INTENT_CELLS) # if data is not None: #...
INTENT_POINTS, INTENT_CELLS]: # random array names s.append_array(a1.data, name=None, at='p') return s.VTKObject @wrap_input(0) def _write_gifti(pd, opth): # TODO: what about pointdata?
64
64
181
26
37
josemariamoreira/BrainSpace
brainspace/mesh/io_support/gifti_support.py
Python
_write_gifti
_write_gifti
44
59
44
46
c3503b2f297257aea4beac1af117daf97ea7c42b
bigcode/the-stack
train
4fe38d0df47c13240fab0e09
train
class
class vtkGIFTIWriter(VTKPythonAlgorithmBase): """VTK-like GIFTI surface writer. """ def __init__(self): if not has_nibabel: raise AssertionError('vtkGIFTIWriter requires nibabel.') super().__init__(nInputPorts=1, inputType='vtkPolyData', nOutputPorts=0) self.__FileName ...
class vtkGIFTIWriter(VTKPythonAlgorithmBase):
"""VTK-like GIFTI surface writer. """ def __init__(self): if not has_nibabel: raise AssertionError('vtkGIFTIWriter requires nibabel.') super().__init__(nInputPorts=1, inputType='vtkPolyData', nOutputPorts=0) self.__FileName = '' self.__is_ascii = False def ...
def SetFileName(self, fname): if fname != self.__FileName: self.__FileName = fname self.Modified() def GetFileName(self): return self.__FileName def GetOutput(self, p_int=0): return self.GetOutputDataObject(p_int) class vtkGIFTIWriter(VTKPythonAlgorithmBase):
76
76
254
12
64
josemariamoreira/BrainSpace
brainspace/mesh/io_support/gifti_support.py
Python
vtkGIFTIWriter
vtkGIFTIWriter
96
127
96
96
b7438d27a3758708550bf327c0c9bfe100582478
bigcode/the-stack
train
0de2e630e9c1448342562ea3
train
function
def _read_gifti(ipth): g = nb.load(ipth) points = g.get_arrays_from_intent(INTENT_POINTS)[0].data cells = g.get_arrays_from_intent(INTENT_CELLS)[0].data s = build_polydata(points, cells=cells) for a1 in g.darrays: if a1.intent not in [INTENT_POINTS, INTENT_CELLS]: # random arra...
def _read_gifti(ipth):
g = nb.load(ipth) points = g.get_arrays_from_intent(INTENT_POINTS)[0].data cells = g.get_arrays_from_intent(INTENT_CELLS)[0].data s = build_polydata(points, cells=cells) for a1 in g.darrays: if a1.intent not in [INTENT_POINTS, INTENT_CELLS]: # random array names s.a...
.nifti1.intent_codes['NIFTI_INTENT_TRIANGLE'] INTENT_POINTDATA = nb.nifti1.intent_codes['NIFTI_INTENT_ESTIMATE'] has_nibabel = True except: has_nibabel = False def _read_gifti(ipth):
64
64
120
9
54
josemariamoreira/BrainSpace
brainspace/mesh/io_support/gifti_support.py
Python
_read_gifti
_read_gifti
29
41
29
29
12c6225bf8a0b286b67f31557449004b07a1891b
bigcode/the-stack
train
caab48d0d9596e4150fabcd2
train
class
class MariaDBDatabase(Database): ProgrammingError = pymysql.err.ProgrammingError TableMissingError = pymysql.err.ProgrammingError OperationalError = pymysql.err.OperationalError InternalError = pymysql.err.InternalError SQLError = pymysql.err.ProgrammingError DataError = pymysql.err.DataError REGEX_CHARACTER = '...
class MariaDBDatabase(Database):
ProgrammingError = pymysql.err.ProgrammingError TableMissingError = pymysql.err.ProgrammingError OperationalError = pymysql.err.OperationalError InternalError = pymysql.err.InternalError SQLError = pymysql.err.ProgrammingError DataError = pymysql.err.DataError REGEX_CHARACTER = 'regexp' def setup_type_map(self...
from typing import List, Tuple, Union import pymysql from pymysql.constants import ER, FIELD_TYPE from pymysql.converters import conversions, escape_string import frappe from frappe.database.database import Database from frappe.database.mariadb.schema import MariaDBTable from frappe.utils import UnicodeWithAttrs, cst...
80
256
2,653
6
73
arslangzr/frappe
frappe/database/mariadb/database.py
Python
MariaDBDatabase
MariaDBDatabase
13
310
13
13
6b4bb970db7f38f4b1cc918adff89722fc82a6ae
bigcode/the-stack
train
63d9fa09e8c37919fb151cef
train
class
class User(SQLAlchemyObjectType): class Meta: model = UserModel exclude_fields = (UserModel._password_hash.key,) groups = gph.List( "adonai.user.api.types.UserGroup", resolver=permissionable_relation_resolver(UserGroupPermissions.read, "groups"), ) permissions = gph.Lis...
class User(SQLAlchemyObjectType):
class Meta: model = UserModel exclude_fields = (UserModel._password_hash.key,) groups = gph.List( "adonai.user.api.types.UserGroup", resolver=permissionable_relation_resolver(UserGroupPermissions.read, "groups"), ) permissions = gph.List( "adonai.permission.api....
ai.user.api.types.User", resolver=permissionable_relation_resolver(UserPermissions.read, "members"), ) domain = gph.Field( "adonai.domain.api.types.Domain", resolver=permissionable_relation_resolver(DomainPermissions.read, "domain"), ) class User(SQLAlchemyObjectType):
64
64
175
7
57
Egnod/adonai
adonai/user/api/types.py
Python
User
User
35
62
35
35
81eca71973303cbaa02025826a52ab51789c2f9e
bigcode/the-stack
train
49b7bc32a1f1334d7a42af48
train
class
class UserGroup(SQLAlchemyObjectType): class Meta: model = UserGroupModel permissions = gph.List( "adonai.permission.api.types.Permission", resolver=permissionable_relation_resolver( PermissionPermissions.read, "permissions" ), ) members = gph.List( ...
class UserGroup(SQLAlchemyObjectType):
class Meta: model = UserGroupModel permissions = gph.List( "adonai.permission.api.types.Permission", resolver=permissionable_relation_resolver( PermissionPermissions.read, "permissions" ), ) members = gph.List( "adonai.user.api.types.User", r...
_relation_resolver from ...domain.permission import DomainPermissions from ...permission.permission import PermissionPermissions from ...user.permission import UserPermissions from ..models import User as UserModel from ..models import UserGroup as UserGroupModel from ..permission import UserGroupPermissions class User...
64
64
123
8
55
Egnod/adonai
adonai/user/api/types.py
Python
UserGroup
UserGroup
13
32
13
13
17d6489d1411437f5729bd766d4cb467f61dec5d
bigcode/the-stack
train
f8a432251bcfa313a24041a5
train
function
def print_data(data): step_info = '' for info in data: if 'Решение' in data.keys(): step_info += f'{info}: {round(data[info], 8) if isinstance(data[info], float) else data[info]}\n' elif 'Номер итерации' in data.keys(): value = data[info] if isinstance(value, ...
def print_data(data):
step_info = '' for info in data: if 'Решение' in data.keys(): step_info += f'{info}: {round(data[info], 8) if isinstance(data[info], float) else data[info]}\n' elif 'Номер итерации' in data.keys(): value = data[info] if isinstance(value, float): ...
для метода итераций': (0, 8), # } # ============================================================ # ВНИМАНИЕ! Пугливым ниже не смотреть! Дальше программный код! # ATTENTION! Not for timid people! Below is the program code! # ============================================================ def print_data(data):
65
65
219
5
59
Battle-Of-Two-K/NumericalMethods
tasks/task_6.py
Python
print_data
print_data
46
64
46
46
b8afa55b8bdbbaf5554a5502982fba8a005f757d
bigcode/the-stack
train
81318dd95753a97631fcd1fc
train
function
def main(): print(' Решение методом дихотомии '.center(100, '=')) decision = dichotomy(task['Функция для метода дихотоми'], task['Отрезок для метода дихотомии'], iterations=5, accuracy_order=3, level_of_details=2) for step in decision: print_data(step) print(' Решение м...
def main():
print(' Решение методом дихотомии '.center(100, '=')) decision = dichotomy(task['Функция для метода дихотоми'], task['Отрезок для метода дихотомии'], iterations=5, accuracy_order=3, level_of_details=2) for step in decision: print_data(step) print(' Решение методом хорд ...
' else: step_info += f'{info}:\n{round(data[info], 8) if isinstance(data[info], float) else data[info]}\n' if 'Решение' in data.keys(): print('\n') elif 'Номер итерации' in data.keys(): print(('-' * 23 + '+') * len(data.keys())) print(step_info) def main():
92
92
309
3
89
Battle-Of-Two-K/NumericalMethods
tasks/task_6.py
Python
main
main
67
93
67
67
2c7edef8df43d18ab425a8650349e37d3b611f12
bigcode/the-stack
train
caa0b49bdec625d04fce7247
train
class
class LXMLOutputChecker(OutputChecker): empty_tags = ( 'param', 'img', 'area', 'br', 'basefont', 'input', 'base', 'meta', 'link', 'col') def get_default_parser(self): return etree.XML def check_output(self, want, got, optionflags): alt_self = getattr(self, '_temp_override_...
class LXMLOutputChecker(OutputChecker):
empty_tags = ( 'param', 'img', 'area', 'br', 'basefont', 'input', 'base', 'meta', 'link', 'col') def get_default_parser(self): return etree.XML def check_output(self, want, got, optionflags): alt_self = getattr(self, '_temp_override_self', None) if alt_self is not N...
SE_XML', 'NOPARSE_MARKUP', 'LXMLOutputChecker', 'LHTMLOutputChecker', 'install', 'temp_install'] try: _basestring = basestring except NameError: _basestring = (str, bytes) _IS_PYTHON_3 = sys.version_info[0] >= 3 PARSE_HTML = doctest.register_optionflag('PARSE_HTML') PARSE_XML = doctest.register_op...
256
256
2,333
10
246
2502302255/al789
lxml/doctestcompare.py
Python
LXMLOutputChecker
LXMLOutputChecker
78
365
78
79
9d9afd89814f87d15ba62b68f65a6d9639a91805
bigcode/the-stack
train
613d400b72ae4fd58ef6b56a
train
class
class _RestoreChecker(object): def __init__(self, dt_self, old_checker, new_checker, check_func, clone_func, del_module): self.dt_self = dt_self self.checker = old_checker self.checker._temp_call_super_check_output = self.call_super self.checker._temp_override_self =...
class _RestoreChecker(object):
def __init__(self, dt_self, old_checker, new_checker, check_func, clone_func, del_module): self.dt_self = dt_self self.checker = old_checker self.checker._temp_call_super_check_output = self.call_super self.checker._temp_override_self = new_checker self.check...
method, at which point we restore the previous check_output # implementation. if _IS_PYTHON_3: check_func = frame.f_locals['check'].__func__ checker_check_func = checker.check_output.__func__ else: check_func = frame.f_locals['check'].im_func checker_check_func = checker.che...
143
143
478
6
137
2502302255/al789
lxml/doctestcompare.py
Python
_RestoreChecker
_RestoreChecker
422
474
422
422
bcd99c5e9ef3b1e414fcfa7a46b873bab6c782e4
bigcode/the-stack
train
ebcff9b49569baa145313834
train
function
def install(html=False): """ Install doctestcompare for all future doctests. If html is true, then by default the HTML parser will be used; otherwise the XML parser is used. """ if html: doctest.OutputChecker = LHTMLOutputChecker else: doctest.OutputChecker = LXMLOutputCheck...
def install(html=False):
""" Install doctestcompare for all future doctests. If html is true, then by default the HTML parser will be used; otherwise the XML parser is used. """ if html: doctest.OutputChecker = LHTMLOutputChecker else: doctest.OutputChecker = LXMLOutputChecker
(got, strip) text = '%s (got: %s)' % (want, got) return self.format_text(text, strip) class LHTMLOutputChecker(LXMLOutputChecker): def get_default_parser(self): return html_fromstring def install(html=False):
64
64
78
5
58
2502302255/al789
lxml/doctestcompare.py
Python
install
install
371
381
371
371
a572e634cd9405f70e8da28360ff8bd822d9a29f
bigcode/the-stack
train
88883c59ab5c74b93a5c2cff
train
function
def norm_whitespace(v): return _norm_whitespace_re.sub(' ', v)
def norm_whitespace(v):
return _norm_whitespace_re.sub(' ', v)
_XML = doctest.register_optionflag('PARSE_XML') NOPARSE_MARKUP = doctest.register_optionflag('NOPARSE_MARKUP') OutputChecker = doctest.OutputChecker def strip(v): if v is None: return None else: return v.strip() def norm_whitespace(v):
64
64
18
6
58
2502302255/al789
lxml/doctestcompare.py
Python
norm_whitespace
norm_whitespace
66
67
66
66
aa0e599ee118ad53f8a63c180962c3253145b750
bigcode/the-stack
train
089e5436659df8f763ffec6a
train
class
class LHTMLOutputChecker(LXMLOutputChecker): def get_default_parser(self): return html_fromstring
class LHTMLOutputChecker(LXMLOutputChecker):
def get_default_parser(self): return html_fromstring
, got, strip): if not got: return '' return self.format_text(got, strip) text = '%s (got: %s)' % (want, got) return self.format_text(text, strip) class LHTMLOutputChecker(LXMLOutputChecker):
64
64
28
15
49
2502302255/al789
lxml/doctestcompare.py
Python
LHTMLOutputChecker
LHTMLOutputChecker
367
369
367
367
25f039f796e74ac59413b7d7b1210c3174fdd7a9
bigcode/the-stack
train
1c06baad98e54adc64059fc1
train
function
def _find_doctest_frame(): import sys frame = sys._getframe(1) while frame: l = frame.f_locals if 'BOOM' in l: # Sign of doctest return frame frame = frame.f_back raise LookupError( "Could not find doctest (only use this function *inside* a doctest...
def _find_doctest_frame():
import sys frame = sys._getframe(1) while frame: l = frame.f_locals if 'BOOM' in l: # Sign of doctest return frame frame = frame.f_back raise LookupError( "Could not find doctest (only use this function *inside* a doctest)")
args, **kw) self.uninstall_module() return result def call_super(self, *args, **kw): self.uninstall_clone() try: return self.check_func(*args, **kw) finally: self.install_clone() def _find_doctest_frame():
63
64
85
8
55
2502302255/al789
lxml/doctestcompare.py
Python
_find_doctest_frame
_find_doctest_frame
476
486
476
476
999a5b260de25b880ec30be58b4a4f00671a9bb9
bigcode/the-stack
train
172c0b2f095cbad1457cc033
train
function
def temp_install(html=False, del_module=None): """ Use this *inside* a doctest to enable this checker for this doctest only. If html is true, then by default the HTML parser will be used; otherwise the XML parser is used. """ if html: Checker = LHTMLOutputChecker else: C...
def temp_install(html=False, del_module=None):
""" Use this *inside* a doctest to enable this checker for this doctest only. If html is true, then by default the HTML parser will be used; otherwise the XML parser is used. """ if html: Checker = LHTMLOutputChecker else: Checker = LXMLOutputChecker frame = _find_do...
class LHTMLOutputChecker(LXMLOutputChecker): def get_default_parser(self): return html_fromstring def install(html=False): """ Install doctestcompare for all future doctests. If html is true, then by default the HTML parser will be used; otherwise the XML parser is used. """ if...
116
116
389
10
105
2502302255/al789
lxml/doctestcompare.py
Python
temp_install
temp_install
383
420
383
383
c16181c08c264ac251572b6bbf2327ee57e906b6
bigcode/the-stack
train
cbdd507df097b796c0f8d9c8
train
function
def strip(v): if v is None: return None else: return v.strip()
def strip(v):
if v is None: return None else: return v.strip()
_info[0] >= 3 PARSE_HTML = doctest.register_optionflag('PARSE_HTML') PARSE_XML = doctest.register_optionflag('PARSE_XML') NOPARSE_MARKUP = doctest.register_optionflag('NOPARSE_MARKUP') OutputChecker = doctest.OutputChecker def strip(v):
64
64
22
4
59
2502302255/al789
lxml/doctestcompare.py
Python
strip
strip
60
64
60
60
690d7d42402b5e8d0ecb29d40ad4e51399a6d4a0
bigcode/the-stack
train
dbcd905980195c216ff812dd
train
function
def html_fromstring(html): return etree.fromstring(html, _html_parser)
def html_fromstring(html):
return etree.fromstring(html, _html_parser)
.OutputChecker def strip(v): if v is None: return None else: return v.strip() def norm_whitespace(v): return _norm_whitespace_re.sub(' ', v) _html_parser = etree.HTMLParser(recover=False, remove_blank_text=True) def html_fromstring(html):
64
64
17
6
58
2502302255/al789
lxml/doctestcompare.py
Python
html_fromstring
html_fromstring
71
72
71
71
6c563c1ebbf92ed0cf50190a24220a2f8f57d1a1
bigcode/the-stack
train
c1327c61494106649a9670ce
train
class
class Config: """Getting the path for static file.""" STATIC_FOLDER = f"{os.getenv('APP_FOLDER')}/project/static"
class Config:
"""Getting the path for static file.""" STATIC_FOLDER = f"{os.getenv('APP_FOLDER')}/project/static"
"""Configuration module.""" import os basedir = os.path.abspath(os.path.dirname(__file__)) class Config:
22
64
28
3
19
fossabot/dash-boilerplate
lib/web/project/config.py
Python
Config
Config
7
10
7
7
dd692146b6b34affc7f37433a20c104f52b17b9a
bigcode/the-stack
train
b25ff7c42ccb75706066d792
train
class
class Migration(migrations.Migration): dependencies = [ ('home', '0008_directingnewsinfo'), ] operations = [ migrations.AddField( model_name='patientinfo', name='id_popup', field=models.IntegerField(default=0), ), ]
class Migration(migrations.Migration):
dependencies = [ ('home', '0008_directingnewsinfo'), ] operations = [ migrations.AddField( model_name='patientinfo', name='id_popup', field=models.IntegerField(default=0), ), ]
# Generated by Django 3.0.10 on 2020-12-01 03:48 from django.db import migrations, models class Migration(migrations.Migration):
38
64
60
7
30
onghbaophuoc118/Capstone2_Final
capstone2/home/migrations/0009_patientinfo_id_popup.py
Python
Migration
Migration
6
18
6
7
727b9171499737780a5ea6a2007c3a3599d264e3
bigcode/the-stack
train
f4ca108c28fc6433ea387f2f
train
function
def to_str(bytes_or_str): '''Converts files into UTF-8''' if isinstance(bytes_or_str, bytes): value = bytes_or_str.decode('utf-8') else: value = bytes_or_str return value
def to_str(bytes_or_str):
'''Converts files into UTF-8''' if isinstance(bytes_or_str, bytes): value = bytes_or_str.decode('utf-8') else: value = bytes_or_str return value
adapted from Python 2 code found in this blog post: https://coolpythoncodes.com/flesch-index-python-script/ and repo https://github.com/Classicdude1/ReaderAbilityChecker ''' import os FILELOCATION = r"c:\path\file.md" def to_str(bytes_or_str):
64
64
52
7
57
mattbriggs/measurewords
modules/ReadingLevel.py
Python
to_str
to_str
18
24
18
18
1f7ae6caabc7870cc9cfeabf92170f3c3c66b49b
bigcode/the-stack
train
5dadc23bc3762b760e7f78bf
train
function
def get_textfromfile(path): '''Return text from a filename path''' textout = "" fh = open(path, "r", encoding="utf8") for line in fh: textout += line fh.close() textout = to_str(textout) return textout
def get_textfromfile(path):
'''Return text from a filename path''' textout = "" fh = open(path, "r", encoding="utf8") for line in fh: textout += line fh.close() textout = to_str(textout) return textout
path\file.md" def to_str(bytes_or_str): '''Converts files into UTF-8''' if isinstance(bytes_or_str, bytes): value = bytes_or_str.decode('utf-8') else: value = bytes_or_str return value def get_textfromfile(path):
64
64
65
7
56
mattbriggs/measurewords
modules/ReadingLevel.py
Python
get_textfromfile
get_textfromfile
27
35
27
27
394b5d9f20dd76a274f00f4e31e67ea51fd35a72
bigcode/the-stack
train
c7283de855f633ad53456dce
train
function
def main(): '''This is the logic of the application.''' text=get_textfromfile(FILELOCATION) sentence=text.count(".") + text.count('!') + text.count(";") + text.count(":") + text.count("?") words=len(text.split()) syllable=0 for word in text.split(): for vowel in ['a','e','i','o','u']...
def main():
'''This is the logic of the application.''' text=get_textfromfile(FILELOCATION) sentence=text.count(".") + text.count('!') + text.count(";") + text.count(":") + text.count("?") words=len(text.split()) syllable=0 for word in text.split(): for vowel in ['a','e','i','o','u']: ...
= bytes_or_str return value def get_textfromfile(path): '''Return text from a filename path''' textout = "" fh = open(path, "r", encoding="utf8") for line in fh: textout += line fh.close() textout = to_str(textout) return textout def main():
77
77
259
3
73
mattbriggs/measurewords
modules/ReadingLevel.py
Python
main
main
38
66
38
38
148e35bb537152eeda282e6265c7dbd8856d3e59
bigcode/the-stack
train
4bb7788fb02b62c0669b9913
train
class
class Materials(cv.CheckedList): """Collection of Materials used for an OpenMC simulation. This class corresponds directly to the materials.xml input file. It can be thought of as a normal Python list where each member is a :class:`Material`. It behaves like a list as the following example demonstr...
class Materials(cv.CheckedList):
"""Collection of Materials used for an OpenMC simulation. This class corresponds directly to the materials.xml input file. It can be thought of as a normal Python list where each member is a :class:`Material`. It behaves like a list as the following example demonstrates: >>> fuel = openmc.Mate...
.depletable = bool(elem.get('depletable')) # Get each nuclide for nuclide in elem.findall('nuclide'): name = nuclide.attrib['name'] if 'ao' in nuclide.attrib: mat.add_nuclide(name, float(nuclide.attrib['ao'])) elif 'wo' in nuclide.attrib: ...
256
256
975
6
249
shimwell/openmc-1
openmc/material.py
Python
Materials
Materials
1,145
1,295
1,145
1,145
50393f95b03591055037d150f7a85fa05e61b923
bigcode/the-stack
train
f9426ab3ab6da90ebd2ef2be
train
class
class Material(IDManagerMixin): """A material composed of a collection of nuclides/elements. To create a material, one should create an instance of this class, add nuclides or elements with :meth:`Material.add_nuclide` or :meth:`Material.add_element`, respectively, and set the total material densit...
class Material(IDManagerMixin):
"""A material composed of a collection of nuclides/elements. To create a material, one should create an instance of this class, add nuclides or elements with :meth:`Material.add_nuclide` or :meth:`Material.add_element`, respectively, and set the total material density with :meth:`Material.set_densi...
from collections import OrderedDict, defaultdict, namedtuple, Counter from collections.abc import Iterable from copy import deepcopy from numbers import Real from pathlib import Path import re import warnings from xml.etree import ElementTree as ET import numpy as np import openmc import openmc.data import openmc.che...
171
256
9,216
6
165
shimwell/openmc-1
openmc/material.py
Python
Material
Material
27
1,142
27
27
d234732ed2d78dfc6064c2ebbcb7a7a31aafdeef
bigcode/the-stack
train
6c06df9853f9daedae394a41
train
class
class Migration(migrations.Migration): dependencies = [ ('pertanyaan', '0001_initial'), ] operations = [ migrations.AddField( model_name='question', name='detail', field=models.TextField(blank=True, max_length=400, null=True), ), ]
class Migration(migrations.Migration):
dependencies = [ ('pertanyaan', '0001_initial'), ] operations = [ migrations.AddField( model_name='question', name='detail', field=models.TextField(blank=True, max_length=400, null=True), ), ]
# Generated by Django 3.1.2 on 2020-11-13 02:33 from django.db import migrations, models class Migration(migrations.Migration):
38
64
63
7
30
rafimuhammad01/donasi-covid-19-2
pertanyaan/migrations/0002_question_detail.py
Python
Migration
Migration
6
18
6
7
3530b60d3cddd2d38b6996236850886b003e0167
bigcode/the-stack
train
c4af4d2616ed73f6ac13009a
train
class
class TestNotInRetryPeriodDep(unittest.TestCase): def _get_task_instance(self, state, end_date=None, retry_delay=timedelta(minutes=15)): task = Mock(retry_delay=retry_delay, retry_exponential_backoff=False) ti = TaskInstance(task=task, state=state, execution_date=None) ...
class TestNotInRetryPeriodDep(unittest.TestCase):
def _get_task_instance(self, state, end_date=None, retry_delay=timedelta(minutes=15)): task = Mock(retry_delay=retry_delay, retry_exponential_backoff=False) ti = TaskInstance(task=task, state=state, execution_date=None) ti.end_date = end_date return ti ...
# KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. import unittest from datetime import timedelta from unittest.mock import Mock from freezegun import freeze_time from airflow.models import TaskInstance from airflow.ti_deps.deps...
104
104
349
11
92
suensummit/airflow
tests/ti_deps/deps/test_not_in_retry_period_dep.py
Python
TestNotInRetryPeriodDep
TestNotInRetryPeriodDep
32
66
32
33
6087415ac0281cc6cc7de1409db87b4a63f3cd0a
bigcode/the-stack
train
7ce4829c5863fb0a63f06bd4
train
class
class QAUserhander(QABaseHandler): def get(self): self.write({'status': 200, 'result':{'user_cookie': 'xx'}})
class QAUserhander(QABaseHandler):
def get(self): self.write({'status': 200, 'result':{'user_cookie': 'xx'}})
aseHandler): def get(self): self.write( { 'status': 200, 'message': 'This is a welcome page for quantaxis backend', 'url': [item[0] for item in handlers] } ) class QAUserhander(QABaseHandler):
64
64
35
10
54
forrestzhang/QUANTAXIS
QUANTAXIS/QAWebServer/server.py
Python
QAUserhander
QAUserhander
56
58
56
56
0208e01a48ec0df8062fb4f5ac62ce2b44dff09d
bigcode/the-stack
train
1135f4e88c9309899259fb49
train
function
def start_server(handlers, address='0.0.0.0', port=8010): apps = Application( handlers=handlers, debug=True, autoreload=True, compress_response=True ) print('========WELCOME QUANTAXIS_WEBSERVER 2.0 ============') print('QUANTAXIS VERSION: {}'.format(__version__)) ...
def start_server(handlers, address='0.0.0.0', port=8010):
apps = Application( handlers=handlers, debug=True, autoreload=True, compress_response=True ) print('========WELCOME QUANTAXIS_WEBSERVER 2.0 ============') print('QUANTAXIS VERSION: {}'.format(__version__)) print('QUANTAXIS WEBSERVER is Listening on: http://{}:{}'...
multiple=True, help="控制台输出内容") parse_command_line() port = options.port address = options.address scheduler = init_scheduler() start_server(handlers, address, port) def start_server(handlers, address='0.0.0.0', port=8010):
64
64
155
21
43
forrestzhang/QUANTAXIS
QUANTAXIS/QAWebServer/server.py
Python
start_server
start_server
95
109
95
95
5134c542eb6bc94fdb011f083f15cae9d5ed1953
bigcode/the-stack
train
3d76851f615bbf9bef27d49c
train
class
class INDEX(QABaseHandler): def get(self): self.write( { 'status': 200, 'message': 'This is a welcome page for quantaxis backend', 'url': [item[0] for item in handlers] } )
class INDEX(QABaseHandler):
def get(self): self.write( { 'status': 200, 'message': 'This is a welcome page for quantaxis backend', 'url': [item[0] for item in handlers] } )
.QAWebServer.qifiserver import QAQIFI_Handler, QAQIFIS_Handler, QAQIFIS_REALTIME_Handler from tornado.options import (define, options, parse_command_line, parse_config_file) from tornado.web import Application, RequestHandler, authenticated class INDEX(QABaseHandler):
64
64
58
7
56
forrestzhang/QUANTAXIS
QUANTAXIS/QAWebServer/server.py
Python
INDEX
INDEX
44
53
44
45
12ee3fff1f1e10d1398e3724af127d2b1480622b
bigcode/the-stack
train
5e05a4a4d930890f361488ce
train
function
def main(): asyncio.set_event_loop(asyncio.new_event_loop()) define("port", default=8010, type=int, help="服务器监听端口号") define("address", default='0.0.0.0', type=str, help='服务器地址') define("content", default=[], type=str, multiple=True, help="控制台输出内容") parse_command_line() port = options.port ...
def main():
asyncio.set_event_loop(asyncio.new_event_loop()) define("port", default=8010, type=int, help="服务器监听端口号") define("address", default='0.0.0.0', type=str, help='服务器地址') define("content", default=[], type=str, multiple=True, help="控制台输出内容") parse_command_line() port = options.port address = op...
", QAScheduleQuery), (r"/qifi", QAQIFI_Handler), (r"/qifis", QAQIFIS_Handler), (r"/qifirealtime", QAQIFIS_REALTIME_Handler), (r"/user", QAUserhander) ] def main():
64
64
111
3
61
forrestzhang/QUANTAXIS
QUANTAXIS/QAWebServer/server.py
Python
main
main
80
92
80
80
55ddbaa332a0d9a25cdaab1e300cc2b6a1566f81
bigcode/the-stack
train
07c00c8ec2894fed8cfe5705
train
class
class MultiDoomSimulator: def __init__(self, all_args): print('|| Creating MultiDoomSimulator object') self.num_simulators = len(all_args) self.simulators = [] for args in all_args: self.simulators.append(DoomSimulator(args)) self.resolution = self.simulators[0].resolution self.num_channels = ...
class MultiDoomSimulator:
def __init__(self, all_args): print('|| Creating MultiDoomSimulator object') self.num_simulators = len(all_args) self.simulators = [] for args in all_args: self.simulators.append(DoomSimulator(args)) self.resolution = self.simulators[0].resolution self.num_channels = self.simulators[0].num_chann...
''' Several doom simulators running otgether ''' from __future__ import print_function from .doom_simulator import DoomSimulator class MultiDoomSimulator:
35
133
444
7
27
LouisDumont/LearningToAct
DFP/multi_doom_simulator.py
Python
MultiDoomSimulator
MultiDoomSimulator
7
62
7
8
41899eed10a6315a5969b0aaef6f8facc1426193
bigcode/the-stack
train
204b4b905eeed48805f2e307
train
function
def main(filename): warning = [] plays = {} for i in range(0, 16): plays[str(i)] = [] # print(plays) f_eve = open(filename + '.eve', 'r') for line in f_eve: if 'PLAY' in line: line_s = line.split(',') plays[line_s[2].strip()].append(line_s[0].strip()) ...
def main(filename):
warning = [] plays = {} for i in range(0, 16): plays[str(i)] = [] # print(plays) f_eve = open(filename + '.eve', 'r') for line in f_eve: if 'PLAY' in line: line_s = line.split(',') plays[line_s[2].strip()].append(line_s[0].strip()) # print(plays) f...
import sys __author__ = 'Epix' min_gap = 300 mark = 'X' def main(filename):
26
73
244
4
22
exzhawk/bms2eve
eve_check.py
Python
main
main
9
34
9
9
edb3644ecc5381ad3cc52393d2983d8616d90bdd
bigcode/the-stack
train
ec790dbb5de5e5c9ea1f5ca8
train
class
class RunType(): ''' 运行类型 ''' REMOTE="REMOTE" #远程服务器启动 BROWSER="BROWSER"#本地浏览器启动
class RunType():
''' 运行类型 ''' REMOTE="REMOTE" #远程服务器启动 BROWSER="BROWSER"#本地浏览器启动
"Remote" IE="Internet Explorer" CHROME="Google Chrome" FIREFOX="Mozilla Firefox" class RunResult(): ''' 运行结果 ''' PASS="PASS" ERROR="ERROR" FAIL="FAIL" TRUE="TRUE" FALSE="FALSE" class RunType():
64
64
34
4
60
yaolihui129/laravel50
storage/app/easyTest/SRC/common/const.py
Python
RunType
RunType
22
27
22
22
b89e4ee286d8aeb116d3c953cd6172ea36d7fefa
bigcode/the-stack
train
9ca77be9e9cee55d3484d335
train
class
class RunResult(): ''' 运行结果 ''' PASS="PASS" ERROR="ERROR" FAIL="FAIL" TRUE="TRUE" FALSE="FALSE"
class RunResult():
''' 运行结果 ''' PASS="PASS" ERROR="ERROR" FAIL="FAIL" TRUE="TRUE" FALSE="FALSE"
# coding=utf-8 class Agent(): ''' 浏览器类型 ''' REMOTE = "Remote" IE="Internet Explorer" CHROME="Google Chrome" FIREFOX="Mozilla Firefox" class RunResult():
48
64
37
4
44
yaolihui129/laravel50
storage/app/easyTest/SRC/common/const.py
Python
RunResult
RunResult
12
20
12
12
29a5c3862545677d2affdc5adb4b77a890f914b9
bigcode/the-stack
train
b1cd4bc66f6d8edef31c9b30
train
class
class Agent(): ''' 浏览器类型 ''' REMOTE = "Remote" IE="Internet Explorer" CHROME="Google Chrome" FIREFOX="Mozilla Firefox"
class Agent():
''' 浏览器类型 ''' REMOTE = "Remote" IE="Internet Explorer" CHROME="Google Chrome" FIREFOX="Mozilla Firefox"
# coding=utf-8 class Agent():
9
64
38
3
5
yaolihui129/laravel50
storage/app/easyTest/SRC/common/const.py
Python
Agent
Agent
3
10
3
3
3efadcf149649afdc6caf407ebf1d63c1d896344
bigcode/the-stack
train
5100fa56f103d1c6a9517a21
train
function
def home_keyevent(): keyevent("HOME")
def home_keyevent():
keyevent("HOME")
Huibo @Date :2019/10/22 11:26 @Desc : ==================================================''' from airtest.core.api import * def back_keyevent(): """ 按【返回键】 :return: """ keyevent('BACK') def home_keyevent():
64
64
11
5
59
Valuebai/awesome-python-io
auto_haowool/airtest_haowool/utils/airtest_utils.py
Python
home_keyevent
home_keyevent
21
22
21
21
67db3863dc26358c855738d834aa55f86465e404
bigcode/the-stack
train
1bacf6a9628567004ccb5b8d
train
function
def perform_view_text_click(poco, text): """ :param poco: :param text: :return: """ # 注意:按钮可能不能点击 poco(text=text).wait_for_appearance() poco(text=text).click()
def perform_view_text_click(poco, text):
""" :param poco: :param text: :return: """ # 注意:按钮可能不能点击 poco(text=text).wait_for_appearance() poco(text=text).click()
id, *timeout): """ 模拟点击某个页面view :param poco: :param id: :return: """ if timeout: poco(id).wait(timeout).click() else: poco(id).click() def perform_view_text_click(poco, text):
64
64
54
10
54
Valuebai/awesome-python-io
auto_haowool/airtest_haowool/utils/airtest_utils.py
Python
perform_view_text_click
perform_view_text_click
38
46
38
38
7add95bc09c1c2ccf1f8574a13c60b08d956cd86
bigcode/the-stack
train
92219f33740628b09b2fcd9e
train
function
def perform_view_input(poco, id, text): """ 模拟输入内容到输入框 :param poco: :param id: :param text: :return: """ poco(id).wait_for_appearance() poco(id).set_text(text)
def perform_view_input(poco, id, text):
""" 模拟输入内容到输入框 :param poco: :param id: :param text: :return: """ poco(id).wait_for_appearance() poco(id).set_text(text)
perform_view_text_click(poco, text): """ :param poco: :param text: :return: """ # 注意:按钮可能不能点击 poco(text=text).wait_for_appearance() poco(text=text).click() def perform_view_input(poco, id, text):
64
64
60
11
53
Valuebai/awesome-python-io
auto_haowool/airtest_haowool/utils/airtest_utils.py
Python
perform_view_input
perform_view_input
49
59
49
49
8203352eff69c59ded3a7332550a1cdee9594df1
bigcode/the-stack
train
339faa770a5bef19301d809a
train
function
def perform_view_id_click(poco, id, *timeout): """ 模拟点击某个页面view :param poco: :param id: :return: """ if timeout: poco(id).wait(timeout).click() else: poco(id).click()
def perform_view_id_click(poco, id, *timeout):
""" 模拟点击某个页面view :param poco: :param id: :return: """ if timeout: poco(id).wait(timeout).click() else: poco(id).click()
Desc : ==================================================''' from airtest.core.api import * def back_keyevent(): """ 按【返回键】 :return: """ keyevent('BACK') def home_keyevent(): keyevent("HOME") def perform_view_id_click(poco, id, *timeout):
64
64
62
13
51
Valuebai/awesome-python-io
auto_haowool/airtest_haowool/utils/airtest_utils.py
Python
perform_view_id_click
perform_view_id_click
25
35
25
25
6a375bf94be8b8249ab4347a3229d631d5cff713
bigcode/the-stack
train
ae739583d913b0c49ad81b6a
train
function
def back_keyevent(): """ 按【返回键】 :return: """ keyevent('BACK')
def back_keyevent():
""" 按【返回键】 :return: """ keyevent('BACK')
/bin/env python # -*- coding: UTF-8 -*- '''================================================= @IDE :PyCharm @Author :LuckyHuibo @Date :2019/10/22 11:26 @Desc : ==================================================''' from airtest.core.api import * def back_keyevent():
64
64
26
5
59
Valuebai/awesome-python-io
auto_haowool/airtest_haowool/utils/airtest_utils.py
Python
back_keyevent
back_keyevent
13
18
13
13
81ec56922c52318fa0c1a9481fd4b3e2bf8b3abe
bigcode/the-stack
train
7c217f88b21c76d2b29d2834
train
class
class TestKernels: """ Test class for the built-in convolution kernels. """ @pytest.mark.skipif('not HAS_SCIPY') @pytest.mark.parametrize(('width'), WIDTHS_ODD) def test_scipy_filter_gaussian(self, width): """ Test GaussianKernel against SciPy ndimage gaussian filter. ""...
class TestKernels:
""" Test class for the built-in convolution kernels. """ @pytest.mark.skipif('not HAS_SCIPY') @pytest.mark.parametrize(('width'), WIDTHS_ODD) def test_scipy_filter_gaussian(self, width): """ Test GaussianKernel against SciPy ndimage gaussian filter. """ gauss_ker...
HAS_SCIPY = True except ImportError: HAS_SCIPY = False WIDTHS_ODD = [3, 5, 7, 9] WIDTHS_EVEN = [2, 4, 8, 16] MODES = ['center', 'linear_interp', 'oversample', 'integrate'] KERNEL_TYPES = [Gaussian1DKernel, Gaussian2DKernel, Box1DKernel, Box2DKernel, Trapezoid1DKernel, TrapezoidDisk...
256
256
4,999
5
251
b1quint/astropy
astropy/convolution/tests/test_kernel_class.py
Python
TestKernels
TestKernels
50
553
50
50
4d98c788c7bcd6a8f72df7c2b68ca8e915fbdc47
bigcode/the-stack
train
9137be558547b4e13c36f53a
train
class
class Config: def __init__(self): self.verbose = True self.network = 'vgg' # setting for data augmentation self.use_horizontal_flips = False self.use_vertical_flips = False self.rot_90 = False # anchor box scales self.anchor_box_scales = [32] # anchor box ratios self.anchor_box_ratios = [[1, ...
class Config:
def __init__(self): self.verbose = True self.network = 'vgg' # setting for data augmentation self.use_horizontal_flips = False self.use_vertical_flips = False self.rot_90 = False # anchor box scales self.anchor_box_scales = [32] # anchor box ratios self.anchor_box_ratios = [[1, 1]] # size t...
from keras import backend as K class Config:
10
137
457
3
6
yipsang/keras-frcnn
keras_frcnn/config.py
Python
Config
Config
4
58
4
5
2d9db518737f0b9cfcc2aa7f55244f2fa1465bb2
bigcode/the-stack
train
3832596ab80f55c600fea770
train
class
class CantControlServiceError(Exception): """Represents an error caused because a service cannot be controlled""" pass
class CantControlServiceError(Exception):
"""Represents an error caused because a service cannot be controlled""" pass
a service is unresponsive""" pass class ServiceNotStartedError(Exception): """Represents an error caused because a service is not started""" pass class ServiceAlreadyRunningError(Exception): """Represents an error caused because a service is already running""" pass class CantControlS...
64
64
24
7
56
BartekSzpak/adversary
app/commands/errors.py
Python
CantControlServiceError
CantControlServiceError
61
63
61
61
80a2e34ffe0a1cf1e601be06a08cb7238911b964
bigcode/the-stack
train
1f5bc0045ba3a23cfc5673d4
train
class
class IncorrectParameterError(Exception): """Represents an error caused because a parameter was incorrect""" pass
class IncorrectParameterError(Exception):
"""Represents an error caused because a parameter was incorrect""" pass
because a service does not exist""" pass class NoProcessError(Exception): """Represents an error caused because a process does not exist""" pass class FileInUseError(Exception): """Represents an error caused because a file is currently in use""" pass class IncorrectParameterError(Exc...
64
64
22
6
57
BartekSzpak/adversary
app/commands/errors.py
Python
IncorrectParameterError
IncorrectParameterError
41
43
41
41
15e8b9942b4b947286472dbd50d1fb2fb53231dd
bigcode/the-stack
train
f20fb2eb50516093c39d9dfb
train
class
class FileInUseError(Exception): """Represents an error caused because a file is currently in use""" pass
class FileInUseError(Exception):
"""Represents an error caused because a file is currently in use""" pass
caused because a registry key was missing""" pass class NoServiceError(Exception): """Represents an error caused because a service does not exist""" pass class NoProcessError(Exception): """Represents an error caused because a process does not exist""" pass class FileInUseError(Excep...
64
64
25
7
56
BartekSzpak/adversary
app/commands/errors.py
Python
FileInUseError
FileInUseError
36
38
36
36
a657095ed85e3ac58e73b0f3e15ce6b1583c2828
bigcode/the-stack
train
6cdfd0b2b9ccb0254a8a6ff2
train
class
class NoNetworkPathError(Exception): """Represents an error caused because a network path does not exist""" pass
class NoNetworkPathError(Exception):
"""Represents an error caused because a network path does not exist""" pass
a service is already running""" pass class CantControlServiceError(Exception): """Represents an error caused because a service cannot be controlled""" pass class ParserNotImplementedError(Exception): """Represents an error caused because the parser does support it""" pass class NoNet...
64
64
25
7
56
BartekSzpak/adversary
app/commands/errors.py
Python
NoNetworkPathError
NoNetworkPathError
71
73
71
71
4b8f8ec0774c216af0aa3f5f71bc2ed51055b7a6
bigcode/the-stack
train
8787fd7efc2e5e7c2e195eb9
train
class
class DomainIssueError(Exception): """Represents an error caused because there is a domain issue""" pass
class DomainIssueError(Exception):
"""Represents an error caused because there is a domain issue""" pass
because a network path does not exist""" pass class PathSyntaxError(Exception): """Represents an error caused because the syntax of a path is incorrect""" pass class AccountDisabledError(Exception): """Represents an error caused because an account is disabled""" pass class DomainIssu...
64
64
23
6
57
BartekSzpak/adversary
app/commands/errors.py
Python
DomainIssueError
DomainIssueError
86
88
86
86
aab6904517423f7fe9e3e7245da45bddb71073f6
bigcode/the-stack
train
d205f774fef067d0e90047a1
train
class
class AccountAlreadyExistsError(Exception): """Represents an error caused because the user account already exists""" pass
class AccountAlreadyExistsError(Exception):
"""Represents an error caused because the user account already exists""" pass
issue""" pass class AcquireLSAError(Exception): """Represents an error caused because the process could not acquire access to LSA""" pass class AVBlockError(Exception): """Represents an error caused because AntiVirus software blocked the action""" pass class AccountAlreadyExistsError...
64
64
24
7
56
BartekSzpak/adversary
app/commands/errors.py
Python
AccountAlreadyExistsError
AccountAlreadyExistsError
101
103
101
101
0aa8ae10825951069629468f2ccd617cf472db84
bigcode/the-stack
train
dd5518d45ca2a3f51f1beefd
train
class
class UnresponsiveServiceError(Exception): """Represents an error caused because a service is unresponsive""" pass
class UnresponsiveServiceError(Exception):
"""Represents an error caused because a service is unresponsive""" pass
because a process does not exist""" pass class FileInUseError(Exception): """Represents an error caused because a file is currently in use""" pass class IncorrectParameterError(Exception): """Represents an error caused because a parameter was incorrect""" pass class UnresponsiveServi...
64
64
24
7
56
BartekSzpak/adversary
app/commands/errors.py
Python
UnresponsiveServiceError
UnresponsiveServiceError
46
48
46
46
57f8bffa2fa351d91e528b6a85d85b1fb00b13e0
bigcode/the-stack
train
a80673b366506cfe8bebc8e4
train
class
class NoProcessError(Exception): """Represents an error caused because a process does not exist""" pass
class NoProcessError(Exception):
"""Represents an error caused because a process does not exist""" pass
an error caused because access was denied""" pass class NoRegKeyError(Exception): """Represents an error caused because a registry key was missing""" pass class NoServiceError(Exception): """Represents an error caused because a service does not exist""" pass class NoProcessError(Exce...
64
64
23
6
57
BartekSzpak/adversary
app/commands/errors.py
Python
NoProcessError
NoProcessError
31
33
31
31
4221ac018a0ca9cc6cac82135564e3809736b110
bigcode/the-stack
train
cbc01ac571620e329ab8541f
train
class
class ServiceNotStartedError(Exception): """Represents an error caused because a service is not started""" pass
class ServiceNotStartedError(Exception):
"""Represents an error caused because a service is not started""" pass
because a file is currently in use""" pass class IncorrectParameterError(Exception): """Represents an error caused because a parameter was incorrect""" pass class UnresponsiveServiceError(Exception): """Represents an error caused because a service is unresponsive""" pass class Servic...
64
64
24
7
56
BartekSzpak/adversary
app/commands/errors.py
Python
ServiceNotStartedError
ServiceNotStartedError
51
53
51
51
42b0a611b449d85185ea9a1d559d507d381be683
bigcode/the-stack
train
1564940b272a0f74b5fad6ec
train
class
class AccountDisabledError(Exception): """Represents an error caused because an account is disabled""" pass
class AccountDisabledError(Exception):
"""Represents an error caused because an account is disabled""" pass
parser does support it""" pass class NoNetworkPathError(Exception): """Represents an error caused because a network path does not exist""" pass class PathSyntaxError(Exception): """Represents an error caused because the syntax of a path is incorrect""" pass class AccountDisabledError...
64
64
22
6
57
BartekSzpak/adversary
app/commands/errors.py
Python
AccountDisabledError
AccountDisabledError
81
83
81
81
40e0a59f2e38557aa5f27031b02dcb589a6ce63e
bigcode/the-stack
train
5f79bfa924fcd49a69163eea
train
class
class AcquireLSAError(Exception): """Represents an error caused because the process could not acquire access to LSA""" pass
class AcquireLSAError(Exception):
"""Represents an error caused because the process could not acquire access to LSA""" pass
because the syntax of a path is incorrect""" pass class AccountDisabledError(Exception): """Represents an error caused because an account is disabled""" pass class DomainIssueError(Exception): """Represents an error caused because there is a domain issue""" pass class AcquireLSAError...
64
64
28
7
56
BartekSzpak/adversary
app/commands/errors.py
Python
AcquireLSAError
AcquireLSAError
91
93
91
91
8c03900e857c85628e6ce71f1a8faf76db8bddbb
bigcode/the-stack
train
2f2b801fe02d1dad93bba485
train
class
class ParseError(Exception): """Represent a generic parsing error""" pass
class ParseError(Exception):
"""Represent a generic parsing error""" pass
class ParseError(Exception):
5
64
16
5
0
BartekSzpak/adversary
app/commands/errors.py
Python
ParseError
ParseError
1
3
1
1
36578688c6a4eeea241a394d789156d687e70572
bigcode/the-stack
train
167d2e596956c763d316cf35
train
class
class NoRegKeyError(Exception): """Represents an error caused because a registry key was missing""" pass
class NoRegKeyError(Exception):
"""Represents an error caused because a registry key was missing""" pass
resents an error caused by a file not being found""" pass class NoShareError(Exception): """Represents an error caused by a share not existing""" pass class AccessDeniedError(Exception): """Represents an error caused because access was denied""" pass class NoRegKeyError(Exception):
64
64
24
7
56
BartekSzpak/adversary
app/commands/errors.py
Python
NoRegKeyError
NoRegKeyError
21
23
21
21
ee1f12d1917b2cb756a63192b3cd8569b4a0733d
bigcode/the-stack
train
99c651c784636d5bbd8d317d
train
class
class PathSyntaxError(Exception): """Represents an error caused because the syntax of a path is incorrect""" pass
class PathSyntaxError(Exception):
"""Represents an error caused because the syntax of a path is incorrect""" pass
a service cannot be controlled""" pass class ParserNotImplementedError(Exception): """Represents an error caused because the parser does support it""" pass class NoNetworkPathError(Exception): """Represents an error caused because a network path does not exist""" pass class PathSynta...
64
64
25
6
57
BartekSzpak/adversary
app/commands/errors.py
Python
PathSyntaxError
PathSyntaxError
76
78
76
76
4c01dd6d784c6d2309b6c556785ce3b57b843f33
bigcode/the-stack
train
2c753a2ee4bbb019d7a2a37b
train
class
class NoShareError(Exception): """Represents an error caused by a share not existing""" pass
class NoShareError(Exception):
"""Represents an error caused by a share not existing""" pass
class ParseError(Exception): """Represent a generic parsing error""" pass class NoFileError(Exception): """Represents an error caused by a file not being found""" pass class NoShareError(Exception):
45
64
22
6
38
BartekSzpak/adversary
app/commands/errors.py
Python
NoShareError
NoShareError
11
13
11
11
601969cf28801dadbb752d771c70cba0cb44e0aa
bigcode/the-stack
train
59663137db3a43c09ecaf06f
train
class
class AccessDeniedError(Exception): """Represents an error caused because access was denied""" pass
class AccessDeniedError(Exception):
"""Represents an error caused because access was denied""" pass
(Exception): """Represent a generic parsing error""" pass class NoFileError(Exception): """Represents an error caused by a file not being found""" pass class NoShareError(Exception): """Represents an error caused by a share not existing""" pass class AccessDeniedError(Exception):...
64
64
21
6
57
BartekSzpak/adversary
app/commands/errors.py
Python
AccessDeniedError
AccessDeniedError
16
18
16
16
c656095c4a338ac918074d017b5f23edd945acdc
bigcode/the-stack
train
b975c3a7e334f3af862d6fba
train
class
class ParserNotImplementedError(Exception): """Represents an error caused because the parser does support it""" pass
class ParserNotImplementedError(Exception):
"""Represents an error caused because the parser does support it""" pass
a service is not started""" pass class ServiceAlreadyRunningError(Exception): """Represents an error caused because a service is already running""" pass class CantControlServiceError(Exception): """Represents an error caused because a service cannot be controlled""" pass class Parser...
64
64
24
7
56
BartekSzpak/adversary
app/commands/errors.py
Python
ParserNotImplementedError
ParserNotImplementedError
66
68
66
66
f1b63c5dab0b04f2ac7221d2ab8c29c0426c1501
bigcode/the-stack
train
bea6ef8d816deb8c92a25f6d
train
class
class AVBlockError(Exception): """Represents an error caused because AntiVirus software blocked the action""" pass
class AVBlockError(Exception):
"""Represents an error caused because AntiVirus software blocked the action""" pass
account is disabled""" pass class DomainIssueError(Exception): """Represents an error caused because there is a domain issue""" pass class AcquireLSAError(Exception): """Represents an error caused because the process could not acquire access to LSA""" pass class AVBlockError(Exceptio...
64
64
24
6
57
BartekSzpak/adversary
app/commands/errors.py
Python
AVBlockError
AVBlockError
96
98
96
96
a8e9a05f14a163670211e4fb0dd20580749f3ce3
bigcode/the-stack
train
b4886f850d987f91ddd93d7a
train
class
class NoServiceError(Exception): """Represents an error caused because a service does not exist""" pass
class NoServiceError(Exception):
"""Represents an error caused because a service does not exist""" pass
resents an error caused by a share not existing""" pass class AccessDeniedError(Exception): """Represents an error caused because access was denied""" pass class NoRegKeyError(Exception): """Represents an error caused because a registry key was missing""" pass class NoServiceError(Exc...
64
64
23
6
57
BartekSzpak/adversary
app/commands/errors.py
Python
NoServiceError
NoServiceError
26
28
26
26
2190744c611557202c6194706f29ddaae63d7dc2
bigcode/the-stack
train
09cab5152e2abb33e77b6ae8
train
class
class NoFileError(Exception): """Represents an error caused by a file not being found""" pass
class NoFileError(Exception):
"""Represents an error caused by a file not being found""" pass
class ParseError(Exception): """Represent a generic parsing error""" pass class NoFileError(Exception):
22
64
23
6
15
BartekSzpak/adversary
app/commands/errors.py
Python
NoFileError
NoFileError
6
8
6
6
38bfdae1cb83a42371351ee7fd867a86d2488d96
bigcode/the-stack
train
86e7ca137808120afe64e031
train
class
class ServiceAlreadyRunningError(Exception): """Represents an error caused because a service is already running""" pass
class ServiceAlreadyRunningError(Exception):
"""Represents an error caused because a service is already running""" pass
because a parameter was incorrect""" pass class UnresponsiveServiceError(Exception): """Represents an error caused because a service is unresponsive""" pass class ServiceNotStartedError(Exception): """Represents an error caused because a service is not started""" pass class ServiceAl...
64
64
24
7
56
BartekSzpak/adversary
app/commands/errors.py
Python
ServiceAlreadyRunningError
ServiceAlreadyRunningError
56
58
56
56
b5504b0e125fa3d57d2839b006bb2cdcd7190c26
bigcode/the-stack
train
181d4281a8c85cbd7f03b67a
train
function
def start(args): setup_util.replace_text("php-fuel/fuel/app/config/production/db.php", "localhost", ""+ args.database_host +"") setup_util.replace_text("php-fuel/deploy/nginx.conf", "root .*\/FrameworkBenchmarks", "root " + home + "/FrameworkBenchmarks") try: if os.name == 'nt': subprocess.check_call('...
def start(args):
setup_util.replace_text("php-fuel/fuel/app/config/production/db.php", "localhost", ""+ args.database_host +"") setup_util.replace_text("php-fuel/deploy/nginx.conf", "root .*\/FrameworkBenchmarks", "root " + home + "/FrameworkBenchmarks") try: if os.name == 'nt': subprocess.check_call('icacls "C:\\Frame...
import subprocess import sys import os import setup_util from os.path import expanduser home = expanduser("~") def start(args):
31
82
274
4
27
MalcolmEvershed/FrameworkBenchmarks
php-fuel/setup.py
Python
start
start
9
23
9
9
5c88add3d20a0983afd291bf70304ca3a19b55bd
bigcode/the-stack
train
401879bef1a11dd21226acb3
train
function
def stop(): try: if os.name == 'nt': subprocess.call('appcmd delete site PHP', shell=True) return 0 subprocess.call("sudo /usr/local/nginx/sbin/nginx -s stop", shell=True) subprocess.call("sudo kill -QUIT $( cat php-fuel/deploy/php-fpm.pid )", shell=True) subprocess.check_call("sudo chown ...
def stop():
try: if os.name == 'nt': subprocess.call('appcmd delete site PHP', shell=True) return 0 subprocess.call("sudo /usr/local/nginx/sbin/nginx -s stop", shell=True) subprocess.call("sudo kill -QUIT $( cat php-fuel/deploy/php-fpm.pid )", shell=True) subprocess.check_call("sudo chown -R $USER:$US...
pm.pid", shell=True) subprocess.check_call("sudo /usr/local/nginx/sbin/nginx -c " + home + "/FrameworkBenchmarks/php-fuel/deploy/nginx.conf", shell=True) return 0 except subprocess.CalledProcessError: return 1 def stop():
64
64
115
3
60
MalcolmEvershed/FrameworkBenchmarks
php-fuel/setup.py
Python
stop
stop
24
34
24
24
232628645c9d2bf6fb06db71c05847d028ebc44f
bigcode/the-stack
train
baa19b265d42bc5e184a1c5a
train
class
class DummyParser(object): def __init__(self): self.parse_called = False def parse(self): self.parse_called = True
class DummyParser(object):
def __init__(self): self.parse_called = False def parse(self): self.parse_called = True
(self, host, port): self.connected = True def print_debug_message(self): pass def send(self, message): self.sent_message = message def receive(self): self.receive_called = True def close(self): self.connected = False class DummyParser(object):
64
64
31
5
58
mjalas/messaging-client
messaging_client/tests/test_messaging_client.py
Python
DummyParser
DummyParser
30
36
30
31
f9a21f65529ad39bb5bb56174ce368f198c1a12b
bigcode/the-stack
train
d6ea6bace0f87f05e1b9f1c1
train
class
class TestMessagingClient(TestCase): def setUp(self): self.socket = DummySocket() self.parser = DummyParser() self.client = MessagingClient(command_line_parser=self.parser, socket=self.socket) self.test_message = "Happy messaging!" def test_parse_command_line(self): sel...
class TestMessagingClient(TestCase):
def setUp(self): self.socket = DummySocket() self.parser = DummyParser() self.client = MessagingClient(command_line_parser=self.parser, socket=self.socket) self.test_message = "Happy messaging!" def test_parse_command_line(self): self.client.parse_command_line() ...
def print_debug_message(self): pass def send(self, message): self.sent_message = message def receive(self): self.receive_called = True def close(self): self.connected = False class DummyParser(object): def __init__(self): self.parse_called = False def ...
84
84
280
7
76
mjalas/messaging-client
messaging_client/tests/test_messaging_client.py
Python
TestMessagingClient
TestMessagingClient
39
79
39
40
208917482306c4e73769cdf787a1036f985b525b
bigcode/the-stack
train
3bfbdfaddd7877b238da76a9
train
class
class DummySocket(ClientSocket): def __init__(self): super().__init__() self.sent_message = None self.receive_called = False self.connected = False def connect(self, host, port): self.connected = True def print_debug_message(self): pass def send(self, ...
class DummySocket(ClientSocket):
def __init__(self): super().__init__() self.sent_message = None self.receive_called = False self.connected = False def connect(self, host, port): self.connected = True def print_debug_message(self): pass def send(self, message): self.sent_messag...
from unittest import TestCase from messaging_client.client_socket import ClientSocket from messaging_client.messaging_client import MessagingClient class DummySocket(ClientSocket):
30
64
100
6
23
mjalas/messaging-client
messaging_client/tests/test_messaging_client.py
Python
DummySocket
DummySocket
6
27
6
7
671aabaae9e01931c8cd4daf5442b19e7831778d
bigcode/the-stack
train
0d0345f38af1b4bc9ed1c157
train
class
class TestDirectoryWalk(unittest.TestCase): def test_directory_walk(self): """ Check whether the directory walk function works correctly without a filter. """ # Walk through the directory and keep a list with the names of all files. file_names = [] for file_path in d...
class TestDirectoryWalk(unittest.TestCase):
def test_directory_walk(self): """ Check whether the directory walk function works correctly without a filter. """ # Walk through the directory and keep a list with the names of all files. file_names = [] for file_path in directory_walk(abs_path("./data_files/test_ha...
import unittest import os from cw.directory_walk import directory_walk import fnmatch def abs_path(rel_path): """ Returns an absolute path to a file relative to this file. :param rel_path: Path relative to this file :return: Absolute path """ return os.path.normpath(os.path.join(os.path.abspa...
90
111
371
8
82
aarondewindt/cw
cw/test/test_directory_walk.py
Python
TestDirectoryWalk
TestDirectoryWalk
17
68
17
17
8ca48d691b66839b7be058e7d8f3eb35602656d7
bigcode/the-stack
train
7626b529a274f805da8ce778
train
function
def abs_path(rel_path): """ Returns an absolute path to a file relative to this file. :param rel_path: Path relative to this file :return: Absolute path """ return os.path.normpath(os.path.join(os.path.abspath(os.path.dirname(__file__)), rel_path))
def abs_path(rel_path):
""" Returns an absolute path to a file relative to this file. :param rel_path: Path relative to this file :return: Absolute path """ return os.path.normpath(os.path.join(os.path.abspath(os.path.dirname(__file__)), rel_path))
import unittest import os from cw.directory_walk import directory_walk import fnmatch def abs_path(rel_path):
24
64
64
6
17
aarondewindt/cw
cw/test/test_directory_walk.py
Python
abs_path
abs_path
7
14
7
7
d018ddd06c4d30b90537435313bffec0f0254087
bigcode/the-stack
train
2f77b0d229e731da5fcd649f
train
class
class Park: def __init__(self, configFile): # initialize instance variables: self.x1 = 0 self.x2 = 0 self.y1 = 0 self.y2 = 0 self.totalacre= 0 self.pathwaydesignstrategy= "forest" #Forest means no designed pathway, its just a forest of trees/plants. s...
class Park:
def __init__(self, configFile): # initialize instance variables: self.x1 = 0 self.x2 = 0 self.y1 = 0 self.y2 = 0 self.totalacre= 0 self.pathwaydesignstrategy= "forest" #Forest means no designed pathway, its just a forest of trees/plants. self.plantlis...
unrooting possible at this time. def plantit(self): self.isplanted=True def getexpectedvalue(self): #The most easily interpretable "Value" function. # (yield*marketprice)^ (bioscore+beautyscore) basevalue = (self.yieldperacre*self.lastMarketPrice) powerfactor = self.bi...
256
256
1,096
3
253
curl-tech/BT_2021
ParkDiversityOptimizer/park.py
Python
Park
Park
48
158
48
48
8a125702050f2473401438bd437eed3b8bd7425c
bigcode/the-stack
train
d24d5c4e4e1278ec4a98d52b
train
class
class Plant: def __init__(self): # initialize instance variables: self.name = "" #this is the plant/tree name (apple, pear, etc) self.yieldperacre = 0 #this is in lbs or kgs of average expected yield from this plant self.bioscore = 0 #this is a relative score(0 to 1 range) on how g...
class Plant:
def __init__(self): # initialize instance variables: self.name = "" #this is the plant/tree name (apple, pear, etc) self.yieldperacre = 0 #this is in lbs or kgs of average expected yield from this plant self.bioscore = 0 #this is a relative score(0 to 1 range) on how good it is for...
import numpy as np import hjson #Instance of a Tree/Plant that will take a place in Park. class Plant:
27
129
433
3
24
curl-tech/BT_2021
ParkDiversityOptimizer/park.py
Python
Plant
Plant
5
40
5
5
10796efc42a527dd9208521f0cac4f6b3343134e
bigcode/the-stack
train
835b856a5dea62d37ed52afe
train
class
class ServiceBusSender(BaseHandlerAsync, SenderMixin): """The ServiceBusSender class defines a high level interface for sending messages to the Azure Service Bus Queue or Topic. :ivar fully_qualified_namespace: The fully qualified host name for the Service Bus namespace. The namespace format is: `<you...
class ServiceBusSender(BaseHandlerAsync, SenderMixin):
"""The ServiceBusSender class defines a high level interface for sending messages to the Azure Service Bus Queue or Topic. :ivar fully_qualified_namespace: The fully qualified host name for the Service Bus namespace. The namespace format is: `<yournamespace>.servicebus.windows.net`. :vartype fully...
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
205
256
2,469
11
194
szaher/azure-sdk-for-python
sdk/servicebus/azure-servicebus/azure/servicebus/aio/_servicebus_sender_async.py
Python
ServiceBusSender
ServiceBusSender
33
297
33
33
0b026c80590f4b7b482cd61ce4e8a6916896fc38
bigcode/the-stack
train