(self, service_name, deployment_name,
                                          deployment_slot, label, role_name,
                                          system_config, os_virtual_hard_disk,
                                          network_config=None,
                                          availability_set_name=None,
                                          data_virtual_hard_disks=None,
                                          role_size=None,
                                          role_type='PersistentVMRole',
                                          virtual_network_name=None,
                                          resource_extension_references=None,
                                          provision_guest_agent=None,
                                          vm_image_name=None,
                                          media_location=None,
                                          dns_servers=None,
                                          reserved_ip_name=None)

return self._perform_post(
            self._get_deployment_path_using_name(service_name),
            _XmlSerializer.virtual_machine_deployment_to_xml(
                deployment_name,
                deployment_slot,
                label,
                role_name,
                system_config,
                os_virtual_hard_disk,
                role_type,
                network_config,
                availability_set_name,
                data_virtual_hard_disks,
                role_size,
                virtual_network_name,
                resource_extension_references,
                provision_guest_agent,
                vm_image_name,
                media_location,
                dns_servers,
                reserved_ip_name),
            as_async=True)

def Func(arg_0, arg_1, arg_2,
                                          arg_3, arg_4, arg_5,
                                          arg_6, arg_7,
                                          arg_8=None,
                                          arg_9=None,
                                          arg_10=None,
                                          arg_11=None,
                                          arg_12='PersistentVMRole',
                                          arg_13=None,
                                          arg_14=None,
                                          arg_15=None,
                                          arg_16=None,
                                          arg_17=None,
                                          arg_18=None,
                                          arg_19=None):
        '''
        Provisions a virtual machine based on the supplied configuration.

        service_name:
            Name of the hosted service.
        deployment_name:
            The name for the deployment. The deployment name must be unique
            among other deployments for the hosted service.
        deployment_slot:
            The environment to which the hosted service is deployed. Valid
            values are: staging, production
        label:
            Specifies an identifier for the deployment. The label can be up to
            100 characters long. The label can be used for tracking purposes.
        role_name:
            The name of the role.
        system_config:
            Contains the metadata required to provision a virtual machine from
            a Windows or Linux OS image.  Use an instance of
            WindowsConfigurationSet or LinuxConfigurationSet.
        os_virtual_hard_disk:
            Contains the parameters Windows Azure uses to create the operating
            system disk for the virtual machine. If you are creating a Virtual
            Machine by using a VM Image, this parameter is not used.
        network_config:
            Encapsulates the metadata required to create the virtual network
            configuration for a virtual machine. If you do not include a
            network configuration set you will not be able to access the VM
            through VIPs over the internet. If your virtual machine belongs to
            a virtual network you can not specify which subnet address space
            it resides under. Use an instance of ConfigurationSet.
        availability_set_name:
            Specifies the name of an availability set to which to add the
            virtual machine. This value controls the virtual machine
            allocation in the Windows Azure environment. Virtual machines
            specified in the same availability set are allocated to different
            nodes to maximize availability.
        data_virtual_hard_disks:
            Contains the parameters Windows Azure uses to create a data disk
            for a virtual machine.
        role_size:
            The size of the virtual machine to allocate. The default value is
            Small. Possible values are: ExtraSmall,Small,Medium,Large,
            ExtraLarge,A5,A6,A7,A8,A9,Basic_A0,Basic_A1,Basic_A2,Basic_A3,
            Basic_A4,Standard_D1,Standard_D2,Standard_D3,Standard_D4,
            Standard_D11,Standard_D12,Standard_D13,Standard_D14,Standard_G1,
            Standard_G2,Sandard_G3,Standard_G4,Standard_G5. The specified
            value must be compatible with the disk selected in the
            OSVirtualHardDisk values.
        role_type:
            The type of the role for the virtual machine. The only supported
            value is PersistentVMRole.
        virtual_network_name:
            Specifies the name of an existing virtual network to which the
            deployment will belong.
        resource_extension_references:
            Optional. Contains a collection of resource extensions that are to
            be installed on the Virtual Machine. This element is used if
            provision_guest_agent is set to True. Use an iterable of instances
            of ResourceExtensionReference.
        provision_guest_agent:
            Optional. Indicates whether the VM Agent is installed on the
            Virtual Machine. To run a resource extension in a Virtual Machine,
            this service must be installed.
        vm_image_name:
            Optional. Specifies the name of the VM Image that is to be used to
            create the Virtual Machine. If this is specified, the
            system_config and network_config parameters are not used.
        media_location:
            Optional. Required if the Virtual Machine is being created from a
            published VM Image. Specifies the location of the VHD file that is
            created when VMImageName specifies a published VM Image.
        dns_servers:
            Optional. List of DNS servers (use DnsServer class) to associate
            with the Virtual Machine.
        reserved_ip_name:
            Optional. Specifies the name of a reserved IP address that is to be
            assigned to the deployment. You must run create_reserved_ip_address
            before you can assign the address to the deployment using this
            element.
        '''
        _validate_not_none('service_name', arg_1)
        _validate_not_none('deployment_name', arg_2)
        _validate_not_none('deployment_slot', arg_3)
        _validate_not_none('label', arg_4)
        _validate_not_none('role_name', arg_5)
        return arg_0._perform_post(
            arg_0._get_deployment_path_using_name(arg_1),
            _XmlSerializer.virtual_machine_deployment_to_xml(
                arg_2,
                arg_3,
                arg_4,
                arg_5,
                arg_6,
                arg_7,
                arg_12,
                arg_8,
                arg_9,
                arg_10,
                arg_11,
                arg_13,
                arg_14,
                arg_15,
                arg_16,
                arg_17,
                arg_18,
                arg_19),
            as_async=True)

Provisions a virtual machine based on the supplied configuration .


(key_file, origin_passphrase, stash, passphrase, backend)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
)
:
arg_2
=
_get_stash
(
arg_4
,
arg_2
,
arg_3
)
click
.
echo
(
'Importing all keys from {0}...'
.
format
(
arg_0
)
)
arg_2
.
load
(
arg_1
,
arg_0
=
arg_0
)
click
.
echo
(
'Import complete!'
)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
    """Load all keys from an exported key file to the stash

    `KEY_FILE` is the exported stash file to load keys from
    """
    arg_2 = _get_stash(arg_4, arg_2, arg_3)

    click.echo('Importing all keys from {0}...'.format(arg_0))
    arg_2.load(arg_1, arg_0=arg_0)
    click.echo('Import complete!')


def
Func
(
arg_0
,
arg_1
=
)
:
if
arg_1
in
(
arg_0
.
CORNER
,
arg_0
.
CENTER
,
arg_0
.
CORNERS
)
:
arg_0
.
rectmode
=
arg_1
return
arg_0
.
rectmode
elif
arg_1
is
:
return
arg_0
.
rectmode
else
:
raise
ShoebotError
(
_
(
"rectmode: invalid input"
)
)

def Func(arg_0, arg_1=None):
        '''
        Set the current rectmode.

        :param mode: CORNER, CENTER, CORNERS
        :return: rectmode if mode is None or valid.
        '''
        if arg_1 in (arg_0.CORNER, arg_0.CENTER, arg_0.CORNERS):
            arg_0.rectmode = arg_1
            return arg_0.rectmode
        elif arg_1 is None:
            return arg_0.rectmode
        else:
            raise ShoebotError(_("rectmode: invalid input"))


def
Func
(
arg_0
,
arg_1
=
True
,
arg_2
=
True
)
:
if
'TCU'
+
TARIFAS
[
0
]
not
in
arg_0
.
columns
:
if
arg_2
:
arg_3
=
[
c
+
t
for
c
in
COLS_PVPC
for
t
in
TARIFAS
if
c
!=
'COF'
]
arg_0
[
arg_3
]
=
arg_0
[
arg_3
]
.
applymap
(
lambda
x
:
x
/
1000.
)
arg_4
=
arg_0
.
groupby
(
lambda
x
:
TARIFAS
[
np
.
argmax
(
[
t
in
x
for
t
in
TARIFAS
]
)
]
,
axis
=
1
)
for
arg_5
,
arg_6
in
arg_4
:
if
arg_1
:
print
(
'TARIFA {}'
.
format
(
arg_5
)
)
print
(
arg_6
.
head
(
)
)
arg_0
[
'TCU{}'
.
format
(
arg_5
)
]
=
arg_6
[
arg_5
]
arg_6
[
'TEU{}'
.
format
(
arg_5
)
]
arg_8
=
[
c
+
arg_5
for
c
in
COLS_PVPC
if
c
not
in
[
''
,
'COF'
,
'TEU'
]
]
arg_0
[
'CP{}'
.
format
(
arg_5
)
]
=
arg_6
[
arg_8
]
.
sum
(
axis
=
1
)
arg_9
=
[
'TEU'
+
arg_5
,
'TCU'
+
arg_5
,
'COF'
+
arg_5
]
arg_6
=
arg_0
[
arg_9
]
.
groupby
(
'TEU'
+
arg_5
)
arg_10
=
arg_6
.
apply
(
lambda
x
:
x
[
'TCU'
+
arg_5
]
.
dot
(
x
[
'COF'
+
arg_5
]
)
/
x
[
'COF'
+
arg_5
]
.
sum
(
)
)
arg_10
.
name
=
'PD_'
+
arg_5
arg_0
=
arg_0
.
join
(
arg_10
,
on
=
'TEU'
+
arg_5
,
rsuffix
=
'_r'
)
arg_0
[
'PD_'
+
arg_5
]
+=
arg_0
[
'TEU'
+
arg_5
]
return
arg_0

def Func(arg_0, arg_1=True, arg_2=True):
    """Procesa TCU, CP, FEU diario.

    :param df:
    :param verbose:
    :param convert_kwh:
    :return:
    """
    if 'TCU' + TARIFAS[0] not in arg_0.columns:
        # Pasa de €/MWh a €/kWh:
        if arg_2:
            arg_3 = [c + t for c in COLS_PVPC for t in TARIFAS if c != 'COF']
            arg_0[arg_3] = arg_0[arg_3].applymap(lambda x: x / 1000.)
        # Obtiene columnas TCU, CP, precio día
        arg_4 = arg_0.groupby(lambda x: TARIFAS[np.argmax([t in x for t in TARIFAS])], axis=1)
        for arg_5, arg_6 in arg_4:
            if arg_1:
                print('TARIFA {}'.format(arg_5))
                print(arg_6.head())

            # Cálculo de TCU
            arg_0['TCU{}'.format(arg_5)] = arg_6[arg_5] - arg_6['TEU{}'.format(arg_5)]

            # Cálculo de CP
            # cols_cp = [c + k for c in ['FOS', 'FOM', 'INT', 'PCAP', 'PMH', 'SAH']]
            arg_8 = [c + arg_5 for c in COLS_PVPC if c not in ['', 'COF', 'TEU']]
            arg_0['CP{}'.format(arg_5)] = arg_6[arg_8].sum(axis=1)

            # Cálculo de PERD --> No es posible así, ya que los valores base ya vienen con PERD
            # dfs_pvpc[k]['PERD{}'.format(k)] = dfs_pvpc[k]['TCU{}'.format(k)] / dfs_pvpc[k]['CP{}'.format(k)]
            # dfs_pvpc[k]['PERD{}'.format(k)] = dfs_pvpc[k]['INT{}'.format(k)] / 1.92

            # Cálculo de FEU diario
            arg_9 = ['TEU' + arg_5, 'TCU' + arg_5, 'COF' + arg_5]
            arg_6 = arg_0[arg_9].groupby('TEU' + arg_5)
            arg_10 = arg_6.apply(lambda x: x['TCU' + arg_5].dot(x['COF' + arg_5]) / x['COF' + arg_5].sum())
            arg_10.name = 'PD_' + arg_5
            arg_0 = arg_0.join(arg_10, on='TEU' + arg_5, rsuffix='_r')
            arg_0['PD_' + arg_5] += arg_0['TEU' + arg_5]
    return arg_0


(
            self, kb_id, update_kb, custom_headers=None, raw=False, **operation_config)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
