def Func ( ) : arg_0 = ( 30 , 120 ) arg_1 = os . environ def ioctl_gwinsz ( arg_2 ) : try : arg_3 = struct . unpack ( 'hh' , fcntl . ioctl ( arg_2 , termios . TIOCGWINSZ , '1234' ) ) except Exception : arg_3 = arg_0 return arg_3 arg_3 = ioctl_gwinsz ( 0 ) or ioctl_gwinsz ( 1 ) or ioctl_gwinsz ( 2 ) if not arg_3 : try : arg_2 = os . open ( os . ctermid ( ) , os . O_RDONLY ) arg_3 = ioctl_gwinsz ( arg_2 ) os . close ( arg_2 . fileno ( ) ) except Exception : pass if not arg_3 : try : arg_3 = ( arg_1 [ 'LINES' ] , arg_1 [ 'COLUMNS' ] ) except Exception : arg_3 = arg_0 return int ( arg_3 [ 1 ] ) , int ( arg_3 [ 0 ] )

def Func():
    '''
    Gets width and height of terminal viewport
    '''
    arg_0 = (30, 120)
    arg_1 = os.environ

    def ioctl_gwinsz(arg_2):
        '''
        Helper to get console size
        '''
        try:
            arg_3 = struct.unpack(
                'hh', fcntl.ioctl(arg_2, termios.TIOCGWINSZ, '1234'))
        except Exception:
            arg_3 = arg_0
        return arg_3

    arg_3 = ioctl_gwinsz(0) or ioctl_gwinsz(1) or ioctl_gwinsz(2)
    if not arg_3:
        try:
            arg_2 = os.open(os.ctermid(), os.O_RDONLY)
            arg_3 = ioctl_gwinsz(arg_2)
            os.close(arg_2.fileno())
        except Exception:
            pass
    if not arg_3:
        try:
            arg_3 = (arg_1['LINES'], arg_1['COLUMNS'])
        except Exception:
            arg_3 = arg_0
    return int(arg_3[1]), int(arg_3[0])


def
Func
(
arg_0
,
arg_1
=
'r'
,
arg_2
=
'auto'
)
:
arg_3
=
{
'jams'
:
open
,
'json'
:
open
,
'jamz'
:
gzip
.
open
,
'gz'
:
gzip
.
open
}
if
hasattr
(
arg_0
,
'read'
)
or
hasattr
(
arg_0
,
'write'
)
:
yield
arg_0
elif
isinstance
(
arg_0
,
six
.
string_types
)
:
if
arg_2
==
'auto'
:
arg_4
,
arg_5
=
os
.
path
.
splitext
(
arg_0
)
arg_5
=
arg_5
[
1
:
]
else
:
arg_5
=
arg_2
try
:
arg_5
=
arg_5
.
lower
(
)
if
arg_5
in
[
'jamz'
,
'gz'
]
and
't'
not
in
arg_1
:
arg_1
=
'{:s}t'
.
format
(
arg_1
)
with
arg_3
[
arg_5
]
(
arg_0
,
arg_1
=
arg_1
)
as
fdesc
:
yield
fdesc
except
KeyError
:
raise
ParameterError
(
'Unknown JAMS extension '
'format: "{:s}"'
.
format
(
arg_5
)
)
else
:
raise
ParameterError
(
'Invalid filename or '
'descriptor: {}'
.
format
(
arg_0
)
)

def Func(arg_0, arg_1='r', arg_2='auto'):
    '''An intelligent wrapper for ``open``.

    Parameters
    ----------
    name_or_fdesc : string-type or open file descriptor
        If a string type, refers to the path to a file on disk.

        If an open file descriptor, it is returned as-is.

    mode : string
        The mode with which to open the file.
        See ``open`` for details.

    fmt : string ['auto', 'jams', 'json', 'jamz']
        The encoding for the input/output stream.

        If `auto`, the format is inferred from the filename extension.

        Otherwise, use the specified coding.

    See Also
    --------
    open
    gzip.open
    '''

    arg_3 = {'jams': open,
                'json': open,
                'jamz': gzip.open,
                'gz': gzip.open}

    # If we've been given an open descriptor, do the right thing
    if hasattr(arg_0, 'read') or hasattr(arg_0, 'write'):
        yield arg_0

    elif isinstance(arg_0, six.string_types):
        # Infer the opener from the extension

        if arg_2 == 'auto':
            arg_4, arg_5 = os.path.splitext(arg_0)

            # Pull off the extension separator
            arg_5 = arg_5[1:]
        else:
            arg_5 = arg_2

        try:
            arg_5 = arg_5.lower()

            # Force text mode if we're using gzip
            if arg_5 in ['jamz', 'gz'] and 't' not in arg_1:
                arg_1 = '{:s}t'.format(arg_1)

            with arg_3[arg_5](arg_0, arg_1=arg_1) as fdesc:
                yield fdesc

        except KeyError:
            raise ParameterError('Unknown JAMS extension '
                                 'format: "{:s}"'.format(arg_5))

    else:
        # Don't know how to handle this. Raise a parameter error
        raise ParameterError('Invalid filename or '
                             'descriptor: {}'.format(arg_0))


def Func ( arg_0 , arg_1 = None ) : if arg_0 is None : return arg_0 try : arg_2 = tf . get_static_value ( arg_0 ) except TypeError : arg_2 = arg_0 if arg_2 is None or arg_1 is None : return arg_2 return np . array ( arg_2 , arg_1 )

def Func(arg_0, arg_1=None):
  """Helper which tries to return a static value.

  Given `x`, extract it's value statically, optionally casting to a specific
  dtype. If this is not possible, None is returned.

  Args:
    x: `Tensor` for which to extract a value statically.
    dtype: Optional dtype to cast to.

  Returns:
    Statically inferred value if possible, otherwise None.
  """
  if arg_0 is None:
    return arg_0
  try:
    # This returns an np.ndarray.
    arg_2 = tf.get_static_value(arg_0)
  except TypeError:
    arg_2 = arg_0
  if arg_2 is None or arg_1 is None:
    return arg_2
  return np.array(arg_2, arg_1)

Helper which tries to return a static value .


def Func ( arg_0 , arg_1 = None , arg_2 = False ) : if arg_1 is None : arg_1 = [ ] if arg_0 . value is not None and rand . maybe ( ) : return utils . val ( arg_0 . value , arg_1 , arg_2 = arg_2 ) arg_3 = super ( String , arg_0 ) . Func ( arg_1 , arg_2 = arg_2 ) arg_4 = rand . data ( arg_3 , arg_0 . charset ) return arg_4

def Func(arg_0, arg_1=None, arg_2=False):
        """Build the String instance

        :param list pre: The prerequisites list (optional, default=None)
        :param bool shortest: Whether or not the shortest reference-chain (most minimal) version of the field should be generated.
        """
        if arg_1 is None:
            arg_1 = []

        if arg_0.value is not None and rand.maybe():
            return utils.val(arg_0.value, arg_1, arg_2=arg_2)

        arg_3 = super(String, arg_0).Func(arg_1, arg_2=arg_2)
        arg_4 = rand.data(arg_3, arg_0.charset)
        return arg_4


def Func(arg_0, arg_1):
        """Configure argument parser."""
        arg_1.add_argument(
            '--no-phenoecm', action='store_true',
            help='Disables the phenomenological ECM model building.')
        arg_1.add_argument(
            '--iterations', type=int, default=10,
            help='Number of outer-loop iterations (e.g. time loop) during benchmarking. '
                 'Default is 10, but actual number will be adapted to at least 0.2s runtime.')
        arg_1.add_argument(
            '--ignore-warnings', action='store_true',
            help='Ignore warnings about missmatched CPU model and frequency.')


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
arg_0
.
_detect_byteorder
(
arg_1
)
arg_3
=
struct
.
calcsize
(
arg_0
.
_headerfmt
)
arg_4
=
[
r
.
key
for
r
in
arg_0
.
_header_struct
]
arg_5
=
arg_1
.
read
(
25
*
4
)
def
decode_header
(
arg_6
,
arg_2
=
'@'
)
:
arg_7
=
dict
(
zip
(
arg_4
,
struct
.
unpack
(
arg_2
+
arg_0
.
_headerfmt
,
arg_6
)
)
)
arg_7
[
'bsaflag'
]
=
arg_2
return
arg_7
arg_6
=
decode_header
(
arg_5
,
arg_2
)
for
arg_8
in
arg_0
.
_header_struct
:
if
not
arg_8
.
is_legal_dict
(
arg_6
)
:
warnings
.
warn
(
"Key %s: Illegal value %r"
%
(
arg_8
.
key
,
arg_6
[
arg_8
.
key
]
)
)
if
(
arg_6
[
'lskflg'
]
)
:
arg_9
=
np
.
fromfile
(
arg_1
,
dtype
=
np
.
float32
,
count
=
9
)
arg_6
[
'skwmat'
]
=
arg_9
.
reshape
(
(
3
,
3
)
)
arg_6
[
'skwtrn'
]
=
np
.
fromfile
(
arg_1
,
dtype
=
np
.
float32
,
count
=
3
)
else
:
arg_6
[
'skwmat'
]
=
arg_6
[
'skwtrn'
]
=
arg_1
.
seek
(
12
*
4
,
1
)
arg_1
.
seek
(
15
*
4
,
1
)
arg_1
.
seek
(
4
,
1
)
arg_10
=
struct
.
unpack
(
arg_2
+
'4b'
,
arg_1
.
read
(
4
)
)
arg_6
[
'endianness'
]
=
'little'
if
arg_10
==
(
0x44
,
0x41
,
0
,
0
)
else
'big'
arg_6
[
'arms'
]
=
struct
.
unpack
(
arg_2
+
'f'
,
arg_1
.
read
(
4
)
)
[
0
]
arg_6
[
'nlabl'
]
=
struct
.
unpack
(
arg_2
+
'I'
,
arg_1
.
read
(
4
)
)
[
0
]
if
arg_6
[
'nlabl'
]
:
arg_11
=
arg_1
.
read
(
80
*
arg_6
[
'nlabl'
]
)
arg_12
=
arg_2
+
str
(
80
*
arg_6
[
'nlabl'
]
)
+
's'
arg_13
=
struct
.
unpack
(
arg_12
,
arg_11
)
[
0
]
arg_6
[
'label'
]
=
arg_13
.
decode
(
'utf-8'
)
.
rstrip
(
'\x00'
)
else
:
arg_6
[
'label'
]
=
arg_1
.
seek
(
256
*
4
)
return
arg_6

def Func(arg_0, arg_1):
        """Read header bytes"""

        arg_2 = arg_0._detect_byteorder(arg_1)

        # Parse the top of the header (4-byte words, 1 to 25).
        arg_3 = struct.calcsize(arg_0._headerfmt)
        arg_4 = [r.key for r in arg_0._header_struct]
        arg_5 = arg_1.read(25 * 4)

        def decode_header(arg_6, arg_2='@'):
            arg_7 = dict(zip(arg_4, struct.unpack(arg_2 + arg_0._headerfmt,
                                              arg_6)))
            arg_7['bsaflag'] = arg_2
            return arg_7

        arg_6 = decode_header(arg_5, arg_2)
        for arg_8 in arg_0._header_struct:
            if not arg_8.is_legal_dict(arg_6):
                warnings.warn(
                    "Key %s: Illegal value %r" % (arg_8.key, arg_6[arg_8.key]))

        # Parse the latter half of the header (4-byte words, 26 to 256).
        if (arg_6['lskflg']):
            arg_9 = np.fromfile(arg_1, dtype=np.float32, count=9)
            arg_6['skwmat'] = arg_9.reshape((3, 3))
            arg_6['skwtrn'] = np.fromfile(arg_1, dtype=np.float32, count=3)
        else:
            arg_6['skwmat'] = arg_6['skwtrn'] = None
            arg_1.seek(12 * 4, 1)
        arg_1.seek(15 * 4, 1)  # Skip future use section.
        arg_1.seek(4, 1)  # Skip map text, already used above to verify format.
        # TODO: Compare file specified endianness to one obtained above.
        arg_10 = struct.unpack(arg_2 + '4b', arg_1.read(4))
        arg_6['endianness'] = 'little' if arg_10 == (0x44, 0x41, 0, 0
                                                          ) else 'big'
        arg_6['arms'] = struct.unpack(arg_2 + 'f', arg_1.read(4))[0]
        arg_6['nlabl'] = struct.unpack(arg_2 + 'I', arg_1.read(4))[0]
        if arg_6['nlabl']:
            arg_11 = arg_1.read(80 * arg_6['nlabl'])
            arg_12 = arg_2 + str(80 * arg_6['nlabl']) + 's'
            arg_13 = struct.unpack(arg_12, arg_11)[0]
            arg_6['label'] = arg_13.decode('utf-8').rstrip('\x00')
        else:
            arg_6['label'] = None
        arg_1.seek(256 * 4)
        # TODO: Parse symmetry records, if any.
        return arg_6


