id
stringlengths
1
8
text
stringlengths
6
1.05M
dataset_id
stringclasses
1 value
/boot-synth-1.2.0.tar.gz/boot-synth-1.2.0/synth/projects_master/nginx_router/frontend/react/node_modules/p-limit/readme.md
# p-limit [![Build Status](https://travis-ci.org/sindresorhus/p-limit.svg?branch=master)](https://travis-ci.org/sindresorhus/p-limit) > Run multiple promise-returning & async functions with limited concurrency ## Install ``` $ npm install p-limit ``` ## Usage ```js const pLimit = require('p-limit'); const limit = pLimit(1); const input = [ limit(() => fetchSomething('foo')), limit(() => fetchSomething('bar')), limit(() => doSomething()) ]; (async () => { // Only one promise is run at once const result = await Promise.all(input); console.log(result); })(); ``` ## API ### pLimit(concurrency) Returns a `limit` function. #### concurrency Type: `number`<br> Minimum: `1`<br> Default: `Infinity` Concurrency limit. ### limit(fn, ...args) Returns the promise returned by calling `fn(...args)`. #### fn Type: `Function` Promise-returning/async function. #### args Any arguments to pass through to `fn`. Support for passing arguments on to the `fn` is provided in order to be able to avoid creating unnecessary closures. You probably don't need this optimization unless you're pushing a *lot* of functions. ### limit.activeCount The number of promises that are currently running. ### limit.pendingCount The number of promises that are waiting to run (i.e. their internal `fn` was not called yet). ## FAQ ### How is this different from the [`p-queue`](https://github.com/sindresorhus/p-queue) package? This package is only about limiting the number of concurrent executions, while `p-queue` is a fully featured queue implementation with lots of different options, introspection, and ability to pause and clear the queue. ## Related - [p-queue](https://github.com/sindresorhus/p-queue) - Promise queue with concurrency control - [p-throttle](https://github.com/sindresorhus/p-throttle) - Throttle promise-returning & async functions - [p-debounce](https://github.com/sindresorhus/p-debounce) - Debounce promise-returning & async functions - [p-all](https://github.com/sindresorhus/p-all) - Run promise-returning & async functions concurrently with optional limited concurrency - [More…](https://github.com/sindresorhus/promise-fun) --- <div align="center"> <b> <a href="https://tidelift.com/subscription/pkg/npm-p-limit?utm_source=npm-p-limit&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a> </b> <br> <sub> Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies. </sub> </div>
PypiClean
/django_bazaar_of_wonders-0.1.40-py3-none-any.whl/main/models.py
from datetime import datetime from django.db import models from django.urls import reverse from django.contrib.auth.models import User class Card_Rarity(models.Model): card_rarity = models.CharField(max_length=200, unique=True) # def __str__(self): # return self.card_rarity class Card_Type(models.Model): card_type = models.CharField(max_length=200, unique=True) # def __str__(self): # return self.card_type class Card(models.Model): # Primary Key product_id = models.CharField(max_length=200,primary_key=True) scryfall_id = models.CharField(max_length=200, null=True) mtg_json_uuid = models.CharField(max_length=200) name = models.CharField(max_length=200) card_image_loc = models.CharField(max_length=800) mana_cost = models.CharField(max_length=200) converted_mana_cost = models.IntegerField() type_id = models.ForeignKey('Card_Type', on_delete=models.CASCADE) card_text = models.CharField(max_length=4000) card_color = models.CharField(max_length=200, default='N/A') card_keywords = models.CharField(max_length=200) set_name = models.CharField(max_length=200) power = models.IntegerField() toughness = models.IntegerField() collection_number = models.IntegerField() rarity_id = models.ForeignKey('Card_Rarity', on_delete=models.CASCADE) flavor_text = models.CharField(max_length=4000) artist = models.CharField(max_length=200) card_market_purchase_url = models.CharField(max_length=2000, default="https://www.cardmarket.com/en") tcg_player_purchase_url = models.CharField(max_length=2000, default="https://www.tcgplayer.com/") mtg_stocks_purchase_url = models.CharField(max_length=2000, default="https://www.mtgstocks.com/news") last_updated = models.CharField(max_length=200, default=datetime.isoformat(datetime.now())) # def __str__(self): # return self.name def save(self, *args, **kwargs): rarity, _ = Card_Rarity.objects.get_or_create(card_rarity = self.card_rarity) # pylint: disable=maybe-no-member self.rarity = rarity type, _ = Card_Type.objects.get_or_create(card_type = self.card_type) # pylint: disable=maybe-no-member self.type = type super(Card, self).save(*args, **kwargs) def get_absolute_url(self): """Returns the url to access a particular author instance.""" return reverse('main:card_view', args=[str(self.product_id)]) class Seller(models.Model): seller_user = models.OneToOneField(User, on_delete=models.CASCADE, blank=True, null=True) seller_key = models.CharField(max_length=200, primary_key=True) seller_name = models.CharField(max_length=200) seller_type = models.CharField(max_length=200) location = models.CharField(max_length=200, blank=True, null=True) completed_sales = models.BigIntegerField(default=0) class Bazaar_User(models.Model): auth_user_id = models.OneToOneField(User, on_delete=models.CASCADE) location = models.CharField(max_length=200, blank=True, null=True) completed_sales = models.BigIntegerField(default=0) class Listing(models.Model): product_id = models.ForeignKey('Card', on_delete=models.CASCADE) product_name = models.CharField(max_length=200) product_line = models.CharField(max_length=50) set_name = models.CharField(max_length=200) price = models.DecimalField(max_digits=9, decimal_places=2) quantity = models.IntegerField() condition = models.CharField(max_length=200) seller_key = models.ForeignKey('Seller', on_delete=models.CASCADE) sponsored = models.BooleanField() user_listing = models.BooleanField() last_updated = models.CharField(max_length=200, default=datetime.isoformat(datetime.now())) # def __str__(self): # return self.product_name class Notification(models.Model): auth_user_id = models.ForeignKey(User, on_delete=models.CASCADE) card_id = models.ForeignKey('Card', on_delete=models.CASCADE) price_threshold = models.DecimalField(max_digits=9, decimal_places=2) less_than_flag = models.BooleanField(default=True) greater_than_flag = models.BooleanField(default=False) equal_flag = models.BooleanField(default=False) # seller_key = models.ForeignKey('Seller', on_delete=models.CASCADE) class Meta: unique_together = (("auth_user_id", "card_id", "price_threshold"),) class Collection(models.Model): owning_auth_user_id = models.IntegerField() # Researching how to properly do an FK on a table not represented by a model (auth_user) collection_name = models.CharField(max_length=200) class Collection_Content(models.Model): collection_id = models.ForeignKey('Collection', on_delete=models.CASCADE) card_id = models.ForeignKey('Card', on_delete=models.CASCADE) obtained = models.BooleanField() class User_Preferences(models.Model): user_id = models.OneToOneField(User, on_delete=models.CASCADE) email_notif = models.BooleanField(default=True) subscribe_email = models.BooleanField(default=False) view_email = models.BooleanField(default=True)
PypiClean
/pulumi_kubernetes-4.2.0a1693403901-py3-none-any.whl/pulumi_kubernetes/flowcontrol/v1alpha1/FlowSchemaPatch.py
import copy import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from ... import _utilities from . import outputs from ... import meta as _meta from ._inputs import * __all__ = ['FlowSchemaPatchArgs', 'FlowSchemaPatch'] @pulumi.input_type class FlowSchemaPatchArgs: def __init__(__self__, *, api_version: Optional[pulumi.Input[str]] = None, kind: Optional[pulumi.Input[str]] = None, metadata: Optional[pulumi.Input['_meta.v1.ObjectMetaPatchArgs']] = None, spec: Optional[pulumi.Input['FlowSchemaSpecPatchArgs']] = None): """ The set of arguments for constructing a FlowSchemaPatch resource. :param pulumi.Input[str] api_version: APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources :param pulumi.Input[str] kind: Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds :param pulumi.Input['_meta.v1.ObjectMetaPatchArgs'] metadata: `metadata` is the standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata :param pulumi.Input['FlowSchemaSpecPatchArgs'] spec: `spec` is the specification of the desired behavior of a FlowSchema. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status """ if api_version is not None: pulumi.set(__self__, "api_version", 'flowcontrol.apiserver.k8s.io/v1alpha1') if kind is not None: pulumi.set(__self__, "kind", 'FlowSchema') if metadata is not None: pulumi.set(__self__, "metadata", metadata) if spec is not None: pulumi.set(__self__, "spec", spec) @property @pulumi.getter(name="apiVersion") def api_version(self) -> Optional[pulumi.Input[str]]: """ APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources """ return pulumi.get(self, "api_version") @api_version.setter def api_version(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "api_version", value) @property @pulumi.getter def kind(self) -> Optional[pulumi.Input[str]]: """ Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds """ return pulumi.get(self, "kind") @kind.setter def kind(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "kind", value) @property @pulumi.getter def metadata(self) -> Optional[pulumi.Input['_meta.v1.ObjectMetaPatchArgs']]: """ `metadata` is the standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata """ return pulumi.get(self, "metadata") @metadata.setter def metadata(self, value: Optional[pulumi.Input['_meta.v1.ObjectMetaPatchArgs']]): pulumi.set(self, "metadata", value) @property @pulumi.getter def spec(self) -> Optional[pulumi.Input['FlowSchemaSpecPatchArgs']]: """ `spec` is the specification of the desired behavior of a FlowSchema. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status """ return pulumi.get(self, "spec") @spec.setter def spec(self, value: Optional[pulumi.Input['FlowSchemaSpecPatchArgs']]): pulumi.set(self, "spec", value) class FlowSchemaPatch(pulumi.CustomResource): @overload def __init__(__self__, resource_name: str, opts: Optional[pulumi.ResourceOptions] = None, api_version: Optional[pulumi.Input[str]] = None, kind: Optional[pulumi.Input[str]] = None, metadata: Optional[pulumi.Input[pulumi.InputType['_meta.v1.ObjectMetaPatchArgs']]] = None, spec: Optional[pulumi.Input[pulumi.InputType['FlowSchemaSpecPatchArgs']]] = None, __props__=None): """ Patch resources are used to modify existing Kubernetes resources by using Server-Side Apply updates. The name of the resource must be specified, but all other properties are optional. More than one patch may be applied to the same resource, and a random FieldManager name will be used for each Patch resource. Conflicts will result in an error by default, but can be forced using the "pulumi.com/patchForce" annotation. See the [Server-Side Apply Docs](https://www.pulumi.com/registry/packages/kubernetes/how-to-guides/managing-resources-with-server-side-apply/) for additional information about using Server-Side Apply to manage Kubernetes resources with Pulumi. FlowSchema defines the schema of a group of flows. Note that a flow is made up of a set of inbound API requests with similar attributes and is identified by a pair of strings: the name of the FlowSchema and a "flow distinguisher". :param str resource_name: The name of the resource. :param pulumi.ResourceOptions opts: Options for the resource. :param pulumi.Input[str] api_version: APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources :param pulumi.Input[str] kind: Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds :param pulumi.Input[pulumi.InputType['_meta.v1.ObjectMetaPatchArgs']] metadata: `metadata` is the standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata :param pulumi.Input[pulumi.InputType['FlowSchemaSpecPatchArgs']] spec: `spec` is the specification of the desired behavior of a FlowSchema. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status """ ... @overload def __init__(__self__, resource_name: str, args: Optional[FlowSchemaPatchArgs] = None, opts: Optional[pulumi.ResourceOptions] = None): """ Patch resources are used to modify existing Kubernetes resources by using Server-Side Apply updates. The name of the resource must be specified, but all other properties are optional. More than one patch may be applied to the same resource, and a random FieldManager name will be used for each Patch resource. Conflicts will result in an error by default, but can be forced using the "pulumi.com/patchForce" annotation. See the [Server-Side Apply Docs](https://www.pulumi.com/registry/packages/kubernetes/how-to-guides/managing-resources-with-server-side-apply/) for additional information about using Server-Side Apply to manage Kubernetes resources with Pulumi. FlowSchema defines the schema of a group of flows. Note that a flow is made up of a set of inbound API requests with similar attributes and is identified by a pair of strings: the name of the FlowSchema and a "flow distinguisher". :param str resource_name: The name of the resource. :param FlowSchemaPatchArgs args: The arguments to use to populate this resource's properties. :param pulumi.ResourceOptions opts: Options for the resource. """ ... def __init__(__self__, resource_name: str, *args, **kwargs): resource_args, opts = _utilities.get_resource_args_opts(FlowSchemaPatchArgs, pulumi.ResourceOptions, *args, **kwargs) if resource_args is not None: __self__._internal_init(resource_name, opts, **resource_args.__dict__) else: __self__._internal_init(resource_name, *args, **kwargs) def _internal_init(__self__, resource_name: str, opts: Optional[pulumi.ResourceOptions] = None, api_version: Optional[pulumi.Input[str]] = None, kind: Optional[pulumi.Input[str]] = None, metadata: Optional[pulumi.Input[pulumi.InputType['_meta.v1.ObjectMetaPatchArgs']]] = None, spec: Optional[pulumi.Input[pulumi.InputType['FlowSchemaSpecPatchArgs']]] = None, __props__=None): opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts) if not isinstance(opts, pulumi.ResourceOptions): raise TypeError('Expected resource options to be a ResourceOptions instance') if opts.id is None: if __props__ is not None: raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') __props__ = FlowSchemaPatchArgs.__new__(FlowSchemaPatchArgs) __props__.__dict__["api_version"] = 'flowcontrol.apiserver.k8s.io/v1alpha1' __props__.__dict__["kind"] = 'FlowSchema' __props__.__dict__["metadata"] = metadata __props__.__dict__["spec"] = spec __props__.__dict__["status"] = None alias_opts = pulumi.ResourceOptions(aliases=[pulumi.Alias(type_="kubernetes:flowcontrol.apiserver.k8s.io/v1beta1:FlowSchemaPatch"), pulumi.Alias(type_="kubernetes:flowcontrol.apiserver.k8s.io/v1beta2:FlowSchemaPatch"), pulumi.Alias(type_="kubernetes:flowcontrol.apiserver.k8s.io/v1beta3:FlowSchemaPatch")]) opts = pulumi.ResourceOptions.merge(opts, alias_opts) super(FlowSchemaPatch, __self__).__init__( 'kubernetes:flowcontrol.apiserver.k8s.io/v1alpha1:FlowSchemaPatch', resource_name, __props__, opts) @staticmethod def get(resource_name: str, id: pulumi.Input[str], opts: Optional[pulumi.ResourceOptions] = None) -> 'FlowSchemaPatch': """ Get an existing FlowSchemaPatch resource's state with the given name, id, and optional extra properties used to qualify the lookup. :param str resource_name: The unique name of the resulting resource. :param pulumi.Input[str] id: The unique provider ID of the resource to lookup. :param pulumi.ResourceOptions opts: Options for the resource. """ opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id)) __props__ = FlowSchemaPatchArgs.__new__(FlowSchemaPatchArgs) __props__.__dict__["api_version"] = None __props__.__dict__["kind"] = None __props__.__dict__["metadata"] = None __props__.__dict__["spec"] = None __props__.__dict__["status"] = None return FlowSchemaPatch(resource_name, opts=opts, __props__=__props__) @property @pulumi.getter(name="apiVersion") def api_version(self) -> pulumi.Output[Optional[str]]: """ APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources """ return pulumi.get(self, "api_version") @property @pulumi.getter def kind(self) -> pulumi.Output[Optional[str]]: """ Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds """ return pulumi.get(self, "kind") @property @pulumi.getter def metadata(self) -> pulumi.Output[Optional['_meta.v1.outputs.ObjectMetaPatch']]: """ `metadata` is the standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata """ return pulumi.get(self, "metadata") @property @pulumi.getter def spec(self) -> pulumi.Output[Optional['outputs.FlowSchemaSpecPatch']]: """ `spec` is the specification of the desired behavior of a FlowSchema. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status """ return pulumi.get(self, "spec") @property @pulumi.getter def status(self) -> pulumi.Output[Optional['outputs.FlowSchemaStatusPatch']]: """ `status` is the current status of a FlowSchema. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status """ return pulumi.get(self, "status")
PypiClean
/robotframework-mobilelibrary-2.0.5.tar.gz/robotframework-mobilelibrary-2.0.5/src/AppiumLibrary/locators/elementfinder.py
from AppiumLibrary import utils from robot.api import logger class ElementFinder(object): def __init__(self): self._strategies = { 'identifier': self._find_by_identifier, 'id': self._find_by_id, 'name': self._find_by_name, 'xpath': self._find_by_xpath, 'class': self._find_by_class_name, 'accessibility_id': self._find_element_by_accessibility_id, 'android': self._find_by_android, 'ios': self._find_by_ios, 'css': self._find_by_css_selector, 'link': self._find_by_link_text, 'partial link': self._find_by_partial_link_text, None: self._find_by_default } def find(self, browser, locator, tag=None): assert browser is not None assert locator is not None and len(locator) > 0 (prefix, criteria) = self._parse_locator(locator) strategy = self._strategies.get(prefix) if strategy is None: raise ValueError("Element locator with prefix '" + prefix + "' is not supported") (tag, constraints) = self._get_tag_and_constraints(tag) return strategy(browser, criteria, tag, constraints) # Strategy routines, private def _find_by_identifier(self, browser, criteria, tag, constraints): elements = self._normalize_result(browser.find_elements_by_id(criteria)) elements.extend(self._normalize_result(browser.find_elements_by_name(criteria))) return self._filter_elements(elements, tag, constraints) def _find_by_id(self, browser, criteria, tag, constraints): return self._filter_elements( browser.find_elements_by_id(criteria), tag, constraints) def _find_by_name(self, browser, criteria, tag, constraints): return self._filter_elements( browser.find_elements_by_name(criteria), tag, constraints) def _find_by_xpath(self, browser, criteria, tag, constraints): return self._filter_elements( browser.find_elements_by_xpath(criteria), tag, constraints) def _find_by_dom(self, browser, criteria, tag, constraints): result = browser.execute_script("return %s;" % criteria) if result is None: return [] if not isinstance(result, list): result = [result] return self._filter_elements(result, tag, constraints) def _find_by_sizzle_selector(self, browser, criteria, tag, constraints): js = "return jQuery('%s').get();" % criteria.replace("'", "\\'") return self._filter_elements( browser.execute_script(js), tag, constraints) def _find_by_link_text(self, browser, criteria, tag, constraints): return self._filter_elements( browser.find_elements_by_link_text(criteria), tag, constraints) def _find_by_partial_link_text(self, browser, criteria, tag, constraints): return self._filter_elements( browser.find_elements_by_partial_link_text(criteria), tag, constraints) def _find_by_css_selector(self, browser, criteria, tag, constraints): return self._filter_elements( browser.find_elements_by_css_selector(criteria), tag, constraints) def _find_by_tag_name(self, browser, criteria, tag, constraints): return self._filter_elements( browser.find_elements_by_tag_name(criteria), tag, constraints) def _find_by_class_name(self, browser, criteria, tag, constraints): return self._filter_elements( browser.find_elements_by_class_name(criteria), tag, constraints) def _find_element_by_accessibility_id(self, browser, criteria, tag, constraints): elements = browser.find_elements_by_accessibility_id(criteria) return elements def _find_by_android(self, browser, criteria, tag, constraints): """Find element matches by UI Automator.""" return self._filter_elements( browser.find_elements_by_android_uiautomator(criteria), tag, constraints) def _find_by_ios(self, browser, criteria, tag, constraints): """Find element matches by UI Automation.""" return self._filter_elements( browser.find_elements_by_ios_uiautomation(criteria), tag, constraints) def _find_by_default(self, browser, criteria, tag, constraints): if criteria.startswith('//'): return self._find_by_xpath(browser, criteria, tag, constraints) return self._find_by_key_attrs(browser, criteria, tag, constraints) def _find_by_key_attrs(self, browser, criteria, tag, constraints): key_attrs = self._key_attrs.get(None) if tag is not None: key_attrs = self._key_attrs.get(tag, key_attrs) xpath_criteria = utils.escape_xpath_value(criteria) xpath_tag = tag if tag is not None else '*' xpath_constraints = ["@%s='%s'" % (name, constraints[name]) for name in constraints] xpath_searchers = ["%s=%s" % (attr, xpath_criteria) for attr in key_attrs] xpath_searchers.extend( self._get_attrs_with_url(key_attrs, criteria, browser)) xpath = "//%s[%s(%s)]" % ( xpath_tag, ' and '.join(xpath_constraints) + ' and ' if len(xpath_constraints) > 0 else '', ' or '.join(xpath_searchers)) return self._normalize_result(browser.find_elements_by_xpath(xpath)) # Private _key_attrs = { None: ['@id', '@name'], 'a': ['@id', '@name', '@href', 'normalize-space(descendant-or-self::text())'], 'img': ['@id', '@name', '@src', '@alt'], 'input': ['@id', '@name', '@value', '@src'], 'button': ['@id', '@name', '@value', 'normalize-space(descendant-or-self::text())'] } def _get_tag_and_constraints(self, tag): if tag is None: return None, {} tag = tag.lower() constraints = {} if tag == 'link': tag = 'a' elif tag == 'image': tag = 'img' elif tag == 'list': tag = 'select' elif tag == 'radio button': tag = 'input' constraints['type'] = 'radio' elif tag == 'checkbox': tag = 'input' constraints['type'] = 'checkbox' elif tag == 'text field': tag = 'input' constraints['type'] = 'text' elif tag == 'file upload': tag = 'input' constraints['type'] = 'file' return tag, constraints def _element_matches(self, element, tag, constraints): if not element.tag_name.lower() == tag: return False for name in constraints: if not element.get_attribute(name) == constraints[name]: return False return True def _filter_elements(self, elements, tag, constraints): elements = self._normalize_result(elements) if tag is None: return elements return filter( lambda element: self._element_matches(element, tag, constraints), elements) def _get_attrs_with_url(self, key_attrs, criteria, browser): attrs = [] url = None xpath_url = None for attr in ['@src', '@href']: if attr in key_attrs: if url is None or xpath_url is None: url = self._get_base_url(browser) + "/" + criteria xpath_url = utils.escape_xpath_value(url) attrs.append("%s=%s" % (attr, xpath_url)) return attrs def _get_base_url(self, browser): url = browser.get_current_url() if '/' in url: url = '/'.join(url.split('/')[:-1]) return url def _parse_locator(self, locator): prefix = None criteria = locator if not locator.startswith('//'): locator_parts = locator.partition('=') if len(locator_parts[1]) > 0: prefix = locator_parts[0].strip().lower() criteria = locator_parts[2].strip() if len(criteria) > 2: if criteria.startswith('\"') and criteria.endswith('\"'): criteria = criteria[1:-1] if criteria.startswith('\'') and criteria.endswith('\''): criteria = criteria[1:-1] return (prefix, criteria) def _normalize_result(self, elements): if not isinstance(elements, list): logger.debug("WebDriver find returned %s" % elements) return [] return elements
PypiClean
/stem_registration-0.0.49.tar.gz/stem_registration-0.0.49/stem_registration/static/stem_registration/js/dist/inputmask/inputmask.regex.extensions.js
!function(factory) { "function" == typeof define && define.amd ? define([ "./dependencyLibs/inputmask.dependencyLib", "./inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("./dependencyLibs/inputmask.dependencyLib"), require("./inputmask")) : factory(window.dependencyLib || jQuery, window.Inputmask); }(function($, Inputmask) { return Inputmask.extendAliases({ Regex: { mask: "r", greedy: !1, repeat: "*", regex: null, regexTokens: null, tokenizer: /\[\^?]?(?:[^\\\]]+|\\[\S\s]?)*]?|\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9][0-9]*|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|c[A-Za-z]|[\S\s]?)|\((?:\?[:=!]?)?|(?:[?*+]|\{[0-9]+(?:,[0-9]*)?\})\??|[^.?*+^${[()|\\]+|./g, quantifierFilter: /[0-9]+[^,]/, isComplete: function(buffer, opts) { return new RegExp(opts.regex, opts.casing ? "i" : "").test(buffer.join("")); }, definitions: { r: { validator: function(chrs, maskset, pos, strict, opts) { function RegexToken(isGroup, isQuantifier) { this.matches = [], this.isGroup = isGroup || !1, this.isQuantifier = isQuantifier || !1, this.quantifier = { min: 1, max: 1 }, this.repeaterPart = void 0; } function validateRegexToken(token, fromGroup) { var isvalid = !1; fromGroup && (regexPart += "(", openGroupCount++); for (var mndx = 0; mndx < token.matches.length; mndx++) { var matchToken = token.matches[mndx]; if (!0 === matchToken.isGroup) isvalid = validateRegexToken(matchToken, !0); else if (!0 === matchToken.isQuantifier) { var crrntndx = $.inArray(matchToken, token.matches), matchGroup = token.matches[crrntndx - 1], regexPartBak = regexPart; if (isNaN(matchToken.quantifier.max)) { for (;matchToken.repeaterPart && matchToken.repeaterPart !== regexPart && matchToken.repeaterPart.length > regexPart.length && !(isvalid = validateRegexToken(matchGroup, !0)); ) ; (isvalid = isvalid || validateRegexToken(matchGroup, !0)) && (matchToken.repeaterPart = regexPart), regexPart = regexPartBak + matchToken.quantifier.max; } else { for (var i = 0, qm = matchToken.quantifier.max - 1; i < qm && !(isvalid = validateRegexToken(matchGroup, !0)); i++) ; regexPart = regexPartBak + "{" + matchToken.quantifier.min + "," + matchToken.quantifier.max + "}"; } } else if (void 0 !== matchToken.matches) for (var k = 0; k < matchToken.length && !(isvalid = validateRegexToken(matchToken[k], fromGroup)); k++) ; else { var testExp; if ("[" == matchToken.charAt(0)) { testExp = regexPart, testExp += matchToken; for (j = 0; j < openGroupCount; j++) testExp += ")"; isvalid = (exp = new RegExp("^(" + testExp + ")$", opts.casing ? "i" : "")).test(bufferStr); } else for (var l = 0, tl = matchToken.length; l < tl; l++) if ("\\" !== matchToken.charAt(l)) { testExp = regexPart, testExp = (testExp += matchToken.substr(0, l + 1)).replace(/\|$/, ""); for (var j = 0; j < openGroupCount; j++) testExp += ")"; var exp = new RegExp("^(" + testExp + ")$", opts.casing ? "i" : ""); if (isvalid = exp.test(bufferStr)) break; } regexPart += matchToken; } if (isvalid) break; } return fromGroup && (regexPart += ")", openGroupCount--), isvalid; } var bufferStr, groupToken, cbuffer = maskset.buffer.slice(), regexPart = "", isValid = !1, openGroupCount = 0; null === opts.regexTokens && function() { var match, m, currentToken = new RegexToken(), opengroups = []; for (opts.regexTokens = []; match = opts.tokenizer.exec(opts.regex); ) switch ((m = match[0]).charAt(0)) { case "(": opengroups.push(new RegexToken(!0)); break; case ")": groupToken = opengroups.pop(), opengroups.length > 0 ? opengroups[opengroups.length - 1].matches.push(groupToken) : currentToken.matches.push(groupToken); break; case "{": case "+": case "*": var quantifierToken = new RegexToken(!1, !0), mq = (m = m.replace(/[{}]/g, "")).split(","), mq0 = isNaN(mq[0]) ? mq[0] : parseInt(mq[0]), mq1 = 1 === mq.length ? mq0 : isNaN(mq[1]) ? mq[1] : parseInt(mq[1]); if (quantifierToken.quantifier = { min: mq0, max: mq1 }, opengroups.length > 0) { var matches = opengroups[opengroups.length - 1].matches; (match = matches.pop()).isGroup || ((groupToken = new RegexToken(!0)).matches.push(match), match = groupToken), matches.push(match), matches.push(quantifierToken); } else (match = currentToken.matches.pop()).isGroup || ((groupToken = new RegexToken(!0)).matches.push(match), match = groupToken), currentToken.matches.push(match), currentToken.matches.push(quantifierToken); break; default: opengroups.length > 0 ? opengroups[opengroups.length - 1].matches.push(m) : currentToken.matches.push(m); } currentToken.matches.length > 0 && opts.regexTokens.push(currentToken); }(), cbuffer.splice(pos, 0, chrs), bufferStr = cbuffer.join(""); for (var i = 0; i < opts.regexTokens.length; i++) { var regexToken = opts.regexTokens[i]; if (isValid = validateRegexToken(regexToken, regexToken.isGroup)) break; } return isValid; }, cardinality: 1 } } } }), Inputmask; });
PypiClean
/Nitrous-0.9.3-py3-none-any.whl/turbogears/identity/saprovider.py
from builtins import str from builtins import object import logging from datetime import datetime from turbogears import config, identity from turbogears.database import bind_metadata, metadata, session from turbogears.util import load_class from sqlalchemy import (Table, Column, ForeignKey, String, Unicode, Integer, DateTime) from sqlalchemy.exc import IntegrityError from sqlalchemy.orm import class_mapper, mapper, relation from sqlalchemy.orm.exc import UnmappedClassError log = logging.getLogger('turbogears.identity.saprovider') # Global class references -- # these will be set when the provider is initialized. user_class = None group_class = None permission_class = None visit_class = None class SqlAlchemyIdentity(object): """Identity that uses a model from a database (via SQLAlchemy).""" def __init__(self, visit_key=None, user=None): self.visit_key = visit_key if user: self._user = user if visit_key is not None: self.login() @property def user(self): """Get user instance for this identity.""" try: return self._user except AttributeError: # User hasn't already been set pass # Attempt to load the user. After this code executes, there *will* be # a _user attribute, even if the value is None. visit = self.visit_link self._user = visit and session.query(user_class).get(visit.user_id) return self._user @property def user_name(self): """Get user name of this identity.""" if not self.user: return None return self.user.user_name @property def user_id(self): """Get user id of this identity.""" if not self.user: return None return self.user.user_id @property def anonymous(self): """Return true if not logged in.""" return not self.user @property def permissions(self): """Get set of permission names of this identity.""" try: return self._permissions except AttributeError: # Permissions haven't been computed yet pass if not self.user: self._permissions = frozenset() else: self._permissions = frozenset( p.permission_name for p in self.user.permissions) return self._permissions @property def groups(self): """Get set of group names of this identity.""" try: return self._groups except AttributeError: # Groups haven't been computed yet pass if not self.user: self._groups = frozenset() else: self._groups = frozenset(g.group_name for g in self.user.groups) return self._groups @property def group_ids(self): """Get set of group IDs of this identity.""" try: return self._group_ids except AttributeError: # Groups haven't been computed yet pass if not self.user: self._group_ids = frozenset() else: self._group_ids = frozenset(g.group_id for g in self.user.groups) return self._group_ids @property def visit_link(self): """Get the visit link to this identity.""" if self.visit_key is None: return None return session.query(visit_class).filter_by( visit_key=self.visit_key).first() @property def login_url(self): """Get the URL for the login page.""" return identity.get_failure_url() def login(self): """Set the link between this identity and the visit.""" visit = self.visit_link if not visit: visit = visit_class() visit.visit_key = self.visit_key session.add(visit) visit.user_id = self._user.user_id try: session.flush() except IntegrityError: visit = self.visit_link if not visit: raise visit.user_id = self._user.user_id session.flush() def logout(self): """Remove the link between this identity and the visit.""" visit = self.visit_link if visit: session.delete(visit) session.flush() # Clear the current identity identity.set_current_identity(SqlAlchemyIdentity()) class SqlAlchemyIdentityProvider(object): """IdentityProvider that uses a model from a database (via SQLAlchemy).""" def __init__(self): super(SqlAlchemyIdentityProvider, self).__init__() glob_ns = globals() for classname in ('user', 'group', 'permission', 'visit'): default_classname = '.TG_' + (classname == 'visit' and 'VisitIdentity' or classname.capitalize()) class_path = config.get('identity.saprovider.model.%s' % classname, __name__ + default_classname) class_ = load_class(class_path) if class_: if class_path == __name__ + default_classname: try: class_mapper(class_) except UnmappedClassError: class_._map() log.info('Successfully loaded "%s".', class_path) glob_ns['%s_class' % classname] = class_ else: log.error('Could not load class "%s". Check ' 'identity.saprovider.model.%s setting', class_path, classname) def encrypt_password(self, password): # Default encryption algorithm is to use plain text passwords algorithm = config.get('identity.saprovider.encryption_algorithm', None) return identity.encrypt_pw_with_algorithm(algorithm, password) def create_provider_model(self): """Create the database tables if they don't already exist.""" bind_metadata() class_mapper(user_class).local_table.create(checkfirst=True) class_mapper(group_class).local_table.create(checkfirst=True) if group_class is TG_Group: group_class._user_association_table.create(checkfirst=True) class_mapper(permission_class).local_table.create(checkfirst=True) if permission_class is TG_Permission: permission_class._group_association_table.create(checkfirst=True) class_mapper(visit_class).local_table.create(checkfirst=True) def validate_identity(self, user_name, password, visit_key): """Validate the identity represented by user_name using the password. Must return either None if the credentials weren't valid or an object with the following properties: user_name: original user name user: a provider dependent object (TG_User or similar) groups: a set of group names permissions: a set of permission names """ user = session.query(user_class).filter_by(user_name=user_name).first() if not user: log.warning("No such user: %s", user_name) return None if not self.validate_password(user, user_name, password): log.info("Passwords don't match for user: %s", user_name) return None log.info("Associating user (%s) with visit (%s)", user_name, visit_key) return SqlAlchemyIdentity(visit_key, user) def validate_password(self, user, user_name, password): """Check the user_name and password against existing credentials. Note: user_name is not used here, but is required by external password validation schemes that might override this method. If you use SqlAlchemyIdentityProvider, but want to check the passwords against an external source (i.e. PAM, LDAP, Windows domain, etc), subclass SqlAlchemyIdentityProvider, and override this method. """ return user.password == self.encrypt_password(password) def load_identity(self, visit_key): """Lookup the principal represented by user_name. Return None if there is no principal for the given user ID. Must return an object with the following properties: user_name: original user name user: a provider dependent object (TG_User or similar) groups: a set of group names permissions: a set of permission names """ return SqlAlchemyIdentity(visit_key) def anonymous_identity(self): """Return anonymous identity. Must return an object with the following properties: user_name: original user name user: a provider dependent object (TG_User or similar) groups: a set of group names permissions: a set of permission names """ return SqlAlchemyIdentity() def authenticated_identity(self, user): """Construct Identity object for users with no visit_key.""" return SqlAlchemyIdentity(user=user) # default identity model classes class TG_User(object): """Reasonably basic User definition.""" def __repr__(self): return '<User: name="%s", email="%s", display name="%s">' % ( self.user_name, self.email_address, self.display_name) def __unicode__(self): return self.display_name or self.user_name @property def permissions(self): """Return all permissions of all groups the user belongs to.""" p = set() for g in self.groups: p |= set(g.permissions) return p @classmethod def by_email_address(cls, email_address): return session.query(cls).filter_by(email_address=email_address).first() @classmethod def by_user_name(cls, user_name): return session.query(cls).filter_by(user_name=user_name).first() by_name = by_user_name def _set_password(self, cleartext_password): """Run cleartext password through the hash algorithm before saving.""" try: hash = identity.current_provider.encrypt_password(cleartext_password) except identity.exceptions.IdentityManagementNotEnabledException: # Creating identity provider just to encrypt password # (so we don't reimplement the encryption step). ip = SqlAlchemyIdentityProvider() hash = ip.encrypt_password(cleartext_password) if hash == cleartext_password: log.info("Identity provider not enabled," " and no encryption algorithm specified in config." " Setting password as plaintext.") if isinstance(hash, str): hash = str(hash) self._password = hash def _get_password(self): """Returns password.""" return self._password password = property(_get_password, _set_password) def set_password_raw(self, password): """Save the password as-is to the database.""" if isinstance(password, str): hash = str(password) self._password = password @classmethod def _map(cls): cls._table = Table('tg_user', metadata, Column('user_id', Integer, primary_key=True), Column('user_name', Unicode(16), unique=True, nullable=False), Column('email_address', Unicode(255), unique=True), Column('display_name', Unicode(255)), Column('password', Unicode(40)), Column('created', DateTime, default=datetime.now)) cls._mapper = mapper(cls, cls._table, properties=dict(_password=cls._table.c.password)) class TG_Group(object): """An ultra-simple Group definition.""" def __repr__(self): return '<Group: name="%s", display_name="%s">' % ( self.group_name, self.display_name) def __unicode__(self): return self.display_name or self.group_name @classmethod def by_group_name(cls, group_name): """Look up Group by given group name.""" return session.query(cls).filter_by(group_name=group_name).first() by_name = by_group_name @classmethod def _map(cls): cls._table = Table('tg_group', metadata, Column('group_id', Integer, primary_key=True), Column('group_name', Unicode(16), unique=True, nullable=False), Column('display_name', Unicode(255)), Column('created', DateTime, default=datetime.now)) cls._user_association_table = Table('user_group', metadata, Column('user_id', Integer, ForeignKey('tg_user.user_id', onupdate='CASCADE', ondelete='CASCADE'), primary_key=True), Column('group_id', Integer, ForeignKey('tg_group.group_id', onupdate='CASCADE', ondelete='CASCADE'), primary_key=True)) cls._mapper = mapper(cls, cls._table, properties=dict(users=relation(TG_User, secondary=cls._user_association_table, backref='groups'))) class TG_Permission(object): """A relationship that determines what each Group can do.""" def __repr__(self): return '<Permission: name="%s">' % self.permission_name def __unicode__(self): return self.permission_name @classmethod def by_permission_name(cls, permission_name): """Look up Permission by given permission name.""" return session.query(cls).filter_by(permission_name=permission_name).first() by_name = by_permission_name @classmethod def _map(cls): cls._table = Table('permission', metadata, Column('permission_id', Integer, primary_key=True), Column('permission_name', Unicode(16), unique=True, nullable=False), Column('description', Unicode(255))) cls._group_association_table = Table('group_permission', metadata, Column('group_id', Integer, ForeignKey('tg_group.group_id', onupdate='CASCADE', ondelete='CASCADE'), primary_key=True), Column('permission_id', Integer, ForeignKey('permission.permission_id', onupdate='CASCADE', ondelete='CASCADE'), primary_key=True)) cls._mapper = mapper(cls, cls._table, properties=dict(groups=relation(TG_Group, secondary=cls._group_association_table, backref='permissions'))) class TG_VisitIdentity(object): """A Visit that is linked to a User object.""" @classmethod def by_visit_key(cls, visit_key): """Look up VisitIdentity by given visit key.""" return session.query(cls).get(visit_key) @classmethod def _map(cls): cls._table = Table('visit_identity', metadata, Column('visit_key', String(40), primary_key=True), Column('user_id', Integer, ForeignKey('tg_user.user_id'), index=True)) cls._mapper = mapper(cls, cls._table, properties=dict(user=relation(TG_User, backref='visit_identity'))) def encrypt_password(cleartext_password): """Encrypt given cleartext password.""" try: hash = identity.current_provider.encrypt_password(cleartext_password) except identity.exceptions.RequestRequiredException: # Creating identity provider just to encrypt password # (so we don't reimplement the encryption step). ip = SqlAlchemyIdentityProvider() hash = ip.encrypt_password(cleartext_password) if hash == cleartext_password: log.info("Identity provider not enabled, and no encryption " "algorithm specified in config. Setting password as plaintext.") return hash
PypiClean
/rockset_sqlcli-0.8.10.tar.gz/rockset_sqlcli-0.8.10/rockset_sqlcli/rscli/main.py
from __future__ import unicode_literals from __future__ import print_function import datetime as dt import functools import humanize import itertools import logging import os import re import rockset import threading import traceback from collections import namedtuple from codecs import open from cli_helpers.tabular_output import TabularOutputFormatter from cli_helpers.tabular_output.preprocessors import align_decimals, format_numbers import click click.disable_unicode_literals_warning = True try: import setproctitle except ImportError: setproctitle = None from prompt_toolkit import CommandLineInterface, Application, AbortAction from prompt_toolkit.auto_suggest import AutoSuggestFromHistory from prompt_toolkit.buffer import AcceptAction from prompt_toolkit.document import Document from prompt_toolkit.enums import DEFAULT_BUFFER, EditingMode from prompt_toolkit.filters import Always, HasFocus, IsDone from prompt_toolkit.history import FileHistory from prompt_toolkit.layout.lexers import PygmentsLexer from prompt_toolkit.layout.processors import ( ConditionalProcessor, HighlightMatchingBracketProcessor, ) from prompt_toolkit.shortcuts import create_prompt_layout, create_eventloop from pygments.lexers.sql import PostgresLexer from pygments.token import Token from rockset.sql.exception import OperationalError, ProgrammingError from time import time, sleep try: from urlparse import urlparse, unquote, parse_qs except ImportError: from urllib.parse import urlparse, unquote, parse_qs from .completion_refresher import CompletionRefresher from .config import ( config_location, ensure_dir_exists, get_casing_file, get_config, load_config, root_config_location, ) from .encodingutils import utf8tounicode from .encodingutils import text_type from .key_bindings import rscli_bindings from .rsbuffer import RSBuffer from .rscompleter import RSCompleter from .rsexecute import RSExecute from .rsstyle import style_factory from .rstoolbar import create_toolbar_tokens_func # Query tuples are used for maintaining history MetaQuery = namedtuple( "Query", [ "query", # The entire text of the command "successful", # True If all subqueries were successful "total_time", # Time elapsed executing the query "meta_changed", # True if any subquery executed create/alter/drop "ws_changed", # True if any subquery changed the workspace "path_changed", # True if any subquery changed the search path "mutated", # True if any subquery executed insert/update/delete ], ) MetaQuery.__new__.__defaults__ = ("", False, 0, False, False, False, False) OutputSettings = namedtuple( "OutputSettings", "table_format dcmlfmt floatfmt missingval expanded max_width case_function", ) OutputSettings.__new__.__defaults__ = ( None, None, None, "<null>", False, None, lambda x: x, ) class RSCli(object): # constants default_prompt = "\\a@\\s:\\w> " max_len_prompt = 30 def __init__( self, rsexecute=None, rsclirc_file=None, auto_vertical_output=False, less_chatty=None, prompt=None, row_limit=None, single_connection=False, generate_warnings=False, ): # Init command handler self.rsexecute = rsexecute # Load config. c = self.config = get_config(rsclirc_file) # Init logger and pager self.logger = logging.getLogger(__name__) self.initialize_logging() self.set_default_pager(c) self.output_file = None # Init settings self.multi_line = c["main"].as_bool("multi_line") self.multiline_mode = c["main"].get("multi_line_mode", "psql") self.vi_mode = c["main"].as_bool("vi") self.auto_expand = auto_vertical_output or c["main"].as_bool("auto_expand") self.expanded_output = c["main"].as_bool("expand") if row_limit is not None: self.row_limit = row_limit else: self.row_limit = c["main"].as_int("row_limit") self.min_num_menu_lines = c["main"].as_int("min_num_menu_lines") self.multiline_continuation_char = c["main"]["multiline_continuation_char"] self.table_format = c["main"]["table_format"] self.syntax_style = c["main"]["syntax_style"] self.cli_style = c["colors"] self.wider_completion_menu = c["main"].as_bool("wider_completion_menu") self.less_chatty = bool(less_chatty) or c["main"].as_bool("less_chatty") self.null_string = c["main"].get("null_string", "<null>") self.prompt_format = ( prompt if prompt is not None else c["main"].get("prompt", self.default_prompt) ) self.on_error = c["main"]["on_error"].upper() self.decimal_format = c["data_formats"]["decimal"] self.float_format = c["data_formats"]["float"] self.timing_enabled = True self.now = dt.datetime.today() self.query_history = [] # Initialize completer and completion refresher self.completion_refresher = CompletionRefresher() smart_completion = c["main"].as_bool("smart_completion") keyword_casing = c["main"]["keyword_casing"] self.settings = { "casing_file": get_casing_file(c), "generate_casing_file": c["main"].as_bool("generate_casing_file"), "generate_aliases": c["main"].as_bool("generate_aliases"), "asterisk_column_order": c["main"]["asterisk_column_order"], "qualify_columns": c["main"]["qualify_columns"], "case_column_headers": c["main"].as_bool("case_column_headers"), "search_path_filter": c["main"].as_bool("search_path_filter"), "single_connection": single_connection, "less_chatty": less_chatty, "keyword_casing": keyword_casing, } completer = RSCompleter(smart_completion, settings=self.settings) self.completer = completer self._completer_lock = threading.Lock() self.eventloop = create_eventloop() self.generate_warnings = generate_warnings self.cli = None def initialize_logging(self): log_file = self.config["main"]["log_file"] if log_file == "default": log_file = os.path.join(root_config_location(), "log") ensure_dir_exists(log_file) log_level = self.config["main"]["log_level"] # Disable logging if value is NONE by switching to a no-op handler. # Set log level to a high value so it doesn't even waste cycles getting called. if log_level.upper() == "NONE": handler = logging.NullHandler() else: handler = logging.FileHandler(os.path.expanduser(log_file)) level_map = { "CRITICAL": logging.CRITICAL, "ERROR": logging.ERROR, "WARNING": logging.WARNING, "INFO": logging.INFO, "DEBUG": logging.DEBUG, "NONE": logging.CRITICAL, } log_level = level_map[log_level.upper()] formatter = logging.Formatter( "%(asctime)s (%(process)d/%(threadName)s) " "%(name)s %(levelname)s - %(message)s" ) handler.setFormatter(formatter) root_logger = logging.getLogger(__name__) root_logger.addHandler(handler) root_logger.setLevel(log_level) root_logger.debug("Initializing rscli logging.") root_logger.debug("Log file %r.", log_file) def set_default_pager(self, config): configured_pager = config["main"].get("pager") os_environ_pager = os.environ.get("PAGER") if configured_pager: self.logger.info( 'Default pager found in config file: "{}"'.format(configured_pager) ) os.environ["PAGER"] = configured_pager elif os_environ_pager: self.logger.info( 'Default pager found in PAGER environment variable: "{}"'.format( os_environ_pager ) ) os.environ["PAGER"] = os_environ_pager else: self.logger.info( "No default pager found in environment. Using os default pager" ) # Set default set of less recommended options, if they are not already set. # They are ignored if pager is different than less. if not os.environ.get("LESS"): os.environ["LESS"] = "-SRXF" def change_table_format(self, pattern, **_): try: if pattern not in TabularOutputFormatter().supported_formats: raise ValueError() self.table_format = pattern yield (None, None, None, "Changed table format to {}".format(pattern)) except ValueError: msg = "Table format {} not recognized. Allowed formats:".format(pattern) for table_type in TabularOutputFormatter().supported_formats: msg += "\n\t{}".format(table_type) msg += "\nCurrently set to: %s" % self.table_format yield (None, None, None, msg) def info_connection(self, **_): yield ( None, None, None, 'You are connected to workspace "%s" at ' 'api_server "%s".' % (self.rsexecute.workspace, self.rsexecute.api_server), ) def change_ws(self, pattern, **_): if pattern: # Get all the parameters in pattern, handling double quotes if any. infos = re.findall(r'"[^"]*"|[^"\'\s]+', pattern) # Now removing quotes. list(map(lambda s: s.strip('"'), infos)) infos.extend([None] * (3 - len(infos))) api_server, api_key, workspace = infos try: self.rsexecute.connect( api_server=api_server, api_key=api_key, workspace=workspace ) except OperationalError as e: click.secho(str(e), err=True, fg="red") click.echo("Previous connection kept") else: self.rsexecute.connect() yield ( None, None, None, 'You are now connected to workspace "%s" at ' 'api_server "%s"' % (self.rsexecute.workspace, self.rsexecute.api_server), ) def execute_from_file(self, pattern, **_): if not pattern: message = "\\i: missing required argument" return [(None, None, None, message, "", False)] try: with open(os.path.expanduser(pattern), encoding="utf-8") as f: query = f.read() except IOError as e: return [(None, None, None, str(e), "", False)] on_error_resume = self.on_error == "RESUME" return self.rsexecute.run(query, on_error_resume=on_error_resume) def write_to_file(self, pattern, **_): if not pattern: self.output_file = None message = "File output disabled" return [(None, None, None, message, "", True)] filename = os.path.abspath(os.path.expanduser(pattern)) if not os.path.isfile(filename): try: open(filename, "w").close() except IOError as e: self.output_file = None message = str(e) + "\nFile output disabled" return [(None, None, None, message, "", False)] self.output_file = filename message = 'Writing to file "%s"' % self.output_file return [(None, None, None, message, "", True)] def connect(self, api_server, api_key, workspace, **kwargs): kwargs["generate_warnings"] = self.generate_warnings # Attempt to connect to Rockset try: rsexecute = RSExecute(api_server, api_key, workspace, **kwargs) except Exception as e: # Connecting to Rockset could fail. self.logger.debug("Rockset connection failed: %r.", e) self.logger.debug("traceback: %r", traceback.format_exc()) click.secho(str(e), err=True, fg="red") exit(1) self.rsexecute = rsexecute def execute_command(self, text, query): logger = self.logger try: output, query = self._evaluate_command(text) except KeyboardInterrupt: # Restart connection to rockset self.rsexecute.connect() logger.debug("cancelled query, sql: %r", text) click.secho("Query cancelled.", err=True, fg="red") except NotImplementedError: click.secho("Not yet implemented.", fg="yellow") except OperationalError as e: logger.error("operational error. sql: %r, error: %r", text, e) logger.debug("traceback: %r", traceback.format_exc()) self._handle_server_closed_connection() except Exception as e: logger.error("exception encountered. sql: %r, error: %r", text, e) logger.error("%s", traceback.format_exc()) click.secho(str(e), err=True, fg="red") else: try: if self.output_file and not text.startswith(("\\o ", "\\? ")): try: with open(self.output_file, "a", encoding="utf-8") as f: click.echo(text, file=f) click.echo("\n".join(output), file=f) click.echo("", file=f) # extra newline except IOError as e: click.secho(str(e), err=True, fg="red") else: click.echo_via_pager("\n".join(output)) except KeyboardInterrupt: pass if self.timing_enabled: # Only add humanized time display if > 1 second if query.total_time > 1: print( "Time: %0.03fs (%s)" % ( query.total_time, humanize.time.naturaldelta(query.total_time), ) ) else: print("Time: %0.03fs" % query.total_time) # Check if we need to update completions, in order of most # to least drastic changes if query.ws_changed: with self._completer_lock: self.completer.reset_completions() self.refresh_completions(persist_priorities="keywords") elif query.meta_changed: self.refresh_completions(persist_priorities="all") elif query.path_changed: logger.debug("Refreshing search path") with self._completer_lock: self.completer.set_search_path(self.rsexecute.search_path()) logger.debug("Search path: %r", self.completer.search_path) return query def run_cli(self): logger = self.logger history_file = self.config["main"]["history_file"] if history_file == "default": history_file = os.path.join(config_location(), "history") history = FileHistory(os.path.expanduser(history_file)) self.refresh_completions(history=history, persist_priorities="none") self.cli = self._build_cli(history) if not self.less_chatty: print("Version:", rockset.version()) print() try: while True: document = self.cli.run() # nothing to do if document is empty if not document.text.strip(): continue # The reason we check here instead of inside the rsexecute is # because we want to raise the Exit exception which will be # caught by the try/except block that wraps the rsexecute.run() # statement. if quit_command(document.text): raise EOFError # Initialize default metaquery in case execution fails query = MetaQuery(query=document.text, successful=False) query = self.execute_command(document.text, query) self.now = dt.datetime.today() # Allow RSCompleter to learn user's preferred keywords, etc. with self._completer_lock: self.completer.extend_query_history(document.text) self.query_history.append(query) except EOFError: if not self.less_chatty: print("Goodbye!") def _build_cli(self, history): def set_vi_mode(value): self.vi_mode = value key_binding_manager = rscli_bindings( get_vi_mode_enabled=lambda: self.vi_mode, set_vi_mode_enabled=set_vi_mode ) def prompt_tokens(_): prompt = self.get_prompt(self.prompt_format) if ( self.prompt_format == self.default_prompt and len(prompt) > self.max_len_prompt ): prompt = self.get_prompt("\\s> ") return [(Token.Prompt, prompt)] def get_continuation_tokens(cli, width): continuation = self.multiline_continuation_char * (width - 1) + " " return [(Token.Continuation, continuation)] get_toolbar_tokens = create_toolbar_tokens_func( lambda: self.vi_mode, self.completion_refresher.is_refreshing, self.rsexecute.failed_transaction, self.rsexecute.valid_transaction, ) layout = create_prompt_layout( lexer=PygmentsLexer(PostgresLexer), reserve_space_for_menu=self.min_num_menu_lines, get_prompt_tokens=prompt_tokens, get_continuation_tokens=get_continuation_tokens, get_bottom_toolbar_tokens=get_toolbar_tokens, display_completions_in_columns=self.wider_completion_menu, multiline=True, extra_input_processors=[ # Highlight matching brackets while editing. ConditionalProcessor( processor=HighlightMatchingBracketProcessor(chars="[](){}"), filter=HasFocus(DEFAULT_BUFFER) & ~IsDone(), ), ], ) with self._completer_lock: buf = RSBuffer( auto_suggest=AutoSuggestFromHistory(), always_multiline=self.multi_line, multiline_mode=self.multiline_mode, completer=self.completer, history=history, complete_while_typing=Always(), accept_action=AcceptAction.RETURN_DOCUMENT, ) editing_mode = EditingMode.VI if self.vi_mode else EditingMode.EMACS application = Application( style=style_factory(self.syntax_style, self.cli_style), layout=layout, buffer=buf, key_bindings_registry=key_binding_manager.registry, on_exit=AbortAction.RAISE_EXCEPTION, on_abort=AbortAction.RETRY, ignore_case=True, editing_mode=editing_mode, ) cli = CommandLineInterface( application=application, eventloop=self.eventloop ) return cli def _should_show_limit_prompt(self, status, cur): """returns True if limit prompt should be shown, False otherwise.""" if not is_select(status): return False return self.row_limit > 0 and cur and cur.rowcount > self.row_limit def _evaluate_command(self, text): """Used to run a command entered by the user during CLI operation (Puts the E in REPL) returns (results, MetaQuery) """ logger = self.logger logger.debug("sql: %r", text) all_success = True meta_changed = False # CREATE, ALTER, DROP, etc mutated = False # INSERT, DELETE, etc ws_changed = False path_changed = False output = [] total = 0 # Run the query. start = time() on_error_resume = self.on_error == "RESUME" res = self.rsexecute.run(text, exception_formatter, on_error_resume) for title, cur, headers, status, sql, success in res: logger.debug("headers: %r", headers) logger.debug("rows: %r", cur) logger.debug("status: %r", status) threshold = self.row_limit if self._should_show_limit_prompt(status, cur): click.secho( "The result set has more than %s rows." % threshold, fg="red" ) if not click.confirm("Do you want to continue?"): click.secho("Aborted!", err=True, fg="red") break if self.auto_expand: max_width = self.cli.output.get_size().columns else: max_width = None expanded = self.expanded_output settings = OutputSettings( table_format=self.table_format, dcmlfmt=self.decimal_format, floatfmt=self.float_format, missingval=self.null_string, expanded=expanded, max_width=max_width, case_function=( self.completer.case if self.settings["case_column_headers"] else lambda x: x ), ) formatted = format_output( title, cur, headers, status, settings, self.generate_warnings ) output.extend(formatted) total = time() - start # Keep track of whether any of the queries are mutating or changing # the workspace if success: mutated = mutated or is_mutating(status) ws_changed = ws_changed or has_change_ws_cmd(sql) meta_changed = meta_changed or has_meta_cmd(sql) path_changed = path_changed or has_change_path_cmd(sql) else: all_success = False meta_query = MetaQuery( text, all_success, total, meta_changed, ws_changed, path_changed, mutated ) return output, meta_query def _handle_server_closed_connection(self): """Used during CLI execution""" reconnect = click.prompt( "Connection reset. Reconnect (Y/n)", show_default=False, type=bool, default=True, ) if reconnect: try: self.rsexecute.connect() click.secho("Reconnected!\nTry the command again.", fg="green") except OperationalError as e: click.secho(str(e), err=True, fg="red") def refresh_completions(self, history=None, persist_priorities="all"): """Refresh outdated completions :param history: A prompt_toolkit.history.FileHistory object. Used to load keyword and identifier preferences :param persist_priorities: 'all' or 'keywords' """ callback = functools.partial( self._on_completions_refreshed, persist_priorities=persist_priorities ) self.completion_refresher.refresh( self.rsexecute, callback, history=history, settings=self.settings ) return [ (None, None, None, "Auto-completion refresh started in the background.") ] def _on_completions_refreshed(self, new_completer, persist_priorities): self._swap_completer_objects(new_completer, persist_priorities) if self.cli: # After refreshing, redraw the CLI to clear the statusbar # "Refreshing completions..." indicator self.cli.request_redraw() def _swap_completer_objects(self, new_completer, persist_priorities): """Swap the completer object in cli with the newly created completer. persist_priorities is a string specifying how the old completer's learned prioritizer should be transferred to the new completer. 'none' - The new prioritizer is left in a new/clean state 'all' - The new prioritizer is updated to exactly reflect the old one 'keywords' - The new prioritizer is updated with old keyword priorities, but not any other. """ with self._completer_lock: old_completer = self.completer self.completer = new_completer if persist_priorities == "all": # Just swap over the entire prioritizer new_completer.prioritizer = old_completer.prioritizer elif persist_priorities == "keywords": # Swap over the entire prioritizer, but clear name priorities, # leaving learned keyword priorities alone new_completer.prioritizer = old_completer.prioritizer new_completer.prioritizer.clear_names() elif persist_priorities == "none": # Leave the new prioritizer as is pass # When rscli is first launched we call refresh_completions before # instantiating the cli object. So it is necessary to check if cli # exists before trying the replace the completer object in cli. if self.cli: self.cli.current_buffer.completer = new_completer def get_completions(self, text, cursor_positition): with self._completer_lock: return self.completer.get_completions( Document(text=text, cursor_position=cursor_positition), None ) def get_prompt(self, string): # shorten api_server api_server = self.rsexecute.api_server or "(none)" if api_server[:8] == "https://": api_server = api_server[8:] elif api_server[:7] == "http://": api_server = api_server[7:] if api_server[-11:] == ".rockset.io": api_server = api_server[:-11] # should be before replacing \\d string = string.replace("\\t", self.now.strftime("%x %X")) string = string.replace("\\a", self.rsexecute.account or "") string = string.replace("\\s", api_server) string = string.replace("\\w", self.rsexecute.workspace or "(none)") string = string.replace("\\#", "#" if (self.rsexecute.superuser) else ">") string = string.replace("\\n", "\n") return string def get_last_query(self): """Get the last query executed or None.""" return self.query_history[-1][0] if self.query_history else None @click.command() @click.option("-k", "--api-key", "api_key", help="API key to connect to Rockset.") @click.option( "-s", "--api-server", "api_server", default="api-us-west-2.rockset.io", help="Host address of the Rockset API server.", ) @click.option("-w", "--workspace", default="public", help="Workspace to connect to.") @click.option( "--auto-vertical-output", is_flag=True, help="Automatically switch to vertical output mode if the " "result is wider than the terminal width.", ) @click.option( "--row-limit", default=None, type=click.INT, help="Set threshold for row limit prompt. Use 0 to disable prompt.", ) @click.option( "--rsclirc", default=os.path.join(config_location(), "config"), help="Location of rsclirc file.", type=click.Path(dir_okay=False), ) @click.option("--prompt", help='Prompt format (Default: "\\a@\\s:\\w> ").') @click.option( "--single-connection", "single_connection", is_flag=True, default=False, help="Do not use a separate connection for completions.", ) @click.argument("target", default=None, nargs=1) def cli( target, api_key, api_server, workspace, auto_vertical_output, row_limit, rsclirc, prompt, single_connection, ): return cli_main( target=target, api_key=api_key, api_server=api_server, workspace=workspace, auto_vertical_output=auto_vertical_output, row_limit=row_limit, rsclirc=rsclirc, prompt=prompt, single_connection=single_connection, ) def cli_main( target=None, api_key=None, api_server=None, workspace=None, auto_vertical_output=None, row_limit=None, rsclirc=None, prompt=None, single_connection=None, generate_warnings=False, ): # static config options less_chatty = False config_dir = os.path.dirname(config_location()) if not os.path.exists(config_dir): os.makedirs(config_dir) # instantiate RSCli rscli = RSCli( rsclirc_file=rsclirc, auto_vertical_output=auto_vertical_output, less_chatty=less_chatty, prompt=prompt, row_limit=row_limit, single_connection=single_connection, generate_warnings=generate_warnings, ) # connect to target if target is not None: uri = urlparse(target) api_server = uri.hostname or api_server api_key = uri.username or api_key workspace = uri.path[1:] or workspace rscli.connect(api_server=api_server, api_key=api_key, workspace=workspace) rscli.logger.debug( "Launch Params: \n" "\tAPI Server: %r" "\tAPI Key: %r" "\tWorkspace: %r" % (api_server, api_key[:4] + "*" * (len(api_key) - 4), workspace) ) # protect process line if api_key was specified in it if setproctitle: obfuscate_process_password() # lets go! rscli.run_cli() def obfuscate_process_password(): process_title = setproctitle.getproctitle() if "://" in process_title: process_title = re.sub(r"://([^:]*):([^@.]*)@", r"://xxx:xxx@", process_title) process_title = re.sub(r"://([^:@]*)@", r"://xxx:xxx@", process_title) if "--api-key " in process_title or "-k " in process_title: process_title = re.sub( r"--api-key (.+?)((\s[a-zA-Z]+=)|$)", r"--api_key xxx\2", process_title ) process_title = re.sub( r"-k (.+?)((\s[a-zA-Z]+=)|$)", r"-k xxx\2", process_title ) setproctitle.setproctitle(process_title) def has_meta_cmd(query): """Determines if the completion needs a refresh by checking if the sql statement is an alter, create, drop, commit or rollback.""" try: first_token = query.split()[0] if first_token.lower() in ("alter", "create", "drop", "commit", "rollback"): return True except Exception: return False return False def has_change_ws_cmd(query): """Determines if the statement is a workspace switch such as 'use' or '\\c'""" try: first_token = query.split()[0] if first_token.lower() in ("use", "\\c", "\\connect"): return True except Exception: return False return False def has_change_path_cmd(sql): """Determines if the search_path should be refreshed by checking if the sql has 'set search_path'.""" return "set search_path" in sql.lower() def is_mutating(status): """Determines if the statement is mutating based on the status.""" if not status: return False mutating = set(["insert", "update", "delete"]) return status.split(None, 1)[0].lower() in mutating def is_select(status): """Returns true if the first word in status is 'select'.""" if not status: return False return status.split(None, 1)[0].lower() == "select" def quit_command(sql): return ( sql.strip().lower() == "exit" or sql.strip().lower() == "quit" or sql.strip() == r"\q" or sql.strip() == ":q" ) def exception_formatter(e): return click.style(utf8tounicode(str(e)), fg="red") def format_output(title, cur, headers, status, settings, generate_warnings): output = [] expanded = settings.expanded or settings.table_format == "vertical" table_format = "vertical" if settings.expanded else settings.table_format max_width = settings.max_width case_function = settings.case_function formatter = TabularOutputFormatter(format_name=table_format) def format_array(val): if val is None: return settings.missingval if not isinstance(val, list): return val return "{" + ",".join(text_type(format_array(e)) for e in val) + "}" def format_arrays(data, headers, **_): data = list(data) for row in data: row[:] = [ format_array(val) if isinstance(val, list) else val for val in row ] return data, headers output_kwargs = { "sep_title": "RECORD {n}", "sep_character": "-", "sep_length": (1, 25), "missing_value": settings.missingval, "integer_format": settings.dcmlfmt, "float_format": settings.floatfmt, "preprocessors": (format_numbers, format_arrays), "disable_numparse": True, "preserve_whitespace": True, } if not settings.floatfmt: output_kwargs["preprocessors"] = (align_decimals,) if title: # Only print the title if it's not None. output.append(title) warnings = [] if cur: if cur.warnings() is not None and generate_warnings: warnings = cur.warnings() headers = [case_function(utf8tounicode(x)) for x in headers] if max_width is not None: cur = list(cur) column_types = None if hasattr(cur, "description"): column_types = [] for d in cur.description: column_types.append(d[1]) formatted = formatter.format_output(cur, headers, **output_kwargs) if isinstance(formatted, (text_type)): formatted = iter(formatted.splitlines()) first_line = next(formatted) formatted = itertools.chain([first_line], formatted) if not expanded and max_width and len(first_line) > max_width and headers: formatted = formatter.format_output( cur, headers, format_name="vertical", column_types=None, **output_kwargs ) if isinstance(formatted, (text_type)): formatted = iter(formatted.splitlines()) output = itertools.chain(output, formatted) if status: # Only print the status if it's not None. output = itertools.chain(output, [status]) if len(warnings) > 0: output = itertools.chain(["Warning: {}".format(x) for x in warnings], output) return output if __name__ == "__main__": cli()
PypiClean
/LinOtpUserIdResolver-2.9.3.tar.gz/LinOtpUserIdResolver-2.9.3/useridresolver/PasswdIdResolver.py
import os import re import logging from . import resolver_registry from UserIdResolver import UserIdResolver from UserIdResolver import ResolverLoadConfigError from UserIdResolver import getResolverClass from linotp.lib.type_utils import text log = logging.getLogger(__name__) def str2unicode(input_str): """ convert as binary string into a unicode string by trying various encodings :param input_str: input binary string :return: unicode output """ output_str = input_str conversions = [{}, {'encoding':'utf-8'}, {'encoding':'iso-8859-1'}, {'encoding':'iso-8859-15'} ] for param in conversions: try: output_str = unicode(input_str, **param) break except UnicodeDecodeError as exx: if param == conversions[-1]: log.info('no unicode conversion found for %r' % input_str) raise exx return output_str def tokenise(r): def _(s): ret = None st = s.strip() m = re.match("^" + r, st) if m: ret = (st[:m.end()].strip(), st[m.end():].strip()) #ret[0].strip() ## remove ws #ret[1].strip() return ret return _ @resolver_registry.class_entry('useridresolver.PasswdIdResolver.IdResolver') @resolver_registry.class_entry('useridresolveree.PasswdIdResolver.IdResolver') @resolver_registry.class_entry('useridresolver.passwdresolver') @resolver_registry.class_entry('passwdresolver') class IdResolver (UserIdResolver): fields = {"username": 1, "userid": 1, "description": 0, "phone": 0, "mobile": 0, "email": 0, "givenname": 0, "surname": 0, "gender": 0 } searchFields = { "username": "text", "userid": "numeric", "description": "text", "email": "text" } sF = { "username": 0, "cryptpass": 1, "userid": 2, "description": 4, "email": 4, } resolver_parameters = { "fileName": (True, None, text), 'linotp.root': (False, None, text) } resolver_parameters.update(UserIdResolver.resolver_parameters) @classmethod def setup(cls, config=None, cache_dir=None): ''' this setup hook is triggered, when the server starts to serve the first request :param config: the linotp config :type config: the linotp config dict ''' log.info("Setting up the PasswdResolver") return def __init__(self): """ simple constructor """ self.name = "etc-passwd" self.fileName = "" self.name = "P" self.nameDict = {} self.descDict = {} self.reversDict = {} self.passDict = {} self.officePhoneDict = {} self.homePhoneDict = {} self.surnameDict = {} self.givennameDict = {} self.emailDict = {} def close(self): """ request hook - to close down resolver object """ return def loadFile(self): """ init loads the /etc/passwd user and uid as a dict for / user loginname lookup """ if (self.fileName == ""): self.fileName = "/etc/passwd" log.info('[loadFile] loading users from file %s' % (self.fileName)) fileHandle = open(self.fileName, "r") line = fileHandle.readline() ID = self.sF["userid"] NAME = self.sF["username"] PASS = self.sF["cryptpass"] DESCRIPTION = self.sF["description"] while line: line = line.strip() if len(line) == 0: continue line = str2unicode(line) fields = line.split(":", 7) self.nameDict["%s" % fields[NAME]] = fields[ID] ## for speed reason - build a revers lookup self.reversDict[fields[ID]] = "%s" % fields[NAME] ## for full info store the line self.descDict[fields[ID]] = fields ## store the crypted password self.passDict[fields[ID]] = fields[PASS] ## store surname, givenname and phones descriptions = fields[DESCRIPTION].split(",") name = descriptions[0] names = name.split(' ', 1) self.givennameDict[fields[ID]] = names[0] self.surnameDict[fields[ID]] = "" self.officePhoneDict[fields[ID]] = "" self.homePhoneDict[fields[ID]] = "" self.emailDict[fields[ID]] = "" if len(names) >= 2: self.surnameDict[fields[ID]] = names[1] if len(descriptions) >= 4: self.officePhoneDict[fields[ID]] = descriptions[2] self.homePhoneDict[fields[ID]] = descriptions[3] if len(descriptions) >= 5: for field in descriptions[4:]: # very basic e-mail regex email_match = re.search('.+@.+\..+', field) if email_match: self.emailDict[fields[ID]] = email_match.group(0) """ print ">>" + key[0] + "<< " + key[2] """ line = fileHandle.readline() def checkPass(self, uid, password): """ This function checks the password for a given uid. - returns true in case of success - false if password does not match We do not support shadow passwords at the moment. so the seconds column of the passwd file needs to contain the crypted password """ import crypt if type(password) is unicode: log.debug("Password is a unicode string. Encoding to UTF-8 for \ crypt.crypt() function.") password = password.encode('utf-8') log.info("[checkPass] checking password for user uid %s" % uid) cryptedpasswd = self.passDict[uid] log.debug("[checkPass] We found the crypted pass %s for uid %s" % (cryptedpasswd, uid)) if cryptedpasswd: if cryptedpasswd == 'x' or cryptedpasswd == '*': err = "Sorry, currently no support for shadow passwords" log.error("[checkPass] %s " % err) raise NotImplementedError(err) cp = crypt.crypt(password, cryptedpasswd) log.debug("[checkPass] crypted pass is %s" % cp) if crypt.crypt(password, cryptedpasswd) == cryptedpasswd: log.info("[checkPass] successfully authenticated user uid %s" % uid) return True else: log.warning("[checkPass] user uid %s failed to authenticate" % uid) return False else: log.warning("[checkPass] Failed to verify password. " "No crypted password found in file") return False def getUserInfo(self, userId, no_passwd=False): """ get some info about the user as we only have the loginId, we have to traverse the dict for the value :param userId: the to be searched user :param no_passwd: retrun no password :return: dict of user info """ ret = {} if userId in self.reversDict: fields = self.descDict.get(userId) for key in self.sF: if no_passwd and key == "cryptpass": continue index = self.sF[key] ret[key] = fields[index] ret['givenname'] = self.givennameDict.get(userId) ret['surname'] = self.surnameDict.get(userId) ret['phone'] = self.homePhoneDict.get(userId) ret['mobile'] = self.officePhoneDict.get(userId) ret['email'] = self.emailDict.get(userId) return ret def getUsername(self, userId): ''' ## TODO: why does this return bool :param userId: the user to be searched :return: true, if a user id exists ''' return userId in self.reversDict def getUserId(self, LoginName): """ search the user id from the login name we need the encoding no more as the input is converted to unicode by the str2unicode function :param LoginName: the login of the user :return: the userId """ return self.nameDict.get(LoginName, '') or '' def getSearchFields(self, searchDict=None): """ show, which search fields this userIdResolver supports TODO: implementation is not completed :param searchDict: fields, which should be queried :return: dict of all searchFields """ if searchDict != None: for search in searchDict: pattern = searchDict[search] log.debug("[getSearchFields] searching for %s:%s", search, pattern) return self.searchFields def getUserList(self, searchDict): """ get a list of all users matching the search criteria of the searchdict :param searchDict: dict of search expressions """ ret = [] ## first check if the searches are in the searchDict for l in self.descDict: line = self.descDict[l] ok = True for search in searchDict: if not search in self.searchFields: ok = False break pattern = searchDict[search] log.debug("[getUserList] searching for %s:%s", search, pattern) if search == "username": ok = self.checkUserName(line, pattern) elif search == "userid": ok = self.checkUserId(line, pattern) elif search == "description": ok = self.checkDescription(line, pattern) elif search == "email": ok = self.checkEmail(line, pattern) if ok != True: break if ok == True: uid = line[self.sF["userid"]] info = self.getUserInfo(uid, no_passwd=True) ret.append(info) return ret def checkUserName(self, line, pattern): """ check for user name """ username = line[self.sF["username"]] ret = self.stringMatch(username, pattern) return ret def checkDescription(self, line, pattern): description = line[self.sF["description"]] ret = self.stringMatch(description, pattern) return ret def checkEmail(self, line, pattern): email = line[self.sF["email"]] ret = self.stringMatch(email, pattern) return ret def stringMatch(self, cString, cPattern): ret = False e = s = "" string = cString.lower() pattern = cPattern.lower() if pattern.startswith("*"): e = "e" pattern = pattern[1:] if pattern.endswith("*"): s = "s" pattern = pattern[:-1] if (e == "e" and s == "s"): if string.find(pattern) != -1: return True elif (e == "e"): if string.endswith(pattern): return True elif (s == "s"): if string.startswith(pattern): return True else: if string == pattern: return True return ret def checkUserId(self, line, pattern): """ check for the userId """ ret = False try: cUserId = int(line[self.sF["userid"]]) except: return ret (op, val) = tokenise(">=|<=|>|<|=|between")(pattern) if op == "between": (lVal, hVal) = val.split(",", 2) try: ilVal = int(lVal.strip()) ihVal = int(hVal.strip()) if ihVal < ilVal: v = ihVal ihVal = ilVal ilVal = v except: return ret if (cUserId <= ihVal and cUserId >= ilVal): ret = True else: try: ival = int(val) except: return ret if op == "=": if (cUserId == ival): ret = True elif op == ">": if (cUserId > ival): ret = True elif op == ">=": if (cUserId >= ival): ret = True elif op == "<": if (cUserId < ival): ret = True elif op == "<=": if (cUserId < ival): ret = True return ret ############################################################# # server info methods ############################################################# def getResolverId(self): """ getResolverId(LoginName) - returns the resolver identifier string - empty string if not exist """ return self.fileName @classmethod def getResolverClassType(cls): return 'passwdresolver' def getResolverType(self): return IdResolver.getResolverClassType() @classmethod def getResolverClassDescriptor(cls): ''' return the descriptor of the resolver, which is - the class name and - the config description :return: resolver description dict :rtype: dict ''' descriptor = {} typ = cls.getResolverClassType() descriptor['clazz'] = "useridresolver.PasswdIdResolver.IdResolver" descriptor['config'] = {'fileName': 'string'} return {typ: descriptor} def getResolverDescriptor(self): return IdResolver.getResolverClassDescriptor() def loadConfig(self, config, conf): """ loadConfig(configDict) The UserIdResolver could be configured from the pylon app config - here this could be the passwd file , whether it is /etc/passwd or /etc/shadow """ l_config, missing = self.filter_config(config, conf) if missing: log.error("missing config entries: %r", missing) raise ResolverLoadConfigError(" missing config entries:" " %r" % missing) fileName = l_config["fileName"] # support for relative file names if "%(here)s" in fileName and "linotp.root" in l_config: fileName = fileName.replace("%(here)s", l_config["linotp.root"]) fileName = os.path.realpath(fileName) if (not os.path.isfile(fileName) or not os.access(fileName, os.R_OK)): raise ResolverLoadConfigError('File %r does not exist or is not ' 'accesible' % fileName) self.fileName = fileName self.loadFile() return self if __name__ == "__main__": print " PasswdIdResolver - IdResolver class test " y = getResolverClass("PasswdIdResolver", "IdResolver")() y.loadConfig({'linotp.passwdresolver.fileName': '/etc/passwd'}, "") x = getResolverClass("PasswdIdResolver", "IdResolver")() x.loadConfig({'linotp.passwdresolver.fileName': '/etc/meinpass'}, "") print "======/etc/meinpass==========" print x.getUserList({'username': '*', "userid": ">= 1000"}) print "======/etc/passwd==========" print y.getUserList({'username': '*', "userid": ">= 1000"}) print "================" user = "koelbel" loginId = y.getUserId(user) print " %s - %s" % (user, loginId) print " reId - " + y.getResolverId() ret = y.getUserInfo(loginId) print "result %r" % ret ret = y.getSearchFields() #ret["username"]="^bea*" search = { "userid": " between 1000, 1005", # "username":"^bea*", #"description":"*Audio*", # "descriptio":"*Winkler*", # "userid":" <=1003", } # ret = y.getUserList(search) print ret
PypiClean
/quart_openapi-1.7.2-py3-none-any.whl/quart_openapi/swagger.py
from collections import OrderedDict from http import HTTPStatus from itertools import chain from typing import (Any, Callable, Dict, Generator, Iterable, List, Mapping, Optional, Tuple, Union) from jsonschema import Draft4Validator from quart.routing import Map as RouteMap from werkzeug.routing import _rule_re as ROUTE_VAR_RE from .marshmallow import MARSHMALLOW, schema_to_json from .resource import Resource, get_expect_args from .typing import HeaderType, ValidatorTypes, Schema from .utils import extract_path, merge, not_none, parse_docstring DEFAULT_RESPONSE_DESCRIPTION = 'Success' DEFAULT_RESPONSE = {'description': DEFAULT_RESPONSE_DESCRIPTION} PY_TYPES = { int: 'integer', float: 'number', str: 'string', bool: 'boolean', None: 'void' } PATH_TYPES = { 'int': 'integer', 'float': 'number', 'string': 'string', 'default': 'string' } def _clean_header(header: HeaderType) -> Dict[str, Any]: """Convert headers to dict representation :param header: Either a header description, a type, a validator, or a dict of keys for the header param object :return: The dict of properties for the given header param normalized to the openapi 3.0 spec """ if isinstance(header, str): header = {'description': header} typedef = header.get('type', 'string') if typedef in PY_TYPES: header['type'] = PY_TYPES[typedef] elif isinstance(typedef, (list, tuple)) and len(typedef) == 1 and typedef[0] in PY_TYPES: header['type'] = 'array' header['items'] = {'type': PY_TYPES[typedef[0]]} elif hasattr(typedef, '__schema__'): header.update(typedef.__schema__) else: header['type'] = typedef return not_none(header) def _parse_rule(rule: str) -> Generator[Tuple[str, str], None, None]: """Generator for the converters for the path parameters :param rule: a route string :return: each iteration yields the next tuple of (converter name, variable name) """ for match in ROUTE_VAR_RE.finditer(rule): named_groups = match.groupdict() yield (named_groups['converter'], named_groups['variable']) def _extract_path_params(path: str) -> OrderedDict: """Generate the path params from the route :param path: The route string :return: An :class:`~collections.OrderedDict` of param names to definitions """ params = OrderedDict() for converter, variable in _parse_rule(path): if not converter: continue param = { 'name': variable, 'in': 'path', 'required': True, 'schema': {} } if converter in PATH_TYPES: param['schema']['type'] = PATH_TYPES[converter] elif converter == 'uuid': param['schema']['type'] = 'string' param['schema']['format'] = 'uuid' elif converter in RouteMap.default_converters: param['schema']['type'] = 'string' else: raise ValueError('Unsupported type converter: %s' % converter) params[variable] = param return params class Swagger(): """Class for generating a openapi.json from the resources and information defined with :class:`~factset.quart_openapi.Pint`""" def __init__(self, api: 'Pint') -> None: """Construct a Swagger object for generating the openapi Json :param api: the main app interface for getting the base model and resources """ self.api = api self._components = OrderedDict([('schemas', OrderedDict()), ('responses', OrderedDict()), ('parameters', OrderedDict()), ('examples', OrderedDict()), ('requestBodies', OrderedDict()), ('headers', OrderedDict()), ('securitySchemes', OrderedDict())]) def as_dict(self) -> Dict[str, Any]: """Return a dict which can be used with the :mod:`json` module to return valid json""" infos = { 'title': self.api.title or 'OpenApi Rest Documentation', 'version': self.api.version or '1.0' } if self.api.description: infos['description'] = self.api.description if self.api.contact and (self.api.contact_email or self.api.contact_url): infos['contact'] = not_none({ 'name': self.api.contact, 'email': self.api.contact_email, 'url': self.api.contact_url }) components = self.serialize_components() or None paths = {} for resource, path, methods in self.api.resources: paths[extract_path(path)] = self.serialize_resource(resource, path, methods) scheme = self.api.config.get('PREFERRED_URL_SCHEME', 'http' if not self.api.config.get('PREFER_SECURE_URLS', False) else 'https') spec = { 'openapi': '3.0.0', 'info': infos, 'servers': [ { 'url': ''.join([scheme, '://', self.api.config['SERVER_NAME'] or '']) } ], 'paths': paths, 'components': components } return not_none(spec) def register_component(self, category: str, name: str, schema: Dict[str, Any]) -> None: """Used for populating the components_ section of the openapi docs :param category: The category under the component section :param name: The name of the model for reference :param schema: the actual schema for this object """ if category not in self._components: raise ValueError('invalid category for components') self._components[category][name] = schema def serialize_components(self) -> Mapping[str, Dict[str, Any]]: """Generate the json for the components_ section :return: An :class:`~collections.OrderedDict` of the components """ if self.api.base_model is None: return {} base_components = self.api.base_model.resolve('#/components')[1] for category, val in base_components.items(): for name, schema in val.items(): self.register_component(category, name, schema) return OrderedDict((k, v) for k, v in self._components.items() if v) @staticmethod def tags_for(doc: List[str]) -> Iterable[List[str]]: """Get the list of tags for output :param doc: a mapping from HTTP verb to the properties for serialization :return: a list of string containing tags as described by the openapi 3.0 spec """ tags = [] for name in doc['tags']: tags.append(name) return tags @staticmethod def description_for(doc: Dict[str, Any], method: str) -> str: """Extract the description metadata and fallback on the whole docstring :param doc: a mapping from HTTP verb to the properties for serialization :param method: The HTTP Verb function for the route :return: The description as pulled from the docstring for the description property """ parts = [] if 'description' in doc: parts.append(doc['description']) if method in doc and 'description' in doc[method]: parts.append(doc[method]['description']) if doc[method]['docstring']['details']: parts.append(doc[method]['docstring']['details']) return '\n'.join(parts).strip() def parameters_for(self, doc: Dict[str, Any]) -> Iterable[Dict[str, Any]]: """Get the list of param descriptions for output :param doc: a mapping from HTTP verb to the properties for serialization :return: a list of dict objects containing params as described by the openapi 3.0 spec """ params = [] for name, param in doc['params'].items(): if 'ref' in param: if isinstance(param['ref'], str) and param['ref'].startswith('#/components/'): params.append({'$ref': param['ref']}) else: params.append(self.serialize_schema(param['ref'])) continue param['name'] = name if 'schema' not in param: param['schema'] = {} if 'type' not in param['schema'] and '$ref' not in param['schema']: param['schema']['type'] = 'string' if 'in' not in param: param['in'] = 'query' params.append(param) return params def operation_id_for(self, doc: Dict[str, Any], method: str) -> str: """Return the operation id to be used for openapi docs :param doc: a mapping from HTTP verb to the properties for serialization :param method: the HTTP Verb :return: The id str """ return doc[method]['id'] if 'id' in doc[method] else self.api.default_id(doc['name'], method) def responses_for(self, doc: Dict[str, Any], method: str) -> Dict[HTTPStatus, Dict[str, Any]]: """Get the Response dictionary for a given route and HTTP verb :param doc: a mapping from HTTP verb to the properties for serialization :param method: the HTTP Verb to get the responses for :return: A dict mapping status codes to object descriptions as per the `openapi response object`__ spec. __ https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md#responseObject """ def process_response(resp: Union[str, Tuple]) -> Tuple[str, Any, Dict[str, Any]]: description = '' validator = None kwargs = {} if isinstance(resp, str): description = resp validator = None kwargs = {} elif len(resp) == 3: description, validator, kwargs = resp elif len(resp) == 2: description, validator = resp kwargs = {} else: raise ValueError('Unsupported response specification') return (description, validator, kwargs) responses = {} for obj in doc, doc[method]: if 'responses' in obj: for code, response in obj['responses'].items(): description, validator, kwargs = process_response(response) description = description or DEFAULT_RESPONSE_DESCRIPTION if code in responses: responses[code].update(description=description) else: responses[code] = {'description': description} if validator: if 'content' not in responses[code]: responses[code]['content'] = {} content_type = kwargs.get('content_type') or 'application/json' if content_type not in responses[code]['content']: responses[code]['content'][content_type] = {} responses[code]['content'][content_type]['schema'] = self.serialize_schema(validator) self.process_headers(responses[code], doc, method, kwargs.get('headers')) if not responses: responses[HTTPStatus.OK.value] = self.process_headers(DEFAULT_RESPONSE.copy(), doc, method) return responses @staticmethod def process_headers(response: Dict[str, Any], doc: Dict[str, Any], method: Optional[str] = None, headers: Optional[Dict[str, Union[str, Dict[str, Any]]]] = None) -> Dict[str, Any]: """Properly form the header parameter objects according to the openapi 3.0 spec :param response: Response object definition :param doc: a mapping from HTTP verb to the properties for serialization :param method: the HTTP verb for specific requests or None for all in the resource :param headers: Header object dict to add to whatever is already in the resource and function decorators :return: The full set of headers for this particular route and request method joining the resource level, method level and any additional headers passed in """ method_doc = doc.get(method, {}) if 'headers' in doc or 'headers' in method_doc or headers: response['headers'] = dict( (k, _clean_header(v)) for k, v in chain( doc.get('headers', {}).items(), method_doc.get('headers', {}).items(), (headers or {}).items()) ) return response def serialize_schema(self, validator: ValidatorTypes) -> Dict[str, Any]: """Given a validator normalize the schema definition :param validator: either the name of a validator, a :class:`~jsonschema.Draft4Validator` instance, or the actual type of the value. Passing a list or tuple will create a schema for an array of that type :return: The schema as defined by the openapi 3.0 spec as a dict """ if isinstance(validator, (list, tuple)): validator = validator[0] return { 'type': 'array', 'items': self.serialize_schema(validator) } if isinstance(validator, Draft4Validator): return validator.schema if isinstance(validator, str): validator = self.api.get_validator(validator) return validator.schema if MARSHMALLOW and isinstance(validator, Schema): return schema_to_json(validator) if isinstance(validator, (type, type(None))) and validator in PY_TYPES: return {'type': PY_TYPES[validator]} return {} def serialize_resource(self, resource: Union[Resource, Callable], path: str, methods: Iterable[str]) -> Dict[str, Any]: """Use the docstring and any decorated info to create the resource object :param resource: the Resource object or view function :param path: the route path for this resource :param methods: The list of available HTTP verbs for this route :return: The dict conforming to the openapi 3.0 spec for a `path item object`__ __ https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md#pathItemObject """ doc = self.extract_resource_doc(resource, path) if doc is False: return {} path = {} for method in [m.lower() for m in resource.methods or []]: methods = [m.lower() for m in methods or []] if doc[method] is False or methods and method not in methods: continue path[method] = self.serialize_operation(doc, method) return not_none(path) def serialize_operation(self, doc: Mapping[str, Any], method: str) -> Dict[str, Any]: """Serialize a single operation on the resource corresponding to a single HTTP verb :param doc: a mapping from HTTP verb to the properties for serialization :param method: The HTTP verb for this operation :return: The dict openapi representation to be converted to json for this operation """ operation = { 'summary': doc[method]['docstring']['summary'], 'description': self.description_for(doc, method), 'tags': self.tags_for(doc[method]), 'parameters': self.parameters_for(doc[method]) or None, 'responses': self.responses_for(doc, method) or None, 'operationId': self.operation_id_for(doc, method) } body = merge(self.expected_params(doc), self.expected_params(doc[method])) if body: operation['requestBody'] = body if doc.get('deprecated') or doc[method].get('deprecated'): operation['deprecated'] = True return not_none(operation) @staticmethod def extract_resource_doc(resource: Union[Resource, Callable], path: str) -> Dict[str, Any]: """Return the doc mapping for this resource that we saved on it :param resource: The :class:`Resource` derived class or decorated view function :param path: The route for this resource :return: a mapping from HTTP verb to the properties for serialization This returns the object that is passed into the `serialize_*` functions that expect a `doc` parameter """ doc = getattr(resource, '__apidoc__', {}) if doc is False: return False doc['name'] = resource.__name__ params = merge(doc.get('params', OrderedDict()), _extract_path_params(path)) doc['params'] = params tags = doc.get('tags', list()) doc['tags'] = tags for method in [m.lower() for m in resource.methods or []]: method_doc = doc.get(method, OrderedDict()) method_impl = getattr(resource, method) if hasattr(method_impl, 'im_func'): method_impl = method_impl.im_func elif hasattr(method_impl, '__func__'): method_impl = method_impl.__func__ method_doc = merge(method_doc, getattr(method_impl, '__apidoc__', OrderedDict())) if method_doc is not False: method_doc['docstring'] = parse_docstring(method_impl) method_params = method_doc.get('params', {}) inherited_params = OrderedDict((k, v) for k, v in params.items()) method_doc['params'] = merge(inherited_params, method_params) method_tags = method_doc.get('tags', []) inherited_tags = sorted(list(tags)) method_doc['tags'] = merge(inherited_tags, method_tags) doc[method] = method_doc return doc def expected_params(self, doc: Dict[str, Any]) -> Dict[str, Any]: """Return the `Media Type object <https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md#mediaTypeObject>`_ for the expected request body. :param doc: a mapping from HTTP verb to the properties for serialization :return: a dict containing the content type and schemas for the requestBody """ params = OrderedDict() if 'expect' not in doc: return params for expect in doc.get('expect', []): validator, content_type, kwargs = get_expect_args(expect) if isinstance(validator, str): validator = self.api.get_validator(validator) elif MARSHMALLOW and isinstance(validator, Schema): pass elif not isinstance(validator, Draft4Validator): continue schema = self.serialize_schema(validator) if '$ref' in schema and '/components/requestBodies/' in schema['$ref']: return schema params[content_type] = not_none(dict({ 'schema': self.serialize_schema(validator) }, **kwargs)) return {'content': params}
PypiClean
/pi-env-0.1.2rc1.tar.gz/pi-env-0.1.2rc1/pi/_requires/docker/utils/build.py
import io import os import re import tarfile import tempfile import pi._requires.six from .fnmatch import fnmatch from ..constants import IS_WINDOWS_PLATFORM _SEP = re.compile('/|\\\\') if IS_WINDOWS_PLATFORM else re.compile('/') def tar(path, exclude=None, dockerfile=None, fileobj=None, gzip=False): root = os.path.abspath(path) exclude = exclude or [] dockerfile = dockerfile or (None, None) extra_files = [] if dockerfile[1] is not None: dockerignore_contents = '\n'.join( (exclude or ['.dockerignore']) + [dockerfile[0]] ) extra_files = [ ('.dockerignore', dockerignore_contents), dockerfile, ] return create_archive( files=sorted(exclude_paths(root, exclude, dockerfile=dockerfile[0])), root=root, fileobj=fileobj, gzip=gzip, extra_files=extra_files ) def exclude_paths(root, patterns, dockerfile=None): """ Given a root directory path and a list of .dockerignore patterns, return an iterator of all paths (both regular files and directories) in the root directory that do *not* match any of the patterns. All paths returned are relative to the root. """ if dockerfile is None: dockerfile = 'Dockerfile' patterns.append('!' + dockerfile) pm = PatternMatcher(patterns) return set(pm.walk(root)) def build_file_list(root): files = [] for dirname, dirnames, fnames in os.walk(root): for filename in fnames + dirnames: longpath = os.path.join(dirname, filename) files.append( longpath.replace(root, '', 1).lstrip('/') ) return files def create_archive(root, files=None, fileobj=None, gzip=False, extra_files=None): extra_files = extra_files or [] if not fileobj: fileobj = tempfile.NamedTemporaryFile() t = tarfile.open(mode='w:gz' if gzip else 'w', fileobj=fileobj) if files is None: files = build_file_list(root) extra_names = set(e[0] for e in extra_files) for path in files: if path in extra_names: # Extra files override context files with the same name continue full_path = os.path.join(root, path) i = t.gettarinfo(full_path, arcname=path) if i is None: # This happens when we encounter a socket file. We can safely # ignore it and proceed. continue # Workaround https://bugs.python.org/issue32713 if i.mtime < 0 or i.mtime > 8**11 - 1: i.mtime = int(i.mtime) if IS_WINDOWS_PLATFORM: # Windows doesn't keep track of the execute bit, so we make files # and directories executable by default. i.mode = i.mode & 0o755 | 0o111 if i.isfile(): try: with open(full_path, 'rb') as f: t.addfile(i, f) except IOError: raise IOError( 'Can not read file in context: {}'.format(full_path) ) else: # Directories, FIFOs, symlinks... don't need to be read. t.addfile(i, None) for name, contents in extra_files: info = tarfile.TarInfo(name) info.size = len(contents) t.addfile(info, io.BytesIO(contents.encode('utf-8'))) t.close() fileobj.seek(0) return fileobj def mkbuildcontext(dockerfile): f = tempfile.NamedTemporaryFile() t = tarfile.open(mode='w', fileobj=f) if isinstance(dockerfile, io.StringIO): dfinfo = tarfile.TarInfo('Dockerfile') if pi._requires.six.PY3: raise TypeError('Please use io.BytesIO to create in-memory ' 'Dockerfiles with Python 3') else: dfinfo.size = len(dockerfile.getvalue()) dockerfile.seek(0) elif isinstance(dockerfile, io.BytesIO): dfinfo = tarfile.TarInfo('Dockerfile') dfinfo.size = len(dockerfile.getvalue()) dockerfile.seek(0) else: dfinfo = t.gettarinfo(fileobj=dockerfile, arcname='Dockerfile') t.addfile(dfinfo, dockerfile) t.close() f.seek(0) return f def split_path(p): return [pt for pt in re.split(_SEP, p) if pt and pt != '.'] def normalize_slashes(p): if IS_WINDOWS_PLATFORM: return '/'.join(split_path(p)) return p def walk(root, patterns, default=True): pm = PatternMatcher(patterns) return pm.walk(root) # Heavily based on # https://github.com/moby/moby/blob/master/pkg/fileutils/fileutils.go class PatternMatcher(object): def __init__(self, patterns): self.patterns = list(filter( lambda p: p.dirs, [Pattern(p) for p in patterns] )) self.patterns.append(Pattern('!.dockerignore')) def matches(self, filepath): matched = False parent_path = os.path.dirname(filepath) parent_path_dirs = split_path(parent_path) for pattern in self.patterns: negative = pattern.exclusion match = pattern.match(filepath) if not match and parent_path != '': if len(pattern.dirs) <= len(parent_path_dirs): match = pattern.match( os.path.sep.join(parent_path_dirs[:len(pattern.dirs)]) ) if match: matched = not negative return matched def walk(self, root): def rec_walk(current_dir): for f in os.listdir(current_dir): fpath = os.path.join( os.path.relpath(current_dir, root), f ) if fpath.startswith('.' + os.path.sep): fpath = fpath[2:] match = self.matches(fpath) if not match: yield fpath cur = os.path.join(root, fpath) if not os.path.isdir(cur) or os.path.islink(cur): continue if match: # If we want to skip this file and it's a directory # then we should first check to see if there's an # excludes pattern (e.g. !dir/file) that starts with this # dir. If so then we can't skip this dir. skip = True for pat in self.patterns: if not pat.exclusion: continue if pat.cleaned_pattern.startswith( normalize_slashes(fpath)): skip = False break if skip: continue for sub in rec_walk(cur): yield sub return rec_walk(root) class Pattern(object): def __init__(self, pattern_str): self.exclusion = False if pattern_str.startswith('!'): self.exclusion = True pattern_str = pattern_str[1:] self.dirs = self.normalize(pattern_str) self.cleaned_pattern = '/'.join(self.dirs) @classmethod def normalize(cls, p): # Leading and trailing slashes are not relevant. Yes, # "foo.py/" must exclude the "foo.py" regular file. "." # components are not relevant either, even if the whole # pattern is only ".", as the Docker reference states: "For # historical reasons, the pattern . is ignored." # ".." component must be cleared with the potential previous # component, regardless of whether it exists: "A preprocessing # step [...] eliminates . and .. elements using Go's # filepath.". i = 0 split = split_path(p) while i < len(split): if split[i] == '..': del split[i] if i > 0: del split[i - 1] i -= 1 else: i += 1 return split def match(self, filepath): return fnmatch(normalize_slashes(filepath), self.cleaned_pattern)
PypiClean
/concrete_ml_extensions_brevitas-0.1.0-py3-none-any.whl/brevitas/nn/quant_dropout.py
# All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # 3. Neither the names of Xilinx, Facebook, Deepmind Technologies, NYU, # NEC Laboratories America and IDIAP Research Institute nor the names # of its contributors may be used to endorse or promote products derived # from this software without specific prior written permission. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. from typing import Union from torch import Tensor from torch.nn import Dropout from brevitas.quant_tensor import QuantTensor from .mixin.base import QuantLayerMixin class QuantDropout(QuantLayerMixin, Dropout): def __init__(self, p: float = 0.5, return_quant_tensor: bool = True): Dropout.__init__(self, p=p, inplace=False) QuantLayerMixin.__init__( self, return_quant_tensor=return_quant_tensor) @property def channelwise_separable(self) -> bool: return True @property def requires_export_handler(self): return False def forward(self, input: Union[Tensor, QuantTensor]): x = self.unpack_input(input) x = x.set(value=super().forward(x.value)) return self.pack_output(x)
PypiClean
/sentry-nos-9.0.0.tar.gz/sentry-nos-9.0.0/src/sentry/south_migrations/0407_auto__add_field_identityprovider_external_id__add_unique_identityprovi.py
from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): # Flag to indicate if this migration is too risky # to run online and needs to be coordinated for offline is_dangerous = False def forwards(self, orm): # Adding field 'IdentityProvider.external_id' db.add_column('sentry_identityprovider', 'external_id', self.gf('django.db.models.fields.CharField')(max_length=64, null=True), keep_default=False) # Adding unique constraint on 'IdentityProvider', fields ['type', 'organization', 'external_id'] db.create_unique('sentry_identityprovider', ['type', 'organization_id', 'external_id']) def backwards(self, orm): # Removing unique constraint on 'IdentityProvider', fields ['type', 'organization', 'external_id'] db.delete_unique('sentry_identityprovider', ['type', 'organization_id', 'external_id']) # Deleting field 'IdentityProvider.external_id' db.delete_column('sentry_identityprovider', 'external_id') models = { 'sentry.activity': { 'Meta': {'object_name': 'Activity'}, 'data': ('sentry.db.models.fields.gzippeddict.GzippedDictField', [], {'null': 'True'}), 'datetime': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'group': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Group']", 'null': 'True'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'ident': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}), 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Project']"}), 'type': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {}), 'user': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.User']", 'null': 'True'}) }, 'sentry.apiapplication': { 'Meta': {'object_name': 'ApiApplication'}, 'allowed_origins': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), 'client_id': ('django.db.models.fields.CharField', [], {'default': "'2746835292a94f05b360946dbacef682afa430d924ea428c89cb38444fdecb1c'", 'unique': 'True', 'max_length': '64'}), 'client_secret': ('sentry.db.models.fields.encrypted.EncryptedTextField', [], {'default': "'c5e8ba173f594f1d8ba1660cd84e849ce9189bbcbb6e4bafbcfa6dff8826cb5a'"}), 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'homepage_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'default': "'Tender Dinosaur'", 'max_length': '64', 'blank': 'True'}), 'owner': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.User']"}), 'privacy_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True'}), 'redirect_uris': ('django.db.models.fields.TextField', [], {}), 'status': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'default': '0', 'db_index': 'True'}), 'terms_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True'}) }, 'sentry.apiauthorization': { 'Meta': {'unique_together': "(('user', 'application'),)", 'object_name': 'ApiAuthorization'}, 'application': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.ApiApplication']", 'null': 'True'}), 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'scope_list': ('sentry.db.models.fields.array.ArrayField', [], {'of': ('django.db.models.fields.TextField', [], {})}), 'scopes': ('django.db.models.fields.BigIntegerField', [], {'default': 'None'}), 'user': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.User']"}) }, 'sentry.apigrant': { 'Meta': {'object_name': 'ApiGrant'}, 'application': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.ApiApplication']"}), 'code': ('django.db.models.fields.CharField', [], {'default': "'2053f1d817f647a29cf94787d2bde1f9'", 'max_length': '64', 'db_index': 'True'}), 'expires_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2018, 4, 24, 0, 0)', 'db_index': 'True'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'redirect_uri': ('django.db.models.fields.CharField', [], {'max_length': '255'}), 'scope_list': ('sentry.db.models.fields.array.ArrayField', [], {'of': ('django.db.models.fields.TextField', [], {})}), 'scopes': ('django.db.models.fields.BigIntegerField', [], {'default': 'None'}), 'user': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.User']"}) }, 'sentry.apikey': { 'Meta': {'object_name': 'ApiKey'}, 'allowed_origins': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32'}), 'label': ('django.db.models.fields.CharField', [], {'default': "'Default'", 'max_length': '64', 'blank': 'True'}), 'organization': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'related_name': "'key_set'", 'to': "orm['sentry.Organization']"}), 'scope_list': ('sentry.db.models.fields.array.ArrayField', [], {'of': ('django.db.models.fields.TextField', [], {})}), 'scopes': ('django.db.models.fields.BigIntegerField', [], {'default': 'None'}), 'status': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'default': '0', 'db_index': 'True'}) }, 'sentry.apitoken': { 'Meta': {'object_name': 'ApiToken'}, 'application': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.ApiApplication']", 'null': 'True'}), 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'expires_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2018, 5, 24, 0, 0)', 'null': 'True'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'refresh_token': ('django.db.models.fields.CharField', [], {'default': "'350a919b00554eff87ced447cbd0cad40dcb4ad83e994a019b934ce57934ffa8'", 'max_length': '64', 'unique': 'True', 'null': 'True'}), 'scope_list': ('sentry.db.models.fields.array.ArrayField', [], {'of': ('django.db.models.fields.TextField', [], {})}), 'scopes': ('django.db.models.fields.BigIntegerField', [], {'default': 'None'}), 'token': ('django.db.models.fields.CharField', [], {'default': "'abf4461f4d774ed1b9a4a7eb8becf5e1d84d9694cf424894a13690735c671cc0'", 'unique': 'True', 'max_length': '64'}), 'user': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.User']"}) }, 'sentry.assistantactivity': { 'Meta': {'unique_together': "(('user', 'guide_id'),)", 'object_name': 'AssistantActivity', 'db_table': "'sentry_assistant_activity'"}, 'dismissed_ts': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), 'guide_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'useful': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), 'user': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.User']"}), 'viewed_ts': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}) }, 'sentry.auditlogentry': { 'Meta': {'object_name': 'AuditLogEntry'}, 'actor': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'blank': 'True', 'related_name': "'audit_actors'", 'null': 'True', 'to': "orm['sentry.User']"}), 'actor_key': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.ApiKey']", 'null': 'True', 'blank': 'True'}), 'actor_label': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True', 'blank': 'True'}), 'data': ('sentry.db.models.fields.gzippeddict.GzippedDictField', [], {}), 'datetime': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'event': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'ip_address': ('django.db.models.fields.GenericIPAddressField', [], {'max_length': '39', 'null': 'True'}), 'organization': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Organization']"}), 'target_object': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True'}), 'target_user': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'blank': 'True', 'related_name': "'audit_targets'", 'null': 'True', 'to': "orm['sentry.User']"}) }, 'sentry.authenticator': { 'Meta': {'unique_together': "(('user', 'type'),)", 'object_name': 'Authenticator', 'db_table': "'auth_authenticator'"}, 'config': ('sentry.db.models.fields.encrypted.EncryptedPickledObjectField', [], {}), 'created_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'id': ('sentry.db.models.fields.bounded.BoundedAutoField', [], {'primary_key': 'True'}), 'last_used_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), 'type': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {}), 'user': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.User']"}) }, 'sentry.authidentity': { 'Meta': {'unique_together': "(('auth_provider', 'ident'), ('auth_provider', 'user'))", 'object_name': 'AuthIdentity'}, 'auth_provider': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.AuthProvider']"}), 'data': ('sentry.db.models.fields.encrypted.EncryptedJsonField', [], {'default': '{}'}), 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'ident': ('django.db.models.fields.CharField', [], {'max_length': '128'}), 'last_synced': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'last_verified': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'user': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.User']"}) }, 'sentry.authprovider': { 'Meta': {'object_name': 'AuthProvider'}, 'config': ('sentry.db.models.fields.encrypted.EncryptedJsonField', [], {'default': '{}'}), 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'default_global_access': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), 'default_role': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'default': '50'}), 'default_teams': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['sentry.Team']", 'symmetrical': 'False', 'blank': 'True'}), 'flags': ('django.db.models.fields.BigIntegerField', [], {'default': '0'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'last_sync': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), 'organization': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Organization']", 'unique': 'True'}), 'provider': ('django.db.models.fields.CharField', [], {'max_length': '128'}), 'sync_time': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True'}) }, 'sentry.broadcast': { 'Meta': {'object_name': 'Broadcast'}, 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'date_expires': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2018, 5, 1, 0, 0)', 'null': 'True', 'blank': 'True'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'db_index': 'True'}), 'link': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), 'message': ('django.db.models.fields.CharField', [], {'max_length': '256'}), 'title': ('django.db.models.fields.CharField', [], {'max_length': '32'}), 'upstream_id': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}) }, 'sentry.broadcastseen': { 'Meta': {'unique_together': "(('broadcast', 'user'),)", 'object_name': 'BroadcastSeen'}, 'broadcast': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Broadcast']"}), 'date_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'user': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.User']"}) }, 'sentry.commit': { 'Meta': {'unique_together': "(('repository_id', 'key'),)", 'object_name': 'Commit', 'index_together': "(('repository_id', 'date_added'),)"}, 'author': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.CommitAuthor']", 'null': 'True'}), 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'key': ('django.db.models.fields.CharField', [], {'max_length': '64'}), 'message': ('django.db.models.fields.TextField', [], {'null': 'True'}), 'organization_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'db_index': 'True'}), 'repository_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {}) }, 'sentry.commitauthor': { 'Meta': {'unique_together': "(('organization_id', 'email'), ('organization_id', 'external_id'))", 'object_name': 'CommitAuthor'}, 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75'}), 'external_id': ('django.db.models.fields.CharField', [], {'max_length': '164', 'null': 'True'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True'}), 'organization_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'db_index': 'True'}) }, 'sentry.commitfilechange': { 'Meta': {'unique_together': "(('commit', 'filename'),)", 'object_name': 'CommitFileChange'}, 'commit': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Commit']"}), 'filename': ('django.db.models.fields.CharField', [], {'max_length': '255'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'organization_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'db_index': 'True'}), 'type': ('django.db.models.fields.CharField', [], {'max_length': '1'}) }, 'sentry.counter': { 'Meta': {'object_name': 'Counter', 'db_table': "'sentry_projectcounter'"}, 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Project']", 'unique': 'True'}), 'value': ('sentry.db.models.fields.bounded.BoundedBigIntegerField', [], {}) }, 'sentry.deletedorganization': { 'Meta': {'object_name': 'DeletedOrganization'}, 'actor_id': ('sentry.db.models.fields.bounded.BoundedBigIntegerField', [], {'null': 'True'}), 'actor_key': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}), 'actor_label': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}), 'date_created': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), 'date_deleted': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'ip_address': ('django.db.models.fields.GenericIPAddressField', [], {'max_length': '39', 'null': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}), 'reason': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), 'slug': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True'}) }, 'sentry.deletedproject': { 'Meta': {'object_name': 'DeletedProject'}, 'actor_id': ('sentry.db.models.fields.bounded.BoundedBigIntegerField', [], {'null': 'True'}), 'actor_key': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}), 'actor_label': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}), 'date_created': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), 'date_deleted': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'ip_address': ('django.db.models.fields.GenericIPAddressField', [], {'max_length': '39', 'null': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True'}), 'organization_id': ('sentry.db.models.fields.bounded.BoundedBigIntegerField', [], {'null': 'True'}), 'organization_name': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}), 'organization_slug': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True'}), 'platform': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}), 'reason': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), 'slug': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True'}) }, 'sentry.deletedteam': { 'Meta': {'object_name': 'DeletedTeam'}, 'actor_id': ('sentry.db.models.fields.bounded.BoundedBigIntegerField', [], {'null': 'True'}), 'actor_key': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}), 'actor_label': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}), 'date_created': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), 'date_deleted': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'ip_address': ('django.db.models.fields.GenericIPAddressField', [], {'max_length': '39', 'null': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}), 'organization_id': ('sentry.db.models.fields.bounded.BoundedBigIntegerField', [], {'null': 'True'}), 'organization_name': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}), 'organization_slug': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True'}), 'reason': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), 'slug': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True'}) }, 'sentry.deploy': { 'Meta': {'object_name': 'Deploy'}, 'date_finished': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'date_started': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), 'environment_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'db_index': 'True'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True', 'blank': 'True'}), 'notified': ('django.db.models.fields.NullBooleanField', [], {'default': 'False', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), 'organization_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'db_index': 'True'}), 'release': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Release']"}), 'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}) }, 'sentry.distribution': { 'Meta': {'unique_together': "(('release', 'name'),)", 'object_name': 'Distribution'}, 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '64'}), 'organization_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'db_index': 'True'}), 'release': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Release']"}) }, 'sentry.dsymapp': { 'Meta': {'unique_together': "(('project', 'platform', 'app_id'),)", 'object_name': 'DSymApp'}, 'app_id': ('django.db.models.fields.CharField', [], {'max_length': '64'}), 'data': ('jsonfield.fields.JSONField', [], {'default': '{}'}), 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'last_synced': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'platform': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'default': '0'}), 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Project']"}), 'sync_id': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}) }, 'sentry.email': { 'Meta': {'object_name': 'Email'}, 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'email': ('sentry.db.models.fields.citext.CIEmailField', [], {'unique': 'True', 'max_length': '75'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}) }, 'sentry.environment': { 'Meta': {'unique_together': "(('organization_id', 'name'),)", 'object_name': 'Environment'}, 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '64'}), 'organization_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {}), 'project_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True'}), 'projects': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['sentry.Project']", 'through': "orm['sentry.EnvironmentProject']", 'symmetrical': 'False'}) }, 'sentry.environmentproject': { 'Meta': {'unique_together': "(('project', 'environment'),)", 'object_name': 'EnvironmentProject'}, 'environment': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Environment']"}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'is_hidden': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Project']"}) }, 'sentry.event': { 'Meta': {'unique_together': "(('project_id', 'event_id'),)", 'object_name': 'Event', 'db_table': "'sentry_message'", 'index_together': "(('group_id', 'datetime'),)"}, 'data': ('sentry.db.models.fields.node.NodeField', [], {'null': 'True', 'blank': 'True'}), 'datetime': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'db_index': 'True'}), 'event_id': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'db_column': "'message_id'"}), 'group_id': ('sentry.db.models.fields.bounded.BoundedBigIntegerField', [], {'null': 'True', 'blank': 'True'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'message': ('django.db.models.fields.TextField', [], {}), 'platform': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}), 'project_id': ('sentry.db.models.fields.bounded.BoundedBigIntegerField', [], {'null': 'True', 'blank': 'True'}), 'time_spent': ('sentry.db.models.fields.bounded.BoundedIntegerField', [], {'null': 'True'}) }, 'sentry.eventmapping': { 'Meta': {'unique_together': "(('project_id', 'event_id'),)", 'object_name': 'EventMapping'}, 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'event_id': ('django.db.models.fields.CharField', [], {'max_length': '32'}), 'group_id': ('sentry.db.models.fields.bounded.BoundedBigIntegerField', [], {}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'project_id': ('sentry.db.models.fields.bounded.BoundedBigIntegerField', [], {}) }, 'sentry.eventprocessingissue': { 'Meta': {'unique_together': "(('raw_event', 'processing_issue'),)", 'object_name': 'EventProcessingIssue'}, 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'processing_issue': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.ProcessingIssue']"}), 'raw_event': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.RawEvent']"}) }, 'sentry.eventtag': { 'Meta': {'unique_together': "(('event_id', 'key_id', 'value_id'),)", 'object_name': 'EventTag', 'index_together': "(('group_id', 'key_id', 'value_id'),)"}, 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'db_index': 'True'}), 'event_id': ('sentry.db.models.fields.bounded.BoundedBigIntegerField', [], {}), 'group_id': ('sentry.db.models.fields.bounded.BoundedBigIntegerField', [], {'null': 'True'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'key_id': ('sentry.db.models.fields.bounded.BoundedBigIntegerField', [], {}), 'project_id': ('sentry.db.models.fields.bounded.BoundedBigIntegerField', [], {}), 'value_id': ('sentry.db.models.fields.bounded.BoundedBigIntegerField', [], {}) }, 'sentry.eventuser': { 'Meta': {'unique_together': "(('project_id', 'ident'), ('project_id', 'hash'))", 'object_name': 'EventUser', 'index_together': "(('project_id', 'email'), ('project_id', 'username'), ('project_id', 'ip_address'))"}, 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'db_index': 'True'}), 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'null': 'True'}), 'hash': ('django.db.models.fields.CharField', [], {'max_length': '32'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'ident': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True'}), 'ip_address': ('django.db.models.fields.GenericIPAddressField', [], {'max_length': '39', 'null': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True'}), 'project_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'db_index': 'True'}), 'username': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True'}) }, 'sentry.featureadoption': { 'Meta': {'unique_together': "(('organization', 'feature_id'),)", 'object_name': 'FeatureAdoption'}, 'applicable': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), 'complete': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'data': ('jsonfield.fields.JSONField', [], {'default': '{}'}), 'date_completed': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'feature_id': ('django.db.models.fields.PositiveIntegerField', [], {}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'organization': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Organization']"}) }, 'sentry.file': { 'Meta': {'object_name': 'File'}, 'blob': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'related_name': "'legacy_blob'", 'null': 'True', 'to': "orm['sentry.FileBlob']"}), 'blobs': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['sentry.FileBlob']", 'through': "orm['sentry.FileBlobIndex']", 'symmetrical': 'False'}), 'checksum': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True', 'db_index': 'True'}), 'headers': ('jsonfield.fields.JSONField', [], {'default': '{}'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}), 'path': ('django.db.models.fields.TextField', [], {'null': 'True'}), 'size': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True'}), 'timestamp': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'db_index': 'True'}), 'type': ('django.db.models.fields.CharField', [], {'max_length': '64'}) }, 'sentry.fileblob': { 'Meta': {'object_name': 'FileBlob'}, 'checksum': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '40'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'path': ('django.db.models.fields.TextField', [], {'null': 'True'}), 'size': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True'}), 'timestamp': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'db_index': 'True'}) }, 'sentry.fileblobindex': { 'Meta': {'unique_together': "(('file', 'blob', 'offset'),)", 'object_name': 'FileBlobIndex'}, 'blob': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.FileBlob']"}), 'file': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.File']"}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'offset': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {}) }, 'sentry.fileblobowner': { 'Meta': {'unique_together': "(('blob', 'organization'),)", 'object_name': 'FileBlobOwner'}, 'blob': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.FileBlob']"}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'organization': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Organization']"}) }, 'sentry.group': { 'Meta': {'unique_together': "(('project', 'short_id'),)", 'object_name': 'Group', 'db_table': "'sentry_groupedmessage'", 'index_together': "(('project', 'first_release'),)"}, 'active_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), 'culprit': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'db_column': "'view'", 'blank': 'True'}), 'data': ('sentry.db.models.fields.gzippeddict.GzippedDictField', [], {'null': 'True', 'blank': 'True'}), 'first_release': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Release']", 'null': 'True', 'on_delete': 'models.PROTECT'}), 'first_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'db_index': 'True'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'is_public': ('django.db.models.fields.NullBooleanField', [], {'default': 'False', 'null': 'True', 'blank': 'True'}), 'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'db_index': 'True'}), 'level': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'default': '40', 'db_index': 'True', 'blank': 'True'}), 'logger': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '64', 'db_index': 'True', 'blank': 'True'}), 'message': ('django.db.models.fields.TextField', [], {}), 'num_comments': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'default': '0', 'null': 'True'}), 'platform': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}), 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Project']", 'null': 'True'}), 'resolved_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), 'score': ('sentry.db.models.fields.bounded.BoundedIntegerField', [], {'default': '0'}), 'short_id': ('sentry.db.models.fields.bounded.BoundedBigIntegerField', [], {'null': 'True'}), 'status': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'default': '0', 'db_index': 'True'}), 'time_spent_count': ('sentry.db.models.fields.bounded.BoundedIntegerField', [], {'default': '0'}), 'time_spent_total': ('sentry.db.models.fields.bounded.BoundedIntegerField', [], {'default': '0'}), 'times_seen': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'default': '1', 'db_index': 'True'}) }, 'sentry.groupassignee': { 'Meta': {'object_name': 'GroupAssignee', 'db_table': "'sentry_groupasignee'"}, 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'group': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'related_name': "'assignee_set'", 'unique': 'True', 'to': "orm['sentry.Group']"}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'related_name': "'assignee_set'", 'to': "orm['sentry.Project']"}), 'team': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'related_name': "'sentry_assignee_set'", 'null': 'True', 'to': "orm['sentry.Team']"}), 'user': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'related_name': "'sentry_assignee_set'", 'null': 'True', 'to': "orm['sentry.User']"}) }, 'sentry.groupbookmark': { 'Meta': {'unique_together': "(('project', 'user', 'group'),)", 'object_name': 'GroupBookmark'}, 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'null': 'True'}), 'group': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'related_name': "'bookmark_set'", 'to': "orm['sentry.Group']"}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'related_name': "'bookmark_set'", 'to': "orm['sentry.Project']"}), 'user': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'related_name': "'sentry_bookmark_set'", 'to': "orm['sentry.User']"}) }, 'sentry.groupcommitresolution': { 'Meta': {'unique_together': "(('group_id', 'commit_id'),)", 'object_name': 'GroupCommitResolution'}, 'commit_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'db_index': 'True'}), 'datetime': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'db_index': 'True'}), 'group_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}) }, 'sentry.groupemailthread': { 'Meta': {'unique_together': "(('email', 'group'), ('email', 'msgid'))", 'object_name': 'GroupEmailThread'}, 'date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'db_index': 'True'}), 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75'}), 'group': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'related_name': "'groupemail_set'", 'to': "orm['sentry.Group']"}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'msgid': ('django.db.models.fields.CharField', [], {'max_length': '100'}), 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'related_name': "'groupemail_set'", 'to': "orm['sentry.Project']"}) }, 'sentry.groupenvironment': { 'Meta': {'unique_together': "[('group_id', 'environment_id')]", 'object_name': 'GroupEnvironment', 'index_together': "[('environment_id', 'first_release_id')]"}, 'environment_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {}), 'first_release_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True'}), 'group_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}) }, 'sentry.grouphash': { 'Meta': {'unique_together': "(('project', 'hash'),)", 'object_name': 'GroupHash'}, 'group': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Group']", 'null': 'True'}), 'group_tombstone_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True', 'db_index': 'True'}), 'hash': ('django.db.models.fields.CharField', [], {'max_length': '32'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Project']", 'null': 'True'}), 'state': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True'}) }, 'sentry.grouplink': { 'Meta': {'unique_together': "(('group_id', 'linked_type', 'linked_id'),)", 'object_name': 'GroupLink'}, 'data': ('jsonfield.fields.JSONField', [], {'default': '{}'}), 'datetime': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'db_index': 'True'}), 'group_id': ('sentry.db.models.fields.bounded.BoundedBigIntegerField', [], {}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'linked_id': ('sentry.db.models.fields.bounded.BoundedBigIntegerField', [], {}), 'linked_type': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'default': '1'}), 'project_id': ('sentry.db.models.fields.bounded.BoundedBigIntegerField', [], {'db_index': 'True'}), 'relationship': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'default': '2'}) }, 'sentry.groupmeta': { 'Meta': {'unique_together': "(('group', 'key'),)", 'object_name': 'GroupMeta'}, 'group': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Group']"}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'key': ('django.db.models.fields.CharField', [], {'max_length': '64'}), 'value': ('django.db.models.fields.TextField', [], {}) }, 'sentry.groupredirect': { 'Meta': {'object_name': 'GroupRedirect'}, 'group_id': ('sentry.db.models.fields.bounded.BoundedBigIntegerField', [], {'db_index': 'True'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'previous_group_id': ('sentry.db.models.fields.bounded.BoundedBigIntegerField', [], {'unique': 'True'}) }, 'sentry.grouprelease': { 'Meta': {'unique_together': "(('group_id', 'release_id', 'environment'),)", 'object_name': 'GroupRelease'}, 'environment': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '64'}), 'first_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'group_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'db_index': 'True'}), 'project_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'db_index': 'True'}), 'release_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'db_index': 'True'}) }, 'sentry.groupresolution': { 'Meta': {'object_name': 'GroupResolution'}, 'actor_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True'}), 'datetime': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'db_index': 'True'}), 'group': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Group']", 'unique': 'True'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'release': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Release']"}), 'status': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'default': '0'}), 'type': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True'}) }, 'sentry.grouprulestatus': { 'Meta': {'unique_together': "(('rule', 'group'),)", 'object_name': 'GroupRuleStatus'}, 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'group': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Group']"}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'last_active': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Project']"}), 'rule': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Rule']"}), 'status': ('django.db.models.fields.PositiveSmallIntegerField', [], {'default': '0'}) }, 'sentry.groupseen': { 'Meta': {'unique_together': "(('user', 'group'),)", 'object_name': 'GroupSeen'}, 'group': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Group']"}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Project']"}), 'user': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.User']", 'db_index': 'False'}) }, 'sentry.groupshare': { 'Meta': {'object_name': 'GroupShare'}, 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'group': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Group']", 'unique': 'True'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Project']"}), 'user': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.User']", 'null': 'True'}), 'uuid': ('django.db.models.fields.CharField', [], {'default': "'f83b530950324e5d85e68d9ac1f85361'", 'unique': 'True', 'max_length': '32'}) }, 'sentry.groupsnooze': { 'Meta': {'object_name': 'GroupSnooze'}, 'actor_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True'}), 'count': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True'}), 'group': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Group']", 'unique': 'True'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'state': ('jsonfield.fields.JSONField', [], {'null': 'True'}), 'until': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), 'user_count': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True'}), 'user_window': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True'}), 'window': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True'}) }, 'sentry.groupsubscription': { 'Meta': {'unique_together': "(('group', 'user'),)", 'object_name': 'GroupSubscription'}, 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'null': 'True'}), 'group': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'related_name': "'subscription_set'", 'to': "orm['sentry.Group']"}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'related_name': "'subscription_set'", 'to': "orm['sentry.Project']"}), 'reason': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'default': '0'}), 'user': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.User']"}) }, 'sentry.grouptagkey': { 'Meta': {'unique_together': "(('project_id', 'group_id', 'key'),)", 'object_name': 'GroupTagKey'}, 'group_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'db_index': 'True'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'key': ('django.db.models.fields.CharField', [], {'max_length': '32'}), 'project_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True', 'db_index': 'True'}), 'values_seen': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'default': '0'}) }, 'sentry.grouptagvalue': { 'Meta': {'unique_together': "(('group_id', 'key', 'value'),)", 'object_name': 'GroupTagValue', 'db_table': "'sentry_messagefiltervalue'", 'index_together': "(('project_id', 'key', 'value', 'last_seen'),)"}, 'first_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'null': 'True', 'db_index': 'True'}), 'group_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'db_index': 'True'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'key': ('django.db.models.fields.CharField', [], {'max_length': '32'}), 'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'null': 'True', 'db_index': 'True'}), 'project_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True', 'db_index': 'True'}), 'times_seen': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'default': '0'}), 'value': ('django.db.models.fields.CharField', [], {'max_length': '200'}) }, 'sentry.grouptombstone': { 'Meta': {'object_name': 'GroupTombstone'}, 'actor_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True'}), 'culprit': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), 'data': ('sentry.db.models.fields.gzippeddict.GzippedDictField', [], {'null': 'True', 'blank': 'True'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'level': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'default': '40', 'blank': 'True'}), 'message': ('django.db.models.fields.TextField', [], {}), 'previous_group_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'unique': 'True'}), 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Project']"}) }, 'sentry.identity': { 'Meta': {'unique_together': "(('idp', 'external_id'), ('idp', 'user'))", 'object_name': 'Identity'}, 'data': ('sentry.db.models.fields.encrypted.EncryptedJsonField', [], {'default': '{}'}), 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'date_verified': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'external_id': ('django.db.models.fields.CharField', [], {'max_length': '64'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'idp': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.IdentityProvider']"}), 'scopes': ('sentry.db.models.fields.array.ArrayField', [], {'of': ('django.db.models.fields.TextField', [], {})}), 'status': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'default': '0'}), 'user': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.User']"}) }, 'sentry.identityprovider': { 'Meta': {'unique_together': "(('type', 'organization'), ('type', 'organization', 'external_id'))", 'object_name': 'IdentityProvider'}, 'config': ('sentry.db.models.fields.encrypted.EncryptedJsonField', [], {'default': '{}'}), 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'null': 'True'}), 'external_id': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'organization': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Organization']"}), 'type': ('django.db.models.fields.CharField', [], {'max_length': '64'}) }, 'sentry.integration': { 'Meta': {'unique_together': "(('provider', 'external_id'),)", 'object_name': 'Integration'}, 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'null': 'True'}), 'external_id': ('django.db.models.fields.CharField', [], {'max_length': '64'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'metadata': ('sentry.db.models.fields.encrypted.EncryptedJsonField', [], {'default': '{}'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}), 'organizations': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'integrations'", 'symmetrical': 'False', 'through': "orm['sentry.OrganizationIntegration']", 'to': "orm['sentry.Organization']"}), 'projects': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'integrations'", 'symmetrical': 'False', 'through': "orm['sentry.ProjectIntegration']", 'to': "orm['sentry.Project']"}), 'provider': ('django.db.models.fields.CharField', [], {'max_length': '64'}) }, 'sentry.latestrelease': { 'Meta': {'unique_together': "(('repository_id', 'environment_id'),)", 'object_name': 'LatestRelease'}, 'commit_id': ('sentry.db.models.fields.bounded.BoundedBigIntegerField', [], {'null': 'True'}), 'deploy_id': ('sentry.db.models.fields.bounded.BoundedBigIntegerField', [], {'null': 'True'}), 'environment_id': ('sentry.db.models.fields.bounded.BoundedBigIntegerField', [], {}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'release_id': ('sentry.db.models.fields.bounded.BoundedBigIntegerField', [], {}), 'repository_id': ('sentry.db.models.fields.bounded.BoundedBigIntegerField', [], {}) }, 'sentry.lostpasswordhash': { 'Meta': {'object_name': 'LostPasswordHash'}, 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'hash': ('django.db.models.fields.CharField', [], {'max_length': '32'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'user': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.User']", 'unique': 'True'}) }, 'sentry.option': { 'Meta': {'object_name': 'Option'}, 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '64'}), 'last_updated': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'value': ('sentry.db.models.fields.encrypted.EncryptedPickledObjectField', [], {}) }, 'sentry.organization': { 'Meta': {'object_name': 'Organization'}, 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'default_role': ('django.db.models.fields.CharField', [], {'default': "'member'", 'max_length': '32'}), 'flags': ('django.db.models.fields.BigIntegerField', [], {'default': '1'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'members': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'org_memberships'", 'symmetrical': 'False', 'through': "orm['sentry.OrganizationMember']", 'to': "orm['sentry.User']"}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '64'}), 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50'}), 'status': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'default': '0'}) }, 'sentry.organizationaccessrequest': { 'Meta': {'unique_together': "(('team', 'member'),)", 'object_name': 'OrganizationAccessRequest'}, 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'member': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.OrganizationMember']"}), 'team': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Team']"}) }, 'sentry.organizationavatar': { 'Meta': {'object_name': 'OrganizationAvatar'}, 'avatar_type': ('django.db.models.fields.PositiveSmallIntegerField', [], {'default': '0'}), 'file': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.File']", 'unique': 'True', 'null': 'True', 'on_delete': 'models.SET_NULL'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'ident': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), 'organization': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'related_name': "'avatar'", 'unique': 'True', 'to': "orm['sentry.Organization']"}) }, 'sentry.organizationintegration': { 'Meta': {'unique_together': "(('organization', 'integration'),)", 'object_name': 'OrganizationIntegration'}, 'config': ('sentry.db.models.fields.encrypted.EncryptedJsonField', [], {'default': '{}'}), 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'null': 'True'}), 'default_auth_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True', 'db_index': 'True'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'integration': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Integration']"}), 'organization': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Organization']"}) }, 'sentry.organizationmember': { 'Meta': {'unique_together': "(('organization', 'user'), ('organization', 'email'))", 'object_name': 'OrganizationMember'}, 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'null': 'True', 'blank': 'True'}), 'flags': ('django.db.models.fields.BigIntegerField', [], {'default': '0'}), 'has_global_access': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'organization': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'related_name': "'member_set'", 'to': "orm['sentry.Organization']"}), 'role': ('django.db.models.fields.CharField', [], {'default': "'member'", 'max_length': '32'}), 'teams': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['sentry.Team']", 'symmetrical': 'False', 'through': "orm['sentry.OrganizationMemberTeam']", 'blank': 'True'}), 'token': ('django.db.models.fields.CharField', [], {'max_length': '64', 'unique': 'True', 'null': 'True', 'blank': 'True'}), 'type': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'default': '50', 'blank': 'True'}), 'user': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'blank': 'True', 'related_name': "'sentry_orgmember_set'", 'null': 'True', 'to': "orm['sentry.User']"}) }, 'sentry.organizationmemberteam': { 'Meta': {'unique_together': "(('team', 'organizationmember'),)", 'object_name': 'OrganizationMemberTeam', 'db_table': "'sentry_organizationmember_teams'"}, 'id': ('sentry.db.models.fields.bounded.BoundedAutoField', [], {'primary_key': 'True'}), 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), 'organizationmember': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.OrganizationMember']"}), 'team': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Team']"}) }, 'sentry.organizationonboardingtask': { 'Meta': {'unique_together': "(('organization', 'task'),)", 'object_name': 'OrganizationOnboardingTask'}, 'data': ('jsonfield.fields.JSONField', [], {'default': '{}'}), 'date_completed': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'organization': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Organization']"}), 'project_id': ('sentry.db.models.fields.bounded.BoundedBigIntegerField', [], {'null': 'True', 'blank': 'True'}), 'status': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {}), 'task': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {}), 'user': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.User']", 'null': 'True'}) }, 'sentry.organizationoption': { 'Meta': {'unique_together': "(('organization', 'key'),)", 'object_name': 'OrganizationOption', 'db_table': "'sentry_organizationoptions'"}, 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'key': ('django.db.models.fields.CharField', [], {'max_length': '64'}), 'organization': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Organization']"}), 'value': ('sentry.db.models.fields.encrypted.EncryptedPickledObjectField', [], {}) }, 'sentry.processingissue': { 'Meta': {'unique_together': "(('project', 'checksum', 'type'),)", 'object_name': 'ProcessingIssue'}, 'checksum': ('django.db.models.fields.CharField', [], {'max_length': '40', 'db_index': 'True'}), 'data': ('sentry.db.models.fields.gzippeddict.GzippedDictField', [], {}), 'datetime': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Project']"}), 'type': ('django.db.models.fields.CharField', [], {'max_length': '30'}) }, 'sentry.project': { 'Meta': {'unique_together': "(('organization', 'slug'),)", 'object_name': 'Project'}, 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'first_event': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), 'flags': ('django.db.models.fields.BigIntegerField', [], {'default': '0', 'null': 'True'}), 'forced_color': ('django.db.models.fields.CharField', [], {'max_length': '6', 'null': 'True', 'blank': 'True'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}), 'organization': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Organization']"}), 'platform': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}), 'public': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '50', 'null': 'True'}), 'status': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'default': '0', 'db_index': 'True'}), 'teams': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'teams'", 'symmetrical': 'False', 'through': "orm['sentry.ProjectTeam']", 'to': "orm['sentry.Team']"}) }, 'sentry.projectavatar': { 'Meta': {'object_name': 'ProjectAvatar'}, 'avatar_type': ('django.db.models.fields.PositiveSmallIntegerField', [], {'default': '0'}), 'file': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.File']", 'unique': 'True', 'null': 'True', 'on_delete': 'models.SET_NULL'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'ident': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'related_name': "'avatar'", 'unique': 'True', 'to': "orm['sentry.Project']"}) }, 'sentry.projectbookmark': { 'Meta': {'unique_together': "(('project_id', 'user'),)", 'object_name': 'ProjectBookmark'}, 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'null': 'True'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'project_id': ('sentry.db.models.fields.bounded.BoundedBigIntegerField', [], {'null': 'True', 'blank': 'True'}), 'user': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.User']"}) }, 'sentry.projectdsymfile': { 'Meta': {'unique_together': "(('project', 'debug_id'),)", 'object_name': 'ProjectDSymFile'}, 'cpu_name': ('django.db.models.fields.CharField', [], {'max_length': '40'}), 'debug_id': ('django.db.models.fields.CharField', [], {'max_length': '64', 'db_column': "'uuid'"}), 'file': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.File']"}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'object_name': ('django.db.models.fields.TextField', [], {}), 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Project']", 'null': 'True'}) }, 'sentry.projectintegration': { 'Meta': {'unique_together': "(('project', 'integration'),)", 'object_name': 'ProjectIntegration'}, 'config': ('sentry.db.models.fields.encrypted.EncryptedJsonField', [], {'default': '{}'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'integration': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Integration']"}), 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Project']"}) }, 'sentry.projectkey': { 'Meta': {'object_name': 'ProjectKey'}, 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'null': 'True'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'label': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True', 'blank': 'True'}), 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'related_name': "'key_set'", 'to': "orm['sentry.Project']"}), 'public_key': ('django.db.models.fields.CharField', [], {'max_length': '32', 'unique': 'True', 'null': 'True'}), 'rate_limit_count': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True'}), 'rate_limit_window': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True'}), 'roles': ('django.db.models.fields.BigIntegerField', [], {'default': '1'}), 'secret_key': ('django.db.models.fields.CharField', [], {'max_length': '32', 'unique': 'True', 'null': 'True'}), 'status': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'default': '0', 'db_index': 'True'}) }, 'sentry.projectoption': { 'Meta': {'unique_together': "(('project', 'key'),)", 'object_name': 'ProjectOption', 'db_table': "'sentry_projectoptions'"}, 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'key': ('django.db.models.fields.CharField', [], {'max_length': '64'}), 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Project']"}), 'value': ('sentry.db.models.fields.encrypted.EncryptedPickledObjectField', [], {}) }, 'sentry.projectownership': { 'Meta': {'object_name': 'ProjectOwnership'}, 'date_created': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'fallthrough': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), 'last_updated': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Project']", 'unique': 'True'}), 'raw': ('django.db.models.fields.TextField', [], {'null': 'True'}), 'schema': ('jsonfield.fields.JSONField', [], {'null': 'True'}) }, 'sentry.projectplatform': { 'Meta': {'unique_together': "(('project_id', 'platform'),)", 'object_name': 'ProjectPlatform'}, 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'platform': ('django.db.models.fields.CharField', [], {'max_length': '64'}), 'project_id': ('sentry.db.models.fields.bounded.BoundedBigIntegerField', [], {}) }, 'sentry.projectredirect': { 'Meta': {'unique_together': "(('organization', 'redirect_slug'),)", 'object_name': 'ProjectRedirect'}, 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'organization': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Organization']"}), 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Project']"}), 'redirect_slug': ('django.db.models.fields.SlugField', [], {'max_length': '50'}) }, 'sentry.projectsymcachefile': { 'Meta': {'unique_together': "(('project', 'dsym_file'),)", 'object_name': 'ProjectSymCacheFile'}, 'cache_file': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.File']"}), 'checksum': ('django.db.models.fields.CharField', [], {'max_length': '40'}), 'dsym_file': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.ProjectDSymFile']"}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Project']", 'null': 'True'}), 'version': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {}) }, 'sentry.projectteam': { 'Meta': {'unique_together': "(('project', 'team'),)", 'object_name': 'ProjectTeam'}, 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Project']"}), 'team': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Team']"}) }, 'sentry.pullrequest': { 'Meta': {'unique_together': "(('repository_id', 'key'),)", 'object_name': 'PullRequest', 'db_table': "'sentry_pull_request'", 'index_together': "(('repository_id', 'date_added'),)"}, 'author': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.CommitAuthor']", 'null': 'True'}), 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'key': ('django.db.models.fields.CharField', [], {'max_length': '64'}), 'merge_commit_sha': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}), 'message': ('django.db.models.fields.TextField', [], {'null': 'True'}), 'organization_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'db_index': 'True'}), 'repository_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {}), 'title': ('django.db.models.fields.TextField', [], {'null': 'True'}) }, 'sentry.pullrequestcommit': { 'Meta': {'unique_together': "(('pull_request', 'commit'),)", 'object_name': 'PullRequestCommit', 'db_table': "'sentry_pullrequest_commit'"}, 'commit': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Commit']"}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'pull_request': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.PullRequest']"}) }, 'sentry.rawevent': { 'Meta': {'unique_together': "(('project', 'event_id'),)", 'object_name': 'RawEvent'}, 'data': ('sentry.db.models.fields.node.NodeField', [], {'null': 'True', 'blank': 'True'}), 'datetime': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'event_id': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Project']"}) }, 'sentry.release': { 'Meta': {'unique_together': "(('organization', 'version'),)", 'object_name': 'Release'}, 'authors': ('sentry.db.models.fields.array.ArrayField', [], {'of': ('django.db.models.fields.TextField', [], {})}), 'commit_count': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True'}), 'data': ('jsonfield.fields.JSONField', [], {'default': '{}'}), 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'date_released': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), 'date_started': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'last_commit_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True'}), 'last_deploy_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True'}), 'new_groups': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'default': '0'}), 'organization': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Organization']"}), 'owner': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.User']", 'null': 'True', 'blank': 'True'}), 'project_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True'}), 'projects': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'releases'", 'symmetrical': 'False', 'through': "orm['sentry.ReleaseProject']", 'to': "orm['sentry.Project']"}), 'ref': ('django.db.models.fields.CharField', [], {'max_length': '250', 'null': 'True', 'blank': 'True'}), 'total_deploys': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True'}), 'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), 'version': ('django.db.models.fields.CharField', [], {'max_length': '250'}) }, 'sentry.releasecommit': { 'Meta': {'unique_together': "(('release', 'commit'), ('release', 'order'))", 'object_name': 'ReleaseCommit'}, 'commit': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Commit']"}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'order': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {}), 'organization_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'db_index': 'True'}), 'project_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True'}), 'release': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Release']"}) }, 'sentry.releaseenvironment': { 'Meta': {'unique_together': "(('organization_id', 'release_id', 'environment_id'),)", 'object_name': 'ReleaseEnvironment', 'db_table': "'sentry_environmentrelease'"}, 'environment_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'db_index': 'True'}), 'first_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'db_index': 'True'}), 'organization_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'db_index': 'True'}), 'project_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True'}), 'release_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'db_index': 'True'}) }, 'sentry.releasefile': { 'Meta': {'unique_together': "(('release', 'ident'),)", 'object_name': 'ReleaseFile'}, 'dist': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Distribution']", 'null': 'True'}), 'file': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.File']"}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'ident': ('django.db.models.fields.CharField', [], {'max_length': '40'}), 'name': ('django.db.models.fields.TextField', [], {}), 'organization': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Organization']"}), 'project_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True'}), 'release': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Release']"}) }, 'sentry.releaseheadcommit': { 'Meta': {'unique_together': "(('repository_id', 'release'),)", 'object_name': 'ReleaseHeadCommit'}, 'commit': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Commit']"}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'organization_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'db_index': 'True'}), 'release': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Release']"}), 'repository_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {}) }, 'sentry.releaseproject': { 'Meta': {'unique_together': "(('project', 'release'),)", 'object_name': 'ReleaseProject', 'db_table': "'sentry_release_project'"}, 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'new_groups': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'default': '0', 'null': 'True'}), 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Project']"}), 'release': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Release']"}) }, 'sentry.releaseprojectenvironment': { 'Meta': {'unique_together': "(('project', 'release', 'environment'),)", 'object_name': 'ReleaseProjectEnvironment'}, 'environment': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Environment']"}), 'first_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'db_index': 'True'}), 'new_issues_count': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'default': '0'}), 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Project']"}), 'release': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Release']"}) }, 'sentry.repository': { 'Meta': {'unique_together': "(('organization_id', 'name'), ('organization_id', 'provider', 'external_id'))", 'object_name': 'Repository'}, 'config': ('jsonfield.fields.JSONField', [], {'default': '{}'}), 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'external_id': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'integration_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True', 'db_index': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}), 'organization_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'db_index': 'True'}), 'provider': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}), 'status': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'default': '0', 'db_index': 'True'}), 'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True'}) }, 'sentry.reprocessingreport': { 'Meta': {'unique_together': "(('project', 'event_id'),)", 'object_name': 'ReprocessingReport'}, 'datetime': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'event_id': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Project']"}) }, 'sentry.rule': { 'Meta': {'object_name': 'Rule'}, 'data': ('sentry.db.models.fields.gzippeddict.GzippedDictField', [], {}), 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'environment_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'label': ('django.db.models.fields.CharField', [], {'max_length': '64'}), 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Project']"}), 'status': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'default': '0', 'db_index': 'True'}) }, 'sentry.savedsearch': { 'Meta': {'unique_together': "(('project', 'name'),)", 'object_name': 'SavedSearch'}, 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'is_default': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}), 'owner': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.User']", 'null': 'True'}), 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Project']"}), 'query': ('django.db.models.fields.TextField', [], {}) }, 'sentry.savedsearchuserdefault': { 'Meta': {'unique_together': "(('project', 'user'),)", 'object_name': 'SavedSearchUserDefault', 'db_table': "'sentry_savedsearch_userdefault'"}, 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Project']"}), 'savedsearch': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.SavedSearch']"}), 'user': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.User']"}) }, 'sentry.scheduleddeletion': { 'Meta': {'unique_together': "(('app_label', 'model_name', 'object_id'),)", 'object_name': 'ScheduledDeletion'}, 'aborted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'actor_id': ('sentry.db.models.fields.bounded.BoundedBigIntegerField', [], {'null': 'True'}), 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '64'}), 'data': ('jsonfield.fields.JSONField', [], {'default': '{}'}), 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'date_scheduled': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2018, 5, 24, 0, 0)'}), 'guid': ('django.db.models.fields.CharField', [], {'default': "'cf72b919aaa844a2896d623c44c24176'", 'unique': 'True', 'max_length': '32'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'in_progress': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'model_name': ('django.db.models.fields.CharField', [], {'max_length': '64'}), 'object_id': ('sentry.db.models.fields.bounded.BoundedBigIntegerField', [], {}) }, 'sentry.scheduledjob': { 'Meta': {'object_name': 'ScheduledJob'}, 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'date_scheduled': ('django.db.models.fields.DateTimeField', [], {}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}), 'payload': ('jsonfield.fields.JSONField', [], {'default': '{}'}) }, 'sentry.servicehook': { 'Meta': {'object_name': 'ServiceHook'}, 'actor_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'db_index': 'True'}), 'application': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.ApiApplication']", 'null': 'True'}), 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'events': ('sentry.db.models.fields.array.ArrayField', [], {'of': ('django.db.models.fields.TextField', [], {})}), 'guid': ('django.db.models.fields.CharField', [], {'max_length': '32', 'unique': 'True', 'null': 'True'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'project_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'db_index': 'True'}), 'secret': ('sentry.db.models.fields.encrypted.EncryptedTextField', [], {'default': "'83c30be6181f49feaed7709c4fe6429d9f0db434143d48a1b171cf51d8c3c6d1'"}), 'status': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'default': '0', 'db_index': 'True'}), 'url': ('django.db.models.fields.URLField', [], {'max_length': '512'}), 'version': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'default': '0'}) }, 'sentry.tagkey': { 'Meta': {'unique_together': "(('project_id', 'key'),)", 'object_name': 'TagKey', 'db_table': "'sentry_filterkey'"}, 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'key': ('django.db.models.fields.CharField', [], {'max_length': '32'}), 'label': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}), 'project_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'db_index': 'True'}), 'status': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'default': '0'}), 'values_seen': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'default': '0'}) }, 'sentry.tagvalue': { 'Meta': {'unique_together': "(('project_id', 'key', 'value'),)", 'object_name': 'TagValue', 'db_table': "'sentry_filtervalue'", 'index_together': "(('project_id', 'key', 'last_seen'),)"}, 'data': ('sentry.db.models.fields.gzippeddict.GzippedDictField', [], {'null': 'True', 'blank': 'True'}), 'first_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'null': 'True', 'db_index': 'True'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'key': ('django.db.models.fields.CharField', [], {'max_length': '32'}), 'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'null': 'True', 'db_index': 'True'}), 'project_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True', 'db_index': 'True'}), 'times_seen': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'default': '0'}), 'value': ('django.db.models.fields.CharField', [], {'max_length': '200'}) }, 'sentry.team': { 'Meta': {'unique_together': "(('organization', 'slug'),)", 'object_name': 'Team'}, 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'null': 'True'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '64'}), 'organization': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Organization']"}), 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), 'status': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'default': '0'}) }, 'sentry.teamavatar': { 'Meta': {'object_name': 'TeamAvatar'}, 'avatar_type': ('django.db.models.fields.PositiveSmallIntegerField', [], {'default': '0'}), 'file': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.File']", 'unique': 'True', 'null': 'True', 'on_delete': 'models.SET_NULL'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'ident': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), 'team': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'related_name': "'avatar'", 'unique': 'True', 'to': "orm['sentry.Team']"}) }, 'sentry.user': { 'Meta': {'object_name': 'User', 'db_table': "'auth_user'"}, 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), 'flags': ('django.db.models.fields.BigIntegerField', [], {'default': '0', 'null': 'True'}), 'id': ('sentry.db.models.fields.bounded.BoundedAutoField', [], {'primary_key': 'True'}), 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), 'is_managed': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'is_password_expired': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'last_active': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'null': 'True'}), 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'null': 'True'}), 'last_password_change': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '200', 'db_column': "'first_name'", 'blank': 'True'}), 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), 'session_nonce': ('django.db.models.fields.CharField', [], {'max_length': '12', 'null': 'True'}), 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}) }, 'sentry.useravatar': { 'Meta': {'object_name': 'UserAvatar'}, 'avatar_type': ('django.db.models.fields.PositiveSmallIntegerField', [], {'default': '0'}), 'file': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.File']", 'unique': 'True', 'null': 'True', 'on_delete': 'models.SET_NULL'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'ident': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), 'user': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'related_name': "'avatar'", 'unique': 'True', 'to': "orm['sentry.User']"}) }, 'sentry.useremail': { 'Meta': {'unique_together': "(('user', 'email'),)", 'object_name': 'UserEmail'}, 'date_hash_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'is_verified': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'user': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'related_name': "'emails'", 'to': "orm['sentry.User']"}), 'validation_hash': ('django.db.models.fields.CharField', [], {'default': "u'qlnWFOIs48qqHNQdhNjkYWu2a1Kakv0e'", 'max_length': '32'}) }, 'sentry.userip': { 'Meta': {'unique_together': "(('user', 'ip_address'),)", 'object_name': 'UserIP'}, 'first_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'ip_address': ('django.db.models.fields.GenericIPAddressField', [], {'max_length': '39'}), 'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'user': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.User']"}) }, 'sentry.useroption': { 'Meta': {'unique_together': "(('user', 'project', 'key'), ('user', 'organization', 'key'))", 'object_name': 'UserOption'}, 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'key': ('django.db.models.fields.CharField', [], {'max_length': '64'}), 'organization': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Organization']", 'null': 'True'}), 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Project']", 'null': 'True'}), 'user': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.User']"}), 'value': ('sentry.db.models.fields.encrypted.EncryptedPickledObjectField', [], {}) }, 'sentry.userpermission': { 'Meta': {'unique_together': "(('user', 'permission'),)", 'object_name': 'UserPermission'}, 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'permission': ('django.db.models.fields.CharField', [], {'max_length': '32'}), 'user': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.User']"}) }, 'sentry.userreport': { 'Meta': {'unique_together': "(('project', 'event_id'),)", 'object_name': 'UserReport', 'index_together': "(('project', 'event_id'), ('project', 'date_added'))"}, 'comments': ('django.db.models.fields.TextField', [], {}), 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75'}), 'environment': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Environment']", 'null': 'True'}), 'event_id': ('django.db.models.fields.CharField', [], {'max_length': '32'}), 'event_user_id': ('sentry.db.models.fields.bounded.BoundedBigIntegerField', [], {'null': 'True'}), 'group': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Group']", 'null': 'True'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}), 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Project']"}) }, 'sentry.versiondsymfile': { 'Meta': {'unique_together': "(('dsym_file', 'version', 'build'),)", 'object_name': 'VersionDSymFile'}, 'build': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}), 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'dsym_app': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.DSymApp']"}), 'dsym_file': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.ProjectDSymFile']", 'null': 'True'}), 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), 'version': ('django.db.models.fields.CharField', [], {'max_length': '32'}) } } complete_apps = ['sentry']
PypiClean
/PyNLPIR-0.6.0.tar.gz/PyNLPIR-0.6.0/docs/index.rst
.. PyNLPIR documentation master file, created by sphinx-quickstart on Thu Mar 27 17:10:46 2014. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. Welcome to PyNLPIR's documentation! =================================== PyNLPIR is a Python wrapper around the `NLPIR/ICTCLAS Chinese segmentation software <http://www.nlpir.org/wordpress/>`_. PyNLPIR allows you to easily segment Chinese text using NLPIR, one of the most widely-regarded Chinese text analyzers: .. code:: python import pynlpir pynlpir.open() s = '欢迎科研人员、技术工程师、企事业单位与个人参与NLPIR平台的建设工作。' pynlpir.segment(s) [('欢迎', 'verb'), ('科研', 'noun'), ('人员', 'noun'), ('、', 'punctuation mark'), ('技术', 'noun'), ('工程师', 'noun'), ('、', 'punctuation mark'), ('企事业', 'noun'), ('单位', 'noun'), ('与', 'conjunction'), ('个人', 'noun'), ('参与', 'verb'), ('NLPIR', 'noun'), ('平台', 'noun'), ('的', 'particle'), ('建设', 'verb'), ('工作', 'verb'), ('。', 'punctuation mark')] If this is your first time using PyNLPIR, check out :doc:`installation`. Then read the :doc:`tutorial`. If you want a more in-depth view of PyNLPIR, check out the :doc:`api`. If you're looking to help out, check out :doc:`contributing`. Support ------- If you encounter a bug, have a feature request, or need help using PyNLPIR, then use `PyNLPIR's GitHub Issues page <https://github.com/tsroten/pynlpir/issues>`_ to send feedback. Documentation Contents ---------------------- .. toctree:: :maxdepth: 2 installation tutorial api contributing history authors
PypiClean
/ansible_alicloud-1.20.0.tar.gz/ansible_alicloud-1.20.0/lib/ansible/modules/cloud/alicloud/ali_slb_lb.py
# Copyright (c) 2017-present Alibaba Group Holding Limited. He Guimin <[email protected]> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Ansible. If not, see http://www.gnu.org/licenses/. from __future__ import (absolute_import, division, print_function) __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = ''' --- module: ali_slb_lb short_description: Create, Delete, Enable or Disable Server Load Balancer. description: - Create, Delete, Start or Stop Server Load Balancer. - Modify Load Balancer internet charge type and bandwidth options: state: description: - The state of the instance after operating. default: 'present' choices: ['present', 'absent', 'running', 'stopped'] type: str load_balancer_name: description: - The name of the server load balancer, which is a string of 1 to 80 characters. It can contain numerals, "_", "/", "." or "-". - This is used to ensure idempotence. aliases: ['name', 'lb_name'] required: True type: str load_balancer_id: description: - This parameter is required when user wants to perform edit operation in Load Balancer aliases: ['id'] type: str is_internet: description: - Load balancer network type whether is internet. type: bool default: False vswitch_id: description: - The ID of the VSwitch to which the SLB instance belongs. aliases: ['subnet_id'] type: str internet_charge_type: description: - The charge type of internet. It will be ignored when C(is_internet=False) default: 'PayByTraffic' choices: ['PayByBandwidth', 'PayByTraffic'] type: str master_zone_id: description: - The ID of the primary zone. By default, the SLB cluster in the primary zone is used to distribute traffic. type: str slave_zone_id: description: - The ID of the backup zone. The backup zone takes over the traffic distribution only when the SLB cluster in the primary zone fails. type: str bandwidth: description: - Bandwidth peak of the public network instance charged per fixed bandwidth. It allow 1~5000 in Mbps. - It will be ignored when C(internet_charge_type=PayByTraffic) default: 1 type: int load_balancer_spec: description: - The specification of the Server Load Balancer instance. If no value is specified, a shared-performance instance is created. - There are some region limitations for load_balancer_spec. See U(https://www.alibabacloud.com/help/doc-detail/27577.htm) for details choices: ['slb.s1.small', 'slb.s2.small', 'slb.s2.medium', 'slb.s3.small', 'slb.s3.medium', 'slb.s3.large'] aliases: ['spec', 'lb_spec'] type: str multi_ok: description: - By default the module will not create another Load Balancer if there is another Load Balancer with the same I(name). Specify this as true if you want duplicate Load Balancers created. default: False type: bool tags: description: - A hash/dictionaries of slb tags. C({"key":"value"}) type: dict purge_tags: description: - Delete existing tags on the slb that are not specified in the task. If True, it means you have to specify all the desired tags on each task affecting a slb. default: False type: bool notes: - The change in internet charge type will take effect from the early morning of the next day. It can not be changed twice in one day, otherwise, a error "Operation.NotAllowed" will appear. requirements: - "python >= 3.6" - "footmark >= 1.16.0" extends_documentation_fragment: - alicloud author: - "He Guimin (@xiaozhu36)" ''' EXAMPLES = ''' # Note: These examples do not set authentication details, see the Alibaba Cloud Guide for details. - name: Create a server load balancer ali_slb_lb: name: 'from-ansible' is_internet: True internet_charge_type: 'PayByTraffic' spec: 'slb.s1.small' state: present - name: Stop a server load balancer ali_slb_lb: name: 'from-ansible' state: stopped - name: Start a server load balancer ali_slb_lb: name: 'from-ansible' state: running - name: Modify server load balancer internet charge type and bandwidth ali_slb_lb: name: 'from-ansible' internet_charge_type: 'PayByBandwidth' bandwidth: 5 ''' RETURN = ''' load_balancer: description: - info about the server load balancer that was created or deleted. returned: on present type: complex contains: address: description: The IP address of the loal balancer returned: always type: str sample: "47.94.26.126" address_ipversion: description: The IP address version. IPV4 or IPV6. returned: always type: str sample: "ipv4" address_type: description: The load balancer internet type returned: always type: str sample: "internet" backend_servers: description: The load balancer's backend servers returned: always type: complex contains: server_id: description: The backend server id returned: always type: str sample: "i-vqunci342" weight: description: The backend server weight returned: always type: int sample: 100 description: description: The backend server description returned: always type: str sample: "" type: description: The backend server type, ecs or eni returned: always type: str sample: "ecs" bandwidth: description: The load balancer internet bandwidth returned: always type: int sample: 5 create_time: description: The time of the load balancer was created returned: always type: str sample: "2019-01-02T02:37:41Z" end_time: description: The time of the load balancer will be released returned: always type: str sample: "2999-09-08T16:00:00Z" id: description: The ID of the load balancer was created. Same as load_balancer_id. returned: always type: str sample: "lb-2zea9ohgtf" internet_charge_type: description: The load balancer internet charge type returned: always type: str sample: "PayByTraffic" listeners: description: The listeners of the load balancer. returned: always type: complex contains: listener_port: description: The front-end port of the listener that is used to receive incoming traffic and distribute the traffic to the backend servers. returned: always type: int sample: 22 listener_protocol: description: The frontend protocol used by the SLB instance. returned: always type: str sample: tcp listener_forward: description: Whether to enable listener forwarding. returned: always type: str sample: "" forward_port: description: The destination listening port. It must be an existing HTTPS listening port. returned: always type: int sample: 20 load_balancer_id: description: The ID of the load balancer was created. returned: always type: str sample: "lb-2zea9ohgtf" load_balancer_name: description: The name of the load balancer was created. returned: always type: str sample: "ansible-ali_slb_lb" load_balancer_status: description: The load balancer current status. returned: always type: str sample: "active" master_zone_id: description: The ID of the primary zone. returned: always type: str sample: "cn-beijing-a" name: description: The name of the load balancer was created. returned: always type: str sample: "ansible-ali_slb_lb" network_type: description: The network type of the load balancer was created. returned: always type: str sample: "classic" pay_type: description: The load balancer instance charge type. returned: always type: str sample: "PostPaid" resource_group_id: description: The resource group of the load balancer belongs. returned: always type: str sample: "rg-acfmwvvtg5owavy" slave_zone_id: description: The ID of the backup zone returned: always type: str sample: "cn-beijing-d" tags: description: The load balancer tags returned: always type: dict sample: {} vpc_id: description: The vpc of the load balancer belongs. returned: always type: str sample: "vpc-fn3nc3" vswitch_id: description: The vswitch of the load balancer belongs. returned: always type: str sample: "vsw-c3nc3r" ''' import time from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.alicloud_ecs import ecs_argument_spec, slb_connect HAS_FOOTMARK = False try: from footmark.exception import SLBResponseError HAS_FOOTMARK = True except ImportError: HAS_FOOTMARK = False def main(): argument_spec = ecs_argument_spec() argument_spec.update(dict( internet_charge_type=dict(type='str', choices=['PayByBandwidth', 'PayByTraffic'], default='PayByTraffic'), state=dict(type='str', choices=['present', 'absent', 'running', 'stopped'], default='present'), load_balancer_name=dict(type='str', required=True, aliases=['name', 'lb_name']), load_balancer_id=dict(type='str', aliases=['id']), is_internet=dict(type='bool', default=False), bandwidth=dict(type='int', default=1), vswitch_id=dict(type='str', aliases=['subnet_id']), master_zone_id=dict(type='str'), slave_zone_id=dict(type='str'), load_balancer_spec=dict(type='str', aliases=['spec', 'lb_spec'], choices=['slb.s1.small', 'slb.s2.small', 'slb.s2.medium', 'slb.s3.small', 'slb.s3.medium', 'slb.s3.large']), multi_ok=dict(type='bool', default=False), tags=dict(type='dict'), purge_tags=dict(type='bool', default=False) )) module = AnsibleModule(argument_spec=argument_spec) if HAS_FOOTMARK is False: module.fail_json(msg='footmark required for the module ali_slb_lb.') slb = slb_connect(module) state = module.params['state'] name = module.params['load_balancer_name'] load_balancer_id = module.params['load_balancer_id'] is_internet = module.params['is_internet'] internet_charge_type = str(module.params['internet_charge_type']).lower() changed = False matching = None filters = {} if name: filters['load_balancer_name'] = name if load_balancer_id: filters['load_balancer_id'] = load_balancer_id if not module.params['multi_ok']: try: matching_slbs = slb.describe_load_balancers(**filters) if len(matching_slbs) == 1: matching = matching_slbs[0] elif len(matching_slbs) > 1: module.fail_json(msg='Currently there are {0} Load Balancers that have the same name {1}. ' 'If you would like to create anyway ' 'please pass True to the multi_ok param.'.format(len(matching_slbs), name)) except Exception as e: module.fail_json(msg="Failed to describe Load Balancers: {0}".format(e)) if state == "absent": if matching: try: changed = matching.delete() except Exception as e: module.fail_json(msg="Failed to delete Load Balancers: {0}".format(e)) module.exit_json(changed=changed, load_balancer={}) if state == "present": if not matching: params = module.params params['internet_charge_type'] = internet_charge_type params['client_token'] = "Ansible-Alicloud-%s-%s" % (hash(str(module.params)), str(time.time())) address_type = "intranet" if is_internet: address_type = "internet" params['address_type'] = address_type try: matching = slb.create_load_balancer(**params) changed = True except Exception as e: module.fail_json(msg="Failed to create Load Balancer: {0}".format(e)) if not matching: module.fail_json(msg="The specified load balancer {0} is not exist. Please check your name and try again.".format(name)) if not internet_charge_type: internet_charge_type = str(matching.internet_charge_type).lower() bandwidth = module.params['bandwidth'] if not bandwidth: bandwidth = matching.bandwidth try: if matching.modify_spec(internet_charge_type=internet_charge_type, bandwidth=bandwidth): changed = True matching = matching.get() except Exception as e: module.fail_json(msg="Failed to modify Load Balancer spec: {0}".format(e)) status = "active" if state == "stopped": status = "inactive" try: if matching.set_status(status): changed = True except Exception as e: module.fail_json(msg="Failed to modify Load Balancer status: {0}".format(e)) tags = module.params['tags'] if module.params['purge_tags']: if not tags: tags = matching.tags try: if matching.remove_tags(tags): changed = True module.exit_json(changed=changed, load_balancer=matching.get().read()) except Exception as e: module.fail_json(msg="{0}".format(e)) if tags: try: if matching.add_tags(tags): changed = True except Exception as e: module.fail_json(msg="{0}".format(e)) module.exit_json(changed=changed, load_balancer=matching.get().read()) if __name__ == "__main__": main()
PypiClean
/agentMET4FOF-0.13.2.tar.gz/agentMET4FOF-0.13.2/agentMET4FOF_tutorials/plotting/custom_memory_multiple_plot.py
from agentMET4FOF.agents import AgentMET4FOF, AgentNetwork, MonitorAgent from agentMET4FOF.streams import SineGenerator import numpy as np import plotly.graph_objs as go from datetime import datetime def custom_create_monitor_graph( data, sender_agent, xname="Time", yname="Y", noise_level=0.1 ): """ Parameters ---------- data : dict or np.darray The data saved in the MonitorAgent's memory, for each Inputs (Agents) it is connected to. sender_agent : str Name of the sender agent **kwargs Custom parameters. In this example, xname, yname and noise_level are the keys of the data in the Monitor agent's memory. """ if xname and yname: x = data[xname] y = data[yname] else: x = np.arange(len(data)) y = data trace = [ go.Scatter( x=x, y=y + np.random.randn(*y.shape) * noise_level, mode="lines", name=sender_agent, ) for i in range(3) ] return trace # Here an example agent of a Sine Generator with timestamped data is defined class TimeSineGeneratorAgent(AgentMET4FOF): def init_parameters(self): self.stream = SineGenerator() def agent_loop(self): if self.current_state == "Running": sine_data = self.stream.next_sample() # dictionary # read current time stamp current_time = datetime.today().strftime("%H:%M:%S") # send out data in form of dictionary {"Time","Y"} self.send_output({"Time": current_time, "Y": sine_data["quantities"]}) def main(): # start agent network server agentNetwork = AgentNetwork() # init agents by adding into the agent network gen_agent = agentNetwork.add_agent(agentType=TimeSineGeneratorAgent) monitor_agent = agentNetwork.add_agent(agentType=MonitorAgent) # provide custom parameters to the monitor agent xname, yname = "Time", "Y" monitor_agent.init_parameters( custom_plot_function=custom_create_monitor_graph, xname=xname, yname=yname, noise_level=0.1, ) # bind agents agentNetwork.bind_agents(gen_agent, monitor_agent) # set all agents states to "Running" agentNetwork.set_running_state() # allow for shutting down the network after execution return agentNetwork if __name__ == "__main__": main()
PypiClean
/pyserialize-1.0.2.tar.gz/pyserialize-1.0.2/README.md
# pyserialize Python simple serializer pyserialize ============ `pyserialize` is a simple python serialization/deserialization library. Installation ------------ You can to use [pip](https://pypi.python.org/pypi/pip) to install pyserialize: ``` bash $ pip install pyserialize ``` Or using last source: ``` bash $ pip install git+git://github.com/juhgiyo/pyserialize.git ``` Usage Guide ----------- Supported Format None, bool, integer, float, string, list, tuple, set, dict, class(subclass of Packable) For all type except class type, you can simply pack: ```python from pyserialize import * ... # Serializing a=0 b='Hello World' c=0.05 serializedData=Serializer.pack(a,b,c) d=[10,20,30] serializedData2=Serializer.pack(a,b,c,d) e=(10.0,30.5) f=None serializedData2=serializedData2+Serializer.pack(e, f) # Deserializing unserializedData=Serializer.unpack(serializedData) print unserializedData[0] # 0 print unserializedData[1] # 'Hellow World' print unserializedData[2] # 0.05 unserializedData2=Serializer.unpack(serializedData2) print unserializedData2[0] # 0 print unserializedData2[1] # 'Hellow World' print unserializedData2[2] # 0.05 print unserializedData2[3] # [10,20,30] print unserializedData2[4] # (10.0,30.5) print unserializedData2[5] # None ``` For class type, the class must be a subclass of Packable and must implement below two functions: ```python def pack(self): def unpack(self, data): ``` Also the class's constructor must not require any explicit arguments: ```python from pyserialize import * class TempClass(Packable): def __init__(self): ... # OR class TempClass(Packable): # This is also fine since all arguments have default values def __init__(self,a=0,b=3,c='Hello'): ... ``` Sample class declaration for pyserialize: ```python class Vector3D(Packable): def __init__(self, x=0.0, y=0.0, z=0.0): self.x = lat self.y = lon self.z = alt def pack(self): return Serializer.pack(self.x, self.y, self.z) # unpack is little tricky. # When unpacking the data, "Serialize._unpack" must be used # and the function also must return tuple of self and size returned from "Serialize._unpack" # to operate correctly def unpack(self, data): (retTuple , size) = = Serializer._unpack(data) count = len(retTuple) # number of entities in the tuple self.x = retTuple[0] self.y = retTuple[1] self.z = retTuple[2] # Simple can be done by single line as below : # ((self.x, self.y, self.z), size) = Serializer._unpack(data) return (self, size) # Optinal def __str__(self): return "Vector3D:x=%s,y=%s,z=%s" % (self.x, self.y, self.z) ... # Now the class can be used as any other supported type for pyserilize a=0 b='Hello World' c=0.05 d= Vector3D(5.0,10.0,2.0) serializedData=Serializer.pack(a,b,c,d) unserializedData=Serializer.unpack(serializedData) print unserializedData[0] # 0 print unserializedData[1] # 'Hellow World' print unserializedData[2] # 0.05 print unserializedData[3] # "Vector3D:x=5.0,y=10.0,z=2.0" ``` Feature Requests and Bug Reports -------------------------------- Should all be reported on the Github Issue Tracker Copyright --------- Copyright (c) 2016 Woong Gyu La <[email protected]>. See LICENSE for details.
PypiClean
/airflow-declarative-1.1.tar.gz/airflow-declarative-1.1/src/airflow_declarative/transformer.py
from __future__ import absolute_import, division, print_function, unicode_literals import json import shlex import subprocess import sys from itertools import chain import jinja2 import yaml from jinja2.ext import Extension from jinja2.lexer import Token from trafaret import str_types from .compat import Iterable, Mapping from .schema import dump, ensure_schema try: from functools import reduce except ImportError: pass def yaml_filter(obj): if isinstance(obj, str_types): return obj elif isinstance(obj, jinja2.Undefined): return "" else: try: return dump(obj) except Exception as exc: raise RuntimeError( "Unable to serialize {!r} to YAML because {}." "Template render must produce valid YAML file, so please use" " simple types in `with_items` block." "".format(obj, exc) ) class YamlExtension(Extension): def filter_stream(self, stream): """ We convert {{ some.variable | filter1 | filter 2}} to {{ some.variable | filter1 | filter 2 | yaml}} ... for all variable declarations in the template This function is called by jinja2 immediately after the lexing stage, but before the parser is called. """ while not stream.eos: token = next(stream) if token.test("variable_begin"): var_expr = [] while not token.test("variable_end"): var_expr.append(token) token = next(stream) variable_end = token last_token = var_expr[-1] if last_token.test("name") and last_token.value == "yaml": # don't yaml twice continue # Wrap the whole expression between the `variable_begin` # and `variable_end` marks in parens: var_expr.insert(1, Token(var_expr[0].lineno, "lparen", None)) var_expr.append(Token(var_expr[-1].lineno, "rparen", None)) var_expr.append(Token(token.lineno, "pipe", "|")) var_expr.append(Token(token.lineno, "name", "yaml")) var_expr.append(variable_end) for token in var_expr: yield token else: yield token ENV = jinja2.Environment() ENV.filters["yaml"] = yaml_filter ENV.add_extension(YamlExtension) def transform(schema): schema0 = ensure_schema(schema) schema1 = transform_templates(schema0) schema2 = transform_defaults(schema1) return schema2 def transform_templates(schema): for dag_id, dag_schema in schema["dags"].items(): if "do" not in dag_schema: continue templates = dag_schema.pop("do") for template in templates: transform_strategy(dag_schema, template) return schema def transform_strategy(schema, template): if "with_items" in template: return transform_with_items(schema, template) else: raise RuntimeError("cannot figure how to apply template: {}".format(template)) def transform_with_items(schema, template): items = template["with_items"] if isinstance(items, dict): if set(items) == {"using"}: items = items["using"] elif set(items) == {"from_stdout"}: items = from_stdout(items["from_stdout"]) if hasattr(items, "__call__"): items = items() if not isinstance(items, Iterable): raise RuntimeError("bad with_items template: {}".format(items)) for key in {"operators", "sensors", "flow"}: if key not in template: continue subschema = reduce(merge, transform_schema_with_items(template[key], items), {}) schema.setdefault(key, {}) schema[key] = merge(schema[key], subschema) return schema def from_stdout(cmd): PY2 = sys.version_info[0] == 2 if PY2: cmd = cmd.encode("utf8") output = subprocess.check_output(shlex.split(cmd)) if not PY2: output = output.decode("utf8") return json.loads(output) def transform_schema_with_items(schema, items): return [transform_dict_with_item(schema, item) for item in items] def transform_value_with_item(value, item): if isinstance(value, Mapping): return transform_dict_with_item(value, item) elif isinstance(value, str_types): return transform_string_with_item(value, item) elif isinstance(value, Iterable): return transform_list_with_item(value, item) else: return value def transform_dict_with_item(dict, item): result = {} for key, value in dict.items(): key = transform_value_with_item(key, item) value = transform_value_with_item(value, item) result[key] = value return result def transform_list_with_item(list, item): return [transform_value_with_item(value, item) for value in list] def transform_string_with_item(string, item, env=ENV): # That's not very cool, but at least this ensures that users won't send # us arbitrary objects and will stay withof simple and clean data types. return yaml.safe_load(env.from_string(string).render(item=item)) def merge(base, other): if isinstance(base, Mapping) and isinstance(other, Mapping): return merge_mappings(base, other) elif isinstance(base, str_types) and isinstance(other, str_types): return base elif isinstance(base, Iterable) and isinstance(other, Iterable): return merge_iterable(base, other) else: return base def merge_mappings(base, other): result = dict(**base) for key in other: if key not in base: result[key] = other[key] elif base[key] == other[key]: continue else: result[key] = merge(base[key], other[key]) return result def merge_iterable(base, other): return list(chain(base, other)) def transform_defaults(schema): for dag_id, dag_schema in schema["dags"].items(): defaults = dag_schema.pop("defaults", {}) if not defaults: continue for key in {"sensors", "operators"}: if key in dag_schema and key in defaults: transform_apply_tasks_defaults(dag_schema[key], defaults[key]) return schema def transform_apply_tasks_defaults(tasks, defaults): for task_id, task_schema in tasks.items(): tasks[task_id] = transform_apply_task_defaults(task_schema, defaults) def transform_apply_task_defaults(task, defaults): return merge_mappings(task, defaults)
PypiClean
/pace-util-0.9.0.tar.gz/pace-util-0.9.0/pace/util/grid/generation.py
import functools import warnings from pace import util from pace.dsl.gt4py_utils import asarray from pace.dsl.stencil import GridIndexing from pace.stencils.corners import ( fill_corners_2d, fill_corners_agrid, fill_corners_cgrid, fill_corners_dgrid, ) from pace.util.constants import N_HALO_DEFAULT, PI, RADIUS from .eta import set_hybrid_pressure_coefficients from .geometry import ( calc_unit_vector_south, calc_unit_vector_west, calculate_divg_del6, calculate_grid_a, calculate_grid_z, calculate_l2c_vu, calculate_supergrid_cos_sin, calculate_trig_uv, calculate_xy_unit_vectors, edge_factors, efactor_a2c_v, get_center_vector, supergrid_corner_fix, unit_vector_lonlat, ) from .gnomonic import ( get_area, great_circle_distance_along_axis, local_gnomonic_ed, lon_lat_corner_to_cell_center, lon_lat_midpoint, lon_lat_to_xyz, set_c_grid_tile_border_area, set_corner_area_to_triangle_area, set_tile_border_dxc, set_tile_border_dyc, ) from .mirror import mirror_grid # TODO: when every environment in python3.8, remove # this custom decorator def cached_property(func): @property @functools.lru_cache() def wrapper(self, *args, **kwargs): return func(self, *args, **kwargs) return wrapper def ignore_zero_division(func): @functools.wraps(func) def wrapped(*args, **kwargs): with warnings.catch_warnings(): warnings.simplefilter("ignore") return func(*args, **kwargs) return wrapped # TODO # corners use sizer + partitioner rather than GridIndexer, # have to refactor fv3core calls to corners to do this as well class MetricTerms: LON_OR_LAT_DIM = "lon_or_lat" TILE_DIM = "tile" CARTESIAN_DIM = "xyz_direction" N_TILES = 6 RIGHT_HAND_GRID = False def __init__( self, *, quantity_factory: util.QuantityFactory, communicator: util.Communicator, grid_type: int = 0, ): assert grid_type < 3 self._grid_type = grid_type self._halo = N_HALO_DEFAULT self._comm = communicator self._partitioner = self._comm.partitioner self._tile_partitioner = self._partitioner.tile self._rank = self._comm.rank self.quantity_factory = quantity_factory self.quantity_factory.set_extra_dim_lengths( **{ self.LON_OR_LAT_DIM: 2, self.TILE_DIM: 6, self.CARTESIAN_DIM: 3, util.X_DIM: 1, } ) self._grid_indexing = GridIndexing.from_sizer_and_communicator( self.quantity_factory.sizer, self._comm ) self._grid_dims = [ util.X_INTERFACE_DIM, util.Y_INTERFACE_DIM, self.LON_OR_LAT_DIM, ] self._grid = self.quantity_factory.zeros( self._grid_dims, "radians", dtype=float, ) npx, npy, ndims = self._tile_partitioner.global_extent(self._grid) self._npx = npx self._npy = npy self._npz = self.quantity_factory.sizer.get_extent(util.Z_DIM)[0] self._agrid = self.quantity_factory.zeros( [util.X_DIM, util.Y_DIM, self.LON_OR_LAT_DIM], "radians", dtype=float ) self._np = self._grid.np self._dx = None self._dy = None self._dx_agrid = None self._dy_agrid = None self._dx_center = None self._dy_center = None self._ak = None self._bk = None self._ks = None self._ptop = None self._ec1 = None self._ec2 = None self._ew1 = None self._ew2 = None self._es1 = None self._es2 = None self._ee1 = None self._ee2 = None self._l2c_v = None self._l2c_u = None self._cos_sg1 = None self._cos_sg2 = None self._cos_sg3 = None self._cos_sg4 = None self._cos_sg5 = None self._cos_sg6 = None self._cos_sg7 = None self._cos_sg8 = None self._cos_sg9 = None self._sin_sg1 = None self._sin_sg2 = None self._sin_sg3 = None self._sin_sg4 = None self._sin_sg5 = None self._sin_sg6 = None self._sin_sg7 = None self._sin_sg8 = None self._sin_sg9 = None self._cosa = None self._sina = None self._cosa_u = None self._cosa_v = None self._cosa_s = None self._sina_u = None self._sina_v = None self._rsin_u = None self._rsin_v = None self._rsina = None self._rsin2 = None self._del6_u = None self._del6_v = None self._divg_u = None self._divg_v = None self._vlon = None self._vlat = None self._z11 = None self._z12 = None self._z21 = None self._z22 = None self._a11 = None self._a12 = None self._a21 = None self._a22 = None self._edge_w = None self._edge_e = None self._edge_s = None self._edge_n = None self._edge_vect_w = None self._edge_vect_e = None self._edge_vect_s = None self._edge_vect_n = None self._edge_vect_w_2d = None self._edge_vect_e_2d = None self._da_min = None self._da_max = None self._da_min_c = None self._da_max_c = None self._init_dgrid() self._init_agrid() @classmethod def from_tile_sizing( cls, npx: int, npy: int, npz: int, communicator: util.Communicator, backend: str, grid_type: int = 0, ) -> "MetricTerms": sizer = util.SubtileGridSizer.from_tile_params( nx_tile=npx - 1, ny_tile=npy - 1, nz=npz, n_halo=N_HALO_DEFAULT, extra_dim_lengths={ cls.LON_OR_LAT_DIM: 2, cls.TILE_DIM: 6, cls.CARTESIAN_DIM: 3, }, layout=communicator.partitioner.tile.layout, ) quantity_factory = util.QuantityFactory.from_backend(sizer, backend=backend) return cls( quantity_factory=quantity_factory, communicator=communicator, grid_type=grid_type, ) @property def grid(self): return self._grid @property def dgrid_lon_lat(self): """ the longitudes and latitudes of the cell corners """ return self._grid @property def gridvar(self): return self._grid @property def agrid(self): return self._agrid @property def agrid_lon_lat(self): """ the longitudes and latitudes of the cell centers """ return self._agrid @property def lon(self): return util.Quantity( data=self.grid.data[:, :, 0], dims=self.grid.dims[0:2], units=self.grid.units, gt4py_backend=self.grid.gt4py_backend, ) @property def lat(self) -> util.Quantity: return util.Quantity( data=self.grid.data[:, :, 1], dims=self.grid.dims[0:2], units=self.grid.units, gt4py_backend=self.grid.gt4py_backend, ) @property def lon_agrid(self) -> util.Quantity: return util.Quantity( data=self.agrid.data[:, :, 0], dims=self.agrid.dims[0:2], units=self.agrid.units, gt4py_backend=self.agrid.gt4py_backend, ) @property def lat_agrid(self) -> util.Quantity: return util.Quantity( data=self.agrid.data[:, :, 1], dims=self.agrid.dims[0:2], units=self.agrid.units, gt4py_backend=self.agrid.gt4py_backend, ) @property def dx(self) -> util.Quantity: """ the distance between grid corners along the x-direction """ if self._dx is None: self._dx, self._dy = self._compute_dxdy() return self._dx @property def dy(self) -> util.Quantity: """ the distance between grid corners along the y-direction """ if self._dy is None: self._dx, self._dy = self._compute_dxdy() return self._dy @property def dxa(self) -> util.Quantity: """ the with of each grid cell along the x-direction """ if self._dx_agrid is None: self._dx_agrid, self._dy_agrid = self._compute_dxdy_agrid() return self._dx_agrid @property def dya(self) -> util.Quantity: """ the with of each grid cell along the y-direction """ if self._dy_agrid is None: self._dx_agrid, self._dy_agrid = self._compute_dxdy_agrid() return self._dy_agrid @property def dxc(self) -> util.Quantity: """ the distance between cell centers along the x-direction """ if self._dx_center is None: self._dx_center, self._dy_center = self._compute_dxdy_center() return self._dx_center @property def dyc(self) -> util.Quantity: """ the distance between cell centers along the y-direction """ if self._dy_center is None: self._dx_center, self._dy_center = self._compute_dxdy_center() return self._dy_center @property def ak(self) -> util.Quantity: """ the ak coefficient used to calculate the pressure at a given k-level: pk = ak + (bk * ps) """ if self._ak is None: ( self._ks, self._ptop, self._ak, self._bk, ) = self._set_hybrid_pressure_coefficients() return self._ak @property def bk(self) -> util.Quantity: """ the bk coefficient used to calculate the pressure at a given k-level: pk = ak + (bk * ps) """ if self._bk is None: ( self._ks, self._ptop, self._ak, self._bk, ) = self._set_hybrid_pressure_coefficients() return self._bk # TODO: can ks and ptop just be derived from ak and bk instead of being returned # as part of _set_hybrid_pressure_coefficients? @property def ks(self) -> util.Quantity: """ the number of pure-pressure layers at the top of the model also the level where model transitions from pure pressure to hybrid pressure levels """ if self._ks is None: ( self._ks, self._ptop, self._ak, self._bk, ) = self._set_hybrid_pressure_coefficients() return self._ks @property def ptop(self) -> util.Quantity: """ the pressure of the top of atmosphere level """ if self._ptop is None: ( self._ks, self._ptop, self._ak, self._bk, ) = self._set_hybrid_pressure_coefficients() return self._ptop @property def ec1(self) -> util.Quantity: """ cartesian components of the local unit vetcor in the x-direation at the cell centers 3d array whose last dimension is length 3 and indicates cartesian x/y/z value """ if self._ec1 is None: self._ec1, self._ec2 = self._calculate_center_vectors() return self._ec1 @property def ec2(self) -> util.Quantity: """ cartesian components of the local unit vetcor in the y-direation at the cell centers 3d array whose last dimension is length 3 and indicates cartesian x/y/z value """ if self._ec2 is None: self._ec1, self._ec2 = self._calculate_center_vectors() return self._ec2 @property def ew1(self) -> util.Quantity: """ cartesian components of the local unit vetcor in the x-direation at the left/right cell edges 3d array whose last dimension is length 3 and indicates cartesian x/y/z value """ if self._ew1 is None: self._ew1, self._ew2 = self._calculate_vectors_west() return self._ew1 @property def ew2(self) -> util.Quantity: """ cartesian components of the local unit vetcor in the y-direation at the left/right cell edges 3d array whose last dimension is length 3 and indicates cartesian x/y/z value """ if self._ew2 is None: self._ew1, self._ew2 = self._calculate_vectors_west() return self._ew2 @property def cos_sg1(self) -> util.Quantity: """ Cosine of the angle at point 1 of the 'supergrid' within each grid cell: 9---4---8 | | 1 5 3 | | 6---2---7 """ if self._cos_sg1 is None: self._init_cell_trigonometry() return self._cos_sg1 @property def cos_sg2(self) -> util.Quantity: """ Cosine of the angle at point 2 of the 'supergrid' within each grid cell: 9---4---8 | | 1 5 3 | | 6---2---7 """ if self._cos_sg2 is None: self._init_cell_trigonometry() return self._cos_sg2 @property def cos_sg3(self) -> util.Quantity: """ Cosine of the angle at point 3 of the 'supergrid' within each grid cell: 9---4---8 | | 1 5 3 | | 6---2---7 """ if self._cos_sg3 is None: self._init_cell_trigonometry() return self._cos_sg3 @property def cos_sg4(self) -> util.Quantity: """ Cosine of the angle at point 4 of the 'supergrid' within each grid cell: 9---4---8 | | 1 5 3 | | 6---2---7 """ if self._cos_sg4 is None: self._init_cell_trigonometry() return self._cos_sg4 @property def cos_sg5(self) -> util.Quantity: """ Cosine of the angle at point 5 of the 'supergrid' within each grid cell: 9---4---8 | | 1 5 3 | | 6---2---7 The inner product of ec1 and ec2 for point 5 """ if self._cos_sg5 is None: self._init_cell_trigonometry() return self._cos_sg5 @property def cos_sg6(self) -> util.Quantity: """ Cosine of the angle at point 6 of the 'supergrid' within each grid cell: 9---4---8 | | 1 5 3 | | 6---2---7 """ if self._cos_sg6 is None: self._init_cell_trigonometry() return self._cos_sg6 @property def cos_sg7(self) -> util.Quantity: """ Cosine of the angle at point 7 of the 'supergrid' within each grid cell: 9---4---8 | | 1 5 3 | | 6---2---7 """ if self._cos_sg7 is None: self._init_cell_trigonometry() return self._cos_sg7 @property def cos_sg8(self) -> util.Quantity: """ Cosine of the angle at point 8 of the 'supergrid' within each grid cell: 9---4---8 | | 1 5 3 | | 6---2---7 """ if self._cos_sg8 is None: self._init_cell_trigonometry() return self._cos_sg8 @property def cos_sg9(self) -> util.Quantity: """ Cosine of the angle at point 9 of the 'supergrid' within each grid cell: 9---4---8 | | 1 5 3 | | 6---2---7 """ if self._cos_sg9 is None: self._init_cell_trigonometry() return self._cos_sg9 @property def sin_sg1(self) -> util.Quantity: """ Sine of the angle at point 1 of the 'supergrid' within each grid cell: 9---4---8 | | 1 5 3 | | 6---2---7 """ if self._sin_sg1 is None: self._init_cell_trigonometry() return self._sin_sg1 @property def sin_sg2(self) -> util.Quantity: """ Sine of the angle at point 2 of the 'supergrid' within each grid cell: 9---4---8 | | 1 5 3 | | 6---2---7 """ if self._sin_sg2 is None: self._init_cell_trigonometry() return self._sin_sg2 @property def sin_sg3(self) -> util.Quantity: """ Sine of the angle at point 3 of the 'supergrid' within each grid cell: 9---4---8 | | 1 5 3 | | 6---2---7 """ if self._sin_sg3 is None: self._init_cell_trigonometry() return self._sin_sg3 @property def sin_sg4(self) -> util.Quantity: """ Sine of the angle at point 4 of the 'supergrid' within each grid cell: 9---4---8 | | 1 5 3 | | 6---2---7 """ if self._sin_sg4 is None: self._init_cell_trigonometry() return self._sin_sg4 @property def sin_sg5(self) -> util.Quantity: """ Sine of the angle at point 5 of the 'supergrid' within each grid cell: 9---4---8 | | 1 5 3 | | 6---2---7 For the center point this is one minus the inner product of ec1 and ec2 squared """ if self._sin_sg5 is None: self._init_cell_trigonometry() return self._sin_sg5 @property def sin_sg6(self) -> util.Quantity: """ Sine of the angle at point 6 of the 'supergrid' within each grid cell: 9---4---8 | | 1 5 3 | | 6---2---7 """ if self._sin_sg6 is None: self._init_cell_trigonometry() return self._sin_sg6 @property def sin_sg7(self) -> util.Quantity: """ Sine of the angle at point 7 of the 'supergrid' within each grid cell: 9---4---8 | | 1 5 3 | | 6---2---7 """ if self._sin_sg7 is None: self._init_cell_trigonometry() return self._sin_sg7 @property def sin_sg8(self) -> util.Quantity: """ Sine of the angle at point 8 of the 'supergrid' within each grid cell: 9---4---8 | | 1 5 3 | | 6---2---7 """ if self._sin_sg8 is None: self._init_cell_trigonometry() return self._sin_sg8 @property def sin_sg9(self) -> util.Quantity: """ Sine of the angle at point 9 of the 'supergrid' within each grid cell: 9---4---8 | | 1 5 3 | | 6---2---7 """ if self._sin_sg9 is None: self._init_cell_trigonometry() return self._sin_sg9 @property def cosa(self) -> util.Quantity: """ cosine of angle between coordinate lines at the cell corners averaged to ensure consistent answers """ if self._cosa is None: self._init_cell_trigonometry() return self._cosa @property def sina(self) -> util.Quantity: """ as cosa but sine """ if self._sina is None: self._init_cell_trigonometry() return self._sina @property def cosa_u(self) -> util.Quantity: """ as cosa but defined at the left and right cell edges """ if self._cosa_u is None: self._init_cell_trigonometry() return self._cosa_u @property def cosa_v(self) -> util.Quantity: """ as cosa but defined at the top and bottom cell edges """ if self._cosa_v is None: self._init_cell_trigonometry() return self._cosa_v @property def cosa_s(self) -> util.Quantity: """ as cosa but defined at cell centers """ if self._cosa_s is None: self._init_cell_trigonometry() return self._cosa_s @property def sina_u(self) -> util.Quantity: """ as cosa_u but with sine """ if self._sina_u is None: self._init_cell_trigonometry() return self._sina_u @property def sina_v(self) -> util.Quantity: """ as cosa_v but with sine """ if self._sina_v is None: self._init_cell_trigonometry() return self._sina_v @property def rsin_u(self) -> util.Quantity: """ 1/sina_u**2, defined as the inverse-squrared as it is only used as such """ if self._rsin_u is None: self._init_cell_trigonometry() return self._rsin_u @property def rsin_v(self) -> util.Quantity: """ 1/sina_v**2, defined as the inverse-squrared as it is only used as such """ if self._rsin_v is None: self._init_cell_trigonometry() return self._rsin_v @property def rsina(self) -> util.Quantity: """ 1/sina**2, defined as the inverse-squrared as it is only used as such """ if self._rsina is None: self._init_cell_trigonometry() return self._rsina @property def rsin2(self) -> util.Quantity: """ 1/sin_sg5**2, defined as the inverse-squrared as it is only used as such """ if self._rsin2 is None: self._init_cell_trigonometry() return self._rsin2 @property def l2c_v(self) -> util.Quantity: """ angular momentum correction for converting v-winds from lat/lon to cartesian coordinates """ if self._l2c_v is None: self._l2c_v, self._l2c_u = self._calculate_latlon_momentum_correction() return self._l2c_v @property def l2c_u(self) -> util.Quantity: """ angular momentum correction for converting u-winds from lat/lon to cartesian coordinates """ if self._l2c_u is None: self._l2c_v, self._l2c_u = self._calculate_latlon_momentum_correction() return self._l2c_u @property def es1(self) -> util.Quantity: """ cartesian components of the local unit vetcor in the x-direation at the top/bottom cell edges, 3d array whose last dimension is length 3 and indicates cartesian x/y/z value """ if self._es1 is None: self._es1, self._es2 = self._calculate_vectors_south() return self._es1 @property def es2(self) -> util.Quantity: """ cartesian components of the local unit vetcor in the y-direation at the top/bottom cell edges, 3d array whose last dimension is length 3 and indicates cartesian x/y/z value """ if self._es2 is None: self._es1, self._es2 = self._calculate_vectors_south() return self._es2 @property def ee1(self) -> util.Quantity: """ cartesian components of the local unit vetcor in the x-direation at the cell corners, 3d array whose last dimension is length 3 and indicates cartesian x/y/z value """ if self._ee1 is None: self._ee1, self._ee2 = self._calculate_xy_unit_vectors() return self._ee1 @property def ee2(self) -> util.Quantity: """ cartesian components of the local unit vetcor in the y-direation at the cell corners, 3d array whose last dimension is length 3 and indicates cartesian x/y/z value """ if self._ee2 is None: self._ee1, self._ee2 = self._calculate_xy_unit_vectors() return self._ee2 @property def divg_u(self) -> util.Quantity: """ sina_v * dyc/dx """ if self._divg_u is None: ( self._del6_u, self._del6_v, self._divg_u, self._divg_v, ) = self._calculate_divg_del6() return self._divg_u @property def divg_v(self) -> util.Quantity: """ sina_u * dxc/dy """ if self._divg_v is None: ( self._del6_u, self._del6_v, self._divg_u, self._divg_v, ) = self._calculate_divg_del6() return self._divg_v @property def del6_u(self) -> util.Quantity: """ sina_v * dx/dyc """ if self._del6_u is None: ( self._del6_u, self._del6_v, self._divg_u, self._divg_v, ) = self._calculate_divg_del6() return self._del6_u @property def del6_v(self) -> util.Quantity: """ sina_u * dy/dxc """ if self._del6_v is None: ( self._del6_u, self._del6_v, self._divg_u, self._divg_v, ) = self._calculate_divg_del6() return self._del6_v @property def vlon(self) -> util.Quantity: """ unit vector in eastward longitude direction, 3d array whose last dimension is length 3 and indicates x/y/z value """ if self._vlon is None: self._vlon, self._vlat = self._calculate_unit_vectors_lonlat() return self._vlon @property def vlat(self) -> util.Quantity: """ unit vector in northward latitude direction, 3d array whose last dimension is length 3 and indicates x/y/z value """ if self._vlat is None: self._vlon, self._vlat = self._calculate_unit_vectors_lonlat() return self._vlat @property def z11(self) -> util.Quantity: """ vector product of horizontal component of the cell-center vector with the unit longitude vector """ if self._z11 is None: self._z11, self._z12, self._z21, self._z22 = self._calculate_grid_z() return self._z11 @property def z12(self) -> util.Quantity: """ vector product of horizontal component of the cell-center vector with the unit latitude vector """ if self._z12 is None: self._z11, self._z12, self._z21, self._z22 = self._calculate_grid_z() return self._z12 @property def z21(self) -> util.Quantity: """ vector product of vertical component of the cell-center vector with the unit longitude vector """ if self._z21 is None: self._z11, self._z12, self._z21, self._z22 = self._calculate_grid_z() return self._z21 @property def z22(self) -> util.Quantity: """ vector product of vertical component of the cell-center vector with the unit latitude vector """ if self._z22 is None: self._z11, self._z12, self._z21, self._z22 = self._calculate_grid_z() return self._z22 @property def a11(self) -> util.Quantity: """ 0.5*z22/sin_sg5 """ if self._a11 is None: self._a11, self._a12, self._a21, self._a22 = self._calculate_grid_a() return self._a11 @property def a12(self) -> util.Quantity: """ 0.5*z21/sin_sg5 """ if self._a12 is None: self._a11, self._a12, self._a21, self._a22 = self._calculate_grid_a() return self._a12 @property def a21(self) -> util.Quantity: """ 0.5*z12/sin_sg5 """ if self._a21 is None: self._a11, self._a12, self._a21, self._a22 = self._calculate_grid_a() return self._a21 @property def a22(self) -> util.Quantity: """ 0.5*z11/sin_sg5 """ if self._a22 is None: self._a11, self._a12, self._a21, self._a22 = self._calculate_grid_a() return self._a22 @property def edge_w(self) -> util.Quantity: """ factor to interpolate scalars from a to c grid at the western grid edge """ if self._edge_w is None: ( self._edge_w, self._edge_e, self._edge_s, self._edge_n, ) = self._calculate_edge_factors() return self._edge_w @property def edge_e(self) -> util.Quantity: """ factor to interpolate scalars from a to c grid at the eastern grid edge """ if self._edge_e is None: ( self._edge_w, self._edge_e, self._edge_s, self._edge_n, ) = self._calculate_edge_factors() return self._edge_e @property def edge_s(self) -> util.Quantity: """ factor to interpolate scalars from a to c grid at the southern grid edge """ if self._edge_s is None: ( self._edge_w, self._edge_e, self._edge_s, self._edge_n, ) = self._calculate_edge_factors() return self._edge_s @property def edge_n(self) -> util.Quantity: """ factor to interpolate scalars from a to c grid at the northern grid edge """ if self._edge_n is None: ( self._edge_w, self._edge_e, self._edge_s, self._edge_n, ) = self._calculate_edge_factors() return self._edge_n @property def edge_vect_w(self) -> util.Quantity: """ factor to interpolate vectors from a to c grid at the western grid edge """ if self._edge_vect_w is None: ( self._edge_vect_w, self._edge_vect_e, self._edge_vect_s, self._edge_vect_n, ) = self._calculate_edge_a2c_vect_factors() return self._edge_vect_w @property def edge_vect_w_2d(self) -> util.Quantity: """ factor to interpolate vectors from a to c grid at the western grid edge repeated in x and y to be used in stencils """ if self._edge_vect_w_2d is None: ( self._edge_vect_e_2d, self._edge_vect_w_2d, ) = self._calculate_2d_edge_a2c_vect_factors() return self._edge_vect_w_2d @property def edge_vect_e(self) -> util.Quantity: """ factor to interpolate vectors from a to c grid at the eastern grid edge """ if self._edge_vect_e is None: ( self._edge_vect_w, self._edge_vect_e, self._edge_vect_s, self._edge_vect_n, ) = self._calculate_edge_a2c_vect_factors() return self._edge_vect_e @property def edge_vect_e_2d(self) -> util.Quantity: """ factor to interpolate vectors from a to c grid at the eastern grid edge repeated in x and y to be used in stencils """ if self._edge_vect_e_2d is None: ( self._edge_vect_e_2d, self._edge_vect_w_2d, ) = self._calculate_2d_edge_a2c_vect_factors() return self._edge_vect_e_2d @property def edge_vect_s(self) -> util.Quantity: """ factor to interpolate vectors from a to c grid at the southern grid edge """ if self._edge_vect_s is None: ( self._edge_vect_w, self._edge_vect_e, self._edge_vect_s, self._edge_vect_n, ) = self._calculate_edge_a2c_vect_factors() return self._edge_vect_s @property def edge_vect_n(self) -> util.Quantity: """ factor to interpolate vectors from a to c grid at the northern grid edge """ if self._edge_vect_n is None: ( self._edge_vect_w, self._edge_vect_e, self._edge_vect_s, self._edge_vect_n, ) = self._calculate_edge_a2c_vect_factors() return self._edge_vect_n @property def da_min(self) -> util.Quantity: """ the minimum agrid cell area across all ranks, if mpi is not present and the communicator is a DummyComm this will be the minimum on the local rank """ if self._da_min is None: self._reduce_global_area_minmaxes() return self._da_min @property def da_max(self) -> util.Quantity: """ the maximum agrid cell area across all ranks, if mpi is not present and the communicator is a DummyComm this will be the maximum on the local rank """ if self._da_max is None: self._reduce_global_area_minmaxes() return self._da_max @property def da_min_c(self) -> util.Quantity: """ the minimum cgrid cell area across all ranks, if mpi is not present and the communicator is a DummyComm this will be the minimum on the local rank """ if self._da_min_c is None: self._reduce_global_area_minmaxes() return self._da_min_c @property def da_max_c(self) -> util.Quantity: """ the maximum cgrid cell area across all ranks, if mpi is not present and the communicator is a DummyComm this will be the maximum on the local rank """ if self._da_max_c is None: self._reduce_global_area_minmaxes() return self._da_max_c @cached_property def area(self) -> util.Quantity: """ the area of each a-grid cell """ return self._compute_area() @cached_property def area_c(self) -> util.Quantity: """ the area of each c-grid cell """ return self._compute_area_c() @cached_property def _dgrid_xyz(self) -> util.Quantity: """ cartesian coordinates of each dgrid cell center """ return lon_lat_to_xyz( self._grid.data[:, :, 0], self._grid.data[:, :, 1], self._np ) @cached_property def _agrid_xyz(self) -> util.Quantity: """ cartesian coordinates of each agrid cell center """ return lon_lat_to_xyz( self._agrid.data[:-1, :-1, 0], self._agrid.data[:-1, :-1, 1], self._np, ) @cached_property def rarea(self) -> util.Quantity: """ 1/cell area """ return util.Quantity( data=1.0 / self.area.data, dims=self.area.dims, units="m^-2", gt4py_backend=self.area.gt4py_backend, ) @cached_property def rarea_c(self) -> util.Quantity: """ 1/cgrid cell area """ return util.Quantity( data=1.0 / self.area_c.data, dims=self.area_c.dims, units="m^-2", gt4py_backend=self.area_c.gt4py_backend, ) @cached_property @ignore_zero_division def rdx(self) -> util.Quantity: """ 1/dx """ return util.Quantity( data=1.0 / self.dx.data, dims=self.dx.dims, units="m^-1", gt4py_backend=self.dx.gt4py_backend, ) @cached_property @ignore_zero_division def rdy(self) -> util.Quantity: """ 1/dy """ return util.Quantity( data=1.0 / self.dy.data, dims=self.dy.dims, units="m^-1", gt4py_backend=self.dy.gt4py_backend, ) @cached_property @ignore_zero_division def rdxa(self) -> util.Quantity: """ 1/dxa """ return util.Quantity( data=1.0 / self.dxa.data, dims=self.dxa.dims, units="m^-1", gt4py_backend=self.dxa.gt4py_backend, ) @cached_property @ignore_zero_division def rdya(self) -> util.Quantity: """ 1/dya """ return util.Quantity( data=1.0 / self.dya.data, dims=self.dya.dims, units="m^-1", gt4py_backend=self.dya.gt4py_backend, ) @cached_property @ignore_zero_division def rdxc(self) -> util.Quantity: """ 1/dxc """ return util.Quantity( data=1.0 / self.dxc.data, dims=self.dxc.dims, units="m^-1", gt4py_backend=self.dxc.gt4py_backend, ) @cached_property @ignore_zero_division def rdyc(self) -> util.Quantity: """ 1/dyc """ return util.Quantity( data=1.0 / self.dyc.data, dims=self.dyc.dims, units="m^-1", gt4py_backend=self.dyc.gt4py_backend, ) def _init_dgrid(self): grid_mirror_ew = self.quantity_factory.zeros( self._grid_dims, "radians", dtype=float, ) grid_mirror_ns = self.quantity_factory.zeros( self._grid_dims, "radians", dtype=float, ) grid_mirror_diag = self.quantity_factory.zeros( self._grid_dims, "radians", dtype=float, ) local_west_edge = self._tile_partitioner.on_tile_left(self._rank) local_east_edge = self._tile_partitioner.on_tile_right(self._rank) local_south_edge = self._tile_partitioner.on_tile_bottom(self._rank) local_north_edge = self._tile_partitioner.on_tile_top(self._rank) # information on position of subtile in full tile slice_x, slice_y = self._tile_partitioner.subtile_slice( self._rank, self._grid.dims, (self._npx, self._npy), overlap=True ) section_global_is = self._halo + slice_x.start section_global_js = self._halo + slice_y.start subtile_width_x = slice_x.stop - slice_x.start - 1 subtile_width_y = slice_y.stop - slice_y.start - 1 # compute gnomonic grid for this rank local_gnomonic_ed( self._grid.view[:, :, 0], self._grid.view[:, :, 1], npx=self._npx, west_edge=local_west_edge, east_edge=local_east_edge, south_edge=local_south_edge, north_edge=local_north_edge, global_is=section_global_is, global_js=section_global_js, np=self._np, rank=self._rank, ) # Next compute gnomonic for the mirrored ranks that'll be averaged j_subtile_index, i_subtile_index = self._tile_partitioner.subtile_index( self._rank ) # compute the global index starting points for the mirrored ranks ew_global_is = ( self._halo + (self._tile_partitioner.layout[0] - i_subtile_index - 1) * subtile_width_x ) ns_global_js = ( self._halo + (self._tile_partitioner.layout[1] - j_subtile_index - 1) * subtile_width_y ) # compute mirror in the east-west direction west_edge = True if local_east_edge else False east_edge = True if local_west_edge else False local_gnomonic_ed( grid_mirror_ew.view[:, :, 0], grid_mirror_ew.view[:, :, 1], npx=self._npx, west_edge=west_edge, east_edge=east_edge, south_edge=local_south_edge, north_edge=local_north_edge, global_is=ew_global_is, global_js=section_global_js, np=self._np, rank=self._rank, ) # compute mirror in the north-south direction south_edge = True if local_north_edge else False north_edge = True if local_south_edge else False local_gnomonic_ed( grid_mirror_ns.view[:, :, 0], grid_mirror_ns.view[:, :, 1], npx=self._npx, west_edge=local_west_edge, east_edge=local_east_edge, south_edge=south_edge, north_edge=north_edge, global_is=section_global_is, global_js=ns_global_js, np=self._np, rank=self._rank, ) local_gnomonic_ed( grid_mirror_diag.view[:, :, 0], grid_mirror_diag.view[:, :, 1], npx=self._npx, west_edge=west_edge, east_edge=east_edge, south_edge=south_edge, north_edge=north_edge, global_is=ew_global_is, global_js=ns_global_js, np=self._np, rank=self._rank, ) # Average the mirrored gnomonic grids tile_index = self._partitioner.tile_index(self._rank) mirror_data = { "local": self._grid.data, "east-west": grid_mirror_ew.data, "north-south": grid_mirror_ns.data, "diagonal": grid_mirror_diag.data, } mirror_grid( mirror_data=mirror_data, tile_index=tile_index, npx=self._npx, npy=self._npy, x_subtile_width=subtile_width_x + 1, y_subtile_width=subtile_width_y + 1, global_is=section_global_is, global_js=section_global_js, ng=self._halo, np=self._grid.np, right_hand_grid=self.RIGHT_HAND_GRID, ) # Shift the corner away from Japan # This will result in the corner close to east coast of China # TODO if not config.do_schmidt and config.shift_fac > 1.0e-4 shift_fac = 18 self._grid.view[:, :, 0] -= PI / shift_fac tile0_lon = self._grid.data[:, :, 0] tile0_lon[tile0_lon < 0] += 2 * PI self._grid.data[self._np.abs(self._grid.data[:]) < 1e-10] = 0.0 self._comm.halo_update(self._grid, n_points=self._halo) fill_corners_2d( self._grid.data, self._grid_indexing, gridtype="B", direction="x" ) def _init_agrid(self): # Set up lat-lon a-grid, calculate side lengths on a-grid lon_agrid, lat_agrid = lon_lat_corner_to_cell_center( self._grid.data[:, :, 0], self._grid.data[:, :, 1], self._np ) self._agrid.data[:-1, :-1, 0], self._agrid.data[:-1, :-1, 1] = ( lon_agrid, lat_agrid, ) self._comm.halo_update(self._agrid, n_points=self._halo) fill_corners_2d( self._agrid.data[:, :, 0][:, :, None], self._grid_indexing, gridtype="A", direction="x", ) fill_corners_2d( self._agrid.data[:, :, 1][:, :, None], self._grid_indexing, gridtype="A", direction="y", ) def _compute_dxdy(self): dx = self.quantity_factory.zeros([util.X_DIM, util.Y_INTERFACE_DIM], "m") dx.view[:, :] = great_circle_distance_along_axis( self._grid.view[:, :, 0], self._grid.view[:, :, 1], RADIUS, self._np, axis=0, ) dy = self.quantity_factory.zeros([util.X_INTERFACE_DIM, util.Y_DIM], "m") dy.view[:, :] = great_circle_distance_along_axis( self._grid.view[:, :, 0], self._grid.view[:, :, 1], RADIUS, self._np, axis=1, ) self._comm.vector_halo_update(dx, dy, n_points=self._halo) # at this point the Fortran code copies in the west and east edges from # the halo for dy and performs a halo update, # to ensure dx and dy mirror across the boundary. # Not doing it here at the moment. dx.data[dx.data < 0] *= -1 dy.data[dy.data < 0] *= -1 fill_corners_dgrid( dx.data[:, :, None], dy.data[:, :, None], self._grid_indexing, vector=False, ) return dx, dy def _compute_dxdy_agrid(self): dx_agrid = self.quantity_factory.zeros([util.X_DIM, util.Y_DIM], "m") dy_agrid = self.quantity_factory.zeros([util.X_DIM, util.Y_DIM], "m") lon, lat = self._grid.data[:, :, 0], self._grid.data[:, :, 1] lon_y_center, lat_y_center = lon_lat_midpoint( lon[:, :-1], lon[:, 1:], lat[:, :-1], lat[:, 1:], self._np ) dx_agrid_tmp = great_circle_distance_along_axis( lon_y_center, lat_y_center, RADIUS, self._np, axis=0 ) lon_x_center, lat_x_center = lon_lat_midpoint( lon[:-1, :], lon[1:, :], lat[:-1, :], lat[1:, :], self._np ) dy_agrid_tmp = great_circle_distance_along_axis( lon_x_center, lat_x_center, RADIUS, self._np, axis=1 ) fill_corners_agrid( dx_agrid_tmp[:, :, None], dy_agrid_tmp[:, :, None], self._grid_indexing, vector=False, ) dx_agrid.data[:-1, :-1] = dx_agrid_tmp dy_agrid.data[:-1, :-1] = dy_agrid_tmp self._comm.vector_halo_update(dx_agrid, dy_agrid, n_points=self._halo) # at this point the Fortran code copies in the west and east edges from # the halo for dy and performs a halo update, # to ensure dx and dy mirror across the boundary. # Not doing it here at the moment. dx_agrid.data[dx_agrid.data < 0] *= -1 dy_agrid.data[dy_agrid.data < 0] *= -1 return dx_agrid, dy_agrid def _compute_dxdy_center(self): dx_center = self.quantity_factory.zeros([util.X_INTERFACE_DIM, util.Y_DIM], "m") dy_center = self.quantity_factory.zeros([util.X_DIM, util.Y_INTERFACE_DIM], "m") lon_agrid, lat_agrid = ( self._agrid.data[:-1, :-1, 0], self._agrid.data[:-1, :-1, 1], ) dx_center_tmp = great_circle_distance_along_axis( lon_agrid, lat_agrid, RADIUS, self._np, axis=0 ) dy_center_tmp = great_circle_distance_along_axis( lon_agrid, lat_agrid, RADIUS, self._np, axis=1 ) # copying the second-to-last values to the last values is what the Fortran # code does, but is this correct/valid? # Maybe we want to change this to use halo updates? dx_center.data[1:-1, :-1] = dx_center_tmp dx_center.data[0, :-1] = dx_center_tmp[0, :] dx_center.data[-1, :-1] = dx_center_tmp[-1, :] dy_center.data[:-1, 1:-1] = dy_center_tmp dy_center.data[:-1, 0] = dy_center_tmp[:, 0] dy_center.data[:-1, -1] = dy_center_tmp[:, -1] set_tile_border_dxc( self._dgrid_xyz[3:-3, 3:-3, :], self._agrid_xyz[3:-3, 3:-3, :], RADIUS, dx_center.data[3:-3, 3:-4], self._tile_partitioner, self._rank, self._np, ) set_tile_border_dyc( self._dgrid_xyz[3:-3, 3:-3, :], self._agrid_xyz[3:-3, 3:-3, :], RADIUS, dy_center.data[3:-4, 3:-3], self._tile_partitioner, self._rank, self._np, ) self._comm.vector_halo_update(dx_center, dy_center, n_points=self._halo) # TODO: Add support for unsigned vector halo updates # instead of handling ad-hoc here dx_center.data[dx_center.data < 0] *= -1 dy_center.data[dy_center.data < 0] *= -1 # TODO: fix issue with interface dimensions causing validation errors fill_corners_cgrid( dx_center.data[:, :, None], dy_center.data[:, :, None], self._grid_indexing, vector=False, ) return dx_center, dy_center def _compute_area(self): area = self.quantity_factory.zeros([util.X_DIM, util.Y_DIM], "m^2") area.data[:, :] = -1.0e8 area.data[3:-4, 3:-4] = get_area( self._grid.data[3:-3, 3:-3, 0], self._grid.data[3:-3, 3:-3, 1], RADIUS, self._np, ) self._comm.halo_update(area, n_points=self._halo) return area def _compute_area_c(self): area_cgrid = self.quantity_factory.zeros( [util.X_INTERFACE_DIM, util.Y_INTERFACE_DIM], "m^2" ) area_cgrid.data[3:-3, 3:-3] = get_area( self._agrid.data[2:-3, 2:-3, 0], self._agrid.data[2:-3, 2:-3, 1], RADIUS, self._np, ) # TODO -- this does not seem to matter? running with or without does # not change whether it validates set_corner_area_to_triangle_area( lon=self._agrid.data[2:-3, 2:-3, 0], lat=self._agrid.data[2:-3, 2:-3, 1], area=area_cgrid.data[3:-3, 3:-3], tile_partitioner=self._tile_partitioner, rank=self._rank, radius=RADIUS, np=self._np, ) set_c_grid_tile_border_area( self._dgrid_xyz[2:-2, 2:-2, :], self._agrid_xyz[2:-2, 2:-2, :], RADIUS, area_cgrid.data[3:-3, 3:-3], self._tile_partitioner, self._rank, self._np, ) self._comm.halo_update(area_cgrid, n_points=self._halo) fill_corners_2d( area_cgrid.data[:, :, None], self._grid_indexing, gridtype="B", direction="x", ) return area_cgrid def _set_hybrid_pressure_coefficients(self): ks = self.quantity_factory.zeros([], "") ptop = self.quantity_factory.zeros([], "mb") ak = self.quantity_factory.zeros([util.Z_INTERFACE_DIM], "mb") bk = self.quantity_factory.zeros([util.Z_INTERFACE_DIM], "") pressure_coefficients = set_hybrid_pressure_coefficients(self._npz) ks = pressure_coefficients.ks ptop = pressure_coefficients.ptop ak.data[:] = asarray(pressure_coefficients.ak, type(ak.data)) bk.data[:] = asarray(pressure_coefficients.bk, type(bk.data)) return ks, ptop, ak, bk def _calculate_center_vectors(self): ec1 = self.quantity_factory.zeros( [util.X_DIM, util.Y_DIM, self.CARTESIAN_DIM], "" ) ec2 = self.quantity_factory.zeros( [util.X_DIM, util.Y_DIM, self.CARTESIAN_DIM], "" ) ec1.data[:] = self._np.nan ec2.data[:] = self._np.nan ec1.data[:-1, :-1, :3], ec2.data[:-1, :-1, :3] = get_center_vector( self._dgrid_xyz, self._grid_type, self._halo, self._tile_partitioner, self._rank, self._np, ) return ec1, ec2 def _calculate_vectors_west(self): ew1 = self.quantity_factory.zeros( [util.X_INTERFACE_DIM, util.Y_DIM, self.CARTESIAN_DIM], "" ) ew2 = self.quantity_factory.zeros( [util.X_INTERFACE_DIM, util.Y_DIM, self.CARTESIAN_DIM], "" ) ew1.data[:] = self._np.nan ew2.data[:] = self._np.nan ew1.data[1:-1, :-1, :3], ew2.data[1:-1, :-1, :3] = calc_unit_vector_west( self._dgrid_xyz, self._agrid_xyz, self._grid_type, self._halo, self._tile_partitioner, self._rank, self._np, ) return ew1, ew2 def _calculate_vectors_south(self): es1 = self.quantity_factory.zeros( [util.X_DIM, util.Y_INTERFACE_DIM, self.CARTESIAN_DIM], "" ) es2 = self.quantity_factory.zeros( [util.X_DIM, util.Y_INTERFACE_DIM, self.CARTESIAN_DIM], "" ) es1.data[:] = self._np.nan es2.data[:] = self._np.nan es1.data[:-1, 1:-1, :3], es2.data[:-1, 1:-1, :3] = calc_unit_vector_south( self._dgrid_xyz, self._agrid_xyz, self._grid_type, self._halo, self._tile_partitioner, self._rank, self._np, ) return es1, es2 def _calculate_more_trig_terms(self, cos_sg, sin_sg): cosa_u = self.quantity_factory.zeros([util.X_INTERFACE_DIM, util.Y_DIM], "") cosa_v = self.quantity_factory.zeros([util.X_DIM, util.Y_INTERFACE_DIM], "") cosa_s = self.quantity_factory.zeros([util.X_DIM, util.Y_DIM], "") sina_u = self.quantity_factory.zeros([util.X_INTERFACE_DIM, util.Y_DIM], "") sina_v = self.quantity_factory.zeros([util.X_DIM, util.Y_INTERFACE_DIM], "") rsin_u = self.quantity_factory.zeros([util.X_INTERFACE_DIM, util.Y_DIM], "") rsin_v = self.quantity_factory.zeros([util.X_DIM, util.Y_INTERFACE_DIM], "") rsina = self.quantity_factory.zeros( [util.X_INTERFACE_DIM, util.Y_INTERFACE_DIM], "" ) rsin2 = self.quantity_factory.zeros([util.X_DIM, util.Y_DIM], "") cosa = self.quantity_factory.zeros( [util.X_INTERFACE_DIM, util.Y_INTERFACE_DIM], "" ) sina = self.quantity_factory.zeros( [util.X_INTERFACE_DIM, util.Y_INTERFACE_DIM], "" ) ( cosa.data[:, :], sina.data[:, :], cosa_u.data[:, :-1], cosa_v.data[:-1, :], cosa_s.data[:-1, :-1], sina_u.data[:, :-1], sina_v.data[:-1, :], rsin_u.data[:, :-1], rsin_v.data[:-1, :], rsina.data[self._halo : -self._halo, self._halo : -self._halo], rsin2.data[:-1, :-1], ) = calculate_trig_uv( self._dgrid_xyz, cos_sg, sin_sg, self._halo, self._tile_partitioner, self._rank, self._np, ) return ( cosa, sina, cosa_u, cosa_v, cosa_s, sina_u, sina_v, rsin_u, rsin_v, rsina, rsin2, ) def _init_cell_trigonometry(self): self._cosa_u = self.quantity_factory.zeros( [util.X_INTERFACE_DIM, util.Y_DIM], "" ) self._cosa_v = self.quantity_factory.zeros( [util.X_DIM, util.Y_INTERFACE_DIM], "" ) self._cosa_s = self.quantity_factory.zeros([util.X_DIM, util.Y_DIM], "") self._sina_u = self.quantity_factory.zeros( [util.X_INTERFACE_DIM, util.Y_DIM], "" ) self._sina_v = self.quantity_factory.zeros( [util.X_DIM, util.Y_INTERFACE_DIM], "" ) self._rsin_u = self.quantity_factory.zeros( [util.X_INTERFACE_DIM, util.Y_DIM], "" ) self._rsin_v = self.quantity_factory.zeros( [util.X_DIM, util.Y_INTERFACE_DIM], "" ) self._rsina = self.quantity_factory.zeros( [util.X_INTERFACE_DIM, util.Y_INTERFACE_DIM], "" ) self._rsin2 = self.quantity_factory.zeros([util.X_DIM, util.Y_DIM], "") self._cosa = self.quantity_factory.zeros( [util.X_INTERFACE_DIM, util.Y_INTERFACE_DIM], "" ) self._sina = self.quantity_factory.zeros( [util.X_INTERFACE_DIM, util.Y_INTERFACE_DIM], "" ) # This section calculates the cos_sg and sin_sg terms, which describe the # angles of the corners and edges of each cell according to the supergrid: # 9---4---8 # | | # 1 5 3 # | | # 6---2---7 cos_sg, sin_sg = calculate_supergrid_cos_sin( self._dgrid_xyz, self._agrid_xyz, self.ec1.data[:-1, :-1], self.ec2.data[:-1, :-1], self._grid_type, self._halo, self._tile_partitioner, self._rank, self._np, ) ( self._cosa.data[:, :], self._sina.data[:, :], self._cosa_u.data[:, :-1], self._cosa_v.data[:-1, :], self._cosa_s.data[:-1, :-1], self._sina_u.data[:, :-1], self._sina_v.data[:-1, :], self._rsin_u.data[:, :-1], self._rsin_v.data[:-1, :], self._rsina.data[self._halo : -self._halo, self._halo : -self._halo], self._rsin2.data[:-1, :-1], ) = calculate_trig_uv( self._dgrid_xyz, cos_sg, sin_sg, self._halo, self._tile_partitioner, self._rank, self._np, ) supergrid_corner_fix( cos_sg, sin_sg, self._halo, self._tile_partitioner, self._rank ) supergrid_trig = {} for i in range(1, 10): supergrid_trig[f"cos_sg{i}"] = self.quantity_factory.zeros( [util.X_DIM, util.Y_DIM], "" ) supergrid_trig[f"cos_sg{i}"].data[:-1, :-1] = cos_sg[:, :, i - 1] supergrid_trig[f"sin_sg{i}"] = self.quantity_factory.zeros( [util.X_DIM, util.Y_DIM], "" ) supergrid_trig[f"sin_sg{i}"].data[:-1, :-1] = sin_sg[:, :, i - 1] self._cos_sg1 = supergrid_trig["cos_sg1"] self._cos_sg2 = supergrid_trig["cos_sg2"] self._cos_sg3 = supergrid_trig["cos_sg3"] self._cos_sg4 = supergrid_trig["cos_sg4"] self._cos_sg5 = supergrid_trig["cos_sg5"] self._cos_sg6 = supergrid_trig["cos_sg6"] self._cos_sg7 = supergrid_trig["cos_sg7"] self._cos_sg8 = supergrid_trig["cos_sg8"] self._cos_sg9 = supergrid_trig["cos_sg9"] self._sin_sg1 = supergrid_trig["sin_sg1"] self._sin_sg2 = supergrid_trig["sin_sg2"] self._sin_sg3 = supergrid_trig["sin_sg3"] self._sin_sg4 = supergrid_trig["sin_sg4"] self._sin_sg5 = supergrid_trig["sin_sg5"] self._sin_sg6 = supergrid_trig["sin_sg6"] self._sin_sg7 = supergrid_trig["sin_sg7"] self._sin_sg8 = supergrid_trig["sin_sg8"] self._sin_sg9 = supergrid_trig["sin_sg9"] def _calculate_derived_trig_terms_for_testing(self): """ As _calculate_derived_trig_terms_for_testing but updates trig attributes in-place without the halo updates. For use only in validation tests. """ self._cosa_u = self.quantity_factory.zeros( [util.X_INTERFACE_DIM, util.Y_DIM], "" ) self._cosa_v = self.quantity_factory.zeros( [util.X_DIM, util.Y_INTERFACE_DIM], "" ) self._cosa_s = self.quantity_factory.zeros([util.X_DIM, util.Y_DIM], "") self._sina_u = self.quantity_factory.zeros( [util.X_INTERFACE_DIM, util.Y_DIM], "" ) self._sina_v = self.quantity_factory.zeros( [util.X_DIM, util.Y_INTERFACE_DIM], "" ) self._rsin_u = self.quantity_factory.zeros( [util.X_INTERFACE_DIM, util.Y_DIM], "" ) self._rsin_v = self.quantity_factory.zeros( [util.X_DIM, util.Y_INTERFACE_DIM], "" ) self._rsina = self.quantity_factory.zeros( [util.X_INTERFACE_DIM, util.Y_INTERFACE_DIM], "" ) self._rsin2 = self.quantity_factory.zeros([util.X_DIM, util.Y_DIM], "") self._cosa = self.quantity_factory.zeros( [util.X_INTERFACE_DIM, util.Y_INTERFACE_DIM], "" ) self._sina = self.quantity_factory.zeros( [util.X_INTERFACE_DIM, util.Y_INTERFACE_DIM], "" ) cos_sg = self._np.array( [ self.cos_sg1.data[:-1, :-1], self.cos_sg2.data[:-1, :-1], self.cos_sg3.data[:-1, :-1], self.cos_sg4.data[:-1, :-1], self.cos_sg5.data[:-1, :-1], self.cos_sg6.data[:-1, :-1], self.cos_sg7.data[:-1, :-1], self.cos_sg8.data[:-1, :-1], self.cos_sg9.data[:-1, :-1], ] ).transpose([1, 2, 0]) sin_sg = self._np.array( [ self.sin_sg1.data[:-1, :-1], self.sin_sg2.data[:-1, :-1], self.sin_sg3.data[:-1, :-1], self.sin_sg4.data[:-1, :-1], self.sin_sg5.data[:-1, :-1], self.sin_sg6.data[:-1, :-1], self.sin_sg7.data[:-1, :-1], self.sin_sg8.data[:-1, :-1], self.sin_sg9.data[:-1, :-1], ] ).transpose([1, 2, 0]) ( self._cosa.data[:, :], self._sina.data[:, :], self._cosa_u.data[:, :-1], self._cosa_v.data[:-1, :], self._cosa_s.data[:-1, :-1], self._sina_u.data[:, :-1], self._sina_v.data[:-1, :], self._rsin_u.data[:, :-1], self._rsin_v.data[:-1, :], self._rsina.data[self._halo : -self._halo, self._halo : -self._halo], self._rsin2.data[:-1, :-1], ) = calculate_trig_uv( self._dgrid_xyz, cos_sg, sin_sg, self._halo, self._tile_partitioner, self._rank, self._np, ) def _calculate_latlon_momentum_correction(self): l2c_v = self.quantity_factory.zeros([util.X_INTERFACE_DIM, util.Y_DIM], "") l2c_u = self.quantity_factory.zeros([util.X_DIM, util.Y_INTERFACE_DIM], "") ( l2c_v.data[self._halo : -self._halo, self._halo : -self._halo - 1], l2c_u.data[self._halo : -self._halo - 1, self._halo : -self._halo], ) = calculate_l2c_vu(self._grid.data[:], self._halo, self._np) return l2c_v, l2c_u def _calculate_xy_unit_vectors(self): ee1 = self.quantity_factory.zeros( [util.X_INTERFACE_DIM, util.Y_INTERFACE_DIM, self.CARTESIAN_DIM], "" ) ee2 = self.quantity_factory.zeros( [util.X_INTERFACE_DIM, util.Y_INTERFACE_DIM, self.CARTESIAN_DIM], "" ) ee1.data[:] = self._np.nan ee2.data[:] = self._np.nan ( ee1.data[self._halo : -self._halo, self._halo : -self._halo, :], ee2.data[self._halo : -self._halo, self._halo : -self._halo, :], ) = calculate_xy_unit_vectors( self._dgrid_xyz, self._halo, self._tile_partitioner, self._rank, self._np ) return ee1, ee2 def _calculate_divg_del6(self): del6_u = self.quantity_factory.zeros([util.X_DIM, util.Y_INTERFACE_DIM], "") del6_v = self.quantity_factory.zeros([util.X_INTERFACE_DIM, util.Y_DIM], "") divg_u = self.quantity_factory.zeros([util.X_DIM, util.Y_INTERFACE_DIM], "") divg_v = self.quantity_factory.zeros([util.X_INTERFACE_DIM, util.Y_DIM], "") sin_sg = [ self.sin_sg1.data[:-1, :-1], self.sin_sg2.data[:-1, :-1], self.sin_sg3.data[:-1, :-1], self.sin_sg4.data[:-1, :-1], self.sin_sg5.data[:-1, :-1], ] sin_sg = self._np.array(sin_sg).transpose(1, 2, 0) ( divg_u.data[:-1, :], divg_v.data[:, :-1], del6_u.data[:-1, :], del6_v.data[:, :-1], ) = calculate_divg_del6( sin_sg, self.sina_u.data[:, :-1], self.sina_v.data[:-1, :], self.dx.data[:-1, :], self.dy.data[:, :-1], self.dxc.data[:, :-1], self.dyc.data[:-1, :], self._halo, self._tile_partitioner, self._rank, ) if self._grid_type < 3: self._comm.vector_halo_update(divg_v, divg_u, n_points=self._halo) self._comm.vector_halo_update(del6_v, del6_u, n_points=self._halo) # TODO: Add support for unsigned vector halo updates # instead of handling ad-hoc here divg_v.data[divg_v.data < 0] *= -1 divg_u.data[divg_u.data < 0] *= -1 del6_v.data[del6_v.data < 0] *= -1 del6_u.data[del6_u.data < 0] *= -1 return del6_u, del6_v, divg_u, divg_v def _calculate_divg_del6_nohalos_for_testing(self): """ As _calculate_divg_del6 but updates self.divg and self.del6 attributes in-place without the halo updates. For use only in validation tests. """ del6_u = self.quantity_factory.zeros([util.X_DIM, util.Y_INTERFACE_DIM], "") del6_v = self.quantity_factory.zeros([util.X_INTERFACE_DIM, util.Y_DIM], "") divg_u = self.quantity_factory.zeros([util.X_DIM, util.Y_INTERFACE_DIM], "") divg_v = self.quantity_factory.zeros([util.X_INTERFACE_DIM, util.Y_DIM], "") sin_sg = [ self.sin_sg1.data[:-1, :-1], self.sin_sg2.data[:-1, :-1], self.sin_sg3.data[:-1, :-1], self.sin_sg4.data[:-1, :-1], self.sin_sg5.data[:-1, :-1], ] sin_sg = self._np.array(sin_sg).transpose(1, 2, 0) ( divg_u.data[:-1, :], divg_v.data[:, :-1], del6_u.data[:-1, :], del6_v.data[:, :-1], ) = calculate_divg_del6( sin_sg, self.sina_u.data[:, :-1], self.sina_v.data[:-1, :], self.dx.data[:-1, :], self.dy.data[:, :-1], self.dxc.data[:, :-1], self.dyc.data[:-1, :], self._halo, self._tile_partitioner, self._rank, ) self._divg_v = divg_v self._divg_u = divg_u self._del6_v = del6_v self._del6_u = del6_u def _calculate_unit_vectors_lonlat(self): vlon = self.quantity_factory.zeros( [util.X_DIM, util.Y_DIM, self.CARTESIAN_DIM], "" ) vlat = self.quantity_factory.zeros( [util.X_DIM, util.Y_DIM, self.CARTESIAN_DIM], "" ) vlon.data[:-1, :-1], vlat.data[:-1, :-1] = unit_vector_lonlat( self._agrid.data[:-1, :-1], self._np ) return vlon, vlat def _calculate_grid_z(self): z11 = self.quantity_factory.zeros([util.X_DIM, util.Y_DIM], "") z12 = self.quantity_factory.zeros([util.X_DIM, util.Y_DIM], "") z21 = self.quantity_factory.zeros([util.X_DIM, util.Y_DIM], "") z22 = self.quantity_factory.zeros([util.X_DIM, util.Y_DIM], "") ( z11.data[:-1, :-1], z12.data[:-1, :-1], z21.data[:-1, :-1], z22.data[:-1, :-1], ) = calculate_grid_z( self.ec1.data[:-1, :-1], self.ec2.data[:-1, :-1], self.vlon.data[:-1, :-1], self.vlat.data[:-1, :-1], self._np, ) return z11, z12, z21, z22 def _calculate_grid_a(self): a11 = self.quantity_factory.zeros([util.X_DIM, util.Y_DIM], "") a12 = self.quantity_factory.zeros([util.X_DIM, util.Y_DIM], "") a21 = self.quantity_factory.zeros([util.X_DIM, util.Y_DIM], "") a22 = self.quantity_factory.zeros([util.X_DIM, util.Y_DIM], "") ( a11.data[:-1, :-1], a12.data[:-1, :-1], a21.data[:-1, :-1], a22.data[:-1, :-1], ) = calculate_grid_a( self.z11.data[:-1, :-1], self.z12.data[:-1, :-1], self.z21.data[:-1, :-1], self.z22.data[:-1, :-1], self.sin_sg5.data[:-1, :-1], ) return a11, a12, a21, a22 def _calculate_edge_factors(self): nhalo = self._halo edge_s = self.quantity_factory.zeros([util.X_INTERFACE_DIM], "") edge_n = self.quantity_factory.zeros([util.X_INTERFACE_DIM], "") edge_e = self.quantity_factory.zeros([util.X_DIM, util.Y_INTERFACE_DIM], "") edge_w = self.quantity_factory.zeros([util.X_DIM, util.Y_INTERFACE_DIM], "") ( edge_w.data[:, nhalo:-nhalo], edge_e.data[:, nhalo:-nhalo], edge_s.data[nhalo:-nhalo], edge_n.data[nhalo:-nhalo], ) = edge_factors( self.gridvar, self.agrid.data[:-1, :-1], self._grid_type, nhalo, self._tile_partitioner, self._rank, RADIUS, self._np, ) return edge_w, edge_e, edge_s, edge_n def _calculate_edge_a2c_vect_factors(self): edge_vect_s = self.quantity_factory.zeros([util.X_DIM], "") edge_vect_n = self.quantity_factory.zeros([util.X_DIM], "") edge_vect_e = self.quantity_factory.zeros([util.Y_DIM], "") edge_vect_w = self.quantity_factory.zeros([util.Y_DIM], "") ( edge_vect_w.data[:-1], edge_vect_e.data[:-1], edge_vect_s.data[:-1], edge_vect_n.data[:-1], ) = efactor_a2c_v( self.gridvar, self.agrid.data[:-1, :-1], self._grid_type, self._halo, self._tile_partitioner, self._rank, RADIUS, self._np, ) return edge_vect_w, edge_vect_e, edge_vect_s, edge_vect_n def _calculate_2d_edge_a2c_vect_factors(self): edge_vect_e_2d = self.quantity_factory.zeros([util.X_DIM, util.Y_DIM], "") edge_vect_w_2d = self.quantity_factory.zeros([util.X_DIM, util.Y_DIM], "") shape = self.lon.data.shape east_edge_data = self.edge_vect_e.data[self._np.newaxis, ...] east_edge_data = self._np.repeat(east_edge_data, shape[0], axis=0) west_edge_data = self.edge_vect_w.data[self._np.newaxis, ...] west_edge_data = self._np.repeat(west_edge_data, shape[0], axis=0) edge_vect_e_2d.data[:-1, :-1], edge_vect_w_2d.data[:-1, :-1] = ( east_edge_data[:-1, :-1], west_edge_data[:-1, :-1], ) return edge_vect_e_2d, edge_vect_w_2d def _reduce_global_area_minmaxes(self): min_area = self._np.min(self.area.storage[3:-4, 3:-4])[()] max_area = self._np.max(self.area.storage[3:-4, 3:-4])[()] min_area_c = self._np.min(self.area_c.storage[3:-4, 3:-4])[()] max_area_c = self._np.max(self.area_c.storage[3:-4, 3:-4])[()] try: self._da_min = self._comm.comm.allreduce(min_area, min) self._da_max = self._comm.comm.allreduce(max_area, max) self._da_min_c = self._comm.comm.allreduce(min_area_c, min) self._da_max_c = self._comm.comm.allreduce(max_area_c, max) except AttributeError: self._da_min = min_area self._da_max = max_area self._da_min_c = min_area_c self._da_max_c = max_area_c
PypiClean
/Categorize_CLI-1.0.0-py3-none-any.whl/src/Categorize_CLI/common/utils.py
from collections import Counter import os import re import time from .extensions import * from progress.bar import IncrementalBar UNITS_MAPPING = [ (1<<50, ' PB'), (1<<40, ' TB'), (1<<30, ' GB'), (1<<20, ' MB'), (1<<10, ' KB'), (1, (' byte', ' bytes')), ] def calc_size(bytes, units=UNITS_MAPPING): for factor, suffix in units: if bytes >= factor: break amount = int(bytes / factor) if isinstance(suffix, tuple): singular, multiple = suffix if amount == 1: suffix = singular else: suffix = multiple return str(amount) + suffix def find_prefixes(strings): prefix_cnts = Counter() pattern = re.compile('[^a-zA-Z0-9]') for string in strings: arr = pattern.split(string) for pos, prefix in enumerate(arr[:-1]): if not prefix.isdigit(): prefix_cnts[f'{prefix} {pos}'] += 1 prefix_cnts = {k:v for k, v in prefix_cnts.items() if v > 1} prefix_cnts = sorted(prefix_cnts.items(), key = lambda kv: (-kv[1], int(kv[0].split()[1]))) prefixes = [k for k, v in prefix_cnts] prefix_cnts = Counter(prefixes) for string in strings: arr = pattern.split(string) for pos, prefix in enumerate(arr[:-1]): token = f'{prefix} {pos}' if token in prefixes: prefix_cnts[token] += 1 break prefixes = {k.split()[0] for k, v in prefix_cnts.items() if v > 1} mapping = {} for string in strings: arr = pattern.split(string) for prefix in arr[:-1]: if prefix in prefixes: mapping[string] = prefix break else: mapping[string] = 'other' return prefixes def find_common_keyword(filenames): final = [] sub_strings = [] delimiters = ['.', ',', '!', ' ', '-', ';', '?', '*', '!', '@', '#', '$', '%', '^', '&', '(', ')', '_', '/', '|', '<', '>'] for filename in filenames: filename = filename.lower() filename = filename.split('.')[0] regexPattern = '|'.join(map(re.escape, delimiters)) sub_string = re.split(regexPattern, filename, 0) sub_strings.append(sub_string[0]) for sub_string in sub_strings: if sub_strings.count(sub_string) > 1 and not sub_string.isdigit() and sub_string != '': final.append(sub_string) return set(final) def get_key(val): for key, value in extensions.items(): if val == value: return key def get_value(one): for key, value in extensions.items(): if one == key: return value def check_files(folder_to_track): files = os.listdir(folder_to_track) isdir = any(os.path.isdir(os.path.join(folder_to_track, file + '//')) for file in files) allisdir = all(os.path.isdir(os.path.join(folder_to_track, file + '//')) for file in files) if allisdir or files.__len__() == 0: return False else: return True def moveIncrementing(source, destination): try: i = 0 destination_name = os.path.splitext(destination)[0] destination_extension = os.path.splitext(destination)[-1] while True: try: if i == 0: destination = destination_name + destination_extension else: destination = destination_name + " " + "(" + str(i) + ")" + destination_extension return os.rename(source, destination if i else destination) except OSError as ex: i = i + 1 pass except Exception as e: pass def displayProgressbar(item_count): print(os.linesep) if (item_count > 0): bar = IncrementalBar('Organizing...', max=item_count) for _ in range(item_count): bar.next() time.sleep(0.01) bar.finish()
PypiClean
/gammapy-1.1.tar.gz/gammapy-1.1/docs/development/pigs/pig-019.rst
.. include:: ../../references.txt .. _pig-019: ******************************************** PIG 19 - Gammapy package structure follow up ******************************************** * Author: Axel Donath, Régis Terrier * Created: Jan 16, 2020 * Accepted: Feb 24, 2020 * Status: accepted * Discussion: `GH 2720`_ Abstract ======== Following the proposal in :ref:`pig-016` the subpackages ``gammapy.image`` and ``gammapy.background`` were removed and a new ``gammapy.modeling`` sub-package was introduced. These changes followed the general idea of rather giving up the separation between 1D, 2D and 3D analysis use-cases and instead structuring the package by concept. In this sense ``gammapy.modeling`` now contains all models, including base classes (``Model``) a container classes (``SkyModels``), a registry object ``MODELS`` and many sub-classes. A previous step in this direction was made by introducing the ``gammapy.maps`` sub-package which resolved the distinction between the 2D and 3D data structures and replaced it with a general ND map structure. The outlook in :ref:`pig-016` already proposed the possibility to make further changes to the package structure leading in the same direction. This PIG now proposes these changes in more detail, especially introducing new ``gammapy.datasets``, ``gammapy.makers`` and ``gammapy.estimators`` sub-packages. This restructuring of the package will also reflect the general API and data analysis workflow in a better way. Proposal ======== Introduce gammapy.datasets -------------------------- The ``Dataset`` abstraction is now the central data container for any likelihood based analysis in Gammapy. It includes a base-class (``Dataset``) a container class (``Datasets``) and many specific implementations such as the ``MapDataset``, ``SpectrumDataset`` or ``FluxPointsDataset``. Currently the different sub-classes are implemented in different sub-packages ``gammapy.cube``, ``gammapy.spectrum`` while the base and container class are defined in ``gammapy.modeling``, where also a dataset registry is defined. This scattered implementation of the sub-classes seems non-intuitive and leads to practical problems such as circular imports. Currently the dataset registry (defined in ``gammapy.modeling.serialize``) imports from ``gammapy.spectrum`` and ``gammapy.cube``, while the latter sub-modules import the ``Dataset`` base class from ``gammapy.modeling``. Another minor problem occurs in documentation, where there is no obvious place to document the concept of a dataset. For this reason we propose to introduce a ``gammapy.datasets`` sub-package and move the base class, the container class, the registry, existing implementations of sub-classes and I/O related functionality there. Introduce gammapy.makers ------------------------ In the past year we introduced a configurable and flexible ``Maker`` system for data reduction in gammapy, currently implemented in ``gammapy.spectrum`` and ``gammapy.cube``. A common ``SafeMaskMaker`` is implemented in ``gammapy.cube`` but used for spectral data reduction as well. The documentation is currently split between ``gammapy.cube`` and ``gammapy.spectrum`` and partly duplicated in multiple tutorials. While already being in use, the system is not yet fully developed. A common ``Maker`` base class, a container class such as ``Makers`` and a ``MAKERS`` registry is still missing. In analogy to the datasets we propose to introduce a ``gammapy.makers`` sub-package as a common namespace for all data-reduction related functionality. This gives again an obvious place to define a common API using base classes and defining registry and container class as well. All existing ``Maker`` classes should be moved there. Later a common base class, a registry and a container class as well as common configuration and serialisation handling can be moved there. Introduce gammapy.estimators ---------------------------- Gammapy already defines a number of ``Estimator`` classes. In general an estimator can be seen as a higher level maker class, taking a dataset on input and computing derived outputs from it, mostly based on likelihood fits. This includes spectral points, lightcurves, significance maps etc. Again those classes are split among multiple sub-packages, such as ``gammapy.spectrum``, ``gammapy.time``, ``gammapy.detect`` and ``gammapy.maps``. The existing estimator classes can be mainly divided into two groups; - Flux estimators such as the ``LightCurveEstimator`` and ``FluxPointsEstimator`` where the output is a table like object. - Map estimators such as the ``TSMapEstimator`` or the ``ASmoothEstimator`` where the output is a ``Map`` or dict of ``Map`` object. No clear API definition via a common base class, nor a registry for such estimators exists. Already now there is code duplication between the ``LightCurveEstimator`` and ``FluxPointsEstimator``, which could be resolved by a common ``FluxEstimator`` base class (see `GH 2555`_). For this reason we propose to introduce a ``gammapy.estimators`` sub-package to group all existing estimator classes into the same namespace. This provides the possibility in future to define a common API via base classes, introducing general higher level estimators and a common configuration system. Introduce gammapy.visualization ------------------------------- To group plotting and data visualisation related functionality in a single namespace we propose to introduce ``gammapy.visualization``. The model of a separate sub-package for plotting was adopted by many other large astronomical python packages, such as `astropy`_, `sunpy`_, `ctapipe`_ and `sherpa`_. So far the plotting functionality in Gammapy is limited and mostly attached to data objects such as datasets, maps and irfs. Introducing ``gammapy.visualization`` would be a possibility to maintain plotting related code independently and move existing functionality such as ``MapPanelPlotter`` or ``colormap_hess`` etc. to a common namespace. Resolve gammapy.detect ---------------------- If we introduce ``gammapy.estimators`` and the ``TSMapEstimator``, ``LiMaMapEstimator``, ``ASmoothMapEstimator`` and ``KernelBackgroundMapEstimator`` have been moved the ``gammapy.detect`` package can be resolved. Minor changes ------------- In addition we propose to move the ``PSFKernel``, ``EDispMap`` and ``PSFMap`` classes to ``gammapy.irf``. Those classes represent a "reduced" IRF and are therefore similar to the existing ``EnergyDependentTablePSF`` or ``TablePSF`` classes. Alternatives ------------ An alternative approach could be to introduce a ``gammapy.core`` sub-package that contains all base-classes, container classes and registries. For each sub-package an ``subpackage/plotting.py`` file, could be introduced where plotting related functionality lives. Outlook ======= Once the functionality on data reduction, datasets and estimators has been removed to the corresponding sub-packages, the ``gammapy.cube`` and ``gammapy.spectrum`` packages can possibly be resolved. Decision ======== This PIG received only little feedback, but there was general agreement in `GH 2720`_ on the introduction of the ``gammapy.datasets`` and ``gammapy.makers`` sub-packages as well as the location of irf maps. Those changes will be introduced first. There was some concern about the ``gammapy.estimators`` sub-package. For this reason the implementation of this will be delayed and can be re-discussed at the next Gammapy coding sprint in person. A final review announced on the Gammapy and CC mailing list did not yield any additional comments. Therefore the PIG was accepted on Feb 24, 2020. .. _GH 2720: https://github.com/gammapy/gammapy/pull/2720 .. _GH 2555: https://github.com/gammapy/gammapy/issues/2555 .. _ctapipe: https://github.com/cta-observatory/ctapipe .. _sunpy: https://github.com/sunpy/sunpy
PypiClean
/torchdatasets-nightly-1676937807.tar.gz/torchdatasets-nightly-1676937807/torchdatasets/maps.py
r"""**This module provides functions one can use with** `torchdatasets.Dataset.map` **method.** Following `dataset` object will be used throughout documentation for brevity (if not defined explicitly):: # Image loading dataset import torchdatasets as td class Example(td.Dataset): def __init__(self, max: int): self.values = list(range(max)) def __getitem__(self, index): return self.values[index] def __len__(self): return len(self.values) dataset = Example(100) `maps` below are general and can be used in various scenarios. If users want to create their own `map` objects, they can use single argument callables taking sample and returning sample after modifications. """ import typing from ._base import Base class After(Base): r"""**Apply function after specified number of samples passed.** Useful for introducing data augmentation after an initial warm-up period. If you want a direct control over when function will be applied to sample, please use `torchdatasets.transforms.OnSignal`. Example:: # After 10 samples apply lambda mapping dataset = dataset.map(After(10, lambda x: -x)) Parameters ---------- samples : int After how many samples function will start being applied. function : Callable Function to apply to sample. Returns ------- Union[sample, function(sample)] Either unchanged sample or function(sample) """ def __init__(self, samples: int, function: typing.Callable): self.samples = samples self.function = function self._elements_counter = -1 def __call__(self, sample): self._elements_counter += 1 if self._elements_counter > self.samples: return self.function(sample) return sample class OnSignal(Base): r"""**Apply function based on boolean output of signalling function.** Useful for introducing data augmentation after an initial warm-up period. You can use it to turn on/off specific augmentation with respect to outer world, for example turning on image rotations after 5 epochs and turning off 5 epochs before the end in order to fine-tune your network. Example:: import torch from PIL import Image import torchdatasets as td import torchvision # Image loading dataset class ImageDataset(td.datasets.Files): def __getitem__(self, index): return Image.open(self.files[index]) class Handle: def __init__(self): self.value: bool = False def __call__(self): return self.value # you can change handle.value to switch whether mapping should be applied handle = Handle() dataset = ( ImageDataset.from_folder("./data") .map(torchvision.transforms.ToTensor()) .cache() # If handle returns True, mapping will be applied .map( td.maps.OnSignal( handle, lambda image: image + torch.rand_like(image) ) ) ) Parameters ---------- signal : Callable No argument callable returning boolean, indicating whether to apply function. function: Callable Function to apply to sample. Returns ------- Union[sample, function(sample)] Either unchanged sample of function(sample) """ def __init__(self, signal: typing.Callable[..., bool], function: typing.Callable): self.signal = signal self.function = function def __call__(self, sample): if self.signal(): return self.function(sample) return sample class Flatten(Base): r"""**Flatten arbitrarily nested sample.** Example:: # Nest elements dataset = dataset.map(lambda x: (x, (x, (x, x), x),)) # Flatten no matter how deep dataset = dataset.map(torchdatasets.maps.Flatten()) Parameters ---------- types : Tuple[type], optional Types to be considered non-flat. Those will be recursively flattened. Default: `(list, tuple)` Returns ------- Tuple[samples] Tuple with elements flattened """ def __init__(self, types: typing.Tuple = (list, tuple)): self.types = types def __call__(self, sample): if not isinstance(sample, self.types): return sample return Flatten._flatten(sample, self.types) @staticmethod def _flatten(items, types): if isinstance(items, tuple): items = list(items) for index, x in enumerate(items): while index < len(items) and isinstance(items[index], types): items[index : index + 1] = items[index] return tuple(items) class Repeat(Base): r"""**Apply function repeatedly to the sample.** Example:: import torchdatasets as td # Creating td.Dataset instance ... # Increase each value by 10 * 1 dataset = dataset.map(td.maps.Repeat(10, lambda x: x+1)) Parameters ---------- n : int How many times the function will be applied. function : Callable Function to apply. Returns ------- function(sample) Function(sample) applied n times. """ def __init__(self, n: int, function: typing.Callable): self.n = n self.function = function def __call__(self, sample): for _ in range(self.n): sample = self.function(sample) return sample class _Choice(Base): def __init__(self, *indices): self.indices = set(indices) def _magic_unpack(self, iterable): if len(iterable) == 1: return iterable[0] if len(iterable) == 0: return None return iterable class Select(_Choice): r"""**Select elements from sample.** Sample has to be indexable object (has `__getitem__` method implemented). **Important:** - Negative indexing is supported if supported by sample object. - This function is **faster** than `Drop` and should be used if possible. - If you want to select sample from nested `tuple`, please use `Flatten` first - Returns single element if only one element is left Example:: # Sample-wise concatenate dataset three times new_dataset = dataset | dataset # Only second (first index) element will be taken selected = new_dataset.map(td.maps.Select(1)) Parameters ---------- *indices : int Indices of objects to select from the sample. If left empty, empty tuple will be returned. Returns ------- Tuple[samples] Tuple with selected elements """ def __call__(self, sample): return self._magic_unpack(tuple(sample[i] for i in self.indices)) class Drop(_Choice): r"""**Return sample without selected elements.** Sample has to be indexable object (has `__getitem__` method implemented). **Important:** - Negative indexing is supported if supported by sample object. - This function is **slower** than `Select` and the latter should be preffered. - If you want to select sample from nested `tuple`, please use `Flatten` first - Returns single element if only one element is left - Returns `None` if all elements are dropped Example:: # Sample-wise concatenate dataset three times new_dataset = dataset | dataset | dataset # Zeroth and last samples dropped selected = new_dataset.map(td.maps.Drop(0, 2)) Parameters ---------- *indices : int Indices of objects to remove from the sample. If left empty, tuple containing all elements will be returned. Returns ------- Tuple[samples] Tuple without selected elements """ def __call__(self, sample): return self._magic_unpack( tuple( sample[index] for index, _ in enumerate(sample) if index not in self.indices ) ) class ToAll(Base): r"""**Apply function to each element of sample.** Sample has to be `iterable` object. **Important:** If you want to apply function to all nested elements (e.g. in nested `tuple`), please use `torchdatasets.maps.Flatten` object first. Example:: # Sample-wise concatenate dataset three times new_dataset = dataset | dataset | dataset # Each concatenated sample will be increased by 1 selected = new_dataset.map(td.maps.ToAll(lambda x: x+1)) Attributes ---------- function : Callable Function to apply to each element of sample. Returns ------- Tuple[function(subsample)] Tuple consisting of subsamples with function applied. """ def __init__(self, function: typing.Callable): self.function = function def __call__(self, sample): return tuple(self.function(subsample) for subsample in sample) class To(Base): """**Apply function to specified elements of sample.** Sample has to be `iterable` object. **Important:** If you want to apply function to all nested elements (e.g. in nested `tuple`), please use `torchdatasets.maps.Flatten` object first. Example:: # Sample-wise concatenate dataset three times new_dataset = dataset | dataset | dataset # Zero and first subsamples will be increased by one, last one left untouched selected = new_dataset.map(td.maps.To(lambda x: x+1, 0, 1)) Attributes ---------- function : Callable Function to apply to specified elements of sample. *indices : int Indices to which function will be applied. If left empty, function will not be applied to anything. Returns ------- Tuple[function(subsample)] Tuple consisting of subsamples with some having the function applied. """ def __init__(self, function: typing.Callable, *indices): self.function = function self.indices = set(indices) def __call__(self, sample): return tuple( self.function(subsample) if index in self.indices else subsample for index, subsample in enumerate(sample) ) class Except(Base): r"""**Apply function to all elements of sample except the ones specified.** Sample has to be `iterable` object. **Important:** If you want to apply function to all nested elements (e.g. in nested `tuple`), please use `torchdatasets.maps.Flatten` object first. Example:: # Sample-wise concatenate dataset three times dataset |= dataset # Every element increased by one except the first one selected = new_dataset.map(td.maps.Except(lambda x: x+1, 0)) Attributes ---------- function: Callable Function to apply to chosen elements of sample. *indices: int Indices of objects to which function will not be applied. If left empty, function will be applied to every element of sample. Returns ------- Tuple[function(subsample)] Tuple with subsamples where some have the function applied. """ def __init__(self, function: typing.Callable, *indices): self.function = function self.indices = set(indices) def __call__(self, sample): return tuple( self.function(subsample) if index not in self.indices else subsample for index, subsample in enumerate(sample) )
PypiClean
/maltpynt-2.0.1.tar.gz/maltpynt-2.0.1/astropy_helpers/astropy_helpers/sphinx/ext/utils.py
import inspect import sys def find_mod_objs(modname, onlylocals=False): """ Returns all the public attributes of a module referenced by name. .. note:: The returned list *not* include subpackages or modules of `modname`,nor does it include private attributes (those that beginwith '_' or are not in `__all__`). Parameters ---------- modname : str The name of the module to search. onlylocals : bool If True, only attributes that are either members of `modname` OR one of its modules or subpackages will be included. Returns ------- localnames : list of str A list of the names of the attributes as they are named in the module `modname` . fqnames : list of str A list of the full qualified names of the attributes (e.g., ``astropy.utils.misc.find_mod_objs``). For attributes that are simple variables, this is based on the local name, but for functions or classes it can be different if they are actually defined elsewhere and just referenced in `modname`. objs : list of objects A list of the actual attributes themselves (in the same order as the other arguments) """ __import__(modname) mod = sys.modules[modname] if hasattr(mod, '__all__'): pkgitems = [(k, mod.__dict__[k]) for k in mod.__all__] else: pkgitems = [(k, mod.__dict__[k]) for k in dir(mod) if k[0] != '_'] # filter out modules and pull the names and objs out ismodule = inspect.ismodule localnames = [k for k, v in pkgitems if not ismodule(v)] objs = [v for k, v in pkgitems if not ismodule(v)] # fully qualified names can be determined from the object's module fqnames = [] for obj, lnm in zip(objs, localnames): if hasattr(obj, '__module__') and hasattr(obj, '__name__'): fqnames.append(obj.__module__ + '.' + obj.__name__) else: fqnames.append(modname + '.' + lnm) if onlylocals: valids = [fqn.startswith(modname) for fqn in fqnames] localnames = [e for i, e in enumerate(localnames) if valids[i]] fqnames = [e for i, e in enumerate(fqnames) if valids[i]] objs = [e for i, e in enumerate(objs) if valids[i]] return localnames, fqnames, objs
PypiClean
/taskcc-alipay-sdk-python-3.3.398.tar.gz/taskcc-alipay-sdk-python-3.3.398/alipay/aop/api/request/KoubeiCateringDishRecommendQueryRequest.py
import json from alipay.aop.api.FileItem import FileItem from alipay.aop.api.constant.ParamConstants import * from alipay.aop.api.domain.KoubeiCateringDishRecommendQueryModel import KoubeiCateringDishRecommendQueryModel class KoubeiCateringDishRecommendQueryRequest(object): def __init__(self, biz_model=None): self._biz_model = biz_model self._biz_content = None self._version = "1.0" self._terminal_type = None self._terminal_info = None self._prod_code = None self._notify_url = None self._return_url = None self._udf_params = None self._need_encrypt = False @property def biz_model(self): return self._biz_model @biz_model.setter def biz_model(self, value): self._biz_model = value @property def biz_content(self): return self._biz_content @biz_content.setter def biz_content(self, value): if isinstance(value, KoubeiCateringDishRecommendQueryModel): self._biz_content = value else: self._biz_content = KoubeiCateringDishRecommendQueryModel.from_alipay_dict(value) @property def version(self): return self._version @version.setter def version(self, value): self._version = value @property def terminal_type(self): return self._terminal_type @terminal_type.setter def terminal_type(self, value): self._terminal_type = value @property def terminal_info(self): return self._terminal_info @terminal_info.setter def terminal_info(self, value): self._terminal_info = value @property def prod_code(self): return self._prod_code @prod_code.setter def prod_code(self, value): self._prod_code = value @property def notify_url(self): return self._notify_url @notify_url.setter def notify_url(self, value): self._notify_url = value @property def return_url(self): return self._return_url @return_url.setter def return_url(self, value): self._return_url = value @property def udf_params(self): return self._udf_params @udf_params.setter def udf_params(self, value): if not isinstance(value, dict): return self._udf_params = value @property def need_encrypt(self): return self._need_encrypt @need_encrypt.setter def need_encrypt(self, value): self._need_encrypt = value def add_other_text_param(self, key, value): if not self.udf_params: self.udf_params = dict() self.udf_params[key] = value def get_params(self): params = dict() params[P_METHOD] = 'koubei.catering.dish.recommend.query' params[P_VERSION] = self.version if self.biz_model: params[P_BIZ_CONTENT] = json.dumps(obj=self.biz_model.to_alipay_dict(), ensure_ascii=False, sort_keys=True, separators=(',', ':')) if self.biz_content: if hasattr(self.biz_content, 'to_alipay_dict'): params['biz_content'] = json.dumps(obj=self.biz_content.to_alipay_dict(), ensure_ascii=False, sort_keys=True, separators=(',', ':')) else: params['biz_content'] = self.biz_content if self.terminal_type: params['terminal_type'] = self.terminal_type if self.terminal_info: params['terminal_info'] = self.terminal_info if self.prod_code: params['prod_code'] = self.prod_code if self.notify_url: params['notify_url'] = self.notify_url if self.return_url: params['return_url'] = self.return_url if self.udf_params: params.update(self.udf_params) return params def get_multipart_params(self): multipart_params = dict() return multipart_params
PypiClean
/up_ibacop-0.0.4-py3-none-manylinux2014_x86_64.whl/up_ibacop/utils/features/heuristics/translate/instantiate.py
from __future__ import with_statement from collections import defaultdict import build_model import pddl_to_prolog import pddl import timers def get_fluent_facts(task, model): fluent_predicates = set() for action in task.actions: for effect in action.effects: fluent_predicates.add(effect.literal.predicate) for axiom in task.axioms: fluent_predicates.add(axiom.name) return set([fact for fact in model if fact.predicate in fluent_predicates]) def get_objects_by_type(typed_objects, types): result = defaultdict(list) supertypes = {} for type in types: supertypes[type.name] = type.supertype_names for obj in typed_objects: result[obj.type].append(obj.name) for type in supertypes[obj.type]: result[type].append(obj.name) return result def instantiate(task, model): relaxed_reachable = False fluent_facts = get_fluent_facts(task, model) init_facts = set(task.init) type_to_objects = get_objects_by_type(task.objects, task.types) instantiated_actions = [] instantiated_axioms = [] reachable_action_parameters = defaultdict(list) for atom in model: if isinstance(atom.predicate, pddl.Action): action = atom.predicate parameters = action.parameters inst_parameters = atom.args[:len(parameters)] # Note: It's important that we use the action object # itself as the key in reachable_action_parameters (rather # than action.name) since we can have multiple different # actions with the same name after normalization, and we # want to distinguish their instantiations. reachable_action_parameters[action].append(inst_parameters) variable_mapping = dict([(par.name, arg) for par, arg in zip(parameters, atom.args)]) inst_action = action.instantiate(variable_mapping, init_facts, fluent_facts, type_to_objects) if inst_action: instantiated_actions.append(inst_action) elif isinstance(atom.predicate, pddl.Axiom): axiom = atom.predicate variable_mapping = dict([(par.name, arg) for par, arg in zip(axiom.parameters, atom.args)]) inst_axiom = axiom.instantiate(variable_mapping, init_facts, fluent_facts) if inst_axiom: instantiated_axioms.append(inst_axiom) elif atom.predicate == "@goal-reachable": relaxed_reachable = True return (relaxed_reachable, fluent_facts, instantiated_actions, instantiated_axioms, reachable_action_parameters) def explore(task): prog = pddl_to_prolog.translate(task) model = build_model.compute_model(prog) with timers.timing("Completing instantiation"): return instantiate(task, model) if __name__ == "__main__": import pddl task = pddl.open() relaxed_reachable, atoms, actions, axioms, _ = explore(task) print "goal relaxed reachable: %s" % relaxed_reachable print "%d atoms:" % len(atoms) for atom in atoms: print " ", atom print print "%d actions:" % len(actions) for action in actions: action.dump() print print print "%d axioms:" % len(axioms) for axiom in axioms: axiom.dump() print
PypiClean
/pydistman-0.0.9.tar.gz/pydistman-0.0.9/docs/CONTRIBUTING.rst
============================== Appendix A. Contribution rules ============================== :Info: Those are the contribution rules for Python Dist Manager. :Copyright: © 2012-2022, Chris Warrick. :License: 3-clause BSD .. index:: contributing Do you want to contribute to this project? Great! I’d love to see some help, but you must comply with some rules. The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in RFC 2119. --------------- Issue reporting --------------- .. index:: issues GitHub Issues are the recommended way to report an issue. If you do not have an account there, get one or mail me. When pasting console sessions, you must paste them fully, *prompt-to-prompt*, to see all the messages and your input. Trim only stuff that you are 1000% sure that is not related to the project in question. -------------------------------------------- General preparations, rules and pull process -------------------------------------------- Prepare ======= A GitHub account is recommended. Patches by mail are accepted, but I’d prefer to work via GitHub. .. _Rules: Rules ===== 1. Commits must have short, informative and logical messages. Signoffs and long messages are recommended. “Fix #xxx” is required if an issue exists. 2. The following fancy Unicode characters should be used when needed: ``— “ ” ‘ ’``. ``…`` should not appear in console output, but may appear elsewhere. 3. For Python code, use the PEP 8 coding style and PEP 257 documentation style. For other languages, K&R style applies. Braces are mandatory in all blocks (even one-line blocks). Braces are on the same lines as class names and function signatures. Use 4-space indents. Request a Pull ============== Done? Go hit the **Pull Request** button over on GitHub! And if you don’t use GitHub, ``git format-patch``. Other formats are not accepted. Your commit should be pulled up in a (longer) while. If I like it. Because some commits may be bad. So, do your best not to do those bad commits.
PypiClean
/ast-toolbox-2020.9.1.7.tar.gz/ast-toolbox-2020.9.1.7/third_party/garage/src/garage/sampler/on_policy_vectorized_sampler.py
import itertools import pickle import time from dowel import logger, tabular import numpy as np from garage.experiment import deterministic from garage.misc import tensor_utils from garage.misc.prog_bar_counter import ProgBarCounter from garage.sampler.batch_sampler import BatchSampler from garage.sampler.stateful_pool import singleton_pool from garage.sampler.utils import truncate_paths from garage.sampler.vec_env_executor import VecEnvExecutor class OnPolicyVectorizedSampler(BatchSampler): """BatchSampler which uses VecEnvExecutor to run multiple environments. Args: algo (garage.np.algo.RLAlgorithm): A garage algo object env (gym.Env): A gym/akro env object n_envs (int): Number of parallel environments used for sampling. """ def __init__(self, algo, env, n_envs=None): if n_envs is None: n_envs = singleton_pool.n_parallel * 4 super().__init__(algo, env) self.n_envs = n_envs self.env_spec = self.env.spec self.vec_env = None def start_worker(self): """Start workers.""" n_envs = self.n_envs envs = [pickle.loads(pickle.dumps(self.env)) for _ in range(n_envs)] # Deterministically set environment seeds based on the global seed. for (i, e) in enumerate(envs): e.seed(deterministic.get_seed() + i) self.vec_env = VecEnvExecutor( envs=envs, max_path_length=self.algo.max_path_length) def shutdown_worker(self): """Shutdown workers.""" self.vec_env.close() # pylint: disable=too-many-statements def obtain_samples(self, itr, batch_size=None, whole_paths=True): """Sample the policy for new trajectories. Args: itr (int): Iteration number. batch_size (int): Number of samples to be collected. If None, it will be default [algo.max_path_length * n_envs]. whole_paths (bool): Whether return all the paths or not. True by default. It's possible for the paths to have total actual sample size larger than batch_size, and will be truncated if this flag is true. Returns: list[dict]: Sample paths, each path with key * observations: (numpy.ndarray) * actions: (numpy.ndarray) * rewards: (numpy.ndarray) * agent_infos: (dict) * env_infos: (dict) """ logger.log('Obtaining samples for iteration %d...' % itr) if not batch_size: batch_size = self.algo.max_path_length * self.n_envs paths = [] n_samples = 0 obses = self.vec_env.reset() dones = np.asarray([True] * self.vec_env.num_envs) running_paths = [None] * self.vec_env.num_envs pbar = ProgBarCounter(batch_size) policy_time = 0 env_time = 0 process_time = 0 policy = self.algo.policy while n_samples < batch_size: t = time.time() policy.reset(dones) actions, agent_infos = policy.get_actions(obses) policy_time += time.time() - t t = time.time() next_obses, rewards, dones, env_infos = self.vec_env.step(actions) env_time += time.time() - t t = time.time() agent_infos = tensor_utils.split_tensor_dict_list(agent_infos) env_infos = tensor_utils.split_tensor_dict_list(env_infos) if env_infos is None: env_infos = [dict() for _ in range(self.vec_env.num_envs)] if agent_infos is None: agent_infos = [dict() for _ in range(self.vec_env.num_envs)] for idx, observation, action, reward, env_info, agent_info, done in zip( # noqa: E501 itertools.count(), obses, actions, rewards, env_infos, agent_infos, dones): if running_paths[idx] is None: running_paths[idx] = dict( observations=[], actions=[], rewards=[], env_infos=[], agent_infos=[], ) running_paths[idx]['observations'].append(observation) running_paths[idx]['actions'].append(action) running_paths[idx]['rewards'].append(reward) running_paths[idx]['env_infos'].append(env_info) running_paths[idx]['agent_infos'].append(agent_info) if done: obs = np.asarray(running_paths[idx]['observations']) actions = np.asarray(running_paths[idx]['actions']) paths.append( dict(observations=obs, actions=actions, rewards=np.asarray(running_paths[idx]['rewards']), env_infos=tensor_utils.stack_tensor_dict_list( running_paths[idx]['env_infos']), agent_infos=tensor_utils.stack_tensor_dict_list( running_paths[idx]['agent_infos']))) n_samples += len(running_paths[idx]['rewards']) running_paths[idx] = None process_time += time.time() - t pbar.inc(len(obses)) obses = next_obses pbar.stop() tabular.record('PolicyExecTime', policy_time) tabular.record('EnvExecTime', env_time) tabular.record('ProcessExecTime', process_time) return paths if whole_paths else truncate_paths(paths, batch_size)
PypiClean
/jupyterlab_remote_contents-0.1.1.tar.gz/jupyterlab_remote_contents-0.1.1/node_modules/@jupyterlab/codeeditor/lib/editor.js
import { ModelDB } from '@jupyterlab/observables'; import * as models from '@jupyterlab/shared-models'; import { Signal } from '@lumino/signaling'; const globalModelDBMutex = models.createMutex(); /** * A namespace for code editors. * * #### Notes * - A code editor is a set of common assumptions which hold for all concrete editors. * - Changes in implementations of the code editor should only be caused by changes in concrete editors. * - Common JLab services which are based on the code editor should belong to `IEditorServices`. */ export var CodeEditor; (function (CodeEditor) { /** * The default selection style. */ CodeEditor.defaultSelectionStyle = { className: '', displayName: '', color: 'black' }; /** * The default implementation of the editor model. */ class Model { /** * Construct a new Model. */ constructor(options) { this._isDisposed = false; this._mimeTypeChanged = new Signal(this); this._sharedModelSwitched = new Signal(this); options = options || {}; if (options.modelDB) { this.modelDB = options.modelDB; } else { this.modelDB = new ModelDB(); } this.sharedModel = models.createStandaloneCell(this.type, options.id); this.sharedModel.changed.connect(this._onSharedModelChanged, this); const value = this.modelDB.createString('value'); value.changed.connect(this._onModelDBValueChanged, this); value.text = value.text || options.value || ''; const mimeType = this.modelDB.createValue('mimeType'); mimeType.changed.connect(this._onModelDBMimeTypeChanged, this); mimeType.set(options.mimeType || 'text/plain'); this.modelDB.createMap('selections'); } /** * When we initialize a cell model, we create a standalone model that cannot be shared in a YNotebook. * Call this function to re-initialize the local representation based on a fresh shared model (e.g. models.YFile or models.YCodeCell). * * @param sharedModel * @param reinitialize Whether to reinitialize the shared model. */ switchSharedModel(sharedModel, reinitialize) { if (reinitialize) { // update local modeldb // @todo also change metadata this.value.text = sharedModel.getSource(); } this.sharedModel.changed.disconnect(this._onSharedModelChanged, this); // clone model retrieve a shared (not standalone) model this.sharedModel = sharedModel; this.sharedModel.changed.connect(this._onSharedModelChanged, this); this._sharedModelSwitched.emit(true); } /** * We update the modeldb store when the shared model changes. * To ensure that we don't run into infinite loops, we wrap this call in a "mutex". * The "mutex" ensures that the wrapped code can only be executed by either the sharedModelChanged handler * or the modelDB change handler. */ _onSharedModelChanged(sender, change) { globalModelDBMutex(() => { if (change.sourceChange) { const value = this.modelDB.get('value'); let currpos = 0; change.sourceChange.forEach(delta => { if (delta.insert != null) { value.insert(currpos, delta.insert); currpos += delta.insert.length; } else if (delta.delete != null) { value.remove(currpos, currpos + delta.delete); } else if (delta.retain != null) { currpos += delta.retain; } }); } }); } /** * Handle a change to the modelDB value. */ _onModelDBValueChanged(value, event) { globalModelDBMutex(() => { this.sharedModel.transact(() => { switch (event.type) { case 'insert': this.sharedModel.updateSource(event.start, event.start, event.value); break; case 'remove': this.sharedModel.updateSource(event.start, event.end); break; default: this.sharedModel.setSource(value.text); break; } }); }); } get type() { return 'code'; } /** * A signal emitted when a mimetype changes. */ get mimeTypeChanged() { return this._mimeTypeChanged; } /** * A signal emitted when the shared model was switched. */ get sharedModelSwitched() { return this._sharedModelSwitched; } /** * Get the value of the model. */ get value() { return this.modelDB.get('value'); } /** * Get the selections for the model. */ get selections() { return this.modelDB.get('selections'); } /** * A mime type of the model. */ get mimeType() { return this.modelDB.getValue('mimeType'); } set mimeType(newValue) { const oldValue = this.mimeType; if (oldValue === newValue) { return; } this.modelDB.setValue('mimeType', newValue); } /** * Whether the model is disposed. */ get isDisposed() { return this._isDisposed; } /** * Dispose of the resources used by the model. */ dispose() { if (this._isDisposed) { return; } this._isDisposed = true; Signal.clearData(this); } _onModelDBMimeTypeChanged(mimeType, args) { this._mimeTypeChanged.emit({ name: 'mimeType', oldValue: args.oldValue, newValue: args.newValue }); } } CodeEditor.Model = Model; /** * The default configuration options for an editor. */ CodeEditor.defaultConfig = { autoClosingBrackets: false, codeFolding: false, cursorBlinkRate: 530, fontFamily: null, fontSize: null, handlePaste: true, insertSpaces: true, lineHeight: null, lineNumbers: false, lineWrap: 'on', matchBrackets: true, readOnly: false, tabSize: 4, rulers: [], showTrailingSpace: false, wordWrapColumn: 80 }; })(CodeEditor || (CodeEditor = {})); //# sourceMappingURL=editor.js.map
PypiClean
/hass-home-assistant-frontend-20200427.3.tar.gz/hass-home-assistant-frontend-20200427.3/hass_frontend/frontend_latest/chunk.26293c1d324edfa5efe8.js
(self.webpackJsonp=self.webpackJsonp||[]).push([[213],{334:function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(r){"object"==typeof window&&(n=window)}t.exports=n},857:function(t,e,n){"use strict";n.r(e),function(t){var n=function(){if("undefined"!=typeof Map)return Map;function t(t,e){var n=-1;return t.some(function(t,r){return t[0]===e&&(n=r,!0)}),n}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(e){var n=t(this.__entries__,e),r=this.__entries__[n];return r&&r[1]},e.prototype.set=function(e,n){var r=t(this.__entries__,e);~r?this.__entries__[r][1]=n:this.__entries__.push([e,n])},e.prototype.delete=function(e){var n=this.__entries__,r=t(n,e);~r&&n.splice(r,1)},e.prototype.has=function(e){return!!~t(this.__entries__,e)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(t,e){void 0===e&&(e=null);for(var n=0,r=this.__entries__;n<r.length;n++){var i=r[n];t.call(e,i[1],i[0])}},e}()}(),r="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,i=void 0!==t&&t.Math===Math?t:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),o="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(i):function(t){return setTimeout(function(){return t(Date.now())},1e3/60)},s=2;var c=20,a=["top","right","bottom","left","width","height","size","weight"],h="undefined"!=typeof MutationObserver,u=function(){function t(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(t,e){var n=!1,r=!1,i=0;function c(){n&&(n=!1,t()),r&&h()}function a(){o(c)}function h(){var t=Date.now();if(n){if(t-i<s)return;r=!0}else n=!0,r=!1,setTimeout(a,e);i=t}return h}(this.refresh.bind(this),c)}return t.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},t.prototype.removeObserver=function(t){var e=this.observers_,n=e.indexOf(t);~n&&e.splice(n,1),!e.length&&this.connected_&&this.disconnect_()},t.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},t.prototype.updateObservers_=function(){var t=this.observers_.filter(function(t){return t.gatherActive(),t.hasActive()});return t.forEach(function(t){return t.broadcastActive()}),t.length>0},t.prototype.connect_=function(){r&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),h?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){r&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(t){var e=t.propertyName,n=void 0===e?"":e;a.some(function(t){return!!~n.indexOf(t)})&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),f=function(t,e){for(var n=0,r=Object.keys(e);n<r.length;n++){var i=r[n];Object.defineProperty(t,i,{value:e[i],enumerable:!1,writable:!1,configurable:!0})}return t},d=function(t){return t&&t.ownerDocument&&t.ownerDocument.defaultView||i},p=y(0,0,0,0);function v(t){return parseFloat(t)||0}function l(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return e.reduce(function(e,n){return e+v(t["border-"+n+"-width"])},0)}function _(t){var e=t.clientWidth,n=t.clientHeight;if(!e&&!n)return p;var r=d(t).getComputedStyle(t),i=function(t){for(var e={},n=0,r=["top","right","bottom","left"];n<r.length;n++){var i=r[n],o=t["padding-"+i];e[i]=v(o)}return e}(r),o=i.left+i.right,s=i.top+i.bottom,c=v(r.width),a=v(r.height);if("border-box"===r.boxSizing&&(Math.round(c+o)!==e&&(c-=l(r,"left","right")+o),Math.round(a+s)!==n&&(a-=l(r,"top","bottom")+s)),!function(t){return t===d(t).document.documentElement}(t)){var h=Math.round(c+o)-e,u=Math.round(a+s)-n;1!==Math.abs(h)&&(c-=h),1!==Math.abs(u)&&(a-=u)}return y(i.left,i.top,c,a)}var b="undefined"!=typeof SVGGraphicsElement?function(t){return t instanceof d(t).SVGGraphicsElement}:function(t){return t instanceof d(t).SVGElement&&"function"==typeof t.getBBox};function m(t){return r?b(t)?function(t){var e=t.getBBox();return y(0,0,e.width,e.height)}(t):_(t):p}function y(t,e,n,r){return{x:t,y:e,width:n,height:r}}var w=function(){function t(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=y(0,0,0,0),this.target=t}return t.prototype.isActive=function(){var t=m(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},t.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},t}(),g=function(){return function(t,e){var n,r,i,o,s,c,a,h=(r=(n=e).x,i=n.y,o=n.width,s=n.height,c="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,a=Object.create(c.prototype),f(a,{x:r,y:i,width:o,height:s,top:i,right:r+o,bottom:s+i,left:r}),a);f(this,{target:t,contentRect:h})}}(),E=function(){function t(t,e,r){if(this.activeObservations_=[],this.observations_=new n,"function"!=typeof t)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=e,this.callbackCtx_=r}return t.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(t instanceof d(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;e.has(t)||(e.set(t,new w(t)),this.controller_.addObserver(this),this.controller_.refresh())}},t.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(t instanceof d(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;e.has(t)&&(e.delete(t),e.size||this.controller_.removeObserver(this))}},t.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},t.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(e){e.isActive()&&t.activeObservations_.push(e)})},t.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,e=this.activeObservations_.map(function(t){return new g(t.target,t.broadcastRect())});this.callback_.call(t,e,t),this.clearActive()}},t.prototype.clearActive=function(){this.activeObservations_.splice(0)},t.prototype.hasActive=function(){return this.activeObservations_.length>0},t}(),O="undefined"!=typeof WeakMap?new WeakMap:new n,M=function(){return function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=u.getInstance(),r=new E(e,n,this);O.set(this,r)}}();["observe","unobserve","disconnect"].forEach(function(t){M.prototype[t]=function(){var e;return(e=O.get(this))[t].apply(e,arguments)}});var A=void 0!==i.ResizeObserver?i.ResizeObserver:M;e.default=A}.call(this,n(334))}}]); //# sourceMappingURL=chunk.26293c1d324edfa5efe8.js.map
PypiClean
/azure-mgmt-oep-1.0.0b1.zip/azure-mgmt-oep-1.0.0b1/azure/mgmt/oep/operations/_operations.py
import functools from typing import Any, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from msrest import Serializer from .. import models as _models from .._vendor import _convert_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False def build_list_request( **kwargs: Any ) -> HttpRequest: api_version = "2021-06-01-preview" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/providers/Microsoft.OpenEnergyPlatform/operations') # Construct parameters query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", url=url, params=query_parameters, headers=header_parameters, **kwargs ) class Operations(object): """Operations operations. You should not instantiate this class directly. Instead, you should create a Client instance that instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. :type models: ~open_energy_platform_management_service_apis.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. """ models = _models def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer self._config = config @distributed_trace def list( self, **kwargs: Any ) -> "_models.OperationListResult": """Lists the available operations of Microsoft.OpenEnergyPlatform resource provider. :keyword callable cls: A custom type or function that will be passed the direct response :return: OperationListResult, or the result of cls(response) :rtype: ~open_energy_platform_management_service_apis.models.OperationListResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) request = build_list_request( template_url=self.list.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('OperationListResult', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized list.metadata = {'url': '/providers/Microsoft.OpenEnergyPlatform/operations'} # type: ignore
PypiClean
/amazon-braket-schemas-1.19.1.tar.gz/amazon-braket-schemas-1.19.1/src/braket/device_schema/simulators/gate_model_simulator_device_capabilities_v1.py
from typing import Dict, Union from pydantic import Field from braket.device_schema.device_action_properties import DeviceActionType from braket.device_schema.device_capabilities import DeviceCapabilities from braket.device_schema.jaqcd_device_action_properties import JaqcdDeviceActionProperties from braket.device_schema.openqasm_device_action_properties import OpenQASMDeviceActionProperties from braket.device_schema.simulators.gate_model_simulator_paradigm_properties_v1 import ( GateModelSimulatorParadigmProperties, ) from braket.schema_common import BraketSchemaBase, BraketSchemaHeader class GateModelSimulatorDeviceCapabilities(BraketSchemaBase, DeviceCapabilities): """ This defines the capabilities of a simulator device. Attributes: action (Dict[Union[DeviceActionType, str], Union[OpenQASMDeviceActionProperties, JaqcdDeviceActionProperties]]): Actions that a gate model simulator device can support paradigm (GateModelSimulatorParadigmProperties): Paradigm properties of a simulator Examples: >>> import json >>> input_json = { ... "braketSchemaHeader": { ... "name": ... "braket.device_schema.simulators.gate_model_simulator_device_capabilities", ... "version": "1", ... }, ... "service": { ... "braketSchemaHeader": { ... "name": "braket.device_schema.device_service_properties", ... "version": "1", ... }, ... "executionWindows": [ ... { ... "executionDay": "Everyday", ... "windowStartHour": "09:00", ... "windowEndHour": "11:00", ... } ... ], ... "shotsRange": [1, 10], ... "deviceCost": { ... "price": 0.25, ... "unit": "minute" ... }, ... "deviceDocumentation": { ... "imageUrl": "image_url", ... "summary": "Summary on the device", ... "externalDocumentationUrl": "external doc link", ... }, ... "deviceLocation": "us-east-1", ... "updatedAt": "2020-06-16T19:28:02.869136", ... }, ... "action": { ... "braket.ir.jaqcd.program": { ... "actionType": "braket.ir.jaqcd.program", ... "version": ["1"], ... "supportedOperations": ["x", "y"], ... "supportedResultTypes":[{ ... "name": "resultType1", ... "observables": ["observable1"], ... "minShots": 0, ... "maxShots": 4, ... }], ... } ... }, ... "paradigm": { ... "braketSchemaHeader": { ... "name": ... "braket.device_schema.simulators.gate_model_simulator_paradigm_properties", ... "version": "1", ... }, ... "qubitCount": 31 ... }, ... "deviceParameters": {GateModelSimulatorDeviceParameters.schema_json()}, ... } >>> GateModelSimulatorDeviceCapabilities.parse_raw_schema(json.dumps(input_json)) """ _PROGRAM_HEADER = BraketSchemaHeader( name="braket.device_schema.simulators.gate_model_simulator_device_capabilities", version="1" ) braketSchemaHeader: BraketSchemaHeader = Field(default=_PROGRAM_HEADER, const=_PROGRAM_HEADER) action: Dict[ Union[DeviceActionType, str], Union[OpenQASMDeviceActionProperties, JaqcdDeviceActionProperties], ] paradigm: GateModelSimulatorParadigmProperties
PypiClean
/parrot_olympe-7.7.1-py3-none-manylinux_2_31_x86_64.whl/olympe/doc/userguide/basics/expectations.rst
Changing a drone setting - Understand the "expectation" mechanism ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ In this example, we will change the "maximum tilt" drone setting. This setting indirectly controls the maximum drone acceleration and speed. The more the drone can tilt, the more the drone gain speed. The maximum tilt setting itself must be within a minimum and maximum range. A drone with a max tilt value of 0° is not particularly useful while a maximum tilt over 180° might only be useful for a racer drone. For ANAFI the maximum tilt setting must be within 1° and 40°. You might be wondering: - What is happening when you send an invalid setting value (ex: 180°)? - How does the drone respond to that? - How do we catch this kind of error with Olympe? Let's see how this is done in the following example. Some important explanations will follow. First, reset the simulation (``sphinx-cli action -m world fwman world_reset_all`` in a terminal). Create the following Python ``maxtilt.py`` script somewhere in your home directory: .. literalinclude:: ../../examples/maxtilt.py :language: python :linenos: This time, the script starts by importing the :py:func:`~olympe.messages.ardrone3.PilotingSettings.MaxTilt` command from the ``ardrone3`` feature. Then, it connects to the drone and sends two MaxTilt commands. The first one with a 10° tilt value, the second with a 0° tilt value. Note that this time, we are assigning into the ``maxTiltAction`` variable the object returned by the ``.wait()`` method. For now, all you have to know is that you can call ``.success() -> bool`` on an "action" object (the more general term is "expectation" object) if you want to know if your command succeeded or not. The ``success()`` function just returns ``True`` in case of success and ``False`` otherwise. You can also call ``.timedout() -> bool`` on an "action" object to know if your command message timed out. This ``.timedout()`` method is not particularly useful in this example because we always call ``.wait()`` on the action object, so the action is either successful or has timed out. To execute this script, from the same shell/terminal you have source'd the ``shell`` script in: .. code-block:: console $ python ./maxtilt.py If all goes well, you should see the following output in your terminal: .. code-block:: console MaxTilt(10) success MaxTilt(0) timedout Obviously, the 10° maximum tilt value is correct, so the first command succeeded while the second command failed to set an incorrect 0° maximum tilt value. It is important to understand how Olympe knows if a particular command succeeded or not. When Olympe sends a **command message**, it usually implicitly expects an **event message** in return. Up until now, we have only explicitly used **command messages**. Command messages and event messages are somewhat similar. They are both associated with an internal unique ID and eventually with some arguments (ex: the maximum tilt value) and they both travel from one source to a destination. A **command message** travel from the controller (Olympe) to the drone while an **event message** travel the other way around. Here, when Olympe sends the ``MaxTilt(10)`` **command message** it implicitly expects a ``MaxTiltChanged(10)`` **event message** in return. If the event is received in time, everything is fine: ``maxTiltAction.success() is True and maxTiltAction.timedout() is False``. Otherwise, the ``maxTiltAction`` times out (``maxTiltAction.success() is False and maxTiltAction.timedout() is True``). The :ref:`following sequence diagram<max-tilt-diag>` illustrates what is happening here. For the second maximum tilt command, when Olympe sends the ``MaxTilt(0)`` **command message** it receives a ``MaxTiltChanged(1)`` **event message** because 0° is an invalid setting value, so the drone just informs the controller that it has set the minimum setting value instead (1°). Olympe **does not assume** that this response means "No, I won't do what you are asking". Instead, it still waits for a ``MaxTiltChanged(0)`` event that will never come and the command message times out: (``maxTiltAction.success() is False and maxTiltAction.timedout() is True``). This behavior is identical for every command message: **when Olympe sends a command message to a drone, it either result in a success or a timeout**. .. _max-tilt-diag: .. seqdiag:: :caption: Setting the drone MaxTilt :align: center seqdiag { activation = none; edge_length = 400; default_fontsize = 14; Olympe => Drone [label = "connect", return = "connected"] Olympe ->> Drone [label = "MaxTilt(10)", leftnote="maxTiltAction pending"] Olympe <<-- Drone [label = "MaxTiltChanged(current=10., min=1., max=40.)", leftnote="maxTiltAction successful"]; Olympe ->> Drone [label = "MaxTilt(0)", leftnote="maxTiltAction pending"] Olympe <<-- Drone [label = "MaxTiltChanged(current=1., min=1., max=40.)", leftnote="maxTiltAction still pending"]; Olympe -> Olympe [leftnote = "maxTiltAction timedout"] Olympe => Drone [label = "disconnect", return = "disconnected"] } The arsdk protocol defined in `arsdk-xml` does not provide a way to report errors uniformly. This is why Olympe cannot detect errors like this one and just time out instead. Olympe associates to each command a default timeout that can be overridden with the `_timeout` message parameter. For example: .. code-block:: python maxTiltAction = drone(MaxTilt(10, _timeout=1)).wait()
PypiClean
/indie_engine-1.0.0-py3-none-any.whl/IndieEngine/input_feild.py
from IndieEngine.font import FONT from IndieEngine.inputs import EVENT, KEY from IndieEngine.physics import QUAD from .transform import TRANSFORM from .colour import COLOUR from . import app as e import pygame pygame.init() class INPUTFEILD(TRANSFORM): """ Customisable Input feilds """ save_status = False COLOR_INACTIVE = COLOUR().make(0,0,0) COLOR_ACTIVE =COLOUR().make(20,80,80) def __init__(self,rect:QUAD,font:FONT, text='',colour_inactive=COLOUR().make(0,0,0),colour_active=COLOUR().make(20,80,80)): self.position = rect.position self.size = rect.size self.rect = pygame.Rect(rect.x,rect.y,rect.w,rect.h) self.color = colour_inactive self.COLOR_INACTIVE = colour_inactive self.COLOR_ACTIVE = colour_active self.text = text self.active = False self.font = font self.save_status = True self.save() self.txt_surface = font.render(self.text, True, COLOUR().make(150,150,150)) def controls(self, event): if event.type == EVENT.mouse_button_down: # If the user clicked on the input_box rect. if self.rect.collidepoint(event.pos): if self.true_value: self.text = self.true_value self.update() # Toggle the active variable. self.active = not self.active else: if self.active: self.active = False if not "..." in self.text: self.save() # Change the current color of the input box. if self.active: self.color = self.COLOR_ACTIVE else: self.color = self.COLOR_INACTIVE # Re-render the text. self.txt_surface = self.font.render(self.text, True, COLOUR().make(150,150,150)) if event.type == EVENT.key_down: if self.active: self.update() if event.key == KEY.return_: self.save_status = True self.save() self.active = False elif event.key == KEY.backspace: self.text = self.text[:-1] else: self.save_status = False self.text += event.unicode # Re-render the text. self.txt_surface = self.font.render(self.text, True, COLOUR().make(150,150,150)) def update(self): # Resize the box if the text is too long. width = max(50, self.txt_surface.get_width()+ 20) self.rect.width = width def blit(self): # Blit the rect. pygame.draw.rect(e.screen, self.color, self.rect, 0) # Blit the text. self.rect = pygame.Rect(self.position.x,self.position.y,self.size.x,self.size.y) e.screen.blit(self.txt_surface, (self.rect.x+5, self.rect.y+10)) true_value = None def save(self): self.true_value = self.text self.text = f"{self.text[:int(self.size.x/10)]}..."
PypiClean
/shimmer-listener-0.4.0.tar.gz/shimmer-listener-0.4.0/shimmer_listener/__init__.py
from ._streams import BtStream, BtSlaveInputStream, BtMasterInputStream, Frameinfo from ._slave import _slave_init, _slave_listen, _slave_close from ._master import _master_listen, _master_close from typing import Optional, Callable, Any, Dict, List, Union import enum __all__ = ["bt_init", "bt_listen", "bt_close", "Frameinfo", "BtMode", "BtStream", "BtMasterInputStream", "BtSlaveInputStream"] class BtMode(enum.Enum): """ Enum used to set the mode in which the library is acting towards the shimmer devices. """ MASTER = 0 SLAVE = 1 @property def index(self): """ Returns a numerical representation of the enum values, where MASTER = 0, SLAVE = 1. """ return self.value listen: List[Callable] = [_master_listen, _slave_listen] close: List[Callable] = [_master_close, _slave_close] _op_mode: Optional[BtMode] = None _running: bool = False def bt_init(mode: BtMode) -> None: """ Initializes the bluetooth server socket interface. Call this at the beginning of your program. """ global _op_mode, _running if _running: raise ValueError("Trying to initialize an already started interface") if mode == BtMode.SLAVE: _slave_init() _op_mode = mode _running = True def bt_listen(connect_handle: Optional[Callable[[str, Frameinfo], None]] = None, message_handle: Optional[Callable[[str, Dict[str, Any]], None]] = None, disconnect_handle: Optional[Callable[[str, bool], None]] = None, **kwargs: Union[str, float]) -> None: """ Starts the listen loop, attaching the passed handlers as event callbacks to each stream that is started. Various options can be passed as keyword arguments depending on the stream type. If the application is in master mode, you can specify the duration of the lookup and scan operations using the following keyword arguments: - **lookup_duration**: defaults to 5 seconds - **scan_interval**: default to 5 seconds """ global _op_mode if _op_mode is None or not _running: raise ValueError("Listen operation on non initialized interface") listen[_op_mode.index](connect_handle, message_handle, disconnect_handle, **kwargs) def bt_close() -> None: """ Gracefully stops any open connection. """ global _op_mode, _running if _op_mode is None: raise ValueError("Trying to close a non initialized interface") close[_op_mode.index]() _op_mode = None _running = False
PypiClean
/pandas_sanddance-0.2.0.tar.gz/pandas_sanddance-0.2.0/src/widget.ts
import { DOMWidgetModel, DOMWidgetView, ISerializers } from '@jupyter-widgets/base'; import { MODULE_NAME, MODULE_VERSION } from './version'; import * as deck from '@deck.gl/core'; import * as layers from '@deck.gl/layers'; import * as luma from 'luma.gl'; import * as fabric from 'office-ui-fabric-react'; import * as vega from 'vega'; import { Explorer, use } from '@msrvida/sanddance-explorer'; import ReactDOM from 'react-dom' import React from 'react' import '../css/widget.css' // TODO use(fabric as any, vega, deck as any, layers, luma); fabric.initializeIcons(); export class SandDanceModel extends DOMWidgetModel { defaults() { return { ...super.defaults(), _model_name: SandDanceModel.model_name, _model_module: SandDanceModel.model_module, _model_module_version: SandDanceModel.model_module_version, _view_name: SandDanceModel.view_name, _view_module: SandDanceModel.view_module, _view_module_version: SandDanceModel.view_module_version, value : '[]', // json string width : '100%', heigth : '60vh', snapshots: [], }; } static serializers: ISerializers = { ...DOMWidgetModel.serializers, // Add any extra serializers here } static model_name = 'SandDanceModel'; static model_module = MODULE_NAME; static model_module_version = MODULE_VERSION; static view_name = 'SandDanceView'; static view_module = MODULE_NAME; static view_module_version = MODULE_VERSION; } export class SandDanceView extends DOMWidgetView { private intervalID?: NodeJS.Timeout private explorer?: Explorer private wrapper?: React.DetailedReactHTMLElement<any, HTMLElement> render () { const explorerProps = { logoClickUrl: 'https://microsoft.github.io/SandDance/', compactUI: true, mounted: (explorer: Explorer) => { this.explorer = explorer; this.model.on('change:value', this.value_changed, this); setTimeout(() => { this.value_changed(); }, 1); }, // TODO ref: (ref: any) => { // restore previoous snapshot states ref.state.snapshots = this.model.get('snapshots'); this.intervalID = this.autosaveSnapshots(ref) }, key: 'explorer-key' }; this.wrapper = React.createElement( 'div', { style: { width: this.model.get('width'), height: this.model.get('height'), } }, [React.createElement(Explorer, explorerProps)], ); ReactDOM.render(this.wrapper, this.el); this.model.on('change:width', this.size_changed, this); this.model.on('change:height', this.size_changed, this); } // TODO autosaveSnapshots (ref: any) { return setInterval(() => { this.model.set('snapshots', ref.state.snapshots) this.model.save_changes(); }, 1000 * 10); } size_changed () { if (!this.wrapper) { return; } const style = { width: this.model.get('width'), height: this.model.get('height'), }; this.wrapper.props.style = style; } value_changed () { if (!this.explorer) { return; } this.explorer.load(JSON.parse(this.model.get('value'))); } remove() { if (this.intervalID) { clearInterval(this.intervalID); } super.remove(); } }
PypiClean
/horizon-23.2.0.tar.gz/horizon-23.2.0/openstack_dashboard/dashboards/identity/application_credentials/views.py
from django.conf import settings from django import http from django.template.loader import render_to_string from django.urls import reverse from django.urls import reverse_lazy from django.utils.translation import gettext_lazy as _ from horizon import exceptions from horizon import forms from horizon import tables from horizon.utils import memoized from horizon import views from openstack_dashboard import api from openstack_dashboard.utils import settings as setting_utils from openstack_dashboard.dashboards.identity.application_credentials \ import forms as project_forms from openstack_dashboard.dashboards.identity.application_credentials \ import tables as project_tables INDEX_URL = "horizon:identity:application_credentials:index" class IndexView(tables.DataTableView): table_class = project_tables.ApplicationCredentialsTable template_name = 'identity/application_credentials/index.html' page_title = _("Application Credentials") def needs_filter_first(self, table): return self._needs_filter_first def get_data(self): app_creds = [] filters = self.get_filters() self._needs_filter_first = False # If filter_first is set and if there are not other filters # selected, then search criteria must be provided # and return an empty list if (setting_utils.get_dict_config( 'FILTER_DATA_FIRST', 'identity.application_credentials') and not filters): self._needs_filter_first = True return app_creds try: app_creds = api.keystone.application_credential_list( self.request, filters=filters) except Exception: exceptions.handle( self.request, _('Unable to retrieve application credential list.')) return app_creds class CreateView(forms.ModalFormView): template_name = 'identity/application_credentials/create.html' form_id = 'create_application_credential_form' form_class = project_forms.CreateApplicationCredentialForm submit_label = _("Create Application Credential") submit_url = reverse_lazy( 'horizon:identity:application_credentials:create') success_url = reverse_lazy( 'horizon:identity:application_credentials:success') page_title = _("Create Application Credential") def get_form_kwargs(self): kwargs = super().get_form_kwargs() kwargs['next_view'] = CreateSuccessfulView return kwargs def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) context['kubeconfig_enabled'] = settings.KUBECONFIG_ENABLED return context class CreateSuccessfulView(forms.ModalFormView): template_name = 'identity/application_credentials/success.html' page_title = _("Your Application Credential") form_class = project_forms.CreateSuccessfulForm model_id = "create_application_credential_successful_modal" success_url = reverse_lazy( 'horizon:identity:application_credentials:index') cancel_label = _("Close") download_openrc_label = _("Download openrc file") download_clouds_yaml_label = _("Download clouds.yaml") download_kubeconfig_label = _("Download kubeconfig file") def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) context['download_openrc_label'] = self.download_openrc_label context['download_clouds_yaml_label'] = self.download_clouds_yaml_label context['download_kubeconfig_label'] = self.download_kubeconfig_label context['download_openrc_url'] = reverse( 'horizon:identity:application_credentials:download_openrc') context['download_clouds_yaml_url'] = reverse( 'horizon:identity:application_credentials:download_clouds_yaml') if settings.KUBECONFIG_ENABLED: context['download_kubeconfig_url'] = reverse( 'horizon:identity:application_credentials:download_kubeconfig') return context def get_initial(self): app_cred = self.request.session['application_credential'] return { 'app_cred_id': app_cred['id'], 'app_cred_name': app_cred['name'], 'app_cred_secret': app_cred['secret'] } def _get_context(request): auth_url = api.base.url_for(request, 'identity', endpoint_type='publicURL') interface = 'public' region = getattr(request.user, 'services_region', '') app_cred = request.session['application_credential'] context = { 'auth_url': auth_url, 'interface': interface, 'region': region, 'user': request.user, 'application_credential_id': app_cred['id'], 'application_credential_name': app_cred['name'], 'application_credential_secret': app_cred['secret'], 'kubernetes_namespace': app_cred['kubernetes_namespace'], 'kubernetes_url': settings.KUBECONFIG_KUBERNETES_URL, 'kubernetes_certificate_authority_data': settings.KUBECONFIG_CERTIFICATE_AUTHORITY_DATA} return context def _render_attachment(filename, template, context, request): content = render_to_string(template, context, request=request) disposition = 'attachment; filename="%s"' % filename response = http.HttpResponse(content, content_type="text/plain") response['Content-Disposition'] = disposition.encode('utf-8') response['Content-Length'] = str(len(response.content)) return response def download_rc_file(request): context = _get_context(request) template = 'identity/application_credentials/openrc.sh.template' filename = 'app-cred-%s-openrc.sh' % context['application_credential_name'] response = _render_attachment(filename, template, context, request) return response def download_clouds_yaml_file(request): context = _get_context(request) context['cloud_name'] = getattr( settings, "OPENSTACK_CLOUDS_YAML_NAME", 'openstack') context['profile'] = getattr( settings, "OPENSTACK_CLOUDS_YAML_PROFILE", None) context['regions'] = [ region_tuple[1] for region_tuple in getattr( settings, "AVAILABLE_REGIONS", []) ] template = 'identity/application_credentials/clouds.yaml.template' filename = 'clouds.yaml' return _render_attachment(filename, template, context, request) def download_kubeconfig_file(request): context = _get_context(request) template = 'identity/application_credentials/kubeconfig.template' filename = 'app-cred-%s-kubeconfig' % context['application_credential_name'] response = _render_attachment(filename, template, context, request) return response class DetailView(views.HorizonTemplateView): template_name = 'identity/application_credentials/detail.html' page_title = "{{ application_credential.name }}" def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) app_cred = self.get_data() table = project_tables.ApplicationCredentialsTable(self.request) context["application_credential"] = app_cred context["url"] = reverse(INDEX_URL) context["actions"] = table.render_row_actions(app_cred) return context @memoized.memoized_method def get_data(self): try: app_cred_id = self.kwargs['application_credential_id'] app_cred = api.keystone.application_credential_get(self.request, app_cred_id) except Exception: exceptions.handle( self.request, _('Unable to retrieve application credential details.'), redirect=reverse(INDEX_URL)) return app_cred
PypiClean
/isedit-0.3.0.tar.gz/isedit-0.3.0/js/node_modules/caniuse-lite/data/regions/WS.js
module.exports={C:{"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0,"103":0.01712,"104":0,"105":0,"106":0,"107":0,"108":0.00428,"109":0.00428,"110":0.00428,"111":0.31237,"112":0.11981,"113":0.00428,"114":0,"3.5":0,"3.6":0},D:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0.00428,"71":0,"72":0.01284,"73":0,"74":0.00428,"75":0,"76":0.01284,"77":0,"78":0,"79":0.00428,"80":0,"81":0.0214,"83":0,"84":0,"85":0,"86":0,"87":0.01284,"88":0.00856,"89":0,"90":0,"91":0,"92":0.0214,"93":0.0214,"94":0.00428,"95":0.07274,"96":0.00428,"97":0,"98":0,"99":0.01712,"100":0.00428,"101":0.02567,"102":0.01284,"103":0.11553,"104":0.00856,"105":0.0214,"106":0,"107":0.02567,"108":0.03851,"109":0.74455,"110":0.23535,"111":3.79975,"112":4.11212,"113":0.00856,"114":0.02995,"115":0,"116":0},F:{"9":0,"11":0,"12":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0.01284,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"60":0,"62":0,"63":0.00856,"64":0,"65":0,"66":0,"67":0,"68":0.00428,"69":0.03851,"70":0,"71":0,"72":0,"73":0.00428,"74":0.1027,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0.00428,"96":0,"97":0.05563,"98":0,"9.5-9.6":0,"10.0-10.1":0,"10.5":0,"10.6":0,"11.1":0,"11.5":0,"11.6":0,"12.1":0},B:{"12":0.00428,"13":0,"14":0.00428,"15":0.00856,"16":0,"17":0.00428,"18":0.00856,"79":0,"80":0,"81":0,"83":0,"84":0.01284,"85":0,"86":0.00428,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0.01284,"93":0,"94":0.00856,"95":0,"96":0.00428,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0,"103":0.0214,"104":0.00428,"105":0.00428,"106":0.01284,"107":0,"108":0.01284,"109":0.2653,"110":0.13693,"111":0.64613,"112":1.11254,"113":0},E:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,_:"0","3.1":0,"3.2":0,"5.1":0,"6.1":0,"7.1":0,"9.1":0,"10.1":0,"11.1":0,"12.1":0,"13.1":0.0214,"14.1":0.08986,"15.1":0,"15.2-15.3":0.00856,"15.4":0,"15.5":0.00428,"15.6":0.65469,"16.0":0,"16.1":0.01712,"16.2":0.01712,"16.3":0.184,"16.4":0.01284,"16.5":0},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0,"5.0-5.1":0,"6.0-6.1":0,"7.0-7.1":0,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.06358,"10.0-10.2":0,"10.3":0.01413,"11.0-11.2":0.01413,"11.3-11.4":0.07594,"12.0-12.1":0.01413,"12.2-12.5":0.60221,"13.0-13.1":0.03179,"13.2":0,"13.3":0.03885,"13.4-13.7":0.82296,"14.0-14.4":0.40265,"14.5-14.8":0.85298,"15.0-15.1":0.09713,"15.2-15.3":0.27197,"15.4":0.35144,"15.5":0.31788,"15.6":1.2521,"16.0":1.96204,"16.1":0.89184,"16.2":2.64902,"16.3":2.35939,"16.4":1.87904,"16.5":0.10773},P:{"4":0.09347,"20":1.73431,"5.0-5.4":0.03116,"6.2-6.4":0.01039,"7.2-7.4":0.24924,"8.2":0,"9.2":0.05193,"10.1":0,"11.1-11.2":0.02077,"12.0":0.08308,"13.0":0.19732,"14.0":0.0727,"15.0":0.0727,"16.0":1.94202,"17.0":0.03116,"18.0":0.34271,"19.0":0.23886},I:{"0":0,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0.1427},K:{_:"0 10 11 12 11.1 11.5 12.1"},A:{"6":0,"7":0,"8":0,"9":0,"10":0,"11":0.02567,"5.5":0},S:{"2.5":0.02288,_:"3.0-3.1"},J:{"7":0,"10":0},N:{"10":0,"11":0},R:{_:"0"},M:{"0":0.04005},Q:{"13.1":0},O:{"0":0.06865},H:{"0":1.91194},L:{"0":61.04861}};
PypiClean
/boulder_opal-0.12.1.tar.gz/boulder_opal-0.12.1/boulderopal/ions/_molmer_sorensen.py
from __future__ import annotations from typing import Optional import numpy as np from qctrlcommons.preconditions import check_argument from boulderopal._validation import ( ArrayDType, ScalarDType, nullable, ) from boulderopal.graph import ( Graph, execute_graph, ) from boulderopal.ions._drives import ( Drive, OptimizableDrive, ) from boulderopal.optimization import run_optimization def _validate_system_parameters( lamb_dicke_parameters: np.ndarray, relative_detunings: np.ndarray, target_phases: Optional[np.ndarray], ) -> int: """ Validate the arrays describing an ion system and return the number of ions. """ ion_count = lamb_dicke_parameters.shape[-1] check_argument( lamb_dicke_parameters.shape == (3, ion_count, ion_count) and relative_detunings.shape == (3, ion_count), "The shape of the Lamb–Dicke parameters array must be (3, N, N), " "and the shape of the relative detunings array must be (3, N), " "where N is the number of ions.", { "lamb_dicke_parameters": lamb_dicke_parameters, "relative_detunings": relative_detunings, }, extras={ "lamb_dicke_parameters.shape": lamb_dicke_parameters.shape, "relative_detunings.shape": relative_detunings.shape, }, ) if target_phases is not None: check_argument( target_phases.shape == (ion_count, ion_count), "The shape of the target phases array must be (N, N), " "where N is the number of ions.", {"target_phases": target_phases}, extras={"ion count": ion_count, "target_phases.shape": target_phases.shape}, ) return ion_count def _check_drives_addressing(drives, ion_count): """ Check the input drives are a list and that the ions they address are valid. """ check_argument( isinstance(drives, list), "You must provide a list of drives.", {"drives": drives}, ) all_addressing = [] for idx, drive in enumerate(drives): check_argument( all(0 <= ion < ion_count for ion in drive.addressing), "The addressed ions must be between 0 (inclusive) " "and the number of ions (exclusive).", {"drives": drives}, extras={ f"drives[{idx}].addressing": drive.addressing, "ion count": ion_count, }, ) all_addressing += drive.addressing check_argument( len(all_addressing) == len(set(all_addressing)), "Each ion can only be addressed by a single drive.", {"drives": drives}, ) def _get_ion_drives(pwc_addressing_pairs, ion_count, graph, duration): """ From a list of (Pwc, list(int)) tuples (drives and ions addressed by them), return a list of length ion_count the drive addressing each ion or a PWC with value 0 if the ion is not addressed by any drive. """ ion_drives = [] for idx in range(ion_count): for pwc, addressing in pwc_addressing_pairs: # Add the first drive that addresses the ion as we assume # each ion can only be addressed by a single drive. if idx in addressing: ion_drives.append(pwc) break else: ion_drives.append(graph.constant_pwc(constant=0.0, duration=duration)) return ion_drives _MS_NODE_NAMES = ["sample_times", "phases", "displacements", "infidelities"] def ms_simulate( drives: list[Drive], duration: float, lamb_dicke_parameters: np.ndarray, relative_detunings: np.ndarray, target_phases: Optional[np.ndarray] = None, sample_count: int = 128, ) -> dict: r""" Simulate a Mølmer–Sørensen-type operation on a system composed of ions. This function builds a graph describing the Mølmer–Sørensen operation and calls boulderopal.execute_graph to simulate the ion dynamics. Parameters ---------- drives : list[~ions.Drive] A list of drives addressing the ions. Each ion can only be addressed by a single drive, but there may be ions not addressed by any drive. duration : float The duration, in seconds, of the dynamics to be simulated, :math:`T`. It must be greater than zero. lamb_dicke_parameters : np.ndarray A 3D array of shape ``(3, N, N)``, where :math:`N` is the number of ions in the system, specifying the laser-ion coupling strength, :math:`\{\eta_{jkl}\}`. The three dimensions indicate, respectively, the axis, the collective mode number, and the ion. relative_detunings : np.ndarray A 2D array of shape ``(3, N)`` specifying the difference, in Hz, between each motional mode frequency and the laser detuning (with respect to the qubit transition frequency :math:`\omega_0`), :math:`\{\delta_{jk} = \nu_{jk} - \delta\}`. The two dimensions indicate, respectively, the axis and the collective mode number. target_phases : np.ndarray or None, optional A 2D array of shape ``(N, N)`` with the target relative phases between ion pairs, :math:`\{\Psi_{kl}\}`, as a strictly lower triangular matrix. Its :math:`(k, l)`-th element indicates the total relative phase target for ions :math:`k` and :math:`l`, with :math:`k > l`. If not provided, the function does not return the operational infidelities. sample_count : int, optional The number of times :math:`T` between 0 and `duration` (included) at which the evolution is sampled. Defaults to 128. Returns ------- dict The result of the `execute_graph` call. Its ``output`` item is a dictionary containing information about the evolution of the system, with the following keys: ``sample_times`` The times at which the evolution is sampled, as an array of shape ``(T,)``. ``phases`` Acquired phases :math:`\{\Phi_{jk}(t_i) = \phi_{jk}(t_i) + \phi_{kj}(t_i)\}` for each sample time and for all ion pairs, as a strictly lower triangular matrix of shape ``(T, N, N)``. :math:`\Phi_{jk}` records the relative phase between ions :math:`j` and :math:`k`; matrix elements where :math:`j \leq k` are zero. ``displacements`` Displacements :math:`\{\eta_{pj}\alpha_{pj}(t_i)\}` for all mode-ion combinations, as an array of shape ``(T, 3, N, N)``. The four dimensions indicate the sample time, the axis, the collective mode number, and the ion. ``infidelities`` A 1D array of length ``T`` representing the operational infidelities of the Mølmer–Sørensen gate at each sample time, :math:`\mathcal{I}(t_i)`. Only returned if target relative phases are provided. See Also -------- boulderopal.ions.Drive : Class describing non-optimizable drives. boulderopal.ions.ms_optimize : Find optimal pulses to perform Mølmer–Sørensen-type operations on trapped ions systems. boulderopal.ions.obtain_ion_chain_properties : Calculate the properties of an ion chain. Notes ----- The internal and motional Hamiltonian of :math:`N` ions is .. math:: H_0 = \sum_{p = 1}^{3N} \hbar\nu_p \left(a_p^\dagger a_p + \frac{1}{2}\right) + \sum_{j = 1}^N \frac{\hbar \omega_0}{2} \sigma_{z,j} , where the axis dimension and collective mode dimension are combined into a single index :math:`p` for simplicity, :math:`a_p` is the annihilation operator for the mode :math:`p`, and :math:`\sigma_{z,j}` is the Pauli :math:`Z` operator for the ion :math:`j`. The interaction Hamiltonian for Mølmer–Sørensen-type operations in the rotating frame with respect to :math:`H_0` is: .. math:: H_I(t) = i\hbar\sum_{j = 1}^N \sigma_{x, j} \sum_{p = 1}^{3N} (-\beta_{pj}^*(t)a_p + \beta_{pj}(t) a_p^\dagger) , where :math:`\sigma_{x, j}` is the Pauli :math:`X` operator for the ion :math:`j` and :math:`\beta_{pj}(t) = \eta_{pj} \frac{\gamma_j(t)}{2} e^{i\delta_p t}`, indicating the coupling of the ion :math:`j` to the motional mode :math:`p`, where :math:`\{\gamma_j\}` is the total drive acting on ion :math:`j`. The corresponding unitary operation is given by [1]_ .. math:: U(t) = \exp\left[ \sum_{j=1}^N \sigma_{x, j} B_j(t) + i\sum_{j=1}^N\sum_{k=1}^{j - 1} (\phi_{jk}(t) + \phi_{kj}(t)) \sigma_{x, j} \sigma_{x, k} \right] , where .. math:: B_j(t) &\equiv \sum_{p = 1}^{3N} \left(\eta_{pj}\alpha_{pj}(t)a_p^\dagger - \eta_{pj}^{\ast}\alpha_{pj}^\ast(t)a_p \right) , \phi_{jk}(t) &\equiv \mathrm{Im} \left[ \sum_{p=1}^{3N} \int_{0}^{t} d \tau_1 \int_{0}^{\tau_1} d \tau_2 \beta_{pj}(\tau_1)\beta_{pk}^{\ast}(\tau_2) \right] , and .. math:: \alpha_{pj}(t) = \int_0^t d\tau \frac{\gamma_j(\tau)}{2} e^{i \delta_p \tau} . The operational infidelity of the Mølmer–Sørensen gate is defined as [1]_: .. math:: \mathcal{I} = 1 - \left| \left( \prod_{\substack{k=1 \\ l<k}}^N \cos ( \phi_{kl} - \psi_{kl}) \right) \left( 1 - \sum_{j=1}^3 \sum_{k,l=1}^N \left[ |\eta_{jkl}|^2 |\alpha_{jkl}|^2 \left(\bar{n}_{jk}+\frac{1}{2} \right) \right] \right) \right|^2 . References ---------- .. [1] `C. D. B. Bentley, H. Ball, M. J. Biercuk, A. R. R. Carvalho, M. R. Hush, and H. J. Slatyer, Advanced Quantum Technologies 3, 2000044 (2020). <https://doi.org/10.1002/qute.202000044>`_ """ duration = ScalarDType.REAL(duration, "duration", min_=0) lamb_dicke_parameters = ArrayDType.REAL( lamb_dicke_parameters, "lamb_dicke_parameters", ndim=3 ) relative_detunings = ArrayDType.REAL( relative_detunings, "relative_detunings", ndim=2 ) target_phases = nullable(ArrayDType.REAL, target_phases, "target_phases", ndim=2) ion_count = _validate_system_parameters( lamb_dicke_parameters, relative_detunings, target_phases ) check_argument( all(isinstance(drive, Drive) for drive in drives), "All drives must be non-optimizable.", {"drives": drives}, ) _check_drives_addressing(drives, ion_count) graph = Graph() drive_pwcs = [ (drive.get_pwc(graph, duration), drive.addressing) for drive in drives ] ion_drives = _get_ion_drives(drive_pwcs, ion_count, graph, duration) sample_times = np.linspace(0.0, duration, sample_count) graph.tensor(sample_times, name="sample_times") phases = graph.ions.ms_phases( drives=ion_drives, lamb_dicke_parameters=lamb_dicke_parameters, relative_detunings=relative_detunings, sample_times=sample_times, name=_MS_NODE_NAMES[1], ) displacements = graph.ions.ms_displacements( drives=ion_drives, lamb_dicke_parameters=lamb_dicke_parameters, relative_detunings=relative_detunings, sample_times=sample_times, name=_MS_NODE_NAMES[2], ) if target_phases is not None: graph.ions.ms_infidelity( phases=phases, displacements=displacements, target_phases=target_phases, name=_MS_NODE_NAMES[3], ) output_node_names = _MS_NODE_NAMES else: output_node_names = _MS_NODE_NAMES[:3] return execute_graph(graph=graph, output_node_names=output_node_names) def ms_optimize( drives: list[OptimizableDrive], duration: float, lamb_dicke_parameters: np.ndarray, relative_detunings: np.ndarray, target_phases: np.ndarray, sample_count: int = 128, robust: bool = False, **optimization_kwargs, ) -> dict: r""" Find optimal pulses to perform a target Mølmer–Sørensen-type operation on a system composed of ions. This function builds a graph describing the Mølmer–Sørensen operation and calls boulderopal.run_optimization to minimize the target cost. Parameters ---------- drives : list[OptimizableDrive] A list of optimizable drives addressing the ions. Each ion can only be addressed by a single drive, but there may be ions not addressed by any drive. duration : float The duration, in seconds, of the dynamics to be optimized, :math:`T`. It must be greater than zero. lamb_dicke_parameters : np.ndarray A 3D array of shape ``(3, N, N)``, where :math:`N` is the number of ions in the system, specifying the laser-ion coupling strength, :math:`\{\eta_{jkl}\}`. The three dimensions indicate, respectively, the axis, the collective mode number, and the ion. relative_detunings : np.ndarray A 2D array of shape ``(3, N)`` specifying the difference, in Hz, between each motional mode frequency and the laser detuning (with respect to the qubit transition frequency :math:`\omega_0`), :math:`\{\delta_{jk} = \nu_{jk} - \delta\}`. The two dimensions indicate, respectively, the axis and the collective mode number. target_phases : np.ndarray A 2D array of shape ``(N, N)`` with the target relative phases between ion pairs, :math:`\{\Psi_{kl}\}`, as a strictly lower triangular matrix. Its :math:`(k, l)`-th element indicates the total relative phase target for ions :math:`k` and :math:`l`, with :math:`k > l`. sample_count : int, optional The number of times :math:`T` between 0 and `duration` (both included) at which the evolution is sampled. Defaults to 128. robust : bool, optional If set to False, the cost corresponds to the infidelity at the end of the gate. If set to True, the cost is the final infidelity plus a dephasing-robust cost term. Defaults to False. **optimization_kwargs Additional parameters to pass to boulderopal.run_optimization. Returns ------- dict The result of the `run_optimization` call. Its ``output`` item is a dictionary containing information about the optimized drive and the evolution of the system, with the following keys: optimized drives The piecewise-constant optimized drives implementing the gate. The keys are the names of the `drives` provided to the function. ``sample_times`` The times at which the evolution is sampled, as an array of shape ``(T,)``. ``phases`` Acquired phases :math:`\{\Phi_{jk}(t_i) = \phi_{jk}(t_i) + \phi_{kj}(t_i)\}` for each sample time and for all ion pairs, as a strictly lower triangular matrix of shape ``(T, N, N)``. :math:`\Phi_{jk}` records the relative phase between ions :math:`j` and :math:`k`; matrix elements where :math:`j \leq k` are zero. ``displacements`` Displacements :math:`\{\eta_{pj}\alpha_{pj}(t_i)\}` for all mode-ion combinations, as an array of shape ``(T, 3, N, N)``. The four dimensions indicate the sample time, the axis, the collective mode number, and the ion. ``infidelities`` A 1D array of length ``T`` representing the operational infidelities of the Mølmer–Sørensen gate at each sample time, :math:`\mathcal{I}(t_i)`. See Also -------- boulderopal.ions.ComplexOptimizableDrive : Class describing a piecewise-constant complex-valued optimizable drive. boulderopal.ions.RealOptimizableDrive : Class describing a piecewise-constant real-valued optimizable drive. boulderopal.ions.ms_simulate : Simulate a Mølmer–Sørensen-type operation on a trapped ions system. boulderopal.ions.obtain_ion_chain_properties : Calculate the properties of an ion chain. Notes ----- The internal and motional Hamiltonian of :math:`N` ions is .. math:: H_0 = \sum_{p = 1}^{3N} \hbar\nu_p \left(a_p^\dagger a_p + \frac{1}{2}\right) + \sum_{j = 1}^N \frac{\hbar \omega_0}{2} \sigma_{z,j} , where the axis dimension and collective mode dimension are combined into a single index :math:`p` for simplicity, :math:`a_p` is the annihilation operator for the mode :math:`p`, and :math:`\sigma_{z,j}` is the Pauli :math:`Z` operator for the ion :math:`j`. The interaction Hamiltonian for Mølmer–Sørensen-type operations in the rotating frame with respect to :math:`H_0` is: .. math:: H_I(t) = i\hbar\sum_{j = 1}^N \sigma_{x, j} \sum_{p = 1}^{3N} (-\beta_{pj}^*(t)a_p + \beta_{pj}(t) a_p^\dagger) , where :math:`\sigma_{x, j}` is the Pauli :math:`X` operator for the ion :math:`j` and :math:`\beta_{pj}(t) = \eta_{pj} \frac{\gamma_j(t)}{2} e^{i\delta_p t}`, indicating the coupling of the ion :math:`j` to the motional mode :math:`p`, where :math:`\{\gamma_j\}` is the total drive acting on ion :math:`j`. The corresponding unitary operation is given by [1]_ .. math:: U(t) = \exp\left[ \sum_{j=1}^N \sigma_{x, j} B_j(t) + i\sum_{j=1}^N\sum_{k=1}^{j - 1} (\phi_{jk}(t) + \phi_{kj}(t)) \sigma_{x, j} \sigma_{x, k} \right] , where .. math:: B_j(t) &\equiv \sum_{p = 1}^{3N} \left(\eta_{pj}\alpha_{pj}(t)a_p^\dagger - \eta_{pj}^{\ast}\alpha_{pj}^\ast(t)a_p \right) , \phi_{jk}(t) &\equiv \mathrm{Im} \left[ \sum_{p=1}^{3N} \int_{0}^{t} d \tau_1 \int_{0}^{\tau_1} d \tau_2 \beta_{pj}(\tau_1)\beta_{pk}^{\ast}(\tau_2) \right] , and .. math:: \alpha_{pj}(t) = \int_0^t d\tau \frac{\gamma_j(\tau)}{2} e^{i \delta_p \tau} . The operational infidelity of the Mølmer–Sørensen gate is defined as [1]_: .. math:: \mathcal{I} = 1 - \left| \left( \prod_{\substack{k=1 \\ l<k}}^N \cos ( \phi_{kl} - \psi_{kl}) \right) \left( 1 - \sum_{j=1}^3 \sum_{k,l=1}^N \left[ |\eta_{jkl}|^2 |\alpha_{jkl}|^2 \left(\bar{n}_{jk}+\frac{1}{2} \right) \right] \right) \right|^2 . You can use the `robust` flag to construct a Mølmer–Sørensen gate that is robust against dephasing noise. This imposes a symmetry [1]_ in the optimizable ion drives and aims to minimize the time-averaged positions of the phase-space trajectories, .. math:: \langle \alpha_{pj} \rangle = \frac{1}{t_\text{gate}} \int_0^{t_\text{gate}} \alpha_{pj}(t) \mathrm{d} t , where the axis dimension and the collective mode dimension are combined into a single index :math:`p` for simplicity. This is achieved by adding an additional term to the cost function, consisting of the sum of the square moduli of the time-averaged positions multiplied by the corresponding Lamb–Dicke parameters. That is to say, .. math:: C_\text{robust} = \mathcal{I} + \sum_{p,j} \left| \eta_{pj} \langle \alpha_{pj} \rangle \right|^2 . References ---------- .. [1] `C. D. B. Bentley, H. Ball, M. J. Biercuk, A. R. R. Carvalho, M. R. Hush, and H. J. Slatyer, Advanced Quantum Technologies 3, 2000044 (2020). <https://doi.org/10.1002/qute.202000044>`_ """ duration = ScalarDType.REAL(duration, "duration", min_=0) lamb_dicke_parameters = ArrayDType.REAL( lamb_dicke_parameters, "lamb_dicke_parameters", ndim=3 ) relative_detunings = ArrayDType.REAL( relative_detunings, "relative_detunings", ndim=2 ) target_phases = ArrayDType.REAL(target_phases, "target_phases", ndim=2) ion_count = _validate_system_parameters( lamb_dicke_parameters, relative_detunings, target_phases ) check_argument( all(isinstance(drive, OptimizableDrive) for drive in drives), "All drives must be optimizable.", {"drives": drives}, ) _check_drives_addressing(drives, ion_count) drive_names = [drive.name for drive in drives] check_argument( len(drive_names) == len(set(drive_names)), "The drive names must be unique.", {"drives": drives}, extras={"[drive.name for drive in drives]": drive_names}, ) graph = Graph() drive_pwcs = [ (drive.get_pwc(graph, duration, robust), drive.addressing) for drive in drives ] ion_drives = _get_ion_drives(drive_pwcs, ion_count, graph, duration) sample_times = np.linspace(0.0, duration, sample_count) graph.tensor(sample_times, name="sample_times") phases = graph.ions.ms_phases( drives=ion_drives, lamb_dicke_parameters=lamb_dicke_parameters, relative_detunings=relative_detunings, sample_times=sample_times, name=_MS_NODE_NAMES[1], ) displacements = graph.ions.ms_displacements( drives=ion_drives, lamb_dicke_parameters=lamb_dicke_parameters, relative_detunings=relative_detunings, sample_times=sample_times, name=_MS_NODE_NAMES[2], ) infidelities = graph.ions.ms_infidelity( phases=phases, displacements=displacements, target_phases=target_phases, name=_MS_NODE_NAMES[3], ) cost = infidelities[-1] if robust: cost += graph.ions.ms_dephasing_robust_cost( drives=ion_drives, lamb_dicke_parameters=lamb_dicke_parameters, relative_detunings=relative_detunings, ) return run_optimization( graph=graph, cost_node_name=cost.name, output_node_names=drive_names + _MS_NODE_NAMES, **optimization_kwargs, )
PypiClean
/commonroad_dataset_converter-2022.1.1-py3-none-any.whl/commonroad_dataset_converter/inD/map_utils.py
__desc__ = """ Extracts planning problems from a big recording by removing a dynamic vehicle and replacing its first and last state with ego vehicle start and goal position """ import os import logging from typing import Dict from commonroad.scenario.scenario import Scenario, ScenarioID from commonroad.scenario.lanelet import LaneletNetwork from commonroad.common.file_reader import CommonRoadFileReader LOGGER = logging.getLogger(__name__) # has to be loaded before usage # by calling "load_lanelet_networks" locationId_to_lanelet_network = {} def load_lanelet_networks(map_dir: str, ind_config: Dict) -> Dict[int, LaneletNetwork]: """ Load all lanelet networks from the given path into the static variable of the file :param map_dir: Path to lanelet network :return: """ # load all lanelet networks in cache for i, location_name in ind_config.get("locations").items(): LOGGER.info(f"Loading lanelet network {location_name} from {map_dir}") map_file = os.path.join(map_dir, f"{location_name}.xml") locationId_to_lanelet_network[i] = CommonRoadFileReader(map_file).open_lanelet_network() # also return the *global* dictionary in case s.o. wants to further manipulate it return locationId_to_lanelet_network def meta_scenario_from_recording(ind_config: Dict, location_id: int, recording_id: int, frame_rate=30) -> Scenario: """ Generate a meta scenario from the recording meta information :param location_id: ID of the location in inD dataset :param recording_id: ID of the recording in inD dataset :param frame_rate: of the recording :return: Meta scenario, containing lanelet_network only """ # compute time step from frame rate scenario_dt = 1 / frame_rate # id should not be 0 indexed, increase by one to prevent recording id = 0 benchmark_id = f"DEU_{ind_config.get('location_benchmark_id')[location_id]}-{location_id}_{recording_id + 1}_T-1" scenario = Scenario(dt=scenario_dt, scenario_id=ScenarioID.from_benchmark_id(benchmark_id, scenario_version="2020a")) lanelet_network = locationId_to_lanelet_network[location_id] scenario.add_objects(lanelet_network) # Bugfix to avoid duplicate incoming IDs for intersection in scenario.lanelet_network.intersections: for incoming in intersection.incomings: scenario._mark_object_id_as_used(incoming.incoming_id) return scenario
PypiClean
/etu_django_frame-1.2.0-py3-none-any.whl/etu_django_frame/django/2.2.2/data/static/admin/simpleui-x/elementui/submenu.js
module.exports = /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = "/dist/"; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 129); /******/ }) /************************************************************************/ /******/ ({ /***/ 0: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; }); /* globals __VUE_SSR_CONTEXT__ */ // IMPORTANT: Do NOT use ES2015 features in this file (except for modules). // This module is a runtime utility for cleaner component module output and will // be included in the final webpack user bundle. function normalizeComponent ( scriptExports, render, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, /* server only */ shadowMode /* vue-cli only */ ) { // Vue.extend constructor export interop var options = typeof scriptExports === 'function' ? scriptExports.options : scriptExports // render functions if (render) { options.render = render options.staticRenderFns = staticRenderFns options._compiled = true } // functional template if (functionalTemplate) { options.functional = true } // scopedId if (scopeId) { options._scopeId = 'data-v-' + scopeId } var hook if (moduleIdentifier) { // server build hook = function (context) { // 2.3 injection context = context || // cached call (this.$vnode && this.$vnode.ssrContext) || // stateful (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional // 2.2 with runInNewContext: true if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { context = __VUE_SSR_CONTEXT__ } // inject component styles if (injectStyles) { injectStyles.call(this, context) } // register component module identifier for async chunk inferrence if (context && context._registeredComponents) { context._registeredComponents.add(moduleIdentifier) } } // used by ssr in case component is cached and beforeCreate // never gets called options._ssrRegister = hook } else if (injectStyles) { hook = shadowMode ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) } : injectStyles } if (hook) { if (options.functional) { // for template-only hot-reload because in that case the render fn doesn't // go through the normalizer options._injectStyles = hook // register for functioal component in vue file var originalRender = options.render options.render = function renderWithStyleInjection (h, context) { hook.call(context) return originalRender(h, context) } } else { // inject component registration as beforeCreate hook var existing = options.beforeCreate options.beforeCreate = existing ? [].concat(existing, hook) : [hook] } } return { exports: scriptExports, options: options } } /***/ }), /***/ 129: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); // EXTERNAL MODULE: external "element-ui/lib/transitions/collapse-transition" var collapse_transition_ = __webpack_require__(28); var collapse_transition_default = /*#__PURE__*/__webpack_require__.n(collapse_transition_); // EXTERNAL MODULE: ./packages/menu/src/menu-mixin.js var menu_mixin = __webpack_require__(36); // EXTERNAL MODULE: external "element-ui/lib/mixins/emitter" var emitter_ = __webpack_require__(4); var emitter_default = /*#__PURE__*/__webpack_require__.n(emitter_); // EXTERNAL MODULE: external "element-ui/lib/utils/vue-popper" var vue_popper_ = __webpack_require__(5); var vue_popper_default = /*#__PURE__*/__webpack_require__.n(vue_popper_); // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/menu/src/submenu.vue?vue&type=script&lang=js& var poperMixins = { props: { transformOrigin: { type: [Boolean, String], default: false }, offset: vue_popper_default.a.props.offset, boundariesPadding: vue_popper_default.a.props.boundariesPadding, popperOptions: vue_popper_default.a.props.popperOptions }, data: vue_popper_default.a.data, methods: vue_popper_default.a.methods, beforeDestroy: vue_popper_default.a.beforeDestroy, deactivated: vue_popper_default.a.deactivated }; /* harmony default export */ var submenuvue_type_script_lang_js_ = ({ name: 'ElSubmenu', componentName: 'ElSubmenu', mixins: [menu_mixin["a" /* default */], emitter_default.a, poperMixins], components: { ElCollapseTransition: collapse_transition_default.a }, props: { index: { type: String, required: true }, showTimeout: { type: Number, default: 300 }, hideTimeout: { type: Number, default: 300 }, popperClass: String, disabled: Boolean, popperAppendToBody: { type: Boolean, default: undefined } }, data: function data() { return { popperJS: null, timeout: null, items: {}, submenus: {}, mouseInChild: false }; }, watch: { opened: function opened(val) { var _this = this; if (this.isMenuPopup) { this.$nextTick(function (_) { _this.updatePopper(); }); } } }, computed: { // popper option appendToBody: function appendToBody() { return this.popperAppendToBody === undefined ? this.isFirstLevel : this.popperAppendToBody; }, menuTransitionName: function menuTransitionName() { return this.rootMenu.collapse ? 'el-zoom-in-left' : 'el-zoom-in-top'; }, opened: function opened() { return this.rootMenu.openedMenus.indexOf(this.index) > -1; }, active: function active() { var isActive = false; var submenus = this.submenus; var items = this.items; Object.keys(items).forEach(function (index) { if (items[index].active) { isActive = true; } }); Object.keys(submenus).forEach(function (index) { if (submenus[index].active) { isActive = true; } }); return isActive; }, hoverBackground: function hoverBackground() { return this.rootMenu.hoverBackground; }, backgroundColor: function backgroundColor() { return this.rootMenu.backgroundColor || ''; }, activeTextColor: function activeTextColor() { return this.rootMenu.activeTextColor || ''; }, textColor: function textColor() { return this.rootMenu.textColor || ''; }, mode: function mode() { return this.rootMenu.mode; }, isMenuPopup: function isMenuPopup() { return this.rootMenu.isMenuPopup; }, titleStyle: function titleStyle() { if (this.mode !== 'horizontal') { return { color: this.textColor }; } return { borderBottomColor: this.active ? this.rootMenu.activeTextColor ? this.activeTextColor : '' : 'transparent', color: this.active ? this.activeTextColor : this.textColor }; }, isFirstLevel: function isFirstLevel() { var isFirstLevel = true; var parent = this.$parent; while (parent && parent !== this.rootMenu) { if (['ElSubmenu', 'ElMenuItemGroup'].indexOf(parent.$options.componentName) > -1) { isFirstLevel = false; break; } else { parent = parent.$parent; } } return isFirstLevel; } }, methods: { handleCollapseToggle: function handleCollapseToggle(value) { if (value) { this.initPopper(); } else { this.doDestroy(); } }, addItem: function addItem(item) { this.$set(this.items, item.index, item); }, removeItem: function removeItem(item) { delete this.items[item.index]; }, addSubmenu: function addSubmenu(item) { this.$set(this.submenus, item.index, item); }, removeSubmenu: function removeSubmenu(item) { delete this.submenus[item.index]; }, handleClick: function handleClick() { var rootMenu = this.rootMenu, disabled = this.disabled; if (rootMenu.menuTrigger === 'hover' && rootMenu.mode === 'horizontal' || rootMenu.collapse && rootMenu.mode === 'vertical' || disabled) { return; } this.dispatch('ElMenu', 'submenu-click', this); }, handleMouseenter: function handleMouseenter(event) { var _this2 = this; var showTimeout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.showTimeout; if (!('ActiveXObject' in window) && event.type === 'focus' && !event.relatedTarget) { return; } var rootMenu = this.rootMenu, disabled = this.disabled; if (rootMenu.menuTrigger === 'click' && rootMenu.mode === 'horizontal' || !rootMenu.collapse && rootMenu.mode === 'vertical' || disabled) { return; } this.dispatch('ElSubmenu', 'mouse-enter-child'); clearTimeout(this.timeout); this.timeout = setTimeout(function () { _this2.rootMenu.openMenu(_this2.index, _this2.indexPath); }, showTimeout); if (this.appendToBody) { this.$parent.$el.dispatchEvent(new MouseEvent('mouseenter')); } }, handleMouseleave: function handleMouseleave() { var _this3 = this; var deepDispatch = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; var rootMenu = this.rootMenu; if (rootMenu.menuTrigger === 'click' && rootMenu.mode === 'horizontal' || !rootMenu.collapse && rootMenu.mode === 'vertical') { return; } this.dispatch('ElSubmenu', 'mouse-leave-child'); clearTimeout(this.timeout); this.timeout = setTimeout(function () { !_this3.mouseInChild && _this3.rootMenu.closeMenu(_this3.index); }, this.hideTimeout); if (this.appendToBody && deepDispatch) { if (this.$parent.$options.name === 'ElSubmenu') { this.$parent.handleMouseleave(true); } } }, handleTitleMouseenter: function handleTitleMouseenter() { if (this.mode === 'horizontal' && !this.rootMenu.backgroundColor) return; var title = this.$refs['submenu-title']; title && (title.style.backgroundColor = this.rootMenu.hoverBackground); }, handleTitleMouseleave: function handleTitleMouseleave() { if (this.mode === 'horizontal' && !this.rootMenu.backgroundColor) return; var title = this.$refs['submenu-title']; title && (title.style.backgroundColor = this.rootMenu.backgroundColor || ''); }, updatePlacement: function updatePlacement() { this.currentPlacement = this.mode === 'horizontal' && this.isFirstLevel ? 'bottom-start' : 'right-start'; }, initPopper: function initPopper() { this.referenceElm = this.$el; this.popperElm = this.$refs.menu; this.updatePlacement(); } }, created: function created() { var _this4 = this; this.$on('toggle-collapse', this.handleCollapseToggle); this.$on('mouse-enter-child', function () { _this4.mouseInChild = true; clearTimeout(_this4.timeout); }); this.$on('mouse-leave-child', function () { _this4.mouseInChild = false; clearTimeout(_this4.timeout); }); }, mounted: function mounted() { this.parentMenu.addSubmenu(this); this.rootMenu.addSubmenu(this); this.initPopper(); }, beforeDestroy: function beforeDestroy() { this.parentMenu.removeSubmenu(this); this.rootMenu.removeSubmenu(this); }, render: function render(h) { var _this5 = this; var active = this.active, opened = this.opened, paddingStyle = this.paddingStyle, titleStyle = this.titleStyle, backgroundColor = this.backgroundColor, rootMenu = this.rootMenu, currentPlacement = this.currentPlacement, menuTransitionName = this.menuTransitionName, mode = this.mode, disabled = this.disabled, popperClass = this.popperClass, $slots = this.$slots, isFirstLevel = this.isFirstLevel; var popupMenu = h( 'transition', { attrs: { name: menuTransitionName } }, [h( 'div', { ref: 'menu', directives: [{ name: 'show', value: opened }], 'class': ['el-menu--' + mode, popperClass], on: { 'mouseenter': function mouseenter($event) { return _this5.handleMouseenter($event, 100); }, 'mouseleave': function mouseleave() { return _this5.handleMouseleave(true); }, 'focus': function focus($event) { return _this5.handleMouseenter($event, 100); } } }, [h( 'ul', { attrs: { role: 'menu' }, 'class': ['el-menu el-menu--popup', 'el-menu--popup-' + currentPlacement], style: { backgroundColor: rootMenu.backgroundColor || '' } }, [$slots.default] )] )] ); var inlineMenu = h('el-collapse-transition', [h( 'ul', { attrs: { role: 'menu' }, 'class': 'el-menu el-menu--inline', directives: [{ name: 'show', value: opened }], style: { backgroundColor: rootMenu.backgroundColor || '' } }, [$slots.default] )]); var submenuTitleIcon = rootMenu.mode === 'horizontal' && isFirstLevel || rootMenu.mode === 'vertical' && !rootMenu.collapse ? 'el-icon-arrow-down' : 'el-icon-arrow-right'; return h( 'li', { 'class': { 'el-submenu': true, 'is-active': active, 'is-opened': opened, 'is-disabled': disabled }, attrs: { role: 'menuitem', 'aria-haspopup': 'true', 'aria-expanded': opened }, on: { 'mouseenter': this.handleMouseenter, 'mouseleave': function mouseleave() { return _this5.handleMouseleave(false); }, 'focus': this.handleMouseenter } }, [h( 'div', { 'class': 'el-submenu__title', ref: 'submenu-title', on: { 'click': this.handleClick, 'mouseenter': this.handleTitleMouseenter, 'mouseleave': this.handleTitleMouseleave }, style: [paddingStyle, titleStyle, { backgroundColor: backgroundColor }] }, [$slots.title, h('i', { 'class': ['el-submenu__icon-arrow', submenuTitleIcon] })] ), this.isMenuPopup ? popupMenu : inlineMenu] ); } }); // CONCATENATED MODULE: ./packages/menu/src/submenu.vue?vue&type=script&lang=js& /* harmony default export */ var src_submenuvue_type_script_lang_js_ = (submenuvue_type_script_lang_js_); // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js var componentNormalizer = __webpack_require__(0); // CONCATENATED MODULE: ./packages/menu/src/submenu.vue var render, staticRenderFns /* normalize component */ var component = Object(componentNormalizer["a" /* default */])( src_submenuvue_type_script_lang_js_, render, staticRenderFns, false, null, null, null ) /* hot reload */ if (false) { var api; } component.options.__file = "packages/menu/src/submenu.vue" /* harmony default export */ var submenu = (component.exports); // CONCATENATED MODULE: ./packages/submenu/index.js /* istanbul ignore next */ submenu.install = function (Vue) { Vue.component(submenu.name, submenu); }; /* harmony default export */ var packages_submenu = __webpack_exports__["default"] = (submenu); /***/ }), /***/ 28: /***/ (function(module, exports) { module.exports = require("element-ui/lib/transitions/collapse-transition"); /***/ }), /***/ 36: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony default export */ __webpack_exports__["a"] = ({ inject: ['rootMenu'], computed: { indexPath: function indexPath() { var path = [this.index]; var parent = this.$parent; while (parent.$options.componentName !== 'ElMenu') { if (parent.index) { path.unshift(parent.index); } parent = parent.$parent; } return path; }, parentMenu: function parentMenu() { var parent = this.$parent; while (parent && ['ElMenu', 'ElSubmenu'].indexOf(parent.$options.componentName) === -1) { parent = parent.$parent; } return parent; }, paddingStyle: function paddingStyle() { if (this.rootMenu.mode !== 'vertical') return {}; var padding = 20; var parent = this.$parent; if (this.rootMenu.collapse) { padding = 20; } else { while (parent && parent.$options.componentName !== 'ElMenu') { if (parent.$options.componentName === 'ElSubmenu') { padding += 20; } parent = parent.$parent; } } return { paddingLeft: padding + 'px' }; } } }); /***/ }), /***/ 4: /***/ (function(module, exports) { module.exports = require("element-ui/lib/mixins/emitter"); /***/ }), /***/ 5: /***/ (function(module, exports) { module.exports = require("element-ui/lib/utils/vue-popper"); /***/ }) /******/ });
PypiClean
/PyDapi2-0.6.2-py3-none-any.whl/dapi2/derror.py
import lxml.etree as ET from dapi2.common import DApi2ErrorLevel class DApiComError(Exception): '''Base exception class for DAPI communication errors :param ErrorMessage errmsg: The error message. ''' errorno = None name = None label = None text = None @classmethod def getErrorClass(cls, errmsg): '''Find the class according to the error message. :param ErrorMessage errmsg: The error message. :return: The excepton class found ''' return next(x for x in DApiComError.__subclasses__() if x.errorno[0] <= errmsg.getError() <= x.errorno[1]) @classmethod def factory(cls, errmsg): '''Classmetoh to construct DApiComError according DAPI error code. :param ErrorMessage errmsg: The error message. :param \*exceptions: A list of specific exceptions. :return: The new exception according DAPI error. ''' assert 0 < errmsg.getError() < 0xc0 or errmsg.getError() >= 0xf0 errcls = DApiComError.getErrorClass(errmsg) return errcls(errmsg) def __init__(self, errmsg): super(Exception, self).__init__(errmsg) return def __str__(self): try: return '{0!s} - #0x1:02X} : {2!s}'.format(self.__class__.__name__, self.error, self.label) except: return Exception.__str__(self) @property def msg(self): '''The error message''' return self.args[0] @property def error(self): '''The error code''' return self.msg.getError() @property def addr(self): '''The message address''' return self.msg.getAddr() class DApiComAddrError(DApiComError): errorno = (0x01,0x01) name = 'DAPI_COM_WRONG_ADDR' label = 'Wrong address' text = 'Invalid address or command' class DApiComReadonlyError(DApiComError): errorno = (0x02,0x02) name = 'DAPI_COM_READ_ONLY' label = 'Read only' text = 'Try to write in a read only register' class DApiComValueError(DApiComError): errorno = (0x03,0x03) name = 'DAPI_COM_WRONG_VALUE' label = 'Wrong value' text = 'No allowed value or wrong argument' class DApiComContextError(DApiComError): errorno = (0x04,0x04) name = 'DAPI_COM_WRONG_CONTEXT' label = 'Wrong context' text = 'This change or command is not allowed in this context' class DApiComFormatError(DApiComError): errorno = (0x05,0x05) name = 'DAPI_COM_MALFORMED_MSG' label = 'Malformed message' text = 'Malformed message' class DApiComAccessError(DApiComError): errorno = (0x06,0x06) name = 'DAPI_COM_ACCESS_DENIED' label = 'Access denied' text = 'Read/Write or command is not available with current access level' class DApiComEepromError(DApiComError): errorno = (0x07,0x07) name = 'DAPI_COM_EEPROM_FAILURE' label = 'EEPROM failure' text = 'EEPROM failure' class DApiComAbortedError(DApiComError): errorno = (0xfd,0xfd) name = 'DAPI_COM_ABORTED' label = 'Aborted command' text = 'Aborted command' class DApiComComBrokenError(DApiComError): errorno = (0xfe,0xfe) name = 'DAPI_COM_COM_BROKEN' label = 'Borken Communication' text = 'Communication is borken' class DApiComUndefinedError(DApiComError): errorno = (0xff,0xff) name = 'DAPI_COM_UDEFNED' label = 'Undefined error' text = 'Undefined error' class DApiCommandError(DApiComError): '''Base exception class for DAPI commands errors :param ErrorMessage errmsg: The error message. ''' errorno = None name = None label = None text = None @classmethod def factory(cls, errmsg, *exceptions): '''Classmethod to construct DApiCommandError according DAPI error code. :param ErrorMessage errmsg: The error message. :param \*exceptions: A list of specific exceptions. :return: The new exception according DAPI error. :rtype: Child of DApiCommandError. ''' #assert 0 < errmsg.getError() < 0xc0, "errmsg.getError() => "+str(errmsg.getError()) if errmsg.getError() < 0x80 or errmsg.getError() >= 0xFD: return DApiComError.factory(errmsg) else: for e in exceptions: if e.errorno[0] <= errmsg.getError() <= e.errorno[1]: return e(errmsg) return DApiCommandError(errmsg) class DApiBoardWarningError(Exception): '''Base exception class for DAPI board warnings and errors :param int num: Warning/Error number :param str name: Warning/Error name :param DApiBardErrorLevel level: Warning/Error level :param str default_description: Default description ''' @classmethod def loadXML(cls, xerror): s = xerror.get('id') if s[:2].lower() == '0x': num = int(s[2:],16) else: num = int(s,10) try: name = xerror.find('name').text except: raise Exception('The <name> element is missing in {0!s}!'.format(ET.tostring(xerror, pretty_print=True))) descr_list = xerror.findall('descr') if len(descr_list)==0: raise Exception('The <descr> element is missing in {0!s}!'.format(ET.tostring(xerror, pretty_print=True))) obj = DApiBoardWarningError( num=num, name=name, level = DApi2ErrorLevel[xerror.get('level')], default_description = descr_list[0].text ) for xdescr in descr_list: lang = xdescr.get('lang', None) obj._descr[lang] = xdescr.text return obj def __init__(self, num, name, level, default_description): super().__init__() self.args =[ num, name, level ] self._descr = {None:default_description} def __str__(self, lang=None): try: return '{0:s} #0x{1:02X} : {2!s}'.format(self.level.label, self.num, self.getDescription(lang)) except: return Exception.__str__(self) def getDescription(self, lang=None): try: return self._descr[lang] except KeyError: return self._descr[None] @property def num(self): return self.args[0] @property def name(self): return self.args[1] @property def level(self): return self.args[2] @property def descriptions(self): return self._descr class DErrorsContainer(object): '''Conatainer to store DAPI2 board errors and warnings. :param object owner: Owner of this container ''' def __init__(self, owner, errorsfile=None): ''' Constructor ''' super().__init__() self._owner = owner self._items = [] self._errors = {} self._names = {} if errorsfile is not None: self.loadFromFile(errorsfile) def __getitem__(self, addr): return self._items[addr] def __len__(self): return len(self._items) def __iter__(self): for item in self._items: yield item def __call__(self, arg): if isinstance(arg, str): return self._items[self._names[arg]] else: return self._items[self._errors[arg]] def __getattr__(self, name): return self._items[self._names[name]] def clear(self): self._items = [] self._errors = {} self._names = {} def add(self, *errors): '''Adds errors into this container. :param DApiBoardWarningError errors: one or more error that should be added to the container ''' for error in errors: assert isinstance(error, DApiBoardWarningError) self._items.append(error) self._names[error.name] = self._errors[error.num] = len(self._items)-1 def loadFromFile(self, fname): if len(self._items)>0: self.clear() #TODO: select file reader regarding the format of file `filename` self.loadXML(ET.parse(fname)) def loadXML(self, xtree): xroot = xtree.getroot() for xerror in xroot.findall('error'): error = DApiBoardWarningError.loadXML(xerror) self.add(error)
PypiClean
/torch_salad-0.2.1a0-py3-none-any.whl/salad/models/gan.py
import torch from torch import nn import torch.nn.functional as F def to_one_hot(y, n_dims=None): y_tensor = y.long().view(-1, 1) n_dims = n_dims if n_dims is not None else int(torch.max(y_tensor)) + 1 #y_one_hot = torch.zeros(y_tensor.size()[0], n_dims).type(y.type()).scatter_(1, y_tensor, 1) y_one_hot = y.new(y_tensor.size()[0], n_dims).zero_().scatter_(1, y_tensor, 1) y_one_hot = y_one_hot.view(*y.shape, -1) return y_one_hot def cat2d(x, *args): w = x.size()[2] h = x.size()[3] args = torch.cat(args, dim = 1) if args.dim() == 2: args = args.float().unsqueeze(2).unsqueeze(3) return torch.cat([x, args.expand([-1,-1,w,h])], dim = 1) class ConditionalGAN(nn.Module): # initializers def __init__(self, d=128, n_classes = 10, n_conditions = 2, n_outputs = 3): super(ConditionalGAN, self).__init__() self.deconv1 = nn.ConvTranspose2d(100 + n_classes + n_conditions, d*8, 4, 1, 0) self.deconv1_bn = nn.BatchNorm2d(d*8) self.deconv2 = nn.ConvTranspose2d(d*8 + n_classes + n_conditions, d*4, 4, 2, 1) self.deconv2_bn = nn.BatchNorm2d(d*4) self.deconv3 = nn.ConvTranspose2d(d*4 + n_classes + n_conditions, d*2, 4, 2, 1) self.deconv3_bn = nn.BatchNorm2d(d*2) self.deconv4 = nn.ConvTranspose2d(d*2 + n_classes + n_conditions, d, 4, 2, 1) self.deconv4_bn = nn.BatchNorm2d(d) self.deconv5 = nn.ConvTranspose2d(d + n_classes + n_conditions, n_outputs, 4, 2, 1) self.n_classes = n_classes self.n_conditions = n_conditions # weight_init def weight_init(self, mean, std): for m in self._modules: normal_init(self._modules[m], mean, std) # forward method def forward(self, input, label, condition): # class is a (N x n_classes) tensor, 1-hot coding # condition is a (N x n_conditions) tensor, 1-hot coding label = to_one_hot(label, self.n_classes) condition = to_one_hot(condition, self.n_conditions) #print(input.size(), label.size(), condition.size()) x = input x = cat2d(x,label,condition) x = F.relu(self.deconv1_bn(self.deconv1(x))) x = cat2d(x,label,condition) x = F.relu(self.deconv2_bn(self.deconv2(x))) x = cat2d(x,label,condition) x = F.relu(self.deconv3_bn(self.deconv3(x))) x = cat2d(x,label,condition) x = F.relu(self.deconv4_bn(self.deconv4(x))) x = cat2d(x,label,condition) x = 3 * F.tanh(self.deconv5(x)) return x class Discriminator(nn.Module): # initializers def __init__(self, d=128, n_classes=1): super(Discriminator, self).__init__() self.conv1 = nn.Conv2d(3, d, 4, 2, 1) self.conv2 = nn.Conv2d(d, d*2, 4, 2, 1) self.conv2_bn = nn.BatchNorm2d(d*2) self.conv3 = nn.Conv2d(d*2, d*4, 4, 2, 1) self.conv3_bn = nn.BatchNorm2d(d*4) self.conv4 = nn.Conv2d(d*4, d*8, 4, 2, 1) self.conv4_bn = nn.BatchNorm2d(d*8) self.conv5 = nn.Conv2d(d*8, n_classes, 4, 1, 0) # weight_init def weight_init(self, mean, std): for m in self._modules: normal_init(self._modules[m], mean, std) # forward method def forward(self, input): x = F.leaky_relu(self.conv1(input), 0.2) x = F.leaky_relu(self.conv2_bn(self.conv2(x)), 0.2) x = F.leaky_relu(self.conv3_bn(self.conv3(x)), 0.2) x = F.leaky_relu(self.conv4_bn(self.conv4(x)), 0.2) x = self.conv5(x) return x def normal_init(m, mean, std): if isinstance(m, nn.ConvTranspose2d) or isinstance(m, nn.Conv2d): m.weight.data.normal_(mean, std) m.bias.data.zero_()
PypiClean
/refinitiv-data-1.3.1.tar.gz/refinitiv-data-1.3.1/refinitiv/data/_log.py
import logging import os import sys from datetime import datetime from functools import lru_cache from logging import LogRecord from logging.handlers import RotatingFileHandler, TimedRotatingFileHandler from typing import Tuple, Any, Optional from ._tools import DEBUG from ._tools._specification import BaseSpecification # --------------------------------------------------------------------------- # Conversion from TS/JS to Python # --------------------------------------------------------------------------- TRACE = 5 py_grade = logging._nameToLevel.copy() py_grade["TRACE"] = TRACE # add an additional level logging.addLevelName(TRACE, "TRACE") py_grade = {f"py_{lname}": {"name": lname, "level": llevel} for lname, llevel in py_grade.items()} ts_grade = { "ts_trace": {"name": "trace", "level": 0}, "ts_debug": {"name": "debug", "level": 1}, "ts_info": {"name": "info", "level": 2}, "ts_warn": {"name": "warn", "level": 3}, "ts_error": {"name": "error", "level": 4}, "ts_silent": {"name": "silent", "level": 5}, } conversion_schema = [ ("ts_trace", "py_TRACE"), ("ts_debug", "py_DEBUG"), ("ts_info", "py_INFO"), ("ts_warn", "py_WARNING"), ("ts_error", "py_ERROR"), ("ts_silent", "py_CRITICAL"), ] """ +------------+----------+ | TypeScript | Python | +------------+----------+ | trace | TRACE | +------------+----------+ | debug | DEBUG | +------------+----------+ | info | INFO | +------------+----------+ | warn | WARNING | +------------+----------+ | error | ERROR | +------------+----------+ | silent | CRITICAL | +------------+----------+ """ py_by_ts_nameToName = {ts_grade[ts_]["name"]: py_grade[py_]["name"] for ts_, py_ in conversion_schema} """ +------------+--------+ | TypeScript | Python | +------------+--------+ | 0 | 5 | +------------+--------+ | 1 | 10 | +------------+--------+ | 2 | 20 | +------------+--------+ | 3 | 30 | +------------+--------+ | 4 | 40 | +------------+--------+ | 5 | 50 | +------------+--------+ """ py_by_ts_levelToLevel = {ts_grade[ts_]["level"]: py_grade[py_]["level"] for ts_, py_ in conversion_schema} # --------------------------------------------------------------------------- # File handler # --------------------------------------------------------------------------- bytes_by_suffix = { "B": 1, # B "K": 2**10, # KiB "M": 2**20, # MiB "G": 2**30, # GiB } def convert_filesize(s) -> int: if isinstance(s, int): return s if isinstance(s, str): suffix_ = s[-1] count_ = int(s[:-1]) bytes_ = bytes_by_suffix[suffix_] count_bytes_ = count_ * bytes_ return count_bytes_ def convert_interval(s) -> Tuple[int, str]: when_ = s[-1] interval_ = int(s[:-1]) # Months if when_ == "M": when_ = "D" interval_ = interval_ * 30 return interval_, when_ class TimedSizedRotatingHandler(TimedRotatingFileHandler, RotatingFileHandler): def __init__( self, filename, file_mode="a", max_bytes=0, backup_count=0, encoding="ascii", delay=False, when="h", interval=1, utc=False, at_time=None, *args, **kwargs, ): if file_mode.startswith("w"): try: os.remove(filename) except Exception: pass self.filename = filename RotatingFileHandler.__init__( self, filename=filename, mode=file_mode, maxBytes=max_bytes, backupCount=backup_count, encoding=encoding, delay=delay, ) TimedRotatingFileHandler.__init__( self, filename=filename, when=when, interval=interval, backupCount=backup_count, encoding=encoding, delay=delay, utc=utc, atTime=at_time, ) if os.path.sep in filename: self.baseFilename = filename def shouldRollover(self, record): timed_rollover = TimedRotatingFileHandler.shouldRollover(self, record) sized_rollover = RotatingFileHandler.shouldRollover(self, record) return timed_rollover or sized_rollover def doRollover(self): super(TimedRotatingFileHandler, self).doRollover() def getFilesToDelete(self): return super(TimedRotatingFileHandler, self).getFilesToDelete() def _filenamer(base_filename): basename_ = os.path.basename(base_filename) date_, time_, pid_, *name_, name_with_count_ = basename_.split("-") *name_chunk_, count_ = name_with_count_.split(".") name_.append(".".join(name_chunk_)) name_ = "-".join(name_) new_basename_ = "-".join([date_, time_, count_, pid_, name_]) return base_filename.replace(basename_, new_basename_) if DEBUG: fmt = ( "[%(asctime)s|" "%(levelname)s|" "%(thread)d-%(threadName)s|" "%(name)s] " "%(module)s." "%(funcName)s " "%(message)s" ) else: fmt = ( "[%(asctime)s] - " "[%(name)s] - " "[%(levelname)s] - " "[%(thread)d - %(threadName)s] - " "[%(module)s] - " "[%(funcName)s] - " "%(message)s" ) class RDFormatter(logging.Formatter): def formatTime(self, record: LogRecord, datefmt: Optional[str] = None) -> str: return datetime.fromtimestamp(record.created).astimezone().isoformat() _file_handler_formatter = RDFormatter(fmt) def _get_filename(filename_: str, datetime_: datetime, pid_: int) -> str: date_ = datetime_.strftime("%Y%m%d") time_ = datetime_.strftime("%H%M") filename_ = filename_.replace("\\", os.path.sep) filename_ = os.path.normpath(filename_) *path, filename = filename_.split(os.path.sep) if path: new_filename = f"{date_}-{time_}-{pid_}-{filename}" path.append(new_filename) filename_ = f"{os.path.sep}".join(path) else: filename_ = f"{date_}-{time_}-{pid_}-{filename}" return filename_ @lru_cache(None) def _create_log_file_handler(name_, file_size_, max_files_, interval_): # file name filename_ = _get_filename(name_, datetime.now(), os.getpid()) # file size file_size_ = convert_filesize(file_size_) # interval interval_, when_ = convert_interval(interval_) handler_ = TimedSizedRotatingHandler( filename_, max_bytes=file_size_, when=when_, interval=interval_, backup_count=max_files_, encoding="utf-8", delay=True, ) handler_.namer = _filenamer handler_.setFormatter(_file_handler_formatter) return handler_ # --------------------------------------------------------------------------- # Stdout handler # --------------------------------------------------------------------------- if DEBUG: fmt = ( "[%(asctime)s|" "%(levelname)s|" "%(thread)d-%(threadName)s|" "%(name)s] \n" "%(module)s." "%(funcName)s " "%(message)s" ) else: fmt = "[%(asctime)s] - [%(levelname)s] - [%(name)s] - [%(thread)d] | %(threadName)s\n%(message)s" _stdout_formatter = RDFormatter(fmt) def _create_log_stdout_handler(): handler_ = logging.StreamHandler(sys.stdout) handler_.setFormatter(_stdout_formatter) return handler_ # --------------------------------------------------------------------------- # Filtering # --------------------------------------------------------------------------- class NotLog(BaseSpecification): def is_satisfied_by(self, record: Any) -> bool: return False class LogEverything(BaseSpecification): def is_satisfied_by(self, record: Any) -> bool: return True class NotLogWithName(BaseSpecification): def __init__(self, name) -> None: super().__init__() self.name = name def is_satisfied_by(self, record: Any) -> bool: return self.name != record.name class LogWithName(BaseSpecification): def __init__(self, name) -> None: super().__init__() self.name = name def is_satisfied_by(self, record: Any) -> bool: return self.name == record.name class LogStartsWithName(BaseSpecification): def __init__(self, name) -> None: super().__init__() self.name = name def is_satisfied_by(self, record: Any) -> bool: return record.name.startswith(self.name) class NotLogStartsWithName(BaseSpecification): def __init__(self, name) -> None: super().__init__() self.name = name def is_satisfied_by(self, record: Any) -> bool: return not record.name.startswith(self.name) default_log_filter = "*" def join_by_and_(prev_spec, spec): return prev_spec and prev_spec.and_(spec) or spec def join_by_or_(prev_spec, spec): return prev_spec and prev_spec.or_(spec) or spec def make_filter(text): ss = [s.strip() for s in text.split(",") if s] if not ss: can_log = NotLog() else: can_log = None for s in ss: if s == "*": can_log = join_by_or_(can_log, LogEverything()) elif s.startswith("-") and s.endswith("*"): can_log = join_by_and_(can_log, NotLogStartsWithName(s[1:-1])) elif s.startswith("-"): can_log = join_by_and_(can_log, NotLogWithName(s[1:])) elif s.endswith("*"): can_log = join_by_or_(can_log, LogStartsWithName(s[:-1])) else: can_log = join_by_or_(can_log, LogWithName(s)) def inner(record): return can_log.is_satisfied_by(record) return inner # --------------------------------------------------------------------------- # Log level # --------------------------------------------------------------------------- def convert_log_level(level) -> int: py_level_ = None if isinstance(level, str): level_ = level.strip() py_level_ = py_by_ts_nameToName.get(level_) if py_level_ is None: py_level_ = level py_level_ = logging._nameToLevel.get(py_level_) elif isinstance(level, int): py_level_ = level return py_level_ or logging.INFO def read_log_level_config(): from . import _configure as configure level_ = configure.get_str(configure.keys.log_level) return convert_log_level(level_) # --------------------------------------------------------------------------- # Create and dispose logger # --------------------------------------------------------------------------- _log_stream_handler = _create_log_stdout_handler() _existing_loggers = [] @lru_cache(None) def create_logger(name): from . import _configure as configure # construct the logger object for session logger_ = logging.getLogger(name) log_file_enabled_ = configure.get(configure.keys.log_file_enabled, True) if log_file_enabled_: name_ = configure.get_str(configure.keys.log_filename) file_size_ = configure.get_str(configure.keys.log_file_size) max_files_ = configure.get_int(configure.keys.log_max_files) interval_ = configure.get_str(configure.keys.log_interval) _log_file_handler = _create_log_file_handler(name_, file_size_, max_files_, interval_) logger_.addHandler(_log_file_handler) log_console_enabled_ = configure.get(configure.keys.log_console_enabled, True) if log_console_enabled_: logger_.addHandler(_log_stream_handler) else: logger_.propagate = False log_level_ = read_log_level_config() if log_level_ != logger_.level: logger_.setLevel(log_level_) log_filter_ = configure.get(configure.keys.log_filter, default_log_filter) logger_.addFilter(make_filter(log_filter_)) _existing_loggers.append(name) return logger_ def get_logger(name): return create_logger(name) def set_log_level(logger, level): if isinstance(logger, str): logger = get_logger(logger) level = convert_log_level(level) logger.setLevel(level) return logger def existing_loggers(): return _existing_loggers def dispose_logger(logger): if isinstance(logger, str): logger = get_logger(logger) handlers_ = logger.handlers[:] for hdlr_ in handlers_: hdlr_.close() logger.removeHandler(hdlr_) return logger # --------------------------------------------------------------------------- # Root logger # --------------------------------------------------------------------------- _root_logger = None def root_logger(): global _root_logger if _root_logger is None: _root_logger = create_logger("rd") return _root_logger
PypiClean
/cubicweb-timesheet-1.0.0.tar.gz/cubicweb-timesheet-1.0.0/cubicweb_timesheet/views/activity.py
__docformat__ = "restructuredtext en" from logilab.mtconverter import xml_escape from cubicweb import _ from cubicweb.utils import UStringIO from cubicweb.schema import display_name from cubicweb.predicates import (is_instance, multi_columns_rset, match_user_groups, score_entity, rql_condition) from cubicweb_web.view import AnyRsetView, EntityView, EntityAdapter from cubicweb_web import action from cubicweb_web.component import Link from cubicweb_web.views import tableview, calendar, navigation, editcontroller from cubicweb_calendar.views import get_date_range_from_reqform class ActivitySummaryView(AnyRsetView): __regid__ = 'actsummary' __select__ = is_instance('Activity') & multi_columns_rset(7) # XXX we should make a very strict selector here def call(self): total_duration = sum(e.duration for e in self.cw_rset.entities()) self.w(u'<h3>%s: %s</h3>' % (_('total'), total_duration)) self.wview('table', self.cw_rset, 'null', displaycols=range(1, 6)) resdict = {} for __, __, res, __, duration, __, login in self.cw_rset: resdur = resdict.get(login, 0) resdur += duration resdict[login] = resdur self.w(u'<h2>%s</h2>' % _('statistics')) self.w(u'<table class="listing">') self.w(u'<tr><th>%s</th><th>%s</th></tr>' % (_('resource'), _('duration'))) for even_odd, (login, resdur) in enumerate(sorted(resdict.iteritems())): self.w(u'<tr class="%s">' % (even_odd % 2 and "odd" or "even")) self.w(u'<td>%s</td>' % login) self.w(u'<td>%s</td>' % resdur) self.w(u'</tr>') self.w(u'</table>') class ActivitySubmitView(EntityView): __regid__ = 'activities-list' __select__ = is_instance('Resource') def cell_call(self, row, col): entity = self.cw_rset.get_entity(row, col) firstday, lastday = get_date_range_from_reqform(self._cw.form) rql = 'Any A WHERE A is Activity, A done_by R, R eid %(r)s' if lastday is None: rql += ', A diem %(fd)s' else: rql += ', A diem >= %(fd)s, A diem <= %(ld)s' rset = self._cw.execute(rql, {'r': entity.eid, 'fd': firstday, 'ld': lastday}) self.wview('activitytable', rset, 'null') self.wview('activities-submitform', rset=self.cw_rset, row=row, col=col, initargs={'date': firstday}) # XXX see generic definition for tablecontext view in gingouz.views class ActivityTableContext(EntityView): __regid__ = 'tablecontext' __select__ = is_instance('Activity') def cell_call(self, row, col): entity = self.cw_rset.get_entity(row, col) self.w(u'<a href="%s"><img alt="%s" src="data/accessories-text-editor.png" /></a>' % (xml_escape(entity.absolute_url(vid='edition')), self._cw._('actions_edit'))) class ActivityTableView(EntityView): __regid__ = 'activitytable' __select__ = is_instance('Activity') title = _('activitytable') def call(self, showresource=True): eids = ','.join(str(row[0]) for row in self.cw_rset) rql = ('Any R, D, DUR, WO, DESCR, S, A, SN, RT, WT ORDERBY D DESC ' 'WHERE ' ' A is Activity, A done_by R, R title RT, ' ' A diem D, A duration DUR, ' ' A done_for WO, WO title WT, ' ' A description DESCR, A in_state S, S name SN, A eid IN (%s)' % eids) rset = self._cw.execute(rql) self.wview('activity-table', rset, 'null', showresource=showresource) class GenericActivityTable(tableview.RsetTableView): __regid__ = 'generic-activitytable' __select__ = multi_columns_rset() title = _('activitytable') cellvids = {4: 'editable-final'} finalvid = 'editable-final' layout_args = { 'display_filter': 'top', 'add_view_actions': False, } def call(self, title=None): strio = UStringIO() self.paginate(self, w=strio.write, page_size=20) super(GenericActivityTable, self).call() self.w(strio.getvalue()) class ActivityTable(tableview.RsetTableView): __regid__ = 'activity-table' def call(self, title=None, showresource=True): _ = self._cw._ self.headers = [_("diem"), _("duration"), _("workpackage"), _("description"), _("state"), ""] if showresource: self.displaycols = range(7) self.headers.insert(0, display_name(self._cw, 'Resource')) self.cellvids = {1: 'editable-final', 2: 'editable-final', 3: 'editable-final', 4: 'editable-final'} else: # skip resource column if asked to self.displaycols = range(1, 7) self.cellvids = { 0: 'editable-final', 1: 'editable-final', 2: 'editable-final', 3: 'editable-final'} super(ActivityTable, self).call() class ActivityCalendarItemView(calendar.CalendarItemView): __select__ = is_instance('Activity') def cell_call(self, row, col): activity = self.cw_rset.get_entity(row, col) self.w(u'<a href="%s">%s %s</a>' % (xml_escape(activity.absolute_url()), xml_escape(activity.workorder.dc_long_title()), activity.duration)) class ValidateActivitiesAction(action.Action): __regid__ = 'validate-activities' __select__ = (action.Action.__select__ & is_instance('Activity') & (match_user_groups('managers') | rql_condition('X done_for W, W owned_by U')) & score_entity(lambda x: x.cw_adapt_to('IWorkflowable').state == 'pending')) category = 'mainactions' title = _('validate activities') trname = 'validate' def fill_menu(self, box, menu): if self.cw_row is None: eids = [row[0] for row in self.cw_rset] else: eids = (self.cw_rset[self.cw_row][self.cw_col or 0],) menu.append(self.build_link(self.title, eids)) def build_link(self, title, eids, item=None): rql = ('INSERT TrInfo X: ' 'X by_transition BT, X wf_info_for Y ' 'WHERE Y eid in ({0}), Y in_state S, S state_of W, ' 'BT transition_of W, BT name \'{1}\'') rql = rql.format(','.join(str(eid) for eid in eids), self.trname) self._cw.add_js('cubes.timesheet.js') href = self._cw.build_url('rqlio/1.0') attrs = {'class': 'rqlio', 'data-rql': rql} return Link(href, self._cw._(title), **attrs) class ArchiveActivitiesAction(ValidateActivitiesAction): __regid__ = 'archive-activities' __select__ = (action.Action.__select__ & match_user_groups('managers') & is_instance('Activity') & score_entity(lambda x: x.cw_adapt_to('IWorkflowable').state == 'validated')) title = _('archive activities') trname = 'archive' WORKORDER_CLOSED_STATES = ['validated', 'canceled'] class MoveActivitiesAction(action.Action): __regid__ = 'move-activities' __select__ = (action.Action.__select__ & ~match_user_groups('managers') & is_instance('Activity') & rql_condition('X done_for W, W owned_by U') & score_entity(lambda x: x.cw_adapt_to('IWorkflowable').state == 'pending')) category = 'mainactions' submenu = _('move activities') def fill_menu(self, box, menu): self._cw.add_js('cubes.timesheet.js') if self.cw_row is None: eids = [str(row[self.cw_col or 0]) for row in self.cw_rset] else: eids = [str(self.cw_rset[self.cw_row][self.cw_col or 0])] for item in self.actual_actions(): menu.append(self.build_link(item.dc_long_title(), item, eids)) def actual_actions(self): states = ','.join('"%s"' % state for state in WORKORDER_CLOSED_STATES) return self._cw.execute('Any W,WT,O,OT ORDERBY OT,WT WHERE W is WorkOrder, ' 'W in_state S, NOT S name IN (%s), ' 'O split_into W, O title OT, W title WT' % states).entities() def build_link(self, title, workorder, eids): rql = 'SET X done_for Y WHERE X eid IN({0}), Y eid {1}' rql = rql.format(','.join(eids), workorder.eid) href = self._cw.build_url('rqlio/1.0') attrs = {'class': 'rqlio', 'data-rql': rql, } return Link(href, title, **attrs) class ManagerMoveActivitiesAction(MoveActivitiesAction): __select__ = (action.Action.__select__ & match_user_groups('managers') & is_instance('Activity') & score_entity(lambda x: x.cw_adapt_to('IWorkflowable').state != 'archived')) def actual_actions(self): return self._cw.execute('Any W,WT,O,OT ORDERBY OT,WT WHERE W is WorkOrder, ' 'O split_into W, O title OT, W title WT' ).entities() class ActivityIPrevNextAdapter(navigation.IPrevNextAdapter): __select__ = is_instance('Activity') def previous_entity(self): entity = self.entity execute = self._cw.execute # if the smallest duration rset = execute("Activity A ORDERBY DUR DESC LIMIT 1 WHERE " "A done_by R, R euser U, U eid %(u)s, A diem %(d)s, " "A duration DUR, A duration < %(t)s", {'u': entity.user.eid, 'd': entity.diem, 't': entity.duration}) if rset: return rset.get_entity(0, 0) # the smallest id rset = execute("Activity A ORDERBY A DESC LIMIT 1 WHERE " "A done_by R, R euser U, U eid %(u)s, A diem %(d)s, " "A duration < %(t)s, A eid < %(eid)s", {'u': entity.user.eid, 'd': entity.diem, 't': entity.duration, 'eid': entity.eid}) if rset: return rset.get_entity(0, 0) # next days rset = execute("Activity A ORDERBY D DESC LIMIT 1 WHERE " "A done_by R, R euser U, U eid %(u)s, " "A diem D, A diem < %(d)s ", {'u': entity.user.eid, 'd': entity.diem}) if rset: return rset.get_entity(0, 0) def next_entity(self): entity = self.entity execute = self._cw.execute rset = execute("Activity A ORDERBY DUR LIMIT 1 WHERE " "A done_by R, R euser U, U eid %(u)s, A diem %(d)s, " "A duration DUR, A duration > %(t)s", {'u': entity.user.eid, 'd': entity.diem, 't': entity.duration}) if rset: return rset.get_entity(0, 0) rset = execute("Activity A ORDERBY A LIMIT 1 WHERE " "A done_by R, R euser U, U eid %(u)s, A diem %(d)s, " "A eid > %(eid)s, A duration > %(t)s", {'u': entity.user.eid, 'd': entity.diem, 't': entity.duration, 'eid': entity.eid}) if rset: return rset.get_entity(0, 0) rset = execute("Activity A ORDERBY D LIMIT 1 WHERE " "A done_by R, R euser U, U eid %(u)s, " "A diem D, A diem > %(d)s ", {'u': entity.user.eid, 'd': entity.diem}) if rset: return rset.get_entity(0, 0) class ActivityIEditControlAdapter(editcontroller.IEditControlAdapter): __select__ = is_instance('Activity') def after_deletion_path(self): """return (path, parameters) which should be used as redirect information when this entity is being deleted """ return 'view', {} class ActivityICalendarViewsAdapter(EntityAdapter): """calendar views interface""" __regid__ = 'ICalendarViews' __select__ = is_instance('Activity') def matching_dates(self, begin, end): """calendar views interface""" return [self.entity.diem]
PypiClean
/jiminy_py-1.7.16-cp311-cp311-macosx_10_15_universal2.whl/jiminy_py/viewer/meshcat/server.py
import os import sys import signal import logging import asyncio import argparse import multiprocessing import multiprocessing.managers from typing import Optional, Tuple, Sequence, Dict, List, Set import zmq import psutil import umsgpack import tornado.web import tornado.ioloop from zmq.eventloop.zmqstream import ZMQStream from meshcat.servers.tree import walk, find_node from meshcat.servers.zmqserver import ( DEFAULT_ZMQ_METHOD, VIEWER_ROOT, StaticFileHandlerNoCache, ZMQWebSocketBridge, WebSocketHandler, find_available_port) DEFAULT_COMM_PORT = 6500 WAIT_COM_TIMEOUT = 5.0 # in seconds # Disable tornado access error logging logging.getLogger('tornado.access').disabled = True # ================ Monkey-patch ======================= # Add support of cross-origin connection. # It is useful to execute custom javascript commands within a Jupyter Notebook, # and it is not an actual security flaw for local servers since they are not # accessible from the outside anyway. WebSocketHandler.check_origin = lambda self, origin: True # Override the default html page to disable auto-update of three js "controls" # of the camera, so that it can be moved programmatically in any position, # without any constraint, as long as the user is not moving it manually using # the mouse. class MyFileHandler(StaticFileHandlerNoCache): """ TODO: Write documentation. """ def initialize(self, # pylint: disable=arguments-differ default_path: str, default_filename: str, fallback_path: str) -> None: """ TODO: Write documentation. """ # pylint: disable=attribute-defined-outside-init self.default_path = os.path.abspath(default_path) self.default_filename = default_filename self.fallback_path = os.path.abspath(fallback_path) super().initialize(self.default_path, self.default_filename) def validate_absolute_path(self, root: str, absolute_path: str) -> Optional[str]: """ TODO: Write documentation. """ if os.path.isdir(absolute_path): if not self.request.path.endswith("/"): self.redirect(self.request.path + "/", permanent=True) return None absolute_path = os.path.join(absolute_path, self.default_filename) return self.validate_absolute_path(root, absolute_path) if os.path.exists(absolute_path) and \ os.path.basename(absolute_path) != self.default_filename: return super().validate_absolute_path(root, absolute_path) return os.path.join( self.fallback_path, absolute_path[(len(root) + 1):]) # Implement bidirectional communication because zmq and the websockets by # gathering and forward messages received from the websockets to zmq. Note that # there is currently no way to identify the client associated to each reply, # but it is usually not a big deal, since the same answers is usually # expected from each of them. Comma is used as a delimiter. # # It also fixes flushing issue when 'handle_zmq' is not directly responsible # for sending a message through the zmq socket. def handle_web(self: WebSocketHandler, message: str) -> None: """ TODO: Write documentation. """ # Ignore watchdog for websockets since it would be closed if non-responding if message != 'meshcat:watchdog': self.bridge.websocket_msg.append(message) # It should not be necessary to check 'is_waiting_ready_msg' because this # method should never be triggered if there is nothing to send, but still # doing it in case of some unexpected edge-case. if not self.bridge.is_waiting_ready_msg: return # Send acknowledgement if everybody replied if len(self.bridge.websocket_msg) == len(self.bridge.websocket_pool) and \ len(self.bridge.comm_msg) == len(self.bridge.comm_pool): self.bridge.is_waiting_ready_msg = False gathered_msg = ",".join( self.bridge.websocket_msg + list(self.bridge.comm_msg.values())) self.bridge.zmq_socket.send(gathered_msg.encode("utf-8")) self.bridge.zmq_stream.flush() self.bridge.comm_msg = {} self.bridge.websocket_msg = [] WebSocketHandler.on_message = handle_web # noqa class ZMQWebSocketIpythonBridge(ZMQWebSocketBridge): """ TODO: Write documentation. """ def __init__(self, zmq_url: Optional[str] = None, comm_url: Optional[str] = None, host: str = "127.0.0.1", port: Optional[int] = None): super().__init__(zmq_url, host, port) # Create a new zmq socket specifically for kernel communications if comm_url is None: def f(port: int) -> Tuple[zmq.Socket, ZMQStream, str]: return self.setup_comm( f"{DEFAULT_ZMQ_METHOD}://{self.host}:{port}") (self.comm_zmq, self.comm_stream, self.comm_url), _ = \ find_available_port(f, DEFAULT_COMM_PORT) else: self.comm_zmq, self.comm_stream, self.comm_url = \ self.setup_comm(comm_url) # Extra buffers for: comm ids and messages self.comm_pool: Set[bytes] = set() self.watch_pool: Set[bytes] = set() self.comm_msg: Dict[bytes, str] = {} self.websocket_msg: List[str] = [] self.is_waiting_ready_msg = False # Start the comm watchdog self.watchdog_comm() def setup_comm(self, url: str) -> Tuple[zmq.Socket, ZMQStream, str]: """ TODO: Write documentation. """ comm_zmq = self.context.socket(zmq.XREQ) comm_zmq.bind(url) comm_stream = ZMQStream(comm_zmq) comm_stream.on_recv(self.handle_comm) return comm_zmq, comm_stream, url def make_app(self) -> tornado.web.Application: """ TODO: Write documentation. """ return tornado.web.Application([ (r"/static/?(.*)", MyFileHandler, { "default_path": VIEWER_ROOT, "fallback_path": os.path.dirname(__file__), "default_filename": "index.html"}), (r"/", WebSocketHandler, {"bridge": self}) ]) def wait_for_websockets(self) -> None: """ TODO: Write documentation. """ if self.websocket_pool or self.comm_pool: self.zmq_socket.send(b"ok") self.zmq_stream.flush() else: self.ioloop.call_later(0.1, self.wait_for_websockets) def watchdog_comm(self) -> None: """ TODO: Write documentation. """ # Purge non-responding comms for comm_id in self.comm_pool.copy(): if comm_id not in self.watch_pool: self.comm_pool.discard(comm_id) self.comm_msg.pop(comm_id, None) self.watch_pool.clear() # Trigger ready sending if comm has been purged if self.is_waiting_ready_msg and \ len(self.websocket_msg) == len(self.websocket_pool) and \ len(self.comm_msg) == len(self.comm_pool): self.is_waiting_ready_msg = False gathered_msg = ",".join( self.websocket_msg + list(self.comm_msg.values())) self.zmq_socket.send(gathered_msg.encode("utf-8")) self.zmq_stream.flush() self.comm_msg = {} self.websocket_msg = [] self.ioloop.call_later(WAIT_COM_TIMEOUT, self.watchdog_comm) def handle_zmq(self, frames: Sequence[bytes]) -> None: """ TODO: Write documentation. """ cmd = frames[0].decode("utf-8") if cmd == "ready": self.comm_stream.flush() if not self.websocket_pool and not self.comm_pool: self.zmq_socket.send(b"") self.zmq_stream.flush() return msg = umsgpack.packb({"type": "ready"}) self.is_waiting_ready_msg = True for websocket in self.websocket_pool: websocket.write_message(msg, binary=True) for comm_id in self.comm_pool: self.forward_to_comm(comm_id, msg) elif cmd == "list": # Only set_transform command is supported for now for i in range(1, len(frames), 3): _cmd, path, data = frames[i:(i+3)] path = list(filter(None, path.decode("utf-8").split("/"))) find_node(self.tree, path).transform = data super().forward_to_websockets(frames[i:(i+3)]) for comm_id in self.comm_pool: self.comm_zmq.send_multipart([comm_id, *frames[3::3]]) self.zmq_socket.send(b"ok") self.zmq_stream.flush(zmq.POLLOUT) elif cmd == "stop": self.ioloop.stop() else: super().handle_zmq(frames) def handle_comm(self, frames: Sequence[bytes]) -> None: """ TODO: Write documentation. """ cmd = frames[0].decode("utf-8") comm_id = cmd.split(':', 2)[1].encode() if cmd.startswith("open:"): self.send_scene(comm_id=comm_id) self.comm_pool.add(comm_id) self.watch_pool.add(comm_id) if self.is_waiting_ready_msg: # Send request for acknowledgment a-posteriori msg = umsgpack.packb({"type": "ready"}) self.forward_to_comm(comm_id, msg) elif cmd.startswith("close:"): # Using `discard` over `remove` to avoid raising exception if # 'comm_id' is not found. It may happened if an old comm is closed # after Jupyter-notebook reset for instance. self.comm_pool.discard(comm_id) self.comm_msg.pop(comm_id, None) elif cmd.startswith("data:"): # Extract the message message = cmd.split(':', 2)[2] # Catch watchdog messages if message == "watchdog": self.watch_pool.add(comm_id) return if comm_id in self.comm_pool: # The comm may have already been thrown away already self.comm_msg[comm_id] = message if self.is_waiting_ready_msg and \ len(self.websocket_msg) == len(self.websocket_pool) and \ len(self.comm_msg) == len(self.comm_pool): self.is_waiting_ready_msg = False gathered_msg = ",".join( self.websocket_msg + list(self.comm_msg.values())) self.zmq_socket.send(gathered_msg.encode("utf-8")) self.zmq_stream.flush() self.comm_msg = {} self.websocket_msg = [] def forward_to_websockets(self, frames: Sequence[bytes]) -> None: """ TODO: Write documentation. """ super().forward_to_websockets(frames) *_, data = frames for comm_id in self.comm_pool: self.forward_to_comm(comm_id, data) def forward_to_comm(self, comm_id: bytes, message: bytes) -> None: """ TODO: Write documentation. """ self.comm_zmq.send_multipart([comm_id, message]) self.comm_stream.flush(zmq.POLLOUT) def send_scene(self, websocket: Optional[WebSocketHandler] = None, comm_id: Optional[bytes] = None) -> None: """ TODO: Write documentation. """ if websocket is not None: super().send_scene(websocket) elif comm_id is not None: for node in walk(self.tree): if node.object is not None: self.forward_to_comm(comm_id, node.object) for prop in node.properties: self.forward_to_comm(comm_id, prop) if node.transform is not None: self.forward_to_comm(comm_id, node.transform) # ====================================================== def _meshcat_server(info: Dict[str, str], verbose: bool) -> None: """Meshcat server daemon, using in/out argument to get the zmq url instead of reading stdout as it was. """ # pylint: disable=consider-using-with # Redirect both stdout and stderr to devnull if not verbose if not verbose: devnull = open(os.devnull, 'w') sys.stdin = sys.stderr = devnull # See https://bugs.python.org/issue37373 if sys.platform.startswith('win'): asyncio.set_event_loop_policy( asyncio.WindowsSelectorEventLoopPolicy()) # Do not catch signal interrupt automatically, to avoid # killing meshcat server and stopping Jupyter notebook cell. signal.signal(signal.SIGINT, signal.SIG_IGN) # Create new asyncio event loop loop = asyncio.new_event_loop() asyncio.set_event_loop(loop) bridge = ZMQWebSocketIpythonBridge() info['zmq_url'] = bridge.zmq_url info['web_url'] = bridge.web_url info['comm_url'] = bridge.comm_url bridge.run() if not verbose: devnull.close() def start_meshcat_server(verbose: bool = False ) -> Tuple[multiprocessing.Process, str, str, str]: """Run meshcat server in background using multiprocessing Process. """ with multiprocessing.managers.SyncManager() as manager: info = manager.dict() server = multiprocessing.Process( target=_meshcat_server, args=(info, verbose), daemon=True) server.start() # Wait for the process to finish initialization while 'comm_url' not in info.keys(): pass zmq_url, web_url, comm_url = \ info['zmq_url'], info['web_url'], info['comm_url'] return server, zmq_url, web_url, comm_url def start_meshcat_server_standalone() -> None: """ TODO: Write documentation. """ argparse.ArgumentParser(description=( "Serve the Jiminy MeshCat HTML files and listen for ZeroMQ commands")) server, zmq_url, web_url, comm_url = start_meshcat_server(True) print(zmq_url) print(web_url) print(comm_url) try: server.join() except KeyboardInterrupt: server.terminate() server.join(timeout=0.5) try: proc = psutil.Process(server.pid) proc.send_signal(signal.SIGKILL) except psutil.NoSuchProcess: pass
PypiClean
/nifigator-0.1.22.tar.gz/nifigator-0.1.22/docs/04_using a SPARQL endpoint.md
--- jupyter: jupytext: text_representation: extension: .md format_name: markdown format_version: '1.3' jupytext_version: 1.14.5 kernelspec: display_name: Python 3 (ipykernel) language: python name: python3 --- # Using a SPARQL endpoint ## Connecting to a (local) SPARQL endpoint You can use an existing SPARQL endpoint in the following way. ```python from rdflib.plugins.stores.sparqlstore import SPARQLUpdateStore from rdflib.graph import DATASET_DEFAULT_GRAPH_ID as default # Connect to triplestore. store = SPARQLUpdateStore() query_endpoint = 'http://localhost:3030/nifigator/sparql' update_endpoint = 'http://localhost:3030/nifigator/update' store.open((query_endpoint, update_endpoint)) ``` Then open a NifGraph in the same way as a rdflib.Graph ```python from nifigator import NifGraph # Open a graph in the open store and set identifier to default graph ID. graph = NifGraph(store=store, identifier=default) ``` We can then check the number of triples in the store ```python # count the number of triples in the store print("Number of triples: "+str(len(graph))) ``` ```console Number of triples: 1081392 ``` To check the contexts in the graph you can use the catalog property. This property return a Pandas DataFrame with the context uris (in the index) with collection uri and the metadata (from DC and DCTERMS) available. ```python # get the catalog with all contexts within the graph catalog = graph.catalog catalog ``` It is sometimes necessary to compact the database. You can do that with the following command ```console curl -XPOST http://localhost:3030/$/compact/nifigator ``` ## Running SPARQL queries ### The total number of words in the collection ```python # define the query for the total number of words q = """ SELECT (count(?s) as ?num) WHERE { SERVICE <http://localhost:3030/nifigator/sparql> { ?s rdf:type nif:Word . } } """ # execute the query results = graph.query(q) # print the results for result in results: print(result[0].value) ``` This returns ```console 68070 ``` ### The frequency of words per context ```python # query for the frequency of words per context q = """ SELECT ?w (count(?w) as ?num) WHERE { SERVICE <http://localhost:3030/nifigator/sparql> { ?s rdf:type nif:Word . ?s nif:anchorOf ?w . ?s nif:referenceContext ?c . } } GROUP BY ?w ORDER BY DESC(?num) LIMIT 10 """ # execute the query results = graph.query(q) # print the results for result in results: print((result[0].value, result[1].value)) ``` This returns ```console ('the', 3713) ('.', 2281) (',', 2077) ('of', 1877) ('and', 1736) ('to', 1420) ('in', 1411) (')', 892) ('-', 874) ('(', 865) ``` ### Adjective-noun combinations in the context ```python # query for the first 10 ADJ-NOUN combinations q = """ SELECT ?a1 ?a WHERE { SERVICE <http://localhost:3030/nifigator/sparql> { ?s rdf:type nif:Word . ?s nif:pos olia:CommonNoun . ?s nif:anchorOf ?a . ?s nif:previousWord [ nif:pos olia:Adjective ; nif:anchorOf ?a1 ] } } LIMIT 10 """ # execute the query results = graph.query(q) # print the results for result in results: print((result[0].value, result[1].value)) ``` This returns ```console ('Annual', 'Report') ('supervisory', 'authorities') ('financial', 'crime') ('illegal', 'use') ('non-commercial', 'purposes') ('wide', 'availability') ('terrorist', 'financing') ('regular', 'supervision') ('pre-pandemic', 'levels') ('new', 'market') ``` ```python # All two-word phrases ending with the lemma 'insurer' and starting with an adjective q = """ SELECT distinct ?c ?a WHERE { SERVICE <http://localhost:3030/nifigator/sparql> { ?s rdf:type nif:Word . ?s nif:lemma "insurer"^^xsd:string . ?s nif:anchorOf ?a . ?s nif:previousWord [ nif:pos olia:Adjective ; nif:anchorOf ?c ; ] } } """ # execute the query results = graph.query(q) # print the results for result in results: print((result[0].value, result[1].value)) ``` This gives: ```console ('eligible', 'insurers') ('Non-life', 'insurers') ('Dutch', 'insurers') ('relevant', 'insurers') ('non-life', 'insurers') ('individual', 'insurers') ```
PypiClean
/substrait_validator-0.0.11-cp37-none-win_amd64.whl/substrait_validator/__init__.py
import sys import json import jdot import yaml import click import urllib.request from io import BytesIO from typing import Iterable from google.protobuf import json_format from google.protobuf.message import DecodeError as ProtoDecodeError from .substrait_validator import ( ResultHandle, Config as _Config, get_diagnostic_codes, get_version as _get_version, get_substrait_version as _get_substrait_version, ) from .substrait.plan_pb2 import Plan from .substrait.validator.tree_pb2 import ParseResult, Diagnostic, Path __VERSION__ = _get_version() _JDOT_MACROS = """@macros .field .selection { .directReference .structField .field ?v .rootReference {} } .field0 .selection { .directReference .structField {} .rootReference {} } .nullable .nullability "NULLABILITY_NULLABLE" .required .nullability "NULLABILITY_REQUIRED" @output """ def _jdot_coder() -> jdot.JdotCoder: coder = jdot.JdotCoder() coder.decode(_JDOT_MACROS) return coder def _jdot_dumps(data) -> str: return _JDOT_MACROS + _jdot_coder().encode( data, formatter=jdot.formatter.JdotFormatter() ) def _jdot_loads(data: str): return _jdot_coder().decode(data) def _populate_config(cfg): """We can't derive from _Config to add the add_urllib_resolver() function, so we'll just have to monkey-patch it.""" def generate_method(cls, name, fn): def x(self, *args, **kwargs): return fn(self._config, *args, **kwargs) x.__name__ = name x.__doc__ = f.__doc__ setattr(cls, name, x) for name in dir(_Config): if name.startswith("_"): continue f = getattr(_Config, name) if not callable(f): continue generate_method(cfg, name, f) cfg.__doc__ = _Config.__doc__ return cfg @_populate_config class Config: def __init__(self): self._config = _Config() @staticmethod def _unwrap(config): if isinstance(config, Config): return config._config elif isinstance(config, _Config): return config elif config is None: return None else: raise TypeError("unsupported type: {}".format(type(config))) def add_urllib_resolver(self): """Adds a URI resolver based on urllib.""" def urllib_resolver(uri): return urllib.request.urlopen(uri).read() self._config.add_uri_resolver(urllib_resolver) def load_plan_from_proto(data: bytes) -> Plan: """Load a Substrait plan from its protobuf serialization.""" if not isinstance(data, bytes): raise TypeError("unsupported type: {}".format(type(data))) plan = Plan() plan.ParseFromString(data) return plan def load_plan_from_json(data: str) -> Plan: """Load a Substrait plan from its JSON string representation.""" if not isinstance(data, str): raise TypeError("unsupported type: {}".format(type(data))) return json_format.Parse(data, Plan()) def load_plan_from_dict(data: dict) -> Plan: """Load a Substrait plan from its Python object JSON representation.""" if not isinstance(data, dict): raise TypeError("unsupported type: {}".format(type(data))) return load_plan_from_json(json.dumps(data)) def load_plan_from_yaml(data: str) -> Plan: """Load a Substrait plan from YAML data mimicking the structure of its JSON string representation.""" if not isinstance(data, str): raise TypeError("unsupported type: {}".format(type(data))) return load_plan_from_dict(yaml.safe_load(data)) def load_plan_from_jdot(data: str) -> Plan: """Load a Substrait plan from JDOT data mimicking the structure of its JSON string representation.""" if not isinstance(data, str): raise TypeError("unsupported type: {}".format(type(data))) return load_plan_from_dict(_jdot_loads(data)) def load_plan(data) -> Plan: """Loads a plan from its binary protobuf serialization (bytes input), a JSON string (string input), or a dictionary representation of such a JSON string (dict input). If data is already a Plan, this function is no-op and simply returns its input.""" if isinstance(data, Plan): return data elif isinstance(data, bytes): return load_plan_from_proto(data) elif isinstance(data, str): return load_plan_from_json(data) elif isinstance(data, dict): return load_plan_from_dict(data) else: raise TypeError("unsupported type: {}".format(type(data))) def parse_plan(plan, config=None) -> ParseResult: """Parses the given plan with the validator. plan can be anything supported by load_plan(), a Plan object, or a ResultHandle object. This is just an alternate name for plan_to_parse_result().""" return plan_to_parse_result(plan, config) def plan_to_proto(plan) -> bytes: """Converts a plan to its binary protobuf serialization. plan can be anything supported by load_plan().""" return load_plan(plan).SerializeToString() def plan_to_json(plan) -> str: """Converts a plan to its JSON serialization, returned as a string. plan can be anything supported by load_plan().""" return json_format.MessageToJson(load_plan(plan)) def plan_to_dict(plan) -> dict: """Converts a plan to its JSON serialization, returned as a dict. plan can be anything supported by load_plan().""" return json_format.MessageToDict(load_plan(plan)) def plan_to_yaml(plan) -> str: """Converts a plan to the YAML equivalent of its JSON serialization, returned as a string. plan can be anything supported by load_plan().""" return yaml.safe_dump(plan_to_dict(plan)) def plan_to_jdot(plan) -> str: """Converts a plan to the JDOT equivalent of its JSON serialization, returned as a string. plan can be anything supported by load_plan().""" return _jdot_dumps(plan_to_dict(plan)) def plan_to_result_handle(plan, config=None) -> ResultHandle: """Parses a Substrait plan using the validator, and returns its result handle object. plan can be anything supported by load_plan(). If the input is already a ResultHandle, it is returned as-is.""" if isinstance(plan, ResultHandle): return plan if isinstance(plan, bytes): data = plan else: data = plan_to_proto(plan) return ResultHandle(data, Config._unwrap(config)) def plan_to_parse_result(plan, config=None) -> ParseResult: """Parses the given plan with the validator, and returns its parse result. plan can be anything supported by load_plan(), a Plan object, or a ResultHandle object.""" result = ParseResult() result.ParseFromString(plan_to_parse_result_proto(plan, config)) return result def plan_to_parse_result_proto(plan, config=None) -> str: """Same as parse_plan(), but returns the binary serialization of the parse result. This is faster, if you don't plan to use the serialization from python.""" return plan_to_result_handle(plan, config).export_proto() def plan_to_diagnostics(plan, config=None) -> Iterable[Diagnostic]: """Converts a plan to an iterable of Diagnostics. plan can be anything supported by plan_to_result_handle().""" def walk(node): for data in node.data: if data.HasField("child"): for diagnostic in walk(data.child.node): yield diagnostic elif data.HasField("diagnostic"): yield data.diagnostic return walk(plan_to_parse_result(plan, config).root) def plan_to_diagnostics_str(plan, config=None) -> str: """Converts a plan to a multiline string representing the diagnostic messages returned by the validator for that plan. plan can be anything supported by plan_to_result_handle().""" return plan_to_result_handle(plan, config).export_diagnostics() def plan_to_html(plan, config=None) -> str: """Generates a HTML page for the given plan to serve as documentation while debugging. plan can be anything supported by plan_to_result_handle().""" return plan_to_result_handle(plan, config).export_html() def check_plan(plan, config=None) -> int: """Returns 1 if the given plan is valid, -1 if it is invalid, or 0 if the validator cannot determine validity. plan can be anything supported by load_plan(), a Plan object, or a ResultHandle object.""" return plan_to_result_handle(plan, config).check() def check_plan_valid(plan, config=None): """Throws a ValueError exception containing the first error or warning encountered in the plan if the validator cannot prove correctness of the given plan. plan can be anything supported by load_plan(), a Plan object, or a ResultHandle object.""" plan_to_result_handle(plan, config).check_valid() def check_plan_not_invalid(plan, config=None): """Throws a ValueError exception containing the first error encountered in the plan if the validator can prove that the given plan is invalid. plan can be anything supported by load_plan(), a Plan object, or a ResultHandle object.""" plan_to_result_handle(plan, config).check_not_invalid() def path_to_string(path: Path) -> str: """Converts a substrait.validator.Path message to a string.""" elements = [path.root] for element in path.elements: if element.HasField("field"): elements.append(f".{element.field.field}") elif element.HasField("repeated_field"): elements.append( f".{element.repeated_field.field}[{element.repeated_field.index}]" ) elif element.HasField("oneof_field"): elements.append( f".{element.oneof_field.field}<{element.oneof_field.variant}>" ) elif element.HasField("array_element"): elements.append(f"[{element.array_element.index}]") else: raise ValueError("invalid path element") return "".join(elements) def version() -> str: """Returns the version of the validator.""" return __VERSION__ def substrait_version() -> str: """Returns the version of Substrait that the validator was built against.""" return _get_substrait_version() @click.command() @click.argument("infile", required=False) @click.option( "--in-type", type=click.Choice(["ext", "proto", "json", "yaml", "jdot"], case_sensitive=False), default="ext", help=( 'Input file type. "ext" uses the extension of the input ' 'file, defaulting to "proto" if there is none.' ), ) @click.option( "--verbosity", "-v", type=click.Choice( ["info", "warn", "error", "fatal", "quiet"], case_sensitive=False ), default="warn", help=("Specifies the verbosity for writing diagnostics to " "stderr."), ) @click.option( "--out-file", "-O", default=None, help='Output file. "-" may be used to select stdout.', ) @click.option( "--out-type", type=click.Choice( ["ext", "diag", "html", "proto", "json", "yaml", "jdot"], case_sensitive=False ), default="ext", help=( 'Output file type. "ext" uses the extension of the output ' 'file, defaulting to "diag" if there is none.' ), ) @click.option( "--mode", "-m", type=click.Choice(["convert", "ignore", "loose", "strict"], case_sensitive=False), default="loose", help=( 'Validation mode. "convert" disables all but protobuf\'s ' "internal validation, and can be used to convert between " 'different representations of substrait.Plan. "ignore" ' "runs validation, but ignores the result (i.e. the " "program always returns 0 and emits an output file if " 'requested). "loose" fails only if the validator can ' 'prove that the plan is invalid. "strict" fails if it ' "cannot prove that it is valid." ), ) @click.option( "--ignore-unknown-fields", help=( "Do not generate warnings for unknown protobuf fields " "that are set to their protobuf-defined default value." ), ) @click.option( "--allow-proto-any", multiple=True, help=( "Explicitly allow the given protobuf type URL(s) to be " "used in protobuf Any messages. Supports glob syntax." ), ) @click.option( "--diagnostic-level", nargs=3, multiple=True, help=( "Clamps the error level of diagnostics with diagnostic " "code or class [0] to at least [1] and at most [2]. " "For example, --diagnostic-level 1 warn error will " "override the level of info diagnostics with code 1 " "to warning, leaving the other levels unchanged." ), ) @click.option( "--override-uri", nargs=2, multiple=True, help=( "Overrides URIs in the plan that match [0] with [1]. Set " '[1] to "-" to disable resolution of matching URIs. ' "Supports glob syntax. For example, " '"--override-uri http://* -" disables resolution via ' "http." ), ) @click.option( "--use-urllib/--no-use-urllib", default=True, help=( "Enable URI resolution via urllib. Enabled by default. " "If disabled, only file:// URIs will resolve (after " "application of any --override-uri options)." ), ) @click.option( "--uri-depth", type=int, default=None, help=( "Sets the maximum recursion depth for resolving transitive " "dependencies. You can specify a negative number to disable " "the limit, or set this to zero to disable URI resolution " "entirely." ), ) @click.option( "--help-diagnostics", is_flag=True, help=("Show a list of all known diagnostic codes and exit."), ) @click.option( "--version", "print_version", is_flag=True, help=("Print the version of the validator and exit."), ) @click.option( "--substrait-version", "print_substrait_version", is_flag=True, help=( "Print the version of Substrait that the validator was " "built against and exit." ), ) def cli( # noqa: C901 infile, in_type, out_file, out_type, mode, verbosity, ignore_unknown_fields, allow_proto_any, diagnostic_level, override_uri, use_urllib, uri_depth, help_diagnostics, print_version, print_substrait_version, ): """Validate or convert the substrait.Plan represented by INFILE (or stdin using "-"). This version of the validator is EXPERIMENTAL. Please report issues via https://github.com/substrait-io/substrait-validator/issues/new. The following formats are supported: \b - proto: binary serialization format of protobuf. - json: JSON serialization format of protobuf. - yaml: like JSON, but represented as YAML. - jdot: like JSON, but represented as JDOT (still highly experimental, see https://github.com/saulpw/jdot). - diag*: list of validator diagnostic messages. - html*: all information known about the plan in HTML format. *output-only, and not supported in -mconvert mode. When validation is enabled, the output message type will be substrait.validator.Result. If you just want to convert between different representations of the substrait.Plan message, use -mconvert. """ # Define various helper functions and constants. INFO = Diagnostic.Level.LEVEL_INFO WARN = Diagnostic.Level.LEVEL_WARNING ERROR = Diagnostic.Level.LEVEL_ERROR FATAL = ERROR + 1 QUIET = FATAL + 1 def level_str_to_int(level): """Converts a string representation of an error level or verbosity to its internal integer representation.""" return { "info": INFO, "warn": WARN, "error": ERROR, "fatal": FATAL, "quiet": QUIET, }[level] def emit_diagnostic(level, msg, code=None, source=None, original_level=None): """Emits a diagnostic message to stderr.""" # Only print the diagnostic if the configured verbosity is high enough. if level < verbosity_level: return # Determine the original error level. if original_level is None: original_level = level # Format the level. formatted = [ { FATAL: click.style("Fatal error", fg="red", bold=True), ERROR: click.style("Error", fg="red", bold=True), WARN: click.style("Warning", fg="yellow", bold=False), INFO: click.style("Info", fg="green", bold=False), }[level] ] # Format extra information written within parentheses. parens = [] if original_level != level: if original_level > level: mod = "reduced from " else: mod = "promoted from " mod += { FATAL: "fatal", ERROR: "error", WARN: "warning", INFO: "info", }[original_level] parens.append(mod) if code is not None: parens.append(f"code {code:04d}") if parens: formatted.append(" ({})".format(", ".join(parens))) formatted.append(":\n") # Append source information, if known. if source is not None: formatted.append(f" at {source}:\n") # Append the actual message. formatted.append(" ") formatted.append("\n ".join(str(msg).split("\n"))) formatted.append("\n") # Print the formatted diagnostic. click.echo("".join(formatted), err=True) def fatal(*args, **kwargs): """Shorthand for emit_diagnostic(FATAL, ...) followed by exiting with code 1.""" emit_diagnostic(FATAL, *args, **kwargs) sys.exit(1) def deduce_format(fil, typ, remap): """Deduces the file format for fil with type hint typ using the rules in remap.""" if typ == "ext": if fil is None: typ = remap["DEFAULT"] else: _, *ext = fil.rsplit(".", maxsplit=1) if ext: typ = ext[0].lower() typ = remap.get(typ, remap["DEFAULT"]) return typ def emit_output(data): """Emits the given output data as specified on the command line.""" # Encode text formats as unicode. if not isinstance(data, bytes): data = data.encode("utf-8") # Write to the output. if out_file == "-": try: count = sys.stdout.buffer.write(data) except IOError as e: fatal(f"failed to write to stdout: {e}") elif out_file is not None: try: with open(out_file, "wb") as f: count = f.write(data) except IOError as e: fatal(f"failed to write output file: {e}") else: return if count < len(data): fatal("failed to write all output") def emit_proto(out_message): """Emits the given protobuf message as specified on the command line.""" # Convert to appropriate data format. if out_type == "proto": emit_output(out_message.SerializeToString()) elif out_type == "json": emit_output(json_format.MessageToJson(out_message)) else: out_dict = json_format.MessageToDict(out_message) if out_type == "yaml": emit_output(yaml.safe_dump(out_dict)) elif out_type == "jdot": emit_output(_jdot_dumps(out_dict)) else: fatal(f"cannot emit protobuf message in {out_type} format") # Print diagnostic code help if requested. if help_diagnostics: click.echo("The following diagnostic codes are defined:\n") diags = {} for code, (name, desc, parent) in sorted(get_diagnostic_codes().items()): diag = (code, name, desc, []) diags[code] = diag if parent is not None: diags[parent][3].append(diag) def print_diag(diag, first_prefix="", next_prefix=""): code, name, desc, children = diag click.echo(f"{first_prefix}{code:04d} ({name}): {desc}.") for child in children[:-1]: print_diag(child, f"{next_prefix} |- ", f"{next_prefix} | ") if children: print_diag(children[-1], f"{next_prefix} '- ", f"{next_prefix} ") print_diag(diags[0]) sys.exit(0) # Print Substrait version if requested. if print_substrait_version: click.echo(substrait_version()) sys.exit(0) # Print validator version if requested. if print_version: click.echo(version()) sys.exit(0) # Parse verbosity level. verbosity_level = level_str_to_int(verbosity) # Check input file. in_file = infile if in_file is None: click.echo("Missing input file. Try --help for usage information.", err=True) sys.exit(2) # Handle automatic format deduction. in_type = deduce_format( in_file, in_type, { "DEFAULT": "proto", "json": "json", "yaml": "yaml", "jdot": "jdot", }, ) out_type = deduce_format( out_file, out_type, { "DEFAULT": "proto", "json": "json", "yaml": "yaml", "jdot": "jdot", "txt": "diag", "html": "html", "htm": "html", }, ) # Read input file. if in_file == "-": try: in_data = sys.stdin.buffer.read() except IOError as e: fatal(f"failed to read from stdin: {e}") else: try: with open(in_file, "rb") as f: in_data = f.read() except IOError as e: fatal(f"failed to read input file: {e}") # Parse input format. if in_type == "proto": # Convert the plan directly. try: in_plan = load_plan_from_proto(in_data) except ProtoDecodeError as e: fatal(e) else: # Remaining formats are UTF-8 encoded. try: in_str = in_data.decode("utf8") except UnicodeError as e: fatal(f"failed to decode input file: {e}") # Convert from different variations of the JSON object model. if in_type == "json": try: in_dict = json.loads(in_str) except json.decoder.JSONDecodeError as e: fatal(f"failed to decode input file: {e}") elif in_type == "yaml": try: in_dict = yaml.safe_load(in_str) except yaml.YAMLError as e: fatal(f"failed to decode input file: {e}") elif in_type == "jdot": try: in_dict = _jdot_loads(in_str) except jdot.decoder.DecodeException as e: fatal(f"failed to decode input file: {e}") else: raise NotImplementedError(in_type) # The outermost structure must be a dict for anything to work at all. if not isinstance(in_dict, dict): fatal("toplevel structure of decoded JSON-like input is not a object") # Convert the dict representation of the JSON object model to the # protobuf message wrapper. try: in_plan = load_plan_from_dict(in_dict) except json_format.ParseError as e: fatal(e) # Handle convert-only mode. if mode == "convert": emit_proto(in_plan) return 0 # Construct parser/validator configuration. config = Config() if ignore_unknown_fields: config.ignore_unknown_fields() for pattern in allow_proto_any: try: config.allow_proto_any_url(pattern) except ValueError as e: fatal(e) for code, minimum, maximum in diagnostic_level: try: code = int(code, 10) if code < 0: raise ValueError() minimum = minimum.lower() if minimum == "warn": minimum = "warning" maximum = maximum.lower() if maximum == "warn": maximum = "warning" config.override_diagnostic_level(code, minimum, maximum) except ValueError as e: fatal(e) for pattern, resolve_as in override_uri: if resolve_as == "-": resolve_as = None try: config.override_uri(pattern, resolve_as) except ValueError as e: fatal(e) if use_urllib: config.add_urllib_resolver() if uri_depth is not None: if uri_depth < 0: config.set_max_uri_resolution_depth(None) else: config.set_max_uri_resolution_depth(uri_depth) # Run the parser/validator. result = plan_to_result_handle(in_plan, config) # Emit diagnostics to stderr. for diagnostic in plan_to_diagnostics(result): emit_diagnostic( msg=diagnostic.msg, code=diagnostic.cause, source=path_to_string(diagnostic.path), level=diagnostic.adjusted_level, original_level=diagnostic.original_level, ) # Check validity. validity = check_plan(result) if mode == "loose": if validity < 0: fatal("plan is invalid") elif mode == "strict": if validity < 1: fatal("failed to prove that plan is valid") elif mode != "ignore": raise ValueError("mode") # Emit output file. if out_type == "diag": emit_output(plan_to_diagnostics_str(result)) elif out_type == "html": emit_output(plan_to_html(result)) else: emit_proto(plan_to_parse_result(result)) return 0 if __name__ == "__main__": cli()
PypiClean
/pano_airflow-2.7.1-py3-none-any.whl/airflow/models/dagwarning.py
from __future__ import annotations from enum import Enum from sqlalchemy import Column, ForeignKeyConstraint, String, Text, false from sqlalchemy.orm import Session from airflow.api_internal.internal_api_call import internal_api_call from airflow.models.base import Base, StringID from airflow.utils import timezone from airflow.utils.retries import retry_db_transaction from airflow.utils.session import NEW_SESSION, provide_session from airflow.utils.sqlalchemy import UtcDateTime class DagWarning(Base): """ A table to store DAG warnings. DAG warnings are problems that don't rise to the level of failing the DAG parse but which users should nonetheless be warned about. These warnings are recorded when parsing DAG and displayed on the Webserver in a flash message. """ dag_id = Column(StringID(), primary_key=True) warning_type = Column(String(50), primary_key=True) message = Column(Text, nullable=False) timestamp = Column(UtcDateTime, nullable=False, default=timezone.utcnow) __tablename__ = "dag_warning" __table_args__ = ( ForeignKeyConstraint( ("dag_id",), ["dag.dag_id"], name="dcw_dag_id_fkey", ondelete="CASCADE", ), ) def __init__(self, dag_id: str, error_type: str, message: str, **kwargs): super().__init__(**kwargs) self.dag_id = dag_id self.warning_type = DagWarningType(error_type).value # make sure valid type self.message = message def __eq__(self, other) -> bool: return self.dag_id == other.dag_id and self.warning_type == other.warning_type def __hash__(self) -> int: return hash((self.dag_id, self.warning_type)) @classmethod @internal_api_call @provide_session def purge_inactive_dag_warnings(cls, session: Session = NEW_SESSION) -> None: """ Deactivate DagWarning records for inactive dags. :return: None """ cls._purge_inactive_dag_warnings_with_retry(session) @classmethod @retry_db_transaction def _purge_inactive_dag_warnings_with_retry(cls, session: Session) -> None: from airflow.models.dag import DagModel if session.get_bind().dialect.name == "sqlite": dag_ids = session.query(DagModel.dag_id).filter(DagModel.is_active == false()) query = session.query(cls).filter(cls.dag_id.in_(dag_ids)) else: query = session.query(cls).filter(cls.dag_id == DagModel.dag_id, DagModel.is_active == false()) query.delete(synchronize_session=False) session.commit() class DagWarningType(str, Enum): """ Enum for DAG warning types. This is the set of allowable values for the ``warning_type`` field in the DagWarning model. """ NONEXISTENT_POOL = "non-existent pool"
PypiClean
/invenio-rest-1.2.8.tar.gz/invenio-rest-1.2.8/invenio_rest/csrf.py
import re import secrets import string from datetime import datetime, timedelta, timezone from flask import Blueprint, abort, current_app, request from itsdangerous import BadSignature, SignatureExpired, \ TimedJSONWebSignatureSerializer from six import string_types from six.moves.urllib.parse import urlparse from .errors import RESTCSRFError REASON_NO_REFERER = "Referer checking failed - no Referer." REASON_BAD_REFERER = ( "Referer checking failed - %s does not match any trusted origins." ) REASON_NO_CSRF_COOKIE = "CSRF cookie not set." REASON_BAD_TOKEN = "CSRF token missing or incorrect." REASON_MALFORMED_REFERER = "Referer checking failed - Referer is malformed." REASON_INSECURE_REFERER = ( "Referer checking failed - Referer is insecure while host is secure." ) REASON_TOKEN_EXPIRED = "CSRF token expired. Try again." def _get_csrf_serializer(expires_in=None): """Note that this serializer is used to encode/decode the CSRF cookie. In case you change this implementation bear in mind that the token generated must be signed so as to avoid any client-side tampering. """ expires_in = expires_in or current_app.config['CSRF_TOKEN_EXPIRES_IN'] return TimedJSONWebSignatureSerializer( current_app.config.get( 'CSRF_SECRET', current_app.config.get('SECRET_KEY') or 'CHANGE_ME'), salt=current_app.config['CSRF_SECRET_SALT'], expires_in=expires_in, ) def _get_random_string(length, allowed_chars): return ''.join(secrets.choice(allowed_chars) for i in range(length)) def _get_new_csrf_token(expires_in=None): csrf_serializer = _get_csrf_serializer(expires_in=expires_in) encoded_token = csrf_serializer.dumps( _get_random_string( current_app.config['CSRF_TOKEN_LENGTH'], current_app.config['CSRF_ALLOWED_CHARS'], ) ) return encoded_token def _get_csrf_token(): try: csrf_cookie = request.cookies[ current_app.config['CSRF_COOKIE_NAME']] except KeyError: return None return _decode_csrf(csrf_cookie) def _decode_csrf(data): csrf_serializer = _get_csrf_serializer() try: return csrf_serializer.loads(data) except SignatureExpired as e: grace_period = timedelta( seconds=current_app.config['CSRF_TOKEN_GRACE_PERIOD']) # Because we support ItsDangerous 1.X and 2.X we need to compute the # appropriately-timezone-aware-or-naive datetime. See # https://github.com/pallets/itsdangerous/blob/1.0.x/src/itsdangerous/jws.py#L212 # noqa # https://github.com/pallets/itsdangerous/blob/2.0.x/src/itsdangerous/jws.py#L244 # noqa now = datetime.now(tz=timezone.utc) if e.date_signed.tzinfo else datetime.utcnow() # noqa if e.date_signed < now - grace_period: # Grace period for token rotation exceeded. _abort400(REASON_TOKEN_EXPIRED) else: # Accept expired token, but rotate it to a new one. reset_token() return e.payload except BadSignature: _abort400(REASON_BAD_TOKEN) def _set_token(response): response.set_cookie( current_app.config['CSRF_COOKIE_NAME'], _get_new_csrf_token(), max_age=current_app.config.get( # 1 week for cookie (but we rotate the token every day) 'CSRF_COOKIE_MAX_AGE', 60*60*24*7), domain=current_app.config.get( 'CSRF_COOKIE_DOMAIN', current_app.session_interface.get_cookie_domain( current_app)), path=current_app.session_interface.get_cookie_path( current_app), secure=current_app.config.get('SESSION_COOKIE_SECURE', True), httponly=False, samesite=current_app.config['CSRF_COOKIE_SAMESITE'], ) def _get_submitted_csrf_token(): header_name = current_app.config['CSRF_HEADER'] csrf_token = request.headers.get(header_name) if csrf_token: return csrf_token return None def _is_referer_secure(referer): return 'https' in referer.scheme or \ not current_app.config['CSRF_FORCE_SECURE_REFERER'] def _abort400(reason): abort(400, reason) def csrf_validate(): """Check CSRF cookie against request headers.""" if request.is_secure: referer = request.referrer if referer is None: return _abort400(REASON_NO_REFERER) referer = urlparse(referer) # Make sure we have a valid URL for Referer. if '' in (referer.scheme, referer.netloc): return _abort400(REASON_MALFORMED_REFERER) # Ensure that our Referer is also secure. if not _is_referer_secure(referer): return _abort400(REASON_INSECURE_REFERER) is_hostname_allowed = referer.hostname in \ current_app.config.get('APP_ALLOWED_HOSTS') if not is_hostname_allowed: reason = REASON_BAD_REFERER % referer.geturl() return _abort400(reason) csrf_token = _get_csrf_token() if csrf_token is None: return _abort400(REASON_NO_CSRF_COOKIE) request_csrf_token = _get_submitted_csrf_token() if not request_csrf_token: _abort400(REASON_BAD_TOKEN) decoded_request_csrf_token = _decode_csrf(request_csrf_token) if csrf_token != decoded_request_csrf_token: return _abort400(REASON_BAD_TOKEN) def reset_token(): """Change the CSRF token in use for a request.""" request.csrf_cookie_needs_reset = True class CSRFTokenMiddleware(): """CSRF Token Middleware.""" def __init__(self, app=None): """Middleware initialization. :param app: An instance of :class:`flask.Flask`. """ if app: self.init_app(app) def init_app(self, app): """Initialize middleware extension. :param app: An instance of :class:`flask.Flask`. """ app.config.setdefault('CSRF_COOKIE_NAME', 'csrftoken') app.config.setdefault('CSRF_HEADER', 'X-CSRFToken') app.config.setdefault( 'CSRF_METHODS', ['POST', 'PUT', 'PATCH', 'DELETE']) app.config.setdefault('CSRF_TOKEN_LENGTH', 32) app.config.setdefault( 'CSRF_ALLOWED_CHARS', string.ascii_letters + string.digits) app.config.setdefault('CSRF_SECRET_SALT', 'invenio-csrf-token') app.config.setdefault('CSRF_FORCE_SECURE_REFERER', True) app.config.setdefault( 'CSRF_COOKIE_SAMESITE', app.config.get('SESSION_COOKIE_SAMESITE') or 'Lax') # The token last for 24 hours, but the cookie for 7 days. This allows # us to implement transparent token rotation during those 7 days. Note, # that the token is automatically rotated on login, thus you can also # change PERMANENT_SESSION_LIFETIME app.config.setdefault('CSRF_TOKEN_EXPIRES_IN', 60*60*24) # We allow usage of an expired CSRF token during this period. This way # we can rotate the CSRF token without the user getting an CSRF error. # Align with CSRF_COOKIE_MAX_AGE app.config.setdefault('CSRF_TOKEN_GRACE_PERIOD', 60*60*24*7) @app.after_request def csrf_send(response): is_method_vulnerable = request.method in app.config['CSRF_METHODS'] cookie_needs_reset = getattr( request, 'csrf_cookie_needs_reset', False) cookie_is_missing = current_app.config['CSRF_COOKIE_NAME'] not in \ request.cookies if (is_method_vulnerable and cookie_is_missing) \ or cookie_needs_reset: _set_token(response) return response app.extensions['invenio-csrf'] = self class CSRFProtectMiddleware(CSRFTokenMiddleware): """CSRF Middleware.""" def __init__(self, app=None): """Middleware initialization. :param app: An instance of :class:`flask.Flask`. """ self._exempt_views = set() self._exempt_blueprints = set() self._before_protect_funcs = [] if app: self.init_app(app) def init_app(self, app): """Initialize middleware extension. :param app: An instance of :class:`flask.Flask`. """ super(CSRFProtectMiddleware, self).init_app(app) @app.before_request def csrf_protect(): """CSRF protect method.""" for func in self._before_protect_funcs: func() is_method_vulnerable = request.method in app.config['CSRF_METHODS'] if not is_method_vulnerable: return if request.blueprint in self._exempt_blueprints: return if hasattr(request, 'skip_csrf_check'): return view = app.view_functions.get(request.endpoint) if view: dest = '{0}.{1}'.format(view.__module__, view.__name__) if dest in self._exempt_views: return return csrf_validate() def before_csrf_protect(self, f): """Register functions to be invoked before checking csrf. The function accepts nothing as parameters. """ self._before_protect_funcs.append(f) return f def exempt(self, view): """Mark a view or blueprint to be excluded from CSRF protection.""" if isinstance(view, Blueprint): self._exempt_blueprints.add(view.name) return view if isinstance(view, string_types): view_location = view else: view_location = '.'.join((view.__module__, view.__name__)) self._exempt_views.add(view_location) return view csrf = CSRFProtectMiddleware()
PypiClean
/mendidenborak-2.0.0.tar.gz/mendidenborak-2.0.0/CONTRIBUTING.rst
.. highlight:: shell ============ Contributing ============ Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given. You can contribute in many ways: Types of Contributions ---------------------- Report Bugs ~~~~~~~~~~~ Report bugs at https://github.com/ionlizarazu/mendidenborak/issues. If you are reporting a bug, please include: * Your operating system name and version. * Any details about your local setup that might be helpful in troubleshooting. * Detailed steps to reproduce the bug. Fix Bugs ~~~~~~~~ Look through the GitHub issues for bugs. Anything tagged with "bug" and "help wanted" is open to whoever wants to implement it. Implement Features ~~~~~~~~~~~~~~~~~~ Look through the GitHub issues for features. Anything tagged with "enhancement" and "help wanted" is open to whoever wants to implement it. Write Documentation ~~~~~~~~~~~~~~~~~~~ mendidenborak could always use more documentation, whether as part of the official mendidenborak docs, in docstrings, or even on the web in blog posts, articles, and such. Submit Feedback ~~~~~~~~~~~~~~~ The best way to send feedback is to file an issue at https://github.com/ionlizarazu/mendidenborak/issues. If you are proposing a feature: * Explain in detail how it would work. * Keep the scope as narrow as possible, to make it easier to implement. * Remember that this is a volunteer-driven project, and that contributions are welcome :) Get Started! ------------ Ready to contribute? Here's how to set up `mendidenborak` for local development. 1. Fork the `mendidenborak` repo on GitHub. 2. Clone your fork locally:: $ git clone [email protected]:ionlizarazu/mendidenborak.git 3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development:: $ mkvirtualenv mendidenborak $ cd mendidenborak/ $ python setup.py develop 4. Create a branch for local development:: $ git checkout -b name-of-your-bugfix-or-feature Now you can make your changes locally. 5. When you're done making changes, check that your changes pass flake8 and the tests, including testing other Python versions with tox:: $ flake8 mendidenborak tests $ python setup.py test or pytest $ tox To get flake8 and tox, just pip install them into your virtualenv. 6. Commit your changes and push your branch to GitHub:: $ git add . $ git commit -m "Your detailed description of your changes." $ git push origin name-of-your-bugfix-or-feature 7. Submit a pull request through the GitHub website. Pull Request Guidelines ----------------------- Before you submit a pull request, check that it meets these guidelines: 1. The pull request should include tests. 2. If the pull request adds functionality, the docs should be updated. Put your new functionality into a function with a docstring, and add the feature to the list in README.rst. 3. The pull request should work for Python 3.5, 3.6, 3.7 and 3.8, and for PyPy. Check https://travis-ci.com/ionlizarazu/mendidenborak/pull_requests and make sure that the tests pass for all supported Python versions. Tips ---- To run a subset of tests:: $ python -m unittest tests.test_mendidenborak Deploying --------- A reminder for the maintainers on how to deploy. Make sure all your changes are committed (including an entry in HISTORY.rst). Then run:: $ bump2version patch # possible: major / minor / patch $ git push $ git push --tags Travis will then deploy to PyPI if tests pass.
PypiClean
/PyRlEnvs_andnp-2.0.1-py3-none-any.whl/PyRlEnvs/domains/Acrobot.py
import numpy as np from functools import partial from PyRlEnvs.Category import addToCategory from PyRlEnvs.utils.math import clip, try2jit, wrap from PyRlEnvs.utils.numerical import rungeKutta from PyRlEnvs.BaseEnvironment import BaseEnvironment from PyRlEnvs.utils.random import makeSampler, sampleDict, truncatedGaussian, uniform, gamma, gaussian @try2jit def _dsdt(l1: float, m1: float, m2: float, com1: float, com2: float, g: float, sa: np.ndarray, t: float): moi = 1. # moment of inertia a = sa[-1] theta1, theta2, dtheta1, dtheta2 = sa[:-1] d1: float = m1 * com1**2 + m2 * (l1**2 + com2**2 + 2 * l1 * com2 * np.cos(theta2)) + 2 * moi d2: float = m2 * (com2**2 + l1 * com2 * np.cos(theta2)) + moi phi2: float = m2 * com2 * g * np.cos(theta1 + theta2 - (np.pi / 2)) phi1: float = -m2 * l1 * com2 * dtheta2**2 * np.sin(theta2) - 2 * m2 * l1 * com2 * dtheta2 * dtheta1 * np.sin(theta2) + (m1 * com1 + m2 * l1) * g * np.cos(theta1 - (np.pi / 2)) + phi2 ddtheta2 = (a + d2 / d1 * phi1 - m2 * l1 * com2 * dtheta1**2 * np.sin(theta2) - phi2) / (m2 * com2**2 + moi - (d2**2 / d1)) ddtheta1 = -(d2 * ddtheta2 + phi1) / d1 return np.array([dtheta1, dtheta2, ddtheta1, ddtheta2, 0.]) @try2jit def _transform(s: np.ndarray) -> np.ndarray: theta1, theta2, dtheta1, dtheta2 = s return np.array([np.cos(theta1), np.sin(theta1), np.cos(theta2), np.sin(theta2), dtheta1, dtheta2]) @try2jit def _isTerminal(s: np.ndarray) -> bool: return -np.cos(s[0]) - np.cos(s[1] + s[0]) > 1. class Acrobot(BaseEnvironment): # ------------- # -- Physics -- # ------------- physical_constants = { 'gravity': 9.8, 'link1_length': 1., 'link1_mass': 1., 'link1_com': 0.5, # center of mass # link2 length is fixed 'link2_mass': 1., 'link2_com': 0.5 } per_step_constants = { 'dt': 0.2, 'force': 1.0, } randomized_constants = { 'gravity': makeSampler(lambda: truncatedGaussian(mean=9.8, stddev=2.0, mi=5.0, ma=13.8)), 'link1_length': makeSampler(lambda: uniform(0.75, 1.25)), 'link1_mass': makeSampler(lambda: uniform(0.75, 1.25)), 'link1_com': makeSampler(lambda: truncatedGaussian(mean=0.5, stddev=0.1, mi=0.3, ma=0.7)), # link2 length is fixed 'link2_mass': makeSampler(lambda: uniform(0.75, 1.25)), 'link2_com': makeSampler(lambda: truncatedGaussian(mean=0.5, stddev=0.1, mi=0.3, ma=0.7)), } per_step_random_constants = { # use clipped gaussian to enforce a lower-bound constraint on how fast we can sample # realistically, we can see very long delays but we can never sample faster than the equipment allows 'dt': makeSampler(lambda: 0.99 * truncatedGaussian(mean=0.2, stddev=0.02, mi=0.125) + 0.01 * gamma(shape=0.1, scale=2.0)), # note this isn't clipped, force can flip signs with low probability 'force': makeSampler(lambda: gaussian(1.0, 0.5)), } def __init__(self, random_init: bool = False, seed: int = 0): super().__init__(seed) self.random_init = random_init self._state = np.zeros(4) self.start_rng = np.random.default_rng(seed) if random_init: self.physical_constants = sampleDict(self.randomized_constants, self.rng) self._dsdt = partial(_dsdt, self.physical_constants['link1_length'], self.physical_constants['link1_mass'], self.physical_constants['link2_mass'], self.physical_constants['link1_com'], self.physical_constants['link2_com'], self.physical_constants['gravity'], ) # ------------------------- # -- Dynamics equations -- # ------------------------- def nextState(self, s: np.ndarray, a: float): dt = self.per_step_constants['dt'] force = self.per_step_constants['force'] a = (a - 1.) * force sa = np.append(s, a) spa = rungeKutta(self._dsdt, sa, np.array([0, dt])) # only need the last result of the integration spa = spa[-1] sp = spa[:-1] ma_vel1 = 4 * np.pi ma_vel2 = 9 * np.pi sp[0] = wrap(sp[0], -np.pi, np.pi) sp[1] = wrap(sp[1], -np.pi, np.pi) sp[2] = clip(sp[2], -ma_vel1, ma_vel1) sp[3] = clip(sp[3], -ma_vel2, ma_vel2) return sp def actions(self, s: np.ndarray): return [0, 1, 2] def reward(self, s: np.ndarray, a: float, sp: np.ndarray): return -1. if not self.terminal(s, a, sp) else 0. def terminal(self, s: np.ndarray, a: float, sp: np.ndarray): return _isTerminal(sp) # ------------------------ # -- Stateful functions -- # ------------------------ def start(self): start = self.start_rng.uniform(-.1, .1, size=4) self._state = start return _transform(start) def step(self, action: float): sp = self.nextState(self._state, action) r = self.reward(self._state, action, sp) t = self.terminal(self._state, action, sp) self._state = sp gamma = 0.0 if t else 1.0 return (r, _transform(sp), t, {'gamma': gamma}) def setState(self, state: np.ndarray): self._state = state.copy() def copy(self): m = Acrobot(random_init=self.random_init, seed=self._seed) m._state = self._state.copy() m.physical_constants = self.physical_constants m.per_step_constants = self.per_step_constants # copy derivative function because state variables changed m._dsdt = self._dsdt return m class StochasticAcrobot(Acrobot): def __init__(self, random_init: bool = True, seed: int = 0): super().__init__(random_init, seed=seed) addToCategory('classic-control', Acrobot) addToCategory('stochastic', StochasticAcrobot)
PypiClean
/utils_nm-1.0.12.tar.gz/utils_nm-1.0.12/src/utils_nm/orm_models.py
import sqlalchemy as sa from sqlalchemy.orm import Session from sqlalchemy.orm.attributes import InstrumentedAttribute # ______________________________________________________________________________________________________________________ Base = sa.orm.declarative_base() class BaseClass: """ Base class which implements general functionality """ @classmethod def set_table_attribute(cls, attr_name: str, attr_value: object) -> None: """ sets the attribute for the table, e.g. 'schema' = 'job' or 'name' = 'job_exec' Args: attr_name: the name of the table attribute attr_value: the value to be set for the attribute Returns: None """ setattr(cls.__table__, attr_name, attr_value) return None @classmethod def create_table(cls, engine: sa.engine.Engine, recreate: bool = False) -> None: """ creates a job execution information table. Only use once! Args: engine: the sqlalchemy engine to the database recreate: if true drop the existing table and recreate it Returns: Creates the specified table and returns None """ if recreate: cls.__table__.drop(engine, checkfirst=True) cls.__table__.create(engine, checkfirst=True) return None @classmethod def select_all(cls, engine: sa.engine.Engine) -> list[object]: """ retrieves all rows as orm instances to a list Args: engine: the sqlalchemy engine used to connect to the database Returns: list of all object instances """ with Session(engine) as session: session.expire_on_commit = False # keep the instance accessible after session closes stmt = sa.select(cls) rows = session.execute(stmt).all() session.commit() rows = [r[0] for r in rows] return rows @classmethod def select_filtered(cls, engine: sa.engine.Engine, verbose: bool = False, **kwargs) -> list[object]: """ retrieves filtered rows as orm instances to a list Args: engine: the sqlalchemy engine used to connect to the database verbose: if true print the generated sql statement **kwargs: the key value pairs corresponding to table colum and colum value to filter Returns: filtered list of object instances """ with Session(engine) as session: session.expire_on_commit = False # keep the instance accessible after session closes stmt = sa.select(cls).filter_by(**kwargs) if verbose: print(stmt) rows = session.execute(stmt).all() session.commit() rows = [r[0] for r in rows] return rows def add(self, engine: sa.engine.Engine) -> object: """ writes the current instance to the database Args: engine: the sqlalchemy engine used to connect to the database Returns: self """ with Session(engine) as session: session.expire_on_commit = False # keep the instance accessible after session closes if self.id is None: session.add(self) session.commit() return self def update(self, engine: sa.engine.Engine) -> None: """ updates the current instance to the database Args: engine: the sqlalchemy engine used to connect to the database Returns: None """ with Session(engine) as session: session.expire_on_commit = False # keep the instance accessible after session closes mapped_values = {} primary_keys = [element.name for element in self.__class__.__table__.primary_key] for key, value in self.__class__.__dict__.items(): if isinstance(value, InstrumentedAttribute) and key not in primary_keys: mapped_values[key] = getattr(self, key) session.query(self.__class__).filter(self.__class__.id == self.id).update(mapped_values) session.commit() return None # ______________________________________________________________________________________________________________________ class JobExec(Base, BaseClass): """ ORM model for the job_execution table """ __tablename__ = 'job_execution' __table_args__ = {'schema': None} id = sa.Column(sa.Integer, sa.Identity(start=1, cycle=True), primary_key=True) name = sa.Column(sa.String(255), nullable=False) start_time = sa.Column(sa.DateTime, nullable=False) end_time = sa.Column(sa.DateTime, nullable=True) status = sa.Column(sa.String(255), nullable=True) running = sa.Column(sa.Boolean, nullable=False) executor = sa.Column(sa.String(31), nullable=False) exception = sa.Column(sa.String(255), nullable=True) log_file = sa.Column(sa.String(255), nullable=True) def __repr__(self): return f'JobExec(id={self.id}, name={self.name}, start_time={self.start_time}, status={self.status})' # ______________________________________________________________________________________________________________________ class JobSchedule(Base, BaseClass): """ ORM model for the job_schedule table """ __tablename__ = 'job_schedule' __table_args__ = {'schema': None} id = sa.Column(sa.Integer, sa.Identity(start=1, cycle=True), primary_key=True) name = sa.Column(sa.String(255), nullable=False) location = sa.Column(sa.String(255), nullable=False) args = sa.Column(sa.String(255), nullable=False) env = sa.Column(sa.String(255), nullable=False) schedule = sa.Column(sa.String(255), nullable=False) priority = sa.Column(sa.SmallInteger, nullable=True) active = sa.Column(sa.Boolean, default=True, nullable=False) def __repr__(self): schedule = zip(self.schedule.split(), ['minute', 'hour', 'day', 'month', 'weekday']) schedule = ', '.join([f'{j}={i}' for i, j in schedule]) return f'JobSchedule(id={self.id}, name={self.name}, args={self.args}, schedule=[{schedule}])' # ______________________________________________________________________________________________________________________
PypiClean
/netbox_lists-3.1.1-py3-none-any.whl/netbox_lists/api/utils.py
import itertools from typing import Any, Iterable, List, Union from django.conf import settings from django.db.models import Q from django.db.models.query import QuerySet from django_filters import FilterSet from django_filters.utils import translate_validation from netaddr import cidr_merge, IPNetwork, iprange_to_cidrs from rest_framework.exceptions import ValidationError from rest_framework.request import Request from rest_framework.response import Response from taggit.managers import _TaggableManager from .constants import AS_CIDR_PARAM_NAME, FAMILY_PARAM_NAME, SUMMARIZE_PARAM_NAME def make_ip_list_response( networks: Iterable[IPNetwork], summarize: bool, use_net_ip: bool = False, ) -> Response: ret: Iterable[str] if summarize is True: if use_net_ip is True: ret = (str(i) for i in cidr_merge([network.ip for network in networks])) else: ret = (str(i) for i in cidr_merge([str(i) for i in networks])) elif use_net_ip is True: ret = set(str(i.ip) for i in networks) else: ret = set(str(i) for i in networks) return Response(ret) def set_prefixlen_max(ipn: IPNetwork) -> IPNetwork: ipn.prefixlen = 32 if ipn.version == 4 else 128 return ipn def device_vm_primary_list( qs: QuerySet[Any], family: Union[int, None] ) -> Iterable[IPNetwork]: if family is None: queryset = qs.filter( Q(primary_ip4__isnull=False) | Q(primary_ip6__isnull=False) ) retindex = -1 elif family == 4: queryset = qs.filter(primary_ip4__isnull=False) retindex = 0 else: queryset = qs.filter(primary_ip6__isnull=False) retindex = 1 queryset = queryset.values_list("primary_ip4__address", "primary_ip6__address") if retindex >= 0: return (set_prefixlen_max(i[retindex]) for i in queryset) else: return ( set_prefixlen_max(i) for i in itertools.chain.from_iterable(queryset) if i ) def services_primary_ips( qs: QuerySet[Any], family: Union[int, None] ) -> Iterable[IPNetwork]: family_filter = Q() values: List[str] = [] if family == 4 or family is None: family_filter |= Q(device__primary_ip4__isnull=False) | Q( virtual_machine__primary_ip4__isnull=False ) values.extend( [ "device__primary_ip4__address", "virtual_machine__primary_ip4__address", ] ) if family == 6 or family is None: family_filter |= Q(device__primary_ip6__isnull=False) | Q( virtual_machine__primary_ip6__isnull=False ) values.extend( [ "device__primary_ip6__address", "virtual_machine__primary_ip6__address", ] ) qs = qs.filter(Q(ipaddresses__isnull=True), family_filter).values_list(*values) return (set_prefixlen_max(i) for i in itertools.chain.from_iterable(qs) if i) def services_assigned_ips( qs: QuerySet[Any], family: Union[int, None] ) -> Iterable[IPNetwork]: if family is None: family_filter = Q() elif family == 4: family_filter = Q(ipaddresses__address__family=4) else: family_filter = Q(ipaddresses__address__family=6) return ( qs.filter(Q(ipaddresses__isnull=False), family_filter) .values_list("ipaddresses__address", flat=True) .distinct() ) def get_service_ips( qs: QuerySet[Any], family: Union[int, None], include_primaries: bool ) -> Iterable[IPNetwork]: iterables: List[Iterable[IPNetwork]] = [services_assigned_ips(qs, family)] if include_primaries is True: iterables.append(services_primary_ips(qs, family)) return (set_prefixlen_max(i) for i in itertools.chain.from_iterable(iterables)) def get_svc_primary_ips_param(param: str, req: Request) -> bool: val = req.query_params.get(param, None) if val is None: return settings.PLUGINS_CONFIG["netbox_lists"]["service_primary_ips"] elif val.lower() == "true": return True elif val.lower() == "false": return False else: raise ValidationError(f"{param} must be true or false.") def get_family_param(req: Request) -> Union[int, None]: """ Raises a ValidationError if family is not '4' or '6'. """ val = req.query_params.get(FAMILY_PARAM_NAME, None) if val is not None and val not in ["4", "6"]: raise ValidationError("Family must be 4 or 6.") elif val is None: return None else: return int(val) def get_as_cidr_param(req: Request) -> bool: val = req.query_params.get(AS_CIDR_PARAM_NAME, None) if val is None: return settings.PLUGINS_CONFIG["netbox_lists"].get("as_cidr", True) elif val.lower() == "true": return True elif val.lower() == "false": return False else: raise ValidationError("as_cidr must be true or false.") def get_summarize_param(req: Request) -> bool: val = req.query_params.get(SUMMARIZE_PARAM_NAME, None) if val is None: return settings.PLUGINS_CONFIG["netbox_lists"].get("summarize", True) elif val.lower() == "true": return True elif val.lower() == "false": return False else: raise ValidationError("summarize must be true or false.") def ip_range_prefixes(start: IPNetwork, end: IPNetwork) -> List[IPNetwork]: return iprange_to_cidrs(start.ip, end.ip) def _json_rep(obj: Any) -> Union[str, int, bool, list, dict, None]: """Return a JSON serializable representation""" if isinstance(obj, (str, int, bool)) or obj is None: return obj elif isinstance(obj, list): return [_json_rep(o) for o in obj] elif isinstance(obj, dict): return {str(k): _json_rep(v) for k, v in obj.items()} elif isinstance(obj, _TaggableManager): return list(obj.slugs()) else: return str(obj) def get_attr(attrs: Iterable[str], obj: Any) -> Any: for a in attrs: if obj is None: return None elif isinstance(obj, dict): obj = obj.get(a) else: obj = getattr(obj, a, None) return obj def get_attr_str(attrs: Iterable[str], obj: Any) -> str: val = get_attr(attrs, obj) if val is None: return "" return str(val) def get_attr_json(attrs: Iterable[str], obj: Any) -> Any: return _json_rep(get_attr(attrs, obj)) def filter_queryset(filterset: FilterSet) -> QuerySet: if not filterset.is_valid(): raise translate_validation(filterset.errors) return filterset.qs
PypiClean
/sagemath-standard-10.0b0.tar.gz/sagemath-standard-10.0b0/sage/schemes/elliptic_curves/period_lattice.py
r""" Period lattices of elliptic curves and related functions Let `E` be an elliptic curve defined over a number field `K` (including `\QQ`). We attach a period lattice (a discrete rank 2 subgroup of `\CC`) to each embedding of `K` into `\CC`. In the case of real embeddings, the lattice is stable under complex conjugation and is called a real lattice. These have two types: rectangular, (the real curve has two connected components and positive discriminant) or non-rectangular (one connected component, negative discriminant). The periods are computed to arbitrary precision using the AGM (Gauss's Arithmetic-Geometric Mean). EXAMPLES:: sage: K.<a> = NumberField(x^3-2) sage: E = EllipticCurve([0,1,0,a,a]) First we try a real embedding:: sage: emb = K.embeddings(RealField())[0] sage: L = E.period_lattice(emb); L Period lattice associated to Elliptic Curve defined by y^2 = x^3 + x^2 + a*x + a over Number Field in a with defining polynomial x^3 - 2 with respect to the embedding Ring morphism: From: Number Field in a with defining polynomial x^3 - 2 To: Algebraic Real Field Defn: a |--> 1.259921049894873? The first basis period is real:: sage: L.basis() (3.81452977217855, 1.90726488608927 + 1.34047785962440*I) sage: L.is_real() True For a basis `\omega_1,\omega_2` normalised so that `\omega_1/\omega_2` is in the fundamental region of the upper half-plane, use the function ``normalised_basis()`` instead:: sage: L.normalised_basis() (1.90726488608927 - 1.34047785962440*I, -1.90726488608927 - 1.34047785962440*I) Next a complex embedding:: sage: emb = K.embeddings(ComplexField())[0] sage: L = E.period_lattice(emb); L Period lattice associated to Elliptic Curve defined by y^2 = x^3 + x^2 + a*x + a over Number Field in a with defining polynomial x^3 - 2 with respect to the embedding Ring morphism: From: Number Field in a with defining polynomial x^3 - 2 To: Algebraic Field Defn: a |--> -0.6299605249474365? - 1.091123635971722?*I In this case, the basis `\omega_1`, `\omega_2` is always normalised so that `\tau = \omega_1/\omega_2` is in the fundamental region in the upper half plane:: sage: w1,w2 = L.basis(); w1,w2 (-1.37588604166076 - 2.58560946624443*I, -2.10339907847356 + 0.428378776460622*I) sage: L.is_real() False sage: tau = w1/w2; tau 0.387694505032876 + 1.30821088214407*I sage: L.normalised_basis() (-1.37588604166076 - 2.58560946624443*I, -2.10339907847356 + 0.428378776460622*I) We test that bug :trac:`8415` (caused by a PARI bug fixed in v2.3.5) is OK:: sage: E = EllipticCurve('37a') sage: K.<a> = QuadraticField(-7) sage: EK = E.change_ring(K) sage: EK.period_lattice(K.complex_embeddings()[0]) Period lattice associated to Elliptic Curve defined by y^2 + y = x^3 + (-1)*x over Number Field in a with defining polynomial x^2 + 7 with a = 2.645751311064591?*I with respect to the embedding Ring morphism: From: Number Field in a with defining polynomial x^2 + 7 with a = 2.645751311064591?*I To: Algebraic Field Defn: a |--> -2.645751311064591?*I REFERENCES: - [CT2013]_ AUTHORS: - ?: initial version. - John Cremona: - Adapted to handle real embeddings of number fields, September 2008. - Added basis_matrix function, November 2008 - Added support for complex embeddings, May 2009. - Added complex elliptic logs, March 2010; enhanced, October 2010. """ from sage.modules.free_module import FreeModule_generic_pid from sage.rings.all import ZZ, QQ, RealField, ComplexField, QQbar, AA import sage.rings.abc from sage.rings.complex_mpfr import ComplexNumber from sage.rings.real_mpfr import RealNumber as RealNumber from sage.rings.number_field.number_field import refine_embedding from sage.rings.infinity import Infinity from sage.schemes.elliptic_curves.constructor import EllipticCurve from sage.misc.cachefunc import cached_method from sage.structure.richcmp import richcmp_method, richcmp, richcmp_not_equal from sage.libs.pari.all import pari class PeriodLattice(FreeModule_generic_pid): """ The class for the period lattice of an algebraic variety. """ pass @richcmp_method class PeriodLattice_ell(PeriodLattice): r""" The class for the period lattice of an elliptic curve. Currently supported are elliptic curves defined over `\QQ`, and elliptic curves defined over a number field with a real or complex embedding, where the lattice constructed depends on that embedding. """ def __init__(self, E, embedding=None): r""" Initialises the period lattice by storing the elliptic curve and the embedding. INPUT: - ``E`` -- an elliptic curve - ``embedding`` (default: ``None``) -- an embedding of the base field `K` of ``E`` into a real or complex field. If ``None``: - use the built-in coercion to `\RR` for `K=\QQ`; - use the first embedding into `\RR` given by ``K.embeddings(RealField())``, if there are any; - use the first embedding into `\CC` given by ``K.embeddings(ComplexField())``, if `K` is totally complex. .. NOTE:: No periods are computed on creation of the lattice; see the functions ``basis()``, ``normalised_basis()`` and ``real_period()`` for precision setting. EXAMPLES: This function is not normally called directly, but will be called by the period_lattice() function of classes ell_number_field and ell_rational_field:: sage: from sage.schemes.elliptic_curves.period_lattice import PeriodLattice_ell sage: E = EllipticCurve('37a') sage: PeriodLattice_ell(E) Period lattice associated to Elliptic Curve defined by y^2 + y = x^3 - x over Rational Field :: sage: K.<a> = NumberField(x^3-2) sage: emb = K.embeddings(RealField())[0] sage: E = EllipticCurve([0,1,0,a,a]) sage: L = PeriodLattice_ell(E,emb); L Period lattice associated to Elliptic Curve defined by y^2 = x^3 + x^2 + a*x + a over Number Field in a with defining polynomial x^3 - 2 with respect to the embedding Ring morphism: From: Number Field in a with defining polynomial x^3 - 2 To: Algebraic Real Field Defn: a |--> 1.259921049894873? sage: emb = K.embeddings(ComplexField())[0] sage: L = PeriodLattice_ell(E,emb); L Period lattice associated to Elliptic Curve defined by y^2 = x^3 + x^2 + a*x + a over Number Field in a with defining polynomial x^3 - 2 with respect to the embedding Ring morphism: From: Number Field in a with defining polynomial x^3 - 2 To: Algebraic Field Defn: a |--> -0.6299605249474365? - 1.091123635971722?*I TESTS:: sage: from sage.schemes.elliptic_curves.period_lattice import PeriodLattice_ell sage: K.<a> = NumberField(x^3-2) sage: emb = K.embeddings(RealField())[0] sage: E = EllipticCurve([0,1,0,a,a]) sage: L = PeriodLattice_ell(E,emb) sage: L == loads(dumps(L)) True """ # First we cache the elliptic curve with this period lattice: self.E = E # Next we cache the embedding into QQbar or AA which extends # the given embedding: K = E.base_field() if embedding is None: embs = K.embeddings(AA) real = len(embs) > 0 if not real: embs = K.embeddings(QQbar) embedding = embs[0] else: embedding = refine_embedding(embedding, Infinity) real = embedding(K.gen()).imag().is_zero() self.embedding = embedding # Next we compute and cache (in self.real_flag) the type of # the lattice: +1 for real rectangular, -1 for real # non-rectangular, 0 for non-real: self.real_flag = 0 if real: self.real_flag = +1 if embedding(E.discriminant())<0: self.real_flag = -1 # The following algebraic data associated to E and the # embedding is cached: # # Ebar: the curve E base-changed to QQbar (or AA) # f2: the 2-division polynomial of Ebar # ei: the roots e1, e2, e3 of f2, as elements of QQbar (or AA) # # The ei are used both for period computation and elliptic # logarithms. self.Ebar = self.E.change_ring(self.embedding) self.f2 = self.Ebar.two_division_polynomial() if self.real_flag == 1: # positive discriminant self._ei = self.f2.roots(AA,multiplicities=False) self._ei.sort() # e1 < e2 < e3 e1, e2, e3 = self._ei elif self.real_flag == -1: # negative discriminant self._ei = self.f2.roots(QQbar, multiplicities=False) self._ei = sorted(self._ei, key=lambda z: z.imag()) e1, e3, e2 = self._ei # so e3 is real e3 = AA(e3) self._ei = [e1, e2, e3] else: self._ei = self.f2.roots(QQbar, multiplicities=False) e1, e2, e3 = self._ei # The quantities sqrt(e_i-e_j) are cached (as elements of # QQbar) to be used in period computations: self._abc = (e3-e1).sqrt(), (e3-e2).sqrt(), (e2-e1).sqrt() PeriodLattice.__init__(self, base_ring=ZZ, rank=2, degree=1, sparse=False) def __richcmp__(self, other, op): r""" Comparison function for period lattices TESTS:: sage: from sage.schemes.elliptic_curves.period_lattice import PeriodLattice_ell sage: K.<a> = NumberField(x^3-2) sage: E = EllipticCurve([0,1,0,a,a]) sage: embs = K.embeddings(ComplexField()) sage: L1,L2,L3 = [PeriodLattice_ell(E,e) for e in embs] sage: L1 < L2 < L3 True """ if not isinstance(other, PeriodLattice_ell): return NotImplemented lx = self.E rx = other.E if lx != rx: return richcmp_not_equal(lx, rx, op) a = self.E.base_field().gen() return richcmp(self.embedding(a), other.embedding(a), op) def __repr__(self): """ Return the string representation of this period lattice. EXAMPLES:: sage: E = EllipticCurve('37a') sage: E.period_lattice() Period lattice associated to Elliptic Curve defined by y^2 + y = x^3 - x over Rational Field :: sage: K.<a> = NumberField(x^3-2) sage: emb = K.embeddings(RealField())[0] sage: E = EllipticCurve([0,1,0,a,a]) sage: L = E.period_lattice(emb); L Period lattice associated to Elliptic Curve defined by y^2 = x^3 + x^2 + a*x + a over Number Field in a with defining polynomial x^3 - 2 with respect to the embedding Ring morphism: From: Number Field in a with defining polynomial x^3 - 2 To: Algebraic Real Field Defn: a |--> 1.259921049894873? """ if self.E.base_field() is QQ: return "Period lattice associated to %s"%(self.E) else: return "Period lattice associated to %s with respect to the embedding %s"%(self.E, self.embedding) def __call__(self, P, prec=None): r""" Return the elliptic logarithm of a point `P`. INPUT: - ``P`` (point) -- a point on the elliptic curve associated with this period lattice. - ``prec`` (default: ``None``) -- precision in bits (default precision if ``None``). OUTPUT: (complex number) The elliptic logarithm of the point `P` with respect to this period lattice. If `E` is the elliptic curve and `\sigma:K\to\CC` the embedding, then the returned value `z` is such that `z\pmod{L}` maps to `\sigma(P)` under the standard Weierstrass isomorphism from `\CC/L` to `\sigma(E)`. EXAMPLES:: sage: E = EllipticCurve('389a') sage: L = E.period_lattice() sage: E.discriminant() > 0 True sage: L.real_flag 1 sage: P = E([-1,1]) sage: P.is_on_identity_component () False sage: L(P, prec=96) 0.4793482501902193161295330101 + 0.985868850775824102211203849...*I sage: Q=E([3,5]) sage: Q.is_on_identity_component() True sage: L(Q, prec=96) 1.931128271542559442488585220 Note that this is actually the inverse of the Weierstrass isomorphism:: sage: L.elliptic_exponential(L(Q)) (3.00000000000000 : 5.00000000000000 : 1.00000000000000) An example with negative discriminant, and a torsion point:: sage: E = EllipticCurve('11a1') sage: L = E.period_lattice() sage: E.discriminant() < 0 True sage: L.real_flag -1 sage: P = E([16,-61]) sage: L(P) 0.253841860855911 sage: L.real_period() / L(P) 5.00000000000000 """ return self.elliptic_logarithm(P,prec) @cached_method def basis(self, prec=None, algorithm='sage'): r""" Return a basis for this period lattice as a 2-tuple. INPUT: - ``prec`` (default: ``None``) -- precision in bits (default precision if ``None``). - ``algorithm`` (string, default 'sage') -- choice of implementation (for real embeddings only) between 'sage' (native Sage implementation) or 'pari' (use the PARI library: only available for real embeddings). OUTPUT: (tuple of Complex) `(\omega_1,\omega_2)` where the lattice is `\ZZ\omega_1 + \ZZ\omega_2`. If the lattice is real then `\omega_1` is real and positive, `\Im(\omega_2)>0` and `\Re(\omega_1/\omega_2)` is either `0` (for rectangular lattices) or `\frac{1}{2}` (for non-rectangular lattices). Otherwise, `\omega_1/\omega_2` is in the fundamental region of the upper half-plane. If the latter normalisation is required for real lattices, use the function ``normalised_basis()`` instead. EXAMPLES:: sage: E = EllipticCurve('37a') sage: E.period_lattice().basis() (2.99345864623196, 2.45138938198679*I) This shows that the issue reported at :trac:`3954` is fixed:: sage: E = EllipticCurve('37a') sage: b1 = E.period_lattice().basis(prec=30) sage: b2 = E.period_lattice().basis(prec=30) sage: b1 == b2 True This shows that the issue reported at :trac:`4064` is fixed:: sage: E = EllipticCurve('37a') sage: E.period_lattice().basis(prec=30)[0].parent() Real Field with 30 bits of precision sage: E.period_lattice().basis(prec=100)[0].parent() Real Field with 100 bits of precision :: sage: K.<a> = NumberField(x^3-2) sage: emb = K.embeddings(RealField())[0] sage: E = EllipticCurve([0,1,0,a,a]) sage: L = E.period_lattice(emb) sage: L.basis(64) (3.81452977217854509, 1.90726488608927255 + 1.34047785962440202*I) sage: emb = K.embeddings(ComplexField())[0] sage: L = E.period_lattice(emb) sage: w1,w2 = L.basis(); w1,w2 (-1.37588604166076 - 2.58560946624443*I, -2.10339907847356 + 0.428378776460622*I) sage: L.is_real() False sage: tau = w1/w2; tau 0.387694505032876 + 1.30821088214407*I """ # We divide into two cases: (1) Q, or a number field with a # real embedding; (2) a number field with a complex embedding. # In each case the periods are computed by a different # internal function. if self.is_real(): return self._compute_periods_real(prec=prec, algorithm=algorithm) else: return self._compute_periods_complex(prec=prec) @cached_method def gens(self, prec=None, algorithm='sage'): r""" Return a basis for this period lattice as a 2-tuple. This is an alias for :meth:`~sage.schemes.elliptic_curves.period_lattice.PeriodLattice_ell.basis`. See the docstring there for a more in-depth explanation and further examples. INPUT: - ``prec`` (default: ``None``) -- precision in bits (default precision if ``None``). - ``algorithm`` (string, default 'sage') -- choice of implementation (for real embeddings only) between 'sage' (native Sage implementation) or 'pari' (use the PARI library: only available for real embeddings). OUTPUT: (tuple of Complex) `(\omega_1,\omega_2)` where the lattice is `\ZZ\omega_1 + \ZZ\omega_2`. If the lattice is real then `\omega_1` is real and positive, `\Im(\omega_2)>0` and `\Re(\omega_1/\omega_2)` is either `0` (for rectangular lattices) or `\frac{1}{2}` (for non-rectangular lattices). Otherwise, `\omega_1/\omega_2` is in the fundamental region of the upper half-plane. If the latter normalisation is required for real lattices, use the function ``normalised_basis()`` instead. EXAMPLES:: sage: E = EllipticCurve('37a') sage: E.period_lattice().gens() (2.99345864623196, 2.45138938198679*I) sage: E.period_lattice().gens(prec = 100) (2.9934586462319596298320099794, 2.4513893819867900608542248319*I) """ return tuple(self.basis(prec=prec, algorithm=algorithm)) @cached_method def normalised_basis(self, prec=None, algorithm='sage'): r""" Return a normalised basis for this period lattice as a 2-tuple. INPUT: - ``prec`` (default: ``None``) -- precision in bits (default precision if ``None``). - ``algorithm`` (string, default 'sage') -- choice of implementation (for real embeddings only) between 'sage' (native Sage implementation) or 'pari' (use the PARI library: only available for real embeddings). OUTPUT: (tuple of Complex) `(\omega_1,\omega_2)` where the lattice has the form `\ZZ\omega_1 + \ZZ\omega_2`. The basis is normalised so that `\omega_1/\omega_2` is in the fundamental region of the upper half-plane. For an alternative normalisation for real lattices (with the first period real), use the function basis() instead. EXAMPLES:: sage: E = EllipticCurve('37a') sage: E.period_lattice().normalised_basis() (2.99345864623196, -2.45138938198679*I) :: sage: K.<a> = NumberField(x^3-2) sage: emb = K.embeddings(RealField())[0] sage: E = EllipticCurve([0,1,0,a,a]) sage: L = E.period_lattice(emb) sage: L.normalised_basis(64) (1.90726488608927255 - 1.34047785962440202*I, -1.90726488608927255 - 1.34047785962440202*I) sage: emb = K.embeddings(ComplexField())[0] sage: L = E.period_lattice(emb) sage: w1,w2 = L.normalised_basis(); w1,w2 (-1.37588604166076 - 2.58560946624443*I, -2.10339907847356 + 0.428378776460622*I) sage: L.is_real() False sage: tau = w1/w2; tau 0.387694505032876 + 1.30821088214407*I """ w1, w2 = self.basis(prec=prec, algorithm=algorithm) periods, _ = normalise_periods(w1, w2) return periods @cached_method def tau(self, prec=None, algorithm='sage'): r""" Return the upper half-plane parameter in the fundamental region. INPUT: - ``prec`` (default: ``None``) -- precision in bits (default precision if ``None``). - ``algorithm`` (string, default 'sage') -- choice of implementation (for real embeddings only) between 'sage' (native Sage implementation) or 'pari' (use the PARI library: only available for real embeddings). OUTPUT: (Complex) `\tau = \omega_1/\omega_2` where the lattice has the form `\ZZ\omega_1 + \ZZ\omega_2`, normalised so that `\tau = \omega_1/\omega_2` is in the fundamental region of the upper half-plane. EXAMPLES:: sage: E = EllipticCurve('37a') sage: L = E.period_lattice() sage: L.tau() 1.22112736076463*I :: sage: K.<a> = NumberField(x^3-2) sage: emb = K.embeddings(RealField())[0] sage: E = EllipticCurve([0,1,0,a,a]) sage: L = E.period_lattice(emb) sage: tau = L.tau(); tau -0.338718341018919 + 0.940887817679340*I sage: tau.abs() 1.00000000000000 sage: -0.5 <= tau.real() <= 0.5 True sage: emb = K.embeddings(ComplexField())[0] sage: L = E.period_lattice(emb) sage: tau = L.tau(); tau 0.387694505032876 + 1.30821088214407*I sage: tau.abs() 1.36444961115933 sage: -0.5 <= tau.real() <= 0.5 True """ w1, w2 = self.normalised_basis(prec=prec, algorithm=algorithm) return w1/w2 @cached_method def _compute_periods_real(self, prec=None, algorithm='sage'): r""" Internal function to compute the periods (real embedding case). INPUT: - `prec` (int or ``None`` (default)) -- floating point precision (in bits); if None, use the default precision. - `algorithm` (string, default 'sage') -- choice of implementation between - `pari`: use the PARI library - `sage`: use a native Sage implementation (with the same underlying algorithm). OUTPUT: (tuple of Complex) `(\omega_1,\omega_2)` where the lattice has the form `\ZZ\omega_1 + \ZZ\omega_2`, `\omega_1` is real and `\omega_1/\omega_2` has real part either `0` or `frac{1}{2}`. EXAMPLES:: sage: K.<a> = NumberField(x^3-2) sage: E = EllipticCurve([0,1,0,a,a]) sage: embs = K.embeddings(CC) sage: Ls = [E.period_lattice(e) for e in embs] sage: [L.is_real() for L in Ls] [False, False, True] sage: Ls[2]._compute_periods_real(100) (3.8145297721785450936365098936, 1.9072648860892725468182549468 + 1.3404778596244020196600112394*I) sage: Ls[2]._compute_periods_real(100, algorithm='pari') (3.8145297721785450936365098936, 1.9072648860892725468182549468 - 1.3404778596244020196600112394*I) """ if prec is None: prec = 53 R = RealField(prec) C = ComplexField(prec) if algorithm == 'pari': ainvs = self.E.a_invariants() if self.E.base_field() is not QQ: ainvs = [C(self.embedding(ai)).real() for ai in ainvs] # The precision for omega() is determined by ellinit() E_pari = pari.ellinit(ainvs, precision=prec) w1, w2 = E_pari.omega() return R(w1), C(w2) if algorithm!='sage': raise ValueError("invalid value of 'algorithm' parameter") pi = R.pi() # Up to now everything has been exact in AA or QQbar, but now # we must go transcendental. Only now is the desired # precision used! if self.real_flag == 1: # positive discriminant a, b, c = (R(x) for x in self._abc) w1 = R(pi/a.agm(b)) # least real period w2 = C(0,pi/a.agm(c)) # least pure imaginary period else: a = C(self._abc[0]) x, y, r = a.real().abs(), a.imag().abs(), a.abs() w1 = R(pi/r.agm(x)) # least real period w2 = R(pi/r.agm(y)) # least pure imaginary period /i w2 = C(w1,w2)/2 return (w1,w2) @cached_method def _compute_periods_complex(self, prec=None, normalise=True): r""" Internal function to compute the periods (complex embedding case). INPUT: - `prec` (int or ``None`` (default)) -- floating point precision (in bits); if None, use the default precision. - `normalise` (bool, default True) -- whether to normalise the basis after computation. OUTPUT: (tuple of Complex) `(\omega_1,\omega_2)` where the lattice has the form `\ZZ\omega_1 + \ZZ\omega_2`. If `normalise` is `True`, the basis is normalised so that `(\omega_1/\omega_2)` is in the fundamental region of the upper half plane. EXAMPLES:: sage: K.<a> = NumberField(x^3-2) sage: E = EllipticCurve([0,1,0,a,a]) sage: embs = K.embeddings(CC) sage: Ls = [E.period_lattice(e) for e in embs] sage: [L.is_real() for L in Ls] [False, False, True] sage: L = Ls[0] sage: w1,w2 = L._compute_periods_complex(100); w1,w2 (-1.3758860416607626645495991458 - 2.5856094662444337042877901304*I, -2.1033990784735587243397865076 + 0.42837877646062187766760569686*I) sage: tau = w1/w2; tau 0.38769450503287609349437509561 + 1.3082108821440725664008561928*I sage: tau.real() 0.38769450503287609349437509561 sage: tau.abs() 1.3644496111593345713923386773 Without normalisation:: sage: w1,w2 = L._compute_periods_complex(normalise=False); w1,w2 (2.10339907847356 - 0.428378776460622*I, 0.727513036812796 - 3.01398824270506*I) sage: tau = w1/w2; tau 0.293483964608883 + 0.627038168678760*I sage: tau.real() 0.293483964608883 sage: tau.abs() # > 1 0.692321964451917 """ if prec is None: prec = RealField().precision() C = ComplexField(prec) # Up to now everything has been exact in AA, but now we # must go transcendental. Only now is the desired # precision used! pi = C.pi() a, b, c = (C(x) for x in self._abc) if (a+b).abs() < (a-b).abs(): b=-b if (a+c).abs() < (a-c).abs(): c=-c w1 = pi/a.agm(b) w2 = pi*C.gen()/a.agm(c) if (w1/w2).imag()<0: w2=-w2 if normalise: w1w2, mat = normalise_periods(w1,w2) return w1w2 return (w1,w2) def is_real(self): r""" Return True if this period lattice is real. EXAMPLES:: sage: f = EllipticCurve('11a') sage: f.period_lattice().is_real() True :: sage: K.<i> = QuadraticField(-1) sage: E = EllipticCurve(K,[0,0,0,i,2*i]) sage: emb = K.embeddings(ComplexField())[0] sage: L = E.period_lattice(emb) sage: L.is_real() False :: sage: K.<a> = NumberField(x^3-2) sage: E = EllipticCurve([0,1,0,a,a]) sage: [E.period_lattice(emb).is_real() for emb in K.embeddings(CC)] [False, False, True] ALGORITHM: The lattice is real if it is associated to a real embedding; such lattices are stable under conjugation. """ return self.real_flag!=0 def is_rectangular(self): r""" Return True if this period lattice is rectangular. .. NOTE:: Only defined for real lattices; a RuntimeError is raised for non-real lattices. EXAMPLES:: sage: f = EllipticCurve('11a') sage: f.period_lattice().basis() (1.26920930427955, 0.634604652139777 + 1.45881661693850*I) sage: f.period_lattice().is_rectangular() False :: sage: f = EllipticCurve('37b') sage: f.period_lattice().basis() (1.08852159290423, 1.76761067023379*I) sage: f.period_lattice().is_rectangular() True ALGORITHM: The period lattice is rectangular precisely if the discriminant of the Weierstrass equation is positive, or equivalently if the number of real components is 2. """ if self.is_real(): return self.real_flag == +1 raise RuntimeError("Not defined for non-real lattices.") def real_period(self, prec=None, algorithm='sage'): """ Return the real period of this period lattice. INPUT: - ``prec`` (int or ``None`` (default)) -- real precision in bits (default real precision if ``None``) - ``algorithm`` (string, default 'sage') -- choice of implementation (for real embeddings only) between 'sage' (native Sage implementation) or 'pari' (use the PARI library: only available for real embeddings). .. NOTE:: Only defined for real lattices; a RuntimeError is raised for non-real lattices. EXAMPLES:: sage: E = EllipticCurve('37a') sage: E.period_lattice().real_period() 2.99345864623196 :: sage: K.<a> = NumberField(x^3-2) sage: emb = K.embeddings(RealField())[0] sage: E = EllipticCurve([0,1,0,a,a]) sage: L = E.period_lattice(emb) sage: L.real_period(64) 3.81452977217854509 """ if self.is_real(): return self.basis(prec,algorithm)[0] raise RuntimeError("Not defined for non-real lattices.") def omega(self, prec=None, bsd_normalise=False): r""" Return the real or complex volume of this period lattice. INPUT: - ``prec`` (int or ``None``(default)) -- real precision in bits (default real precision if ``None``) - ``bsd_normalise`` (bool, default ``False``) -- flag to use BSD normalisation in the complex case. OUTPUT: (real) For real lattices, this is the real period times the number of connected components. For non-real lattices it is the complex area, or double the area if ``bsd_normalise`` is ``True``. .. NOTE:: If the curve is given by a *global minimal* Weierstrass equation, then with ``bsd_normalise`` = ``True``, this gives the correct period in the BSD conjecture: the product of this quantity over all embeddings appears in the BSD formula. In general a correction factor is required to make allowance for the model. EXAMPLES:: sage: E = EllipticCurve('37a') sage: E.period_lattice().omega() 5.98691729246392 This is not a minimal model:: sage: E = EllipticCurve([0,-432*6^2]) sage: E.period_lattice().omega() 0.486109385710056 If you were to plug the above omega into the BSD conjecture, you would get an incorrect value, out by a factor of 2. The following works though:: sage: F = E.minimal_model() sage: F.period_lattice().omega() 0.972218771420113 :: sage: K.<a> = NumberField(x^3-2) sage: emb = K.embeddings(RealField())[0] sage: E = EllipticCurve([0,1,0,a,a]) sage: L = E.period_lattice(emb) sage: L.omega(64) 3.81452977217854509 A complex example (taken from J.E.Cremona and E.Whitley, *Periods of cusp forms and elliptic curves over imaginary quadratic fields*, Mathematics of Computation 62 No. 205 (1994), 407-429). See :trac:`29645` and :trac:`29782`:: sage: K.<i> = QuadraticField(-1) sage: E = EllipticCurve([0,1-i,i,-i,0]) sage: L = E.period_lattice(K.embeddings(CC)[0]) sage: L.omega() 8.80694160502647 sage: L.omega(prec=200) 8.8069416050264741493250743632295462227858630765392114070032 sage: L.omega(bsd_normalise=True) 17.6138832100529 """ if self.is_real(): n_components = 2 if self.real_flag == 1 else 1 return self.real_period(prec) * n_components else: bsd_factor = 2 if bsd_normalise else 1 return self.complex_area(prec) * bsd_factor @cached_method def basis_matrix(self, prec=None, normalised=False): r""" Return the basis matrix of this period lattice. INPUT: - ``prec`` (int or ``None``(default)) -- real precision in bits (default real precision if ``None``). - ``normalised`` (bool, default False) -- if True and the embedding is real, use the normalised basis (see ``normalised_basis()``) instead of the default. OUTPUT: A 2x2 real matrix whose rows are the lattice basis vectors, after identifying `\CC` with `\RR^2`. EXAMPLES:: sage: E = EllipticCurve('37a') sage: E.period_lattice().basis_matrix() [ 2.99345864623196 0.000000000000000] [0.000000000000000 2.45138938198679] :: sage: K.<a> = NumberField(x^3-2) sage: emb = K.embeddings(RealField())[0] sage: E = EllipticCurve([0,1,0,a,a]) sage: L = E.period_lattice(emb) sage: L.basis_matrix(64) [ 3.81452977217854509 0.000000000000000000] [ 1.90726488608927255 1.34047785962440202] See :trac:`4388`:: sage: L = EllipticCurve('11a1').period_lattice() sage: L.basis_matrix() [ 1.26920930427955 0.000000000000000] [0.634604652139777 1.45881661693850] sage: L.basis_matrix(normalised=True) [0.634604652139777 -1.45881661693850] [-1.26920930427955 0.000000000000000] :: sage: L = EllipticCurve('389a1').period_lattice() sage: L.basis_matrix() [ 2.49021256085505 0.000000000000000] [0.000000000000000 1.97173770155165] sage: L.basis_matrix(normalised=True) [ 2.49021256085505 0.000000000000000] [0.000000000000000 -1.97173770155165] """ from sage.matrix.constructor import Matrix if normalised: return Matrix([list(w) for w in self.normalised_basis(prec)]) w1,w2 = self.basis(prec) if self.is_real(): return Matrix([[w1,0],list(w2)]) else: return Matrix([list(w) for w in (w1,w2)]) def complex_area(self, prec=None): """ Return the area of a fundamental domain for the period lattice of the elliptic curve. INPUT: - ``prec`` (int or ``None``(default)) -- real precision in bits (default real precision if ``None``). EXAMPLES:: sage: E = EllipticCurve('37a') sage: E.period_lattice().complex_area() 7.33813274078958 :: sage: K.<a> = NumberField(x^3-2) sage: embs = K.embeddings(ComplexField()) sage: E = EllipticCurve([0,1,0,a,a]) sage: [E.period_lattice(emb).is_real() for emb in K.embeddings(CC)] [False, False, True] sage: [E.period_lattice(emb).complex_area() for emb in embs] [6.02796894766694, 6.02796894766694, 5.11329270448345] """ w1,w2 = self.basis(prec) return (w1*w2.conjugate()).imag().abs() def sigma(self, z, prec=None, flag=0): r""" Return the value of the Weierstrass sigma function for this elliptic curve period lattice. INPUT: - ``z`` -- a complex number - ``prec`` (default: ``None``) -- real precision in bits (default real precision if None). - ``flag`` -- 0: (default) ???; 1: computes an arbitrary determination of log(sigma(z)) 2, 3: same using the product expansion instead of theta series. ??? .. NOTE:: The reason for the ???'s above, is that the PARI documentation for ellsigma is very vague. Also this is only implemented for curves defined over `\QQ`. .. TODO:: This function does not use any of the PeriodLattice functions and so should be moved to ell_rational_field. EXAMPLES:: sage: EllipticCurve('389a1').period_lattice().sigma(CC(2,1)) 2.60912163570108 - 0.200865080824587*I """ if prec is None: prec = RealField().precision() try: return self.E.pari_curve().ellsigma(z, flag, precision=prec) except AttributeError: raise NotImplementedError("sigma function not yet implemented for period lattices of curves not defined over Q") def curve(self): r""" Return the elliptic curve associated with this period lattice. EXAMPLES:: sage: E = EllipticCurve('37a') sage: L = E.period_lattice() sage: L.curve() is E True :: sage: K.<a> = NumberField(x^3-2) sage: E = EllipticCurve([0,1,0,a,a]) sage: L = E.period_lattice(K.embeddings(RealField())[0]) sage: L.curve() is E True sage: L = E.period_lattice(K.embeddings(ComplexField())[0]) sage: L.curve() is E True """ return self.E def ei(self): r""" Return the x-coordinates of the 2-division points of the elliptic curve associated with this period lattice, as elements of QQbar. EXAMPLES:: sage: E = EllipticCurve('37a') sage: L = E.period_lattice() sage: L.ei() [-1.107159871688768?, 0.2695944364054446?, 0.8375654352833230?] In the following example, we should have one purely real 2-division point coordinate, and two conjugate purely imaginary coordinates. :: sage: K.<a> = NumberField(x^3-2) sage: E = EllipticCurve([0,1,0,a,a]) sage: L = E.period_lattice(K.embeddings(RealField())[0]) sage: x1,x2,x3 = L.ei() sage: abs(x1.real())+abs(x2.real())<1e-14 True sage: x1.imag(),x2.imag(),x3 (-1.122462048309373?, 1.122462048309373?, -1.000000000000000?) :: sage: L = E.period_lattice(K.embeddings(ComplexField())[0]) sage: L.ei() [-1.000000000000000? + 0.?e-1...*I, -0.9720806486198328? - 0.561231024154687?*I, 0.9720806486198328? + 0.561231024154687?*I] """ return self._ei def coordinates(self, z, rounding=None): r""" Return the coordinates of a complex number w.r.t. the lattice basis INPUT: - ``z`` (complex) -- A complex number. - ``rounding`` (default ``None``) -- whether and how to round the output (see below). OUTPUT: When ``rounding`` is ``None`` (the default), returns a tuple of reals `x`, `y` such that `z=xw_1+yw_2` where `w_1`, `w_2` are a basis for the lattice (normalised in the case of complex embeddings). When ``rounding`` is 'round', returns a tuple of integers `n_1`, `n_2` which are the closest integers to the `x`, `y` defined above. If `z` is in the lattice these are the coordinates of `z` with respect to the lattice basis. When ``rounding`` is 'floor', returns a tuple of integers `n_1`, `n_2` which are the integer parts to the `x`, `y` defined above. These are used in :meth:`.reduce` EXAMPLES:: sage: E = EllipticCurve('389a') sage: L = E.period_lattice() sage: w1, w2 = L.basis(prec=100) sage: P = E([-1,1]) sage: zP = P.elliptic_logarithm(precision=100); zP 0.47934825019021931612953301006 + 0.98586885077582410221120384908*I sage: L.coordinates(zP) (0.19249290511394227352563996419, 0.50000000000000000000000000000) sage: sum([x*w for x,w in zip(L.coordinates(zP), L.basis(prec=100))]) 0.47934825019021931612953301006 + 0.98586885077582410221120384908*I sage: L.coordinates(12*w1+23*w2) (12.000000000000000000000000000, 23.000000000000000000000000000) sage: L.coordinates(12*w1+23*w2, rounding='floor') (11, 22) sage: L.coordinates(12*w1+23*w2, rounding='round') (12, 23) """ C = z.parent() if isinstance(C, sage.rings.abc.RealField): C = ComplexField(C.precision()) z = C(z) else: if isinstance(C, sage.rings.abc.ComplexField): pass else: try: C = ComplexField() z = C(z) except TypeError: raise TypeError("%s is not a complex number"%z) prec = C.precision() from sage.matrix.constructor import Matrix from sage.modules.free_module_element import vector if self.real_flag: w1,w2 = self.basis(prec) M = Matrix([[w1,0], list(w2)])**(-1) else: w1,w2 = self.normalised_basis(prec) M = Matrix([list(w1), list(w2)])**(-1) u,v = vector(z)*M # Now z = u*w1+v*w2 if rounding=='round': return u.round(), v.round() if rounding=='floor': return u.floor(), v.floor() return u,v def reduce(self, z): r""" Reduce a complex number modulo the lattice INPUT: - ``z`` (complex) -- A complex number. OUTPUT: (complex) the reduction of `z` modulo the lattice, lying in the fundamental period parallelogram with respect to the lattice basis. For curves defined over the reals (i.e. real embeddings) the output will be real when possible. EXAMPLES:: sage: E = EllipticCurve('389a') sage: L = E.period_lattice() sage: w1, w2 = L.basis(prec=100) sage: P = E([-1,1]) sage: zP = P.elliptic_logarithm(precision=100); zP 0.47934825019021931612953301006 + 0.98586885077582410221120384908*I sage: z = zP+10*w1-20*w2; z 25.381473858740770069343110929 - 38.448885180257139986236950114*I sage: L.reduce(z) 0.47934825019021931612953301006 + 0.98586885077582410221120384908*I sage: L.elliptic_logarithm(2*P) 0.958696500380439 sage: L.reduce(L.elliptic_logarithm(2*P)) 0.958696500380439 sage: L.reduce(L.elliptic_logarithm(2*P)+10*w1-20*w2) 0.958696500380444 """ C = z.parent() if isinstance(C, sage.rings.abc.RealField): C = ComplexField(C.precision()) z = C(z) elif isinstance(C, sage.rings.abc.ComplexField): pass else: try: C = ComplexField() z = C(z) except TypeError: raise TypeError("%s is not a complex number" % z) prec = C.precision() if self.real_flag: w1, w2 = self.basis(prec) # w1 real else: w1, w2 = self.normalised_basis(prec) u, v = self.coordinates(z, rounding='floor') z = z-u*w1-v*w2 # Final adjustments for the real case. # NB We assume here that when the embedding is real then the # point is also real! if self.real_flag == 0: return z if self.real_flag == -1: k = (z.imag()/w2.imag()).round() z = z-k*w2 return C(z.real(),0) if ((2*z.imag()/w2.imag()).round())%2: return C(z.real(),w2.imag()/2) else: return C(z.real(),0) def e_log_RC(self, xP, yP, prec=None, reduce=True): r""" Return the elliptic logarithm of a real or complex point. - ``xP, yP`` (real or complex) -- Coordinates of a point on the embedded elliptic curve associated with this period lattice. - ``prec`` (default: ``None``) -- real precision in bits (default real precision if None). - ``reduce`` (default: ``True``) -- if ``True``, the result is reduced with respect to the period lattice basis. OUTPUT: (complex number) The elliptic logarithm of the point `(xP,yP)` with respect to this period lattice. If `E` is the elliptic curve and `\sigma:K\to\CC` the embedding, the returned value `z` is such that `z\pmod{L}` maps to `(xP,yP)=\sigma(P)` under the standard Weierstrass isomorphism from `\CC/L` to `\sigma(E)`. If ``reduce`` is ``True``, the output is reduced so that it is in the fundamental period parallelogram with respect to the normalised lattice basis. ALGORITHM: Uses the complex AGM. See [CT2013]_ for details. EXAMPLES:: sage: E = EllipticCurve('389a') sage: L = E.period_lattice() sage: P = E([-1,1]) sage: xP, yP = [RR(c) for c in P.xy()] The elliptic log from the real coordinates:: sage: L.e_log_RC(xP, yP) 0.479348250190219 + 0.985868850775824*I The same elliptic log from the algebraic point:: sage: L(P) 0.479348250190219 + 0.985868850775824*I A number field example:: sage: K.<a> = NumberField(x^3-2) sage: E = EllipticCurve([0,0,0,0,a]) sage: v = K.real_places()[0] sage: L = E.period_lattice(v) sage: P = E.lift_x(1/3*a^2 + a + 5/3) sage: L(P) 3.51086196882538 sage: xP, yP = [v(c) for c in P.xy()] sage: L.e_log_RC(xP, yP) 3.51086196882538 Elliptic logs of real points which do not come from algebraic points:: sage: ER = EllipticCurve([v(ai) for ai in E.a_invariants()]) sage: P = ER.lift_x(12.34) sage: xP, yP = P.xy() sage: xP, yP (12.3400000000000, 43.3628968710567) sage: L.e_log_RC(xP, yP) 3.76298229503967 sage: xP, yP = ER.lift_x(0).xy() sage: L.e_log_RC(xP, yP) 2.69842609082114 Elliptic logs of complex points:: sage: v = K.complex_embeddings()[0] sage: L = E.period_lattice(v) sage: P = E.lift_x(1/3*a^2 + a + 5/3) sage: L(P) 1.68207104397706 - 1.87873661686704*I sage: xP, yP = [v(c) for c in P.xy()] sage: L.e_log_RC(xP, yP) 1.68207104397706 - 1.87873661686704*I sage: EC = EllipticCurve([v(ai) for ai in E.a_invariants()]) sage: xP, yP = EC.lift_x(0).xy() sage: L.e_log_RC(xP, yP) 1.03355715602040 - 0.867257428417356*I """ if prec is None: prec = RealField().precision() # Note: using log2(prec) + 3 guard bits is usually enough. # To avoid computing a logarithm, we use 40 guard bits which # should be largely enough in practice. prec2 = prec + 40 R = RealField(prec2) C = ComplexField(prec2) e1,e2,e3 = self._ei a1,a2,a3 = [self.embedding(a) for a in self.E.ainvs()[:3]] wP = 2*yP+a1*xP+a3 # We treat the case of 2-torsion points separately. (Note # that Cohen's algorithm does not handle these properly.) if wP.is_zero(): # 2-torsion treated separately w1,w2 = self._compute_periods_complex(prec,normalise=False) if xP==e1: z = w2/2 else: if xP==e3: z = w1/2 else: z = (w1+w2)/2 if reduce: z = self.reduce(z) return z # NB The first block of code works fine for real embeddings as # well as complex embeddings. The special code for real # embeddings uses only real arithmetic in the iteration, and is # based on Cremona and Thongjunthug. # An older version, based on Cohen's Algorithm 7.4.8 also uses # only real arithmetic, and gives different normalisations, # but also causes problems (see #10026). It is left in but # commented out below. if self.real_flag==0: # complex case a = C((e1-e3).sqrt()) b = C((e1-e2).sqrt()) if (a+b).abs() < (a-b).abs(): b=-b r = C(((xP-e3)/(xP-e2)).sqrt()) if r.real()<0: r=-r t = -C(wP)/(2*r*(xP-e2)) # eps controls the end of the loop. Since we aim at a target # precision of prec bits, eps = 2^(-prec) is enough. eps = R(1) >> prec while True: s = b*r+a a, b = (a+b)/2, (a*b).sqrt() if (a+b).abs() < (a-b).abs(): b=-b r = (a*(r+1)/s).sqrt() if (r.abs()-1).abs() < eps: break if r.real()<0: r=-r t *= r z = ((a/t).arctan())/a z = ComplexField(prec)(z) if reduce: z = self.reduce(z) return z if self.real_flag==-1: # real, connected case z = C(self._abc[0]) # sqrt(e3-e1) a, y, b = z.real(), z.imag(), z.abs() uv = (xP-e1).sqrt() u, v = uv.real().abs(), uv.imag().abs() r = (u*a/(u*a+v*y)).sqrt() t = -r*R(wP)/(2*(u**2+v**2)) on_egg = False else: # real, disconnected case a = R(e3-e1).sqrt() b = R(e3-e2).sqrt() if (a+b).abs() < (a-b).abs(): b=-b on_egg = (xP<e3) if on_egg: r = a/R(e3-xP).sqrt() t = r*R(wP)/(2*R(xP-e1)) else: r = R((xP-e1)/(xP-e2)).sqrt() t = -R(wP)/(2*r*R(xP-e2)) # eps controls the end of the loop. Since we aim at a target # precision of prec bits, eps = 2^(-prec) is enough. eps = R(1) >> prec while True: s = b*r+a a, b = (a+b)/2, (a*b).sqrt() r = (a*(r+1)/s).sqrt() if (r-1).abs() < eps: break t *= r z = ((a/t).arctan())/a if on_egg: w1,w2 = self._compute_periods_real(prec) z += w2/2 z = ComplexField(prec)(z) if reduce: z = self.reduce(z) return z def elliptic_logarithm(self, P, prec=None, reduce=True): r""" Return the elliptic logarithm of a point. INPUT: - ``P`` (point) -- A point on the elliptic curve associated with this period lattice. - ``prec`` (default: ``None``) -- real precision in bits (default real precision if None). - ``reduce`` (default: ``True``) -- if ``True``, the result is reduced with respect to the period lattice basis. OUTPUT: (complex number) The elliptic logarithm of the point `P` with respect to this period lattice. If `E` is the elliptic curve and `\sigma:K\to\CC` the embedding, the returned value `z` is such that `z\pmod{L}` maps to `\sigma(P)` under the standard Weierstrass isomorphism from `\CC/L` to `\sigma(E)`. If ``reduce`` is ``True``, the output is reduced so that it is in the fundamental period parallelogram with respect to the normalised lattice basis. ALGORITHM: Uses the complex AGM. See [CT2013]_ for details. EXAMPLES:: sage: E = EllipticCurve('389a') sage: L = E.period_lattice() sage: E.discriminant() > 0 True sage: L.real_flag 1 sage: P = E([-1,1]) sage: P.is_on_identity_component () False sage: L.elliptic_logarithm(P, prec=96) 0.4793482501902193161295330101 + 0.9858688507758241022112038491*I sage: Q=E([3,5]) sage: Q.is_on_identity_component() True sage: L.elliptic_logarithm(Q, prec=96) 1.931128271542559442488585220 Note that this is actually the inverse of the Weierstrass isomorphism:: sage: L.elliptic_exponential(_) # abs tol 1e-26 (3.000000000000000000000000000 : 5.000000000000000000000000000 : 1.000000000000000000000000000) An example with negative discriminant, and a torsion point:: sage: E = EllipticCurve('11a1') sage: L = E.period_lattice() sage: E.discriminant() < 0 True sage: L.real_flag -1 sage: P = E([16,-61]) sage: L.elliptic_logarithm(P) 0.253841860855911 sage: L.real_period() / L.elliptic_logarithm(P) 5.00000000000000 An example where precision is problematic:: sage: E = EllipticCurve([1, 0, 1, -85357462, 303528987048]) #18074g1 sage: P = E([4458713781401/835903744, -64466909836503771/24167649046528, 1]) sage: L = E.period_lattice() sage: L.ei() [5334.003952567705? - 1.964393150436?e-6*I, 5334.003952567705? + 1.964393150436?e-6*I, -10668.25790513541?] sage: L.elliptic_logarithm(P,prec=100) 0.27656204014107061464076203097 Some complex examples, taken from the paper by Cremona and Thongjunthug:: sage: K.<i> = QuadraticField(-1) sage: a4 = 9*i-10 sage: a6 = 21-i sage: E = EllipticCurve([0,0,0,a4,a6]) sage: e1 = 3-2*i; e2 = 1+i; e3 = -4+i sage: emb = K.embeddings(CC)[1] sage: L = E.period_lattice(emb) sage: P = E(2-i,4+2*i) By default, the output is reduced with respect to the normalised lattice basis, so that its coordinates with respect to that basis lie in the interval [0,1):: sage: z = L.elliptic_logarithm(P,prec=100); z 0.70448375537782208460499649302 - 0.79246725643650979858266018068*I sage: L.coordinates(z) (0.46247636364807931766105406092, 0.79497588726808704200760395829) Using ``reduce=False`` this step can be omitted. In this case the coordinates are usually in the interval [-0.5,0.5), but this is not guaranteed. This option is mainly for testing purposes:: sage: z = L.elliptic_logarithm(P,prec=100, reduce=False); z 0.57002153834710752778063503023 + 0.46476340520469798857457031393*I sage: L.coordinates(z) (0.46247636364807931766105406092, -0.20502411273191295799239604171) The elliptic logs of the 2-torsion points are half-periods:: sage: L.elliptic_logarithm(E(e1,0),prec=100) 0.64607575874356525952487867052 + 0.22379609053909448304176885364*I sage: L.elliptic_logarithm(E(e2,0),prec=100) 0.71330686725892253793705940192 - 0.40481924028150941053684639367*I sage: L.elliptic_logarithm(E(e3,0),prec=100) 0.067231108515357278412180731396 - 0.62861533082060389357861524731*I We check this by doubling and seeing that the resulting coordinates are integers:: sage: L.coordinates(2*L.elliptic_logarithm(E(e1,0),prec=100)) (1.0000000000000000000000000000, 0.00000000000000000000000000000) sage: L.coordinates(2*L.elliptic_logarithm(E(e2,0),prec=100)) (1.0000000000000000000000000000, 1.0000000000000000000000000000) sage: L.coordinates(2*L.elliptic_logarithm(E(e3,0),prec=100)) (0.00000000000000000000000000000, 1.0000000000000000000000000000) :: sage: a4 = -78*i + 104 sage: a6 = -216*i - 312 sage: E = EllipticCurve([0,0,0,a4,a6]) sage: emb = K.embeddings(CC)[1] sage: L = E.period_lattice(emb) sage: P = E(3+2*i,14-7*i) sage: L.elliptic_logarithm(P) 0.297147783912228 - 0.546125549639461*I sage: L.coordinates(L.elliptic_logarithm(P)) (0.628653378040238, 0.371417754610223) sage: e1 = 1+3*i; e2 = -4-12*i; e3=-e1-e2 sage: L.coordinates(L.elliptic_logarithm(E(e1,0))) (0.500000000000000, 0.500000000000000) sage: L.coordinates(L.elliptic_logarithm(E(e2,0))) (1.00000000000000, 0.500000000000000) sage: L.coordinates(L.elliptic_logarithm(E(e3,0))) (0.500000000000000, 0.000000000000000) TESTS: See :trac:`10026` and :trac:`11767`:: sage: K.<w> = QuadraticField(2) sage: E = EllipticCurve([ 0, -1, 1, -3*w -4, 3*w + 4 ]) sage: T = E.simon_two_descent(lim1=20,lim3=5,limtriv=20) sage: P,Q = T[2] sage: embs = K.embeddings(CC) sage: Lambda = E.period_lattice(embs[0]) sage: Lambda.elliptic_logarithm(P, 100) 4.7100131126199672766973600998 sage: R.<x> = QQ[] sage: K.<a> = NumberField(x^2 + x + 5) sage: E = EllipticCurve(K, [0,0,1,-3,-5]) sage: P = E([0,a]) sage: Lambda = P.curve().period_lattice(K.embeddings(ComplexField(600))[0]) sage: Lambda.elliptic_logarithm(P, prec=600) -0.842248166487739393375018008381693990800588864069506187033873183845246233548058477561706400464057832396643843146464236956684557207157300006542470428493573195030603817094900751609464 - 0.571366031453267388121279381354098224265947866751130917440598461117775339240176310729173301979590106474259885638797913383502735083088736326391919063211421189027226502851390118943491*I sage: K.<a> = QuadraticField(-5) sage: E = EllipticCurve([1,1,a,a,0]) sage: P = E(0,0) sage: L = P.curve().period_lattice(K.embeddings(ComplexField())[0]) sage: L.elliptic_logarithm(P, prec=500) 1.17058357737548897849026170185581196033579563441850967539191867385734983296504066660506637438866628981886518901958717288150400849746892393771983141354 - 1.13513899565966043682474529757126359416758251309237866586896869548539516543734207347695898664875799307727928332953834601460994992792519799260968053875*I sage: L.elliptic_logarithm(P, prec=1000) 1.17058357737548897849026170185581196033579563441850967539191867385734983296504066660506637438866628981886518901958717288150400849746892393771983141354014895386251320571643977497740116710952913769943240797618468987304985625823413440999754037939123032233879499904283600304184828809773650066658885672885 - 1.13513899565966043682474529757126359416758251309237866586896869548539516543734207347695898664875799307727928332953834601460994992792519799260968053875387282656993476491590607092182964878750169490985439873220720963653658829712494879003124071110818175013453207439440032582917366703476398880865439217473*I """ if not P.curve() is self.E: raise ValueError("Point is on the wrong curve") if prec is None: prec = RealField().precision() if P.is_zero(): return ComplexField(prec)(0) # Compute the real or complex coordinates of P: xP, yP = [self.embedding(coord) for coord in P.xy()] # The real work is done over R or C now: return self.e_log_RC(xP, yP, prec, reduce=reduce) def elliptic_exponential(self, z, to_curve=True): r""" Return the elliptic exponential of a complex number. INPUT: - ``z`` (complex) -- A complex number (viewed modulo this period lattice). - ``to_curve`` (bool, default True): see below. OUTPUT: - If ``to_curve`` is False, a 2-tuple of real or complex numbers representing the point `(x,y) = (\wp(z),\wp'(z))` where `\wp` denotes the Weierstrass `\wp`-function with respect to this lattice. - If ``to_curve`` is True, the point `(X,Y) = (x-b_2/12,y-(a_1(x-b_2/12)-a_3)/2)` as a point in `E(\RR)` or `E(\CC)`, with `(x,y) = (\wp(z),\wp'(z))` as above, where `E` is the elliptic curve over `\RR` or `\CC` whose period lattice this is. - If the lattice is real and `z` is also real then the output is a pair of real numbers if ``to_curve`` is True, or a point in `E(\RR)` if ``to_curve`` is False. .. NOTE:: The precision is taken from that of the input ``z``. EXAMPLES:: sage: E = EllipticCurve([1,1,1,-8,6]) sage: P = E(1,-2) sage: L = E.period_lattice() sage: z = L(P); z 1.17044757240090 sage: L.elliptic_exponential(z) (0.999999999999999 : -2.00000000000000 : 1.00000000000000) sage: _.curve() Elliptic Curve defined by y^2 + 1.00000000000000*x*y + 1.00000000000000*y = x^3 + 1.00000000000000*x^2 - 8.00000000000000*x + 6.00000000000000 over Real Field with 53 bits of precision sage: L.elliptic_exponential(z,to_curve=False) (1.41666666666667, -2.00000000000000) sage: z = L(P,prec=201); z 1.17044757240089592298992188482371493504472561677451007994189 sage: L.elliptic_exponential(z) (1.00000000000000000000000000000000000000000000000000000000000 : -2.00000000000000000000000000000000000000000000000000000000000 : 1.00000000000000000000000000000000000000000000000000000000000) Examples over number fields:: sage: x = polygen(QQ) sage: K.<a> = NumberField(x^3-2) sage: embs = K.embeddings(CC) sage: E = EllipticCurve('37a') sage: EK = E.change_ring(K) sage: Li = [EK.period_lattice(e) for e in embs] sage: P = EK(-1,-1) sage: Q = EK(a-1,1-a^2) sage: zi = [L.elliptic_logarithm(P) for L in Li] sage: [c.real() for c in Li[0].elliptic_exponential(zi[0])] [-1.00000000000000, -1.00000000000000, 1.00000000000000] sage: [c.real() for c in Li[0].elliptic_exponential(zi[1])] [-1.00000000000000, -1.00000000000000, 1.00000000000000] sage: [c.real() for c in Li[0].elliptic_exponential(zi[2])] [-1.00000000000000, -1.00000000000000, 1.00000000000000] sage: zi = [L.elliptic_logarithm(Q) for L in Li] sage: Li[0].elliptic_exponential(zi[0]) (-1.62996052494744 - 1.09112363597172*I : 1.79370052598410 - 1.37472963699860*I : 1.00000000000000) sage: [embs[0](c) for c in Q] [-1.62996052494744 - 1.09112363597172*I, 1.79370052598410 - 1.37472963699860*I, 1.00000000000000] sage: Li[1].elliptic_exponential(zi[1]) (-1.62996052494744 + 1.09112363597172*I : 1.79370052598410 + 1.37472963699860*I : 1.00000000000000) sage: [embs[1](c) for c in Q] [-1.62996052494744 + 1.09112363597172*I, 1.79370052598410 + 1.37472963699860*I, 1.00000000000000] sage: [c.real() for c in Li[2].elliptic_exponential(zi[2])] [0.259921049894873, -0.587401051968199, 1.00000000000000] sage: [embs[2](c) for c in Q] [0.259921049894873, -0.587401051968200, 1.00000000000000] Test to show that :trac:`8820` is fixed:: sage: E = EllipticCurve('37a') sage: K.<a> = QuadraticField(-5) sage: L = E.change_ring(K).period_lattice(K.places()[0]) sage: L.elliptic_exponential(CDF(.1,.1)) (0.0000142854026029... - 49.9960001066650*I : 249.520141250950 + 250.019855549131*I : 1.00000000000000) sage: L.elliptic_exponential(CDF(.1,.1), to_curve=False) (0.0000142854026029447 - 49.9960001066650*I, 500.040282501900 + 500.039711098263*I) `z=0` is treated as a special case:: sage: E = EllipticCurve([1,1,1,-8,6]) sage: L = E.period_lattice() sage: L.elliptic_exponential(0) (0.000000000000000 : 1.00000000000000 : 0.000000000000000) sage: L.elliptic_exponential(0, to_curve=False) (+infinity, +infinity) :: sage: E = EllipticCurve('37a') sage: K.<a> = QuadraticField(-5) sage: L = E.change_ring(K).period_lattice(K.places()[0]) sage: P = L.elliptic_exponential(0); P (0.000000000000000 : 1.00000000000000 : 0.000000000000000) sage: P.parent() Abelian group of points on Elliptic Curve defined by y^2 + 1.00000000000000*y = x^3 + (-1.00000000000000)*x over Complex Field with 53 bits of precision Very small `z` are handled properly (see :trac:`8820`):: sage: K.<a> = QuadraticField(-1) sage: E = EllipticCurve([0,0,0,a,0]) sage: L = E.period_lattice(K.complex_embeddings()[0]) sage: L.elliptic_exponential(1e-100) (0.000000000000000 : 1.00000000000000 : 0.000000000000000) The elliptic exponential of `z` is returned as (0 : 1 : 0) if the coordinates of z with respect to the period lattice are approximately integral:: sage: (100/log(2.0,10))/0.8 415.241011860920 sage: L.elliptic_exponential((RealField(415)(1e-100))).is_zero() True sage: L.elliptic_exponential((RealField(420)(1e-100))).is_zero() False """ C = z.parent() z_is_real = False if isinstance(C, sage.rings.abc.RealField): z_is_real = True C = ComplexField(C.precision()) z = C(z) else: if isinstance(C, sage.rings.abc.ComplexField): z_is_real = z.is_real() else: try: C = ComplexField() z = C(z) z_is_real = z.is_real() except TypeError: raise TypeError("%s is not a complex number" % z) prec = C.precision() # test for the point at infinity: eps = (C(2)**(-0.8*prec)).real() ## to test integrality w.r.t. lattice within 20% if all((t.round()-t).abs() < eps for t in self.coordinates(z)): K = z.parent() if to_curve: return self.curve().change_ring(K)(0) else: return K(Infinity), K(Infinity) # general number field code (including QQ): # We do not use PARI's ellztopoint function since it is only # defined for curves over the reals (note that PARI only # computes the period lattice basis in that case). But Sage # can compute the period lattice basis over CC, and then # PARI's ellwp function works fine. # NB converting the PARI values to Sage values might land up # in real/complex fields of spuriously higher precision than # the input, since PARI's precision is in word-size chunks. # So we force the results back into the real/complex fields of # the same precision as the input. x, y = pari(self.basis(prec=prec)).ellwp(z, flag=1) x, y = [C(t) for t in (x, y)] if self.real_flag and z_is_real: x = x.real() y = y.real() if to_curve: K = x.parent() v = refine_embedding(self.embedding, Infinity) a1, a2, a3, a4, a6 = [K(v(a)) for a in self.E.ainvs()] b2 = K(v(self.E.b2())) x = x - b2 / 12 y = (y - (a1 * x + a3)) / 2 EK = EllipticCurve(K, [a1, a2, a3, a4, a6]) return EK.point((x, y, K.one()), check=False) else: return (x, y) def reduce_tau(tau): r""" Transform a point in the upper half plane to the fundamental region. INPUT: - ``tau`` (complex) -- a complex number with positive imaginary part OUTPUT: (tuple) `(\tau',[a,b,c,d])` where `a,b,c,d` are integers such that - `ad-bc=1`; - `\tau`=(a\tau+b)/(c\tau+d)`; - `|\tau'|\ge1`; - `|\Re(\tau')|\le\frac{1}{2}`. EXAMPLES:: sage: from sage.schemes.elliptic_curves.period_lattice import reduce_tau sage: reduce_tau(CC(1.23,3.45)) (0.230000000000000 + 3.45000000000000*I, [1, -1, 0, 1]) sage: reduce_tau(CC(1.23,0.0345)) (-0.463960069171512 + 1.35591888067914*I, [-5, 6, 4, -5]) sage: reduce_tau(CC(1.23,0.0000345)) (0.130000000001761 + 2.89855072463768*I, [13, -16, 100, -123]) """ assert tau.imag() > 0 a, b = ZZ(1), ZZ(0) c, d = b, a k = tau.real().round() tau -= k a -= k*c b -= k*d while tau.abs()<0.999: tau = -1/tau a, b, c, d = c, d, -a, -b k = tau.real().round() tau -= k a -= k*c b -= k*d assert a*d-b*c==1 assert tau.abs()>=0.999 and tau.real().abs() <= 0.5 return tau, [a,b,c,d] def normalise_periods(w1, w2): r""" Normalise the period basis `(w_1,w_2)` so that `w_1/w_2` is in the fundamental region. INPUT: - ``w1,w2`` (complex) -- two complex numbers with non-real ratio OUTPUT: (tuple) `((\omega_1',\omega_2'),[a,b,c,d])` where `a,b,c,d` are integers such that - `ad-bc=\pm1`; - `(\omega_1',\omega_2') = (a\omega_1+b\omega_2,c\omega_1+d\omega_2)`; - `\tau=\omega_1'/\omega_2'` is in the upper half plane; - `|\tau|\ge1` and `|\Re(\tau)|\le\frac{1}{2}`. EXAMPLES:: sage: from sage.schemes.elliptic_curves.period_lattice import reduce_tau, normalise_periods sage: w1 = CC(1.234, 3.456) sage: w2 = CC(1.234, 3.456000001) sage: w1/w2 # in lower half plane! 0.999999999743367 - 9.16334785827644e-11*I sage: w1w2, abcd = normalise_periods(w1,w2) sage: a,b,c,d = abcd sage: w1w2 == (a*w1+b*w2, c*w1+d*w2) True sage: w1w2[0]/w1w2[1] 1.23400010389203e9*I sage: a*d-b*c # note change of orientation -1 """ tau = w1/w2 s = +1 if tau.imag()<0: w2 = -w2 tau = -tau s = -1 tau, abcd = reduce_tau(tau) a, b, c, d = abcd if s<0: abcd = (a,-b,c,-d) return (a*w1+b*w2,c*w1+d*w2), abcd def extended_agm_iteration(a, b, c): r""" Internal function for the extended AGM used in elliptic logarithm computation. INPUT: - ``a``, ``b``, ``c`` (real or complex) -- three real or complex numbers. OUTPUT: (3-tuple) `(a_0,b_0,c_0)`, the limit of the iteration `(a,b,c) \mapsto ((a+b)/2,\sqrt{ab},(c+\sqrt(c^2+b^2-a^2))/2)`. EXAMPLES:: sage: from sage.schemes.elliptic_curves.period_lattice import extended_agm_iteration sage: extended_agm_iteration(RR(1),RR(2),RR(3)) (1.45679103104691, 1.45679103104691, 3.21245294970054) sage: extended_agm_iteration(CC(1,2),CC(2,3),CC(3,4)) (1.46242448156430 + 2.47791311676267*I, 1.46242448156430 + 2.47791311676267*I, 3.22202144343535 + 4.28383734262540*I) TESTS:: sage: extended_agm_iteration(1,2,3) Traceback (most recent call last): ... ValueError: values must be real or complex numbers """ if not isinstance(a, (RealNumber,ComplexNumber)): raise ValueError("values must be real or complex numbers") eps = a.parent().one().real() >> (a.parent().precision() - 10) while True: a1 = (a + b) / 2 b1 = (a * b).sqrt() delta = (b**2 - a**2) / c**2 f = (1 + (1 + delta).sqrt()) / 2 if (f.abs() - 1).abs() < eps: return a, b, c c *= f a, b = a1, b1
PypiClean
/templot-1.1.tar.gz/templot-1.1/doc/examples/plot_aggregated_map.rst
.. note:: :class: sphx-glr-download-link-note Click :ref:`here <sphx_glr_download_examples_plot_aggregated_map.py>` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_examples_plot_aggregated_map.py: Plot Aggregated Map Example. ============================ .. code-block:: default import os import pandas as pd from templot import plot_aggregated_map, add_regions, download_irep filepath = os.path.join('..', 'templot', 'data', 'df.csv') if not os.path.exists(filepath): if not os.path.exists(os.path.join('..', 'templot', 'data')): os.makedirs(os.path.join('..', 'templot', 'data')) download_irep(filepath) df = pd.read_csv(filepath) df = add_regions(df, "LLX", "LLY") my_map = plot_aggregated_map( data=df, variables=[ "Quantite2004", "Quantite2005", "Quantite2006", "Quantite2007", "Quantite2008", "Quantite2009", ], aggregation_method="average", height=300, ) # visualize the html results in sphinx gallery tmp_dir = os.path.join('..', 'dist', 'html') if os.path.exists(tmp_dir): with open(os.path.join(tmp_dir, 'example_agrmap.html'), 'wt') as fh: fh.write(my_map.get_root().render()) .. raw:: html <iframe src="../example_agrmap.html" height="600px" width="100%"></iframe> .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 3.282 seconds) .. _sphx_glr_download_examples_plot_aggregated_map.py: .. only :: html .. container:: sphx-glr-footer :class: sphx-glr-footer-example .. container:: sphx-glr-download :download:`Download Python source code: plot_aggregated_map.py <plot_aggregated_map.py>` .. container:: sphx-glr-download :download:`Download Jupyter notebook: plot_aggregated_map.ipynb <plot_aggregated_map.ipynb>` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery <https://sphinx-gallery.github.io>`_
PypiClean
/green_magic-0.5.6.tar.gz/green_magic-0.5.6/green_magic/map_maker.py
import os import sys import inspect import subprocess from time import time from collections import Counter import somoclu import numpy as np from sklearn.cluster import KMeans from . import definitions from .weedata import Weedataset from .labeling import get_labeler_instance class MapMakerManager: def __init__(self, weedmaster, graphs_dir): self._weedmaster = weedmaster self.graphs_dir = graphs_dir self.implemented_map_makers = ['somoclu'] self.map_makers = {} self.id2map_obj = {} self.map_obj2id = {} self.som = None self.figures = {} self.backend = 'somoclu' self._nb_rows = None self._nb_cols = None self._dataset_id = '' for figure in os.listdir(self.graphs_dir): self.figures[figure.split('.')[0]] = definitions.graphs_dir + figure def __getitem__(self, map_expr): return self.get_map_maker(self.backend, self._weedmaster.selected_dt_id, int(map_expr.split('x')[0]), int(map_expr.split('x')[1])) def get_map_maker(self, map_type, dataset_id, nb_rows, nb_cols): self.backend = map_type self._nb_rows = nb_rows self._nb_cols = nb_cols self._dataset_id = dataset_id _id = self._get_map_maker_id(self.backend) if _id not in self.map_makers: self.map_makers[_id] = self._create_map_maker(map_type, self._weedmaster.id2dataset[dataset_id], nb_rows=nb_rows, nb_cols=nb_cols) self.map_makers[_id].register(self) return self def update(self, *args, **kwargs): map_id = '{}_{}_'.format(self.backend, self._dataset_id) + '_'.join(args) self.id2map_obj[map_id] = kwargs['map_object'] self.som = kwargs['map_object'] self.map_obj2id[self.som] = map_id def get_som(self, map_expr): d = decode(map_expr) map_id = self.get_map_id(d['map-type'], d['grid-type'], d['nb-rows'], d['nb-cols'], initialization=d['initialization'], clusters=False) if map_id not in self.id2map_obj: map_maker = self.get_map_maker(self.backend, self._weedmaster.selected_dt_id, nb_rows=d['nb-rows'], nb_cols=d['nb-cols']).map_makers[self._get_map_maker_id(self.backend)] som = map_maker.create_map(d['map-type'], d['grid-type'], initialization=d['initialization']) print('Created som object with id:', map_id) else: print('Loaded som object with id:', map_id) return self.id2map_obj[map_id] return som def show_map(self, som_obj): """ Opens the default image viewer and shows the visualization of the given trained self-organizing map object. Saves the created png file in the 'self.graphs_dir' path.\n :param som_obj: a trained instance of a self-organizing map :type som_obj: somoclu.Somoclu """ if not isinstance(som_obj, somoclu.Somoclu): warnings.warn("Received {} object instead of Somoclu", DeprecationWarning) return None cl = False if som_obj.clusters is not None: cl = np.max(som_obj.clusters) map_id = self.get_map_id(som_obj._map_type, som_obj._grid_type, som_obj._n_rows, som_obj._n_columns, initialization=som_obj._initialization, clusters=cl) figure_path = self.graphs_dir + '/' + map_id som_obj.view_umatrix(bestmatches=True, filename=figure_path) subprocess.call(['xdg-open', figure_path + '.png']) def _create_map_maker(self, map_maker_type, weed_dataset, nb_rows=20, nb_cols=20): for name, obj in inspect.getmembers(sys.modules[__name__]): if inspect.isclass(obj): if hasattr(obj, 'name') and map_maker_type == obj.name: return obj(nb_rows, nb_cols, weed_dataset, name) else: raise Exception("Unknown map maker type '%s'" % map_maker_type) def get_map_id(self, map_type, grid_type, nb_rows, nb_cols, initialization='', clusters=False): b = '_'.join([self.backend, self._weedmaster.selected_dt_id, initialization, map_type, grid_type, str(nb_rows), str(nb_cols)]) if clusters: return b + '_cl' + str(clusters) else: return b def _get_map_maker_id(self, backend): return '_'.join([backend, self._weedmaster.selected_dt_id, str(self._nb_rows), str(self._nb_cols)]) def decode(map_expr): d = {} els = map_expr.split('.') d['map-type'] = els[0] d['grid-type'] = els[1] d['nb-rows'] = int(els[2]) d['nb-cols'] = int(els[3]) if len(els) < 5: d['initialization'] = '' # random intialization of codebook of shape (nb_neurons, dims) else: d['initialization'] = els[4] # pca return d class MapMaker: def __init__(self, nb_rows, nb_cols, weed_dataset, name): """ :type weed_dataset: weedata.Weedataset """ self.nb_rows = nb_rows self.nb_cols = nb_cols self._weed_dataset = weed_dataset self.name = name self.observers = [] def register(self, observer): if observer not in self.observers: self.observers.append(observer) def unregister(self, observer): if observer in self.observers: self.observers.remove(observer) def unregister_all(self): if self.observers: del self.observers[:] def update_observers(self, *args, **kwargs): for observer in self.observers: observer.update(*args, **kwargs) def create_map(self, map_type, grid_type, initialization=None): try: map_obj = self._create_map(map_type, grid_type, initialization=initialization) except NoDatapointsException: print("No datapoints found in {}. Call the 'get_feature_vectors' of weedmaster".format(self._weed_dataset.name)) return None ini = '' if initialization is not None: ini = initialization self.update_observers(ini, map_type, grid_type, str(self.nb_rows), str(self.nb_cols), map_object=map_obj) return map_obj def save_map_as_figure(self, map_obj, a_name, **kwargs): raise NotImplementedError def _create_map(self, map_type, grid_type, initialization=None): raise NotImplementedError class SomocluMapMaker(MapMaker): name = 'somoclu' def __init__(self, nb_rows, nb_cols, data, name): super().__init__(nb_rows, nb_cols, data, name) def _create_map(self, map_type, grid_type, initialization=None): if not self._weed_dataset.datapoints: raise NoDatapointsException if initialization != 'pca': initialization = None som = somoclu.Somoclu(self.nb_cols, self.nb_rows, maptype=map_type, gridtype=grid_type, initialization=initialization, compactsupport=False) som.train(data=np.array(self._weed_dataset.datapoints, dtype=np.float32)) return som def save_map_as_figure(self, map_obj, a_name, colors=None, labels=None, clusters=False, random_state=None): if clusters: map_obj.cluster(algorithm=KMeans(n_clusters=clusters, random_state=random_state)) map_obj.view_umatrix(bestmatches=True, bestmatchcolors=colors, labels=labels, filename=a_name) else: map_obj.view_umatrix(bestmatches=True, bestmatchcolors=colors, labels=labels, filename=a_name) def print_vector(feature_encoded_vector): print('[ ' + ' '.join(str(el) for el in map(lambda x: str(x if type(x) == int else '%.2f' % x), feature_encoded_vector)) + ' ]') class NoDatapointsException(Exception): pass
PypiClean
/isla-solver-1.14.1.tar.gz/isla-solver-1.14.1/src/isla/isla_language/IslaLanguageLexer.py
from antlr4 import * from io import StringIO import sys if sys.version_info[1] > 5: from typing import TextIO else: from typing.io import TextIO def serializedATN(): return [ 4,0,45,607,6,-1,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5, 2,6,7,6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2, 13,7,13,2,14,7,14,2,15,7,15,2,16,7,16,2,17,7,17,2,18,7,18,2,19,7, 19,2,20,7,20,2,21,7,21,2,22,7,22,2,23,7,23,2,24,7,24,2,25,7,25,2, 26,7,26,2,27,7,27,2,28,7,28,2,29,7,29,2,30,7,30,2,31,7,31,2,32,7, 32,2,33,7,33,2,34,7,34,2,35,7,35,2,36,7,36,2,37,7,37,2,38,7,38,2, 39,7,39,2,40,7,40,2,41,7,41,2,42,7,42,2,43,7,43,2,44,7,44,2,45,7, 45,2,46,7,46,2,47,7,47,2,48,7,48,1,0,1,0,1,0,1,0,1,0,1,0,1,1,1,1, 1,2,1,2,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,4,1,4,1,4,1,5,1,5,1,5,1,5, 1,5,1,5,1,5,1,6,1,6,1,7,1,7,1,7,1,7,1,8,1,8,1,8,1,8,1,9,1,9,1,10, 1,10,1,11,1,11,1,12,1,12,1,12,1,12,1,12,1,13,1,13,1,13,1,13,1,13, 1,13,1,14,1,14,1,14,1,14,1,15,1,15,1,15,1,16,1,16,1,16,1,16,1,17, 1,17,1,17,1,17,1,18,1,18,1,18,1,19,1,19,1,19,1,19,1,19,1,19,1,19, 1,19,1,20,1,20,1,20,1,20,1,20,1,20,1,20,1,20,1,20,1,20,1,20,1,20, 1,20,1,20,1,20,1,20,1,20,3,20,197,8,20,1,21,1,21,1,21,1,21,1,21, 1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21, 1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21, 1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21, 1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21, 1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21, 1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21, 1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21, 1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21, 1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21, 1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21, 1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21, 1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21, 1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21, 1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21, 1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21, 1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21, 1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21, 1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21, 1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21, 1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21, 1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21, 1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,3,21,486,8,21,1,22, 1,22,3,22,490,8,22,1,22,4,22,493,8,22,11,22,12,22,494,1,23,1,23, 1,23,1,23,1,23,1,23,1,23,1,23,1,23,1,23,1,23,1,23,3,23,509,8,23, 1,24,1,24,1,24,1,24,1,25,1,25,1,25,1,25,1,26,1,26,1,26,1,26,1,27, 1,27,1,27,1,27,1,28,1,28,1,28,5,28,530,8,28,10,28,12,28,533,9,28, 1,28,1,28,1,29,1,29,1,29,5,29,540,8,29,10,29,12,29,543,9,29,1,30, 3,30,546,8,30,1,30,4,30,549,8,30,11,30,12,30,550,1,31,1,31,1,31, 1,32,1,32,1,33,1,33,1,33,1,34,1,34,1,35,1,35,1,36,1,36,1,37,1,37, 1,38,1,38,1,39,1,39,1,40,1,40,1,40,1,41,1,41,1,41,1,42,1,42,1,43, 1,43,1,44,4,44,584,8,44,11,44,12,44,585,1,44,1,44,1,45,1,45,5,45, 592,8,45,10,45,12,45,595,9,45,1,45,1,45,1,45,1,45,1,46,1,46,1,47, 3,47,604,8,47,1,48,1,48,2,531,593,0,49,1,1,3,2,5,3,7,4,9,5,11,6, 13,7,15,8,17,9,19,10,21,11,23,12,25,13,27,14,29,15,31,16,33,17,35, 18,37,19,39,20,41,21,43,22,45,23,47,0,49,24,51,25,53,26,55,27,57, 28,59,29,61,30,63,31,65,32,67,33,69,34,71,35,73,36,75,37,77,38,79, 39,81,40,83,41,85,42,87,43,89,44,91,45,93,0,95,0,97,0,1,0,4,6,0, 34,34,92,92,98,98,110,110,114,114,116,116,3,0,9,10,13,13,32,32,3, 0,65,90,95,95,97,122,4,0,45,46,65,90,94,95,97,122,646,0,1,1,0,0, 0,0,3,1,0,0,0,0,5,1,0,0,0,0,7,1,0,0,0,0,9,1,0,0,0,0,11,1,0,0,0,0, 13,1,0,0,0,0,15,1,0,0,0,0,17,1,0,0,0,0,19,1,0,0,0,0,21,1,0,0,0,0, 23,1,0,0,0,0,25,1,0,0,0,0,27,1,0,0,0,0,29,1,0,0,0,0,31,1,0,0,0,0, 33,1,0,0,0,0,35,1,0,0,0,0,37,1,0,0,0,0,39,1,0,0,0,0,41,1,0,0,0,0, 43,1,0,0,0,0,45,1,0,0,0,0,49,1,0,0,0,0,51,1,0,0,0,0,53,1,0,0,0,0, 55,1,0,0,0,0,57,1,0,0,0,0,59,1,0,0,0,0,61,1,0,0,0,0,63,1,0,0,0,0, 65,1,0,0,0,0,67,1,0,0,0,0,69,1,0,0,0,0,71,1,0,0,0,0,73,1,0,0,0,0, 75,1,0,0,0,0,77,1,0,0,0,0,79,1,0,0,0,0,81,1,0,0,0,0,83,1,0,0,0,0, 85,1,0,0,0,0,87,1,0,0,0,0,89,1,0,0,0,0,91,1,0,0,0,1,99,1,0,0,0,3, 105,1,0,0,0,5,107,1,0,0,0,7,109,1,0,0,0,9,116,1,0,0,0,11,119,1,0, 0,0,13,126,1,0,0,0,15,128,1,0,0,0,17,132,1,0,0,0,19,136,1,0,0,0, 21,138,1,0,0,0,23,140,1,0,0,0,25,142,1,0,0,0,27,147,1,0,0,0,29,153, 1,0,0,0,31,157,1,0,0,0,33,160,1,0,0,0,35,164,1,0,0,0,37,168,1,0, 0,0,39,171,1,0,0,0,41,196,1,0,0,0,43,485,1,0,0,0,45,489,1,0,0,0, 47,508,1,0,0,0,49,510,1,0,0,0,51,514,1,0,0,0,53,518,1,0,0,0,55,522, 1,0,0,0,57,526,1,0,0,0,59,536,1,0,0,0,61,545,1,0,0,0,63,552,1,0, 0,0,65,555,1,0,0,0,67,557,1,0,0,0,69,560,1,0,0,0,71,562,1,0,0,0, 73,564,1,0,0,0,75,566,1,0,0,0,77,568,1,0,0,0,79,570,1,0,0,0,81,572, 1,0,0,0,83,575,1,0,0,0,85,578,1,0,0,0,87,580,1,0,0,0,89,583,1,0, 0,0,91,589,1,0,0,0,93,600,1,0,0,0,95,603,1,0,0,0,97,605,1,0,0,0, 99,100,5,99,0,0,100,101,5,111,0,0,101,102,5,110,0,0,102,103,5,115, 0,0,103,104,5,116,0,0,104,2,1,0,0,0,105,106,5,58,0,0,106,4,1,0,0, 0,107,108,5,59,0,0,108,6,1,0,0,0,109,110,5,102,0,0,110,111,5,111, 0,0,111,112,5,114,0,0,112,113,5,97,0,0,113,114,5,108,0,0,114,115, 5,108,0,0,115,8,1,0,0,0,116,117,5,105,0,0,117,118,5,110,0,0,118, 10,1,0,0,0,119,120,5,101,0,0,120,121,5,120,0,0,121,122,5,105,0,0, 122,123,5,115,0,0,123,124,5,116,0,0,124,125,5,115,0,0,125,12,1,0, 0,0,126,127,5,61,0,0,127,14,1,0,0,0,128,129,5,105,0,0,129,130,5, 110,0,0,130,131,5,116,0,0,131,16,1,0,0,0,132,133,5,105,0,0,133,134, 5,102,0,0,134,135,5,102,0,0,135,18,1,0,0,0,136,137,5,40,0,0,137, 20,1,0,0,0,138,139,5,44,0,0,139,22,1,0,0,0,140,141,5,41,0,0,141, 24,1,0,0,0,142,143,5,116,0,0,143,144,5,114,0,0,144,145,5,117,0,0, 145,146,5,101,0,0,146,26,1,0,0,0,147,148,5,102,0,0,148,149,5,97, 0,0,149,150,5,108,0,0,150,151,5,115,0,0,151,152,5,101,0,0,152,28, 1,0,0,0,153,154,5,97,0,0,154,155,5,110,0,0,155,156,5,100,0,0,156, 30,1,0,0,0,157,158,5,111,0,0,158,159,5,114,0,0,159,32,1,0,0,0,160, 161,5,110,0,0,161,162,5,111,0,0,162,163,5,116,0,0,163,34,1,0,0,0, 164,165,5,120,0,0,165,166,5,111,0,0,166,167,5,114,0,0,167,36,1,0, 0,0,168,169,5,61,0,0,169,170,5,62,0,0,170,38,1,0,0,0,171,172,5,105, 0,0,172,173,5,109,0,0,173,174,5,112,0,0,174,175,5,108,0,0,175,176, 5,105,0,0,176,177,5,101,0,0,177,178,5,115,0,0,178,40,1,0,0,0,179, 180,5,114,0,0,180,181,5,101,0,0,181,182,5,46,0,0,182,183,5,43,0, 0,183,197,5,43,0,0,184,185,5,115,0,0,185,186,5,116,0,0,186,187,5, 114,0,0,187,188,5,46,0,0,188,189,5,43,0,0,189,197,5,43,0,0,190,191, 5,115,0,0,191,192,5,116,0,0,192,193,5,114,0,0,193,194,5,46,0,0,194, 195,5,60,0,0,195,197,5,61,0,0,196,179,1,0,0,0,196,184,1,0,0,0,196, 190,1,0,0,0,197,42,1,0,0,0,198,486,3,55,27,0,199,200,5,114,0,0,200, 201,5,101,0,0,201,202,5,46,0,0,202,486,5,43,0,0,203,204,5,114,0, 0,204,205,5,101,0,0,205,206,5,46,0,0,206,486,5,42,0,0,207,208,5, 115,0,0,208,209,5,116,0,0,209,210,5,114,0,0,210,211,5,46,0,0,211, 212,5,108,0,0,212,213,5,101,0,0,213,486,5,110,0,0,214,215,5,115, 0,0,215,216,5,116,0,0,216,217,5,114,0,0,217,218,5,46,0,0,218,219, 5,105,0,0,219,220,5,110,0,0,220,221,5,95,0,0,221,222,5,114,0,0,222, 486,5,101,0,0,223,224,5,115,0,0,224,225,5,116,0,0,225,226,5,114, 0,0,226,227,5,46,0,0,227,228,5,116,0,0,228,229,5,111,0,0,229,230, 5,95,0,0,230,231,5,114,0,0,231,486,5,101,0,0,232,233,5,114,0,0,233, 234,5,101,0,0,234,235,5,46,0,0,235,236,5,110,0,0,236,237,5,111,0, 0,237,238,5,110,0,0,238,486,5,101,0,0,239,240,5,114,0,0,240,241, 5,101,0,0,241,242,5,46,0,0,242,243,5,97,0,0,243,244,5,108,0,0,244, 486,5,108,0,0,245,246,5,114,0,0,246,247,5,101,0,0,247,248,5,46,0, 0,248,249,5,97,0,0,249,250,5,108,0,0,250,251,5,108,0,0,251,252,5, 99,0,0,252,253,5,104,0,0,253,254,5,97,0,0,254,486,5,114,0,0,255, 256,5,115,0,0,256,257,5,116,0,0,257,258,5,114,0,0,258,259,5,46,0, 0,259,260,5,97,0,0,260,486,5,116,0,0,261,262,5,115,0,0,262,263,5, 116,0,0,263,264,5,114,0,0,264,265,5,46,0,0,265,266,5,115,0,0,266, 267,5,117,0,0,267,268,5,98,0,0,268,269,5,115,0,0,269,270,5,116,0, 0,270,486,5,114,0,0,271,272,5,115,0,0,272,273,5,116,0,0,273,274, 5,114,0,0,274,275,5,46,0,0,275,276,5,112,0,0,276,277,5,114,0,0,277, 278,5,101,0,0,278,279,5,102,0,0,279,280,5,105,0,0,280,281,5,120, 0,0,281,282,5,111,0,0,282,486,5,102,0,0,283,284,5,115,0,0,284,285, 5,116,0,0,285,286,5,114,0,0,286,287,5,46,0,0,287,288,5,115,0,0,288, 289,5,117,0,0,289,290,5,102,0,0,290,291,5,102,0,0,291,292,5,105, 0,0,292,293,5,120,0,0,293,294,5,111,0,0,294,486,5,102,0,0,295,296, 5,115,0,0,296,297,5,116,0,0,297,298,5,114,0,0,298,299,5,46,0,0,299, 300,5,99,0,0,300,301,5,111,0,0,301,302,5,110,0,0,302,303,5,116,0, 0,303,304,5,97,0,0,304,305,5,105,0,0,305,306,5,110,0,0,306,486,5, 115,0,0,307,308,5,115,0,0,308,309,5,116,0,0,309,310,5,114,0,0,310, 311,5,46,0,0,311,312,5,105,0,0,312,313,5,110,0,0,313,314,5,100,0, 0,314,315,5,101,0,0,315,316,5,120,0,0,316,317,5,111,0,0,317,486, 5,102,0,0,318,319,5,115,0,0,319,320,5,116,0,0,320,321,5,114,0,0, 321,322,5,46,0,0,322,323,5,114,0,0,323,324,5,101,0,0,324,325,5,112, 0,0,325,326,5,108,0,0,326,327,5,97,0,0,327,328,5,99,0,0,328,486, 5,101,0,0,329,330,5,115,0,0,330,331,5,116,0,0,331,332,5,114,0,0, 332,333,5,46,0,0,333,334,5,114,0,0,334,335,5,101,0,0,335,336,5,112, 0,0,336,337,5,108,0,0,337,338,5,97,0,0,338,339,5,99,0,0,339,340, 5,101,0,0,340,341,5,95,0,0,341,342,5,97,0,0,342,343,5,108,0,0,343, 486,5,108,0,0,344,345,5,115,0,0,345,346,5,116,0,0,346,347,5,114, 0,0,347,348,5,46,0,0,348,349,5,114,0,0,349,350,5,101,0,0,350,351, 5,112,0,0,351,352,5,108,0,0,352,353,5,97,0,0,353,354,5,99,0,0,354, 355,5,101,0,0,355,356,5,95,0,0,356,357,5,114,0,0,357,486,5,101,0, 0,358,359,5,115,0,0,359,360,5,116,0,0,360,361,5,114,0,0,361,362, 5,46,0,0,362,363,5,114,0,0,363,364,5,101,0,0,364,365,5,112,0,0,365, 366,5,108,0,0,366,367,5,97,0,0,367,368,5,99,0,0,368,369,5,101,0, 0,369,370,5,95,0,0,370,371,5,114,0,0,371,372,5,101,0,0,372,373,5, 95,0,0,373,374,5,97,0,0,374,375,5,108,0,0,375,486,5,108,0,0,376, 377,5,114,0,0,377,378,5,101,0,0,378,379,5,46,0,0,379,380,5,117,0, 0,380,381,5,110,0,0,381,382,5,105,0,0,382,383,5,111,0,0,383,486, 5,110,0,0,384,385,5,114,0,0,385,386,5,101,0,0,386,387,5,46,0,0,387, 388,5,105,0,0,388,389,5,110,0,0,389,390,5,116,0,0,390,391,5,101, 0,0,391,486,5,114,0,0,392,393,5,114,0,0,393,394,5,101,0,0,394,395, 5,46,0,0,395,396,5,99,0,0,396,397,5,111,0,0,397,398,5,109,0,0,398, 486,5,112,0,0,399,400,5,114,0,0,400,401,5,101,0,0,401,402,5,46,0, 0,402,403,5,100,0,0,403,404,5,105,0,0,404,405,5,102,0,0,405,486, 5,102,0,0,406,407,5,114,0,0,407,408,5,101,0,0,408,409,5,46,0,0,409, 410,5,111,0,0,410,411,5,112,0,0,411,486,5,116,0,0,412,413,5,114, 0,0,413,414,5,101,0,0,414,415,5,46,0,0,415,416,5,114,0,0,416,417, 5,97,0,0,417,418,5,110,0,0,418,419,5,103,0,0,419,486,5,101,0,0,420, 421,5,114,0,0,421,422,5,101,0,0,422,423,5,46,0,0,423,424,5,108,0, 0,424,425,5,111,0,0,425,426,5,111,0,0,426,486,5,112,0,0,427,428, 5,115,0,0,428,429,5,116,0,0,429,430,5,114,0,0,430,431,5,46,0,0,431, 432,5,105,0,0,432,433,5,115,0,0,433,434,5,95,0,0,434,435,5,100,0, 0,435,436,5,105,0,0,436,437,5,103,0,0,437,438,5,105,0,0,438,486, 5,116,0,0,439,440,5,115,0,0,440,441,5,116,0,0,441,442,5,114,0,0, 442,443,5,46,0,0,443,444,5,116,0,0,444,445,5,111,0,0,445,446,5,95, 0,0,446,447,5,99,0,0,447,448,5,111,0,0,448,449,5,100,0,0,449,486, 5,101,0,0,450,451,5,115,0,0,451,452,5,116,0,0,452,453,5,114,0,0, 453,454,5,46,0,0,454,455,5,102,0,0,455,456,5,114,0,0,456,457,5,111, 0,0,457,458,5,109,0,0,458,459,5,95,0,0,459,460,5,99,0,0,460,461, 5,111,0,0,461,462,5,100,0,0,462,486,5,101,0,0,463,464,5,115,0,0, 464,465,5,116,0,0,465,466,5,114,0,0,466,467,5,46,0,0,467,468,5,116, 0,0,468,469,5,111,0,0,469,470,5,46,0,0,470,471,5,105,0,0,471,472, 5,110,0,0,472,486,5,116,0,0,473,474,5,115,0,0,474,475,5,116,0,0, 475,476,5,114,0,0,476,477,5,46,0,0,477,478,5,102,0,0,478,479,5,114, 0,0,479,480,5,111,0,0,480,481,5,109,0,0,481,482,5,95,0,0,482,483, 5,105,0,0,483,484,5,110,0,0,484,486,5,116,0,0,485,198,1,0,0,0,485, 199,1,0,0,0,485,203,1,0,0,0,485,207,1,0,0,0,485,214,1,0,0,0,485, 223,1,0,0,0,485,232,1,0,0,0,485,239,1,0,0,0,485,245,1,0,0,0,485, 255,1,0,0,0,485,261,1,0,0,0,485,271,1,0,0,0,485,283,1,0,0,0,485, 295,1,0,0,0,485,307,1,0,0,0,485,318,1,0,0,0,485,329,1,0,0,0,485, 344,1,0,0,0,485,358,1,0,0,0,485,376,1,0,0,0,485,384,1,0,0,0,485, 392,1,0,0,0,485,399,1,0,0,0,485,406,1,0,0,0,485,412,1,0,0,0,485, 420,1,0,0,0,485,427,1,0,0,0,485,439,1,0,0,0,485,450,1,0,0,0,485, 463,1,0,0,0,485,473,1,0,0,0,486,44,1,0,0,0,487,490,3,59,29,0,488, 490,3,49,24,0,489,487,1,0,0,0,489,488,1,0,0,0,490,492,1,0,0,0,491, 493,3,47,23,0,492,491,1,0,0,0,493,494,1,0,0,0,494,492,1,0,0,0,494, 495,1,0,0,0,495,46,1,0,0,0,496,497,3,65,32,0,497,498,3,49,24,0,498, 509,1,0,0,0,499,500,3,65,32,0,500,501,3,49,24,0,501,502,3,69,34, 0,502,503,3,61,30,0,503,504,3,71,35,0,504,509,1,0,0,0,505,506,3, 67,33,0,506,507,3,49,24,0,507,509,1,0,0,0,508,496,1,0,0,0,508,499, 1,0,0,0,508,505,1,0,0,0,509,48,1,0,0,0,510,511,3,87,43,0,511,512, 3,59,29,0,512,513,3,85,42,0,513,50,1,0,0,0,514,515,5,100,0,0,515, 516,5,105,0,0,516,517,5,118,0,0,517,52,1,0,0,0,518,519,5,109,0,0, 519,520,5,111,0,0,520,521,5,100,0,0,521,54,1,0,0,0,522,523,5,97, 0,0,523,524,5,98,0,0,524,525,5,115,0,0,525,56,1,0,0,0,526,531,5, 34,0,0,527,530,3,63,31,0,528,530,9,0,0,0,529,527,1,0,0,0,529,528, 1,0,0,0,530,533,1,0,0,0,531,532,1,0,0,0,531,529,1,0,0,0,532,534, 1,0,0,0,533,531,1,0,0,0,534,535,5,34,0,0,535,58,1,0,0,0,536,541, 3,93,46,0,537,540,3,95,47,0,538,540,3,97,48,0,539,537,1,0,0,0,539, 538,1,0,0,0,540,543,1,0,0,0,541,539,1,0,0,0,541,542,1,0,0,0,542, 60,1,0,0,0,543,541,1,0,0,0,544,546,5,45,0,0,545,544,1,0,0,0,545, 546,1,0,0,0,546,548,1,0,0,0,547,549,3,97,48,0,548,547,1,0,0,0,549, 550,1,0,0,0,550,548,1,0,0,0,550,551,1,0,0,0,551,62,1,0,0,0,552,553, 5,92,0,0,553,554,7,0,0,0,554,64,1,0,0,0,555,556,5,46,0,0,556,66, 1,0,0,0,557,558,5,46,0,0,558,559,5,46,0,0,559,68,1,0,0,0,560,561, 5,91,0,0,561,70,1,0,0,0,562,563,5,93,0,0,563,72,1,0,0,0,564,565, 5,42,0,0,565,74,1,0,0,0,566,567,5,43,0,0,567,76,1,0,0,0,568,569, 5,45,0,0,569,78,1,0,0,0,570,571,5,94,0,0,571,80,1,0,0,0,572,573, 5,62,0,0,573,574,5,61,0,0,574,82,1,0,0,0,575,576,5,60,0,0,576,577, 5,61,0,0,577,84,1,0,0,0,578,579,5,62,0,0,579,86,1,0,0,0,580,581, 5,60,0,0,581,88,1,0,0,0,582,584,7,1,0,0,583,582,1,0,0,0,584,585, 1,0,0,0,585,583,1,0,0,0,585,586,1,0,0,0,586,587,1,0,0,0,587,588, 6,44,0,0,588,90,1,0,0,0,589,593,5,35,0,0,590,592,9,0,0,0,591,590, 1,0,0,0,592,595,1,0,0,0,593,594,1,0,0,0,593,591,1,0,0,0,594,596, 1,0,0,0,595,593,1,0,0,0,596,597,5,10,0,0,597,598,1,0,0,0,598,599, 6,45,0,0,599,92,1,0,0,0,600,601,7,2,0,0,601,94,1,0,0,0,602,604,7, 3,0,0,603,602,1,0,0,0,604,96,1,0,0,0,605,606,2,48,57,0,606,98,1, 0,0,0,15,0,196,485,489,494,508,529,531,539,541,545,550,585,593,603, 1,6,0,0 ] class IslaLanguageLexer(Lexer): atn = ATNDeserializer().deserialize(serializedATN()) decisionsToDFA = [ DFA(ds, i) for i, ds in enumerate(atn.decisionToState) ] T__0 = 1 T__1 = 2 T__2 = 3 T__3 = 4 T__4 = 5 T__5 = 6 T__6 = 7 T__7 = 8 T__8 = 9 T__9 = 10 T__10 = 11 T__11 = 12 T__12 = 13 T__13 = 14 AND = 15 OR = 16 NOT = 17 XOR = 18 IMPLIES_SMT = 19 IMPLIES_ISLA = 20 SMT_INFIX_RE_STR = 21 SMT_NONBINARY_OP = 22 XPATHEXPR = 23 VAR_TYPE = 24 DIV = 25 MOD = 26 ABS = 27 STRING = 28 ID = 29 INT = 30 ESC = 31 DOT = 32 TWODOTS = 33 BROP = 34 BRCL = 35 MUL = 36 PLUS = 37 MINUS = 38 EXP = 39 GEQ = 40 LEQ = 41 GT = 42 LT = 43 WS = 44 LINE_COMMENT = 45 channelNames = [ u"DEFAULT_TOKEN_CHANNEL", u"HIDDEN" ] modeNames = [ "DEFAULT_MODE" ] literalNames = [ "<INVALID>", "'const'", "':'", "';'", "'forall'", "'in'", "'exists'", "'='", "'int'", "'iff'", "'('", "','", "')'", "'true'", "'false'", "'and'", "'or'", "'not'", "'xor'", "'=>'", "'implies'", "'div'", "'mod'", "'abs'", "'.'", "'..'", "'['", "']'", "'*'", "'+'", "'-'", "'^'", "'>='", "'<='", "'>'", "'<'" ] symbolicNames = [ "<INVALID>", "AND", "OR", "NOT", "XOR", "IMPLIES_SMT", "IMPLIES_ISLA", "SMT_INFIX_RE_STR", "SMT_NONBINARY_OP", "XPATHEXPR", "VAR_TYPE", "DIV", "MOD", "ABS", "STRING", "ID", "INT", "ESC", "DOT", "TWODOTS", "BROP", "BRCL", "MUL", "PLUS", "MINUS", "EXP", "GEQ", "LEQ", "GT", "LT", "WS", "LINE_COMMENT" ] ruleNames = [ "T__0", "T__1", "T__2", "T__3", "T__4", "T__5", "T__6", "T__7", "T__8", "T__9", "T__10", "T__11", "T__12", "T__13", "AND", "OR", "NOT", "XOR", "IMPLIES_SMT", "IMPLIES_ISLA", "SMT_INFIX_RE_STR", "SMT_NONBINARY_OP", "XPATHEXPR", "XPATHSEGMENT", "VAR_TYPE", "DIV", "MOD", "ABS", "STRING", "ID", "INT", "ESC", "DOT", "TWODOTS", "BROP", "BRCL", "MUL", "PLUS", "MINUS", "EXP", "GEQ", "LEQ", "GT", "LT", "WS", "LINE_COMMENT", "INIT_ID_LETTER", "ID_LETTER", "DIGIT" ] grammarFileName = "IslaLanguage.g4" def __init__(self, input=None, output:TextIO = sys.stdout): super().__init__(input, output) self.checkVersion("4.13.0") self._interp = LexerATNSimulator(self, self.atn, self.decisionsToDFA, PredictionContextCache()) self._actions = None self._predicates = None
PypiClean
/gamification-engine-0.4.0.tar.gz/gamification-engine-0.4.0/gengine/app/jsscripts/node_modules/intl/locale-data/jsonp/ms-SG.js
IntlPolyfill.__addLocaleData({locale:"ms-SG",date:{ca:["gregory","buddhist","chinese","coptic","dangi","ethioaa","ethiopic","generic","hebrew","indian","islamic","islamicc","japanese","persian","roc"],hourNo0:true,hour12:true,formats:{short:"{1} {0}",medium:"{1} {0}",full:"{1} {0}",long:"{1} {0}",availableFormats:{"d":"d","E":"ccc",Ed:"d E",Ehm:"E h:mm a",EHm:"E HH:mm",Ehms:"E h:mm:ss a",EHms:"E HH:mm:ss",Gy:"G y",GyMMM:"G y MMM",GyMMMd:"G y MMM d",GyMMMEd:"G y MMM d, E","h":"h a","H":"HH",hm:"h:mm a",Hm:"HH:mm",Hmm:"H:mm",hms:"h:mm:ss a",Hms:"HH:mm:ss",hmsv:"h:mm:ss a v",Hmsv:"HH:mm:ss v",hmv:"h:mm a v",Hmv:"HH:mm v","M":"L",Md:"d-M",MEd:"E, d-M",MMdd:"dd/MM",MMM:"LLL",MMMd:"d MMM",MMMEd:"E, d MMM",MMMMd:"d MMMM",ms:"mm:ss","y":"y",yM:"M-y",yMd:"d/M/y",yMEd:"E, d/M/y",yMMM:"MMM y",yMMMd:"d MMM y",yMMMEd:"E, d MMM y",yMMMM:"y MMMM",yQQQ:"QQQ y",yQQQQ:"QQQQ y"},dateFormats:{yMMMMEEEEd:"EEEE, d MMMM y",yMMMMd:"d MMMM y",yMMMd:"d MMM y",yMd:"d/MM/yy"},timeFormats:{hmmsszzzz:"h:mm:ss a zzzz",hmsz:"h:mm:ss a z",hms:"h:mm:ss a",hm:"h:mm a"}},calendars:{buddhist:{months:{narrow:["J","F","M","A","M","J","J","O","S","O","N","D"],short:["Jan","Feb","Mac","Apr","Mei","Jun","Jul","Ogo","Sep","Okt","Nov","Dis"],long:["Januari","Februari","Mac","April","Mei","Jun","Julai","Ogos","September","Oktober","November","Disember"]},days:{narrow:["A","I","S","R","K","J","S"],short:["Ahd","Isn","Sel","Rab","Kha","Jum","Sab"],long:["Ahad","Isnin","Selasa","Rabu","Khamis","Jumaat","Sabtu"]},eras:{narrow:["BE"],short:["BE"],long:["BE"]},dayPeriods:{am:"PG",pm:"PTG"}},chinese:{months:{narrow:["Jn","Fb","Mc","Ap","Me","Ju","Jl","Og","Sp","Ok","Nv","Ds"],short:["Jan","Feb","Mac","Apr","Mei","Jun","Jul","Ogo","Sep","Okt","Nov","Dis"],long:["Januari","Februari","Mac","April","Mei","Jun","Julai","Ogos","September","Oktober","November","Disember"]},days:{narrow:["A","I","S","R","K","J","S"],short:["Ahd","Isn","Sel","Rab","Kha","Jum","Sab"],long:["Ahad","Isnin","Selasa","Rabu","Khamis","Jumaat","Sabtu"]},dayPeriods:{am:"PG",pm:"PTG"}},coptic:{months:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12","13"],short:["Tout","Baba","Hator","Kiahk","Toba","Amshir","Baramhat","Baramouda","Bashans","Paona","Epep","Mesra","Nasie"],long:["Tout","Baba","Hator","Kiahk","Toba","Amshir","Baramhat","Baramouda","Bashans","Paona","Epep","Mesra","Nasie"]},days:{narrow:["A","I","S","R","K","J","S"],short:["Ahd","Isn","Sel","Rab","Kha","Jum","Sab"],long:["Ahad","Isnin","Selasa","Rabu","Khamis","Jumaat","Sabtu"]},eras:{narrow:["ERA0","ERA1"],short:["ERA0","ERA1"],long:["ERA0","ERA1"]},dayPeriods:{am:"PG",pm:"PTG"}},dangi:{months:{narrow:["Jn","Fb","Mc","Ap","Me","Ju","Jl","Og","Sp","Ok","Nv","Ds"],short:["Jan","Feb","Mac","Apr","Mei","Jun","Jul","Ogo","Sep","Okt","Nov","Dis"],long:["Januari","Februari","Mac","April","Mei","Jun","Julai","Ogos","September","Oktober","November","Disember"]},days:{narrow:["A","I","S","R","K","J","S"],short:["Ahd","Isn","Sel","Rab","Kha","Jum","Sab"],long:["Ahad","Isnin","Selasa","Rabu","Khamis","Jumaat","Sabtu"]},dayPeriods:{am:"PG",pm:"PTG"}},ethiopic:{months:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12","13"],short:["Meskerem","Tekemt","Hedar","Tahsas","Ter","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehasse","Pagumen"],long:["Meskerem","Tekemt","Hedar","Tahsas","Ter","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehasse","Pagumen"]},days:{narrow:["A","I","S","R","K","J","S"],short:["Ahd","Isn","Sel","Rab","Kha","Jum","Sab"],long:["Ahad","Isnin","Selasa","Rabu","Khamis","Jumaat","Sabtu"]},eras:{narrow:["ERA0","ERA1"],short:["ERA0","ERA1"],long:["ERA0","ERA1"]},dayPeriods:{am:"PG",pm:"PTG"}},ethioaa:{months:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12","13"],short:["Meskerem","Tekemt","Hedar","Tahsas","Ter","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehasse","Pagumen"],long:["Meskerem","Tekemt","Hedar","Tahsas","Ter","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehasse","Pagumen"]},days:{narrow:["A","I","S","R","K","J","S"],short:["Ahd","Isn","Sel","Rab","Kha","Jum","Sab"],long:["Ahad","Isnin","Selasa","Rabu","Khamis","Jumaat","Sabtu"]},eras:{narrow:["ERA0"],short:["ERA0"],long:["ERA0"]},dayPeriods:{am:"PG",pm:"PTG"}},generic:{months:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12"],short:["M01","M02","M03","M04","M05","M06","M07","M08","M09","M10","M11","M12"],long:["M01","M02","M03","M04","M05","M06","M07","M08","M09","M10","M11","M12"]},days:{narrow:["A","I","S","R","K","J","S"],short:["Ahd","Isn","Sel","Rab","Kha","Jum","Sab"],long:["Ahad","Isnin","Selasa","Rabu","Khamis","Jumaat","Sabtu"]},eras:{narrow:["ERA0","ERA1"],short:["ERA0","ERA1"],long:["ERA0","ERA1"]},dayPeriods:{am:"PG",pm:"PTG"}},gregory:{months:{narrow:["J","F","M","A","M","J","J","O","S","O","N","D"],short:["Jan","Feb","Mac","Apr","Mei","Jun","Jul","Ogo","Sep","Okt","Nov","Dis"],long:["Januari","Februari","Mac","April","Mei","Jun","Julai","Ogos","September","Oktober","November","Disember"]},days:{narrow:["A","I","S","R","K","J","S"],short:["Ahd","Isn","Sel","Rab","Kha","Jum","Sab"],long:["Ahad","Isnin","Selasa","Rabu","Khamis","Jumaat","Sabtu"]},eras:{narrow:["S.M.","TM","BCE","CE"],short:["S.M.","TM","BCE","CE"],long:["S.M.","TM","BCE","CE"]},dayPeriods:{am:"PG",pm:"PTG"}},hebrew:{months:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12","13","7"],short:["Tishri","Heshvan","Kislev","Tevet","Shevat","Adar I","Adar","Nisan","Iyar","Sivan","Tamuz","Av","Elul","Adar II"],long:["Tishri","Heshvan","Kislev","Tevet","Shevat","Adar I","Adar","Nisan","Iyar","Sivan","Tamuz","Av","Elul","Adar II"]},days:{narrow:["A","I","S","R","K","J","S"],short:["Ahd","Isn","Sel","Rab","Kha","Jum","Sab"],long:["Ahad","Isnin","Selasa","Rabu","Khamis","Jumaat","Sabtu"]},eras:{narrow:["AM"],short:["AM"],long:["AM"]},dayPeriods:{am:"PG",pm:"PTG"}},indian:{months:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12"],short:["Chaitra","Vaisakha","Jyaistha","Asadha","Sravana","Bhadra","Asvina","Kartika","Agrahayana","Pausa","Magha","Phalguna"],long:["Chaitra","Vaisakha","Jyaistha","Asadha","Sravana","Bhadra","Asvina","Kartika","Agrahayana","Pausa","Magha","Phalguna"]},days:{narrow:["A","I","S","R","K","J","S"],short:["Ahd","Isn","Sel","Rab","Kha","Jum","Sab"],long:["Ahad","Isnin","Selasa","Rabu","Khamis","Jumaat","Sabtu"]},eras:{narrow:["Saka"],short:["Saka"],long:["Saka"]},dayPeriods:{am:"PG",pm:"PTG"}},islamic:{months:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12"],short:["Muh.","Saf.","Rab. I","Rab. II","Jum. I","Jum. II","Raj.","Sha.","Ram.","Shaw.","Dhuʻl-Q.","Dhuʻl-H."],long:["Muharram","Safar","Rabiʻ I","Rabiʻ II","Jumada I","Jumada II","Rajab","Shaʻban","Ramadan","Shawwal","Dhuʻl-Qiʻdah","Dhuʻl-Hijjah"]},days:{narrow:["A","I","S","R","K","J","S"],short:["Ahd","Isn","Sel","Rab","Kha","Jum","Sab"],long:["Ahad","Isnin","Selasa","Rabu","Khamis","Jumaat","Sabtu"]},eras:{narrow:["AH"],short:["AH"],long:["AH"]},dayPeriods:{am:"PG",pm:"PTG"}},islamicc:{months:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12"],short:["Muh.","Saf.","Rab. I","Rab. II","Jum. I","Jum. II","Raj.","Sha.","Ram.","Shaw.","Dhuʻl-Q.","Dhuʻl-H."],long:["Muharram","Safar","Rabiʻ I","Rabiʻ II","Jumada I","Jumada II","Rajab","Shaʻban","Ramadan","Shawwal","Dhuʻl-Qiʻdah","Dhuʻl-Hijjah"]},days:{narrow:["A","I","S","R","K","J","S"],short:["Ahd","Isn","Sel","Rab","Kha","Jum","Sab"],long:["Ahad","Isnin","Selasa","Rabu","Khamis","Jumaat","Sabtu"]},eras:{narrow:["AH"],short:["AH"],long:["AH"]},dayPeriods:{am:"PG",pm:"PTG"}},japanese:{months:{narrow:["J","F","M","A","M","J","J","O","S","O","N","D"],short:["Jan","Feb","Mac","Apr","Mei","Jun","Jul","Ogo","Sep","Okt","Nov","Dis"],long:["Januari","Februari","Mac","April","Mei","Jun","Julai","Ogos","September","Oktober","November","Disember"]},days:{narrow:["A","I","S","R","K","J","S"],short:["Ahd","Isn","Sel","Rab","Kha","Jum","Sab"],long:["Ahad","Isnin","Selasa","Rabu","Khamis","Jumaat","Sabtu"]},eras:{narrow:["Taika (645–650)","Hakuchi (650–671)","Hakuhō (672–686)","Shuchō (686–701)","Taihō (701–704)","Keiun (704–708)","Wadō (708–715)","Reiki (715–717)","Yōrō (717–724)","Jinki (724–729)","Tenpyō (729–749)","Tenpyō-kampō (749-749)","Tenpyō-shōhō (749-757)","Tenpyō-hōji (757-765)","Tenpyō-jingo (765-767)","Jingo-keiun (767-770)","Hōki (770–780)","Ten-ō (781-782)","Enryaku (782–806)","Daidō (806–810)","Kōnin (810–824)","Tenchō (824–834)","Jōwa (834–848)","Kajō (848–851)","Ninju (851–854)","Saikō (854–857)","Ten-an (857-859)","Jōgan (859–877)","Gangyō (877–885)","Ninna (885–889)","Kanpyō (889–898)","Shōtai (898–901)","Engi (901–923)","Enchō (923–931)","Jōhei (931–938)","Tengyō (938–947)","Tenryaku (947–957)","Tentoku (957–961)","Ōwa (961–964)","Kōhō (964–968)","Anna (968–970)","Tenroku (970–973)","Ten’en (973–976)","Jōgen (976–978)","Tengen (978–983)","Eikan (983–985)","Kanna (985–987)","Eien (987–989)","Eiso (989–990)","Shōryaku (990–995)","Chōtoku (995–999)","Chōhō (999–1004)","Kankō (1004–1012)","Chōwa (1012–1017)","Kannin (1017–1021)","Jian (1021–1024)","Manju (1024–1028)","Chōgen (1028–1037)","Chōryaku (1037–1040)","Chōkyū (1040–1044)","Kantoku (1044–1046)","Eishō (1046–1053)","Tengi (1053–1058)","Kōhei (1058–1065)","Jiryaku (1065–1069)","Enkyū (1069–1074)","Shōho (1074–1077)","Shōryaku (1077–1081)","Eihō (1081–1084)","Ōtoku (1084–1087)","Kanji (1087–1094)","Kahō (1094–1096)","Eichō (1096–1097)","Jōtoku (1097–1099)","Kōwa (1099–1104)","Chōji (1104–1106)","Kashō (1106–1108)","Tennin (1108–1110)","Ten-ei (1110-1113)","Eikyū (1113–1118)","Gen’ei (1118–1120)","Hōan (1120–1124)","Tenji (1124–1126)","Daiji (1126–1131)","Tenshō (1131–1132)","Chōshō (1132–1135)","Hōen (1135–1141)","Eiji (1141–1142)","Kōji (1142–1144)","Ten’yō (1144–1145)","Kyūan (1145–1151)","Ninpei (1151–1154)","Kyūju (1154–1156)","Hōgen (1156–1159)","Heiji (1159–1160)","Eiryaku (1160–1161)","Ōho (1161–1163)","Chōkan (1163–1165)","Eiman (1165–1166)","Nin’an (1166–1169)","Kaō (1169–1171)","Shōan (1171–1175)","Angen (1175–1177)","Jishō (1177–1181)","Yōwa (1181–1182)","Juei (1182–1184)","Genryaku (1184–1185)","Bunji (1185–1190)","Kenkyū (1190–1199)","Shōji (1199–1201)","Kennin (1201–1204)","Genkyū (1204–1206)","Ken’ei (1206–1207)","Jōgen (1207–1211)","Kenryaku (1211–1213)","Kenpō (1213–1219)","Jōkyū (1219–1222)","Jōō (1222–1224)","Gennin (1224–1225)","Karoku (1225–1227)","Antei (1227–1229)","Kanki (1229–1232)","Jōei (1232–1233)","Tenpuku (1233–1234)","Bunryaku (1234–1235)","Katei (1235–1238)","Ryakunin (1238–1239)","En’ō (1239–1240)","Ninji (1240–1243)","Kangen (1243–1247)","Hōji (1247–1249)","Kenchō (1249–1256)","Kōgen (1256–1257)","Shōka (1257–1259)","Shōgen (1259–1260)","Bun’ō (1260–1261)","Kōchō (1261–1264)","Bun’ei (1264–1275)","Kenji (1275–1278)","Kōan (1278–1288)","Shōō (1288–1293)","Einin (1293–1299)","Shōan (1299–1302)","Kengen (1302–1303)","Kagen (1303–1306)","Tokuji (1306–1308)","Enkyō (1308–1311)","Ōchō (1311–1312)","Shōwa (1312–1317)","Bunpō (1317–1319)","Genō (1319–1321)","Genkō (1321–1324)","Shōchū (1324–1326)","Karyaku (1326–1329)","Gentoku (1329–1331)","Genkō (1331–1334)","Kenmu (1334–1336)","Engen (1336–1340)","Kōkoku (1340–1346)","Shōhei (1346–1370)","Kentoku (1370–1372)","Bunchū (1372–1375)","Tenju (1375–1379)","Kōryaku (1379–1381)","Kōwa (1381–1384)","Genchū (1384–1392)","Meitoku (1384–1387)","Kakei (1387–1389)","Kōō (1389–1390)","Meitoku (1390–1394)","Ōei (1394–1428)","Shōchō (1428–1429)","Eikyō (1429–1441)","Kakitsu (1441–1444)","Bun’an (1444–1449)","Hōtoku (1449–1452)","Kyōtoku (1452–1455)","Kōshō (1455–1457)","Chōroku (1457–1460)","Kanshō (1460–1466)","Bunshō (1466–1467)","Ōnin (1467–1469)","Bunmei (1469–1487)","Chōkyō (1487–1489)","Entoku (1489–1492)","Meiō (1492–1501)","Bunki (1501–1504)","Eishō (1504–1521)","Taiei (1521–1528)","Kyōroku (1528–1532)","Tenbun (1532–1555)","Kōji (1555–1558)","Eiroku (1558–1570)","Genki (1570–1573)","Tenshō (1573–1592)","Bunroku (1592–1596)","Keichō (1596–1615)","Genna (1615–1624)","Kan’ei (1624–1644)","Shōho (1644–1648)","Keian (1648–1652)","Jōō (1652–1655)","Meireki (1655–1658)","Manji (1658–1661)","Kanbun (1661–1673)","Enpō (1673–1681)","Tenna (1681–1684)","Jōkyō (1684–1688)","Genroku (1688–1704)","Hōei (1704–1711)","Shōtoku (1711–1716)","Kyōhō (1716–1736)","Genbun (1736–1741)","Kanpō (1741–1744)","Enkyō (1744–1748)","Kan’en (1748–1751)","Hōreki (1751–1764)","Meiwa (1764–1772)","An’ei (1772–1781)","Tenmei (1781–1789)","Kansei (1789–1801)","Kyōwa (1801–1804)","Bunka (1804–1818)","Bunsei (1818–1830)","Tenpō (1830–1844)","Kōka (1844–1848)","Kaei (1848–1854)","Ansei (1854–1860)","Man’en (1860–1861)","Bunkyū (1861–1864)","Genji (1864–1865)","Keiō (1865–1868)","M","T","S","H"],short:["Taika (645–650)","Hakuchi (650–671)","Hakuhō (672–686)","Shuchō (686–701)","Taihō (701–704)","Keiun (704–708)","Wadō (708–715)","Reiki (715–717)","Yōrō (717–724)","Jinki (724–729)","Tenpyō (729–749)","Tenpyō-kampō (749-749)","Tenpyō-shōhō (749-757)","Tenpyō-hōji (757-765)","Tenpyō-jingo (765-767)","Jingo-keiun (767-770)","Hōki (770–780)","Ten-ō (781-782)","Enryaku (782–806)","Daidō (806–810)","Kōnin (810–824)","Tenchō (824–834)","Jōwa (834–848)","Kajō (848–851)","Ninju (851–854)","Saikō (854–857)","Ten-an (857-859)","Jōgan (859–877)","Gangyō (877–885)","Ninna (885–889)","Kanpyō (889–898)","Shōtai (898–901)","Engi (901–923)","Enchō (923–931)","Jōhei (931–938)","Tengyō (938–947)","Tenryaku (947–957)","Tentoku (957–961)","Ōwa (961–964)","Kōhō (964–968)","Anna (968–970)","Tenroku (970–973)","Ten’en (973–976)","Jōgen (976–978)","Tengen (978–983)","Eikan (983–985)","Kanna (985–987)","Eien (987–989)","Eiso (989–990)","Shōryaku (990–995)","Chōtoku (995–999)","Chōhō (999–1004)","Kankō (1004–1012)","Chōwa (1012–1017)","Kannin (1017–1021)","Jian (1021–1024)","Manju (1024–1028)","Chōgen (1028–1037)","Chōryaku (1037–1040)","Chōkyū (1040–1044)","Kantoku (1044–1046)","Eishō (1046–1053)","Tengi (1053–1058)","Kōhei (1058–1065)","Jiryaku (1065–1069)","Enkyū (1069–1074)","Shōho (1074–1077)","Shōryaku (1077–1081)","Eihō (1081–1084)","Ōtoku (1084–1087)","Kanji (1087–1094)","Kahō (1094–1096)","Eichō (1096–1097)","Jōtoku (1097–1099)","Kōwa (1099–1104)","Chōji (1104–1106)","Kashō (1106–1108)","Tennin (1108–1110)","Ten-ei (1110-1113)","Eikyū (1113–1118)","Gen’ei (1118–1120)","Hōan (1120–1124)","Tenji (1124–1126)","Daiji (1126–1131)","Tenshō (1131–1132)","Chōshō (1132–1135)","Hōen (1135–1141)","Eiji (1141–1142)","Kōji (1142–1144)","Ten’yō (1144–1145)","Kyūan (1145–1151)","Ninpei (1151–1154)","Kyūju (1154–1156)","Hōgen (1156–1159)","Heiji (1159–1160)","Eiryaku (1160–1161)","Ōho (1161–1163)","Chōkan (1163–1165)","Eiman (1165–1166)","Nin’an (1166–1169)","Kaō (1169–1171)","Shōan (1171–1175)","Angen (1175–1177)","Jishō (1177–1181)","Yōwa (1181–1182)","Juei (1182–1184)","Genryaku (1184–1185)","Bunji (1185–1190)","Kenkyū (1190–1199)","Shōji (1199–1201)","Kennin (1201–1204)","Genkyū (1204–1206)","Ken’ei (1206–1207)","Jōgen (1207–1211)","Kenryaku (1211–1213)","Kenpō (1213–1219)","Jōkyū (1219–1222)","Jōō (1222–1224)","Gennin (1224–1225)","Karoku (1225–1227)","Antei (1227–1229)","Kanki (1229–1232)","Jōei (1232–1233)","Tenpuku (1233–1234)","Bunryaku (1234–1235)","Katei (1235–1238)","Ryakunin (1238–1239)","En’ō (1239–1240)","Ninji (1240–1243)","Kangen (1243–1247)","Hōji (1247–1249)","Kenchō (1249–1256)","Kōgen (1256–1257)","Shōka (1257–1259)","Shōgen (1259–1260)","Bun’ō (1260–1261)","Kōchō (1261–1264)","Bun’ei (1264–1275)","Kenji (1275–1278)","Kōan (1278–1288)","Shōō (1288–1293)","Einin (1293–1299)","Shōan (1299–1302)","Kengen (1302–1303)","Kagen (1303–1306)","Tokuji (1306–1308)","Enkyō (1308–1311)","Ōchō (1311–1312)","Shōwa (1312–1317)","Bunpō (1317–1319)","Genō (1319–1321)","Genkō (1321–1324)","Shōchū (1324–1326)","Karyaku (1326–1329)","Gentoku (1329–1331)","Genkō (1331–1334)","Kenmu (1334–1336)","Engen (1336–1340)","Kōkoku (1340–1346)","Shōhei (1346–1370)","Kentoku (1370–1372)","Bunchū (1372–1375)","Tenju (1375–1379)","Kōryaku (1379–1381)","Kōwa (1381–1384)","Genchū (1384–1392)","Meitoku (1384–1387)","Kakei (1387–1389)","Kōō (1389–1390)","Meitoku (1390–1394)","Ōei (1394–1428)","Shōchō (1428–1429)","Eikyō (1429–1441)","Kakitsu (1441–1444)","Bun’an (1444–1449)","Hōtoku (1449–1452)","Kyōtoku (1452–1455)","Kōshō (1455–1457)","Chōroku (1457–1460)","Kanshō (1460–1466)","Bunshō (1466–1467)","Ōnin (1467–1469)","Bunmei (1469–1487)","Chōkyō (1487–1489)","Entoku (1489–1492)","Meiō (1492–1501)","Bunki (1501–1504)","Eishō (1504–1521)","Taiei (1521–1528)","Kyōroku (1528–1532)","Tenbun (1532–1555)","Kōji (1555–1558)","Eiroku (1558–1570)","Genki (1570–1573)","Tenshō (1573–1592)","Bunroku (1592–1596)","Keichō (1596–1615)","Genna (1615–1624)","Kan’ei (1624–1644)","Shōho (1644–1648)","Keian (1648–1652)","Jōō (1652–1655)","Meireki (1655–1658)","Manji (1658–1661)","Kanbun (1661–1673)","Enpō (1673–1681)","Tenna (1681–1684)","Jōkyō (1684–1688)","Genroku (1688–1704)","Hōei (1704–1711)","Shōtoku (1711–1716)","Kyōhō (1716–1736)","Genbun (1736–1741)","Kanpō (1741–1744)","Enkyō (1744–1748)","Kan’en (1748–1751)","Hōreki (1751–1764)","Meiwa (1764–1772)","An’ei (1772–1781)","Tenmei (1781–1789)","Kansei (1789–1801)","Kyōwa (1801–1804)","Bunka (1804–1818)","Bunsei (1818–1830)","Tenpō (1830–1844)","Kōka (1844–1848)","Kaei (1848–1854)","Ansei (1854–1860)","Man’en (1860–1861)","Bunkyū (1861–1864)","Genji (1864–1865)","Keiō (1865–1868)","Meiji","Taishō","Shōwa","Heisei"],long:["Taika (645–650)","Hakuchi (650–671)","Hakuhō (672–686)","Shuchō (686–701)","Taihō (701–704)","Keiun (704–708)","Wadō (708–715)","Reiki (715–717)","Yōrō (717–724)","Jinki (724–729)","Tenpyō (729–749)","Tenpyō-kampō (749-749)","Tenpyō-shōhō (749-757)","Tenpyō-hōji (757-765)","Tenpyō-jingo (765-767)","Jingo-keiun (767-770)","Hōki (770–780)","Ten-ō (781-782)","Enryaku (782–806)","Daidō (806–810)","Kōnin (810–824)","Tenchō (824–834)","Jōwa (834–848)","Kajō (848–851)","Ninju (851–854)","Saikō (854–857)","Ten-an (857-859)","Jōgan (859–877)","Gangyō (877–885)","Ninna (885–889)","Kanpyō (889–898)","Shōtai (898–901)","Engi (901–923)","Enchō (923–931)","Jōhei (931–938)","Tengyō (938–947)","Tenryaku (947–957)","Tentoku (957–961)","Ōwa (961–964)","Kōhō (964–968)","Anna (968–970)","Tenroku (970–973)","Ten’en (973–976)","Jōgen (976–978)","Tengen (978–983)","Eikan (983–985)","Kanna (985–987)","Eien (987–989)","Eiso (989–990)","Shōryaku (990–995)","Chōtoku (995–999)","Chōhō (999–1004)","Kankō (1004–1012)","Chōwa (1012–1017)","Kannin (1017–1021)","Jian (1021–1024)","Manju (1024–1028)","Chōgen (1028–1037)","Chōryaku (1037–1040)","Chōkyū (1040–1044)","Kantoku (1044–1046)","Eishō (1046–1053)","Tengi (1053–1058)","Kōhei (1058–1065)","Jiryaku (1065–1069)","Enkyū (1069–1074)","Shōho (1074–1077)","Shōryaku (1077–1081)","Eihō (1081–1084)","Ōtoku (1084–1087)","Kanji (1087–1094)","Kahō (1094–1096)","Eichō (1096–1097)","Jōtoku (1097–1099)","Kōwa (1099–1104)","Chōji (1104–1106)","Kashō (1106–1108)","Tennin (1108–1110)","Ten-ei (1110-1113)","Eikyū (1113–1118)","Gen’ei (1118–1120)","Hōan (1120–1124)","Tenji (1124–1126)","Daiji (1126–1131)","Tenshō (1131–1132)","Chōshō (1132–1135)","Hōen (1135–1141)","Eiji (1141–1142)","Kōji (1142–1144)","Ten’yō (1144–1145)","Kyūan (1145–1151)","Ninpei (1151–1154)","Kyūju (1154–1156)","Hōgen (1156–1159)","Heiji (1159–1160)","Eiryaku (1160–1161)","Ōho (1161–1163)","Chōkan (1163–1165)","Eiman (1165–1166)","Nin’an (1166–1169)","Kaō (1169–1171)","Shōan (1171–1175)","Angen (1175–1177)","Jishō (1177–1181)","Yōwa (1181–1182)","Juei (1182–1184)","Genryaku (1184–1185)","Bunji (1185–1190)","Kenkyū (1190–1199)","Shōji (1199–1201)","Kennin (1201–1204)","Genkyū (1204–1206)","Ken’ei (1206–1207)","Jōgen (1207–1211)","Kenryaku (1211–1213)","Kenpō (1213–1219)","Jōkyū (1219–1222)","Jōō (1222–1224)","Gennin (1224–1225)","Karoku (1225–1227)","Antei (1227–1229)","Kanki (1229–1232)","Jōei (1232–1233)","Tenpuku (1233–1234)","Bunryaku (1234–1235)","Katei (1235–1238)","Ryakunin (1238–1239)","En’ō (1239–1240)","Ninji (1240–1243)","Kangen (1243–1247)","Hōji (1247–1249)","Kenchō (1249–1256)","Kōgen (1256–1257)","Shōka (1257–1259)","Shōgen (1259–1260)","Bun’ō (1260–1261)","Kōchō (1261–1264)","Bun’ei (1264–1275)","Kenji (1275–1278)","Kōan (1278–1288)","Shōō (1288–1293)","Einin (1293–1299)","Shōan (1299–1302)","Kengen (1302–1303)","Kagen (1303–1306)","Tokuji (1306–1308)","Enkyō (1308–1311)","Ōchō (1311–1312)","Shōwa (1312–1317)","Bunpō (1317–1319)","Genō (1319–1321)","Genkō (1321–1324)","Shōchū (1324–1326)","Karyaku (1326–1329)","Gentoku (1329–1331)","Genkō (1331–1334)","Kenmu (1334–1336)","Engen (1336–1340)","Kōkoku (1340–1346)","Shōhei (1346–1370)","Kentoku (1370–1372)","Bunchū (1372–1375)","Tenju (1375–1379)","Kōryaku (1379–1381)","Kōwa (1381–1384)","Genchū (1384–1392)","Meitoku (1384–1387)","Kakei (1387–1389)","Kōō (1389–1390)","Meitoku (1390–1394)","Ōei (1394–1428)","Shōchō (1428–1429)","Eikyō (1429–1441)","Kakitsu (1441–1444)","Bun’an (1444–1449)","Hōtoku (1449–1452)","Kyōtoku (1452–1455)","Kōshō (1455–1457)","Chōroku (1457–1460)","Kanshō (1460–1466)","Bunshō (1466–1467)","Ōnin (1467–1469)","Bunmei (1469–1487)","Chōkyō (1487–1489)","Entoku (1489–1492)","Meiō (1492–1501)","Bunki (1501–1504)","Eishō (1504–1521)","Taiei (1521–1528)","Kyōroku (1528–1532)","Tenbun (1532–1555)","Kōji (1555–1558)","Eiroku (1558–1570)","Genki (1570–1573)","Tenshō (1573–1592)","Bunroku (1592–1596)","Keichō (1596–1615)","Genna (1615–1624)","Kan’ei (1624–1644)","Shōho (1644–1648)","Keian (1648–1652)","Jōō (1652–1655)","Meireki (1655–1658)","Manji (1658–1661)","Kanbun (1661–1673)","Enpō (1673–1681)","Tenna (1681–1684)","Jōkyō (1684–1688)","Genroku (1688–1704)","Hōei (1704–1711)","Shōtoku (1711–1716)","Kyōhō (1716–1736)","Genbun (1736–1741)","Kanpō (1741–1744)","Enkyō (1744–1748)","Kan’en (1748–1751)","Hōreki (1751–1764)","Meiwa (1764–1772)","An’ei (1772–1781)","Tenmei (1781–1789)","Kansei (1789–1801)","Kyōwa (1801–1804)","Bunka (1804–1818)","Bunsei (1818–1830)","Tenpō (1830–1844)","Kōka (1844–1848)","Kaei (1848–1854)","Ansei (1854–1860)","Man’en (1860–1861)","Bunkyū (1861–1864)","Genji (1864–1865)","Keiō (1865–1868)","Meiji","Taishō","Shōwa","Heisei"]},dayPeriods:{am:"PG",pm:"PTG"}},persian:{months:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12"],short:["Farvardin","Ordibehesht","Khordad","Tir","Mordad","Shahrivar","Mehr","Aban","Azar","Dey","Bahman","Esfand"],long:["Farvardin","Ordibehesht","Khordad","Tir","Mordad","Shahrivar","Mehr","Aban","Azar","Dey","Bahman","Esfand"]},days:{narrow:["A","I","S","R","K","J","S"],short:["Ahd","Isn","Sel","Rab","Kha","Jum","Sab"],long:["Ahad","Isnin","Selasa","Rabu","Khamis","Jumaat","Sabtu"]},eras:{narrow:["AP"],short:["AP"],long:["AP"]},dayPeriods:{am:"PG",pm:"PTG"}},roc:{months:{narrow:["J","F","M","A","M","J","J","O","S","O","N","D"],short:["Jan","Feb","Mac","Apr","Mei","Jun","Jul","Ogo","Sep","Okt","Nov","Dis"],long:["Januari","Februari","Mac","April","Mei","Jun","Julai","Ogos","September","Oktober","November","Disember"]},days:{narrow:["A","I","S","R","K","J","S"],short:["Ahd","Isn","Sel","Rab","Kha","Jum","Sab"],long:["Ahad","Isnin","Selasa","Rabu","Khamis","Jumaat","Sabtu"]},eras:{narrow:["Before R.O.C.","R.O.C."],short:["Before R.O.C.","R.O.C."],long:["Before R.O.C.","R.O.C."]},dayPeriods:{am:"PG",pm:"PTG"}}}},number:{nu:["latn"],patterns:{decimal:{positivePattern:"{number}",negativePattern:"{minusSign}{number}"},currency:{positivePattern:"{currency}{number}",negativePattern:"{minusSign}{currency}{number}"},percent:{positivePattern:"{number}{percentSign}",negativePattern:"{minusSign}{number}{percentSign}"}},symbols:{latn:{decimal:".",group:",",nan:"NaN",plusSign:"+",minusSign:"-",percentSign:"%",infinity:"∞"}},currencies:{AUD:"A$",BRL:"R$",CNY:"CN¥",EUR:"€",GBP:"£",HKD:"HK$",ILS:"₪",INR:"₹",JPY:"JP¥",KRW:"₩",MYR:"RM",NZD:"NZ$",SGD:"$",TWD:"NT$",VND:"₫",XAF:"FCFA",XCD:"EC$",XOF:"CFA",XPF:"CFPF"}}});
PypiClean
/Newcalls-0.0.1-cp37-cp37m-win_amd64.whl/newcalls/node_modules/typescript/lib/lib.es2022.array.d.ts
interface Array<T> { /** * Returns the item located at the specified index. * @param index The zero-based index of the desired code unit. A negative index will count back from the last item. */ at(index: number): T | undefined; } interface ReadonlyArray<T> { /** * Returns the item located at the specified index. * @param index The zero-based index of the desired code unit. A negative index will count back from the last item. */ at(index: number): T | undefined; } interface Int8Array { /** * Returns the item located at the specified index. * @param index The zero-based index of the desired code unit. A negative index will count back from the last item. */ at(index: number): number | undefined; } interface Uint8Array { /** * Returns the item located at the specified index. * @param index The zero-based index of the desired code unit. A negative index will count back from the last item. */ at(index: number): number | undefined; } interface Uint8ClampedArray { /** * Returns the item located at the specified index. * @param index The zero-based index of the desired code unit. A negative index will count back from the last item. */ at(index: number): number | undefined; } interface Int16Array { /** * Returns the item located at the specified index. * @param index The zero-based index of the desired code unit. A negative index will count back from the last item. */ at(index: number): number | undefined; } interface Uint16Array { /** * Returns the item located at the specified index. * @param index The zero-based index of the desired code unit. A negative index will count back from the last item. */ at(index: number): number | undefined; } interface Int32Array { /** * Returns the item located at the specified index. * @param index The zero-based index of the desired code unit. A negative index will count back from the last item. */ at(index: number): number | undefined; } interface Uint32Array { /** * Returns the item located at the specified index. * @param index The zero-based index of the desired code unit. A negative index will count back from the last item. */ at(index: number): number | undefined; } interface Float32Array { /** * Returns the item located at the specified index. * @param index The zero-based index of the desired code unit. A negative index will count back from the last item. */ at(index: number): number | undefined; } interface Float64Array { /** * Returns the item located at the specified index. * @param index The zero-based index of the desired code unit. A negative index will count back from the last item. */ at(index: number): number | undefined; } interface BigInt64Array { /** * Returns the item located at the specified index. * @param index The zero-based index of the desired code unit. A negative index will count back from the last item. */ at(index: number): bigint | undefined; } interface BigUint64Array { /** * Returns the item located at the specified index. * @param index The zero-based index of the desired code unit. A negative index will count back from the last item. */ at(index: number): bigint | undefined; }
PypiClean
/iaweb.privacy-1.0a1.tar.gz/iaweb.privacy-1.0a1/README.rst
.. This README is meant for consumption by humans and pypi. Pypi can render rst files so please do not use Sphinx features. If you want to learn more about writing documentation, please check out: http://docs.plone.org/about/documentation_styleguide.html This text does not appear on pypi or github. It is a comment. ============= iaweb.privacy ============= This package implement collective.privacy rules for IMIO web projects Installation ------------ Install iaweb.privacy by adding it to your buildout:: [buildout] ... eggs = iaweb.privacy and then running ``bin/buildout`` Contribute ---------- - Issue Tracker: https://github.com/collective/iaweb.privacy/issues - Source Code: https://github.com/collective/iaweb.privacy License ------- The project is licensed under the GPLv2.
PypiClean
/cegalprizm_pythontoolpro-2.3.2-py3-none-any.whl/cegalprizm/pythontool/grpc/petrelinterface_pb2_grpc.py
"""Client and server classes corresponding to protobuf-defined services.""" import grpc from cegalprizm.pythontool.grpc import petrelinterface_pb2 as cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2 class PetrelConnection_ProjectStub(object): """Missing associated documentation comment in .proto file.""" def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. """ self.VerifyClientVersion = channel.unary_unary( '/petrelgrpc.PetrelConnection_Project/VerifyClientVersion', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.VersionAccepted.FromString, ) self.Ping = channel.unary_unary( '/petrelgrpc.PetrelConnection_Project/Ping', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.EmptyRequest.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoInt.FromString, ) self.GetCurrentProjectName = channel.unary_unary( '/petrelgrpc.PetrelConnection_Project/GetCurrentProjectName', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.EmptyRequest.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.FromString, ) self.AProjectIsActive = channel.unary_unary( '/petrelgrpc.PetrelConnection_Project/AProjectIsActive', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.EmptyRequest.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, ) self.EnableHistory = channel.unary_unary( '/petrelgrpc.PetrelConnection_Project/EnableHistory', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, ) self.SetScriptName = channel.unary_unary( '/petrelgrpc.PetrelConnection_Project/SetScriptName', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.FromString, ) self.GetStringsMap = channel.unary_stream( '/petrelgrpc.PetrelConnection_Project/GetStringsMap', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GetStringsMapRequest.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.StringsMap.FromString, ) self.Project_ImportWorkflow = channel.unary_unary( '/petrelgrpc.PetrelConnection_Project/Project_ImportWorkflow', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Project_ImportWorkflow_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Project_ImportWorkflow_Response.FromString, ) self.Project_GetRegisteredObservedDataVersions = channel.unary_unary( '/petrelgrpc.PetrelConnection_Project/Project_GetRegisteredObservedDataVersions', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.EmptyRequest.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.StringsMap.FromString, ) self.Project_GetPetrelObjectsByGuids = channel.unary_stream( '/petrelgrpc.PetrelConnection_Project/Project_GetPetrelObjectsByGuids', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Project_GetPetrelObjectsByGuids_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Project_GetPetrelObjectsByGuids_Response.FromString, ) self.Project_GetPetrelProjectUnits = channel.unary_unary( '/petrelgrpc.PetrelConnection_Project/Project_GetPetrelProjectUnits', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.EmptyRequest.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.StringsMap.FromString, ) self.Project_GetCrs = channel.unary_unary( '/petrelgrpc.PetrelConnection_Project/Project_GetCrs', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.EmptyRequest.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.FromString, ) self.GetServerVersion = channel.unary_unary( '/petrelgrpc.PetrelConnection_Project/GetServerVersion', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.EmptyRequest.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.FromString, ) class PetrelConnection_ProjectServicer(object): """Missing associated documentation comment in .proto file.""" def VerifyClientVersion(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Ping(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def GetCurrentProjectName(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def AProjectIsActive(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def EnableHistory(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def SetScriptName(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def GetStringsMap(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Project_ImportWorkflow(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Project_GetRegisteredObservedDataVersions(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Project_GetPetrelObjectsByGuids(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Project_GetPetrelProjectUnits(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Project_GetCrs(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def GetServerVersion(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def add_PetrelConnection_ProjectServicer_to_server(servicer, server): rpc_method_handlers = { 'VerifyClientVersion': grpc.unary_unary_rpc_method_handler( servicer.VerifyClientVersion, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.VersionAccepted.SerializeToString, ), 'Ping': grpc.unary_unary_rpc_method_handler( servicer.Ping, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.EmptyRequest.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoInt.SerializeToString, ), 'GetCurrentProjectName': grpc.unary_unary_rpc_method_handler( servicer.GetCurrentProjectName, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.EmptyRequest.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.SerializeToString, ), 'AProjectIsActive': grpc.unary_unary_rpc_method_handler( servicer.AProjectIsActive, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.EmptyRequest.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.SerializeToString, ), 'EnableHistory': grpc.unary_unary_rpc_method_handler( servicer.EnableHistory, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.SerializeToString, ), 'SetScriptName': grpc.unary_unary_rpc_method_handler( servicer.SetScriptName, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.SerializeToString, ), 'GetStringsMap': grpc.unary_stream_rpc_method_handler( servicer.GetStringsMap, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GetStringsMapRequest.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.StringsMap.SerializeToString, ), 'Project_ImportWorkflow': grpc.unary_unary_rpc_method_handler( servicer.Project_ImportWorkflow, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Project_ImportWorkflow_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Project_ImportWorkflow_Response.SerializeToString, ), 'Project_GetRegisteredObservedDataVersions': grpc.unary_unary_rpc_method_handler( servicer.Project_GetRegisteredObservedDataVersions, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.EmptyRequest.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.StringsMap.SerializeToString, ), 'Project_GetPetrelObjectsByGuids': grpc.unary_stream_rpc_method_handler( servicer.Project_GetPetrelObjectsByGuids, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Project_GetPetrelObjectsByGuids_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Project_GetPetrelObjectsByGuids_Response.SerializeToString, ), 'Project_GetPetrelProjectUnits': grpc.unary_unary_rpc_method_handler( servicer.Project_GetPetrelProjectUnits, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.EmptyRequest.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.StringsMap.SerializeToString, ), 'Project_GetCrs': grpc.unary_unary_rpc_method_handler( servicer.Project_GetCrs, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.EmptyRequest.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.SerializeToString, ), 'GetServerVersion': grpc.unary_unary_rpc_method_handler( servicer.GetServerVersion, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.EmptyRequest.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'petrelgrpc.PetrelConnection_Project', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) # This class is part of an EXPERIMENTAL API. class PetrelConnection_Project(object): """Missing associated documentation comment in .proto file.""" @staticmethod def VerifyClientVersion(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Project/VerifyClientVersion', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.VersionAccepted.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Ping(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Project/Ping', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.EmptyRequest.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoInt.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def GetCurrentProjectName(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Project/GetCurrentProjectName', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.EmptyRequest.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def AProjectIsActive(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Project/AProjectIsActive', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.EmptyRequest.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def EnableHistory(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Project/EnableHistory', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def SetScriptName(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Project/SetScriptName', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def GetStringsMap(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_Project/GetStringsMap', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GetStringsMapRequest.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.StringsMap.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Project_ImportWorkflow(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Project/Project_ImportWorkflow', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Project_ImportWorkflow_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Project_ImportWorkflow_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Project_GetRegisteredObservedDataVersions(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Project/Project_GetRegisteredObservedDataVersions', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.EmptyRequest.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.StringsMap.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Project_GetPetrelObjectsByGuids(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_Project/Project_GetPetrelObjectsByGuids', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Project_GetPetrelObjectsByGuids_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Project_GetPetrelObjectsByGuids_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Project_GetPetrelProjectUnits(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Project/Project_GetPetrelProjectUnits', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.EmptyRequest.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.StringsMap.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Project_GetCrs(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Project/Project_GetCrs', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.EmptyRequest.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def GetServerVersion(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Project/GetServerVersion', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.EmptyRequest.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) class PetrelConnection_PetrelObjectStub(object): """Missing associated documentation comment in .proto file.""" def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. """ self.PetrelObject_GetPetrelName = channel.unary_unary( '/petrelgrpc.PetrelConnection_PetrelObject/PetrelObject_GetPetrelName', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.FromString, ) self.PetrelObject_GetPath = channel.unary_unary( '/petrelgrpc.PetrelConnection_PetrelObject/PetrelObject_GetPath', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.FromString, ) self.PetrelObject_RetrieveStats = channel.unary_unary( '/petrelgrpc.PetrelConnection_PetrelObject/PetrelObject_RetrieveStats', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.StringsMap.FromString, ) self.PetrelObject_GetDroidString = channel.unary_unary( '/petrelgrpc.PetrelConnection_PetrelObject/PetrelObject_GetDroidString', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.FromString, ) self.PetrelObject_GetReadOnly = channel.unary_unary( '/petrelgrpc.PetrelConnection_PetrelObject/PetrelObject_GetReadOnly', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, ) self.PetrelObject_Clone = channel.unary_unary( '/petrelgrpc.PetrelConnection_PetrelObject/PetrelObject_Clone', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Clone_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, ) self.PetrelObject_IsAlwaysReadonly = channel.unary_unary( '/petrelgrpc.PetrelConnection_PetrelObject/PetrelObject_IsAlwaysReadonly', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObject_IsAlwaysReadonly_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObject_IsAlwaysReadonly_Response.FromString, ) self.PetrelObject_GetOceanType = channel.unary_unary( '/petrelgrpc.PetrelConnection_PetrelObject/PetrelObject_GetOceanType', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.FromString, ) self.PetrelObject_RetrieveHistory = channel.unary_stream( '/petrelgrpc.PetrelConnection_PetrelObject/PetrelObject_RetrieveHistory', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObject_RetrieveHistory_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObject_RetrieveHistory_Response.FromString, ) self.PetrelObject_GetTemplate = channel.unary_unary( '/petrelgrpc.PetrelConnection_PetrelObject/PetrelObject_GetTemplate', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObject_GetTemplate_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObject_GetTemplate_Response.FromString, ) self.PetrelObject_GetComments = channel.unary_unary( '/petrelgrpc.PetrelConnection_PetrelObject/PetrelObject_GetComments', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObject_GetComments_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObject_GetComments_Response.FromString, ) self.PetrelObject_AddComment = channel.unary_unary( '/petrelgrpc.PetrelConnection_PetrelObject/PetrelObject_AddComment', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObject_AddComment_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObject_AddComment_Response.FromString, ) class PetrelConnection_PetrelObjectServicer(object): """Missing associated documentation comment in .proto file.""" def PetrelObject_GetPetrelName(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def PetrelObject_GetPath(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def PetrelObject_RetrieveStats(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def PetrelObject_GetDroidString(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def PetrelObject_GetReadOnly(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def PetrelObject_Clone(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def PetrelObject_IsAlwaysReadonly(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def PetrelObject_GetOceanType(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def PetrelObject_RetrieveHistory(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def PetrelObject_GetTemplate(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def PetrelObject_GetComments(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def PetrelObject_AddComment(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def add_PetrelConnection_PetrelObjectServicer_to_server(servicer, server): rpc_method_handlers = { 'PetrelObject_GetPetrelName': grpc.unary_unary_rpc_method_handler( servicer.PetrelObject_GetPetrelName, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.SerializeToString, ), 'PetrelObject_GetPath': grpc.unary_unary_rpc_method_handler( servicer.PetrelObject_GetPath, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.SerializeToString, ), 'PetrelObject_RetrieveStats': grpc.unary_unary_rpc_method_handler( servicer.PetrelObject_RetrieveStats, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.StringsMap.SerializeToString, ), 'PetrelObject_GetDroidString': grpc.unary_unary_rpc_method_handler( servicer.PetrelObject_GetDroidString, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.SerializeToString, ), 'PetrelObject_GetReadOnly': grpc.unary_unary_rpc_method_handler( servicer.PetrelObject_GetReadOnly, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.SerializeToString, ), 'PetrelObject_Clone': grpc.unary_unary_rpc_method_handler( servicer.PetrelObject_Clone, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Clone_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, ), 'PetrelObject_IsAlwaysReadonly': grpc.unary_unary_rpc_method_handler( servicer.PetrelObject_IsAlwaysReadonly, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObject_IsAlwaysReadonly_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObject_IsAlwaysReadonly_Response.SerializeToString, ), 'PetrelObject_GetOceanType': grpc.unary_unary_rpc_method_handler( servicer.PetrelObject_GetOceanType, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.SerializeToString, ), 'PetrelObject_RetrieveHistory': grpc.unary_stream_rpc_method_handler( servicer.PetrelObject_RetrieveHistory, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObject_RetrieveHistory_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObject_RetrieveHistory_Response.SerializeToString, ), 'PetrelObject_GetTemplate': grpc.unary_unary_rpc_method_handler( servicer.PetrelObject_GetTemplate, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObject_GetTemplate_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObject_GetTemplate_Response.SerializeToString, ), 'PetrelObject_GetComments': grpc.unary_unary_rpc_method_handler( servicer.PetrelObject_GetComments, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObject_GetComments_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObject_GetComments_Response.SerializeToString, ), 'PetrelObject_AddComment': grpc.unary_unary_rpc_method_handler( servicer.PetrelObject_AddComment, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObject_AddComment_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObject_AddComment_Response.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'petrelgrpc.PetrelConnection_PetrelObject', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) # This class is part of an EXPERIMENTAL API. class PetrelConnection_PetrelObject(object): """Missing associated documentation comment in .proto file.""" @staticmethod def PetrelObject_GetPetrelName(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_PetrelObject/PetrelObject_GetPetrelName', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def PetrelObject_GetPath(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_PetrelObject/PetrelObject_GetPath', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def PetrelObject_RetrieveStats(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_PetrelObject/PetrelObject_RetrieveStats', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.StringsMap.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def PetrelObject_GetDroidString(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_PetrelObject/PetrelObject_GetDroidString', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def PetrelObject_GetReadOnly(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_PetrelObject/PetrelObject_GetReadOnly', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def PetrelObject_Clone(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_PetrelObject/PetrelObject_Clone', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Clone_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def PetrelObject_IsAlwaysReadonly(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_PetrelObject/PetrelObject_IsAlwaysReadonly', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObject_IsAlwaysReadonly_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObject_IsAlwaysReadonly_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def PetrelObject_GetOceanType(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_PetrelObject/PetrelObject_GetOceanType', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def PetrelObject_RetrieveHistory(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_PetrelObject/PetrelObject_RetrieveHistory', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObject_RetrieveHistory_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObject_RetrieveHistory_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def PetrelObject_GetTemplate(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_PetrelObject/PetrelObject_GetTemplate', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObject_GetTemplate_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObject_GetTemplate_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def PetrelObject_GetComments(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_PetrelObject/PetrelObject_GetComments', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObject_GetComments_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObject_GetComments_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def PetrelObject_AddComment(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_PetrelObject/PetrelObject_AddComment', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObject_AddComment_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObject_AddComment_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) class PetrelConnection_CheckShotStub(object): """Missing associated documentation comment in .proto file.""" def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. """ self.CheckShot_GetValues = channel.unary_stream( '/petrelgrpc.PetrelConnection_CheckShot/CheckShot_GetValues', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CheckShot_GetValues_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CheckShot_GetValues_Response.FromString, ) class PetrelConnection_CheckShotServicer(object): """Missing associated documentation comment in .proto file.""" def CheckShot_GetValues(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def add_PetrelConnection_CheckShotServicer_to_server(servicer, server): rpc_method_handlers = { 'CheckShot_GetValues': grpc.unary_stream_rpc_method_handler( servicer.CheckShot_GetValues, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CheckShot_GetValues_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CheckShot_GetValues_Response.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'petrelgrpc.PetrelConnection_CheckShot', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) # This class is part of an EXPERIMENTAL API. class PetrelConnection_CheckShot(object): """Missing associated documentation comment in .proto file.""" @staticmethod def CheckShot_GetValues(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_CheckShot/CheckShot_GetValues', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CheckShot_GetValues_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CheckShot_GetValues_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) class PetrelConnection_MarkerCollectionStub(object): """Missing associated documentation comment in .proto file.""" def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. """ self.GetMarkerCollection = channel.unary_unary( '/petrelgrpc.PetrelConnection_MarkerCollection/GetMarkerCollection', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, ) self.MarkerCollection_GetName = channel.unary_unary( '/petrelgrpc.PetrelConnection_MarkerCollection/MarkerCollection_GetName', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MarkerCollection_GetName_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MarkerCollection_GetName_Response.FromString, ) self.MarkerCollection_SetName = channel.unary_unary( '/petrelgrpc.PetrelConnection_MarkerCollection/MarkerCollection_SetName', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MarkerCollection_SetName_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MarkerCollection_SetName_Response.FromString, ) self.MarkerCollection_GetValues = channel.unary_stream( '/petrelgrpc.PetrelConnection_MarkerCollection/MarkerCollection_GetValues', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MarkerCollection_GetValues_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PropertyRangeData.FromString, ) self.MarkerCollection_SetPropertyValues = channel.stream_unary( '/petrelgrpc.PetrelConnection_MarkerCollection/MarkerCollection_SetPropertyValues', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MarkerCollection_SetValues_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, ) self.MarkerCollection_GetAttributes = channel.unary_stream( '/petrelgrpc.PetrelConnection_MarkerCollection/MarkerCollection_GetAttributes', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, ) self.MarkerCollection_GetAttributeParent = channel.unary_unary( '/petrelgrpc.PetrelConnection_MarkerCollection/MarkerCollection_GetAttributeParent', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, ) self.MarkerCollection_GetAttributeUniqueName = channel.unary_unary( '/petrelgrpc.PetrelConnection_MarkerCollection/MarkerCollection_GetAttributeUniqueName', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MarkerCollection_GetName_Response.FromString, ) self.MarkerCollection_AddAttribute = channel.stream_unary( '/petrelgrpc.PetrelConnection_MarkerCollection/MarkerCollection_AddAttribute', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MarkerCollection_SetValues_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, ) self.MarkerCollection_AddEmptyAttribute = channel.unary_unary( '/petrelgrpc.PetrelConnection_MarkerCollection/MarkerCollection_AddEmptyAttribute', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MarkerCollection_AddEmptyAttribute_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, ) self.MarkerCollection_GetStratigraphies = channel.unary_stream( '/petrelgrpc.PetrelConnection_MarkerCollection/MarkerCollection_GetStratigraphies', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MarkerCollection_GetStratigraphies_Response.FromString, ) self.MarkerCollection_AddMarker = channel.unary_unary( '/petrelgrpc.PetrelConnection_MarkerCollection/MarkerCollection_AddMarker', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MarkerCollection_AddMarker_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MarkerCollection_AddMarker_Response.FromString, ) self.MarkerCollection_AddManyMarkers = channel.stream_unary( '/petrelgrpc.PetrelConnection_MarkerCollection/MarkerCollection_AddManyMarkers', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MarkerCollection_AddMarker_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MarkerCollection_AddMarker_Response.FromString, ) self.MarkerCollection_GetMarkerDroid = channel.unary_unary( '/petrelgrpc.PetrelConnection_MarkerCollection/MarkerCollection_GetMarkerDroid', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MarkerCollection_GetMarkerDroid_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MarkerCollection_GetMarkerDroid_Response.FromString, ) self.MarkerCollection_DeleteMarker = channel.unary_unary( '/petrelgrpc.PetrelConnection_MarkerCollection/MarkerCollection_DeleteMarker', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MarkerCollection_DeleteMarker_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, ) self.MarkerCollection_DeleteManyMarkers = channel.stream_unary( '/petrelgrpc.PetrelConnection_MarkerCollection/MarkerCollection_DeleteManyMarkers', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MarkerCollection_GetMarkerDroid_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, ) class PetrelConnection_MarkerCollectionServicer(object): """Missing associated documentation comment in .proto file.""" def GetMarkerCollection(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def MarkerCollection_GetName(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def MarkerCollection_SetName(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def MarkerCollection_GetValues(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def MarkerCollection_SetPropertyValues(self, request_iterator, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def MarkerCollection_GetAttributes(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def MarkerCollection_GetAttributeParent(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def MarkerCollection_GetAttributeUniqueName(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def MarkerCollection_AddAttribute(self, request_iterator, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def MarkerCollection_AddEmptyAttribute(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def MarkerCollection_GetStratigraphies(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def MarkerCollection_AddMarker(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def MarkerCollection_AddManyMarkers(self, request_iterator, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def MarkerCollection_GetMarkerDroid(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def MarkerCollection_DeleteMarker(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def MarkerCollection_DeleteManyMarkers(self, request_iterator, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def add_PetrelConnection_MarkerCollectionServicer_to_server(servicer, server): rpc_method_handlers = { 'GetMarkerCollection': grpc.unary_unary_rpc_method_handler( servicer.GetMarkerCollection, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.SerializeToString, ), 'MarkerCollection_GetName': grpc.unary_unary_rpc_method_handler( servicer.MarkerCollection_GetName, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MarkerCollection_GetName_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MarkerCollection_GetName_Response.SerializeToString, ), 'MarkerCollection_SetName': grpc.unary_unary_rpc_method_handler( servicer.MarkerCollection_SetName, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MarkerCollection_SetName_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MarkerCollection_SetName_Response.SerializeToString, ), 'MarkerCollection_GetValues': grpc.unary_stream_rpc_method_handler( servicer.MarkerCollection_GetValues, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MarkerCollection_GetValues_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PropertyRangeData.SerializeToString, ), 'MarkerCollection_SetPropertyValues': grpc.stream_unary_rpc_method_handler( servicer.MarkerCollection_SetPropertyValues, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MarkerCollection_SetValues_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.SerializeToString, ), 'MarkerCollection_GetAttributes': grpc.unary_stream_rpc_method_handler( servicer.MarkerCollection_GetAttributes, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.SerializeToString, ), 'MarkerCollection_GetAttributeParent': grpc.unary_unary_rpc_method_handler( servicer.MarkerCollection_GetAttributeParent, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.SerializeToString, ), 'MarkerCollection_GetAttributeUniqueName': grpc.unary_unary_rpc_method_handler( servicer.MarkerCollection_GetAttributeUniqueName, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MarkerCollection_GetName_Response.SerializeToString, ), 'MarkerCollection_AddAttribute': grpc.stream_unary_rpc_method_handler( servicer.MarkerCollection_AddAttribute, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MarkerCollection_SetValues_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.SerializeToString, ), 'MarkerCollection_AddEmptyAttribute': grpc.unary_unary_rpc_method_handler( servicer.MarkerCollection_AddEmptyAttribute, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MarkerCollection_AddEmptyAttribute_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.SerializeToString, ), 'MarkerCollection_GetStratigraphies': grpc.unary_stream_rpc_method_handler( servicer.MarkerCollection_GetStratigraphies, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MarkerCollection_GetStratigraphies_Response.SerializeToString, ), 'MarkerCollection_AddMarker': grpc.unary_unary_rpc_method_handler( servicer.MarkerCollection_AddMarker, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MarkerCollection_AddMarker_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MarkerCollection_AddMarker_Response.SerializeToString, ), 'MarkerCollection_AddManyMarkers': grpc.stream_unary_rpc_method_handler( servicer.MarkerCollection_AddManyMarkers, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MarkerCollection_AddMarker_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MarkerCollection_AddMarker_Response.SerializeToString, ), 'MarkerCollection_GetMarkerDroid': grpc.unary_unary_rpc_method_handler( servicer.MarkerCollection_GetMarkerDroid, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MarkerCollection_GetMarkerDroid_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MarkerCollection_GetMarkerDroid_Response.SerializeToString, ), 'MarkerCollection_DeleteMarker': grpc.unary_unary_rpc_method_handler( servicer.MarkerCollection_DeleteMarker, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MarkerCollection_DeleteMarker_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.SerializeToString, ), 'MarkerCollection_DeleteManyMarkers': grpc.stream_unary_rpc_method_handler( servicer.MarkerCollection_DeleteManyMarkers, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MarkerCollection_GetMarkerDroid_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'petrelgrpc.PetrelConnection_MarkerCollection', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) # This class is part of an EXPERIMENTAL API. class PetrelConnection_MarkerCollection(object): """Missing associated documentation comment in .proto file.""" @staticmethod def GetMarkerCollection(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_MarkerCollection/GetMarkerCollection', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def MarkerCollection_GetName(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_MarkerCollection/MarkerCollection_GetName', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MarkerCollection_GetName_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MarkerCollection_GetName_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def MarkerCollection_SetName(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_MarkerCollection/MarkerCollection_SetName', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MarkerCollection_SetName_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MarkerCollection_SetName_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def MarkerCollection_GetValues(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_MarkerCollection/MarkerCollection_GetValues', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MarkerCollection_GetValues_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PropertyRangeData.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def MarkerCollection_SetPropertyValues(request_iterator, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.stream_unary(request_iterator, target, '/petrelgrpc.PetrelConnection_MarkerCollection/MarkerCollection_SetPropertyValues', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MarkerCollection_SetValues_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def MarkerCollection_GetAttributes(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_MarkerCollection/MarkerCollection_GetAttributes', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def MarkerCollection_GetAttributeParent(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_MarkerCollection/MarkerCollection_GetAttributeParent', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def MarkerCollection_GetAttributeUniqueName(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_MarkerCollection/MarkerCollection_GetAttributeUniqueName', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MarkerCollection_GetName_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def MarkerCollection_AddAttribute(request_iterator, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.stream_unary(request_iterator, target, '/petrelgrpc.PetrelConnection_MarkerCollection/MarkerCollection_AddAttribute', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MarkerCollection_SetValues_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def MarkerCollection_AddEmptyAttribute(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_MarkerCollection/MarkerCollection_AddEmptyAttribute', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MarkerCollection_AddEmptyAttribute_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def MarkerCollection_GetStratigraphies(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_MarkerCollection/MarkerCollection_GetStratigraphies', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MarkerCollection_GetStratigraphies_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def MarkerCollection_AddMarker(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_MarkerCollection/MarkerCollection_AddMarker', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MarkerCollection_AddMarker_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MarkerCollection_AddMarker_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def MarkerCollection_AddManyMarkers(request_iterator, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.stream_unary(request_iterator, target, '/petrelgrpc.PetrelConnection_MarkerCollection/MarkerCollection_AddManyMarkers', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MarkerCollection_AddMarker_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MarkerCollection_AddMarker_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def MarkerCollection_GetMarkerDroid(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_MarkerCollection/MarkerCollection_GetMarkerDroid', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MarkerCollection_GetMarkerDroid_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MarkerCollection_GetMarkerDroid_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def MarkerCollection_DeleteMarker(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_MarkerCollection/MarkerCollection_DeleteMarker', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MarkerCollection_DeleteMarker_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def MarkerCollection_DeleteManyMarkers(request_iterator, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.stream_unary(request_iterator, target, '/petrelgrpc.PetrelConnection_MarkerCollection/MarkerCollection_DeleteManyMarkers', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MarkerCollection_GetMarkerDroid_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) class PetrelConnection_SeismicStub(object): """Missing associated documentation comment in .proto file.""" def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. """ self.DebugConnectionTest = channel.unary_unary( '/petrelgrpc.PetrelConnection_Seismic/DebugConnectionTest', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.EmptyRequest.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, ) self.GetSeismicCube = channel.unary_unary( '/petrelgrpc.PetrelConnection_Seismic/GetSeismicCube', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, ) self.SeismicCube_Extent = channel.unary_unary( '/petrelgrpc.PetrelConnection_Seismic/SeismicCube_Extent', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.Indices3.FromString, ) self.SeismicCube_AxesRange = channel.unary_unary( '/petrelgrpc.PetrelConnection_Seismic/SeismicCube_AxesRange', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.AxesRange.FromString, ) self.SeismicCube_IndexAtPosition = channel.unary_unary( '/petrelgrpc.PetrelConnection_Seismic/SeismicCube_IndexAtPosition', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.IndexAtPosition_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.ExtIndices3.FromString, ) self.SeismicCube_IndexToAnnotation = channel.unary_unary( '/petrelgrpc.PetrelConnection_Seismic/SeismicCube_IndexToAnnotation', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.IndexToAnnotation_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.ExtIndices3.FromString, ) self.SeismicCube_AnnotationToIndex = channel.unary_unary( '/petrelgrpc.PetrelConnection_Seismic/SeismicCube_AnnotationToIndex', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.AnnotationToIndex_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.ExtIndices3.FromString, ) self.SeismicCube_GetParentCollection = channel.unary_unary( '/petrelgrpc.PetrelConnection_Seismic/SeismicCube_GetParentCollection', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, ) self.SeismicCube_PositionAtIndex = channel.unary_unary( '/petrelgrpc.PetrelConnection_Seismic/SeismicCube_PositionAtIndex', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PositionAtIndex_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.ExtDouble3.FromString, ) self.SeismicCube_DisplayUnitSymbol = channel.unary_unary( '/petrelgrpc.PetrelConnection_Seismic/SeismicCube_DisplayUnitSymbol', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.FromString, ) self.SeismicCube_GetChunk = channel.unary_stream( '/petrelgrpc.PetrelConnection_Seismic/SeismicCube_GetChunk', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GetChunk_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Subchunk.FromString, ) self.SeismicCube_StreamSetChunk = channel.stream_unary( '/petrelgrpc.PetrelConnection_Seismic/SeismicCube_StreamSetChunk', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SetSubchunk_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Report.FromString, ) self.SeismicCube_SetConstantValue = channel.unary_unary( '/petrelgrpc.PetrelConnection_Seismic/SeismicCube_SetConstantValue', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SeismicCube_SetConstantValue_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SeismicCube_SetConstantValue_Response.FromString, ) self.SeismicCube_GetIjk = channel.unary_unary( '/petrelgrpc.PetrelConnection_Seismic/SeismicCube_GetIjk', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SeismicCube_GetIjk_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SeismicCube_GetIjk_Response.FromString, ) self.SeismicCube_GetPositions = channel.unary_unary( '/petrelgrpc.PetrelConnection_Seismic/SeismicCube_GetPositions', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SeismicCube_GetPositions_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SeismicCube_GetPositions_Response.FromString, ) self.Seismic_BulkFile = channel.unary_unary( '/petrelgrpc.PetrelConnection_Seismic/Seismic_BulkFile', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Seismic_BulkFile_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Seismic_BulkFile_Response.FromString, ) self.Seismic_Reconnect = channel.unary_unary( '/petrelgrpc.PetrelConnection_Seismic/Seismic_Reconnect', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Seismic_Reconnect_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Seismic_Reconnect_Response.FromString, ) self.Seismic_GetCrs = channel.unary_unary( '/petrelgrpc.PetrelConnection_Seismic/Seismic_GetCrs', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Seismic_GetCrs_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Seismic_GetCrs_Response.FromString, ) self.Seismic_GetAffineTransform = channel.unary_stream( '/petrelgrpc.PetrelConnection_Seismic/Seismic_GetAffineTransform', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Seismic_GetAffineTransform_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Seismic_GetAffineTransform_Response.FromString, ) class PetrelConnection_SeismicServicer(object): """Missing associated documentation comment in .proto file.""" def DebugConnectionTest(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def GetSeismicCube(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def SeismicCube_Extent(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def SeismicCube_AxesRange(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def SeismicCube_IndexAtPosition(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def SeismicCube_IndexToAnnotation(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def SeismicCube_AnnotationToIndex(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def SeismicCube_GetParentCollection(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def SeismicCube_PositionAtIndex(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def SeismicCube_DisplayUnitSymbol(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def SeismicCube_GetChunk(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def SeismicCube_StreamSetChunk(self, request_iterator, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def SeismicCube_SetConstantValue(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def SeismicCube_GetIjk(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def SeismicCube_GetPositions(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Seismic_BulkFile(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Seismic_Reconnect(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Seismic_GetCrs(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Seismic_GetAffineTransform(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def add_PetrelConnection_SeismicServicer_to_server(servicer, server): rpc_method_handlers = { 'DebugConnectionTest': grpc.unary_unary_rpc_method_handler( servicer.DebugConnectionTest, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.EmptyRequest.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.SerializeToString, ), 'GetSeismicCube': grpc.unary_unary_rpc_method_handler( servicer.GetSeismicCube, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.SerializeToString, ), 'SeismicCube_Extent': grpc.unary_unary_rpc_method_handler( servicer.SeismicCube_Extent, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.Indices3.SerializeToString, ), 'SeismicCube_AxesRange': grpc.unary_unary_rpc_method_handler( servicer.SeismicCube_AxesRange, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.AxesRange.SerializeToString, ), 'SeismicCube_IndexAtPosition': grpc.unary_unary_rpc_method_handler( servicer.SeismicCube_IndexAtPosition, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.IndexAtPosition_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.ExtIndices3.SerializeToString, ), 'SeismicCube_IndexToAnnotation': grpc.unary_unary_rpc_method_handler( servicer.SeismicCube_IndexToAnnotation, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.IndexToAnnotation_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.ExtIndices3.SerializeToString, ), 'SeismicCube_AnnotationToIndex': grpc.unary_unary_rpc_method_handler( servicer.SeismicCube_AnnotationToIndex, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.AnnotationToIndex_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.ExtIndices3.SerializeToString, ), 'SeismicCube_GetParentCollection': grpc.unary_unary_rpc_method_handler( servicer.SeismicCube_GetParentCollection, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.SerializeToString, ), 'SeismicCube_PositionAtIndex': grpc.unary_unary_rpc_method_handler( servicer.SeismicCube_PositionAtIndex, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PositionAtIndex_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.ExtDouble3.SerializeToString, ), 'SeismicCube_DisplayUnitSymbol': grpc.unary_unary_rpc_method_handler( servicer.SeismicCube_DisplayUnitSymbol, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.SerializeToString, ), 'SeismicCube_GetChunk': grpc.unary_stream_rpc_method_handler( servicer.SeismicCube_GetChunk, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GetChunk_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Subchunk.SerializeToString, ), 'SeismicCube_StreamSetChunk': grpc.stream_unary_rpc_method_handler( servicer.SeismicCube_StreamSetChunk, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SetSubchunk_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Report.SerializeToString, ), 'SeismicCube_SetConstantValue': grpc.unary_unary_rpc_method_handler( servicer.SeismicCube_SetConstantValue, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SeismicCube_SetConstantValue_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SeismicCube_SetConstantValue_Response.SerializeToString, ), 'SeismicCube_GetIjk': grpc.unary_unary_rpc_method_handler( servicer.SeismicCube_GetIjk, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SeismicCube_GetIjk_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SeismicCube_GetIjk_Response.SerializeToString, ), 'SeismicCube_GetPositions': grpc.unary_unary_rpc_method_handler( servicer.SeismicCube_GetPositions, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SeismicCube_GetPositions_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SeismicCube_GetPositions_Response.SerializeToString, ), 'Seismic_BulkFile': grpc.unary_unary_rpc_method_handler( servicer.Seismic_BulkFile, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Seismic_BulkFile_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Seismic_BulkFile_Response.SerializeToString, ), 'Seismic_Reconnect': grpc.unary_unary_rpc_method_handler( servicer.Seismic_Reconnect, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Seismic_Reconnect_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Seismic_Reconnect_Response.SerializeToString, ), 'Seismic_GetCrs': grpc.unary_unary_rpc_method_handler( servicer.Seismic_GetCrs, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Seismic_GetCrs_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Seismic_GetCrs_Response.SerializeToString, ), 'Seismic_GetAffineTransform': grpc.unary_stream_rpc_method_handler( servicer.Seismic_GetAffineTransform, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Seismic_GetAffineTransform_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Seismic_GetAffineTransform_Response.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'petrelgrpc.PetrelConnection_Seismic', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) # This class is part of an EXPERIMENTAL API. class PetrelConnection_Seismic(object): """Missing associated documentation comment in .proto file.""" @staticmethod def DebugConnectionTest(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Seismic/DebugConnectionTest', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.EmptyRequest.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def GetSeismicCube(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Seismic/GetSeismicCube', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def SeismicCube_Extent(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Seismic/SeismicCube_Extent', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.Indices3.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def SeismicCube_AxesRange(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Seismic/SeismicCube_AxesRange', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.AxesRange.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def SeismicCube_IndexAtPosition(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Seismic/SeismicCube_IndexAtPosition', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.IndexAtPosition_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.ExtIndices3.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def SeismicCube_IndexToAnnotation(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Seismic/SeismicCube_IndexToAnnotation', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.IndexToAnnotation_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.ExtIndices3.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def SeismicCube_AnnotationToIndex(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Seismic/SeismicCube_AnnotationToIndex', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.AnnotationToIndex_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.ExtIndices3.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def SeismicCube_GetParentCollection(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Seismic/SeismicCube_GetParentCollection', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def SeismicCube_PositionAtIndex(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Seismic/SeismicCube_PositionAtIndex', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PositionAtIndex_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.ExtDouble3.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def SeismicCube_DisplayUnitSymbol(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Seismic/SeismicCube_DisplayUnitSymbol', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def SeismicCube_GetChunk(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_Seismic/SeismicCube_GetChunk', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GetChunk_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Subchunk.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def SeismicCube_StreamSetChunk(request_iterator, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.stream_unary(request_iterator, target, '/petrelgrpc.PetrelConnection_Seismic/SeismicCube_StreamSetChunk', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SetSubchunk_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Report.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def SeismicCube_SetConstantValue(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Seismic/SeismicCube_SetConstantValue', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SeismicCube_SetConstantValue_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SeismicCube_SetConstantValue_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def SeismicCube_GetIjk(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Seismic/SeismicCube_GetIjk', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SeismicCube_GetIjk_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SeismicCube_GetIjk_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def SeismicCube_GetPositions(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Seismic/SeismicCube_GetPositions', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SeismicCube_GetPositions_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SeismicCube_GetPositions_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Seismic_BulkFile(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Seismic/Seismic_BulkFile', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Seismic_BulkFile_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Seismic_BulkFile_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Seismic_Reconnect(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Seismic/Seismic_Reconnect', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Seismic_Reconnect_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Seismic_Reconnect_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Seismic_GetCrs(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Seismic/Seismic_GetCrs', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Seismic_GetCrs_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Seismic_GetCrs_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Seismic_GetAffineTransform(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_Seismic/Seismic_GetAffineTransform', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Seismic_GetAffineTransform_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Seismic_GetAffineTransform_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) class PetrelConnection_Seismic2DStub(object): """Missing associated documentation comment in .proto file.""" def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. """ self.GetSeismic2D = channel.unary_unary( '/petrelgrpc.PetrelConnection_Seismic2D/GetSeismic2D', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, ) self.Seismic2D_Extent = channel.unary_unary( '/petrelgrpc.PetrelConnection_Seismic2D/Seismic2D_Extent', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.Indices3.FromString, ) self.Seismic2D_AxesRange = channel.unary_unary( '/petrelgrpc.PetrelConnection_Seismic2D/Seismic2D_AxesRange', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.AxesRange.FromString, ) self.Seismic2D_IndexAtPosition = channel.unary_unary( '/petrelgrpc.PetrelConnection_Seismic2D/Seismic2D_IndexAtPosition', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.IndexAtPosition_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.ExtIndices3.FromString, ) self.Seismic2D_PositionAtIndex = channel.unary_unary( '/petrelgrpc.PetrelConnection_Seismic2D/Seismic2D_PositionAtIndex', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Seismic2D_PositionAtIndex_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.ExtDouble3.FromString, ) self.Seismic2D_DisplayUnitSymbol = channel.unary_unary( '/petrelgrpc.PetrelConnection_Seismic2D/Seismic2D_DisplayUnitSymbol', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.FromString, ) self.Seismic2D_GetParentCollection = channel.unary_unary( '/petrelgrpc.PetrelConnection_Seismic2D/Seismic2D_GetParentCollection', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, ) self.Seismic2D_GetChunk = channel.unary_stream( '/petrelgrpc.PetrelConnection_Seismic2D/Seismic2D_GetChunk', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GetChunk_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Subchunk.FromString, ) self.Seismic2D_StreamSetChunk = channel.stream_unary( '/petrelgrpc.PetrelConnection_Seismic2D/Seismic2D_StreamSetChunk', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SetSubchunk_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Report.FromString, ) self.Seismic2d_GetCrs = channel.unary_unary( '/petrelgrpc.PetrelConnection_Seismic2D/Seismic2d_GetCrs', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Seismic2d_GetCrs_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Seismic2d_GetCrs_Response.FromString, ) class PetrelConnection_Seismic2DServicer(object): """Missing associated documentation comment in .proto file.""" def GetSeismic2D(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Seismic2D_Extent(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Seismic2D_AxesRange(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Seismic2D_IndexAtPosition(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Seismic2D_PositionAtIndex(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Seismic2D_DisplayUnitSymbol(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Seismic2D_GetParentCollection(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Seismic2D_GetChunk(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Seismic2D_StreamSetChunk(self, request_iterator, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Seismic2d_GetCrs(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def add_PetrelConnection_Seismic2DServicer_to_server(servicer, server): rpc_method_handlers = { 'GetSeismic2D': grpc.unary_unary_rpc_method_handler( servicer.GetSeismic2D, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.SerializeToString, ), 'Seismic2D_Extent': grpc.unary_unary_rpc_method_handler( servicer.Seismic2D_Extent, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.Indices3.SerializeToString, ), 'Seismic2D_AxesRange': grpc.unary_unary_rpc_method_handler( servicer.Seismic2D_AxesRange, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.AxesRange.SerializeToString, ), 'Seismic2D_IndexAtPosition': grpc.unary_unary_rpc_method_handler( servicer.Seismic2D_IndexAtPosition, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.IndexAtPosition_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.ExtIndices3.SerializeToString, ), 'Seismic2D_PositionAtIndex': grpc.unary_unary_rpc_method_handler( servicer.Seismic2D_PositionAtIndex, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Seismic2D_PositionAtIndex_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.ExtDouble3.SerializeToString, ), 'Seismic2D_DisplayUnitSymbol': grpc.unary_unary_rpc_method_handler( servicer.Seismic2D_DisplayUnitSymbol, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.SerializeToString, ), 'Seismic2D_GetParentCollection': grpc.unary_unary_rpc_method_handler( servicer.Seismic2D_GetParentCollection, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.SerializeToString, ), 'Seismic2D_GetChunk': grpc.unary_stream_rpc_method_handler( servicer.Seismic2D_GetChunk, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GetChunk_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Subchunk.SerializeToString, ), 'Seismic2D_StreamSetChunk': grpc.stream_unary_rpc_method_handler( servicer.Seismic2D_StreamSetChunk, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SetSubchunk_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Report.SerializeToString, ), 'Seismic2d_GetCrs': grpc.unary_unary_rpc_method_handler( servicer.Seismic2d_GetCrs, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Seismic2d_GetCrs_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Seismic2d_GetCrs_Response.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'petrelgrpc.PetrelConnection_Seismic2D', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) # This class is part of an EXPERIMENTAL API. class PetrelConnection_Seismic2D(object): """Missing associated documentation comment in .proto file.""" @staticmethod def GetSeismic2D(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Seismic2D/GetSeismic2D', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Seismic2D_Extent(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Seismic2D/Seismic2D_Extent', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.Indices3.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Seismic2D_AxesRange(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Seismic2D/Seismic2D_AxesRange', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.AxesRange.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Seismic2D_IndexAtPosition(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Seismic2D/Seismic2D_IndexAtPosition', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.IndexAtPosition_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.ExtIndices3.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Seismic2D_PositionAtIndex(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Seismic2D/Seismic2D_PositionAtIndex', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Seismic2D_PositionAtIndex_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.ExtDouble3.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Seismic2D_DisplayUnitSymbol(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Seismic2D/Seismic2D_DisplayUnitSymbol', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Seismic2D_GetParentCollection(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Seismic2D/Seismic2D_GetParentCollection', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Seismic2D_GetChunk(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_Seismic2D/Seismic2D_GetChunk', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GetChunk_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Subchunk.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Seismic2D_StreamSetChunk(request_iterator, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.stream_unary(request_iterator, target, '/petrelgrpc.PetrelConnection_Seismic2D/Seismic2D_StreamSetChunk', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SetSubchunk_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Report.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Seismic2d_GetCrs(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Seismic2D/Seismic2d_GetCrs', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Seismic2d_GetCrs_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Seismic2d_GetCrs_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) class PetrelConnection_GridStub(object): """Missing associated documentation comment in .proto file.""" def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. """ self.GetGrid = channel.unary_unary( '/petrelgrpc.PetrelConnection_Grid/GetGrid', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, ) self.Grid_Extent = channel.unary_unary( '/petrelgrpc.PetrelConnection_Grid/Grid_Extent', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.Indices3.FromString, ) self.Grid_AxesRange = channel.unary_unary( '/petrelgrpc.PetrelConnection_Grid/Grid_AxesRange', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.AxesRange.FromString, ) self.Grid_PositionOfCellCenter = channel.unary_unary( '/petrelgrpc.PetrelConnection_Grid/Grid_PositionOfCellCenter', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_PositionOfCellCenter_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.ExtDouble3.FromString, ) self.Grid_IndicesOfCell = channel.unary_unary( '/petrelgrpc.PetrelConnection_Grid/Grid_IndicesOfCell', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_IndicesOfCell_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.ExtIndices3.FromString, ) self.Grid_VerticesPositions = channel.unary_unary( '/petrelgrpc.PetrelConnection_Grid/Grid_VerticesPositions', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_VerticesPositions_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_VerticesPositions_Reply.FromString, ) self.Grid_IsCellDefined = channel.unary_unary( '/petrelgrpc.PetrelConnection_Grid/Grid_IsCellDefined', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_IsCellDefined_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, ) self.Grid_GetIjk = channel.unary_unary( '/petrelgrpc.PetrelConnection_Grid/Grid_GetIjk', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_GetIjk_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_GetIjk_Response.FromString, ) self.Grid_GetPositions = channel.unary_unary( '/petrelgrpc.PetrelConnection_Grid/Grid_GetPositions', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_GetPositions_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_GetPositions_Response.FromString, ) self.Grid_GetProperties = channel.unary_stream( '/petrelgrpc.PetrelConnection_Grid/Grid_GetProperties', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_GetProperties_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_GetProperties_Response.FromString, ) self.Grid_GetDictionaryProperties = channel.unary_stream( '/petrelgrpc.PetrelConnection_Grid/Grid_GetDictionaryProperties', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_GetDictionaryProperties_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_GetDictionaryProperties_Response.FromString, ) self.Grid_GetNumberOfGridProperties = channel.unary_unary( '/petrelgrpc.PetrelConnection_Grid/Grid_GetNumberOfGridProperties', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_GetNumberOfGridProperties_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_GetNumberOfGridProperties_Response.FromString, ) self.Grid_GetZones = channel.unary_unary( '/petrelgrpc.PetrelConnection_Grid/Grid_GetZones', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_GetZones_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_GetZones_Response.FromString, ) self.Grid_GetNumberOfZones = channel.unary_unary( '/petrelgrpc.PetrelConnection_Grid/Grid_GetNumberOfZones', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_GetNumberOfZones_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_GetNumberOfZones_Response.FromString, ) self.Grid_GetSegments = channel.unary_unary( '/petrelgrpc.PetrelConnection_Grid/Grid_GetSegments', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_GetSegments_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_GetSegments_Response.FromString, ) self.Grid_GetNumberOfSegments = channel.unary_unary( '/petrelgrpc.PetrelConnection_Grid/Grid_GetNumberOfSegments', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_GetNumberOfSegments_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_GetNumberOfSegments_Response.FromString, ) class PetrelConnection_GridServicer(object): """Missing associated documentation comment in .proto file.""" def GetGrid(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Grid_Extent(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Grid_AxesRange(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Grid_PositionOfCellCenter(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Grid_IndicesOfCell(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Grid_VerticesPositions(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Grid_IsCellDefined(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Grid_GetIjk(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Grid_GetPositions(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Grid_GetProperties(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Grid_GetDictionaryProperties(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Grid_GetNumberOfGridProperties(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Grid_GetZones(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Grid_GetNumberOfZones(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Grid_GetSegments(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Grid_GetNumberOfSegments(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def add_PetrelConnection_GridServicer_to_server(servicer, server): rpc_method_handlers = { 'GetGrid': grpc.unary_unary_rpc_method_handler( servicer.GetGrid, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.SerializeToString, ), 'Grid_Extent': grpc.unary_unary_rpc_method_handler( servicer.Grid_Extent, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.Indices3.SerializeToString, ), 'Grid_AxesRange': grpc.unary_unary_rpc_method_handler( servicer.Grid_AxesRange, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.AxesRange.SerializeToString, ), 'Grid_PositionOfCellCenter': grpc.unary_unary_rpc_method_handler( servicer.Grid_PositionOfCellCenter, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_PositionOfCellCenter_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.ExtDouble3.SerializeToString, ), 'Grid_IndicesOfCell': grpc.unary_unary_rpc_method_handler( servicer.Grid_IndicesOfCell, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_IndicesOfCell_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.ExtIndices3.SerializeToString, ), 'Grid_VerticesPositions': grpc.unary_unary_rpc_method_handler( servicer.Grid_VerticesPositions, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_VerticesPositions_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_VerticesPositions_Reply.SerializeToString, ), 'Grid_IsCellDefined': grpc.unary_unary_rpc_method_handler( servicer.Grid_IsCellDefined, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_IsCellDefined_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.SerializeToString, ), 'Grid_GetIjk': grpc.unary_unary_rpc_method_handler( servicer.Grid_GetIjk, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_GetIjk_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_GetIjk_Response.SerializeToString, ), 'Grid_GetPositions': grpc.unary_unary_rpc_method_handler( servicer.Grid_GetPositions, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_GetPositions_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_GetPositions_Response.SerializeToString, ), 'Grid_GetProperties': grpc.unary_stream_rpc_method_handler( servicer.Grid_GetProperties, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_GetProperties_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_GetProperties_Response.SerializeToString, ), 'Grid_GetDictionaryProperties': grpc.unary_stream_rpc_method_handler( servicer.Grid_GetDictionaryProperties, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_GetDictionaryProperties_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_GetDictionaryProperties_Response.SerializeToString, ), 'Grid_GetNumberOfGridProperties': grpc.unary_unary_rpc_method_handler( servicer.Grid_GetNumberOfGridProperties, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_GetNumberOfGridProperties_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_GetNumberOfGridProperties_Response.SerializeToString, ), 'Grid_GetZones': grpc.unary_unary_rpc_method_handler( servicer.Grid_GetZones, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_GetZones_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_GetZones_Response.SerializeToString, ), 'Grid_GetNumberOfZones': grpc.unary_unary_rpc_method_handler( servicer.Grid_GetNumberOfZones, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_GetNumberOfZones_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_GetNumberOfZones_Response.SerializeToString, ), 'Grid_GetSegments': grpc.unary_unary_rpc_method_handler( servicer.Grid_GetSegments, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_GetSegments_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_GetSegments_Response.SerializeToString, ), 'Grid_GetNumberOfSegments': grpc.unary_unary_rpc_method_handler( servicer.Grid_GetNumberOfSegments, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_GetNumberOfSegments_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_GetNumberOfSegments_Response.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'petrelgrpc.PetrelConnection_Grid', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) # This class is part of an EXPERIMENTAL API. class PetrelConnection_Grid(object): """Missing associated documentation comment in .proto file.""" @staticmethod def GetGrid(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Grid/GetGrid', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Grid_Extent(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Grid/Grid_Extent', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.Indices3.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Grid_AxesRange(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Grid/Grid_AxesRange', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.AxesRange.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Grid_PositionOfCellCenter(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Grid/Grid_PositionOfCellCenter', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_PositionOfCellCenter_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.ExtDouble3.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Grid_IndicesOfCell(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Grid/Grid_IndicesOfCell', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_IndicesOfCell_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.ExtIndices3.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Grid_VerticesPositions(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Grid/Grid_VerticesPositions', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_VerticesPositions_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_VerticesPositions_Reply.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Grid_IsCellDefined(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Grid/Grid_IsCellDefined', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_IsCellDefined_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Grid_GetIjk(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Grid/Grid_GetIjk', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_GetIjk_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_GetIjk_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Grid_GetPositions(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Grid/Grid_GetPositions', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_GetPositions_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_GetPositions_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Grid_GetProperties(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_Grid/Grid_GetProperties', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_GetProperties_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_GetProperties_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Grid_GetDictionaryProperties(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_Grid/Grid_GetDictionaryProperties', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_GetDictionaryProperties_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_GetDictionaryProperties_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Grid_GetNumberOfGridProperties(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Grid/Grid_GetNumberOfGridProperties', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_GetNumberOfGridProperties_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_GetNumberOfGridProperties_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Grid_GetZones(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Grid/Grid_GetZones', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_GetZones_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_GetZones_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Grid_GetNumberOfZones(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Grid/Grid_GetNumberOfZones', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_GetNumberOfZones_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_GetNumberOfZones_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Grid_GetSegments(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Grid/Grid_GetSegments', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_GetSegments_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_GetSegments_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Grid_GetNumberOfSegments(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Grid/Grid_GetNumberOfSegments', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_GetNumberOfSegments_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Grid_GetNumberOfSegments_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) class PetrelConnection_GridPropertyStub(object): """Missing associated documentation comment in .proto file.""" def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. """ self.GetGridProperty = channel.unary_unary( '/petrelgrpc.PetrelConnection_GridProperty/GetGridProperty', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Property_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, ) self.GridProperty_ParentGrid = channel.unary_unary( '/petrelgrpc.PetrelConnection_GridProperty/GridProperty_ParentGrid', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.FromString, ) self.GridProperty_DisplayUnitSymbol = channel.unary_unary( '/petrelgrpc.PetrelConnection_GridProperty/GridProperty_DisplayUnitSymbol', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.FromString, ) self.GridProperty_Extent = channel.unary_unary( '/petrelgrpc.PetrelConnection_GridProperty/GridProperty_Extent', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.Indices3.FromString, ) self.GridProperty_GetChunk = channel.unary_stream( '/petrelgrpc.PetrelConnection_GridProperty/GridProperty_GetChunk', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GetChunk_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Subchunk.FromString, ) self.GridProperty_StreamSetChunk = channel.stream_unary( '/petrelgrpc.PetrelConnection_GridProperty/GridProperty_StreamSetChunk', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SetSubchunk_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Report.FromString, ) self.GridProperty_GetDate = channel.unary_unary( '/petrelgrpc.PetrelConnection_GridProperty/GridProperty_GetDate', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Date.FromString, ) self.GridProperty_GetUpscaledCells = channel.unary_unary( '/petrelgrpc.PetrelConnection_GridProperty/GridProperty_GetUpscaledCells', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.IndicesArray.FromString, ) self.GridProperty_SetUpscaledCells = channel.unary_unary( '/petrelgrpc.PetrelConnection_GridProperty/GridProperty_SetUpscaledCells', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SetIndicesArray_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, ) self.GridProperty_GetParentPropertyCollection = channel.unary_unary( '/petrelgrpc.PetrelConnection_GridProperty/GridProperty_GetParentPropertyCollection', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.FromString, ) self.GridDictionaryProperty_GetAllDictionaryCodes = channel.unary_unary( '/petrelgrpc.PetrelConnection_GridProperty/GridDictionaryProperty_GetAllDictionaryCodes', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.IntStringTuples.FromString, ) self.GetPropertyCollection = channel.unary_unary( '/petrelgrpc.PetrelConnection_GridProperty/GetPropertyCollection', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Property_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, ) self.PropertyCollection_GetPropertyObjects = channel.unary_unary( '/petrelgrpc.PetrelConnection_GridProperty/PropertyCollection_GetPropertyObjects', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Properties_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuids.FromString, ) class PetrelConnection_GridPropertyServicer(object): """Missing associated documentation comment in .proto file.""" def GetGridProperty(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def GridProperty_ParentGrid(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def GridProperty_DisplayUnitSymbol(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def GridProperty_Extent(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def GridProperty_GetChunk(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def GridProperty_StreamSetChunk(self, request_iterator, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def GridProperty_GetDate(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def GridProperty_GetUpscaledCells(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def GridProperty_SetUpscaledCells(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def GridProperty_GetParentPropertyCollection(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def GridDictionaryProperty_GetAllDictionaryCodes(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def GetPropertyCollection(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def PropertyCollection_GetPropertyObjects(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def add_PetrelConnection_GridPropertyServicer_to_server(servicer, server): rpc_method_handlers = { 'GetGridProperty': grpc.unary_unary_rpc_method_handler( servicer.GetGridProperty, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Property_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.SerializeToString, ), 'GridProperty_ParentGrid': grpc.unary_unary_rpc_method_handler( servicer.GridProperty_ParentGrid, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.SerializeToString, ), 'GridProperty_DisplayUnitSymbol': grpc.unary_unary_rpc_method_handler( servicer.GridProperty_DisplayUnitSymbol, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.SerializeToString, ), 'GridProperty_Extent': grpc.unary_unary_rpc_method_handler( servicer.GridProperty_Extent, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.Indices3.SerializeToString, ), 'GridProperty_GetChunk': grpc.unary_stream_rpc_method_handler( servicer.GridProperty_GetChunk, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GetChunk_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Subchunk.SerializeToString, ), 'GridProperty_StreamSetChunk': grpc.stream_unary_rpc_method_handler( servicer.GridProperty_StreamSetChunk, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SetSubchunk_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Report.SerializeToString, ), 'GridProperty_GetDate': grpc.unary_unary_rpc_method_handler( servicer.GridProperty_GetDate, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Date.SerializeToString, ), 'GridProperty_GetUpscaledCells': grpc.unary_unary_rpc_method_handler( servicer.GridProperty_GetUpscaledCells, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.IndicesArray.SerializeToString, ), 'GridProperty_SetUpscaledCells': grpc.unary_unary_rpc_method_handler( servicer.GridProperty_SetUpscaledCells, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SetIndicesArray_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.SerializeToString, ), 'GridProperty_GetParentPropertyCollection': grpc.unary_unary_rpc_method_handler( servicer.GridProperty_GetParentPropertyCollection, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.SerializeToString, ), 'GridDictionaryProperty_GetAllDictionaryCodes': grpc.unary_unary_rpc_method_handler( servicer.GridDictionaryProperty_GetAllDictionaryCodes, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.IntStringTuples.SerializeToString, ), 'GetPropertyCollection': grpc.unary_unary_rpc_method_handler( servicer.GetPropertyCollection, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Property_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.SerializeToString, ), 'PropertyCollection_GetPropertyObjects': grpc.unary_unary_rpc_method_handler( servicer.PropertyCollection_GetPropertyObjects, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Properties_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuids.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'petrelgrpc.PetrelConnection_GridProperty', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) # This class is part of an EXPERIMENTAL API. class PetrelConnection_GridProperty(object): """Missing associated documentation comment in .proto file.""" @staticmethod def GetGridProperty(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_GridProperty/GetGridProperty', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Property_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def GridProperty_ParentGrid(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_GridProperty/GridProperty_ParentGrid', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def GridProperty_DisplayUnitSymbol(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_GridProperty/GridProperty_DisplayUnitSymbol', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def GridProperty_Extent(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_GridProperty/GridProperty_Extent', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.Indices3.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def GridProperty_GetChunk(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_GridProperty/GridProperty_GetChunk', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GetChunk_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Subchunk.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def GridProperty_StreamSetChunk(request_iterator, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.stream_unary(request_iterator, target, '/petrelgrpc.PetrelConnection_GridProperty/GridProperty_StreamSetChunk', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SetSubchunk_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Report.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def GridProperty_GetDate(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_GridProperty/GridProperty_GetDate', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Date.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def GridProperty_GetUpscaledCells(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_GridProperty/GridProperty_GetUpscaledCells', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.IndicesArray.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def GridProperty_SetUpscaledCells(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_GridProperty/GridProperty_SetUpscaledCells', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SetIndicesArray_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def GridProperty_GetParentPropertyCollection(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_GridProperty/GridProperty_GetParentPropertyCollection', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def GridDictionaryProperty_GetAllDictionaryCodes(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_GridProperty/GridDictionaryProperty_GetAllDictionaryCodes', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.IntStringTuples.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def GetPropertyCollection(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_GridProperty/GetPropertyCollection', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Property_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def PropertyCollection_GetPropertyObjects(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_GridProperty/PropertyCollection_GetPropertyObjects', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Properties_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuids.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) class PetrelConnection_SurfaceStub(object): """Missing associated documentation comment in .proto file.""" def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. """ self.GetSurface = channel.unary_unary( '/petrelgrpc.PetrelConnection_Surface/GetSurface', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, ) self.Surface_Extent = channel.unary_unary( '/petrelgrpc.PetrelConnection_Surface/Surface_Extent', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.Indices2.FromString, ) self.Surface_AxesRange = channel.unary_unary( '/petrelgrpc.PetrelConnection_Surface/Surface_AxesRange', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.AxesRange.FromString, ) self.Surface_IndexAtPosition = channel.unary_unary( '/petrelgrpc.PetrelConnection_Surface/Surface_IndexAtPosition', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.IndexAtPosition_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.ExtIndices2.FromString, ) self.Surface_PositionAtIndex = channel.unary_unary( '/petrelgrpc.PetrelConnection_Surface/Surface_PositionAtIndex', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PositionAtIndex_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.ExtDouble3.FromString, ) self.Surface_Properties = channel.unary_unary( '/petrelgrpc.PetrelConnection_Surface/Surface_Properties', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Properties_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuids.FromString, ) self.Surface_ParentSurfaceCollection = channel.unary_unary( '/petrelgrpc.PetrelConnection_Surface/Surface_ParentSurfaceCollection', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, ) self.Surface_GetIjk = channel.unary_unary( '/petrelgrpc.PetrelConnection_Surface/Surface_GetIjk', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Surface_GetIjk_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Surface_GetIjk_Response.FromString, ) self.Surface_GetPositions = channel.unary_unary( '/petrelgrpc.PetrelConnection_Surface/Surface_GetPositions', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Surface_GetPositions_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Surface_GetPositions_Response.FromString, ) self.RegularHeightField_GetCrs = channel.unary_unary( '/petrelgrpc.PetrelConnection_Surface/RegularHeightField_GetCrs', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.RegularHeightField_GetCrs_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.RegularHeightField_GetCrs_Response.FromString, ) self.RegularHeightField_GetAffineTransform = channel.unary_stream( '/petrelgrpc.PetrelConnection_Surface/RegularHeightField_GetAffineTransform', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.RegularHeightField_GetAffineTransform_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.RegularHeightField_GetAffineTransform_Response.FromString, ) class PetrelConnection_SurfaceServicer(object): """Missing associated documentation comment in .proto file.""" def GetSurface(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Surface_Extent(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Surface_AxesRange(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Surface_IndexAtPosition(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Surface_PositionAtIndex(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Surface_Properties(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Surface_ParentSurfaceCollection(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Surface_GetIjk(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Surface_GetPositions(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def RegularHeightField_GetCrs(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def RegularHeightField_GetAffineTransform(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def add_PetrelConnection_SurfaceServicer_to_server(servicer, server): rpc_method_handlers = { 'GetSurface': grpc.unary_unary_rpc_method_handler( servicer.GetSurface, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.SerializeToString, ), 'Surface_Extent': grpc.unary_unary_rpc_method_handler( servicer.Surface_Extent, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.Indices2.SerializeToString, ), 'Surface_AxesRange': grpc.unary_unary_rpc_method_handler( servicer.Surface_AxesRange, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.AxesRange.SerializeToString, ), 'Surface_IndexAtPosition': grpc.unary_unary_rpc_method_handler( servicer.Surface_IndexAtPosition, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.IndexAtPosition_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.ExtIndices2.SerializeToString, ), 'Surface_PositionAtIndex': grpc.unary_unary_rpc_method_handler( servicer.Surface_PositionAtIndex, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PositionAtIndex_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.ExtDouble3.SerializeToString, ), 'Surface_Properties': grpc.unary_unary_rpc_method_handler( servicer.Surface_Properties, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Properties_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuids.SerializeToString, ), 'Surface_ParentSurfaceCollection': grpc.unary_unary_rpc_method_handler( servicer.Surface_ParentSurfaceCollection, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, ), 'Surface_GetIjk': grpc.unary_unary_rpc_method_handler( servicer.Surface_GetIjk, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Surface_GetIjk_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Surface_GetIjk_Response.SerializeToString, ), 'Surface_GetPositions': grpc.unary_unary_rpc_method_handler( servicer.Surface_GetPositions, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Surface_GetPositions_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Surface_GetPositions_Response.SerializeToString, ), 'RegularHeightField_GetCrs': grpc.unary_unary_rpc_method_handler( servicer.RegularHeightField_GetCrs, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.RegularHeightField_GetCrs_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.RegularHeightField_GetCrs_Response.SerializeToString, ), 'RegularHeightField_GetAffineTransform': grpc.unary_stream_rpc_method_handler( servicer.RegularHeightField_GetAffineTransform, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.RegularHeightField_GetAffineTransform_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.RegularHeightField_GetAffineTransform_Response.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'petrelgrpc.PetrelConnection_Surface', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) # This class is part of an EXPERIMENTAL API. class PetrelConnection_Surface(object): """Missing associated documentation comment in .proto file.""" @staticmethod def GetSurface(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Surface/GetSurface', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Surface_Extent(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Surface/Surface_Extent', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.Indices2.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Surface_AxesRange(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Surface/Surface_AxesRange', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.AxesRange.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Surface_IndexAtPosition(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Surface/Surface_IndexAtPosition', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.IndexAtPosition_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.ExtIndices2.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Surface_PositionAtIndex(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Surface/Surface_PositionAtIndex', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PositionAtIndex_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.ExtDouble3.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Surface_Properties(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Surface/Surface_Properties', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Properties_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuids.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Surface_ParentSurfaceCollection(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Surface/Surface_ParentSurfaceCollection', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Surface_GetIjk(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Surface/Surface_GetIjk', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Surface_GetIjk_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Surface_GetIjk_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Surface_GetPositions(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Surface/Surface_GetPositions', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Surface_GetPositions_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Surface_GetPositions_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def RegularHeightField_GetCrs(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Surface/RegularHeightField_GetCrs', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.RegularHeightField_GetCrs_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.RegularHeightField_GetCrs_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def RegularHeightField_GetAffineTransform(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_Surface/RegularHeightField_GetAffineTransform', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.RegularHeightField_GetAffineTransform_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.RegularHeightField_GetAffineTransform_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) class PetrelConnection_SurfaceCollectionStub(object): """Missing associated documentation comment in .proto file.""" def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. """ self.SurfaceCollection_GetRegularHeightFieldObjects = channel.unary_unary( '/petrelgrpc.PetrelConnection_SurfaceCollection/SurfaceCollection_GetRegularHeightFieldObjects', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuids.FromString, ) class PetrelConnection_SurfaceCollectionServicer(object): """Missing associated documentation comment in .proto file.""" def SurfaceCollection_GetRegularHeightFieldObjects(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def add_PetrelConnection_SurfaceCollectionServicer_to_server(servicer, server): rpc_method_handlers = { 'SurfaceCollection_GetRegularHeightFieldObjects': grpc.unary_unary_rpc_method_handler( servicer.SurfaceCollection_GetRegularHeightFieldObjects, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuids.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'petrelgrpc.PetrelConnection_SurfaceCollection', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) # This class is part of an EXPERIMENTAL API. class PetrelConnection_SurfaceCollection(object): """Missing associated documentation comment in .proto file.""" @staticmethod def SurfaceCollection_GetRegularHeightFieldObjects(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_SurfaceCollection/SurfaceCollection_GetRegularHeightFieldObjects', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuids.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) class PetrelConnection_SurfacePropertyStub(object): """Missing associated documentation comment in .proto file.""" def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. """ self.GetSurfaceProperty = channel.unary_unary( '/petrelgrpc.PetrelConnection_SurfaceProperty/GetSurfaceProperty', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Property_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, ) self.SurfaceProperty_DisplayUnitSymbol = channel.unary_unary( '/petrelgrpc.PetrelConnection_SurfaceProperty/SurfaceProperty_DisplayUnitSymbol', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.FromString, ) self.SurfaceProperty_GetChunk = channel.unary_stream( '/petrelgrpc.PetrelConnection_SurfaceProperty/SurfaceProperty_GetChunk', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GetChunk_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Subchunk.FromString, ) self.SurfaceProperty_Extent = channel.unary_unary( '/petrelgrpc.PetrelConnection_SurfaceProperty/SurfaceProperty_Extent', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.Indices3.FromString, ) self.SurfaceProperty_StreamSetChunk = channel.stream_unary( '/petrelgrpc.PetrelConnection_SurfaceProperty/SurfaceProperty_StreamSetChunk', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SetSubchunk_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Report.FromString, ) self.SurfaceProperty_TypeOfSurface = channel.unary_unary( '/petrelgrpc.PetrelConnection_SurfaceProperty/SurfaceProperty_TypeOfSurface', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.FromString, ) self.SurfaceProperty_ParentSurface = channel.unary_unary( '/petrelgrpc.PetrelConnection_SurfaceProperty/SurfaceProperty_ParentSurface', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.FromString, ) self.SurfaceProperty_GetAllDictionaryCodes = channel.unary_unary( '/petrelgrpc.PetrelConnection_SurfaceProperty/SurfaceProperty_GetAllDictionaryCodes', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.IntStringTuples.FromString, ) self.SurfaceProperty_GetIjk = channel.unary_unary( '/petrelgrpc.PetrelConnection_SurfaceProperty/SurfaceProperty_GetIjk', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SurfaceProperty_GetIjk_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SurfaceProperty_GetIjk_Response.FromString, ) self.SurfaceProperty_GetPositions = channel.unary_unary( '/petrelgrpc.PetrelConnection_SurfaceProperty/SurfaceProperty_GetPositions', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SurfaceProperty_GetPositions_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SurfaceProperty_GetPositions_Response.FromString, ) self.SurfaceProperty_GetCrs = channel.unary_unary( '/petrelgrpc.PetrelConnection_SurfaceProperty/SurfaceProperty_GetCrs', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SurfaceProperty_GetCrs_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SurfaceProperty_GetCrs_Response.FromString, ) self.SurfaceProperty_GetAffineTransform = channel.unary_stream( '/petrelgrpc.PetrelConnection_SurfaceProperty/SurfaceProperty_GetAffineTransform', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SurfaceProperty_GetAffineTransform_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SurfaceProperty_GetAffineTransform_Response.FromString, ) class PetrelConnection_SurfacePropertyServicer(object): """Missing associated documentation comment in .proto file.""" def GetSurfaceProperty(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def SurfaceProperty_DisplayUnitSymbol(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def SurfaceProperty_GetChunk(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def SurfaceProperty_Extent(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def SurfaceProperty_StreamSetChunk(self, request_iterator, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def SurfaceProperty_TypeOfSurface(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def SurfaceProperty_ParentSurface(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def SurfaceProperty_GetAllDictionaryCodes(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def SurfaceProperty_GetIjk(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def SurfaceProperty_GetPositions(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def SurfaceProperty_GetCrs(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def SurfaceProperty_GetAffineTransform(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def add_PetrelConnection_SurfacePropertyServicer_to_server(servicer, server): rpc_method_handlers = { 'GetSurfaceProperty': grpc.unary_unary_rpc_method_handler( servicer.GetSurfaceProperty, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Property_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.SerializeToString, ), 'SurfaceProperty_DisplayUnitSymbol': grpc.unary_unary_rpc_method_handler( servicer.SurfaceProperty_DisplayUnitSymbol, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.SerializeToString, ), 'SurfaceProperty_GetChunk': grpc.unary_stream_rpc_method_handler( servicer.SurfaceProperty_GetChunk, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GetChunk_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Subchunk.SerializeToString, ), 'SurfaceProperty_Extent': grpc.unary_unary_rpc_method_handler( servicer.SurfaceProperty_Extent, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.Indices3.SerializeToString, ), 'SurfaceProperty_StreamSetChunk': grpc.stream_unary_rpc_method_handler( servicer.SurfaceProperty_StreamSetChunk, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SetSubchunk_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Report.SerializeToString, ), 'SurfaceProperty_TypeOfSurface': grpc.unary_unary_rpc_method_handler( servicer.SurfaceProperty_TypeOfSurface, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.SerializeToString, ), 'SurfaceProperty_ParentSurface': grpc.unary_unary_rpc_method_handler( servicer.SurfaceProperty_ParentSurface, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.SerializeToString, ), 'SurfaceProperty_GetAllDictionaryCodes': grpc.unary_unary_rpc_method_handler( servicer.SurfaceProperty_GetAllDictionaryCodes, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.IntStringTuples.SerializeToString, ), 'SurfaceProperty_GetIjk': grpc.unary_unary_rpc_method_handler( servicer.SurfaceProperty_GetIjk, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SurfaceProperty_GetIjk_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SurfaceProperty_GetIjk_Response.SerializeToString, ), 'SurfaceProperty_GetPositions': grpc.unary_unary_rpc_method_handler( servicer.SurfaceProperty_GetPositions, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SurfaceProperty_GetPositions_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SurfaceProperty_GetPositions_Response.SerializeToString, ), 'SurfaceProperty_GetCrs': grpc.unary_unary_rpc_method_handler( servicer.SurfaceProperty_GetCrs, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SurfaceProperty_GetCrs_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SurfaceProperty_GetCrs_Response.SerializeToString, ), 'SurfaceProperty_GetAffineTransform': grpc.unary_stream_rpc_method_handler( servicer.SurfaceProperty_GetAffineTransform, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SurfaceProperty_GetAffineTransform_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SurfaceProperty_GetAffineTransform_Response.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'petrelgrpc.PetrelConnection_SurfaceProperty', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) # This class is part of an EXPERIMENTAL API. class PetrelConnection_SurfaceProperty(object): """Missing associated documentation comment in .proto file.""" @staticmethod def GetSurfaceProperty(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_SurfaceProperty/GetSurfaceProperty', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Property_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def SurfaceProperty_DisplayUnitSymbol(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_SurfaceProperty/SurfaceProperty_DisplayUnitSymbol', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def SurfaceProperty_GetChunk(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_SurfaceProperty/SurfaceProperty_GetChunk', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GetChunk_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Subchunk.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def SurfaceProperty_Extent(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_SurfaceProperty/SurfaceProperty_Extent', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.Indices3.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def SurfaceProperty_StreamSetChunk(request_iterator, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.stream_unary(request_iterator, target, '/petrelgrpc.PetrelConnection_SurfaceProperty/SurfaceProperty_StreamSetChunk', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SetSubchunk_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Report.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def SurfaceProperty_TypeOfSurface(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_SurfaceProperty/SurfaceProperty_TypeOfSurface', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def SurfaceProperty_ParentSurface(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_SurfaceProperty/SurfaceProperty_ParentSurface', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def SurfaceProperty_GetAllDictionaryCodes(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_SurfaceProperty/SurfaceProperty_GetAllDictionaryCodes', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.IntStringTuples.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def SurfaceProperty_GetIjk(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_SurfaceProperty/SurfaceProperty_GetIjk', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SurfaceProperty_GetIjk_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SurfaceProperty_GetIjk_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def SurfaceProperty_GetPositions(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_SurfaceProperty/SurfaceProperty_GetPositions', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SurfaceProperty_GetPositions_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SurfaceProperty_GetPositions_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def SurfaceProperty_GetCrs(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_SurfaceProperty/SurfaceProperty_GetCrs', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SurfaceProperty_GetCrs_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SurfaceProperty_GetCrs_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def SurfaceProperty_GetAffineTransform(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_SurfaceProperty/SurfaceProperty_GetAffineTransform', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SurfaceProperty_GetAffineTransform_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SurfaceProperty_GetAffineTransform_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) class PetrelConnection_CompletionsSetStub(object): """Missing associated documentation comment in .proto file.""" def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. """ self.CompletionsSet_GetCompletionsData = channel.unary_stream( '/petrelgrpc.PetrelConnection_CompletionsSet/CompletionsSet_GetCompletionsData', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_GetData_Response.FromString, ) self.CompletionsSet_GetCasingStrings = channel.unary_stream( '/petrelgrpc.PetrelConnection_CompletionsSet/CompletionsSet_GetCasingStrings', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, ) self.CompletionsSet_GetPerforations = channel.unary_stream( '/petrelgrpc.PetrelConnection_CompletionsSet/CompletionsSet_GetPerforations', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, ) self.CompletionsSet_GetPlugbacks = channel.unary_stream( '/petrelgrpc.PetrelConnection_CompletionsSet/CompletionsSet_GetPlugbacks', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, ) self.CompletionsSet_GetSqueezes = channel.unary_stream( '/petrelgrpc.PetrelConnection_CompletionsSet/CompletionsSet_GetSqueezes', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, ) self.CompletionsSet_AddPerforation = channel.unary_unary( '/petrelgrpc.PetrelConnection_CompletionsSet/CompletionsSet_AddPerforation', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_AddPerforation_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, ) self.CompletionsSet_AddCasingString = channel.unary_unary( '/petrelgrpc.PetrelConnection_CompletionsSet/CompletionsSet_AddCasingString', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_AddCasingString_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, ) self.CompletionsSet_AddPlugback = channel.unary_unary( '/petrelgrpc.PetrelConnection_CompletionsSet/CompletionsSet_AddPlugback', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_AddPlugback_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, ) self.CompletionsSet_AddSqueeze = channel.unary_unary( '/petrelgrpc.PetrelConnection_CompletionsSet/CompletionsSet_AddSqueeze', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_AddSqueeze_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, ) class PetrelConnection_CompletionsSetServicer(object): """Missing associated documentation comment in .proto file.""" def CompletionsSet_GetCompletionsData(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def CompletionsSet_GetCasingStrings(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def CompletionsSet_GetPerforations(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def CompletionsSet_GetPlugbacks(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def CompletionsSet_GetSqueezes(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def CompletionsSet_AddPerforation(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def CompletionsSet_AddCasingString(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def CompletionsSet_AddPlugback(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def CompletionsSet_AddSqueeze(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def add_PetrelConnection_CompletionsSetServicer_to_server(servicer, server): rpc_method_handlers = { 'CompletionsSet_GetCompletionsData': grpc.unary_stream_rpc_method_handler( servicer.CompletionsSet_GetCompletionsData, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_GetData_Response.SerializeToString, ), 'CompletionsSet_GetCasingStrings': grpc.unary_stream_rpc_method_handler( servicer.CompletionsSet_GetCasingStrings, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.SerializeToString, ), 'CompletionsSet_GetPerforations': grpc.unary_stream_rpc_method_handler( servicer.CompletionsSet_GetPerforations, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.SerializeToString, ), 'CompletionsSet_GetPlugbacks': grpc.unary_stream_rpc_method_handler( servicer.CompletionsSet_GetPlugbacks, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.SerializeToString, ), 'CompletionsSet_GetSqueezes': grpc.unary_stream_rpc_method_handler( servicer.CompletionsSet_GetSqueezes, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.SerializeToString, ), 'CompletionsSet_AddPerforation': grpc.unary_unary_rpc_method_handler( servicer.CompletionsSet_AddPerforation, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_AddPerforation_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.SerializeToString, ), 'CompletionsSet_AddCasingString': grpc.unary_unary_rpc_method_handler( servicer.CompletionsSet_AddCasingString, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_AddCasingString_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.SerializeToString, ), 'CompletionsSet_AddPlugback': grpc.unary_unary_rpc_method_handler( servicer.CompletionsSet_AddPlugback, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_AddPlugback_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.SerializeToString, ), 'CompletionsSet_AddSqueeze': grpc.unary_unary_rpc_method_handler( servicer.CompletionsSet_AddSqueeze, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_AddSqueeze_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'petrelgrpc.PetrelConnection_CompletionsSet', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) # This class is part of an EXPERIMENTAL API. class PetrelConnection_CompletionsSet(object): """Missing associated documentation comment in .proto file.""" @staticmethod def CompletionsSet_GetCompletionsData(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_CompletionsSet/CompletionsSet_GetCompletionsData', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_GetData_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def CompletionsSet_GetCasingStrings(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_CompletionsSet/CompletionsSet_GetCasingStrings', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def CompletionsSet_GetPerforations(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_CompletionsSet/CompletionsSet_GetPerforations', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def CompletionsSet_GetPlugbacks(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_CompletionsSet/CompletionsSet_GetPlugbacks', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def CompletionsSet_GetSqueezes(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_CompletionsSet/CompletionsSet_GetSqueezes', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def CompletionsSet_AddPerforation(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_CompletionsSet/CompletionsSet_AddPerforation', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_AddPerforation_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def CompletionsSet_AddCasingString(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_CompletionsSet/CompletionsSet_AddCasingString', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_AddCasingString_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def CompletionsSet_AddPlugback(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_CompletionsSet/CompletionsSet_AddPlugback', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_AddPlugback_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def CompletionsSet_AddSqueeze(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_CompletionsSet/CompletionsSet_AddSqueeze', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_AddSqueeze_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) class PetrelConnection_CompletionsSet_CasingStringStub(object): """Missing associated documentation comment in .proto file.""" def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. """ self.CompletionsSet_GetCasingStringEndDepth = channel.unary_unary( '/petrelgrpc.PetrelConnection_CompletionsSet_CasingString/CompletionsSet_GetCasingStringEndDepth', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_GetDepth_Response.FromString, ) self.CompletionsSet_SetCasingStringEndDepth = channel.unary_unary( '/petrelgrpc.PetrelConnection_CompletionsSet_CasingString/CompletionsSet_SetCasingStringEndDepth', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_SetDepth_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, ) self.CompletionsSet_GetCasingStringStartDate = channel.unary_unary( '/petrelgrpc.PetrelConnection_CompletionsSet_CasingString/CompletionsSet_GetCasingStringStartDate', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_GetStartDate_Response.FromString, ) self.CompletionsSet_SetCasingStringStartDate = channel.unary_unary( '/petrelgrpc.PetrelConnection_CompletionsSet_CasingString/CompletionsSet_SetCasingStringStartDate', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_SetStartDate_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, ) self.CompletionsSet_GetAvailableCasingEquipment = channel.unary_stream( '/petrelgrpc.PetrelConnection_CompletionsSet_CasingString/CompletionsSet_GetAvailableCasingEquipment', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_CasingStrings_GetEquipment_Response.FromString, ) self.CompletionsSet_GetCasingStringParts = channel.unary_stream( '/petrelgrpc.PetrelConnection_CompletionsSet_CasingString/CompletionsSet_GetCasingStringParts', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_CasingStrings_GetParts_Response.FromString, ) self.CompletionsSet_AddCasingStringPart = channel.unary_unary( '/petrelgrpc.PetrelConnection_CompletionsSet_CasingString/CompletionsSet_AddCasingStringPart', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_AddCasingStringPart_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_AddCasingStringPart_Response.FromString, ) self.CompletionsSet_RemoveCasingStringPart = channel.unary_unary( '/petrelgrpc.PetrelConnection_CompletionsSet_CasingString/CompletionsSet_RemoveCasingStringPart', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_RemoveCasingStringPart_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, ) self.CompletionsSet_SetCasingPartDepth = channel.unary_unary( '/petrelgrpc.PetrelConnection_CompletionsSet_CasingString/CompletionsSet_SetCasingPartDepth', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_CasingStrings_SetPartDepth_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_CasingStrings_SetPartDepth_Response.FromString, ) class PetrelConnection_CompletionsSet_CasingStringServicer(object): """Missing associated documentation comment in .proto file.""" def CompletionsSet_GetCasingStringEndDepth(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def CompletionsSet_SetCasingStringEndDepth(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def CompletionsSet_GetCasingStringStartDate(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def CompletionsSet_SetCasingStringStartDate(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def CompletionsSet_GetAvailableCasingEquipment(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def CompletionsSet_GetCasingStringParts(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def CompletionsSet_AddCasingStringPart(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def CompletionsSet_RemoveCasingStringPart(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def CompletionsSet_SetCasingPartDepth(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def add_PetrelConnection_CompletionsSet_CasingStringServicer_to_server(servicer, server): rpc_method_handlers = { 'CompletionsSet_GetCasingStringEndDepth': grpc.unary_unary_rpc_method_handler( servicer.CompletionsSet_GetCasingStringEndDepth, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_GetDepth_Response.SerializeToString, ), 'CompletionsSet_SetCasingStringEndDepth': grpc.unary_unary_rpc_method_handler( servicer.CompletionsSet_SetCasingStringEndDepth, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_SetDepth_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.SerializeToString, ), 'CompletionsSet_GetCasingStringStartDate': grpc.unary_unary_rpc_method_handler( servicer.CompletionsSet_GetCasingStringStartDate, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_GetStartDate_Response.SerializeToString, ), 'CompletionsSet_SetCasingStringStartDate': grpc.unary_unary_rpc_method_handler( servicer.CompletionsSet_SetCasingStringStartDate, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_SetStartDate_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.SerializeToString, ), 'CompletionsSet_GetAvailableCasingEquipment': grpc.unary_stream_rpc_method_handler( servicer.CompletionsSet_GetAvailableCasingEquipment, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_CasingStrings_GetEquipment_Response.SerializeToString, ), 'CompletionsSet_GetCasingStringParts': grpc.unary_stream_rpc_method_handler( servicer.CompletionsSet_GetCasingStringParts, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_CasingStrings_GetParts_Response.SerializeToString, ), 'CompletionsSet_AddCasingStringPart': grpc.unary_unary_rpc_method_handler( servicer.CompletionsSet_AddCasingStringPart, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_AddCasingStringPart_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_AddCasingStringPart_Response.SerializeToString, ), 'CompletionsSet_RemoveCasingStringPart': grpc.unary_unary_rpc_method_handler( servicer.CompletionsSet_RemoveCasingStringPart, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_RemoveCasingStringPart_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.SerializeToString, ), 'CompletionsSet_SetCasingPartDepth': grpc.unary_unary_rpc_method_handler( servicer.CompletionsSet_SetCasingPartDepth, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_CasingStrings_SetPartDepth_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_CasingStrings_SetPartDepth_Response.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'petrelgrpc.PetrelConnection_CompletionsSet_CasingString', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) # This class is part of an EXPERIMENTAL API. class PetrelConnection_CompletionsSet_CasingString(object): """Missing associated documentation comment in .proto file.""" @staticmethod def CompletionsSet_GetCasingStringEndDepth(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_CompletionsSet_CasingString/CompletionsSet_GetCasingStringEndDepth', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_GetDepth_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def CompletionsSet_SetCasingStringEndDepth(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_CompletionsSet_CasingString/CompletionsSet_SetCasingStringEndDepth', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_SetDepth_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def CompletionsSet_GetCasingStringStartDate(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_CompletionsSet_CasingString/CompletionsSet_GetCasingStringStartDate', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_GetStartDate_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def CompletionsSet_SetCasingStringStartDate(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_CompletionsSet_CasingString/CompletionsSet_SetCasingStringStartDate', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_SetStartDate_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def CompletionsSet_GetAvailableCasingEquipment(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_CompletionsSet_CasingString/CompletionsSet_GetAvailableCasingEquipment', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_CasingStrings_GetEquipment_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def CompletionsSet_GetCasingStringParts(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_CompletionsSet_CasingString/CompletionsSet_GetCasingStringParts', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_CasingStrings_GetParts_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def CompletionsSet_AddCasingStringPart(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_CompletionsSet_CasingString/CompletionsSet_AddCasingStringPart', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_AddCasingStringPart_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_AddCasingStringPart_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def CompletionsSet_RemoveCasingStringPart(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_CompletionsSet_CasingString/CompletionsSet_RemoveCasingStringPart', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_RemoveCasingStringPart_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def CompletionsSet_SetCasingPartDepth(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_CompletionsSet_CasingString/CompletionsSet_SetCasingPartDepth', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_CasingStrings_SetPartDepth_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_CasingStrings_SetPartDepth_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) class PetrelConnection_CompletionsSet_PerforationStub(object): """Missing associated documentation comment in .proto file.""" def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. """ self.CompletionsSet_GetPerforationTopMd = channel.unary_unary( '/petrelgrpc.PetrelConnection_CompletionsSet_Perforation/CompletionsSet_GetPerforationTopMd', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_GetDepth_Response.FromString, ) self.CompletionsSet_SetPerforationTopMd = channel.unary_unary( '/petrelgrpc.PetrelConnection_CompletionsSet_Perforation/CompletionsSet_SetPerforationTopMd', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_SetDepth_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, ) self.CompletionsSet_GetPerforationBottomMd = channel.unary_unary( '/petrelgrpc.PetrelConnection_CompletionsSet_Perforation/CompletionsSet_GetPerforationBottomMd', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_GetDepth_Response.FromString, ) self.CompletionsSet_SetPerforationBottomMd = channel.unary_unary( '/petrelgrpc.PetrelConnection_CompletionsSet_Perforation/CompletionsSet_SetPerforationBottomMd', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_SetDepth_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, ) self.CompletionsSet_GetPerforationDate = channel.unary_unary( '/petrelgrpc.PetrelConnection_CompletionsSet_Perforation/CompletionsSet_GetPerforationDate', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_GetStartDate_Response.FromString, ) self.CompletionsSet_SetPerforationDate = channel.unary_unary( '/petrelgrpc.PetrelConnection_CompletionsSet_Perforation/CompletionsSet_SetPerforationDate', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_SetStartDate_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, ) self.CompletionsSet_GetPerforationSkinFactor = channel.unary_unary( '/petrelgrpc.PetrelConnection_CompletionsSet_Perforation/CompletionsSet_GetPerforationSkinFactor', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_Perforations_GetSkinFactor_Response.FromString, ) self.CompletionsSet_SetPerforationSkinFactor = channel.unary_unary( '/petrelgrpc.PetrelConnection_CompletionsSet_Perforation/CompletionsSet_SetPerforationSkinFactor', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_Perforations_SetSkinFactor_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, ) class PetrelConnection_CompletionsSet_PerforationServicer(object): """Missing associated documentation comment in .proto file.""" def CompletionsSet_GetPerforationTopMd(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def CompletionsSet_SetPerforationTopMd(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def CompletionsSet_GetPerforationBottomMd(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def CompletionsSet_SetPerforationBottomMd(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def CompletionsSet_GetPerforationDate(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def CompletionsSet_SetPerforationDate(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def CompletionsSet_GetPerforationSkinFactor(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def CompletionsSet_SetPerforationSkinFactor(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def add_PetrelConnection_CompletionsSet_PerforationServicer_to_server(servicer, server): rpc_method_handlers = { 'CompletionsSet_GetPerforationTopMd': grpc.unary_unary_rpc_method_handler( servicer.CompletionsSet_GetPerforationTopMd, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_GetDepth_Response.SerializeToString, ), 'CompletionsSet_SetPerforationTopMd': grpc.unary_unary_rpc_method_handler( servicer.CompletionsSet_SetPerforationTopMd, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_SetDepth_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.SerializeToString, ), 'CompletionsSet_GetPerforationBottomMd': grpc.unary_unary_rpc_method_handler( servicer.CompletionsSet_GetPerforationBottomMd, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_GetDepth_Response.SerializeToString, ), 'CompletionsSet_SetPerforationBottomMd': grpc.unary_unary_rpc_method_handler( servicer.CompletionsSet_SetPerforationBottomMd, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_SetDepth_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.SerializeToString, ), 'CompletionsSet_GetPerforationDate': grpc.unary_unary_rpc_method_handler( servicer.CompletionsSet_GetPerforationDate, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_GetStartDate_Response.SerializeToString, ), 'CompletionsSet_SetPerforationDate': grpc.unary_unary_rpc_method_handler( servicer.CompletionsSet_SetPerforationDate, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_SetStartDate_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.SerializeToString, ), 'CompletionsSet_GetPerforationSkinFactor': grpc.unary_unary_rpc_method_handler( servicer.CompletionsSet_GetPerforationSkinFactor, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_Perforations_GetSkinFactor_Response.SerializeToString, ), 'CompletionsSet_SetPerforationSkinFactor': grpc.unary_unary_rpc_method_handler( servicer.CompletionsSet_SetPerforationSkinFactor, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_Perforations_SetSkinFactor_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'petrelgrpc.PetrelConnection_CompletionsSet_Perforation', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) # This class is part of an EXPERIMENTAL API. class PetrelConnection_CompletionsSet_Perforation(object): """Missing associated documentation comment in .proto file.""" @staticmethod def CompletionsSet_GetPerforationTopMd(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_CompletionsSet_Perforation/CompletionsSet_GetPerforationTopMd', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_GetDepth_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def CompletionsSet_SetPerforationTopMd(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_CompletionsSet_Perforation/CompletionsSet_SetPerforationTopMd', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_SetDepth_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def CompletionsSet_GetPerforationBottomMd(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_CompletionsSet_Perforation/CompletionsSet_GetPerforationBottomMd', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_GetDepth_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def CompletionsSet_SetPerforationBottomMd(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_CompletionsSet_Perforation/CompletionsSet_SetPerforationBottomMd', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_SetDepth_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def CompletionsSet_GetPerforationDate(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_CompletionsSet_Perforation/CompletionsSet_GetPerforationDate', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_GetStartDate_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def CompletionsSet_SetPerforationDate(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_CompletionsSet_Perforation/CompletionsSet_SetPerforationDate', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_SetStartDate_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def CompletionsSet_GetPerforationSkinFactor(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_CompletionsSet_Perforation/CompletionsSet_GetPerforationSkinFactor', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_Perforations_GetSkinFactor_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def CompletionsSet_SetPerforationSkinFactor(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_CompletionsSet_Perforation/CompletionsSet_SetPerforationSkinFactor', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_Perforations_SetSkinFactor_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) class PetrelConnection_CompletionsSet_PlugbackStub(object): """Missing associated documentation comment in .proto file.""" def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. """ self.CompletionsSet_GetPlugbackTopMd = channel.unary_unary( '/petrelgrpc.PetrelConnection_CompletionsSet_Plugback/CompletionsSet_GetPlugbackTopMd', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_GetDepth_Response.FromString, ) self.CompletionsSet_SetPlugbackTopMd = channel.unary_unary( '/petrelgrpc.PetrelConnection_CompletionsSet_Plugback/CompletionsSet_SetPlugbackTopMd', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_SetDepth_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, ) self.CompletionsSet_GetPlugbackBottomMd = channel.unary_unary( '/petrelgrpc.PetrelConnection_CompletionsSet_Plugback/CompletionsSet_GetPlugbackBottomMd', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_GetDepth_Response.FromString, ) self.CompletionsSet_GetPlugbackStartDate = channel.unary_unary( '/petrelgrpc.PetrelConnection_CompletionsSet_Plugback/CompletionsSet_GetPlugbackStartDate', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_GetStartDate_Response.FromString, ) self.CompletionsSet_SetPlugbackStartDate = channel.unary_unary( '/petrelgrpc.PetrelConnection_CompletionsSet_Plugback/CompletionsSet_SetPlugbackStartDate', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_SetStartDate_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, ) class PetrelConnection_CompletionsSet_PlugbackServicer(object): """Missing associated documentation comment in .proto file.""" def CompletionsSet_GetPlugbackTopMd(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def CompletionsSet_SetPlugbackTopMd(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def CompletionsSet_GetPlugbackBottomMd(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def CompletionsSet_GetPlugbackStartDate(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def CompletionsSet_SetPlugbackStartDate(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def add_PetrelConnection_CompletionsSet_PlugbackServicer_to_server(servicer, server): rpc_method_handlers = { 'CompletionsSet_GetPlugbackTopMd': grpc.unary_unary_rpc_method_handler( servicer.CompletionsSet_GetPlugbackTopMd, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_GetDepth_Response.SerializeToString, ), 'CompletionsSet_SetPlugbackTopMd': grpc.unary_unary_rpc_method_handler( servicer.CompletionsSet_SetPlugbackTopMd, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_SetDepth_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.SerializeToString, ), 'CompletionsSet_GetPlugbackBottomMd': grpc.unary_unary_rpc_method_handler( servicer.CompletionsSet_GetPlugbackBottomMd, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_GetDepth_Response.SerializeToString, ), 'CompletionsSet_GetPlugbackStartDate': grpc.unary_unary_rpc_method_handler( servicer.CompletionsSet_GetPlugbackStartDate, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_GetStartDate_Response.SerializeToString, ), 'CompletionsSet_SetPlugbackStartDate': grpc.unary_unary_rpc_method_handler( servicer.CompletionsSet_SetPlugbackStartDate, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_SetStartDate_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'petrelgrpc.PetrelConnection_CompletionsSet_Plugback', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) # This class is part of an EXPERIMENTAL API. class PetrelConnection_CompletionsSet_Plugback(object): """Missing associated documentation comment in .proto file.""" @staticmethod def CompletionsSet_GetPlugbackTopMd(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_CompletionsSet_Plugback/CompletionsSet_GetPlugbackTopMd', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_GetDepth_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def CompletionsSet_SetPlugbackTopMd(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_CompletionsSet_Plugback/CompletionsSet_SetPlugbackTopMd', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_SetDepth_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def CompletionsSet_GetPlugbackBottomMd(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_CompletionsSet_Plugback/CompletionsSet_GetPlugbackBottomMd', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_GetDepth_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def CompletionsSet_GetPlugbackStartDate(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_CompletionsSet_Plugback/CompletionsSet_GetPlugbackStartDate', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_GetStartDate_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def CompletionsSet_SetPlugbackStartDate(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_CompletionsSet_Plugback/CompletionsSet_SetPlugbackStartDate', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_SetStartDate_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) class PetrelConnection_CompletionsSet_SqueezeStub(object): """Missing associated documentation comment in .proto file.""" def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. """ self.CompletionsSet_GetSqueezeTopMd = channel.unary_unary( '/petrelgrpc.PetrelConnection_CompletionsSet_Squeeze/CompletionsSet_GetSqueezeTopMd', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_GetDepth_Response.FromString, ) self.CompletionsSet_SetSqueezeTopMd = channel.unary_unary( '/petrelgrpc.PetrelConnection_CompletionsSet_Squeeze/CompletionsSet_SetSqueezeTopMd', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_SetDepth_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, ) self.CompletionsSet_GetSqueezeBottomMd = channel.unary_unary( '/petrelgrpc.PetrelConnection_CompletionsSet_Squeeze/CompletionsSet_GetSqueezeBottomMd', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_GetDepth_Response.FromString, ) self.CompletionsSet_SetSqueezeBottomMd = channel.unary_unary( '/petrelgrpc.PetrelConnection_CompletionsSet_Squeeze/CompletionsSet_SetSqueezeBottomMd', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_SetDepth_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, ) self.CompletionsSet_GetSqueezeStartDate = channel.unary_unary( '/petrelgrpc.PetrelConnection_CompletionsSet_Squeeze/CompletionsSet_GetSqueezeStartDate', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_GetStartDate_Response.FromString, ) self.CompletionsSet_SetSqueezeStartDate = channel.unary_unary( '/petrelgrpc.PetrelConnection_CompletionsSet_Squeeze/CompletionsSet_SetSqueezeStartDate', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_SetStartDate_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, ) class PetrelConnection_CompletionsSet_SqueezeServicer(object): """Missing associated documentation comment in .proto file.""" def CompletionsSet_GetSqueezeTopMd(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def CompletionsSet_SetSqueezeTopMd(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def CompletionsSet_GetSqueezeBottomMd(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def CompletionsSet_SetSqueezeBottomMd(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def CompletionsSet_GetSqueezeStartDate(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def CompletionsSet_SetSqueezeStartDate(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def add_PetrelConnection_CompletionsSet_SqueezeServicer_to_server(servicer, server): rpc_method_handlers = { 'CompletionsSet_GetSqueezeTopMd': grpc.unary_unary_rpc_method_handler( servicer.CompletionsSet_GetSqueezeTopMd, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_GetDepth_Response.SerializeToString, ), 'CompletionsSet_SetSqueezeTopMd': grpc.unary_unary_rpc_method_handler( servicer.CompletionsSet_SetSqueezeTopMd, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_SetDepth_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.SerializeToString, ), 'CompletionsSet_GetSqueezeBottomMd': grpc.unary_unary_rpc_method_handler( servicer.CompletionsSet_GetSqueezeBottomMd, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_GetDepth_Response.SerializeToString, ), 'CompletionsSet_SetSqueezeBottomMd': grpc.unary_unary_rpc_method_handler( servicer.CompletionsSet_SetSqueezeBottomMd, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_SetDepth_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.SerializeToString, ), 'CompletionsSet_GetSqueezeStartDate': grpc.unary_unary_rpc_method_handler( servicer.CompletionsSet_GetSqueezeStartDate, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_GetStartDate_Response.SerializeToString, ), 'CompletionsSet_SetSqueezeStartDate': grpc.unary_unary_rpc_method_handler( servicer.CompletionsSet_SetSqueezeStartDate, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_SetStartDate_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'petrelgrpc.PetrelConnection_CompletionsSet_Squeeze', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) # This class is part of an EXPERIMENTAL API. class PetrelConnection_CompletionsSet_Squeeze(object): """Missing associated documentation comment in .proto file.""" @staticmethod def CompletionsSet_GetSqueezeTopMd(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_CompletionsSet_Squeeze/CompletionsSet_GetSqueezeTopMd', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_GetDepth_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def CompletionsSet_SetSqueezeTopMd(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_CompletionsSet_Squeeze/CompletionsSet_SetSqueezeTopMd', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_SetDepth_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def CompletionsSet_GetSqueezeBottomMd(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_CompletionsSet_Squeeze/CompletionsSet_GetSqueezeBottomMd', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_GetDepth_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def CompletionsSet_SetSqueezeBottomMd(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_CompletionsSet_Squeeze/CompletionsSet_SetSqueezeBottomMd', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_SetDepth_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def CompletionsSet_GetSqueezeStartDate(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_CompletionsSet_Squeeze/CompletionsSet_GetSqueezeStartDate', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_GetStartDate_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def CompletionsSet_SetSqueezeStartDate(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_CompletionsSet_Squeeze/CompletionsSet_SetSqueezeStartDate', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CompletionsSet_SetStartDate_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) class PetrelConnection_BoreholeCollectionStub(object): """Missing associated documentation comment in .proto file.""" def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. """ self.GetBoreholeCollectionGrpc = channel.unary_unary( '/petrelgrpc.PetrelConnection_BoreholeCollection/GetBoreholeCollectionGrpc', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, ) class PetrelConnection_BoreholeCollectionServicer(object): """Missing associated documentation comment in .proto file.""" def GetBoreholeCollectionGrpc(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def add_PetrelConnection_BoreholeCollectionServicer_to_server(servicer, server): rpc_method_handlers = { 'GetBoreholeCollectionGrpc': grpc.unary_unary_rpc_method_handler( servicer.GetBoreholeCollectionGrpc, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'petrelgrpc.PetrelConnection_BoreholeCollection', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) # This class is part of an EXPERIMENTAL API. class PetrelConnection_BoreholeCollection(object): """Missing associated documentation comment in .proto file.""" @staticmethod def GetBoreholeCollectionGrpc(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_BoreholeCollection/GetBoreholeCollectionGrpc', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) class PetrelConnection_BoreholeStub(object): """Missing associated documentation comment in .proto file.""" def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. """ self.GetBorehole = channel.unary_unary( '/petrelgrpc.PetrelConnection_Borehole/GetBorehole', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, ) self.CreateBorehole = channel.unary_unary( '/petrelgrpc.PetrelConnection_Borehole/CreateBorehole', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CreateBorehole_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, ) self.Borehole_GetAllLogs = channel.unary_unary( '/petrelgrpc.PetrelConnection_Borehole/Borehole_GetAllLogs', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GetAllLogs_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuids.FromString, ) self.Borehole_GetLogsValues = channel.unary_stream( '/petrelgrpc.PetrelConnection_Borehole/Borehole_GetLogsValues', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GetLogsValues_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.LogValues.FromString, ) self.Borehole_GetElevationTimePosition = channel.unary_unary( '/petrelgrpc.PetrelConnection_Borehole/Borehole_GetElevationTimePosition', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetElevationTimePosition_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetElevationTimePosition_Response.FromString, ) self.Borehole_GetTvdPosition = channel.unary_unary( '/petrelgrpc.PetrelConnection_Borehole/Borehole_GetTvdPosition', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetTvdPosition_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetTvdPosition_Response.FromString, ) self.Borehole_GetObservedDataSets = channel.unary_stream( '/petrelgrpc.PetrelConnection_Borehole/Borehole_GetObservedDataSets', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetObservedDataSets_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetObservedDataSets_Response.FromString, ) self.Borehole_GetNumberOfObservedDataSets = channel.unary_unary( '/petrelgrpc.PetrelConnection_Borehole/Borehole_GetNumberOfObservedDataSets', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetNumberOfObservedDataSets_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetNumberOfObservedDataSets_Response.FromString, ) self.Borehole_GetXyzWellSurveys = channel.unary_stream( '/petrelgrpc.PetrelConnection_Borehole/Borehole_GetXyzWellSurveys', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetWellSurveys_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetWellSurveys_Response.FromString, ) self.Borehole_GetXytvdWellSurveys = channel.unary_stream( '/petrelgrpc.PetrelConnection_Borehole/Borehole_GetXytvdWellSurveys', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetWellSurveys_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetWellSurveys_Response.FromString, ) self.Borehole_GetDxdytvdWellSurveys = channel.unary_stream( '/petrelgrpc.PetrelConnection_Borehole/Borehole_GetDxdytvdWellSurveys', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetWellSurveys_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetWellSurveys_Response.FromString, ) self.Borehole_GetMdinclazimWellSurveys = channel.unary_stream( '/petrelgrpc.PetrelConnection_Borehole/Borehole_GetMdinclazimWellSurveys', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetWellSurveys_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetWellSurveys_Response.FromString, ) self.Borehole_GetExplicitWellSurveys = channel.unary_stream( '/petrelgrpc.PetrelConnection_Borehole/Borehole_GetExplicitWellSurveys', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetWellSurveys_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetWellSurveys_Response.FromString, ) self.Borehole_GetNumberOfWellSurveys = channel.unary_unary( '/petrelgrpc.PetrelConnection_Borehole/Borehole_GetNumberOfWellSurveys', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetNumberOfWellSurveys_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetNumberOfWellSurveys_Response.FromString, ) self.Borehole_GetWellDatum = channel.unary_unary( '/petrelgrpc.PetrelConnection_Borehole/Borehole_GetWellDatum', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetWellDatum_Response.FromString, ) self.Borehole_SetWellDatum = channel.unary_unary( '/petrelgrpc.PetrelConnection_Borehole/Borehole_SetWellDatum', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_SetWellDatum_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, ) self.Borehole_GetCrs = channel.unary_unary( '/petrelgrpc.PetrelConnection_Borehole/Borehole_GetCrs', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetCrs_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetCrs_Response.FromString, ) self.Borehole_CompletionsSetExists = channel.unary_unary( '/petrelgrpc.PetrelConnection_Borehole/Borehole_CompletionsSetExists', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, ) self.Borehole_GetWellHeadCoordinates = channel.unary_unary( '/petrelgrpc.PetrelConnection_Borehole/Borehole_GetWellHeadCoordinates', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.Double2.FromString, ) self.Borehole_SetWellHeadCoordinates = channel.unary_unary( '/petrelgrpc.PetrelConnection_Borehole/Borehole_SetWellHeadCoordinates', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_SetWellHeadCoordinates_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, ) self.Borehole_CreateTrajectory = channel.unary_unary( '/petrelgrpc.PetrelConnection_Borehole/Borehole_CreateTrajectory', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_CreateTrajectory_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, ) self.Borehole_CreateLateral = channel.unary_unary( '/petrelgrpc.PetrelConnection_Borehole/Borehole_CreateLateral', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_CreateLateral_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, ) self.Borehole_IsLateral = channel.unary_unary( '/petrelgrpc.PetrelConnection_Borehole/Borehole_IsLateral', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, ) class PetrelConnection_BoreholeServicer(object): """Missing associated documentation comment in .proto file.""" def GetBorehole(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def CreateBorehole(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Borehole_GetAllLogs(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Borehole_GetLogsValues(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Borehole_GetElevationTimePosition(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Borehole_GetTvdPosition(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Borehole_GetObservedDataSets(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Borehole_GetNumberOfObservedDataSets(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Borehole_GetXyzWellSurveys(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Borehole_GetXytvdWellSurveys(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Borehole_GetDxdytvdWellSurveys(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Borehole_GetMdinclazimWellSurveys(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Borehole_GetExplicitWellSurveys(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Borehole_GetNumberOfWellSurveys(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Borehole_GetWellDatum(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Borehole_SetWellDatum(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Borehole_GetCrs(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Borehole_CompletionsSetExists(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Borehole_GetWellHeadCoordinates(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Borehole_SetWellHeadCoordinates(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Borehole_CreateTrajectory(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Borehole_CreateLateral(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Borehole_IsLateral(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def add_PetrelConnection_BoreholeServicer_to_server(servicer, server): rpc_method_handlers = { 'GetBorehole': grpc.unary_unary_rpc_method_handler( servicer.GetBorehole, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.SerializeToString, ), 'CreateBorehole': grpc.unary_unary_rpc_method_handler( servicer.CreateBorehole, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CreateBorehole_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.SerializeToString, ), 'Borehole_GetAllLogs': grpc.unary_unary_rpc_method_handler( servicer.Borehole_GetAllLogs, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GetAllLogs_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuids.SerializeToString, ), 'Borehole_GetLogsValues': grpc.unary_stream_rpc_method_handler( servicer.Borehole_GetLogsValues, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GetLogsValues_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.LogValues.SerializeToString, ), 'Borehole_GetElevationTimePosition': grpc.unary_unary_rpc_method_handler( servicer.Borehole_GetElevationTimePosition, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetElevationTimePosition_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetElevationTimePosition_Response.SerializeToString, ), 'Borehole_GetTvdPosition': grpc.unary_unary_rpc_method_handler( servicer.Borehole_GetTvdPosition, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetTvdPosition_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetTvdPosition_Response.SerializeToString, ), 'Borehole_GetObservedDataSets': grpc.unary_stream_rpc_method_handler( servicer.Borehole_GetObservedDataSets, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetObservedDataSets_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetObservedDataSets_Response.SerializeToString, ), 'Borehole_GetNumberOfObservedDataSets': grpc.unary_unary_rpc_method_handler( servicer.Borehole_GetNumberOfObservedDataSets, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetNumberOfObservedDataSets_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetNumberOfObservedDataSets_Response.SerializeToString, ), 'Borehole_GetXyzWellSurveys': grpc.unary_stream_rpc_method_handler( servicer.Borehole_GetXyzWellSurveys, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetWellSurveys_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetWellSurveys_Response.SerializeToString, ), 'Borehole_GetXytvdWellSurveys': grpc.unary_stream_rpc_method_handler( servicer.Borehole_GetXytvdWellSurveys, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetWellSurveys_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetWellSurveys_Response.SerializeToString, ), 'Borehole_GetDxdytvdWellSurveys': grpc.unary_stream_rpc_method_handler( servicer.Borehole_GetDxdytvdWellSurveys, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetWellSurveys_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetWellSurveys_Response.SerializeToString, ), 'Borehole_GetMdinclazimWellSurveys': grpc.unary_stream_rpc_method_handler( servicer.Borehole_GetMdinclazimWellSurveys, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetWellSurveys_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetWellSurveys_Response.SerializeToString, ), 'Borehole_GetExplicitWellSurveys': grpc.unary_stream_rpc_method_handler( servicer.Borehole_GetExplicitWellSurveys, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetWellSurveys_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetWellSurveys_Response.SerializeToString, ), 'Borehole_GetNumberOfWellSurveys': grpc.unary_unary_rpc_method_handler( servicer.Borehole_GetNumberOfWellSurveys, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetNumberOfWellSurveys_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetNumberOfWellSurveys_Response.SerializeToString, ), 'Borehole_GetWellDatum': grpc.unary_unary_rpc_method_handler( servicer.Borehole_GetWellDatum, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetWellDatum_Response.SerializeToString, ), 'Borehole_SetWellDatum': grpc.unary_unary_rpc_method_handler( servicer.Borehole_SetWellDatum, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_SetWellDatum_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.SerializeToString, ), 'Borehole_GetCrs': grpc.unary_unary_rpc_method_handler( servicer.Borehole_GetCrs, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetCrs_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetCrs_Response.SerializeToString, ), 'Borehole_CompletionsSetExists': grpc.unary_unary_rpc_method_handler( servicer.Borehole_CompletionsSetExists, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.SerializeToString, ), 'Borehole_GetWellHeadCoordinates': grpc.unary_unary_rpc_method_handler( servicer.Borehole_GetWellHeadCoordinates, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.Double2.SerializeToString, ), 'Borehole_SetWellHeadCoordinates': grpc.unary_unary_rpc_method_handler( servicer.Borehole_SetWellHeadCoordinates, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_SetWellHeadCoordinates_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.SerializeToString, ), 'Borehole_CreateTrajectory': grpc.unary_unary_rpc_method_handler( servicer.Borehole_CreateTrajectory, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_CreateTrajectory_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.SerializeToString, ), 'Borehole_CreateLateral': grpc.unary_unary_rpc_method_handler( servicer.Borehole_CreateLateral, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_CreateLateral_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.SerializeToString, ), 'Borehole_IsLateral': grpc.unary_unary_rpc_method_handler( servicer.Borehole_IsLateral, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'petrelgrpc.PetrelConnection_Borehole', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) # This class is part of an EXPERIMENTAL API. class PetrelConnection_Borehole(object): """Missing associated documentation comment in .proto file.""" @staticmethod def GetBorehole(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Borehole/GetBorehole', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def CreateBorehole(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Borehole/CreateBorehole', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.CreateBorehole_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Borehole_GetAllLogs(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Borehole/Borehole_GetAllLogs', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GetAllLogs_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuids.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Borehole_GetLogsValues(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_Borehole/Borehole_GetLogsValues', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GetLogsValues_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.LogValues.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Borehole_GetElevationTimePosition(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Borehole/Borehole_GetElevationTimePosition', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetElevationTimePosition_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetElevationTimePosition_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Borehole_GetTvdPosition(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Borehole/Borehole_GetTvdPosition', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetTvdPosition_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetTvdPosition_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Borehole_GetObservedDataSets(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_Borehole/Borehole_GetObservedDataSets', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetObservedDataSets_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetObservedDataSets_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Borehole_GetNumberOfObservedDataSets(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Borehole/Borehole_GetNumberOfObservedDataSets', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetNumberOfObservedDataSets_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetNumberOfObservedDataSets_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Borehole_GetXyzWellSurveys(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_Borehole/Borehole_GetXyzWellSurveys', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetWellSurveys_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetWellSurveys_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Borehole_GetXytvdWellSurveys(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_Borehole/Borehole_GetXytvdWellSurveys', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetWellSurveys_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetWellSurveys_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Borehole_GetDxdytvdWellSurveys(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_Borehole/Borehole_GetDxdytvdWellSurveys', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetWellSurveys_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetWellSurveys_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Borehole_GetMdinclazimWellSurveys(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_Borehole/Borehole_GetMdinclazimWellSurveys', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetWellSurveys_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetWellSurveys_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Borehole_GetExplicitWellSurveys(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_Borehole/Borehole_GetExplicitWellSurveys', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetWellSurveys_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetWellSurveys_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Borehole_GetNumberOfWellSurveys(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Borehole/Borehole_GetNumberOfWellSurveys', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetNumberOfWellSurveys_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetNumberOfWellSurveys_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Borehole_GetWellDatum(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Borehole/Borehole_GetWellDatum', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetWellDatum_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Borehole_SetWellDatum(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Borehole/Borehole_SetWellDatum', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_SetWellDatum_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Borehole_GetCrs(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Borehole/Borehole_GetCrs', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetCrs_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_GetCrs_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Borehole_CompletionsSetExists(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Borehole/Borehole_CompletionsSetExists', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Borehole_GetWellHeadCoordinates(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Borehole/Borehole_GetWellHeadCoordinates', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.Double2.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Borehole_SetWellHeadCoordinates(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Borehole/Borehole_SetWellHeadCoordinates', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_SetWellHeadCoordinates_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Borehole_CreateTrajectory(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Borehole/Borehole_CreateTrajectory', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_CreateTrajectory_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Borehole_CreateLateral(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Borehole/Borehole_CreateLateral', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Borehole_CreateLateral_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Borehole_IsLateral(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Borehole/Borehole_IsLateral', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) class PetrelConnection_WellLogStub(object): """Missing associated documentation comment in .proto file.""" def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. """ self.GetWellLog = channel.unary_unary( '/petrelgrpc.PetrelConnection_WellLog/GetWellLog', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GetWellLog_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, ) self.WellLog_DisplayUnitSymbol = channel.unary_unary( '/petrelgrpc.PetrelConnection_WellLog/WellLog_DisplayUnitSymbol', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.WellLog_DisplayUnitSymbol_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.WellLog_DisplayUnitSymbol_Response.FromString, ) self.WellLog_GetParentPythonBoreholeObject = channel.unary_unary( '/petrelgrpc.PetrelConnection_WellLog/WellLog_GetParentPythonBoreholeObject', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.WellLog_GetParentPythonBoreholObject_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.WellLog_GetParentPythonBoreholObject_Response.FromString, ) self.WellLog_SetSamples = channel.unary_unary( '/petrelgrpc.PetrelConnection_WellLog/WellLog_SetSamples', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.WellLog_SetSamples_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.WellLog_SetSamples_Response.FromString, ) self.WellLog_GetSamples = channel.unary_unary( '/petrelgrpc.PetrelConnection_WellLog/WellLog_GetSamples', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.WellLog_GetSamples_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.WellLog_GetSamples_Response.FromString, ) self.WellLog_GetGlobalWellLog = channel.unary_unary( '/petrelgrpc.PetrelConnection_WellLog/WellLog_GetGlobalWellLog', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.WellLog_GetGlobalWellLog_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.WellLog_GetGlobalWellLog_Response.FromString, ) self.DiscreteWellLog_GetAllDictionaryCodes = channel.unary_unary( '/petrelgrpc.PetrelConnection_WellLog/DiscreteWellLog_GetAllDictionaryCodes', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DiscreteWellLog_GetAllDictionaryCodes_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DiscreteWellLog_GetAllDictionaryCodes_Response.FromString, ) class PetrelConnection_WellLogServicer(object): """Missing associated documentation comment in .proto file.""" def GetWellLog(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def WellLog_DisplayUnitSymbol(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def WellLog_GetParentPythonBoreholeObject(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def WellLog_SetSamples(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def WellLog_GetSamples(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def WellLog_GetGlobalWellLog(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def DiscreteWellLog_GetAllDictionaryCodes(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def add_PetrelConnection_WellLogServicer_to_server(servicer, server): rpc_method_handlers = { 'GetWellLog': grpc.unary_unary_rpc_method_handler( servicer.GetWellLog, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GetWellLog_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.SerializeToString, ), 'WellLog_DisplayUnitSymbol': grpc.unary_unary_rpc_method_handler( servicer.WellLog_DisplayUnitSymbol, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.WellLog_DisplayUnitSymbol_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.WellLog_DisplayUnitSymbol_Response.SerializeToString, ), 'WellLog_GetParentPythonBoreholeObject': grpc.unary_unary_rpc_method_handler( servicer.WellLog_GetParentPythonBoreholeObject, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.WellLog_GetParentPythonBoreholObject_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.WellLog_GetParentPythonBoreholObject_Response.SerializeToString, ), 'WellLog_SetSamples': grpc.unary_unary_rpc_method_handler( servicer.WellLog_SetSamples, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.WellLog_SetSamples_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.WellLog_SetSamples_Response.SerializeToString, ), 'WellLog_GetSamples': grpc.unary_unary_rpc_method_handler( servicer.WellLog_GetSamples, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.WellLog_GetSamples_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.WellLog_GetSamples_Response.SerializeToString, ), 'WellLog_GetGlobalWellLog': grpc.unary_unary_rpc_method_handler( servicer.WellLog_GetGlobalWellLog, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.WellLog_GetGlobalWellLog_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.WellLog_GetGlobalWellLog_Response.SerializeToString, ), 'DiscreteWellLog_GetAllDictionaryCodes': grpc.unary_unary_rpc_method_handler( servicer.DiscreteWellLog_GetAllDictionaryCodes, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DiscreteWellLog_GetAllDictionaryCodes_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DiscreteWellLog_GetAllDictionaryCodes_Response.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'petrelgrpc.PetrelConnection_WellLog', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) # This class is part of an EXPERIMENTAL API. class PetrelConnection_WellLog(object): """Missing associated documentation comment in .proto file.""" @staticmethod def GetWellLog(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_WellLog/GetWellLog', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GetWellLog_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def WellLog_DisplayUnitSymbol(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_WellLog/WellLog_DisplayUnitSymbol', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.WellLog_DisplayUnitSymbol_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.WellLog_DisplayUnitSymbol_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def WellLog_GetParentPythonBoreholeObject(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_WellLog/WellLog_GetParentPythonBoreholeObject', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.WellLog_GetParentPythonBoreholObject_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.WellLog_GetParentPythonBoreholObject_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def WellLog_SetSamples(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_WellLog/WellLog_SetSamples', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.WellLog_SetSamples_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.WellLog_SetSamples_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def WellLog_GetSamples(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_WellLog/WellLog_GetSamples', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.WellLog_GetSamples_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.WellLog_GetSamples_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def WellLog_GetGlobalWellLog(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_WellLog/WellLog_GetGlobalWellLog', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.WellLog_GetGlobalWellLog_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.WellLog_GetGlobalWellLog_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def DiscreteWellLog_GetAllDictionaryCodes(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_WellLog/DiscreteWellLog_GetAllDictionaryCodes', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DiscreteWellLog_GetAllDictionaryCodes_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DiscreteWellLog_GetAllDictionaryCodes_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) class PetrelConnection_GlobalObservedDataSetsStub(object): """Missing associated documentation comment in .proto file.""" def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. """ self.GlobalObservedDataSet_GetGlobalObservedDataSet = channel.unary_unary( '/petrelgrpc.PetrelConnection_GlobalObservedDataSets/GlobalObservedDataSet_GetGlobalObservedDataSet', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, ) self.GlobalObservedDataSet_CreateObservedDataSet = channel.unary_unary( '/petrelgrpc.PetrelConnection_GlobalObservedDataSets/GlobalObservedDataSet_CreateObservedDataSet', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GlobalObservedDataSet_CreateObservedDataSet_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GlobalObservedDataSet_CreateObservedDataSet_Response.FromString, ) class PetrelConnection_GlobalObservedDataSetsServicer(object): """Missing associated documentation comment in .proto file.""" def GlobalObservedDataSet_GetGlobalObservedDataSet(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def GlobalObservedDataSet_CreateObservedDataSet(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def add_PetrelConnection_GlobalObservedDataSetsServicer_to_server(servicer, server): rpc_method_handlers = { 'GlobalObservedDataSet_GetGlobalObservedDataSet': grpc.unary_unary_rpc_method_handler( servicer.GlobalObservedDataSet_GetGlobalObservedDataSet, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.SerializeToString, ), 'GlobalObservedDataSet_CreateObservedDataSet': grpc.unary_unary_rpc_method_handler( servicer.GlobalObservedDataSet_CreateObservedDataSet, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GlobalObservedDataSet_CreateObservedDataSet_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GlobalObservedDataSet_CreateObservedDataSet_Response.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'petrelgrpc.PetrelConnection_GlobalObservedDataSets', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) # This class is part of an EXPERIMENTAL API. class PetrelConnection_GlobalObservedDataSets(object): """Missing associated documentation comment in .proto file.""" @staticmethod def GlobalObservedDataSet_GetGlobalObservedDataSet(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_GlobalObservedDataSets/GlobalObservedDataSet_GetGlobalObservedDataSet', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def GlobalObservedDataSet_CreateObservedDataSet(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_GlobalObservedDataSets/GlobalObservedDataSet_CreateObservedDataSet', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GlobalObservedDataSet_CreateObservedDataSet_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GlobalObservedDataSet_CreateObservedDataSet_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) class PetrelConnection_GlobalWellLogStub(object): """Missing associated documentation comment in .proto file.""" def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. """ self.GetGlobalWellLog = channel.unary_unary( '/petrelgrpc.PetrelConnection_GlobalWellLog/GetGlobalWellLog', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GetGlobalWellLog_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, ) self.GlobalWellLog_GetWellLogByBoreholeNameOrGuid = channel.unary_unary( '/petrelgrpc.PetrelConnection_GlobalWellLog/GlobalWellLog_GetWellLogByBoreholeNameOrGuid', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GlobalWellLog_GetWellLogByBoreholeName_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GlobalWellLog_GetWellLogByBoreholeName_Response.FromString, ) self.GlobalWellLog_GetAllLogs = channel.unary_unary( '/petrelgrpc.PetrelConnection_GlobalWellLog/GlobalWellLog_GetAllLogs', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GlobalWellLog_GetAllLogs_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GlobalWellLog_GetAllLogs_Response.FromString, ) self.GlobalWellLog_DisplayUnitSymbol = channel.unary_unary( '/petrelgrpc.PetrelConnection_GlobalWellLog/GlobalWellLog_DisplayUnitSymbol', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GlobalWellLog_DisplayUnitSymbol_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GlobalWellLog_DisplayUnitSymbol_Response.FromString, ) self.GlobalWellLog_CreateWellLog = channel.unary_unary( '/petrelgrpc.PetrelConnection_GlobalWellLog/GlobalWellLog_CreateWellLog', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GlobalWellLog_CreateWellLog_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GlobalWellLog_CreateWellLog_Response.FromString, ) self.GlobalWellLog_CreateDictionaryWellLog = channel.unary_unary( '/petrelgrpc.PetrelConnection_GlobalWellLog/GlobalWellLog_CreateDictionaryWellLog', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GlobalWellLog_CreateDictionaryWellLog_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GlobalWellLog_CreateDictionaryWellLog_Response.FromString, ) class PetrelConnection_GlobalWellLogServicer(object): """Missing associated documentation comment in .proto file.""" def GetGlobalWellLog(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def GlobalWellLog_GetWellLogByBoreholeNameOrGuid(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def GlobalWellLog_GetAllLogs(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def GlobalWellLog_DisplayUnitSymbol(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def GlobalWellLog_CreateWellLog(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def GlobalWellLog_CreateDictionaryWellLog(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def add_PetrelConnection_GlobalWellLogServicer_to_server(servicer, server): rpc_method_handlers = { 'GetGlobalWellLog': grpc.unary_unary_rpc_method_handler( servicer.GetGlobalWellLog, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GetGlobalWellLog_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.SerializeToString, ), 'GlobalWellLog_GetWellLogByBoreholeNameOrGuid': grpc.unary_unary_rpc_method_handler( servicer.GlobalWellLog_GetWellLogByBoreholeNameOrGuid, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GlobalWellLog_GetWellLogByBoreholeName_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GlobalWellLog_GetWellLogByBoreholeName_Response.SerializeToString, ), 'GlobalWellLog_GetAllLogs': grpc.unary_unary_rpc_method_handler( servicer.GlobalWellLog_GetAllLogs, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GlobalWellLog_GetAllLogs_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GlobalWellLog_GetAllLogs_Response.SerializeToString, ), 'GlobalWellLog_DisplayUnitSymbol': grpc.unary_unary_rpc_method_handler( servicer.GlobalWellLog_DisplayUnitSymbol, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GlobalWellLog_DisplayUnitSymbol_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GlobalWellLog_DisplayUnitSymbol_Response.SerializeToString, ), 'GlobalWellLog_CreateWellLog': grpc.unary_unary_rpc_method_handler( servicer.GlobalWellLog_CreateWellLog, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GlobalWellLog_CreateWellLog_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GlobalWellLog_CreateWellLog_Response.SerializeToString, ), 'GlobalWellLog_CreateDictionaryWellLog': grpc.unary_unary_rpc_method_handler( servicer.GlobalWellLog_CreateDictionaryWellLog, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GlobalWellLog_CreateDictionaryWellLog_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GlobalWellLog_CreateDictionaryWellLog_Response.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'petrelgrpc.PetrelConnection_GlobalWellLog', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) # This class is part of an EXPERIMENTAL API. class PetrelConnection_GlobalWellLog(object): """Missing associated documentation comment in .proto file.""" @staticmethod def GetGlobalWellLog(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_GlobalWellLog/GetGlobalWellLog', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GetGlobalWellLog_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def GlobalWellLog_GetWellLogByBoreholeNameOrGuid(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_GlobalWellLog/GlobalWellLog_GetWellLogByBoreholeNameOrGuid', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GlobalWellLog_GetWellLogByBoreholeName_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GlobalWellLog_GetWellLogByBoreholeName_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def GlobalWellLog_GetAllLogs(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_GlobalWellLog/GlobalWellLog_GetAllLogs', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GlobalWellLog_GetAllLogs_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GlobalWellLog_GetAllLogs_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def GlobalWellLog_DisplayUnitSymbol(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_GlobalWellLog/GlobalWellLog_DisplayUnitSymbol', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GlobalWellLog_DisplayUnitSymbol_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GlobalWellLog_DisplayUnitSymbol_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def GlobalWellLog_CreateWellLog(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_GlobalWellLog/GlobalWellLog_CreateWellLog', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GlobalWellLog_CreateWellLog_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GlobalWellLog_CreateWellLog_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def GlobalWellLog_CreateDictionaryWellLog(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_GlobalWellLog/GlobalWellLog_CreateDictionaryWellLog', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GlobalWellLog_CreateDictionaryWellLog_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GlobalWellLog_CreateDictionaryWellLog_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) class PetrelConnection_PointsStub(object): """Missing associated documentation comment in .proto file.""" def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. """ self.GetPointSet = channel.unary_unary( '/petrelgrpc.PetrelConnection_Points/GetPointSet', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, ) self.PointSet_DisplayUnitSymbol = channel.unary_unary( '/petrelgrpc.PetrelConnection_Points/PointSet_DisplayUnitSymbol', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuidAndIndex.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.FromString, ) self.PointSet_GetPointCount = channel.unary_unary( '/petrelgrpc.PetrelConnection_Points/PointSet_GetPointCount', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoInt.FromString, ) self.PointSet_GetPropertyCount = channel.unary_unary( '/petrelgrpc.PetrelConnection_Points/PointSet_GetPropertyCount', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoInt.FromString, ) self.PointSet_GetPositionValuesByRange = channel.unary_stream( '/petrelgrpc.PetrelConnection_Points/PointSet_GetPositionValuesByRange', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuidAndRange.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PropertyRangeData.FromString, ) self.PointSet_GetPositionValuesByInds = channel.unary_stream( '/petrelgrpc.PetrelConnection_Points/PointSet_GetPositionValuesByInds', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuidAndIndices.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PropertyRangeData.FromString, ) self.PointSet_GetPropertiesValuesByInds = channel.unary_stream( '/petrelgrpc.PetrelConnection_Points/PointSet_GetPropertiesValuesByInds', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuidAndIndices.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PropertyRangeData.FromString, ) self.PointSet_DeletePoints = channel.unary_unary( '/petrelgrpc.PetrelConnection_Points/PointSet_DeletePoints', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DeletePoints_request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, ) self.PointSet_AddPoints = channel.unary_unary( '/petrelgrpc.PetrelConnection_Points/PointSet_AddPoints', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.AddPoints_request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, ) self.PointSet_SetPropertyValues = channel.stream_unary( '/petrelgrpc.PetrelConnection_Points/PointSet_SetPropertyValues', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SetPropertiesValues_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, ) self.PointSet_AddProperty = channel.unary_unary( '/petrelgrpc.PetrelConnection_Points/PointSet_AddProperty', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.AddProperty_request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, ) self.PointSet_AttributesInfo = channel.unary_unary( '/petrelgrpc.PetrelConnection_Points/PointSet_AttributesInfo', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.FromString, ) self.PointSet_OrderedUniquePropertyNames = channel.unary_unary( '/petrelgrpc.PetrelConnection_Points/PointSet_OrderedUniquePropertyNames', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.StringArray.FromString, ) self.PointSet_GetCrs = channel.unary_unary( '/petrelgrpc.PetrelConnection_Points/PointSet_GetCrs', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PointSet_GetCrs_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PointSet_GetCrs_Response.FromString, ) self.PointSetAndPolylineSet_SetProperty = channel.unary_unary( '/petrelgrpc.PetrelConnection_Points/PointSetAndPolylineSet_SetProperty', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SetPointProperty_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, ) self.PointSetAndPolylineSet_SetProperties = channel.stream_unary( '/petrelgrpc.PetrelConnection_Points/PointSetAndPolylineSet_SetProperties', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SetPointProperty_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, ) self.PointSetAndPolylineSet_SetPropertiesTable = channel.stream_unary( '/petrelgrpc.PetrelConnection_Points/PointSetAndPolylineSet_SetPropertiesTable', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SetSubTable_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, ) self.PointSetAndPolylineSet_GetPropertiesTable = channel.unary_stream( '/petrelgrpc.PetrelConnection_Points/PointSetAndPolylineSet_GetPropertiesTable', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SubTable.FromString, ) class PetrelConnection_PointsServicer(object): """Missing associated documentation comment in .proto file.""" def GetPointSet(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def PointSet_DisplayUnitSymbol(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def PointSet_GetPointCount(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def PointSet_GetPropertyCount(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def PointSet_GetPositionValuesByRange(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def PointSet_GetPositionValuesByInds(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def PointSet_GetPropertiesValuesByInds(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def PointSet_DeletePoints(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def PointSet_AddPoints(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def PointSet_SetPropertyValues(self, request_iterator, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def PointSet_AddProperty(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def PointSet_AttributesInfo(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def PointSet_OrderedUniquePropertyNames(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def PointSet_GetCrs(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def PointSetAndPolylineSet_SetProperty(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def PointSetAndPolylineSet_SetProperties(self, request_iterator, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def PointSetAndPolylineSet_SetPropertiesTable(self, request_iterator, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def PointSetAndPolylineSet_GetPropertiesTable(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def add_PetrelConnection_PointsServicer_to_server(servicer, server): rpc_method_handlers = { 'GetPointSet': grpc.unary_unary_rpc_method_handler( servicer.GetPointSet, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.SerializeToString, ), 'PointSet_DisplayUnitSymbol': grpc.unary_unary_rpc_method_handler( servicer.PointSet_DisplayUnitSymbol, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuidAndIndex.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.SerializeToString, ), 'PointSet_GetPointCount': grpc.unary_unary_rpc_method_handler( servicer.PointSet_GetPointCount, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoInt.SerializeToString, ), 'PointSet_GetPropertyCount': grpc.unary_unary_rpc_method_handler( servicer.PointSet_GetPropertyCount, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoInt.SerializeToString, ), 'PointSet_GetPositionValuesByRange': grpc.unary_stream_rpc_method_handler( servicer.PointSet_GetPositionValuesByRange, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuidAndRange.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PropertyRangeData.SerializeToString, ), 'PointSet_GetPositionValuesByInds': grpc.unary_stream_rpc_method_handler( servicer.PointSet_GetPositionValuesByInds, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuidAndIndices.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PropertyRangeData.SerializeToString, ), 'PointSet_GetPropertiesValuesByInds': grpc.unary_stream_rpc_method_handler( servicer.PointSet_GetPropertiesValuesByInds, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuidAndIndices.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PropertyRangeData.SerializeToString, ), 'PointSet_DeletePoints': grpc.unary_unary_rpc_method_handler( servicer.PointSet_DeletePoints, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DeletePoints_request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.SerializeToString, ), 'PointSet_AddPoints': grpc.unary_unary_rpc_method_handler( servicer.PointSet_AddPoints, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.AddPoints_request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.SerializeToString, ), 'PointSet_SetPropertyValues': grpc.stream_unary_rpc_method_handler( servicer.PointSet_SetPropertyValues, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SetPropertiesValues_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.SerializeToString, ), 'PointSet_AddProperty': grpc.unary_unary_rpc_method_handler( servicer.PointSet_AddProperty, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.AddProperty_request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.SerializeToString, ), 'PointSet_AttributesInfo': grpc.unary_unary_rpc_method_handler( servicer.PointSet_AttributesInfo, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.SerializeToString, ), 'PointSet_OrderedUniquePropertyNames': grpc.unary_unary_rpc_method_handler( servicer.PointSet_OrderedUniquePropertyNames, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.StringArray.SerializeToString, ), 'PointSet_GetCrs': grpc.unary_unary_rpc_method_handler( servicer.PointSet_GetCrs, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PointSet_GetCrs_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PointSet_GetCrs_Response.SerializeToString, ), 'PointSetAndPolylineSet_SetProperty': grpc.unary_unary_rpc_method_handler( servicer.PointSetAndPolylineSet_SetProperty, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SetPointProperty_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.SerializeToString, ), 'PointSetAndPolylineSet_SetProperties': grpc.stream_unary_rpc_method_handler( servicer.PointSetAndPolylineSet_SetProperties, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SetPointProperty_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.SerializeToString, ), 'PointSetAndPolylineSet_SetPropertiesTable': grpc.stream_unary_rpc_method_handler( servicer.PointSetAndPolylineSet_SetPropertiesTable, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SetSubTable_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.SerializeToString, ), 'PointSetAndPolylineSet_GetPropertiesTable': grpc.unary_stream_rpc_method_handler( servicer.PointSetAndPolylineSet_GetPropertiesTable, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SubTable.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'petrelgrpc.PetrelConnection_Points', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) # This class is part of an EXPERIMENTAL API. class PetrelConnection_Points(object): """Missing associated documentation comment in .proto file.""" @staticmethod def GetPointSet(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Points/GetPointSet', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def PointSet_DisplayUnitSymbol(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Points/PointSet_DisplayUnitSymbol', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuidAndIndex.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def PointSet_GetPointCount(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Points/PointSet_GetPointCount', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoInt.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def PointSet_GetPropertyCount(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Points/PointSet_GetPropertyCount', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoInt.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def PointSet_GetPositionValuesByRange(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_Points/PointSet_GetPositionValuesByRange', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuidAndRange.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PropertyRangeData.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def PointSet_GetPositionValuesByInds(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_Points/PointSet_GetPositionValuesByInds', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuidAndIndices.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PropertyRangeData.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def PointSet_GetPropertiesValuesByInds(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_Points/PointSet_GetPropertiesValuesByInds', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuidAndIndices.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PropertyRangeData.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def PointSet_DeletePoints(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Points/PointSet_DeletePoints', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DeletePoints_request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def PointSet_AddPoints(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Points/PointSet_AddPoints', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.AddPoints_request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def PointSet_SetPropertyValues(request_iterator, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.stream_unary(request_iterator, target, '/petrelgrpc.PetrelConnection_Points/PointSet_SetPropertyValues', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SetPropertiesValues_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def PointSet_AddProperty(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Points/PointSet_AddProperty', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.AddProperty_request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def PointSet_AttributesInfo(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Points/PointSet_AttributesInfo', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def PointSet_OrderedUniquePropertyNames(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Points/PointSet_OrderedUniquePropertyNames', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.StringArray.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def PointSet_GetCrs(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Points/PointSet_GetCrs', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PointSet_GetCrs_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PointSet_GetCrs_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def PointSetAndPolylineSet_SetProperty(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Points/PointSetAndPolylineSet_SetProperty', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SetPointProperty_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def PointSetAndPolylineSet_SetProperties(request_iterator, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.stream_unary(request_iterator, target, '/petrelgrpc.PetrelConnection_Points/PointSetAndPolylineSet_SetProperties', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SetPointProperty_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def PointSetAndPolylineSet_SetPropertiesTable(request_iterator, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.stream_unary(request_iterator, target, '/petrelgrpc.PetrelConnection_Points/PointSetAndPolylineSet_SetPropertiesTable', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SetSubTable_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def PointSetAndPolylineSet_GetPropertiesTable(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_Points/PointSetAndPolylineSet_GetPropertiesTable', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SubTable.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) class PetrelConnection_PolylinesStub(object): """Missing associated documentation comment in .proto file.""" def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. """ self.GetPolylineSet = channel.unary_unary( '/petrelgrpc.PetrelConnection_Polylines/GetPolylineSet', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, ) self.PolylineSet_GetNumPolylines = channel.unary_unary( '/petrelgrpc.PetrelConnection_Polylines/PolylineSet_GetNumPolylines', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoInt.FromString, ) self.PolylineSet_DisplayUnitSymbol = channel.unary_unary( '/petrelgrpc.PetrelConnection_Polylines/PolylineSet_DisplayUnitSymbol', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuidAndIndex.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.FromString, ) self.PolylineSet_IsClosed = channel.unary_unary( '/petrelgrpc.PetrelConnection_Polylines/PolylineSet_IsClosed', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuidAndIndex.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, ) self.PolylineSet_GetPoints = channel.unary_stream( '/petrelgrpc.PetrelConnection_Polylines/PolylineSet_GetPoints', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuidAndIndex.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.Double3.FromString, ) self.PolylineSet_SetPolylinePoints = channel.stream_unary( '/petrelgrpc.PetrelConnection_Polylines/PolylineSet_SetPolylinePoints', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SetPolylinePoints_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, ) self.PolylineSet_AddPolyline = channel.stream_unary( '/petrelgrpc.PetrelConnection_Polylines/PolylineSet_AddPolyline', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.AddPolyline_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, ) self.PolylineSet_DeletePolyline = channel.unary_unary( '/petrelgrpc.PetrelConnection_Polylines/PolylineSet_DeletePolyline', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuidAndIndex.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, ) self.PolylineSet_DeleteAll = channel.unary_unary( '/petrelgrpc.PetrelConnection_Polylines/PolylineSet_DeleteAll', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PolylineSet_DeleteAll_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PolylineSet_DeleteAll_Response.FromString, ) self.PolylineSet_GetCrs = channel.unary_unary( '/petrelgrpc.PetrelConnection_Polylines/PolylineSet_GetCrs', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PolylineSet_GetCrs_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PolylineSet_GetCrs_Response.FromString, ) class PetrelConnection_PolylinesServicer(object): """Missing associated documentation comment in .proto file.""" def GetPolylineSet(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def PolylineSet_GetNumPolylines(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def PolylineSet_DisplayUnitSymbol(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def PolylineSet_IsClosed(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def PolylineSet_GetPoints(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def PolylineSet_SetPolylinePoints(self, request_iterator, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def PolylineSet_AddPolyline(self, request_iterator, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def PolylineSet_DeletePolyline(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def PolylineSet_DeleteAll(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def PolylineSet_GetCrs(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def add_PetrelConnection_PolylinesServicer_to_server(servicer, server): rpc_method_handlers = { 'GetPolylineSet': grpc.unary_unary_rpc_method_handler( servicer.GetPolylineSet, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.SerializeToString, ), 'PolylineSet_GetNumPolylines': grpc.unary_unary_rpc_method_handler( servicer.PolylineSet_GetNumPolylines, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoInt.SerializeToString, ), 'PolylineSet_DisplayUnitSymbol': grpc.unary_unary_rpc_method_handler( servicer.PolylineSet_DisplayUnitSymbol, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuidAndIndex.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.SerializeToString, ), 'PolylineSet_IsClosed': grpc.unary_unary_rpc_method_handler( servicer.PolylineSet_IsClosed, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuidAndIndex.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.SerializeToString, ), 'PolylineSet_GetPoints': grpc.unary_stream_rpc_method_handler( servicer.PolylineSet_GetPoints, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuidAndIndex.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.Double3.SerializeToString, ), 'PolylineSet_SetPolylinePoints': grpc.stream_unary_rpc_method_handler( servicer.PolylineSet_SetPolylinePoints, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SetPolylinePoints_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.SerializeToString, ), 'PolylineSet_AddPolyline': grpc.stream_unary_rpc_method_handler( servicer.PolylineSet_AddPolyline, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.AddPolyline_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.SerializeToString, ), 'PolylineSet_DeletePolyline': grpc.unary_unary_rpc_method_handler( servicer.PolylineSet_DeletePolyline, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuidAndIndex.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.SerializeToString, ), 'PolylineSet_DeleteAll': grpc.unary_unary_rpc_method_handler( servicer.PolylineSet_DeleteAll, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PolylineSet_DeleteAll_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PolylineSet_DeleteAll_Response.SerializeToString, ), 'PolylineSet_GetCrs': grpc.unary_unary_rpc_method_handler( servicer.PolylineSet_GetCrs, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PolylineSet_GetCrs_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PolylineSet_GetCrs_Response.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'petrelgrpc.PetrelConnection_Polylines', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) # This class is part of an EXPERIMENTAL API. class PetrelConnection_Polylines(object): """Missing associated documentation comment in .proto file.""" @staticmethod def GetPolylineSet(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Polylines/GetPolylineSet', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def PolylineSet_GetNumPolylines(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Polylines/PolylineSet_GetNumPolylines', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoInt.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def PolylineSet_DisplayUnitSymbol(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Polylines/PolylineSet_DisplayUnitSymbol', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuidAndIndex.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def PolylineSet_IsClosed(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Polylines/PolylineSet_IsClosed', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuidAndIndex.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def PolylineSet_GetPoints(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_Polylines/PolylineSet_GetPoints', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuidAndIndex.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.Double3.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def PolylineSet_SetPolylinePoints(request_iterator, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.stream_unary(request_iterator, target, '/petrelgrpc.PetrelConnection_Polylines/PolylineSet_SetPolylinePoints', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SetPolylinePoints_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def PolylineSet_AddPolyline(request_iterator, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.stream_unary(request_iterator, target, '/petrelgrpc.PetrelConnection_Polylines/PolylineSet_AddPolyline', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.AddPolyline_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def PolylineSet_DeletePolyline(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Polylines/PolylineSet_DeletePolyline', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuidAndIndex.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def PolylineSet_DeleteAll(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Polylines/PolylineSet_DeleteAll', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PolylineSet_DeleteAll_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PolylineSet_DeleteAll_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def PolylineSet_GetCrs(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Polylines/PolylineSet_GetCrs', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PolylineSet_GetCrs_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PolylineSet_GetCrs_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) class PetrelConnection_HorizonStub(object): """Missing associated documentation comment in .proto file.""" def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. """ self.GetHorizonProperty3d = channel.unary_unary( '/petrelgrpc.PetrelConnection_Horizon/GetHorizonProperty3d', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, ) self.HorizonProperty3d_Extent = channel.unary_unary( '/petrelgrpc.PetrelConnection_Horizon/HorizonProperty3d_Extent', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.Indices2.FromString, ) self.HorizonProperty3d_IndexAtPosition = channel.unary_unary( '/petrelgrpc.PetrelConnection_Horizon/HorizonProperty3d_IndexAtPosition', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.IndexAtPosition_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.ExtIndices2.FromString, ) self.HorizonProperty3d_PositionAtIndex = channel.unary_unary( '/petrelgrpc.PetrelConnection_Horizon/HorizonProperty3d_PositionAtIndex', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PositionAtIndex_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.ExtDouble3.FromString, ) self.HorizonProperty3d_DisplayUnitSymbol = channel.unary_unary( '/petrelgrpc.PetrelConnection_Horizon/HorizonProperty3d_DisplayUnitSymbol', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.FromString, ) self.HorizonProperty3d_GetChunk = channel.unary_stream( '/petrelgrpc.PetrelConnection_Horizon/HorizonProperty3d_GetChunk', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GetChunk_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Subchunk.FromString, ) self.HorizonProperty3d_StreamSetChunk = channel.stream_unary( '/petrelgrpc.PetrelConnection_Horizon/HorizonProperty3d_StreamSetChunk', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SetSubchunk_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Report.FromString, ) self.HorizonProperty3d_GetIjk = channel.unary_unary( '/petrelgrpc.PetrelConnection_Horizon/HorizonProperty3d_GetIjk', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonProperty3d_GetIjk_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonProperty3d_GetIjk_Response.FromString, ) self.HorizonProperty3d_GetPositions = channel.unary_unary( '/petrelgrpc.PetrelConnection_Horizon/HorizonProperty3d_GetPositions', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonProperty3d_GetPositions_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonProperty3d_GetPositions_Response.FromString, ) self.HorizonProperty3d_GetParentHorizonInterpretation3d = channel.unary_unary( '/petrelgrpc.PetrelConnection_Horizon/HorizonProperty3d_GetParentHorizonInterpretation3d', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonProperty3d_GetParentHorizonInterpretation3d_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonProperty3d_GetParentHorizonInterpretation3d_Response.FromString, ) self.HorizonProperty3d_GetAffineTransform = channel.unary_stream( '/petrelgrpc.PetrelConnection_Horizon/HorizonProperty3d_GetAffineTransform', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonProperty3d_GetAffineTransform_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonProperty3d_GetAffineTransform_Response.FromString, ) self.HorizonProperty3d_GetCrs = channel.unary_unary( '/petrelgrpc.PetrelConnection_Horizon/HorizonProperty3d_GetCrs', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonProperty3d_GetCrs_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonProperty3d_GetCrs_Response.FromString, ) self.GetHorizonInterpretation3d = channel.unary_unary( '/petrelgrpc.PetrelConnection_Horizon/GetHorizonInterpretation3d', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, ) self.HorizonInterpretation3d_SampleCount = channel.unary_unary( '/petrelgrpc.PetrelConnection_Horizon/HorizonInterpretation3d_SampleCount', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoInt.FromString, ) self.HorizonInterpretation3d_GetAllHorizonPropertyValues = channel.unary_unary( '/petrelgrpc.PetrelConnection_Horizon/HorizonInterpretation3d_GetAllHorizonPropertyValues', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuids.FromString, ) self.HorizonInterpretation3d_Extent = channel.unary_unary( '/petrelgrpc.PetrelConnection_Horizon/HorizonInterpretation3d_Extent', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.Indices2.FromString, ) self.HorizonInterpretation3d_IndexAtPosition = channel.unary_unary( '/petrelgrpc.PetrelConnection_Horizon/HorizonInterpretation3d_IndexAtPosition', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.IndexAtPosition_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.ExtIndices2.FromString, ) self.HorizonInterpretation3d_PositionAtIndex = channel.unary_unary( '/petrelgrpc.PetrelConnection_Horizon/HorizonInterpretation3d_PositionAtIndex', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PositionAtIndex_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.ExtDouble3.FromString, ) self.HorizonInterpretation3d_DisplayUnitSymbol = channel.unary_unary( '/petrelgrpc.PetrelConnection_Horizon/HorizonInterpretation3d_DisplayUnitSymbol', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.FromString, ) self.HorizonInterpretation3d_GetChunk = channel.unary_stream( '/petrelgrpc.PetrelConnection_Horizon/HorizonInterpretation3d_GetChunk', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GetChunk_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Subchunk.FromString, ) self.HorizonInterpretation3d_StreamSetChunk = channel.stream_unary( '/petrelgrpc.PetrelConnection_Horizon/HorizonInterpretation3d_StreamSetChunk', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SetSubchunk_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Report.FromString, ) self.HorizonInterpretation3d_GetParent = channel.unary_unary( '/petrelgrpc.PetrelConnection_Horizon/HorizonInterpretation3d_GetParent', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonInterpretation3d_GetParent_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonInterpretation3d_GetParent_Response.FromString, ) self.HorizonInterpretation3d_GetIjk = channel.unary_unary( '/petrelgrpc.PetrelConnection_Horizon/HorizonInterpretation3d_GetIjk', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonInterpretation3d_GetIjk_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonInterpretation3d_GetIjk_Response.FromString, ) self.HorizonInterpretation3d_GetPositions = channel.unary_unary( '/petrelgrpc.PetrelConnection_Horizon/HorizonInterpretation3d_GetPositions', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonInterpretation3d_GetPositions_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonInterpretation3d_GetPositions_Response.FromString, ) self.HorizonInterpretation3d_GetAffineTransform = channel.unary_stream( '/petrelgrpc.PetrelConnection_Horizon/HorizonInterpretation3d_GetAffineTransform', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonInterpretation3d_GetAffineTransform_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonInterpretation3d_GetAffineTransform_Response.FromString, ) self.HorizonInterpretation3d_GetCrs = channel.unary_unary( '/petrelgrpc.PetrelConnection_Horizon/HorizonInterpretation3d_GetCrs', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonInterpretation3d_GetCrs_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonInterpretation3d_GetCrs_Response.FromString, ) class PetrelConnection_HorizonServicer(object): """Missing associated documentation comment in .proto file.""" def GetHorizonProperty3d(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def HorizonProperty3d_Extent(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def HorizonProperty3d_IndexAtPosition(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def HorizonProperty3d_PositionAtIndex(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def HorizonProperty3d_DisplayUnitSymbol(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def HorizonProperty3d_GetChunk(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def HorizonProperty3d_StreamSetChunk(self, request_iterator, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def HorizonProperty3d_GetIjk(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def HorizonProperty3d_GetPositions(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def HorizonProperty3d_GetParentHorizonInterpretation3d(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def HorizonProperty3d_GetAffineTransform(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def HorizonProperty3d_GetCrs(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def GetHorizonInterpretation3d(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def HorizonInterpretation3d_SampleCount(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def HorizonInterpretation3d_GetAllHorizonPropertyValues(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def HorizonInterpretation3d_Extent(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def HorizonInterpretation3d_IndexAtPosition(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def HorizonInterpretation3d_PositionAtIndex(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def HorizonInterpretation3d_DisplayUnitSymbol(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def HorizonInterpretation3d_GetChunk(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def HorizonInterpretation3d_StreamSetChunk(self, request_iterator, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def HorizonInterpretation3d_GetParent(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def HorizonInterpretation3d_GetIjk(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def HorizonInterpretation3d_GetPositions(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def HorizonInterpretation3d_GetAffineTransform(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def HorizonInterpretation3d_GetCrs(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def add_PetrelConnection_HorizonServicer_to_server(servicer, server): rpc_method_handlers = { 'GetHorizonProperty3d': grpc.unary_unary_rpc_method_handler( servicer.GetHorizonProperty3d, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.SerializeToString, ), 'HorizonProperty3d_Extent': grpc.unary_unary_rpc_method_handler( servicer.HorizonProperty3d_Extent, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.Indices2.SerializeToString, ), 'HorizonProperty3d_IndexAtPosition': grpc.unary_unary_rpc_method_handler( servicer.HorizonProperty3d_IndexAtPosition, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.IndexAtPosition_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.ExtIndices2.SerializeToString, ), 'HorizonProperty3d_PositionAtIndex': grpc.unary_unary_rpc_method_handler( servicer.HorizonProperty3d_PositionAtIndex, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PositionAtIndex_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.ExtDouble3.SerializeToString, ), 'HorizonProperty3d_DisplayUnitSymbol': grpc.unary_unary_rpc_method_handler( servicer.HorizonProperty3d_DisplayUnitSymbol, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.SerializeToString, ), 'HorizonProperty3d_GetChunk': grpc.unary_stream_rpc_method_handler( servicer.HorizonProperty3d_GetChunk, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GetChunk_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Subchunk.SerializeToString, ), 'HorizonProperty3d_StreamSetChunk': grpc.stream_unary_rpc_method_handler( servicer.HorizonProperty3d_StreamSetChunk, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SetSubchunk_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Report.SerializeToString, ), 'HorizonProperty3d_GetIjk': grpc.unary_unary_rpc_method_handler( servicer.HorizonProperty3d_GetIjk, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonProperty3d_GetIjk_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonProperty3d_GetIjk_Response.SerializeToString, ), 'HorizonProperty3d_GetPositions': grpc.unary_unary_rpc_method_handler( servicer.HorizonProperty3d_GetPositions, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonProperty3d_GetPositions_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonProperty3d_GetPositions_Response.SerializeToString, ), 'HorizonProperty3d_GetParentHorizonInterpretation3d': grpc.unary_unary_rpc_method_handler( servicer.HorizonProperty3d_GetParentHorizonInterpretation3d, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonProperty3d_GetParentHorizonInterpretation3d_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonProperty3d_GetParentHorizonInterpretation3d_Response.SerializeToString, ), 'HorizonProperty3d_GetAffineTransform': grpc.unary_stream_rpc_method_handler( servicer.HorizonProperty3d_GetAffineTransform, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonProperty3d_GetAffineTransform_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonProperty3d_GetAffineTransform_Response.SerializeToString, ), 'HorizonProperty3d_GetCrs': grpc.unary_unary_rpc_method_handler( servicer.HorizonProperty3d_GetCrs, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonProperty3d_GetCrs_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonProperty3d_GetCrs_Response.SerializeToString, ), 'GetHorizonInterpretation3d': grpc.unary_unary_rpc_method_handler( servicer.GetHorizonInterpretation3d, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.SerializeToString, ), 'HorizonInterpretation3d_SampleCount': grpc.unary_unary_rpc_method_handler( servicer.HorizonInterpretation3d_SampleCount, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoInt.SerializeToString, ), 'HorizonInterpretation3d_GetAllHorizonPropertyValues': grpc.unary_unary_rpc_method_handler( servicer.HorizonInterpretation3d_GetAllHorizonPropertyValues, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuids.SerializeToString, ), 'HorizonInterpretation3d_Extent': grpc.unary_unary_rpc_method_handler( servicer.HorizonInterpretation3d_Extent, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.Indices2.SerializeToString, ), 'HorizonInterpretation3d_IndexAtPosition': grpc.unary_unary_rpc_method_handler( servicer.HorizonInterpretation3d_IndexAtPosition, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.IndexAtPosition_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.ExtIndices2.SerializeToString, ), 'HorizonInterpretation3d_PositionAtIndex': grpc.unary_unary_rpc_method_handler( servicer.HorizonInterpretation3d_PositionAtIndex, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PositionAtIndex_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.ExtDouble3.SerializeToString, ), 'HorizonInterpretation3d_DisplayUnitSymbol': grpc.unary_unary_rpc_method_handler( servicer.HorizonInterpretation3d_DisplayUnitSymbol, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.SerializeToString, ), 'HorizonInterpretation3d_GetChunk': grpc.unary_stream_rpc_method_handler( servicer.HorizonInterpretation3d_GetChunk, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GetChunk_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Subchunk.SerializeToString, ), 'HorizonInterpretation3d_StreamSetChunk': grpc.stream_unary_rpc_method_handler( servicer.HorizonInterpretation3d_StreamSetChunk, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SetSubchunk_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Report.SerializeToString, ), 'HorizonInterpretation3d_GetParent': grpc.unary_unary_rpc_method_handler( servicer.HorizonInterpretation3d_GetParent, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonInterpretation3d_GetParent_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonInterpretation3d_GetParent_Response.SerializeToString, ), 'HorizonInterpretation3d_GetIjk': grpc.unary_unary_rpc_method_handler( servicer.HorizonInterpretation3d_GetIjk, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonInterpretation3d_GetIjk_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonInterpretation3d_GetIjk_Response.SerializeToString, ), 'HorizonInterpretation3d_GetPositions': grpc.unary_unary_rpc_method_handler( servicer.HorizonInterpretation3d_GetPositions, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonInterpretation3d_GetPositions_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonInterpretation3d_GetPositions_Response.SerializeToString, ), 'HorizonInterpretation3d_GetAffineTransform': grpc.unary_stream_rpc_method_handler( servicer.HorizonInterpretation3d_GetAffineTransform, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonInterpretation3d_GetAffineTransform_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonInterpretation3d_GetAffineTransform_Response.SerializeToString, ), 'HorizonInterpretation3d_GetCrs': grpc.unary_unary_rpc_method_handler( servicer.HorizonInterpretation3d_GetCrs, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonInterpretation3d_GetCrs_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonInterpretation3d_GetCrs_Response.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'petrelgrpc.PetrelConnection_Horizon', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) # This class is part of an EXPERIMENTAL API. class PetrelConnection_Horizon(object): """Missing associated documentation comment in .proto file.""" @staticmethod def GetHorizonProperty3d(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Horizon/GetHorizonProperty3d', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def HorizonProperty3d_Extent(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Horizon/HorizonProperty3d_Extent', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.Indices2.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def HorizonProperty3d_IndexAtPosition(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Horizon/HorizonProperty3d_IndexAtPosition', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.IndexAtPosition_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.ExtIndices2.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def HorizonProperty3d_PositionAtIndex(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Horizon/HorizonProperty3d_PositionAtIndex', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PositionAtIndex_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.ExtDouble3.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def HorizonProperty3d_DisplayUnitSymbol(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Horizon/HorizonProperty3d_DisplayUnitSymbol', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def HorizonProperty3d_GetChunk(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_Horizon/HorizonProperty3d_GetChunk', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GetChunk_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Subchunk.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def HorizonProperty3d_StreamSetChunk(request_iterator, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.stream_unary(request_iterator, target, '/petrelgrpc.PetrelConnection_Horizon/HorizonProperty3d_StreamSetChunk', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SetSubchunk_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Report.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def HorizonProperty3d_GetIjk(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Horizon/HorizonProperty3d_GetIjk', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonProperty3d_GetIjk_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonProperty3d_GetIjk_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def HorizonProperty3d_GetPositions(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Horizon/HorizonProperty3d_GetPositions', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonProperty3d_GetPositions_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonProperty3d_GetPositions_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def HorizonProperty3d_GetParentHorizonInterpretation3d(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Horizon/HorizonProperty3d_GetParentHorizonInterpretation3d', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonProperty3d_GetParentHorizonInterpretation3d_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonProperty3d_GetParentHorizonInterpretation3d_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def HorizonProperty3d_GetAffineTransform(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_Horizon/HorizonProperty3d_GetAffineTransform', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonProperty3d_GetAffineTransform_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonProperty3d_GetAffineTransform_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def HorizonProperty3d_GetCrs(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Horizon/HorizonProperty3d_GetCrs', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonProperty3d_GetCrs_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonProperty3d_GetCrs_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def GetHorizonInterpretation3d(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Horizon/GetHorizonInterpretation3d', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def HorizonInterpretation3d_SampleCount(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Horizon/HorizonInterpretation3d_SampleCount', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoInt.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def HorizonInterpretation3d_GetAllHorizonPropertyValues(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Horizon/HorizonInterpretation3d_GetAllHorizonPropertyValues', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuids.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def HorizonInterpretation3d_Extent(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Horizon/HorizonInterpretation3d_Extent', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.Indices2.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def HorizonInterpretation3d_IndexAtPosition(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Horizon/HorizonInterpretation3d_IndexAtPosition', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.IndexAtPosition_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.ExtIndices2.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def HorizonInterpretation3d_PositionAtIndex(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Horizon/HorizonInterpretation3d_PositionAtIndex', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PositionAtIndex_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.ExtDouble3.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def HorizonInterpretation3d_DisplayUnitSymbol(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Horizon/HorizonInterpretation3d_DisplayUnitSymbol', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def HorizonInterpretation3d_GetChunk(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_Horizon/HorizonInterpretation3d_GetChunk', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.GetChunk_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Subchunk.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def HorizonInterpretation3d_StreamSetChunk(request_iterator, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.stream_unary(request_iterator, target, '/petrelgrpc.PetrelConnection_Horizon/HorizonInterpretation3d_StreamSetChunk', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SetSubchunk_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Report.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def HorizonInterpretation3d_GetParent(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Horizon/HorizonInterpretation3d_GetParent', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonInterpretation3d_GetParent_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonInterpretation3d_GetParent_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def HorizonInterpretation3d_GetIjk(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Horizon/HorizonInterpretation3d_GetIjk', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonInterpretation3d_GetIjk_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonInterpretation3d_GetIjk_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def HorizonInterpretation3d_GetPositions(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Horizon/HorizonInterpretation3d_GetPositions', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonInterpretation3d_GetPositions_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonInterpretation3d_GetPositions_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def HorizonInterpretation3d_GetAffineTransform(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_Horizon/HorizonInterpretation3d_GetAffineTransform', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonInterpretation3d_GetAffineTransform_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonInterpretation3d_GetAffineTransform_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def HorizonInterpretation3d_GetCrs(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Horizon/HorizonInterpretation3d_GetCrs', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonInterpretation3d_GetCrs_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonInterpretation3d_GetCrs_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) class PetrelConnection_WaveletStub(object): """Missing associated documentation comment in .proto file.""" def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. """ self.GetWavelet = channel.unary_unary( '/petrelgrpc.PetrelConnection_Wavelet/GetWavelet', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, ) self.Wavelet_Amplitudes = channel.unary_stream( '/petrelgrpc.PetrelConnection_Wavelet/Wavelet_Amplitudes', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Wavelet_Amplitudes_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Wavelet_Amplitudes_Response.FromString, ) self.Wavelet_SampleCount = channel.unary_unary( '/petrelgrpc.PetrelConnection_Wavelet/Wavelet_SampleCount', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Wavelet_SampleCount_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Wavelet_SampleCount_Response.FromString, ) self.Wavelet_SamplingInterval = channel.unary_unary( '/petrelgrpc.PetrelConnection_Wavelet/Wavelet_SamplingInterval', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Wavelet_SamplingInterval_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Wavelet_SamplingInterval_Response.FromString, ) self.Wavelet_SamplingStart = channel.unary_unary( '/petrelgrpc.PetrelConnection_Wavelet/Wavelet_SamplingStart', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Wavelet_SamplingStart_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Wavelet_SamplingStart_Response.FromString, ) self.Wavelet_SamplePoints = channel.unary_stream( '/petrelgrpc.PetrelConnection_Wavelet/Wavelet_SamplePoints', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Wavelet_SamplePoints_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Wavelet_SamplePoints_Response.FromString, ) self.Wavelet_TimeUnitSymbol = channel.unary_unary( '/petrelgrpc.PetrelConnection_Wavelet/Wavelet_TimeUnitSymbol', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Wavelet_TimeUnitSymbol_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Wavelet_TimeUnitSymbol_Response.FromString, ) self.Wavelet_SetAmplitudes = channel.stream_unary( '/petrelgrpc.PetrelConnection_Wavelet/Wavelet_SetAmplitudes', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Wavelet_SetAmplitudes_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, ) self.Wavelet_SetSamplingStart = channel.unary_unary( '/petrelgrpc.PetrelConnection_Wavelet/Wavelet_SetSamplingStart', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Wavelet_SetSamplingStart_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Wavelet_SetSamplingStart_Response.FromString, ) self.Wavelet_SetSamplingInterval = channel.unary_unary( '/petrelgrpc.PetrelConnection_Wavelet/Wavelet_SetSamplingInterval', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Wavelet_SetSamplingInterval_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Wavelet_SetSamplingInterval_Response.FromString, ) class PetrelConnection_WaveletServicer(object): """Missing associated documentation comment in .proto file.""" def GetWavelet(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Wavelet_Amplitudes(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Wavelet_SampleCount(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Wavelet_SamplingInterval(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Wavelet_SamplingStart(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Wavelet_SamplePoints(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Wavelet_TimeUnitSymbol(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Wavelet_SetAmplitudes(self, request_iterator, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Wavelet_SetSamplingStart(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Wavelet_SetSamplingInterval(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def add_PetrelConnection_WaveletServicer_to_server(servicer, server): rpc_method_handlers = { 'GetWavelet': grpc.unary_unary_rpc_method_handler( servicer.GetWavelet, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.SerializeToString, ), 'Wavelet_Amplitudes': grpc.unary_stream_rpc_method_handler( servicer.Wavelet_Amplitudes, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Wavelet_Amplitudes_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Wavelet_Amplitudes_Response.SerializeToString, ), 'Wavelet_SampleCount': grpc.unary_unary_rpc_method_handler( servicer.Wavelet_SampleCount, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Wavelet_SampleCount_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Wavelet_SampleCount_Response.SerializeToString, ), 'Wavelet_SamplingInterval': grpc.unary_unary_rpc_method_handler( servicer.Wavelet_SamplingInterval, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Wavelet_SamplingInterval_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Wavelet_SamplingInterval_Response.SerializeToString, ), 'Wavelet_SamplingStart': grpc.unary_unary_rpc_method_handler( servicer.Wavelet_SamplingStart, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Wavelet_SamplingStart_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Wavelet_SamplingStart_Response.SerializeToString, ), 'Wavelet_SamplePoints': grpc.unary_stream_rpc_method_handler( servicer.Wavelet_SamplePoints, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Wavelet_SamplePoints_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Wavelet_SamplePoints_Response.SerializeToString, ), 'Wavelet_TimeUnitSymbol': grpc.unary_unary_rpc_method_handler( servicer.Wavelet_TimeUnitSymbol, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Wavelet_TimeUnitSymbol_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Wavelet_TimeUnitSymbol_Response.SerializeToString, ), 'Wavelet_SetAmplitudes': grpc.stream_unary_rpc_method_handler( servicer.Wavelet_SetAmplitudes, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Wavelet_SetAmplitudes_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.SerializeToString, ), 'Wavelet_SetSamplingStart': grpc.unary_unary_rpc_method_handler( servicer.Wavelet_SetSamplingStart, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Wavelet_SetSamplingStart_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Wavelet_SetSamplingStart_Response.SerializeToString, ), 'Wavelet_SetSamplingInterval': grpc.unary_unary_rpc_method_handler( servicer.Wavelet_SetSamplingInterval, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Wavelet_SetSamplingInterval_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Wavelet_SetSamplingInterval_Response.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'petrelgrpc.PetrelConnection_Wavelet', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) # This class is part of an EXPERIMENTAL API. class PetrelConnection_Wavelet(object): """Missing associated documentation comment in .proto file.""" @staticmethod def GetWavelet(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Wavelet/GetWavelet', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Wavelet_Amplitudes(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_Wavelet/Wavelet_Amplitudes', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Wavelet_Amplitudes_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Wavelet_Amplitudes_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Wavelet_SampleCount(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Wavelet/Wavelet_SampleCount', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Wavelet_SampleCount_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Wavelet_SampleCount_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Wavelet_SamplingInterval(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Wavelet/Wavelet_SamplingInterval', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Wavelet_SamplingInterval_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Wavelet_SamplingInterval_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Wavelet_SamplingStart(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Wavelet/Wavelet_SamplingStart', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Wavelet_SamplingStart_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Wavelet_SamplingStart_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Wavelet_SamplePoints(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_Wavelet/Wavelet_SamplePoints', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Wavelet_SamplePoints_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Wavelet_SamplePoints_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Wavelet_TimeUnitSymbol(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Wavelet/Wavelet_TimeUnitSymbol', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Wavelet_TimeUnitSymbol_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Wavelet_TimeUnitSymbol_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Wavelet_SetAmplitudes(request_iterator, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.stream_unary(request_iterator, target, '/petrelgrpc.PetrelConnection_Wavelet/Wavelet_SetAmplitudes', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Wavelet_SetAmplitudes_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Wavelet_SetSamplingStart(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Wavelet/Wavelet_SetSamplingStart', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Wavelet_SetSamplingStart_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Wavelet_SetSamplingStart_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Wavelet_SetSamplingInterval(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Wavelet/Wavelet_SetSamplingInterval', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Wavelet_SetSamplingInterval_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Wavelet_SetSamplingInterval_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) class PetrelConnection_XyzWellSurveyStub(object): """Missing associated documentation comment in .proto file.""" def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. """ self.GetXyzWellSurvey = channel.unary_unary( '/petrelgrpc.PetrelConnection_XyzWellSurvey/GetXyzWellSurvey', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, ) self.XyzWellSurvey_RecordCount = channel.unary_unary( '/petrelgrpc.PetrelConnection_XyzWellSurvey/XyzWellSurvey_RecordCount', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_RecordCount_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_RecordCount_Response.FromString, ) self.XyzWellSurvey_GetXs = channel.unary_stream( '/petrelgrpc.PetrelConnection_XyzWellSurvey/XyzWellSurvey_GetXs', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_GetXs_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_GetXs_Response.FromString, ) self.XyzWellSurvey_GetYs = channel.unary_stream( '/petrelgrpc.PetrelConnection_XyzWellSurvey/XyzWellSurvey_GetYs', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_GetYs_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_GetYs_Response.FromString, ) self.XyzWellSurvey_GetZs = channel.unary_stream( '/petrelgrpc.PetrelConnection_XyzWellSurvey/XyzWellSurvey_GetZs', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_GetZs_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_GetZs_Response.FromString, ) self.XyzWellSurvey_GetMds = channel.unary_stream( '/petrelgrpc.PetrelConnection_XyzWellSurvey/XyzWellSurvey_GetMds', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_GetMds_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_GetMds_Response.FromString, ) self.XyzWellSurvey_GetIncls = channel.unary_stream( '/petrelgrpc.PetrelConnection_XyzWellSurvey/XyzWellSurvey_GetIncls', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_GetIncls_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_GetIncls_Response.FromString, ) self.XyzWellSurvey_GetAzims = channel.unary_stream( '/petrelgrpc.PetrelConnection_XyzWellSurvey/XyzWellSurvey_GetAzims', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_GetAzims_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_GetAzims_Response.FromString, ) self.XyzWellSurvey_SetRecords = channel.stream_unary( '/petrelgrpc.PetrelConnection_XyzWellSurvey/XyzWellSurvey_SetRecords', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_SetRecords_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, ) self.XyzWellSurvey_SetSurveyAsDefinitive = channel.unary_unary( '/petrelgrpc.PetrelConnection_XyzWellSurvey/XyzWellSurvey_SetSurveyAsDefinitive', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_SetSurveyAsDefinitive_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_SetSurveyAsDefinitive_Response.FromString, ) self.XyzWellSurvey_TieInMd = channel.unary_unary( '/petrelgrpc.PetrelConnection_XyzWellSurvey/XyzWellSurvey_TieInMd', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_TieInMd_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_TieInMd_Response.FromString, ) self.XyzWellSurvey_SetTieInMd = channel.unary_unary( '/petrelgrpc.PetrelConnection_XyzWellSurvey/XyzWellSurvey_SetTieInMd', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_SetTieInMd_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_SetTieInMd_Response.FromString, ) self.XyzWellSurvey_IsLateral = channel.unary_unary( '/petrelgrpc.PetrelConnection_XyzWellSurvey/XyzWellSurvey_IsLateral', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_IsLateral_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_IsLateral_Response.FromString, ) self.XyzWellSurvey_GetParentPythonBoreholeObject = channel.unary_unary( '/petrelgrpc.PetrelConnection_XyzWellSurvey/XyzWellSurvey_GetParentPythonBoreholeObject', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_GetParentPythonBoreholeObject_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_GetParentPythonBoreholeObject_Response.FromString, ) self.XyzWellSurvey_IsAlgorithmMinimumCurvature = channel.unary_unary( '/petrelgrpc.PetrelConnection_XyzWellSurvey/XyzWellSurvey_IsAlgorithmMinimumCurvature', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, ) self.XyzWellSurvey_SetAlgorithmToMinimumCurvature = channel.unary_unary( '/petrelgrpc.PetrelConnection_XyzWellSurvey/XyzWellSurvey_SetAlgorithmToMinimumCurvature', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SetAlgorithmToMinimumCurvature_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, ) self.XyzWellSurvey_IsCalculationValid = channel.unary_unary( '/petrelgrpc.PetrelConnection_XyzWellSurvey/XyzWellSurvey_IsCalculationValid', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, ) class PetrelConnection_XyzWellSurveyServicer(object): """Missing associated documentation comment in .proto file.""" def GetXyzWellSurvey(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def XyzWellSurvey_RecordCount(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def XyzWellSurvey_GetXs(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def XyzWellSurvey_GetYs(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def XyzWellSurvey_GetZs(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def XyzWellSurvey_GetMds(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def XyzWellSurvey_GetIncls(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def XyzWellSurvey_GetAzims(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def XyzWellSurvey_SetRecords(self, request_iterator, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def XyzWellSurvey_SetSurveyAsDefinitive(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def XyzWellSurvey_TieInMd(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def XyzWellSurvey_SetTieInMd(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def XyzWellSurvey_IsLateral(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def XyzWellSurvey_GetParentPythonBoreholeObject(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def XyzWellSurvey_IsAlgorithmMinimumCurvature(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def XyzWellSurvey_SetAlgorithmToMinimumCurvature(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def XyzWellSurvey_IsCalculationValid(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def add_PetrelConnection_XyzWellSurveyServicer_to_server(servicer, server): rpc_method_handlers = { 'GetXyzWellSurvey': grpc.unary_unary_rpc_method_handler( servicer.GetXyzWellSurvey, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.SerializeToString, ), 'XyzWellSurvey_RecordCount': grpc.unary_unary_rpc_method_handler( servicer.XyzWellSurvey_RecordCount, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_RecordCount_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_RecordCount_Response.SerializeToString, ), 'XyzWellSurvey_GetXs': grpc.unary_stream_rpc_method_handler( servicer.XyzWellSurvey_GetXs, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_GetXs_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_GetXs_Response.SerializeToString, ), 'XyzWellSurvey_GetYs': grpc.unary_stream_rpc_method_handler( servicer.XyzWellSurvey_GetYs, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_GetYs_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_GetYs_Response.SerializeToString, ), 'XyzWellSurvey_GetZs': grpc.unary_stream_rpc_method_handler( servicer.XyzWellSurvey_GetZs, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_GetZs_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_GetZs_Response.SerializeToString, ), 'XyzWellSurvey_GetMds': grpc.unary_stream_rpc_method_handler( servicer.XyzWellSurvey_GetMds, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_GetMds_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_GetMds_Response.SerializeToString, ), 'XyzWellSurvey_GetIncls': grpc.unary_stream_rpc_method_handler( servicer.XyzWellSurvey_GetIncls, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_GetIncls_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_GetIncls_Response.SerializeToString, ), 'XyzWellSurvey_GetAzims': grpc.unary_stream_rpc_method_handler( servicer.XyzWellSurvey_GetAzims, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_GetAzims_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_GetAzims_Response.SerializeToString, ), 'XyzWellSurvey_SetRecords': grpc.stream_unary_rpc_method_handler( servicer.XyzWellSurvey_SetRecords, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_SetRecords_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.SerializeToString, ), 'XyzWellSurvey_SetSurveyAsDefinitive': grpc.unary_unary_rpc_method_handler( servicer.XyzWellSurvey_SetSurveyAsDefinitive, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_SetSurveyAsDefinitive_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_SetSurveyAsDefinitive_Response.SerializeToString, ), 'XyzWellSurvey_TieInMd': grpc.unary_unary_rpc_method_handler( servicer.XyzWellSurvey_TieInMd, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_TieInMd_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_TieInMd_Response.SerializeToString, ), 'XyzWellSurvey_SetTieInMd': grpc.unary_unary_rpc_method_handler( servicer.XyzWellSurvey_SetTieInMd, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_SetTieInMd_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_SetTieInMd_Response.SerializeToString, ), 'XyzWellSurvey_IsLateral': grpc.unary_unary_rpc_method_handler( servicer.XyzWellSurvey_IsLateral, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_IsLateral_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_IsLateral_Response.SerializeToString, ), 'XyzWellSurvey_GetParentPythonBoreholeObject': grpc.unary_unary_rpc_method_handler( servicer.XyzWellSurvey_GetParentPythonBoreholeObject, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_GetParentPythonBoreholeObject_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_GetParentPythonBoreholeObject_Response.SerializeToString, ), 'XyzWellSurvey_IsAlgorithmMinimumCurvature': grpc.unary_unary_rpc_method_handler( servicer.XyzWellSurvey_IsAlgorithmMinimumCurvature, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.SerializeToString, ), 'XyzWellSurvey_SetAlgorithmToMinimumCurvature': grpc.unary_unary_rpc_method_handler( servicer.XyzWellSurvey_SetAlgorithmToMinimumCurvature, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SetAlgorithmToMinimumCurvature_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.SerializeToString, ), 'XyzWellSurvey_IsCalculationValid': grpc.unary_unary_rpc_method_handler( servicer.XyzWellSurvey_IsCalculationValid, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'petrelgrpc.PetrelConnection_XyzWellSurvey', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) # This class is part of an EXPERIMENTAL API. class PetrelConnection_XyzWellSurvey(object): """Missing associated documentation comment in .proto file.""" @staticmethod def GetXyzWellSurvey(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_XyzWellSurvey/GetXyzWellSurvey', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def XyzWellSurvey_RecordCount(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_XyzWellSurvey/XyzWellSurvey_RecordCount', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_RecordCount_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_RecordCount_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def XyzWellSurvey_GetXs(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_XyzWellSurvey/XyzWellSurvey_GetXs', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_GetXs_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_GetXs_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def XyzWellSurvey_GetYs(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_XyzWellSurvey/XyzWellSurvey_GetYs', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_GetYs_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_GetYs_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def XyzWellSurvey_GetZs(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_XyzWellSurvey/XyzWellSurvey_GetZs', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_GetZs_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_GetZs_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def XyzWellSurvey_GetMds(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_XyzWellSurvey/XyzWellSurvey_GetMds', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_GetMds_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_GetMds_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def XyzWellSurvey_GetIncls(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_XyzWellSurvey/XyzWellSurvey_GetIncls', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_GetIncls_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_GetIncls_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def XyzWellSurvey_GetAzims(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_XyzWellSurvey/XyzWellSurvey_GetAzims', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_GetAzims_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_GetAzims_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def XyzWellSurvey_SetRecords(request_iterator, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.stream_unary(request_iterator, target, '/petrelgrpc.PetrelConnection_XyzWellSurvey/XyzWellSurvey_SetRecords', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_SetRecords_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def XyzWellSurvey_SetSurveyAsDefinitive(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_XyzWellSurvey/XyzWellSurvey_SetSurveyAsDefinitive', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_SetSurveyAsDefinitive_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_SetSurveyAsDefinitive_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def XyzWellSurvey_TieInMd(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_XyzWellSurvey/XyzWellSurvey_TieInMd', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_TieInMd_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_TieInMd_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def XyzWellSurvey_SetTieInMd(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_XyzWellSurvey/XyzWellSurvey_SetTieInMd', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_SetTieInMd_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_SetTieInMd_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def XyzWellSurvey_IsLateral(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_XyzWellSurvey/XyzWellSurvey_IsLateral', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_IsLateral_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_IsLateral_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def XyzWellSurvey_GetParentPythonBoreholeObject(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_XyzWellSurvey/XyzWellSurvey_GetParentPythonBoreholeObject', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_GetParentPythonBoreholeObject_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XyzWellSurvey_GetParentPythonBoreholeObject_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def XyzWellSurvey_IsAlgorithmMinimumCurvature(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_XyzWellSurvey/XyzWellSurvey_IsAlgorithmMinimumCurvature', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def XyzWellSurvey_SetAlgorithmToMinimumCurvature(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_XyzWellSurvey/XyzWellSurvey_SetAlgorithmToMinimumCurvature', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SetAlgorithmToMinimumCurvature_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def XyzWellSurvey_IsCalculationValid(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_XyzWellSurvey/XyzWellSurvey_IsCalculationValid', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) class PetrelConnection_XytvdWellSurveyStub(object): """Missing associated documentation comment in .proto file.""" def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. """ self.GetXytvdWellSurvey = channel.unary_unary( '/petrelgrpc.PetrelConnection_XytvdWellSurvey/GetXytvdWellSurvey', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, ) self.XytvdWellSurvey_RecordCount = channel.unary_unary( '/petrelgrpc.PetrelConnection_XytvdWellSurvey/XytvdWellSurvey_RecordCount', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_RecordCount_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_RecordCount_Response.FromString, ) self.XytvdWellSurvey_GetXs = channel.unary_stream( '/petrelgrpc.PetrelConnection_XytvdWellSurvey/XytvdWellSurvey_GetXs', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_GetXs_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_GetXs_Response.FromString, ) self.XytvdWellSurvey_GetYs = channel.unary_stream( '/petrelgrpc.PetrelConnection_XytvdWellSurvey/XytvdWellSurvey_GetYs', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_GetYs_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_GetYs_Response.FromString, ) self.XytvdWellSurvey_GetTvds = channel.unary_stream( '/petrelgrpc.PetrelConnection_XytvdWellSurvey/XytvdWellSurvey_GetTvds', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_GetTvds_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_GetTvds_Response.FromString, ) self.XytvdWellSurvey_GetZs = channel.unary_stream( '/petrelgrpc.PetrelConnection_XytvdWellSurvey/XytvdWellSurvey_GetZs', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_GetZs_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_GetZs_Response.FromString, ) self.XytvdWellSurvey_GetMds = channel.unary_stream( '/petrelgrpc.PetrelConnection_XytvdWellSurvey/XytvdWellSurvey_GetMds', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_GetMds_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_GetMds_Response.FromString, ) self.XytvdWellSurvey_GetIncls = channel.unary_stream( '/petrelgrpc.PetrelConnection_XytvdWellSurvey/XytvdWellSurvey_GetIncls', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_GetIncls_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_GetIncls_Response.FromString, ) self.XytvdWellSurvey_GetAzims = channel.unary_stream( '/petrelgrpc.PetrelConnection_XytvdWellSurvey/XytvdWellSurvey_GetAzims', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_GetAzims_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_GetAzims_Response.FromString, ) self.XytvdWellSurvey_SetRecords = channel.stream_unary( '/petrelgrpc.PetrelConnection_XytvdWellSurvey/XytvdWellSurvey_SetRecords', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_SetRecords_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, ) self.XytvdWellSurvey_SetSurveyAsDefinitive = channel.unary_unary( '/petrelgrpc.PetrelConnection_XytvdWellSurvey/XytvdWellSurvey_SetSurveyAsDefinitive', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_SetSurveyAsDefinitive_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_SetSurveyAsDefinitive_Response.FromString, ) self.XytvdWellSurvey_TieInMd = channel.unary_unary( '/petrelgrpc.PetrelConnection_XytvdWellSurvey/XytvdWellSurvey_TieInMd', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_TieInMd_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_TieInMd_Response.FromString, ) self.XytvdWellSurvey_SetTieInMd = channel.unary_unary( '/petrelgrpc.PetrelConnection_XytvdWellSurvey/XytvdWellSurvey_SetTieInMd', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_SetTieInMd_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_SetTieInMd_Response.FromString, ) self.XytvdWellSurvey_IsLateral = channel.unary_unary( '/petrelgrpc.PetrelConnection_XytvdWellSurvey/XytvdWellSurvey_IsLateral', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_IsLateral_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_IsLateral_Response.FromString, ) self.XytvdWellSurvey_GetParentPythonBoreholeObject = channel.unary_unary( '/petrelgrpc.PetrelConnection_XytvdWellSurvey/XytvdWellSurvey_GetParentPythonBoreholeObject', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_GetParentPythonBoreholeObject_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_GetParentPythonBoreholeObject_Response.FromString, ) self.XytvdWellSurvey_IsAlgorithmMinimumCurvature = channel.unary_unary( '/petrelgrpc.PetrelConnection_XytvdWellSurvey/XytvdWellSurvey_IsAlgorithmMinimumCurvature', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, ) self.XytvdWellSurvey_SetAlgorithmToMinimumCurvature = channel.unary_unary( '/petrelgrpc.PetrelConnection_XytvdWellSurvey/XytvdWellSurvey_SetAlgorithmToMinimumCurvature', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SetAlgorithmToMinimumCurvature_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, ) self.XytvdWellSurvey_IsCalculationValid = channel.unary_unary( '/petrelgrpc.PetrelConnection_XytvdWellSurvey/XytvdWellSurvey_IsCalculationValid', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, ) class PetrelConnection_XytvdWellSurveyServicer(object): """Missing associated documentation comment in .proto file.""" def GetXytvdWellSurvey(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def XytvdWellSurvey_RecordCount(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def XytvdWellSurvey_GetXs(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def XytvdWellSurvey_GetYs(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def XytvdWellSurvey_GetTvds(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def XytvdWellSurvey_GetZs(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def XytvdWellSurvey_GetMds(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def XytvdWellSurvey_GetIncls(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def XytvdWellSurvey_GetAzims(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def XytvdWellSurvey_SetRecords(self, request_iterator, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def XytvdWellSurvey_SetSurveyAsDefinitive(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def XytvdWellSurvey_TieInMd(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def XytvdWellSurvey_SetTieInMd(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def XytvdWellSurvey_IsLateral(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def XytvdWellSurvey_GetParentPythonBoreholeObject(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def XytvdWellSurvey_IsAlgorithmMinimumCurvature(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def XytvdWellSurvey_SetAlgorithmToMinimumCurvature(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def XytvdWellSurvey_IsCalculationValid(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def add_PetrelConnection_XytvdWellSurveyServicer_to_server(servicer, server): rpc_method_handlers = { 'GetXytvdWellSurvey': grpc.unary_unary_rpc_method_handler( servicer.GetXytvdWellSurvey, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.SerializeToString, ), 'XytvdWellSurvey_RecordCount': grpc.unary_unary_rpc_method_handler( servicer.XytvdWellSurvey_RecordCount, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_RecordCount_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_RecordCount_Response.SerializeToString, ), 'XytvdWellSurvey_GetXs': grpc.unary_stream_rpc_method_handler( servicer.XytvdWellSurvey_GetXs, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_GetXs_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_GetXs_Response.SerializeToString, ), 'XytvdWellSurvey_GetYs': grpc.unary_stream_rpc_method_handler( servicer.XytvdWellSurvey_GetYs, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_GetYs_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_GetYs_Response.SerializeToString, ), 'XytvdWellSurvey_GetTvds': grpc.unary_stream_rpc_method_handler( servicer.XytvdWellSurvey_GetTvds, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_GetTvds_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_GetTvds_Response.SerializeToString, ), 'XytvdWellSurvey_GetZs': grpc.unary_stream_rpc_method_handler( servicer.XytvdWellSurvey_GetZs, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_GetZs_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_GetZs_Response.SerializeToString, ), 'XytvdWellSurvey_GetMds': grpc.unary_stream_rpc_method_handler( servicer.XytvdWellSurvey_GetMds, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_GetMds_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_GetMds_Response.SerializeToString, ), 'XytvdWellSurvey_GetIncls': grpc.unary_stream_rpc_method_handler( servicer.XytvdWellSurvey_GetIncls, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_GetIncls_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_GetIncls_Response.SerializeToString, ), 'XytvdWellSurvey_GetAzims': grpc.unary_stream_rpc_method_handler( servicer.XytvdWellSurvey_GetAzims, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_GetAzims_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_GetAzims_Response.SerializeToString, ), 'XytvdWellSurvey_SetRecords': grpc.stream_unary_rpc_method_handler( servicer.XytvdWellSurvey_SetRecords, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_SetRecords_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.SerializeToString, ), 'XytvdWellSurvey_SetSurveyAsDefinitive': grpc.unary_unary_rpc_method_handler( servicer.XytvdWellSurvey_SetSurveyAsDefinitive, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_SetSurveyAsDefinitive_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_SetSurveyAsDefinitive_Response.SerializeToString, ), 'XytvdWellSurvey_TieInMd': grpc.unary_unary_rpc_method_handler( servicer.XytvdWellSurvey_TieInMd, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_TieInMd_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_TieInMd_Response.SerializeToString, ), 'XytvdWellSurvey_SetTieInMd': grpc.unary_unary_rpc_method_handler( servicer.XytvdWellSurvey_SetTieInMd, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_SetTieInMd_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_SetTieInMd_Response.SerializeToString, ), 'XytvdWellSurvey_IsLateral': grpc.unary_unary_rpc_method_handler( servicer.XytvdWellSurvey_IsLateral, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_IsLateral_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_IsLateral_Response.SerializeToString, ), 'XytvdWellSurvey_GetParentPythonBoreholeObject': grpc.unary_unary_rpc_method_handler( servicer.XytvdWellSurvey_GetParentPythonBoreholeObject, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_GetParentPythonBoreholeObject_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_GetParentPythonBoreholeObject_Response.SerializeToString, ), 'XytvdWellSurvey_IsAlgorithmMinimumCurvature': grpc.unary_unary_rpc_method_handler( servicer.XytvdWellSurvey_IsAlgorithmMinimumCurvature, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.SerializeToString, ), 'XytvdWellSurvey_SetAlgorithmToMinimumCurvature': grpc.unary_unary_rpc_method_handler( servicer.XytvdWellSurvey_SetAlgorithmToMinimumCurvature, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SetAlgorithmToMinimumCurvature_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.SerializeToString, ), 'XytvdWellSurvey_IsCalculationValid': grpc.unary_unary_rpc_method_handler( servicer.XytvdWellSurvey_IsCalculationValid, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'petrelgrpc.PetrelConnection_XytvdWellSurvey', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) # This class is part of an EXPERIMENTAL API. class PetrelConnection_XytvdWellSurvey(object): """Missing associated documentation comment in .proto file.""" @staticmethod def GetXytvdWellSurvey(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_XytvdWellSurvey/GetXytvdWellSurvey', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def XytvdWellSurvey_RecordCount(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_XytvdWellSurvey/XytvdWellSurvey_RecordCount', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_RecordCount_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_RecordCount_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def XytvdWellSurvey_GetXs(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_XytvdWellSurvey/XytvdWellSurvey_GetXs', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_GetXs_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_GetXs_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def XytvdWellSurvey_GetYs(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_XytvdWellSurvey/XytvdWellSurvey_GetYs', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_GetYs_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_GetYs_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def XytvdWellSurvey_GetTvds(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_XytvdWellSurvey/XytvdWellSurvey_GetTvds', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_GetTvds_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_GetTvds_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def XytvdWellSurvey_GetZs(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_XytvdWellSurvey/XytvdWellSurvey_GetZs', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_GetZs_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_GetZs_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def XytvdWellSurvey_GetMds(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_XytvdWellSurvey/XytvdWellSurvey_GetMds', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_GetMds_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_GetMds_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def XytvdWellSurvey_GetIncls(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_XytvdWellSurvey/XytvdWellSurvey_GetIncls', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_GetIncls_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_GetIncls_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def XytvdWellSurvey_GetAzims(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_XytvdWellSurvey/XytvdWellSurvey_GetAzims', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_GetAzims_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_GetAzims_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def XytvdWellSurvey_SetRecords(request_iterator, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.stream_unary(request_iterator, target, '/petrelgrpc.PetrelConnection_XytvdWellSurvey/XytvdWellSurvey_SetRecords', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_SetRecords_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def XytvdWellSurvey_SetSurveyAsDefinitive(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_XytvdWellSurvey/XytvdWellSurvey_SetSurveyAsDefinitive', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_SetSurveyAsDefinitive_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_SetSurveyAsDefinitive_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def XytvdWellSurvey_TieInMd(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_XytvdWellSurvey/XytvdWellSurvey_TieInMd', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_TieInMd_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_TieInMd_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def XytvdWellSurvey_SetTieInMd(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_XytvdWellSurvey/XytvdWellSurvey_SetTieInMd', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_SetTieInMd_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_SetTieInMd_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def XytvdWellSurvey_IsLateral(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_XytvdWellSurvey/XytvdWellSurvey_IsLateral', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_IsLateral_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_IsLateral_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def XytvdWellSurvey_GetParentPythonBoreholeObject(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_XytvdWellSurvey/XytvdWellSurvey_GetParentPythonBoreholeObject', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_GetParentPythonBoreholeObject_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.XytvdWellSurvey_GetParentPythonBoreholeObject_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def XytvdWellSurvey_IsAlgorithmMinimumCurvature(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_XytvdWellSurvey/XytvdWellSurvey_IsAlgorithmMinimumCurvature', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def XytvdWellSurvey_SetAlgorithmToMinimumCurvature(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_XytvdWellSurvey/XytvdWellSurvey_SetAlgorithmToMinimumCurvature', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SetAlgorithmToMinimumCurvature_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def XytvdWellSurvey_IsCalculationValid(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_XytvdWellSurvey/XytvdWellSurvey_IsCalculationValid', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) class PetrelConnection_DxdytvdWellSurveyStub(object): """Missing associated documentation comment in .proto file.""" def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. """ self.GetDxdytvdWellSurvey = channel.unary_unary( '/petrelgrpc.PetrelConnection_DxdytvdWellSurvey/GetDxdytvdWellSurvey', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, ) self.DxdytvdWellSurvey_RecordCount = channel.unary_unary( '/petrelgrpc.PetrelConnection_DxdytvdWellSurvey/DxdytvdWellSurvey_RecordCount', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_RecordCount_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_RecordCount_Response.FromString, ) self.DxdytvdWellSurvey_AzimuthReferenceIsGridNorth = channel.unary_unary( '/petrelgrpc.PetrelConnection_DxdytvdWellSurvey/DxdytvdWellSurvey_AzimuthReferenceIsGridNorth', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_AzimuthReferenceIsGridNorth_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_AzimuthReferenceIsGridNorth_Response.FromString, ) self.DxdytvdWellSurvey_GetDxs = channel.unary_stream( '/petrelgrpc.PetrelConnection_DxdytvdWellSurvey/DxdytvdWellSurvey_GetDxs', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_GetDxs_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_GetDxs_Response.FromString, ) self.DxdytvdWellSurvey_GetDys = channel.unary_stream( '/petrelgrpc.PetrelConnection_DxdytvdWellSurvey/DxdytvdWellSurvey_GetDys', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_GetDys_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_GetDys_Response.FromString, ) self.DxdytvdWellSurvey_GetTvds = channel.unary_stream( '/petrelgrpc.PetrelConnection_DxdytvdWellSurvey/DxdytvdWellSurvey_GetTvds', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_GetTvds_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_GetTvds_Response.FromString, ) self.DxdytvdWellSurvey_GetXs = channel.unary_stream( '/petrelgrpc.PetrelConnection_DxdytvdWellSurvey/DxdytvdWellSurvey_GetXs', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_GetXs_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_GetXs_Response.FromString, ) self.DxdytvdWellSurvey_GetYs = channel.unary_stream( '/petrelgrpc.PetrelConnection_DxdytvdWellSurvey/DxdytvdWellSurvey_GetYs', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_GetYs_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_GetYs_Response.FromString, ) self.DxdytvdWellSurvey_GetZs = channel.unary_stream( '/petrelgrpc.PetrelConnection_DxdytvdWellSurvey/DxdytvdWellSurvey_GetZs', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_GetZs_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_GetZs_Response.FromString, ) self.DxdytvdWellSurvey_GetMds = channel.unary_stream( '/petrelgrpc.PetrelConnection_DxdytvdWellSurvey/DxdytvdWellSurvey_GetMds', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_GetMds_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_GetMds_Response.FromString, ) self.DxdytvdWellSurvey_GetIncls = channel.unary_stream( '/petrelgrpc.PetrelConnection_DxdytvdWellSurvey/DxdytvdWellSurvey_GetIncls', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_GetIncls_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_GetIncls_Response.FromString, ) self.DxdytvdWellSurvey_GetAzims = channel.unary_stream( '/petrelgrpc.PetrelConnection_DxdytvdWellSurvey/DxdytvdWellSurvey_GetAzims', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_GetAzims_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_GetAzims_Response.FromString, ) self.DxdytvdWellSurvey_SetRecords = channel.stream_unary( '/petrelgrpc.PetrelConnection_DxdytvdWellSurvey/DxdytvdWellSurvey_SetRecords', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_SetRecords_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, ) self.DxdytvdWellSurvey_SetSurveyAsDefinitive = channel.unary_unary( '/petrelgrpc.PetrelConnection_DxdytvdWellSurvey/DxdytvdWellSurvey_SetSurveyAsDefinitive', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_SetSurveyAsDefinitive_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_SetSurveyAsDefinitive_Response.FromString, ) self.DxdytvdWellSurvey_TieInMd = channel.unary_unary( '/petrelgrpc.PetrelConnection_DxdytvdWellSurvey/DxdytvdWellSurvey_TieInMd', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_TieInMd_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_TieInMd_Response.FromString, ) self.DxdytvdWellSurvey_SetTieInMd = channel.unary_unary( '/petrelgrpc.PetrelConnection_DxdytvdWellSurvey/DxdytvdWellSurvey_SetTieInMd', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_SetTieInMd_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_SetTieInMd_Response.FromString, ) self.DxdytvdWellSurvey_IsLateral = channel.unary_unary( '/petrelgrpc.PetrelConnection_DxdytvdWellSurvey/DxdytvdWellSurvey_IsLateral', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_IsLateral_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_IsLateral_Response.FromString, ) self.DxdytvdWellSurvey_GetParentPythonBoreholeObject = channel.unary_unary( '/petrelgrpc.PetrelConnection_DxdytvdWellSurvey/DxdytvdWellSurvey_GetParentPythonBoreholeObject', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_GetParentPythonBoreholeObject_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_GetParentPythonBoreholeObject_Response.FromString, ) self.DxdytvdWellSurvey_IsAlgorithmMinimumCurvature = channel.unary_unary( '/petrelgrpc.PetrelConnection_DxdytvdWellSurvey/DxdytvdWellSurvey_IsAlgorithmMinimumCurvature', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, ) self.DxdytvdWellSurvey_SetAlgorithmToMinimumCurvature = channel.unary_unary( '/petrelgrpc.PetrelConnection_DxdytvdWellSurvey/DxdytvdWellSurvey_SetAlgorithmToMinimumCurvature', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SetAlgorithmToMinimumCurvature_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, ) self.DxdytvdWellSurvey_IsCalculationValid = channel.unary_unary( '/petrelgrpc.PetrelConnection_DxdytvdWellSurvey/DxdytvdWellSurvey_IsCalculationValid', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, ) class PetrelConnection_DxdytvdWellSurveyServicer(object): """Missing associated documentation comment in .proto file.""" def GetDxdytvdWellSurvey(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def DxdytvdWellSurvey_RecordCount(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def DxdytvdWellSurvey_AzimuthReferenceIsGridNorth(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def DxdytvdWellSurvey_GetDxs(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def DxdytvdWellSurvey_GetDys(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def DxdytvdWellSurvey_GetTvds(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def DxdytvdWellSurvey_GetXs(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def DxdytvdWellSurvey_GetYs(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def DxdytvdWellSurvey_GetZs(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def DxdytvdWellSurvey_GetMds(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def DxdytvdWellSurvey_GetIncls(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def DxdytvdWellSurvey_GetAzims(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def DxdytvdWellSurvey_SetRecords(self, request_iterator, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def DxdytvdWellSurvey_SetSurveyAsDefinitive(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def DxdytvdWellSurvey_TieInMd(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def DxdytvdWellSurvey_SetTieInMd(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def DxdytvdWellSurvey_IsLateral(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def DxdytvdWellSurvey_GetParentPythonBoreholeObject(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def DxdytvdWellSurvey_IsAlgorithmMinimumCurvature(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def DxdytvdWellSurvey_SetAlgorithmToMinimumCurvature(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def DxdytvdWellSurvey_IsCalculationValid(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def add_PetrelConnection_DxdytvdWellSurveyServicer_to_server(servicer, server): rpc_method_handlers = { 'GetDxdytvdWellSurvey': grpc.unary_unary_rpc_method_handler( servicer.GetDxdytvdWellSurvey, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.SerializeToString, ), 'DxdytvdWellSurvey_RecordCount': grpc.unary_unary_rpc_method_handler( servicer.DxdytvdWellSurvey_RecordCount, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_RecordCount_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_RecordCount_Response.SerializeToString, ), 'DxdytvdWellSurvey_AzimuthReferenceIsGridNorth': grpc.unary_unary_rpc_method_handler( servicer.DxdytvdWellSurvey_AzimuthReferenceIsGridNorth, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_AzimuthReferenceIsGridNorth_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_AzimuthReferenceIsGridNorth_Response.SerializeToString, ), 'DxdytvdWellSurvey_GetDxs': grpc.unary_stream_rpc_method_handler( servicer.DxdytvdWellSurvey_GetDxs, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_GetDxs_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_GetDxs_Response.SerializeToString, ), 'DxdytvdWellSurvey_GetDys': grpc.unary_stream_rpc_method_handler( servicer.DxdytvdWellSurvey_GetDys, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_GetDys_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_GetDys_Response.SerializeToString, ), 'DxdytvdWellSurvey_GetTvds': grpc.unary_stream_rpc_method_handler( servicer.DxdytvdWellSurvey_GetTvds, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_GetTvds_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_GetTvds_Response.SerializeToString, ), 'DxdytvdWellSurvey_GetXs': grpc.unary_stream_rpc_method_handler( servicer.DxdytvdWellSurvey_GetXs, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_GetXs_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_GetXs_Response.SerializeToString, ), 'DxdytvdWellSurvey_GetYs': grpc.unary_stream_rpc_method_handler( servicer.DxdytvdWellSurvey_GetYs, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_GetYs_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_GetYs_Response.SerializeToString, ), 'DxdytvdWellSurvey_GetZs': grpc.unary_stream_rpc_method_handler( servicer.DxdytvdWellSurvey_GetZs, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_GetZs_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_GetZs_Response.SerializeToString, ), 'DxdytvdWellSurvey_GetMds': grpc.unary_stream_rpc_method_handler( servicer.DxdytvdWellSurvey_GetMds, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_GetMds_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_GetMds_Response.SerializeToString, ), 'DxdytvdWellSurvey_GetIncls': grpc.unary_stream_rpc_method_handler( servicer.DxdytvdWellSurvey_GetIncls, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_GetIncls_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_GetIncls_Response.SerializeToString, ), 'DxdytvdWellSurvey_GetAzims': grpc.unary_stream_rpc_method_handler( servicer.DxdytvdWellSurvey_GetAzims, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_GetAzims_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_GetAzims_Response.SerializeToString, ), 'DxdytvdWellSurvey_SetRecords': grpc.stream_unary_rpc_method_handler( servicer.DxdytvdWellSurvey_SetRecords, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_SetRecords_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.SerializeToString, ), 'DxdytvdWellSurvey_SetSurveyAsDefinitive': grpc.unary_unary_rpc_method_handler( servicer.DxdytvdWellSurvey_SetSurveyAsDefinitive, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_SetSurveyAsDefinitive_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_SetSurveyAsDefinitive_Response.SerializeToString, ), 'DxdytvdWellSurvey_TieInMd': grpc.unary_unary_rpc_method_handler( servicer.DxdytvdWellSurvey_TieInMd, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_TieInMd_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_TieInMd_Response.SerializeToString, ), 'DxdytvdWellSurvey_SetTieInMd': grpc.unary_unary_rpc_method_handler( servicer.DxdytvdWellSurvey_SetTieInMd, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_SetTieInMd_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_SetTieInMd_Response.SerializeToString, ), 'DxdytvdWellSurvey_IsLateral': grpc.unary_unary_rpc_method_handler( servicer.DxdytvdWellSurvey_IsLateral, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_IsLateral_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_IsLateral_Response.SerializeToString, ), 'DxdytvdWellSurvey_GetParentPythonBoreholeObject': grpc.unary_unary_rpc_method_handler( servicer.DxdytvdWellSurvey_GetParentPythonBoreholeObject, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_GetParentPythonBoreholeObject_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_GetParentPythonBoreholeObject_Response.SerializeToString, ), 'DxdytvdWellSurvey_IsAlgorithmMinimumCurvature': grpc.unary_unary_rpc_method_handler( servicer.DxdytvdWellSurvey_IsAlgorithmMinimumCurvature, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.SerializeToString, ), 'DxdytvdWellSurvey_SetAlgorithmToMinimumCurvature': grpc.unary_unary_rpc_method_handler( servicer.DxdytvdWellSurvey_SetAlgorithmToMinimumCurvature, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SetAlgorithmToMinimumCurvature_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.SerializeToString, ), 'DxdytvdWellSurvey_IsCalculationValid': grpc.unary_unary_rpc_method_handler( servicer.DxdytvdWellSurvey_IsCalculationValid, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'petrelgrpc.PetrelConnection_DxdytvdWellSurvey', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) # This class is part of an EXPERIMENTAL API. class PetrelConnection_DxdytvdWellSurvey(object): """Missing associated documentation comment in .proto file.""" @staticmethod def GetDxdytvdWellSurvey(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_DxdytvdWellSurvey/GetDxdytvdWellSurvey', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def DxdytvdWellSurvey_RecordCount(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_DxdytvdWellSurvey/DxdytvdWellSurvey_RecordCount', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_RecordCount_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_RecordCount_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def DxdytvdWellSurvey_AzimuthReferenceIsGridNorth(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_DxdytvdWellSurvey/DxdytvdWellSurvey_AzimuthReferenceIsGridNorth', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_AzimuthReferenceIsGridNorth_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_AzimuthReferenceIsGridNorth_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def DxdytvdWellSurvey_GetDxs(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_DxdytvdWellSurvey/DxdytvdWellSurvey_GetDxs', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_GetDxs_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_GetDxs_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def DxdytvdWellSurvey_GetDys(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_DxdytvdWellSurvey/DxdytvdWellSurvey_GetDys', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_GetDys_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_GetDys_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def DxdytvdWellSurvey_GetTvds(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_DxdytvdWellSurvey/DxdytvdWellSurvey_GetTvds', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_GetTvds_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_GetTvds_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def DxdytvdWellSurvey_GetXs(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_DxdytvdWellSurvey/DxdytvdWellSurvey_GetXs', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_GetXs_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_GetXs_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def DxdytvdWellSurvey_GetYs(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_DxdytvdWellSurvey/DxdytvdWellSurvey_GetYs', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_GetYs_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_GetYs_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def DxdytvdWellSurvey_GetZs(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_DxdytvdWellSurvey/DxdytvdWellSurvey_GetZs', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_GetZs_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_GetZs_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def DxdytvdWellSurvey_GetMds(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_DxdytvdWellSurvey/DxdytvdWellSurvey_GetMds', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_GetMds_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_GetMds_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def DxdytvdWellSurvey_GetIncls(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_DxdytvdWellSurvey/DxdytvdWellSurvey_GetIncls', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_GetIncls_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_GetIncls_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def DxdytvdWellSurvey_GetAzims(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_DxdytvdWellSurvey/DxdytvdWellSurvey_GetAzims', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_GetAzims_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_GetAzims_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def DxdytvdWellSurvey_SetRecords(request_iterator, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.stream_unary(request_iterator, target, '/petrelgrpc.PetrelConnection_DxdytvdWellSurvey/DxdytvdWellSurvey_SetRecords', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_SetRecords_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def DxdytvdWellSurvey_SetSurveyAsDefinitive(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_DxdytvdWellSurvey/DxdytvdWellSurvey_SetSurveyAsDefinitive', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_SetSurveyAsDefinitive_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_SetSurveyAsDefinitive_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def DxdytvdWellSurvey_TieInMd(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_DxdytvdWellSurvey/DxdytvdWellSurvey_TieInMd', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_TieInMd_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_TieInMd_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def DxdytvdWellSurvey_SetTieInMd(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_DxdytvdWellSurvey/DxdytvdWellSurvey_SetTieInMd', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_SetTieInMd_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_SetTieInMd_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def DxdytvdWellSurvey_IsLateral(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_DxdytvdWellSurvey/DxdytvdWellSurvey_IsLateral', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_IsLateral_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_IsLateral_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def DxdytvdWellSurvey_GetParentPythonBoreholeObject(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_DxdytvdWellSurvey/DxdytvdWellSurvey_GetParentPythonBoreholeObject', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_GetParentPythonBoreholeObject_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.DxdytvdWellSurvey_GetParentPythonBoreholeObject_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def DxdytvdWellSurvey_IsAlgorithmMinimumCurvature(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_DxdytvdWellSurvey/DxdytvdWellSurvey_IsAlgorithmMinimumCurvature', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def DxdytvdWellSurvey_SetAlgorithmToMinimumCurvature(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_DxdytvdWellSurvey/DxdytvdWellSurvey_SetAlgorithmToMinimumCurvature', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.SetAlgorithmToMinimumCurvature_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def DxdytvdWellSurvey_IsCalculationValid(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_DxdytvdWellSurvey/DxdytvdWellSurvey_IsCalculationValid', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) class PetrelConnection_MdinclazimWellSurveyStub(object): """Missing associated documentation comment in .proto file.""" def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. """ self.GetMdinclazimWellSurvey = channel.unary_unary( '/petrelgrpc.PetrelConnection_MdinclazimWellSurvey/GetMdinclazimWellSurvey', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, ) self.MdinclazimWellSurvey_RecordCount = channel.unary_unary( '/petrelgrpc.PetrelConnection_MdinclazimWellSurvey/MdinclazimWellSurvey_RecordCount', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_RecordCount_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_RecordCount_Response.FromString, ) self.MdinclazimWellSurvey_AzimuthReferenceIsGridNorth = channel.unary_unary( '/petrelgrpc.PetrelConnection_MdinclazimWellSurvey/MdinclazimWellSurvey_AzimuthReferenceIsGridNorth', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_AzimuthReferenceIsGridNorth_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_AzimuthReferenceIsGridNorth_Response.FromString, ) self.MdinclazimWellSurvey_GetMds = channel.unary_stream( '/petrelgrpc.PetrelConnection_MdinclazimWellSurvey/MdinclazimWellSurvey_GetMds', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_GetMds_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_GetMds_Response.FromString, ) self.MdinclazimWellSurvey_GetIncls = channel.unary_stream( '/petrelgrpc.PetrelConnection_MdinclazimWellSurvey/MdinclazimWellSurvey_GetIncls', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_GetIncls_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_GetIncls_Response.FromString, ) self.MdinclazimWellSurvey_GetAzims = channel.unary_stream( '/petrelgrpc.PetrelConnection_MdinclazimWellSurvey/MdinclazimWellSurvey_GetAzims', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_GetAzims_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_GetAzims_Response.FromString, ) self.MdinclazimWellSurvey_GetXs = channel.unary_stream( '/petrelgrpc.PetrelConnection_MdinclazimWellSurvey/MdinclazimWellSurvey_GetXs', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_GetXs_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_GetXs_Response.FromString, ) self.MdinclazimWellSurvey_GetYs = channel.unary_stream( '/petrelgrpc.PetrelConnection_MdinclazimWellSurvey/MdinclazimWellSurvey_GetYs', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_GetYs_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_GetYs_Response.FromString, ) self.MdinclazimWellSurvey_GetZs = channel.unary_stream( '/petrelgrpc.PetrelConnection_MdinclazimWellSurvey/MdinclazimWellSurvey_GetZs', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_GetZs_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_GetZs_Response.FromString, ) self.MdinclazimWellSurvey_IsAzimuthReferenceGridNorth = channel.unary_unary( '/petrelgrpc.PetrelConnection_MdinclazimWellSurvey/MdinclazimWellSurvey_IsAzimuthReferenceGridNorth', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_IsAzimuthReferenceGridNorth_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_IsAzimuthReferenceGridNorth_Response.FromString, ) self.MdinclazimWellSurvey_SetRecords = channel.stream_unary( '/petrelgrpc.PetrelConnection_MdinclazimWellSurvey/MdinclazimWellSurvey_SetRecords', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_SetRecords_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, ) self.MdinclazimWellSurvey_SetSurveyAsDefinitive = channel.unary_unary( '/petrelgrpc.PetrelConnection_MdinclazimWellSurvey/MdinclazimWellSurvey_SetSurveyAsDefinitive', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_SetSurveyAsDefinitive_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_SetSurveyAsDefinitive_Response.FromString, ) self.MdinclazimWellSurvey_TieInMd = channel.unary_unary( '/petrelgrpc.PetrelConnection_MdinclazimWellSurvey/MdinclazimWellSurvey_TieInMd', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_TieInMd_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_TieInMd_Response.FromString, ) self.MdinclazimWellSurvey_SetTieInMd = channel.unary_unary( '/petrelgrpc.PetrelConnection_MdinclazimWellSurvey/MdinclazimWellSurvey_SetTieInMd', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_SetTieInMd_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_SetTieInMd_Response.FromString, ) self.MdinclazimWellSurvey_IsLateral = channel.unary_unary( '/petrelgrpc.PetrelConnection_MdinclazimWellSurvey/MdinclazimWellSurvey_IsLateral', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_IsLateral_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_IsLateral_Response.FromString, ) self.MdinclazimWellSurvey_GetParentPythonBoreholeObject = channel.unary_unary( '/petrelgrpc.PetrelConnection_MdinclazimWellSurvey/MdinclazimWellSurvey_GetParentPythonBoreholeObject', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_GetParentPythonBoreholeObject_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_GetParentPythonBoreholeObject_Response.FromString, ) self.MdinclazimWellSurvey_IsCalculationValid = channel.unary_unary( '/petrelgrpc.PetrelConnection_MdinclazimWellSurvey/MdinclazimWellSurvey_IsCalculationValid', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, ) class PetrelConnection_MdinclazimWellSurveyServicer(object): """Missing associated documentation comment in .proto file.""" def GetMdinclazimWellSurvey(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def MdinclazimWellSurvey_RecordCount(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def MdinclazimWellSurvey_AzimuthReferenceIsGridNorth(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def MdinclazimWellSurvey_GetMds(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def MdinclazimWellSurvey_GetIncls(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def MdinclazimWellSurvey_GetAzims(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def MdinclazimWellSurvey_GetXs(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def MdinclazimWellSurvey_GetYs(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def MdinclazimWellSurvey_GetZs(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def MdinclazimWellSurvey_IsAzimuthReferenceGridNorth(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def MdinclazimWellSurvey_SetRecords(self, request_iterator, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def MdinclazimWellSurvey_SetSurveyAsDefinitive(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def MdinclazimWellSurvey_TieInMd(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def MdinclazimWellSurvey_SetTieInMd(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def MdinclazimWellSurvey_IsLateral(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def MdinclazimWellSurvey_GetParentPythonBoreholeObject(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def MdinclazimWellSurvey_IsCalculationValid(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def add_PetrelConnection_MdinclazimWellSurveyServicer_to_server(servicer, server): rpc_method_handlers = { 'GetMdinclazimWellSurvey': grpc.unary_unary_rpc_method_handler( servicer.GetMdinclazimWellSurvey, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.SerializeToString, ), 'MdinclazimWellSurvey_RecordCount': grpc.unary_unary_rpc_method_handler( servicer.MdinclazimWellSurvey_RecordCount, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_RecordCount_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_RecordCount_Response.SerializeToString, ), 'MdinclazimWellSurvey_AzimuthReferenceIsGridNorth': grpc.unary_unary_rpc_method_handler( servicer.MdinclazimWellSurvey_AzimuthReferenceIsGridNorth, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_AzimuthReferenceIsGridNorth_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_AzimuthReferenceIsGridNorth_Response.SerializeToString, ), 'MdinclazimWellSurvey_GetMds': grpc.unary_stream_rpc_method_handler( servicer.MdinclazimWellSurvey_GetMds, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_GetMds_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_GetMds_Response.SerializeToString, ), 'MdinclazimWellSurvey_GetIncls': grpc.unary_stream_rpc_method_handler( servicer.MdinclazimWellSurvey_GetIncls, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_GetIncls_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_GetIncls_Response.SerializeToString, ), 'MdinclazimWellSurvey_GetAzims': grpc.unary_stream_rpc_method_handler( servicer.MdinclazimWellSurvey_GetAzims, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_GetAzims_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_GetAzims_Response.SerializeToString, ), 'MdinclazimWellSurvey_GetXs': grpc.unary_stream_rpc_method_handler( servicer.MdinclazimWellSurvey_GetXs, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_GetXs_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_GetXs_Response.SerializeToString, ), 'MdinclazimWellSurvey_GetYs': grpc.unary_stream_rpc_method_handler( servicer.MdinclazimWellSurvey_GetYs, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_GetYs_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_GetYs_Response.SerializeToString, ), 'MdinclazimWellSurvey_GetZs': grpc.unary_stream_rpc_method_handler( servicer.MdinclazimWellSurvey_GetZs, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_GetZs_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_GetZs_Response.SerializeToString, ), 'MdinclazimWellSurvey_IsAzimuthReferenceGridNorth': grpc.unary_unary_rpc_method_handler( servicer.MdinclazimWellSurvey_IsAzimuthReferenceGridNorth, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_IsAzimuthReferenceGridNorth_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_IsAzimuthReferenceGridNorth_Response.SerializeToString, ), 'MdinclazimWellSurvey_SetRecords': grpc.stream_unary_rpc_method_handler( servicer.MdinclazimWellSurvey_SetRecords, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_SetRecords_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.SerializeToString, ), 'MdinclazimWellSurvey_SetSurveyAsDefinitive': grpc.unary_unary_rpc_method_handler( servicer.MdinclazimWellSurvey_SetSurveyAsDefinitive, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_SetSurveyAsDefinitive_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_SetSurveyAsDefinitive_Response.SerializeToString, ), 'MdinclazimWellSurvey_TieInMd': grpc.unary_unary_rpc_method_handler( servicer.MdinclazimWellSurvey_TieInMd, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_TieInMd_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_TieInMd_Response.SerializeToString, ), 'MdinclazimWellSurvey_SetTieInMd': grpc.unary_unary_rpc_method_handler( servicer.MdinclazimWellSurvey_SetTieInMd, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_SetTieInMd_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_SetTieInMd_Response.SerializeToString, ), 'MdinclazimWellSurvey_IsLateral': grpc.unary_unary_rpc_method_handler( servicer.MdinclazimWellSurvey_IsLateral, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_IsLateral_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_IsLateral_Response.SerializeToString, ), 'MdinclazimWellSurvey_GetParentPythonBoreholeObject': grpc.unary_unary_rpc_method_handler( servicer.MdinclazimWellSurvey_GetParentPythonBoreholeObject, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_GetParentPythonBoreholeObject_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_GetParentPythonBoreholeObject_Response.SerializeToString, ), 'MdinclazimWellSurvey_IsCalculationValid': grpc.unary_unary_rpc_method_handler( servicer.MdinclazimWellSurvey_IsCalculationValid, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'petrelgrpc.PetrelConnection_MdinclazimWellSurvey', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) # This class is part of an EXPERIMENTAL API. class PetrelConnection_MdinclazimWellSurvey(object): """Missing associated documentation comment in .proto file.""" @staticmethod def GetMdinclazimWellSurvey(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_MdinclazimWellSurvey/GetMdinclazimWellSurvey', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def MdinclazimWellSurvey_RecordCount(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_MdinclazimWellSurvey/MdinclazimWellSurvey_RecordCount', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_RecordCount_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_RecordCount_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def MdinclazimWellSurvey_AzimuthReferenceIsGridNorth(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_MdinclazimWellSurvey/MdinclazimWellSurvey_AzimuthReferenceIsGridNorth', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_AzimuthReferenceIsGridNorth_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_AzimuthReferenceIsGridNorth_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def MdinclazimWellSurvey_GetMds(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_MdinclazimWellSurvey/MdinclazimWellSurvey_GetMds', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_GetMds_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_GetMds_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def MdinclazimWellSurvey_GetIncls(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_MdinclazimWellSurvey/MdinclazimWellSurvey_GetIncls', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_GetIncls_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_GetIncls_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def MdinclazimWellSurvey_GetAzims(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_MdinclazimWellSurvey/MdinclazimWellSurvey_GetAzims', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_GetAzims_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_GetAzims_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def MdinclazimWellSurvey_GetXs(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_MdinclazimWellSurvey/MdinclazimWellSurvey_GetXs', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_GetXs_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_GetXs_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def MdinclazimWellSurvey_GetYs(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_MdinclazimWellSurvey/MdinclazimWellSurvey_GetYs', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_GetYs_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_GetYs_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def MdinclazimWellSurvey_GetZs(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_MdinclazimWellSurvey/MdinclazimWellSurvey_GetZs', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_GetZs_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_GetZs_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def MdinclazimWellSurvey_IsAzimuthReferenceGridNorth(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_MdinclazimWellSurvey/MdinclazimWellSurvey_IsAzimuthReferenceGridNorth', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_IsAzimuthReferenceGridNorth_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_IsAzimuthReferenceGridNorth_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def MdinclazimWellSurvey_SetRecords(request_iterator, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.stream_unary(request_iterator, target, '/petrelgrpc.PetrelConnection_MdinclazimWellSurvey/MdinclazimWellSurvey_SetRecords', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_SetRecords_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def MdinclazimWellSurvey_SetSurveyAsDefinitive(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_MdinclazimWellSurvey/MdinclazimWellSurvey_SetSurveyAsDefinitive', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_SetSurveyAsDefinitive_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_SetSurveyAsDefinitive_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def MdinclazimWellSurvey_TieInMd(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_MdinclazimWellSurvey/MdinclazimWellSurvey_TieInMd', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_TieInMd_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_TieInMd_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def MdinclazimWellSurvey_SetTieInMd(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_MdinclazimWellSurvey/MdinclazimWellSurvey_SetTieInMd', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_SetTieInMd_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_SetTieInMd_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def MdinclazimWellSurvey_IsLateral(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_MdinclazimWellSurvey/MdinclazimWellSurvey_IsLateral', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_IsLateral_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_IsLateral_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def MdinclazimWellSurvey_GetParentPythonBoreholeObject(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_MdinclazimWellSurvey/MdinclazimWellSurvey_GetParentPythonBoreholeObject', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_GetParentPythonBoreholeObject_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.MdinclazimWellSurvey_GetParentPythonBoreholeObject_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def MdinclazimWellSurvey_IsCalculationValid(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_MdinclazimWellSurvey/MdinclazimWellSurvey_IsCalculationValid', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) class PetrelConnection_ExplicitWellSurveyStub(object): """Missing associated documentation comment in .proto file.""" def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. """ self.GetExplicitWellSurvey = channel.unary_unary( '/petrelgrpc.PetrelConnection_ExplicitWellSurvey/GetExplicitWellSurvey', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, ) self.ExplicitWellSurvey_RecordCount = channel.unary_unary( '/petrelgrpc.PetrelConnection_ExplicitWellSurvey/ExplicitWellSurvey_RecordCount', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_RecordCount_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_RecordCount_Response.FromString, ) self.ExplicitWellSurvey_GetXs = channel.unary_stream( '/petrelgrpc.PetrelConnection_ExplicitWellSurvey/ExplicitWellSurvey_GetXs', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_GetXs_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_GetXs_Response.FromString, ) self.ExplicitWellSurvey_GetYs = channel.unary_stream( '/petrelgrpc.PetrelConnection_ExplicitWellSurvey/ExplicitWellSurvey_GetYs', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_GetYs_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_GetYs_Response.FromString, ) self.ExplicitWellSurvey_GetZs = channel.unary_stream( '/petrelgrpc.PetrelConnection_ExplicitWellSurvey/ExplicitWellSurvey_GetZs', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_GetZs_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_GetZs_Response.FromString, ) self.ExplicitWellSurvey_GetMds = channel.unary_stream( '/petrelgrpc.PetrelConnection_ExplicitWellSurvey/ExplicitWellSurvey_GetMds', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_GetMds_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_GetMds_Response.FromString, ) self.ExplicitWellSurvey_GetIncls = channel.unary_stream( '/petrelgrpc.PetrelConnection_ExplicitWellSurvey/ExplicitWellSurvey_GetIncls', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_GetIncls_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_GetIncls_Response.FromString, ) self.ExplicitWellSurvey_GetAzims = channel.unary_stream( '/petrelgrpc.PetrelConnection_ExplicitWellSurvey/ExplicitWellSurvey_GetAzims', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_GetAzims_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_GetAzims_Response.FromString, ) self.ExplicitWellSurvey_SetSurveyAsDefinitive = channel.unary_unary( '/petrelgrpc.PetrelConnection_ExplicitWellSurvey/ExplicitWellSurvey_SetSurveyAsDefinitive', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_SetSurveyAsDefinitive_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_SetSurveyAsDefinitive_Response.FromString, ) self.ExplicitWellSurvey_TieInMd = channel.unary_unary( '/petrelgrpc.PetrelConnection_ExplicitWellSurvey/ExplicitWellSurvey_TieInMd', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_TieInMd_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_TieInMd_Response.FromString, ) self.ExplicitWellSurvey_SetTieInMd = channel.unary_unary( '/petrelgrpc.PetrelConnection_ExplicitWellSurvey/ExplicitWellSurvey_SetTieInMd', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_SetTieInMd_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_SetTieInMd_Response.FromString, ) self.ExplicitWellSurvey_IsLateral = channel.unary_unary( '/petrelgrpc.PetrelConnection_ExplicitWellSurvey/ExplicitWellSurvey_IsLateral', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_IsLateral_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_IsLateral_Response.FromString, ) self.ExplicitWellSurvey_GetParentPythonBoreholeObject = channel.unary_unary( '/petrelgrpc.PetrelConnection_ExplicitWellSurvey/ExplicitWellSurvey_GetParentPythonBoreholeObject', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_GetParentPythonBoreholeObject_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_GetParentPythonBoreholeObject_Response.FromString, ) self.ExplicitWellSurvey_IsCalculationValid = channel.unary_unary( '/petrelgrpc.PetrelConnection_ExplicitWellSurvey/ExplicitWellSurvey_IsCalculationValid', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, ) class PetrelConnection_ExplicitWellSurveyServicer(object): """Missing associated documentation comment in .proto file.""" def GetExplicitWellSurvey(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def ExplicitWellSurvey_RecordCount(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def ExplicitWellSurvey_GetXs(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def ExplicitWellSurvey_GetYs(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def ExplicitWellSurvey_GetZs(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def ExplicitWellSurvey_GetMds(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def ExplicitWellSurvey_GetIncls(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def ExplicitWellSurvey_GetAzims(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def ExplicitWellSurvey_SetSurveyAsDefinitive(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def ExplicitWellSurvey_TieInMd(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def ExplicitWellSurvey_SetTieInMd(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def ExplicitWellSurvey_IsLateral(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def ExplicitWellSurvey_GetParentPythonBoreholeObject(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def ExplicitWellSurvey_IsCalculationValid(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def add_PetrelConnection_ExplicitWellSurveyServicer_to_server(servicer, server): rpc_method_handlers = { 'GetExplicitWellSurvey': grpc.unary_unary_rpc_method_handler( servicer.GetExplicitWellSurvey, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.SerializeToString, ), 'ExplicitWellSurvey_RecordCount': grpc.unary_unary_rpc_method_handler( servicer.ExplicitWellSurvey_RecordCount, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_RecordCount_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_RecordCount_Response.SerializeToString, ), 'ExplicitWellSurvey_GetXs': grpc.unary_stream_rpc_method_handler( servicer.ExplicitWellSurvey_GetXs, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_GetXs_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_GetXs_Response.SerializeToString, ), 'ExplicitWellSurvey_GetYs': grpc.unary_stream_rpc_method_handler( servicer.ExplicitWellSurvey_GetYs, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_GetYs_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_GetYs_Response.SerializeToString, ), 'ExplicitWellSurvey_GetZs': grpc.unary_stream_rpc_method_handler( servicer.ExplicitWellSurvey_GetZs, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_GetZs_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_GetZs_Response.SerializeToString, ), 'ExplicitWellSurvey_GetMds': grpc.unary_stream_rpc_method_handler( servicer.ExplicitWellSurvey_GetMds, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_GetMds_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_GetMds_Response.SerializeToString, ), 'ExplicitWellSurvey_GetIncls': grpc.unary_stream_rpc_method_handler( servicer.ExplicitWellSurvey_GetIncls, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_GetIncls_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_GetIncls_Response.SerializeToString, ), 'ExplicitWellSurvey_GetAzims': grpc.unary_stream_rpc_method_handler( servicer.ExplicitWellSurvey_GetAzims, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_GetAzims_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_GetAzims_Response.SerializeToString, ), 'ExplicitWellSurvey_SetSurveyAsDefinitive': grpc.unary_unary_rpc_method_handler( servicer.ExplicitWellSurvey_SetSurveyAsDefinitive, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_SetSurveyAsDefinitive_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_SetSurveyAsDefinitive_Response.SerializeToString, ), 'ExplicitWellSurvey_TieInMd': grpc.unary_unary_rpc_method_handler( servicer.ExplicitWellSurvey_TieInMd, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_TieInMd_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_TieInMd_Response.SerializeToString, ), 'ExplicitWellSurvey_SetTieInMd': grpc.unary_unary_rpc_method_handler( servicer.ExplicitWellSurvey_SetTieInMd, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_SetTieInMd_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_SetTieInMd_Response.SerializeToString, ), 'ExplicitWellSurvey_IsLateral': grpc.unary_unary_rpc_method_handler( servicer.ExplicitWellSurvey_IsLateral, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_IsLateral_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_IsLateral_Response.SerializeToString, ), 'ExplicitWellSurvey_GetParentPythonBoreholeObject': grpc.unary_unary_rpc_method_handler( servicer.ExplicitWellSurvey_GetParentPythonBoreholeObject, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_GetParentPythonBoreholeObject_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_GetParentPythonBoreholeObject_Response.SerializeToString, ), 'ExplicitWellSurvey_IsCalculationValid': grpc.unary_unary_rpc_method_handler( servicer.ExplicitWellSurvey_IsCalculationValid, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'petrelgrpc.PetrelConnection_ExplicitWellSurvey', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) # This class is part of an EXPERIMENTAL API. class PetrelConnection_ExplicitWellSurvey(object): """Missing associated documentation comment in .proto file.""" @staticmethod def GetExplicitWellSurvey(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_ExplicitWellSurvey/GetExplicitWellSurvey', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def ExplicitWellSurvey_RecordCount(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_ExplicitWellSurvey/ExplicitWellSurvey_RecordCount', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_RecordCount_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_RecordCount_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def ExplicitWellSurvey_GetXs(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_ExplicitWellSurvey/ExplicitWellSurvey_GetXs', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_GetXs_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_GetXs_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def ExplicitWellSurvey_GetYs(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_ExplicitWellSurvey/ExplicitWellSurvey_GetYs', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_GetYs_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_GetYs_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def ExplicitWellSurvey_GetZs(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_ExplicitWellSurvey/ExplicitWellSurvey_GetZs', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_GetZs_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_GetZs_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def ExplicitWellSurvey_GetMds(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_ExplicitWellSurvey/ExplicitWellSurvey_GetMds', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_GetMds_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_GetMds_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def ExplicitWellSurvey_GetIncls(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_ExplicitWellSurvey/ExplicitWellSurvey_GetIncls', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_GetIncls_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_GetIncls_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def ExplicitWellSurvey_GetAzims(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_ExplicitWellSurvey/ExplicitWellSurvey_GetAzims', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_GetAzims_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_GetAzims_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def ExplicitWellSurvey_SetSurveyAsDefinitive(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_ExplicitWellSurvey/ExplicitWellSurvey_SetSurveyAsDefinitive', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_SetSurveyAsDefinitive_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_SetSurveyAsDefinitive_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def ExplicitWellSurvey_TieInMd(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_ExplicitWellSurvey/ExplicitWellSurvey_TieInMd', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_TieInMd_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_TieInMd_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def ExplicitWellSurvey_SetTieInMd(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_ExplicitWellSurvey/ExplicitWellSurvey_SetTieInMd', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_SetTieInMd_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_SetTieInMd_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def ExplicitWellSurvey_IsLateral(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_ExplicitWellSurvey/ExplicitWellSurvey_IsLateral', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_IsLateral_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_IsLateral_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def ExplicitWellSurvey_GetParentPythonBoreholeObject(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_ExplicitWellSurvey/ExplicitWellSurvey_GetParentPythonBoreholeObject', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_GetParentPythonBoreholeObject_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ExplicitWellSurvey_GetParentPythonBoreholeObject_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def ExplicitWellSurvey_IsCalculationValid(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_ExplicitWellSurvey/ExplicitWellSurvey_IsCalculationValid', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoBool.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) class PetrelConnection_HorizonInterpretationStub(object): """Missing associated documentation comment in .proto file.""" def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. """ self.GetHorizonInterpretation = channel.unary_unary( '/petrelgrpc.PetrelConnection_HorizonInterpretation/GetHorizonInterpretation', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, ) self.HorizonInterpretation_GetHorizonInterpretation3dObjects = channel.unary_stream( '/petrelgrpc.PetrelConnection_HorizonInterpretation/HorizonInterpretation_GetHorizonInterpretation3dObjects', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonInterpretation_GetHorizonInterpretation3dObjects_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonInterpretation_GetHorizonInterpretation3dObjects_Response.FromString, ) class PetrelConnection_HorizonInterpretationServicer(object): """Missing associated documentation comment in .proto file.""" def GetHorizonInterpretation(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def HorizonInterpretation_GetHorizonInterpretation3dObjects(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def add_PetrelConnection_HorizonInterpretationServicer_to_server(servicer, server): rpc_method_handlers = { 'GetHorizonInterpretation': grpc.unary_unary_rpc_method_handler( servicer.GetHorizonInterpretation, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.SerializeToString, ), 'HorizonInterpretation_GetHorizonInterpretation3dObjects': grpc.unary_stream_rpc_method_handler( servicer.HorizonInterpretation_GetHorizonInterpretation3dObjects, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonInterpretation_GetHorizonInterpretation3dObjects_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonInterpretation_GetHorizonInterpretation3dObjects_Response.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'petrelgrpc.PetrelConnection_HorizonInterpretation', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) # This class is part of an EXPERIMENTAL API. class PetrelConnection_HorizonInterpretation(object): """Missing associated documentation comment in .proto file.""" @staticmethod def GetHorizonInterpretation(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_HorizonInterpretation/GetHorizonInterpretation', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def HorizonInterpretation_GetHorizonInterpretation3dObjects(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_HorizonInterpretation/HorizonInterpretation_GetHorizonInterpretation3dObjects', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonInterpretation_GetHorizonInterpretation3dObjects_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.HorizonInterpretation_GetHorizonInterpretation3dObjects_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) class PetrelConnection_ReferenceVariableStub(object): """Missing associated documentation comment in .proto file.""" def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. """ self.GetReferenceVariable = channel.unary_unary( '/petrelgrpc.PetrelConnection_ReferenceVariable/GetReferenceVariable', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, ) self.ReferenceVariable_IsGood = channel.unary_unary( '/petrelgrpc.PetrelConnection_ReferenceVariable/ReferenceVariable_IsGood', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ReferenceVariable_IsGood_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ReferenceVariable_IsGood_Response.FromString, ) class PetrelConnection_ReferenceVariableServicer(object): """Missing associated documentation comment in .proto file.""" def GetReferenceVariable(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def ReferenceVariable_IsGood(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def add_PetrelConnection_ReferenceVariableServicer_to_server(servicer, server): rpc_method_handlers = { 'GetReferenceVariable': grpc.unary_unary_rpc_method_handler( servicer.GetReferenceVariable, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.SerializeToString, ), 'ReferenceVariable_IsGood': grpc.unary_unary_rpc_method_handler( servicer.ReferenceVariable_IsGood, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ReferenceVariable_IsGood_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ReferenceVariable_IsGood_Response.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'petrelgrpc.PetrelConnection_ReferenceVariable', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) # This class is part of an EXPERIMENTAL API. class PetrelConnection_ReferenceVariable(object): """Missing associated documentation comment in .proto file.""" @staticmethod def GetReferenceVariable(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_ReferenceVariable/GetReferenceVariable', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def ReferenceVariable_IsGood(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_ReferenceVariable/ReferenceVariable_IsGood', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ReferenceVariable_IsGood_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ReferenceVariable_IsGood_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) class PetrelConnection_WorkflowStub(object): """Missing associated documentation comment in .proto file.""" def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. """ self.GetWorkflow = channel.unary_unary( '/petrelgrpc.PetrelConnection_Workflow/GetWorkflow', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, ) self.Workflow_GetWorkflowInputReferences = channel.unary_stream( '/petrelgrpc.PetrelConnection_Workflow/Workflow_GetWorkflowInputReferences', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Workflow_GetWorkflowInputReferences_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Workflow_GetWorkflowInputReferences_Response.FromString, ) self.Workflow_GetWorkflowOutputReferences = channel.unary_stream( '/petrelgrpc.PetrelConnection_Workflow/Workflow_GetWorkflowOutputReferences', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Workflow_GetWorkflowOutputReferences_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Workflow_GetWorkflowOutputReferences_Response.FromString, ) self.Workflow_RunSingle = channel.unary_unary( '/petrelgrpc.PetrelConnection_Workflow/Workflow_RunSingle', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Workflow_RunSingle_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Workflow_RunSingle_Response.FromString, ) class PetrelConnection_WorkflowServicer(object): """Missing associated documentation comment in .proto file.""" def GetWorkflow(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Workflow_GetWorkflowInputReferences(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Workflow_GetWorkflowOutputReferences(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Workflow_RunSingle(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def add_PetrelConnection_WorkflowServicer_to_server(servicer, server): rpc_method_handlers = { 'GetWorkflow': grpc.unary_unary_rpc_method_handler( servicer.GetWorkflow, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.SerializeToString, ), 'Workflow_GetWorkflowInputReferences': grpc.unary_stream_rpc_method_handler( servicer.Workflow_GetWorkflowInputReferences, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Workflow_GetWorkflowInputReferences_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Workflow_GetWorkflowInputReferences_Response.SerializeToString, ), 'Workflow_GetWorkflowOutputReferences': grpc.unary_stream_rpc_method_handler( servicer.Workflow_GetWorkflowOutputReferences, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Workflow_GetWorkflowOutputReferences_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Workflow_GetWorkflowOutputReferences_Response.SerializeToString, ), 'Workflow_RunSingle': grpc.unary_unary_rpc_method_handler( servicer.Workflow_RunSingle, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Workflow_RunSingle_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Workflow_RunSingle_Response.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'petrelgrpc.PetrelConnection_Workflow', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) # This class is part of an EXPERIMENTAL API. class PetrelConnection_Workflow(object): """Missing associated documentation comment in .proto file.""" @staticmethod def GetWorkflow(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Workflow/GetWorkflow', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Workflow_GetWorkflowInputReferences(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_Workflow/Workflow_GetWorkflowInputReferences', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Workflow_GetWorkflowInputReferences_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Workflow_GetWorkflowInputReferences_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Workflow_GetWorkflowOutputReferences(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_Workflow/Workflow_GetWorkflowOutputReferences', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Workflow_GetWorkflowOutputReferences_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Workflow_GetWorkflowOutputReferences_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Workflow_RunSingle(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Workflow/Workflow_RunSingle', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Workflow_RunSingle_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Workflow_RunSingle_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) class PetrelConnection_ObservedDataStub(object): """Missing associated documentation comment in .proto file.""" def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. """ self.GetObservedData = channel.unary_unary( '/petrelgrpc.PetrelConnection_ObservedData/GetObservedData', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, ) self.ObservedData_SetValues = channel.stream_unary( '/petrelgrpc.PetrelConnection_ObservedData/ObservedData_SetValues', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ObservedData_SetValues_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ObservedData_SetValues_Response.FromString, ) self.ObservedData_GetValues = channel.unary_stream( '/petrelgrpc.PetrelConnection_ObservedData/ObservedData_GetValues', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ObservedData_GetValues_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ObservedData_GetValues_Response.FromString, ) self.ObservedData_DisplayUnitSymbol = channel.unary_unary( '/petrelgrpc.PetrelConnection_ObservedData/ObservedData_DisplayUnitSymbol', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.FromString, ) self.ObservedData_GetParentObservedDataSet = channel.unary_unary( '/petrelgrpc.PetrelConnection_ObservedData/ObservedData_GetParentObservedDataSet', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ObservedData_GetParent_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ObservedData_GetParent_Response.FromString, ) class PetrelConnection_ObservedDataServicer(object): """Missing associated documentation comment in .proto file.""" def GetObservedData(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def ObservedData_SetValues(self, request_iterator, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def ObservedData_GetValues(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def ObservedData_DisplayUnitSymbol(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def ObservedData_GetParentObservedDataSet(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def add_PetrelConnection_ObservedDataServicer_to_server(servicer, server): rpc_method_handlers = { 'GetObservedData': grpc.unary_unary_rpc_method_handler( servicer.GetObservedData, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.SerializeToString, ), 'ObservedData_SetValues': grpc.stream_unary_rpc_method_handler( servicer.ObservedData_SetValues, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ObservedData_SetValues_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ObservedData_SetValues_Response.SerializeToString, ), 'ObservedData_GetValues': grpc.unary_stream_rpc_method_handler( servicer.ObservedData_GetValues, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ObservedData_GetValues_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ObservedData_GetValues_Response.SerializeToString, ), 'ObservedData_DisplayUnitSymbol': grpc.unary_unary_rpc_method_handler( servicer.ObservedData_DisplayUnitSymbol, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.SerializeToString, ), 'ObservedData_GetParentObservedDataSet': grpc.unary_unary_rpc_method_handler( servicer.ObservedData_GetParentObservedDataSet, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ObservedData_GetParent_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ObservedData_GetParent_Response.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'petrelgrpc.PetrelConnection_ObservedData', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) # This class is part of an EXPERIMENTAL API. class PetrelConnection_ObservedData(object): """Missing associated documentation comment in .proto file.""" @staticmethod def GetObservedData(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_ObservedData/GetObservedData', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def ObservedData_SetValues(request_iterator, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.stream_unary(request_iterator, target, '/petrelgrpc.PetrelConnection_ObservedData/ObservedData_SetValues', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ObservedData_SetValues_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ObservedData_SetValues_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def ObservedData_GetValues(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_ObservedData/ObservedData_GetValues', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ObservedData_GetValues_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ObservedData_GetValues_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def ObservedData_DisplayUnitSymbol(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_ObservedData/ObservedData_DisplayUnitSymbol', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def ObservedData_GetParentObservedDataSet(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_ObservedData/ObservedData_GetParentObservedDataSet', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ObservedData_GetParent_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ObservedData_GetParent_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) class PetrelConnection_ObservedDataSetStub(object): """Missing associated documentation comment in .proto file.""" def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. """ self.GetObservedDataSet = channel.unary_unary( '/petrelgrpc.PetrelConnection_ObservedDataSet/GetObservedDataSet', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, ) self.ObservedDataSet_GetObservedDataObjects = channel.unary_stream( '/petrelgrpc.PetrelConnection_ObservedDataSet/ObservedDataSet_GetObservedDataObjects', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ObservedDataSet_GetObservedDataObjects_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ObservedDataSet_GetObservedDataObjects_Response.FromString, ) self.ObservedDataSet_GetNumberOfObservedDataObjects = channel.unary_unary( '/petrelgrpc.PetrelConnection_ObservedDataSet/ObservedDataSet_GetNumberOfObservedDataObjects', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ObservedDataSet_GetNumberOfObservedDataObjects_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ObservedDataSet_GetNumberOfObservedDataObjects_Response.FromString, ) self.ObservedDataSet_GetDates = channel.unary_stream( '/petrelgrpc.PetrelConnection_ObservedDataSet/ObservedDataSet_GetDates', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ObservedDataSet_GetDates_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ObservedDataSet_GetDates_Response.FromString, ) self.ObservedDataSet_Append = channel.stream_unary( '/petrelgrpc.PetrelConnection_ObservedDataSet/ObservedDataSet_Append', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ObservedDataSet_Append_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ObservedDataSet_Append_Response.FromString, ) self.ObservedDataSet_CreateObservedData = channel.stream_unary( '/petrelgrpc.PetrelConnection_ObservedDataSet/ObservedDataSet_CreateObservedData', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ObservedDataSet_CreateObservedData_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ObservedDataSet_CreateObservedData_Response.FromString, ) self.ObservedDataSet_GetParentPythonBoreholeObject = channel.unary_unary( '/petrelgrpc.PetrelConnection_ObservedDataSet/ObservedDataSet_GetParentPythonBoreholeObject', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ObservedDataSet_GetParentPythonBoreholeObject_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ObservedDataSet_GetParentPythonBoreholeObject_Response.FromString, ) class PetrelConnection_ObservedDataSetServicer(object): """Missing associated documentation comment in .proto file.""" def GetObservedDataSet(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def ObservedDataSet_GetObservedDataObjects(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def ObservedDataSet_GetNumberOfObservedDataObjects(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def ObservedDataSet_GetDates(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def ObservedDataSet_Append(self, request_iterator, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def ObservedDataSet_CreateObservedData(self, request_iterator, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def ObservedDataSet_GetParentPythonBoreholeObject(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def add_PetrelConnection_ObservedDataSetServicer_to_server(servicer, server): rpc_method_handlers = { 'GetObservedDataSet': grpc.unary_unary_rpc_method_handler( servicer.GetObservedDataSet, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.SerializeToString, ), 'ObservedDataSet_GetObservedDataObjects': grpc.unary_stream_rpc_method_handler( servicer.ObservedDataSet_GetObservedDataObjects, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ObservedDataSet_GetObservedDataObjects_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ObservedDataSet_GetObservedDataObjects_Response.SerializeToString, ), 'ObservedDataSet_GetNumberOfObservedDataObjects': grpc.unary_unary_rpc_method_handler( servicer.ObservedDataSet_GetNumberOfObservedDataObjects, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ObservedDataSet_GetNumberOfObservedDataObjects_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ObservedDataSet_GetNumberOfObservedDataObjects_Response.SerializeToString, ), 'ObservedDataSet_GetDates': grpc.unary_stream_rpc_method_handler( servicer.ObservedDataSet_GetDates, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ObservedDataSet_GetDates_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ObservedDataSet_GetDates_Response.SerializeToString, ), 'ObservedDataSet_Append': grpc.stream_unary_rpc_method_handler( servicer.ObservedDataSet_Append, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ObservedDataSet_Append_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ObservedDataSet_Append_Response.SerializeToString, ), 'ObservedDataSet_CreateObservedData': grpc.stream_unary_rpc_method_handler( servicer.ObservedDataSet_CreateObservedData, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ObservedDataSet_CreateObservedData_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ObservedDataSet_CreateObservedData_Response.SerializeToString, ), 'ObservedDataSet_GetParentPythonBoreholeObject': grpc.unary_unary_rpc_method_handler( servicer.ObservedDataSet_GetParentPythonBoreholeObject, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ObservedDataSet_GetParentPythonBoreholeObject_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ObservedDataSet_GetParentPythonBoreholeObject_Response.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'petrelgrpc.PetrelConnection_ObservedDataSet', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) # This class is part of an EXPERIMENTAL API. class PetrelConnection_ObservedDataSet(object): """Missing associated documentation comment in .proto file.""" @staticmethod def GetObservedDataSet(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_ObservedDataSet/GetObservedDataSet', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def ObservedDataSet_GetObservedDataObjects(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_ObservedDataSet/ObservedDataSet_GetObservedDataObjects', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ObservedDataSet_GetObservedDataObjects_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ObservedDataSet_GetObservedDataObjects_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def ObservedDataSet_GetNumberOfObservedDataObjects(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_ObservedDataSet/ObservedDataSet_GetNumberOfObservedDataObjects', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ObservedDataSet_GetNumberOfObservedDataObjects_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ObservedDataSet_GetNumberOfObservedDataObjects_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def ObservedDataSet_GetDates(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/petrelgrpc.PetrelConnection_ObservedDataSet/ObservedDataSet_GetDates', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ObservedDataSet_GetDates_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ObservedDataSet_GetDates_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def ObservedDataSet_Append(request_iterator, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.stream_unary(request_iterator, target, '/petrelgrpc.PetrelConnection_ObservedDataSet/ObservedDataSet_Append', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ObservedDataSet_Append_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ObservedDataSet_Append_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def ObservedDataSet_CreateObservedData(request_iterator, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.stream_unary(request_iterator, target, '/petrelgrpc.PetrelConnection_ObservedDataSet/ObservedDataSet_CreateObservedData', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ObservedDataSet_CreateObservedData_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ObservedDataSet_CreateObservedData_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def ObservedDataSet_GetParentPythonBoreholeObject(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_ObservedDataSet/ObservedDataSet_GetParentPythonBoreholeObject', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ObservedDataSet_GetParentPythonBoreholeObject_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ObservedDataSet_GetParentPythonBoreholeObject_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) class PetrelConnection_ZoneStub(object): """Missing associated documentation comment in .proto file.""" def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. """ self.GetZone = channel.unary_unary( '/petrelgrpc.PetrelConnection_Zone/GetZone', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, ) self.Zone_GetParentGrid = channel.unary_unary( '/petrelgrpc.PetrelConnection_Zone/Zone_GetParentGrid', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Zone_GetParentGrid_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Zone_GetParentGrid_Response.FromString, ) self.Zone_GetBaseK = channel.unary_unary( '/petrelgrpc.PetrelConnection_Zone/Zone_GetBaseK', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Zone_GetBaseK_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Zone_GetBaseK_Response.FromString, ) self.Zone_GetTopK = channel.unary_unary( '/petrelgrpc.PetrelConnection_Zone/Zone_GetTopK', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Zone_GetTopK_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Zone_GetTopK_Response.FromString, ) self.Zone_GetNumberOfZones = channel.unary_unary( '/petrelgrpc.PetrelConnection_Zone/Zone_GetNumberOfZones', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Zone_GetNumberOfZones_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Zone_GetNumberOfZones_Response.FromString, ) self.Zone_GetZones = channel.unary_unary( '/petrelgrpc.PetrelConnection_Zone/Zone_GetZones', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Zone_GetZones_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Zone_GetZones_Response.FromString, ) self.Zone_GetParentZone = channel.unary_unary( '/petrelgrpc.PetrelConnection_Zone/Zone_GetParentZone', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Zone_GetParentZone_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Zone_GetParentZone_Response.FromString, ) class PetrelConnection_ZoneServicer(object): """Missing associated documentation comment in .proto file.""" def GetZone(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Zone_GetParentGrid(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Zone_GetBaseK(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Zone_GetTopK(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Zone_GetNumberOfZones(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Zone_GetZones(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Zone_GetParentZone(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def add_PetrelConnection_ZoneServicer_to_server(servicer, server): rpc_method_handlers = { 'GetZone': grpc.unary_unary_rpc_method_handler( servicer.GetZone, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.SerializeToString, ), 'Zone_GetParentGrid': grpc.unary_unary_rpc_method_handler( servicer.Zone_GetParentGrid, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Zone_GetParentGrid_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Zone_GetParentGrid_Response.SerializeToString, ), 'Zone_GetBaseK': grpc.unary_unary_rpc_method_handler( servicer.Zone_GetBaseK, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Zone_GetBaseK_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Zone_GetBaseK_Response.SerializeToString, ), 'Zone_GetTopK': grpc.unary_unary_rpc_method_handler( servicer.Zone_GetTopK, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Zone_GetTopK_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Zone_GetTopK_Response.SerializeToString, ), 'Zone_GetNumberOfZones': grpc.unary_unary_rpc_method_handler( servicer.Zone_GetNumberOfZones, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Zone_GetNumberOfZones_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Zone_GetNumberOfZones_Response.SerializeToString, ), 'Zone_GetZones': grpc.unary_unary_rpc_method_handler( servicer.Zone_GetZones, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Zone_GetZones_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Zone_GetZones_Response.SerializeToString, ), 'Zone_GetParentZone': grpc.unary_unary_rpc_method_handler( servicer.Zone_GetParentZone, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Zone_GetParentZone_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Zone_GetParentZone_Response.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'petrelgrpc.PetrelConnection_Zone', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) # This class is part of an EXPERIMENTAL API. class PetrelConnection_Zone(object): """Missing associated documentation comment in .proto file.""" @staticmethod def GetZone(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Zone/GetZone', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Zone_GetParentGrid(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Zone/Zone_GetParentGrid', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Zone_GetParentGrid_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Zone_GetParentGrid_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Zone_GetBaseK(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Zone/Zone_GetBaseK', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Zone_GetBaseK_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Zone_GetBaseK_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Zone_GetTopK(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Zone/Zone_GetTopK', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Zone_GetTopK_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Zone_GetTopK_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Zone_GetNumberOfZones(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Zone/Zone_GetNumberOfZones', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Zone_GetNumberOfZones_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Zone_GetNumberOfZones_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Zone_GetZones(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Zone/Zone_GetZones', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Zone_GetZones_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Zone_GetZones_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Zone_GetParentZone(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Zone/Zone_GetParentZone', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Zone_GetParentZone_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Zone_GetParentZone_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) class PetrelConnection_SegmentStub(object): """Missing associated documentation comment in .proto file.""" def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. """ self.GetSegment = channel.unary_unary( '/petrelgrpc.PetrelConnection_Segment/GetSegment', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, ) self.Segment_GetParentGrid = channel.unary_unary( '/petrelgrpc.PetrelConnection_Segment/Segment_GetParentGrid', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Segment_GetParentGrid_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Segment_GetParentGrid_Response.FromString, ) self.Segment_GetCells = channel.unary_unary( '/petrelgrpc.PetrelConnection_Segment/Segment_GetCells', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Segment_GetCells_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Indices2Array.FromString, ) self.Segment_IsCellInside = channel.unary_unary( '/petrelgrpc.PetrelConnection_Segment/Segment_IsCellInside', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Segment_IsCellInside_Request.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Segment_IsCellInside_Response.FromString, ) class PetrelConnection_SegmentServicer(object): """Missing associated documentation comment in .proto file.""" def GetSegment(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Segment_GetParentGrid(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Segment_GetCells(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Segment_IsCellInside(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def add_PetrelConnection_SegmentServicer_to_server(servicer, server): rpc_method_handlers = { 'GetSegment': grpc.unary_unary_rpc_method_handler( servicer.GetSegment, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.SerializeToString, ), 'Segment_GetParentGrid': grpc.unary_unary_rpc_method_handler( servicer.Segment_GetParentGrid, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Segment_GetParentGrid_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Segment_GetParentGrid_Response.SerializeToString, ), 'Segment_GetCells': grpc.unary_unary_rpc_method_handler( servicer.Segment_GetCells, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Segment_GetCells_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Indices2Array.SerializeToString, ), 'Segment_IsCellInside': grpc.unary_unary_rpc_method_handler( servicer.Segment_IsCellInside, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Segment_IsCellInside_Request.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Segment_IsCellInside_Response.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'petrelgrpc.PetrelConnection_Segment', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) # This class is part of an EXPERIMENTAL API. class PetrelConnection_Segment(object): """Missing associated documentation comment in .proto file.""" @staticmethod def GetSegment(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Segment/GetSegment', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Segment_GetParentGrid(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Segment/Segment_GetParentGrid', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Segment_GetParentGrid_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Segment_GetParentGrid_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Segment_GetCells(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Segment/Segment_GetCells', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Segment_GetCells_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Indices2Array.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Segment_IsCellInside(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Segment/Segment_IsCellInside', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Segment_IsCellInside_Request.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Segment_IsCellInside_Response.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) class PetrelConnection_TemplateStub(object): """Missing associated documentation comment in .proto file.""" def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. """ self.GetTemplate = channel.unary_unary( '/petrelgrpc.PetrelConnection_Template/GetTemplate', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, ) self.Template_DisplayUnitSymbol = channel.unary_unary( '/petrelgrpc.PetrelConnection_Template/Template_DisplayUnitSymbol', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.FromString, ) self.Template_Units = channel.unary_unary( '/petrelgrpc.PetrelConnection_Template/Template_Units', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.StringArray.FromString, ) class PetrelConnection_TemplateServicer(object): """Missing associated documentation comment in .proto file.""" def GetTemplate(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Template_DisplayUnitSymbol(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Template_Units(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def add_PetrelConnection_TemplateServicer_to_server(servicer, server): rpc_method_handlers = { 'GetTemplate': grpc.unary_unary_rpc_method_handler( servicer.GetTemplate, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.SerializeToString, ), 'Template_DisplayUnitSymbol': grpc.unary_unary_rpc_method_handler( servicer.Template_DisplayUnitSymbol, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.SerializeToString, ), 'Template_Units': grpc.unary_unary_rpc_method_handler( servicer.Template_Units, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.StringArray.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'petrelgrpc.PetrelConnection_Template', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) # This class is part of an EXPERIMENTAL API. class PetrelConnection_Template(object): """Missing associated documentation comment in .proto file.""" @staticmethod def GetTemplate(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Template/GetTemplate', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Template_DisplayUnitSymbol(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Template/Template_DisplayUnitSymbol', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.ProtoString.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Template_Units(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_Template/Template_Units', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.Primitives.StringArray.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) class PetrelConnection_DiscreteTemplateStub(object): """Missing associated documentation comment in .proto file.""" def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. """ self.GetDiscreteTemplate = channel.unary_unary( '/petrelgrpc.PetrelConnection_DiscreteTemplate/GetDiscreteTemplate', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, ) self.DiscreteTemplate_GetAllDictionaryCodes = channel.unary_unary( '/petrelgrpc.PetrelConnection_DiscreteTemplate/DiscreteTemplate_GetAllDictionaryCodes', request_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, response_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.IntStringTuples.FromString, ) class PetrelConnection_DiscreteTemplateServicer(object): """Missing associated documentation comment in .proto file.""" def GetDiscreteTemplate(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def DiscreteTemplate_GetAllDictionaryCodes(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def add_PetrelConnection_DiscreteTemplateServicer_to_server(servicer, server): rpc_method_handlers = { 'GetDiscreteTemplate': grpc.unary_unary_rpc_method_handler( servicer.GetDiscreteTemplate, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.SerializeToString, ), 'DiscreteTemplate_GetAllDictionaryCodes': grpc.unary_unary_rpc_method_handler( servicer.DiscreteTemplate_GetAllDictionaryCodes, request_deserializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.FromString, response_serializer=cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.IntStringTuples.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'petrelgrpc.PetrelConnection_DiscreteTemplate', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) # This class is part of an EXPERIMENTAL API. class PetrelConnection_DiscreteTemplate(object): """Missing associated documentation comment in .proto file.""" @staticmethod def GetDiscreteTemplate(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_DiscreteTemplate/GetDiscreteTemplate', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRequest.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectRef.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def DiscreteTemplate_GetAllDictionaryCodes(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/petrelgrpc.PetrelConnection_DiscreteTemplate/DiscreteTemplate_GetAllDictionaryCodes', cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.PetrelObjectGuid.SerializeToString, cegalprizm_dot_pythontool_dot_grpc_dot_petrelinterface__pb2.IntStringTuples.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
PypiClean
/pulumi_gcp_native-0.0.2a1617829075.tar.gz/pulumi_gcp_native-0.0.2a1617829075/pulumi_gcp_native/healthcare/v1beta1/dataset_consent_store.py
import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union from ... import _utilities, _tables __all__ = ['DatasetConsentStore'] class DatasetConsentStore(pulumi.CustomResource): def __init__(__self__, resource_name: str, opts: Optional[pulumi.ResourceOptions] = None, consent_stores_id: Optional[pulumi.Input[str]] = None, datasets_id: Optional[pulumi.Input[str]] = None, default_consent_ttl: Optional[pulumi.Input[str]] = None, enable_consent_create_on_update: Optional[pulumi.Input[bool]] = None, labels: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None, locations_id: Optional[pulumi.Input[str]] = None, name: Optional[pulumi.Input[str]] = None, projects_id: Optional[pulumi.Input[str]] = None, __props__=None, __name__=None, __opts__=None): """ Creates a new consent store in the parent dataset. Attempting to create a consent store with the same ID as an existing store fails with an ALREADY_EXISTS error. :param str resource_name: The name of the resource. :param pulumi.ResourceOptions opts: Options for the resource. :param pulumi.Input[str] default_consent_ttl: Optional. Default time to live for Consents created in this store. Must be at least 24 hours. Updating this field will not affect the expiration time of existing consents. :param pulumi.Input[bool] enable_consent_create_on_update: Optional. If `true`, UpdateConsent creates the Consent if it does not already exist. If unspecified, defaults to `false`. :param pulumi.Input[Mapping[str, pulumi.Input[str]]] labels: Optional. User-supplied key-value pairs used to organize consent stores. Label keys must be between 1 and 63 characters long, have a UTF-8 encoding of maximum 128 bytes, and must conform to the following PCRE regular expression: \p{Ll}\p{Lo}{0,62}. Label values must be between 1 and 63 characters long, have a UTF-8 encoding of maximum 128 bytes, and must conform to the following PCRE regular expression: [\p{Ll}\p{Lo}\p{N}_-]{0,63}. No more than 64 labels can be associated with a given store. For more information: https://cloud.google.com/healthcare/docs/how-tos/labeling-resources :param pulumi.Input[str] name: Resource name of the consent store, of the form `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/consentStores/{consent_store_id}`. Cannot be changed after creation. """ if __name__ is not None: warnings.warn("explicit use of __name__ is deprecated", DeprecationWarning) resource_name = __name__ if __opts__ is not None: warnings.warn("explicit use of __opts__ is deprecated, use 'opts' instead", DeprecationWarning) opts = __opts__ if opts is None: opts = pulumi.ResourceOptions() if not isinstance(opts, pulumi.ResourceOptions): raise TypeError('Expected resource options to be a ResourceOptions instance') if opts.version is None: opts.version = _utilities.get_version() if opts.id is None: if __props__ is not None: raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') __props__ = dict() if consent_stores_id is None and not opts.urn: raise TypeError("Missing required property 'consent_stores_id'") __props__['consent_stores_id'] = consent_stores_id if datasets_id is None and not opts.urn: raise TypeError("Missing required property 'datasets_id'") __props__['datasets_id'] = datasets_id __props__['default_consent_ttl'] = default_consent_ttl __props__['enable_consent_create_on_update'] = enable_consent_create_on_update __props__['labels'] = labels if locations_id is None and not opts.urn: raise TypeError("Missing required property 'locations_id'") __props__['locations_id'] = locations_id __props__['name'] = name if projects_id is None and not opts.urn: raise TypeError("Missing required property 'projects_id'") __props__['projects_id'] = projects_id super(DatasetConsentStore, __self__).__init__( 'gcp-native:healthcare/v1beta1:DatasetConsentStore', resource_name, __props__, opts) @staticmethod def get(resource_name: str, id: pulumi.Input[str], opts: Optional[pulumi.ResourceOptions] = None) -> 'DatasetConsentStore': """ Get an existing DatasetConsentStore resource's state with the given name, id, and optional extra properties used to qualify the lookup. :param str resource_name: The unique name of the resulting resource. :param pulumi.Input[str] id: The unique provider ID of the resource to lookup. :param pulumi.ResourceOptions opts: Options for the resource. """ opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id)) __props__ = dict() __props__["default_consent_ttl"] = None __props__["enable_consent_create_on_update"] = None __props__["labels"] = None __props__["name"] = None return DatasetConsentStore(resource_name, opts=opts, __props__=__props__) @property @pulumi.getter(name="defaultConsentTtl") def default_consent_ttl(self) -> pulumi.Output[str]: """ Optional. Default time to live for Consents created in this store. Must be at least 24 hours. Updating this field will not affect the expiration time of existing consents. """ return pulumi.get(self, "default_consent_ttl") @property @pulumi.getter(name="enableConsentCreateOnUpdate") def enable_consent_create_on_update(self) -> pulumi.Output[bool]: """ Optional. If `true`, UpdateConsent creates the Consent if it does not already exist. If unspecified, defaults to `false`. """ return pulumi.get(self, "enable_consent_create_on_update") @property @pulumi.getter def labels(self) -> pulumi.Output[Mapping[str, str]]: """ Optional. User-supplied key-value pairs used to organize consent stores. Label keys must be between 1 and 63 characters long, have a UTF-8 encoding of maximum 128 bytes, and must conform to the following PCRE regular expression: \p{Ll}\p{Lo}{0,62}. Label values must be between 1 and 63 characters long, have a UTF-8 encoding of maximum 128 bytes, and must conform to the following PCRE regular expression: [\p{Ll}\p{Lo}\p{N}_-]{0,63}. No more than 64 labels can be associated with a given store. For more information: https://cloud.google.com/healthcare/docs/how-tos/labeling-resources """ return pulumi.get(self, "labels") @property @pulumi.getter def name(self) -> pulumi.Output[str]: """ Resource name of the consent store, of the form `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/consentStores/{consent_store_id}`. Cannot be changed after creation. """ return pulumi.get(self, "name") def translate_output_property(self, prop): return _tables.CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop def translate_input_property(self, prop): return _tables.SNAKE_TO_CAMEL_CASE_TABLE.get(prop) or prop
PypiClean
/kubernetes-async-patch-4.0.1.tar.gz/kubernetes-async-patch-4.0.1/kubernetes/stream/ws_client.py
from kubernetes.client.rest import ApiException import select import certifi import time import collections from websocket import WebSocket, ABNF, enableTrace import six import ssl from six.moves.urllib.parse import urlencode, quote_plus, urlparse, urlunparse STDIN_CHANNEL = 0 STDOUT_CHANNEL = 1 STDERR_CHANNEL = 2 ERROR_CHANNEL = 3 RESIZE_CHANNEL = 4 class WSClient: def __init__(self, configuration, url, headers): """A websocket client with support for channels. Exec command uses different channels for different streams. for example, 0 is stdin, 1 is stdout and 2 is stderr. Some other API calls like port forwarding can forward different pods' streams to different channels. """ enableTrace(False) header = [] self._connected = False self._channels = {} self._all = "" # We just need to pass the Authorization, ignore all the other # http headers we get from the generated code if headers and 'authorization' in headers: header.append("authorization: %s" % headers['authorization']) if headers and 'sec-websocket-protocol' in headers: header.append("sec-websocket-protocol: %s" % headers['sec-websocket-protocol']) else: header.append("sec-websocket-protocol: v4.channel.k8s.io") if url.startswith('wss://') and configuration.verify_ssl: ssl_opts = { 'cert_reqs': ssl.CERT_REQUIRED, 'ca_certs': configuration.ssl_ca_cert or certifi.where(), } if configuration.assert_hostname is not None: ssl_opts['check_hostname'] = configuration.assert_hostname else: ssl_opts = {'cert_reqs': ssl.CERT_NONE} if configuration.cert_file: ssl_opts['certfile'] = configuration.cert_file if configuration.key_file: ssl_opts['keyfile'] = configuration.key_file self.sock = WebSocket(sslopt=ssl_opts, skip_utf8_validation=False) self.sock.connect(url, header=header) self._connected = True def peek_channel(self, channel, timeout=0): """Peek a channel and return part of the input, empty string otherwise.""" self.update(timeout=timeout) if channel in self._channels: return self._channels[channel] return "" def read_channel(self, channel, timeout=0): """Read data from a channel.""" if channel not in self._channels: ret = self.peek_channel(channel, timeout) else: ret = self._channels[channel] if channel in self._channels: del self._channels[channel] return ret def readline_channel(self, channel, timeout=None): """Read a line from a channel.""" if timeout is None: timeout = float("inf") start = time.time() while self.is_open() and time.time() - start < timeout: if channel in self._channels: data = self._channels[channel] if "\n" in data: index = data.find("\n") ret = data[:index] data = data[index+1:] if data: self._channels[channel] = data else: del self._channels[channel] return ret self.update(timeout=(timeout - time.time() + start)) def write_channel(self, channel, data): """Write data to a channel.""" self.sock.send(chr(channel) + data) def peek_stdout(self, timeout=0): """Same as peek_channel with channel=1.""" return self.peek_channel(STDOUT_CHANNEL, timeout=timeout) def read_stdout(self, timeout=None): """Same as read_channel with channel=1.""" return self.read_channel(STDOUT_CHANNEL, timeout=timeout) def readline_stdout(self, timeout=None): """Same as readline_channel with channel=1.""" return self.readline_channel(STDOUT_CHANNEL, timeout=timeout) def peek_stderr(self, timeout=0): """Same as peek_channel with channel=2.""" return self.peek_channel(STDERR_CHANNEL, timeout=timeout) def read_stderr(self, timeout=None): """Same as read_channel with channel=2.""" return self.read_channel(STDERR_CHANNEL, timeout=timeout) def readline_stderr(self, timeout=None): """Same as readline_channel with channel=2.""" return self.readline_channel(STDERR_CHANNEL, timeout=timeout) def read_all(self): """Return buffered data received on stdout and stderr channels. This is useful for non-interactive call where a set of command passed to the API call and their result is needed after the call is concluded. Should be called after run_forever() or update() TODO: Maybe we can process this and return a more meaningful map with channels mapped for each input. """ out = self._all self._all = "" self._channels = {} return out def is_open(self): """True if the connection is still alive.""" return self._connected def write_stdin(self, data): """The same as write_channel with channel=0.""" self.write_channel(STDIN_CHANNEL, data) def update(self, timeout=0): """Update channel buffers with at most one complete frame of input.""" if not self.is_open(): return if not self.sock.connected: self._connected = False return r, _, _ = select.select( (self.sock.sock, ), (), (), timeout) if r: op_code, frame = self.sock.recv_data_frame(True) if op_code == ABNF.OPCODE_CLOSE: self._connected = False return elif op_code == ABNF.OPCODE_BINARY or op_code == ABNF.OPCODE_TEXT: data = frame.data if six.PY3: data = data.decode("utf-8") if len(data) > 1: channel = ord(data[0]) data = data[1:] if data: if channel in [STDOUT_CHANNEL, STDERR_CHANNEL]: # keeping all messages in the order they received for # non-blocking call. self._all += data if channel not in self._channels: self._channels[channel] = data else: self._channels[channel] += data def run_forever(self, timeout=None): """Wait till connection is closed or timeout reached. Buffer any input received during this time.""" if timeout: start = time.time() while self.is_open() and time.time() - start < timeout: self.update(timeout=(timeout - time.time() + start)) else: while self.is_open(): self.update(timeout=None) def close(self, **kwargs): """ close websocket connection. """ self._connected = False if self.sock: self.sock.close(**kwargs) WSResponse = collections.namedtuple('WSResponse', ['data']) def get_websocket_url(url): parsed_url = urlparse(url) parts = list(parsed_url) if parsed_url.scheme == 'http': parts[0] = 'ws' elif parsed_url.scheme == 'https': parts[0] = 'wss' return urlunparse(parts) def websocket_call(configuration, *args, **kwargs): """An internal function to be called in api-client when a websocket connection is required. args and kwargs are the parameters of apiClient.request method.""" url = args[1] query_params = kwargs.get("query_params", {}) _request_timeout = kwargs.get("_request_timeout", 60) _preload_content = kwargs.get("_preload_content", True) headers = kwargs.get("headers") # Extract the command from the list of tuples commands = None for key, value in query_params: if key == 'command': commands = value break # drop command from query_params as we will be processing it separately query_params = [(key, value) for key, value in query_params if key != 'command'] # if we still have query params then encode them if query_params: url += '?' + urlencode(query_params) # tack on the actual command to execute at the end if isinstance(commands, list): for command in commands: url += "&command=%s&" % quote_plus(command) elif commands is not None: url += '&command=' + quote_plus(commands) try: client = WSClient(configuration, get_websocket_url(url), headers) if not _preload_content: return client client.run_forever(timeout=_request_timeout) return WSResponse('%s' % ''.join(client.read_all())) except (Exception, KeyboardInterrupt, SystemExit) as e: raise ApiException(status=0, reason=str(e))
PypiClean
/yr_weather-0.3.0-py3-none-any.whl/yr_weather/locationforecast.py
import requests from requests_cache import CachedSession from typing import Optional, Literal, Union from .base import BaseClient from .types.completeforecast import CompleteForecast, CompleteUnits from .types.compactforecast import CompactForecast, CompactInstantDetails class Locationforecast(BaseClient): """A client for interacting with the Yr Locationforecast API. The client has multiple functions which can be used for retrieving data from the API. It must be initialized with a ``headers`` dict, which at least includes a User-Agent. The headers will be used with the :mod:`requests` library. Example 1. Getting a location forecast for a specified location: .. code-block:: python import yr_weather headers = { "User-Agent": "Your User-Agent" } yr_client = yr_weather.Locationforecast(headers=headers) # Get weather data for Oslo, Norway. weather_data = yr_client.get_forecast(59.91, 10.75) """ def __init__(self, headers: dict, use_cache: Optional[bool] = True) -> None: if "User-Agent" not in headers.keys(): raise ValueError("A custom 'User-Agent' property is required in the 'headers' dict.") super().__init__(headers, use_cache) self._baseURL += "locationforecast/2.0/" def get_forecast(self, lat: float, lon: float, forecast_type: Optional[Literal["complete", "compact"]] = "complete") -> Union[CompleteForecast, CompactForecast]: """Retrieve a complete or compact forecast for a selected location. Parameters ---------- lat: :class:`float` | :class:`int` The latitude of the location. lon: :class:`float` | :class:`int` The longitude of the location. forecast_type: Optional[Literal["complete", "compact"]] Optionally specify the type of forecast. Possible values: ``"complete"`` or ``"compact"``. Returns ------- CompleteForecast | CompactForecast An object with all possible values from the API, including temperature, air pressure, humidity and so on. """ if forecast_type not in ["complete", "compact"]: raise ValueError("Value of forecast_type must be 'complete', or 'compact'.\nNote that 'classic' is not supported, as it's obsolete.") request = self.session.get(self._baseURL + f"{forecast_type}?lat={lat}&lon={lon}") if forecast_type == "complete": weatherData: CompleteForecast = request.json() elif forecast_type == "compact": weatherData: CompactForecast = request.json() return weatherData def get_air_temperature(self, lat: float, lon: float, altitude: Optional[int] = None) -> float: """Retrieve the air temperature at a given location. This function returns the latest data available, meaning it provides the current air temperature. Parameters ---------- lat: :class:`float` | :class:`int` The latitude of the location. lon: :class:`float` | :class:`int` The longitude of the location. altitude: Optional[:class:`int`] The altitude of the location, given in whole meters. Returns ------- :class:`float` The air temperature, given in the current scale used by the Yr Locationforecast API (this is usually degrees Celsius). """ URL = self._baseURL + f"compact?lat={lat}&lon={lon}" if altitude: if type(altitude) != int: raise TypeError("Type of altitude must be int.") URL += f"&altitude={altitude}" request = self.session.get(URL) data: CompactForecast = request.json() return float(data["properties"]["timeseries"][0]["data"]["instant"]["details"]["air_temperature"]) def get_instant_data(self, lat: float, lon: float, altitude: Optional[int] = None) -> CompactInstantDetails: """Retrieve current weather information about a location. This includes air pressure, temperature, humidity, wind and more. Parameters ---------- lat: :class:`float` | :class:`int` The latitude of the location. lon: :class:`float` | :class:`int` The longitude of the location. altitude: Optional[:class:`int`] The altitude of the location, given in whole meters. Returns ------- CompactInstantDetails A typed dict with data received from the API. """ URL = self._baseURL + f"complete?lat={lat}&lon={lon}" if altitude: if type(altitude) != int: raise TypeError("Type of altitude must be int.") URL += f"&altitude={altitude}" request = self.session.get(URL) data: CompleteForecast = request.json() instant_data: CompactInstantDetails = data["properties"]["timeseries"][0]["data"]["instant"]["details"] return instant_data def get_units(self) -> CompleteUnits: """Retrieve a list of units used by the Yr Locationforecast API. Returns ------- CompleteUnits A typed dict with units currently used. """ request = self.session.get(self._baseURL + "complete?lat=0&lon=0") data: CompleteForecast = request.json() units: CompleteUnits = data["properties"]["meta"]["units"] return units
PypiClean
/reactive-pyecharts-1.0.0.tar.gz/reactive-pyecharts-1.0.0/example/polar_example.py
import math import random from example.commons import Collector, Faker from pyecharts import options as opts from pyecharts.charts import Page, Polar C = Collector() @C.funcs def polar_scatter0() -> Polar: data = [(i, random.randint(1, 100)) for i in range(101)] c = ( Polar() .add("", data, type_="scatter", label_opts=opts.LabelOpts(is_show=False)) .set_global_opts(title_opts=opts.TitleOpts(title="Polar-Scatter0")) ) return c @C.funcs def polar_scatter1() -> Polar: c = ( Polar() .add("", [(10, random.randint(1, 100)) for i in range(300)], type_="scatter") .add("", [(11, random.randint(1, 100)) for i in range(300)], type_="scatter") .set_series_opts(label_opts=opts.LabelOpts(is_show=False)) .set_global_opts(title_opts=opts.TitleOpts(title="Polar-Scatter1")) ) return c @C.funcs def polar_effectscatter() -> Polar: data = [(i, random.randint(1, 100)) for i in range(10)] c = ( Polar() .add( "", data, type_="effectScatter", effect_opts=opts.EffectOpts(scale=10, period=5), label_opts=opts.LabelOpts(is_show=False), ) .set_global_opts(title_opts=opts.TitleOpts(title="Polar-EffectScatter")) ) return c @C.funcs def polar_radiusaxis() -> Polar: c = ( Polar() .add_schema( radiusaxis_opts=opts.RadiusAxisOpts(data=Faker.week, type_="category") ) .add("A", [1, 2, 3, 4, 3, 5, 1], type_="bar", stack="stack0") .add("B", [2, 4, 6, 1, 2, 3, 1], type_="bar", stack="stack0") .add("C", [1, 2, 3, 4, 1, 2, 5], type_="bar", stack="stack0") .set_global_opts(title_opts=opts.TitleOpts(title="Polar-RadiusAxis")) ) return c @C.funcs def polar_angleaxis() -> Polar: c = ( Polar() .add_schema( angleaxis_opts=opts.AngleAxisOpts(data=Faker.week, type_="category") ) .add("A", [1, 2, 3, 4, 3, 5, 1], type_="bar", stack="stack0") .add("B", [2, 4, 6, 1, 2, 3, 1], type_="bar", stack="stack0") .add("C", [1, 2, 3, 4, 1, 2, 5], type_="bar", stack="stack0") .set_global_opts(title_opts=opts.TitleOpts(title="Polar-AngleAxis")) ) return c @C.funcs def polar_flower() -> Polar: data = [] for i in range(101): theta = i / 100 * 360 r = 5 * (1 + math.sin(theta / 180 * math.pi)) data.append([r, theta]) hour = [i for i in range(1, 25)] c = ( Polar() .add_schema( angleaxis_opts=opts.AngleAxisOpts( data=hour, type_="value", boundary_gap=False, start_angle=0 ) ) .add("love", data, label_opts=opts.LabelOpts(is_show=False)) .set_global_opts(title_opts=opts.TitleOpts(title="Polar-Love")) ) return c @C.funcs def polar_flower() -> Polar: data = [] for i in range(361): t = i / 180 * math.pi r = math.sin(2 * t) * math.cos(2 * t) data.append([r, i]) c = ( Polar() .add_schema(angleaxis_opts=opts.AngleAxisOpts(start_angle=0, min_=0)) .add("flower", data, label_opts=opts.LabelOpts(is_show=False)) .set_global_opts(title_opts=opts.TitleOpts(title="Polar-Flower")) ) return c Page().add(*[fn() for fn, _ in C.charts]).render()
PypiClean
/jkg_evaluators-0.0.6.tar.gz/jkg_evaluators-0.0.6/jkg_evaluators/challenges/data/hotels.py
import json import os import random import shutil import numpy as np import pandas as pd from .comparator_class import SolutionComparator def _create_hotel_input(size): return [ { "lat": (random.betavariate(3, 3) - 0.5) * 125, "lon": (random.betavariate(3, 3) - 0.5) * 300, } for _ in range(size) ] def _create_hotel_filter_input(size): return [ { "lat": (random.betavariate(3, 3) - 0.5) * 125, "lon": (random.betavariate(3, 3) - 0.5) * 300, "stars": np.linspace(0, 5, 11)[np.random.randint(11)], **_get_price_pair(), } for _ in range(size) ] def _get_price_pair(): prices = np.sort(np.random.exponential(70, size=2)) return {"min_price": prices[0], "max_price": prices[1]} class HotelSolutionComparator(SolutionComparator): @staticmethod def _get_input(size): return _create_hotel_input(size) @staticmethod def _dump_data(size, path): data_path = os.path.join("data", f"{size}.csv") shutil.copy(data_path, path) class HotelFilterSolutionComparator(HotelSolutionComparator): @staticmethod def _get_input(size): return _create_hotel_filter_input(size) def get_hotel_data(data_root="data"): os.makedirs(data_root, exist_ok=True) for data_size_k in [10, 20, 50, 100, 200, 500]: data_size = data_size_k * 1000 dl_path = ( "https://borza-hotelcom-data.s3.eu-central-1" f".amazonaws.com/challenge-{data_size}.csv" ) df = pd.read_csv(dl_path) write_path = os.path.join(data_root, f"{data_size}.csv") df.to_csv(write_path, index=False) def dump_hotel_input(size, path="inputs.json"): obj = _create_hotel_input(size) with open(path, "w") as fp: json.dump(obj, fp) def dump_hotel_filter_input(size, path="inputs.json"): obj = _create_hotel_filter_input(size) with open(path, "w") as fp: json.dump(obj, fp)
PypiClean
/fake_bpy_module_2.80-20230117-py3-none-any.whl/bl_operators/clip.py
import sys import typing import bpy_types GenericType = typing.TypeVar("GenericType") class CLIP_OT_bundles_to_mesh(bpy_types.Operator): bl_idname = None ''' ''' bl_label = None ''' ''' bl_options = None ''' ''' bl_rna = None ''' ''' id_data = None ''' ''' def as_keywords(self, ignore): ''' ''' pass def as_pointer(self): ''' ''' pass def bl_rna_get_subclass(self): ''' ''' pass def bl_rna_get_subclass_py(self): ''' ''' pass def driver_add(self): ''' ''' pass def driver_remove(self): ''' ''' pass def execute(self, context): ''' ''' pass def get(self): ''' ''' pass def is_property_hidden(self): ''' ''' pass def is_property_overridable_library(self): ''' ''' pass def is_property_readonly(self): ''' ''' pass def is_property_set(self): ''' ''' pass def items(self): ''' ''' pass def keyframe_delete(self): ''' ''' pass def keyframe_insert(self): ''' ''' pass def keys(self): ''' ''' pass def path_from_id(self): ''' ''' pass def path_resolve(self): ''' ''' pass def poll(self, context): ''' ''' pass def pop(self): ''' ''' pass def property_overridable_library_set(self): ''' ''' pass def property_unset(self): ''' ''' pass def type_recast(self): ''' ''' pass def values(self): ''' ''' pass class CLIP_OT_constraint_to_fcurve(bpy_types.Operator): bl_idname = None ''' ''' bl_label = None ''' ''' bl_options = None ''' ''' bl_rna = None ''' ''' id_data = None ''' ''' def as_keywords(self, ignore): ''' ''' pass def as_pointer(self): ''' ''' pass def bl_rna_get_subclass(self): ''' ''' pass def bl_rna_get_subclass_py(self): ''' ''' pass def driver_add(self): ''' ''' pass def driver_remove(self): ''' ''' pass def execute(self, context): ''' ''' pass def get(self): ''' ''' pass def is_property_hidden(self): ''' ''' pass def is_property_overridable_library(self): ''' ''' pass def is_property_readonly(self): ''' ''' pass def is_property_set(self): ''' ''' pass def items(self): ''' ''' pass def keyframe_delete(self): ''' ''' pass def keyframe_insert(self): ''' ''' pass def keys(self): ''' ''' pass def path_from_id(self): ''' ''' pass def path_resolve(self): ''' ''' pass def pop(self): ''' ''' pass def property_overridable_library_set(self): ''' ''' pass def property_unset(self): ''' ''' pass def type_recast(self): ''' ''' pass def values(self): ''' ''' pass class CLIP_OT_delete_proxy(bpy_types.Operator): bl_idname = None ''' ''' bl_label = None ''' ''' bl_options = None ''' ''' bl_rna = None ''' ''' id_data = None ''' ''' def as_keywords(self, ignore): ''' ''' pass def as_pointer(self): ''' ''' pass def bl_rna_get_subclass(self): ''' ''' pass def bl_rna_get_subclass_py(self): ''' ''' pass def driver_add(self): ''' ''' pass def driver_remove(self): ''' ''' pass def execute(self, context): ''' ''' pass def get(self): ''' ''' pass def invoke(self, context, event): ''' ''' pass def is_property_hidden(self): ''' ''' pass def is_property_overridable_library(self): ''' ''' pass def is_property_readonly(self): ''' ''' pass def is_property_set(self): ''' ''' pass def items(self): ''' ''' pass def keyframe_delete(self): ''' ''' pass def keyframe_insert(self): ''' ''' pass def keys(self): ''' ''' pass def path_from_id(self): ''' ''' pass def path_resolve(self): ''' ''' pass def poll(self, context): ''' ''' pass def pop(self): ''' ''' pass def property_overridable_library_set(self): ''' ''' pass def property_unset(self): ''' ''' pass def type_recast(self): ''' ''' pass def values(self): ''' ''' pass class CLIP_OT_filter_tracks(bpy_types.Operator): bl_idname = None ''' ''' bl_label = None ''' ''' bl_options = None ''' ''' bl_rna = None ''' ''' id_data = None ''' ''' def as_keywords(self, ignore): ''' ''' pass def as_pointer(self): ''' ''' pass def bl_rna_get_subclass(self): ''' ''' pass def bl_rna_get_subclass_py(self): ''' ''' pass def driver_add(self): ''' ''' pass def driver_remove(self): ''' ''' pass def execute(self, context): ''' ''' pass def get(self): ''' ''' pass def is_property_hidden(self): ''' ''' pass def is_property_overridable_library(self): ''' ''' pass def is_property_readonly(self): ''' ''' pass def is_property_set(self): ''' ''' pass def items(self): ''' ''' pass def keyframe_delete(self): ''' ''' pass def keyframe_insert(self): ''' ''' pass def keys(self): ''' ''' pass def path_from_id(self): ''' ''' pass def path_resolve(self): ''' ''' pass def poll(self, context): ''' ''' pass def pop(self): ''' ''' pass def property_overridable_library_set(self): ''' ''' pass def property_unset(self): ''' ''' pass def type_recast(self): ''' ''' pass def values(self): ''' ''' pass class CLIP_OT_set_active_clip(bpy_types.Operator): bl_idname = None ''' ''' bl_label = None ''' ''' bl_rna = None ''' ''' id_data = None ''' ''' def as_keywords(self, ignore): ''' ''' pass def as_pointer(self): ''' ''' pass def bl_rna_get_subclass(self): ''' ''' pass def bl_rna_get_subclass_py(self): ''' ''' pass def driver_add(self): ''' ''' pass def driver_remove(self): ''' ''' pass def execute(self, context): ''' ''' pass def get(self): ''' ''' pass def is_property_hidden(self): ''' ''' pass def is_property_overridable_library(self): ''' ''' pass def is_property_readonly(self): ''' ''' pass def is_property_set(self): ''' ''' pass def items(self): ''' ''' pass def keyframe_delete(self): ''' ''' pass def keyframe_insert(self): ''' ''' pass def keys(self): ''' ''' pass def path_from_id(self): ''' ''' pass def path_resolve(self): ''' ''' pass def poll(self, context): ''' ''' pass def pop(self): ''' ''' pass def property_overridable_library_set(self): ''' ''' pass def property_unset(self): ''' ''' pass def type_recast(self): ''' ''' pass def values(self): ''' ''' pass class CLIP_OT_set_viewport_background(bpy_types.Operator): bl_idname = None ''' ''' bl_label = None ''' ''' bl_options = None ''' ''' bl_rna = None ''' ''' id_data = None ''' ''' def as_keywords(self, ignore): ''' ''' pass def as_pointer(self): ''' ''' pass def bl_rna_get_subclass(self): ''' ''' pass def bl_rna_get_subclass_py(self): ''' ''' pass def driver_add(self): ''' ''' pass def driver_remove(self): ''' ''' pass def execute(self, context): ''' ''' pass def get(self): ''' ''' pass def is_property_hidden(self): ''' ''' pass def is_property_overridable_library(self): ''' ''' pass def is_property_readonly(self): ''' ''' pass def is_property_set(self): ''' ''' pass def items(self): ''' ''' pass def keyframe_delete(self): ''' ''' pass def keyframe_insert(self): ''' ''' pass def keys(self): ''' ''' pass def path_from_id(self): ''' ''' pass def path_resolve(self): ''' ''' pass def poll(self, context): ''' ''' pass def pop(self): ''' ''' pass def property_overridable_library_set(self): ''' ''' pass def property_unset(self): ''' ''' pass def type_recast(self): ''' ''' pass def values(self): ''' ''' pass class CLIP_OT_setup_tracking_scene(bpy_types.Operator): bl_idname = None ''' ''' bl_label = None ''' ''' bl_options = None ''' ''' bl_rna = None ''' ''' id_data = None ''' ''' def as_keywords(self, ignore): ''' ''' pass def as_pointer(self): ''' ''' pass def bl_rna_get_subclass(self): ''' ''' pass def bl_rna_get_subclass_py(self): ''' ''' pass def createCollection(self, context, collection_name): ''' ''' pass def driver_add(self): ''' ''' pass def driver_remove(self): ''' ''' pass def execute(self, context): ''' ''' pass def get(self): ''' ''' pass def is_property_hidden(self): ''' ''' pass def is_property_overridable_library(self): ''' ''' pass def is_property_readonly(self): ''' ''' pass def is_property_set(self): ''' ''' pass def items(self): ''' ''' pass def keyframe_delete(self): ''' ''' pass def keyframe_insert(self): ''' ''' pass def keys(self): ''' ''' pass def path_from_id(self): ''' ''' pass def path_resolve(self): ''' ''' pass def poll(self, context): ''' ''' pass def pop(self): ''' ''' pass def property_overridable_library_set(self): ''' ''' pass def property_unset(self): ''' ''' pass def type_recast(self): ''' ''' pass def values(self): ''' ''' pass class CLIP_OT_track_settings_as_default(bpy_types.Operator): bl_idname = None ''' ''' bl_label = None ''' ''' bl_options = None ''' ''' bl_rna = None ''' ''' id_data = None ''' ''' def as_keywords(self, ignore): ''' ''' pass def as_pointer(self): ''' ''' pass def bl_rna_get_subclass(self): ''' ''' pass def bl_rna_get_subclass_py(self): ''' ''' pass def driver_add(self): ''' ''' pass def driver_remove(self): ''' ''' pass def execute(self, context): ''' ''' pass def get(self): ''' ''' pass def is_property_hidden(self): ''' ''' pass def is_property_overridable_library(self): ''' ''' pass def is_property_readonly(self): ''' ''' pass def is_property_set(self): ''' ''' pass def items(self): ''' ''' pass def keyframe_delete(self): ''' ''' pass def keyframe_insert(self): ''' ''' pass def keys(self): ''' ''' pass def path_from_id(self): ''' ''' pass def path_resolve(self): ''' ''' pass def poll(self, context): ''' ''' pass def pop(self): ''' ''' pass def property_overridable_library_set(self): ''' ''' pass def property_unset(self): ''' ''' pass def type_recast(self): ''' ''' pass def values(self): ''' ''' pass class CLIP_OT_track_settings_to_track(bpy_types.Operator): bl_idname = None ''' ''' bl_label = None ''' ''' bl_options = None ''' ''' bl_rna = None ''' ''' id_data = None ''' ''' def as_keywords(self, ignore): ''' ''' pass def as_pointer(self): ''' ''' pass def bl_rna_get_subclass(self): ''' ''' pass def bl_rna_get_subclass_py(self): ''' ''' pass def driver_add(self): ''' ''' pass def driver_remove(self): ''' ''' pass def execute(self, context): ''' ''' pass def get(self): ''' ''' pass def is_property_hidden(self): ''' ''' pass def is_property_overridable_library(self): ''' ''' pass def is_property_readonly(self): ''' ''' pass def is_property_set(self): ''' ''' pass def items(self): ''' ''' pass def keyframe_delete(self): ''' ''' pass def keyframe_insert(self): ''' ''' pass def keys(self): ''' ''' pass def path_from_id(self): ''' ''' pass def path_resolve(self): ''' ''' pass def poll(self, context): ''' ''' pass def pop(self): ''' ''' pass def property_overridable_library_set(self): ''' ''' pass def property_unset(self): ''' ''' pass def type_recast(self): ''' ''' pass def values(self): ''' ''' pass class CLIP_OT_track_to_empty(bpy_types.Operator): bl_idname = None ''' ''' bl_label = None ''' ''' bl_options = None ''' ''' bl_rna = None ''' ''' id_data = None ''' ''' def as_keywords(self, ignore): ''' ''' pass def as_pointer(self): ''' ''' pass def bl_rna_get_subclass(self): ''' ''' pass def bl_rna_get_subclass_py(self): ''' ''' pass def driver_add(self): ''' ''' pass def driver_remove(self): ''' ''' pass def execute(self, context): ''' ''' pass def get(self): ''' ''' pass def is_property_hidden(self): ''' ''' pass def is_property_overridable_library(self): ''' ''' pass def is_property_readonly(self): ''' ''' pass def is_property_set(self): ''' ''' pass def items(self): ''' ''' pass def keyframe_delete(self): ''' ''' pass def keyframe_insert(self): ''' ''' pass def keys(self): ''' ''' pass def path_from_id(self): ''' ''' pass def path_resolve(self): ''' ''' pass def poll(self, context): ''' ''' pass def pop(self): ''' ''' pass def property_overridable_library_set(self): ''' ''' pass def property_unset(self): ''' ''' pass def type_recast(self): ''' ''' pass def values(self): ''' ''' pass def CLIP_camera_for_clip(context, clip): ''' ''' pass def CLIP_default_settings_from_track(clip, track, framenr): ''' ''' pass def CLIP_set_viewport_background(context, clip, clip_user): ''' ''' pass def CLIP_spaces_walk(context, all_screens, tarea, tspace, callback, args): ''' ''' pass def CLIP_track_view_selected(sc, track): ''' ''' pass
PypiClean
/astro_pyvista-0.2.1-py3-none-any.whl/pyvista/spectra.py
import matplotlib import glob from importlib_resources import files import matplotlib.pyplot as plt import multiprocessing as mp import os import pdb import pickle import copy import scipy.signal import scipy.interpolate from scipy.optimize import curve_fit from scipy.ndimage import median_filter, gaussian_filter1d from scipy.linalg import solve_banded import numpy as np import astropy from astropy.modeling import models, fitting from astropy.nddata import StdDevUncertainty from pyvista.dataclass import Data from astropy.io import ascii, fits from astropy.convolution import convolve, Box1DKernel, Box2DKernel from astropy.table import Table import pyvista import pyvista.data from pyvista import image, tv, skycalc, bitmask, dataclass from tools import plots class WaveCal() : """ Class for wavelength solutions Parameters ---------- file : str, optional filename for FITS file with WaveCal attributes type : str, optional, default='chebyshev' astropy model function degree : int, optional, default=2 polynomial degree for wavelength direction ydegree : int, optional, default=2 polynomial degree for spatial or cross-dispersed direction pix0 : int, optional, default=0 reference pixel Attributes ---------- type : str astropy model function for wavelength solution degree : int polynomial degree for wavelength direction ydegree : int polynomial degree for spatial or cross-dispersed direction pix0 : int reference pixel orders : array_like spectral order for each row in spatially resolved or cross-dispersed pix : array_like pixel positions of identified lines in spectrum waves : array_like wavelength positions of identified lines in spectrum weights : array_like weights for fitting of identified lines in spectrum y : array_like spatial or cross-dispersed array position spectrum : array_like reference spectrum to be used to identify lines model : astropy model, or list of models Model(s) for the wavelength solution """ def __init__ (self,file=None, type='chebyshev',degree=2,ydegree=2, pix0=0,index=0,hdu=1,orders=None) : if file is not None : if file == '?' : out=glob.glob( str(files(pyvista.data).joinpath('*/*wave*.fits'))) print('available predefined WaveCals: ') for o in out : print(o.split('/')[-2]+'/'+o.split('/')[-1]) return if isinstance(file,astropy.io.fits.fitsrec.FITS_rec) : tab=Table(file) elif str(file)[0] == '.' or str(file)[0] == '/' : tab=Table.read(file,hdu=hdu) else : tab=Table.read(files(pyvista.data).joinpath(file),hdu=hdu) for tag in ['type','degree','ydegree','waves', 'waves_order','orders','index', 'pix0','pix','y','spectrum','weights'] : if tag in tab.keys() : setattr(self,tag,tab[tag][0]) else : setattr(self,tag,None) self.orders=np.atleast_1d(self.orders) # make the initial models from the saved data self.model = self.getmod() self.fit() else : self.type = type self.degree = degree self.ydegree = ydegree self.pix0 = pix0 self.waves = None self.x = None self.y = None self.weights = None self.model = None self.ax = None self.spectrum = None if orders is not None : self.orders = orders else : self.orders = [1] self.index = None def write(self,file,append=False) : """ Save object to file Parameters ---------- file : str, name of output file to write to, FITS format append : bool, append to existing file (untested) """ tab=Table() for tag in ['type','degree','ydegree','waves','waves_order', 'orders','index','pix0','pix','y','weights','spectrum'] : tab[tag] = [getattr(self,tag)] if append : tab.write(file,append=True) else : tab.write(file,overwrite=True) return tab def wave(self,pixels=None,image=None,domain=False) : """ Wavelength from pixel using wavelength solution model With pixels=[pixels,rows] keyword, return wavelengths for input set of pixels/rows With image=(nrow,ncol), returns wavelengths in an image Parameters ---------- pix : array_like, optional input pixel positions [x] or [y,x] image : tuple, optional for input image size [nrows,ncols], return wavelengths at all pixels Returns ------- wavelength """ if pixels is not None : out=np.zeros(len(pixels[0])) for i,pixel in enumerate(pixels[0]) : order=self.orders[pixels[1][i]] if self.type.find('2D') > 0 : out[i]=self.model(pixel-self.pix0,pixels[1][i])/order else : out[i]=self.model(pixel-self.pix0)/order return out else : out=np.zeros(image) cols=np.arange(out.shape[-1]) if out.ndim == 2 : for row in range(out.shape[0]) : rows=np.zeros(len(cols))+row order = self.orders[row] if '2D' in self.type : out[row,:] = self.model(cols-self.pix0,rows)/order else : out[row,:] = self.model(cols-self.pix0)/order if domain : bd=np.where(((cols-self.pix0) < self.model.domain[0]-10) | ((cols-self.pix0) > self.model.domain[1]+10) )[0] out[row,bd] = np.nan else : out= self.model(cols-self.pix0)/self.orders[0] if domain : bd=np.where(((cols-self.pix0) < self.model.domain[0]-10) | ((cols-self.pix0) > self.model.domain[1]+10) )[0] out[bd] = np.nan return out def add_wave(self, hd) : """ Add wavelength attribute to input image using current wavelength solution Parameters ---------- hd : Data object Image to add wavelength array to """ hd.add_wave(self.wave(image=np.array(np.atleast_2d(hd.data).shape))) def getmod(self) : """ Return model for current attributes """ if self.type == 'Polynomial1D' : mod=models.Polynomial1D(degree=self.degree) elif self.type == 'chebyshev' : mod=models.Chebyshev1D(degree=self.degree) elif self.type == 'chebyshev2D' : sz=self.spectrum.shape mod=models.Chebyshev2D(x_degree=self.degree,y_degree=self.ydegree, x_domain=[0,sz[1]],y_domain=[0,sz[0]]) else : raise ValueError('unknown fitting type: '+self.type) return return mod def plot(self,hard=None) : """ Plot current solution """ if self.ax is None : fig,ax = plt.subplots(2,1,sharex=True,figsize=(10,5)) fig.subplots_adjust(hspace=1.05) self.fig = fig self.ax = ax #plot spectrum with current wavelength solution self.ax[0].cla() wav = self.wave(image=self.spectrum.shape) if len(self.spectrum) > 1 : row = self.spectrum.shape[0] // 2 self.ax[0].plot(wav[row,:],self.spectrum[row,:]) else : self.ax[0].plot(wav[0],self.spectrum[0,:]) for line in self.waves : self.ax[0].text(line,1.,'{:7.1f}'.format(line), rotation='vertical',va='top',ha='center') # plot residuals diff=self.waves-self.wave(pixels=[self.pix,self.y]) gd = np.where(self.weights > 0.001)[0] bd = np.where(self.weights <= 0.)[0] self.ax[1].cla() if len(self.spectrum) == 1 : self.ax[1].plot(self.waves[gd],diff[gd],'go') else : scat=self.ax[1].scatter(self.waves,diff,marker='o',c=self.y,s=5,cmap='viridis') cb_ax = self.fig.add_axes([0.94,0.05,0.02,0.4]) cb = self.fig.colorbar(scat,cax=cb_ax) cb.ax.set_ylabel('Row') xlim=self.ax[1].get_xlim() self.ax[1].set_ylim(diff.min()-0.5,diff.max()+0.5) self.ax[1].plot(xlim,[0,0],linestyle=':') self.ax[1].text(0.1,0.9,'rms: {:8.3f} Angstroms'.format( diff[gd].std()),transform=self.ax[1].transAxes) self.ax[1].set_xlabel('Wavelength') self.ax[1].set_ylabel('obs wave - fit wave') if len(bd) > 0 : self.ax[1].scatter(self.waves[bd],diff[bd],c='r',s=5) self.ax[1].set_ylim(diff[gd].min()-0.5,diff[gd].max()+0.5) self.fig.tight_layout() plt.draw() if hard is not None : self.fig.savefig(hard+'.png') def dispersion(self) : """ approximate dispersion from 1st order term" """ return self.model.c1.value/(self.model._domain[1]-self.model._domain[0])*2. def fit(self,degree=None,reject=3,inter=True) : """ do a wavelength fit If a figure has been set in identify, will show fit graphically and allow for manual removal of lines in 1D case. In 2D case, outliers are detected and removed Parameters ---------- degree : int, optional degree of polynomial in wavelength, else as previously set in object """ # set up fitter and model twod='2D' in self.type fitter=fitting.LinearLSQFitter() if degree is not None : self.degree=degree self.model = self.getmod() mod = self.model if not hasattr(self,'ax') : self.ax = None if twod : # for 2D fit, we just use automatic line rejections nold=-1 nbd=0 while nbd != nold : # iterate as long as new points have been removed nold=nbd self.model=fitter(mod,self.pix-self.pix0,self.y, self.waves*self.waves_order,weights=self.weights) diff=self.waves-self.wave(pixels=[self.pix,self.y]) gd = np.where(self.weights > 0)[0] print(' rms: {:8.3f}'.format(diff[gd].std())) bd = np.where(abs(diff) > reject*diff.std())[0] nbd = len(bd) print('rejecting {:d} points from {:d} total: '.format( nbd,len(self.waves))) self.weights[bd] = 0. # plot the results if self.ax is not None : self.ax[1].cla() scat=self.ax[1].scatter(self.waves,diff,marker='o', c=self.y,s=5,cmap='viridis') plots.plotp(self.ax[1],self.waves[bd],diff[bd], marker='o',color='r',size=5) xlim=self.ax[1].get_xlim() self.ax[1].set_ylim(diff.min()-0.5,diff.max()+0.5) self.ax[1].plot(xlim,[0,0],linestyle=':') self.ax[1].text(0.1,0.9,'rms: {:8.3f}'.format( diff[gd].std()),transform=self.ax[1].transAxes) cb_ax = self.fig.add_axes([0.94,0.05,0.02,0.4]) cb = self.fig.colorbar(scat,cax=cb_ax) cb.ax.set_ylabel('Row') plt.draw() try: self.fig.canvas.draw_idle() except: pass print(' See 2D wavecal fit. Enter space in plot window to continue') if inter : get=plots.mark(self.fig) else : # 1D fit, loop over all rows in which lines have been identified nmod = len(set(self.y)) models = [] for row in set(self.y) : irow = np.where(self.y == row)[0] self.model=fitter(mod,self.pix[irow]-self.pix0, self.waves[irow]*self.waves_order[irow], weights=self.weights[irow]) gd=np.where(self.weights[irow]>0.)[0] diff=self.waves-self.wave(pixels=[self.pix,self.y]) print(' rms: {:8.3f} Angstroms ({:d} lines)'.format( diff[irow[gd]].std(),len(irow))) if self.ax is not None : # iterate allowing for interactive removal of points done = False ymax = self.ax[0].get_ylim()[1] print(' Input in plot window: ') print(' l : to remove all lines to left of cursor') print(' r : to remove all lines to right of cursor') print(' n : to remove line nearest cursor x position') print(' anything else : finish and return') while not done : # do fit gd=np.where(self.weights[irow]>0.)[0] gd=irow[gd] bd=np.where(self.weights[irow]<=0.)[0] bd=irow[bd] self.model=fitter(mod,self.pix[gd]-self.pix0, self.waves[gd]*self.waves_order[gd], weights=self.weights[gd]) diff=self.waves-self.wave(pixels=[self.pix,self.y]) print(' rms: {:8.3f} Anstroms'.format(diff[gd].std())) # replot spectrum with new fit wavelength scale self.ax[0].cla() self.ax[0].plot(self.wave(image=self.spectrum.shape[1]), self.spectrum[0,:]) # plot residuals self.ax[1].cla() self.ax[1].plot(self.waves[gd],diff[gd],'go') self.ax[1].text(0.1,0.9,'rms: {:8.3f} Angstroms'.format( diff[gd].std()),transform=self.ax[1].transAxes) self.ax[1].set_xlabel('Wavelength') self.ax[1].set_ylabel('obs wave - fit wave') if len(bd) > 0 : self.ax[1].plot(self.waves[bd],diff[bd],'ro') self.ax[1].set_ylim(diff[gd].min()-0.5,diff[gd].max()+0.5) plots._data_x = self.waves[irow][np.isfinite(self.waves[irow])] plots._data_y = diff[irow][np.isfinite(diff[irow])] for i in range(len(self.pix[irow])) : j = irow[i] self.ax[1].text(self.waves[j],diff[j],'{:2d}'.format( i),va='top',ha='center') if self.weights[i] > 0 : self.ax[0].plot([self.waves[j],self.waves[j]], [0,ymax],'g') else : self.ax[0].plot([self.waves[j],self.waves[j]], [0,ymax],'r') plt.draw() # get input from user on lines to remove if inter : i = getinput(' input from plot window...', self.fig,index=True) else : i = '' if i == '' : done = True elif i[2] == 'l' : bd=np.where(self.waves[irow]<i[0])[0] self.weights[irow[bd]] = 0. elif i[2] == 'r' : bd=np.where(self.waves[irow]>i[0])[0] self.weights[irow[bd]] = 0. elif i[2] == 'n' : #bd=np.argmin(np.abs(self.waves[irow]-i[0])) bd=i[3] self.weights[irow[bd]] = 0. elif i == 'O' : print(' current degree of fit: {:d}'.format( self.degree)) self.degree = int(getinput( ' enter new degree of fit: ',self.fig)) mod = self.getmod() else : done = True models.append(self.model) if nmod == 1 : self.model = models[0] else : self.model = models def set_spectrum(self,spectrum) : """ Set spectrum used to derive fit """ self.spectrum = np.atleast_2d(spectrum) def get_spectrum(self) : """ Set spectrum used to derive fit """ return self.spectrum def identify(self,spectrum,file=None,wav=None,wref=None,inter=False, orders=None,verbose=False,rad=5,thresh=100, fit=True, maxshift=1.e10, disp=None,display=None,plot=None,pixplot=False,domain=False, plotinter=True, xmin=None,xmax=None,lags=range(-300,300), nskip=None) : """ Given some estimate of wavelength solution and file with lines, identify peaks and centroid, via methods: 1. if input wav array/image is specified, use this to identify lines 2. if WaveCal object as associated spectrum, use cross correlation to identify shift of input spectrum, then use previous solution to create a wavelength array. Cross correlation lags to try are specified by lags=range(dx1,dx2), default range(-300,300) 3. if inter==True, prompt user to identify 2 lines 4. use header cards DISPDW and DISPWC for dispersion and wave center or as specified by input disp=[dispersion] and wref=[lambda,pix] Given wavelength guess array, identify lines from input file, or, if no file given, lines saved in the WaveCal structure Lines are identified by looking for peaks within rad pixels of initial guess After line identification, fit() is called, unless fit=False With plot=True, plot of spectrum is shown, with initial wavelength guess. With pixplot=True, plot is shown as function of pixel """ sz=spectrum.data.shape if len(sz) == 1 : spectrum.data = np.atleast_2d(spectrum.data) spectrum.uncertainty.array = np.atleast_2d(spectrum.uncertainty.array) sz=spectrum.data.shape if xmin is None : xmin=0 if xmax is None : xmax=sz[-1] nrow=sz[0] if orders is not None : self.orders = orders if nskip is None : if len(set(self.orders)) == 1 : nskip=25 else : nskip=1 # get initial reference wavelengths if not given if wav is None : pix=np.arange(sz[-1]) if inter : f,a=plots.multi(1,1) a.plot(spectrum.data[0,:]) for i in range(2) : print('mark location of known line with m key') ret=plots.mark(f) w=input('wavelength of line: ') if i==0 : w0=float(w) pix0=ret[0] else : disp = (float(w)-w0)/(ret[0]-pix0) print(w0,pix0,disp) wav=np.atleast_2d(w0+(pix-pix0)*disp) elif self.spectrum is not None : # cross correlate with reference image to get pixel shift print(' cross correlating with reference spectrum using lags: ', lags) fitpeak,shift = image.xcorr(self.spectrum,spectrum.data,lags) if shift.ndim == 1 : pixshift=(fitpeak+lags[0])[0] print(' Derived pixel shift from input wcal: ',fitpeak+lags[0]) if display is not None : display.plotax1.cla() display.plotax1.text(0.05,0.95,'spectrum and reference', transform=display.plotax1.transAxes) for row in range(spectrum.data.shape[0]) : display.plotax1.plot(spectrum.data[row,:],color='m') display.plotax1.plot(self.spectrum[row,:],color='g') display.plotax1.set_xlabel('Pixel') display.histclick=False display.plotax2.cla() display.plotax2.text(0.05,0.95, 'cross correlation: {:8.3f}'.format(pixshift), transform=display.plotax2.transAxes) display.plotax2.plot(lags,shift) display.plotax2.set_xlabel('Lag') plt.draw() print(" See spectrum and template spectrum (top), cross correlation(bottom)",display.fig) # single shift for all pixels self.pix0 = self.pix0+fitpeak+lags[0] wav=np.atleast_2d(self.wave(image=np.array(sz),domain=domain)) #wav=np.atleast_2d(self.wave(image=sz)) else : # different shift for each row wav=np.zeros(sz) cols = np.arange(sz[-1]) orders=[] for row in range(wav.shape[0]) : print(' Derived pixel shift from input wcal for row: {:d} {:d}'.format (row,shift[row,:].argmax()+lags[0]),end='\r') rows=np.zeros(len(cols))+row try : order = self.orders[row] except : order=self.orders[0] orders.append(order) pix0 = self.pix0+fitpeak[row]+lags[0] wav[row,:] = self.model(cols-pix0)/order # ensure we have 2D fit self.type = 'chebyshev2D' self.model = self.getmod() self.orders = orders print("") else : # get dispersion guess from header cards if not given in disp if disp is None: disp=spectrum.header['DISPDW'] if wref is not None : w0=wref[0] pix0=wref[1] else: w0=spectrum.header['DISPWC'] pix0=sz[1]/2 wav=np.atleast_2d(w0+(pix-pix0)*disp) # open file with wavelengths and read if file is not None : if file.find('/') < 0 : f=open(files(pyvista.data).joinpath('lamps/'+file),'r') else : f=open(file,'r') lines=[] for line in f : if line[0] != '#' : w=float(line.split()[0]) # if we have microns, convert to Angstroms if w<10 : w*=10000 if w > np.nanmin(wav) and w < np.nanmax(wav) : lines.append(w) lines=np.array(lines) f.close() else : lines = self.waves weights = self.weights gd = np.where(weights >0)[0] lines = set(lines[gd]) # get centroid around expected lines x=[] y=[] fwhm=[] waves=[] waves_order=[] weight=[] diff=[] if display is not None and isinstance(display,pyvista.tv.TV) : display.ax.cla() display.ax.axis('off') display.tv(spectrum.data) if plot is None or plot == False: self.ax = None else : if type(plot) is matplotlib.figure.Figure : plot.clf() plt.draw() ax1=plot.add_subplot(2,1,1) ax2=plot.add_subplot(2,1,2,sharex=ax1) plot.subplots_adjust(left=0.05,right=0.92, hspace=1.05) ax=[ax1,ax2] self.fig = plot self.ax = ax else : fig,ax = plt.subplots(2,1,sharex=True,figsize=(10,5)) fig.subplots_adjust(hspace=1.05) self.fig = fig self.ax = ax if self.ax is not None : ax[0].cla() peaks=[] rows=[] gdpeaks=[] gdrows=[] for row in range(0,nrow,nskip) : if verbose :print(' identifying lines in row: ', row,end='\r') if self.ax is not None : # next line for pixel plot if pixplot : ax[0].plot(spectrum.data[row,:]) else : ax[0].plot(wav[row,:],spectrum.data[row,:]) #ax[0].set_yscale('log') ax[0].set_ylim(1.,ax[0].get_ylim()[1]) ax[0].text(0.1,0.9,'row: {:d}'.format(row),transform=ax[0].transAxes) ax[0].set_xlabel('Rough wavelength') ax[0].set_ylabel('Intensity') for line in lines : # initial guess from input wavelengths peak0=np.nanargmin(abs(line-wav[row,:])) peak=np.nanargmin(abs(line-wav[row,:])) if ( (peak > xmin+rad) and (peak < xmax-rad)) : # set peak to highest nearby pixel peak=(spectrum.data[row,peak-rad:peak+rad+1]).argmax()+peak-rad if ( (peak < xmin+rad) or (peak > xmax-rad)) : continue if isinstance(display,pyvista.tv.TV) : peaks.append(peak) rows.append(row) # S/N threshold if (spectrum.data[row,peak-rad:peak+rad+1]/ spectrum.uncertainty.array[row,peak-rad:peak+rad+1]).max() > thresh: oldpeak = 0 niter=0 xx = np.arange(peak-rad,peak+rad+1) yy = spectrum.data[row,peak-rad:peak+rad+1] try : while peak != oldpeak and niter<10: p0 = [spectrum.data[row,peak],peak,rad/2.354,0.] coeff, var_matrix = curve_fit(gauss, xx, yy, p0=p0) cent = coeff[1] oldpeak = peak peak = int(cent) niter+=1 #if niter == 10 : continue except : continue if verbose : print(line,peak,*coeff) if display is not None and isinstance(display,pyvista.tv.TV) : gdpeaks.append(cent) gdrows.append(row) if plot is not None and plot != False : if pixplot : ax[0].plot([cent,cent],ax[0].get_ylim(),color='r') else : ax[0].text(line,1.,'{:7.1f}'.format(line), rotation='vertical',va='top',ha='center') x.append(cent) y.append(row) fwhm.append(np.abs(coeff[2]*2.354)) # we will fit for wavelength*order waves.append(line) try: order = self.orders[row] except: order=self.orders[0] waves_order.append(order) if np.abs(cent-peak0) < maxshift : wt=1. else : print('bad: ',cent,peak0) wt=0. weight.append(wt) if isinstance(display,pyvista.tv.TV) : display.ax.scatter(peaks,rows,marker='o',color='r',s=2) display.ax.scatter(gdpeaks,gdrows,marker='o',color='g',s=2) if self.ax is not None : self.fig.tight_layout() print(' See identified lines.') self.pix=np.array(x) self.y=np.array(y) self.fwhm=np.array(fwhm) self.waves=np.array(waves) self.waves_order=np.array(waves_order) self.weights=np.array(weight) self.spectrum = spectrum.data if fit: self.fit(inter=plotinter) spectrum.add_wave(self.wave(image=spectrum.data.shape)) print('') def skyline(self,hd,plot=True,thresh=50,inter=True,linear=False,file='skyline.dat') : """ Adjust wavelength solution based on sky lines Parameters ---------- hd : Data object input pyvista Data object, must contain wave attribute with initial wavelengths plot : bool, default=True display plot results thresh : float, default=50 minimum S/N for line detection inter : bool, default=True allow for interactive removal of lines linear : bool, default=False if True, allow for dispersion to be ajusted as well as wavelength zeropoint requires at least two sky lines! file : str, default='skyline.dat' file with sky lines to look for, if you want to override default:w """ if hd.wave is None : raise ValueError('input object must contain wave attribute') # set higher order terms to fixed for i in range(self.degree) : if not linear or i>0 : self.model.fixed['c{:d}'.format(i+1)] = True self.identify(hd,wav=hd.wave,file=file,plot=plot,thresh=thresh, plotinter=inter) def scomb(self,hd,wav,average=True,usemask=True) : """ Resample onto input wavelength grid Uses current wavelength solution, linearly interpolates to specified wavelengths, on a row-by-row basis. Allows for order overlap. Parameters ---------- hd : array or CCDData input image to resample wav : array_like new wavelengths to interpolate to average : bool, optional, default=True if overlapping orders, average if True, otherwise sum usemask : bool, optional, default=True if True, skip input masked pixels for interpolation """ #output grid out=np.zeros(len(wav)) sig=np.zeros(len(wav)) mask=np.zeros(len(wav),dtype=np.uintc) pixmask=bitmask.PixelBitMask() # raw wavelengths w=self.wave(image=np.array(np.atleast_2d(hd.data).shape)) for i in range(np.atleast_2d(hd).shape[0]) : sort=np.argsort(w[i,:]) if usemask : gd = np.where(~(np.atleast_2d(hd.bitmask&pixmask.badval()))[i,sort]) sort= sort[gd] if len(gd[0]) == 0 : continue wmin=w[i,sort].min() wmax=w[i,sort].max() w2=np.abs(wav-wmin).argmin() w1=np.abs(wav-wmax).argmin() if average : out[w2:w1] += ( np.interp(wav[w2:w1],w[i,sort], np.atleast_2d(hd.data)[i,sort]) / np.interp(wav[w2:w1],w[i,sort], np.atleast_2d(hd.uncertainty.array)[i,sort])**2 ) sig[w2:w1] += 1./np.interp(wav[w2:w1],w[i,sort], np.atleast_2d(hd.uncertainty.array)[i,sort])**2 else : out[w2:w1] += np.interp(wav[w2:w1],w[i,sort], np.atleast_2d(hd.data)[i,sort]) sig[w2:w1] += np.interp(wav[w2:w1],w[i,sort], np.atleast_2d(hd.uncertainty.array**2)[i,sort]) if average : out = out / sig sig = np.sqrt(1./sig) else : sig = np.sqrt(sig) return Data(out,uncertainty=StdDevUncertainty(sig), bitmask=mask,header=hd.header,wave=wav) def correct(self,hd,wav) : """ Resample input image to desired wavelength scale Uses current wavelength solution, linearly interpolates to specified wavelengths, on a row-by-row basis. Parameters ---------- hd : Data, input image to resample wav : array_like, new wavelengths to interpolate to """ out=np.zeros([hd.data.shape[0],len(wav)]) sig=np.zeros_like(out) bitmask=np.zeros_like(out,dtype=hd.bitmask.dtype) w=self.wave(image=hd.data.shape) for i in range(len(out)) : sort=np.argsort(w[i,:]) wmin=w[i,sort].min() wmax=w[i,sort].max() w2=np.abs(wav-wmin).argmin() w1=np.abs(wav-wmax).argmin() out[i,:] += np.interp(wav,w[i,sort],hd.data[i,sort]) sig[i,:] += np.sqrt( np.interp(wav,w[i,sort],hd.uncertainty.array[i,sort]**2)) for bit in range(0,32) : mask = (hd.bitmask[i,sort] & 2**bit) if mask.max() > 0 : maskint = np.interp(wav,w[i,sort],mask) bitset = np.where(maskint>0)[0] bitmask[i,bitset] |= 2**bit return Data(out,uncertainty=StdDevUncertainty(sig),bitmask=bitmask,wave=wav) class Trace() : """ Class for spectral traces Attributes ---------- type : str type of astropy model to use degree : int polynomial degree to use for trace sigdegree : int polynomial degree to use for fitting gaussian sigma trace width sc0 : int starting column for trace, will work in both directions from here pix0 : int derived shift of current image relative to reference image spectrum : array_like reference spatial slice at sc0, used to determine object location rad : int radius in pixels to use for calculating centroid lags : array_like range of lags to use to try to find object locations Parameters ---------- file : str, optional filename for FITS file with Trace attributes """ def __init__ (self,file=None,inst=None, type='Polynomial1D',degree=2,sigdegree=0, pix0=0,rad=5, spectrum=None,model=None,sc0=None,rows=None, transpose=False,lags=None,channel=None,hdu=1) : if file is not None : """ Initialize object from FITS file """ if file == '?' : out=glob.glob( str(files(pyvista.data).joinpath('*/*trace*.fits'))) print('available predefined traces: ') for o in out : print(o.split('/')[-2]+'/'+o.split('/')[-1]) return try: if str(file)[0] == '.' or str(file)[0] == '/' : tab=Table.read(file,hdu=hdu) else : tab=Table.read(files(pyvista.data).joinpath(file),hdu=hdu) except FileNotFoundError : raise ValueError("can't find file {:s}",file) for tag in ['type','degree','sc0','pix0', 'spectrum','rad','lags','transpose'] : setattr(self,tag, tab[tag][0]) for tag in ['rows','index'] : try : setattr(self,tag,tab[tag][0]) except KeyError : print('no attribute: ', tag) setattr(self,tag,None) # use saved coefficients to instantiate model coeffs = tab['coeffs'][0] self.model = [] for row in coeffs : if self.type == 'Polynomial1D' : kwargs={} for i,c in enumerate(row) : name='c{:d}'.format(i) kwargs[name] = c self.model.append( models.Polynomial1D(degree=self.degree,**kwargs)) else : raise ValueError('Only Polynomial1D currently implemented') try : self.sigdegree = tab['sigdegree'][0] except : self.sigdegree = sigdegree try : sigcoeffs = tab['sigcoeffs'][0] self.sigmodel = [] for row in sigcoeffs : if self.type == 'Polynomial1D' : kwargs={} for i,c in enumerate(row) : name='c{:d}'.format(i) kwargs[name] = c self.sigmodel.append( models.Polynomial1D(degree=self.degree,**kwargs)) else : raise ValueError('Only Polynomial1D currently implemented') except KeyError : sigcoeffs = None self.sigmodel = None return self.type = type self.degree = degree self.sigdegree = sigdegree self.pix0 = pix0 self.spectrum = spectrum self.rad = rad self.transpose = transpose if inst == 'TSPEC' : self.degree = 3 self.rows = [[135,235],[295,395],[435,535],[560,660],[735,830]] self.lags = range(-75,75) elif inst == 'DIS' : if channel == 0 : self.rows=[215,915] elif channel == 1 : self.rows=[100,800] else : raise ValueError('need to specify channel') self.lags = range(-300,300) elif inst == 'KOSMOS' : self.rows=[550,1450] self.lags = range(-300,300) self.transpose = True elif inst == 'ARCES' : self.lags = range(-10,10) else : self.lags = range(-50,50) if rows is not None : self.rows=rows if lags is not None : self.lags=lags if model is not None : self.model=model else : self.model=None self.sigmodel=None if sc0 is not None : self.sc0=sc0 else : self.sc0 = None def write(self,file,append=False) : """ Write trace information to FITS file """ tab=Table() for tag in ['type','degree','sc0','pix0', 'spectrum','rad','lags','transpose'] : tab[tag] = [getattr(self,tag)] for tag in ['rows','index'] : try : if getattr(self,tag) is not None : tab[tag] = [np.array(getattr(self,tag))] except AttributeError : print('no attribute: ', tag) coeffs = [] if self.type == 'Polynomial1D' : # load model coefficients for m in self.model : row=[] for i in range(self.degree+1) : name='c{:d}'.format(i) row.append(getattr(m,name).value) coeffs.append(row) tab['coeffs'] = [np.array(coeffs)] if self.sigmodel is not None : coeffs = [] if self.type == 'Polynomial1D' : # load model coefficients for m in self.sigmodel : row=[] for i in range(self.degree+1) : name='c{:d}'.format(i) row.append(getattr(m,name).value) coeffs.append(row) tab['sigcoeffs'] = [np.array(coeffs)] if append : tab.write(file,append=True) else : tab.write(file,overwrite=True) return tab def trace(self,im,srows,sc0=None,plot=None,display=None, rad=None, thresh=20,index=None,skip=10,gaussian=False) : """ Trace a spectrum from starting position Parameters ---------- im : Data input image srows : array-like location(s) at sc0 for initial trace location(s) guess(es) rad : float, optional, default=self.rad radius of window to use to find trace locations index : integer, optional, default=None index to label trace(s) with skip : integer, optional, default=10 measure trace center every skip pixels, using median of data from -skip/2 to skip/2 gaussian : bool, optional, default=False if True, use gaussian fit for trace location instead of centroid. with gaussian=True, will also fit trace widths into sigmodel, with polynomial of degree self.sigdegree sc0 : integer, optional, default=ncol/2 plot : bool, optional, default=None display : TV object, optional, default=None """ if plot == None and display != None : plot = display fitter=fitting.LinearLSQFitter() if self.type == 'Polynomial1D' : mod=models.Polynomial1D(degree=self.degree) sigmod=models.Polynomial1D(degree=self.sigdegree) else : raise ValueError('unknown fitting type: '+self.type) return if index is not None and len(index) != len(srows) : raise ValueError('length of index and srows must be the same') if self.transpose : hd = dataclass.transpose(im) else : hd = im nrow = hd.data.shape[0] ncol = hd.data.shape[1] if sc0 is None : if self.sc0 is None : self.sc0 = ncol//2 else : self.sc0 = sc0 self.spectrum = hd.data[:,self.sc0] self.spectrum[self.spectrum<0] = 0. rows = np.arange(nrow) ypos = np.zeros(ncol) ysum = np.zeros(ncol) yvar = np.zeros(ncol) ymask = np.ones(ncol,dtype=bool) ygpos = np.zeros(ncol) ygsig = np.zeros(ncol) pixmask = bitmask.PixelBitMask() # we want to handle multiple traces, so make sure srows is iterable if type(srows ) is int or type(srows) is float : srows=[srows] self.model=[] if gaussian : self.sigmodel=[] #fig,ax=plots.multi(1,1) if plot : plot.clear() plot.tv(hd) plot.plotax2.cla() if rad is None : rad = self.rad-1 for irow,srow in enumerate(srows) : try: print(' Tracing row: {:d}'.format(int(srow)),end='\r') except: pdb.set_trace() continue sr=copy.copy(srow) sr=int(round(sr)) sr=hd.data[sr-rad:sr+rad+1,self.sc0].argmax()+sr-rad # march left from center for col in range(self.sc0,skip//2,-skip) : # centroid data = np.median(hd.data[:,col-skip//2:col+skip//2+1],axis=1) var = np.median(hd.uncertainty.array[:,col-skip//2:col+skip//2+1]**2,axis=1)/(2*skip) cr=sr-rad+data[sr-rad:sr+rad+1].argmax() ysum[col] = np.sum(data[cr-rad:cr+rad+1]) ypos[col] = np.sum(rows[cr-rad:cr+rad+1]*data[cr-rad:cr+rad+1]) / ysum[col] yvar[col] = np.sum(var[cr-rad:cr+rad+1]) ymask[col] = False # gaussian fit if gaussian : #gcoeff=gfit(data,cr,rad=rad,sig=2,back=0.) try : gcoeff=gfit(data,cr,rad=rad,sig=2,back=0.) #ax.plot(data) ygpos[col] = gcoeff[1] ygsig[col] = gcoeff[2] except : pass # if centroid is too far from starting guess, mask as bad if np.abs(ypos[col]-sr) > rad : ymask[col] = True # use this position as starting center for next #if above threshold S/N if ((not ymask[col]) & np.isfinite(ysum[col]) & (ysum[col]/np.sqrt(yvar[col]) > thresh) ) : sr=int(round(ypos[col])) # march right from center sr=copy.copy(srow) sr=int(round(sr)) sr=hd.data[sr-rad:sr+rad+1,self.sc0].argmax()+sr-rad for col in range(self.sc0+skip,ncol,skip) : # centroid data = np.median(hd.data[:,col-skip//2:col+skip//2+1],axis=1) var = np.median(hd.uncertainty.array[:,col-skip//2:col+skip//2+1]**2,axis=1)/(2*skip) cr=sr-rad+data[sr-rad:sr+rad+1].argmax() ysum[col] = np.sum(data[cr-rad:cr+rad+1]) ypos[col] = np.sum(rows[cr-rad:cr+rad+1]*data[cr-rad:cr+rad+1]) / ysum[col] yvar[col] = np.sum(var[cr-rad:cr+rad+1]) ymask[col] = False # gaussian fit if gaussian : try : gcoeff=gfit(data,cr,rad=self.rad,sig=2,back=0.) #ax.plot(data) ygpos[col] = gcoeff[1] ygsig[col] = gcoeff[2] except : pass # use this position as starting center for next if above threshold S/N if np.abs(ypos[col]-sr) > rad : ymask[col] = True if ((not ymask[col]) & np.isfinite(ysum[col]) & (ysum[col]/np.sqrt(yvar[col]) > thresh) ) : sr=int(round(ypos[col])) # do a fit to the measured locations cols=np.arange(ncol) gd = np.where((~ymask) & (ysum/np.sqrt(yvar)>thresh) )[0] if gaussian : # use gaussian fit centers model=(fitter(mod,cols[gd],ygpos[gd])) res = model(cols)-ygpos else : # use centroid model=(fitter(mod,cols[gd],ypos[gd])) res = model(cols)-ypos # reject outlier points (>1 pixel) and refit gd = np.where((~ymask) & (ysum/np.sqrt(yvar)>thresh) & (np.abs(res)<rad))[0] if gaussian: model=(fitter(mod,cols[gd],ygpos[gd])) sigmodel=(fitter(sigmod,cols[gd],ygsig[gd])) self.sigmodel.append(sigmodel) else : model=(fitter(mod,cols[gd],ypos[gd])) if len(gd) < self.degree*2 : print(' failed trace for row: {:d} {:d} {:d}'.format(irow,len(gd),len(res))) self.model.append(model) if plot : valid = np.where(ypos>0.)[0] if gaussian : plot.ax.scatter(cols[valid],ygpos[valid],marker='o',color='r',s=50) plot.ax.scatter(cols[gd],ygpos[gd],marker='o',color='g',s=50) else : plot.ax.scatter(cols[valid],ypos[valid],marker='o',color='r',s=50) plot.ax.scatter(cols[gd],ypos[gd],marker='o',color='g',s=50) plot.ax.plot(cols,model(cols),color='m') plot.plotax2.plot(cols,model(cols),color='m') plot.plotax2.text(0.05,0.95,'Derived trace', transform=plot.plotax2.transAxes) #plt.pause(0.05) plt.draw() self.pix0=0 if index is not None : self.index = index else : self.index=np.arange(len(self.model)) print("") if plot : while getinput(' See trace. Hit space bar to continue....',plot.fig)[2] != ' ' : pass def retrace(self,hd,plot=None,display=None,thresh=20,gaussian=False,skip=10) : """ Retrace starting with existing model """ if plot == None and display != None : plot = display self.find(hd) srows = [] for row in range(len(self.model)) : print("Using shift: ",self.pix0) srows.append(self.model[row](self.sc0)+self.pix0) self.trace(hd,srows,plot=plot,thresh=thresh,gaussian=gaussian,skip=10) def findpeak(self,hd,sc0=None,width=100,thresh=50,plot=False, smooth=5,diff=10000,bundle=10000,verbose=False) : """ Find peaks in spatial profile for subsequent tracing Parameters ---------- hd : Data object Input image sc0 : int, default=None pixel location of wavelength to make spatial profile around if none, use sc0 defined in trace width : int, default=100 width of window around specfied wavelength to median to give spatial profile thresh : float, default = 50 threshold for finding objects, as a factor to be multiplied by the median uncertainty smooth : float, default = 5 smoothing FWHM (pixels) for cross-section before peak finding Returns ------- tuple : list of peak locations, and list of indices peak locations can be passed to trace() """ if self.transpose : im = dataclass.transpose(hd) else : im = copy.deepcopy(hd) if sc0 is None : if self.sc0 is None: self.sc0 = im.data.shape[1]//2 sc0 = self.sc0 print('looking for peaks using {:d} pixels around {:d}, threshhold of {:f}'. format(2*width,sc0,thresh)) nrows=im.data.shape[0] if self.rows is None : self.rows=[0,nrows] back =np.percentile(im.data[self.rows[0]:self.rows[1], sc0-width:sc0+width],10) sig =np.median(im.uncertainty.array[self.rows[0]:self.rows[1], sc0-width:sc0+width])/np.sqrt(2*width) data = np.median(im.data[self.rows[0]:self.rows[1], sc0-width:sc0+width],axis=1)-back if smooth > 0 : data = gaussian_filter1d(data, smooth/2.354) if plot : plt.figure() plt.plot(np.arange(self.rows[0],self.rows[1]), np.median(im.data[self.rows[0]:self.rows[1], self.sc0-width:self.sc0+width],axis=1)-back) plt.plot(data) plt.xlabel('Spatial pixel') plt.ylabel('Median flux') peaks,fiber = findpeak(data, thresh=thresh*sig, diff=diff, bundle=bundle,verbose=verbose) print('peaks: ',peaks) print('aperture/fiber: ',fiber) return np.array(peaks)+self.rows[0], fiber def find(self,hd,sc0=None,width=100,lags=None,plot=None,display=None,inter=False,rad=3) : """ Determine shift from existing trace to input frame Parameters ---------- hd : Data object Input image width : int, default=100 width of window around central wavelength to median to give spatial profile lags : array-like, default=self.lags range of cross-correlation lags to allow rad : int, default=3 radius around xcorr peak to do polynomial fit to display : pyvista.tv object, default=None if not None, tv object to display in """ if lags is None : lags = self.lags if plot == None and display != None : plot = display if self.transpose : im = dataclass.transpose(hd) else : im = copy.deepcopy(hd) if inter : try : display.tv(im) except : raise ValueError('must use display= with inter=True') print('Hit "f" on location of spectrum: ') button,x,y=display.tvmark() self.pix0=y-self.model[0](x) print('setting trace offset to: ', self.pix0) return # get median around central column if sc0 is None : if self.sc0 is None: self.sc0 = im.data.shape[1]//2 sc0 = self.sc0 spec=np.median(im.data[:,sc0-width:sc0+width],axis=1) # if we have a window, zero array outside of window try: spec[:self.rows[0]] = 0. spec[self.rows[1]:] = 0. except: pass # cross-correlate with saved spectrum to get shift fitpeak,shift = image.xcorr(self.spectrum,spec,lags,rad=rad) pixshift=(fitpeak+lags[0])[0] print(' Derived pixel shift from input trace: ',pixshift) if plot is not None : plot.clear() plot.tv(im) plot.plotax1.cla() plot.plotax1.text(0.05,0.95,'obj and ref cross-section', transform=plot.plotax1.transAxes) plot.plotax1.plot(self.spectrum/self.spectrum.max()) plot.plotax1.plot(im.data[:,sc0]/im.data[:,sc0].max()) plot.plotax1.set_xlabel('row') plot.histclick=False plot.plotax2.cla() plot.plotax2.text(0.05,0.95, 'cross correlation {:8.3f}'.format(pixshift), transform=plot.plotax2.transAxes) plot.plotax2.plot(lags,shift) plot.plotax2.set_xlabel('lag') plt.draw() getinput(' See spectra and cross-correlation.\n'+ ' Hit any key in display window to continue....',plot.fig) self.pix0=fitpeak+lags[0] self.pix0=pixshift return fitpeak+lags[0] def immodel(self,im,ext,threads=0) : """ Create model 2D image from input fluxes """ if self.transpose : new = (im.data*0.).T else : new = im.data*0. ncols = im.data.shape[1] pars=[] if threads == 0 : skip=1 npars=ncols else : skip=ncols//threads npars=threads for col in range(npars) : if col == threads-1 : ec=ncols else : ec=col*skip+skip pars.append((ext.data[:,col*skip:ec],new.shape[0], np.arange(col*skip,ec),self.model,self.sigmodel,self.index)) if threads > 0 : pool = mp.Pool(threads) output = pool.map_async(model_col, pars).get() pool.close() pool.join() col=0 for out in output : nc=out.shape[1] new[:,col:col+nc] = out col+=skip else : col=0 for par in pars : out=model_col(par) new[:,col:col+skip] = out col+=skip if self.transpose : return new.T else : return new def extract(self,im,rad=None,back=[],fit=False,old=False, display=None,plot=None,medfilt=None,nout=None,threads=0) : """ Extract spectrum given trace(s) Parameters ---------- hd : Data object Input image rad : float, default=self.rad radius for extraction window back : array-like of array-like list of two-element lists giving start and end of background window(s), in units of pixels relative to trace location nout : integer, default=None used for multi-object spectra. If not None, specifies number of rows of output image; each extracted spectrum will be loaded into indices loaded into index attribute, with an index for each trace """ if plot == None and display != None : plot = display if self.transpose : hd = dataclass.transpose(im) else : hd = copy.deepcopy(im) if hd.bitmask is None : hd.add_bitmask(np.zeros_like(hd.data,dtype=np.uintc)) if fit and (self.sigmodel is None or len(self.sigmodel) == 0) : raise ValueError('must have a sigmodel to use fit extraction.'+ 'Use gaussian=True in trace') if rad is None : rad=self.rad if back is None : back = [] if len(back) > 0 : for bk in back: try : if (len(bk) != 2 or not isinstance(bk[0],int) or not isinstance(bk[1],int) ) : raise ValueError('back must be list of [backlo,backhi] integer pairs') except : raise ValueError('back must be list of [backlo,backhi] integer pairs') nrows=hd.data.shape[0] ncols=hd.data.shape[-1] if nout is not None : spec = np.zeros([nout,hd.data.shape[1]]) sig = np.zeros([nout,hd.data.shape[1]]) bitmask = np.zeros([nout,hd.data.shape[1]],dtype=np.uintc) else : spec = np.zeros([len(self.model),hd.data.shape[1]]) sig = np.zeros([len(self.model),hd.data.shape[1]]) bitmask = np.zeros([len(self.model),hd.data.shape[1]],dtype=np.uintc) pars=[] if threads == 0 : skip=1 npars=ncols skip=ncols npars=1 else : skip=ncols//threads npars=threads for col in range(npars) : if col == threads-1 : ec=ncols else : ec=col*skip+skip pars.append((hd.data[:,col*skip:ec], hd.uncertainty.array[:,col*skip:ec], hd.bitmask[:,col*skip:ec], np.arange(col*skip,ec), self.model,rad,self.pix0,back,self.sigmodel)) print(' extracting ... ') if threads > 0 : pool = mp.Pool(threads) if fit : output = pool.map_async(extract_col_fit, pars).get() elif old : output = pool.map_async(extract_col_old, pars).get() else : output = pool.map_async(extract_col, pars).get() pool.close() pool.join() col=0 for out in output : nc=out[0].shape[1] spec[self.index,col:col+nc] = out[0] sig[self.index,col:col+nc] = out[1] bitmask[self.index,col:col+nc] = out[2] col+=skip else : col=0 for par in pars : if fit : out=extract_col_fit(par) elif old : print(' may take some time, consider threads=') out=extract_col_old(par) else : out=extract_col(par) spec[self.index,col:col+skip] = out[0] sig[self.index,col:col+skip] = out[1] bitmask[self.index,col:col+skip] = out[2] col+=skip if plot is not None: plot.clear() plot.tv(hd) for j,model in enumerate(self.model) : i=self.index[j] if medfilt is not None : boxcar = Box1DKernel(medfilt) median = convolve(spec[i,:],boxcar,boundary='extend') spec[i,:]/=median sig[i,:]/=median if plot is not None : cr=model(np.arange(ncols))+self.pix0 if i%2 == 0 : color='b' else : color='m' plot.ax.plot(range(ncols),cr,color='g',linewidth=3) plot.ax.plot(range(ncols),cr-rad,color=color,linewidth=1) plot.ax.plot(range(ncols),cr+rad,color=color,linewidth=1) if len(back) > 0 : for bk in back: plot.ax.plot(range(ncols),cr+bk[0],color='r',linewidth=1) plot.ax.plot(range(ncols),cr+bk[1],color='r',linewidth=1) plot.plotax2.cla() plot.plotax2.plot(range(ncols),spec[i],color=color,linewidth=1) plot.plotax2.text(0.05,0.95,'Extracted spectrum', transform=plot.plotax2.transAxes) plt.draw() if plot is not None : while getinput(' See extraction window(s). Hit space bar to continue....',plot.fig)[2] != ' ' : pass print("") return Data(spec,uncertainty=StdDevUncertainty(sig), bitmask=bitmask,header=hd.header) def extract2d(self,im,rows=None,plot=None,display=None) : """ Extract 2D spectrum given trace(s) Assumes all requested rows uses same trace, just offset, not a 2D model for traces. Linear interpolation is used. """ if plot == None and display != None : plot = display if self.transpose : hd = dataclass.transpose(im) else : hd = im nrows=hd.data.shape[0] ncols=hd.data.shape[-1] out=[] if plot is not None: plot.clear() plot.tv(hd) if rows != None : self.rows = rows if self.rows is None : self.rows=[0,nrows] if self.sc0 is None : self.sc0 = ncols//2 for model in self.model : if plot is not None : plot.ax.plot([0,ncols],[self.rows[0],self.rows[0]],color='g') plot.ax.plot([0,ncols],[self.rows[1],self.rows[1]],color='g') plt.draw() outrows=np.arange(self.rows[0],self.rows[1]) noutrows=len(range(self.rows[0],self.rows[1])) spec=np.zeros([noutrows,ncols]) sig=np.zeros([noutrows,ncols]) bitmask=np.zeros([noutrows,ncols],dtype=np.uintc) cr=model(np.arange(ncols)) cr-=cr[self.sc0] for col in range(ncols) : spec[:,col] = np.interp(outrows+cr[col],np.arange(nrows), hd.data[:,col]) sig[:,col] = np.sqrt(np.interp(outrows+cr[col],np.arange(nrows), hd.uncertainty.array[:,col]**2)) for bit in range(0,32) : mask = (hd.bitmask[:,col] & 2**bit) if mask.max() > 0 : maskint = np.interp(outrows+cr[col],np.arange(nrows),mask) bitset = np.where(maskint>0)[0] bitmask[bitset,col] |= 2**bit out.append(Data(spec,StdDevUncertainty(sig), bitmask=bitmask,header=hd.header)) if plot is not None: while getinput(' See extraction window(s). Hit space bar to continue....',plot.fig)[2] != ' ' : pass if len(out) == 1 : return out[0] else : return out class FluxCal() : """ Class for flux calibration Parameters ---------- degree : int, default=3 Order of polynomial for response curve, -1 for median/mean median : bool, default=False if degree<0, use median response curve rather than mean extinct : Table/str, default='flux/apo_extinct.dat' mean extinction curve to use, can be input as astropy Table with columns ['wave','mag'], or a filename from which these can be read Attributes ---------- """ def __init__(self,degree=3,median=False,extinct='flux/apo_extinct.dat') : self.nstars = 0 self.waves = [] self.weights = [] self.obs = [] self.obscorr = [] self.true = [] self.weights = [] self.name = [] self.degree = degree self.median = False self.mean = True if median : self.mean = False self.median = True self.response_curve = None if type(extinct) is astropy.table.table.Table : self.meanextinct = extinct elif str(extinct)[0] == '.' or str(extinct)[0] == '/' : self.meanextinct=Table.read(extinct,format='ascii') elif extinct is not None : self.meanextinct=Table.read(files(pyvista.data).joinpath(extinct), names=['wave','mag'],format='ascii') else : raise ValueError('must specify either file= or stdflux=') def extinct(self,hd,wave) : """ Correct input image for atmospheric extinction Parameters ---------- hd : Data object with data Input image wave : float, array-like Wavelengths for input image (separate from attribute to allow slicing in hd) file : str, default='flux/apo_extinct.dat' Two column file (['wave','mag']) with extinction curve """ x = skycalc.airmass(hd.header) ext = np.interp(wave,self.meanextinct['wave'],self.meanextinct['mag']) corr = 10**(-0.4*ext*x) out=copy.deepcopy(hd) out.data /=corr out.uncertainty.array /=corr return out def addstar(self,hd,wave,pixelmask=None,file=None,stdflux=None,extinct=True) : """ Derive flux calibration vector from standard star Parameters ---------- hd : Data object with standard star spectrum Input image file : str, optional File with calibrated fluxes, with columns ['wave','flux','bin'], must be readable by astropy.io.ascii with format='ascii' stdflux : astropy Table, optional Table with calibrated fluxes in columns 'wave','flux','bin' extinct : boo, default=Ture Use mean extinction curve to correct for atmospheric extinction """ # any bad pixels? if pixelmask is not None : bd = np.bitwise_or.reduce(pixelmask.flatten()) pixelmask=bitmask.PixelBitMask() if bd & pixelmask.badval() : print('Bad pixels found in spectrum, not adding') return if stdflux is not None : tab=stdflux elif str(file)[0] == '.' or str(file)[0] == '/' : tab=Table.read(file,format='ascii') elif file is not None : tab=Table.read(files(pyvista.data).joinpath(file), names=['wave','flux','mjy','bin'],format='ascii') else : raise ValueError('must specify either file= or stdflux=') if extinct : extcorr = self.extinct(hd,wave) else : extcorr=copy.deepcopy(hd) obs=[] obscorr=[] w=[] true=[] weights=[] for line in tab : w1=line['wave']-line['bin']/2. w2=line['wave']+line['bin']/2. if w1 > wave.min() and w2 < wave.max() : j=np.where((wave >= w1) & (wave <= w2) )[0] obs.append(np.mean(hd.data[j])) obscorr.append(np.mean(extcorr.data[j])) w.append(line['wave']) true.append(line['flux']) weights.append(1.) w=np.array(w) obs=np.array(obs) obscorr=np.array(obscorr) true=np.array(true) weights=np.array(weights) self.waves.append(w) self.obs.append(obs) self.obscorr.append(obscorr) # mask areas around significant lines bdlines = [[7570,7730], [6850,7000], [6520, 6600], [4820,4900], [4300,4380]] for line in bdlines : bd=np.where((w>=line[0]) & (w<=line[1]) )[0] weights[bd] = 0. bd=np.where(~np.isfinite(obscorr)|(obscorr<=0.))[0] weights[bd] = 0. self.weights.append(weights) self.true.append(true) self.name.append('{:s} {:f}'.format( hd.header['FILE'],skycalc.airmass(hd.header))) self.nstars += 1 def response(self,degree=None,inter=False,plot=True,legend=True,hard=None,medfilt=None) : """ Create response curve from loaded standard star spectra and fluxes Parameters ---------- degree : integer, default=self.degree polynomial degree medfilt : integer, default=None width of median filter to apply to mean/median response curve plot : bool, default=False set to True to see plot legend : bool, default=True label stars on plot with a legend hard : str, default=None file name for hardcopy plot """ if self.nstars < 1 : raise ValueError('you must add at least one star with addstar') if degree is not None : self.degree = degree des=[] rhs=[] if plot : fig,ax=plots.multi(1,3,hspace=0.001) for istar,(wav,obs,true,weight,name) in enumerate( zip(self.waves,self.obscorr,self.true,self.weights,self.name)) : gd=np.where(weight > 0.)[0] if self.degree >= 0 : vander=np.vander(wav,self.degree+1) design=np.zeros([len(wav),self.degree+self.nstars-1]) design[:,0:self.degree]=(vander[:,0:self.degree]* np.repeat(weight,self.degree).reshape(len(wav),self.degree)) if istar>0 : design[:,self.degree+istar-1] = 1. des.append(design) tmp=-2.5*np.log10(obs/true)*weight bd=np.where(~np.isfinite(tmp))[0] tmp[bd] = 0. rhs.append(tmp) if plot : line,=ax[0].plot(wav,-2.5*np.log10(obs/true),lw=1) ax[0].plot(wav[gd],-2.5*np.log10(obs[gd]/true[gd]), lw=0,marker='o',color=line.get_color(), markersize=2, label='{:s}'.format(name)) ax[1].plot(wav,-2.5*np.log10(obs), lw=1,color=line.get_color(), label='{:s}'.format(name)) ax[2].plot(wav,-2.5*np.log10(true), lw=1,color=line.get_color(), label='{:s}'.format(name)) ax[2].set_xlabel('Wavelength') ax[0].set_ylabel('-2.5 log(obs/true )') ax[1].set_ylabel('-2.5 log(obs)') ax[2].set_ylabel('-2.5 log(true)') if plot : for i in range(3) : yr=ax[i].get_ylim() ax[i].set_ylim(yr[0]+5, yr[0]) if self.degree >= 0 : design=np.vstack(des) rhs=np.hstack(rhs) out=np.linalg.solve(np.dot(design.T,design),np.dot(design.T,rhs)) self.coeffs = np.append(out[0:self.degree],0.) if plot : plt.gca().set_prop_cycle(None) for istar,wav in enumerate(self.waves) : if istar>0 : vec = np.append(out[0:self.degree],out[self.degree+istar-1]) else : vec = np.append(out[0:self.degree],0.) self.coeffs = vec ax[0].plot(wav,np.polyval(vec,wav)) else : for wav in self.waves : if not np.array_equal(wav,self.waves[0]) : raise ValueError('cannot median response curves if not all on same wavelengths') allobs = np.array(self.obscorr) alltrue = np.array(self.true) allwav = np.array(self.waves) allweights = np.array(self.weights) if self.mean : self.response_curve = np.mean(-2.5*np.log10(allobs/alltrue),axis=0) else : self.response_curve = np.nanmedian(-2.5*np.log10(allobs/alltrue),axis=0) if medfilt is not None : self.response_curve = median_filter(self.response_curve,size=medfilt) if plot : for istar,wav in enumerate(self.waves) : ax[2].plot(wav,-2.5*np.log10(obs/10.**(-0.4*self.response_curve))) ax[0].plot(wav,self.response_curve,lw=5,color='k',label='response curve') if legend : ax[0].legend(fontsize='xx-small') plt.draw() if plot and hard is not None : print('saving: ', hard) fig.savefig(hard) def correct(self,hd,waves,extinct=True) : """ Apply flux correction to input spectrum Parameters ---------- hd : Data object with spectrum to be corrected Input image waves : array-like Wavelength array for hd (separate from hd to allow slicing of hd) """ if extinct : extcorr = self.extinct(hd,waves) if self.degree >= 0 : for irow,row in enumerate(hd.data) : corr = 10.**(-0.4*np.polyval(self.coeffs,waves)) hd.data[irow] /= corr hd.uncertainty.array[irow] /= corr else : spline = scipy.interpolate.CubicSpline(self.waves[0],self.response_curve) for irow,row in enumerate(hd.data) : corr = 10.**(-0.4*spline(waves[irow])) hd.data[irow] /= corr hd.uncertainty.array[irow] /= corr def refraction(self,h=2000,temp=10,rh=0.25) : p0=101325 M = 0.02896968 g = 9.80665 T0 = 288.16 R0 = 8.314462618 pressure = p0 *np.exp(-g*h*M/T0/R0)*10 ref=erfa.refco(pressure,temp,rh,wav)[0]*206265 def gfit(data,x0,rad=10,sig=3,back=None) : """ Fit 1D gaussian """ xx = np.arange(x0-rad,x0+rad+1) yy = data[x0-rad:x0+rad+1] peak=yy.argmax()+x0-rad xx = np.arange(peak-rad,peak+rad+1) yy = data[peak-rad:peak+rad+1] if back == None : p0 = [data[peak],peak,sig] bounds = ((yy.min(),peak-rad,0.3),(yy.max(),peak+rad,rad)) else : p0 = [data[peak],peak,sig,yy.min()] bounds = ((yy.min(),peak-rad,0.3,0),(yy.max()+1.e-3,peak+rad,rad,yy.max())) coeff, var_matrix = curve_fit(gauss, xx, yy, p0=p0,bounds=bounds) fit = gauss(xx,*coeff) return coeff def qgauss(x, *p): A, mu, sigma = p return A*np.exp(-(x-mu)**2/(2.*sigma**2))/np.sqrt(2*np.pi)/sigma def gauss(x, *p): """ Gaussian function """ if len(p) == 3 : A, mu, sigma = p back = 0. elif len(p) == 4 : A, mu, sigma, back = p elif len(p) == 5 : A, mu, sigma, back0, backslope = p back = back0 + x*backslope elif len(p) == 7 : A, mu, sigma, B, Bmu, Bsigma, back = p return A*np.exp(-(x-mu)**2/(2.*sigma**2))+B*np.exp(-(x-Bmu)**2/2.*Bsigma**2)+back return A*np.exp(-(x-mu)**2/(2.*sigma**2))+back def findpeak(x,thresh,diff=10000,bundle=0,verbose=False) : """ Find peaks in vector x above input threshold attempts to associate an index with each depending on spacing Parameters ---------- x : float, array-like input vector to find peaks in thresh : float threshold for peak finding diff : int maximum difference in pixels between traces before incrementing fiber index bundle : int number of fibers after which to allow max distance to be exceeded without incrementing """ j=[] fiber=[] f=-1 for i in range(len(x)) : if i>0 and i < len(x)-1 and x[i]>x[i-1] and x[i]>x[i+1] and x[i]>thresh : j.append(i) if verbose and len(j) > 1 : print(j[-1],j[-2],j[-1]-j[-2],f+1) if len(j) > 1 : sep=j[-1]-j[-2] if len(j)>1 and bundle> 0 and (f+1)%bundle != 0 and (f+1)%bundle != bundle-1 : #print(j[-1],j[-2],j[-1]-j[-2],f) f=f+sep//diff + 1 elif len(j)>1 and bundle > 0: sep = (sep-13) if sep-13 > 0 else 0 f=f+sep//diff + 1 else : f=f+1 fiber.append(f) return j,fiber def getinput(prompt,fig=None,index=False) : """ Get input from terminal or matplotlib figure """ if fig == None : return '','',input(prompt) print(prompt) get = plots.mark(fig,index=index) return get def model_col(pars) : """ Extract a single column, using boxcar extraction for multiple traces """ ext,nrow,cols,models,sigmodels,index = pars new = np.zeros([nrow,len(cols)]) for jcol,col in enumerate(cols) : row = np.arange(0,nrow) coldata= np.zeros([nrow]) for i,(model,sigmodel) in enumerate(zip(models,sigmodels)) : cr=model(col) sig=sigmodel(col) rows=np.arange(int(cr-5*sig),int(cr+5*sig)) coldata[rows] += qgauss(rows,ext[index[i],jcol],cr,sig) new[:,jcol] = coldata return new def extract_col_fit(pars) : """ Extract a single column, using boxcar extraction for multiple traces """ data,err,bitmask,cols,models,rad,pix0,back,sigmodels = pars spec = np.zeros([len(models),len(cols)]) sig = np.zeros([len(models),len(cols)]) mask = np.zeros([len(models),len(cols)],dtype=np.uintc) for jcol,col in enumerate(cols) : center=[] sigma=[] for i,(model,sigmodel) in enumerate(zip(models,sigmodels)) : center.append(model(col)) sigma.append(sigmodel(col)) center=np.array(center) sigma=np.array(sigma) n=len(models) # get background to subtract bpix = np.array([]) bvar = np.array([]) for bk in back : bpix=np.append(bpix,data[bk[0]:bk[1],jcol]) bvar=np.append(bvar,err[bk[0]:bk[1],jcol]**2) bck = np.median(bpix) print(col,bck) ab=np.zeros([3,n]) b=np.zeros([n]) for row in range(data.shape[0]) : nearest=np.argmin(np.abs(row-center)) if nearest == 0 : for j in [0,1] : ab[j+1,nearest] += ( qgauss(row, 1.,center[nearest],sigma[nearest]) * qgauss(row, 1.,center[nearest+j],sigma[nearest+j]) ) elif nearest == n-1 : for j in [-1,0] : ab[j+1,nearest] += ( qgauss(row, 1.,center[nearest],sigma[nearest]) * qgauss(row, 1.,center[nearest+j],sigma[nearest+j]) ) else : for j in [-1,0,1] : ab[j+1,nearest] += ( qgauss(row, 1.,center[nearest],sigma[nearest]) * qgauss(row, 1.,center[nearest+j],sigma[nearest+j]) ) b[nearest] += (data[row,jcol]-bck) * qgauss(row,1.,center[nearest],sigma[nearest]) x=solve_banded((1,1),ab,b) spec[:,jcol] = x return spec,sig, mask def extract_col_old(pars) : """ Extract a single column, using boxcar extraction for multiple traces """ data,err,bitmask,cols,models,rad,pix0,back,sigmodels = pars spec = np.zeros([len(models),len(cols)]) sig = np.zeros([len(models),len(cols)]) mask = np.zeros([len(models),len(cols)],dtype=np.uintc) for i,model in enumerate(models) : for j,col in enumerate(cols) : cr=model(col)+pix0 icr=np.round(cr).astype(int) rfrac=cr-icr+0.5 # add 0.5 because we rounded r1=icr-rad r2=icr+rad try : if r1>=0 and r2<data.size : # sum inner pixels directly spec[i,j]=np.sum(data[r1+1:r2,j]) sig[i,j]=np.sum(err[r1+1:r2,j]**2) # outer pixels depending on fractional pixel location of trace spec[i,j]+=data[r1,j]*(1-rfrac) sig[i,j]+=err[r1,j]**2*(1-rfrac) spec[i,j]+=data[r2,j]*rfrac sig[i,j]+=err[r2,j]**2*rfrac sig[i,j]=np.sqrt(sig[i,j]) mask[i,j] = np.bitwise_or.reduce(bitmask[r1:r2+1,j]) if len(back) > 0 : bpix = np.array([]) bvar = np.array([]) for bk in back : bpix=np.append(bpix,data[icr+bk[0]:icr+bk[1],j]) bvar=np.append(bvar,err[icr+bk[0]:icr+bk[1],j]**2) spec[i,j] -= np.median(bpix)*(r2-r1) sig[i,j] = np.sqrt(sig[i,j]**2+np.sum(bvar)/(len(bvar)-1)) except : print(' extraction failed',i,j,col) pixmask=bitmask.PixelBitMask() mask[i,j] = pixmask.badval('BAD_EXTRACTION') return spec,sig, mask def extract_col(pars) : """ Extract a series of columns, using boxcar extraction for multiple traces """ data,err,bitmask,cols,models,rad,pix0,back,sigmodels = pars spec = np.zeros([len(models),len(cols)]) sig2 = np.zeros([len(models),len(cols)]) mask = np.zeros([len(models),len(cols)],dtype=np.uintc) ny=data.shape[0] ncol=data.shape[1] y,x = np.mgrid[0:data.shape[0],0:data.shape[1]] pix=np.zeros(data.shape) for i,model in enumerate(models) : # center of trace ymid=model(cols)+pix0 # calculate distance of each pixel from trace center ylo = np.int(np.min(np.floor(ymid-rad))) yhi = np.int(np.max(np.ceil(ymid+rad))) dist=y[ylo:yhi+1,:]-ymid # determine contribution of each pixel to boxcar contrib = np.zeros(dist.shape,float) # full pixel contribution iy,ix = np.where( (np.abs(dist)<rad-0.5) ) contrib[iy,ix] = 1. # fractional pixel contribution iy,ix = np.where( (np.abs(dist)>rad-0.5) & (np.abs(dist)<rad+0.5) ) contrib[iy,ix] = 1-(np.abs(dist[iy,ix])-(rad-0.5)) # add the contributions spec[i,:] = np.sum( data[ylo:yhi+1,:]*contrib, axis=0) sig2[i,:] = np.sum(err[ylo:yhi+1,:]**2*contrib**2, axis=0) # for bitmask take bitwise_or of pixels that have full contribution mask[i,:] = np.bitwise_or.reduce( bitmask[ylo:yhi+1,:]*contrib.astype(int),axis=0) # background background = np.empty_like(data) background[:] = np.nan background_err = copy.copy(background) if len(back) > 0 : dist = y - ymid nback=0 for bk in back : iy,ix = np.where( (dist>bk[0]) & (dist<bk[1]) ) background[iy,ix] = data[iy,ix] background_err[iy,ix] = err[iy,ix]**2 nback+=np.abs(bk[1]-bk[0]) spec[i,:] -= np.nanmedian(background,axis=0)*2*rad sig2[i,:] += np.nansum(background_err,axis=0)/nback*(2*rad) return spec, np.sqrt(sig2), mask
PypiClean
/pyplan-core-0.1.36.tar.gz/pyplan-core-0.1.36/pyplan_core/cubepy/axes.py
import numpy as np from pyplan_core.cubepy.exceptions import NonUniqueDimNamesError from pyplan_core.cubepy.utils import is_axis class Axes(object): """Axes is an internal helper class allowing easier manipulation with cube axes. It is not intended to be accessed by users of cubepy package. Get axis name of an axis of given index: ax_name = cube.axes[0].name Get index of axis of a given name: ax_index = cube.axes.index('a') Axes can be indexed using integer or string index: ax1 = cube.axes[0] ax_a = cube.axes['a'] Axes can be used as iterables: axes_list = list(cube.axes) # the above is better than [axis for axis in cube.axes] axes_dict = dict(name: axis for name, axis in enumerate(cube.axes))""" def __init__(self, axes): """If for non-unique axes are found, ValueError is raised. If axis has invalid type, TypeError is raised. :param axes: Axis or a collection of Axis objects (incl. another Axes object) """ # special case with zero axes if axes is None: self.axes = tuple() self.dims = tuple() return # special case with a single axis if is_axis(axes): axes = [axes] unique_names = set() for axis in axes: # test correct types if not is_axis(axis): raise TypeError("axis must be an instance of Axis") # test unique names - report the name of the first axis which is not unique if axis.name in unique_names: raise NonUniqueDimNamesError( "multiple axes with name '{}'".format(axis.name)) unique_names.add(axis.name) # the sequence of axes must be immutable self.axes = tuple(axes) self.dims = tuple(a.name for a in axes) def __repr__(self): axes = [str(a) for a in self.axes] return "Axes(" + ', '.join(axes) + ")" def __len__(self): return len(self.axes) def __getitem__(self, index): """Return an axis given by its index. :param index: int :return: an Axis object :raise: IndexError if not found """ return self.axes[index] def axis_by_index(self, index): return self.axes[index] def axis_by_name(self, name): """Returns None if not found. """ return next((axis for axis in self.axes if axis.name == name), None) def axis_and_index(self, axis): index = self.index(axis) return self[index], index def is_unique_subset(self, axes): """Tests whether all axes are contained in the Axes object and whether they are unique. """ raise NotImplementedError def complement(self, axes): """Return a tuple of indices of axes from Axes object which are not contained in the specified collection of axes. :param axes: collection of axes specified by axis name or index :return: tuple of int """ if isinstance(axes, str) or isinstance(axes, int): axes = (axes,) indices = set(self.index(a) for a in axes) if len(indices) != len(axes): raise ValueError("axes are not unique") return tuple(i for i in range(len(self)) if i not in indices) def index(self, axis): """Find axis index by name, by index, or by axis object. :param axis: int, str or Axis :return: int :raise: LookupError if not found """ # find by numeric index, normalize negative numbers if isinstance(axis, int): axis_count = len(self.axes) if 0 <= axis < axis_count: return axis if -axis_count <= axis < 0: # negative index is counted from the last axis backward return axis_count + axis raise LookupError("invalid axis index: {}".format(axis)) # find by name if isinstance(axis, str): for i, a in enumerate(self.axes): if a.name == axis: return i raise LookupError("invalid axis name: '{}'".format(axis)) # find by object identity if is_axis(axis): for i, a in enumerate(self.axes): if a is axis: return i # try by name return self.index(axis.name) #raise LookupError("axis not found: {}".format(axis)) raise TypeError("invalid axis identification type") def contains(self, axis): """Returns True/False indicating whether the axis is contained in the Axes object. Axis can be specified by name (str), by index (int) or by Axis object. """ try: self.index(axis) return True except LookupError: return False def transposed_indices(self, front, back): """Reorder axes by specified names or indices. Return a list of axis indices which correspond to the new order of axes. """ if isinstance(front, str) or isinstance(front, int) or is_axis(front): front = [front] if isinstance(back, str) or isinstance(back, int) or is_axis(back): back = [back] front_axes = list() back_axes = list() temp_axes = list(self.axes) for axis_id in front: index = self.index(axis_id) front_axes.append(index) if temp_axes[index] is None: raise ValueError("duplicate axes in transpose") temp_axes[index] = None for axis_id in back: index = self.index(axis_id) back_axes.append(index) if temp_axes[index] is None: raise ValueError("duplicate axes in transpose") temp_axes[index] = None middle_axes = [index for index, axis in enumerate( temp_axes) if axis is not None] return front_axes + middle_axes + back_axes def insert(self, axis, index=0): """Insert a new axis at the specified position and return the new Axes object. :param axis: the new axis to be inserted :param index: the index of the new axis :return: new Axes object """ axis_list = list(self.axes) # need to correctly handle negative values # for example: index -1 means that the new axis should be the last axis after the insertion if index < 0: index = len(axis_list) + 1 - index axis_list.insert(index, axis) return Axes(axis_list) def remove(self, axis_id): """Remove axis or axes with a given index or name. Return new Axes object. """ axis_index = self.index(axis_id) return self._remove(axis_index) def _remove(self, axis_index): new_axes = list(self.axes) del new_axes[axis_index] return Axes(new_axes) def rename(self, old_axis_id, new_axis_name): """Return an Axes object with a renamed axis. :param old_axis_id: axis index (int) or name (str) :param new_axis_name: the name of the new axis (str) :return: new Axes object """ old_axis, old_axis_index = self.axis_and_index(old_axis_id) new_axis = old_axis.rename(new_axis_name) return self._replace(old_axis_index, new_axis) def replace(self, old_axis_id, new_axis): """Replace an existing axis with a new axis and return the new Axes object. The new axes collection is checked for duplicate names. The old and new axes are NOT checked for equal lengths. :param old_axis_id: axis index (int) or name (str) :param new_axis: Series or Index object :return: new Axes object """ old_axis_index = self.index(old_axis_id) return self._replace(old_axis_index, new_axis) def _replace(self, old_axis_index, new_axis): new_axes = list(self.axes) new_axes[old_axis_index] = new_axis return Axes(new_axes) def swap(self, axis_id1, axis_id2): """Return a new Axes object with two axes swapped. :param axis_id1: name or index of the first axis :param axis_id2: name or index of the second axis :return: new Axes object """ index1 = self.index(axis_id1) index2 = self.index(axis_id2) new_axes = list(self) new_axes[index1], new_axes[index2] = new_axes[index2], new_axes[index1] return Axes(new_axes) def intersect(axes1, axes2): """Return the space intersect of the common axes. The order of values on each axis correspond to the order on the corresponding axis on axes1. The result can be used for inner join operations. :param axes1: Axes object :param axes2: Axes object :return: Axes """ common_axes = [] for axis1 in axes1: axis2 = axes2.axis_by_name(axis1.name) if axis2 is None: continue if axis1 is axes2: axis = axis1 else: # TODO: assume_unique=True ? indices = np.in1d(axis1.values, axis2.values) axis = axis1[indices] common_axes.append(axis) return Axes(common_axes) def make_axes(axes): """Creates an Axes object from a collection of axes.""" if not isinstance(axes, Axes): return Axes(axes) else: return axes
PypiClean
/yangsuite_grpc_telemetry-1.0.7-py3-none-any.whl/ysgrpctelemetry/static/ysgrpctelemetry/docs/_static/underscore-1.13.1.js
(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define('underscore', factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (function () { var current = global._; var exports = global._ = factory(); exports.noConflict = function () { global._ = current; return exports; }; }())); }(this, (function () { // Underscore.js 1.13.1 // https://underscorejs.org // (c) 2009-2021 Jeremy Ashkenas, Julian Gonggrijp, and DocumentCloud and Investigative Reporters & Editors // Underscore may be freely distributed under the MIT license. // Current version. var VERSION = '1.13.1'; // Establish the root object, `window` (`self`) in the browser, `global` // on the server, or `this` in some virtual machines. We use `self` // instead of `window` for `WebWorker` support. var root = typeof self == 'object' && self.self === self && self || typeof global == 'object' && global.global === global && global || Function('return this')() || {}; // Save bytes in the minified (but not gzipped) version: var ArrayProto = Array.prototype, ObjProto = Object.prototype; var SymbolProto = typeof Symbol !== 'undefined' ? Symbol.prototype : null; // Create quick reference variables for speed access to core prototypes. var push = ArrayProto.push, slice = ArrayProto.slice, toString = ObjProto.toString, hasOwnProperty = ObjProto.hasOwnProperty; // Modern feature detection. var supportsArrayBuffer = typeof ArrayBuffer !== 'undefined', supportsDataView = typeof DataView !== 'undefined'; // All **ECMAScript 5+** native function implementations that we hope to use // are declared here. var nativeIsArray = Array.isArray, nativeKeys = Object.keys, nativeCreate = Object.create, nativeIsView = supportsArrayBuffer && ArrayBuffer.isView; // Create references to these builtin functions because we override them. var _isNaN = isNaN, _isFinite = isFinite; // Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed. var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString'); var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString', 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString']; // The largest integer that can be represented exactly. var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1; // Some functions take a variable number of arguments, or a few expected // arguments at the beginning and then a variable number of values to operate // on. This helper accumulates all remaining arguments past the function’s // argument length (or an explicit `startIndex`), into an array that becomes // the last argument. Similar to ES6’s "rest parameter". function restArguments(func, startIndex) { startIndex = startIndex == null ? func.length - 1 : +startIndex; return function() { var length = Math.max(arguments.length - startIndex, 0), rest = Array(length), index = 0; for (; index < length; index++) { rest[index] = arguments[index + startIndex]; } switch (startIndex) { case 0: return func.call(this, rest); case 1: return func.call(this, arguments[0], rest); case 2: return func.call(this, arguments[0], arguments[1], rest); } var args = Array(startIndex + 1); for (index = 0; index < startIndex; index++) { args[index] = arguments[index]; } args[startIndex] = rest; return func.apply(this, args); }; } // Is a given variable an object? function isObject(obj) { var type = typeof obj; return type === 'function' || type === 'object' && !!obj; } // Is a given value equal to null? function isNull(obj) { return obj === null; } // Is a given variable undefined? function isUndefined(obj) { return obj === void 0; } // Is a given value a boolean? function isBoolean(obj) { return obj === true || obj === false || toString.call(obj) === '[object Boolean]'; } // Is a given value a DOM element? function isElement(obj) { return !!(obj && obj.nodeType === 1); } // Internal function for creating a `toString`-based type tester. function tagTester(name) { var tag = '[object ' + name + ']'; return function(obj) { return toString.call(obj) === tag; }; } var isString = tagTester('String'); var isNumber = tagTester('Number'); var isDate = tagTester('Date'); var isRegExp = tagTester('RegExp'); var isError = tagTester('Error'); var isSymbol = tagTester('Symbol'); var isArrayBuffer = tagTester('ArrayBuffer'); var isFunction = tagTester('Function'); // Optimize `isFunction` if appropriate. Work around some `typeof` bugs in old // v8, IE 11 (#1621), Safari 8 (#1929), and PhantomJS (#2236). var nodelist = root.document && root.document.childNodes; if (typeof /./ != 'function' && typeof Int8Array != 'object' && typeof nodelist != 'function') { isFunction = function(obj) { return typeof obj == 'function' || false; }; } var isFunction$1 = isFunction; var hasObjectTag = tagTester('Object'); // In IE 10 - Edge 13, `DataView` has string tag `'[object Object]'`. // In IE 11, the most common among them, this problem also applies to // `Map`, `WeakMap` and `Set`. var hasStringTagBug = ( supportsDataView && hasObjectTag(new DataView(new ArrayBuffer(8))) ), isIE11 = (typeof Map !== 'undefined' && hasObjectTag(new Map)); var isDataView = tagTester('DataView'); // In IE 10 - Edge 13, we need a different heuristic // to determine whether an object is a `DataView`. function ie10IsDataView(obj) { return obj != null && isFunction$1(obj.getInt8) && isArrayBuffer(obj.buffer); } var isDataView$1 = (hasStringTagBug ? ie10IsDataView : isDataView); // Is a given value an array? // Delegates to ECMA5's native `Array.isArray`. var isArray = nativeIsArray || tagTester('Array'); // Internal function to check whether `key` is an own property name of `obj`. function has$1(obj, key) { return obj != null && hasOwnProperty.call(obj, key); } var isArguments = tagTester('Arguments'); // Define a fallback version of the method in browsers (ahem, IE < 9), where // there isn't any inspectable "Arguments" type. (function() { if (!isArguments(arguments)) { isArguments = function(obj) { return has$1(obj, 'callee'); }; } }()); var isArguments$1 = isArguments; // Is a given object a finite number? function isFinite$1(obj) { return !isSymbol(obj) && _isFinite(obj) && !isNaN(parseFloat(obj)); } // Is the given value `NaN`? function isNaN$1(obj) { return isNumber(obj) && _isNaN(obj); } // Predicate-generating function. Often useful outside of Underscore. function constant(value) { return function() { return value; }; } // Common internal logic for `isArrayLike` and `isBufferLike`. function createSizePropertyCheck(getSizeProperty) { return function(collection) { var sizeProperty = getSizeProperty(collection); return typeof sizeProperty == 'number' && sizeProperty >= 0 && sizeProperty <= MAX_ARRAY_INDEX; } } // Internal helper to generate a function to obtain property `key` from `obj`. function shallowProperty(key) { return function(obj) { return obj == null ? void 0 : obj[key]; }; } // Internal helper to obtain the `byteLength` property of an object. var getByteLength = shallowProperty('byteLength'); // Internal helper to determine whether we should spend extensive checks against // `ArrayBuffer` et al. var isBufferLike = createSizePropertyCheck(getByteLength); // Is a given value a typed array? var typedArrayPattern = /\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/; function isTypedArray(obj) { // `ArrayBuffer.isView` is the most future-proof, so use it when available. // Otherwise, fall back on the above regular expression. return nativeIsView ? (nativeIsView(obj) && !isDataView$1(obj)) : isBufferLike(obj) && typedArrayPattern.test(toString.call(obj)); } var isTypedArray$1 = supportsArrayBuffer ? isTypedArray : constant(false); // Internal helper to obtain the `length` property of an object. var getLength = shallowProperty('length'); // Internal helper to create a simple lookup structure. // `collectNonEnumProps` used to depend on `_.contains`, but this led to // circular imports. `emulatedSet` is a one-off solution that only works for // arrays of strings. function emulatedSet(keys) { var hash = {}; for (var l = keys.length, i = 0; i < l; ++i) hash[keys[i]] = true; return { contains: function(key) { return hash[key]; }, push: function(key) { hash[key] = true; return keys.push(key); } }; } // Internal helper. Checks `keys` for the presence of keys in IE < 9 that won't // be iterated by `for key in ...` and thus missed. Extends `keys` in place if // needed. function collectNonEnumProps(obj, keys) { keys = emulatedSet(keys); var nonEnumIdx = nonEnumerableProps.length; var constructor = obj.constructor; var proto = isFunction$1(constructor) && constructor.prototype || ObjProto; // Constructor is a special case. var prop = 'constructor'; if (has$1(obj, prop) && !keys.contains(prop)) keys.push(prop); while (nonEnumIdx--) { prop = nonEnumerableProps[nonEnumIdx]; if (prop in obj && obj[prop] !== proto[prop] && !keys.contains(prop)) { keys.push(prop); } } } // Retrieve the names of an object's own properties. // Delegates to **ECMAScript 5**'s native `Object.keys`. function keys(obj) { if (!isObject(obj)) return []; if (nativeKeys) return nativeKeys(obj); var keys = []; for (var key in obj) if (has$1(obj, key)) keys.push(key); // Ahem, IE < 9. if (hasEnumBug) collectNonEnumProps(obj, keys); return keys; } // Is a given array, string, or object empty? // An "empty" object has no enumerable own-properties. function isEmpty(obj) { if (obj == null) return true; // Skip the more expensive `toString`-based type checks if `obj` has no // `.length`. var length = getLength(obj); if (typeof length == 'number' && ( isArray(obj) || isString(obj) || isArguments$1(obj) )) return length === 0; return getLength(keys(obj)) === 0; } // Returns whether an object has a given set of `key:value` pairs. function isMatch(object, attrs) { var _keys = keys(attrs), length = _keys.length; if (object == null) return !length; var obj = Object(object); for (var i = 0; i < length; i++) { var key = _keys[i]; if (attrs[key] !== obj[key] || !(key in obj)) return false; } return true; } // If Underscore is called as a function, it returns a wrapped object that can // be used OO-style. This wrapper holds altered versions of all functions added // through `_.mixin`. Wrapped objects may be chained. function _$1(obj) { if (obj instanceof _$1) return obj; if (!(this instanceof _$1)) return new _$1(obj); this._wrapped = obj; } _$1.VERSION = VERSION; // Extracts the result from a wrapped and chained object. _$1.prototype.value = function() { return this._wrapped; }; // Provide unwrapping proxies for some methods used in engine operations // such as arithmetic and JSON stringification. _$1.prototype.valueOf = _$1.prototype.toJSON = _$1.prototype.value; _$1.prototype.toString = function() { return String(this._wrapped); }; // Internal function to wrap or shallow-copy an ArrayBuffer, // typed array or DataView to a new view, reusing the buffer. function toBufferView(bufferSource) { return new Uint8Array( bufferSource.buffer || bufferSource, bufferSource.byteOffset || 0, getByteLength(bufferSource) ); } // We use this string twice, so give it a name for minification. var tagDataView = '[object DataView]'; // Internal recursive comparison function for `_.isEqual`. function eq(a, b, aStack, bStack) { // Identical objects are equal. `0 === -0`, but they aren't identical. // See the [Harmony `egal` proposal](https://wiki.ecmascript.org/doku.php?id=harmony:egal). if (a === b) return a !== 0 || 1 / a === 1 / b; // `null` or `undefined` only equal to itself (strict comparison). if (a == null || b == null) return false; // `NaN`s are equivalent, but non-reflexive. if (a !== a) return b !== b; // Exhaust primitive checks var type = typeof a; if (type !== 'function' && type !== 'object' && typeof b != 'object') return false; return deepEq(a, b, aStack, bStack); } // Internal recursive comparison function for `_.isEqual`. function deepEq(a, b, aStack, bStack) { // Unwrap any wrapped objects. if (a instanceof _$1) a = a._wrapped; if (b instanceof _$1) b = b._wrapped; // Compare `[[Class]]` names. var className = toString.call(a); if (className !== toString.call(b)) return false; // Work around a bug in IE 10 - Edge 13. if (hasStringTagBug && className == '[object Object]' && isDataView$1(a)) { if (!isDataView$1(b)) return false; className = tagDataView; } switch (className) { // These types are compared by value. case '[object RegExp]': // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i') case '[object String]': // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is // equivalent to `new String("5")`. return '' + a === '' + b; case '[object Number]': // `NaN`s are equivalent, but non-reflexive. // Object(NaN) is equivalent to NaN. if (+a !== +a) return +b !== +b; // An `egal` comparison is performed for other numeric values. return +a === 0 ? 1 / +a === 1 / b : +a === +b; case '[object Date]': case '[object Boolean]': // Coerce dates and booleans to numeric primitive values. Dates are compared by their // millisecond representations. Note that invalid dates with millisecond representations // of `NaN` are not equivalent. return +a === +b; case '[object Symbol]': return SymbolProto.valueOf.call(a) === SymbolProto.valueOf.call(b); case '[object ArrayBuffer]': case tagDataView: // Coerce to typed array so we can fall through. return deepEq(toBufferView(a), toBufferView(b), aStack, bStack); } var areArrays = className === '[object Array]'; if (!areArrays && isTypedArray$1(a)) { var byteLength = getByteLength(a); if (byteLength !== getByteLength(b)) return false; if (a.buffer === b.buffer && a.byteOffset === b.byteOffset) return true; areArrays = true; } if (!areArrays) { if (typeof a != 'object' || typeof b != 'object') return false; // Objects with different constructors are not equivalent, but `Object`s or `Array`s // from different frames are. var aCtor = a.constructor, bCtor = b.constructor; if (aCtor !== bCtor && !(isFunction$1(aCtor) && aCtor instanceof aCtor && isFunction$1(bCtor) && bCtor instanceof bCtor) && ('constructor' in a && 'constructor' in b)) { return false; } } // Assume equality for cyclic structures. The algorithm for detecting cyclic // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`. // Initializing stack of traversed objects. // It's done here since we only need them for objects and arrays comparison. aStack = aStack || []; bStack = bStack || []; var length = aStack.length; while (length--) { // Linear search. Performance is inversely proportional to the number of // unique nested structures. if (aStack[length] === a) return bStack[length] === b; } // Add the first object to the stack of traversed objects. aStack.push(a); bStack.push(b); // Recursively compare objects and arrays. if (areArrays) { // Compare array lengths to determine if a deep comparison is necessary. length = a.length; if (length !== b.length) return false; // Deep compare the contents, ignoring non-numeric properties. while (length--) { if (!eq(a[length], b[length], aStack, bStack)) return false; } } else { // Deep compare objects. var _keys = keys(a), key; length = _keys.length; // Ensure that both objects contain the same number of properties before comparing deep equality. if (keys(b).length !== length) return false; while (length--) { // Deep compare each member key = _keys[length]; if (!(has$1(b, key) && eq(a[key], b[key], aStack, bStack))) return false; } } // Remove the first object from the stack of traversed objects. aStack.pop(); bStack.pop(); return true; } // Perform a deep comparison to check if two objects are equal. function isEqual(a, b) { return eq(a, b); } // Retrieve all the enumerable property names of an object. function allKeys(obj) { if (!isObject(obj)) return []; var keys = []; for (var key in obj) keys.push(key); // Ahem, IE < 9. if (hasEnumBug) collectNonEnumProps(obj, keys); return keys; } // Since the regular `Object.prototype.toString` type tests don't work for // some types in IE 11, we use a fingerprinting heuristic instead, based // on the methods. It's not great, but it's the best we got. // The fingerprint method lists are defined below. function ie11fingerprint(methods) { var length = getLength(methods); return function(obj) { if (obj == null) return false; // `Map`, `WeakMap` and `Set` have no enumerable keys. var keys = allKeys(obj); if (getLength(keys)) return false; for (var i = 0; i < length; i++) { if (!isFunction$1(obj[methods[i]])) return false; } // If we are testing against `WeakMap`, we need to ensure that // `obj` doesn't have a `forEach` method in order to distinguish // it from a regular `Map`. return methods !== weakMapMethods || !isFunction$1(obj[forEachName]); }; } // In the interest of compact minification, we write // each string in the fingerprints only once. var forEachName = 'forEach', hasName = 'has', commonInit = ['clear', 'delete'], mapTail = ['get', hasName, 'set']; // `Map`, `WeakMap` and `Set` each have slightly different // combinations of the above sublists. var mapMethods = commonInit.concat(forEachName, mapTail), weakMapMethods = commonInit.concat(mapTail), setMethods = ['add'].concat(commonInit, forEachName, hasName); var isMap = isIE11 ? ie11fingerprint(mapMethods) : tagTester('Map'); var isWeakMap = isIE11 ? ie11fingerprint(weakMapMethods) : tagTester('WeakMap'); var isSet = isIE11 ? ie11fingerprint(setMethods) : tagTester('Set'); var isWeakSet = tagTester('WeakSet'); // Retrieve the values of an object's properties. function values(obj) { var _keys = keys(obj); var length = _keys.length; var values = Array(length); for (var i = 0; i < length; i++) { values[i] = obj[_keys[i]]; } return values; } // Convert an object into a list of `[key, value]` pairs. // The opposite of `_.object` with one argument. function pairs(obj) { var _keys = keys(obj); var length = _keys.length; var pairs = Array(length); for (var i = 0; i < length; i++) { pairs[i] = [_keys[i], obj[_keys[i]]]; } return pairs; } // Invert the keys and values of an object. The values must be serializable. function invert(obj) { var result = {}; var _keys = keys(obj); for (var i = 0, length = _keys.length; i < length; i++) { result[obj[_keys[i]]] = _keys[i]; } return result; } // Return a sorted list of the function names available on the object. function functions(obj) { var names = []; for (var key in obj) { if (isFunction$1(obj[key])) names.push(key); } return names.sort(); } // An internal function for creating assigner functions. function createAssigner(keysFunc, defaults) { return function(obj) { var length = arguments.length; if (defaults) obj = Object(obj); if (length < 2 || obj == null) return obj; for (var index = 1; index < length; index++) { var source = arguments[index], keys = keysFunc(source), l = keys.length; for (var i = 0; i < l; i++) { var key = keys[i]; if (!defaults || obj[key] === void 0) obj[key] = source[key]; } } return obj; }; } // Extend a given object with all the properties in passed-in object(s). var extend = createAssigner(allKeys); // Assigns a given object with all the own properties in the passed-in // object(s). // (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) var extendOwn = createAssigner(keys); // Fill in a given object with default properties. var defaults = createAssigner(allKeys, true); // Create a naked function reference for surrogate-prototype-swapping. function ctor() { return function(){}; } // An internal function for creating a new object that inherits from another. function baseCreate(prototype) { if (!isObject(prototype)) return {}; if (nativeCreate) return nativeCreate(prototype); var Ctor = ctor(); Ctor.prototype = prototype; var result = new Ctor; Ctor.prototype = null; return result; } // Creates an object that inherits from the given prototype object. // If additional properties are provided then they will be added to the // created object. function create(prototype, props) { var result = baseCreate(prototype); if (props) extendOwn(result, props); return result; } // Create a (shallow-cloned) duplicate of an object. function clone(obj) { if (!isObject(obj)) return obj; return isArray(obj) ? obj.slice() : extend({}, obj); } // Invokes `interceptor` with the `obj` and then returns `obj`. // The primary purpose of this method is to "tap into" a method chain, in // order to perform operations on intermediate results within the chain. function tap(obj, interceptor) { interceptor(obj); return obj; } // Normalize a (deep) property `path` to array. // Like `_.iteratee`, this function can be customized. function toPath$1(path) { return isArray(path) ? path : [path]; } _$1.toPath = toPath$1; // Internal wrapper for `_.toPath` to enable minification. // Similar to `cb` for `_.iteratee`. function toPath(path) { return _$1.toPath(path); } // Internal function to obtain a nested property in `obj` along `path`. function deepGet(obj, path) { var length = path.length; for (var i = 0; i < length; i++) { if (obj == null) return void 0; obj = obj[path[i]]; } return length ? obj : void 0; } // Get the value of the (deep) property on `path` from `object`. // If any property in `path` does not exist or if the value is // `undefined`, return `defaultValue` instead. // The `path` is normalized through `_.toPath`. function get(object, path, defaultValue) { var value = deepGet(object, toPath(path)); return isUndefined(value) ? defaultValue : value; } // Shortcut function for checking if an object has a given property directly on // itself (in other words, not on a prototype). Unlike the internal `has` // function, this public version can also traverse nested properties. function has(obj, path) { path = toPath(path); var length = path.length; for (var i = 0; i < length; i++) { var key = path[i]; if (!has$1(obj, key)) return false; obj = obj[key]; } return !!length; } // Keep the identity function around for default iteratees. function identity(value) { return value; } // Returns a predicate for checking whether an object has a given set of // `key:value` pairs. function matcher(attrs) { attrs = extendOwn({}, attrs); return function(obj) { return isMatch(obj, attrs); }; } // Creates a function that, when passed an object, will traverse that object’s // properties down the given `path`, specified as an array of keys or indices. function property(path) { path = toPath(path); return function(obj) { return deepGet(obj, path); }; } // Internal function that returns an efficient (for current engines) version // of the passed-in callback, to be repeatedly applied in other Underscore // functions. function optimizeCb(func, context, argCount) { if (context === void 0) return func; switch (argCount == null ? 3 : argCount) { case 1: return function(value) { return func.call(context, value); }; // The 2-argument case is omitted because we’re not using it. case 3: return function(value, index, collection) { return func.call(context, value, index, collection); }; case 4: return function(accumulator, value, index, collection) { return func.call(context, accumulator, value, index, collection); }; } return function() { return func.apply(context, arguments); }; } // An internal function to generate callbacks that can be applied to each // element in a collection, returning the desired result — either `_.identity`, // an arbitrary callback, a property matcher, or a property accessor. function baseIteratee(value, context, argCount) { if (value == null) return identity; if (isFunction$1(value)) return optimizeCb(value, context, argCount); if (isObject(value) && !isArray(value)) return matcher(value); return property(value); } // External wrapper for our callback generator. Users may customize // `_.iteratee` if they want additional predicate/iteratee shorthand styles. // This abstraction hides the internal-only `argCount` argument. function iteratee(value, context) { return baseIteratee(value, context, Infinity); } _$1.iteratee = iteratee; // The function we call internally to generate a callback. It invokes // `_.iteratee` if overridden, otherwise `baseIteratee`. function cb(value, context, argCount) { if (_$1.iteratee !== iteratee) return _$1.iteratee(value, context); return baseIteratee(value, context, argCount); } // Returns the results of applying the `iteratee` to each element of `obj`. // In contrast to `_.map` it returns an object. function mapObject(obj, iteratee, context) { iteratee = cb(iteratee, context); var _keys = keys(obj), length = _keys.length, results = {}; for (var index = 0; index < length; index++) { var currentKey = _keys[index]; results[currentKey] = iteratee(obj[currentKey], currentKey, obj); } return results; } // Predicate-generating function. Often useful outside of Underscore. function noop(){} // Generates a function for a given object that returns a given property. function propertyOf(obj) { if (obj == null) return noop; return function(path) { return get(obj, path); }; } // Run a function **n** times. function times(n, iteratee, context) { var accum = Array(Math.max(0, n)); iteratee = optimizeCb(iteratee, context, 1); for (var i = 0; i < n; i++) accum[i] = iteratee(i); return accum; } // Return a random integer between `min` and `max` (inclusive). function random(min, max) { if (max == null) { max = min; min = 0; } return min + Math.floor(Math.random() * (max - min + 1)); } // A (possibly faster) way to get the current timestamp as an integer. var now = Date.now || function() { return new Date().getTime(); }; // Internal helper to generate functions for escaping and unescaping strings // to/from HTML interpolation. function createEscaper(map) { var escaper = function(match) { return map[match]; }; // Regexes for identifying a key that needs to be escaped. var source = '(?:' + keys(map).join('|') + ')'; var testRegexp = RegExp(source); var replaceRegexp = RegExp(source, 'g'); return function(string) { string = string == null ? '' : '' + string; return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string; }; } // Internal list of HTML entities for escaping. var escapeMap = { '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#x27;', '`': '&#x60;' }; // Function for escaping strings to HTML interpolation. var _escape = createEscaper(escapeMap); // Internal list of HTML entities for unescaping. var unescapeMap = invert(escapeMap); // Function for unescaping strings from HTML interpolation. var _unescape = createEscaper(unescapeMap); // By default, Underscore uses ERB-style template delimiters. Change the // following template settings to use alternative delimiters. var templateSettings = _$1.templateSettings = { evaluate: /<%([\s\S]+?)%>/g, interpolate: /<%=([\s\S]+?)%>/g, escape: /<%-([\s\S]+?)%>/g }; // When customizing `_.templateSettings`, if you don't want to define an // interpolation, evaluation or escaping regex, we need one that is // guaranteed not to match. var noMatch = /(.)^/; // Certain characters need to be escaped so that they can be put into a // string literal. var escapes = { "'": "'", '\\': '\\', '\r': 'r', '\n': 'n', '\u2028': 'u2028', '\u2029': 'u2029' }; var escapeRegExp = /\\|'|\r|\n|\u2028|\u2029/g; function escapeChar(match) { return '\\' + escapes[match]; } // In order to prevent third-party code injection through // `_.templateSettings.variable`, we test it against the following regular // expression. It is intentionally a bit more liberal than just matching valid // identifiers, but still prevents possible loopholes through defaults or // destructuring assignment. var bareIdentifier = /^\s*(\w|\$)+\s*$/; // JavaScript micro-templating, similar to John Resig's implementation. // Underscore templating handles arbitrary delimiters, preserves whitespace, // and correctly escapes quotes within interpolated code. // NB: `oldSettings` only exists for backwards compatibility. function template(text, settings, oldSettings) { if (!settings && oldSettings) settings = oldSettings; settings = defaults({}, settings, _$1.templateSettings); // Combine delimiters into one regular expression via alternation. var matcher = RegExp([ (settings.escape || noMatch).source, (settings.interpolate || noMatch).source, (settings.evaluate || noMatch).source ].join('|') + '|$', 'g'); // Compile the template source, escaping string literals appropriately. var index = 0; var source = "__p+='"; text.replace(matcher, function(match, escape, interpolate, evaluate, offset) { source += text.slice(index, offset).replace(escapeRegExp, escapeChar); index = offset + match.length; if (escape) { source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'"; } else if (interpolate) { source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'"; } else if (evaluate) { source += "';\n" + evaluate + "\n__p+='"; } // Adobe VMs need the match returned to produce the correct offset. return match; }); source += "';\n"; var argument = settings.variable; if (argument) { // Insure against third-party code injection. (CVE-2021-23358) if (!bareIdentifier.test(argument)) throw new Error( 'variable is not a bare identifier: ' + argument ); } else { // If a variable is not specified, place data values in local scope. source = 'with(obj||{}){\n' + source + '}\n'; argument = 'obj'; } source = "var __t,__p='',__j=Array.prototype.join," + "print=function(){__p+=__j.call(arguments,'');};\n" + source + 'return __p;\n'; var render; try { render = new Function(argument, '_', source); } catch (e) { e.source = source; throw e; } var template = function(data) { return render.call(this, data, _$1); }; // Provide the compiled source as a convenience for precompilation. template.source = 'function(' + argument + '){\n' + source + '}'; return template; } // Traverses the children of `obj` along `path`. If a child is a function, it // is invoked with its parent as context. Returns the value of the final // child, or `fallback` if any child is undefined. function result(obj, path, fallback) { path = toPath(path); var length = path.length; if (!length) { return isFunction$1(fallback) ? fallback.call(obj) : fallback; } for (var i = 0; i < length; i++) { var prop = obj == null ? void 0 : obj[path[i]]; if (prop === void 0) { prop = fallback; i = length; // Ensure we don't continue iterating. } obj = isFunction$1(prop) ? prop.call(obj) : prop; } return obj; } // Generate a unique integer id (unique within the entire client session). // Useful for temporary DOM ids. var idCounter = 0; function uniqueId(prefix) { var id = ++idCounter + ''; return prefix ? prefix + id : id; } // Start chaining a wrapped Underscore object. function chain(obj) { var instance = _$1(obj); instance._chain = true; return instance; } // Internal function to execute `sourceFunc` bound to `context` with optional // `args`. Determines whether to execute a function as a constructor or as a // normal function. function executeBound(sourceFunc, boundFunc, context, callingContext, args) { if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args); var self = baseCreate(sourceFunc.prototype); var result = sourceFunc.apply(self, args); if (isObject(result)) return result; return self; } // Partially apply a function by creating a version that has had some of its // arguments pre-filled, without changing its dynamic `this` context. `_` acts // as a placeholder by default, allowing any combination of arguments to be // pre-filled. Set `_.partial.placeholder` for a custom placeholder argument. var partial = restArguments(function(func, boundArgs) { var placeholder = partial.placeholder; var bound = function() { var position = 0, length = boundArgs.length; var args = Array(length); for (var i = 0; i < length; i++) { args[i] = boundArgs[i] === placeholder ? arguments[position++] : boundArgs[i]; } while (position < arguments.length) args.push(arguments[position++]); return executeBound(func, bound, this, this, args); }; return bound; }); partial.placeholder = _$1; // Create a function bound to a given object (assigning `this`, and arguments, // optionally). var bind = restArguments(function(func, context, args) { if (!isFunction$1(func)) throw new TypeError('Bind must be called on a function'); var bound = restArguments(function(callArgs) { return executeBound(func, bound, context, this, args.concat(callArgs)); }); return bound; }); // Internal helper for collection methods to determine whether a collection // should be iterated as an array or as an object. // Related: https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength // Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094 var isArrayLike = createSizePropertyCheck(getLength); // Internal implementation of a recursive `flatten` function. function flatten$1(input, depth, strict, output) { output = output || []; if (!depth && depth !== 0) { depth = Infinity; } else if (depth <= 0) { return output.concat(input); } var idx = output.length; for (var i = 0, length = getLength(input); i < length; i++) { var value = input[i]; if (isArrayLike(value) && (isArray(value) || isArguments$1(value))) { // Flatten current level of array or arguments object. if (depth > 1) { flatten$1(value, depth - 1, strict, output); idx = output.length; } else { var j = 0, len = value.length; while (j < len) output[idx++] = value[j++]; } } else if (!strict) { output[idx++] = value; } } return output; } // Bind a number of an object's methods to that object. Remaining arguments // are the method names to be bound. Useful for ensuring that all callbacks // defined on an object belong to it. var bindAll = restArguments(function(obj, keys) { keys = flatten$1(keys, false, false); var index = keys.length; if (index < 1) throw new Error('bindAll must be passed function names'); while (index--) { var key = keys[index]; obj[key] = bind(obj[key], obj); } return obj; }); // Memoize an expensive function by storing its results. function memoize(func, hasher) { var memoize = function(key) { var cache = memoize.cache; var address = '' + (hasher ? hasher.apply(this, arguments) : key); if (!has$1(cache, address)) cache[address] = func.apply(this, arguments); return cache[address]; }; memoize.cache = {}; return memoize; } // Delays a function for the given number of milliseconds, and then calls // it with the arguments supplied. var delay = restArguments(function(func, wait, args) { return setTimeout(function() { return func.apply(null, args); }, wait); }); // Defers a function, scheduling it to run after the current call stack has // cleared. var defer = partial(delay, _$1, 1); // Returns a function, that, when invoked, will only be triggered at most once // during a given window of time. Normally, the throttled function will run // as much as it can, without ever going more than once per `wait` duration; // but if you'd like to disable the execution on the leading edge, pass // `{leading: false}`. To disable execution on the trailing edge, ditto. function throttle(func, wait, options) { var timeout, context, args, result; var previous = 0; if (!options) options = {}; var later = function() { previous = options.leading === false ? 0 : now(); timeout = null; result = func.apply(context, args); if (!timeout) context = args = null; }; var throttled = function() { var _now = now(); if (!previous && options.leading === false) previous = _now; var remaining = wait - (_now - previous); context = this; args = arguments; if (remaining <= 0 || remaining > wait) { if (timeout) { clearTimeout(timeout); timeout = null; } previous = _now; result = func.apply(context, args); if (!timeout) context = args = null; } else if (!timeout && options.trailing !== false) { timeout = setTimeout(later, remaining); } return result; }; throttled.cancel = function() { clearTimeout(timeout); previous = 0; timeout = context = args = null; }; return throttled; } // When a sequence of calls of the returned function ends, the argument // function is triggered. The end of a sequence is defined by the `wait` // parameter. If `immediate` is passed, the argument function will be // triggered at the beginning of the sequence instead of at the end. function debounce(func, wait, immediate) { var timeout, previous, args, result, context; var later = function() { var passed = now() - previous; if (wait > passed) { timeout = setTimeout(later, wait - passed); } else { timeout = null; if (!immediate) result = func.apply(context, args); // This check is needed because `func` can recursively invoke `debounced`. if (!timeout) args = context = null; } }; var debounced = restArguments(function(_args) { context = this; args = _args; previous = now(); if (!timeout) { timeout = setTimeout(later, wait); if (immediate) result = func.apply(context, args); } return result; }); debounced.cancel = function() { clearTimeout(timeout); timeout = args = context = null; }; return debounced; } // Returns the first function passed as an argument to the second, // allowing you to adjust arguments, run code before and after, and // conditionally execute the original function. function wrap(func, wrapper) { return partial(wrapper, func); } // Returns a negated version of the passed-in predicate. function negate(predicate) { return function() { return !predicate.apply(this, arguments); }; } // Returns a function that is the composition of a list of functions, each // consuming the return value of the function that follows. function compose() { var args = arguments; var start = args.length - 1; return function() { var i = start; var result = args[start].apply(this, arguments); while (i--) result = args[i].call(this, result); return result; }; } // Returns a function that will only be executed on and after the Nth call. function after(times, func) { return function() { if (--times < 1) { return func.apply(this, arguments); } }; } // Returns a function that will only be executed up to (but not including) the // Nth call. function before(times, func) { var memo; return function() { if (--times > 0) { memo = func.apply(this, arguments); } if (times <= 1) func = null; return memo; }; } // Returns a function that will be executed at most one time, no matter how // often you call it. Useful for lazy initialization. var once = partial(before, 2); // Returns the first key on an object that passes a truth test. function findKey(obj, predicate, context) { predicate = cb(predicate, context); var _keys = keys(obj), key; for (var i = 0, length = _keys.length; i < length; i++) { key = _keys[i]; if (predicate(obj[key], key, obj)) return key; } } // Internal function to generate `_.findIndex` and `_.findLastIndex`. function createPredicateIndexFinder(dir) { return function(array, predicate, context) { predicate = cb(predicate, context); var length = getLength(array); var index = dir > 0 ? 0 : length - 1; for (; index >= 0 && index < length; index += dir) { if (predicate(array[index], index, array)) return index; } return -1; }; } // Returns the first index on an array-like that passes a truth test. var findIndex = createPredicateIndexFinder(1); // Returns the last index on an array-like that passes a truth test. var findLastIndex = createPredicateIndexFinder(-1); // Use a comparator function to figure out the smallest index at which // an object should be inserted so as to maintain order. Uses binary search. function sortedIndex(array, obj, iteratee, context) { iteratee = cb(iteratee, context, 1); var value = iteratee(obj); var low = 0, high = getLength(array); while (low < high) { var mid = Math.floor((low + high) / 2); if (iteratee(array[mid]) < value) low = mid + 1; else high = mid; } return low; } // Internal function to generate the `_.indexOf` and `_.lastIndexOf` functions. function createIndexFinder(dir, predicateFind, sortedIndex) { return function(array, item, idx) { var i = 0, length = getLength(array); if (typeof idx == 'number') { if (dir > 0) { i = idx >= 0 ? idx : Math.max(idx + length, i); } else { length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1; } } else if (sortedIndex && idx && length) { idx = sortedIndex(array, item); return array[idx] === item ? idx : -1; } if (item !== item) { idx = predicateFind(slice.call(array, i, length), isNaN$1); return idx >= 0 ? idx + i : -1; } for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) { if (array[idx] === item) return idx; } return -1; }; } // Return the position of the first occurrence of an item in an array, // or -1 if the item is not included in the array. // If the array is large and already in sort order, pass `true` // for **isSorted** to use binary search. var indexOf = createIndexFinder(1, findIndex, sortedIndex); // Return the position of the last occurrence of an item in an array, // or -1 if the item is not included in the array. var lastIndexOf = createIndexFinder(-1, findLastIndex); // Return the first value which passes a truth test. function find(obj, predicate, context) { var keyFinder = isArrayLike(obj) ? findIndex : findKey; var key = keyFinder(obj, predicate, context); if (key !== void 0 && key !== -1) return obj[key]; } // Convenience version of a common use case of `_.find`: getting the first // object containing specific `key:value` pairs. function findWhere(obj, attrs) { return find(obj, matcher(attrs)); } // The cornerstone for collection functions, an `each` // implementation, aka `forEach`. // Handles raw objects in addition to array-likes. Treats all // sparse array-likes as if they were dense. function each(obj, iteratee, context) { iteratee = optimizeCb(iteratee, context); var i, length; if (isArrayLike(obj)) { for (i = 0, length = obj.length; i < length; i++) { iteratee(obj[i], i, obj); } } else { var _keys = keys(obj); for (i = 0, length = _keys.length; i < length; i++) { iteratee(obj[_keys[i]], _keys[i], obj); } } return obj; } // Return the results of applying the iteratee to each element. function map(obj, iteratee, context) { iteratee = cb(iteratee, context); var _keys = !isArrayLike(obj) && keys(obj), length = (_keys || obj).length, results = Array(length); for (var index = 0; index < length; index++) { var currentKey = _keys ? _keys[index] : index; results[index] = iteratee(obj[currentKey], currentKey, obj); } return results; } // Internal helper to create a reducing function, iterating left or right. function createReduce(dir) { // Wrap code that reassigns argument variables in a separate function than // the one that accesses `arguments.length` to avoid a perf hit. (#1991) var reducer = function(obj, iteratee, memo, initial) { var _keys = !isArrayLike(obj) && keys(obj), length = (_keys || obj).length, index = dir > 0 ? 0 : length - 1; if (!initial) { memo = obj[_keys ? _keys[index] : index]; index += dir; } for (; index >= 0 && index < length; index += dir) { var currentKey = _keys ? _keys[index] : index; memo = iteratee(memo, obj[currentKey], currentKey, obj); } return memo; }; return function(obj, iteratee, memo, context) { var initial = arguments.length >= 3; return reducer(obj, optimizeCb(iteratee, context, 4), memo, initial); }; } // **Reduce** builds up a single result from a list of values, aka `inject`, // or `foldl`. var reduce = createReduce(1); // The right-associative version of reduce, also known as `foldr`. var reduceRight = createReduce(-1); // Return all the elements that pass a truth test. function filter(obj, predicate, context) { var results = []; predicate = cb(predicate, context); each(obj, function(value, index, list) { if (predicate(value, index, list)) results.push(value); }); return results; } // Return all the elements for which a truth test fails. function reject(obj, predicate, context) { return filter(obj, negate(cb(predicate)), context); } // Determine whether all of the elements pass a truth test. function every(obj, predicate, context) { predicate = cb(predicate, context); var _keys = !isArrayLike(obj) && keys(obj), length = (_keys || obj).length; for (var index = 0; index < length; index++) { var currentKey = _keys ? _keys[index] : index; if (!predicate(obj[currentKey], currentKey, obj)) return false; } return true; } // Determine if at least one element in the object passes a truth test. function some(obj, predicate, context) { predicate = cb(predicate, context); var _keys = !isArrayLike(obj) && keys(obj), length = (_keys || obj).length; for (var index = 0; index < length; index++) { var currentKey = _keys ? _keys[index] : index; if (predicate(obj[currentKey], currentKey, obj)) return true; } return false; } // Determine if the array or object contains a given item (using `===`). function contains(obj, item, fromIndex, guard) { if (!isArrayLike(obj)) obj = values(obj); if (typeof fromIndex != 'number' || guard) fromIndex = 0; return indexOf(obj, item, fromIndex) >= 0; } // Invoke a method (with arguments) on every item in a collection. var invoke = restArguments(function(obj, path, args) { var contextPath, func; if (isFunction$1(path)) { func = path; } else { path = toPath(path); contextPath = path.slice(0, -1); path = path[path.length - 1]; } return map(obj, function(context) { var method = func; if (!method) { if (contextPath && contextPath.length) { context = deepGet(context, contextPath); } if (context == null) return void 0; method = context[path]; } return method == null ? method : method.apply(context, args); }); }); // Convenience version of a common use case of `_.map`: fetching a property. function pluck(obj, key) { return map(obj, property(key)); } // Convenience version of a common use case of `_.filter`: selecting only // objects containing specific `key:value` pairs. function where(obj, attrs) { return filter(obj, matcher(attrs)); } // Return the maximum element (or element-based computation). function max(obj, iteratee, context) { var result = -Infinity, lastComputed = -Infinity, value, computed; if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) { obj = isArrayLike(obj) ? obj : values(obj); for (var i = 0, length = obj.length; i < length; i++) { value = obj[i]; if (value != null && value > result) { result = value; } } } else { iteratee = cb(iteratee, context); each(obj, function(v, index, list) { computed = iteratee(v, index, list); if (computed > lastComputed || computed === -Infinity && result === -Infinity) { result = v; lastComputed = computed; } }); } return result; } // Return the minimum element (or element-based computation). function min(obj, iteratee, context) { var result = Infinity, lastComputed = Infinity, value, computed; if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) { obj = isArrayLike(obj) ? obj : values(obj); for (var i = 0, length = obj.length; i < length; i++) { value = obj[i]; if (value != null && value < result) { result = value; } } } else { iteratee = cb(iteratee, context); each(obj, function(v, index, list) { computed = iteratee(v, index, list); if (computed < lastComputed || computed === Infinity && result === Infinity) { result = v; lastComputed = computed; } }); } return result; } // Sample **n** random values from a collection using the modern version of the // [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher–Yates_shuffle). // If **n** is not specified, returns a single random element. // The internal `guard` argument allows it to work with `_.map`. function sample(obj, n, guard) { if (n == null || guard) { if (!isArrayLike(obj)) obj = values(obj); return obj[random(obj.length - 1)]; } var sample = isArrayLike(obj) ? clone(obj) : values(obj); var length = getLength(sample); n = Math.max(Math.min(n, length), 0); var last = length - 1; for (var index = 0; index < n; index++) { var rand = random(index, last); var temp = sample[index]; sample[index] = sample[rand]; sample[rand] = temp; } return sample.slice(0, n); } // Shuffle a collection. function shuffle(obj) { return sample(obj, Infinity); } // Sort the object's values by a criterion produced by an iteratee. function sortBy(obj, iteratee, context) { var index = 0; iteratee = cb(iteratee, context); return pluck(map(obj, function(value, key, list) { return { value: value, index: index++, criteria: iteratee(value, key, list) }; }).sort(function(left, right) { var a = left.criteria; var b = right.criteria; if (a !== b) { if (a > b || a === void 0) return 1; if (a < b || b === void 0) return -1; } return left.index - right.index; }), 'value'); } // An internal function used for aggregate "group by" operations. function group(behavior, partition) { return function(obj, iteratee, context) { var result = partition ? [[], []] : {}; iteratee = cb(iteratee, context); each(obj, function(value, index) { var key = iteratee(value, index, obj); behavior(result, value, key); }); return result; }; } // Groups the object's values by a criterion. Pass either a string attribute // to group by, or a function that returns the criterion. var groupBy = group(function(result, value, key) { if (has$1(result, key)) result[key].push(value); else result[key] = [value]; }); // Indexes the object's values by a criterion, similar to `_.groupBy`, but for // when you know that your index values will be unique. var indexBy = group(function(result, value, key) { result[key] = value; }); // Counts instances of an object that group by a certain criterion. Pass // either a string attribute to count by, or a function that returns the // criterion. var countBy = group(function(result, value, key) { if (has$1(result, key)) result[key]++; else result[key] = 1; }); // Split a collection into two arrays: one whose elements all pass the given // truth test, and one whose elements all do not pass the truth test. var partition = group(function(result, value, pass) { result[pass ? 0 : 1].push(value); }, true); // Safely create a real, live array from anything iterable. var reStrSymbol = /[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g; function toArray(obj) { if (!obj) return []; if (isArray(obj)) return slice.call(obj); if (isString(obj)) { // Keep surrogate pair characters together. return obj.match(reStrSymbol); } if (isArrayLike(obj)) return map(obj, identity); return values(obj); } // Return the number of elements in a collection. function size(obj) { if (obj == null) return 0; return isArrayLike(obj) ? obj.length : keys(obj).length; } // Internal `_.pick` helper function to determine whether `key` is an enumerable // property name of `obj`. function keyInObj(value, key, obj) { return key in obj; } // Return a copy of the object only containing the allowed properties. var pick = restArguments(function(obj, keys) { var result = {}, iteratee = keys[0]; if (obj == null) return result; if (isFunction$1(iteratee)) { if (keys.length > 1) iteratee = optimizeCb(iteratee, keys[1]); keys = allKeys(obj); } else { iteratee = keyInObj; keys = flatten$1(keys, false, false); obj = Object(obj); } for (var i = 0, length = keys.length; i < length; i++) { var key = keys[i]; var value = obj[key]; if (iteratee(value, key, obj)) result[key] = value; } return result; }); // Return a copy of the object without the disallowed properties. var omit = restArguments(function(obj, keys) { var iteratee = keys[0], context; if (isFunction$1(iteratee)) { iteratee = negate(iteratee); if (keys.length > 1) context = keys[1]; } else { keys = map(flatten$1(keys, false, false), String); iteratee = function(value, key) { return !contains(keys, key); }; } return pick(obj, iteratee, context); }); // Returns everything but the last entry of the array. Especially useful on // the arguments object. Passing **n** will return all the values in // the array, excluding the last N. function initial(array, n, guard) { return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n))); } // Get the first element of an array. Passing **n** will return the first N // values in the array. The **guard** check allows it to work with `_.map`. function first(array, n, guard) { if (array == null || array.length < 1) return n == null || guard ? void 0 : []; if (n == null || guard) return array[0]; return initial(array, array.length - n); } // Returns everything but the first entry of the `array`. Especially useful on // the `arguments` object. Passing an **n** will return the rest N values in the // `array`. function rest(array, n, guard) { return slice.call(array, n == null || guard ? 1 : n); } // Get the last element of an array. Passing **n** will return the last N // values in the array. function last(array, n, guard) { if (array == null || array.length < 1) return n == null || guard ? void 0 : []; if (n == null || guard) return array[array.length - 1]; return rest(array, Math.max(0, array.length - n)); } // Trim out all falsy values from an array. function compact(array) { return filter(array, Boolean); } // Flatten out an array, either recursively (by default), or up to `depth`. // Passing `true` or `false` as `depth` means `1` or `Infinity`, respectively. function flatten(array, depth) { return flatten$1(array, depth, false); } // Take the difference between one array and a number of other arrays. // Only the elements present in just the first array will remain. var difference = restArguments(function(array, rest) { rest = flatten$1(rest, true, true); return filter(array, function(value){ return !contains(rest, value); }); }); // Return a version of the array that does not contain the specified value(s). var without = restArguments(function(array, otherArrays) { return difference(array, otherArrays); }); // Produce a duplicate-free version of the array. If the array has already // been sorted, you have the option of using a faster algorithm. // The faster algorithm will not work with an iteratee if the iteratee // is not a one-to-one function, so providing an iteratee will disable // the faster algorithm. function uniq(array, isSorted, iteratee, context) { if (!isBoolean(isSorted)) { context = iteratee; iteratee = isSorted; isSorted = false; } if (iteratee != null) iteratee = cb(iteratee, context); var result = []; var seen = []; for (var i = 0, length = getLength(array); i < length; i++) { var value = array[i], computed = iteratee ? iteratee(value, i, array) : value; if (isSorted && !iteratee) { if (!i || seen !== computed) result.push(value); seen = computed; } else if (iteratee) { if (!contains(seen, computed)) { seen.push(computed); result.push(value); } } else if (!contains(result, value)) { result.push(value); } } return result; } // Produce an array that contains the union: each distinct element from all of // the passed-in arrays. var union = restArguments(function(arrays) { return uniq(flatten$1(arrays, true, true)); }); // Produce an array that contains every item shared between all the // passed-in arrays. function intersection(array) { var result = []; var argsLength = arguments.length; for (var i = 0, length = getLength(array); i < length; i++) { var item = array[i]; if (contains(result, item)) continue; var j; for (j = 1; j < argsLength; j++) { if (!contains(arguments[j], item)) break; } if (j === argsLength) result.push(item); } return result; } // Complement of zip. Unzip accepts an array of arrays and groups // each array's elements on shared indices. function unzip(array) { var length = array && max(array, getLength).length || 0; var result = Array(length); for (var index = 0; index < length; index++) { result[index] = pluck(array, index); } return result; } // Zip together multiple lists into a single array -- elements that share // an index go together. var zip = restArguments(unzip); // Converts lists into objects. Pass either a single array of `[key, value]` // pairs, or two parallel arrays of the same length -- one of keys, and one of // the corresponding values. Passing by pairs is the reverse of `_.pairs`. function object(list, values) { var result = {}; for (var i = 0, length = getLength(list); i < length; i++) { if (values) { result[list[i]] = values[i]; } else { result[list[i][0]] = list[i][1]; } } return result; } // Generate an integer Array containing an arithmetic progression. A port of // the native Python `range()` function. See // [the Python documentation](https://docs.python.org/library/functions.html#range). function range(start, stop, step) { if (stop == null) { stop = start || 0; start = 0; } if (!step) { step = stop < start ? -1 : 1; } var length = Math.max(Math.ceil((stop - start) / step), 0); var range = Array(length); for (var idx = 0; idx < length; idx++, start += step) { range[idx] = start; } return range; } // Chunk a single array into multiple arrays, each containing `count` or fewer // items. function chunk(array, count) { if (count == null || count < 1) return []; var result = []; var i = 0, length = array.length; while (i < length) { result.push(slice.call(array, i, i += count)); } return result; } // Helper function to continue chaining intermediate results. function chainResult(instance, obj) { return instance._chain ? _$1(obj).chain() : obj; } // Add your own custom functions to the Underscore object. function mixin(obj) { each(functions(obj), function(name) { var func = _$1[name] = obj[name]; _$1.prototype[name] = function() { var args = [this._wrapped]; push.apply(args, arguments); return chainResult(this, func.apply(_$1, args)); }; }); return _$1; } // Add all mutator `Array` functions to the wrapper. each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) { var method = ArrayProto[name]; _$1.prototype[name] = function() { var obj = this._wrapped; if (obj != null) { method.apply(obj, arguments); if ((name === 'shift' || name === 'splice') && obj.length === 0) { delete obj[0]; } } return chainResult(this, obj); }; }); // Add all accessor `Array` functions to the wrapper. each(['concat', 'join', 'slice'], function(name) { var method = ArrayProto[name]; _$1.prototype[name] = function() { var obj = this._wrapped; if (obj != null) obj = method.apply(obj, arguments); return chainResult(this, obj); }; }); // Named Exports var allExports = { __proto__: null, VERSION: VERSION, restArguments: restArguments, isObject: isObject, isNull: isNull, isUndefined: isUndefined, isBoolean: isBoolean, isElement: isElement, isString: isString, isNumber: isNumber, isDate: isDate, isRegExp: isRegExp, isError: isError, isSymbol: isSymbol, isArrayBuffer: isArrayBuffer, isDataView: isDataView$1, isArray: isArray, isFunction: isFunction$1, isArguments: isArguments$1, isFinite: isFinite$1, isNaN: isNaN$1, isTypedArray: isTypedArray$1, isEmpty: isEmpty, isMatch: isMatch, isEqual: isEqual, isMap: isMap, isWeakMap: isWeakMap, isSet: isSet, isWeakSet: isWeakSet, keys: keys, allKeys: allKeys, values: values, pairs: pairs, invert: invert, functions: functions, methods: functions, extend: extend, extendOwn: extendOwn, assign: extendOwn, defaults: defaults, create: create, clone: clone, tap: tap, get: get, has: has, mapObject: mapObject, identity: identity, constant: constant, noop: noop, toPath: toPath$1, property: property, propertyOf: propertyOf, matcher: matcher, matches: matcher, times: times, random: random, now: now, escape: _escape, unescape: _unescape, templateSettings: templateSettings, template: template, result: result, uniqueId: uniqueId, chain: chain, iteratee: iteratee, partial: partial, bind: bind, bindAll: bindAll, memoize: memoize, delay: delay, defer: defer, throttle: throttle, debounce: debounce, wrap: wrap, negate: negate, compose: compose, after: after, before: before, once: once, findKey: findKey, findIndex: findIndex, findLastIndex: findLastIndex, sortedIndex: sortedIndex, indexOf: indexOf, lastIndexOf: lastIndexOf, find: find, detect: find, findWhere: findWhere, each: each, forEach: each, map: map, collect: map, reduce: reduce, foldl: reduce, inject: reduce, reduceRight: reduceRight, foldr: reduceRight, filter: filter, select: filter, reject: reject, every: every, all: every, some: some, any: some, contains: contains, includes: contains, include: contains, invoke: invoke, pluck: pluck, where: where, max: max, min: min, shuffle: shuffle, sample: sample, sortBy: sortBy, groupBy: groupBy, indexBy: indexBy, countBy: countBy, partition: partition, toArray: toArray, size: size, pick: pick, omit: omit, first: first, head: first, take: first, initial: initial, last: last, rest: rest, tail: rest, drop: rest, compact: compact, flatten: flatten, without: without, uniq: uniq, unique: uniq, union: union, intersection: intersection, difference: difference, unzip: unzip, transpose: unzip, zip: zip, object: object, range: range, chunk: chunk, mixin: mixin, 'default': _$1 }; // Default Export // Add all of the Underscore functions to the wrapper object. var _ = mixin(allExports); // Legacy Node.js API. _._ = _; return _; }))); //# sourceMappingURL=underscore-umd.js.map
PypiClean
/monk_cuda90-0.0.1.tar.gz/monk_cuda90-0.0.1/monk/pytorch/datasets/params.py
from monk.pytorch.datasets.imports import * from monk.system.imports import * @accepts([int, tuple], dict, post_trace=False) #@TraceFunction(trace_args=False, trace_rv=False) def set_input_size(input_size, system_dict): ''' Set Input data size Args: input_size (int, tuple): Single integer in case of square shaped image Tuple representing (width, height) system_dict (dict): System Dictionary Returns: dict: Updated system dictionary. ''' system_dict["dataset"]["params"]["input_size"] = input_size; return system_dict; @accepts(int, dict, post_trace=False) #@TraceFunction(trace_args=False, trace_rv=False) def set_batch_size(batch_size, system_dict): ''' Set Input batch size Args: batch_size (int): Batch sizes for sampling input data during training system_dict (dict): System Dictionary Returns: dict: Updated system dictionary. ''' system_dict["dataset"]["params"]["batch_size"] = batch_size; return system_dict; @accepts(bool, dict, post_trace=False) #@TraceFunction(trace_args=False, trace_rv=False) def set_data_shuffle(value, system_dict): ''' Set weather to shuffle data Args: value (bool): If True data is shuffled before sampling into batches system_dict (dict): System Dictionary Returns: dict: Updated system dictionary. ''' train_shuffle = value; val_shuffle = value; system_dict["dataset"]["params"]["train_shuffle"] = train_shuffle; system_dict["dataset"]["params"]["val_shuffle"] = val_shuffle; return system_dict; @accepts(int, dict, post_trace=False) #@TraceFunction(trace_args=False, trace_rv=False) def set_num_processors(num_workers, system_dict): ''' Set Number of processors for data sampling Args: num_workers (int): Max number of CPUs to be used system_dict (dict): System Dictionary Returns: dict: Updated system dictionary. ''' system_dict["dataset"]["params"]["num_workers"] = num_workers; return system_dict; @accepts(bool, dict, post_trace=False) #@TraceFunction(trace_args=False, trace_rv=False) def set_weighted_sampling(sample, system_dict): ''' ''' system_dict["dataset"]["params"]["weighted_sample"] = sample; return system_dict;
PypiClean
/py_bot_starter-0.0.19-py3-none-any.whl/botstarter/db/base.py
import logging import os from enum import Enum from importlib import import_module from os.path import isdir from typing import List, TypeVar, Optional import pymongo from bson import ObjectId from pymongo import database from pymongo.database import Collection from pymongo.results import UpdateResult, DeleteResult __db: database.Database = None DEFAULT_DATABASE = "pybotstarter" TBase = TypeVar("TBase", bound="Base") class Base(dict): __collection__: Collection = None __getattr__ = dict.get __delattr__ = dict.__delitem__ __setattr__ = dict.__setitem__ @classmethod def get_doc(cls, object_id) -> TBase: doc = cls.__collection__.find_one({"_id": ObjectId(object_id)}) if doc: return cls(doc) @classmethod def find(cls, *args, **kwargs) -> List[TBase]: docs = cls.__collection__.find(*args, **kwargs) if docs: return [cls(doc) for doc in docs] @classmethod def find_one(cls, *args, **kwargs) -> TBase: doc = cls.__collection__.find_one(*args, **kwargs) if doc: return cls(doc) @classmethod def update_one(cls, *args, **kwargs) -> UpdateResult: return cls.__collection__.update_one(*args, **kwargs) def save(self): if not self._id: res = self.__collection__.insert_one(self) self['_id'] = res.inserted_id else: self.__collection__.update_one({"_id": ObjectId(self._id)}, self) def reload(self): if self._id: self.update(self.__collection__.find_one({"_id": ObjectId(self._id)})) def remove(self) -> Optional[DeleteResult]: if self._id: result = self.__collection__.delete_one({"_id": ObjectId(self._id)}) self.clear() return result else: return None def get_db() -> database.Database: global __db if __db is not None: return __db else: raise RuntimeError(""" Database was not initialised. To fix this issue add the following lines to your main python file: from botstarter.db.base import init_db if __name__ == "__main__": init_db()""") MODEL_INTERCEPTORS = {} MODEL_CLASSES = {} class InterceptorHooks(Enum): SAVE_USER_CREATE = "save_user_create" def register_model(name): def wrapper(cls): MODEL_CLASSES[name] = cls return cls return wrapper def model_interceptor(hook): def wrapper(func): MODEL_INTERCEPTORS[hook] = func logging.debug("Registered model interceptor for hook %s", hook) return func return wrapper def get_interceptors(hook_name): return MODEL_INTERCEPTORS.get(hook_name) def __create_models(): for collection in MODEL_CLASSES.keys(): cls = MODEL_CLASSES.get(collection) cls.__collection_name__ = collection cls.__collection__ = get_db()[collection] def __load_db_modules_extensions(): # todo: walk db packages using pkgutil, for now using a workaround # import pkgutil # for loader, module_name, is_pkg in pkgutil.walk_packages(botstarter.db.__path__): # print(module_name) import_module("botstarter.db.medias") import_module("botstarter.db.users") caller_db_modules_dir = "db" if isdir(caller_db_modules_dir): modules = os.listdir(caller_db_modules_dir) for m in [mod.replace(".py", "") for mod in modules if mod.endswith(".py") and mod != "__init__.py"]: logging.debug("Loading db module %s", m) import_module(f"{caller_db_modules_dir}.{m}") def init_db(host=None, port=None, database_name=None, auth=None): """ Initializes the database connection with MongoDB. Parameters for the connection can be set using function parameters or environment variables. Every time a parameter is supplied directly to the function, it will override whatever is defined as an environment variables. In essence, environment variables are used as "fallback values" for missing parameters. :param: host: the db hostname. Default is "localhost". Can also be set with "MONGODB_HOST" environment variable :param: port: the db port. Default is "27017". Can also be set with "MONGODB_PORT" environment variable :param: database_name: the name of the database. Default is "pybotstarter". Can also be set with "DATABASE_NAME" environment variable :param: auth: a dict containing the "username" and "password" keys for authentication. If left empty, no authentication is used. To set authentication with environment variables, both "MONGODB_USERNAME" and "MONGODB_PASSWORD" environment variables must be defined. If not a ValueError is raised. """ global __db p_host = host or os.getenv("MONGODB_HOST", "localhost") p_port = port or os.getenv("MONGODB_PORT", 27017) p_database_name = database_name or os.getenv("DATABASE_NAME", DEFAULT_DATABASE) if not auth: env_username = os.getenv("MONGODB_USERNAME") env_password = os.getenv("MONGODB_PASSWORD") if env_username and env_password: auth = { "username": env_username, "password": env_password } elif not env_username and not env_password: auth = {} else: raise ValueError( "Only one authentication variable is set. Please provide both MONGODB_USERNAME and MONGODB_PASSWORD.") client = pymongo.MongoClient( host=p_host, port=int(p_port), **auth ) __db = client[p_database_name] __load_db_modules_extensions() __create_models()
PypiClean
/dgl_cu90-0.5.3-cp38-cp38-win_amd64.whl/dgl_cu90-0.5.3.data/purelib/dgl/sampling/neighbor.py
from .._ffi.function import _init_api from .. import backend as F from ..base import DGLError, EID from ..heterograph import DGLHeteroGraph from .. import ndarray as nd from .. import utils __all__ = [ 'sample_neighbors', 'select_topk'] def sample_neighbors(g, nodes, fanout, edge_dir='in', prob=None, replace=False, copy_ndata=True, copy_edata=True, _dist_training=False): """Sample neighboring edges of the given nodes and return the induced subgraph. For each node, a number of inbound (or outbound when ``edge_dir == 'out'``) edges will be randomly chosen. The graph returned will then contain all the nodes in the original graph, but only the sampled edges. Node/edge features are not preserved. The original IDs of the sampled edges are stored as the `dgl.EID` feature in the returned graph. Parameters ---------- g : DGLGraph The graph. Must be on CPU. nodes : tensor or dict Node IDs to sample neighbors from. This argument can take a single ID tensor or a dictionary of node types and ID tensors. If a single tensor is given, the graph must only have one type of nodes. fanout : int or dict[etype, int] The number of edges to be sampled for each node on each edge type. This argument can take a single int or a dictionary of edge types and ints. If a single int is given, DGL will sample this number of edges for each node for every edge type. If -1 is given for a single edge type, all the neighboring edges with that edge type will be selected. edge_dir : str, optional Determines whether to sample inbound or outbound edges. Can take either ``in`` for inbound edges or ``out`` for outbound edges. prob : str, optional Feature name used as the (unnormalized) probabilities associated with each neighboring edge of a node. The feature must have only one element for each edge. The features must be non-negative floats, and the sum of the features of inbound/outbound edges for every node must be positive (though they don't have to sum up to one). Otherwise, the result will be undefined. replace : bool, optional If True, sample with replacement. copy_ndata: bool, optional If True, the node features of the new graph are copied from the original graph. If False, the new graph will not have any node features. (Default: True) copy_edata: bool, optional If True, the edge features of the new graph are copied from the original graph. If False, the new graph will not have any edge features. (Default: True) _dist_training : bool, optional Internal argument. Do not use. (Default: False) Returns ------- DGLGraph A sampled subgraph containing only the sampled neighboring edges. It is on CPU. Notes ----- If :attr:`copy_ndata` or :attr:`copy_edata` is True, same tensors are used as the node or edge features of the original graph and the new graph. As a result, users should avoid performing in-place operations on the node features of the new graph to avoid feature corruption. Examples -------- Assume that you have the following graph >>> g = dgl.graph(([0, 0, 1, 1, 2, 2], [1, 2, 0, 1, 2, 0])) And the weights >>> g.edata['prob'] = torch.FloatTensor([0., 1., 0., 1., 0., 1.]) To sample one inbound edge for node 0 and node 1: >>> sg = dgl.sampling.sample_neighbors(g, [0, 1], 1) >>> sg.edges(order='eid') (tensor([1, 0]), tensor([0, 1])) >>> sg.edata[dgl.EID] tensor([2, 0]) To sample one inbound edge for node 0 and node 1 with probability in edge feature ``prob``: >>> sg = dgl.sampling.sample_neighbors(g, [0, 1], 1, prob='prob') >>> sg.edges(order='eid') (tensor([2, 1]), tensor([0, 1])) With ``fanout`` greater than the number of actual neighbors and without replacement, DGL will take all neighbors instead: >>> sg = dgl.sampling.sample_neighbors(g, [0, 1], 3) >>> sg.edges(order='eid') (tensor([1, 2, 0, 1]), tensor([0, 0, 1, 1])) """ if not isinstance(nodes, dict): if len(g.ntypes) > 1: raise DGLError("Must specify node type when the graph is not homogeneous.") nodes = {g.ntypes[0] : nodes} assert g.device == F.cpu(), "Graph must be on CPU." nodes = utils.prepare_tensor_dict(g, nodes, 'nodes') nodes_all_types = [] for ntype in g.ntypes: if ntype in nodes: nodes_all_types.append(F.to_dgl_nd(nodes[ntype])) else: nodes_all_types.append(nd.array([], ctx=nd.cpu())) if not isinstance(fanout, dict): fanout_array = [int(fanout)] * len(g.etypes) else: if len(fanout) != len(g.etypes): raise DGLError('Fan-out must be specified for each edge type ' 'if a dict is provided.') fanout_array = [None] * len(g.etypes) for etype, value in fanout.items(): fanout_array[g.get_etype_id(etype)] = value fanout_array = F.to_dgl_nd(F.tensor(fanout_array, dtype=F.int64)) if prob is None: prob_arrays = [nd.array([], ctx=nd.cpu())] * len(g.etypes) else: prob_arrays = [] for etype in g.canonical_etypes: if prob in g.edges[etype].data: prob_arrays.append(F.to_dgl_nd(g.edges[etype].data[prob])) else: prob_arrays.append(nd.array([], ctx=nd.cpu())) subgidx = _CAPI_DGLSampleNeighbors(g._graph, nodes_all_types, fanout_array, edge_dir, prob_arrays, replace) induced_edges = subgidx.induced_edges ret = DGLHeteroGraph(subgidx.graph, g.ntypes, g.etypes) # handle features # (TODO) (BarclayII) DGL distributed fails with bus error, freezes, or other # incomprehensible errors with lazy feature copy. # So in distributed training context, we fall back to old behavior where we # only set the edge IDs. if not _dist_training: if copy_ndata: node_frames = utils.extract_node_subframes(g, None) utils.set_new_frames(ret, node_frames=node_frames) if copy_edata: edge_frames = utils.extract_edge_subframes(g, induced_edges) utils.set_new_frames(ret, edge_frames=edge_frames) else: for i, etype in enumerate(ret.canonical_etypes): ret.edges[etype].data[EID] = induced_edges[i] return ret def select_topk(g, k, weight, nodes=None, edge_dir='in', ascending=False, copy_ndata=True, copy_edata=True): """Select the neighboring edges with k-largest (or k-smallest) weights of the given nodes and return the induced subgraph. For each node, a number of inbound (or outbound when ``edge_dir == 'out'``) edges with the largest (or smallest when ``ascending == True``) weights will be chosen. The graph returned will then contain all the nodes in the original graph, but only the sampled edges. Node/edge features are not preserved. The original IDs of the sampled edges are stored as the `dgl.EID` feature in the returned graph. Parameters ---------- g : DGLGraph The graph. Must be on CPU. k : int or dict[etype, int] The number of edges to be selected for each node on each edge type. This argument can take a single int or a dictionary of edge types and ints. If a single int is given, DGL will select this number of edges for each node for every edge type. If -1 is given for a single edge type, all the neighboring edges with that edge type will be selected. weight : str Feature name of the weights associated with each edge. The feature should have only one element for each edge. The feature can be either int32/64 or float32/64. nodes : tensor or dict, optional Node IDs to sample neighbors from. This argument can take a single ID tensor or a dictionary of node types and ID tensors. If a single tensor is given, the graph must only have one type of nodes. If None, DGL will select the edges for all nodes. edge_dir : str, optional Determines whether to sample inbound or outbound edges. Can take either ``in`` for inbound edges or ``out`` for outbound edges. ascending : bool, optional If True, DGL will return edges with k-smallest weights instead of k-largest weights. copy_ndata: bool, optional If True, the node features of the new graph are copied from the original graph. If False, the new graph will not have any node features. (Default: True) copy_edata: bool, optional If True, the edge features of the new graph are copied from the original graph. If False, the new graph will not have any edge features. (Default: True) Returns ------- DGLGraph A sampled subgraph containing only the sampled neighboring edges. It is on CPU. Notes ----- If :attr:`copy_ndata` or :attr:`copy_edata` is True, same tensors are used as the node or edge features of the original graph and the new graph. As a result, users should avoid performing in-place operations on the node features of the new graph to avoid feature corruption. Examples -------- >>> g = dgl.graph(([0, 0, 1, 1, 2, 2], [1, 2, 0, 1, 2, 0])) >>> g.edata['weight'] = torch.FloatTensor([0, 1, 0, 1, 0, 1]) >>> sg = dgl.sampling.select_topk(g, 1, 'weight') >>> sg.edges(order='eid') (tensor([2, 1, 0]), tensor([0, 1, 2])) """ # Rectify nodes to a dictionary if nodes is None: nodes = {ntype: F.arange(0, g.number_of_nodes(ntype)) for ntype in g.ntypes} elif not isinstance(nodes, dict): if len(g.ntypes) > 1: raise DGLError("Must specify node type when the graph is not homogeneous.") nodes = {g.ntypes[0] : nodes} assert g.device == F.cpu(), "Graph must be on CPU." # Parse nodes into a list of NDArrays. nodes = utils.prepare_tensor_dict(g, nodes, 'nodes') nodes_all_types = [] for ntype in g.ntypes: if ntype in nodes: nodes_all_types.append(F.to_dgl_nd(nodes[ntype])) else: nodes_all_types.append(nd.array([], ctx=nd.cpu())) if not isinstance(k, dict): k_array = [int(k)] * len(g.etypes) else: if len(k) != len(g.etypes): raise DGLError('K value must be specified for each edge type ' 'if a dict is provided.') k_array = [None] * len(g.etypes) for etype, value in k.items(): k_array[g.get_etype_id(etype)] = value k_array = F.to_dgl_nd(F.tensor(k_array, dtype=F.int64)) weight_arrays = [] for etype in g.canonical_etypes: if weight in g.edges[etype].data: weight_arrays.append(F.to_dgl_nd(g.edges[etype].data[weight])) else: raise DGLError('Edge weights "{}" do not exist for relation graph "{}".'.format( weight, etype)) subgidx = _CAPI_DGLSampleNeighborsTopk( g._graph, nodes_all_types, k_array, edge_dir, weight_arrays, bool(ascending)) induced_edges = subgidx.induced_edges ret = DGLHeteroGraph(subgidx.graph, g.ntypes, g.etypes) # handle features if copy_ndata: node_frames = utils.extract_node_subframes(g, None) utils.set_new_frames(ret, node_frames=node_frames) if copy_edata: edge_frames = utils.extract_edge_subframes(g, induced_edges) utils.set_new_frames(ret, edge_frames=edge_frames) return ret _init_api('dgl.sampling.neighbor', __name__)
PypiClean
/django-onec-utils-0.2.2.tar.gz/django-onec-utils-0.2.2/onec_utils/models.py
from datetime import * import logging import random, string import settings from django.db import models from django.utils.translation import ugettext_lazy as _ from django.contrib.localflavor.us.models import USStateField, PhoneNumberField from django.contrib.markup.templatetags import markup from onec_utils.fields import USZipcodeField from onec_utils.utils import google_lat_long MARKUP_HTML = 'h' MARKUP_MARKDOWN = 'm' MARKUP_REST = 'r' MARKUP_TEXTILE = 't' MARKUP_OPTIONS = getattr(settings, 'MARKUP_OPTIONS', ( (MARKUP_HTML, _('HTML/Plain Text')), (MARKUP_MARKDOWN, _('Markdown')), (MARKUP_REST, _('ReStructured Text')), (MARKUP_TEXTILE, _('Textile')) )) MARKUP_DEFAULT = getattr(settings, 'MARKUP_DEFAULT', MARKUP_MARKDOWN) MARKUP_HELP = _("""Select the type of markup you are using in this article. <ul> <li><a href="http://daringfireball.net/projects/markdown/basics" target="_blank">Markdown Guide</a></li> <li><a href="http://docutils.sourceforge.net/docs/user/rst/quickref.html" target="_blank">ReStructured Text Guide</a></li> <li><a href="http://thresholdstate.com/articles/4312/the-textile-reference-manual" target="_blank">Textile Guide</a></li> </ul>""") class Options(object): """ Class handling per-model markup options. """ rendered_field = None source_field = None def __init__(self, opts): for key, value in opts.__dict__.iteritems(): setattr(self, key, value) class MarkupBase(models.base.ModelBase): def __init__(cls, name, bases, attrs): parents = [b for b in bases if isinstance(b, MarkupBase)] if not parents: return ''' Parse MarkupOptions and store them as under _markup on the object. ''' user_opts = getattr(cls, 'MarkupOptions', None) opts = Options(user_opts) setattr(cls, '_markup', opts) class MarkupMixin(models.Model): markup = models.CharField(max_length=1, choices=MARKUP_OPTIONS, default=MARKUP_DEFAULT, help_text=MARKUP_HELP) __metaclass__= MarkupBase class Meta: abstract=True class MarkupOptions: pass def save(self, *args, **kwargs): logging.debug('This mixin is deprecated in favor of the django-markup-mixin project, found on github.') ''' Only try to pre-render if the options have been set.''' if self._markup.rendered_field and self._markup.source_field: logging.debug('Rendering markup for %s to %s.' % (self._markup.source_field, self._markup.rendered_field)) self.do_render_markup() super(MarkupMixin, self).save(*args, **kwargs) def do_render_markup(self): """Turns any markup into HTML""" original = self._rendered if self.markup == MARKUP_MARKDOWN: rendered = markup.markdown(self._source) elif self.markup == MARKUP_REST: rendered = markup.restructuredtext(self._source) elif self.markup == MARKUP_TEXTILE: rendered = markup.textile(self._source) else: rendered = self._source setattr(self, self._markup.rendered_field, rendered) return (rendered != original) @property def _source(self): return getattr(self, self._markup.source_field) @property def _rendered(self): return getattr(self, self._markup.rendered_field) class USAddressPhoneMixin(models.Model): """ Mixin that handles models that need to have an address associated with it. Note: This is none to sophisticated and would need some fleshing out for int'l applications. Also, a little trick where it looks up a lat long using google... """ address=models.CharField(_('Address'), max_length=255) town=models.CharField(_('Town'), max_length=100) state=USStateField(_('State')) zipcode=USZipcodeField(_('Zip'), max_length=5) phone=PhoneNumberField(_('phone'), blank=True, null=True) lat_long=models.CharField(_('Coordinates'), max_length=255, blank=True, null=True) class Meta: abstract=True def save(self, *args, **kwargs): if not self.lat_long: logging.debug('onec_utils.models: USAddressPhoneMixin says "Looking up latitude and longitude for %s %s, %s."' % (self.address, self.town, self.state)) location = "%s +%s +%s +%s" % (self.address, self.town, self.state, self.zipcode) self.lat_long = google_lat_long(location) if not self.lat_long: location = "%s +%s +%s" % (self.town, self.state, self.zipcode) self.lat_long = google_lat_long(location) logging.debug('onec_utils.models: USAddressPhoneMixin says "Latitude and longitude set to %s for %s %s, %s."' % (self.lat_long, self.address, self.town, self.state)) super(USAddressPhoneMixin, self).save(*args, **kwargs) try: RAND_FIELD_LENGTH=settings.RAND_FIELD_LENGTH except: RAND_FIELD_LENGTH = 8 class RandomIDMixin(models.Model): """ Taken directly from djangosnippet.org/snippets/814/ """ id = models.CharField(primary_key=True, max_length=RAND_FIELD_LENGTH) def save(self): if not self.id: self.id = random_id(RAND_FIELD_LENGTH) super(RandomIDMixin, self).save() class Meta: abstract = True # alphabet will become our base-32 character set: alphabet = string.lowercase + string.digits # We must remove 4 characters from alphabet to make it 32 characters long. We want it to be 32 # characters long so that we can use a whole number of random bits to index into it. for loser in 'l1o0': # Choose to remove ones that might be visually confusing i = alphabet.index(loser) alphabet = alphabet[:i] + alphabet[i+1:] def byte_to_base32_chr(byte): return alphabet[byte & 31] def random_id(length): # Can easily be converted to use secure random when available # see http://www.secureprogramming.com/?action=view&feature=recipes&recipeid=20 random_bytes = [random.randint(0, 0xFF) for i in range(length)] return ''.join(map(byte_to_base32_chr, random_bytes)) class StandardMetadata(models.Model): """ A basic (abstract) model for metadata. Included in each model file to maintain application separation. Subclass new models from 'StandardMetadata' instead of 'models.Model'. """ created = models.DateTimeField(_('created'), default=datetime.now, editable=False) updated = models.DateTimeField(_('updated'), default=datetime.now, editable=False) #deleted = models.BooleanField(_('deleted'), default=False, editable=False) class Meta: abstract = True def save(self, *args, **kwargs): self.updated = datetime.now() super(StandardMetadata, self).save(*args, **kwargs) #def delete(self, *args, **kwargs): # self.deleted=True # super(StandardMetadata, self).delete(*args, **kwargs)
PypiClean
/fds.sdk.SecuritizedDerivativesAPIforDigitalPortals-0.10.2-py3-none-any.whl/fds/sdk/SecuritizedDerivativesAPIforDigitalPortals/model/inline_response2005_data_key_figures_delta_effective.py
import re # noqa: F401 import sys # noqa: F401 from fds.sdk.SecuritizedDerivativesAPIforDigitalPortals.model_utils import ( # noqa: F401 ApiTypeError, ModelComposed, ModelNormal, ModelSimple, cached_property, change_keys_js_to_python, convert_js_args_to_python_args, date, datetime, file_type, none_type, validate_get_composed_info, OpenApiModel ) from fds.sdk.SecuritizedDerivativesAPIforDigitalPortals.exceptions import ApiAttributeError class InlineResponse2005DataKeyFiguresDeltaEffective(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. Attributes: allowed_values (dict): The key is the tuple path to the attribute and the for var_name this is (var_name,). The value is a dict with a capitalized key describing the allowed value and an allowed value. These dicts store the allowed enum values. attribute_map (dict): The key is attribute name and the value is json key in definition. discriminator_value_class_map (dict): A dict to go from the discriminator variable value to the discriminator class name. validations (dict): The key is the tuple path to the attribute and the for var_name this is (var_name,). The value is a dict that stores validations for max_length, min_length, max_items, min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, inclusive_minimum, and regex. additional_properties_type (tuple): A tuple of classes accepted as additional properties values. """ allowed_values = { } validations = { } @cached_property def additional_properties_type(): """ This must be a method because a model may have properties that are of type self, this must run after the class is loaded """ return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @cached_property def openapi_types(): """ This must be a method because a model may have properties that are of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ return { 'minimum': (float,), # noqa: E501 'maximum': (float,), # noqa: E501 } @cached_property def discriminator(): return None attribute_map = { 'minimum': 'minimum', # noqa: E501 'maximum': 'maximum', # noqa: E501 } read_only_vars = { } _composed_schemas = {} @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 """InlineResponse2005DataKeyFiguresDeltaEffective - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be raised if the wrong type is input. Defaults to True _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted If omitted no type conversion is done. _visited_composed_classes (tuple): This stores a tuple of classes that we have traveled through so that if we see that class again we will not use its discriminator again. When traveling through a discriminator, the composed schema that is is traveled through is added to this set. For example if Animal has a discriminator petType and we pass in "Dog", and the class Dog allOf includes Animal, we move through Animal once using the discriminator, and pick Dog. Then in Dog, we will make an instance of the Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) minimum (float): Minimum value.. [optional] # noqa: E501 maximum (float): Maximum value.. [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) _spec_property_naming = kwargs.pop('_spec_property_naming', False) _path_to_item = kwargs.pop('_path_to_item', ()) _configuration = kwargs.pop('_configuration', None) _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) self = super(OpenApiModel, cls).__new__(cls) if args: raise ApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( args, self.__class__.__name__, ), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) self._data_store = {} self._check_type = _check_type self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self required_properties = set([ '_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 """InlineResponse2005DataKeyFiguresDeltaEffective - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be raised if the wrong type is input. Defaults to True _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted If omitted no type conversion is done. _visited_composed_classes (tuple): This stores a tuple of classes that we have traveled through so that if we see that class again we will not use its discriminator again. When traveling through a discriminator, the composed schema that is is traveled through is added to this set. For example if Animal has a discriminator petType and we pass in "Dog", and the class Dog allOf includes Animal, we move through Animal once using the discriminator, and pick Dog. Then in Dog, we will make an instance of the Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) minimum (float): Minimum value.. [optional] # noqa: E501 maximum (float): Maximum value.. [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) _spec_property_naming = kwargs.pop('_spec_property_naming', False) _path_to_item = kwargs.pop('_path_to_item', ()) _configuration = kwargs.pop('_configuration', None) _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) if args: raise ApiTypeError( "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( args, self.__class__.__name__, ), path_to_item=_path_to_item, valid_classes=(self.__class__,), ) self._data_store = {} self._check_type = _check_type self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " f"class with read only attributes.")
PypiClean
/vantetider_scraper-0.2.0.tar.gz/vantetider_scraper-0.2.0/README.rst
This is a scraper for statistical data from http://www.vantetider.se built on top of the `Statscraper package <https://github.com/jplusplus/statscraper>`. Install ------- pip install -r requirements.txt The scraper has to do a lot of requests and uses `requests-cache <https://pypi.python.org/pypi/requests-cache>` to store queries. Example usage ------------- .. code:: python from vantetider import VantetiderScraper scraper = VantetiderScraper() scraper.items # List _implemeted_ datasets # [<VantetiderDataset: VantatKortareAn60Dagar (Väntat kortare än 60 dagar )>, <VantetiderDataset: Overbelaggning (Överbeläggningar)>, <VantetiderDataset: PrimarvardTelefon (Telefontillgänglighet)>, <VantetiderDataset: PrimarvardBesok (Läkarbesök)>, <VantetiderDataset: SpecialiseradBesok (Förstabesök)>, <VantetiderDataset: SpecialiseradOperation (Operation/åtgärd)>] dataset = scraper.get("Overbelaggning") # Get a specific dataset # List all available dimensions print dataset.dimensions print datatset.regions # List available region print datatset.years # List available years # Make a query, you have to explicitly define all dimension values you want # to query. By default the scraper will fetch default values. res = dataset.fetch({ "region": "Blekinge", "year": "2016", "period": "Februari", # Currenty we can only query by id of dimension value "type_of_overbelaggning": ["0", "1"], # "Somatik" and "Psykiatri" }) # Do something with the result df = res.pandas Practical application, using dataset.py for storege. .. code:: python from vantetider import VantetiderScraper from vantetider.allowed_values import TYPE_OF_OVERBELAGGNING, PERIODS import dataset db = dataset.connect('sqlite:///vantetider.db') TOPIC = "Overbelaggning" # Set up local db table = db.create_table(TOPIC) scraper = VantetiderScraper() dataset = scraper.get(TOPIC) # Get all available regions and years for query years = [x.value for x in dataset.years] regions = [x.value for x in dataset.regions] # Query in chunks to be able to store to database on the run for region in regions: for year in years: res = dataset.fetch({ "year": year, "type_of_overbelaggning": [x[0] for x in TYPE_OF_OVERBELAGGNING], "period": PERIODS, "region": region, }) df = res.pandas data = res.list_of_dicts table.insert_many(data) TODO ---- - Implement scraping of "Aterbesok", "Undersokningar", "BUPdetalj", "BUP". - Enable querying on label names on all dimensions - Add more allowed values to `vantetider/allowed_values.py` - Make requests-cache optional. Devlop ------ Run tests: make tests
PypiClean
/url-normalize-1.4.3.tar.gz/url-normalize-1.4.3/README.md
url-normalize ============= [![Build Status](https://travis-ci.org/niksite/url-normalize.svg?branch=master)](https://travis-ci.org/niksite/url-normalize) [![Coverage Status](https://coveralls.io/repos/github/niksite/url-normalize/badge.svg?branch=master)](https://coveralls.io/github/niksite/url-normalize?branch=master) URI Normalization function: * Take care of IDN domains. * Always provide the URI scheme in lowercase characters. * Always provide the host, if any, in lowercase characters. * Only perform percent-encoding where it is essential. * Always use uppercase A-through-F characters when percent-encoding. * Prevent dot-segments appearing in non-relative URI paths. * For schemes that define a default authority, use an empty authority if the default is desired. * For schemes that define an empty path to be equivalent to a path of "/", use "/". * For schemes that define a port, use an empty port if the default is desired * All portions of the URI must be utf-8 encoded NFC from Unicode strings Inspired by Sam Ruby's [urlnorm.py](http://intertwingly.net/blog/2004/08/04/Urlnorm) Example: ```sh $ pip install url-normalize Collecting url-normalize ... Successfully installed future-0.16.0 url-normalize-1.3.3 $ python Python 3.6.1 (default, Jul 8 2017, 05:00:20) [GCC 4.9.2] on linux Type "help", "copyright", "credits" or "license" for more information. > from url_normalize import url_normalize > print(url_normalize('www.foo.com:80/foo')) > https://www.foo.com/foo ``` History: * 1.4.3: Added LICENSE file * 1.4.2: Added an optional param sort_query_params (True by default) * 1.4.1: Added an optional param default_scheme to the url_normalize ('https' by default) * 1.4.0: A bit of code refactoring and cleanup * 1.3.3: Support empty string and double slash urls (//domain.tld) * 1.3.2: Same code support both Python 3 and Python 2. * 1.3.1: Python 3 compatibility * 1.2.1: PEP8, setup.py * 1.1.2: support for shebang (#!) urls * 1.1.1: using 'http' schema by default when appropriate * 1.1.0: added handling of IDN domains * 1.0.0: code pep8 * 0.1.0: forked from Sam Ruby's urlnorm.py License: MIT License
PypiClean
/PySDL2-0.9.16.tar.gz/PySDL2-0.9.16/doc/index.rst
Welcome to PySDL2's documentation! ================================== PySDL2 is a wrapper around the SDL2 library and as such similar to the discontinued PySDL project. In contrast to PySDL, it has no licensing restrictions, nor does it rely on C code, but uses :mod:`ctypes` instead. Getting Started =============== .. toctree:: :maxdepth: 2 install.rst integration.rst faq.rst tutorial/index.rst API Reference ============= .. toctree:: :maxdepth: 2 modules/index.rst Project Information =================== .. toctree:: :maxdepth: 1 news.rst todos.rst copying.rst Indices and tables ================== * :ref:`genindex` * :ref:`modindex` * :ref:`search`
PypiClean
/DeploymentTool-1.5.zip/DeploymentTool-1.5/README.rst
How to use: 1. easy_install DeploymentTool 2. after all dependency installed download the project at here https://pypi.python.org/pypi?:action=display&name=DeploymentTool&version=1.4 3. extract the downloaded file 4. go to the directory of extracted file or with cmd if using windows 5. go to Deployment directory and make sure manage.py file is there 6. run manage.py createsuperadmin 7. create database with name deploymentdb and back to the Deployment directory 8. run manage.py syncdb 9. run manage.py runserver 10. go to localhost:8000/admin and login with your newly created superadmin account 11. create new host and users 12. go to localhost:8000 and login with your superadmin account or newly added user
PypiClean
/boot-synth-1.2.0.tar.gz/boot-synth-1.2.0/synth/projects_master/nginx_router/frontend/react/node_modules/css/node_modules/source-map/lib/source-map-consumer.js
* Copyright 2011 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause */ var util = require('./util'); var binarySearch = require('./binary-search'); var ArraySet = require('./array-set').ArraySet; var base64VLQ = require('./base64-vlq'); var quickSort = require('./quick-sort').quickSort; function SourceMapConsumer(aSourceMap, aSourceMapURL) { var sourceMap = aSourceMap; if (typeof aSourceMap === 'string') { sourceMap = util.parseSourceMapInput(aSourceMap); } return sourceMap.sections != null ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) : new BasicSourceMapConsumer(sourceMap, aSourceMapURL); } SourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) { return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL); } /** * The version of the source mapping spec that we are consuming. */ SourceMapConsumer.prototype._version = 3; // `__generatedMappings` and `__originalMappings` are arrays that hold the // parsed mapping coordinates from the source map's "mappings" attribute. They // are lazily instantiated, accessed via the `_generatedMappings` and // `_originalMappings` getters respectively, and we only parse the mappings // and create these arrays once queried for a source location. We jump through // these hoops because there can be many thousands of mappings, and parsing // them is expensive, so we only want to do it if we must. // // Each object in the arrays is of the form: // // { // generatedLine: The line number in the generated code, // generatedColumn: The column number in the generated code, // source: The path to the original source file that generated this // chunk of code, // originalLine: The line number in the original source that // corresponds to this chunk of generated code, // originalColumn: The column number in the original source that // corresponds to this chunk of generated code, // name: The name of the original symbol which generated this chunk of // code. // } // // All properties except for `generatedLine` and `generatedColumn` can be // `null`. // // `_generatedMappings` is ordered by the generated positions. // // `_originalMappings` is ordered by the original positions. SourceMapConsumer.prototype.__generatedMappings = null; Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', { configurable: true, enumerable: true, get: function () { if (!this.__generatedMappings) { this._parseMappings(this._mappings, this.sourceRoot); } return this.__generatedMappings; } }); SourceMapConsumer.prototype.__originalMappings = null; Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', { configurable: true, enumerable: true, get: function () { if (!this.__originalMappings) { this._parseMappings(this._mappings, this.sourceRoot); } return this.__originalMappings; } }); SourceMapConsumer.prototype._charIsMappingSeparator = function SourceMapConsumer_charIsMappingSeparator(aStr, index) { var c = aStr.charAt(index); return c === ";" || c === ","; }; /** * Parse the mappings in a string in to a data structure which we can easily * query (the ordered arrays in the `this.__generatedMappings` and * `this.__originalMappings` properties). */ SourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { throw new Error("Subclasses must implement _parseMappings"); }; SourceMapConsumer.GENERATED_ORDER = 1; SourceMapConsumer.ORIGINAL_ORDER = 2; SourceMapConsumer.GREATEST_LOWER_BOUND = 1; SourceMapConsumer.LEAST_UPPER_BOUND = 2; /** * Iterate over each mapping between an original source/line/column and a * generated line/column in this source map. * * @param Function aCallback * The function that is called with each mapping. * @param Object aContext * Optional. If specified, this object will be the value of `this` every * time that `aCallback` is called. * @param aOrder * Either `SourceMapConsumer.GENERATED_ORDER` or * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to * iterate over the mappings sorted by the generated file's line/column * order or the original's source/line/column order, respectively. Defaults to * `SourceMapConsumer.GENERATED_ORDER`. */ SourceMapConsumer.prototype.eachMapping = function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) { var context = aContext || null; var order = aOrder || SourceMapConsumer.GENERATED_ORDER; var mappings; switch (order) { case SourceMapConsumer.GENERATED_ORDER: mappings = this._generatedMappings; break; case SourceMapConsumer.ORIGINAL_ORDER: mappings = this._originalMappings; break; default: throw new Error("Unknown order of iteration."); } var sourceRoot = this.sourceRoot; mappings.map(function (mapping) { var source = mapping.source === null ? null : this._sources.at(mapping.source); source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL); return { source: source, generatedLine: mapping.generatedLine, generatedColumn: mapping.generatedColumn, originalLine: mapping.originalLine, originalColumn: mapping.originalColumn, name: mapping.name === null ? null : this._names.at(mapping.name) }; }, this).forEach(aCallback, context); }; /** * Returns all generated line and column information for the original source, * line, and column provided. If no column is provided, returns all mappings * corresponding to a either the line we are searching for or the next * closest line that has any mappings. Otherwise, returns all mappings * corresponding to the given line and either the column we are searching for * or the next closest column that has any offsets. * * The only argument is an object with the following properties: * * - source: The filename of the original source. * - line: The line number in the original source. The line number is 1-based. * - column: Optional. the column number in the original source. * The column number is 0-based. * * and an array of objects is returned, each with the following properties: * * - line: The line number in the generated source, or null. The * line number is 1-based. * - column: The column number in the generated source, or null. * The column number is 0-based. */ SourceMapConsumer.prototype.allGeneratedPositionsFor = function SourceMapConsumer_allGeneratedPositionsFor(aArgs) { var line = util.getArg(aArgs, 'line'); // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping // returns the index of the closest mapping less than the needle. By // setting needle.originalColumn to 0, we thus find the last mapping for // the given line, provided such a mapping exists. var needle = { source: util.getArg(aArgs, 'source'), originalLine: line, originalColumn: util.getArg(aArgs, 'column', 0) }; needle.source = this._findSourceIndex(needle.source); if (needle.source < 0) { return []; } var mappings = []; var index = this._findMapping(needle, this._originalMappings, "originalLine", "originalColumn", util.compareByOriginalPositions, binarySearch.LEAST_UPPER_BOUND); if (index >= 0) { var mapping = this._originalMappings[index]; if (aArgs.column === undefined) { var originalLine = mapping.originalLine; // Iterate until either we run out of mappings, or we run into // a mapping for a different line than the one we found. Since // mappings are sorted, this is guaranteed to find all mappings for // the line we found. while (mapping && mapping.originalLine === originalLine) { mappings.push({ line: util.getArg(mapping, 'generatedLine', null), column: util.getArg(mapping, 'generatedColumn', null), lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) }); mapping = this._originalMappings[++index]; } } else { var originalColumn = mapping.originalColumn; // Iterate until either we run out of mappings, or we run into // a mapping for a different line than the one we were searching for. // Since mappings are sorted, this is guaranteed to find all mappings for // the line we are searching for. while (mapping && mapping.originalLine === line && mapping.originalColumn == originalColumn) { mappings.push({ line: util.getArg(mapping, 'generatedLine', null), column: util.getArg(mapping, 'generatedColumn', null), lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) }); mapping = this._originalMappings[++index]; } } } return mappings; }; exports.SourceMapConsumer = SourceMapConsumer; /** * A BasicSourceMapConsumer instance represents a parsed source map which we can * query for information about the original file positions by giving it a file * position in the generated source. * * The first parameter is the raw source map (either as a JSON string, or * already parsed to an object). According to the spec, source maps have the * following attributes: * * - version: Which version of the source map spec this map is following. * - sources: An array of URLs to the original source files. * - names: An array of identifiers which can be referrenced by individual mappings. * - sourceRoot: Optional. The URL root from which all sources are relative. * - sourcesContent: Optional. An array of contents of the original source files. * - mappings: A string of base64 VLQs which contain the actual mappings. * - file: Optional. The generated file this source map is associated with. * * Here is an example source map, taken from the source map spec[0]: * * { * version : 3, * file: "out.js", * sourceRoot : "", * sources: ["foo.js", "bar.js"], * names: ["src", "maps", "are", "fun"], * mappings: "AA,AB;;ABCDE;" * } * * The second parameter, if given, is a string whose value is the URL * at which the source map was found. This URL is used to compute the * sources array. * * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1# */ function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) { var sourceMap = aSourceMap; if (typeof aSourceMap === 'string') { sourceMap = util.parseSourceMapInput(aSourceMap); } var version = util.getArg(sourceMap, 'version'); var sources = util.getArg(sourceMap, 'sources'); // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which // requires the array) to play nice here. var names = util.getArg(sourceMap, 'names', []); var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null); var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null); var mappings = util.getArg(sourceMap, 'mappings'); var file = util.getArg(sourceMap, 'file', null); // Once again, Sass deviates from the spec and supplies the version as a // string rather than a number, so we use loose equality checking here. if (version != this._version) { throw new Error('Unsupported version: ' + version); } if (sourceRoot) { sourceRoot = util.normalize(sourceRoot); } sources = sources .map(String) // Some source maps produce relative source paths like "./foo.js" instead of // "foo.js". Normalize these first so that future comparisons will succeed. // See bugzil.la/1090768. .map(util.normalize) // Always ensure that absolute sources are internally stored relative to // the source root, if the source root is absolute. Not doing this would // be particularly problematic when the source root is a prefix of the // source (valid, but why??). See github issue #199 and bugzil.la/1188982. .map(function (source) { return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) ? util.relative(sourceRoot, source) : source; }); // Pass `true` below to allow duplicate names and sources. While source maps // are intended to be compressed and deduplicated, the TypeScript compiler // sometimes generates source maps with duplicates in them. See Github issue // #72 and bugzil.la/889492. this._names = ArraySet.fromArray(names.map(String), true); this._sources = ArraySet.fromArray(sources, true); this._absoluteSources = this._sources.toArray().map(function (s) { return util.computeSourceURL(sourceRoot, s, aSourceMapURL); }); this.sourceRoot = sourceRoot; this.sourcesContent = sourcesContent; this._mappings = mappings; this._sourceMapURL = aSourceMapURL; this.file = file; } BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer; /** * Utility function to find the index of a source. Returns -1 if not * found. */ BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) { var relativeSource = aSource; if (this.sourceRoot != null) { relativeSource = util.relative(this.sourceRoot, relativeSource); } if (this._sources.has(relativeSource)) { return this._sources.indexOf(relativeSource); } // Maybe aSource is an absolute URL as returned by |sources|. In // this case we can't simply undo the transform. var i; for (i = 0; i < this._absoluteSources.length; ++i) { if (this._absoluteSources[i] == aSource) { return i; } } return -1; }; /** * Create a BasicSourceMapConsumer from a SourceMapGenerator. * * @param SourceMapGenerator aSourceMap * The source map that will be consumed. * @param String aSourceMapURL * The URL at which the source map can be found (optional) * @returns BasicSourceMapConsumer */ BasicSourceMapConsumer.fromSourceMap = function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) { var smc = Object.create(BasicSourceMapConsumer.prototype); var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true); var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true); smc.sourceRoot = aSourceMap._sourceRoot; smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), smc.sourceRoot); smc.file = aSourceMap._file; smc._sourceMapURL = aSourceMapURL; smc._absoluteSources = smc._sources.toArray().map(function (s) { return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL); }); // Because we are modifying the entries (by converting string sources and // names to indices into the sources and names ArraySets), we have to make // a copy of the entry or else bad things happen. Shared mutable state // strikes again! See github issue #191. var generatedMappings = aSourceMap._mappings.toArray().slice(); var destGeneratedMappings = smc.__generatedMappings = []; var destOriginalMappings = smc.__originalMappings = []; for (var i = 0, length = generatedMappings.length; i < length; i++) { var srcMapping = generatedMappings[i]; var destMapping = new Mapping; destMapping.generatedLine = srcMapping.generatedLine; destMapping.generatedColumn = srcMapping.generatedColumn; if (srcMapping.source) { destMapping.source = sources.indexOf(srcMapping.source); destMapping.originalLine = srcMapping.originalLine; destMapping.originalColumn = srcMapping.originalColumn; if (srcMapping.name) { destMapping.name = names.indexOf(srcMapping.name); } destOriginalMappings.push(destMapping); } destGeneratedMappings.push(destMapping); } quickSort(smc.__originalMappings, util.compareByOriginalPositions); return smc; }; /** * The version of the source mapping spec that we are consuming. */ BasicSourceMapConsumer.prototype._version = 3; /** * The list of original sources. */ Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', { get: function () { return this._absoluteSources.slice(); } }); /** * Provide the JIT with a nice shape / hidden class. */ function Mapping() { this.generatedLine = 0; this.generatedColumn = 0; this.source = null; this.originalLine = null; this.originalColumn = null; this.name = null; } /** * Parse the mappings in a string in to a data structure which we can easily * query (the ordered arrays in the `this.__generatedMappings` and * `this.__originalMappings` properties). */ BasicSourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { var generatedLine = 1; var previousGeneratedColumn = 0; var previousOriginalLine = 0; var previousOriginalColumn = 0; var previousSource = 0; var previousName = 0; var length = aStr.length; var index = 0; var cachedSegments = {}; var temp = {}; var originalMappings = []; var generatedMappings = []; var mapping, str, segment, end, value; while (index < length) { if (aStr.charAt(index) === ';') { generatedLine++; index++; previousGeneratedColumn = 0; } else if (aStr.charAt(index) === ',') { index++; } else { mapping = new Mapping(); mapping.generatedLine = generatedLine; // Because each offset is encoded relative to the previous one, // many segments often have the same encoding. We can exploit this // fact by caching the parsed variable length fields of each segment, // allowing us to avoid a second parse if we encounter the same // segment again. for (end = index; end < length; end++) { if (this._charIsMappingSeparator(aStr, end)) { break; } } str = aStr.slice(index, end); segment = cachedSegments[str]; if (segment) { index += str.length; } else { segment = []; while (index < end) { base64VLQ.decode(aStr, index, temp); value = temp.value; index = temp.rest; segment.push(value); } if (segment.length === 2) { throw new Error('Found a source, but no line and column'); } if (segment.length === 3) { throw new Error('Found a source and line, but no column'); } cachedSegments[str] = segment; } // Generated column. mapping.generatedColumn = previousGeneratedColumn + segment[0]; previousGeneratedColumn = mapping.generatedColumn; if (segment.length > 1) { // Original source. mapping.source = previousSource + segment[1]; previousSource += segment[1]; // Original line. mapping.originalLine = previousOriginalLine + segment[2]; previousOriginalLine = mapping.originalLine; // Lines are stored 0-based mapping.originalLine += 1; // Original column. mapping.originalColumn = previousOriginalColumn + segment[3]; previousOriginalColumn = mapping.originalColumn; if (segment.length > 4) { // Original name. mapping.name = previousName + segment[4]; previousName += segment[4]; } } generatedMappings.push(mapping); if (typeof mapping.originalLine === 'number') { originalMappings.push(mapping); } } } quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated); this.__generatedMappings = generatedMappings; quickSort(originalMappings, util.compareByOriginalPositions); this.__originalMappings = originalMappings; }; /** * Find the mapping that best matches the hypothetical "needle" mapping that * we are searching for in the given "haystack" of mappings. */ BasicSourceMapConsumer.prototype._findMapping = function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, aColumnName, aComparator, aBias) { // To return the position we are searching for, we must first find the // mapping for the given position and then return the opposite position it // points to. Because the mappings are sorted, we can use binary search to // find the best mapping. if (aNeedle[aLineName] <= 0) { throw new TypeError('Line must be greater than or equal to 1, got ' + aNeedle[aLineName]); } if (aNeedle[aColumnName] < 0) { throw new TypeError('Column must be greater than or equal to 0, got ' + aNeedle[aColumnName]); } return binarySearch.search(aNeedle, aMappings, aComparator, aBias); }; /** * Compute the last column for each generated mapping. The last column is * inclusive. */ BasicSourceMapConsumer.prototype.computeColumnSpans = function SourceMapConsumer_computeColumnSpans() { for (var index = 0; index < this._generatedMappings.length; ++index) { var mapping = this._generatedMappings[index]; // Mappings do not contain a field for the last generated columnt. We // can come up with an optimistic estimate, however, by assuming that // mappings are contiguous (i.e. given two consecutive mappings, the // first mapping ends where the second one starts). if (index + 1 < this._generatedMappings.length) { var nextMapping = this._generatedMappings[index + 1]; if (mapping.generatedLine === nextMapping.generatedLine) { mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1; continue; } } // The last mapping for each line spans the entire line. mapping.lastGeneratedColumn = Infinity; } }; /** * Returns the original source, line, and column information for the generated * source's line and column positions provided. The only argument is an object * with the following properties: * * - line: The line number in the generated source. The line number * is 1-based. * - column: The column number in the generated source. The column * number is 0-based. * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the * closest element that is smaller than or greater than the one we are * searching for, respectively, if the exact element cannot be found. * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. * * and an object is returned with the following properties: * * - source: The original source file, or null. * - line: The line number in the original source, or null. The * line number is 1-based. * - column: The column number in the original source, or null. The * column number is 0-based. * - name: The original identifier, or null. */ BasicSourceMapConsumer.prototype.originalPositionFor = function SourceMapConsumer_originalPositionFor(aArgs) { var needle = { generatedLine: util.getArg(aArgs, 'line'), generatedColumn: util.getArg(aArgs, 'column') }; var index = this._findMapping( needle, this._generatedMappings, "generatedLine", "generatedColumn", util.compareByGeneratedPositionsDeflated, util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) ); if (index >= 0) { var mapping = this._generatedMappings[index]; if (mapping.generatedLine === needle.generatedLine) { var source = util.getArg(mapping, 'source', null); if (source !== null) { source = this._sources.at(source); source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL); } var name = util.getArg(mapping, 'name', null); if (name !== null) { name = this._names.at(name); } return { source: source, line: util.getArg(mapping, 'originalLine', null), column: util.getArg(mapping, 'originalColumn', null), name: name }; } } return { source: null, line: null, column: null, name: null }; }; /** * Return true if we have the source content for every source in the source * map, false otherwise. */ BasicSourceMapConsumer.prototype.hasContentsOfAllSources = function BasicSourceMapConsumer_hasContentsOfAllSources() { if (!this.sourcesContent) { return false; } return this.sourcesContent.length >= this._sources.size() && !this.sourcesContent.some(function (sc) { return sc == null; }); }; /** * Returns the original source content. The only argument is the url of the * original source file. Returns null if no original source content is * available. */ BasicSourceMapConsumer.prototype.sourceContentFor = function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { if (!this.sourcesContent) { return null; } var index = this._findSourceIndex(aSource); if (index >= 0) { return this.sourcesContent[index]; } var relativeSource = aSource; if (this.sourceRoot != null) { relativeSource = util.relative(this.sourceRoot, relativeSource); } var url; if (this.sourceRoot != null && (url = util.urlParse(this.sourceRoot))) { // XXX: file:// URIs and absolute paths lead to unexpected behavior for // many users. We can help them out when they expect file:// URIs to // behave like it would if they were running a local HTTP server. See // https://bugzilla.mozilla.org/show_bug.cgi?id=885597. var fileUriAbsPath = relativeSource.replace(/^file:\/\//, ""); if (url.scheme == "file" && this._sources.has(fileUriAbsPath)) { return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)] } if ((!url.path || url.path == "/") && this._sources.has("/" + relativeSource)) { return this.sourcesContent[this._sources.indexOf("/" + relativeSource)]; } } // This function is used recursively from // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we // don't want to throw if we can't find the source - we just want to // return null, so we provide a flag to exit gracefully. if (nullOnMissing) { return null; } else { throw new Error('"' + relativeSource + '" is not in the SourceMap.'); } }; /** * Returns the generated line and column information for the original source, * line, and column positions provided. The only argument is an object with * the following properties: * * - source: The filename of the original source. * - line: The line number in the original source. The line number * is 1-based. * - column: The column number in the original source. The column * number is 0-based. * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the * closest element that is smaller than or greater than the one we are * searching for, respectively, if the exact element cannot be found. * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. * * and an object is returned with the following properties: * * - line: The line number in the generated source, or null. The * line number is 1-based. * - column: The column number in the generated source, or null. * The column number is 0-based. */ BasicSourceMapConsumer.prototype.generatedPositionFor = function SourceMapConsumer_generatedPositionFor(aArgs) { var source = util.getArg(aArgs, 'source'); source = this._findSourceIndex(source); if (source < 0) { return { line: null, column: null, lastColumn: null }; } var needle = { source: source, originalLine: util.getArg(aArgs, 'line'), originalColumn: util.getArg(aArgs, 'column') }; var index = this._findMapping( needle, this._originalMappings, "originalLine", "originalColumn", util.compareByOriginalPositions, util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) ); if (index >= 0) { var mapping = this._originalMappings[index]; if (mapping.source === needle.source) { return { line: util.getArg(mapping, 'generatedLine', null), column: util.getArg(mapping, 'generatedColumn', null), lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) }; } } return { line: null, column: null, lastColumn: null }; }; exports.BasicSourceMapConsumer = BasicSourceMapConsumer; /** * An IndexedSourceMapConsumer instance represents a parsed source map which * we can query for information. It differs from BasicSourceMapConsumer in * that it takes "indexed" source maps (i.e. ones with a "sections" field) as * input. * * The first parameter is a raw source map (either as a JSON string, or already * parsed to an object). According to the spec for indexed source maps, they * have the following attributes: * * - version: Which version of the source map spec this map is following. * - file: Optional. The generated file this source map is associated with. * - sections: A list of section definitions. * * Each value under the "sections" field has two fields: * - offset: The offset into the original specified at which this section * begins to apply, defined as an object with a "line" and "column" * field. * - map: A source map definition. This source map could also be indexed, * but doesn't have to be. * * Instead of the "map" field, it's also possible to have a "url" field * specifying a URL to retrieve a source map from, but that's currently * unsupported. * * Here's an example source map, taken from the source map spec[0], but * modified to omit a section which uses the "url" field. * * { * version : 3, * file: "app.js", * sections: [{ * offset: {line:100, column:10}, * map: { * version : 3, * file: "section.js", * sources: ["foo.js", "bar.js"], * names: ["src", "maps", "are", "fun"], * mappings: "AAAA,E;;ABCDE;" * } * }], * } * * The second parameter, if given, is a string whose value is the URL * at which the source map was found. This URL is used to compute the * sources array. * * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt */ function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) { var sourceMap = aSourceMap; if (typeof aSourceMap === 'string') { sourceMap = util.parseSourceMapInput(aSourceMap); } var version = util.getArg(sourceMap, 'version'); var sections = util.getArg(sourceMap, 'sections'); if (version != this._version) { throw new Error('Unsupported version: ' + version); } this._sources = new ArraySet(); this._names = new ArraySet(); var lastOffset = { line: -1, column: 0 }; this._sections = sections.map(function (s) { if (s.url) { // The url field will require support for asynchronicity. // See https://github.com/mozilla/source-map/issues/16 throw new Error('Support for url field in sections not implemented.'); } var offset = util.getArg(s, 'offset'); var offsetLine = util.getArg(offset, 'line'); var offsetColumn = util.getArg(offset, 'column'); if (offsetLine < lastOffset.line || (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) { throw new Error('Section offsets must be ordered and non-overlapping.'); } lastOffset = offset; return { generatedOffset: { // The offset fields are 0-based, but we use 1-based indices when // encoding/decoding from VLQ. generatedLine: offsetLine + 1, generatedColumn: offsetColumn + 1 }, consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL) } }); } IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer; /** * The version of the source mapping spec that we are consuming. */ IndexedSourceMapConsumer.prototype._version = 3; /** * The list of original sources. */ Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', { get: function () { var sources = []; for (var i = 0; i < this._sections.length; i++) { for (var j = 0; j < this._sections[i].consumer.sources.length; j++) { sources.push(this._sections[i].consumer.sources[j]); } } return sources; } }); /** * Returns the original source, line, and column information for the generated * source's line and column positions provided. The only argument is an object * with the following properties: * * - line: The line number in the generated source. The line number * is 1-based. * - column: The column number in the generated source. The column * number is 0-based. * * and an object is returned with the following properties: * * - source: The original source file, or null. * - line: The line number in the original source, or null. The * line number is 1-based. * - column: The column number in the original source, or null. The * column number is 0-based. * - name: The original identifier, or null. */ IndexedSourceMapConsumer.prototype.originalPositionFor = function IndexedSourceMapConsumer_originalPositionFor(aArgs) { var needle = { generatedLine: util.getArg(aArgs, 'line'), generatedColumn: util.getArg(aArgs, 'column') }; // Find the section containing the generated position we're trying to map // to an original position. var sectionIndex = binarySearch.search(needle, this._sections, function(needle, section) { var cmp = needle.generatedLine - section.generatedOffset.generatedLine; if (cmp) { return cmp; } return (needle.generatedColumn - section.generatedOffset.generatedColumn); }); var section = this._sections[sectionIndex]; if (!section) { return { source: null, line: null, column: null, name: null }; } return section.consumer.originalPositionFor({ line: needle.generatedLine - (section.generatedOffset.generatedLine - 1), column: needle.generatedColumn - (section.generatedOffset.generatedLine === needle.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0), bias: aArgs.bias }); }; /** * Return true if we have the source content for every source in the source * map, false otherwise. */ IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = function IndexedSourceMapConsumer_hasContentsOfAllSources() { return this._sections.every(function (s) { return s.consumer.hasContentsOfAllSources(); }); }; /** * Returns the original source content. The only argument is the url of the * original source file. Returns null if no original source content is * available. */ IndexedSourceMapConsumer.prototype.sourceContentFor = function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { for (var i = 0; i < this._sections.length; i++) { var section = this._sections[i]; var content = section.consumer.sourceContentFor(aSource, true); if (content) { return content; } } if (nullOnMissing) { return null; } else { throw new Error('"' + aSource + '" is not in the SourceMap.'); } }; /** * Returns the generated line and column information for the original source, * line, and column positions provided. The only argument is an object with * the following properties: * * - source: The filename of the original source. * - line: The line number in the original source. The line number * is 1-based. * - column: The column number in the original source. The column * number is 0-based. * * and an object is returned with the following properties: * * - line: The line number in the generated source, or null. The * line number is 1-based. * - column: The column number in the generated source, or null. * The column number is 0-based. */ IndexedSourceMapConsumer.prototype.generatedPositionFor = function IndexedSourceMapConsumer_generatedPositionFor(aArgs) { for (var i = 0; i < this._sections.length; i++) { var section = this._sections[i]; // Only consider this section if the requested source is in the list of // sources of the consumer. if (section.consumer._findSourceIndex(util.getArg(aArgs, 'source')) === -1) { continue; } var generatedPosition = section.consumer.generatedPositionFor(aArgs); if (generatedPosition) { var ret = { line: generatedPosition.line + (section.generatedOffset.generatedLine - 1), column: generatedPosition.column + (section.generatedOffset.generatedLine === generatedPosition.line ? section.generatedOffset.generatedColumn - 1 : 0) }; return ret; } } return { line: null, column: null }; }; /** * Parse the mappings in a string in to a data structure which we can easily * query (the ordered arrays in the `this.__generatedMappings` and * `this.__originalMappings` properties). */ IndexedSourceMapConsumer.prototype._parseMappings = function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) { this.__generatedMappings = []; this.__originalMappings = []; for (var i = 0; i < this._sections.length; i++) { var section = this._sections[i]; var sectionMappings = section.consumer._generatedMappings; for (var j = 0; j < sectionMappings.length; j++) { var mapping = sectionMappings[j]; var source = section.consumer._sources.at(mapping.source); source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL); this._sources.add(source); source = this._sources.indexOf(source); var name = null; if (mapping.name) { name = section.consumer._names.at(mapping.name); this._names.add(name); name = this._names.indexOf(name); } // The mappings coming from the consumer for the section have // generated positions relative to the start of the section, so we // need to offset them to be relative to the start of the concatenated // generated file. var adjustedMapping = { source: source, generatedLine: mapping.generatedLine + (section.generatedOffset.generatedLine - 1), generatedColumn: mapping.generatedColumn + (section.generatedOffset.generatedLine === mapping.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0), originalLine: mapping.originalLine, originalColumn: mapping.originalColumn, name: name }; this.__generatedMappings.push(adjustedMapping); if (typeof adjustedMapping.originalLine === 'number') { this.__originalMappings.push(adjustedMapping); } } } quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated); quickSort(this.__originalMappings, util.compareByOriginalPositions); }; exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;
PypiClean
/optimizer/MomentumBisection.py
from abc import abstractmethod # Third party imports import numpy as np from .base import Optimizer class Momentum(Optimizer): """Optimizer object Implementation of Momentum (Polyak, 1964) """ def __init__(self, surrogate, params=[1e-3, 0.9]): super().__init__(surrogate, params) def run(self, xp, num_iters, surrogate_grad_params): alpha = self.params[0] beta = self.params[1] x_next = xp mt = 0 for i in range(num_iters): # grad has shape (d, ) grad = self.surrogate.eval_gradient(x_next, surrogate_grad_params) x_old = x_next mt = beta * mt + (1 - beta) * grad x_next = x_next - alpha * mt # convergence if np.linalg.norm(x_old - x_next) < 1e-3: return x_next return x_next class MomentumBisection(Optimizer): """Optimizer object Implementation of Momentum (Polyak, 1964) Modified with bisection method if a sign change of gradient happened """ def __init__(self, surrogate, params=[1e-3, 0.9]): super().__init__(surrogate, params) def run(self, xp, num_iters, surrogate_grad_params, k=2): alpha = np.ones_like(xp) * self.params[0] beta = self.params[1] mt = 0 x_next = xp grad = self.surrogate.eval_gradient(xp, surrogate_grad_params) for i in range(1, num_iters): # store old point with its gradient x_old = x_next grad_old = grad # Momentum update rule mt = beta * mt + (1 - beta) * grad_old x_new = x_next - alpha * mt grad = self.surrogate.eval_gradient(x_new, surrogate_grad_params) # Bisection # sign changed happened if sign is negative sign = grad * grad_old sign_changed = sign < 0 # adapt alpha learning rate alpha = sign_changed * alpha / (k**2) + (1 - sign_changed) * alpha * k # x_next lies between x_old and x_new x_next = (1 - sign_changed) * x_new + sign_changed * (x_new + x_old) / 2 # convergence if np.linalg.norm(x_old - x_next) < 1e-3: return x_next return x_next
PypiClean
/django-rest-framework-braces-0.3.4.tar.gz/django-rest-framework-braces-0.3.4/drf_braces/serializers/enforce_validation_serializer.py
from __future__ import absolute_import, print_function, unicode_literals import inspect from rest_framework import fields, serializers from rest_framework.fields import empty from ..utils import add_base_class_to_instance, get_class_name_with_new_suffix class EnforceValidationFieldMixin(object): """ Custom DRF field mixin which allows to ignore validation error if the field is not mandatory. The field is mandatory when the parent serializer includes it in the ``must_validate_fields`` list or ``must_validate_fields`` list is completely omitted. If the list is omitted, then all fields in that serializer are mandatory and must validate. """ def run_validation(self, data=empty): try: return super(EnforceValidationFieldMixin, self).run_validation(data) except serializers.ValidationError as e: must_validate_fields = getattr(self.parent, 'must_validate_fields', None) field_name = getattr(self, 'field_name') # only re-raise validation error when this field must be validated # as defined by must_validate_fields list on the parent serializer # or if must_validate_fields is not defined if must_validate_fields is None or field_name in must_validate_fields: raise else: self.capture_failed_field(field_name, data, e.detail) raise fields.SkipField( 'This field "{}" is being skipped as per enforce validation logic.' ''.format(field_name) ) def capture_failed_field(self, field_name, field_data, error_msg): """ Hook for capturing invalid fields. This is used to track which fields have been skipped. Args: field_name (str): the name of the field whose data failed to validate field_data (object): the data of the field that failed validation error_msg (str): validation error message Returns: Not meant to return anything. """ def _create_enforce_validation_serializer(serializer, strict_mode_by_default=True, validation_serializer_field_mixin_class=EnforceValidationFieldMixin): """ Recursively creates a copy of a given serializer which enforces ``must_validate_fields``. This function recursively copies serializers and replaces all fields by adding ``EnforceValidationFieldMixin`` to their mro which then enforces validation for fields defined in ``must_validate_fields`` and drops their data for all other fields. Args: serializer (Serializer): Serializer class or instance to be copied strict_mode_by_default (bool): Whether serializer should use strict mode when ``must_validate_fields`` is not defined. If ``True``, then all fields must be validated by default and if ``False``, then all fields can be dropped. validation_serializer_field_mixin_class (type): the class used to validate serializer fields Returns: Recursive copy of the ``serializer`` which will enforce ``must_validate_fields``. """ if inspect.isclass(serializer): serializer = type( get_class_name_with_new_suffix( serializer, 'Serializer', 'EnforceValidationSerializer' ), (serializer,), {} ) fields = serializer._declared_fields declared_fields = None else: # when serializer is instance, we still want to create a modified # serializer class copy since if we only adjust the fields # on the instance, that can complicate introspecting, # especially when ``_create_enforce_validation_serializer`` # is used as decorator serializer = add_base_class_to_instance( serializer, new_name=get_class_name_with_new_suffix( serializer.__class__, 'Serializer', 'EnforceValidationSerializer' ) ) if isinstance(serializer, serializers.ListSerializer): serializer.child = _create_enforce_validation_serializer( serializer.child, strict_mode_by_default=strict_mode_by_default, validation_serializer_field_mixin_class=validation_serializer_field_mixin_class, ) # kwargs are used to take a deepcopy of the fields # so we need to adjust the child kwargs not to loose # reference to our custom child serializer if 'child' in serializer._kwargs: serializer._kwargs['child'] = serializer.child return serializer fields = serializer.fields declared_fields = serializer._declared_fields if not strict_mode_by_default and not hasattr(serializer, 'must_validate_fields'): serializer.must_validate_fields = [] # this is necessary for deepcopy to work when # root serializer is instantiated it does deepcopy # on serializer._declared_fields which re-instantiates # all child fields hence must_validate_fields will be lost # adding it to the class makes it persistent if not inspect.isclass(serializer): serializer.__class__.must_validate_fields = [] # cant use .items() since we need to adjust dictionary # within the loop so we cant be looping over the dict # at the same time # Python 3 even raises exception for this: # RuntimeError: dictionary changed size during iteration for name in list(fields.keys()): field = fields[name] replacement = None if isinstance(field, serializers.BaseSerializer): replacement = _create_enforce_validation_serializer( field, strict_mode_by_default=strict_mode_by_default, validation_serializer_field_mixin_class=validation_serializer_field_mixin_class, ) elif isinstance(field, serializers.Field): replacement = add_base_class_to_instance( field, validation_serializer_field_mixin_class, new_name=get_class_name_with_new_suffix( field.__class__, 'Field', 'EnforceValidationField' ) ) if replacement is not None: if declared_fields is not None: declared_fields[name] = replacement if replacement.source == name: replacement.source = None fields[name] = replacement return serializer def create_enforce_validation_serializer(serializer=None, **kwargs): """ Public function that creates a copy of a serializer which enforces ``must_validate_fields``. The difference between this function and ``_create_enforce_validation_serializer`` is that this function can be used both as a direct decorator and decorator with parameters. For example:: @create_enforce_validation_serializer class MySerializer(BaseSerializer): pass # or @create_enforce_validation_serializer(param=value) class MySerializer(BaseSerializer): pass # or create_enforce_validation_serializer( MySerializer, param=value ) """ # used as direct decorator so then simply return new serializer # e.g. @decorator # class MySerializer(...) # or used as regular function # e.g. function(Serializer, foo=bar) if inspect.isclass(serializer) and issubclass(serializer, serializers.Serializer): return _create_enforce_validation_serializer(serializer, **kwargs) # used as decorator with parameters # e.g. @decorator(foo=bar) # class MySerializer(...) elif serializer is None: def inner(serializer): return _create_enforce_validation_serializer(serializer, **kwargs) return inner else: raise TypeError( 'create_enforce_validation_serializer can only be only on serializers. ' 'It was called with "{}"'.format(type(serializer)) )
PypiClean
/Products.FCKeditor-2.6.6.3.zip/Products.FCKeditor-2.6.6.3/Products/FCKeditor/_src/fckeditor/editor/_source/classes/fcktoolbarpanelbutton.js
/* * FCKeditor - The text editor for Internet - http://www.fckeditor.net * Copyright (C) 2003-2010 Frederico Caldeira Knabben * * == BEGIN LICENSE == * * Licensed under the terms of any of the following licenses at your * choice: * * - GNU General Public License Version 2 or later (the "GPL") * http://www.gnu.org/licenses/gpl.html * * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") * http://www.gnu.org/licenses/lgpl.html * * - Mozilla Public License Version 1.1 or later (the "MPL") * http://www.mozilla.org/MPL/MPL-1.1.html * * == END LICENSE == * * FCKToolbarPanelButton Class: represents a special button in the toolbar * that shows a panel when pressed. */ var FCKToolbarPanelButton = function( commandName, label, tooltip, style, icon ) { this.CommandName = commandName ; var oIcon ; if ( icon == null ) oIcon = FCKConfig.SkinPath + 'toolbar/' + commandName.toLowerCase() + '.gif' ; else if ( typeof( icon ) == 'number' ) oIcon = [ FCKConfig.SkinPath + 'fck_strip.gif', 16, icon ] ; var oUIButton = this._UIButton = new FCKToolbarButtonUI( commandName, label, tooltip, oIcon, style ) ; oUIButton._FCKToolbarPanelButton = this ; oUIButton.ShowArrow = true ; oUIButton.OnClick = FCKToolbarPanelButton_OnButtonClick ; } FCKToolbarPanelButton.prototype.TypeName = 'FCKToolbarPanelButton' ; FCKToolbarPanelButton.prototype.Create = function( parentElement ) { parentElement.className += 'Menu' ; this._UIButton.Create( parentElement ) ; var oPanel = FCK.ToolbarSet.CurrentInstance.Commands.GetCommand( this.CommandName )._Panel ; this.RegisterPanel( oPanel ) ; } FCKToolbarPanelButton.prototype.RegisterPanel = function( oPanel ) { if ( oPanel._FCKToolbarPanelButton ) return ; oPanel._FCKToolbarPanelButton = this ; var eLineDiv = oPanel.Document.body.appendChild( oPanel.Document.createElement( 'div' ) ) ; eLineDiv.style.position = 'absolute' ; eLineDiv.style.top = '0px' ; var eLine = oPanel._FCKToolbarPanelButtonLineDiv = eLineDiv.appendChild( oPanel.Document.createElement( 'IMG' ) ) ; eLine.className = 'TB_ConnectionLine' ; eLine.style.position = 'absolute' ; // eLine.style.backgroundColor = 'Red' ; eLine.src = FCK_SPACER_PATH ; oPanel.OnHide = FCKToolbarPanelButton_OnPanelHide ; } /* Events */ function FCKToolbarPanelButton_OnButtonClick( toolbarButton ) { var oButton = this._FCKToolbarPanelButton ; var e = oButton._UIButton.MainElement ; oButton._UIButton.ChangeState( FCK_TRISTATE_ON ) ; // oButton.LineImg.style.width = ( e.offsetWidth - 2 ) + 'px' ; var oCommand = FCK.ToolbarSet.CurrentInstance.Commands.GetCommand( oButton.CommandName ) ; var oPanel = oCommand._Panel ; oPanel._FCKToolbarPanelButtonLineDiv.style.width = ( e.offsetWidth - 2 ) + 'px' ; oCommand.Execute( 0, e.offsetHeight - 1, e ) ; // -1 to be over the border } function FCKToolbarPanelButton_OnPanelHide() { var oMenuButton = this._FCKToolbarPanelButton ; oMenuButton._UIButton.ChangeState( FCK_TRISTATE_OFF ) ; } // The Panel Button works like a normal button so the refresh state functions // defined for the normal button can be reused here. FCKToolbarPanelButton.prototype.RefreshState = FCKToolbarButton.prototype.RefreshState ; FCKToolbarPanelButton.prototype.Enable = FCKToolbarButton.prototype.Enable ; FCKToolbarPanelButton.prototype.Disable = FCKToolbarButton.prototype.Disable ;
PypiClean
/accelbyte_py_sdk-0.48.0.tar.gz/accelbyte_py_sdk-0.48.0/accelbyte_py_sdk/api/reporting/wrappers/_admin_configurations.py
# template file: ags_py_codegen # pylint: disable=duplicate-code # pylint: disable=line-too-long # pylint: disable=missing-function-docstring # pylint: disable=missing-function-docstring # pylint: disable=missing-module-docstring # pylint: disable=too-many-arguments # pylint: disable=too-many-branches # pylint: disable=too-many-instance-attributes # pylint: disable=too-many-lines # pylint: disable=too-many-locals # pylint: disable=too-many-public-methods # pylint: disable=too-many-return-statements # pylint: disable=too-many-statements # pylint: disable=unused-import from typing import Any, Dict, List, Optional, Tuple, Union from ....core import HeaderStr from ....core import get_namespace as get_services_namespace from ....core import run_request from ....core import run_request_async from ....core import same_doc_as from ..models import RestapiConfigResponse from ..models import RestapiErrorResponse from ..models import RestapiReportingLimit from ..operations.admin_configurations import Get from ..operations.admin_configurations import GetCategoryEnum from ..operations.admin_configurations import Upsert @same_doc_as(Get) def get( category: Optional[Union[str, GetCategoryEnum]] = None, namespace: Optional[str] = None, x_additional_headers: Optional[Dict[str, str]] = None, **kwargs ): """Get configuration (Get) Required permission: ADMIN:NAMESPACE:{namespace}:REPORTINGCONFIG [READ] TimeInterval is in nanoseconds. When there's no configuration set, the response is the default value (configurable through envar). Required Permission(s): - ADMIN:NAMESPACE:{namespace}:REPORTINGCONFIG [READ] Properties: url: /reporting/v1/admin/namespaces/{namespace}/configurations method: GET tags: ["Admin Configurations"] consumes: ["application/json"] produces: ["application/json"] securities: [BEARER_AUTH] namespace: (namespace) REQUIRED str in path category: (category) OPTIONAL Union[str, CategoryEnum] in query Responses: 200: OK - RestapiConfigResponse 500: Internal Server Error - RestapiErrorResponse """ if namespace is None: namespace, error = get_services_namespace() if error: return None, error request = Get.create( category=category, namespace=namespace, ) return run_request(request, additional_headers=x_additional_headers, **kwargs) @same_doc_as(Get) async def get_async( category: Optional[Union[str, GetCategoryEnum]] = None, namespace: Optional[str] = None, x_additional_headers: Optional[Dict[str, str]] = None, **kwargs ): """Get configuration (Get) Required permission: ADMIN:NAMESPACE:{namespace}:REPORTINGCONFIG [READ] TimeInterval is in nanoseconds. When there's no configuration set, the response is the default value (configurable through envar). Required Permission(s): - ADMIN:NAMESPACE:{namespace}:REPORTINGCONFIG [READ] Properties: url: /reporting/v1/admin/namespaces/{namespace}/configurations method: GET tags: ["Admin Configurations"] consumes: ["application/json"] produces: ["application/json"] securities: [BEARER_AUTH] namespace: (namespace) REQUIRED str in path category: (category) OPTIONAL Union[str, CategoryEnum] in query Responses: 200: OK - RestapiConfigResponse 500: Internal Server Error - RestapiErrorResponse """ if namespace is None: namespace, error = get_services_namespace() if error: return None, error request = Get.create( category=category, namespace=namespace, ) return await run_request_async( request, additional_headers=x_additional_headers, **kwargs ) @same_doc_as(Upsert) def upsert( body: RestapiReportingLimit, namespace: Optional[str] = None, x_additional_headers: Optional[Dict[str, str]] = None, **kwargs ): """Create/Update configuration (Upsert) Required permission: ADMIN:NAMESPACE:{namespace}:REPORTINGCONFIG [CREATE] The behaviour of this endpoint is upsert based on the namespace. So, you can use this for both creating & updating the configuration. TimeInterval is in nanoseconds. Required Permission(s): - ADMIN:NAMESPACE:{namespace}:REPORTINGCONFIG [CREATE] Properties: url: /reporting/v1/admin/namespaces/{namespace}/configurations method: POST tags: ["Admin Configurations"] consumes: ["application/json"] produces: ["application/json"] securities: [BEARER_AUTH] body: (body) REQUIRED RestapiReportingLimit in body namespace: (namespace) REQUIRED str in path Responses: 200: OK - RestapiConfigResponse 400: Bad Request - RestapiErrorResponse 500: Internal Server Error - RestapiErrorResponse """ if namespace is None: namespace, error = get_services_namespace() if error: return None, error request = Upsert.create( body=body, namespace=namespace, ) return run_request(request, additional_headers=x_additional_headers, **kwargs) @same_doc_as(Upsert) async def upsert_async( body: RestapiReportingLimit, namespace: Optional[str] = None, x_additional_headers: Optional[Dict[str, str]] = None, **kwargs ): """Create/Update configuration (Upsert) Required permission: ADMIN:NAMESPACE:{namespace}:REPORTINGCONFIG [CREATE] The behaviour of this endpoint is upsert based on the namespace. So, you can use this for both creating & updating the configuration. TimeInterval is in nanoseconds. Required Permission(s): - ADMIN:NAMESPACE:{namespace}:REPORTINGCONFIG [CREATE] Properties: url: /reporting/v1/admin/namespaces/{namespace}/configurations method: POST tags: ["Admin Configurations"] consumes: ["application/json"] produces: ["application/json"] securities: [BEARER_AUTH] body: (body) REQUIRED RestapiReportingLimit in body namespace: (namespace) REQUIRED str in path Responses: 200: OK - RestapiConfigResponse 400: Bad Request - RestapiErrorResponse 500: Internal Server Error - RestapiErrorResponse """ if namespace is None: namespace, error = get_services_namespace() if error: return None, error request = Upsert.create( body=body, namespace=namespace, ) return await run_request_async( request, additional_headers=x_additional_headers, **kwargs )
PypiClean
/gen_py_tool-1.2.3-py3-none-any.whl/gen_py_tool/pro/factory/extractiner/tool/base.py
import sys try: from gen_py_tool.pro.schema.schema_container import SchemaContainer from gen_py_tool.pro.element.element_container import ElementContainer except ImportError as ats_error_message: MESSAGE = '\n{0}\n{1}\n'.format(__file__, ats_error_message) sys.exit(MESSAGE) # Force close python ATS ############################## __author__ = 'Vladimir Roncevic' __copyright__ = 'Copyright 2017, https://vroncevic.github.io/gen_py_tool' __credits__ = ['Vladimir Roncevic'] __license__ = 'https://github.com/vroncevic/gen_py_tool/blob/dev/LICENSE' __version__ = '1.2.3' __maintainer__ = 'Vladimir Roncevic' __email__ = '[email protected]' __status__ = 'Updated' class BaseExtractor(SchemaContainer, ElementContainer): ''' Defined class BaseExtractor with attribute(s) and method(s). Defined project container for post-processing phase. It defines: :attributes: | None. :methods: | __init__ - initial constructor. | is_container_ok - checking is container ok. | __str__ - dunder method for BaseExtractor. ''' def __init__(self, verbose=False): ''' Initial constructor. :param verbose: enable/disable verbose option. :type verbose: <bool> :exceptions: None ''' SchemaContainer.__init__(self, verbose=verbose) ElementContainer.__init__(self, verbose=verbose) def is_container_ok(self): ''' Checking is container ok. :return: boolean status, True (ok) | False. :rtype: <bool> :exceptions: None ''' return all([self.is_schema_ok(), self.is_element_ok()]) def __str__(self): ''' Dunder method for BaseExtractor. :return: object in a human-readable format. :rtype: <str> :exceptions: None ''' return '{0} ({1}, {2})'.format( self.__class__.__name__, str(self.__schema), str(self.__element) )
PypiClean
/neural_compressor_full-2.1.1.tar.gz/neural_compressor_full-2.1.1/neural_compressor/experimental/data/dataloaders/base_dataloader.py
"""BaseDataloder of all dataloaders.""" from abc import abstractmethod class BaseDataLoader: """Base class for all DataLoaders. _generate_dataloader is needed to create a dataloader object from the general params like batch_size and sampler. The dynamic batching is just to generate a new dataloader by setting batch_size and last_batch. """ def __init__(self, dataset, batch_size=1, last_batch='rollover', collate_fn=None, sampler=None, batch_sampler=None, num_workers=0, pin_memory=False, shuffle=False, distributed=False): """Initialize BaseDataLoader. Args: dataset (object): dataset from which to load the data batch_size (int, optional): number of samples per batch. Defaults to 1. last_batch (str, optional): whether to drop the last batch if it is incomplete. Support ['rollover', 'discard'], rollover means False, discard means True. Defaults to 'rollover'. collate_fn (callable, optional): merge data with outer dimension batch size. Defaults to None. sampler (Sampler, optional): Sampler object to sample data. Defaults to None. batch_sampler (BatchSampler, optional): BatchSampler object to generate batch of indices. Defaults to None. num_workers (int, optional): number of subprocesses to use for data loading. Defaults to 0. pin_memory (bool, optional): whether to copy data into pinned memory before returning. Defaults to False. shuffle (bool, optional): whether to shuffle data. Defaults to False. distributed (bool, optional): whether the dataloader is distributed. Defaults to False. """ self.dataset = dataset self.collate_fn = collate_fn self.sampler = sampler self.batch_sampler = batch_sampler self.num_workers = num_workers self.pin_memory = pin_memory self._batch_size = batch_size self.shuffle = shuffle self.distributed = distributed self.last_batch = last_batch self.drop_last = False if last_batch == 'rollover' else True self.dataloader = self._generate_dataloader( self.dataset, batch_size=batch_size, last_batch=last_batch, collate_fn=collate_fn, sampler=sampler, batch_sampler=batch_sampler, num_workers=num_workers, pin_memory=pin_memory, shuffle=shuffle, distributed=distributed) def batch(self, batch_size, last_batch=None): """Set batch size for dataloader. Args: batch_size (int): number of samples per batch. last_batch (str, optional): whether to drop the last batch if it is incomplete. Support ['rollover', 'discard'], rollover means False, discard means True. Defaults to None. """ self._batch_size = batch_size if last_batch is not None: self.last_batch = last_batch self.dataloader = self._generate_dataloader( self.dataset, batch_size, self.last_batch, self.collate_fn, self.sampler, self.batch_sampler, self.num_workers, self.pin_memory, self.shuffle, self.distributed) @property def batch_size(self): """Get dataloader's batch_size. Returns: int: batch_size """ return self._batch_size def __iter__(self): """Yield data in iterative order. Returns: iterator: iterator for dataloder """ return iter(self.dataloader) @abstractmethod def _generate_dataloader(self, dataset, batch_size, last_batch, collate_fn, sampler, batch_sampler, num_workers, pin_memory, shuffle, distributed): raise NotImplementedError
PypiClean
/ssh-import-id-5.11.tar.gz/ssh-import-id-5.11/README
ssh-import-id =========== You're logged onto a cloud instance working on a problem with your fellow devs, and you want to invite them to log in and take a look at these crazy log messages. What do? Oh. You have to ask them to cat their public SSH key, paste it into IRC (wait, no, it's id\_rsa.pub, not id\_rsa silly!) then you copy it and cat it to the end of authorized\_hosts. That's where ssh-import-id comes in. With ssh-import-id, you can add the public SSH keys from a known, trusted online identity to grant SSH access. Currently supported identities include Github and Launchpad. Usage ----- ssh-import-id uses short prefix to indicate the location of the online identity. For now, these are: 'gh:' for Github 'lp:' for Launchpad Command line help: usage: ssh-import-id [-h] [-o FILE] USERID [USERID ...] Authorize SSH public keys from trusted online identities. positional arguments: USERID User IDs to import optional arguments: -h, --help show this help message and exit -o FILE, --output FILE Write output to file (default ~/.ssh/authorized_keys) Example ------- If you wanted me to be able to ssh into your server, as the desired user on that machine you would use: $ ssh-import-id gh:cmars You can also import multiple users on the same line, even from different key services, like so: $ ssh-import-id gh:cmars lp:kirkland Used with care, it's a great collaboration tool! Installing ---------- ssh-import-id can be installed on Python >= 2.6 with a recent version of pip: $ pip install ssh-import-id ssh-import-id requires a recent version of Requests (>=1.1.0) for verified SSL/TLS connections. Extending --------- You can add support for your own SSH public key providers by creating a script named ssh-import-id-*prefix*. Make the script executable and place it in the same bin directory as ssh-import-id. The script should accept the identity username for the service it connects to, and output lines in the same format as an ~/.ssh/authorized\_keys file. If you do develop such a handler, I recommend that you connect to the service with SSL/TLS, and require a valid certificate and matching hostname. Use Requests.get(url, verify=True), for example. Credits ------- This project is authored and maintained by Dustin Kirkland, Scott Moser, and Casey Marshall.
PypiClean
/pyclimacell-0.18.2.tar.gz/pyclimacell-0.18.2/README.rst
==================== Python ClimaCell API ==================== .. image:: https://img.shields.io/pypi/v/pyclimacell.svg :target: https://pypi.python.org/pypi/pyclimacell .. image:: https://img.shields.io/travis/raman325/pyclimacell.svg :target: https://travis-ci.com/raman325/pyclimacell .. image:: https://readthedocs.org/projects/pyclimacell/badge/?version=latest :target: https://pyclimacell.readthedocs.io/en/latest/?badge=latest :alt: Documentation Status Python3.7+ package to access the `ClimaCell Weather API <https://www.climacell.co/weather-api/>`_ Both an async module (``ClimaCellV4`` and ``ClimaCellV3``) and a synchronous module (``ClimaCellV3Sync`` and ``ClimaCellV4Sync``) are provided. Example Code ------------- .. code-block:: python from pyclimacell import ClimaCellV4Sync api = ClimaCellSync("MY_API_KEY", latitude, longitude) print(api.realtime(api.available_fields(timedelta(0)))) print(api.forecast_nowcast(api.available_fields(timedelta(minutes=5))), start_time, timedelta_duration, timestep)) Features -------- * TODO Credits ------- This package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template. .. _Cookiecutter: https://github.com/audreyr/cookiecutter .. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage
PypiClean
/cardinal_pythonlib-1.1.24.tar.gz/cardinal_pythonlib-1.1.24/cardinal_pythonlib/sqlalchemy/alembic_ops.py
from alembic.operations import Operations, MigrateOperation # ============================================================================= # The thing (e.g. view) we are representing # ============================================================================= class ReplaceableObject(object): def __init__(self, name, sqltext): """ Object that can be passed to the ``create_view()`` and similar functions that we will register within the ``alembic.op`` namespace. See https://alembic.zzzcomputing.com/en/latest/cookbook.html#replaceable-objects Args: name: e.g. name of a view, such as ``subject_session_view`` sqltext: e.g. SQL to create the view, such as .. code-block:: sql SELECT C.subject, S.* FROM config C INNER JOIN session S ON S.config_id = C.config_id """ # noqa self.name = name self.sqltext = sqltext # ============================================================================= # An operation that can be reversed # ============================================================================= class ReversibleOp(MigrateOperation): """ Represents a DDL (SQL) migration operation that can be reversed; e.g. the combination of ``CREATE VIEW`` and ``DROP VIEW``. """ def __init__(self, target): """ Args: target: instance of :class:`.ReplaceableObject` """ self.target = target @classmethod def invoke_for_target(cls, operations, target): """ Invokes the operation. Args: operations: instance of ``alembic.operations.base.Operations`` target: instance of :class:`.ReplaceableObject` Returns: result of ``alembic.operations.base.Operations.invoke`` performed upon an instance of this class initialized with ``target`` """ op = cls(target) return operations.invoke(op) def reverse(self): """ Returns: the ``MigrateOperation`` representing the reverse of this operation """ raise NotImplementedError() @classmethod def _get_object_from_version(cls, operations, ident): """ Returns a Python object from an Alembic migration module (script). Args: operations: instance of ``alembic.operations.base.Operations`` ident: string of the format ``version.objname`` Returns: the object whose name is ``objname`` within the Alembic migration script identified by ``version`` """ version, objname = ident.split(".") module_ = operations.get_context().script.get_revision(version).module obj = getattr(module_, objname) return obj @classmethod def replace(cls, operations, target, replaces=None, replace_with=None): if replaces: old_obj = cls._get_object_from_version(operations, replaces) drop_old = cls(old_obj).reverse() create_new = cls(target) elif replace_with: old_obj = cls._get_object_from_version(operations, replace_with) drop_old = cls(target).reverse() create_new = cls(old_obj) else: raise TypeError("replaces or replace_with is required") operations.invoke(drop_old) operations.invoke(create_new) # ============================================================================= # Operations that will become part of the op.* namespace # ============================================================================= @Operations.register_operation("create_view", "invoke_for_target") @Operations.register_operation("replace_view", "replace") class CreateViewOp(ReversibleOp): """ Represents ``CREATE VIEW`` (reversed by ``DROP VIEW``). """ def reverse(self): return DropViewOp(self.target) @Operations.register_operation("drop_view", "invoke_for_target") class DropViewOp(ReversibleOp): """ Represents ``DROP VIEW`` (reversed by ``CREATE VIEW``). """ def reverse(self): return CreateViewOp(self.view) @Operations.register_operation("create_sp", "invoke_for_target") @Operations.register_operation("replace_sp", "replace") class CreateSPOp(ReversibleOp): """ Represents ``CREATE FUNCTION`` (reversed by ``DROP FUNCTION``) [sp = stored procedure]. """ def reverse(self): return DropSPOp(self.target) @Operations.register_operation("drop_sp", "invoke_for_target") class DropSPOp(ReversibleOp): """ Represents ``DROP FUNCTION`` (reversed by ``CREATE FUNCTION``) [sp = stored procedure]. """ def reverse(self): return CreateSPOp(self.target) # ============================================================================= # Implementation of these operations # ============================================================================= @Operations.implementation_for(CreateViewOp) def create_view(operations, operation): """ Implements ``CREATE VIEW``. Args: operations: instance of ``alembic.operations.base.Operations`` operation: instance of :class:`.ReversibleOp` Returns: ``None`` """ operations.execute( "CREATE VIEW %s AS %s" % (operation.target.name, operation.target.sqltext) ) @Operations.implementation_for(DropViewOp) def drop_view(operations, operation): """ Implements ``DROP VIEW``. Args: operations: instance of ``alembic.operations.base.Operations`` operation: instance of :class:`.ReversibleOp` Returns: ``None`` """ operations.execute("DROP VIEW %s" % operation.target.name) @Operations.implementation_for(CreateSPOp) def create_sp(operations, operation): """ Implements ``CREATE FUNCTION``. Args: operations: instance of ``alembic.operations.base.Operations`` operation: instance of :class:`.ReversibleOp` Returns: ``None`` """ operations.execute( "CREATE FUNCTION %s %s" % (operation.target.name, operation.target.sqltext) ) @Operations.implementation_for(DropSPOp) def drop_sp(operations, operation): """ Implements ``DROP FUNCTION``. Args: operations: instance of ``alembic.operations.base.Operations`` operation: instance of :class:`.ReversibleOp` Returns: ``None`` """ operations.execute("DROP FUNCTION %s" % operation.target.name)
PypiClean
/jupyterlab_remote_contents-0.1.1.tar.gz/jupyterlab_remote_contents-0.1.1/node_modules/request/lib/har.js
'use strict' var fs = require('fs') var qs = require('querystring') var validate = require('har-validator') var extend = require('extend') function Har (request) { this.request = request } Har.prototype.reducer = function (obj, pair) { // new property ? if (obj[pair.name] === undefined) { obj[pair.name] = pair.value return obj } // existing? convert to array var arr = [ obj[pair.name], pair.value ] obj[pair.name] = arr return obj } Har.prototype.prep = function (data) { // construct utility properties data.queryObj = {} data.headersObj = {} data.postData.jsonObj = false data.postData.paramsObj = false // construct query objects if (data.queryString && data.queryString.length) { data.queryObj = data.queryString.reduce(this.reducer, {}) } // construct headers objects if (data.headers && data.headers.length) { // loweCase header keys data.headersObj = data.headers.reduceRight(function (headers, header) { headers[header.name] = header.value return headers }, {}) } // construct Cookie header if (data.cookies && data.cookies.length) { var cookies = data.cookies.map(function (cookie) { return cookie.name + '=' + cookie.value }) if (cookies.length) { data.headersObj.cookie = cookies.join('; ') } } // prep body function some (arr) { return arr.some(function (type) { return data.postData.mimeType.indexOf(type) === 0 }) } if (some([ 'multipart/mixed', 'multipart/related', 'multipart/form-data', 'multipart/alternative'])) { // reset values data.postData.mimeType = 'multipart/form-data' } else if (some([ 'application/x-www-form-urlencoded'])) { if (!data.postData.params) { data.postData.text = '' } else { data.postData.paramsObj = data.postData.params.reduce(this.reducer, {}) // always overwrite data.postData.text = qs.stringify(data.postData.paramsObj) } } else if (some([ 'text/json', 'text/x-json', 'application/json', 'application/x-json'])) { data.postData.mimeType = 'application/json' if (data.postData.text) { try { data.postData.jsonObj = JSON.parse(data.postData.text) } catch (e) { this.request.debug(e) // force back to text/plain data.postData.mimeType = 'text/plain' } } } return data } Har.prototype.options = function (options) { // skip if no har property defined if (!options.har) { return options } var har = {} extend(har, options.har) // only process the first entry if (har.log && har.log.entries) { har = har.log.entries[0] } // add optional properties to make validation successful har.url = har.url || options.url || options.uri || options.baseUrl || '/' har.httpVersion = har.httpVersion || 'HTTP/1.1' har.queryString = har.queryString || [] har.headers = har.headers || [] har.cookies = har.cookies || [] har.postData = har.postData || {} har.postData.mimeType = har.postData.mimeType || 'application/octet-stream' har.bodySize = 0 har.headersSize = 0 har.postData.size = 0 if (!validate.request(har)) { return options } // clean up and get some utility properties var req = this.prep(har) // construct new options if (req.url) { options.url = req.url } if (req.method) { options.method = req.method } if (Object.keys(req.queryObj).length) { options.qs = req.queryObj } if (Object.keys(req.headersObj).length) { options.headers = req.headersObj } function test (type) { return req.postData.mimeType.indexOf(type) === 0 } if (test('application/x-www-form-urlencoded')) { options.form = req.postData.paramsObj } else if (test('application/json')) { if (req.postData.jsonObj) { options.body = req.postData.jsonObj options.json = true } } else if (test('multipart/form-data')) { options.formData = {} req.postData.params.forEach(function (param) { var attachment = {} if (!param.fileName && !param.contentType) { options.formData[param.name] = param.value return } // attempt to read from disk! if (param.fileName && !param.value) { attachment.value = fs.createReadStream(param.fileName) } else if (param.value) { attachment.value = param.value } if (param.fileName) { attachment.options = { filename: param.fileName, contentType: param.contentType ? param.contentType : null } } options.formData[param.name] = attachment }) } else { if (req.postData.text) { options.body = req.postData.text } } return options } exports.Har = Har
PypiClean
/pesapal-0.0.6.tar.gz/pesapal-0.0.6/lib/__init__.py
import xml.etree.cElementTree as etree try: # Python 3 from html import escape except ImportError: # Python 2 from cgi import escape from . import oauth from .oauth import OAuthConsumer, OAuthRequest SIGNATURE_METHOD = oauth.OAuthSignatureMethod_HMAC_SHA1() # configurable enc variables consumer_key = None consumer_secret = None testing = True class MissingKeyError(Exception): pass class InvalidOption(Exception): pass # method to validate passed options def validateOptions(options, default_options): for k, v in list(options.items()): if k not in default_options: msg = 'Option %s not found in %s' % (k, list(default_options.keys())) raise InvalidOption(msg) # method to build and return oauth request def createOauthRequest(http_url, params, default_params): validateOptions(params, default_params) default_params.update(params) params = default_params http_method='GET' token = params.pop('token', None) base_url = 'https://www.pesapal.com/api/' if testing: base_url = 'https://demo.pesapal.com/api/' url = base_url + http_url if not consumer_key: raise MissingKeyError('provide consumer key') if not consumer_secret: raise MissingKeyError('provide consumer consumer_secret') oauth_consumer = oauth.OAuthConsumer(consumer_key, consumer_secret) request = OAuthRequest.from_consumer_and_token( oauth_consumer, http_url= url, http_method=http_method, parameters=params ) request.sign_request(SIGNATURE_METHOD, oauth_consumer, token) return request.to_url() def postDirectOrder(params, request_data): """ PostPesapalDirectOrderV4 --- Use this to post a transaction to PesaPal. PesaPal will present the user with a page which contains the available payment options and will redirect to your site once the user has completed the payment process. """ default_request_data = { 'Amount': '', 'Description': '', 'Type': 'MERCHANT', 'Reference': '', 'Email': '', 'PhoneNumber': '', # optional 'Currency': '', 'FirstName': '', 'LastName': '', 'LineItems': [ # { # 'uniqueid': '', # 'particulars': '', # 'quantity': '', # 'unitcost': '', # 'subtotal': '' # } ] } # validate xml data validateOptions(request_data, default_request_data) default_request_data.update(request_data) request_data = default_request_data root_xml = etree.Element('PesapalDirectOrderInfo') root_xml.attrib['xmlns:xsi'] = 'http://www.w3.org/2001/XMLSchema-instance' root_xml.attrib['xmlns:xsd'] = 'http://www.w3.org/2001/XMLSchema' root_xml.attrib['xmlns'] = 'http://www.pesapal.com' # populate line items line_items = request_data.pop('LineItems') if len(line_items) > 0: line_items_xml = etree.SubElement(root_xml, 'lineitems') for item in line_items: item_xml = etree.SubElement(line_items_xml, 'lineitem') item_xml.attrib.update(item) # populate info root_xml.attrib.update(request_data) # pesapal_request_data #print(etree.tostring(root_xml)) pesapal_request_data = escape(etree.tostring(root_xml).decode("utf-8")) # print etree.tostring(root_xml) default_params = { 'oauth_callback': '', #'oauth_consumer_key': '', #'oauth_nonce': '', #'oauth_signature': '', #'oauth_signature_method': '', #'oauth_timestamp': '', #'oauth_version': '1.0', 'pesapal_request_data': pesapal_request_data } http_url = 'PostPesapalDirectOrderV4' return createOauthRequest(http_url, params, default_params) def queryPaymentStatus(params): """ Use this to query the status of the transaction. When a transaction is posted to PesaPal, it may be in a PENDING, COMPLETED or FAILED state. If the transaction is PENDING, the payment may complete or fail at a later stage. Both the unique order id generated by your system and the pesapal tracking id are required as input parameters. """ http_url = 'QueryPaymentStatus' default_params = { 'pesapal_merchant_reference': '', 'pesapal_transaction_tracking_id': '' } return createOauthRequest(http_url, params, default_params) def queryPaymentStatusByMerchantRef(params): """ Same as QueryPaymentStatus, but only the unique order id genereated by your system is required as the input parameter. """ http_url = 'QueryPaymentStatusByMerchantRef' default_params = { 'pesapal_merchant_reference': '' } return createOauthRequest(http_url, params, default_params) def queryPaymentDetails(params): """ Same as QueryPaymentStatus, but additional information is returned. """ http_url = 'QueryPaymentDetails' default_params = { 'pesapal_merchant_reference': '', 'pesapal_transaction_tracking_id': '' } return createOauthRequest(http_url, params, default_params)
PypiClean
/snf_image_creator-0.10.tar.gz/snf_image_creator-0.10/image_creator/os_type/linux.py
from image_creator.os_type.unix import Unix, sysprep, add_sysprep_param import os import re import pkg_resources import tempfile X2GO_DESKTOPSESSIONS = { 'CINNAMON': 'cinnamon', 'KDE': 'startkde', 'GNOME': 'gnome-session', 'MATE': 'mate-session', 'XFCE': 'xfce4-session', 'LXDE': 'startlxde', 'TRINITY': 'starttrinity', 'UNITY': 'unity', } X2GO_EXECUTABLE = "x2goruncommand" DISTRO_ORDER = { "ubuntu": 80, "linuxmint": 75, "debian": 70, "rhel": 60, "fedora": 58, "centos": 55, "scientificlinux": 50, "sles": 45, "opensuse": 44, "archlinux": 40, "gentoo": 35, "slackware": 30, "oraclelinux": 28, "mageia": 20, "mandriva": 19, "cirros": 15, "pardus": 10 } class Linux(Unix): """OS class for Linux""" @add_sysprep_param( 'bootmenu_timeout', 'posint', 10, "Boot menu timeout in seconds") @add_sysprep_param( 'powerbtn_action', 'string', '/sbin/shutdown -h now', "The action that should be executed if the power button is pressed") def __init__(self, image, **kwargs): super(Linux, self).__init__(image, **kwargs) self._uuid = dict() self._persistent = re.compile('/dev/[hsv]d[a-z][1-9]*') @sysprep('Removing user accounts with id greater that 1000', enabled=False) def _remove_user_accounts(self): """Remove all user accounts with id greater than 1000""" removed_users = {} # Remove users from /etc/passwd if self.image.g.is_file('/etc/passwd'): passwd = [] metadata_users = self.meta['USERS'].split() \ if 'USERS' in self.meta else [] for line in self.image.g.cat('/etc/passwd').splitlines(): fields = line.split(':') if int(fields[2]) > 1000: removed_users[fields[0]] = fields # remove it from the USERS metadata too if fields[0] in metadata_users: metadata_users.remove(fields[0]) else: passwd.append(':'.join(fields)) self.meta['USERS'] = " ".join(metadata_users) # Delete the USERS metadata if empty if not len(self.meta['USERS']): del self.meta['USERS'] self.image.g.write('/etc/passwd', '\n'.join(passwd) + '\n') else: self.out.warn("File: `/etc/passwd' is missing. " "No users were deleted") return if self.image.g.is_file('/etc/shadow'): # Remove the corresponding /etc/shadow entries shadow = [] for line in self.image.g.cat('/etc/shadow').splitlines(): fields = line.split(':') if fields[0] not in removed_users: shadow.append(':'.join(fields)) self.image.g.write('/etc/shadow', "\n".join(shadow) + '\n') else: self.out.warn("File: `/etc/shadow' is missing.") if self.image.g.is_file('/etc/group'): # Remove the corresponding /etc/group entries group = [] for line in self.image.g.cat('/etc/group').splitlines(): fields = line.split(':') # Remove groups tha have the same name as the removed users if fields[0] not in removed_users: group.append(':'.join(fields)) self.image.g.write('/etc/group', '\n'.join(group) + '\n') # Remove home directories for home in [field[5] for field in removed_users.values()]: if self.image.g.is_dir(home) and home.startswith('/home/'): self.image.g.rm_rf(home) @sysprep('Cleaning up password & locking all user accounts') def _cleanup_passwords(self): """Remove all passwords and lock all user accounts""" shadow = [] for line in self.image.g.cat('/etc/shadow').splitlines(): fields = line.split(':') if fields[1] not in ('*', '!'): fields[1] = '!' shadow.append(":".join(fields)) self.image.g.write('/etc/shadow', "\n".join(shadow) + '\n') # Remove backup file for /etc/shadow self.image.g.rm_rf('/etc/shadow-') @sysprep('Fixing acpid powerdown action') def _fix_acpid(self): """Replace acpid powerdown action scripts to immediately shutdown the system without checking if a GUI is running. """ powerbtn_action = self.sysprep_params['powerbtn_action'].value events_dir = '/etc/acpi/events' if not self.image.g.is_dir(events_dir): self.out.warn("No acpid event directory found") return event_exp = re.compile('event=(.+)', re.I) action_exp = re.compile('action=(.+)', re.I) for events_file in self.image.g.readdir(events_dir): if events_file['ftyp'] != 'r': continue event = -1 action = -1 fullpath = "%s/%s" % (events_dir, events_file['name']) content = self.image.g.cat(fullpath).splitlines() for i in xrange(len(content)): if event_exp.match(content[i]): event = i elif action_exp.match(content[i]): action = i if event == -1: continue if action == -1: self.out.warn("Corrupted acpid event file: `%s'" % fullpath) continue entry = content[event].split('=')[1].strip() if entry in ("button[ /]power", "button/power.*"): content[action] = "action=%s" % powerbtn_action self.image.g.write(fullpath, "\n".join(content) + '\n\n### Edited by snf-image-creator ###\n') return elif entry == ".*": self.out.warn("Found action `.*'. Don't know how to handle " "this. Please edit `%s' image file manually to " "make the system immediately shutdown when an " "power button ACPI event occurs." % content[action].split('=')[1].strip()) return self.out.warn("No acpi power button event found!") @sysprep('Removing persistent network interface names') def _remove_persistent_net_rules(self): """Remove udev rules that will keep network interface names persistent after hardware changes and reboots. Those rules will be created again the next time the image runs. """ rule_file = '/etc/udev/rules.d/70-persistent-net.rules' if self.image.g.is_file(rule_file): self.image.g.rm(rule_file) @sysprep('Removing swap entry from fstab') def _remove_swap_entry(self): """Remove swap entry from /etc/fstab. If swap is the last partition then the partition will be removed when shrinking is performed. If the swap partition is not the last partition in the disk or if you are not going to shrink the image you should probably disable this. """ if not self.image.g.is_file('/etc/fstab'): self.out.warn("File: `/etc/fstab' is missing. No entry removed!") return new_fstab = "" fstab = self.image.g.cat('/etc/fstab') for line in fstab.splitlines(): entry = line.split('#')[0].strip().split() if len(entry) == 6 and entry[2] == 'swap': continue new_fstab += "%s\n" % line self.image.g.write('/etc/fstab', new_fstab) @sysprep('Change boot menu timeout to %(bootmenu_timeout)s seconds') def _change_bootmenu_timeout(self): """Change the boot menu timeout to the one specified by the namesake system preparation parameter. """ timeout = self.sysprep_params['bootmenu_timeout'].value if self.image.g.is_file('/etc/default/grub'): self.image.g.aug_init('/', 0) try: self.image.g.aug_set('/files/etc/default/grub/GRUB_TIMEOUT', str(timeout)) finally: self.image.g.aug_save() self.image.g.aug_close() def replace_timeout(remote, regexp, timeout): """Replace the timeout value from a config file""" tmpfd, tmp = tempfile.mkstemp() try: for line in self.image.g.cat(remote).splitlines(): if regexp.match(line): line = re.sub(r'\d+', str(timeout), line) os.write(tmpfd, line + '\n') os.close(tmpfd) tmpfd = None self.image.g.upload(tmp, remote) finally: if tmpfd is not None: os.close(tmpfd) os.unlink(tmp) grub1_config = '/boot/grub/menu.lst' grub2_config = '/boot/grub/grub.cfg' syslinux_config = '/boot/syslinux/syslinux.cfg' if self.image.g.is_file(grub1_config): regexp = re.compile(r'^\s*timeout\s+\d+\s*$') replace_timeout(grub1_config, regexp, timeout) elif self.image.g.is_file(grub2_config): regexp = re.compile(r'^\s*set\s+timeout=\d+\s*$') replace_timeout(grub2_config, regexp, timeout) if self.image.g.is_file(syslinux_config): regexp = re.compile(r'^\s*TIMEOUT\s+\d+\s*$', re.IGNORECASE) # In syslinux the timeout unit is 0.1 seconds replace_timeout(syslinux_config, regexp, timeout * 10) @sysprep('Replacing fstab & grub non-persistent device references') def _use_persistent_block_device_names(self): """Scan fstab & grub configuration files and replace all non-persistent device references with UUIDs. """ if not self.image.g.is_file('/etc/fstab'): self.out.warn("Omitted! File: `/etc/fstab' does not exist") # convert all devices in fstab to persistent persistent_root = self._persistent_fstab() # convert root device in grub1 to persistent self._persistent_grub1(persistent_root) # convert root device in syslinux to persistent self._persistent_syslinux(persistent_root) @sysprep('Disabling IPv6 privacy extensions', display='Disable IPv6 privacy enxtensions') def _disable_ipv6_privacy_extensions(self): """Disable IPv6 privacy extensions.""" file_path = '/files/etc/sysctl.conf/net.ipv6.conf.%s.use_tempaddr' dir_path = '/files/etc/sysctl.d/*/net.ipv6.conf.%s.use_tempaddr' self.image.g.aug_init('/', 0) try: default = self.image.g.aug_match(file_path % 'default') + \ self.image.g.aug_match(dir_path % 'default') all = self.image.g.aug_match(file_path % 'all') + \ self.image.g.aug_match(dir_path % 'all') if len(default) == 0: self.image.g.aug_set(file_path % 'default', '0') else: for token in default: self.image.g.aug_set(token, '0') if len(all) == 0: self.image.g.aug_set(file_path % 'all', '0') else: for token in all: self.image.g.aug_set(token, '0') finally: self.image.g.aug_save() self.image.g.aug_close() @sysprep('Removing local machine ID configuration file', display="Remove local machine ID configuration file") def _remove_local_machine_id_configuration_file(self): """Remove the /etc/machine-id file if present. This file is used by systemd to uniquelly identify systems and will be created automatically on the next boot if not present.""" if self.image.g.is_file('/etc/machine-id'): self.image.g.rm('/etc/machine-id') def _persistent_grub1(self, new_root): """Replaces non-persistent device name occurrences with persistent ones in GRUB1 configuration files. """ if self.image.g.is_file('/boot/grub/menu.lst'): grub1 = '/boot/grub/menu.lst' elif self.image.g.is_file('/etc/grub.conf'): grub1 = '/etc/grub.conf' else: return self.image.g.aug_init('/', 0) try: roots = self.image.g.aug_match( '/files%s/title[*]/kernel/root' % grub1) for root in roots: dev = self.image.g.aug_get(root) if not self._is_persistent(dev): # This is not always correct. Grub may contain root entries # for other systems, but we only support 1 OS per hard # disk, so this shouldn't harm. self.image.g.aug_set(root, new_root) finally: self.image.g.aug_save() self.image.g.aug_close() def _persistent_syslinux(self, new_root): """Replace non-persistent root device name occurrences with persistent ones in the syslinux configuration files. """ config = '/boot/syslinux/syslinux.cfg' append_regexp = re.compile( r'\s*APPEND\s+.*\broot=/dev/[hsv]d[a-z][1-9]*\b', re.IGNORECASE) if not self.image.g.is_file(config): return # There is no augeas lense for syslinux :-( tmpfd, tmp = tempfile.mkstemp() try: for line in self.image.g.cat(config).splitlines(): if append_regexp.match(line): line = re.sub(r'\broot=/dev/[hsv]d[a-z][1-9]*\b', 'root=%s' % new_root, line) os.write(tmpfd, line + '\n') os.close(tmpfd) tmpfd = None self.image.g.upload(tmp, config) finally: if tmpfd is not None: os.close(tmpfd) os.unlink(tmp) def _persistent_fstab(self): """Replaces non-persistent device name occurrences in /etc/fstab with persistent ones. """ mpoints = self.image.g.mountpoints() if len(mpoints) == 0: pass # TODO: error handling device_dict = dict([[mpoint, dev] for dev, mpoint in mpoints]) root_dev = None new_fstab = "" fstab = self.image.g.cat('/etc/fstab') for line in fstab.splitlines(): line, dev, mpoint = self._convert_fstab_line(line, device_dict) new_fstab += "%s\n" % line if mpoint == '/': root_dev = dev self.image.g.write('/etc/fstab', new_fstab) if root_dev is None: pass # TODO: error handling return root_dev def _convert_fstab_line(self, line, devices): """Replace non-persistent device names in an fstab line to their UUID equivalent """ orig = line line = line.split('#')[0].strip() if len(line) == 0: return orig, "", "" entry = line.split() if len(entry) != 6: self.out.warn("Detected abnormal entry in fstab") return orig, "", "" dev = entry[0] mpoint = entry[1] if not self._is_persistent(dev): if mpoint in devices: dev = "UUID=%s" % self._get_uuid(devices[mpoint]) entry[0] = dev else: # comment out the entry entry[0] = "#%s" % dev return " ".join(entry), dev, mpoint return orig, dev, mpoint def _do_inspect(self): """Run various diagnostics to check if media is supported""" self.out.info( 'Checking if the media contains logical volumes (LVM)...', False) has_lvm = True if len(self.image.g.lvs()) else False if has_lvm: self.out.info() self.image.set_unsupported('The media contains logical volumes') else: self.out.success('no') def _do_collect_metadata(self): """Collect metadata about the OS""" super(Linux, self)._do_collect_metadata() users = self._get_passworded_users() self.meta["USERS"] = " ".join(users) # Delete the USERS metadata if empty if not len(self.meta['USERS']): self.out.warn("No passworded users found!") del self.meta['USERS'] kernels = [] for f in self.image.g.ls('/boot'): if f.startswith('config-'): kernels.append(f[7:]) if len(kernels): kernels.sort(key=pkg_resources.parse_version) self.meta['KERNEL'] = kernels[-1] distro = self.image.g.inspect_get_distro(self.root) major = self.image.g.inspect_get_major_version(self.root) if major > 99: major = 99 minor = self.image.g.inspect_get_minor_version(self.root) if minor > 99: minor = 99 try: self.meta['SORTORDER'] += \ 10000 * DISTRO_ORDER[distro] + 100 * major + minor except KeyError: pass if self.is_enabled('sshd'): ssh = [] opts = self.ssh_connection_options(users) for user in opts['users']: ssh.append("ssh:port=%d,user=%s" % (opts['port'], user)) if 'REMOTE_CONNECTION' not in self.meta: self.meta['REMOTE_CONNECTION'] = "" else: self.meta['REMOTE_CONNECTION'] += " " if len(ssh): self.meta['REMOTE_CONNECTION'] += " ".join(ssh) else: self.meta['REMOTE_CONNECTION'] += "ssh:port=%d" % opts['port'] # Check if x2go is installed x2go_installed = False desktops = set() for path in ('/bin', '/usr/bin', '/usr/local/bin'): if self.image.g.is_file("%s/%s" % (path, X2GO_EXECUTABLE)): x2go_installed = True for name, exe in X2GO_DESKTOPSESSIONS.items(): if self.image.g.is_file("%s/%s" % (path, exe)): desktops.add(name) if x2go_installed: self.meta['REMOTE_CONNECTION'] += " " if len(desktops) == 0: self.meta['REMOTE_CONNECTION'] += "x2go" else: self.meta['REMOTE_CONNECTION'] += \ " ".join(["x2go:session=%s" % d for d in desktops]) else: self.out.warn("OpenSSH Daemon is not configured to run on boot") def is_enabled(self, service): """Check if a service is enabled to run on boot""" systemd_services = '/etc/systemd/system/multi-user.target.wants' exec_start = re.compile(r'^\s*ExecStart=.+bin/%s\s?' % service) if self.image.g.is_dir(systemd_services): for entry in self.image.g.readdir(systemd_services): if entry['ftyp'] not in ('l', 'f'): continue service_file = "%s/%s" % (systemd_services, entry['name']) for line in self.image.g.cat(service_file).splitlines(): if exec_start.search(line): return True found = set() def check_file(path): regexp = re.compile(r"[/=\s'\"]%s('\")?\s" % service) for line in self.image.g.cat(path).splitlines(): line = line.split('#', 1)[0].strip() if len(line) == 0: continue if regexp.search(line): found.add(path) return # Check upstart config files under /etc/init # Only examine *.conf files if self.image.g.is_dir('/etc/init'): self._foreach_file('/etc/init', check_file, maxdepth=1, include=r'.+\.conf$') if len(found): return True # Check scripts under /etc/rc[1-5].d/ and /etc/rc.d/rc[1-5].d/ for conf in ["/etc/%src%d.d" % (d, i) for i in xrange(1, 6) for d in ('', 'rc.d/')]: try: for entry in self.image.g.readdir(conf): if entry['ftyp'] not in ('l', 'f'): continue check_file("%s/%s" % (conf, entry['name'])) if len(found): return True except RuntimeError: continue return False def _get_passworded_users(self): """Returns a list of non-locked user accounts""" if not self.image.g.is_file('/etc/shadow'): self.out.warn( "Unable to collect user info. File: `/etc/shadow' is missing!") return [] users = [] regexp = re.compile(r'(\S+):((?:!\S+)|(?:[^!*]\S+)|):(?:\S*:){6}') for line in self.image.g.cat('/etc/shadow').splitlines(): match = regexp.match(line) if not match: continue user, passwd = match.groups() if len(passwd) > 0 and passwd[0] == '!': self.out.warn("Ignoring locked %s account." % user) else: users.append(user) return users def _is_persistent(self, dev): """Checks if a device name is persistent.""" return not self._persistent.match(dev) def _get_uuid(self, dev): """Returns the UUID corresponding to a device""" if dev in self._uuid: return self._uuid[dev] uuid = self.image.g.vfs_uuid(dev) assert len(uuid) self._uuid[dev] = uuid return uuid # vim: set sta sts=4 shiftwidth=4 sw=4 et ai :
PypiClean
/birenci_infra-0.0.9-py3-none-any.whl/sdk/apis/pdu.py
from os import urandom from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support.wait import WebDriverWait import functools import signal def timeout(sec): """ timeout decorator :param sec: function raise TimeoutError after ? seconds """ def decorator(func): @functools.wraps(func) def wrapped_func(*args, **kwargs): def _handle_timeout(signum, frame): err_msg = f'Function {func.__name__} timed out after {sec} seconds' raise TimeoutError(err_msg) signal.signal(signal.SIGALRM, _handle_timeout) signal.alarm(sec) try: result = func(*args, **kwargs) finally: signal.alarm(0) return result return wrapped_func return decorator class PduWeb(object): def __init__(self, host, user, passwd) -> None: chrome_option = Options() chrome_option.add_argument("--no-sandbox") chrome_option.add_argument("--disable-dev-shm-usage") chrome_option.add_argument("--headless") self.host = host self.user = user self.passwd = passwd self.baseUrl = f"http://{host}" self.browser = webdriver.Chrome(options=chrome_option) self.wait = WebDriverWait(self.browser, 5) self.is_login = False @timeout(3) def login(self): url = "/" self.browser.get(self.baseUrl + url) input = self.browser.find_element(by=By.ID, value="login_username") input.send_keys(self.user) input = self.browser.find_element(by=By.ID, value="login_password") input.send_keys(self.passwd) input = self.browser.find_element(by=By.ID, value="login_but").click() self.wait.until( EC.presence_of_element_located((By.ID, "login_out_btn")), message="登录成功" ) self.is_login = True def seat_list(self): if not self.is_login: self.login() out = [] listEle = self.browser.find_elements( by=By.XPATH, value='//td[contains(@id,"td1_")]' ) for one in listEle: seat = one.get_attribute("id").replace("td1_", "") name = one.text status = ( "up" if self.browser.find_element(By.ID, value=f"td2_{seat}").get_attribute( "class" ) == "TdOnIco" else "down" ) out.append( { "seat": seat, "name": name, "status": status, "host": self.host, } ) return out def down_seat(self, seat): if not self.is_login: self.login() seat = self.browser.find_element(By.ID, value=f"td2_{seat}") status = "up" if seat.get_attribute("class") == "TdOnIco" else "down" if status != "down": seat.click() return def up_seat(self, seat): if not self.is_login: self.login() seat = self.browser.find_element(By.ID, value=f"td2_{seat}") status = "up" if seat.get_attribute("class") == "TdOnIco" else "down" if status == "down": seat.click() return def restart_seat(self, seat): if not self.is_login: self.login() def check_down(browser): return ( browser.find_element(By.ID, value=f"td2_{seat}").get_attribute("class") == "TdOffIco" ) def check_up(browser): return ( browser.find_element(By.ID, value=f"td2_{seat}").get_attribute("class") == "TdOnIco" ) self.down_seat(seat) self.wait.until(check_down, message="关闭成功") self.up_seat(seat) self.wait.until(check_up, message="开启成功")
PypiClean
/holoviews-1.17.1.tar.gz/holoviews-1.17.1/examples/reference/elements/matplotlib/BoxWhisker.ipynb
<div class="contentcontainer med left" style="margin-left: -50px;"> <dl class="dl-horizontal"> <dt>Title</dt> <dd> BoxWhisker Element</dd> <dt>Dependencies</dt> <dd>Matplotlib</dd> <dt>Backends</dt> <dd><a href='./BoxWhisker.ipynb'>Matplotlib</a></dd> <dd><a href='../bokeh/BoxWhisker.ipynb'>Bokeh</a></dd> <dd><a href='../plotly/BoxWhisker.ipynb'>Plotly</a></dd> </dl> </div> ``` import numpy as np import holoviews as hv from holoviews import opts hv.extension('matplotlib') ``` A ``BoxWhisker`` Element is a quick way of visually summarizing one or more groups of numerical data through their quartiles. The boxes of a ``BoxWhisker`` element represent the first, second and third quartiles. The whiskers follow the Tukey boxplot definition representing the lowest datum still within 1.5 IQR of the lower quartile, and the highest datum still within 1.5 IQR of the upper quartile. Any points falling outside this range are shown as distinct outlier points. The data of a ``BoxWhisker`` Element may have any number of key dimensions representing the grouping of the value dimension and a single value dimensions representing the distribution of values within each group. See the [Tabular Datasets](../../../user_guide/07-Tabular_Datasets.ipynb) user guide for supported data formats, which include arrays, pandas dataframes and dictionaries of arrays. Without any groups a BoxWhisker Element represents a single distribution of values: ``` hv.BoxWhisker(np.random.randn(1000), vdims='Value') ``` By supplying key dimensions we can compare our distributions across multiple variables. ``` groups = [chr(65+g) for g in np.random.randint(0, 3, 200)] box = hv.BoxWhisker((groups, np.random.randint(0, 5, 200), np.random.randn(200)), ['Group', 'Category'], 'Value').sort() box.opts(opts.BoxWhisker(aspect=2, fig_size=200, whiskerprops={'color': 'gray'})) ``` For full documentation and the available style and plot options, use ``hv.help(hv.BoxWhisker).``
PypiClean
/ast-toolbox-2020.9.1.7.tar.gz/ast-toolbox-2020.9.1.7/third_party/garage/examples/tf/trpo_cubecrash.py
import click import gym from garage.envs import normalize from garage.experiment import run_experiment from garage.tf.algos import TRPO from garage.tf.baselines import GaussianCNNBaseline from garage.tf.envs import TfEnv from garage.tf.experiment import LocalTFRunner from garage.tf.policies import CategoricalCNNPolicy def run_task(snapshot_config, variant_data, *_): """Run task. Args: snapshot_config (garage.experiment.SnapshotConfig): The snapshot configuration used by LocalRunner to create the snapshotter. variant_data (dict): Custom arguments for the task. *_ (object): Ignored by this function. """ with LocalTFRunner(snapshot_config=snapshot_config) as runner: env = TfEnv(normalize(gym.make('CubeCrash-v0'))) policy = CategoricalCNNPolicy(env_spec=env.spec, conv_filters=(32, 64), conv_filter_sizes=(8, 4), conv_strides=(4, 2), conv_pad='VALID', hidden_sizes=(32, 32)) baseline = GaussianCNNBaseline(env_spec=env.spec, regressor_args=dict( num_filters=(32, 64), filter_dims=(8, 4), strides=(4, 2), padding='VALID', hidden_sizes=(32, 32), use_trust_region=True)) algo = TRPO(env_spec=env.spec, policy=policy, baseline=baseline, max_path_length=100, discount=0.99, max_kl_step=0.01, flatten_input=False) runner.setup(algo, env) runner.train(n_epochs=100, batch_size=variant_data['batch_size']) @click.command() @click.option('--batch_size', '_batch_size', type=int, default=4000) def _args(_batch_size): """A click command to parse arguments for automated testing purposes. Args: _batch_size (int): Number of environment steps in one batch. Returns: int: The input argument as-is. """ return _batch_size batch_size = _args.main(standalone_mode=False) run_experiment( run_task, snapshot_mode='last', seed=1, variant={'batch_size': batch_size}, )
PypiClean
/flying_ioc-1.0.3.tar.gz/flying_ioc-1.0.3/README.md
# Inversion of control (IoC) for Humans - written in Python [Inversion of control](https://en.wikipedia.org/wiki/Inversion_of_control) ## How to use it pip install flying-ioc ``` {.sourceCode .python} from flying_ioc import * ioc = IocManager() ioc.set_class(cls=HelperWrapper, singleton=True) ioc.set_class(cls=GRHelperService, singleton=True) ioc.set_class(name='api', cls=GRApiClient, singleton=True, thread_local=True) gr_service: GRHelperService = ioc.GRHelperService gr_service.start() ``` ## Features * Support getting an object as an attribute of IoC manager * Initializing a class argument by the argument's class name and if not present by the argument name * Support for inheritance - initializing arguments needed by parent classes * Support mapping of values, classes, factories * Support configuration of mapping like singleton, class per thread * Support for @NotInject decorator ## Attribute ``` {.sourceCode .python} gr_service: GRHelperService = ioc.GRHelperService gr_service.start() ``` ### Initializing a class ``` {.sourceCode .python} class ClassA: pass class ClassB: pass class ClassC: pass class ExampleClass: def __init__(self, arg1: ClassA, arg2, arg3: ClassC): assert arg1.__class__ == ClassA assert arg2.__class__ == ClassB assert arg3.__class__ == ClassC def test_arguments(): ioc = IocManager() ioc.set_class(cls=ClassA) ioc.set_class(name='arg2', cls=ClassB) ioc.set_class(name='arg3', cls=ClassC) ioc.set_class(cls=ExampleClass) assert ioc.ExampleClass.__class__ == ExampleClass ``` ## Support for inheritance ``` {.sourceCode .python} class ClassA: pass class ClassB: pass class ClassC: pass class ParentD: def __init__(self, arg1: ClassA, **kwargs): self._arg1 = arg1 class ParentE(ParentD): def __init__(self, arg2: ClassB, **kwargs): super().__init__(**kwargs) self._arg2 = arg2 class ExampleClass(ParentE): def __init__(self, arg3: ClassC, **kwargs): super().__init__(**kwargs) assert self._arg1.__class__ == ClassA assert self._arg2.__class__ == ClassB assert arg3.__class__ == ClassC def test_arguments(): ioc = IocManager() ioc.set_class(cls=ClassA) ioc.set_class(cls=ClassB) ioc.set_class(cls=ClassC) ioc.set_class(cls=ExampleClass) assert ioc.ExampleClass.__class__ == ExampleClass ``` ## Values ``` {.sourceCode .python} class ClassA: pass class ExampleClass: def __init__(self, value_text, value_class): assert value_text == 'Some text' assert value_class.__class__ == ClassA def test_arguments(): ioc = IocManager() ioc.set_value(name='value_text', value='Some text') ioc.set_value(name='value_class', value=ClassA()) ioc.set_class(cls=ExampleClass) assert ioc.ExampleClass.__class__ == ExampleClass ``` ## Factory ``` {.sourceCode .python} class ClassA: pass class ClassB: pass class ClassC: pass class Factory(IocFactory): @staticmethod def get_instance(ioc_manager: IocManager, name: str, frame_info: inspect.FrameInfo): if frame_info.function == 'test_factory_1': return ioc_manager.ClassA if name == 'factory1': return ioc_manager.ClassB return ioc_manager.ClassC ioc = IocManager() ioc.set_class(cls=ClassA) ioc.set_class(cls=ClassB) ioc.set_class(cls=ClassC) ioc.set_factory(name='factory1', cls=Factory) ioc.set_factory(name='factory2', cls=Factory) def test_factory_1(): assert ioc.factory1.__class__ == ClassA assert ioc.factory2.__class__ == ClassA def test_factory_2(): assert ioc.factory1.__class__ == ClassB assert ioc.factory2.__class__ == ClassC ``` ## Singleton ``` {.sourceCode .python} class ClassA: pass class ClassB: pass def test_singleton(): ioc = IocManager() ioc.set_class(cls=ClassA) ioc.set_class(cls=ClassB, singleton=True) assert ioc.ClassA != ioc.ClassA assert ioc.ClassB == ioc.ClassB ``` ## Class per thread ``` {.sourceCode .python} class ClassA: pass def _set_vars(ioc: IocManager, storage: dict): def wrapped(): storage['singleton1'] = ioc.singleton1 storage['singleton2'] = ioc.singleton2 return wrapped def test_class_per_thread(): ioc = IocManager() ioc.set_class(name='singleton1', cls=ClassA, singleton=True) ioc.set_class(name='singleton2', cls=ClassA, singleton=True, thread_local=True) assert ioc.singleton1 == ioc.singleton1 assert ioc.singleton2 == ioc.singleton2 thread_storage = {} thread = threading.Thread(target=_set_vars(ioc, thread_storage)) thread.start() thread.join() assert ioc.singleton1 == thread_storage['singleton1'] assert ioc.singleton2 != thread_storage['singleton2'] ``` ## @NotInject decorator In the following example, the @NotInject decorator prevents the IoC manager from adding arg1 to the kwargs argument when it initializes the ExampleClass, arg1 argument is needed by the parent class. Removing the @NotInject decorator in this example will result in an exception. The @NonInject decorator takes a list of argument names to skip in the initializing process. ``` {.sourceCode .python} class ClassA: pass class ClassB: pass class Parent: def __init__(self, arg1: ClassA, **kwargs): super().__init__(**kwargs) self._arg1 = arg1 @NotInject(['arg1']) class ExampleClass(Parent): def __init__(self, arg2: ClassB, **kwargs): arg1 = ClassA() super().__init__(arg1, **kwargs) assert self._arg1 == arg1 assert arg2.__class__ == ClassB def test_not_inject(): ioc = IocManager() ioc.set_class(cls=ClassA) ioc.set_class(cls=ClassB) ioc.set_class(cls=ExampleClass) assert ioc.ExampleClass.__class__ == ExampleClass ``` ## Exceptions IoC Manager raises two types of exceptions: * AttributeError - when trying to get an undefined attribute from the IoC Manager * TypeError - in the following cases: * IoC Manager is missing a container definition needed by the initialization of a class or it parent class * While initializing a class, multiple instances of the same argument are provided to it's parent class - by the user and also injected by IoC Manager. This issue can be resolve using the @NotInject decorator ``` {.sourceCode .python} class ClassA: pass class ClassB: pass class ClassC: pass class Parent: def __init__(self, arg1: ClassA, **kwargs): super().__init__(**kwargs) self._arg1 = arg1 class ExampleClass1(Parent): def __init__(self, arg2: ClassB, **kwargs): arg1 = ClassA() super().__init__(arg1, **kwargs) assert self._arg1 == arg1 assert arg2.__class__ == ClassB class ExampleClass2: def __init__(self, arg1: ClassC): pass class ExampleClass3(ExampleClass2): def __init__(self, **kwargs): super().__init__(**kwargs) ioc = IocManager() ioc.set_class(cls=ClassA) ioc.set_class(cls=ClassB) def test_exception_container_not_defined(): with pytest.raises(AttributeError) as e: ioc.NotExists assert e.value.args[0] == "Name 'NotExists' does not exist" def test_exception_missing_not_inject(): with pytest.raises(TypeError) as e: ioc.set_class(cls=ExampleClass1) ioc.ExampleClass1 assert e.value.args[0] == "__init__() got multiple values for argument 'arg1'" def test_exception_arg_is_not_defined(): with pytest.raises(TypeError) as e: ioc.set_class(cls=ExampleClass2) ioc.ExampleClass2 assert e.value.args[0].args[0] == "Can't get a container neither by class name ClassC, neither by arg name arg1" def test_exception_arg_for_parent_is_not_defined(): with pytest.raises(TypeError) as e: ioc.set_class(cls=ExampleClass3) ioc.ExampleClass3 assert e.value.args[0] == "__init__() missing 1 required positional argument: 'arg1'" ```
PypiClean
/nm_transformers-1.5.1.42301-py3-none-any.whl/transformers/models/poolformer/configuration_poolformer.py
""" PoolFormer model configuration""" from collections import OrderedDict from typing import Mapping from packaging import version from ...configuration_utils import PretrainedConfig from ...onnx import OnnxConfig from ...utils import logging logger = logging.get_logger(__name__) POOLFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = { "sail/poolformer_s12": "https://huggingface.co/sail/poolformer_s12/resolve/main/config.json", # See all PoolFormer models at https://huggingface.co/models?filter=poolformer } class PoolFormerConfig(PretrainedConfig): r""" This is the configuration class to store the configuration of [`PoolFormerModel`]. It is used to instantiate a PoolFormer model according to the specified arguments, defining the model architecture. Instantiating a configuration with the defaults will yield a similar configuration to that of the PoolFormer [sail/poolformer_s12](https://huggingface.co/sail/poolformer_s12) architecture. Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the documentation from [`PretrainedConfig`] for more information. Args: num_channels (`int`, *optional*, defaults to 3): The number of channels in the input image. patch_size (`int`, *optional*, defaults to 16): The size of the input patch. stride (`int`, *optional*, defaults to 16): The stride of the input patch. pool_size (`int`, *optional*, defaults to 3): The size of the pooling window. mlp_ratio (`float`, *optional*, defaults to 4.0): The ratio of the number of channels in the output of the MLP to the number of channels in the input. depths (`list`, *optional*, defaults to `[2, 2, 6, 2]`): The depth of each encoder block. hidden_sizes (`list`, *optional*, defaults to `[64, 128, 320, 512]`): The hidden sizes of each encoder block. patch_sizes (`list`, *optional*, defaults to `[7, 3, 3, 3]`): The size of the input patch for each encoder block. strides (`list`, *optional*, defaults to `[4, 2, 2, 2]`): The stride of the input patch for each encoder block. padding (`list`, *optional*, defaults to `[2, 1, 1, 1]`): The padding of the input patch for each encoder block. num_encoder_blocks (`int`, *optional*, defaults to 4): The number of encoder blocks. drop_path_rate (`float`, *optional*, defaults to 0.0): The dropout rate for the dropout layers. hidden_act (`str`, *optional*, defaults to `"gelu"`): The activation function for the hidden layers. use_layer_scale (`bool`, *optional*, defaults to `True`): Whether to use layer scale. layer_scale_init_value (`float`, *optional*, defaults to 1e-5): The initial value for the layer scale. initializer_range (`float`, *optional*, defaults to 0.02): The initializer range for the weights. Example: ```python >>> from transformers import PoolFormerConfig, PoolFormerModel >>> # Initializing a PoolFormer sail/poolformer_s12 style configuration >>> configuration = PoolFormerConfig() >>> # Initializing a model (with random weights) from the sail/poolformer_s12 style configuration >>> model = PoolFormerModel(configuration) >>> # Accessing the model configuration >>> configuration = model.config ``` """ model_type = "poolformer" def __init__( self, num_channels=3, patch_size=16, stride=16, pool_size=3, mlp_ratio=4.0, depths=[2, 2, 6, 2], hidden_sizes=[64, 128, 320, 512], patch_sizes=[7, 3, 3, 3], strides=[4, 2, 2, 2], padding=[2, 1, 1, 1], num_encoder_blocks=4, drop_path_rate=0.0, hidden_act="gelu", use_layer_scale=True, layer_scale_init_value=1e-5, initializer_range=0.02, **kwargs, ): self.num_channels = num_channels self.patch_size = patch_size self.stride = stride self.padding = padding self.pool_size = pool_size self.hidden_sizes = hidden_sizes self.mlp_ratio = mlp_ratio self.depths = depths self.patch_sizes = patch_sizes self.strides = strides self.num_encoder_blocks = num_encoder_blocks self.drop_path_rate = drop_path_rate self.hidden_act = hidden_act self.use_layer_scale = use_layer_scale self.layer_scale_init_value = layer_scale_init_value self.initializer_range = initializer_range super().__init__(**kwargs) class PoolFormerOnnxConfig(OnnxConfig): torch_onnx_minimum_version = version.parse("1.11") @property def inputs(self) -> Mapping[str, Mapping[int, str]]: return OrderedDict( [ ("pixel_values", {0: "batch", 1: "num_channels", 2: "height", 3: "width"}), ] ) @property def atol_for_validation(self) -> float: return 2e-3
PypiClean
/foundation-sphinx-theme-0.0.3.tar.gz/foundation-sphinx-theme-0.0.3/foundation_sphinx_theme/static/foundation/js/vendor/zepto.js
;(function(undefined){ if (String.prototype.trim === undefined) // fix for iOS 3.2 String.prototype.trim = function(){ return this.replace(/^\s+|\s+$/g, '') } // For iOS 3.x // from https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/reduce if (Array.prototype.reduce === undefined) Array.prototype.reduce = function(fun){ if(this === void 0 || this === null) throw new TypeError() var t = Object(this), len = t.length >>> 0, k = 0, accumulator if(typeof fun != 'function') throw new TypeError() if(len == 0 && arguments.length == 1) throw new TypeError() if(arguments.length >= 2) accumulator = arguments[1] else do{ if(k in t){ accumulator = t[k++] break } if(++k >= len) throw new TypeError() } while (true) while (k < len){ if(k in t) accumulator = fun.call(undefined, accumulator, t[k], k, t) k++ } return accumulator } })() var Zepto = (function() { var undefined, key, $, classList, emptyArray = [], slice = emptyArray.slice, filter = emptyArray.filter, document = window.document, elementDisplay = {}, classCache = {}, getComputedStyle = document.defaultView.getComputedStyle, cssNumber = { 'column-count': 1, 'columns': 1, 'font-weight': 1, 'line-height': 1,'opacity': 1, 'z-index': 1, 'zoom': 1 }, fragmentRE = /^\s*<(\w+|!)[^>]*>/, tagExpanderRE = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig, rootNodeRE = /^(?:body|html)$/i, // special attributes that should be get/set via method calls methodAttributes = ['val', 'css', 'html', 'text', 'data', 'width', 'height', 'offset'], adjacencyOperators = [ 'after', 'prepend', 'before', 'append' ], table = document.createElement('table'), tableRow = document.createElement('tr'), containers = { 'tr': document.createElement('tbody'), 'tbody': table, 'thead': table, 'tfoot': table, 'td': tableRow, 'th': tableRow, '*': document.createElement('div') }, readyRE = /complete|loaded|interactive/, classSelectorRE = /^\.([\w-]+)$/, idSelectorRE = /^#([\w-]*)$/, tagSelectorRE = /^[\w-]+$/, class2type = {}, toString = class2type.toString, zepto = {}, camelize, uniq, tempParent = document.createElement('div') zepto.matches = function(element, selector) { if (!element || element.nodeType !== 1) return false var matchesSelector = element.webkitMatchesSelector || element.mozMatchesSelector || element.oMatchesSelector || element.matchesSelector if (matchesSelector) return matchesSelector.call(element, selector) // fall back to performing a selector: var match, parent = element.parentNode, temp = !parent if (temp) (parent = tempParent).appendChild(element) match = ~zepto.qsa(parent, selector).indexOf(element) temp && tempParent.removeChild(element) return match } function type(obj) { return obj == null ? String(obj) : class2type[toString.call(obj)] || "object" } function isFunction(value) { return type(value) == "function" } function isWindow(obj) { return obj != null && obj == obj.window } function isDocument(obj) { return obj != null && obj.nodeType == obj.DOCUMENT_NODE } function isObject(obj) { return type(obj) == "object" } function isPlainObject(obj) { return isObject(obj) && !isWindow(obj) && obj.__proto__ == Object.prototype } function isArray(value) { return value instanceof Array } function likeArray(obj) { return typeof obj.length == 'number' } function compact(array) { return filter.call(array, function(item){ return item != null }) } function flatten(array) { return array.length > 0 ? $.fn.concat.apply([], array) : array } camelize = function(str){ return str.replace(/-+(.)?/g, function(match, chr){ return chr ? chr.toUpperCase() : '' }) } function dasherize(str) { return str.replace(/::/g, '/') .replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2') .replace(/([a-z\d])([A-Z])/g, '$1_$2') .replace(/_/g, '-') .toLowerCase() } uniq = function(array){ return filter.call(array, function(item, idx){ return array.indexOf(item) == idx }) } function classRE(name) { return name in classCache ? classCache[name] : (classCache[name] = new RegExp('(^|\\s)' + name + '(\\s|$)')) } function maybeAddPx(name, value) { return (typeof value == "number" && !cssNumber[dasherize(name)]) ? value + "px" : value } function defaultDisplay(nodeName) { var element, display if (!elementDisplay[nodeName]) { element = document.createElement(nodeName) document.body.appendChild(element) display = getComputedStyle(element, '').getPropertyValue("display") element.parentNode.removeChild(element) display == "none" && (display = "block") elementDisplay[nodeName] = display } return elementDisplay[nodeName] } function children(element) { return 'children' in element ? slice.call(element.children) : $.map(element.childNodes, function(node){ if (node.nodeType == 1) return node }) } // `$.zepto.fragment` takes a html string and an optional tag name // to generate DOM nodes nodes from the given html string. // The generated DOM nodes are returned as an array. // This function can be overriden in plugins for example to make // it compatible with browsers that don't support the DOM fully. zepto.fragment = function(html, name, properties) { if (html.replace) html = html.replace(tagExpanderRE, "<$1></$2>") if (name === undefined) name = fragmentRE.test(html) && RegExp.$1 if (!(name in containers)) name = '*' var nodes, dom, container = containers[name] container.innerHTML = '' + html dom = $.each(slice.call(container.childNodes), function(){ container.removeChild(this) }) if (isPlainObject(properties)) { nodes = $(dom) $.each(properties, function(key, value) { if (methodAttributes.indexOf(key) > -1) nodes[key](value) else nodes.attr(key, value) }) } return dom } // `$.zepto.Z` swaps out the prototype of the given `dom` array // of nodes with `$.fn` and thus supplying all the Zepto functions // to the array. Note that `__proto__` is not supported on Internet // Explorer. This method can be overriden in plugins. zepto.Z = function(dom, selector) { dom = dom || [] dom.__proto__ = $.fn dom.selector = selector || '' return dom } // `$.zepto.isZ` should return `true` if the given object is a Zepto // collection. This method can be overriden in plugins. zepto.isZ = function(object) { return object instanceof zepto.Z } // `$.zepto.init` is Zepto's counterpart to jQuery's `$.fn.init` and // takes a CSS selector and an optional context (and handles various // special cases). // This method can be overriden in plugins. zepto.init = function(selector, context) { // If nothing given, return an empty Zepto collection if (!selector) return zepto.Z() // If a function is given, call it when the DOM is ready else if (isFunction(selector)) return $(document).ready(selector) // If a Zepto collection is given, juts return it else if (zepto.isZ(selector)) return selector else { var dom // normalize array if an array of nodes is given if (isArray(selector)) dom = compact(selector) // Wrap DOM nodes. If a plain object is given, duplicate it. else if (isObject(selector)) dom = [isPlainObject(selector) ? $.extend({}, selector) : selector], selector = null // If it's a html fragment, create nodes from it else if (fragmentRE.test(selector)) dom = zepto.fragment(selector.trim(), RegExp.$1, context), selector = null // If there's a context, create a collection on that context first, and select // nodes from there else if (context !== undefined) return $(context).find(selector) // And last but no least, if it's a CSS selector, use it to select nodes. else dom = zepto.qsa(document, selector) // create a new Zepto collection from the nodes found return zepto.Z(dom, selector) } } // `$` will be the base `Zepto` object. When calling this // function just call `$.zepto.init, which makes the implementation // details of selecting nodes and creating Zepto collections // patchable in plugins. $ = function(selector, context){ return zepto.init(selector, context) } function extend(target, source, deep) { for (key in source) if (deep && (isPlainObject(source[key]) || isArray(source[key]))) { if (isPlainObject(source[key]) && !isPlainObject(target[key])) target[key] = {} if (isArray(source[key]) && !isArray(target[key])) target[key] = [] extend(target[key], source[key], deep) } else if (source[key] !== undefined) target[key] = source[key] } // Copy all but undefined properties from one or more // objects to the `target` object. $.extend = function(target){ var deep, args = slice.call(arguments, 1) if (typeof target == 'boolean') { deep = target target = args.shift() } args.forEach(function(arg){ extend(target, arg, deep) }) return target } // `$.zepto.qsa` is Zepto's CSS selector implementation which // uses `document.querySelectorAll` and optimizes for some special cases, like `#id`. // This method can be overriden in plugins. zepto.qsa = function(element, selector){ var found return (isDocument(element) && idSelectorRE.test(selector)) ? ( (found = element.getElementById(RegExp.$1)) ? [found] : [] ) : (element.nodeType !== 1 && element.nodeType !== 9) ? [] : slice.call( classSelectorRE.test(selector) ? element.getElementsByClassName(RegExp.$1) : tagSelectorRE.test(selector) ? element.getElementsByTagName(selector) : element.querySelectorAll(selector) ) } function filtered(nodes, selector) { return selector === undefined ? $(nodes) : $(nodes).filter(selector) } $.contains = function(parent, node) { return parent !== node && parent.contains(node) } function funcArg(context, arg, idx, payload) { return isFunction(arg) ? arg.call(context, idx, payload) : arg } function setAttribute(node, name, value) { value == null ? node.removeAttribute(name) : node.setAttribute(name, value) } // access className property while respecting SVGAnimatedString function className(node, value){ var klass = node.className, svg = klass && klass.baseVal !== undefined if (value === undefined) return svg ? klass.baseVal : klass svg ? (klass.baseVal = value) : (node.className = value) } // "true" => true // "false" => false // "null" => null // "42" => 42 // "42.5" => 42.5 // JSON => parse if valid // String => self function deserializeValue(value) { var num try { return value ? value == "true" || ( value == "false" ? false : value == "null" ? null : !isNaN(num = Number(value)) ? num : /^[\[\{]/.test(value) ? $.parseJSON(value) : value ) : value } catch(e) { return value } } $.type = type $.isFunction = isFunction $.isWindow = isWindow $.isArray = isArray $.isPlainObject = isPlainObject $.isEmptyObject = function(obj) { var name for (name in obj) return false return true } $.inArray = function(elem, array, i){ return emptyArray.indexOf.call(array, elem, i) } $.camelCase = camelize $.trim = function(str) { return str.trim() } // plugin compatibility $.uuid = 0 $.support = { } $.expr = { } $.map = function(elements, callback){ var value, values = [], i, key if (likeArray(elements)) for (i = 0; i < elements.length; i++) { value = callback(elements[i], i) if (value != null) values.push(value) } else for (key in elements) { value = callback(elements[key], key) if (value != null) values.push(value) } return flatten(values) } $.each = function(elements, callback){ var i, key if (likeArray(elements)) { for (i = 0; i < elements.length; i++) if (callback.call(elements[i], i, elements[i]) === false) return elements } else { for (key in elements) if (callback.call(elements[key], key, elements[key]) === false) return elements } return elements } $.grep = function(elements, callback){ return filter.call(elements, callback) } if (window.JSON) $.parseJSON = JSON.parse // Populate the class2type map $.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { class2type[ "[object " + name + "]" ] = name.toLowerCase() }) // Define methods that will be available on all // Zepto collections $.fn = { // Because a collection acts like an array // copy over these useful array functions. forEach: emptyArray.forEach, reduce: emptyArray.reduce, push: emptyArray.push, sort: emptyArray.sort, indexOf: emptyArray.indexOf, concat: emptyArray.concat, // `map` and `slice` in the jQuery API work differently // from their array counterparts map: function(fn){ return $($.map(this, function(el, i){ return fn.call(el, i, el) })) }, slice: function(){ return $(slice.apply(this, arguments)) }, ready: function(callback){ if (readyRE.test(document.readyState)) callback($) else document.addEventListener('DOMContentLoaded', function(){ callback($) }, false) return this }, get: function(idx){ return idx === undefined ? slice.call(this) : this[idx >= 0 ? idx : idx + this.length] }, toArray: function(){ return this.get() }, size: function(){ return this.length }, remove: function(){ return this.each(function(){ if (this.parentNode != null) this.parentNode.removeChild(this) }) }, each: function(callback){ emptyArray.every.call(this, function(el, idx){ return callback.call(el, idx, el) !== false }) return this }, filter: function(selector){ if (isFunction(selector)) return this.not(this.not(selector)) return $(filter.call(this, function(element){ return zepto.matches(element, selector) })) }, add: function(selector,context){ return $(uniq(this.concat($(selector,context)))) }, is: function(selector){ return this.length > 0 && zepto.matches(this[0], selector) }, not: function(selector){ var nodes=[] if (isFunction(selector) && selector.call !== undefined) this.each(function(idx){ if (!selector.call(this,idx)) nodes.push(this) }) else { var excludes = typeof selector == 'string' ? this.filter(selector) : (likeArray(selector) && isFunction(selector.item)) ? slice.call(selector) : $(selector) this.forEach(function(el){ if (excludes.indexOf(el) < 0) nodes.push(el) }) } return $(nodes) }, has: function(selector){ return this.filter(function(){ return isObject(selector) ? $.contains(this, selector) : $(this).find(selector).size() }) }, eq: function(idx){ return idx === -1 ? this.slice(idx) : this.slice(idx, + idx + 1) }, first: function(){ var el = this[0] return el && !isObject(el) ? el : $(el) }, last: function(){ var el = this[this.length - 1] return el && !isObject(el) ? el : $(el) }, find: function(selector){ var result, $this = this if (typeof selector == 'object') result = $(selector).filter(function(){ var node = this return emptyArray.some.call($this, function(parent){ return $.contains(parent, node) }) }) else if (this.length == 1) result = $(zepto.qsa(this[0], selector)) else result = this.map(function(){ return zepto.qsa(this, selector) }) return result }, closest: function(selector, context){ var node = this[0], collection = false if (typeof selector == 'object') collection = $(selector) while (node && !(collection ? collection.indexOf(node) >= 0 : zepto.matches(node, selector))) node = node !== context && !isDocument(node) && node.parentNode return $(node) }, parents: function(selector){ var ancestors = [], nodes = this while (nodes.length > 0) nodes = $.map(nodes, function(node){ if ((node = node.parentNode) && !isDocument(node) && ancestors.indexOf(node) < 0) { ancestors.push(node) return node } }) return filtered(ancestors, selector) }, parent: function(selector){ return filtered(uniq(this.pluck('parentNode')), selector) }, children: function(selector){ return filtered(this.map(function(){ return children(this) }), selector) }, contents: function() { return this.map(function() { return slice.call(this.childNodes) }) }, siblings: function(selector){ return filtered(this.map(function(i, el){ return filter.call(children(el.parentNode), function(child){ return child!==el }) }), selector) }, empty: function(){ return this.each(function(){ this.innerHTML = '' }) }, // `pluck` is borrowed from Prototype.js pluck: function(property){ return $.map(this, function(el){ return el[property] }) }, show: function(){ return this.each(function(){ this.style.display == "none" && (this.style.display = null) if (getComputedStyle(this, '').getPropertyValue("display") == "none") this.style.display = defaultDisplay(this.nodeName) }) }, replaceWith: function(newContent){ return this.before(newContent).remove() }, wrap: function(structure){ var func = isFunction(structure) if (this[0] && !func) var dom = $(structure).get(0), clone = dom.parentNode || this.length > 1 return this.each(function(index){ $(this).wrapAll( func ? structure.call(this, index) : clone ? dom.cloneNode(true) : dom ) }) }, wrapAll: function(structure){ if (this[0]) { $(this[0]).before(structure = $(structure)) var children // drill down to the inmost element while ((children = structure.children()).length) structure = children.first() $(structure).append(this) } return this }, wrapInner: function(structure){ var func = isFunction(structure) return this.each(function(index){ var self = $(this), contents = self.contents(), dom = func ? structure.call(this, index) : structure contents.length ? contents.wrapAll(dom) : self.append(dom) }) }, unwrap: function(){ this.parent().each(function(){ $(this).replaceWith($(this).children()) }) return this }, clone: function(){ return this.map(function(){ return this.cloneNode(true) }) }, hide: function(){ return this.css("display", "none") }, toggle: function(setting){ return this.each(function(){ var el = $(this) ;(setting === undefined ? el.css("display") == "none" : setting) ? el.show() : el.hide() }) }, prev: function(selector){ return $(this.pluck('previousElementSibling')).filter(selector || '*') }, next: function(selector){ return $(this.pluck('nextElementSibling')).filter(selector || '*') }, html: function(html){ return html === undefined ? (this.length > 0 ? this[0].innerHTML : null) : this.each(function(idx){ var originHtml = this.innerHTML $(this).empty().append( funcArg(this, html, idx, originHtml) ) }) }, text: function(text){ return text === undefined ? (this.length > 0 ? this[0].textContent : null) : this.each(function(){ this.textContent = text }) }, attr: function(name, value){ var result return (typeof name == 'string' && value === undefined) ? (this.length == 0 || this[0].nodeType !== 1 ? undefined : (name == 'value' && this[0].nodeName == 'INPUT') ? this.val() : (!(result = this[0].getAttribute(name)) && name in this[0]) ? this[0][name] : result ) : this.each(function(idx){ if (this.nodeType !== 1) return if (isObject(name)) for (key in name) setAttribute(this, key, name[key]) else setAttribute(this, name, funcArg(this, value, idx, this.getAttribute(name))) }) }, removeAttr: function(name){ return this.each(function(){ this.nodeType === 1 && setAttribute(this, name) }) }, prop: function(name, value){ return (value === undefined) ? (this[0] && this[0][name]) : this.each(function(idx){ this[name] = funcArg(this, value, idx, this[name]) }) }, data: function(name, value){ var data = this.attr('data-' + dasherize(name), value) return data !== null ? deserializeValue(data) : undefined }, val: function(value){ return (value === undefined) ? (this[0] && (this[0].multiple ? $(this[0]).find('option').filter(function(o){ return this.selected }).pluck('value') : this[0].value) ) : this.each(function(idx){ this.value = funcArg(this, value, idx, this.value) }) }, offset: function(coordinates){ if (coordinates) return this.each(function(index){ var $this = $(this), coords = funcArg(this, coordinates, index, $this.offset()), parentOffset = $this.offsetParent().offset(), props = { top: coords.top - parentOffset.top, left: coords.left - parentOffset.left } if ($this.css('position') == 'static') props['position'] = 'relative' $this.css(props) }) if (this.length==0) return null var obj = this[0].getBoundingClientRect() return { left: obj.left + window.pageXOffset, top: obj.top + window.pageYOffset, width: Math.round(obj.width), height: Math.round(obj.height) } }, css: function(property, value){ if (arguments.length < 2 && typeof property == 'string') return this[0] && (this[0].style[camelize(property)] || getComputedStyle(this[0], '').getPropertyValue(property)) var css = '' if (type(property) == 'string') { if (!value && value !== 0) this.each(function(){ this.style.removeProperty(dasherize(property)) }) else css = dasherize(property) + ":" + maybeAddPx(property, value) } else { for (key in property) if (!property[key] && property[key] !== 0) this.each(function(){ this.style.removeProperty(dasherize(key)) }) else css += dasherize(key) + ':' + maybeAddPx(key, property[key]) + ';' } return this.each(function(){ this.style.cssText += ';' + css }) }, index: function(element){ return element ? this.indexOf($(element)[0]) : this.parent().children().indexOf(this[0]) }, hasClass: function(name){ return emptyArray.some.call(this, function(el){ return this.test(className(el)) }, classRE(name)) }, addClass: function(name){ return this.each(function(idx){ classList = [] var cls = className(this), newName = funcArg(this, name, idx, cls) newName.split(/\s+/g).forEach(function(klass){ if (!$(this).hasClass(klass)) classList.push(klass) }, this) classList.length && className(this, cls + (cls ? " " : "") + classList.join(" ")) }) }, removeClass: function(name){ return this.each(function(idx){ if (name === undefined) return className(this, '') classList = className(this) funcArg(this, name, idx, classList).split(/\s+/g).forEach(function(klass){ classList = classList.replace(classRE(klass), " ") }) className(this, classList.trim()) }) }, toggleClass: function(name, when){ return this.each(function(idx){ var $this = $(this), names = funcArg(this, name, idx, className(this)) names.split(/\s+/g).forEach(function(klass){ (when === undefined ? !$this.hasClass(klass) : when) ? $this.addClass(klass) : $this.removeClass(klass) }) }) }, scrollTop: function(){ if (!this.length) return return ('scrollTop' in this[0]) ? this[0].scrollTop : this[0].scrollY }, position: function() { if (!this.length) return var elem = this[0], // Get *real* offsetParent offsetParent = this.offsetParent(), // Get correct offsets offset = this.offset(), parentOffset = rootNodeRE.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset() // Subtract element margins // note: when an element has margin: auto the offsetLeft and marginLeft // are the same in Safari causing offset.left to incorrectly be 0 offset.top -= parseFloat( $(elem).css('margin-top') ) || 0 offset.left -= parseFloat( $(elem).css('margin-left') ) || 0 // Add offsetParent borders parentOffset.top += parseFloat( $(offsetParent[0]).css('border-top-width') ) || 0 parentOffset.left += parseFloat( $(offsetParent[0]).css('border-left-width') ) || 0 // Subtract the two offsets return { top: offset.top - parentOffset.top, left: offset.left - parentOffset.left } }, offsetParent: function() { return this.map(function(){ var parent = this.offsetParent || document.body while (parent && !rootNodeRE.test(parent.nodeName) && $(parent).css("position") == "static") parent = parent.offsetParent return parent }) } } // for now $.fn.detach = $.fn.remove // Generate the `width` and `height` functions ;['width', 'height'].forEach(function(dimension){ $.fn[dimension] = function(value){ var offset, el = this[0], Dimension = dimension.replace(/./, function(m){ return m[0].toUpperCase() }) if (value === undefined) return isWindow(el) ? el['inner' + Dimension] : isDocument(el) ? el.documentElement['offset' + Dimension] : (offset = this.offset()) && offset[dimension] else return this.each(function(idx){ el = $(this) el.css(dimension, funcArg(this, value, idx, el[dimension]())) }) } }) function traverseNode(node, fun) { fun(node) for (var key in node.childNodes) traverseNode(node.childNodes[key], fun) } // Generate the `after`, `prepend`, `before`, `append`, // `insertAfter`, `insertBefore`, `appendTo`, and `prependTo` methods. adjacencyOperators.forEach(function(operator, operatorIndex) { var inside = operatorIndex % 2 //=> prepend, append $.fn[operator] = function(){ // arguments can be nodes, arrays of nodes, Zepto objects and HTML strings var argType, nodes = $.map(arguments, function(arg) { argType = type(arg) return argType == "object" || argType == "array" || arg == null ? arg : zepto.fragment(arg) }), parent, copyByClone = this.length > 1 if (nodes.length < 1) return this return this.each(function(_, target){ parent = inside ? target : target.parentNode // convert all methods to a "before" operation target = operatorIndex == 0 ? target.nextSibling : operatorIndex == 1 ? target.firstChild : operatorIndex == 2 ? target : null nodes.forEach(function(node){ if (copyByClone) node = node.cloneNode(true) else if (!parent) return $(node).remove() traverseNode(parent.insertBefore(node, target), function(el){ if (el.nodeName != null && el.nodeName.toUpperCase() === 'SCRIPT' && (!el.type || el.type === 'text/javascript') && !el.src) window['eval'].call(window, el.innerHTML) }) }) }) } // after => insertAfter // prepend => prependTo // before => insertBefore // append => appendTo $.fn[inside ? operator+'To' : 'insert'+(operatorIndex ? 'Before' : 'After')] = function(html){ $(html)[operator](this) return this } }) zepto.Z.prototype = $.fn // Export internal API functions in the `$.zepto` namespace zepto.uniq = uniq zepto.deserializeValue = deserializeValue $.zepto = zepto return $ })() window.Zepto = Zepto '$' in window || (window.$ = Zepto) ;(function($){ function detect(ua){ var os = this.os = {}, browser = this.browser = {}, webkit = ua.match(/WebKit\/([\d.]+)/), android = ua.match(/(Android)\s+([\d.]+)/), ipad = ua.match(/(iPad).*OS\s([\d_]+)/), iphone = !ipad && ua.match(/(iPhone\sOS)\s([\d_]+)/), webos = ua.match(/(webOS|hpwOS)[\s\/]([\d.]+)/), touchpad = webos && ua.match(/TouchPad/), kindle = ua.match(/Kindle\/([\d.]+)/), silk = ua.match(/Silk\/([\d._]+)/), blackberry = ua.match(/(BlackBerry).*Version\/([\d.]+)/), bb10 = ua.match(/(BB10).*Version\/([\d.]+)/), rimtabletos = ua.match(/(RIM\sTablet\sOS)\s([\d.]+)/), playbook = ua.match(/PlayBook/), chrome = ua.match(/Chrome\/([\d.]+)/) || ua.match(/CriOS\/([\d.]+)/), firefox = ua.match(/Firefox\/([\d.]+)/) // Todo: clean this up with a better OS/browser seperation: // - discern (more) between multiple browsers on android // - decide if kindle fire in silk mode is android or not // - Firefox on Android doesn't specify the Android version // - possibly devide in os, device and browser hashes if (browser.webkit = !!webkit) browser.version = webkit[1] if (android) os.android = true, os.version = android[2] if (iphone) os.ios = os.iphone = true, os.version = iphone[2].replace(/_/g, '.') if (ipad) os.ios = os.ipad = true, os.version = ipad[2].replace(/_/g, '.') if (webos) os.webos = true, os.version = webos[2] if (touchpad) os.touchpad = true if (blackberry) os.blackberry = true, os.version = blackberry[2] if (bb10) os.bb10 = true, os.version = bb10[2] if (rimtabletos) os.rimtabletos = true, os.version = rimtabletos[2] if (playbook) browser.playbook = true if (kindle) os.kindle = true, os.version = kindle[1] if (silk) browser.silk = true, browser.version = silk[1] if (!silk && os.android && ua.match(/Kindle Fire/)) browser.silk = true if (chrome) browser.chrome = true, browser.version = chrome[1] if (firefox) browser.firefox = true, browser.version = firefox[1] os.tablet = !!(ipad || playbook || (android && !ua.match(/Mobile/)) || (firefox && ua.match(/Tablet/))) os.phone = !!(!os.tablet && (android || iphone || webos || blackberry || bb10 || (chrome && ua.match(/Android/)) || (chrome && ua.match(/CriOS\/([\d.]+)/)) || (firefox && ua.match(/Mobile/)))) } detect.call($, navigator.userAgent) // make available to unit tests $.__detect = detect })(Zepto) ;(function($){ var $$ = $.zepto.qsa, handlers = {}, _zid = 1, specialEvents={}, hover = { mouseenter: 'mouseover', mouseleave: 'mouseout' } specialEvents.click = specialEvents.mousedown = specialEvents.mouseup = specialEvents.mousemove = 'MouseEvents' function zid(element) { return element._zid || (element._zid = _zid++) } function findHandlers(element, event, fn, selector) { event = parse(event) if (event.ns) var matcher = matcherFor(event.ns) return (handlers[zid(element)] || []).filter(function(handler) { return handler && (!event.e || handler.e == event.e) && (!event.ns || matcher.test(handler.ns)) && (!fn || zid(handler.fn) === zid(fn)) && (!selector || handler.sel == selector) }) } function parse(event) { var parts = ('' + event).split('.') return {e: parts[0], ns: parts.slice(1).sort().join(' ')} } function matcherFor(ns) { return new RegExp('(?:^| )' + ns.replace(' ', ' .* ?') + '(?: |$)') } function eachEvent(events, fn, iterator){ if ($.type(events) != "string") $.each(events, iterator) else events.split(/\s/).forEach(function(type){ iterator(type, fn) }) } function eventCapture(handler, captureSetting) { return handler.del && (handler.e == 'focus' || handler.e == 'blur') || !!captureSetting } function realEvent(type) { return hover[type] || type } function add(element, events, fn, selector, getDelegate, capture){ var id = zid(element), set = (handlers[id] || (handlers[id] = [])) eachEvent(events, fn, function(event, fn){ var handler = parse(event) handler.fn = fn handler.sel = selector // emulate mouseenter, mouseleave if (handler.e in hover) fn = function(e){ var related = e.relatedTarget if (!related || (related !== this && !$.contains(this, related))) return handler.fn.apply(this, arguments) } handler.del = getDelegate && getDelegate(fn, event) var callback = handler.del || fn handler.proxy = function (e) { var result = callback.apply(element, [e].concat(e.data)) if (result === false) e.preventDefault(), e.stopPropagation() return result } handler.i = set.length set.push(handler) element.addEventListener(realEvent(handler.e), handler.proxy, eventCapture(handler, capture)) }) } function remove(element, events, fn, selector, capture){ var id = zid(element) eachEvent(events || '', fn, function(event, fn){ findHandlers(element, event, fn, selector).forEach(function(handler){ delete handlers[id][handler.i] element.removeEventListener(realEvent(handler.e), handler.proxy, eventCapture(handler, capture)) }) }) } $.event = { add: add, remove: remove } $.proxy = function(fn, context) { if ($.isFunction(fn)) { var proxyFn = function(){ return fn.apply(context, arguments) } proxyFn._zid = zid(fn) return proxyFn } else if (typeof context == 'string') { return $.proxy(fn[context], fn) } else { throw new TypeError("expected function") } } $.fn.bind = function(event, callback){ return this.each(function(){ add(this, event, callback) }) } $.fn.unbind = function(event, callback){ return this.each(function(){ remove(this, event, callback) }) } $.fn.one = function(event, callback){ return this.each(function(i, element){ add(this, event, callback, null, function(fn, type){ return function(){ var result = fn.apply(element, arguments) remove(element, type, fn) return result } }) }) } var returnTrue = function(){return true}, returnFalse = function(){return false}, ignoreProperties = /^([A-Z]|layer[XY]$)/, eventMethods = { preventDefault: 'isDefaultPrevented', stopImmediatePropagation: 'isImmediatePropagationStopped', stopPropagation: 'isPropagationStopped' } function createProxy(event) { var key, proxy = { originalEvent: event } for (key in event) if (!ignoreProperties.test(key) && event[key] !== undefined) proxy[key] = event[key] $.each(eventMethods, function(name, predicate) { proxy[name] = function(){ this[predicate] = returnTrue return event[name].apply(event, arguments) } proxy[predicate] = returnFalse }) return proxy } // emulates the 'defaultPrevented' property for browsers that have none function fix(event) { if (!('defaultPrevented' in event)) { event.defaultPrevented = false var prevent = event.preventDefault event.preventDefault = function() { this.defaultPrevented = true prevent.call(this) } } } $.fn.delegate = function(selector, event, callback){ return this.each(function(i, element){ add(element, event, callback, selector, function(fn){ return function(e){ var evt, match = $(e.target).closest(selector, element).get(0) if (match) { evt = $.extend(createProxy(e), {currentTarget: match, liveFired: element}) return fn.apply(match, [evt].concat([].slice.call(arguments, 1))) } } }) }) } $.fn.undelegate = function(selector, event, callback){ return this.each(function(){ remove(this, event, callback, selector) }) } $.fn.live = function(event, callback){ $(document.body).delegate(this.selector, event, callback) return this } $.fn.die = function(event, callback){ $(document.body).undelegate(this.selector, event, callback) return this } $.fn.on = function(event, selector, callback){ return !selector || $.isFunction(selector) ? this.bind(event, selector || callback) : this.delegate(selector, event, callback) } $.fn.off = function(event, selector, callback){ return !selector || $.isFunction(selector) ? this.unbind(event, selector || callback) : this.undelegate(selector, event, callback) } $.fn.trigger = function(event, data){ if (typeof event == 'string' || $.isPlainObject(event)) event = $.Event(event) fix(event) event.data = data return this.each(function(){ // items in the collection might not be DOM elements // (todo: possibly support events on plain old objects) if('dispatchEvent' in this) this.dispatchEvent(event) }) } // triggers event handlers on current element just as if an event occurred, // doesn't trigger an actual event, doesn't bubble $.fn.triggerHandler = function(event, data){ var e, result this.each(function(i, element){ e = createProxy(typeof event == 'string' ? $.Event(event) : event) e.data = data e.target = element $.each(findHandlers(element, event.type || event), function(i, handler){ result = handler.proxy(e) if (e.isImmediatePropagationStopped()) return false }) }) return result } // shortcut methods for `.bind(event, fn)` for each event type ;('focusin focusout load resize scroll unload click dblclick '+ 'mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave '+ 'change select keydown keypress keyup error').split(' ').forEach(function(event) { $.fn[event] = function(callback) { return callback ? this.bind(event, callback) : this.trigger(event) } }) ;['focus', 'blur'].forEach(function(name) { $.fn[name] = function(callback) { if (callback) this.bind(name, callback) else this.each(function(){ try { this[name]() } catch(e) {} }) return this } }) $.Event = function(type, props) { if (typeof type != 'string') props = type, type = props.type var event = document.createEvent(specialEvents[type] || 'Events'), bubbles = true if (props) for (var name in props) (name == 'bubbles') ? (bubbles = !!props[name]) : (event[name] = props[name]) event.initEvent(type, bubbles, true, null, null, null, null, null, null, null, null, null, null, null, null) event.isDefaultPrevented = function(){ return this.defaultPrevented } return event } })(Zepto) ;(function($){ var jsonpID = 0, document = window.document, key, name, rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, scriptTypeRE = /^(?:text|application)\/javascript/i, xmlTypeRE = /^(?:text|application)\/xml/i, jsonType = 'application/json', htmlType = 'text/html', blankRE = /^\s*$/ // trigger a custom event and return false if it was cancelled function triggerAndReturn(context, eventName, data) { var event = $.Event(eventName) $(context).trigger(event, data) return !event.defaultPrevented } // trigger an Ajax "global" event function triggerGlobal(settings, context, eventName, data) { if (settings.global) return triggerAndReturn(context || document, eventName, data) } // Number of active Ajax requests $.active = 0 function ajaxStart(settings) { if (settings.global && $.active++ === 0) triggerGlobal(settings, null, 'ajaxStart') } function ajaxStop(settings) { if (settings.global && !(--$.active)) triggerGlobal(settings, null, 'ajaxStop') } // triggers an extra global event "ajaxBeforeSend" that's like "ajaxSend" but cancelable function ajaxBeforeSend(xhr, settings) { var context = settings.context if (settings.beforeSend.call(context, xhr, settings) === false || triggerGlobal(settings, context, 'ajaxBeforeSend', [xhr, settings]) === false) return false triggerGlobal(settings, context, 'ajaxSend', [xhr, settings]) } function ajaxSuccess(data, xhr, settings) { var context = settings.context, status = 'success' settings.success.call(context, data, status, xhr) triggerGlobal(settings, context, 'ajaxSuccess', [xhr, settings, data]) ajaxComplete(status, xhr, settings) } // type: "timeout", "error", "abort", "parsererror" function ajaxError(error, type, xhr, settings) { var context = settings.context settings.error.call(context, xhr, type, error) triggerGlobal(settings, context, 'ajaxError', [xhr, settings, error]) ajaxComplete(type, xhr, settings) } // status: "success", "notmodified", "error", "timeout", "abort", "parsererror" function ajaxComplete(status, xhr, settings) { var context = settings.context settings.complete.call(context, xhr, status) triggerGlobal(settings, context, 'ajaxComplete', [xhr, settings]) ajaxStop(settings) } // Empty function, used as default callback function empty() {} $.ajaxJSONP = function(options){ if (!('type' in options)) return $.ajax(options) var callbackName = 'jsonp' + (++jsonpID), script = document.createElement('script'), cleanup = function() { clearTimeout(abortTimeout) $(script).remove() delete window[callbackName] }, abort = function(type){ cleanup() // In case of manual abort or timeout, keep an empty function as callback // so that the SCRIPT tag that eventually loads won't result in an error. if (!type || type == 'timeout') window[callbackName] = empty ajaxError(null, type || 'abort', xhr, options) }, xhr = { abort: abort }, abortTimeout if (ajaxBeforeSend(xhr, options) === false) { abort('abort') return false } window[callbackName] = function(data){ cleanup() ajaxSuccess(data, xhr, options) } script.onerror = function() { abort('error') } script.src = options.url.replace(/=\?/, '=' + callbackName) $('head').append(script) if (options.timeout > 0) abortTimeout = setTimeout(function(){ abort('timeout') }, options.timeout) return xhr } $.ajaxSettings = { // Default type of request type: 'GET', // Callback that is executed before request beforeSend: empty, // Callback that is executed if the request succeeds success: empty, // Callback that is executed the the server drops error error: empty, // Callback that is executed on request complete (both: error and success) complete: empty, // The context for the callbacks context: null, // Whether to trigger "global" Ajax events global: true, // Transport xhr: function () { return new window.XMLHttpRequest() }, // MIME types mapping accepts: { script: 'text/javascript, application/javascript', json: jsonType, xml: 'application/xml, text/xml', html: htmlType, text: 'text/plain' }, // Whether the request is to another domain crossDomain: false, // Default timeout timeout: 0, // Whether data should be serialized to string processData: true, // Whether the browser should be allowed to cache GET responses cache: true, } function mimeToDataType(mime) { if (mime) mime = mime.split(';', 2)[0] return mime && ( mime == htmlType ? 'html' : mime == jsonType ? 'json' : scriptTypeRE.test(mime) ? 'script' : xmlTypeRE.test(mime) && 'xml' ) || 'text' } function appendQuery(url, query) { return (url + '&' + query).replace(/[&?]{1,2}/, '?') } // serialize payload and append it to the URL for GET requests function serializeData(options) { if (options.processData && options.data && $.type(options.data) != "string") options.data = $.param(options.data, options.traditional) if (options.data && (!options.type || options.type.toUpperCase() == 'GET')) options.url = appendQuery(options.url, options.data) } $.ajax = function(options){ var settings = $.extend({}, options || {}) for (key in $.ajaxSettings) if (settings[key] === undefined) settings[key] = $.ajaxSettings[key] ajaxStart(settings) if (!settings.crossDomain) settings.crossDomain = /^([\w-]+:)?\/\/([^\/]+)/.test(settings.url) && RegExp.$2 != window.location.host if (!settings.url) settings.url = window.location.toString() serializeData(settings) if (settings.cache === false) settings.url = appendQuery(settings.url, '_=' + Date.now()) var dataType = settings.dataType, hasPlaceholder = /=\?/.test(settings.url) if (dataType == 'jsonp' || hasPlaceholder) { if (!hasPlaceholder) settings.url = appendQuery(settings.url, 'callback=?') return $.ajaxJSONP(settings) } var mime = settings.accepts[dataType], baseHeaders = { }, protocol = /^([\w-]+:)\/\//.test(settings.url) ? RegExp.$1 : window.location.protocol, xhr = settings.xhr(), abortTimeout if (!settings.crossDomain) baseHeaders['X-Requested-With'] = 'XMLHttpRequest' if (mime) { baseHeaders['Accept'] = mime if (mime.indexOf(',') > -1) mime = mime.split(',', 2)[0] xhr.overrideMimeType && xhr.overrideMimeType(mime) } if (settings.contentType || (settings.contentType !== false && settings.data && settings.type.toUpperCase() != 'GET')) baseHeaders['Content-Type'] = (settings.contentType || 'application/x-www-form-urlencoded') settings.headers = $.extend(baseHeaders, settings.headers || {}) xhr.onreadystatechange = function(){ if (xhr.readyState == 4) { xhr.onreadystatechange = empty; clearTimeout(abortTimeout) var result, error = false if ((xhr.status >= 200 && xhr.status < 300) || xhr.status == 304 || (xhr.status == 0 && protocol == 'file:')) { dataType = dataType || mimeToDataType(xhr.getResponseHeader('content-type')) result = xhr.responseText try { // http://perfectionkills.com/global-eval-what-are-the-options/ if (dataType == 'script') (1,eval)(result) else if (dataType == 'xml') result = xhr.responseXML else if (dataType == 'json') result = blankRE.test(result) ? null : $.parseJSON(result) } catch (e) { error = e } if (error) ajaxError(error, 'parsererror', xhr, settings) else ajaxSuccess(result, xhr, settings) } else { ajaxError(null, xhr.status ? 'error' : 'abort', xhr, settings) } } } var async = 'async' in settings ? settings.async : true xhr.open(settings.type, settings.url, async) for (name in settings.headers) xhr.setRequestHeader(name, settings.headers[name]) if (ajaxBeforeSend(xhr, settings) === false) { xhr.abort() return false } if (settings.timeout > 0) abortTimeout = setTimeout(function(){ xhr.onreadystatechange = empty xhr.abort() ajaxError(null, 'timeout', xhr, settings) }, settings.timeout) // avoid sending empty string (#319) xhr.send(settings.data ? settings.data : null) return xhr } // handle optional data/success arguments function parseArguments(url, data, success, dataType) { var hasData = !$.isFunction(data) return { url: url, data: hasData ? data : undefined, success: !hasData ? data : $.isFunction(success) ? success : undefined, dataType: hasData ? dataType || success : success } } $.get = function(url, data, success, dataType){ return $.ajax(parseArguments.apply(null, arguments)) } $.post = function(url, data, success, dataType){ var options = parseArguments.apply(null, arguments) options.type = 'POST' return $.ajax(options) } $.getJSON = function(url, data, success){ var options = parseArguments.apply(null, arguments) options.dataType = 'json' return $.ajax(options) } $.fn.load = function(url, data, success){ if (!this.length) return this var self = this, parts = url.split(/\s/), selector, options = parseArguments(url, data, success), callback = options.success if (parts.length > 1) options.url = parts[0], selector = parts[1] options.success = function(response){ self.html(selector ? $('<div>').html(response.replace(rscript, "")).find(selector) : response) callback && callback.apply(self, arguments) } $.ajax(options) return this } var escape = encodeURIComponent function serialize(params, obj, traditional, scope){ var type, array = $.isArray(obj) $.each(obj, function(key, value) { type = $.type(value) if (scope) key = traditional ? scope : scope + '[' + (array ? '' : key) + ']' // handle data in serializeArray() format if (!scope && array) params.add(value.name, value.value) // recurse into nested objects else if (type == "array" || (!traditional && type == "object")) serialize(params, value, traditional, key) else params.add(key, value) }) } $.param = function(obj, traditional){ var params = [] params.add = function(k, v){ this.push(escape(k) + '=' + escape(v)) } serialize(params, obj, traditional) return params.join('&').replace(/%20/g, '+') } })(Zepto) ;(function ($) { $.fn.serializeArray = function () { var result = [], el $( Array.prototype.slice.call(this.get(0).elements) ).each(function () { el = $(this) var type = el.attr('type') if (this.nodeName.toLowerCase() != 'fieldset' && !this.disabled && type != 'submit' && type != 'reset' && type != 'button' && ((type != 'radio' && type != 'checkbox') || this.checked)) result.push({ name: el.attr('name'), value: el.val() }) }) return result } $.fn.serialize = function () { var result = [] this.serializeArray().forEach(function (elm) { result.push( encodeURIComponent(elm.name) + '=' + encodeURIComponent(elm.value) ) }) return result.join('&') } $.fn.submit = function (callback) { if (callback) this.bind('submit', callback) else if (this.length) { var event = $.Event('submit') this.eq(0).trigger(event) if (!event.defaultPrevented) this.get(0).submit() } return this } })(Zepto) ;(function($, undefined){ var prefix = '', eventPrefix, endEventName, endAnimationName, vendors = { Webkit: 'webkit', Moz: '', O: 'o', ms: 'MS' }, document = window.document, testEl = document.createElement('div'), supportedTransforms = /^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i, transform, transitionProperty, transitionDuration, transitionTiming, animationName, animationDuration, animationTiming, cssReset = {} function dasherize(str) { return downcase(str.replace(/([a-z])([A-Z])/, '$1-$2')) } function downcase(str) { return str.toLowerCase() } function normalizeEvent(name) { return eventPrefix ? eventPrefix + name : downcase(name) } $.each(vendors, function(vendor, event){ if (testEl.style[vendor + 'TransitionProperty'] !== undefined) { prefix = '-' + downcase(vendor) + '-' eventPrefix = event return false } }) transform = prefix + 'transform' cssReset[transitionProperty = prefix + 'transition-property'] = cssReset[transitionDuration = prefix + 'transition-duration'] = cssReset[transitionTiming = prefix + 'transition-timing-function'] = cssReset[animationName = prefix + 'animation-name'] = cssReset[animationDuration = prefix + 'animation-duration'] = cssReset[animationTiming = prefix + 'animation-timing-function'] = '' $.fx = { off: (eventPrefix === undefined && testEl.style.transitionProperty === undefined), speeds: { _default: 400, fast: 200, slow: 600 }, cssPrefix: prefix, transitionEnd: normalizeEvent('TransitionEnd'), animationEnd: normalizeEvent('AnimationEnd') } $.fn.animate = function(properties, duration, ease, callback){ if ($.isPlainObject(duration)) ease = duration.easing, callback = duration.complete, duration = duration.duration if (duration) duration = (typeof duration == 'number' ? duration : ($.fx.speeds[duration] || $.fx.speeds._default)) / 1000 return this.anim(properties, duration, ease, callback) } $.fn.anim = function(properties, duration, ease, callback){ var key, cssValues = {}, cssProperties, transforms = '', that = this, wrappedCallback, endEvent = $.fx.transitionEnd if (duration === undefined) duration = 0.4 if ($.fx.off) duration = 0 if (typeof properties == 'string') { // keyframe animation cssValues[animationName] = properties cssValues[animationDuration] = duration + 's' cssValues[animationTiming] = (ease || 'linear') endEvent = $.fx.animationEnd } else { cssProperties = [] // CSS transitions for (key in properties) if (supportedTransforms.test(key)) transforms += key + '(' + properties[key] + ') ' else cssValues[key] = properties[key], cssProperties.push(dasherize(key)) if (transforms) cssValues[transform] = transforms, cssProperties.push(transform) if (duration > 0 && typeof properties === 'object') { cssValues[transitionProperty] = cssProperties.join(', ') cssValues[transitionDuration] = duration + 's' cssValues[transitionTiming] = (ease || 'linear') } } wrappedCallback = function(event){ if (typeof event !== 'undefined') { if (event.target !== event.currentTarget) return // makes sure the event didn't bubble from "below" $(event.target).unbind(endEvent, wrappedCallback) } $(this).css(cssReset) callback && callback.call(this) } if (duration > 0) this.bind(endEvent, wrappedCallback) // trigger page reflow so new elements can animate this.size() && this.get(0).clientLeft this.css(cssValues) if (duration <= 0) setTimeout(function() { that.each(function(){ wrappedCallback.call(this) }) }, 0) return this } testEl = null })(Zepto) // Zepto.js // (c) 2010-2012 Thomas Fuchs // Zepto.js may be freely distributed under the MIT license. ;(function($, undefined){ var document = window.document, docElem = document.documentElement, origShow = $.fn.show, origHide = $.fn.hide, origToggle = $.fn.toggle function anim(el, speed, opacity, scale, callback) { if (typeof speed == 'function' && !callback) callback = speed, speed = undefined var props = { opacity: opacity } if (scale) { props.scale = scale el.css($.fx.cssPrefix + 'transform-origin', '0 0') } return el.animate(props, speed, null, callback) } function hide(el, speed, scale, callback) { return anim(el, speed, 0, scale, function(){ origHide.call($(this)) callback && callback.call(this) }) } $.fn.show = function(speed, callback) { origShow.call(this) if (speed === undefined) speed = 0 else this.css('opacity', 0) return anim(this, speed, 1, '1,1', callback) } $.fn.hide = function(speed, callback) { if (speed === undefined) return origHide.call(this) else return hide(this, speed, '0,0', callback) } $.fn.toggle = function(speed, callback) { if (speed === undefined || typeof speed == 'boolean') return origToggle.call(this, speed) else return this.each(function(){ var el = $(this) el[el.css('display') == 'none' ? 'show' : 'hide'](speed, callback) }) } $.fn.fadeTo = function(speed, opacity, callback) { return anim(this, speed, opacity, null, callback) } $.fn.fadeIn = function(speed, callback) { var target = this.css('opacity') if (target > 0) this.css('opacity', 0) else target = 1 return origShow.call(this).fadeTo(speed, target, callback) } $.fn.fadeOut = function(speed, callback) { return hide(this, speed, null, callback) } $.fn.fadeToggle = function(speed, callback) { return this.each(function(){ var el = $(this) el[ (el.css('opacity') == 0 || el.css('display') == 'none') ? 'fadeIn' : 'fadeOut' ](speed, callback) }) } })(Zepto) // Zepto.js // (c) 2010-2012 Thomas Fuchs // Zepto.js may be freely distributed under the MIT license. ;(function($){ var cache = [], timeout $.fn.remove = function(){ return this.each(function(){ if(this.parentNode){ if(this.tagName === 'IMG'){ cache.push(this) this.src = 'data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=' if (timeout) clearTimeout(timeout) timeout = setTimeout(function(){ cache = [] }, 60000) } this.parentNode.removeChild(this) } }) } })(Zepto) // Zepto.js // (c) 2010-2012 Thomas Fuchs // Zepto.js may be freely distributed under the MIT license. // The following code is heavily inspired by jQuery's $.fn.data() ;(function($) { var data = {}, dataAttr = $.fn.data, camelize = $.camelCase, exp = $.expando = 'Zepto' + (+new Date()) // Get value from node: // 1. first try key as given, // 2. then try camelized key, // 3. fall back to reading "data-*" attribute. function getData(node, name) { var id = node[exp], store = id && data[id] if (name === undefined) return store || setData(node) else { if (store) { if (name in store) return store[name] var camelName = camelize(name) if (camelName in store) return store[camelName] } return dataAttr.call($(node), name) } } // Store value under camelized key on node function setData(node, name, value) { var id = node[exp] || (node[exp] = ++$.uuid), store = data[id] || (data[id] = attributeData(node)) if (name !== undefined) store[camelize(name)] = value return store } // Read all "data-*" attributes from a node function attributeData(node) { var store = {} $.each(node.attributes, function(i, attr){ if (attr.name.indexOf('data-') == 0) store[camelize(attr.name.replace('data-', ''))] = $.zepto.deserializeValue(attr.value) }) return store } $.fn.data = function(name, value) { return value === undefined ? // set multiple values via object $.isPlainObject(name) ? this.each(function(i, node){ $.each(name, function(key, value){ setData(node, key, value) }) }) : // get value from first element this.length == 0 ? undefined : getData(this[0], name) : // set value on all elements this.each(function(){ setData(this, name, value) }) } $.fn.removeData = function(names) { if (typeof names == 'string') names = names.split(/\s+/) return this.each(function(){ var id = this[exp], store = id && data[id] if (store) $.each(names, function(){ delete store[camelize(this)] }) }) } })(Zepto) ;(function($){ var zepto = $.zepto, oldQsa = zepto.qsa, oldMatches = zepto.matches function visible(elem){ elem = $(elem) return !!(elem.width() || elem.height()) && elem.css("display") !== "none" } // Implements a subset from: // http://api.jquery.com/category/selectors/jquery-selector-extensions/ // // Each filter function receives the current index, all nodes in the // considered set, and a value if there were parentheses. The value // of `this` is the node currently being considered. The function returns the // resulting node(s), null, or undefined. // // Complex selectors are not supported: // li:has(label:contains("foo")) + li:has(label:contains("bar")) // ul.inner:first > li var filters = $.expr[':'] = { visible: function(){ if (visible(this)) return this }, hidden: function(){ if (!visible(this)) return this }, selected: function(){ if (this.selected) return this }, checked: function(){ if (this.checked) return this }, parent: function(){ return this.parentNode }, first: function(idx){ if (idx === 0) return this }, last: function(idx, nodes){ if (idx === nodes.length - 1) return this }, eq: function(idx, _, value){ if (idx === value) return this }, contains: function(idx, _, text){ if ($(this).text().indexOf(text) > -1) return this }, has: function(idx, _, sel){ if (zepto.qsa(this, sel).length) return this } } var filterRe = new RegExp('(.*):(\\w+)(?:\\(([^)]+)\\))?$\\s*'), childRe = /^\s*>/, classTag = 'Zepto' + (+new Date()) function process(sel, fn) { // quote the hash in `a[href^=#]` expression sel = sel.replace(/=#\]/g, '="#"]') var filter, arg, match = filterRe.exec(sel) if (match && match[2] in filters) { filter = filters[match[2]], arg = match[3] sel = match[1] if (arg) { var num = Number(arg) if (isNaN(num)) arg = arg.replace(/^["']|["']$/g, '') else arg = num } } return fn(sel, filter, arg) } zepto.qsa = function(node, selector) { return process(selector, function(sel, filter, arg){ try { var taggedParent if (!sel && filter) sel = '*' else if (childRe.test(sel)) // support "> *" child queries by tagging the parent node with a // unique class and prepending that classname onto the selector taggedParent = $(node).addClass(classTag), sel = '.'+classTag+' '+sel var nodes = oldQsa(node, sel) } catch(e) { console.error('error performing selector: %o', selector) throw e } finally { if (taggedParent) taggedParent.removeClass(classTag) } return !filter ? nodes : zepto.uniq($.map(nodes, function(n, i){ return filter.call(n, i, nodes, arg) })) }) } zepto.matches = function(node, selector){ return process(selector, function(sel, filter, arg){ return (!sel || oldMatches(node, sel)) && (!filter || filter.call(node, null, arg) === node) }) } })(Zepto) // Zepto.js // (c) 2010-2012 Thomas Fuchs // Zepto.js may be freely distributed under the MIT license. ;(function($){ $.fn.end = function(){ return this.prevObject || $() } $.fn.andSelf = function(){ return this.add(this.prevObject || $()) } 'filter,add,not,eq,first,last,find,closest,parents,parent,children,siblings'.split(',').forEach(function(property){ var fn = $.fn[property] $.fn[property] = function(){ var ret = fn.apply(this, arguments) ret.prevObject = this return ret } }) })(Zepto) // outer and inner height/width support if (this.Zepto) { (function($) { var ioDim, _base; ioDim = function(elem, Dimension, dimension, includeBorder, includeMargin) { var sides, size; if (elem) { size = elem[dimension](); sides = { width: ["left", "right"], height: ["top", "bottom"] }; sides[dimension].forEach(function(side) { size += parseInt(elem.css("padding-" + side), 10); if (includeBorder) { size += parseInt(elem.css("border-" + side + "-width"), 10); } if (includeMargin) { return size += parseInt(elem.css("margin-" + side), 10); } }); return size; } else { return null; } }; ["width", "height"].forEach(function(dimension) { var Dimension, _base, _base1, _name, _name1; Dimension = dimension.replace(/./, function(m) { return m[0].toUpperCase(); }); (_base = $.fn)[_name = "inner" + Dimension] || (_base[_name] = function(includeMargin) { return ioDim(this, Dimension, dimension, false, includeMargin); }); return (_base1 = $.fn)[_name1 = "outer" + Dimension] || (_base1[_name1] = function(includeMargin) { return ioDim(this, Dimension, dimension, true, includeMargin); }); }); return (_base = $.fn).detach || (_base.detach = function(selector) { var cloned, set; set = this; if (selector != null) { set = set.filter(selector); } cloned = set.clone(true); set.remove(); return cloned; }); })(Zepto); }
PypiClean
/hindsight_ubuntu-0.0.3-py3-none-any.whl/hindsight/save.py
# ----------- # SPDX-License-Identifier: MIT # Copyright (c) 2021 Troy Williams # uuid = c3207508-b7ef-11eb-89b8-59b62252b88f # author = Troy Williams # email = [email protected] # date = 2021-05-18 # ----------- """ """ # ------------ # System Modules - Included with Python import sys import logging # ------------ # 3rd Party - From pip import click # ------------ # Custom Modules from .common import run_cmd, write_json # ------------- # Logging # Assign the variable log = logging.getLogger(__name__) # ------------- @click.command("save") @click.option( "--log", is_flag=True, help="Display the list of saved windows to STDOUT." ) @click.pass_context def save(*args, **kwargs): """ # Usage """ # Extract the configuration file from the click context paths = args[0].obj["paths"] # We will use the wmctrl program to save the active window positions # $ sudo apt install wmctrl # to capture the information we will use `$ wmctrl -Gl` # $ man wmctrl, -l: # List the windows being managed by the window manager. One line is output for each window, with the line broken # up into space separated columns. # - The first column always contains the window identity as a hexadecimal integer # - the second column always contains the desktop number (a -1 is used to identify a sticky window) # - If the -p option is specified the next column will contain the PID for the window as a decimal integer # - If the -G option is specified then four integer columns will follow: # - x-offset # - y-offset # - width # - height # - The next column always contains the client machine name. The remainder of the line contains the window title (possibly with multiple spaces in the title). cmd = ["wmctrl", "-lG"] results = run_cmd(cmd) # positions = [p.split()[:6] for p in results] items = [p.split() for p in results] if kwargs["log"]: for p in items: log.info(p) write_json(paths["locations"], items) if kwargs["log"]: log.info(f'Positions saved to {paths["locations"]}...') # NOTE: wmctrl -lG returns x and y in desktop coordinates, we have to multiply by the x and y scale factors to get the correct coordinates.
PypiClean
/blockstore-client-0.0.12.10.tar.gz/blockstore-client-0.0.12.10/blockstore_client/drivers/disk.py
# This module lets the blockstore client treat local disk as a storage provider. # This is useful for doing local testing. import os import sys import traceback DISK_ROOT="/tmp/blockstore-disk" IMMUTABLE_STORAGE_ROOT = DISK_ROOT + "/immutable" MUTABLE_STORAGE_ROOT = DISK_ROOT + "/mutable" DEBUG = False def storage_init(): """ Local disk implementation of the storage_init API call. Do one-time global setup--i.e. make directories. Return True on success Return False on error """ global DISK_ROOT, MUTABLE_STORAGE_ROOT, IMMUTABLE_STORAGE_ROOT if not os.path.isdir( DISK_ROOT ): os.makedirs( DISK_ROOT ) if not os.path.isdir( MUTABLE_STORAGE_ROOT ): os.makedirs( MUTABLE_STORAGE_ROOT ) if not os.path.isdir( IMMUTABLE_STORAGE_ROOT ): os.makedirs( IMMUTABLE_STORAGE_ROOT ) return True def make_mutable_url( data_id ): """ Local disk implementation of the make_mutable_url API call. Given the ID of the data, generate a URL that can be used to route reads and writes to the data. Return a string. """ global MUTABLE_STORAGE_ROOT # replace all /'s with \x2f's data_id_noslash = data_id.replace( "/", r"\x2f" ) return "file://%s/%s" % (MUTABLE_STORAGE_ROOT, data_id_noslash) def get_immutable_handler( key ): """ Local disk implementation of the get_immutable_handler API call. Given the hash of the data, return the data. Return None if not found. """ global IMMUTABLE_STORAGE_ROOT data = None path = os.path.join( IMMUTABLE_STORAGE_ROOT, key ) try: with open( path, "r" ) as f: data = f.read() return data except Exception, e: if DEBUG: traceback.print_exc() return None def get_mutable_handler( url ): """ Local disk implementation of the get_mutable_handler API call. Given a route URL to data, return the data itself. If we can't handle this URL, raise UnhandledURLException. Return the data if found. Return None if not. """ global MUTABLE_STORAGE_ROOT if not url.startswith( "file://" ): # invalid return None # get path from URL path = url[ len("file://"): ] try: with open( path, "r" ) as f: data = f.read() return data except Exception, e: if DEBUG: traceback.print_exc() return None def put_immutable_handler( key, data, txid ): """ Local disk implmentation of the put_immutable_handler API call. Given the hash of the data (key), the serialized data itself, and the transaction ID in the blockchain that contains the data's hash, put the data into the storage system. Return True on success; False on failure. """ global IMMUTABLE_STORAGE_ROOT path = os.path.join( IMMUTABLE_STORAGE_ROOT, key ) try: with open( path, "w+") as f: f.write( data ) except Exception, e: if DEBUG: traceback.print_exc() return False return True def put_mutable_handler( data_id, nonce, signature, data_json ): """ Local disk implementation of the put_mutable_handler API call. Given the the unchanging ID for the data, a nonce representing this version of the data, the writer's signature over hash(data_id + data + nonce), and the serialized JSON representing all of the above plus the data, put the serialized JSON into storage. Return True on success; False on failure. """ global MUTABLE_STORAGE_ROOT # replace all /'s with \x2f's data_id_noslash = data_id.replace( "/", r"\x2f" ) path = os.path.join( MUTABLE_STORAGE_ROOT, data_id_noslash ) with open( path, "w+" ) as f: f.write( data_json ) return True def delete_immutable_handler( key, txid ): """ Local disk implementation of the delete_immutable_handler API call. Given the hash of the data and transaction ID of the update that deleted the data, remove data from storage. Return True on success; False if not. """ global IMMUTABLE_STORAGE_ROOT path = os.path.join( IMMUTABLE_STORAGE_ROOT, key ) try: os.unlink( path ) except Exception, e: pass return True def delete_mutable_handler( data_id, signature ): """ Local disk implementation of the delete_mutable_handler API call. Given the unchanging data ID for the data and the writer's signature over the hash of the data_id, remove data from storage. Return True on success; False if not. """ global MUTABLE_STORAGE_ROOT data_id_noslash = data_id.replace( "/", r"\x2f" ) path = os.path.join( MUTABLE_STORAGE_ROOT, data_id_noslash ) try: os.unlink( path ) except Exception, e: pass return True if __name__ == "__main__": """ Unit tests. """ import pybitcoin import json # hack around absolute paths current_dir = os.path.abspath(os.path.dirname(__file__)) sys.path.insert(0, current_dir) current_dir = os.path.abspath(os.path.join( os.path.dirname(__file__), "..") ) sys.path.insert(0, current_dir) from parsing import json_stable_serialize from storage import mutable_data_parse, mutable_data test_data = [ ["my_first_datum", "hello world", 1, "unused", None], ["/my/second/datum", "hello world 2", 2, "unused", None], ["user_profile", '{"name":{"formatted":"judecn"},"v":"2"}', 3, "unused", None], ["empty_string", "", 4, "unused", None], ] def hash_data( d ): return pybitcoin.hash.hex_hash160( d ) rc = storage_init() if not rc: raise Exception("Failed to initialize") # put_immutable_handler print "put_immutable_handler" for i in xrange(0, len(test_data)): d_id, d, n, s, url = test_data[i] rc = put_immutable_handler( hash_data( d ), d, "unused" ) if not rc: raise Exception("put_immutable_handler('%s') failed" % d) # put_mutable_handler print "put_mutable_handler" for i in xrange(0, len(test_data)): d_id, d, n, s, url = test_data[i] data_url = make_mutable_url( d_id ) data = mutable_data( d_id, d, n, sig=s ) data_json = json_stable_serialize( data ) rc = put_mutable_handler( d_id, n, "unused", data_json ) if not rc: raise Exception("put_mutable_handler('%s', '%s') failed" % (d_id, d)) test_data[i][4] = data_url # get_immutable_handler print "get_immutable_handler" for i in xrange(0, len(test_data)): d_id, d, n, s, url = test_data[i] rd = get_immutable_handler( hash_data( d ) ) if rd != d: raise Exception("get_mutable_handler('%s'): '%s' != '%s'" % (hash_data(d), d, rd)) # get_mutable_handler print "get_mutable_handler" for i in xrange(0, len(test_data)): d_id, d, n, s, url = test_data[i] rd_json = get_mutable_handler( url ) rd = mutable_data_parse( rd_json ) if rd is None: raise Exception("Failed to parse mutable data '%s'" % rd_json) if rd['id'] != d_id: raise Exception("Data ID mismatch: '%s' != '%s'" % (rd['id'], d_id)) if rd['nonce'] != n: raise Exception("Nonce mismatch: '%s' != '%s'" % (rd['nonce'], n)) if rd['data'] != d: raise Exception("Data mismatch: '%s' != '%s'" % (rd['data'], d)) # delete_immutable_handler print "delete_immutable_handler" for i in xrange(0, len(test_data)): d_id, d, n, s, url = test_data[i] rc = delete_immutable_handler( hash_data(d), "unused" ) if not rc: raise Exception("delete_immutable_handler('%s' (%s)) failed" % (hash_data(d), d)) # delete_mutable_handler print "delete_mutable_handler" for i in xrange(0, len(test_data)): d_id, d, n, s, url = test_data[i] rc = delete_mutable_handler( d_id, "unused" ) if not rc: raise Exception("delete_mutable_handler('%s') failed" % d_id)
PypiClean
/Cibyl-1.0.0.0rc1.tar.gz/Cibyl-1.0.0.0rc1/docs/source/development/output.rst
Output ====== To see an overview of cibyl output from a user's perspective see the `output page <../output.html>`_. From a developer's perspective there are three objects that are involved in printing the output, which are summarized in the diagram below. .. image:: ../images/cibyl_printing.png :align: center First, the `Orchestrator` processes the query and creates a `Publisher` to handle the output creation. There are two kinds of publishers: the `PrintPublisher`, which prints human-readeable text and the `JSONPublisher` that prints JSON output. The main difference is that the PrintPublisher prints the output for each system after each environment is queried, while the JSONPublisher prints the output after all environment are queried. To produce valid json, all the output needs to be aggregated into a single object, but when printing human-readeable text, producing output after each environment is queried gives faster feedback to the user. To produce the output, the Publisher creates a `Printer` object. Cibyl has a `Printer` abstract class that is specialized. The used printer is typically called `CI*Printer`. The `CI` prefix is used because the class implements the interface defined by the ``CIPrinter`` class. The interface mandates the implementation of a `print_environment` method. This method takes an environment object and produces a string representation of its contents. There are several Printer classes in cibyl, specialized depending on the output format and the contents. For example, for printing colored output, the hierarchy shown in the diagram below is established. .. image:: ../images/colored_printer.png :align: center The class `CIColoredPrinter` is the Printer that is used for colored text and it will produce a string representation for all core models. While producing the output, the printer creates a `CISystemPrinter` object, which is specialized depending on which kind of system (zuul or jenkins) is being processed. The system printer is the object that will go through the whole model hierarchy, starting at the system level, and complete the output string. As an aside, the `ColoredPrinter` class takes as argument a `Palette` object. Using a `DefaultPalette` will produce colored output, while using a `ClearText` palette will produce plain text ( which is the result of passing the flag `-f text` to cibyl). For serialized text (json being the main example), there is another set of classes that provide the funcionality, as shown in the diagram below: .. image:: ../images/serialized_printer.png In this case, we have a generic `CISerializedPrinter` that can be specialized depending on the output format. Currently only a JSON implementation is available, but through the use of a different `SerializationProvider`, a YAML or XML implementation could be easily created. For json output, the printer would be the `CIJSONPrinter`, which would again have some type of `CISystemPrinter`. In this case it would be either a `JSONBaseSystemPrinter`, a `JSONJobsSystemPrinter` or a `JSONZuulSystemPrinter`. As can be seen in the diagram, these three classes are extensions of the `SerializedBaseSystemPrinter`, `SerializedJobsSystemPrinter` and `SerializedZuulSystemPrinter`, respectively. The printers explained above deal with the core models. If the query involved any funcionality or models provided by a plugin, then the plugin own printer must be also called. Plugins must create their own printers by inheriting from the `PluginPrinterTemplate` abstract class. We will ilustrate this relationship using the openstack plugin as an example: .. image:: ../images/osp_printer.png :align: center The openstack plugin introduces a `PrinterRouter` class which implements the `PluginPrinterTemplate` requirements (an `as_text` and an `as_json` method). Then, the plugin introduces two printers: `OSJSONPrinter` and `OSColoredPrinter` for json and human-readeable output. When producing the output, the system printers explained above will call the `as_text` or `as_json` method from the appropiate openstack printer and will get the correct string representation for the plugin-specific models found in the query.
PypiClean