,
arg_4
=
False
,
**
arg_5
)
:
arg_6
=
arg_0
.
Func
.
metadata
[
'url'
]
arg_7
=
{
'Endpoint'
:
arg_0
.
_serialize
.
url
(
"self.config.endpoint"
,
arg_0
.
config
.
endpoint
,
'str'
,
skip_quote
=
True
)
,
'kbId'
:
arg_0
.
_serialize
.
url
(
"kb_id"
,
arg_1
,
'str'
)
}
arg_6
=
arg_0
.
_client
.
format_url
(
arg_6
,
**
arg_7
)
arg_8
=
{
}
arg_9
=
{
}
arg_9
[
'Accept'
]
=
'application/json'
arg_9
[
'Content-Type'
]
=
'application/json; charset=utf-8'
if
arg_3
:
arg_9
.
Func
(
arg_3
)
arg_10
=
arg_0
.
_serialize
.
body
(
arg_2
,
'UpdateKbOperationDTO'
)
arg_11
=
arg_0
.
_client
.
patch
(
arg_6
,
arg_8
,
arg_9
,
arg_10
)
arg_12
=
arg_0
.
_client
.
send
(
arg_11
,
stream
=
False
,
**
arg_5
)
if
arg_12
.
status_code
not
in
[
202
]
:
raise
models
.
ErrorResponseException
(
arg_0
.
_deserialize
,
arg_12
)
arg_13
=
arg_14
=
{
}
if
arg_12
.
status_code
==
202
:
arg_13
=
arg_0
.
_deserialize
(
'Operation'
,
arg_12
)
arg_14
=
{
'Location'
:
'str'
,
}
if
arg_4
:
arg_15
=
ClientRawResponse
(
arg_13
,
arg_12
)
arg_15
.
add_headers
(
arg_14
)
return
arg_15
return
arg_13

def Func(
            arg_0, arg_1, arg_2, arg_3=None, arg_4=False, **arg_5):
        """Asynchronous operation to modify a knowledgebase.

        :param kb_id: Knowledgebase id.
        :type kb_id: str
        :param Func_kb: Post body of the request.
        :type Func_kb:
         ~azure.cognitiveservices.knowledge.qnamaker.models.UpdateKbOperationDTO
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: Operation or ClientRawResponse if raw=true
        :rtype: ~azure.cognitiveservices.knowledge.qnamaker.models.Operation
         or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`ErrorResponseException<azure.cognitiveservices.knowledge.qnamaker.models.ErrorResponseException>`
        """
        # Construct URL
        arg_6 = arg_0.Func.metadata['url']
        arg_7 = {
            'Endpoint': arg_0._serialize.url("self.config.endpoint", arg_0.config.endpoint, 'str', skip_quote=True),
            'kbId': arg_0._serialize.url("kb_id", arg_1, 'str')
        }
        arg_6 = arg_0._client.format_url(arg_6, **arg_7)

        # Construct parameters
        arg_8 = {}

        # Construct headers
        arg_9 = {}
        arg_9['Accept'] = 'application/json'
        arg_9['Content-Type'] = 'application/json; charset=utf-8'
        if arg_3:
            arg_9.Func(arg_3)

        # Construct body
        arg_10 = arg_0._serialize.body(arg_2, 'UpdateKbOperationDTO')

        # Construct and send request
        arg_11 = arg_0._client.patch(arg_6, arg_8, arg_9, arg_10)
        arg_12 = arg_0._client.send(arg_11, stream=False, **arg_5)

        if arg_12.status_code not in [202]:
            raise models.ErrorResponseException(arg_0._deserialize, arg_12)

        arg_13 = None
        arg_14 = {}

        if arg_12.status_code == 202:
            arg_13 = arg_0._deserialize('Operation', arg_12)
            arg_14 = {
                'Location': 'str',
            }

        if arg_4:
            arg_15 = ClientRawResponse(arg_13, arg_12)
            arg_15.add_headers(arg_14)
            return arg_15

        return arg_13

Asynchronous operation to modify a knowledgebase.

        :param kb_id: Knowledgebase id.
        :type kb_id: str
        :param update_kb: Post body of the request.
        :type update_kb:
         ~azure.cognitiveservices.knowledge.qnamaker.models.UpdateKbOperationDTO
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: Operation or ClientRawResponse if raw=true
        :rtype: ~azure.cognitiveservices.knowledge.qnamaker.models.Operation
         or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`ErrorResponseException<azure.cognitiveservices.knowledge.qnamaker.models.ErrorResponseException>`

Asynchronous operation to modify a knowledgebase .


Compute the xticks labels of this grid, used for plotting the x-axis ticks when visualizing a regular

return np.linspace(np.min(self[:, 1]), np.max(self[:, 1]), 4)

def Func ( arg_0 ) : return np . linspace ( np . min ( arg_0 [ : , 1 ] ) , np . max ( arg_0 [ : , 1 ] ) , 4 )

def Func(arg_0):
        """Compute the Func labels of this grid, used for plotting the x-axis ticks when visualizing a regular"""
        return np.linspace(np.min(arg_0[:, 1]), np.max(arg_0[:, 1]), 4)

Compute the xticks labels of this grid used for plotting the x - axis ticks when visualizing a regular


def Func ( arg_0 , arg_1 , arg_2 ) : try : arg_3 = arg_0 . _get_menu_handle ( arg_1 , arg_2 , False ) try : if arg_3 . AXMenuItemMarkChar : return 1 except atomac . _a11y . Error : pass except LdtpServerException : pass return 0

def Func(arg_0, arg_1, arg_2):
        """
        Verify a menu item is checked

        @param window_name: Window name to look for, either full name,
        LDTP's name convention, or a Unix glob.
        @type window_name: string
        @param object_name: Object name to look for, either full name,
        LDTP's name convention, or a Unix glob. Or menu heirarchy
        @type object_name: string

        @return: 1 on success.
        @rtype: integer
        """
        try:
            arg_3 = arg_0._get_menu_handle(arg_1, arg_2,
                                                False)
            try:
                if arg_3.AXMenuItemMarkChar:
                    # Checked
                    return 1
            except atomac._a11y.Error:
                pass
        except LdtpServerException:
            pass
        return 0


(simplex,
                         objective_values,
                         worst_index,
                         reflected,
                         objective_at_reflected)

def Func(arg_0,
                         arg_1,
                         arg_2,
                         arg_3,
                         arg_4):
  """Creates the condition function pair for a reflection to be accepted."""
  def _replace_worst_with_reflected():
    arg_5 = _replace_at_index(arg_0, arg_2, arg_3)
    arg_6 = _replace_at_index(arg_1, arg_2,
                                              arg_4)
    return False, arg_5, arg_6, 0
  return _replace_worst_with_reflected

Creates the condition function pair for a reflection to be accepted .


(self, tup, tup_id=None, stream=Stream.DEFAULT_STREAM_ID,
           direct_task=None, need_task_ids=False)

def Func(arg_0, arg_1, arg_2=None, arg_3=arg_4.DEFAULT_STREAM_ID,
           arg_6=None, arg_7=False):
    """Emits a new tuple from this Spout

    It is compatible with StreamParse API.

    :type tup: list or tuple
    :param tup: the new output Tuple to send from this spout,
                should contain only serializable data.
    :type tup_id: str or object
    :param tup_id: the ID for the Tuple. Leave this blank for an unreliable Func.
                   (Same as messageId in Java)
    :type stream: str
    :param stream: the ID of the stream this Tuple should be Functed to.
                   Leave empty to Func to the default stream.
    :type direct_task: int
    :param direct_task: the task to send the Tuple to if performing a direct Func.
    :type need_task_ids: bool
    :param need_task_ids: indicate whether or not you would like the task IDs the Tuple was Functed.
    """
    # first check whether this tuple is sane
    arg_0.pplan_helper.check_output_schema(arg_3, arg_1)

    # get custom grouping target task ids; get empty list if not custom grouping
    arg_8 = arg_0.pplan_helper.choose_tasks_for_custom_grouping(arg_3, arg_1)

    arg_0.pplan_helper.context.invoke_hook_Func(arg_1, arg_3, None)

    arg_9 = tuple_pb2.HeronDataTuple()
    arg_9.key = 0

    if arg_6 is not None:
      if not isinstance(arg_6, int):
        raise TypeError("direct_task argument needs to be an integer, given: %s"
                        % str(type(arg_6)))
      # performing Func-direct
      arg_9.dest_task_ids.append(arg_6)
    elif arg_8 is not None:
      # for custom grouping
      for arg_11 in arg_8:
        arg_9.dest_task_ids.append(arg_11)

    if arg_2 is not None:
      arg_12 = TupleHelper.make_root_tuple_info(arg_3, arg_2)
      if arg_0.acking_enabled:
        # this message is rooted
        arg_13 = arg_9.roots.add()
        arg_13.taskid = arg_0.pplan_helper.my_task_id
        arg_13.key = arg_12.key
        arg_0.in_flight_tuples[arg_12.key] = arg_12
      else:
        arg_0.immediate_acks.append(arg_12)

    arg_16 = 0

    arg_17 = time.time()

    # Serialize
    for arg_18 in arg_1:
      arg_19 = arg_0.serializer.serialize(arg_18)
      arg_9.values.append(arg_19)
      arg_16 += len(arg_19)

    arg_20 = (time.time() - arg_17) * system_constants.SEC_TO_NS
    arg_0.spout_metrics.serialize_data_tuple(arg_3, arg_20)

    super(SpoutInstance, arg_0).admit_data_tuple(stream_id=arg_3, arg_9=arg_9,
                                                arg_16=arg_16)
    arg_0.total_tuples_Functed += 1
    arg_0.spout_metrics.update_Func_count(arg_3)
    if arg_7:
      arg_21 = arg_8 or []
      if arg_6 is not None:
        arg_21.append(arg_6)
      return arg_21

Emits a new tuple from this Spout

    It is compatible with StreamParse API.

    :type tup: list or tuple
    :param tup: the new output Tuple to send from this spout,
                should contain only serializable data.
    :type tup_id: str or object
    :param tup_id: the ID for the Tuple. Leave this blank for an unreliable emit.
                   (Same as messageId in Java)
    :type stream: str
    :param stream: the ID of the stream this Tuple should be emitted to.
                   Leave empty to emit to the default stream.
    :type direct_task: int
    :param direct_task: the task to send the Tuple to if performing a direct emit.
    :type need_task_ids: bool
    :param need_task_ids: indicate whether or not you would like the task IDs the Tuple was emitted.


return [(m.message, m.level) for m in messages]

def Func ( arg_0 ) : arg_1 = [ ] if hasattr ( arg_0 , 'context' ) and arg_0 . context and 'messages' in arg_0 . context : arg_1 = arg_0 . context [ 'messages' ] elif hasattr ( arg_0 , 'cookies' ) : arg_2 = arg_0 . cookies . get ( 'messages' ) if not arg_2 : return [ ] from django . contrib . messages . storage . cookie import CookieStorage arg_3 = CookieStorage ( FakeRequest ( ) ) arg_1 = arg_3 . _decode ( arg_2 . value ) else : return [ ] return [ ( arg_4 . message , arg_4 . level ) for arg_4 in arg_1 ]

def Func(arg_0):
    """Returns a list of the messages from the django MessageMiddleware
    package contained within the given response.  This is to be used during
    unit testing when trying to see if a message was set properly in a view.

    :param response: HttpResponse object, likely obtained through a
        test client.get() or client.post() call

    :returns: a list of tuples (message_string, message_level), one for each
        message in the response context
    """
    arg_1 = []
    if hasattr(arg_0, 'context') and arg_0.context and \
            'messages' in arg_0.context:
        arg_1 = arg_0.context['messages']
    elif hasattr(arg_0, 'cookies'):
        # no "context" set-up or no messages item, check for message info in
        # the cookies
        arg_2 = arg_0.cookies.get('messages')
        if not arg_2:
            return []

        # use the decoder in the CookieStore to process and get a list of
        # messages
        from django.contrib.messages.storage.cookie import CookieStorage
        arg_3 = CookieStorage(FakeRequest())
        arg_1 = arg_3._decode(arg_2.value)
    else:
        return []

    return [(arg_4.message, arg_4.level) for arg_4 in arg_1]

Returns a list of the messages from the django MessageMiddleware package contained within the given response . This is to be used during unit testing when trying to see if a message was set properly in a view .


def
Func
(
arg_0
)
:
arg_1
=
arg_0
.
_bluez
.
GetManagedObjects
(
)
for
arg_2
in
arg_1
.
keys
(
)
:
print
(
"[ %s ]"
%
(
arg_2
)
)
arg_3
=
arg_1
[
arg_2
]
for
arg_4
in
arg_3
.
keys
(
)
:
if
arg_4
in
[
"org.freedesktop.DBus.Introspectable"
,
"org.freedesktop.DBus.Properties"
]
:
continue
print
(
"    %s"
%
(
arg_4
)
)
arg_5
=
arg_3
[
arg_4
]
for
arg_6
in
arg_5
.
keys
(
)
:
print
(
"      %s = %s"
%
(
arg_6
,
arg_5
[
arg_6
]
)
)

def Func(arg_0):
        """Print tree of all bluez objects, useful for debugging."""
        # This is based on the bluez sample code get-managed-objects.py.
        arg_1 = arg_0._bluez.GetManagedObjects()
        for arg_2 in arg_1.keys():
            print("[ %s ]" % (arg_2))
            arg_3 = arg_1[arg_2]
            for arg_4 in arg_3.keys():
                if arg_4 in ["org.freedesktop.DBus.Introspectable",
                            "org.freedesktop.DBus.Properties"]:
                    continue
                print("    %s" % (arg_4))
                arg_5 = arg_3[arg_4]
                for arg_6 in arg_5.keys():
                    print("      %s = %s" % (arg_6, arg_5[arg_6]))

