body
stringlengths
26
98.2k
body_hash
int64
-9,222,864,604,528,158,000
9,221,803,474B
docstring
stringlengths
1
16.8k
path
stringlengths
5
230
name
stringlengths
1
96
repository_name
stringlengths
7
89
lang
stringclasses
1 value
body_without_docstring
stringlengths
20
98.2k
def locate(): 'Locate the image file/index if decode fails.' if (self.seq is not None): idx = self.seq[((self.cur % self.num_image) - 1)] else: idx = ((self.cur % self.num_image) - 1) if (self.imglist is not None): (_, fname) = self.imglist[idx] msg = 'filename: {}'.forma...
6,663,479,313,187,464,000
Locate the image file/index if decode fails.
python/mxnet/image/image.py
locate
Vikas89/private-mxnet
python
def locate(): if (self.seq is not None): idx = self.seq[((self.cur % self.num_image) - 1)] else: idx = ((self.cur % self.num_image) - 1) if (self.imglist is not None): (_, fname) = self.imglist[idx] msg = 'filename: {}'.format(fname) else: msg = 'index: {}'.f...
def testV1beta1CPUTargetUtilization(self): '\n Test V1beta1CPUTargetUtilization\n ' model = openshift.client.models.v1beta1_cpu_target_utilization.V1beta1CPUTargetUtilization()
-8,290,292,325,380,832,000
Test V1beta1CPUTargetUtilization
openshift/test/test_v1beta1_cpu_target_utilization.py
testV1beta1CPUTargetUtilization
flaper87/openshift-restclient-python
python
def testV1beta1CPUTargetUtilization(self): '\n \n ' model = openshift.client.models.v1beta1_cpu_target_utilization.V1beta1CPUTargetUtilization()
def gen_base_anchors(self): 'Generate base anchors.\n\n Returns:\n list(torch.Tensor): Base anchors of a feature grid in multiple feature levels.\n ' multi_level_base_anchors = [] for (i, base_size) in enumerate(self.base_sizes): base_anchors = self.gen_singl...
-7,490,404,798,596,648,000
Generate base anchors. Returns: list(torch.Tensor): Base anchors of a feature grid in multiple feature levels.
xmmdet/core/anchor/anchor_generator.py
gen_base_anchors
www516717402/edgeai-mmdetection
python
def gen_base_anchors(self): 'Generate base anchors.\n\n Returns:\n list(torch.Tensor): Base anchors of a feature grid in multiple feature levels.\n ' multi_level_base_anchors = [] for (i, base_size) in enumerate(self.base_sizes): base_anchors = self.gen_singl...
def __repr__(self): 'str: a string that describes the module' indent_str = ' ' repr_str = (self.__class__.__name__ + '(\n') repr_str += f'''{indent_str}strides={self.strides}, ''' repr_str += f'''{indent_str}scales={self.scales}, ''' repr_str += f'''{indent_str}scale_major={self.scale_major},...
1,996,265,108,211,176,700
str: a string that describes the module
xmmdet/core/anchor/anchor_generator.py
__repr__
www516717402/edgeai-mmdetection
python
def __repr__(self): indent_str = ' ' repr_str = (self.__class__.__name__ + '(\n') repr_str += f'{indent_str}strides={self.strides}, ' repr_str += f'{indent_str}scales={self.scales}, ' repr_str += f'{indent_str}scale_major={self.scale_major}, ' repr_str += f'{indent_str}input_size={self.i...
def __init__(self, simulator): 'Instantiate a Display (thas is: a window with a display widget and\n simulation controls) from a simulator.\n\n :param simulator: The simulator to use.' self.simulator = simulator if (not self.display): if ('tiles' in self.simulator.palette_info): ...
1,797,124,596,122,620,200
Instantiate a Display (thas is: a window with a display widget and simulation controls) from a simulator. :param simulator: The simulator to use.
zasim/gui/display.py
__init__
timo/zasim
python
def __init__(self, simulator): 'Instantiate a Display (thas is: a window with a display widget and\n simulation controls) from a simulator.\n\n :param simulator: The simulator to use.' self.simulator = simulator if (not self.display): if ('tiles' in self.simulator.palette_info): ...
def set_scale(self, scale): 'Sets the scale of the display component.' self.display.set_scale(scale)
-6,195,129,771,046,029,000
Sets the scale of the display component.
zasim/gui/display.py
set_scale
timo/zasim
python
def set_scale(self, scale): self.display.set_scale(scale)
def resize_images_3d(x, output_shape): 'Resize images to the given shape.\n This function resizes 3D data to :obj:`output_shape`.\n Currently, only bilinear interpolation is supported as the sampling method.\n Notatition: here is a notation for dimensionalities.\n - :math:`n` is the batch size.\n - :...
-1,313,251,346,635,617,300
Resize images to the given shape. This function resizes 3D data to :obj:`output_shape`. Currently, only bilinear interpolation is supported as the sampling method. Notatition: here is a notation for dimensionalities. - :math:`n` is the batch size. - :math:`c_I` is the number of the input channels. - :math:`h`, :math:`w...
src/links/model/resize_images_3d.py
resize_images_3d
pfnet-research/label-efficient-brain-tumor-segmentation
python
def resize_images_3d(x, output_shape): 'Resize images to the given shape.\n This function resizes 3D data to :obj:`output_shape`.\n Currently, only bilinear interpolation is supported as the sampling method.\n Notatition: here is a notation for dimensionalities.\n - :math:`n` is the batch size.\n - :...
def server_extensions_handshake(requested: List[str], supported: List[Extension]) -> Optional[bytes]: 'Agree on the extensions to use returning an appropriate header value.\n\n This returns None if there are no agreed extensions\n ' accepts: Dict[(str, Union[(bool, bytes)])] = {} for offer in requeste...
-5,065,775,016,215,352,000
Agree on the extensions to use returning an appropriate header value. This returns None if there are no agreed extensions
wsproto/handshake.py
server_extensions_handshake
bluetech/wsproto
python
def server_extensions_handshake(requested: List[str], supported: List[Extension]) -> Optional[bytes]: 'Agree on the extensions to use returning an appropriate header value.\n\n This returns None if there are no agreed extensions\n ' accepts: Dict[(str, Union[(bool, bytes)])] = {} for offer in requeste...
@property def connection(self) -> Optional[Connection]: 'Return the established connection.\n\n This will either return the connection or raise a\n LocalProtocolError if the connection has not yet been\n established.\n\n :rtype: h11.Connection\n ' return self._connection
-79,934,593,187,587,360
Return the established connection. This will either return the connection or raise a LocalProtocolError if the connection has not yet been established. :rtype: h11.Connection
wsproto/handshake.py
connection
bluetech/wsproto
python
@property def connection(self) -> Optional[Connection]: 'Return the established connection.\n\n This will either return the connection or raise a\n LocalProtocolError if the connection has not yet been\n established.\n\n :rtype: h11.Connection\n ' return self._connection
def initiate_upgrade_connection(self, headers: Headers, path: str) -> None: 'Initiate an upgrade connection.\n\n This should be used if the request has already be received and\n parsed.\n\n :param list headers: HTTP headers represented as a list of 2-tuples.\n :param str path: A URL path...
-7,749,412,552,793,166,000
Initiate an upgrade connection. This should be used if the request has already be received and parsed. :param list headers: HTTP headers represented as a list of 2-tuples. :param str path: A URL path.
wsproto/handshake.py
initiate_upgrade_connection
bluetech/wsproto
python
def initiate_upgrade_connection(self, headers: Headers, path: str) -> None: 'Initiate an upgrade connection.\n\n This should be used if the request has already be received and\n parsed.\n\n :param list headers: HTTP headers represented as a list of 2-tuples.\n :param str path: A URL path...
def send(self, event: Event) -> bytes: 'Send an event to the remote.\n\n This will return the bytes to send based on the event or raise\n a LocalProtocolError if the event is not valid given the\n state.\n\n :returns: Data to send to the WebSocket peer.\n :rtype: bytes\n ' ...
-7,001,928,548,610,590,000
Send an event to the remote. This will return the bytes to send based on the event or raise a LocalProtocolError if the event is not valid given the state. :returns: Data to send to the WebSocket peer. :rtype: bytes
wsproto/handshake.py
send
bluetech/wsproto
python
def send(self, event: Event) -> bytes: 'Send an event to the remote.\n\n This will return the bytes to send based on the event or raise\n a LocalProtocolError if the event is not valid given the\n state.\n\n :returns: Data to send to the WebSocket peer.\n :rtype: bytes\n ' ...
def receive_data(self, data: bytes) -> None: 'Receive data from the remote.\n\n A list of events that the remote peer triggered by sending\n this data can be retrieved with :meth:`events`.\n\n :param bytes data: Data received from the WebSocket peer.\n ' self._h11_connection.receive_...
8,708,793,808,222,445,000
Receive data from the remote. A list of events that the remote peer triggered by sending this data can be retrieved with :meth:`events`. :param bytes data: Data received from the WebSocket peer.
wsproto/handshake.py
receive_data
bluetech/wsproto
python
def receive_data(self, data: bytes) -> None: 'Receive data from the remote.\n\n A list of events that the remote peer triggered by sending\n this data can be retrieved with :meth:`events`.\n\n :param bytes data: Data received from the WebSocket peer.\n ' self._h11_connection.receive_...
def events(self) -> Generator[(Event, None, None)]: 'Return a generator that provides any events that have been generated\n by protocol activity.\n\n :returns: a generator that yields H11 events.\n ' while self._events: (yield self._events.popleft())
-4,374,321,370,451,939,300
Return a generator that provides any events that have been generated by protocol activity. :returns: a generator that yields H11 events.
wsproto/handshake.py
events
bluetech/wsproto
python
def events(self) -> Generator[(Event, None, None)]: 'Return a generator that provides any events that have been generated\n by protocol activity.\n\n :returns: a generator that yields H11 events.\n ' while self._events: (yield self._events.popleft())
def __init__(self, model_name, device='CPU', extensions=None, async_infer=True): '\n Set instance variables.\n ' self.plugin = None self.network = None self.exec_network = None self.infer_request_handle = None self.input_blob = None self.input_shape = None self.output_blob ...
4,609,530,129,871,315,000
Set instance variables.
src/facial_landmarks_detection.py
__init__
ElisaCovato/Computer-pointer-controller---Intel-Edge-AI-Nanodegree
python
def __init__(self, model_name, device='CPU', extensions=None, async_infer=True): '\n \n ' self.plugin = None self.network = None self.exec_network = None self.infer_request_handle = None self.input_blob = None self.input_shape = None self.output_blob = None self.output_...
def load_model(self, plugin): '\n This method is for loading the model (in IR format) to the device specified by the user.\n Default device is CPU.\n ' model_structure = (self.model_name + '.xml') model_weights = (self.model_name + '.bin') self.plugin = plugin if (self.extension...
6,192,489,219,267,985,000
This method is for loading the model (in IR format) to the device specified by the user. Default device is CPU.
src/facial_landmarks_detection.py
load_model
ElisaCovato/Computer-pointer-controller---Intel-Edge-AI-Nanodegree
python
def load_model(self, plugin): '\n This method is for loading the model (in IR format) to the device specified by the user.\n Default device is CPU.\n ' model_structure = (self.model_name + '.xml') model_weights = (self.model_name + '.bin') self.plugin = plugin if (self.extension...
def predict(self, image): '\n This method is meant for running predictions on the input image.\n ' if np.all(np.array(image.shape)): net_input = {self.input_blob: self.preprocess_input(image)} if self.async_infer: self.infer_request_handle = self.exec_network.start_asyn...
-697,507,850,356,550,300
This method is meant for running predictions on the input image.
src/facial_landmarks_detection.py
predict
ElisaCovato/Computer-pointer-controller---Intel-Edge-AI-Nanodegree
python
def predict(self, image): '\n \n ' if np.all(np.array(image.shape)): net_input = {self.input_blob: self.preprocess_input(image)} if self.async_infer: self.infer_request_handle = self.exec_network.start_async(request_id=0, inputs=net_input) if (self.exec_netw...
def check_model(self): '\n This method check whether the model (along with the plugin) is support on the CPU device.\n If anything is missing (such as a CPU extension), let the user know and exit the programm.\n ' supported_layers = self.plugin.query_network(network=self.network, device_nam...
-3,086,004,535,256,337,000
This method check whether the model (along with the plugin) is support on the CPU device. If anything is missing (such as a CPU extension), let the user know and exit the programm.
src/facial_landmarks_detection.py
check_model
ElisaCovato/Computer-pointer-controller---Intel-Edge-AI-Nanodegree
python
def check_model(self): '\n This method check whether the model (along with the plugin) is support on the CPU device.\n If anything is missing (such as a CPU extension), let the user know and exit the programm.\n ' supported_layers = self.plugin.query_network(network=self.network, device_nam...
def preprocess_input(self, image): '\n Method to process inputs before feeding them into the model for inference.\n ' image = cv2.resize(image, (self.input_shape[3], self.input_shape[2])) image = image.transpose((2, 0, 1)) image = image.reshape(1, *image.shape) return image
7,479,949,119,213,668,000
Method to process inputs before feeding them into the model for inference.
src/facial_landmarks_detection.py
preprocess_input
ElisaCovato/Computer-pointer-controller---Intel-Edge-AI-Nanodegree
python
def preprocess_input(self, image): '\n \n ' image = cv2.resize(image, (self.input_shape[3], self.input_shape[2])) image = image.transpose((2, 0, 1)) image = image.reshape(1, *image.shape) return image
def preprocess_output(self, outputs, image): '\n Method to process outputs before feeding them into the next model for\n inference or for the last step of the app.\n ' w = image.shape[1] h = image.shape[0] outputs = outputs[0] (xl, yl) = (int((outputs[0][0][0] * w)), int((output...
-7,138,546,993,679,951,000
Method to process outputs before feeding them into the next model for inference or for the last step of the app.
src/facial_landmarks_detection.py
preprocess_output
ElisaCovato/Computer-pointer-controller---Intel-Edge-AI-Nanodegree
python
def preprocess_output(self, outputs, image): '\n Method to process outputs before feeding them into the next model for\n inference or for the last step of the app.\n ' w = image.shape[1] h = image.shape[0] outputs = outputs[0] (xl, yl) = (int((outputs[0][0][0] * w)), int((output...
def start_reconnect_task(server: StorServer, peer_info_arg: PeerInfo, log, auth: bool): '\n Start a background task that checks connection and reconnects periodically to a peer.\n ' if peer_info_arg.is_valid(): peer_info = peer_info_arg else: peer_info = PeerInfo(socket.gethostbyname(p...
-1,791,811,104,352,758,000
Start a background task that checks connection and reconnects periodically to a peer.
stor/server/reconnect_task.py
start_reconnect_task
Stor-Network/stor-blockchain
python
def start_reconnect_task(server: StorServer, peer_info_arg: PeerInfo, log, auth: bool): '\n \n ' if peer_info_arg.is_valid(): peer_info = peer_info_arg else: peer_info = PeerInfo(socket.gethostbyname(peer_info_arg.host), peer_info_arg.port) async def connection_check(): wh...
def configure(config={}, nested=False, cache=None): "Useful for when you need to control Switchboard's setup." if nested: config = nested_config(config) Settings.init(cache=cache, **config) operator.cache = cache timeout = getattr(settings, 'SWITCHBOARD_TIMEOUT', 10) dburl = settings.SWI...
-2,602,632,946,951,776,000
Useful for when you need to control Switchboard's setup.
switchboard/manager.py
configure
juju/switchboard
python
def configure(config={}, nested=False, cache=None): if nested: config = nested_config(config) Settings.init(cache=cache, **config) operator.cache = cache timeout = getattr(settings, 'SWITCHBOARD_TIMEOUT', 10) dburl = settings.SWITCHBOARD_DBURL if dburl: engine = sqla.create_...
def __getitem__(self, key): '\n Returns a SwitchProxy, rather than a Switch. It allows us to\n easily extend the Switches method and automatically include our\n manager instance.\n ' return SwitchProxy(self, super(SwitchManager, self).__getitem__(key))
1,561,878,215,264,609,300
Returns a SwitchProxy, rather than a Switch. It allows us to easily extend the Switches method and automatically include our manager instance.
switchboard/manager.py
__getitem__
juju/switchboard
python
def __getitem__(self, key): '\n Returns a SwitchProxy, rather than a Switch. It allows us to\n easily extend the Switches method and automatically include our\n manager instance.\n ' return SwitchProxy(self, super(SwitchManager, self).__getitem__(key))
def with_result_cache(func): '\n Decorator specifically for is_active. If self.result_cache is set to a {}\n the is_active results will be cached for each set of params.\n ' def inner(self, *args, **kwargs): dic = self.result_cache cache_key = None if (dic is not N...
-5,442,204,369,891,342,000
Decorator specifically for is_active. If self.result_cache is set to a {} the is_active results will be cached for each set of params.
switchboard/manager.py
with_result_cache
juju/switchboard
python
def with_result_cache(func): '\n Decorator specifically for is_active. If self.result_cache is set to a {}\n the is_active results will be cached for each set of params.\n ' def inner(self, *args, **kwargs): dic = self.result_cache cache_key = None if (dic is not N...
@with_result_cache def is_active(self, key, *instances, **kwargs): "\n Returns ``True`` if any of ``instances`` match an active switch.\n Otherwise returns ``False``.\n\n >>> operator.is_active('my_feature', request) #doctest: +SKIP\n " try: default = kwargs.pop('default', Fa...
4,146,366,985,063,664,600
Returns ``True`` if any of ``instances`` match an active switch. Otherwise returns ``False``. >>> operator.is_active('my_feature', request) #doctest: +SKIP
switchboard/manager.py
is_active
juju/switchboard
python
@with_result_cache def is_active(self, key, *instances, **kwargs): "\n Returns ``True`` if any of ``instances`` match an active switch.\n Otherwise returns ``False``.\n\n >>> operator.is_active('my_feature', request) #doctest: +SKIP\n " try: default = kwargs.pop('default', Fa...
def register(self, condition_set): '\n Registers a condition set with the manager.\n\n >>> condition_set = MyConditionSet() #doctest: +SKIP\n >>> operator.register(condition_set) #doctest: +SKIP\n ' if callable(condition_set): condition_set = condition_set() registry[cond...
-8,700,801,431,450,779,000
Registers a condition set with the manager. >>> condition_set = MyConditionSet() #doctest: +SKIP >>> operator.register(condition_set) #doctest: +SKIP
switchboard/manager.py
register
juju/switchboard
python
def register(self, condition_set): '\n Registers a condition set with the manager.\n\n >>> condition_set = MyConditionSet() #doctest: +SKIP\n >>> operator.register(condition_set) #doctest: +SKIP\n ' if callable(condition_set): condition_set = condition_set() registry[cond...
def unregister(self, condition_set): '\n Unregisters a condition set with the manager.\n\n >>> operator.unregister(condition_set) #doctest: +SKIP\n ' if callable(condition_set): condition_set = condition_set() registry.pop(condition_set.get_id(), None) registry_by_namespace....
-3,110,375,665,669,518,000
Unregisters a condition set with the manager. >>> operator.unregister(condition_set) #doctest: +SKIP
switchboard/manager.py
unregister
juju/switchboard
python
def unregister(self, condition_set): '\n Unregisters a condition set with the manager.\n\n >>> operator.unregister(condition_set) #doctest: +SKIP\n ' if callable(condition_set): condition_set = condition_set() registry.pop(condition_set.get_id(), None) registry_by_namespace....
def get_condition_set_by_id(self, switch_id): '\n Given the identifier of a condition set (described in\n ConditionSet.get_id()), returns the registered instance.\n ' return registry[switch_id]
-4,491,633,507,980,078,000
Given the identifier of a condition set (described in ConditionSet.get_id()), returns the registered instance.
switchboard/manager.py
get_condition_set_by_id
juju/switchboard
python
def get_condition_set_by_id(self, switch_id): '\n Given the identifier of a condition set (described in\n ConditionSet.get_id()), returns the registered instance.\n ' return registry[switch_id]
def get_condition_sets(self): '\n Returns a generator yielding all currently registered\n ConditionSet instances.\n ' return registry.itervalues()
-4,830,379,080,715,123,000
Returns a generator yielding all currently registered ConditionSet instances.
switchboard/manager.py
get_condition_sets
juju/switchboard
python
def get_condition_sets(self): '\n Returns a generator yielding all currently registered\n ConditionSet instances.\n ' return registry.itervalues()
def get_all_conditions(self): '\n Returns a generator which yields groups of lists of conditions.\n\n >>> for set_id, label, field in operator.get_all_conditions(): #doctest: +SKIP\n >>> print "%(label)s: %(field)s" % (label, field.label) #doctest: +SKIP\n ' cs = self.get_conditi...
-4,256,478,779,523,565,000
Returns a generator which yields groups of lists of conditions. >>> for set_id, label, field in operator.get_all_conditions(): #doctest: +SKIP >>> print "%(label)s: %(field)s" % (label, field.label) #doctest: +SKIP
switchboard/manager.py
get_all_conditions
juju/switchboard
python
def get_all_conditions(self): '\n Returns a generator which yields groups of lists of conditions.\n\n >>> for set_id, label, field in operator.get_all_conditions(): #doctest: +SKIP\n >>> print "%(label)s: %(field)s" % (label, field.label) #doctest: +SKIP\n ' cs = self.get_conditi...
def get_output_dir(imdb_name, net_name=None, output_dir='output'): 'Return the directory where experimental artifacts are placed.\n If the directory does not exist, it is created.\n\n A canonical path is built using the name from an imdb and a network\n (if not None).\n ' outdir = osp.abspath(osp.jo...
-8,190,657,062,051,350,000
Return the directory where experimental artifacts are placed. If the directory does not exist, it is created. A canonical path is built using the name from an imdb and a network (if not None).
model/utils/config.py
get_output_dir
Juggernaut93/SSH-pytorch
python
def get_output_dir(imdb_name, net_name=None, output_dir='output'): 'Return the directory where experimental artifacts are placed.\n If the directory does not exist, it is created.\n\n A canonical path is built using the name from an imdb and a network\n (if not None).\n ' outdir = osp.abspath(osp.jo...
def get_output_tb_dir(imdb, weights_filename): 'Return the directory where tensorflow summaries are placed.\n If the directory does not exist, it is created.\n A canonical path is built using the name from an imdb and a network\n (if not None).\n ' outdir = osp.abspath(osp.join(__C.ROOT_DIR, 'tensor...
-5,700,492,455,365,735,000
Return the directory where tensorflow summaries are placed. If the directory does not exist, it is created. A canonical path is built using the name from an imdb and a network (if not None).
model/utils/config.py
get_output_tb_dir
Juggernaut93/SSH-pytorch
python
def get_output_tb_dir(imdb, weights_filename): 'Return the directory where tensorflow summaries are placed.\n If the directory does not exist, it is created.\n A canonical path is built using the name from an imdb and a network\n (if not None).\n ' outdir = osp.abspath(osp.join(__C.ROOT_DIR, 'tensor...
def _merge_a_into_b(a, b): 'Merge config dictionary a into config dictionary b, clobbering the\n options in b whenever they are also specified in a.\n ' if (type(a) is not edict): return for (k, v) in a.items(): if (k not in b): raise KeyError('{} is not a valid config key'...
-7,092,344,095,667,698,000
Merge config dictionary a into config dictionary b, clobbering the options in b whenever they are also specified in a.
model/utils/config.py
_merge_a_into_b
Juggernaut93/SSH-pytorch
python
def _merge_a_into_b(a, b): 'Merge config dictionary a into config dictionary b, clobbering the\n options in b whenever they are also specified in a.\n ' if (type(a) is not edict): return for (k, v) in a.items(): if (k not in b): raise KeyError('{} is not a valid config key'...
def cfg_from_file(filename): 'Load a config file and merge it into the default options.' import yaml with open(filename, 'r') as f: yaml_cfg = edict(yaml.load(f)) _merge_a_into_b(yaml_cfg, __C)
3,048,925,329,488,565,000
Load a config file and merge it into the default options.
model/utils/config.py
cfg_from_file
Juggernaut93/SSH-pytorch
python
def cfg_from_file(filename): import yaml with open(filename, 'r') as f: yaml_cfg = edict(yaml.load(f)) _merge_a_into_b(yaml_cfg, __C)
def cfg_from_list(cfg_list): 'Set config keys via list (e.g., from command line).' from ast import literal_eval assert ((len(cfg_list) % 2) == 0) for (k, v) in zip(cfg_list[0::2], cfg_list[1::2]): key_list = k.split('.') d = __C for subkey in key_list[:(- 1)]: assert ...
1,336,896,622,455,959,300
Set config keys via list (e.g., from command line).
model/utils/config.py
cfg_from_list
Juggernaut93/SSH-pytorch
python
def cfg_from_list(cfg_list): from ast import literal_eval assert ((len(cfg_list) % 2) == 0) for (k, v) in zip(cfg_list[0::2], cfg_list[1::2]): key_list = k.split('.') d = __C for subkey in key_list[:(- 1)]: assert (subkey in d) d = d[subkey] subke...
def configure_output_dir(d=None): '\n Set output directory to d, or to /tmp/somerandomnumber if d is None\n ' G.first_row = True G.log_headers = [] G.log_current_row = {} G.output_dir = (d or ('/tmp/experiments/%i' % int(time.time()))) if (not osp.exists(G.output_dir)): os.makedirs...
4,649,972,137,371,970,000
Set output directory to d, or to /tmp/somerandomnumber if d is None
ADMCode/snuz/ars/logz.py
configure_output_dir
CoAxLab/AdaptiveDecisionMaking_2018
python
def configure_output_dir(d=None): '\n \n ' G.first_row = True G.log_headers = [] G.log_current_row = {} G.output_dir = (d or ('/tmp/experiments/%i' % int(time.time()))) if (not osp.exists(G.output_dir)): os.makedirs(G.output_dir) G.output_file = open(osp.join(G.output_dir, 'log...
def log_tabular(key, val): '\n Log a value of some diagnostic\n Call this once for each diagnostic quantity, each iteration\n ' if G.first_row: G.log_headers.append(key) else: assert (key in G.log_headers), ("Trying to introduce a new key %s that you didn't include in the first iter...
-4,924,882,616,239,801,000
Log a value of some diagnostic Call this once for each diagnostic quantity, each iteration
ADMCode/snuz/ars/logz.py
log_tabular
CoAxLab/AdaptiveDecisionMaking_2018
python
def log_tabular(key, val): '\n Log a value of some diagnostic\n Call this once for each diagnostic quantity, each iteration\n ' if G.first_row: G.log_headers.append(key) else: assert (key in G.log_headers), ("Trying to introduce a new key %s that you didn't include in the first iter...
def dump_tabular(): '\n Write all of the diagnostics from the current iteration\n ' vals = [] key_lens = [len(key) for key in G.log_headers] max_key_len = max(15, max(key_lens)) keystr = ('%' + ('%d' % max_key_len)) fmt = (('| ' + keystr) + 's | %15s |') n_slashes = (22 + max_key_len) ...
2,233,594,333,627,156,700
Write all of the diagnostics from the current iteration
ADMCode/snuz/ars/logz.py
dump_tabular
CoAxLab/AdaptiveDecisionMaking_2018
python
def dump_tabular(): '\n \n ' vals = [] key_lens = [len(key) for key in G.log_headers] max_key_len = max(15, max(key_lens)) keystr = ('%' + ('%d' % max_key_len)) fmt = (('| ' + keystr) + 's | %15s |') n_slashes = (22 + max_key_len) print(('-' * n_slashes)) for key in G.log_heade...
def old_javascript_array(array): "in case the browser doesn't support JSON, and to save some separator bytes" array = list(array) sepChar = ord(' ') chars_used = set(''.join(array)) assert (('"' not in chars_used) and ('\\' not in chars_used) and ('<' not in chars_used) and ('&' not in chars_used)),...
-8,124,362,927,457,646,000
in case the browser doesn't support JSON, and to save some separator bytes
ohi.py
old_javascript_array
ssb22/indexer
python
def old_javascript_array(array): array = list(array) sepChar = ord(' ') chars_used = set(.join(array)) assert (('"' not in chars_used) and ('\\' not in chars_used) and ('<' not in chars_used) and ('&' not in chars_used)), "Can't use special chars (unless you change this code to escape them)" wh...
def htmlDoc(start, end, docNo): 'Returns an HTML document containing fragments[start:end]. docNo is used to generate previous/next page links as appropriate. Caches its return value in case called again with same start,end (in which case docNo is ignored on second call).' global __lastStartEnd, __lastDoc ...
-2,020,903,471,065,346,800
Returns an HTML document containing fragments[start:end]. docNo is used to generate previous/next page links as appropriate. Caches its return value in case called again with same start,end (in which case docNo is ignored on second call).
ohi.py
htmlDoc
ssb22/indexer
python
def htmlDoc(start, end, docNo): global __lastStartEnd, __lastDoc if (not ((start, end) == __lastStartEnd)): __lastStartEnd = (start, end) __lastDoc = (header + js_hashjump((x for (x, y) in fragments[start:end] if x))) if start: assert docNo, 'Document 0 should start at 0...
def findEnd(start, docNo): "Given 'start' (an index into 'fragments'), find an 'end' that produces the largest possible htmlDoc less than max_filesize. docNo is used to generate previous/next page links as appropriate." eTry = (len(fragments) - start) assert eTry, 'must start before the end' sLen = len...
-8,778,858,671,342,789,000
Given 'start' (an index into 'fragments'), find an 'end' that produces the largest possible htmlDoc less than max_filesize. docNo is used to generate previous/next page links as appropriate.
ohi.py
findEnd
ssb22/indexer
python
def findEnd(start, docNo): eTry = (len(fragments) - start) assert eTry, 'must start before the end' sLen = len(htmlDoc(start, (start + eTry), docNo)) if (sLen > max_filesize): eTry = int((eTry / int((sLen / max_filesize)))) while ((eTry > 1) and (len(htmlDoc(start, (start + eTry), d...
def __call__(self, text): 'Find shortest prefix of text that differentiates it from previous item (empty string if no difference)' assert (text >= self.lastText), 'input must have been properly sorted' i = 0 for (c1, c2) in izip((self.lastText + chr(0)), text): i += 1 if (not (c1 == c2))...
-6,722,151,275,927,327,000
Find shortest prefix of text that differentiates it from previous item (empty string if no difference)
ohi.py
__call__
ssb22/indexer
python
def __call__(self, text): assert (text >= self.lastText), 'input must have been properly sorted' i = 0 for (c1, c2) in izip((self.lastText + chr(0)), text): i += 1 if (not (c1 == c2)): self.lastText = text return text[:i] assert (text == self.lastText), ((rep...
def ready(self): 'Override this to put in:\n Users system checks\n Users signal registration\n ' pass
2,586,872,105,737,007,000
Override this to put in: Users system checks Users signal registration
bookstudio/books/apps.py
ready
sudoabhinav/bookstudio
python
def ready(self): 'Override this to put in:\n Users system checks\n Users signal registration\n ' pass
def __call__(self, num_update): 'Return a new learning rate based on number of updates.\n\n Parameters\n ----------\n num_update: nnvm Symbol\n the number of updates applied to weight.\n ' raise NotImplementedError('__call__ method must be overridden.')
5,438,065,671,394,147,000
Return a new learning rate based on number of updates. Parameters ---------- num_update: nnvm Symbol the number of updates applied to weight.
nnvm/python/nnvm/compiler/lr_scheduler.py
__call__
00liujj/tvm
python
def __call__(self, num_update): 'Return a new learning rate based on number of updates.\n\n Parameters\n ----------\n num_update: nnvm Symbol\n the number of updates applied to weight.\n ' raise NotImplementedError('__call__ method must be overridden.')
def grep_core(media_file: str, add_prefix: bool, ffmpeg: FFmpeg, args, log: Log, TEMP: str) -> None: "\n We're using the WEBVTT subtitle format. It's better than srt\n because it doesn't emit line numbers and the time code is in\n (hh:mm:ss.sss) instead of (dd:hh:mm:ss,sss)\n " out_file = os.path.jo...
-825,400,447,666,074,200
We're using the WEBVTT subtitle format. It's better than srt because it doesn't emit line numbers and the time code is in (hh:mm:ss.sss) instead of (dd:hh:mm:ss,sss)
auto_editor/subcommands/grep.py
grep_core
chancat87/auto-editor
python
def grep_core(media_file: str, add_prefix: bool, ffmpeg: FFmpeg, args, log: Log, TEMP: str) -> None: "\n We're using the WEBVTT subtitle format. It's better than srt\n because it doesn't emit line numbers and the time code is in\n (hh:mm:ss.sss) instead of (dd:hh:mm:ss,sss)\n " out_file = os.path.jo...
def absolute_login_url(provider_id, fence_idp=None, shib_idp=None): '\n Args:\n provider_id (str): provider to log in with; an IDP_URL_MAP key.\n fence_idp (str, optional): if provider_id is "fence"\n (multi-tenant Fence setup), fence_idp can be any of the\n providers supporte...
-2,670,125,579,266,269,700
Args: provider_id (str): provider to log in with; an IDP_URL_MAP key. fence_idp (str, optional): if provider_id is "fence" (multi-tenant Fence setup), fence_idp can be any of the providers supported by the other Fence. If not specified, will default to NIH login. shib_idp (str, optio...
fence/blueprints/login/__init__.py
absolute_login_url
chicagopcdc/fence
python
def absolute_login_url(provider_id, fence_idp=None, shib_idp=None): '\n Args:\n provider_id (str): provider to log in with; an IDP_URL_MAP key.\n fence_idp (str, optional): if provider_id is "fence"\n (multi-tenant Fence setup), fence_idp can be any of the\n providers supporte...
def provider_info(login_details): '\n Args:\n login_details (dict):\n { name, desc, idp, fence_idp, shib_idps, secondary }\n - "idp": a configured provider.\n Multiple options can be configured with the same idp.\n - if provider_id is "fence", "fence_idp" can be any of the\n ...
-2,740,890,148,715,159,000
Args: login_details (dict): { name, desc, idp, fence_idp, shib_idps, secondary } - "idp": a configured provider. Multiple options can be configured with the same idp. - if provider_id is "fence", "fence_idp" can be any of the providers supported by the other Fence. If not specified, will def...
fence/blueprints/login/__init__.py
provider_info
chicagopcdc/fence
python
def provider_info(login_details): '\n Args:\n login_details (dict):\n { name, desc, idp, fence_idp, shib_idps, secondary }\n - "idp": a configured provider.\n Multiple options can be configured with the same idp.\n - if provider_id is "fence", "fence_idp" can be any of the\n ...
def make_login_blueprint(): '\n Return:\n flask.Blueprint: the blueprint used for ``/login`` endpoints\n\n Raises:\n ValueError: if app is not amenably configured\n ' blueprint = flask.Blueprint('login', __name__) blueprint_api = RestfulApi(blueprint, decorators=[enable_audit_logging]...
5,273,018,673,974,718,000
Return: flask.Blueprint: the blueprint used for ``/login`` endpoints Raises: ValueError: if app is not amenably configured
fence/blueprints/login/__init__.py
make_login_blueprint
chicagopcdc/fence
python
def make_login_blueprint(): '\n Return:\n flask.Blueprint: the blueprint used for ``/login`` endpoints\n\n Raises:\n ValueError: if app is not amenably configured\n ' blueprint = flask.Blueprint('login', __name__) blueprint_api = RestfulApi(blueprint, decorators=[enable_audit_logging]...
def get_all_shib_idps(): '\n Get the list of all existing Shibboleth IDPs.\n This function only returns the information we need to generate login URLs.\n\n Returns:\n list: list of {"idp": "", "name": ""} dictionaries\n ' url = config['OPENID_CONNECT'].get('fence', {}).get('shibboleth_discove...
-9,166,596,299,316,049,000
Get the list of all existing Shibboleth IDPs. This function only returns the information we need to generate login URLs. Returns: list: list of {"idp": "", "name": ""} dictionaries
fence/blueprints/login/__init__.py
get_all_shib_idps
chicagopcdc/fence
python
def get_all_shib_idps(): '\n Get the list of all existing Shibboleth IDPs.\n This function only returns the information we need to generate login URLs.\n\n Returns:\n list: list of {"idp": , "name": } dictionaries\n ' url = config['OPENID_CONNECT'].get('fence', {}).get('shibboleth_discovery_u...
def get_shib_idp_en_name(names): '\n Returns a name in English for a Shibboleth IDP, or the first available\n name if no English name was provided.\n\n Args:\n names (list): list of {"lang": "", "value": ""} dictionaries\n Example:\n [\n {\n "v...
48,967,702,506,096,370
Returns a name in English for a Shibboleth IDP, or the first available name if no English name was provided. Args: names (list): list of {"lang": "", "value": ""} dictionaries Example: [ { "value": "University of Chicago", "lang": "en" }, ...
fence/blueprints/login/__init__.py
get_shib_idp_en_name
chicagopcdc/fence
python
def get_shib_idp_en_name(names): '\n Returns a name in English for a Shibboleth IDP, or the first available\n name if no English name was provided.\n\n Args:\n names (list): list of {"lang": , "value": } dictionaries\n Example:\n [\n {\n "value...
@blueprint.route('', methods=['GET']) def default_login(): '\n The default root login route.\n ' (default_provider_info, all_provider_info) = get_login_providers_info() return flask.jsonify({'default_provider': default_provider_info, 'providers': all_provider_info})
3,493,305,278,892,696,000
The default root login route.
fence/blueprints/login/__init__.py
default_login
chicagopcdc/fence
python
@blueprint.route(, methods=['GET']) def default_login(): '\n \n ' (default_provider_info, all_provider_info) = get_login_providers_info() return flask.jsonify({'default_provider': default_provider_info, 'providers': all_provider_info})
def _split_path(path): ' Split a path into a list of directory names ' if (path[0] != '/'): raise Exception('Not absolute path') result = [] while (path != '/'): (path, tail) = os.path.split(path) if tail: result.append(tail) return list(reversed(result))
984,756,720,676,671,400
Split a path into a list of directory names
src/xrootd_cache_stats.py
_split_path
ivukotic/xcache
python
def _split_path(path): ' ' if (path[0] != '/'): raise Exception('Not absolute path') result = [] while (path != '/'): (path, tail) = os.path.split(path) if tail: result.append(tail) return list(reversed(result))
def _is_prefix(lhs, rhs): ' return True if the first list is a prefix of the second ' rhs = list(rhs) while rhs: if (lhs == rhs): return True rhs.pop() return False
3,350,491,932,785,587,700
return True if the first list is a prefix of the second
src/xrootd_cache_stats.py
_is_prefix
ivukotic/xcache
python
def _is_prefix(lhs, rhs): ' ' rhs = list(rhs) while rhs: if (lhs == rhs): return True rhs.pop() return False
def scan_cache_dirs(rootdir): ' Scan the top level directory of the cache.\n Walks the path looking for directories that are not in vo_paths.\n For each of these generate a cache summary\n ' results = {} try: root_components = _split_path(rootdir) for (dirpath, dirnames, filenames) ...
-5,469,963,317,324,711,000
Scan the top level directory of the cache. Walks the path looking for directories that are not in vo_paths. For each of these generate a cache summary
src/xrootd_cache_stats.py
scan_cache_dirs
ivukotic/xcache
python
def scan_cache_dirs(rootdir): ' Scan the top level directory of the cache.\n Walks the path looking for directories that are not in vo_paths.\n For each of these generate a cache summary\n ' results = {} try: root_components = _split_path(rootdir) for (dirpath, dirnames, filenames) ...
def scan_vo_dir(vodir): ' Scan a VO directory (assumed to be the whole directory tree after the top level ' now = time.time() totalsize = 0 nfiles = 0 naccesses = 0 accesses = collections.defaultdict(int) most_recent_access = 0 bad_cinfo_files = 0 for (root, dirs, files) in os.walk(v...
8,486,517,527,046,751,000
Scan a VO directory (assumed to be the whole directory tree after the top level
src/xrootd_cache_stats.py
scan_vo_dir
ivukotic/xcache
python
def scan_vo_dir(vodir): ' ' now = time.time() totalsize = 0 nfiles = 0 naccesses = 0 accesses = collections.defaultdict(int) most_recent_access = 0 bad_cinfo_files = 0 for (root, dirs, files) in os.walk(vodir): fnames = set(files) for (f, cinfo) in ((f, (f + '.cinfo'...
def read_cinfo(cinfo_file, now): ' Try to extract useful info from the cinfo file ' result = {'naccesses': 0, 'last_access': 0, 'by_hour': {'01': 0, '12': 0, '24': 0}, 'bytes_hr': {'01': 0, '12': 0, '24': 0}} cf = open(cinfo_file, 'rb') buf = cf.read(_header_fmt_size) if (len(buf) < _header_fmt_size...
-835,176,595,427,975,000
Try to extract useful info from the cinfo file
src/xrootd_cache_stats.py
read_cinfo
ivukotic/xcache
python
def read_cinfo(cinfo_file, now): ' ' result = {'naccesses': 0, 'last_access': 0, 'by_hour': {'01': 0, '12': 0, '24': 0}, 'bytes_hr': {'01': 0, '12': 0, '24': 0}} cf = open(cinfo_file, 'rb') buf = cf.read(_header_fmt_size) if (len(buf) < _header_fmt_size): raise ReadCInfoError(('%s header to...
def test_xrootd_server(url): " Contact the xrootd server to check if it's alive\n " try: myclient = XRootD.client.FileSystem(url) startt = time.time() (response, _) = myclient.ping(timeout=10) elapsed = (time.time() - startt) if response.fatal: status = 'fa...
3,086,439,373,156,683,000
Contact the xrootd server to check if it's alive
src/xrootd_cache_stats.py
test_xrootd_server
ivukotic/xcache
python
def test_xrootd_server(url): " \n " try: myclient = XRootD.client.FileSystem(url) startt = time.time() (response, _) = myclient.ping(timeout=10) elapsed = (time.time() - startt) if response.fatal: status = 'fatal' elif response.error: st...
def get_cache_info(rootdir, cache_max_fs_fraction): 'Get information about the cache itself' result = {} try: stat = os.statvfs(rootdir) total_size = int(((stat.f_blocks * stat.f_bsize) * cache_max_fs_fraction)) free_size = int((total_size - ((stat.f_blocks - stat.f_bfree) * stat.f_b...
-1,475,640,488,449,280,000
Get information about the cache itself
src/xrootd_cache_stats.py
get_cache_info
ivukotic/xcache
python
def get_cache_info(rootdir, cache_max_fs_fraction): result = {} try: stat = os.statvfs(rootdir) total_size = int(((stat.f_blocks * stat.f_bsize) * cache_max_fs_fraction)) free_size = int((total_size - ((stat.f_blocks - stat.f_bfree) * stat.f_bsize))) result['total_cache_byte...
def collect_cache_stats(url, rootdir, cache_max_fs_fraction=1.0): ' Collect stats on the cache server ' start_time = time.time() parsed_url = urllib.parse.urlparse(url) try: if (parsed_url.scheme not in ('root', 'xroot')): raise Exception(("URL '%s' is not an xrootd url" % url)) ...
-6,529,351,487,603,837,000
Collect stats on the cache server
src/xrootd_cache_stats.py
collect_cache_stats
ivukotic/xcache
python
def collect_cache_stats(url, rootdir, cache_max_fs_fraction=1.0): ' ' start_time = time.time() parsed_url = urllib.parse.urlparse(url) try: if (parsed_url.scheme not in ('root', 'xroot')): raise Exception(("URL '%s' is not an xrootd url" % url)) hostname = parsed_url.netloc ...
def __init__(__self__, *, resource_group_name: pulumi.Input[str], address_space: Optional[pulumi.Input['AddressSpaceArgs']]=None, bgp_properties: Optional[pulumi.Input['BgpSettingsArgs']]=None, device_properties: Optional[pulumi.Input['DevicePropertiesArgs']]=None, id: Optional[pulumi.Input[str]]=None, ip_address: Opti...
6,120,896,590,403,586,000
The set of arguments for constructing a VpnSite resource. :param pulumi.Input[str] resource_group_name: The resource group name of the VpnSite. :param pulumi.Input['AddressSpaceArgs'] address_space: The AddressSpace that contains an array of IP address ranges. :param pulumi.Input['BgpSettingsArgs'] bgp_properties: The ...
sdk/python/pulumi_azure_native/network/v20200301/vpn_site.py
__init__
sebtelko/pulumi-azure-native
python
def __init__(__self__, *, resource_group_name: pulumi.Input[str], address_space: Optional[pulumi.Input['AddressSpaceArgs']]=None, bgp_properties: Optional[pulumi.Input['BgpSettingsArgs']]=None, device_properties: Optional[pulumi.Input['DevicePropertiesArgs']]=None, id: Optional[pulumi.Input[str]]=None, ip_address: Opti...
@property @pulumi.getter(name='resourceGroupName') def resource_group_name(self) -> pulumi.Input[str]: '\n The resource group name of the VpnSite.\n ' return pulumi.get(self, 'resource_group_name')
8,317,305,569,743,092,000
The resource group name of the VpnSite.
sdk/python/pulumi_azure_native/network/v20200301/vpn_site.py
resource_group_name
sebtelko/pulumi-azure-native
python
@property @pulumi.getter(name='resourceGroupName') def resource_group_name(self) -> pulumi.Input[str]: '\n \n ' return pulumi.get(self, 'resource_group_name')
@property @pulumi.getter(name='addressSpace') def address_space(self) -> Optional[pulumi.Input['AddressSpaceArgs']]: '\n The AddressSpace that contains an array of IP address ranges.\n ' return pulumi.get(self, 'address_space')
2,101,335,417,336,896,000
The AddressSpace that contains an array of IP address ranges.
sdk/python/pulumi_azure_native/network/v20200301/vpn_site.py
address_space
sebtelko/pulumi-azure-native
python
@property @pulumi.getter(name='addressSpace') def address_space(self) -> Optional[pulumi.Input['AddressSpaceArgs']]: '\n \n ' return pulumi.get(self, 'address_space')
@property @pulumi.getter(name='bgpProperties') def bgp_properties(self) -> Optional[pulumi.Input['BgpSettingsArgs']]: '\n The set of bgp properties.\n ' return pulumi.get(self, 'bgp_properties')
-3,046,225,807,278,165,500
The set of bgp properties.
sdk/python/pulumi_azure_native/network/v20200301/vpn_site.py
bgp_properties
sebtelko/pulumi-azure-native
python
@property @pulumi.getter(name='bgpProperties') def bgp_properties(self) -> Optional[pulumi.Input['BgpSettingsArgs']]: '\n \n ' return pulumi.get(self, 'bgp_properties')
@property @pulumi.getter(name='deviceProperties') def device_properties(self) -> Optional[pulumi.Input['DevicePropertiesArgs']]: '\n The device properties.\n ' return pulumi.get(self, 'device_properties')
7,089,106,565,800,478,000
The device properties.
sdk/python/pulumi_azure_native/network/v20200301/vpn_site.py
device_properties
sebtelko/pulumi-azure-native
python
@property @pulumi.getter(name='deviceProperties') def device_properties(self) -> Optional[pulumi.Input['DevicePropertiesArgs']]: '\n \n ' return pulumi.get(self, 'device_properties')
@property @pulumi.getter def id(self) -> Optional[pulumi.Input[str]]: '\n Resource ID.\n ' return pulumi.get(self, 'id')
4,003,078,074,025,280,500
Resource ID.
sdk/python/pulumi_azure_native/network/v20200301/vpn_site.py
id
sebtelko/pulumi-azure-native
python
@property @pulumi.getter def id(self) -> Optional[pulumi.Input[str]]: '\n \n ' return pulumi.get(self, 'id')
@property @pulumi.getter(name='ipAddress') def ip_address(self) -> Optional[pulumi.Input[str]]: '\n The ip-address for the vpn-site.\n ' return pulumi.get(self, 'ip_address')
3,874,535,099,923,703,300
The ip-address for the vpn-site.
sdk/python/pulumi_azure_native/network/v20200301/vpn_site.py
ip_address
sebtelko/pulumi-azure-native
python
@property @pulumi.getter(name='ipAddress') def ip_address(self) -> Optional[pulumi.Input[str]]: '\n \n ' return pulumi.get(self, 'ip_address')
@property @pulumi.getter(name='isSecuritySite') def is_security_site(self) -> Optional[pulumi.Input[bool]]: '\n IsSecuritySite flag.\n ' return pulumi.get(self, 'is_security_site')
-4,221,913,758,271,601,700
IsSecuritySite flag.
sdk/python/pulumi_azure_native/network/v20200301/vpn_site.py
is_security_site
sebtelko/pulumi-azure-native
python
@property @pulumi.getter(name='isSecuritySite') def is_security_site(self) -> Optional[pulumi.Input[bool]]: '\n \n ' return pulumi.get(self, 'is_security_site')
@property @pulumi.getter def location(self) -> Optional[pulumi.Input[str]]: '\n Resource location.\n ' return pulumi.get(self, 'location')
5,685,883,695,381,965,000
Resource location.
sdk/python/pulumi_azure_native/network/v20200301/vpn_site.py
location
sebtelko/pulumi-azure-native
python
@property @pulumi.getter def location(self) -> Optional[pulumi.Input[str]]: '\n \n ' return pulumi.get(self, 'location')
@property @pulumi.getter(name='siteKey') def site_key(self) -> Optional[pulumi.Input[str]]: '\n The key for vpn-site that can be used for connections.\n ' return pulumi.get(self, 'site_key')
-973,204,070,441,350,500
The key for vpn-site that can be used for connections.
sdk/python/pulumi_azure_native/network/v20200301/vpn_site.py
site_key
sebtelko/pulumi-azure-native
python
@property @pulumi.getter(name='siteKey') def site_key(self) -> Optional[pulumi.Input[str]]: '\n \n ' return pulumi.get(self, 'site_key')
@property @pulumi.getter def tags(self) -> Optional[pulumi.Input[Mapping[(str, pulumi.Input[str])]]]: '\n Resource tags.\n ' return pulumi.get(self, 'tags')
-2,047,115,851,061,118,500
Resource tags.
sdk/python/pulumi_azure_native/network/v20200301/vpn_site.py
tags
sebtelko/pulumi-azure-native
python
@property @pulumi.getter def tags(self) -> Optional[pulumi.Input[Mapping[(str, pulumi.Input[str])]]]: '\n \n ' return pulumi.get(self, 'tags')
@property @pulumi.getter(name='virtualWan') def virtual_wan(self) -> Optional[pulumi.Input['SubResourceArgs']]: '\n The VirtualWAN to which the vpnSite belongs.\n ' return pulumi.get(self, 'virtual_wan')
3,641,573,313,436,819,000
The VirtualWAN to which the vpnSite belongs.
sdk/python/pulumi_azure_native/network/v20200301/vpn_site.py
virtual_wan
sebtelko/pulumi-azure-native
python
@property @pulumi.getter(name='virtualWan') def virtual_wan(self) -> Optional[pulumi.Input['SubResourceArgs']]: '\n \n ' return pulumi.get(self, 'virtual_wan')
@property @pulumi.getter(name='vpnSiteLinks') def vpn_site_links(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['VpnSiteLinkArgs']]]]: '\n List of all vpn site links.\n ' return pulumi.get(self, 'vpn_site_links')
-1,688,591,939,661,649,700
List of all vpn site links.
sdk/python/pulumi_azure_native/network/v20200301/vpn_site.py
vpn_site_links
sebtelko/pulumi-azure-native
python
@property @pulumi.getter(name='vpnSiteLinks') def vpn_site_links(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['VpnSiteLinkArgs']]]]: '\n \n ' return pulumi.get(self, 'vpn_site_links')
@property @pulumi.getter(name='vpnSiteName') def vpn_site_name(self) -> Optional[pulumi.Input[str]]: '\n The name of the VpnSite being created or updated.\n ' return pulumi.get(self, 'vpn_site_name')
7,713,478,107,883,586,000
The name of the VpnSite being created or updated.
sdk/python/pulumi_azure_native/network/v20200301/vpn_site.py
vpn_site_name
sebtelko/pulumi-azure-native
python
@property @pulumi.getter(name='vpnSiteName') def vpn_site_name(self) -> Optional[pulumi.Input[str]]: '\n \n ' return pulumi.get(self, 'vpn_site_name')
@overload def __init__(__self__, resource_name: str, opts: Optional[pulumi.ResourceOptions]=None, address_space: Optional[pulumi.Input[pulumi.InputType['AddressSpaceArgs']]]=None, bgp_properties: Optional[pulumi.Input[pulumi.InputType['BgpSettingsArgs']]]=None, device_properties: Optional[pulumi.Input[pulumi.InputType[...
4,679,802,617,474,998,000
VpnSite Resource. :param str resource_name: The name of the resource. :param pulumi.ResourceOptions opts: Options for the resource. :param pulumi.Input[pulumi.InputType['AddressSpaceArgs']] address_space: The AddressSpace that contains an array of IP address ranges. :param pulumi.Input[pulumi.InputType['BgpSettingsArg...
sdk/python/pulumi_azure_native/network/v20200301/vpn_site.py
__init__
sebtelko/pulumi-azure-native
python
@overload def __init__(__self__, resource_name: str, opts: Optional[pulumi.ResourceOptions]=None, address_space: Optional[pulumi.Input[pulumi.InputType['AddressSpaceArgs']]]=None, bgp_properties: Optional[pulumi.Input[pulumi.InputType['BgpSettingsArgs']]]=None, device_properties: Optional[pulumi.Input[pulumi.InputType[...
@overload def __init__(__self__, resource_name: str, args: VpnSiteArgs, opts: Optional[pulumi.ResourceOptions]=None): "\n VpnSite Resource.\n\n :param str resource_name: The name of the resource.\n :param VpnSiteArgs args: The arguments to use to populate this resource's properties.\n :p...
-3,237,702,773,393,285,000
VpnSite Resource. :param str resource_name: The name of the resource. :param VpnSiteArgs args: The arguments to use to populate this resource's properties. :param pulumi.ResourceOptions opts: Options for the resource.
sdk/python/pulumi_azure_native/network/v20200301/vpn_site.py
__init__
sebtelko/pulumi-azure-native
python
@overload def __init__(__self__, resource_name: str, args: VpnSiteArgs, opts: Optional[pulumi.ResourceOptions]=None): "\n VpnSite Resource.\n\n :param str resource_name: The name of the resource.\n :param VpnSiteArgs args: The arguments to use to populate this resource's properties.\n :p...
@staticmethod def get(resource_name: str, id: pulumi.Input[str], opts: Optional[pulumi.ResourceOptions]=None) -> 'VpnSite': "\n Get an existing VpnSite resource's state with the given name, id, and optional extra\n properties used to qualify the lookup.\n\n :param str resource_name: The unique ...
-4,261,798,479,824,081,000
Get an existing VpnSite 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...
sdk/python/pulumi_azure_native/network/v20200301/vpn_site.py
get
sebtelko/pulumi-azure-native
python
@staticmethod def get(resource_name: str, id: pulumi.Input[str], opts: Optional[pulumi.ResourceOptions]=None) -> 'VpnSite': "\n Get an existing VpnSite resource's state with the given name, id, and optional extra\n properties used to qualify the lookup.\n\n :param str resource_name: The unique ...
@property @pulumi.getter(name='addressSpace') def address_space(self) -> pulumi.Output[Optional['outputs.AddressSpaceResponse']]: '\n The AddressSpace that contains an array of IP address ranges.\n ' return pulumi.get(self, 'address_space')
6,035,939,328,442,930,000
The AddressSpace that contains an array of IP address ranges.
sdk/python/pulumi_azure_native/network/v20200301/vpn_site.py
address_space
sebtelko/pulumi-azure-native
python
@property @pulumi.getter(name='addressSpace') def address_space(self) -> pulumi.Output[Optional['outputs.AddressSpaceResponse']]: '\n \n ' return pulumi.get(self, 'address_space')
@property @pulumi.getter(name='bgpProperties') def bgp_properties(self) -> pulumi.Output[Optional['outputs.BgpSettingsResponse']]: '\n The set of bgp properties.\n ' return pulumi.get(self, 'bgp_properties')
-5,544,391,000,063,190,000
The set of bgp properties.
sdk/python/pulumi_azure_native/network/v20200301/vpn_site.py
bgp_properties
sebtelko/pulumi-azure-native
python
@property @pulumi.getter(name='bgpProperties') def bgp_properties(self) -> pulumi.Output[Optional['outputs.BgpSettingsResponse']]: '\n \n ' return pulumi.get(self, 'bgp_properties')
@property @pulumi.getter(name='deviceProperties') def device_properties(self) -> pulumi.Output[Optional['outputs.DevicePropertiesResponse']]: '\n The device properties.\n ' return pulumi.get(self, 'device_properties')
-7,396,698,740,448,333,000
The device properties.
sdk/python/pulumi_azure_native/network/v20200301/vpn_site.py
device_properties
sebtelko/pulumi-azure-native
python
@property @pulumi.getter(name='deviceProperties') def device_properties(self) -> pulumi.Output[Optional['outputs.DevicePropertiesResponse']]: '\n \n ' return pulumi.get(self, 'device_properties')
@property @pulumi.getter def etag(self) -> pulumi.Output[str]: '\n A unique read-only string that changes whenever the resource is updated.\n ' return pulumi.get(self, 'etag')
5,960,741,373,667,297,000
A unique read-only string that changes whenever the resource is updated.
sdk/python/pulumi_azure_native/network/v20200301/vpn_site.py
etag
sebtelko/pulumi-azure-native
python
@property @pulumi.getter def etag(self) -> pulumi.Output[str]: '\n \n ' return pulumi.get(self, 'etag')
@property @pulumi.getter(name='ipAddress') def ip_address(self) -> pulumi.Output[Optional[str]]: '\n The ip-address for the vpn-site.\n ' return pulumi.get(self, 'ip_address')
-3,467,924,975,983,858,000
The ip-address for the vpn-site.
sdk/python/pulumi_azure_native/network/v20200301/vpn_site.py
ip_address
sebtelko/pulumi-azure-native
python
@property @pulumi.getter(name='ipAddress') def ip_address(self) -> pulumi.Output[Optional[str]]: '\n \n ' return pulumi.get(self, 'ip_address')
@property @pulumi.getter(name='isSecuritySite') def is_security_site(self) -> pulumi.Output[Optional[bool]]: '\n IsSecuritySite flag.\n ' return pulumi.get(self, 'is_security_site')
-849,941,201,518,532,000
IsSecuritySite flag.
sdk/python/pulumi_azure_native/network/v20200301/vpn_site.py
is_security_site
sebtelko/pulumi-azure-native
python
@property @pulumi.getter(name='isSecuritySite') def is_security_site(self) -> pulumi.Output[Optional[bool]]: '\n \n ' return pulumi.get(self, 'is_security_site')
@property @pulumi.getter def location(self) -> pulumi.Output[str]: '\n Resource location.\n ' return pulumi.get(self, 'location')
-605,776,475,662,102,400
Resource location.
sdk/python/pulumi_azure_native/network/v20200301/vpn_site.py
location
sebtelko/pulumi-azure-native
python
@property @pulumi.getter def location(self) -> pulumi.Output[str]: '\n \n ' return pulumi.get(self, 'location')
@property @pulumi.getter def name(self) -> pulumi.Output[str]: '\n Resource name.\n ' return pulumi.get(self, 'name')
4,695,236,134,441,039,000
Resource name.
sdk/python/pulumi_azure_native/network/v20200301/vpn_site.py
name
sebtelko/pulumi-azure-native
python
@property @pulumi.getter def name(self) -> pulumi.Output[str]: '\n \n ' return pulumi.get(self, 'name')
@property @pulumi.getter(name='provisioningState') def provisioning_state(self) -> pulumi.Output[str]: '\n The provisioning state of the VPN site resource.\n ' return pulumi.get(self, 'provisioning_state')
-854,177,058,422,730,600
The provisioning state of the VPN site resource.
sdk/python/pulumi_azure_native/network/v20200301/vpn_site.py
provisioning_state
sebtelko/pulumi-azure-native
python
@property @pulumi.getter(name='provisioningState') def provisioning_state(self) -> pulumi.Output[str]: '\n \n ' return pulumi.get(self, 'provisioning_state')
@property @pulumi.getter(name='siteKey') def site_key(self) -> pulumi.Output[Optional[str]]: '\n The key for vpn-site that can be used for connections.\n ' return pulumi.get(self, 'site_key')
7,705,280,787,700,509,000
The key for vpn-site that can be used for connections.
sdk/python/pulumi_azure_native/network/v20200301/vpn_site.py
site_key
sebtelko/pulumi-azure-native
python
@property @pulumi.getter(name='siteKey') def site_key(self) -> pulumi.Output[Optional[str]]: '\n \n ' return pulumi.get(self, 'site_key')
@property @pulumi.getter def tags(self) -> pulumi.Output[Optional[Mapping[(str, str)]]]: '\n Resource tags.\n ' return pulumi.get(self, 'tags')
-2,929,197,049,816,896,000
Resource tags.
sdk/python/pulumi_azure_native/network/v20200301/vpn_site.py
tags
sebtelko/pulumi-azure-native
python
@property @pulumi.getter def tags(self) -> pulumi.Output[Optional[Mapping[(str, str)]]]: '\n \n ' return pulumi.get(self, 'tags')
@property @pulumi.getter def type(self) -> pulumi.Output[str]: '\n Resource type.\n ' return pulumi.get(self, 'type')
2,132,950,812,122,862,800
Resource type.
sdk/python/pulumi_azure_native/network/v20200301/vpn_site.py
type
sebtelko/pulumi-azure-native
python
@property @pulumi.getter def type(self) -> pulumi.Output[str]: '\n \n ' return pulumi.get(self, 'type')
@property @pulumi.getter(name='virtualWan') def virtual_wan(self) -> pulumi.Output[Optional['outputs.SubResourceResponse']]: '\n The VirtualWAN to which the vpnSite belongs.\n ' return pulumi.get(self, 'virtual_wan')
5,332,521,942,094,007,000
The VirtualWAN to which the vpnSite belongs.
sdk/python/pulumi_azure_native/network/v20200301/vpn_site.py
virtual_wan
sebtelko/pulumi-azure-native
python
@property @pulumi.getter(name='virtualWan') def virtual_wan(self) -> pulumi.Output[Optional['outputs.SubResourceResponse']]: '\n \n ' return pulumi.get(self, 'virtual_wan')
@property @pulumi.getter(name='vpnSiteLinks') def vpn_site_links(self) -> pulumi.Output[Optional[Sequence['outputs.VpnSiteLinkResponse']]]: '\n List of all vpn site links.\n ' return pulumi.get(self, 'vpn_site_links')
-5,086,771,345,091,703,000
List of all vpn site links.
sdk/python/pulumi_azure_native/network/v20200301/vpn_site.py
vpn_site_links
sebtelko/pulumi-azure-native
python
@property @pulumi.getter(name='vpnSiteLinks') def vpn_site_links(self) -> pulumi.Output[Optional[Sequence['outputs.VpnSiteLinkResponse']]]: '\n \n ' return pulumi.get(self, 'vpn_site_links')
@click.group('r2dt') def cli(): '\n A group of commands for parsing data from secondary structures into an\n importable format.\n ' pass
5,622,575,217,022,508,000
A group of commands for parsing data from secondary structures into an importable format.
rnacentral_pipeline/cli/r2dt.py
cli
RNAcentral/rnacentral-import-pipeline
python
@click.group('r2dt') def cli(): '\n A group of commands for parsing data from secondary structures into an\n importable format.\n ' pass
@cli.command('process-svgs') @click.option('--allow-missing', is_flag=True, default=False) @click.argument('model_info', type=click.File('r')) @click.argument('directory', type=click.Path()) @click.argument('output', type=click.File('w')) def process_svgs(model_info, directory, output, allow_missing=False): '\n ...
3,233,411,465,854,024
Process all SVG secondary structures in the given directory and produce a single data file that can be imported into the database.
rnacentral_pipeline/cli/r2dt.py
process_svgs
RNAcentral/rnacentral-import-pipeline
python
@cli.command('process-svgs') @click.option('--allow-missing', is_flag=True, default=False) @click.argument('model_info', type=click.File('r')) @click.argument('directory', type=click.Path()) @click.argument('output', type=click.File('w')) def process_svgs(model_info, directory, output, allow_missing=False): '\n ...
@cli.group('should-show') def should_show(): '\n Some commands relating to building a model for should show as well as\n running it.\n '
-8,246,602,746,235,892,000
Some commands relating to building a model for should show as well as running it.
rnacentral_pipeline/cli/r2dt.py
should_show
RNAcentral/rnacentral-import-pipeline
python
@cli.group('should-show') def should_show(): '\n Some commands relating to building a model for should show as well as\n running it.\n '
@should_show.command('convert-sheet') @click.argument('filename', type=click.File('r')) @click.argument('output', type=click.File('w')) def convert_sheet(filename, output): "\n This command is to convert a downloaded google sheet csv into a csv that can\n be used for training data. Often we will build a sprea...
-4,815,811,023,913,836,000
This command is to convert a downloaded google sheet csv into a csv that can be used for training data. Often we will build a spreadsheet of example URS and then use that to build a training set. It is nice since you can embedd an SVG in google sheets so it is fast for us to compare several of them. In order to move t...
rnacentral_pipeline/cli/r2dt.py
convert_sheet
RNAcentral/rnacentral-import-pipeline
python
@should_show.command('convert-sheet') @click.argument('filename', type=click.File('r')) @click.argument('output', type=click.File('w')) def convert_sheet(filename, output): "\n This command is to convert a downloaded google sheet csv into a csv that can\n be used for training data. Often we will build a sprea...
@should_show.command('fetch-data') @click.option('--db-url', envvar='PGDATABASE') @click.argument('filename', type=click.File('r')) @click.argument('output', type=click.File('w')) def fetch_training_data(filename, output, db_url=None): '\n This builds a CSV file of training data to use for the model building. I\...
7,687,694,629,916,893,000
This builds a CSV file of training data to use for the model building. I keep it separate so I can build a training csv and play with it interactivly before committing the final modeling building logic to the pipeline.
rnacentral_pipeline/cli/r2dt.py
fetch_training_data
RNAcentral/rnacentral-import-pipeline
python
@should_show.command('fetch-data') @click.option('--db-url', envvar='PGDATABASE') @click.argument('filename', type=click.File('r')) @click.argument('output', type=click.File('w')) def fetch_training_data(filename, output, db_url=None): '\n This builds a CSV file of training data to use for the model building. I\...
@should_show.command('inspect-data') @click.option('--db-url', envvar='PGDATABASE') @click.argument('filename', type=click.File('r')) @click.argument('output', type=click.File('w')) def fetch_inspect_data(filename, output, db_url=None): '\n This is the command to use when trying to fetch more examples to add to ...
-1,115,318,413,282,255,600
This is the command to use when trying to fetch more examples to add to the training set. This will fetch some information that is useful for a person to evaluate a diagram and decide if it should be true/false in the training set.
rnacentral_pipeline/cli/r2dt.py
fetch_inspect_data
RNAcentral/rnacentral-import-pipeline
python
@should_show.command('inspect-data') @click.option('--db-url', envvar='PGDATABASE') @click.argument('filename', type=click.File('r')) @click.argument('output', type=click.File('w')) def fetch_inspect_data(filename, output, db_url=None): '\n This is the command to use when trying to fetch more examples to add to ...
@should_show.command('build-model') @click.option('--db-url', envvar='PGDATABASE') @click.argument('training-info', type=click.File('r')) @click.argument('model', type=click.Path()) def build_model(training_info, model, db_url=None): '\n This builds a model given then training information. The training\n info...
-7,088,327,318,684,605,000
This builds a model given then training information. The training information should be a csv file of: URS,flag The flag must be 1 or 0 to indicate if the URS should be shown or not. THis will fetch the data like the fetch-data command but will then build a model and write it out the the output file directly.
rnacentral_pipeline/cli/r2dt.py
build_model
RNAcentral/rnacentral-import-pipeline
python
@should_show.command('build-model') @click.option('--db-url', envvar='PGDATABASE') @click.argument('training-info', type=click.File('r')) @click.argument('model', type=click.Path()) def build_model(training_info, model, db_url=None): '\n This builds a model given then training information. The training\n info...
@should_show.command('compute') @click.option('--db-url', envvar='PGDATABASE') @click.argument('model', type=click.Path()) @click.argument('filename', type=click.File('r')) @click.argument('output', type=click.File('w')) def write_should_show(model, filename, output, db_url=None): '\n This computes the should sh...
-1,106,030,058,217,618,800
This computes the should show values for the data in the given file and a file listing urs ids to use. The data needed for the URS will be fetched from the database. This is meant to operate on large batches, like relabeling the entire database.
rnacentral_pipeline/cli/r2dt.py
write_should_show
RNAcentral/rnacentral-import-pipeline
python
@should_show.command('compute') @click.option('--db-url', envvar='PGDATABASE') @click.argument('model', type=click.Path()) @click.argument('filename', type=click.File('r')) @click.argument('output', type=click.File('w')) def write_should_show(model, filename, output, db_url=None): '\n This computes the should sh...
@cli.group('model-info') def model_info(): '\n Commands for parsing and generating data files we can import into the\n database as model info files.\n ' pass
6,172,029,846,261,659,000
Commands for parsing and generating data files we can import into the database as model info files.
rnacentral_pipeline/cli/r2dt.py
model_info
RNAcentral/rnacentral-import-pipeline
python
@cli.group('model-info') def model_info(): '\n Commands for parsing and generating data files we can import into the\n database as model info files.\n ' pass
@model_info.command('crw') @click.argument('filename', type=click.File('r')) @click.argument('output', default='-', type=click.File('w')) def crw_model_info(filename, output): '\n Parse the CRW metadata file and produce\n ' r2dt.write_crw(filename, output)
2,648,798,942,224,611,300
Parse the CRW metadata file and produce
rnacentral_pipeline/cli/r2dt.py
crw_model_info
RNAcentral/rnacentral-import-pipeline
python
@model_info.command('crw') @click.argument('filename', type=click.File('r')) @click.argument('output', default='-', type=click.File('w')) def crw_model_info(filename, output): '\n \n ' r2dt.write_crw(filename, output)
@model_info.command('ribovision') @click.argument('filename', type=click.File('r')) @click.argument('output', default='-', type=click.File('w')) def ribovision_model_info(filename, output): '\n Parse the metadata.tsv file from R2DT for Ribovision models to\n produce something we can put in our database.\n ...
3,917,267,558,135,540,000
Parse the metadata.tsv file from R2DT for Ribovision models to produce something we can put in our database.
rnacentral_pipeline/cli/r2dt.py
ribovision_model_info
RNAcentral/rnacentral-import-pipeline
python
@model_info.command('ribovision') @click.argument('filename', type=click.File('r')) @click.argument('output', default='-', type=click.File('w')) def ribovision_model_info(filename, output): '\n Parse the metadata.tsv file from R2DT for Ribovision models to\n produce something we can put in our database.\n ...