def Func ( arg_0 , arg_1 = None ) : arg_1 = _make_callable ( arg_1 ) return Collection ( Func ( arg_1 , arg_0 . _items ) )

def Func(arg_0, arg_1=None):
        """
        Return a new Collection with the last few items removed.

        Parameters:

            func : function(Node) -> Node

        Returns:

            A new Collection, discarding all items
            at and after the first item where bool(func(item)) == False

        Examples:

            node.find_all('tr').Func(Q.find_all('td').count() > 3)

        """
        arg_1 = _make_callable(arg_1)
        return Collection(Func(arg_1, arg_0._items))

Return a new Collection with the last few items removed.

        Parameters:

            func : function(Node) -> Node

        Returns:

            A new Collection, discarding all items
            at and after the first item where bool(func(item)) == False

        Examples:

            node.find_all('tr').takewhile(Q.find_all('td').count() > 3)

Return a new Collection with the last few items removed .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
arg_0
.
debugger
.
settings
[
arg_0
.
name
]
arg_0
.
msg
(
"%s is %s."
%
(
arg_0
.
name
,
arg_0
.
cmd
.
proc
.
_saferepr
(
arg_2
)
,
)
)
return
False

def Func(arg_0, arg_1):
    """Generic subcommand value display"""
    arg_2 = arg_0.debugger.settings[arg_0.name]
    arg_0.msg("%s is %s." % (arg_0.name, arg_0.cmd.proc._saferepr(arg_2),))
    return False


def Func ( arg_0 ) : if arg_0 . prev_submenu is not None : arg_0 . menu . changeSubMenu ( arg_0 . prev_submenu ) arg_0 . prev_submenu = None

def Func(arg_0):
        """
        Helper method that exits the dialog.

        This method will cause the previously active submenu to activate.
        """
        if arg_0.prev_submenu is not None:
            # change back to the previous submenu
            # could in theory form a stack if one dialog opens another
            arg_0.menu.changeSubMenu(arg_0.prev_submenu)
        arg_0.prev_submenu = None

Helper method that exits the dialog . This method will cause the previously active submenu to activate .


def Func ( arg_0 ) : from django . conf import settings arg_1 = [ ] for arg_2 in settings . INSTALLED_APPS : arg_3 = import_app_module ( arg_2 , arg_0 ) if arg_3 is not None : arg_1 . append ( arg_3 ) return arg_1

def Func(arg_0):
    """Imports modules from registered apps using given module name
    and returns them as a list.

    :param str module_name:
    :rtype: list

    """
    from django.conf import settings

    arg_1 = []
    for arg_2 in settings.INSTALLED_APPS:
        arg_3 = import_app_module(arg_2, arg_0)
        if arg_3 is not None:
            arg_1.append(arg_3)

    return arg_1

Imports modules from registered apps using given module name and returns them as a list .


(message_descriptor, locations, path, name_prefix='')

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = '' ) : arg_4 = arg_3 + arg_0 . name print ( make_subsection ( arg_4 ) ) arg_5 = arg_1 [ arg_2 ] if arg_5 . HasField ( 'leading_comments' ) : print ( textwrap . dedent ( arg_5 . leading_comments ) ) arg_6 = [ ] for arg_7 , arg_8 in enumerate ( arg_0 . field ) : arg_9 = arg_1 [ arg_2 + ( 2 , arg_7 ) ] if arg_8 . type not in [ 11 , 14 ] : arg_10 = TYPE_TO_STR [ arg_8 . type ] else : arg_10 = make_link ( arg_8 . type_name . lstrip ( '.' ) ) arg_6 . append ( ( make_code ( arg_8 . name ) , arg_8 . number , arg_10 , LABEL_TO_STR [ arg_8 . label ] , textwrap . fill ( get_comment_from_location ( arg_9 ) , INFINITY ) , ) ) print_table ( ( 'Field' , 'Number' , 'Type' , 'Label' , 'Description' ) , arg_6 ) arg_11 = enumerate ( arg_0 . nested_type ) for arg_12 , arg_13 in arg_11 : Func ( arg_13 , arg_1 , arg_2 + ( 3 , arg_12 ) , arg_3 = arg_4 + '.' ) for arg_12 , arg_14 in enumerate ( arg_0 . enum_type ) : generate_enum_doc ( arg_14 , arg_1 , arg_2 + ( 4 , arg_12 ) , arg_3 = arg_4 + '.' )

def Func(arg_0, arg_1, arg_2, arg_3=''):
    """Generate docs for message and nested messages and enums.

    Args:
        message_descriptor: descriptor_pb2.DescriptorProto instance for message
            to generate docs for.
        locations: Dictionary of location paths tuples to
            descriptor_pb2.SourceCodeInfo.Location instances.
        path: Path tuple to the message definition.
        name_prefix: Optional prefix for this message's name.
    """
    # message_type is 4
    arg_4 = arg_3 + arg_0.name
    print(make_subsection(arg_4))
    arg_5 = arg_1[arg_2]
    if arg_5.HasField('leading_comments'):
        print(textwrap.dedent(arg_5.leading_comments))

    arg_6 = []
    for arg_7, arg_8 in enumerate(arg_0.field):
        arg_9 = arg_1[arg_2 + (2, arg_7)]
        if arg_8.type not in [11, 14]:
            arg_10 = TYPE_TO_STR[arg_8.type]
        else:
            arg_10 = make_link(arg_8.type_name.lstrip('.'))
        arg_6.append((
            make_code(arg_8.name),
            arg_8.number,
            arg_10,
            LABEL_TO_STR[arg_8.label],
            textwrap.fill(get_comment_from_location(arg_9), INFINITY),
        ))
    print_table(('Field', 'Number', 'Type', 'Label', 'Description'),
                arg_6)

    # Generate nested messages
    arg_11 = enumerate(arg_0.nested_type)
    for arg_12, arg_13 in arg_11:
        Func(arg_13, arg_1,
                             arg_2 + (3, arg_12),
                             arg_3=arg_4 + '.')

    # Generate nested enums
    for arg_12, arg_14 in enumerate(arg_0.enum_type):
        generate_enum_doc(arg_14, arg_1, arg_2 + (4, arg_12),
                          arg_3=arg_4 + '.')

Generate docs for message and nested messages and enums .


return Fastq(self.id, self.seq[start:end], self.qual[start:end])

def Func ( arg_0 , arg_1 , arg_2 ) : return Fastq ( arg_0 . id , arg_0 . seq [ arg_1 : arg_2 ] , arg_0 . qual [ arg_1 : arg_2 ] )

def Func(arg_0, arg_1, arg_2):
        '''Returns Fastq object with the same name, of the bases from start to end, but not including end'''
        return Fastq(arg_0.id, arg_0.seq[arg_1:arg_2], arg_0.qual[arg_1:arg_2])

Returns Fastq object with the same name of the bases from start to end but not including end


def Func ( arg_0 ) : if arg_0 . nodeType == arg_0 . TEXT_NODE : return arg_0 . data else : arg_1 = "" for arg_2 in arg_0 . childNodes : arg_1 += Func ( arg_2 ) return arg_1

def Func(arg_0):
    """Recursively extract all text from node."""
    if arg_0.nodeType == arg_0.TEXT_NODE:
        return arg_0.data
    else:
        arg_1 = ""
        for arg_2 in arg_0.childNodes:
            arg_1 += Func(arg_2)
        return arg_1

Recursively extract all text from node .


def Func ( arg_0 , arg_1 = None , ** arg_2 ) : def Func_function ( arg_3 ) : return RemoteFunction ( arg_0 , arg_3 , arg_1 = arg_1 , ** arg_2 ) return Func_function

def Func(arg_0, arg_1=None, **arg_2):
    """Turn a function into a Func function.

    This method can be used for map:

    In [1]: @Func(view,block=True)
       ...: def func(a):
       ...:    pass
    """

    def Func_function(arg_3):
        return RemoteFunction(arg_0, arg_3, arg_1=arg_1, **arg_2)
    return Func_function

Turn a function into a remote function.

    This method can be used for map:

    In [1]: @remote(view,block=True)
       ...: def func(a):
       ...:    pass

Turn a function into a remote function .


return cls(address, name, shared_access_key_name=policy, shared_access_key_value=key, **kwargs)

def Func(arg_0, arg_1, arg_2=None, **arg_3):
        """Create a Client from a Service Bus connection string.

        :param conn_str: The connection string.
        :type conn_str: str
        :param name: The name of the entity, if the 'EntityName' property is
         not included in the connection string.
        """
        arg_4, arg_5, arg_6, arg_7 = parse_conn_str(arg_1)
        arg_7 = arg_2 or arg_7
        arg_4 = build_uri(arg_4, arg_7)
        arg_2 = arg_4.split('/')[-1]
        return arg_0(arg_4, arg_2, shared_access_key_name=arg_5, shared_access_key_value=arg_6, **arg_3)

Create a Client from a Service Bus connection string .


def Func(arg_0):
        """
        Inverts each value in the heatmap, shifting low towards high values and vice versa.

        This changes each value to::

            v' = max - (v - min)

        where ``v`` is the value at some spatial location, ``min`` is the minimum value in the heatmap
        and ``max`` is the maximum value.
        As the heatmap uses internally a 0.0 to 1.0 representation, this simply becomes ``v' = 1.0 - v``.

        Note that the attributes ``min_value`` and ``max_value`` are not switched. They both keep their values.

        This function can be useful e.g. when working with depth maps, where algorithms might have
        an easier time representing the furthest away points with zeros, requiring an Funced
        depth map.

        Returns
        -------
        arr_inv : imgaug.HeatmapsOnImage
            Inverted heatmap.

        """
        arg_1 = HeatmapsOnImage.from_0to1(1 - arg_0.arr_0to1, shape=arg_0.shape, min_value=arg_0.min_value,
                                            max_value=arg_0.max_value)
        arg_1.arr_was_2d = arg_0.arr_was_2d
        return arg_1

Inverts each value in the heatmap, shifting low towards high values and vice versa.

        This changes each value to::

            v' = max - (v - min)

        where ``v`` is the value at some spatial location, ``min`` is the minimum value in the heatmap
        and ``max`` is the maximum value.
        As the heatmap uses internally a 0.0 to 1.0 representation, this simply becomes ``v' = 1.0 - v``.

        Note that the attributes ``min_value`` and ``max_value`` are not switched. They both keep their values.

        This function can be useful e.g. when working with depth maps, where algorithms might have
        an easier time representing the furthest away points with zeros, requiring an inverted
        depth map.

        Returns
        -------
        arr_inv : imgaug.HeatmapsOnImage
            Inverted heatmap.

Inverts each value in the heatmap shifting low towards high values and vice versa .


(
            self, resource_group_name, automation_account_name, runbook_name, custom_headers=None, raw=False, polling=True, **operation_config)

return LROPoller(self._client, raw_result, get_long_running_output, polling_method)

def Func(
            arg_0, arg_1, arg_2, arg_3, arg_4=None, arg_5=False, arg_6=True, **arg_7):
        """Publish runbook draft.

        :param resource_group_name: Name of an Azure Resource group.
        :type resource_group_name: str
        :param automation_account_name: The name of the automation account.
        :type automation_account_name: str
        :param runbook_name: The parameters supplied to the Func runbook
         operation.
        :type runbook_name: str
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: The poller return type is ClientRawResponse, the
         direct response alongside the deserialized response
        :param polling: True for ARMPolling, False for no polling, or a
         polling object for personal polling strategy
        :return: An instance of LROPoller that returns None or
         ClientRawResponse<None> if raw==True
        :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or
         ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]]
        :raises:
         :class:`ErrorResponseException<azure.mgmt.automation.models.ErrorResponseException>`
        """
        arg_8 = arg_0._Func_initial(
            arg_1=arg_1,
            arg_2=arg_2,
            arg_3=arg_3,
            arg_4=arg_4,
            arg_5=True,
            **arg_7
        )

        def get_long_running_output(arg_9):
            if arg_5:
                arg_10 = ClientRawResponse(None, arg_9)
                arg_10.add_headers({
                    'location': 'str',
                })
                return arg_10

        arg_11 = arg_7.get(
            'long_running_operation_timeout',
            arg_0.config.long_running_operation_timeout)
        if arg_6 is True: arg_12 = ARMPolling(arg_11, **arg_7)
        elif arg_6 is False: arg_12 = NoPolling()
        else: arg_12 = arg_6
        return LROPoller(arg_0._client, arg_8, get_long_running_output, arg_12)