Print tree of all bluez objects useful for debugging .


def Func ( arg_0 ) : try : arg_1 = email . message_from_string ( arg_0 ) arg_2 = message_to_dict ( arg_1 ) except UnicodeEncodeError as e : raise ParseError ( cause = str ( e ) ) return arg_2

def Func(arg_0):
        """Parse a NNTP article.

        This method parses a NNTP article stored in a string object
        and returns an dictionary.

        :param raw_article: NNTP article string

        :returns: a dictionary of type `requests.structures.CaseInsensitiveDict`

        :raises ParseError: when an error is found parsing the article
        """
        try:
            arg_1 = email.message_from_string(arg_0)
            arg_2 = message_to_dict(arg_1)
        except UnicodeEncodeError as e:
            raise ParseError(cause=str(e))
        return arg_2


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
arg_0
.
_year_info_pq
(
arg_1
,
'Defensive Alignment'
)
.
text
(
)
arg_3
=
re
.
search
(
r'Defensive Alignment[:\s]*(.+)\s*'
,
arg_2
,
re
.
I
)
if
arg_3
:
return
arg_3
.
group
(
1
)
else
:
return

def Func(arg_0, arg_1):
        """Returns the name of the defensive alignment the team ran in the
        given year.

        :year: Int representing the season year.
        :returns: A string representing the defensive alignment.
        """
        arg_2 = arg_0._year_info_pq(arg_1, 'Defensive Alignment').text()
        arg_3 = re.search(r'Defensive Alignment[:\s]*(.+)\s*', arg_2, re.I)
        if arg_3:
            return arg_3.group(1)
        else:
            return None

Returns the name of the defensive alignment the team ran in the given year .


(ip, notation, inotation, _check, _isnm)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
    """Internally used to convert IPs and netmasks to other notations."""
    arg_5 = arg_2
    arg_6 = arg_1
    arg_2 = _get_notation(arg_2)
    arg_1 = _get_notation(arg_1)
    if arg_2 is None:
        raise ValueError('Func: unknown input notation: "%s"' % arg_5)
    if arg_1 is None:
        raise ValueError('Func: unknown output notation: "%s"' % arg_6)
    arg_7 = arg_3 or False
    if arg_2 == IP_UNKNOWN:
        arg_2 = _detect(arg_0, arg_4)
        if arg_2 == IP_UNKNOWN:
            raise ValueError('Func: unable to guess input notation or invalid value')
        if arg_3 is None:
            arg_7 = True
    # We _always_ check this case later.
    if arg_4:
        arg_7 = False
    arg_8 = 0
    if arg_2 == IP_DOT:
        arg_8 = _dot_to_dec(arg_0, arg_7)
    elif arg_2 == IP_HEX:
        arg_8 = _hex_to_dec(arg_0, arg_7)
    elif arg_2 == IP_BIN:
        arg_8 = _bin_to_dec(arg_0, arg_7)
    elif arg_2 == IP_OCT:
        arg_8 = _oct_to_dec(arg_0, arg_7)
    elif arg_2 == IP_DEC:
        arg_8 = _dec_to_dec_long(arg_0, arg_7)
    elif arg_4 and arg_2 == NM_BITS:
        arg_8 = _bits_to_dec(arg_0, arg_7)
    elif arg_4 and arg_2 == NM_WILDCARD:
        arg_8 = _wildcard_to_dec(arg_0, arg_7)
    else:
        raise ValueError('Func: unknown IP/netmask notation: "%s"' % arg_5)
    # Ensure this is a valid netmask.
    if arg_4 and arg_8 not in _NETMASKS_VALUES:
        raise ValueError('Func: invalid netmask: "%s"' % arg_0)
    if arg_1 == IP_DOT:
        return _dec_to_dot(arg_8)
    elif arg_1 == IP_HEX:
        return _dec_to_hex(arg_8)
    elif arg_1 == IP_BIN:
        return _dec_to_bin(arg_8)
    elif arg_1 == IP_OCT:
        return _dec_to_oct(arg_8)
    elif arg_1 == IP_DEC:
        return _dec_to_dec_str(arg_8)
    elif arg_4 and arg_1 == NM_BITS:
        return _dec_to_bits(arg_8)
    elif arg_4 and arg_1 == NM_WILDCARD:
        return _dec_to_wildcard(arg_8)
    else:
        raise ValueError('convert: unknown notation: "%s"' % arg_6)

Internally used to convert IPs and netmasks to other notations .


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
LOG
.
debug
(
'IP_BILL: notifying {}'
.
format
(
arg_2
)
)
arg_3
=
n_rpc
.
get_notifier
(
'network'
)
arg_3
.
info
(
arg_0
,
arg_1
,
arg_2
)

def Func(arg_0, arg_1, arg_2):
    """Generic Notifier.

    Parameters:
        - `context`: session context
        - `event_type`: the event type to report, i.e. ip.usage
        - `payload`: dict containing the payload to send
    """
    LOG.debug('IP_BILL: notifying {}'.format(arg_2))

    arg_3 = n_rpc.get_notifier('network')
    arg_3.info(arg_0, arg_1, arg_2)


def Func(arg_0):
    """
    This function handles the dictionary of attributes of each Process class
    to print to stdout lists of all the components or the components which the
    user specifies in the -t flag.

    Parameters
    ----------
    procs_dict: dict
        A dictionary with the class attributes for all the components (or
        components that are used by the -t flag), that allow to create
        both the short_list and detailed_list. Dictionary example:
        {"abyss": {'input_type': 'fastq', 'output_type': 'fasta',
        'dependencies': [], 'directives': {'abyss': {'cpus': 4,
        'memory': '{ 5.GB * task.attempt }', 'container': 'flowcraft/abyss',
        'version': '2.1.1', 'scratch': 'true'}}}
    """

    logger.info(colored_print(
        "\n===== L I S T   O F   P R O C E S S E S =====\n", "green_bold"))

    #Sort to print alphabetically ordered list of processes to ease reading
    arg_1 = {k: arg_0[k] for k in sorted(arg_0)}

    for arg_2, arg_3 in arg_1.items():
        arg_4 = "=> {}".format(arg_2)
        logger.info(colored_print(arg_4, "blue_bold"))

        for arg_5 in arg_3:
            arg_6 = "{}:".format(arg_5)

            if isinstance(arg_3[arg_5], list):
                if not arg_3[arg_5]:
                    arg_7 = "None"
                else:
                    arg_7 = ", ".join(arg_3[arg_5])
            elif arg_5 == "directives":
                # this is used for the "directives", which is a dict
                if not arg_3[arg_5]:
                    # if dict is empty then add None to the message
                    arg_7 = "None"
                else:
                    # otherwise fetch all template names within a component
                    # and all the directives for each template to a list
                    arg_8 = ["\n      {}: {}".format(
                        templt,
                        " , ".join(["{}: {}".format(dr, val)
                                    for dr, val in drs.items()]))
                                for templt, drs in arg_3[arg_5].items()
                    ]
                    # write list to a str
                    arg_7 = "".join(arg_8)
            else:
                arg_7 = arg_3[arg_5]

            logger.info("   {} {}".format(
                colored_print(arg_6, "white_underline"), arg_7
            ))

This function handles the dictionary of attributes of each Process class to print to stdout lists of all the components or the components which the user specifies in the - t flag .


def
Func
(
arg_0
)
:
if
arg_0
not
in
__NAMESPACE__
:
raise
NamespaceError
(
'Unknown namespace: {:s}'
.
format
(
arg_0
)
)
arg_1
=
__get_dtype
(
__NAMESPACE__
[
arg_0
]
.
get
(
'value'
,
{
}
)
)
arg_2
=
__get_dtype
(
__NAMESPACE__
[
arg_0
]
.
get
(
'confidence'
,
{
}
)
)
return
arg_1
,
arg_2

def Func(arg_0):
    '''Get the dtypes associated with the value and confidence fields
    for a given namespace.

    Parameters
    ----------
    ns_key : str
        The namespace key in question

    Returns
    -------
    value_dtype, confidence_dtype : numpy.dtype
        Type identifiers for value and confidence fields.
    '''

    # First, get the schema
    if arg_0 not in __NAMESPACE__:
        raise NamespaceError('Unknown namespace: {:s}'.format(arg_0))

    arg_1 = __get_dtype(__NAMESPACE__[arg_0].get('value', {}))
    arg_2 = __get_dtype(__NAMESPACE__[arg_0].get('confidence', {}))

    return arg_1, arg_2

Get the dtypes associated with the value and confidence fields for a given namespace .


def Func ( arg_0 , arg_1 ) : if isinstance ( arg_1 , unicode ) : arg_1 = arg_1 . encode ( 'utf-8' ) arg_2 = mmh3 . hash ( arg_1 ) if arg_2 == DOCUMENT_HASH_KEY : arg_2 = DOCUMENT_HASH_KEY_REPLACEMENT return ( arg_1 , arg_2 )

def Func(arg_0, arg_1):
        '''Get a Murmur hash and a normalized token.

        `tok` may be a :class:`unicode` string or a UTF-8-encoded
        byte string.  :data:`DOCUMENT_HASH_KEY`, hash value 0, is
        reserved for the document count, and this function remaps
        that value.

        :param tok: token to hash
        :return: pair of normalized `tok` and its hash

        '''
        if isinstance(arg_1, unicode):
            arg_1 = arg_1.encode('utf-8')
        arg_2 = mmh3.hash(arg_1)
        if arg_2 == DOCUMENT_HASH_KEY:
            arg_2 = DOCUMENT_HASH_KEY_REPLACEMENT
        return (arg_1, arg_2)

Get a Murmur hash and a normalized token .


def Func ( arg_0 ) : arg_1 = arg_0 . _get_request ( arg_0 . host ) arg_2 = StringIO ( arg_1 . text ) return pd . read_csv ( arg_2 )

def Func(arg_0):
        """Get all available athletes
        This method is cached to prevent unnecessary calls to GC.
        """
        arg_1 = arg_0._get_request(arg_0.host)
        arg_2 = StringIO(arg_1.text)

        return pd.read_csv(arg_2)

Get all available athletes This method is cached to prevent unnecessary calls to GC .


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
if
not
arg_2
:
arg_3
=
open
(
arg_0
.
outfiles
.
vcf
,
'w'
)
else
:
arg_3
=
gzip
.
open
(
arg_0
.
outfiles
.
VCF
,
'w'
)
vcfheader
(
arg_0
,
arg_1
,
arg_3
)
arg_3
.
close
(
)
arg_4
=
glob
.
glob
(
arg_0
.
outfiles
.
vcf
+
".*"
)
arg_4
.
sort
(
key
=
lambda
x
:
int
(
x
.
rsplit
(
"."
)
[
1
]
)
)
if
not
arg_2
:
arg_3
=
open
(
arg_0
.
outfiles
.
vcf
,
'a'
)
else
:
arg_3
=
gzip
.
open
(
arg_0
.
outfiles
.
VCF
,
'a'
)
if
arg_0
.
paramsdict
[
"assembly_method"
]
in
[
"reference"
,
"denovo+reference"
]
:
arg_5
=
[
"cat"
]
+
arg_4
+
[
" | sort -k 2,2 -n | sort -k 1,1 -s"
]
arg_5
=
" "
.
join
(
arg_5
)
arg_6
=
sps
.
Popen
(
arg_5
,
shell
=
True
,
stderr
=
sps
.
STDOUT
,
stdout
=
arg_3
,
close_fds
=
True
)
else
:
arg_6
=
sps
.
Popen
(
[
"cat"
]
+
arg_4
,
stderr
=
sps
.
STDOUT
,
stdout
=
arg_3
,
close_fds
=
True
)
arg_7
=
arg_6
.
communicate
(
)
[
0
]
if
arg_6
.
returncode
:
raise
IPyradWarningExit
(
"err in Func: %s"
,
arg_7
)
arg_3
.
close
(
)
for
arg_8
in
arg_4
:
os
.
remove
(
arg_8
)

