Search is not available for this dataset
identifier
stringlengths
1
155
parameters
stringlengths
2
6.09k
docstring
stringlengths
11
63.4k
docstring_summary
stringlengths
0
63.4k
function
stringlengths
29
99.8k
function_tokens
list
start_point
list
end_point
list
language
stringclasses
1 value
docstring_language
stringlengths
2
7
docstring_language_predictions
stringlengths
18
23
is_langid_reliable
stringclasses
2 values
PrivateIngredientsApiTests.test_create_ingredient_invalid
(self)
Test creating invalid ingredient fails
Test creating invalid ingredient fails
def test_create_ingredient_invalid(self): """Test creating invalid ingredient fails""" payload = {'name': ''} res = self.client.post(INGREDIENTS_URL, payload) self.assertEqual(res.status_code, status.HTTP_400_BAD_REQUEST)
[ "def", "test_create_ingredient_invalid", "(", "self", ")", ":", "payload", "=", "{", "'name'", ":", "''", "}", "res", "=", "self", ".", "client", ".", "post", "(", "INGREDIENTS_URL", ",", "payload", ")", "self", ".", "assertEqual", "(", "res", ".", "stat...
[ 79, 4 ]
[ 84, 70 ]
python
en
['af', 'en', 'en']
True
PrivateIngredientsApiTests.test_retrieve_ingredients_assigned_to_recipes
(self)
Test filtering ingredients by those assigned to recipes
Test filtering ingredients by those assigned to recipes
def test_retrieve_ingredients_assigned_to_recipes(self): """Test filtering ingredients by those assigned to recipes""" ingredient1 = Ingredient.objects.create(user=self.user, name='Apples') ingredient2 = Ingredient.objects.create(user=self.user, name='Turkey') recipe = Recipe.objects.cre...
[ "def", "test_retrieve_ingredients_assigned_to_recipes", "(", "self", ")", ":", "ingredient1", "=", "Ingredient", ".", "objects", ".", "create", "(", "user", "=", "self", ".", "user", ",", "name", "=", "'Apples'", ")", "ingredient2", "=", "Ingredient", ".", "ob...
[ 86, 4 ]
[ 103, 52 ]
python
en
['en', 'en', 'en']
True
PrivateIngredientsApiTests.test_retrieve_ingredients_assigned_unique
(self)
Test filtering ingredients by those assigned unique items
Test filtering ingredients by those assigned unique items
def test_retrieve_ingredients_assigned_unique(self): """Test filtering ingredients by those assigned unique items""" ingredient = Ingredient.objects.create(user=self.user, name='Eggs') Ingredient.objects.create(user=self.user, name='Cheese') recipe1 = Recipe.objects.create( t...
[ "def", "test_retrieve_ingredients_assigned_unique", "(", "self", ")", ":", "ingredient", "=", "Ingredient", ".", "objects", ".", "create", "(", "user", "=", "self", ".", "user", ",", "name", "=", "'Eggs'", ")", "Ingredient", ".", "objects", ".", "create", "(...
[ 105, 4 ]
[ 126, 42 ]
python
en
['en', 'en', 'en']
True
S3SubdirReaderBatchKwargsGenerator._build_batch_kwargs
(self, batch_parameters)
Args: batch_parameters: Returns: batch_kwargs
def _build_batch_kwargs(self, batch_parameters): """ Args: batch_parameters: Returns: batch_kwargs """ try: data_asset_name = batch_parameters.pop("data_asset_name") except KeyError: raise BatchKwargsError( ...
[ "def", "_build_batch_kwargs", "(", "self", ",", "batch_parameters", ")", ":", "try", ":", "data_asset_name", "=", "batch_parameters", ".", "pop", "(", "\"data_asset_name\"", ")", "except", "KeyError", ":", "raise", "BatchKwargsError", "(", "\"Unable to build BatchKwar...
[ 137, 4 ]
[ 197, 13 ]
python
en
['en', 'error', 'th']
False
S3SubdirReaderBatchKwargsGenerator._window_to_s3_path
(self, path: str)
To handle window "\" path. "s3://bucket\\prefix" => "s3://bucket/prefix" >>> path = os.path.join("s3://bucket", "prefix") >>> window_to_s3_path(path) >>>
To handle window "\" path. "s3://bucket\\prefix" => "s3://bucket/prefix" >>> path = os.path.join("s3://bucket", "prefix") >>> window_to_s3_path(path) >>>
def _window_to_s3_path(self, path: str): """ To handle window "\" path. "s3://bucket\\prefix" => "s3://bucket/prefix" >>> path = os.path.join("s3://bucket", "prefix") >>> window_to_s3_path(path) >>> """ s3_url = urlparse(path) s3_path = Path(s3_url.path) ...
[ "def", "_window_to_s3_path", "(", "self", ",", "path", ":", "str", ")", ":", "s3_url", "=", "urlparse", "(", "path", ")", "s3_path", "=", "Path", "(", "s3_url", ".", "path", ")", "s3_new_url", "=", "urlunparse", "(", "(", "s3_url", ".", "scheme", ",", ...
[ 299, 4 ]
[ 319, 25 ]
python
en
['en', 'error', 'th']
False
_convert_anomalies_to_contextual
(X, interval=1)
Convert list of timestamps to list of tuples. Convert a list of anomalies identified by timestamps, to a list of tuples marking the start and end interval of anomalies; make it contextually defined. Args: X (list): contains timestamp of anomalies. interval (int): allowed gap between a...
Convert list of timestamps to list of tuples.
def _convert_anomalies_to_contextual(X, interval=1): """ Convert list of timestamps to list of tuples. Convert a list of anomalies identified by timestamps, to a list of tuples marking the start and end interval of anomalies; make it contextually defined. Args: X (list): contains timestamp...
[ "def", "_convert_anomalies_to_contextual", "(", "X", ",", "interval", "=", "1", ")", ":", "if", "len", "(", "X", ")", "==", "0", ":", "return", "[", "]", "X", "=", "sorted", "(", "X", ")", "start_ts", "=", "0", "max_ts", "=", "len", "(", "X", ")"...
[ 15, 0 ]
[ 50, 20 ]
python
en
['en', 'en', 'en']
True
split_sequence
(X, index, target_column, sequence_size, overlap_size)
Split sequences of time series data. The function creates a list of input sequences by splitting the input sequence into partitions with a specified size and pads it with values from previous sequence according to the overlap size. Args: X (ndarray): N-dimensional value sequence to...
Split sequences of time series data.
def split_sequence(X, index, target_column, sequence_size, overlap_size): """Split sequences of time series data. The function creates a list of input sequences by splitting the input sequence into partitions with a specified size and pads it with values from previous sequence according to the overlap ...
[ "def", "split_sequence", "(", "X", ",", "index", ",", "target_column", ",", "sequence_size", ",", "overlap_size", ")", ":", "X_", "=", "list", "(", ")", "index_", "=", "list", "(", ")", "overlap", "=", "0", "start", "=", "0", "max_start", "=", "len", ...
[ 53, 0 ]
[ 95, 21 ]
python
en
['en', 'en', 'en']
True
detect_anomalies
(X, index, interval, overlap_size, subscription_key, endpoint, granularity, custom_interval=None, period=None, max_anomaly_ratio=None, sensitivity=None, timezone="UTC")
Microsoft's Azure Anomaly Detection tool. Args: X (list): Array containing the input value sequences. index (list): Array containing the input index sequences. interval (int): Integer denoting time span frequency of the data. overlap_size (int): ...
Microsoft's Azure Anomaly Detection tool.
def detect_anomalies(X, index, interval, overlap_size, subscription_key, endpoint, granularity, custom_interval=None, period=None, max_anomaly_ratio=None, sensitivity=None, timezone="UTC"): """Microsoft's Azure Anomaly Detection tool. Args: X (list): ...
[ "def", "detect_anomalies", "(", "X", ",", "index", ",", "interval", ",", "overlap_size", ",", "subscription_key", ",", "endpoint", ",", "granularity", ",", "custom_interval", "=", "None", ",", "period", "=", "None", ",", "max_anomaly_ratio", "=", "None", ",", ...
[ 98, 0 ]
[ 168, 61 ]
python
en
['en', 'en', 'en']
True
hierarchy_info_t.__init__
(self, related_class=None, access=None, is_virtual=False)
creates class that contains partial information about class relationship
creates class that contains partial information about class relationship
def __init__(self, related_class=None, access=None, is_virtual=False): """creates class that contains partial information about class relationship""" if related_class: assert isinstance(related_class, class_t) self._related_class = related_class if access: ...
[ "def", "__init__", "(", "self", ",", "related_class", "=", "None", ",", "access", "=", "None", ",", "is_virtual", "=", "False", ")", ":", "if", "related_class", ":", "assert", "isinstance", "(", "related_class", ",", "class_t", ")", "self", ".", "_related_...
[ 60, 4 ]
[ 71, 42 ]
python
en
['en', 'en', 'en']
True
hierarchy_info_t.related_class
(self)
reference to base or derived :class:`class <class_t>`
reference to base or derived :class:`class <class_t>`
def related_class(self): """reference to base or derived :class:`class <class_t>`""" return self._related_class
[ "def", "related_class", "(", "self", ")", ":", "return", "self", ".", "_related_class" ]
[ 95, 4 ]
[ 97, 34 ]
python
en
['en', 'en', 'en']
True
hierarchy_info_t.access_type
(self)
describes :class:`hierarchy type <ACCESS_TYPES>`
describes :class:`hierarchy type <ACCESS_TYPES>`
def access_type(self): """describes :class:`hierarchy type <ACCESS_TYPES>`""" return self.access
[ "def", "access_type", "(", "self", ")", ":", "return", "self", ".", "access" ]
[ 118, 4 ]
[ 120, 26 ]
python
en
['en', 'gl', 'en']
True
hierarchy_info_t.is_virtual
(self)
indicates whether the inheritance is virtual or not
indicates whether the inheritance is virtual or not
def is_virtual(self): """indicates whether the inheritance is virtual or not""" return self._is_virtual
[ "def", "is_virtual", "(", "self", ")", ":", "return", "self", ".", "_is_virtual" ]
[ 129, 4 ]
[ 131, 31 ]
python
en
['en', 'en', 'en']
True
class_declaration_t.__init__
(self, name='')
creates class that describes C++ class declaration ( and not definition )
creates class that describes C++ class declaration ( and not definition )
def __init__(self, name=''): """creates class that describes C++ class declaration ( and not definition )""" declaration.declaration_t.__init__(self, name) self._aliases = []
[ "def", "__init__", "(", "self", ",", "name", "=", "''", ")", ":", "declaration", ".", "declaration_t", ".", "__init__", "(", "self", ",", "name", ")", "self", ".", "_aliases", "=", "[", "]" ]
[ 155, 4 ]
[ 159, 26 ]
python
en
['en', 'lb', 'en']
True
class_declaration_t._get__cmp__items
(self)
implementation details
implementation details
def _get__cmp__items(self): """implementation details""" return []
[ "def", "_get__cmp__items", "(", "self", ")", ":", "return", "[", "]" ]
[ 161, 4 ]
[ 163, 17 ]
python
da
['eo', 'da', 'en']
False
class_declaration_t.aliases
(self)
List of :class:`aliases <typedef_t>` to this instance
List of :class:`aliases <typedef_t>` to this instance
def aliases(self): """List of :class:`aliases <typedef_t>` to this instance""" return self._aliases
[ "def", "aliases", "(", "self", ")", ":", "return", "self", ".", "_aliases" ]
[ 169, 4 ]
[ 171, 28 ]
python
en
['en', 'en', 'en']
True
class_t.__init__
( self, name='', class_type=CLASS_TYPES.CLASS, is_abstract=False)
creates class that describes C++ class definition
creates class that describes C++ class definition
def __init__( self, name='', class_type=CLASS_TYPES.CLASS, is_abstract=False): """creates class that describes C++ class definition""" scopedef.scopedef_t.__init__(self, name) byte_info.byte_info.__init__(self) elaborated_info.elaborated_in...
[ "def", "__init__", "(", "self", ",", "name", "=", "''", ",", "class_type", "=", "CLASS_TYPES", ".", "CLASS", ",", "is_abstract", "=", "False", ")", ":", "scopedef", ".", "scopedef_t", ".", "__init__", "(", "self", ",", "name", ")", "byte_info", ".", "b...
[ 191, 4 ]
[ 212, 43 ]
python
en
['en', 'lb', 'en']
True
class_t._get__cmp__scope_items
(self)
implementation details
implementation details
def _get__cmp__scope_items(self): """implementation details""" return [ self.class_type, [declaration_utils.declaration_path(base.related_class) for base in self.bases].sort(), [declaration_utils.declaration_path(derive.related_class) for der...
[ "def", "_get__cmp__scope_items", "(", "self", ")", ":", "return", "[", "self", ".", "class_type", ",", "[", "declaration_utils", ".", "declaration_path", "(", "base", ".", "related_class", ")", "for", "base", "in", "self", ".", "bases", "]", ".", "sort", "...
[ 260, 4 ]
[ 271, 42 ]
python
da
['eo', 'da', 'en']
False
class_t.class_type
(self)
describes class :class:`type <CLASS_TYPES>`
describes class :class:`type <CLASS_TYPES>`
def class_type(self): """describes class :class:`type <CLASS_TYPES>`""" return self._class_type
[ "def", "class_type", "(", "self", ")", ":", "return", "self", ".", "_class_type" ]
[ 297, 4 ]
[ 299, 31 ]
python
en
['en', 'lb', 'en']
True
class_t.bases
(self)
list of :class:`base classes <hierarchy_info_t>`
list of :class:`base classes <hierarchy_info_t>`
def bases(self): """list of :class:`base classes <hierarchy_info_t>`""" return self._bases
[ "def", "bases", "(", "self", ")", ":", "return", "self", ".", "_bases" ]
[ 308, 4 ]
[ 310, 26 ]
python
en
['en', 'en', 'en']
True
class_t.recursive_bases
(self)
list of all :class:`base classes <hierarchy_info_t>`
list of all :class:`base classes <hierarchy_info_t>`
def recursive_bases(self): """list of all :class:`base classes <hierarchy_info_t>`""" if self._recursive_bases is None: to_go = self.bases[:] all_bases = [] while to_go: base = to_go.pop() if base not in all_bases: a...
[ "def", "recursive_bases", "(", "self", ")", ":", "if", "self", ".", "_recursive_bases", "is", "None", ":", "to_go", "=", "self", ".", "bases", "[", ":", "]", "all_bases", "=", "[", "]", "while", "to_go", ":", "base", "=", "to_go", ".", "pop", "(", ...
[ 317, 4 ]
[ 328, 36 ]
python
en
['en', 'en', 'en']
True
class_t.derived
(self)
list of :class:`derived classes <hierarchy_info_t>`
list of :class:`derived classes <hierarchy_info_t>`
def derived(self): """list of :class:`derived classes <hierarchy_info_t>`""" return self._derived
[ "def", "derived", "(", "self", ")", ":", "return", "self", ".", "_derived" ]
[ 331, 4 ]
[ 333, 28 ]
python
en
['en', 'en', 'ur']
True
class_t.recursive_derived
(self)
list of all :class:`derive classes <hierarchy_info_t>`
list of all :class:`derive classes <hierarchy_info_t>`
def recursive_derived(self): """list of all :class:`derive classes <hierarchy_info_t>`""" if self._recursive_derived is None: to_go = self.derived[:] all_derived = [] while to_go: derive = to_go.pop() if derive not in all_derived: ...
[ "def", "recursive_derived", "(", "self", ")", ":", "if", "self", ".", "_recursive_derived", "is", "None", ":", "to_go", "=", "self", ".", "derived", "[", ":", "]", "all_derived", "=", "[", "]", "while", "to_go", ":", "derive", "=", "to_go", ".", "pop",...
[ 340, 4 ]
[ 351, 38 ]
python
en
['en', 'en', 'en']
True
class_t.is_abstract
(self)
describes whether class abstract or not
describes whether class abstract or not
def is_abstract(self): """describes whether class abstract or not""" return self._is_abstract
[ "def", "is_abstract", "(", "self", ")", ":", "return", "self", ".", "_is_abstract" ]
[ 354, 4 ]
[ 356, 32 ]
python
en
['en', 'en', 'en']
True
class_t.public_members
(self)
list of all public :class:`members <declarationt_>`
list of all public :class:`members <declarationt_>`
def public_members(self): """list of all public :class:`members <declarationt_>`""" return self._public_members
[ "def", "public_members", "(", "self", ")", ":", "return", "self", ".", "_public_members" ]
[ 363, 4 ]
[ 365, 35 ]
python
en
['en', 'en', 'en']
True
class_t.private_members
(self)
list of all private :class:`members <declarationt_>`
list of all private :class:`members <declarationt_>`
def private_members(self): """list of all private :class:`members <declarationt_>`""" return self._private_members
[ "def", "private_members", "(", "self", ")", ":", "return", "self", ".", "_private_members" ]
[ 372, 4 ]
[ 374, 36 ]
python
en
['en', 'en', 'en']
True
class_t.protected_members
(self)
list of all protected :class:`members <declarationt_>`
list of all protected :class:`members <declarationt_>`
def protected_members(self): """list of all protected :class:`members <declarationt_>`""" return self._protected_members
[ "def", "protected_members", "(", "self", ")", ":", "return", "self", ".", "_protected_members" ]
[ 381, 4 ]
[ 383, 38 ]
python
en
['en', 'en', 'en']
True
class_t.aliases
(self)
List of :class:`aliases <typedef_t>` to this instance
List of :class:`aliases <typedef_t>` to this instance
def aliases(self): """List of :class:`aliases <typedef_t>` to this instance""" return self._aliases
[ "def", "aliases", "(", "self", ")", ":", "return", "self", ".", "_aliases" ]
[ 390, 4 ]
[ 392, 28 ]
python
en
['en', 'en', 'en']
True
class_t.get_members
(self, access=None)
returns list of members according to access type If access equals to None, then returned list will contain all members. You should not modify the list content, otherwise different optimization data will stop work and may to give you wrong results. :param access: describes desi...
returns list of members according to access type
def get_members(self, access=None): """ returns list of members according to access type If access equals to None, then returned list will contain all members. You should not modify the list content, otherwise different optimization data will stop work and may to give you wrong ...
[ "def", "get_members", "(", "self", ",", "access", "=", "None", ")", ":", "if", "access", "==", "ACCESS_TYPES", ".", "PUBLIC", ":", "return", "self", ".", "public_members", "elif", "access", "==", "ACCESS_TYPES", ".", "PROTECTED", ":", "return", "self", "."...
[ 401, 4 ]
[ 425, 30 ]
python
en
['en', 'error', 'th']
False
class_t.adopt_declaration
(self, decl, access)
adds new declaration to the class :param decl: reference to a :class:`declaration_t` :param access: member access type :type access: :class:ACCESS_TYPES
adds new declaration to the class
def adopt_declaration(self, decl, access): """adds new declaration to the class :param decl: reference to a :class:`declaration_t` :param access: member access type :type access: :class:ACCESS_TYPES """ if access == ACCESS_TYPES.PUBLIC: self.public_members.a...
[ "def", "adopt_declaration", "(", "self", ",", "decl", ",", "access", ")", ":", "if", "access", "==", "ACCESS_TYPES", ".", "PUBLIC", ":", "self", ".", "public_members", ".", "append", "(", "decl", ")", "elif", "access", "==", "ACCESS_TYPES", ".", "PROTECTED...
[ 427, 4 ]
[ 445, 39 ]
python
en
['en', 'en', 'en']
True
class_t.remove_declaration
(self, decl)
removes decl from members list :param decl: declaration to be removed :type decl: :class:`declaration_t`
removes decl from members list
def remove_declaration(self, decl): """ removes decl from members list :param decl: declaration to be removed :type decl: :class:`declaration_t` """ access_type = self.find_out_member_access_type(decl) if access_type == ACCESS_TYPES.PUBLIC: containe...
[ "def", "remove_declaration", "(", "self", ",", "decl", ")", ":", "access_type", "=", "self", ".", "find_out_member_access_type", "(", "decl", ")", "if", "access_type", "==", "ACCESS_TYPES", ".", "PUBLIC", ":", "container", "=", "self", ".", "public_members", "...
[ 447, 4 ]
[ 463, 26 ]
python
en
['en', 'error', 'th']
False
class_t.find_out_member_access_type
(self, member)
returns member access type :param member: member of the class :type member: :class:`declaration_t` :rtype: :class:ACCESS_TYPES
returns member access type
def find_out_member_access_type(self, member): """ returns member access type :param member: member of the class :type member: :class:`declaration_t` :rtype: :class:ACCESS_TYPES """ assert member.parent is self if not member.cache.access_type: ...
[ "def", "find_out_member_access_type", "(", "self", ",", "member", ")", ":", "assert", "member", ".", "parent", "is", "self", "if", "not", "member", ".", "cache", ".", "access_type", ":", "if", "member", "in", "self", ".", "public_members", ":", "access_type"...
[ 465, 4 ]
[ 488, 43 ]
python
en
['en', 'error', 'th']
False
class_t.top_class
(self)
reference to a parent class, which contains this class and defined within a namespace if this class is defined under a namespace, self will be returned
reference to a parent class, which contains this class and defined within a namespace
def top_class(self): """reference to a parent class, which contains this class and defined within a namespace if this class is defined under a namespace, self will be returned""" curr = self parent = self.parent while isinstance(parent, class_t): curr = paren...
[ "def", "top_class", "(", "self", ")", ":", "curr", "=", "self", "parent", "=", "self", ".", "parent", "while", "isinstance", "(", "parent", ",", "class_t", ")", ":", "curr", "=", "parent", "parent", "=", "parent", ".", "parent", "return", "curr" ]
[ 529, 4 ]
[ 539, 19 ]
python
en
['en', 'en', 'en']
True
dependency_info_t.decl
(self)
Deprecated since 1.9.0. Will be removed in 2.0.0.
Deprecated since 1.9.0. Will be removed in 2.0.0.
def decl(self): """ Deprecated since 1.9.0. Will be removed in 2.0.0. """ warnings.warn( "The decl attribute is deprecated.\n" + "Please use the declaration attribute instead.", DeprecationWarning) return self._decl
[ "def", "decl", "(", "self", ")", ":", "warnings", ".", "warn", "(", "\"The decl attribute is deprecated.\\n\"", "+", "\"Please use the declaration attribute instead.\"", ",", "DeprecationWarning", ")", "return", "self", ".", "_decl" ]
[ 588, 4 ]
[ 597, 25 ]
python
en
['en', 'error', 'th']
False
dependency_info_t.hint
(self)
The declaration, that report dependency can put some additional inforamtion about dependency. It can be used later
The declaration, that report dependency can put some additional inforamtion about dependency. It can be used later
def hint(self): """The declaration, that report dependency can put some additional inforamtion about dependency. It can be used later""" return self._hint
[ "def", "hint", "(", "self", ")", ":", "return", "self", ".", "_hint" ]
[ 616, 4 ]
[ 619, 25 ]
python
en
['en', 'en', 'en']
True
dependency_info_t.find_out_depend_on_it_declarations
(self)
If declaration depends on other declaration and not on some type this function will return reference to it. Otherwise None will be returned
If declaration depends on other declaration and not on some type this function will return reference to it. Otherwise None will be returned
def find_out_depend_on_it_declarations(self): """If declaration depends on other declaration and not on some type this function will return reference to it. Otherwise None will be returned """ return impl_details.dig_declarations(self.depend_on_it)
[ "def", "find_out_depend_on_it_declarations", "(", "self", ")", ":", "return", "impl_details", ".", "dig_declarations", "(", "self", ".", "depend_on_it", ")" ]
[ 621, 4 ]
[ 626, 63 ]
python
en
['en', 'en', 'en']
True
dependency_info_t.i_depend_on_them
(decl)
Returns set of declarations. every item in the returned set, depends on a declaration from the input
Returns set of declarations. every item in the returned set, depends on a declaration from the input
def i_depend_on_them(decl): """Returns set of declarations. every item in the returned set, depends on a declaration from the input""" to_be_included = set() for dependency_info in decl.i_depend_on_them(): for ddecl in dependency_info.find_out_depend_on_it_declarations(): ...
[ "def", "i_depend_on_them", "(", "decl", ")", ":", "to_be_included", "=", "set", "(", ")", "for", "dependency_info", "in", "decl", ".", "i_depend_on_them", "(", ")", ":", "for", "ddecl", "in", "dependency_info", ".", "find_out_depend_on_it_declarations", "(", ")"...
[ 629, 4 ]
[ 641, 29 ]
python
en
['en', 'en', 'en']
True
dependency_info_t.we_depend_on_them
(decls)
Returns set of declarations. every item in the returned set, depends on a declaration from the input
Returns set of declarations. every item in the returned set, depends on a declaration from the input
def we_depend_on_them(decls): """Returns set of declarations. every item in the returned set, depends on a declaration from the input""" to_be_included = set() for decl in decls: to_be_included.update(dependency_info_t.i_depend_on_them(decl)) return to_be_included
[ "def", "we_depend_on_them", "(", "decls", ")", ":", "to_be_included", "=", "set", "(", ")", "for", "decl", "in", "decls", ":", "to_be_included", ".", "update", "(", "dependency_info_t", ".", "i_depend_on_them", "(", "decl", ")", ")", "return", "to_be_included"...
[ 644, 4 ]
[ 650, 29 ]
python
en
['en', 'en', 'en']
True
enumeration_t.__init__
(self, name='', values=None)
creates class that describes C++ `enum` declaration The items of the list 'values' may either be strings containing the enumeration value name or tuples (name, numeric value). :param name: `enum` name :type name: str :param parent: Parent declaration :type parent: decla...
creates class that describes C++ `enum` declaration
def __init__(self, name='', values=None): """creates class that describes C++ `enum` declaration The items of the list 'values' may either be strings containing the enumeration value name or tuples (name, numeric value). :param name: `enum` name :type name: str :param p...
[ "def", "__init__", "(", "self", ",", "name", "=", "''", ",", "values", "=", "None", ")", ":", "declaration", ".", "declaration_t", ".", "__init__", "(", "self", ",", "name", ")", "byte_info", ".", "byte_info", ".", "__init__", "(", "self", ")", "elabor...
[ 24, 4 ]
[ 46, 28 ]
python
en
['en', 'la', 'en']
True
enumeration_t._get__cmp__items
(self)
implementation details
implementation details
def _get__cmp__items(self): """implementation details""" return [self.values]
[ "def", "_get__cmp__items", "(", "self", ")", ":", "return", "[", "self", ".", "values", "]" ]
[ 56, 4 ]
[ 58, 28 ]
python
da
['eo', 'da', 'en']
False
enumeration_t.values
(self)
A list of tuples (valname(str), valnum(int)) that contain the enumeration values. @type: list
A list of tuples (valname(str), valnum(int)) that contain the enumeration values.
def values(self): """A list of tuples (valname(str), valnum(int)) that contain the enumeration values. @type: list""" return copy.copy(self._values)
[ "def", "values", "(", "self", ")", ":", "return", "copy", ".", "copy", "(", "self", ".", "_values", ")" ]
[ 61, 4 ]
[ 65, 38 ]
python
en
['en', 'da', 'en']
True
enumeration_t.append_value
(self, valuename, valuenum=None)
Append another enumeration value to the `enum`. The numeric value may be None in which case it is automatically determined by increasing the value of the last item. When the 'values' attribute is accessed the resulting list will be in the same order as append_value() was called. ...
Append another enumeration value to the `enum`.
def append_value(self, valuename, valuenum=None): """Append another enumeration value to the `enum`. The numeric value may be None in which case it is automatically determined by increasing the value of the last item. When the 'values' attribute is accessed the resulting list will be i...
[ "def", "append_value", "(", "self", ",", "valuename", ",", "valuenum", "=", "None", ")", ":", "# No number given? Then use the previous one + 1", "if", "valuenum", "is", "None", ":", "if", "not", "self", ".", "_values", ":", "valuenum", "=", "0", "else", ":", ...
[ 92, 4 ]
[ 114, 55 ]
python
en
['en', 'en', 'en']
True
enumeration_t.has_value_name
(self, name)
Check if this `enum` has a particular name among its values. :param name: Enumeration value name :type name: str :rtype: True if there is an enumeration value with the given name
Check if this `enum` has a particular name among its values.
def has_value_name(self, name): """Check if this `enum` has a particular name among its values. :param name: Enumeration value name :type name: str :rtype: True if there is an enumeration value with the given name """ for val, _ in self._values: if val == nam...
[ "def", "has_value_name", "(", "self", ",", "name", ")", ":", "for", "val", ",", "_", "in", "self", ".", "_values", ":", "if", "val", "==", "name", ":", "return", "True", "return", "False" ]
[ 116, 4 ]
[ 126, 20 ]
python
en
['en', 'en', 'en']
True
enumeration_t.get_name2value_dict
(self)
returns a dictionary, that maps between `enum` name( key ) and `enum` value( value )
returns a dictionary, that maps between `enum` name( key ) and `enum` value( value )
def get_name2value_dict(self): """returns a dictionary, that maps between `enum` name( key ) and `enum` value( value )""" x = {} for val, num in self._values: x[val] = num return x
[ "def", "get_name2value_dict", "(", "self", ")", ":", "x", "=", "{", "}", "for", "val", ",", "num", "in", "self", ".", "_values", ":", "x", "[", "val", "]", "=", "num", "return", "x" ]
[ 128, 4 ]
[ 134, 16 ]
python
en
['en', 'en', 'en']
True
ColumnMedian._pandas
(cls, column, **kwargs)
Pandas Median Implementation
Pandas Median Implementation
def _pandas(cls, column, **kwargs): """Pandas Median Implementation""" return column.median()
[ "def", "_pandas", "(", "cls", ",", "column", ",", "*", "*", "kwargs", ")", ":", "return", "column", ".", "median", "(", ")" ]
[ 32, 4 ]
[ 34, 30 ]
python
en
['pt', 'jv', 'en']
False
ColumnMedian._sqlalchemy
( cls, execution_engine: "SqlAlchemyExecutionEngine", metric_domain_kwargs: Dict, metric_value_kwargs: Dict, metrics: Dict[Tuple, Any], runtime_configuration: Dict, )
SqlAlchemy Median Implementation
SqlAlchemy Median Implementation
def _sqlalchemy( cls, execution_engine: "SqlAlchemyExecutionEngine", metric_domain_kwargs: Dict, metric_value_kwargs: Dict, metrics: Dict[Tuple, Any], runtime_configuration: Dict, ): ( selectable, compute_domain_kwargs, acce...
[ "def", "_sqlalchemy", "(", "cls", ",", "execution_engine", ":", "\"SqlAlchemyExecutionEngine\"", ",", "metric_domain_kwargs", ":", "Dict", ",", "metric_value_kwargs", ":", "Dict", ",", "metrics", ":", "Dict", "[", "Tuple", ",", "Any", "]", ",", "runtime_configurat...
[ 37, 4 ]
[ 87, 28 ]
python
en
['en', 'en', 'en']
True
ColumnMedian._spark
( cls, execution_engine: "SqlAlchemyExecutionEngine", metric_domain_kwargs: Dict, metric_value_kwargs: Dict, metrics: Dict[Tuple, Any], runtime_configuration: Dict, )
Spark Median Implementation
Spark Median Implementation
def _spark( cls, execution_engine: "SqlAlchemyExecutionEngine", metric_domain_kwargs: Dict, metric_value_kwargs: Dict, metrics: Dict[Tuple, Any], runtime_configuration: Dict, ): ( df, compute_domain_kwargs, accessor_domain_k...
[ "def", "_spark", "(", "cls", ",", "execution_engine", ":", "\"SqlAlchemyExecutionEngine\"", ",", "metric_domain_kwargs", ":", "Dict", ",", "metric_value_kwargs", ":", "Dict", ",", "metrics", ":", "Dict", "[", "Tuple", ",", "Any", "]", ",", "runtime_configuration",...
[ 90, 4 ]
[ 120, 30 ]
python
en
['en', 'da', 'en']
True
ColumnMedian._get_evaluation_dependencies
( cls, metric: MetricConfiguration, configuration: Optional[ExpectationConfiguration] = None, execution_engine: Optional[ExecutionEngine] = None, runtime_configuration: Optional[dict] = None, )
This should return a dictionary: { "dependency_name": MetricConfiguration, ... }
This should return a dictionary: { "dependency_name": MetricConfiguration, ... }
def _get_evaluation_dependencies( cls, metric: MetricConfiguration, configuration: Optional[ExpectationConfiguration] = None, execution_engine: Optional[ExecutionEngine] = None, runtime_configuration: Optional[dict] = None, ): """This should return a dictionary: ...
[ "def", "_get_evaluation_dependencies", "(", "cls", ",", "metric", ":", "MetricConfiguration", ",", "configuration", ":", "Optional", "[", "ExpectationConfiguration", "]", "=", "None", ",", "execution_engine", ":", "Optional", "[", "ExecutionEngine", "]", "=", "None"...
[ 123, 4 ]
[ 161, 27 ]
python
en
['en', 'en', 'en']
True
test_incomplete_uncommitted
()
When a project is shared between users, it is common to have an incomplete uncommitted directory present. We should fail gracefully when config variables are missing.
When a project is shared between users, it is common to have an incomplete uncommitted directory present. We should fail gracefully when config variables are missing.
def test_incomplete_uncommitted(): """ When a project is shared between users, it is common to have an incomplete uncommitted directory present. We should fail gracefully when config variables are missing. """ with pytest.raises(InvalidConfigError) as exc: _ = DataContext( fi...
[ "def", "test_incomplete_uncommitted", "(", ")", ":", "with", "pytest", ".", "raises", "(", "InvalidConfigError", ")", "as", "exc", ":", "_", "=", "DataContext", "(", "file_relative_path", "(", "__file__", ",", "\"./fixtures/contexts/incomplete_uncommitted/great_expectat...
[ 7, 0 ]
[ 24, 9 ]
python
en
['en', 'error', 'th']
False
language_callback
(lexer, match)
Parse the content of a $-string using a lexer The lexer is chosen looking for a nearby LANGUAGE.
Parse the content of a $-string using a lexer
def language_callback(lexer, match): """Parse the content of a $-string using a lexer The lexer is chosen looking for a nearby LANGUAGE. """ l = None m = language_re.match(lexer.text[match.end():match.end()+100]) if m is not None: l = lexer._get_lexer(m.group(1)) else: m = l...
[ "def", "language_callback", "(", "lexer", ",", "match", ")", ":", "l", "=", "None", "m", "=", "language_re", ".", "match", "(", "lexer", ".", "text", "[", "match", ".", "end", "(", ")", ":", "match", ".", "end", "(", ")", "+", "100", "]", ")", ...
[ 60, 0 ]
[ 82, 52 ]
python
en
['en', 'en', 'en']
True
wait_for_ready_state_complete
(driver, timeout=settings.EXTREME_TIMEOUT)
The DOM (Document Object Model) has a property called "readyState". When the value of this becomes "complete", page resources are considered fully loaded (although AJAX and other loads might still be happening). This method will wait until document.readyState == "complete".
The DOM (Document Object Model) has a property called "readyState". When the value of this becomes "complete", page resources are considered fully loaded (although AJAX and other loads might still be happening). This method will wait until document.readyState == "complete".
def wait_for_ready_state_complete(driver, timeout=settings.EXTREME_TIMEOUT): """ The DOM (Document Object Model) has a property called "readyState". When the value of this becomes "complete", page resources are considered fully loaded (although AJAX and other loads might still be happening). This me...
[ "def", "wait_for_ready_state_complete", "(", "driver", ",", "timeout", "=", "settings", ".", "EXTREME_TIMEOUT", ")", ":", "start_ms", "=", "time", ".", "time", "(", ")", "*", "1000.0", "stop_ms", "=", "start_ms", "+", "(", "timeout", "*", "1000.0", ")", "f...
[ 15, 0 ]
[ 48, 71 ]
python
en
['en', 'error', 'th']
False
raise_unable_to_load_jquery_exception
(driver)
The most-likely reason for jQuery not loading on web pages.
The most-likely reason for jQuery not loading on web pages.
def raise_unable_to_load_jquery_exception(driver): """ The most-likely reason for jQuery not loading on web pages. """ raise Exception( '''Unable to load jQuery on "%s" due to a possible violation ''' '''of the website's Content Security Policy directive. ''' '''To override this policy, ...
[ "def", "raise_unable_to_load_jquery_exception", "(", "driver", ")", ":", "raise", "Exception", "(", "'''Unable to load jQuery on \"%s\" due to a possible violation '''", "'''of the website's Content Security Policy directive. '''", "'''To override this policy, add \"--disable-csp\" on the '''"...
[ 124, 0 ]
[ 130, 73 ]
python
en
['en', 'en', 'en']
True
activate_jquery
(driver)
If "jQuery is not defined", use this method to activate it for use. This happens because jQuery is not always defined on web sites.
If "jQuery is not defined", use this method to activate it for use. This happens because jQuery is not always defined on web sites.
def activate_jquery(driver): """ If "jQuery is not defined", use this method to activate it for use. This happens because jQuery is not always defined on web sites. """ try: # Let's first find out if jQuery is already defined. driver.execute_script("jQuery('html')") # Since that ...
[ "def", "activate_jquery", "(", "driver", ")", ":", "try", ":", "# Let's first find out if jQuery is already defined.", "driver", ".", "execute_script", "(", "\"jQuery('html')\"", ")", "# Since that command worked, jQuery is defined. Let's return.", "return", "except", "Exception"...
[ 133, 0 ]
[ 158, 49 ]
python
en
['en', 'en', 'en']
True
escape_quotes_if_needed
(string)
re.escape() works differently in Python 3.7.0 than earlier versions: Python 3.6.5: >>> import re >>> re.escape('"') '\\"' Python 3.7.0: >>> import re >>> re.escape('"') '"' SeleniumBase needs quotes to be properly escaped for Javascript calls.
re.escape() works differently in Python 3.7.0 than earlier versions:
def escape_quotes_if_needed(string): """ re.escape() works differently in Python 3.7.0 than earlier versions: Python 3.6.5: >>> import re >>> re.escape('"') '\\"' Python 3.7.0: >>> import re >>> re.escape('"') '"' SeleniumBase needs quotes to be properly escaped for Javasc...
[ "def", "escape_quotes_if_needed", "(", "string", ")", ":", "if", "are_quotes_escaped", "(", "string", ")", ":", "if", "string", ".", "count", "(", "\"'\"", ")", "!=", "string", ".", "count", "(", "\"\\\\'\"", ")", ":", "string", "=", "string", ".", "repl...
[ 168, 0 ]
[ 189, 17 ]
python
en
['en', 'error', 'th']
False
safe_execute_script
(driver, script)
When executing a script that contains a jQuery command, it's important that the jQuery library has been loaded first. This method will load jQuery if it wasn't already loaded.
When executing a script that contains a jQuery command, it's important that the jQuery library has been loaded first. This method will load jQuery if it wasn't already loaded.
def safe_execute_script(driver, script): """ When executing a script that contains a jQuery command, it's important that the jQuery library has been loaded first. This method will load jQuery if it wasn't already loaded. """ try: driver.execute_script(script) except Exception: ...
[ "def", "safe_execute_script", "(", "driver", ",", "script", ")", ":", "try", ":", "driver", ".", "execute_script", "(", "script", ")", "except", "Exception", ":", "# The likely reason this fails is because: \"jQuery is not defined\"", "activate_jquery", "(", "driver", "...
[ 192, 0 ]
[ 201, 37 ]
python
en
['en', 'en', 'en']
True
post_message
(driver, message, msg_dur, style="info")
A helper method to post a message on the screen with Messenger. (Should only be called from post_message() in base_case.py)
A helper method to post a message on the screen with Messenger. (Should only be called from post_message() in base_case.py)
def post_message(driver, message, msg_dur, style="info"): """ A helper method to post a message on the screen with Messenger. (Should only be called from post_message() in base_case.py) """ if not msg_dur: msg_dur = settings.DEFAULT_MESSAGE_DURATION msg_dur = float(msg_dur) message = re....
[ "def", "post_message", "(", "driver", ",", "message", ",", "msg_dur", ",", "style", "=", "\"info\"", ")", ":", "if", "not", "msg_dur", ":", "msg_dur", "=", "settings", ".", "DEFAULT_MESSAGE_DURATION", "msg_dur", "=", "float", "(", "msg_dur", ")", "message", ...
[ 550, 0 ]
[ 574, 51 ]
python
en
['en', 'en', 'en']
True
_jq_format
(code)
DEPRECATED - Use re.escape() instead, which performs the intended action. Use before throwing raw code such as 'div[tab="advanced"]' into jQuery. Selectors with quotes inside of quotes would otherwise break jQuery. If you just want to escape quotes, there's escape_quotes_if_needed(). This is simila...
DEPRECATED - Use re.escape() instead, which performs the intended action. Use before throwing raw code such as 'div[tab="advanced"]' into jQuery. Selectors with quotes inside of quotes would otherwise break jQuery. If you just want to escape quotes, there's escape_quotes_if_needed(). This is simila...
def _jq_format(code): """ DEPRECATED - Use re.escape() instead, which performs the intended action. Use before throwing raw code such as 'div[tab="advanced"]' into jQuery. Selectors with quotes inside of quotes would otherwise break jQuery. If you just want to escape quotes, there's escape_quotes_if...
[ "def", "_jq_format", "(", "code", ")", ":", "code", "=", "code", ".", "replace", "(", "'\\\\'", ",", "'\\\\\\\\'", ")", ".", "replace", "(", "'\\t'", ",", "'\\\\t'", ")", ".", "replace", "(", "'\\n'", ",", "'\\\\n'", ")", "code", "=", "code", ".", ...
[ 735, 0 ]
[ 747, 15 ]
python
en
['en', 'error', 'th']
False
xarray_sortby_coord
(dataset, coord)
Sort an xarray.Dataset by a coordinate. xarray.Dataset.sortby() sometimes fails, so this is an alternative. Credit to https://stackoverflow.com/a/42600594/5449970.
Sort an xarray.Dataset by a coordinate. xarray.Dataset.sortby() sometimes fails, so this is an alternative. Credit to https://stackoverflow.com/a/42600594/5449970.
def xarray_sortby_coord(dataset, coord): """ Sort an xarray.Dataset by a coordinate. xarray.Dataset.sortby() sometimes fails, so this is an alternative. Credit to https://stackoverflow.com/a/42600594/5449970. """ return dataset.loc[{coord:np.sort(dataset.coords[coord].values)}]
[ "def", "xarray_sortby_coord", "(", "dataset", ",", "coord", ")", ":", "return", "dataset", ".", "loc", "[", "{", "coord", ":", "np", ".", "sort", "(", "dataset", ".", "coords", "[", "coord", "]", ".", "values", ")", "}", "]" ]
[ 2, 0 ]
[ 7, 69 ]
python
en
['en', 'error', 'th']
False
parse_requirements
(filename)
Parse a requirements pip file returning the list of required packages. It exclude commented lines and --find-links directives. Args: filename: pip requirements requirements Returns: list of required package with versions constraints
Parse a requirements pip file returning the list of required packages. It exclude commented lines and --find-links directives.
def parse_requirements(filename): """ Parse a requirements pip file returning the list of required packages. It exclude commented lines and --find-links directives. Args: filename: pip requirements requirements Returns: list of required package with versions constraints """ wi...
[ "def", "parse_requirements", "(", "filename", ")", ":", "with", "open", "(", "filename", ")", "as", "file", ":", "parsed_requirements", "=", "file", ".", "read", "(", ")", ".", "splitlines", "(", ")", "parsed_requirements", "=", "[", "line", ".", "strip", ...
[ 5, 0 ]
[ 22, 30 ]
python
en
['en', 'error', 'th']
False
get_dependency_links
(filename)
Parse a requirements pip file looking for the --find-links directive. Args: filename: pip requirements requirements Returns: list of find-links's url
Parse a requirements pip file looking for the --find-links directive. Args: filename: pip requirements requirements
def get_dependency_links(filename): """ Parse a requirements pip file looking for the --find-links directive. Args: filename: pip requirements requirements Returns: list of find-links's url """ with open(filename) as file: parsed_requirements = file.read().splitlines()...
[ "def", "get_dependency_links", "(", "filename", ")", ":", "with", "open", "(", "filename", ")", "as", "file", ":", "parsed_requirements", "=", "file", ".", "read", "(", ")", ".", "splitlines", "(", ")", "dependency_links", "=", "list", "(", ")", "for", "...
[ 25, 0 ]
[ 41, 27 ]
python
en
['en', 'error', 'th']
False
init
(target_directory, view, usage_stats)
Initialize a new Great Expectations project. This guided input walks the user through setting up a new project and also onboards a new developer in an existing project. It scaffolds directories, sets up notebooks, creates a project file, and appends to a `.gitignore` file.
Initialize a new Great Expectations project.
def init(target_directory, view, usage_stats): """ Initialize a new Great Expectations project. This guided input walks the user through setting up a new project and also onboards a new developer in an existing project. It scaffolds directories, sets up notebooks, creates a project file, and a...
[ "def", "init", "(", "target_directory", ",", "view", ",", "usage_stats", ")", ":", "target_directory", "=", "os", ".", "path", ".", "abspath", "(", "target_directory", ")", "ge_dir", "=", "_get_full_path_to_ge_dir", "(", "target_directory", ")", "cli_message", "...
[ 58, 0 ]
[ 191, 19 ]
python
en
['en', 'error', 'th']
False
LinearInversionDirectApp.set_G
(self, N=20, M=100, p=-0.25, q=0.25, j1=1, jn=60)
Parameters ---------- N: # of data M: # of model parameters ...
Parameters ---------- N: # of data M: # of model parameters ...
def set_G(self, N=20, M=100, p=-0.25, q=0.25, j1=1, jn=60): """ Parameters ---------- N: # of data M: # of model parameters ... """ self.N = N self.M = M self._mesh = TensorMesh([M]) jk = np.linspace(j1, jn, N) self._G = np...
[ "def", "set_G", "(", "self", ",", "N", "=", "20", ",", "M", "=", "100", ",", "p", "=", "-", "0.25", ",", "q", "=", "0.25", ",", "j1", "=", "1", ",", "jn", "=", "60", ")", ":", "self", ".", "N", "=", "N", "self", ".", "M", "=", "M", "s...
[ 81, 4 ]
[ 103, 21 ]
python
en
['en', 'error', 'th']
False
MetaSqlAlchemyDataset.column_map_expectation
(cls, func)
For SqlAlchemy, this decorator allows individual column_map_expectations to simply return the filter that describes the expected condition on their data. The decorator will then use that filter to obtain unexpected elements, relevant counts, and return the formatted object.
For SqlAlchemy, this decorator allows individual column_map_expectations to simply return the filter that describes the expected condition on their data.
def column_map_expectation(cls, func): """For SqlAlchemy, this decorator allows individual column_map_expectations to simply return the filter that describes the expected condition on their data. The decorator will then use that filter to obtain unexpected elements, relevant counts, and return ...
[ "def", "column_map_expectation", "(", "cls", ",", "func", ")", ":", "argspec", "=", "inspect", ".", "getfullargspec", "(", "func", ")", "[", "0", "]", "[", "1", ":", "]", "@", "cls", ".", "expectation", "(", "argspec", ")", "@", "wraps", "(", "func",...
[ 169, 4 ]
[ 359, 28 ]
python
en
['en', 'en', 'en']
True
SqlAlchemyDataset.head
(self, n=5)
Returns a *PandasDataset* with the first *n* rows of the given Dataset
Returns a *PandasDataset* with the first *n* rows of the given Dataset
def head(self, n=5): """Returns a *PandasDataset* with the first *n* rows of the given Dataset""" try: df = next( pd.read_sql_table( table_name=self._table.name, schema=self._table.schema, con=self.engine, ...
[ "def", "head", "(", "self", ",", "n", "=", "5", ")", ":", "try", ":", "df", "=", "next", "(", "pd", ".", "read_sql_table", "(", "table_name", "=", "self", ".", "_table", ".", "name", ",", "schema", "=", "self", ".", "_table", ".", "schema", ",", ...
[ 652, 4 ]
[ 701, 9 ]
python
en
['en', 'en', 'en']
True
SqlAlchemyDataset.get_column_hist
(self, column, bins)
return a list of counts corresponding to bins Args: column: the name of the column for which to get the histogram bins: tuple of bin edges for which to get histogram values; *must* be tuple to support caching
return a list of counts corresponding to bins
def get_column_hist(self, column, bins): """return a list of counts corresponding to bins Args: column: the name of the column for which to get the histogram bins: tuple of bin edges for which to get histogram values; *must* be tuple to support caching """ case_c...
[ "def", "get_column_hist", "(", "self", ",", "column", ",", "bins", ")", ":", "case_conditions", "=", "[", "]", "idx", "=", "0", "bins", "=", "list", "(", "bins", ")", "# If we have an infinite lower bound, don't express that in sql", "if", "(", "bins", "[", "0...
[ 1071, 4 ]
[ 1163, 19 ]
python
en
['en', 'en', 'en']
True
SqlAlchemyDataset.create_temporary_table
(self, table_name, custom_sql, schema_name=None)
Create Temporary table based on sql query. This will be used as a basis for executing expectations. WARNING: this feature is new in v0.4. It hasn't been tested in all SQL dialects, and may change based on community feedback. :param custom_sql:
Create Temporary table based on sql query. This will be used as a basis for executing expectations. WARNING: this feature is new in v0.4. It hasn't been tested in all SQL dialects, and may change based on community feedback. :param custom_sql:
def create_temporary_table(self, table_name, custom_sql, schema_name=None): """ Create Temporary table based on sql query. This will be used as a basis for executing expectations. WARNING: this feature is new in v0.4. It hasn't been tested in all SQL dialects, and may change based on com...
[ "def", "create_temporary_table", "(", "self", ",", "table_name", ",", "custom_sql", ",", "schema_name", "=", "None", ")", ":", "###", "# NOTE: 20200310 - The update to support snowflake transient table creation revealed several", "# import cases that are not fully handled.", "# The...
[ 1261, 4 ]
[ 1359, 37 ]
python
en
['en', 'error', 'th']
False
SqlAlchemyDataset.column_reflection_fallback
(self)
If we can't reflect the table, use a query to at least get column names.
If we can't reflect the table, use a query to at least get column names.
def column_reflection_fallback(self): """If we can't reflect the table, use a query to at least get column names.""" col_info_dict_list: List[Dict] if self.sql_engine_dialect.name.lower() == "mssql": type_module = self._get_dialect_type_module() # Get column names and typ...
[ "def", "column_reflection_fallback", "(", "self", ")", ":", "col_info_dict_list", ":", "List", "[", "Dict", "]", "if", "self", ".", "sql_engine_dialect", ".", "name", ".", "lower", "(", ")", "==", "\"mssql\"", ":", "type_module", "=", "self", ".", "_get_dial...
[ 1361, 4 ]
[ 1391, 33 ]
python
en
['en', 'en', 'en']
True
SqlAlchemyDataset.expect_table_row_count_to_equal_other_table
( self, other_table_name, result_format=None, include_config=True, catch_exceptions=None, meta=None, )
Expect the number of rows in this table to equal the number of rows in a different table. expect_table_row_count_to_equal is a :func:`expectation \ <great_expectations.data_asset.data_asset.DataAsset.expectation>`, not a ``column_map_expectation`` or ``column_aggregate_expectation``. A...
Expect the number of rows in this table to equal the number of rows in a different table.
def expect_table_row_count_to_equal_other_table( self, other_table_name, result_format=None, include_config=True, catch_exceptions=None, meta=None, ): """Expect the number of rows in this table to equal the number of rows in a different table. expect_...
[ "def", "expect_table_row_count_to_equal_other_table", "(", "self", ",", "other_table_name", ",", "result_format", "=", "None", ",", "include_config", "=", "True", ",", "catch_exceptions", "=", "None", ",", "meta", "=", "None", ",", ")", ":", "row_count", "=", "s...
[ 1406, 4 ]
[ 1458, 9 ]
python
en
['en', 'en', 'en']
True
test_notebook_execution_with_pandas_backend
( titanic_v013_multi_datasource_pandas_data_context_with_checkpoints_v1_with_empty_store_stats_enabled, )
To set this test up we: - create a suite using profiling - verify that no validations have happened - create the suite edit notebook by hijacking the private cli method We then: - execute that notebook (Note this will raise various errors like CellExecutionError if any cell in the noteboo...
To set this test up we:
def test_notebook_execution_with_pandas_backend( titanic_v013_multi_datasource_pandas_data_context_with_checkpoints_v1_with_empty_store_stats_enabled, ): """ To set this test up we: - create a suite using profiling - verify that no validations have happened - create the suite edit notebook by h...
[ "def", "test_notebook_execution_with_pandas_backend", "(", "titanic_v013_multi_datasource_pandas_data_context_with_checkpoints_v1_with_empty_store_stats_enabled", ",", ")", ":", "context", ":", "DataContext", "=", "titanic_v013_multi_datasource_pandas_data_context_with_checkpoints_v1_with_empt...
[ 16, 0 ]
[ 210, 59 ]
python
en
['en', 'error', 'th']
False
NumericMetricRangeMultiBatchParameterBuilder.__init__
( self, parameter_name: str, metric_name: str, metric_domain_kwargs: Optional[Union[str, dict]] = None, metric_value_kwargs: Optional[Union[str, dict]] = None, sampling_method: Optional[str] = "bootstrap", enforce_numeric_metric: Optional[Union[str, bool]] = True,...
Args: parameter_name: the name of this parameter -- this is user-specified parameter name (from configuration); it is not the fully-qualified parameter name; a fully-qualified parameter name must start with "$parameter." and may contain one or more subsequent parts (e.g., "$...
Args: parameter_name: the name of this parameter -- this is user-specified parameter name (from configuration); it is not the fully-qualified parameter name; a fully-qualified parameter name must start with "$parameter." and may contain one or more subsequent parts (e.g., "$...
def __init__( self, parameter_name: str, metric_name: str, metric_domain_kwargs: Optional[Union[str, dict]] = None, metric_value_kwargs: Optional[Union[str, dict]] = None, sampling_method: Optional[str] = "bootstrap", enforce_numeric_metric: Optional[Union[str, bo...
[ "def", "__init__", "(", "self", ",", "parameter_name", ":", "str", ",", "metric_name", ":", "str", ",", "metric_domain_kwargs", ":", "Optional", "[", "Union", "[", "str", ",", "dict", "]", "]", "=", "None", ",", "metric_value_kwargs", ":", "Optional", "[",...
[ 52, 4 ]
[ 131, 47 ]
python
en
['en', 'error', 'th']
False
NumericMetricRangeMultiBatchParameterBuilder._build_parameters
( self, parameter_container: ParameterContainer, domain: Domain, *, variables: Optional[ParameterContainer] = None, parameters: Optional[Dict[str, ParameterContainer]] = None, )
Builds ParameterContainer object that holds ParameterNode objects with attribute name-value pairs and optional details. :return: ParameterContainer object that holds ParameterNode objects with attribute name-value pairs and optional details The algorithm operates according to the following...
Builds ParameterContainer object that holds ParameterNode objects with attribute name-value pairs and optional details.
def _build_parameters( self, parameter_container: ParameterContainer, domain: Domain, *, variables: Optional[ParameterContainer] = None, parameters: Optional[Dict[str, ParameterContainer]] = None, ): """ Builds ParameterContainer object that holds Par...
[ "def", "_build_parameters", "(", "self", ",", "parameter_container", ":", "ParameterContainer", ",", "domain", ":", "Domain", ",", "*", ",", "variables", ":", "Optional", "[", "ParameterContainer", "]", "=", "None", ",", "parameters", ":", "Optional", "[", "Di...
[ 133, 4 ]
[ 299, 9 ]
python
en
['en', 'error', 'th']
False
UpdateOwnProfile.has_object_permission
(self, request, view, obj)
Check user is trying to edit their own profile.
Check user is trying to edit their own profile.
def has_object_permission(self, request, view, obj): """Check user is trying to edit their own profile.""" if request.method in permissions.SAFE_METHODS: return True return obj.id == request.user.id
[ "def", "has_object_permission", "(", "self", ",", "request", ",", "view", ",", "obj", ")", ":", "if", "request", ".", "method", "in", "permissions", ".", "SAFE_METHODS", ":", "return", "True", "return", "obj", ".", "id", "==", "request", ".", "user", "."...
[ 6, 4 ]
[ 12, 40 ]
python
en
['en', 'en', 'en']
True
SqlAlchemyBatchData.__init__
( self, execution_engine, record_set_name: str = None, # Option 1 schema_name: str = None, table_name: str = None, # Option 2 query: str = None, # Option 3 selectable=None, create_temp_table: bool = True, temp_table_name: st...
A Constructor used to initialize and SqlAlchemy Batch, create an id for it, and verify that all necessary parameters have been provided. If a Query is given, also builds a temporary table for this query Args: engine (SqlAlchemy Engine): \ A SqlAlchemy Engine or c...
A Constructor used to initialize and SqlAlchemy Batch, create an id for it, and verify that all necessary parameters have been provided. If a Query is given, also builds a temporary table for this query
def __init__( self, execution_engine, record_set_name: str = None, # Option 1 schema_name: str = None, table_name: str = None, # Option 2 query: str = None, # Option 3 selectable=None, create_temp_table: bool = True, temp_ta...
[ "def", "__init__", "(", "self", ",", "execution_engine", ",", "record_set_name", ":", "str", "=", "None", ",", "# Option 1", "schema_name", ":", "str", "=", "None", ",", "table_name", ":", "str", "=", "None", ",", "# Option 2", "query", ":", "str", "=", ...
[ 22, 4 ]
[ 166, 74 ]
python
en
['en', 'en', 'en']
True
SqlAlchemyBatchData.sql_engine_dialect
(self)
Returns the Batches' current engine dialect
Returns the Batches' current engine dialect
def sql_engine_dialect(self) -> DefaultDialect: """Returns the Batches' current engine dialect""" return self._engine.dialect
[ "def", "sql_engine_dialect", "(", "self", ")", "->", "DefaultDialect", ":", "return", "self", ".", "_engine", ".", "dialect" ]
[ 169, 4 ]
[ 171, 35 ]
python
en
['en', 'en', 'en']
True
SqlAlchemyBatchData._create_temporary_table
( self, temp_table_name, query, temp_table_schema_name=None )
Create Temporary table based on sql query. This will be used as a basis for executing expectations. :param query:
Create Temporary table based on sql query. This will be used as a basis for executing expectations. :param query:
def _create_temporary_table( self, temp_table_name, query, temp_table_schema_name=None ): """ Create Temporary table based on sql query. This will be used as a basis for executing expectations. :param query: """ if self.sql_engine_dialect.name.lower() == "bigquery": ...
[ "def", "_create_temporary_table", "(", "self", ",", "temp_table_name", ",", "query", ",", "temp_table_schema_name", "=", "None", ")", ":", "if", "self", ".", "sql_engine_dialect", ".", "name", ".", "lower", "(", ")", "==", "\"bigquery\"", ":", "stmt", "=", "...
[ 193, 4 ]
[ 256, 38 ]
python
en
['en', 'error', 'th']
False
load_xml_generator_configuration
(configuration, **defaults)
Loads CastXML or GCC-XML configuration. Args: configuration (string|configparser.ConfigParser): can be a string (file path to a configuration file) or instance of :class:`configparser.ConfigParser`. defaults: can be used to override single configuration values. ...
Loads CastXML or GCC-XML configuration.
def load_xml_generator_configuration(configuration, **defaults): """ Loads CastXML or GCC-XML configuration. Args: configuration (string|configparser.ConfigParser): can be a string (file path to a configuration file) or instance of :class:`configparser.ConfigParser`. ...
[ "def", "load_xml_generator_configuration", "(", "configuration", ",", "*", "*", "defaults", ")", ":", "parser", "=", "configuration", "if", "utils", ".", "is_str", "(", "configuration", ")", ":", "parser", "=", "ConfigParser", "(", ")", "parser", ".", "read", ...
[ 332, 0 ]
[ 409, 14 ]
python
en
['en', 'error', 'th']
False
create_compiler_path
(xml_generator, compiler_path)
Try to guess a path for the compiler. If you want ot use a specific compiler, please provide the compiler path manually, as the guess may not be what you are expecting. Providing the path can be done by passing it as an argument (compiler_path) to the xml_generator_configuration_t() or by defining...
Try to guess a path for the compiler.
def create_compiler_path(xml_generator, compiler_path): """ Try to guess a path for the compiler. If you want ot use a specific compiler, please provide the compiler path manually, as the guess may not be what you are expecting. Providing the path can be done by passing it as an argument (compiler_...
[ "def", "create_compiler_path", "(", "xml_generator", ",", "compiler_path", ")", ":", "if", "xml_generator", "==", "'castxml'", "and", "compiler_path", "is", "None", ":", "if", "platform", ".", "system", "(", ")", "==", "'Windows'", ":", "# Look for msvc", "p", ...
[ 412, 0 ]
[ 470, 24 ]
python
en
['en', 'error', 'th']
False
parser_configuration_t.include_paths
(self)
list of include paths to look for header files
list of include paths to look for header files
def include_paths(self): """list of include paths to look for header files""" return self.__include_paths
[ "def", "include_paths", "(", "self", ")", ":", "return", "self", ".", "__include_paths" ]
[ 102, 4 ]
[ 104, 35 ]
python
en
['en', 'en', 'en']
True
parser_configuration_t.define_symbols
(self)
list of "define" directives
list of "define" directives
def define_symbols(self): """list of "define" directives """ return self.__define_symbols
[ "def", "define_symbols", "(", "self", ")", ":", "return", "self", ".", "__define_symbols" ]
[ 107, 4 ]
[ 109, 36 ]
python
en
['en', 'en', 'en']
True
parser_configuration_t.undefine_symbols
(self)
list of "undefine" directives
list of "undefine" directives
def undefine_symbols(self): """list of "undefine" directives """ return self.__undefine_symbols
[ "def", "undefine_symbols", "(", "self", ")", ":", "return", "self", ".", "__undefine_symbols" ]
[ 112, 4 ]
[ 114, 38 ]
python
de
['en', 'de', 'ur']
False
parser_configuration_t.compiler
(self)
get compiler name to simulate
get compiler name to simulate
def compiler(self): """get compiler name to simulate""" return self.__compiler
[ "def", "compiler", "(", "self", ")", ":", "return", "self", ".", "__compiler" ]
[ 117, 4 ]
[ 119, 30 ]
python
en
['en', 'en', 'en']
True
parser_configuration_t.compiler
(self, compiler)
set compiler name to simulate
set compiler name to simulate
def compiler(self, compiler): """set compiler name to simulate""" self.__compiler = compiler
[ "def", "compiler", "(", "self", ",", "compiler", ")", ":", "self", ".", "__compiler", "=", "compiler" ]
[ 122, 4 ]
[ 124, 34 ]
python
en
['en', 'en', 'en']
True
parser_configuration_t.xml_generator
(self)
get xml_generator (gccxml or castxml)
get xml_generator (gccxml or castxml)
def xml_generator(self): """get xml_generator (gccxml or castxml)""" return self.__xml_generator
[ "def", "xml_generator", "(", "self", ")", ":", "return", "self", ".", "__xml_generator" ]
[ 127, 4 ]
[ 129, 35 ]
python
en
['en', 'la', 'en']
True
parser_configuration_t.xml_generator
(self, xml_generator)
set xml_generator (gccxml or castxml)
set xml_generator (gccxml or castxml)
def xml_generator(self, xml_generator): """set xml_generator (gccxml or castxml)""" if "real" in xml_generator: # Support for gccxml.real from newer gccxml package # Can be removed once gccxml support is dropped. xml_generator = "gccxml" self.__xml_generator =...
[ "def", "xml_generator", "(", "self", ",", "xml_generator", ")", ":", "if", "\"real\"", "in", "xml_generator", ":", "# Support for gccxml.real from newer gccxml package", "# Can be removed once gccxml support is dropped.", "xml_generator", "=", "\"gccxml\"", "self", ".", "__xm...
[ 132, 4 ]
[ 138, 44 ]
python
en
['en', 'la', 'en']
True
parser_configuration_t.castxml_epic_version
(self)
File format version used by castxml.
File format version used by castxml.
def castxml_epic_version(self): """ File format version used by castxml. """ return self.__castxml_epic_version
[ "def", "castxml_epic_version", "(", "self", ")", ":", "return", "self", ".", "__castxml_epic_version" ]
[ 141, 4 ]
[ 145, 42 ]
python
en
['en', 'error', 'th']
False
parser_configuration_t.castxml_epic_version
(self, castxml_epic_version)
File format version used by castxml.
File format version used by castxml.
def castxml_epic_version(self, castxml_epic_version): """ File format version used by castxml. """ self.__castxml_epic_version = castxml_epic_version
[ "def", "castxml_epic_version", "(", "self", ",", "castxml_epic_version", ")", ":", "self", ".", "__castxml_epic_version", "=", "castxml_epic_version" ]
[ 148, 4 ]
[ 152, 58 ]
python
en
['en', 'error', 'th']
False
parser_configuration_t.keep_xml
(self)
Are xml files kept after errors.
Are xml files kept after errors.
def keep_xml(self): """Are xml files kept after errors.""" return self.__keep_xml
[ "def", "keep_xml", "(", "self", ")", ":", "return", "self", ".", "__keep_xml" ]
[ 155, 4 ]
[ 157, 30 ]
python
en
['da', 'en', 'en']
True
parser_configuration_t.keep_xml
(self, keep_xml)
Set if xml files kept after errors.
Set if xml files kept after errors.
def keep_xml(self, keep_xml): """Set if xml files kept after errors.""" self.__keep_xml = keep_xml
[ "def", "keep_xml", "(", "self", ",", "keep_xml", ")", ":", "self", ".", "__keep_xml", "=", "keep_xml" ]
[ 160, 4 ]
[ 162, 34 ]
python
en
['da', 'en', 'en']
True
parser_configuration_t.flags
(self)
Optional flags for pygccxml.
Optional flags for pygccxml.
def flags(self): """Optional flags for pygccxml.""" return self.__flags
[ "def", "flags", "(", "self", ")", ":", "return", "self", ".", "__flags" ]
[ 165, 4 ]
[ 167, 27 ]
python
en
['en', 'en', 'en']
True
parser_configuration_t.flags
(self, flags)
Optional flags for pygccxml.
Optional flags for pygccxml.
def flags(self, flags): """Optional flags for pygccxml.""" if flags is None: flags = [] self.__flags = flags
[ "def", "flags", "(", "self", ",", "flags", ")", ":", "if", "flags", "is", "None", ":", "flags", "=", "[", "]", "self", ".", "__flags", "=", "flags" ]
[ 170, 4 ]
[ 174, 28 ]
python
en
['en', 'en', 'en']
True
parser_configuration_t.compiler_path
(self)
Get the path for the compiler.
Get the path for the compiler.
def compiler_path(self): """Get the path for the compiler.""" return self.__compiler_path
[ "def", "compiler_path", "(", "self", ")", ":", "return", "self", ".", "__compiler_path" ]
[ 177, 4 ]
[ 179, 35 ]
python
en
['en', 'en', 'en']
True
parser_configuration_t.compiler_path
(self, compiler_path)
Set the path for the compiler.
Set the path for the compiler.
def compiler_path(self, compiler_path): """Set the path for the compiler.""" self.__compiler_path = compiler_path
[ "def", "compiler_path", "(", "self", ",", "compiler_path", ")", ":", "self", ".", "__compiler_path", "=", "compiler_path" ]
[ 182, 4 ]
[ 184, 44 ]
python
en
['en', 'en', 'en']
True
parser_configuration_t.cflags
(self)
additional flags to pass to compiler
additional flags to pass to compiler
def cflags(self): """additional flags to pass to compiler""" return self.__cflags
[ "def", "cflags", "(", "self", ")", ":", "return", "self", ".", "__cflags" ]
[ 187, 4 ]
[ 189, 28 ]
python
en
['en', 'en', 'en']
True
parser_configuration_t.raise_on_wrong_settings
(self)
Validates the configuration settings and raises RuntimeError on error
Validates the configuration settings and raises RuntimeError on error
def raise_on_wrong_settings(self): """ Validates the configuration settings and raises RuntimeError on error """ self.__ensure_dir_exists(self.working_directory, 'working directory') for idir in self.include_paths: self.__ensure_dir_exists(idir, 'include directory') ...
[ "def", "raise_on_wrong_settings", "(", "self", ")", ":", "self", ".", "__ensure_dir_exists", "(", "self", ".", "working_directory", ",", "'working directory'", ")", "for", "idir", "in", "self", ".", "include_paths", ":", "self", ".", "__ensure_dir_exists", "(", ...
[ 209, 4 ]
[ 219, 35 ]
python
en
['en', 'error', 'th']
False
xml_generator_configuration_t.xml_generator_path
(self)
XML generator binary location
XML generator binary location
def xml_generator_path(self): """ XML generator binary location """ return self.__xml_generator_path
[ "def", "xml_generator_path", "(", "self", ")", ":", "return", "self", ".", "__xml_generator_path" ]
[ 279, 4 ]
[ 285, 40 ]
python
en
['en', 'error', 'th']
False
xml_generator_configuration_t.xml_generator_from_xml_file
(self)
Configuration object containing information about the xml generator read from the xml file. Returns: utils.xml_generators: configuration object
Configuration object containing information about the xml generator read from the xml file.
def xml_generator_from_xml_file(self): """ Configuration object containing information about the xml generator read from the xml file. Returns: utils.xml_generators: configuration object """ return self.__xml_generator_from_xml_file
[ "def", "xml_generator_from_xml_file", "(", "self", ")", ":", "return", "self", ".", "__xml_generator_from_xml_file" ]
[ 292, 4 ]
[ 300, 49 ]
python
en
['en', 'error', 'th']
False
xml_generator_configuration_t.start_with_declarations
(self)
list of declarations gccxml should start with, when it dumps declaration tree
list of declarations gccxml should start with, when it dumps declaration tree
def start_with_declarations(self): """list of declarations gccxml should start with, when it dumps declaration tree""" return self.__start_with_declarations
[ "def", "start_with_declarations", "(", "self", ")", ":", "return", "self", ".", "__start_with_declarations" ]
[ 307, 4 ]
[ 310, 45 ]
python
en
['en', 'fr', 'en']
True
xml_generator_configuration_t.ignore_gccxml_output
(self)
set this property to True, if you want pygccxml to ignore any error warning that comes from gccxml
set this property to True, if you want pygccxml to ignore any error warning that comes from gccxml
def ignore_gccxml_output(self): """set this property to True, if you want pygccxml to ignore any error warning that comes from gccxml""" return self.__ignore_gccxml_output
[ "def", "ignore_gccxml_output", "(", "self", ")", ":", "return", "self", ".", "__ignore_gccxml_output" ]
[ 313, 4 ]
[ 316, 42 ]
python
en
['en', 'en', 'en']
True
User.password
(self, value)
设置属性 user.passord = "xxxxx" :param value: 设置属性时的数据 value就是"xxxxx", 原始的明文密码 :return:
设置属性 user.passord = "xxxxx" :param value: 设置属性时的数据 value就是"xxxxx", 原始的明文密码 :return:
def password(self, value): """ 设置属性 user.passord = "xxxxx" :param value: 设置属性时的数据 value就是"xxxxx", 原始的明文密码 :return: """ self.password_hash = generate_password_hash(value)
[ "def", "password", "(", "self", ",", "value", ")", ":", "self", ".", "password_hash", "=", "generate_password_hash", "(", "value", ")" ]
[ 55, 4 ]
[ 61, 58 ]
python
en
['en', 'error', 'th']
False
User.check_password
(self, passwd)
检验密码的正确性 :param passwd: 用户登录时填写的原始密码 :return: 如果正确,返回True, 否则返回False
检验密码的正确性 :param passwd: 用户登录时填写的原始密码 :return: 如果正确,返回True, 否则返回False
def check_password(self, passwd): """ 检验密码的正确性 :param passwd: 用户登录时填写的原始密码 :return: 如果正确,返回True, 否则返回False """ return check_password_hash(self.password_hash, passwd)
[ "def", "check_password", "(", "self", ",", "passwd", ")", ":", "return", "check_password_hash", "(", "self", ".", "password_hash", ",", "passwd", ")" ]
[ 67, 4 ]
[ 73, 62 ]
python
en
['en', 'error', 'th']
False
User.auth_to_dict
(self)
将实名信息转换为字典数据
将实名信息转换为字典数据
def auth_to_dict(self): """将实名信息转换为字典数据""" auth_dict = { "user_id": self.id, "real_name": self.real_name, } return auth_dict
[ "def", "auth_to_dict", "(", "self", ")", ":", "auth_dict", "=", "{", "\"user_id\"", ":", "self", ".", "id", ",", "\"real_name\"", ":", "self", ".", "real_name", ",", "}", "return", "auth_dict" ]
[ 85, 4 ]
[ 91, 24 ]
python
zh
['zh', 'zh', 'zh']
False