Publish runbook draft.

        :param resource_group_name: Name of an Azure Resource group.
        :type resource_group_name: str
        :param automation_account_name: The name of the automation account.
        :type automation_account_name: str
        :param runbook_name: The parameters supplied to the publish runbook
         operation.
        :type runbook_name: str
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: The poller return type is ClientRawResponse, the
         direct response alongside the deserialized response
        :param polling: True for ARMPolling, False for no polling, or a
         polling object for personal polling strategy
        :return: An instance of LROPoller that returns None or
         ClientRawResponse<None> if raw==True
        :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or
         ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]]
        :raises:
         :class:`ErrorResponseException<azure.mgmt.automation.models.ErrorResponseException>`


def Func(arg_0):
        """
        This uploads the protocol functions nessecary to do binary
        chunked transfer
        """
        log.info('Preparing esp for transfer.')

        for arg_1 in LUA_FUNCTIONS:
            detected = arg_0.__exchange('print({0})'.format(arg_1))
            if detected.find('function:') == -1:
                break
        else:
            log.info('Preparation already done. Not adding functions again.')
            return True
        arg_2 = RECV_LUA + '\n' + SEND_LUA
        arg_3 = arg_2.format(baud=arg_0._port.baudrate)
        ##change any \r\n to just \n and split on that
        arg_4 = arg_3.replace('\r', '').split('\n')

        #remove some unneccesary spaces to conserve some bytes
        for arg_5 in arg_4:
            arg_5 = arg_5.strip().replace(', ', ',').replace(' = ', '=')

            if len(arg_5) == 0:
                continue

            arg_6 = arg_0.__exchange(arg_5)
            #do some basic test of the result
            if ('unexpected' in arg_6) or ('stdin' in arg_6) or len(arg_6) > len(arg_2)+10:
                log.error('error when preparing "%s"', arg_6)
                return False
        return True


def Func(arg_0, arg_1, arg_2, arg_3=1):
        # type: (str, Union[float, datetime], float) -> None
        """Send a Timer metric calculating the duration from the start time"""
        arg_4 = 0  # type: float
        if isinstance(arg_2, datetime):
            arg_4 = (datetime.now(arg_2.tzinfo) - arg_2).total_seconds() * 1000
        elif is_numeric(arg_2):
            assert arg_2 > 0
            arg_4 = (time() - arg_2) * 1000
        else:
            raise ValueError("start time should be a timestamp or a datetime")
        arg_0.timing(arg_1, arg_4, arg_3)


def Func(arg_0, arg_1, arg_2, arg_3):
    '''
    This returns the residual between model mags and the actual mags.

    Parameters
    ----------

    flareparams : list of float
        This defines the flare model::

            [amplitude,
             flare_peak_time,
             rise_gaussian_stdev,
             decay_time_constant]

        where:

        `amplitude`: the maximum flare amplitude in mags or flux. If flux, then
        amplitude should be positive. If mags, amplitude should be negative.

        `flare_peak_time`: time at which the flare maximum happens.

        `rise_gaussian_stdev`: the stdev of the gaussian describing the rise of
        the flare.

        `decay_time_constant`: the time constant of the exponential fall of the
        flare.

    times,mags,errs : np.array
        The input time-series of measurements and associated errors for which
        the model will be generated. The times will be used to generate
        model mags.

    Returns
    -------

    np.array
        The residuals between the input `mags` and generated `modelmags`,
        weighted by the measurement errors in `errs`.

    '''

    arg_4, arg_5, arg_5, arg_5 = flare_model(arg_0, arg_1, arg_2, arg_3)

    return (arg_2 - arg_4)/arg_3

This returns the residual between model mags and the actual mags .


def Func ( arg_0 , arg_1 ) : if not arg_0 . options . exclude_labels : return copy . deepcopy ( arg_1 ) arg_2 = set ( ) arg_3 = arg_0 . options . exclude_labels arg_4 = [ ] for arg_5 in arg_1 : for arg_6 in arg_5 [ "labels" ] : if arg_6 [ "name" ] in arg_3 : arg_2 . add ( arg_5 [ "number" ] ) break for arg_5 in arg_1 : if arg_5 [ "number" ] not in arg_2 : arg_4 . append ( arg_5 ) return arg_4

def Func(arg_0, arg_1):
        """
        Delete all issues with labels from exclude-labels option.

        :param list(dict) issues: All issues for tag.
        :rtype: list(dict)
        :return: Filtered issues.
        """
        if not arg_0.options.exclude_labels:
            return copy.deepcopy(arg_1)

        arg_2 = set()
        arg_3 = arg_0.options.exclude_labels
        arg_4 = []
        for arg_5 in arg_1:
            for arg_6 in arg_5["labels"]:
                if arg_6["name"] in arg_3:
                    arg_2.add(arg_5["number"])
                    break
        for arg_5 in arg_1:
            if arg_5["number"] not in arg_2:
                arg_4.append(arg_5)
        return arg_4

Delete all issues with labels from exclude - labels option .


return self.get_conn().instances().get(
            project=project_id,
            instance=instance
        ).execute(num_retries=self.num_retries)

def Func ( arg_0 , arg_1 , arg_2 = None ) : return arg_0 . get_conn ( ) . instances ( ) . get ( project = arg_2 , arg_1 = arg_1 ) . execute ( num_retries = arg_0 . num_retries )

def Func(arg_0, arg_1, arg_2=None):
        """
        Retrieves a resource containing information about a Cloud SQL instance.

        :param instance: Database instance ID. This does not include the project ID.
        :type instance: str
        :param project_id: Project ID of the project that contains the instance. If set
            to None or missing, the default project_id from the GCP connection is used.
        :type project_id: str
        :return: A Cloud SQL instance resource.
        :rtype: dict
        """
        return arg_0.get_conn().instances().get(
            project=arg_2,
            arg_1=arg_1
        ).execute(num_retries=arg_0.num_retries)

Retrieves a resource containing information about a Cloud SQL instance .


(objective_function,
             initial_simplex=None,
             initial_vertex=None,
             step_sizes=None,
             objective_at_initial_simplex=None,
             objective_at_initial_vertex=None,
             batch_evaluate_objective=False,
             func_tolerance=1e-8,
             position_tolerance=1e-8,
             parallel_iterations=1,
             max_iterations=None,
             reflection=None,
             expansion=None,
             contraction=None,
             shrinkage=None,
             name=None)

def Func(arg_0,
             arg_1=None,
             arg_2=None,
             arg_3=None,
             arg_4=None,
             arg_5=None,
             arg_6=False,
             arg_7=1e-8,
             arg_8=1e-8,
             arg_9=1,
             arg_10=None,
             arg_11=None,
             arg_12=None,
             arg_13=None,
             arg_14=None,
             arg_15=None):
  """Minimum of the objective function using the Nelder Mead simplex algorithm.

  Performs an unconstrained minimization of a (possibly non-smooth) function
  using the Nelder Mead simplex method. Nelder Mead method does not support
  univariate functions. Hence the dimensions of the domain must be 2 or greater.
  For details of the algorithm, see
  [Press, Teukolsky, Vetterling and Flannery(2007)][1].

  Points in the domain of the objective function may be represented as a
  `Tensor` of general shape but with rank at least 1. The algorithm proceeds
  by modifying a full rank simplex in the domain. The initial simplex may
  either be specified by the user or can be constructed using a single vertex
  supplied by the user. In the latter case, if `v0` is the supplied vertex,
  the simplex is the convex hull of the set:

  ```None
  S = {v0} + {v0 + step_i * e_i}
  ```

  Here `e_i` is a vector which is `1` along the `i`-th axis and zero elsewhere
  and `step_i` is a characteristic length scale along the `i`-th axis. If the
  step size is not supplied by the user, a unit step size is used in every axis.
  Alternately, a single step size may be specified which is used for every
  axis. The most flexible option is to supply a bespoke step size for every
  axis.

  ### Usage:

  The following example demonstrates the usage of the Nelder Mead minimzation
  on a two dimensional problem with the minimum located at a non-differentiable
  point.

  ```python
    # The objective function
    def sqrt_quadratic(x):
      return tf.sqrt(tf.reduce_sum(x ** 2, axis=-1))

    start = tf.constant([6.0, -21.0])  # Starting point for the search.
    optim_results = tfp.optimizer.nelder_mead_Func(
        sqrt_quadratic, initial_vertex=start, func_tolerance=1e-8,
        batch_evaluate_objective=True)

    with tf.Session() as session:
      results = session.run(optim_results)
      # Check that the search converged
      assert(results.converged)
      # Check that the argmin is close to the actual value.
      np.testing.assert_allclose(results.position, np.array([0.0, 0.0]),
                                 atol=1e-7)
      # Print out the total number of function evaluations it took.
      print ("Function evaluations: %d" % results.num_objective_evaluations)
  ```

  ### References:
  [1]: William Press, Saul Teukolsky, William Vetterling and Brian Flannery.
    Numerical Recipes in C++, third edition. pp. 502-507. (2007).
    http://numerical.recipes/cpppages/chap0sel.pdf

  [2]: Jeffrey Lagarias, James Reeds, Margaret Wright and Paul Wright.
    Convergence properties of the Nelder-Mead simplex method in low dimensions,
    Siam J. Optim., Vol 9, No. 1, pp. 112-147. (1998).
    http://www.math.kent.edu/~reichel/courses/Opt/reading.material.2/nelder.mead.pdf

  [3]: Fuchang Gao and Lixing Han. Implementing the Nelder-Mead simplex
    algorithm with adaptive parameters. Computational Optimization and
    Applications, Vol 51, Issue 1, pp 259-277. (2012).
    https://pdfs.semanticscholar.org/15b4/c4aa7437df4d032c6ee6ce98d6030dd627be.pdf

  Args:
    objective_function:  A Python callable that accepts a point as a
      real `Tensor` and returns a `Tensor` of real dtype containing
      the value of the function at that point. The function
      to be Funcd. If `batch_evaluate_objective` is `True`, the callable
      may be evaluated on a `Tensor` of shape `[n+1] + s ` where `n` is
      the dimension of the problem and `s` is the shape of a single point
      in the domain (so `n` is the size of a `Tensor` representing a
      single point).
      In this case, the expected return value is a `Tensor` of shape `[n+1]`.
      Note that this method does not support univariate functions so the problem
      dimension `n` must be strictly greater than 1.
    initial_simplex: (Optional) `Tensor` of real dtype. The initial simplex to
      start the search. If supplied, should be a `Tensor` of shape `[n+1] + s`
      where `n` is the dimension of the problem and `s` is the shape of a
      single point in the domain. Each row (i.e. the `Tensor` with a given
      value of the first index) is interpreted as a vertex of a simplex and
      hence the rows must be affinely independent. If not supplied, an axes
      aligned simplex is constructed using the `initial_vertex` and
      `step_sizes`. Only one and at least one of `initial_simplex` and
      `initial_vertex` must be supplied.
    initial_vertex: (Optional) `Tensor` of real dtype and any shape that can
      be consumed by the `objective_function`. A single point in the domain that
      will be used to construct an axes aligned initial simplex.
    step_sizes: (Optional) `Tensor` of real dtype and shape broadcasting
      compatible with `initial_vertex`. Supplies the simplex scale along each
      axes. Only used if `initial_simplex` is not supplied. See description
      above for details on how step sizes and initial vertex are used to
      construct the initial simplex.
    objective_at_initial_simplex: (Optional) Rank `1` `Tensor` of real dtype
      of a rank `1` `Tensor`. The value of the objective function at the
      initial simplex. May be supplied only if `initial_simplex` is
      supplied. If not supplied, it will be computed.
    objective_at_initial_vertex: (Optional) Scalar `Tensor` of real dtype. The
      value of the objective function at the initial vertex. May be supplied
      only if the `initial_vertex` is also supplied.
    batch_evaluate_objective: (Optional) Python `bool`. If True, the objective
      function will be evaluated on all the vertices of the simplex packed
      into a single tensor. If False, the objective will be mapped across each
      vertex separately. Evaluating the objective function in a batch allows
      use of vectorization and should be preferred if the objective function
      allows it.
    func_tolerance: (Optional) Scalar `Tensor` of real dtype. The algorithm
      stops if the absolute difference between the largest and the smallest
      function value on the vertices of the simplex is below this number.
    position_tolerance: (Optional) Scalar `Tensor` of real dtype. The
      algorithm stops if the largest absolute difference between the
      coordinates of the vertices is below this threshold.
    parallel_iterations: (Optional) Positive integer. The number of iterations
      allowed to run in parallel.
    max_iterations: (Optional) Scalar positive `Tensor` of dtype `int32`.
      The maximum number of iterations allowed. If `None` then no limit is
      applied.
    reflection: (Optional) Positive Scalar `Tensor` of same dtype as
      `initial_vertex`. This parameter controls the scaling of the reflected
      vertex. See, [Press et al(2007)][1] for details. If not specified,
      uses the dimension dependent prescription of [Gao and Han(2012)][3].
    expansion: (Optional) Positive Scalar `Tensor` of same dtype as
      `initial_vertex`. Should be greater than `1` and `reflection`. This
      parameter controls the expanded scaling of a reflected vertex.
      See, [Press et al(2007)][1] for details. If not specified, uses the
      dimension dependent prescription of [Gao and Han(2012)][3].
    contraction: (Optional) Positive scalar `Tensor` of same dtype as
      `initial_vertex`. Must be between `0` and `1`. This parameter controls
      the contraction of the reflected vertex when the objective function at
      the reflected point fails to show sufficient decrease.
      See, [Press et al(2007)][1] for more details. If not specified, uses
      the dimension dependent prescription of [Gao and Han(2012][3].
    shrinkage: (Optional) Positive scalar `Tensor` of same dtype as
      `initial_vertex`. Must be between `0` and `1`. This parameter is the scale
      by which the simplex is shrunk around the best point when the other
      steps fail to produce improvements.
      See, [Press et al(2007)][1] for more details. If not specified, uses
      the dimension dependent prescription of [Gao and Han(2012][3].
    name: (Optional) Python str. The name prefixed to the ops created by this
      function. If not supplied, the default name 'Func' is used.

  Returns:
    optimizer_results: A namedtuple containing the following items:
      converged: Scalar boolean tensor indicating whether the minimum was
        found within tolerance.
      num_objective_evaluations: The total number of objective
        evaluations performed.
      position: A `Tensor` containing the last argument value found
        during the search. If the search converged, then
        this value is the argmin of the objective function.
      objective_value: A tensor containing the value of the objective
        function at the `position`. If the search
        converged, then this is the (local) minimum of
        the objective function.
      final_simplex: The last simplex constructed before stopping.
      final_objective_values: The objective function evaluated at the
        vertices of the final simplex.
      initial_simplex: The starting simplex.
      initial_objective_values: The objective function evaluated at the
        vertices of the initial simplex.
      num_iterations: The number of iterations of the main algorithm body.

  Raises:
    ValueError: If any of the following conditions hold
      1. If none or more than one of `initial_simplex` and `initial_vertex` are
        supplied.
      2. If `initial_simplex` and `step_sizes` are both specified.
  """
  with tf.compat.v1.name_scope(arg_15, 'Func', [
      arg_1, arg_2, arg_3, arg_4,
      arg_5, arg_7, arg_8
  ]):
    (
        arg_16,
        arg_17,
        arg_18,
        arg_19,
        arg_20
    ) = _prepare_args(arg_0,
                      arg_1,
                      arg_2,
                      arg_3,
                      arg_4,
                      arg_5,
                      arg_6)
    arg_21 = arg_18.dtype
    (
        arg_11,
        arg_12,
        arg_13,
        arg_14
    ) = _resolve_parameters(arg_16,
                            arg_11,
                            arg_12,
                            arg_13,
                            arg_14,
                            arg_21)

    arg_22 = dict(
        arg_0=arg_0,
        arg_16=arg_16,
        arg_7=arg_7,
        arg_8=arg_8,
        arg_6=arg_6,
        arg_11=arg_11,
        arg_12=arg_12,
        arg_13=arg_13,
        arg_14=arg_14)

    def _loop_body(arg_17, arg_23, arg_18, arg_19,
                   arg_20):
      (
          arg_24,
          arg_25,
          arg_26,
          arg_27
      ) = nelder_mead_one_step(arg_18, arg_19, **arg_22)

      return (arg_24, arg_23 + 1, arg_25, arg_26,
              arg_20 + arg_27)

    arg_28 = (False, 0, arg_18, arg_19,
                    arg_20)
    # Loop until either we have converged or if the max iterations are supplied
    # then until we have converged or exhausted the available iteration budget.
    def _is_converged(arg_24, arg_29, *arg_30):  # pylint:disable=unused-argument
      # It is important to ensure that not_converged is a tensor. If
      # converged is not a tensor but a Python bool, then the overloaded
      # op '~' acts as bitwise complement so ~True = -2 and ~False = -1.
      # In that case, the loop will never terminate.
      arg_31 = tf.logical_not(arg_24)
      return (arg_31 if arg_10 is None
              else (arg_31 & (arg_29 < arg_10)))

    (arg_24, arg_29, arg_32, arg_33,
     arg_34) = tf.while_loop(
         cond=_is_converged,
         body=_loop_body,
         loop_vars=arg_28,
         arg_9=arg_9)
    arg_35 = tf.argsort(
        arg_33, direction='ASCENDING', stable=True)
    arg_36 = arg_35[0]
    # The explicit cast to Tensor below is done to avoid returning a mixture
    # of Python types and Tensors which cause problems with session.run.
    # In the eager mode, converged may remain a Python bool. Trying to evaluate
    # the whole tuple in one evaluate call will raise an exception because
    # of the presence of non-tensors. This is very annoying so we explicitly
    # cast those arguments to Tensors.
    return NelderMeadOptimizerResults(
        arg_24=tf.convert_to_tensor(value=arg_24),
        num_objective_evaluations=arg_34,
        position=arg_32[arg_36],
        objective_value=arg_33[arg_36],
        arg_32=arg_32,
        arg_33=arg_33,
        arg_29=tf.convert_to_tensor(value=arg_29),
        arg_1=arg_18,
        initial_objective_values=arg_19)