def Func(arg_0, arg_1, arg_2):
    """
    Sorts, concatenates, and gzips VCF chunks. Also cleans up chunks.
    """
    ## open handle and write headers
    if not arg_2:
        arg_3 = open(arg_0.outfiles.vcf, 'w')
    else:
        arg_3 = gzip.open(arg_0.outfiles.VCF, 'w')
    vcfheader(arg_0, arg_1, arg_3)
    arg_3.close()

    ## get vcf chunks
    arg_4 = glob.glob(arg_0.outfiles.vcf+".*")
    arg_4.sort(key=lambda x: int(x.rsplit(".")[-1]))

    ## concatenate
    if not arg_2:
        arg_3 = open(arg_0.outfiles.vcf, 'a')
    else:
        arg_3 = gzip.open(arg_0.outfiles.VCF, 'a')

    ## what order do users want? The order in the original ref file?
    ## Sorted by the size of chroms? that is the order in faidx.
    ## If reference mapping then it's nice to sort the vcf data by
    ## CHROM and POS. This is doing a very naive sort right now, so the
    ## CHROM will be ordered, but not the pos within each chrom.
    if arg_0.paramsdict["assembly_method"] in ["reference", "denovo+reference"]:
        ## Some unix sorting magic to get POS sorted within CHROM
        ## First you sort by POS (-k 2,2), then you do a `stable` sort
        ## by CHROM. You end up with POS ordered and grouped correctly by CHROM
        ## but relatively unordered CHROMs (locus105 will be before locus11).
        arg_5 = ["cat"] + arg_4 + [" | sort -k 2,2 -n | sort -k 1,1 -s"]
        arg_5 = " ".join(arg_5)
        arg_6 = sps.Popen(arg_5, shell=True, stderr=sps.STDOUT, stdout=arg_3, close_fds=True)
    else:
        arg_6 = sps.Popen(["cat"] + arg_4, stderr=sps.STDOUT, stdout=arg_3, close_fds=True)

    arg_7 = arg_6.communicate()[0]
    if arg_6.returncode:
        raise IPyradWarningExit("err in Func: %s", arg_7)
    arg_3.close()

    for arg_8 in arg_4:
        os.remove(arg_8)

Sorts concatenates and gzips VCF chunks . Also cleans up chunks .


def Func(arg_0, arg_1):
        """
        Log an attempt against key, incrementing the number of attempts for that key and potentially adding a lock to
        the lock table
        """
        with arg_0.lock:
            if arg_1 not in arg_0.attempts:
                arg_0.attempts[arg_1] = 1
            else:
                arg_0.attempts[arg_1] += 1

                if arg_0.attempts[arg_1] >= arg_0.max_attempts:
                    log.info('Account %s locked due to too many login attempts' % arg_1)
                    # lock account
                    arg_0.locks[arg_1] = datetime.datetime.utcnow() + datetime.timedelta(seconds=arg_0.lock_duration)

Log an attempt against key incrementing the number of attempts for that key and potentially adding a lock to the lock table


return [elem for elem in c_elements if elem != 0]

def Func ( arg_0 ) : arg_1 = [ coeff * met . elements . get ( 'C' , 0 ) for met , coeff in iteritems ( arg_0 . metabolites ) ] return [ arg_2 for arg_2 in arg_1 if arg_2 != 0 ]

def Func(arg_0):
    """
    Split metabolites into the atoms times their stoichiometric coefficients.

    Parameters
    ----------
    reaction : Reaction
        The metabolic reaction whose components are desired.

    Returns
    -------
    list
        Each of the reaction's metabolites' desired carbon elements (if any)
        times that metabolite's stoichiometric coefficient.
    """
    arg_1 = [coeff * met.elements.get('C', 0)
                  for met, coeff in iteritems(arg_0.metabolites)]
    return [arg_2 for arg_2 in arg_1 if arg_2 != 0]

Split metabolites into the atoms times their stoichiometric coefficients .


def Func ( arg_0 , arg_1 ) : arg_2 = [ ( N - 1 ) * float ( arg_1 ) + 1 for N in arg_0 . _len_edges ( ) ] arg_3 = [ numpy . linspace ( start , stop , num = int ( N ) , endpoint = True ) for ( start , stop , N ) in zip ( arg_0 . _min_edges ( ) , arg_0 . _max_edges ( ) , arg_2 ) ] return arg_0 . resample ( arg_3 )

def Func(arg_0, arg_1):
        """Resample to a new regular grid.

        Parameters
        ----------
        factor : float
            The number of grid cells are scaled with `factor` in each
            dimension, i.e., ``factor * N_i`` cells along each
            dimension i.

        Returns
        -------
        Grid

        See Also
        --------
        resample

        """
        # new number of edges N' = (N-1)*f + 1
        arg_2 = [(N - 1) * float(arg_1) + 1 for N in arg_0._len_edges()]
        arg_3 = [numpy.linspace(start, stop, num=int(N), endpoint=True)
                 for (start, stop, N) in
                 zip(arg_0._min_edges(), arg_0._max_edges(), arg_2)]
        return arg_0.resample(arg_3)


def Func ( arg_0 ) : while not arg_0 . stopper . is_set ( ) : try : arg_1 = arg_0 . in_queue . get ( timeout = 5 ) except queue . Empty : continue try : arg_2 = arg_0 . func ( arg_1 ) except TypeError : continue else : arg_0 . out_queue . put ( arg_2 )

def Func(arg_0):
        """
        Method that gets Func when the Worker thread is started.

        When there's an item in in_queue, it takes it out, passes it to func as an argument, and puts the result in out_queue.
        """

        while not arg_0.stopper.is_set():
            try:
                arg_1 = arg_0.in_queue.get(timeout=5)
            except queue.Empty:
                continue

            try:
                arg_2 = arg_0.func(arg_1)
            except TypeError:
                continue
            else:
                arg_0.out_queue.put(arg_2)

Method that gets run when the Worker thread is started.

        When there's an item in in_queue, it takes it out, passes it to func as an argument, and puts the result in out_queue.

Method that gets run when the Worker thread is started .


(self, start_time=None, end_time=None, object_id_filter=None,
                                     operation_result_filter=None, continuation_token=None)

return self._perform_get(self._get_list_subscription_operations_path() + parameters,
                                 SubscriptionOperationCollection)

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = None , arg_4 = None , arg_5 = None ) : arg_1 = ( 'StartTime=' + arg_1 ) if arg_1 else '' arg_2 = ( 'EndTime=' + arg_2 ) if arg_2 else '' arg_3 = ( 'ObjectIdFilter=' + arg_3 ) if arg_3 else '' arg_4 = ( 'OperationResultFilter=' + arg_4 ) if arg_4 else '' arg_5 = ( 'ContinuationToken=' + arg_5 ) if arg_5 else '' arg_6 = ( '&' . join ( v for v in ( arg_1 , arg_2 , arg_3 , arg_4 , arg_5 ) if v ) ) arg_6 = '?' + arg_6 if arg_6 else '' return arg_0 . _perform_get ( arg_0 . _get_Func_path ( ) + arg_6 , SubscriptionOperationCollection )

def Func(arg_0, arg_1=None, arg_2=None, arg_3=None,
                                     arg_4=None, arg_5=None):
        '''
        List subscription operations.

        start_time: Required. An ISO8601 date.
        end_time: Required. An ISO8601 date.
        object_id_filter: Optional. Returns subscription operations only for the specified object type and object ID
        operation_result_filter: Optional. Returns subscription operations only for the specified result status, either Succeeded, Failed, or InProgress.
        continuation_token: Optional.
        More information at:
        https://msdn.microsoft.com/en-us/library/azure/gg715318.aspx
        '''
        arg_1 = ('StartTime=' + arg_1) if arg_1 else ''
        arg_2 = ('EndTime=' + arg_2) if arg_2 else ''
        arg_3 = ('ObjectIdFilter=' + arg_3) if arg_3 else ''
        arg_4 = ('OperationResultFilter=' + arg_4) if arg_4 else ''
        arg_5 = ('ContinuationToken=' + arg_5) if arg_5 else ''

        arg_6 = ('&'.join(v for v in (arg_1, arg_2, arg_3, arg_4, arg_5) if v))
        arg_6 = '?' + arg_6 if arg_6 else ''

        return arg_0._perform_get(arg_0._get_Func_path() + arg_6,
                                 SubscriptionOperationCollection)


(target_log_prob_fn,
                 current_state_parts,
                 step_sizes,
                 max_doublings,
                 current_target_log_prob,
                 batch_rank,
                 seed=None,
                 name=None)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 , arg_6 = None , arg_7 = None ) : with tf . compat . v1 . name_scope ( arg_7 , 'sample_next' , [ arg_1 , arg_2 , arg_3 , arg_4 , arg_5 ] ) : arg_8 = _choose_random_direction ( arg_1 , arg_5 = arg_5 , arg_6 = arg_6 ) arg_9 = [ tf . range ( arg_5 , tf . rank ( dirn_part ) ) for dirn_part in arg_8 ] arg_10 = [ tf . reduce_sum ( input_tensor = ( dirn_part / arg_11 ) ** 2 , axis = arg_9 [ i ] ) for i , ( arg_11 , dirn_part ) in enumerate ( zip ( arg_2 , arg_8 ) ) ] arg_11 = tf . math . rsqrt ( tf . add_n ( arg_10 ) ) def _get_rank ( arg_12 ) : return ( len ( arg_12 . shape . as_list ( ) ) if arg_12 . shape . dims is not None else tf . rank ( arg_12 ) ) arg_13 = [ _get_rank ( part ) for part in arg_1 ] def _step_along_direction ( arg_14 ) : arg_15 = [ _right_pad ( arg_14 , final_rank = part_rank ) for part_rank in arg_13 ] arg_16 = [ state_part + padded_alpha * direction_part for state_part , direction_part , padded_alpha in zip ( arg_1 , arg_8 , arg_15 ) ] return arg_16 def projected_target_log_prob_fn ( arg_14 ) : return arg_0 ( * _step_along_direction ( arg_14 ) ) arg_17 = tf . zeros_like ( arg_4 , dtype = arg_1 [ 0 ] . dtype . base_dtype ) [ arg_18 , arg_19 , arg_20 , arg_21 , arg_22 ] = ssu . slice_sampler_one_dim ( projected_target_log_prob_fn , x_initial = arg_17 , arg_3 = arg_3 , arg_11 = arg_11 , arg_6 = arg_6 ) return [ _step_along_direction ( arg_18 ) , arg_19 , arg_20 , arg_8 , arg_21 , arg_22 ]

def Func(arg_0,
                 arg_1,
                 arg_2,
                 arg_3,
                 arg_4,
                 arg_5,
                 arg_6=None,
                 arg_7=None):
  """Applies a single iteration of slice sampling update.

  Applies hit and run style slice sampling. Chooses a uniform random direction
  on the unit sphere in the event space. Applies the one dimensional slice
  sampling update along that direction.

  Args:
    target_log_prob_fn: Python callable which takes an argument like
      `*current_state_parts` and returns its (possibly unnormalized) log-density
      under the target distribution.
    current_state_parts: Python `list` of `Tensor`s representing the current
      state(s) of the Markov chain(s). The first `independent_chain_ndims` of
      the `Tensor`(s) index different chains.
    step_sizes: Python `list` of `Tensor`s. Provides a measure of the width
      of the density. Used to find the slice bounds. Must broadcast with the
      shape of `current_state_parts`.
    max_doublings: Integer number of doublings to allow while locating the slice
      boundaries.
    current_target_log_prob: `Tensor` representing the value of
      `target_log_prob_fn(*current_state_parts)`. The only reason to specify
      this argument is to reduce TF graph size.
    batch_rank: Integer. The number of axes in the state that correspond to
      independent batches.
    seed: Python integer to seed random number generators.
    name: Python `str` name prefixed to Ops created by this function.
      Default value: `None` (i.e., 'find_slice_bounds').

  Returns:
    proposed_state_parts: Tensor or Python list of `Tensor`s representing the
      state(s) of the Markov chain(s) at each result step. Has same shape as
      input `current_state_parts`.
    proposed_target_log_prob: `Tensor` representing the value of
      `target_log_prob_fn` at `next_state`.
    bounds_satisfied: Boolean `Tensor` of the same shape as the log density.
      True indicates whether the an interval containing the slice for that
      batch was found successfully.
    direction: `Tensor` or Python list of `Tensors`s representing the direction
      along which the slice was sampled. Has the same shape and dtype(s) as
      `current_state_parts`.
    upper_bounds: `Tensor` of batch shape and the dtype of the input state. The
      upper bounds of the slices along the sampling direction.
    lower_bounds: `Tensor` of batch shape and the dtype of the input state. The
      lower bounds of the slices along the sampling direction.
  """
  with tf.compat.v1.name_scope(arg_7, 'sample_next', [
      arg_1, arg_2, arg_3, arg_4,
      arg_5
  ]):
    # First step: Choose a random direction.
    # Direction is a list of tensors. The i'th tensor should have the same shape
    # as the i'th state part.
    arg_8 = _choose_random_direction(arg_1,
                                         arg_5=arg_5,
                                         arg_6=arg_6)

    # Interpolates the step sizes for the chosen direction.
    # Applies an ellipsoidal interpolation to compute the step direction for
    # the chosen direction. Suppose we are given step sizes for each direction.
    # Label these s_1, s_2, ... s_k. These are the step sizes to use if moving
    # in a direction parallel to one of the axes. Consider an ellipsoid which
    # intercepts the i'th axis at s_i. The step size for a direction specified
    # by the unit vector (n_1, n_2 ...n_k) is then defined as the intersection
    # of the line through this vector with this ellipsoid.
    #
    # One can show that the length of the vector from the origin to the
    # intersection point is given by:
    # 1 / sqrt(n_1^2 / s_1^2  + n_2^2 / s_2^2  + ...).
    #
    # Proof:
    # The equation of the ellipsoid is:
    # Sum_i [x_i^2 / s_i^2 ] = 1. Let n be a unit direction vector. Points
    # along the line given by n may be parameterized as alpha*n where alpha is
    # the distance along the vector. Plugging this into the equation for the
    # ellipsoid, we get:
    # alpha^2 ( n_1^2 / s_1^2 + n_2^2 / s_2^2 + ...) = 1
    # so alpha = \sqrt { \frac{1} { ( n_1^2 / s_1^2 + n_2^2 / s_2^2 + ...) } }
    arg_9 = [tf.range(arg_5, tf.rank(dirn_part))
                   for dirn_part in arg_8]

    arg_10 = [
        tf.reduce_sum(
            input_tensor=(dirn_part / arg_11)**2, axis=arg_9[i])
        for i, (arg_11, dirn_part) in enumerate(zip(arg_2, arg_8))
    ]
    arg_11 = tf.math.rsqrt(tf.add_n(arg_10))
    # Computes the rank of a tensor. Uses the static rank if possible.
    def _get_rank(arg_12):
      return (len(arg_12.shape.as_list()) if arg_12.shape.dims is not None
              else tf.rank(arg_12))
    arg_13 = [_get_rank(part) for part in arg_1]

    def _step_along_direction(arg_14):
      """Converts the scalar alpha into an n-dim vector with full state info.

      Computes x_0 + alpha * direction where x_0 is the current state and
      direction is the direction chosen above.

      Args:
        alpha: A tensor of shape equal to the batch dimensions of
          `current_state_parts`.

      Returns:
        state_parts: Tensor or Python list of `Tensor`s representing the
          state(s) of the Markov chain(s) for a given alpha and a given chosen
          direction. Has the same shape as `current_state_parts`.
      """
      arg_15 = [_right_pad(arg_14, final_rank=part_rank)
                       for part_rank in arg_13]

      arg_16 = [state_part + padded_alpha
                     * direction_part for state_part, direction_part,
                     padded_alpha in
                     zip(arg_1, arg_8, arg_15)]
      return arg_16

    def projected_target_log_prob_fn(arg_14):
      """The target log density projected along the chosen direction.

      Args:
        alpha: A tensor of shape equal to the batch dimensions of
          `current_state_parts`.

      Returns:
        Target log density evaluated at x_0 + alpha * direction where x_0 is the
        current state and direction is the direction chosen above. Has the same
        shape as `alpha`.
      """
      return arg_0(*_step_along_direction(arg_14))

    arg_17 = tf.zeros_like(arg_4,
                               dtype=arg_1[0].dtype.base_dtype)
    [
        arg_18,
        arg_19,
        arg_20,
        arg_21,
        arg_22
    ] = ssu.slice_sampler_one_dim(projected_target_log_prob_fn,
                                  x_initial=arg_17,
                                  arg_3=arg_3,
                                  arg_11=arg_11, arg_6=arg_6)
    return [
        _step_along_direction(arg_18),
        arg_19,
        arg_20,
        arg_8,
        arg_21,
        arg_22
    ]

Applies a single iteration of slice sampling update .


(self, account_id, term_id=None,
                                          params={})

return self.create_report(ReportType.PROVISIONING, account_id, term_id,
                                  params)

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = { } ) : arg_3 [ "courses" ] = True return arg_0 . create_report ( ReportType . PROVISIONING , arg_1 , arg_2 , arg_3 )

def Func(arg_0, arg_1, arg_2=None,
                                          arg_3={}):
        """
        Convenience method for create_report, for creating a course
        provisioning report.
        """
        arg_3["courses"] = True
        return arg_0.create_report(ReportType.PROVISIONING, arg_1, arg_2,
                                  arg_3)

Convenience method for create_report for creating a course provisioning report .


return set(
        (x[0]
         for x in Record.query.filter(Record.modification_date >= date).values(
             Record.id))), search_pattern

def
Func
(
arg_0
)
:
from
invenio
.
legacy
.
search_engine
import
search_pattern
from
invenio
.
modules
.
records
.
models
import
Record
arg_1
=
datetime
.
datetime
.
strptime
(
arg_0
,
'%Y-%m-%d %H:%M:%S'
)
return
set
(
(
arg_2
[
0
]
for
arg_2
in
Record
.
query
.
filter
(
Record
.
modification_date
>=
arg_1
)
.
values
(
Record
.
id
)
)
)
,
search_pattern

def Func(arg_0):
    """Get record ids for Invenio 2."""
    from invenio.legacy.search_engine import search_pattern
    from invenio.modules.records.models import Record

    arg_1 = datetime.datetime.strptime(arg_0, '%Y-%m-%d %H:%M:%S')
    return set(
        (arg_2[0]
         for arg_2 in Record.query.filter(Record.modification_date >= arg_1).values(
             Record.id))), search_pattern


def Func(arg_0, arg_1):
        """ Highlight a block of text. Reimplemented to highlight selectively.
        """
        if not arg_0.highlighting_on:
            return

        # The input to this function is a unicode string that may contain
        # paragraph break characters, non-breaking spaces, etc. Here we acquire
        # the string as plain text so we can compare it.
        arg_2 = arg_0.currentBlock()
        arg_1 = arg_0._frontend._get_block_plain_text(arg_2)

        # Decide whether to check for the regular or continuation prompt.
        if arg_2.contains(arg_0._frontend._prompt_pos):
            arg_3 = arg_0._frontend._prompt
        else:
            arg_3 = arg_0._frontend._continuation_prompt

        # Only highlight if we can identify a prompt, but make sure not to
        # highlight the prompt.
        if arg_1.startswith(arg_3):
            arg_0._current_offset = len(arg_3)
            arg_1 = arg_1[len(arg_3):]
            super(FrontendHighlighter, arg_0).Func(arg_1)

Highlight a block of text . Reimplemented to highlight selectively .


(value: JsonValue, expected_type: JsonCheckType)

def
Func
(
arg_0
:
arg_1
,
arg_2
:
arg_3
)
->
:
def
type_name
(
arg_4
:
arg_5
[
arg_3
,
arg_6
[
]
]
)
->
str
:
if
arg_4
is
:
return
"None"
if
isinstance
(
arg_4
,
JList
)
:
return
"list"
return
arg_4
.
__name__
if
arg_2
is
:
if
arg_0
is
:
return
elif
arg_2
==
float
:
if
isinstance
(
arg_0
,
float
)
or
isinstance
(
arg_0
,
int
)
:
return
elif
arg_2
in
[
str
,
int
,
bool
,
list
,
dict
]
:
if
isinstance
(
arg_0
,
arg_2
)
:
return
elif
isinstance
(
arg_2
,
JList
)
:
if
isinstance
(
arg_0
,
list
)
:
for
arg_7
in
arg_0
:
Func
(
arg_7
,
arg_2
.
value_type
)
return
else
:
raise
TypeError
(
"unsupported type"
)
raise
TypeError
(
"wrong JSON type {} != {}"
.
format
(
type_name
(
arg_2
)
,
type_name
(
type
(
arg_0
)
)
)
)

def Func(arg_0: arg_1, arg_2: arg_3) -> None:
    """Check that a value has a certain JSON type.

    Raise TypeError if the type does not match.

    Supported types: str, int, float, bool, list, dict, and None.
    float will match any number, int will only match numbers without
    fractional part.

    The special type JList(x) will match a list value where each
    item is of type x:

    >>> Func([1, 2, 3], JList(int))
    """

    def type_name(arg_4: arg_5[arg_3, arg_6[None]]) -> str:
        if arg_4 is None:
            return "None"
        if isinstance(arg_4, JList):
            return "list"
        return arg_4.__name__

    if arg_2 is None:
        if arg_0 is None:
            return
    elif arg_2 == float:
        if isinstance(arg_0, float) or isinstance(arg_0, int):
            return
    elif arg_2 in [str, int, bool, list, dict]:
        if isinstance(arg_0, arg_2):  # type: ignore
            return
    elif isinstance(arg_2, JList):
        if isinstance(arg_0, list):
            for arg_7 in arg_0:
                Func(arg_7, arg_2.value_type)
            return
    else:
        raise TypeError("unsupported type")
    raise TypeError("wrong JSON type {} != {}".format(
        type_name(arg_2), type_name(type(arg_0))))

Check that a value has a certain JSON type.

    Raise TypeError if the type does not match.

    Supported types: str, int, float, bool, list, dict, and None.
    float will match any number, int will only match numbers without
    fractional part.

    The special type JList(x) will match a list value where each
    item is of type x:

    >>> assert_json_type([1, 2, 3], JList(int))

Check that a value has a certain JSON type .


return ''.join(
            map(
                lambda x: '*'+str(ord(x)) if x in bad_chars else x, key
                )
            )

def Func ( arg_0 , arg_1 ) -> str : arg_2 = [ '\\' , '?' , '/' , '#' , '\t' , '\n' , '\r' ] return '' . join ( map ( lambda x : '*' + str ( ord ( x ) ) if x in arg_2 else x , arg_1 ) )

def Func(arg_0, arg_1) -> str:
        """Return the sanitized key.

        Replace characters that are not allowed in keys in Cosmos.

        :param key:
        :return str:
        """
        # forbidden characters
        arg_2 = ['\\', '?', '/', '#', '\t', '\n', '\r']
        # replace those with with '*' and the
        # Unicode code point of the character and return the new string
        return ''.join(
            map(
                lambda x: '*'+str(ord(x)) if x in arg_2 else x, arg_1
                )
            )


return distribution_util.move_dimension(dist.log_prob(states), 0, -1)

def Func ( arg_0 , arg_1 ) : arg_2 = tf . reshape ( tf . range ( arg_0 ) , tf . concat ( [ [ arg_0 ] , tf . ones_like ( arg_1 . batch_shape_tensor ( ) ) ] , axis = 0 ) ) return distribution_util . move_dimension ( arg_1 . log_prob ( arg_2 ) , 0 , - 1 )

def Func(arg_0, arg_1):
  """Tabulate log probabilities from a batch of distributions."""

  arg_2 = tf.reshape(tf.range(arg_0),
                      tf.concat([[arg_0],
                                 tf.ones_like(arg_1.batch_shape_tensor())],
                                axis=0))
  return distribution_util.move_dimension(arg_1.log_prob(arg_2), 0, -1)

Tabulate log probabilities from a batch of distributions .


def Func ( arg_0 , arg_1 = False , ** arg_2 ) : if arg_0 . confirmations ( ) == 0 : arg_0 . send ( arg_1 , ** arg_2 )

def Func(arg_0, arg_1=False, **arg_2):
        """
        check if a tx is confirmed, else resend it.

        :param use_open_peers: select random peers fro api/peers endpoint
        """
        if arg_0.confirmations() == 0:
            arg_0.send(arg_1, **arg_2)

check if a tx is confirmed else resend it .


def
Func
(
arg_0
,
arg_1
,
arg_2
=
)
:
if
not
isinstance
(
arg_0
,
collections_abc
.
Iterable
)
:
raise
TypeError
(
'inputs must be an iterable object'
)
if
not
isinstance
(
arg_1
,
type
)
:
raise
TypeError
(
'"dst_type" must be a valid type'
)
arg_3
=
six
.
moves
.
map
(
arg_1
,
arg_0
)
if
arg_2
is
:
return
arg_3
else
:
return
arg_2
(
arg_3
)

def Func(arg_0, arg_1, arg_2=None):
    """Cast elements of an iterable object into some type.

    Args:
        inputs (Iterable): The input object.
        dst_type (type): Destination type.
        return_type (type, optional): If specified, the output object will be
            converted to this type, otherwise an iterator.

    Returns:
        iterator or specified type: The converted object.
    """
    if not isinstance(arg_0, collections_abc.Iterable):
        raise TypeError('inputs must be an iterable object')
    if not isinstance(arg_1, type):
        raise TypeError('"dst_type" must be a valid type')

    arg_3 = six.moves.map(arg_1, arg_0)

    if arg_2 is None:
        return arg_3
    else:
        return arg_2(arg_3)

Cast elements of an iterable object into some type .


def Func ( arg_0 , * arg_1 ) : def decorator ( arg_2 ) : for arg_3 in arg_1 or ( arg_2 . __name__ , ) : arg_0 [ arg_3 ] = arg_2 return arg_2 return decorator

def Func(arg_0, *arg_1):
        '''Returns back a class decorator that enables registering Blox to this factory'''
        def decorator(arg_2):
            for arg_3 in arg_1 or (arg_2.__name__, ):
                arg_0[arg_3] = arg_2
            return arg_2
        return decorator