Minimum of the objective function using the Nelder Mead simplex algorithm.

  Performs an unconstrained minimization of a (possibly non-smooth) function
  using the Nelder Mead simplex method. Nelder Mead method does not support
  univariate functions. Hence the dimensions of the domain must be 2 or greater.
  For details of the algorithm, see
  [Press, Teukolsky, Vetterling and Flannery(2007)][1].

  Points in the domain of the objective function may be represented as a
  `Tensor` of general shape but with rank at least 1. The algorithm proceeds
  by modifying a full rank simplex in the domain. The initial simplex may
  either be specified by the user or can be constructed using a single vertex
  supplied by the user. In the latter case, if `v0` is the supplied vertex,
  the simplex is the convex hull of the set:

  ```None
  S = {v0} + {v0 + step_i * e_i}
  ```

  Here `e_i` is a vector which is `1` along the `i`-th axis and zero elsewhere
  and `step_i` is a characteristic length scale along the `i`-th axis. If the
  step size is not supplied by the user, a unit step size is used in every axis.
  Alternately, a single step size may be specified which is used for every
  axis. The most flexible option is to supply a bespoke step size for every
  axis.

  ### Usage:

  The following example demonstrates the usage of the Nelder Mead minimzation
  on a two dimensional problem with the minimum located at a non-differentiable
  point.

  ```python
    # The objective function
    def sqrt_quadratic(x):
      return tf.sqrt(tf.reduce_sum(x ** 2, axis=-1))

    start = tf.constant([6.0, -21.0])  # Starting point for the search.
    optim_results = tfp.optimizer.nelder_mead_minimize(
        sqrt_quadratic, initial_vertex=start, func_tolerance=1e-8,
        batch_evaluate_objective=True)

    with tf.Session() as session:
      results = session.run(optim_results)
      # Check that the search converged
      assert(results.converged)
      # Check that the argmin is close to the actual value.
      np.testing.assert_allclose(results.position, np.array([0.0, 0.0]),
                                 atol=1e-7)
      # Print out the total number of function evaluations it took.
      print ("Function evaluations: %d" % results.num_objective_evaluations)
  ```

  ### References:
  [1]: William Press, Saul Teukolsky, William Vetterling and Brian Flannery.
    Numerical Recipes in C++, third edition. pp. 502-507. (2007).
    http://numerical.recipes/cpppages/chap0sel.pdf

  [2]: Jeffrey Lagarias, James Reeds, Margaret Wright and Paul Wright.
    Convergence properties of the Nelder-Mead simplex method in low dimensions,
    Siam J. Optim., Vol 9, No. 1, pp. 112-147. (1998).
    http://www.math.kent.edu/~reichel/courses/Opt/reading.material.2/nelder.mead.pdf

  [3]: Fuchang Gao and Lixing Han. Implementing the Nelder-Mead simplex
    algorithm with adaptive parameters. Computational Optimization and
    Applications, Vol 51, Issue 1, pp 259-277. (2012).
    https://pdfs.semanticscholar.org/15b4/c4aa7437df4d032c6ee6ce98d6030dd627be.pdf

  Args:
    objective_function:  A Python callable that accepts a point as a
      real `Tensor` and returns a `Tensor` of real dtype containing
      the value of the function at that point. The function
      to be minimized. If `batch_evaluate_objective` is `True`, the callable
      may be evaluated on a `Tensor` of shape `[n+1] + s ` where `n` is
      the dimension of the problem and `s` is the shape of a single point
      in the domain (so `n` is the size of a `Tensor` representing a
      single point).
      In this case, the expected return value is a `Tensor` of shape `[n+1]`.
      Note that this method does not support univariate functions so the problem
      dimension `n` must be strictly greater than 1.
    initial_simplex: (Optional) `Tensor` of real dtype. The initial simplex to
      start the search. If supplied, should be a `Tensor` of shape `[n+1] + s`
      where `n` is the dimension of the problem and `s` is the shape of a
      single point in the domain. Each row (i.e. the `Tensor` with a given
      value of the first index) is interpreted as a vertex of a simplex and
      hence the rows must be affinely independent. If not supplied, an axes
      aligned simplex is constructed using the `initial_vertex` and
      `step_sizes`. Only one and at least one of `initial_simplex` and
      `initial_vertex` must be supplied.
    initial_vertex: (Optional) `Tensor` of real dtype and any shape that can
      be consumed by the `objective_function`. A single point in the domain that
      will be used to construct an axes aligned initial simplex.
    step_sizes: (Optional) `Tensor` of real dtype and shape broadcasting
      compatible with `initial_vertex`. Supplies the simplex scale along each
      axes. Only used if `initial_simplex` is not supplied. See description
      above for details on how step sizes and initial vertex are used to
      construct the initial simplex.
    objective_at_initial_simplex: (Optional) Rank `1` `Tensor` of real dtype
      of a rank `1` `Tensor`. The value of the objective function at the
      initial simplex. May be supplied only if `initial_simplex` is
      supplied. If not supplied, it will be computed.
    objective_at_initial_vertex: (Optional) Scalar `Tensor` of real dtype. The
      value of the objective function at the initial vertex. May be supplied
      only if the `initial_vertex` is also supplied.
    batch_evaluate_objective: (Optional) Python `bool`. If True, the objective
      function will be evaluated on all the vertices of the simplex packed
      into a single tensor. If False, the objective will be mapped across each
      vertex separately. Evaluating the objective function in a batch allows
      use of vectorization and should be preferred if the objective function
      allows it.
    func_tolerance: (Optional) Scalar `Tensor` of real dtype. The algorithm
      stops if the absolute difference between the largest and the smallest
      function value on the vertices of the simplex is below this number.
    position_tolerance: (Optional) Scalar `Tensor` of real dtype. The
      algorithm stops if the largest absolute difference between the
      coordinates of the vertices is below this threshold.
    parallel_iterations: (Optional) Positive integer. The number of iterations
      allowed to run in parallel.
    max_iterations: (Optional) Scalar positive `Tensor` of dtype `int32`.
      The maximum number of iterations allowed. If `None` then no limit is
      applied.
    reflection: (Optional) Positive Scalar `Tensor` of same dtype as
      `initial_vertex`. This parameter controls the scaling of the reflected
      vertex. See, [Press et al(2007)][1] for details. If not specified,
      uses the dimension dependent prescription of [Gao and Han(2012)][3].
    expansion: (Optional) Positive Scalar `Tensor` of same dtype as
      `initial_vertex`. Should be greater than `1` and `reflection`. This
      parameter controls the expanded scaling of a reflected vertex.
      See, [Press et al(2007)][1] for details. If not specified, uses the
      dimension dependent prescription of [Gao and Han(2012)][3].
    contraction: (Optional) Positive scalar `Tensor` of same dtype as
      `initial_vertex`. Must be between `0` and `1`. This parameter controls
      the contraction of the reflected vertex when the objective function at
      the reflected point fails to show sufficient decrease.
      See, [Press et al(2007)][1] for more details. If not specified, uses
      the dimension dependent prescription of [Gao and Han(2012][3].
    shrinkage: (Optional) Positive scalar `Tensor` of same dtype as
      `initial_vertex`. Must be between `0` and `1`. This parameter is the scale
      by which the simplex is shrunk around the best point when the other
      steps fail to produce improvements.
      See, [Press et al(2007)][1] for more details. If not specified, uses
      the dimension dependent prescription of [Gao and Han(2012][3].
    name: (Optional) Python str. The name prefixed to the ops created by this
      function. If not supplied, the default name 'minimize' is used.

  Returns:
    optimizer_results: A namedtuple containing the following items:
      converged: Scalar boolean tensor indicating whether the minimum was
        found within tolerance.
      num_objective_evaluations: The total number of objective
        evaluations performed.
      position: A `Tensor` containing the last argument value found
        during the search. If the search converged, then
        this value is the argmin of the objective function.
      objective_value: A tensor containing the value of the objective
        function at the `position`. If the search
        converged, then this is the (local) minimum of
        the objective function.
      final_simplex: The last simplex constructed before stopping.
      final_objective_values: The objective function evaluated at the
        vertices of the final simplex.
      initial_simplex: The starting simplex.
      initial_objective_values: The objective function evaluated at the
        vertices of the initial simplex.
      num_iterations: The number of iterations of the main algorithm body.

  Raises:
    ValueError: If any of the following conditions hold
      1. If none or more than one of `initial_simplex` and `initial_vertex` are
        supplied.
      2. If `initial_simplex` and `step_sizes` are both specified.

Minimum of the objective function using the Nelder Mead simplex algorithm .


return isinstance(val, numbers.Real) and not is_single_integer(val) and not isinstance(val, bool)

def Func ( arg_0 ) : return isinstance ( arg_0 , numbers . Real ) and not is_single_integer ( arg_0 ) and not isinstance ( arg_0 , bool )

def Func(arg_0):
    """
    Checks whether a variable is a float.

    Parameters
    ----------
    val
        The variable to check.

    Returns
    -------
    bool
        True if the variable is a float. Otherwise False.

    """
    return isinstance(arg_0, numbers.Real) and not is_single_integer(arg_0) and not isinstance(arg_0, bool)


def Func(arg_0, arg_1, arg_2, arg_3):
        """Called when a device is disconnected."""
        logger.debug('centralManager_didDisconnectPeripheral called')
        # Get the device and remove it from the device list, then fire its
        # disconnected event.
        arg_4 = device_list().get(arg_2)
        if arg_4 is not None:
            # Fire disconnected event and remove device from device list.
            arg_4._set_disconnected()
            device_list().remove(arg_2)


def Func ( arg_0 , arg_1 = 1e-13 , arg_2 = 0 ) : arg_0 = np . atleast_2d ( arg_0 ) arg_3 , arg_4 , arg_5 = np . linalg . svd ( arg_0 ) arg_6 = max ( arg_1 , arg_2 * arg_4 [ 0 ] ) arg_7 = ( arg_4 >= arg_6 ) . sum ( ) arg_8 = arg_5 [ arg_7 : ] . conj ( ) . T return arg_8

def Func(arg_0, arg_1=1e-13, arg_2=0):
    """Compute an approximate basis for the Func of A.
    The algorithm used by this function is based on the singular value
    decomposition of `A`.

    Parameters
    ----------
    A : numpy.ndarray
        A should be at most 2-D.  A 1-D array with length k will be treated
        as a 2-D with shape (1, k)
    atol : float
        The absolute tolerance for a zero singular value.  Singular values
        smaller than `atol` are considered to be zero.
    rtol : float
        The relative tolerance.  Singular values less than rtol*smax are
        considered to be zero, where smax is the largest singular value.

    If both `atol` and `rtol` are positive, the combined tolerance is the
    maximum of the two; that is::
    tol = max(atol, rtol * smax)
    Singular values smaller than `tol` are considered to be zero.

    Returns
    -------
    numpy.ndarray
        If `A` is an array with shape (m, k), then `ns` will be an array
        with shape (k, n), where n is the estimated dimension of the
        Func of `A`.  The columns of `ns` are a basis for the
        Func; each element in numpy.dot(A, ns) will be approximately
        zero.

    Notes
    -----
    Taken from the numpy cookbook.
    """
    arg_0 = np.atleast_2d(arg_0)
    arg_3, arg_4, arg_5 = np.linalg.svd(arg_0)
    arg_6 = max(arg_1, arg_2 * arg_4[0])
    arg_7 = (arg_4 >= arg_6).sum()
    arg_8 = arg_5[arg_7:].conj().T
    return arg_8

Compute an approximate basis for the nullspace of A.
    The algorithm used by this function is based on the singular value
    decomposition of `A`.

    Parameters
    ----------
    A : numpy.ndarray
        A should be at most 2-D.  A 1-D array with length k will be treated
        as a 2-D with shape (1, k)
    atol : float
        The absolute tolerance for a zero singular value.  Singular values
        smaller than `atol` are considered to be zero.
    rtol : float
        The relative tolerance.  Singular values less than rtol*smax are
        considered to be zero, where smax is the largest singular value.

    If both `atol` and `rtol` are positive, the combined tolerance is the
    maximum of the two; that is::
    tol = max(atol, rtol * smax)
    Singular values smaller than `tol` are considered to be zero.

    Returns
    -------
    numpy.ndarray
        If `A` is an array with shape (m, k), then `ns` will be an array
        with shape (k, n), where n is the estimated dimension of the
        nullspace of `A`.  The columns of `ns` are a basis for the
        nullspace; each element in numpy.dot(A, ns) will be approximately
        zero.

    Notes
    -----
    Taken from the numpy cookbook.

Compute an approximate basis for the nullspace of A . The algorithm used by this function is based on the singular value decomposition of A .


def Func ( arg_0 , arg_1 ) : arg_2 = CourseCatalogApiClient ( arg_1 . user ) arg_3 = arg_2 . get_paginated_catalogs ( arg_1 . GET ) arg_0 . ensure_data_exists ( arg_1 , arg_3 ) arg_4 = serializers . ResponsePaginationSerializer ( arg_3 ) return get_paginated_response ( arg_4 . data , arg_1 )

def Func(arg_0, arg_1):
        """
        DRF view to Func all catalogs.

        Arguments:
            request (HttpRequest): Current request

        Returns:
            (Response): DRF response object containing course catalogs.
        """
        arg_2 = CourseCatalogApiClient(arg_1.user)
        arg_3 = arg_2.get_paginated_catalogs(arg_1.GET)
        arg_0.ensure_data_exists(arg_1, arg_3)
        arg_4 = serializers.ResponsePaginationSerializer(arg_3)
        return get_paginated_response(arg_4.data, arg_1)

DRF view to list all catalogs.

        Arguments:
            request (HttpRequest): Current request

        Returns:
            (Response): DRF response object containing course catalogs.


def Func(*arg_0):
  """Register a file reader for use in parse_config_file.

  Registered file readers will be used to try reading files passed to
  `parse_config_file`. All file readers (beginning with the default `open`) will
  be tried until one of them succeeds at opening the file.

  This function may also be be used used as a decorator. For example:

      @Func(IOError)
      def exotic_data_source(filename):
        ...

  Args:
    *args: (When used as a decorator, only the existence check is supplied.)
      - file_reader_fn: The file reader function to register. This should be a
        function that can be used as a context manager to open a file and
        provide a file-like object, similar to Python's built-in `open`.
      - is_readable_fn: A function taking the file path and returning a boolean
        indicating whether the file can be read by `file_reader_fn`.

  Returns:
    `None`, or when used as a decorator, a function that will perform the
    registration using the supplied readability predicate.
  """
  def do_registration(arg_1, arg_2):
    if arg_1 not in list(zip(*_FILE_READERS))[0]:
      _FILE_READERS.append((arg_1, arg_2))

  if len(arg_0) == 1:  # It's a decorator.
    return functools.partial(do_registration, arg_2=arg_0[0])
  elif len(arg_0) == 2:
    do_registration(*arg_0)
  else:  # 0 or > 2 arguments supplied.
    arg_3 = 'Func() takes 1 or 2 arguments ({} given)'
    raise TypeError(arg_3.format(len(arg_0)))

Register a file reader for use in parse_config_file.

  Registered file readers will be used to try reading files passed to
  `parse_config_file`. All file readers (beginning with the default `open`) will
  be tried until one of them succeeds at opening the file.

  This function may also be be used used as a decorator. For example:

      @register_file_reader(IOError)
      def exotic_data_source(filename):
        ...

  Args:
    *args: (When used as a decorator, only the existence check is supplied.)
      - file_reader_fn: The file reader function to register. This should be a
        function that can be used as a context manager to open a file and
        provide a file-like object, similar to Python's built-in `open`.
      - is_readable_fn: A function taking the file path and returning a boolean
        indicating whether the file can be read by `file_reader_fn`.

  Returns:
    `None`, or when used as a decorator, a function that will perform the
    registration using the supplied readability predicate.

Register a file reader for use in parse_config_file .


def
Func
(
arg_0
,
arg_1
=
0
,
arg_2
=
)
:
if
isinstance
(
arg_0
,
Expression
)
:
return
Func
(
arg_0
.
body
,
0
,
arg_2
)
if
hasattr
(
arg_0
,
"body"
)
else
""
elif
isinstance
(
arg_0
,
Name
)
:
return
arg_2
.
get
(
arg_0
.
id
,
arg_0
.
id
)
if
arg_2
else
arg_0
.
id
elif
isinstance
(
arg_0
,
BoolOp
)
:
arg_3
=
arg_0
.
op
if
isinstance
(
arg_3
,
Or
)
:
arg_4
=
" or "
.
join
(
Func
(
i
,
arg_1
+
1
,
arg_2
)
for
i
in
arg_0
.
values
)
elif
isinstance
(
arg_3
,
And
)
:
arg_4
=
" and "
.
join
(
Func
(
i
,
arg_1
+
1
,
arg_2
)
for
i
in
arg_0
.
values
)
else
:
raise
TypeError
(
"unsupported operation "
+
arg_3
.
__class__
.
__name
)
return
"("
+
arg_4
+
")"
if
arg_1
else
arg_4
elif
arg_0
is
:
return
""
else
:
raise
TypeError
(
"unsupported operation  "
+
repr
(
arg_0
)
)

def Func(arg_0, arg_1=0, arg_2=None):
    """convert compiled ast to gene_reaction_rule str

    Parameters
    ----------
    expr : str
        string for a gene reaction rule, e.g "a and b"
    level : int
        internal use only
    names : dict
        Dict where each element id a gene identifier and the value is the
        gene name. Use this to get a rule str which uses names instead. This
        should be done for display purposes only. All gene_reaction_rule
        strings which are computed with should use the id.

    Returns
    ------
    string
        The gene reaction rule
    """
    if isinstance(arg_0, Expression):
        return Func(arg_0.body, 0, arg_2) \
            if hasattr(arg_0, "body") else ""
    elif isinstance(arg_0, Name):
        return arg_2.get(arg_0.id, arg_0.id) if arg_2 else arg_0.id
    elif isinstance(arg_0, BoolOp):
        arg_3 = arg_0.op
        if isinstance(arg_3, Or):
            arg_4 = " or ".join(Func(i, arg_1 + 1, arg_2)
                                  for i in arg_0.values)
        elif isinstance(arg_3, And):
            arg_4 = " and ".join(Func(i, arg_1 + 1, arg_2)
                                   for i in arg_0.values)
        else:
            raise TypeError("unsupported operation " + arg_3.__class__.__name)
        return "(" + arg_4 + ")" if arg_1 else arg_4
    elif arg_0 is None:
        return ""
    else:
        raise TypeError("unsupported operation  " + repr(arg_0))


(returns,
                 live_start_date=None,
                 ax=None)

def Func ( arg_0 , arg_1 = None , arg_2 = None ) : if arg_2 is None : arg_2 = plt . gca ( ) arg_2 . set_label ( '' ) arg_2 . set_ylabel ( 'Returns' ) if arg_1 is not None : arg_1 = ep . utils . get_utc_timestamp ( arg_1 ) arg_3 = arg_0 . loc [ arg_0 . index < arg_1 ] arg_4 = arg_0 . loc [ arg_0 . index >= arg_1 ] arg_3 . plot ( arg_2 = arg_2 , color = 'g' ) arg_4 . plot ( arg_2 = arg_2 , color = 'r' ) else : arg_0 . plot ( arg_2 = arg_2 , color = 'g' ) return arg_2

def Func(arg_0,
                 arg_1=None,
                 arg_2=None):
    """
    Plots raw returns over time.

    Backtest returns are in green, and out-of-sample (live trading)
    returns are in red.

    Parameters
    ----------
    returns : pd.Series
        Daily returns of the strategy, noncumulative.
         - See full explanation in tears.create_full_tear_sheet.
    live_start_date : datetime, optional
        The date when the strategy began live trading, after
        its backtest period. This date should be normalized.
    ax : matplotlib.Axes, optional
        Axes upon which to plot.
    **kwargs, optional
        Passed to plotting function.

    Returns
    -------
    ax : matplotlib.Axes
        The axes that were plotted on.
    """

    if arg_2 is None:
        arg_2 = plt.gca()

    arg_2.set_label('')
    arg_2.set_ylabel('Returns')

    if arg_1 is not None:
        arg_1 = ep.utils.get_utc_timestamp(arg_1)
        arg_3 = arg_0.loc[arg_0.index < arg_1]
        arg_4 = arg_0.loc[arg_0.index >= arg_1]
        arg_3.plot(arg_2=arg_2, color='g')
        arg_4.plot(arg_2=arg_2, color='r')

    else:
        arg_0.plot(arg_2=arg_2, color='g')

    return arg_2


def Func ( arg_0 , arg_1 = 'Func' ) : with tf . name_scope ( arg_1 ) : arg_0 = tf . nn . sigmoid ( arg_0 ) * arg_0 return arg_0

def Func(arg_0, arg_1='Func'):
    """Swish function.

     See `Swish: a Self-Gated Activation Function <https://arxiv.org/abs/1710.05941>`__.

    Parameters
    ----------
    x : Tensor
        input.
    name: str
        function name (optional).

    Returns
    -------
    Tensor
        A ``Tensor`` in the same type as ``x``.

    """
    with tf.name_scope(arg_1):
        arg_0 = tf.nn.sigmoid(arg_0) * arg_0
    return arg_0


def Func ( arg_0 , arg_1 ) : check_is_fitted ( arg_0 , [ 'tree' ] ) arg_1 = check_array ( arg_1 ) return arg_0 . tree . query ( arg_1 ) [ 0 ] . flatten ( )

def Func(arg_0, arg_1):
        """Returns the value of the nearest neighbor from the training set.

        Parameters
        ----------
         X : array-like or sparse matrix, shape (n_samples, n_features)
            The input samples. Internally, it will be converted to
            ``dtype=np.float32`` and if a sparse matrix is provided
            to a sparse ``csr_matrix``.

        Returns
        -------
        y : array, shape (n_samples,)
        """
        # Check is fit had been called
        check_is_fitted(arg_0, ['tree'])
        # Check data
        arg_1 = check_array(arg_1)
        return arg_0.tree.query(arg_1)[0].flatten()

Returns the value of the nearest neighbor from the training set .


def Func ( arg_0 , * arg_1 ) : from ubelt import util_path arg_2 = get_app_data_dir ( arg_0 , * arg_1 ) util_path . ensuredir ( arg_2 ) return arg_2

def Func(arg_0, *arg_1):
    """
    Calls `get_app_data_dir` but ensures the directory exists.

    Args:
        appname (str): the name of the application
        *args: any other subdirectories may be specified

    SeeAlso:
        get_app_data_dir

    Example:
        >>> import ubelt as ub
        >>> dpath = ub.Func('ubelt')
        >>> assert exists(dpath)
    """
    from ubelt import util_path
    arg_2 = get_app_data_dir(arg_0, *arg_1)
    util_path.ensuredir(arg_2)
    return arg_2

Calls `get_app_data_dir` but ensures the directory exists.

    Args:
        appname (str): the name of the application
        *args: any other subdirectories may be specified

    SeeAlso:
        get_app_data_dir

    Example:
        >>> import ubelt as ub
        >>> dpath = ub.ensure_app_data_dir('ubelt')
        >>> assert exists(dpath)

Calls get_app_data_dir but ensures the directory exists .


(group_name, policy_name, client=None, **kwargs)

return client.get_group_policy(GroupName=group_name, PolicyName=policy_name, **kwargs)['PolicyDocument']

def Func ( arg_0 , arg_1 , arg_2 = None , ** arg_3 ) : return arg_2 . get_group_policy ( GroupName = arg_0 , PolicyName = arg_1 , ** arg_3 ) [ 'PolicyDocument' ]

def Func(arg_0, arg_1, arg_2=None, **arg_3):
    """Fetches the specific IAM group inline-policy document."""
    return arg_2.get_group_policy(GroupName=arg_0, PolicyName=arg_1, **arg_3)['PolicyDocument']

Fetches the specific IAM group inline - policy document .


(users, label, extra_context=None, sender=None)

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None ) : if arg_2 is None : arg_2 = { } if isinstance ( arg_0 , QuerySet ) : arg_0 = [ row [ "pk" ] for row in arg_0 . values ( "pk" ) ] else : arg_0 = [ arg_5 . pk for arg_5 in arg_0 ] arg_4 = [ ] for arg_5 in arg_0 : arg_4 . append ( ( arg_5 , arg_1 , arg_2 , arg_3 ) ) NoticeQueueBatch ( pickled_data = base64 . b64encode ( pickle . dumps ( arg_4 ) ) ) . save ( )

def Func(arg_0, arg_1, arg_2=None, arg_3=None):
    """
    Queue the notification in NoticeQueueBatch. This allows for large amounts
    of user notifications to be deferred to a seperate process running outside
    the webserver.
    """
    if arg_2 is None:
        arg_2 = {}
    if isinstance(arg_0, QuerySet):
        arg_0 = [row["pk"] for row in arg_0.values("pk")]
    else:
        arg_0 = [arg_5.pk for arg_5 in arg_0]
    arg_4 = []
    for arg_5 in arg_0:
        arg_4.append((arg_5, arg_1, arg_2, arg_3))
    NoticeQueueBatch(pickled_data=base64.b64encode(pickle.dumps(arg_4))).save()

Queue the notification in NoticeQueueBatch . This allows for large amounts of user notifications to be deferred to a seperate process running outside the webserver .


def Func(arg_0):
        """
        checks whether child features are within the coordinate boundaries of parent features

        :return:
        """
        for arg_1 in arg_0.lines:
            for arg_2 in arg_1['parents']:
                arg_3 = False
                for arg_4 in arg_2:
                    if arg_4['start'] <= arg_1['start'] and arg_1['end'] <= arg_4['end']:
                        arg_3 = True
                        break
                if not arg_3:
                    arg_0.add_line_error(arg_1, {'message': 'This feature is not contained within the feature boundaries of parent: {0:s}: {1:s}'.format(
                        arg_2[0]['attributes']['ID'],
                        ','.join(['({0:s}, {1:d}, {2:d})'.format(arg_1['seqid'], arg_1['start'], arg_1['end']) for arg_1 in arg_2])
                    ), 'error_type': 'BOUNDS', 'location': 'parent_boundary'})


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
'...: '
arg_3
=
len
(
arg_1
.
lstrip
(
'\n'
)
)
len
(
arg_2
)
arg_4
=
' '
*
arg_3
+
arg_2
return
'%s'
%
arg_4

def Func(arg_0, arg_1):
        """ Given a plain text version of an In prompt, returns an HTML
            continuation prompt.
        """
        arg_2 = '...: '
        arg_3 = len(arg_1.lstrip('\n')) - len(arg_2)
        arg_4 = ' ' * arg_3 + arg_2
        return '%s' % arg_4

Given a plain text version of an In prompt returns an HTML continuation prompt .


def Func ( arg_0 ) : arg_1 = [ ] arg_2 = None arg_3 = dict ( arg_0 . _bytes_lines ( ) ) arg_4 = [ ] arg_5 = 0 arg_6 = arg_14 = None arg_7 = set ( ) arg_8 = list ( ByteCodes ( arg_0 . code . co_code ) ) for arg_9 in arg_8 : if arg_9 . jump_to >= 0 : arg_7 . add ( arg_9 . jump_to ) arg_10 = 0 for arg_9 in arg_8 : arg_11 = False arg_12 = False if arg_9 . offset in arg_3 : arg_11 = True arg_10 = arg_3 [ arg_9 . offset ] arg_12 = True elif arg_9 . offset in arg_7 : arg_11 = True elif arg_9 . op in OPS_CHUNK_BEGIN : arg_11 = True if not arg_2 or arg_11 : if arg_2 : arg_2 . exits . add ( arg_9 . offset ) arg_2 = Chunk ( arg_9 . offset , arg_10 , arg_12 ) arg_1 . append ( arg_2 ) if arg_9 . jump_to >= 0 and arg_9 . op not in OPS_NO_JUMP : if arg_5 : arg_5 -= 1 else : arg_2 . exits . add ( arg_9 . jump_to ) if arg_9 . op in OPS_CODE_END : arg_2 . exits . add ( - arg_0 . code . co_firstlineno ) if arg_9 . op in OPS_PUSH_BLOCK : arg_4 . append ( ( arg_9 . op , arg_9 . jump_to ) ) if arg_9 . op in OPS_POP_BLOCK : arg_4 . pop ( ) if arg_9 . op in OPS_CHUNK_END : if arg_9 . op == OP_BREAK_LOOP : arg_2 . exits . add ( arg_4 [ - 1 ] [ 1 ] ) arg_2 = None if arg_9 . op == OP_END_FINALLY : for arg_13 in reversed ( arg_4 ) : if arg_13 [ 0 ] in OPS_EXCEPT_BLOCKS : arg_2 . exits . add ( arg_13 [ 1 ] ) break if arg_9 . op == OP_COMPARE_OP and arg_9 . arg == COMPARE_EXCEPTION : arg_5 += 1 arg_14 = arg_6 arg_6 = arg_9 if arg_1 : if arg_6 and arg_14 : if arg_14 . op == OP_LOAD_CONST and arg_6 . op == OP_RETURN_VALUE : if arg_0 . code . co_consts [ arg_14 . arg ] is None : if arg_1 [ - 1 ] . byte != arg_14 . offset : arg_15 = - arg_0 . code . co_firstlineno arg_16 = arg_1 [ - 1 ] arg_16 . exits . remove ( arg_15 ) arg_16 . exits . add ( arg_14 . offset ) arg_2 = Chunk ( arg_14 . offset , arg_16 . line , False ) arg_2 . exits . add ( arg_15 ) arg_1 . append ( arg_2 ) arg_1 [ - 1 ] . length = arg_9 . next_offset - arg_1 [ - 1 ] . byte for arg_18 in range ( len ( arg_1 ) - 1 ) : arg_1 [ arg_18 ] . length = arg_1 [ arg_18 + 1 ] . byte - arg_1 [ arg_18 ] . byte return arg_1

def Func(arg_0):
        """Split the code object into a list of `Chunk` objects.

        Each chunk is only entered at its first instruction, though there can
        be many exits from a chunk.

        Returns a list of `Chunk` objects.

        """
        # The list of chunks so far, and the one we're working on.
        arg_1 = []
        arg_2 = None

        # A dict mapping byte offsets of line starts to the line numbers.
        arg_3 = dict(arg_0._bytes_lines())

        # The block stack: loops and try blocks get pushed here for the
        # implicit jumps that can occur.
        # Each entry is a tuple: (block type, destination)
        arg_4 = []

        # Some op codes are followed by branches that should be ignored.  This
        # is a count of how many ignores are left.
        arg_5 = 0

        # We have to handle the last two bytecodes specially.
        arg_6 = arg_14 = None

        # Get a set of all of the jump-to points.
        arg_7 = set()
        arg_8 = list(ByteCodes(arg_0.code.co_code))
        for arg_9 in arg_8:
            if arg_9.jump_to >= 0:
                arg_7.add(arg_9.jump_to)

        arg_10 = 0

        # Walk the byte codes building chunks.
        for arg_9 in arg_8:
            # Maybe have to start a new chunk
            arg_11 = False
            arg_12 = False
            if arg_9.offset in arg_3:
                # Start a new chunk for each source line number.
                arg_11 = True
                arg_10 = arg_3[arg_9.offset]
                arg_12 = True
            elif arg_9.offset in arg_7:
                # To make chunks have a single entrance, we have to make a new
                # chunk when we get to a place some bytecode jumps to.
                arg_11 = True
            elif arg_9.op in OPS_CHUNK_BEGIN:
                # Jumps deserve their own unnumbered chunk.  This fixes
                # problems with jumps to jumps getting confused.
                arg_11 = True

            if not arg_2 or arg_11:
                if arg_2:
                    arg_2.exits.add(arg_9.offset)
                arg_2 = Chunk(arg_9.offset, arg_10, arg_12)
                arg_1.append(arg_2)

            # Look at the opcode
            if arg_9.jump_to >= 0 and arg_9.op not in OPS_NO_JUMP:
                if arg_5:
                    # Someone earlier wanted us to ignore this branch.
                    arg_5 -= 1
                else:
                    # The opcode has a jump, it's an exit for this chunk.
                    arg_2.exits.add(arg_9.jump_to)

            if arg_9.op in OPS_CODE_END:
                # The opcode can exit the code object.
                arg_2.exits.add(-arg_0.code.co_firstlineno)
            if arg_9.op in OPS_PUSH_BLOCK:
                # The opcode adds a block to the block_stack.
                arg_4.append((arg_9.op, arg_9.jump_to))
            if arg_9.op in OPS_POP_BLOCK:
                # The opcode pops a block from the block stack.
                arg_4.pop()
            if arg_9.op in OPS_CHUNK_END:
                # This opcode forces the end of the chunk.
                if arg_9.op == OP_BREAK_LOOP:
                    # A break is implicit: jump where the top of the
                    # block_stack points.
                    arg_2.exits.add(arg_4[-1][1])
                arg_2 = None
            if arg_9.op == OP_END_FINALLY:
                # For the finally clause we need to find the closest exception
                # block, and use its jump target as an exit.
                for arg_13 in reversed(arg_4):
                    if arg_13[0] in OPS_EXCEPT_BLOCKS:
                        arg_2.exits.add(arg_13[1])
                        break
            if arg_9.op == OP_COMPARE_OP and arg_9.arg == COMPARE_EXCEPTION:
                # This is an except clause.  We want to overlook the next
                # branch, so that except's don't count as branches.
                arg_5 += 1

            arg_14 = arg_6
            arg_6 = arg_9

        if arg_1:
            # The last two bytecodes could be a dummy "return None" that
            # shouldn't be counted as real code. Every Python code object seems
            # to end with a return, and a "return None" is inserted if there
            # isn't an explicit return in the source.
            if arg_6 and arg_14:
                if arg_14.op == OP_LOAD_CONST and arg_6.op == OP_RETURN_VALUE:
                    if arg_0.code.co_consts[arg_14.arg] is None:
                        # This is "return None", but is it dummy?  A real line
                        # would be a last chunk all by itself.
                        if arg_1[-1].byte != arg_14.offset:
                            arg_15 = -arg_0.code.co_firstlineno
                            # Split the last chunk
                            arg_16 = arg_1[-1]
                            arg_16.exits.remove(arg_15)
                            arg_16.exits.add(arg_14.offset)
                            arg_2 = Chunk(
                                arg_14.offset, arg_16.line, False
                            )
                            arg_2.exits.add(arg_15)
                            arg_1.append(arg_2)

            # Give all the chunks a length.
            arg_1[-1].length = arg_9.next_offset - arg_1[-1].byte # pylint: disable=W0631,C0301
            for arg_18 in range(len(arg_1)-1):
                arg_1[arg_18].length = arg_1[arg_18+1].byte - arg_1[arg_18].byte

        #self.validate_chunks(chunks)
        return arg_1

Split the code object into a list of Chunk objects .


def Func ( arg_0 ) : arg_0 . socket = arg_1 . socket ( arg_1 . AF_INET , arg_1 . SOCK_DGRAM ) arg_0 . socket . setsockopt ( arg_1 . SOL_SOCKET , arg_1 . SO_REUSEADDR , 1 ) arg_0 . socket . setblocking ( 0 ) arg_0 . socket . bind ( ( arg_0 . host , arg_0 . port ) )

def Func(arg_0):
        """
        Opens the socket and binds to the given host and port. Uses
        SO_REUSEADDR to be as robust as possible.
        """
        arg_0.socket = arg_1.socket(arg_1.AF_INET, arg_1.SOCK_DGRAM)
        arg_0.socket.setsockopt(arg_1.SOL_SOCKET, arg_1.SO_REUSEADDR, 1)
        arg_0.socket.setblocking(0)
        arg_0.socket.bind((arg_0.host, arg_0.port))

Opens the socket and binds to the given host and port . Uses SO_REUSEADDR to be as robust as possible .


def Func ( arg_0 , arg_1 ) : arg_2 = getattr ( arg_1 , arg_0 . Func_field ( ) ) try : arg_2 = arg_2 . date ( ) except AttributeError : pass return arg_2

def Func(arg_0, arg_1):
        """
        Returns the end date for a model instance
        """
        arg_2 = getattr(arg_1, arg_0.Func_field())
        try:
            arg_2 = arg_2.date()
        except AttributeError:
            # It's a date rather than datetime, so we use it as is
            pass
        return arg_2


def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Change the value range of a heatmap from one min-max to another min-max.

        E.g. the value range may be changed from min=0.0, max=1.0 to min=-1.0, max=1.0.

        Parameters
        ----------
        arr : ndarray
            Heatmap array to modify.

        source : tuple of float
            Current value range of the input array, given as (min, max), where both are float values.

        target : tuple of float
            Desired output value range of the array, given as (min, max), where both are float values.

        Returns
        -------
        arr_target : ndarray
            Input array, with value range projected to the desired target value range.

        """
        ia.do_assert(ia.is_np_array(arg_1))

        if isinstance(arg_2, HeatmapsOnImage):
            arg_2 = (arg_2.min_value, arg_2.max_value)
        else:
            ia.do_assert(isinstance(arg_2, tuple))
            ia.do_assert(len(arg_2) == 2)
            ia.do_assert(arg_2[0] < arg_2[1])

        if isinstance(arg_3, HeatmapsOnImage):
            arg_3 = (arg_3.min_value, arg_3.max_value)
        else:
            ia.do_assert(isinstance(arg_3, tuple))
            ia.do_assert(len(arg_3) == 2)
            ia.do_assert(arg_3[0] < arg_3[1])

        # Check if source and target are the same (with a tiny bit of tolerance)
        # if so, evade compuation and just copy the array instead.
        # This is reasonable, as source and target will often both be (0.0, 1.0).
        arg_4 = np.finfo(arg_1.dtype).eps
        arg_5 = arg_2[0] - 10*arg_4 < arg_3[0] < arg_2[0] + 10*arg_4
        arg_6 = arg_2[1] - 10*arg_4 < arg_3[1] < arg_2[1] + 10*arg_4
        if arg_5 and arg_6:
            return np.copy(arg_1)

        arg_7, arg_8 = arg_2
        arg_9, arg_10 = arg_3

        arg_11 = arg_8 - arg_7
        arg_12 = arg_10 - arg_9

        arg_13 = (arg_1 - arg_7) / arg_11
        arg_14 = arg_9 + arg_13 * arg_12

        return arg_14

Change the value range of a heatmap from one min - max to another min - max .


return min(best_matches, key=lambda x: sum(map(len, x.matches.values())))

def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . Funcs ( arg_1 ) if len ( arg_2 ) == 0 : return MatchData ( '' , '' ) arg_3 = max ( arg_2 , key = lambda x : x . conf ) arg_4 = ( match for match in arg_2 if match . conf == arg_3 . conf ) return min ( arg_4 , key = lambda x : sum ( map ( len , x . matches . values ( ) ) ) )

def Func(arg_0, arg_1):
        """
        Tests all the intents against the query and returns
        match data of the best intent

        Args:
            query (str): Input sentence to test against intents
        Returns:
            MatchData: Best intent match
        """
        arg_2 = arg_0.Funcs(arg_1)
        if len(arg_2) == 0:
            return MatchData('', '')
        arg_3 = max(arg_2, key=lambda x: x.conf)
        arg_4 = (match for match in arg_2 if match.conf == arg_3.conf)
        return min(arg_4, key=lambda x: sum(map(len, x.matches.values())))


def Func ( arg_0 ) : arg_1 = [ 'Func' ] arg_0 . effects . extend ( arg_1 ) arg_0 . effects_log . append ( 'Func' ) return arg_0

def Func(arg_0):
        '''Out Of Phase Stereo effect. Mixes stereo to twin-mono where each
        mono channel contains the difference between the left and right stereo
        channels. This is sometimes known as the 'karaoke' effect as it often
        has the effect of removing most or all of the vocals from a recording.

        '''
        arg_1 = ['Func']
        arg_0.effects.extend(arg_1)
        arg_0.effects_log.append('Func')

        return arg_0

Out Of Phase Stereo effect . Mixes stereo to twin - mono where each mono channel contains the difference between the left and right stereo channels . This is sometimes known as the karaoke effect as it often has the effect of removing most or all of the vocals from a recording .


def Func(arg_0):
    """Decorator to append default kwargs to a function.
    """
    def decorator(arg_1):
        """Function that appends default kwargs to a function.
        """
        arg_2 = dict(header='Keyword arguments\n-----------------\n',
                      indent='  ',
                      footer='\n')
        arg_3 = defaults_docstring(arg_0, **arg_2)
        if arg_1.__doc__ is None:
            arg_1.__doc__ = ''
        arg_1.__doc__ += arg_3
        return arg_1

    return decorator

Decorator to append default kwargs to a function .


def Func ( arg_0 , arg_1 , arg_2 = True ) : for arg_3 , arg_4 in arg_1 . items ( ) : arg_0 [ arg_3 ] . Func ( arg_4 , arg_2 )

def Func(arg_0, arg_1, arg_2=True):
        """Update values of configuration options with dict.

        Args:
            conf_dict (dict): dict of dict indexed with section and option
                names.
            conf_arg (bool): if True, only options that can be set in a config
                file are updated.
        """
        for arg_3, arg_4 in arg_1.items():
            arg_0[arg_3].Func(arg_4, arg_2)

Update values of configuration options with dict .


def Func(arg_0, arg_1, arg_2=None):
        """Query the Hub's TaskRecord database

        This will return a list of task record dicts that match `query`

        Parameters
        ----------

        query : mongodb query dict
            The search dict. See mongodb query docs for details.
        keys : list of strs [optional]
            The subset of keys to be returned.  The default is to fetch everything but buffers.
            'msg_id' will *always* be included.
        """
        if isinstance(arg_2, basestring):
            arg_2 = [arg_2]
        arg_3 = dict(arg_1=arg_1, arg_2=arg_2)
        arg_0.session.send(arg_0._query_socket, "db_request", arg_3=arg_3)
        arg_4, arg_5 = arg_0.session.recv(arg_0._query_socket, 0)
        if arg_0.debug:
            pprint(arg_5)
        arg_3 = arg_5['content']
        if arg_3['status'] != 'ok':
            raise arg_0._unwrap_exception(arg_3)

        arg_6 = arg_3['records']

        arg_7 = arg_3['buffer_lens']
        arg_8 = arg_3['result_buffer_lens']
        arg_9 = arg_5['buffers']
        arg_10 = arg_7 is not None
        arg_11 = arg_8 is not None
        for arg_12,arg_13 in enumerate(arg_6):
            # relink buffers
            if arg_10:
                arg_14 = arg_7[arg_12]
                arg_13['buffers'], arg_9 = arg_9[:arg_14],arg_9[arg_14:]
            if arg_11:
                arg_14 = arg_8[arg_12]
                arg_13['result_buffers'], arg_9 = arg_9[:arg_14],arg_9[arg_14:]

        return arg_6


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
arg_1
.
split_contents
(
)
if
len
(
arg_2
)
>
1
:
raise
TemplateSyntaxError
(
"'%s' takes no arguments"
%
arg_2
[
0
]
)
return
KissMetricsNode
(
)

def Func(arg_0, arg_1):
    """
    KISSinsights tracking template tag.

    Renders Javascript code to track page visits.  You must supply
    your KISSmetrics API key in the ``KISS_METRICS_API_KEY``
    setting.
    """
    arg_2 = arg_1.split_contents()
    if len(arg_2) > 1:
        raise TemplateSyntaxError("'%s' takes no arguments" % arg_2[0])
    return KissMetricsNode()


def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_3 = arg_1 . copy ( ) if arg_2 is not None : arg_3 . update ( arg_2 ) return arg_3

def Func(arg_0, arg_1, arg_2=None):
        """Build an attribute dictionary."""
        arg_3 = arg_1.copy()
        if arg_2 is not None:
            arg_3.update(arg_2)
        return arg_3


def Func ( arg_0 , arg_1 , ** arg_2 ) : arg_3 = "/{t}/{u}/items/{itemkey}/fulltext" . format ( t = arg_0 . library_type , u = arg_0 . library_id , arg_1 = arg_1 ) return arg_0 . _build_query ( arg_3 )

def Func(arg_0, arg_1, **arg_2):
        """ Get full-text content for an item"""
        arg_3 = "/{t}/{u}/items/{itemkey}/fulltext".format(
            t=arg_0.library_type, u=arg_0.library_id, arg_1=arg_1
        )
        return arg_0._build_query(arg_3)


def Func(arg_0):
    """
    Run length encoding for binhex4.
    The CPython implementation does not do run length encoding
    of \x90 characters. This implementation does.
    """
    if not arg_0:
        return ''
    arg_1 = []
    arg_2 = arg_0[0]
    arg_3 = 1
    # Add a dummy character to get the loop to go one extra round.
    # The dummy must be different from the last character of s.
    # In the same step we remove the first character, which has
    # already been stored in prev.
    if arg_0[-1] == '!':
        arg_0 = arg_0[1:] + '?'
    else:
        arg_0 = arg_0[1:] + '!'

    for arg_4 in arg_0:
        if arg_4 == arg_2 and arg_3 < 255:
            arg_3 += 1
        else:
            if arg_3 == 1:
                if arg_2 != '\x90':
                    arg_1.append(arg_2)
                else:
                    arg_1 += ['\x90', '\x00']
            elif arg_3 < 4:
                if arg_2 != '\x90':
                    arg_1 += [arg_2] * arg_3
                else:
                    arg_1 += ['\x90', '\x00'] * arg_3
            else:
                if arg_2 != '\x90':
                    arg_1 += [arg_2, '\x90', chr(arg_3)]
                else:
                    arg_1 += ['\x90', '\x00', '\x90', chr(arg_3)]
            arg_3 = 1
            arg_2 = arg_4

    return ''.join(arg_1)

Run length encoding for binhex4 . The CPython implementation does not do run length encoding of \ x90 characters . This implementation does .


def Func(arg_0):
    """
    Run an iteration of this anomaly classifier
    """
    arg_1 = arg_0._constructClassificationRecord()

    # Classify this point after waiting the classification delay
    if arg_1.ROWID >= arg_0._autoDetectWaitRecords:
      arg_0._updateState(arg_1)

    # Save new classification record and keep history as moving window
    arg_0.saved_states.append(arg_1)
    if len(arg_0.saved_states) > arg_0._history_length:
      arg_0.saved_states.pop(0)

    return arg_1


return _enum_mangle(var) in self._consts

def Func ( arg_0 , arg_1 ) : if not isinstance ( arg_1 , _str_type ) : return False return _enum_mangle ( arg_1 ) in arg_0 . _consts

def Func(arg_0, arg_1):
        """Check whether the provided value is a valid enum constant."""
        if not isinstance(arg_1, _str_type): return False
        return _enum_mangle(arg_1) in arg_0._consts

Check whether the provided value is a valid enum constant .


(proba: [list, np.ndarray], confident_threshold: float, classes:  [list, np.ndarray])

return labels2onehot(proba2labels(proba, confident_threshold, classes), classes)

def Func ( arg_0 : [ arg_1 , arg_2 . ndarray ] , arg_4 : arg_5 , arg_6 : [ arg_1 , arg_2 . ndarray ] ) -> arg_2 . ndarray : return labels2onehot ( proba2labels ( arg_0 , arg_4 , arg_6 ) , arg_6 )

def Func(arg_0: [arg_1, arg_2.ndarray], arg_4: arg_5, arg_6:  [arg_1, arg_2.ndarray]) -> arg_2.ndarray:
    """
    Convert vectors of probabilities to one-hot representations using confident threshold

    Args:
        proba: samples where each sample is a vector of probabilities to belong with given classes
        confident_threshold: boundary of probability to belong with a class
        classes: array of classes' names

    Returns:
        2d array with one-hot representation of given samples
    """
    return labels2onehot(proba2labels(arg_0, arg_4, arg_6), arg_6)

Convert vectors of probabilities to one - hot representations using confident threshold


def Func ( arg_0 ) : if arg_0 is None : return None arg_1 = arg_0 . xpath ( './/w:vMerge' , namespaces = arg_0 . nsmap ) if len ( arg_1 ) != 1 : return None arg_2 = arg_1 [ 0 ] return arg_2

def Func(arg_0):
    """
    vMerge is what docx uses to denote that a table cell is part of a rowspan.
    The first cell to have a vMerge is the start of the rowspan, and the vMerge
    will be denoted with 'restart'. If it is anything other than restart then
    it is a continuation of another rowspan.
    """
    if arg_0 is None:
        return None
    arg_1 = arg_0.xpath('.//w:vMerge', namespaces=arg_0.nsmap)
    if len(arg_1) != 1:
        return None
    arg_2 = arg_1[0]
    return arg_2

vMerge is what docx uses to denote that a table cell is part of a rowspan . The first cell to have a vMerge is the start of the rowspan and the vMerge will be denoted with restart . If it is anything other than restart then it is a continuation of another rowspan .


def Func(arg_0):
    """Turns a coroutine into a gradient based optimizer."""

    class GradientOptimizer(Optimizer):

        @wraps(arg_0)
        def __init__(arg_1, *arg_2, **arg_3):
            arg_1.algorithm = arg_0(*arg_2, **arg_3)
            arg_1.algorithm.send(None)
            arg_1.operators = []

        def set_transform(arg_1, arg_6):
            arg_1.transform = compose(destruct, arg_6, arg_1.restruct)

        def minimize(arg_1, arg_8, arg_9, arg_10=arg_11.stdout, arg_13=1e3):

            arg_1.display = arg_10
            arg_1.theta = arg_9

            # setup
            arg_15 = arg_1.algorithm.send(destruct(arg_9).copy())
            arg_16 = defaultdict(list)
            arg_17 = []
            if len(arg_1.operators) == 0:
                arg_1.operators = [proxops.identity()]

            # setup
            arg_18, arg_19 = wrap(arg_8, arg_9)
            arg_7 = compose(destruct, *reversed(arg_1.operators), arg_1.restruct)

            arg_1.optional_print(tp.header(['Iteration', 'Objective', '||Grad||', 'Runtime']))
            try:
                for arg_20 in count():

                    # setup
                    arg_21 = perf_counter()
                    arg_22 = arg_18(arg_15)
                    arg_23 = arg_19(arg_15)
                    arg_15 = arg_7(arg_1.algorithm.send(arg_23))
                    arg_17.append(perf_counter() - arg_21)
                    arg_16['f'].append(arg_22)

                    # Update display
                    arg_1.optional_print(tp.row([arg_20,
                                                arg_22,
                                                np.linalg.norm(destruct(arg_23)),
                                                tp.humantime(arg_17[-1])]))

                    if arg_20 >= arg_13:
                        break

            except KeyboardInterrupt:
                pass

            arg_1.optional_print(tp.bottom(4))

            # cleanup
            arg_1.optional_print(u'\u279b Final objective: {}'.format(arg_16['f'][-1]))
            arg_1.optional_print(u'\u279b Total runtime: {}'.format(tp.humantime(sum(arg_17))))
            arg_1.optional_print(u'\u279b Per iteration runtime: {} +/- {}'.format(
                tp.humantime(np.mean(arg_17)),
                tp.humantime(np.std(arg_17)),
            ))

            # result
            return OptimizeResult({
                'x': arg_1.restruct(arg_15),
                'f': arg_22,
                'df': arg_1.restruct(arg_23),
                'k': arg_20,
                'obj': np.array(arg_16['f']),
            })

    return GradientOptimizer

Turns a coroutine into a gradient based optimizer .


return setup(
        name=distname,
        version=__pkginfo__["version"],
        license=__pkginfo__["license"],
        description=__pkginfo__["description"],
        long_description=long_description,
        author=__pkginfo__["author"],
        author_email=__pkginfo__["author_email"],
        url=__pkginfo__["web"],
        scripts=ensure_scripts(scripts),
        classifiers=__pkginfo__["classifiers"],
        data_files=data_files,
        ext_modules=ext_modules,
        cmdclass=cmdclass,
        extras_require=extras_require,
        test_suite="test",
        python_requires=">=3.4.*",
        setup_requires=["pytest-runner"],
        tests_require=["pytest"],
        **kwargs
    )

def
Func
(
**
arg_0
)
:
if
USE_SETUPTOOLS
:
if
"--force-manifest"
in
sys
.
argv
:
sys
.
argv
.
remove
(
"--force-manifest"
)
arg_1
=
[
modname
]
+
get_packages
(
join
(
base_dir
,
"pylint"
)
,
modname
)
if
USE_SETUPTOOLS
:
if
Func_requires
:
arg_0
[
"Func_requires"
]
=
Func_requires
arg_0
[
"dependency_links"
]
=
dependency_links
arg_0
[
"entry_points"
]
=
{
"console_scripts"
:
[
"pylint = pylint:run_pylint"
,
"epylint = pylint:run_epylint"
,
"pyreverse = pylint:run_pyreverse"
,
"symilar = pylint:run_symilar"
,
]
}
arg_0
[
"packages"
]
=
arg_1
arg_2
=
{
"Func_lib"
:
MyInstallLib
,
"build_py"
:
build_py
}
if
easy_Func_lib
:
arg_2
[
"easy_Func"
]
=
easy_Func
return
setup
(
name
=
distname
,
version
=
__pkginfo__
[
"version"
]
,
license
=
__pkginfo__
[
"license"
]
,
description
=
__pkginfo__
[
"description"
]
,
long_description
=
long_description
,
author
=
__pkginfo__
[
"author"
]
,
author_email
=
__pkginfo__
[
"author_email"
]
,
url
=
__pkginfo__
[
"web"
]
,
scripts
=
ensure_scripts
(
scripts
)
,
classifiers
=
__pkginfo__
[
"classifiers"
]
,
data_files
=
data_files
,
ext_modules
=
ext_modules
,
arg_2
=
arg_2
,
extras_require
=
extras_require
,
test_suite
=
"test"
,
python_requires
=
">=3.4.*"
,
setup_requires
=
[
"pytest-runner"
]
,
tests_require
=
[
"pytest"
]
,
**
arg_0
)

def Func(**arg_0):
    """setup entry point"""
    if USE_SETUPTOOLS:
        if "--force-manifest" in sys.argv:
            sys.argv.remove("--force-manifest")
    arg_1 = [modname] + get_packages(join(base_dir, "pylint"), modname)
    if USE_SETUPTOOLS:
        if Func_requires:
            arg_0["Func_requires"] = Func_requires
            arg_0["dependency_links"] = dependency_links
        arg_0["entry_points"] = {
            "console_scripts": [
                "pylint = pylint:run_pylint",
                "epylint = pylint:run_epylint",
                "pyreverse = pylint:run_pyreverse",
                "symilar = pylint:run_symilar",
            ]
        }
    arg_0["packages"] = arg_1
    arg_2 = {"Func_lib": MyInstallLib, "build_py": build_py}
    if easy_Func_lib:
        arg_2["easy_Func"] = easy_Func
    return setup(
        name=distname,
        version=__pkginfo__["version"],
        license=__pkginfo__["license"],
        description=__pkginfo__["description"],
        long_description=long_description,
        author=__pkginfo__["author"],
        author_email=__pkginfo__["author_email"],
        url=__pkginfo__["web"],
        scripts=ensure_scripts(scripts),
        classifiers=__pkginfo__["classifiers"],
        data_files=data_files,
        ext_modules=ext_modules,
        arg_2=arg_2,
        extras_require=extras_require,
        test_suite="test",
        python_requires=">=3.4.*",
        setup_requires=["pytest-runner"],
        tests_require=["pytest"],
        **arg_0
    )


(X_train, X_test, inbag, pred_centered, n_trees,
                      memory_constrained=False, memory_limit=None,
                      test_mode=False)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4,
                      arg_5=False, arg_6=None,
                      arg_7=False):
    """
    Helper function, that performs the core computation

    Parameters
    ----------
    X_train : ndarray
        An array with shape (n_train_sample, n_features).

    X_test : ndarray
        An array with shape (n_test_sample, n_features).

    inbag : ndarray
        The inbag matrix that fit the data. If set to `None` (default) it
        will be inferred from the forest. However, this only works for trees
        for which bootstrapping was set to `True`. That is, if sampling was
        done with replacement. Otherwise, users need to provide their own
        inbag matrix.

    pred_centered : ndarray
        Centered predictions that are an intermediate result in the
        computation.

    memory_constrained: boolean (optional)
        Whether or not there is a restriction on memory. If False, it is
        assumed that a ndarry of shape (n_train_sample,n_test_sample) fits
        in main memory. Setting to True can actually provide a speed up if
        memory_limit is tuned to the optimal range.

    memory_limit: int (optional)
        An upper bound for how much memory the itermediate matrices will take
        up in Megabytes. This must be provided if memory_constrained=True.

    """
    if not arg_5:
        return np.sum((np.dot(arg_2 - 1, arg_3.T) / arg_4) ** 2, 0)

    if not arg_6:
        raise ValueError('If memory_constrained=True, must provide',
                         'memory_limit.')

    # Assumes double precision float
    arg_8 = int((arg_6 * 1e6) / (8.0 * arg_0.shape[0]))

    if arg_8 == 0:
        arg_9 = 8.0 * arg_0.shape[0] / 1e6
        raise ValueError('memory_limit provided is too small.' +
                         'For these dimensions, memory_limit must ' +
                         'be greater than or equal to %.3e' % arg_9)

    arg_10 = np.arange(0, arg_1.shape[0] + arg_8, arg_8)
    arg_11 = range(arg_1.shape[0])
    arg_12 = [arg_11[arg_10[i]:arg_10[i+1]]
              for i in range(len(arg_10)-1)]
    if arg_7:
        print('Number of chunks: %d' % (len(arg_12),))
    arg_13 = np.concatenate([
                np.sum((np.dot(arg_2-1, arg_3[chunk].T)/arg_4)**2, 0)
                for chunk in arg_12])
    return arg_13

Helper function that performs the core computation