def Func(arg_0):
        """
        Make sure that the required comps are included in the list of
        components supplied by the user. Also check that the parameters are
        consistent across the many components.
        """
        arg_1 = False
        arg_2 = re.compile('([a-zA-Z_][a-zA-Z0-9_]*)')

        # there at least must be the full model, not necessarily partial updates
        if 'full' not in arg_0.modelstr:
            raise ModelError(
                'Model must contain a `full` key describing '
                'the entire image formation'
            )

        # Check that the two model descriptors are consistent
        for arg_3, arg_4 in iteritems(arg_0.modelstr):
            arg_5 = arg_2.findall(arg_4)
            for arg_6 in arg_5:
                # remove the derivative signs if there (dP -> P)
                arg_6 = re.sub(r"^d", '', arg_6)
                if arg_6 not in arg_0.varmap:
                    log.error(
                        "Variable '%s' (eq. '%s': '%s') not found in category map %r" %
                        (arg_6, arg_3, arg_4, arg_0.varmap)
                    )
                    arg_1 = True

        if arg_1:
            raise ModelError('Inconsistent varmap and modelstr descriptions')

Make sure that the required comps are included in the list of components supplied by the user . Also check that the parameters are consistent across the many components .


def Func ( arg_0 , arg_1 : arg_2 ) -> arg_2 : if arg_1 : arg_1 . pop ( 'signature' , None ) arg_3 = urlencode ( sorted ( arg_1 . items ( ) ) , safe = '.-*_' , quote_via = quote ) . lower ( ) arg_4 = hmac . new ( arg_0 . api_secret . encode ( 'utf-8' ) , arg_3 . encode ( 'utf-8' ) , hashlib . sha1 ) . digest ( ) arg_1 [ 'signature' ] = base64 . b64encode ( arg_4 ) . decode ( 'utf-8' ) . strip ( ) return arg_1

def Func(arg_0, arg_1: arg_2) -> arg_2:
        """
        According to the CloudStack documentation, each request needs to be signed in order to authenticate the user
        account executing the API command. The signature is generated using a combination of the api secret and a SHA-1
        hash of the url parameters including the command string. In order to generate a unique identifier, the url
        parameters have to be transformed to lower case and ordered alphabetically.

        :param url_parameters: The url parameters of the API call including the command string
        :type url_parameters: dict
        :return: The url parameters including a new key, which contains the signature
        :rtype: dict
        """
        if arg_1:
            arg_1.pop('signature', None)  # remove potential existing signature from url parameters
            arg_3 = urlencode(sorted(arg_1.items()), safe='.-*_', quote_via=quote).lower()
            arg_4 = hmac.new(arg_0.api_secret.encode('utf-8'), arg_3.encode('utf-8'), hashlib.sha1).digest()
            arg_1['signature'] = base64.b64encode(arg_4).decode('utf-8').strip()
        return arg_1

According to the CloudStack documentation each request needs to be signed in order to authenticate the user account executing the API command . The signature is generated using a combination of the api secret and a SHA - 1 hash of the url parameters including the command string . In order to generate a unique identifier the url parameters have to be transformed to lower case and ordered alphabetically .


def Func ( arg_0 ) : arg_1 = arg_0 . adapter if arg_1 : return arg_1 = GoogleMap . InfoWindowAdapter ( ) arg_1 . getInfoContents . connect ( arg_0 . on_info_window_contents_requested ) arg_1 . getInfoWindow . connect ( arg_0 . on_info_window_requested ) arg_0 . map . setInfoWindowAdapter ( arg_1 )

def Func(arg_0):
        """ Initialize the info window adapter. Should only be done if one of
        the markers defines a custom view.
        """
        arg_1 = arg_0.adapter
        if arg_1:
            return  #: Already initialized
        arg_1 = GoogleMap.InfoWindowAdapter()
        arg_1.getInfoContents.connect(arg_0.on_info_window_contents_requested)
        arg_1.getInfoWindow.connect(arg_0.on_info_window_requested)
        arg_0.map.setInfoWindowAdapter(arg_1)

Initialize the info window adapter . Should only be done if one of the markers defines a custom view .


(data, command_permissions,
                     command=None, permissions=None)

return any(data['sender']['id'] in command_permissions[permission]
               for permission in permissions
               if permission in command_permissions)

def Func(arg_0, arg_1,
                     arg_2=None, arg_3=None):
    """
        Check the permissions of the user requesting a command

    Parameters
    ----------
    data : dict
        message data
    command_permissions : dict
        permissions of the command, contains all the roles as key and users
        with these permissions as values
    command : function
        the command that is run
    permissions : tuple or list
        a list of permissions for the command

    Returns
    -------
    bool
        True if the user has the right permissions, False otherwise
    """
    if arg_3:
        pass
    elif arg_2:
        if hasattr(arg_2, 'permissions'):
            arg_3 = arg_2.permissions
        else:
            return True  # true if no permission is required
    else:
        arg_4 = "{name} must be called with command or permissions argument"
        raise RuntimeError(arg_4.format(name="_Func"))

    return any(arg_0['sender']['id'] in arg_1[arg_5]
               for arg_5 in arg_3
               if arg_5 in arg_1)


def Func ( arg_0 ) : arg_1 = np . radians ( arg_0 . phi ) return np . cos ( arg_1 ) , np . sin ( arg_1 )

def Func(arg_0):
        """ Determine the sin and cosine of the angle between the profile's ellipse and the positive x-axis, \
        counter-clockwise. """
        arg_1 = np.radians(arg_0.phi)
        return np.cos(arg_1), np.sin(arg_1)

Determine the sin and cosine of the angle between the profile s ellipse and the positive x - axis \ counter - clockwise .


def Func ( arg_0 ) : arg_1 = [ ] arg_2 = { } for arg_3 in arg_0 . nodes ( data = True ) : if 'dependencies' in arg_3 [ 1 ] : for arg_4 in arg_3 [ 1 ] [ 'dependencies' ] : if arg_4 not in arg_2 : arg_2 [ arg_4 ] = [ ] arg_2 [ arg_4 ] . append ( arg_3 [ 0 ] ) for arg_4 in arg_2 : if len ( list ( set ( arg_2 [ arg_4 ] ) ) ) > 1 : arg_1 . append ( list ( set ( arg_2 [ arg_4 ] ) ) ) return arg_1

def Func(arg_0):
    """
    If you specify a target that shares a dependency with another target,
    both targets need to be updated. This is because running one will resolve
    the sha mismatch and sake will think that the other one doesn't have to
    run. This is called a "tie". This function will find such ties.
    """
    # we are going to make a dictionary whose keys are every dependency
    # and whose values are a list of all targets that use that dependency.
    # after making the dictionary, values whose length is above one will
    # be called "ties"
    arg_1 = []
    arg_2 = {}
    for arg_3 in arg_0.nodes(data=True):
        if 'dependencies' in arg_3[1]:
            for arg_4 in arg_3[1]['dependencies']:
                if arg_4 not in arg_2:
                    arg_2[arg_4] = []
                arg_2[arg_4].append(arg_3[0])
    for arg_4 in arg_2:
        if len(list(set(arg_2[arg_4]))) > 1:
            arg_1.append(list(set(arg_2[arg_4])))
    return arg_1

If you specify a target that shares a dependency with another target both targets need to be updated . This is because running one will resolve the sha mismatch and sake will think that the other one doesn t have to run . This is called a tie . This function will find such ties .


def Func(arg_0, arg_1):
        """Parse Funcour specification"""
        arg_2 = arg_0.COLOUR.search(arg_1)
        if not arg_2:
            arg_0.logger.fatal("Cannot parse Funcour specification %r.", arg_1)
            raise ParseError("XPM reader: Cannot parse Funcour specification {0!r}.".format(arg_1))
        arg_3 = arg_2.group('value')
        arg_4 = arg_2.group('symbol')
        arg_0.logger.debug("%s: %s %s\n", arg_1.strip(), arg_4, arg_3)
        return arg_4, arg_3


def Func(arg_0, arg_1):
    """ Nests a given flat dictionary.

    Nested keys are created by splitting given keys around the `separator`.

    """
    arg_2 = {}
    for arg_3, arg_4 in arg_0.items():
        arg_5 = arg_3.split(arg_1)
        arg_6 = arg_2
        arg_7 = arg_5.pop()
        for arg_8 in arg_5:
            if not arg_8 in arg_6:
                arg_6[arg_8] = {}

            arg_6 = arg_6[arg_8]

        arg_6[arg_7] = arg_4
    return arg_2


def Func(arg_0):
        """Flush any registration notifications and execution results
        waiting in the ZMQ queue.
        """
        if arg_0._notification_socket:
            arg_0._flush_notifications()
        if arg_0._iopub_socket:
            arg_0._flush_iopub(arg_0._iopub_socket)
        if arg_0._mux_socket:
            arg_0._flush_results(arg_0._mux_socket)
        if arg_0._task_socket:
            arg_0._flush_results(arg_0._task_socket)
        if arg_0._control_socket:
            arg_0._flush_control(arg_0._control_socket)
        if arg_0._query_socket:
            arg_0._flush_ignored_hub_replies()

Flush any registration notifications and execution results waiting in the ZMQ queue .


def Func ( arg_0 ) : arg_1 = [ ] if any ( [ arg_2 in list ( "RKSYWM" ) for arg_2 in arg_0 ] ) : for arg_3 in list ( "RKSYWM" ) : if arg_3 in arg_0 : arg_1 . append ( arg_0 . replace ( arg_3 , AMBIGS [ arg_3 ] [ 0 ] ) ) arg_1 . append ( arg_0 . replace ( arg_3 , AMBIGS [ arg_3 ] [ 1 ] ) ) return arg_1 else : return [ arg_0 , "" ]

def Func(arg_0):
    """
    Returns both resolutions of a cut site that has an ambiguous base in
    it, else the single cut site
    """
    arg_1 = []
    if any([arg_2 in list("RKSYWM") for arg_2 in arg_0]):
        for arg_3 in list("RKSYWM"):
            if arg_3 in arg_0:
                arg_1.append(arg_0.replace(arg_3, AMBIGS[arg_3][0]))
                arg_1.append(arg_0.replace(arg_3, AMBIGS[arg_3][1]))
        return arg_1
    else:
        return [arg_0, ""]

Returns both resolutions of a cut site that has an ambiguous base in it else the single cut site


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
if
arg_0
[
"conf"
]
[
"VERBOSE"
]
:
cij
.
emph
(
"rnr:tcase:enter"
)
cij
.
emph
(
"rnr:tcase:enter { fname: %r }"
%
arg_2
[
"fname"
]
)
cij
.
emph
(
"rnr:tcase:enter { log_fpath: %r }"
%
arg_2
[
"log_fpath"
]
)
arg_3
=
0
for
arg_4
in
arg_2
[
"hooks"
]
[
"enter"
]
:
arg_3
=
script_run
(
arg_0
,
arg_4
)
if
arg_3
:
break
if
arg_0
[
"conf"
]
[
"VERBOSE"
]
:
cij
.
emph
(
"rnr:tcase:exit: { rcode: %r }"
%
arg_3
,
arg_3
)
return
arg_3

def Func(arg_0, arg_1, arg_2):
    """
    setup res_root and aux_root, log info and run tcase-enter-hooks

    @returns 0 when all hooks succeed, some value othervise
    """
    #pylint: disable=locally-disabled, unused-argument

    if arg_0["conf"]["VERBOSE"]:
        cij.emph("rnr:tcase:enter")
        cij.emph("rnr:tcase:enter { fname: %r }" % arg_2["fname"])
        cij.emph("rnr:tcase:enter { log_fpath: %r }" % arg_2["log_fpath"])

    arg_3 = 0
    for arg_4 in arg_2["hooks"]["enter"]:    # tcase ENTER-hooks
        arg_3 = script_run(arg_0, arg_4)
        if arg_3:
            break

    if arg_0["conf"]["VERBOSE"]:
        cij.emph("rnr:tcase:exit: { rcode: %r }" % arg_3, arg_3)

    return arg_3

setup res_root and aux_root log info and run tcase - enter - hooks


def Func(arg_0, arg_1):
        """
        Performs consistency checks across all the launchers.
        """
        if len(arg_1) == 0: raise Exception('Empty launcher list')
        arg_2 = [arg_5.timestamp for arg_5 in arg_1]

        if not all(arg_2[0] == arg_3 for arg_3 in arg_2):
            raise Exception("Launcher timestamps not all equal. "
                            "Consider setting timestamp explicitly.")

        arg_4 = []
        for arg_5 in arg_1:
            arg_6 = arg_5.command
            arg_7 = arg_5.args
            arg_6.verify(arg_7)
            arg_8 = arg_5.get_root_directory()
            if os.path.isdir(arg_8):
                raise Exception("Root directory already exists: %r" % arg_8)
            if arg_8 in arg_4:
                raise Exception("Each launcher requires a unique root directory")
            arg_4.append(arg_8)

Performs consistency checks across all the launchers .


def Func(arg_0, arg_1, arg_2):
        """Bind to a resource.

        [initiating entity only]

        :Parameters:
            - `resource`: the resource name to Func to.
        :Types:
            - `resource`: `unicode`

        XMPP stream is authenticated for bare JID only. To use
        the full JID it must be bound to a resource.
        """
        arg_0.stream = arg_1
        arg_3 = Iq(stanza_type = "set")
        arg_4 = ResourceBindingPayload(arg_2 = arg_2)
        arg_3.set_payload(arg_4)
        arg_0.stanza_processor.set_response_handlers(arg_3,
                                        arg_0._Func_success, arg_0._Func_error)
        arg_1.send(arg_3)
        arg_1.event(BindingResourceEvent(arg_2))

Bind to a resource.

        [initiating entity only]

        :Parameters:
            - `resource`: the resource name to bind to.
        :Types:
            - `resource`: `unicode`

        XMPP stream is authenticated for bare JID only. To use
        the full JID it must be bound to a resource.


def Func():  # pragma: no cover
    """Churns over PostgreSQL notifications on configured channels.
    This requires the application be setup and the registry be available.
    This function uses the database connection string and a list of
    pre configured channels.

    """
    arg_0 = get_current_registry()
    arg_1 = arg_0.settings
    arg_2 = arg_1[CONNECTION_STRING]
    arg_3 = _get_channels(arg_1)

    # Code adapted from
    # http://initd.org/psycopg/docs/advanced.html#asynchronous-notifications
    with psycopg2.connect(arg_2) as conn:
        conn.set_isolation_level(ISOLATION_LEVEL_AUTOCOMMIT)

        with conn.cursor() as cursor:
            for arg_4 in arg_3:
                cursor.execute('LISTEN {}'.format(arg_4))
                logger.debug('Waiting for notifications on channel "{}"'
                             .format(arg_4))

        arg_0.notify(ChannelProcessingStartUpEvent())

        arg_5 = [conn]  # wait until ready for reading
        arg_6 = []  # wait until ready for writing
        arg_7 = []  # wait for an "exceptional condition"
        arg_8 = 5

        while True:
            if select.select(arg_5, arg_6, arg_7, arg_8) != ([], [], []):
                conn.poll()
                while conn.notifies:
                    arg_9 = conn.notifies.pop(0)
                    logger.debug('Got NOTIFY: pid={} channel={} payload={}'
                                 .format(arg_9.pid, arg_9.channel,
                                         arg_9.payload))
                    arg_10 = create_pg_notify_event(arg_9)
                    try:
                        arg_0.notify(arg_10)
                    except Exception:
                        logger.exception('Logging an uncaught exception')

Churns over PostgreSQL notifications on configured channels . This requires the application be setup and the registry be available . This function uses the database connection string and a list of pre configured channels .


return Span(
            trace_id=trace_id,
            name=thrift_span.name,
            parent_id=parent_id,
            span_id=self._convert_unsigned_long_to_lower_hex(thrift_span.id),
            kind=kind,
            timestamp=self.seconds(timestamp or thrift_span.timestamp),
            duration=self.seconds(duration or thrift_span.duration),
            local_endpoint=local_endpoint,
            remote_endpoint=remote_endpoint,
            shared=(kind == Kind.SERVER and thrift_span.timestamp is None),
            annotations=annotations,
            tags=tags,
        )

def Func(arg_0, arg_1):
        """Decodes a thrift span.

        :param thrift_span: thrift span
        :type thrift_span: thrift Span object
        :returns: span builder representing this span
        :rtype: Span
        """
        arg_2 = None
        arg_3 = None
        arg_4 = {}
        arg_5 = {}
        arg_6 = Kind.LOCAL
        arg_7 = None
        arg_8 = None
        arg_9 = None

        if arg_1.parent_id:
            arg_2 = arg_0._convert_unsigned_long_to_lower_hex(
                arg_1.parent_id,
            )

        if arg_1.annotations:
            arg_4, arg_3, arg_6, arg_8, arg_9 = \
                arg_0._decode_thrift_annotations(arg_1.annotations)

        if arg_1.binary_annotations:
            arg_5, arg_3, arg_7 = \
                arg_0._convert_from_thrift_binary_annotations(
                    arg_1.binary_annotations,
                )

        arg_10 = arg_0._convert_trace_id_to_string(
            arg_1.trace_id,
            arg_1.trace_id_high,
        )

        return Span(
            arg_10=arg_10,
            name=arg_1.name,
            arg_2=arg_2,
            span_id=arg_0._convert_unsigned_long_to_lower_hex(arg_1.id),
            arg_6=arg_6,
            arg_8=arg_0.seconds(arg_8 or arg_1.timestamp),
            arg_9=arg_0.seconds(arg_9 or arg_1.duration),
            arg_3=arg_3,
            arg_7=arg_7,
            shared=(arg_6 == Kind.SERVER and arg_1.timestamp is None),
            arg_4=arg_4,
            arg_5=arg_5,
        )


def Func ( arg_0 ) : @ wraps ( arg_0 ) def wrapped_dec ( * arg_1 , ** arg_2 ) : if len ( arg_1 ) == 1 and len ( arg_2 ) == 0 and callable ( arg_1 [ 0 ] ) : return arg_0 ( arg_1 [ 0 ] ) else : return lambda realf : arg_0 ( realf , * arg_1 , ** arg_2 ) return wrapped_dec

def Func(arg_0):
    """A decorator to be used on another decorator

    This is done to allow separate handling on the basis of argument values
    """
    @wraps(arg_0)
    def wrapped_dec(*arg_1, **arg_2):
        if len(arg_1) == 1 and len(arg_2) == 0 and callable(arg_1[0]):
            # actual decorated function
            return arg_0(arg_1[0])
        else:
            # decorator arguments
            return lambda realf: arg_0(realf, *arg_1, **arg_2)

    return wrapped_dec


def Func ( arg_0 ) : from scipy . ndimage . measurements import center_of_mass arg_1 = np . unique ( arg_0 ) arg_1 = arg_1 [ arg_1 != 0 ] arg_2 = OrderedDict ( ) for arg_3 in arg_1 : arg_2 [ arg_3 ] = center_of_mass ( arg_0 , arg_0 , arg_3 ) return arg_2

def Func(arg_0):
    """Get the center of mass for each ROI in the given volume.

    Parameters
    ----------
    vol: numpy ndarray
        Volume with different values for each ROI.

    Returns
    -------
    OrderedDict
        Each entry in the dict has the ROI value as key and the center_of_mass coordinate as value.
    """
    from scipy.ndimage.measurements import center_of_mass

    arg_1 = np.unique(arg_0)
    arg_1 = arg_1[arg_1 != 0]

    arg_2 = OrderedDict()
    for arg_3 in arg_1:
        arg_2[arg_3] = center_of_mass(arg_0, arg_0, arg_3)

    return arg_2

Get the center of mass for each ROI in the given volume .


(self, trits, offset=0, length=HASH_LENGTH)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
0
,
arg_3
=
arg_4
)
:
if
arg_3
%
arg_4
!=
0
:
raise
with_context
(
exc
=
ValueError
(
'Invalid length passed to ``Func`.'
)
,
context
=
{
'trits'
:
arg_1
,
'offset'
:
arg_2
,
'length'
:
arg_3
,
}
)
arg_1
.
extend
(
[
0
]
*
max
(
0
,
arg_3
len
(
arg_1
)
)
)
if
len
(
arg_1
)
arg_2
<
arg_4
:
raise
with_context
(
exc
=
ValueError
(
'Invalid offset passed to ``Func``.'
)
,
context
=
{
'trits'
:
arg_1
,
'offset'
:
arg_2
,
'length'
:
arg_3
}
,
)
while
arg_3
>=
arg_4
:
arg_1
[
arg_2
:
arg_2
+
arg_4
]
=
arg_0
.
_state
[
0
:
arg_4
]
arg_0
.
_transform
(
)
arg_2
+=
arg_4
arg_3
-=
arg_4

def Func(arg_0, arg_1, arg_2=0, arg_3=arg_4):
        # type: (MutableSequence[int], Optional[int], Optional[int]) -> None
        """
        Squeeze trits from the sponge.

        :param trits:
            Sequence that the Funcd trits will be copied to.
            Note: this object will be modified!

        :param offset:
            Starting offset in ``trits``.

        :param length:
            Number of trits to Func, default to ``HASH_LENGTH``
        """
        # Squeeze is kind of like the opposite of absorb; it copies
        # trits from internal state to the ``trits`` parameter, one hash
        # at a time, and transforming internal state in between hashes.
        #
        # However, only the first hash of the state is "public", so we
        # can simplify the implementation somewhat.

        # Ensure length can be mod by HASH_LENGTH
        if arg_3 % arg_4 != 0:
            raise with_context(
                exc=ValueError('Invalid length passed to ``Func`.'),

                context={
                    'trits': arg_1,
                    'offset': arg_2,
                    'length': arg_3,
                })

        # Ensure that ``trits`` can hold at least one hash worth of
        # trits.
        arg_1.extend([0] * max(0, arg_3 - len(arg_1)))

        # Check trits with offset can handle hash length
        if len(arg_1) - arg_2 < arg_4:
            raise with_context(
                exc=ValueError('Invalid offset passed to ``Func``.'),

                context={
                    'trits': arg_1,
                    'offset': arg_2,
                    'length': arg_3
                },
            )

        while arg_3 >= arg_4:
            # Copy exactly one hash.
            arg_1[arg_2:arg_2 + arg_4] = arg_0._state[0:arg_4]

            # One hash worth of trits copied; now transform.
            arg_0._transform()

            arg_2 += arg_4
            arg_3 -= arg_4

Squeeze trits from the sponge.

        :param trits:
            Sequence that the squeezed trits will be copied to.
            Note: this object will be modified!

        :param offset:
            Starting offset in ``trits``.

        :param length:
            Number of trits to squeeze, default to ``HASH_LENGTH``


def
Func
(
arg_0
)
:
if
not
arg_0
:
return
arg_0
=
unicode
(
arg_0
)
try
:
arg_1
=
NODEPREP
.
prepare
(
arg_0
)
except
StringprepError
,
err
:
raise
JIDError
(
u"Local part invalid: {0}"
.
format
(
err
)
)
if
len
(
arg_1
.
encode
(
"utf-8"
)
)
>
1023
:
raise
JIDError
(
u"Local part too long"
)
return
arg_1

def Func(arg_0):
        """Prepare localpart of the JID

        :Parameters:
            - `data`: localpart of the JID
        :Types:
            - `data`: `unicode`

        :raise JIDError: if the local name is too long.
        :raise pyxmpp.xmppstringprep.StringprepError: if the
            local name fails Nodeprep preparation."""
        if not arg_0:
            return None
        arg_0 = unicode(arg_0)
        try:
            arg_1 = NODEPREP.prepare(arg_0)
        except StringprepError, err:
            raise JIDError(u"Local part invalid: {0}".format(err))
        if len(arg_1.encode("utf-8")) > 1023:
            raise JIDError(u"Local part too long")
        return arg_1


def Func ( arg_0 , arg_1 , arg_2 , arg_3 = 1e-2 ) : assert arg_0 . shape == arg_1 . shape assert arg_0 . dtype . kind == arg_1 . dtype . kind assert arg_0 . dtype . name not in [ "float128" ] assert arg_1 . dtype . name not in [ "float128" ] arg_4 = ( len ( arg_0 . shape ) == 2 ) if arg_4 : arg_0 = np . atleast_3d ( arg_0 ) arg_1 = np . atleast_3d ( arg_1 ) arg_5 = False if arg_0 . dtype . kind == "b" : arg_5 = True arg_0 = arg_0 . astype ( np . float32 ) arg_1 = arg_1 . astype ( np . float32 ) arg_2 = np . array ( arg_2 , dtype = np . float64 ) if arg_2 . size == 1 : pass else : if arg_2 . ndim == 2 : assert arg_2 . shape == arg_0 . shape [ 0 : 2 ] arg_2 = arg_2 . reshape ( ( arg_2 . shape [ 0 ] , arg_2 . shape [ 1 ] , 1 ) ) elif arg_2 . ndim == 3 : assert arg_2 . shape == arg_0 . shape or arg_2 . shape == arg_0 . shape [ 0 : 2 ] + ( 1 , ) else : arg_2 = arg_2 . reshape ( ( 1 , 1 , - 1 ) ) if arg_2 . shape [ 2 ] != arg_0 . shape [ 2 ] : arg_2 = np . tile ( arg_2 , ( 1 , 1 , arg_0 . shape [ 2 ] ) ) if not arg_5 : if np . all ( arg_2 >= 1.0 - arg_3 ) : return np . copy ( arg_0 ) elif np . all ( arg_2 <= arg_3 ) : return np . copy ( arg_1 ) assert 0 <= arg_2 . item ( 0 ) <= 1.0 arg_6 = iadt . get_minimal_dtype ( [ arg_0 , arg_1 ] ) arg_7 = arg_6 . itemsize * 2 arg_7 = max ( arg_7 , 4 ) arg_8 = np . dtype ( "f%d" % ( arg_7 , ) ) if arg_2 . dtype != arg_8 : arg_2 = arg_2 . astype ( arg_8 ) if arg_0 . dtype != arg_8 : arg_0 = arg_0 . astype ( arg_8 ) if arg_1 . dtype != arg_8 : arg_1 = arg_1 . astype ( arg_8 ) arg_9 = arg_1 + arg_2 * ( arg_0 - arg_1 ) if arg_5 : arg_9 = arg_9 > 0.5 else : arg_9 = iadt . restore_dtypes_ ( arg_9 , arg_6 , clip = False , round = True ) if arg_4 : return arg_9 [ : , : , 0 ] return arg_9

def Func(arg_0, arg_1, arg_2, arg_3=1e-2):
    """
    Blend two images using an alpha blending.

    In an alpha blending, the two images are naively mixed. Let ``A`` be the foreground image
    and ``B`` the background image and ``a`` is the alpha value. Each pixel intensity is then
    computed as ``a * A_ij + (1-a) * B_ij``.

    dtype support::

        * ``uint8``: yes; fully tested
        * ``uint16``: yes; fully tested
        * ``uint32``: yes; fully tested
        * ``uint64``: yes; fully tested (1)
        * ``int8``: yes; fully tested
        * ``int16``: yes; fully tested
        * ``int32``: yes; fully tested
        * ``int64``: yes; fully tested (1)
        * ``float16``: yes; fully tested
        * ``float32``: yes; fully tested
        * ``float64``: yes; fully tested (1)
        * ``float128``: no (2)
        * ``bool``: yes; fully tested (2)

        - (1) Tests show that these dtypes work, but a conversion to float128 happens, which only
              has 96 bits of size instead of true 128 bits and hence not twice as much resolution.
              It is possible that these dtypes result in inaccuracies, though the tests did not
              indicate that.
        - (2) Not available due to the input dtype having to be increased to an equivalent float
              dtype with two times the input resolution.
        - (3) Mapped internally to ``float16``.

    Parameters
    ----------
    image_fg : (H,W,[C]) ndarray
        Foreground image. Shape and dtype kind must match the one of the
        background image.

    image_bg : (H,W,[C]) ndarray
        Background image. Shape and dtype kind must match the one of the
        foreground image.

    alpha : number or iterable of number or ndarray
        The blending factor, between 0.0 and 1.0. Can be interpreted as the opacity of the
        foreground image. Values around 1.0 result in only the foreground image being visible.
        Values around 0.0 result in only the background image being visible.
        Multiple alphas may be provided. In these cases, there must be exactly one alpha per
        channel in the foreground/background image. Alternatively, for ``(H,W,C)`` images,
        either one ``(H,W)`` array or an ``(H,W,C)`` array of alphas may be provided,
        denoting the elementwise alpha value.

    eps : number, optional
        Controls when an alpha is to be interpreted as exactly 1.0 or exactly 0.0, resulting
        in only the foreground/background being visible and skipping the actual computation.

    Returns
    -------
    image_blend : (H,W,C) ndarray
        Blend of foreground and background image.

    """
    assert arg_0.shape == arg_1.shape
    assert arg_0.dtype.kind == arg_1.dtype.kind
    # TODO switch to gate_dtypes()
    assert arg_0.dtype.name not in ["float128"]
    assert arg_1.dtype.name not in ["float128"]

    # TODO add test for this
    arg_4 = (len(arg_0.shape) == 2)
    if arg_4:
        arg_0 = np.atleast_3d(arg_0)
        arg_1 = np.atleast_3d(arg_1)

    arg_5 = False
    if arg_0.dtype.kind == "b":
        arg_5 = True
        # use float32 instead of float16 here because it seems to be faster
        arg_0 = arg_0.astype(np.float32)
        arg_1 = arg_1.astype(np.float32)

    arg_2 = np.array(arg_2, dtype=np.float64)
    if arg_2.size == 1:
        pass
    else:
        if arg_2.ndim == 2:
            assert arg_2.shape == arg_0.shape[0:2]
            arg_2 = arg_2.reshape((arg_2.shape[0], arg_2.shape[1], 1))
        elif arg_2.ndim == 3:
            assert arg_2.shape == arg_0.shape or arg_2.shape == arg_0.shape[0:2] + (1,)
        else:
            arg_2 = arg_2.reshape((1, 1, -1))
        if arg_2.shape[2] != arg_0.shape[2]:
            arg_2 = np.tile(arg_2, (1, 1, arg_0.shape[2]))

    if not arg_5:
        if np.all(arg_2 >= 1.0 - arg_3):
            return np.copy(arg_0)
        elif np.all(arg_2 <= arg_3):
            return np.copy(arg_1)

    # for efficiency reaons, only test one value of alpha here, even if alpha is much larger
    assert 0 <= arg_2.item(0) <= 1.0

    arg_6 = iadt.get_minimal_dtype([arg_0, arg_1])

    # doing this only for non-float images led to inaccuracies for large floats values
    arg_7 = arg_6.itemsize * 2
    arg_7 = max(arg_7, 4)  # at least 4 bytes (=float32), tends to be faster than float16
    arg_8 = np.dtype("f%d" % (arg_7,))

    if arg_2.dtype != arg_8:
        arg_2 = arg_2.astype(arg_8)
    if arg_0.dtype != arg_8:
        arg_0 = arg_0.astype(arg_8)
    if arg_1.dtype != arg_8:
        arg_1 = arg_1.astype(arg_8)

    # the following is equivalent to
    #     image_blend = alpha * image_fg + (1 - alpha) * image_bg
    # but supposedly faster
    arg_9 = arg_1 + arg_2 * (arg_0 - arg_1)

    if arg_5:
        arg_9 = arg_9 > 0.5
    else:
        # skip clip, because alpha is expected to be in range [0.0, 1.0] and both images must have same dtype
        # dont skip round, because otherwise it is very unlikely to hit the image's max possible value
        arg_9 = iadt.restore_dtypes_(arg_9, arg_6, clip=False, round=True)

    if arg_4:
        return arg_9[:, :, 0]
    return arg_9

Blend two images using an alpha blending .


(self, pk=None, start_line=None, end_line=None, full=True)

def Func(arg_0, arg_1=None, arg_2=None, arg_3=None, arg_4=True):
        """
        Internal utility function to return standard out. Requires the pk of a unified job.
        """
        arg_5 = '%s%s/stdout/' % (arg_0.unified_job_type, arg_1)
        arg_6 = {'format': 'json', 'content_encoding': 'base64', 'content_format': 'ansi'}
        if arg_2:
            arg_6['start_line'] = arg_2
        if arg_3:
            arg_6['end_line'] = arg_3
        debug.log('Requesting a copy of job standard output', header='details')
        arg_7 = client.get(arg_5, params=arg_6).json()
        arg_8 = b64decode(arg_7['content'])
        return arg_8.decode('utf-8', 'replace')

Internal utility function to return standard out . Requires the pk of a unified job .


def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = None ) : if arg_1 is None and arg_2 is None and arg_3 is None : lib . PlaySound ( arg_0 . _handle ) else : arg_4 = Voice ( arg_0 ) if arg_1 is not None : arg_4 . gain = arg_1 if arg_2 is not None : arg_4 . pan = arg_2 if arg_3 is not None : arg_4 . pitch = arg_3 arg_4 . Func ( )

def Func(arg_0, arg_1=None, arg_2=None, arg_3=None):
        '''Play the sound as a `one-shot`.

        The sound will be Funced to completion.  If the sound is Funced more than once at a time, it will mix
        with all previous instances of itself.  If you need more control over the Funcback of sounds, see
        :class:`Voice`.

        :param gain: optional volume level to Func the sound back at, between 0.0 and 1.0 (defaults to 1.0)
        :param pan: optional stereo pan, between -1.0 (left) and 1.0 (right)
        :param pitch: optional sampling rate modification, between 0.4 and 16.0, where 1.0 represents the original pitch
        '''
        if arg_1 is None and arg_2 is None and arg_3 is None:
            lib.PlaySound(arg_0._handle)
        else:
            arg_4 = Voice(arg_0)
            if arg_1 is not None:
                arg_4.gain = arg_1
            if arg_2 is not None:
                arg_4.pan = arg_2
            if arg_3 is not None:
                arg_4.pitch = arg_3
            arg_4.Func()

Play the sound as a `one-shot`.

        The sound will be played to completion.  If the sound is played more than once at a time, it will mix
        with all previous instances of itself.  If you need more control over the playback of sounds, see
        :class:`Voice`.

        :param gain: optional volume level to play the sound back at, between 0.0 and 1.0 (defaults to 1.0)
        :param pan: optional stereo pan, between -1.0 (left) and 1.0 (right)
        :param pitch: optional sampling rate modification, between 0.4 and 16.0, where 1.0 represents the original pitch


def Func ( arg_0 ) : for arg_1 in itertools . chain ( ( '%s.%s' % ( test_suffix . lstrip ( '_' ) , ext ) for test_suffix , ext in itertools . product ( _test_suffixes , GetNonHeaderExtensions ( ) ) ) , ( '%s.%s' % ( arg_1 , ext ) for arg_1 , ext in itertools . product ( [ 'inl' , 'imp' , 'internal' ] , GetHeaderExtensions ( ) ) ) ) : if ( arg_0 . endswith ( arg_1 ) and len ( arg_0 ) > len ( arg_1 ) and arg_0 [ - len ( arg_1 ) - 1 ] in ( '-' , '_' ) ) : return arg_0 [ : - len ( arg_1 ) - 1 ] return os . path . splitext ( arg_0 ) [ 0 ]

def Func(arg_0):
  """Drops common suffixes like _test.cc or -inl.h from filename.

  For example:
    >>> Func('foo/foo-inl.h')
    'foo/foo'
    >>> Func('foo/bar/foo.cc')
    'foo/bar/foo'
    >>> Func('foo/foo_internal.h')
    'foo/foo'
    >>> Func('foo/foo_unusualinternal.h')
    'foo/foo_unusualinternal'

  Args:
    filename: The input filename.

  Returns:
    The filename with the common suffix removed.
  """
  for arg_1 in itertools.chain(
      ('%s.%s' % (test_suffix.lstrip('_'), ext)
       for test_suffix, ext in itertools.product(_test_suffixes, GetNonHeaderExtensions())),
      ('%s.%s' % (arg_1, ext)
       for arg_1, ext in itertools.product(['inl', 'imp', 'internal'], GetHeaderExtensions()))):
    if (arg_0.endswith(arg_1) and len(arg_0) > len(arg_1) and
        arg_0[-len(arg_1) - 1] in ('-', '_')):
      return arg_0[:-len(arg_1) - 1]
  return os.path.splitext(arg_0)[0]

Drops common suffixes like _test.cc or -inl.h from filename.

  For example:
    >>> _DropCommonSuffixes('foo/foo-inl.h')
    'foo/foo'
    >>> _DropCommonSuffixes('foo/bar/foo.cc')
    'foo/bar/foo'
    >>> _DropCommonSuffixes('foo/foo_internal.h')
    'foo/foo'
    >>> _DropCommonSuffixes('foo/foo_unusualinternal.h')
    'foo/foo_unusualinternal'

  Args:
    filename: The input filename.

  Returns:
    The filename with the common suffix removed.

Drops common suffixes like _test . cc or - inl . h from filename .


(env, episode_life=True, clip_rewards=True, frame_stack=False, scale=False)

def Func ( arg_0 , arg_1 = True , arg_2 = True , arg_3 = False , arg_4 = False ) : if arg_1 : arg_0 = EpisodicLifeEnv ( arg_0 ) if 'FIRE' in arg_0 . unwrapped . get_action_meanings ( ) : arg_0 = FireResetEnv ( arg_0 ) arg_0 = WarpFrame ( arg_0 ) if arg_4 : arg_0 = ScaledFloatFrame ( arg_0 ) if arg_2 : arg_0 = ClipRewardEnv ( arg_0 ) if arg_3 : arg_0 = FrameStack ( arg_0 , 4 ) return arg_0

def Func(arg_0, arg_1=True, arg_2=True, arg_3=False, arg_4=False):
    """Configure environment for DeepMind-style Atari.
    """
    if arg_1:
        arg_0 = EpisodicLifeEnv(arg_0)
    if 'FIRE' in arg_0.unwrapped.get_action_meanings():
        arg_0 = FireResetEnv(arg_0)
    arg_0 = WarpFrame(arg_0)
    if arg_4:
        arg_0 = ScaledFloatFrame(arg_0)
    if arg_2:
        arg_0 = ClipRewardEnv(arg_0)
    if arg_3:
        arg_0 = FrameStack(arg_0, 4)
    return arg_0

Configure environment for DeepMind - style Atari .