(self, job_name, positions, stream_names,
                                       instance_count, state, last_description,
                                       last_describe_job_call)

return state, last_description, last_describe_job_call

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 , arg_6 , arg_7 ) : arg_8 = '/aws/sagemaker/TrainingJobs' if len ( arg_3 ) < arg_4 : arg_9 = arg_0 . get_log_conn ( ) try : arg_10 = arg_9 . describe_log_streams ( logGroupName = arg_8 , logStreamNamePrefix = arg_1 + '/' , orderBy = 'LogStreamName' , limit = arg_4 ) arg_3 = [ arg_11 [ 'logStreamName' ] for arg_11 in arg_10 [ 'logStreams' ] ] arg_2 . update ( [ ( arg_11 , Position ( timestamp = 0 , skip = 0 ) ) for arg_11 in arg_3 if arg_11 not in arg_2 ] ) except arg_9 . exceptions . ResourceNotFoundException : pass if len ( arg_3 ) > 0 : for arg_12 , arg_13 in arg_0 . multi_stream_iter ( arg_8 , arg_3 , arg_2 ) : arg_0 . log . info ( arg_13 [ 'message' ] ) arg_14 , arg_15 = arg_2 [ arg_3 [ arg_12 ] ] if arg_13 [ 'timestamp' ] == arg_14 : arg_2 [ arg_3 [ arg_12 ] ] = Position ( timestamp = arg_14 , skip = arg_15 + 1 ) else : arg_2 [ arg_3 [ arg_12 ] ] = Position ( timestamp = arg_13 [ 'timestamp' ] , skip = 1 ) if arg_5 == LogState . COMPLETE : return arg_5 , arg_6 , arg_7 if arg_5 == LogState . JOB_COMPLETE : arg_5 = LogState . COMPLETE elif time . time ( ) - arg_7 >= 30 : arg_16 = arg_0 . describe_training_job ( arg_1 ) arg_7 = time . time ( ) if secondary_training_status_changed ( arg_16 , arg_6 ) : arg_0 . log . info ( secondary_training_status_message ( arg_16 , arg_6 ) ) arg_6 = arg_16 arg_17 = arg_16 [ 'TrainingJobStatus' ] if arg_17 not in arg_0 . non_terminal_states : arg_5 = LogState . JOB_COMPLETE return arg_5 , arg_6 , arg_7

def Func(arg_0, arg_1, arg_2, arg_3,
                                       arg_4, arg_5, arg_6,
                                       arg_7):
        """
        Return the training job info associated with job_name and print CloudWatch logs
        """
        arg_8 = '/aws/sagemaker/TrainingJobs'

        if len(arg_3) < arg_4:
            # Log streams are created whenever a container starts writing to stdout/err, so this list
            # may be dynamic until we have a stream for every instance.
            arg_9 = arg_0.get_log_conn()
            try:
                arg_10 = arg_9.describe_log_streams(
                    logGroupName=arg_8,
                    logStreamNamePrefix=arg_1 + '/',
                    orderBy='LogStreamName',
                    limit=arg_4
                )
                arg_3 = [arg_11['logStreamName'] for arg_11 in arg_10['logStreams']]
                arg_2.update([(arg_11, Position(timestamp=0, skip=0))
                                  for arg_11 in arg_3 if arg_11 not in arg_2])
            except arg_9.exceptions.ResourceNotFoundException:
                # On the very first training job run on an account, there's no log group until
                # the container starts logging, so ignore any errors thrown about that
                pass

        if len(arg_3) > 0:
            for arg_12, arg_13 in arg_0.multi_stream_iter(arg_8, arg_3, arg_2):
                arg_0.log.info(arg_13['message'])
                arg_14, arg_15 = arg_2[arg_3[arg_12]]
                if arg_13['timestamp'] == arg_14:
                    arg_2[arg_3[arg_12]] = Position(timestamp=arg_14, skip=arg_15 + 1)
                else:
                    arg_2[arg_3[arg_12]] = Position(timestamp=arg_13['timestamp'], skip=1)

        if arg_5 == LogState.COMPLETE:
            return arg_5, arg_6, arg_7

        if arg_5 == LogState.JOB_COMPLETE:
            arg_5 = LogState.COMPLETE
        elif time.time() - arg_7 >= 30:
            arg_16 = arg_0.describe_training_job(arg_1)
            arg_7 = time.time()

            if secondary_training_status_changed(arg_16, arg_6):
                arg_0.log.info(secondary_training_status_message(arg_16, arg_6))
                arg_6 = arg_16

            arg_17 = arg_16['TrainingJobStatus']

            if arg_17 not in arg_0.non_terminal_states:
                arg_5 = LogState.JOB_COMPLETE
        return arg_5, arg_6, arg_7


def Func ( arg_0 , arg_1 , arg_2 = arg_3 . KMIPVersion . KMIP_1_0 ) : arg_6 = utils . BytearrayStream ( ) if arg_0 . _located_items : arg_0 . _located_items . Func ( arg_6 , arg_2 = arg_2 ) if arg_0 . _unique_identifiers : for arg_7 in arg_0 . _unique_identifiers : arg_7 . Func ( arg_6 , arg_2 = arg_2 ) arg_0 . length = arg_6 . length ( ) super ( LocateResponsePayload , arg_0 ) . Func ( arg_1 , arg_2 = arg_2 ) arg_1 . Func ( arg_6 . buffer )

def Func(arg_0, arg_1, arg_2=arg_3.KMIPVersion.KMIP_1_0):
        """
        Write the data encoding the Locate response payload to a buffer.

        Args:
            output_buffer (stream): A data buffer in which to encode object
                data, supporting a Func method.
            kmip_version (KMIPVersion): An enumeration defining the KMIP
                version with which the object will be encoded. Optional,
                defaults to KMIP 1.0.
        """
        arg_6 = utils.BytearrayStream()

        if arg_0._located_items:
            arg_0._located_items.Func(arg_6, arg_2=arg_2)

        if arg_0._unique_identifiers:
            for arg_7 in arg_0._unique_identifiers:
                arg_7.Func(
                    arg_6,
                    arg_2=arg_2
                )

        arg_0.length = arg_6.length()
        super(LocateResponsePayload, arg_0).Func(
            arg_1,
            arg_2=arg_2
        )
        arg_1.Func(arg_6.buffer)

Write the data encoding the Locate response payload to a buffer.

        Args:
            output_buffer (stream): A data buffer in which to encode object
                data, supporting a write method.
            kmip_version (KMIPVersion): An enumeration defining the KMIP
                version with which the object will be encoded. Optional,
                defaults to KMIP 1.0.

Write the data encoding the Locate response payload to a buffer .


def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_2 = arg_2 or arg_0 . current_page_context if isinstance ( arg_1 , FilterExpression ) : arg_1 = arg_1 . resolve ( arg_2 ) else : arg_1 = arg_1 . strip ( ) try : arg_1 = Variable ( arg_1 ) . resolve ( arg_2 ) except VariableDoesNotExist : arg_1 = arg_1 return arg_1

def Func(arg_0, arg_1, arg_2=None):
        """Resolves name as a variable in a given context.

        If no context specified page context' is considered as context.

        :param str|unicode varname:
        :param Context context:
        :return:
        """
        arg_2 = arg_2 or arg_0.current_page_context

        if isinstance(arg_1, FilterExpression):
            arg_1 = arg_1.resolve(arg_2)
        else:
            arg_1 = arg_1.strip()

            try:
                arg_1 = Variable(arg_1).resolve(arg_2)
            except VariableDoesNotExist:
                arg_1 = arg_1

        return arg_1

Resolves name as a variable in a given context .


(session, project_id, bidder_id, description, amount,
                      period, milestone_percentage)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4,
                      arg_5, arg_6):
    """
    Place a bid on a project
    """
    arg_7 = {
        'project_id': arg_1,
        'bidder_id': arg_2,
        'description': arg_3,
        'amount': arg_4,
        'period': arg_5,
        'milestone_percentage': arg_6,
    }
    # POST /api/projects/0.1/bids/
    arg_8 = make_post_request(arg_0, 'bids', arg_9=arg_7)
    arg_9 = arg_8.json()
    if arg_8.status_code == 200:
        arg_7 = arg_9['result']
        return Bid(arg_7)
    else:
        raise BidNotPlacedException(message=arg_9['message'],
                                    error_code=arg_9['error_code'],
                                    request_id=arg_9['request_id'])


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : if arg_2 [ 0 ] not in arg_1 : arg_1 [ arg_2 [ 0 ] ] = Counter ( ) if len ( arg_2 ) == 1 : arg_1 [ arg_2 [ 0 ] ] [ None ] += arg_3 else : arg_0 . Func ( arg_1 [ arg_2 [ 0 ] ] , arg_2 [ 1 : ] , arg_3 )

def Func(arg_0, arg_1, arg_2, arg_3):
        """Build up a corpus entry recursively.

        Parameters
        ----------
        corpus : Corpus
            The corpus
        words : [str]
            Words to add to the corpus
        count : int
            Count of words

        """
        if arg_2[0] not in arg_1:
            arg_1[arg_2[0]] = Counter()

        if len(arg_2) == 1:
            arg_1[arg_2[0]][None] += arg_3
        else:
            arg_0.Func(arg_1[arg_2[0]], arg_2[1:], arg_3)


def
Func
(
arg_0
,
arg_1
)
:
for
arg_2
in
arg_1
.
threeQ_or_more_gates
(
)
:
arg_3
=
arg_2
.
op
.
definition
if
not
arg_3
:
raise
QiskitError
(
"Cannot unroll all 3q or more gates. "
"No rule to expand instruction %s."
%
arg_2
.
op
.
name
)
arg_4
=
DAGCircuit
(
)
arg_4
.
add_qreg
(
arg_3
[
0
]
[
1
]
[
0
]
[
0
]
)
for
arg_5
in
arg_3
:
arg_4
.
apply_operation_back
(
*
arg_5
)
arg_4
=
arg_0
.
Func
(
arg_4
)
arg_1
.
substitute_node_with_dag
(
arg_2
,
arg_4
)
return
arg_1

def Func(arg_0, arg_1):
        """Expand 3+ qubit gates using their decomposition rules.

        Args:
            dag(DAGCircuit): input dag
        Returns:
            DAGCircuit: output dag with maximum node degrees of 2
        Raises:
            QiskitError: if a 3q+ gate is not decomposable
        """
        for arg_2 in arg_1.threeQ_or_more_gates():
            # TODO: allow choosing other possible decompositions
            arg_3 = arg_2.op.definition
            if not arg_3:
                raise QiskitError("Cannot unroll all 3q or more gates. "
                                  "No rule to expand instruction %s." %
                                  arg_2.op.name)

            # hacky way to build a dag on the same register as the rule is defined
            # TODO: need anonymous rules to address wires by index
            arg_4 = DAGCircuit()
            arg_4.add_qreg(arg_3[0][1][0][0])
            for arg_5 in arg_3:
                arg_4.apply_operation_back(*arg_5)
            arg_4 = arg_0.Func(arg_4)  # recursively unroll
            arg_1.substitute_node_with_dag(arg_2, arg_4)
        return arg_1

Expand 3 + qubit gates using their decomposition rules .


def Func ( ) : arg_0 = os . path . dirname ( os . path . abspath ( site . __file__ ) ) arg_1 = os . path . join ( arg_0 , 'no-global-site-packages.txt' ) if running_under_virtualenv ( ) and os . path . isfile ( arg_1 ) : return True

def Func():
    """
    Return True if in a venv and no system site packages.
    """
    #this mirrors the logic in virtualenv.py for locating the no-global-site-packages.txt file
    arg_0 = os.path.dirname(os.path.abspath(site.__file__))
    arg_1 = os.path.join(arg_0, 'no-global-site-packages.txt')
    if running_under_virtualenv() and os.path.isfile(arg_1):
        return True

Return True if in a venv and no system site packages .


def Func ( arg_0 ) : if not arg_0 . response : return set ( ) elif arg_0 . _Func is None and arg_0 . response : arg_0 . _Func = set ( ) for arg_2 in arg_0 . response . payload : for arg_3 in arg_2 [ 'Func' ] : arg_0 . _Func . add ( arg_3 [ 'name' ] ) return arg_0 . _Func

def Func(arg_0):
        """Returns a set of all Func from the last response

        Returns:
          set: Response success: all the Func available in the response
               Response failure: an empty set
        """
        if not arg_0.response:
            return set()
        elif arg_0._Func is None and arg_0.response:
            arg_0._Func = set()
            for arg_2 in arg_0.response.payload:
                for arg_3 in arg_2['Func']:
                    arg_0._Func.add(arg_3['name'])

        return arg_0._Func

Returns a set of all pipelines from the last response

        Returns:
          set: Response success: all the pipelines available in the response
               Response failure: an empty set


(
        self, name: str,
        value: str,
        positional: bool = None,
        before: str = None,
        after: str = None,
        preserve_spacing: bool = True
    )

def Func ( arg_0 , arg_1 : arg_2 , arg_3 : arg_2 , arg_4 : arg_5 = None , arg_6 : arg_2 = None , arg_7 : arg_2 = None , arg_8 : arg_5 = True ) -> None : arg_9 = list ( reversed ( arg_0 . arguments ) ) arg_10 = get_arg ( arg_1 , arg_9 ) if arg_10 : if arg_4 : arg_10 . positional = arg_4 if arg_8 : arg_11 = arg_10 . value arg_10 . value = arg_11 . replace ( arg_11 . strip ( WS ) , arg_3 ) else : arg_10 . value = arg_3 return if not arg_1 and arg_4 is None : arg_4 = True if not arg_4 and arg_8 and arg_9 : arg_12 = [ ] arg_13 = [ ] arg_14 = [ ] arg_15 = [ ] for arg_10 in arg_9 : arg_16 = arg_10 . name arg_17 = arg_25 ( arg_16 ) arg_13 . append ( arg_17 ) arg_12 . append ( STARTING_WS_MATCH ( arg_16 ) [ 0 ] ) arg_18 = arg_10 . value arg_14 . append ( STARTING_WS_MATCH ( arg_18 ) [ 0 ] ) arg_15 . append ( ENDING_WS_MATCH ( arg_18 ) [ 0 ] ) arg_19 = mode ( arg_12 ) arg_20 = mode ( arg_13 ) arg_21 = mode ( [ SPACE_AFTER_SEARCH ( arg_0 . string ) [ 0 ] ] + arg_15 [ 1 : ] ) arg_22 = mode ( arg_14 ) else : arg_8 = False if arg_4 : arg_23 = '|' + arg_3 else : if arg_8 : arg_23 = ( '|' + ( arg_19 + arg_1 . strip ( WS ) ) . ljust ( arg_20 ) + '=' + arg_22 + arg_3 + arg_21 ) else : arg_23 = '|' + arg_1 + '=' + arg_3 if arg_6 : arg_10 = get_arg ( arg_6 , arg_9 ) arg_10 . insert ( 0 , arg_23 ) elif arg_7 : arg_10 = get_arg ( arg_7 , arg_9 ) arg_10 . insert ( arg_25 ( arg_10 . string ) , arg_23 ) else : if arg_9 and not arg_4 : arg_10 = arg_9 [ 0 ] arg_24 = arg_10 . string if arg_8 : arg_10 [ 0 : arg_25 ( arg_24 ) ] = ( arg_10 . string . rstrip ( WS ) + arg_21 + arg_23 . rstrip ( WS ) + arg_15 [ 0 ] ) else : arg_10 . insert ( arg_25 ( arg_24 ) , arg_23 ) else : arg_0 . insert ( - 2 , arg_23 )

def Func(
        arg_0, arg_1: arg_2,
        arg_3: arg_2,
        arg_4: arg_5 = None,
        arg_6: arg_2 = None,
        arg_7: arg_2 = None,
        arg_8: arg_5 = True
    ) -> None:
        """Set the value for `name` argument. Add it if it doesn't exist.

        - Use `positional`, `before` and `after` keyword arguments only when
          adding a new argument.
        - If `before` is given, ignore `after`.
        - If neither `before` nor `after` are given and it's needed to add a
          new argument, then append the new argument to the end.
        - If `positional` is True, try to add the given value as a positional
          argument. Ignore `preserve_spacing` if positional is True.
          If it's None, do what seems more appropriate.
        """
        arg_9 = list(reversed(arg_0.arguments))
        arg_10 = get_arg(arg_1, arg_9)
        # Updating an existing argument.
        if arg_10:
            if arg_4:
                arg_10.positional = arg_4
            if arg_8:
                arg_11 = arg_10.value
                arg_10.value = arg_11.replace(arg_11.strip(WS), arg_3)
            else:
                arg_10.value = arg_3
            return
        # Adding a new argument
        if not arg_1 and arg_4 is None:
            arg_4 = True
        # Calculate the whitespace needed before arg-name and after arg-value.
        if not arg_4 and arg_8 and arg_9:
            arg_12 = []
            arg_13 = []
            arg_14 = []
            arg_15 = []
            for arg_10 in arg_9:
                arg_16 = arg_10.name
                arg_17 = arg_25(arg_16)
                arg_13.append(arg_17)
                arg_12.append(STARTING_WS_MATCH(arg_16)[0])
                arg_18 = arg_10.value
                arg_14.append(STARTING_WS_MATCH(arg_18)[0])
                arg_15.append(ENDING_WS_MATCH(arg_18)[0])
            arg_19 = mode(arg_12)
            arg_20 = mode(arg_13)
            arg_21 = mode(
                [SPACE_AFTER_SEARCH(arg_0.string)[0]] + arg_15[1:]
            )
            arg_22 = mode(arg_14)
        else:
            arg_8 = False
        # Calculate the string that needs to be added to the Template.
        if arg_4:
            # Ignore preserve_spacing for positional args.
            arg_23 = '|' + arg_3
        else:
            if arg_8:
                # noinspection PyUnboundLocalVariable
                arg_23 = (
                    '|' + (arg_19 + arg_1.strip(WS)).
                    ljust(arg_20) +
                    '=' + arg_22 + arg_3 + arg_21
                )
            else:
                arg_23 = '|' + arg_1 + '=' + arg_3
        # Place the addstring in the right position.
        if arg_6:
            arg_10 = get_arg(arg_6, arg_9)
            arg_10.insert(0, arg_23)
        elif arg_7:
            arg_10 = get_arg(arg_7, arg_9)
            arg_10.insert(arg_25(arg_10.string), arg_23)
        else:
            if arg_9 and not arg_4:
                arg_10 = arg_9[0]
                arg_24 = arg_10.string
                if arg_8:
                    # Insert after the last argument.
                    # The addstring needs to be recalculated because we don't
                    # want to change the the whitespace before final braces.
                    # noinspection PyUnboundLocalVariable
                    arg_10[0:arg_25(arg_24)] = (
                        arg_10.string.rstrip(WS) + arg_21 +
                        arg_23.rstrip(WS) + arg_15[0]
                    )
                else:
                    arg_10.insert(arg_25(arg_24), arg_23)
            else:
                # The template has no arguments or the new arg is
                # positional AND is to be added at the end of the template.
                arg_0.insert(-2, arg_23)

Set the value for name argument . Add it if it doesn t exist .


def
Func
(
arg_0
)
:
arg_1
=
""
if
len
(
arg_0
.
_points
)
>
0
:
arg_1
+=
"M "
+
str
(
arg_0
.
_points
[
0
]
.
x
)
+
" "
+
str
(
arg_0
.
_points
[
0
]
.
y
)
+
" "
for
arg_2
in
arg_0
.
_points
:
if
arg_2
.
cmd
==
MOVETO
:
arg_1
+=
"M "
+
str
(
arg_2
.
x
)
+
" "
+
str
(
arg_2
.
y
)
+
" "
elif
arg_2
.
cmd
==
LINETO
:
arg_1
+=
"L "
+
str
(
arg_2
.
x
)
+
" "
+
str
(
arg_2
.
y
)
+
" "
elif
arg_2
.
cmd
==
CURVETO
:
arg_1
+=
"C "
arg_1
+=
str
(
arg_2
.
ctrl1
.
x
)
+
" "
+
str
(
arg_2
.
ctrl1
.
y
)
+
" "
arg_1
+=
str
(
arg_2
.
ctrl2
.
x
)
+
" "
+
str
(
arg_2
.
ctrl2
.
y
)
+
" "
arg_1
+=
str
(
arg_2
.
x
)
+
" "
+
str
(
arg_2
.
y
)
+
" "
arg_3
=
"rgb("
arg_3
+=
str
(
int
(
arg_0
.
path_color
.
r
*
255
)
)
+
","
arg_3
+=
str
(
int
(
arg_0
.
path_color
.
g
*
255
)
)
+
","
arg_3
+=
str
(
int
(
arg_0
.
path_color
.
b
*
255
)
)
+
")"
arg_4
=
'<?xml version="1.0"?>\n'
arg_4
+=
'<svg width="'
+
str
(
_ctx
.
WIDTH
)
+
'pt" height="'
+
str
(
_ctx
.
HEIGHT
)
+
'pt">\n'
arg_4
+=
'<g>\n'
arg_4
+=
'<path d="'
+
arg_1
+
'" fill="none" stroke="'
+
arg_3
+
'" stroke-width="'
+
str
(
arg_0
.
strokewidth
)
+
'" />\n'
arg_4
+=
'</g>\n'
arg_4
+=
'</svg>\n'
arg_5
=
open
(
arg_0
.
file
+
".svg"
,
"w"
)
arg_5
.
write
(
arg_4
)
arg_5
.
close
(
)

def Func(arg_0):

        """ Exports the path as SVG.

        Uses the filename given when creating this object.
        The file is automatically updated to reflect
        changes to the path.

        """

        arg_1 = ""
        if len(arg_0._points) > 0:
            arg_1 += "M "+str(arg_0._points[0].x)+" "+str(arg_0._points[0].y)+" "
            for arg_2 in arg_0._points:
                if arg_2.cmd == MOVETO:
                    arg_1 += "M "+str(arg_2.x)+" "+str(arg_2.y)+" "
                elif arg_2.cmd == LINETO:
                    arg_1 += "L "+str(arg_2.x)+" "+str(arg_2.y)+" "
                elif arg_2.cmd == CURVETO:
                    arg_1 += "C "
                    arg_1 += str(arg_2.ctrl1.x)+" "+str(arg_2.ctrl1.y)+" "
                    arg_1 += str(arg_2.ctrl2.x)+" "+str(arg_2.ctrl2.y)+" "
                    arg_1 += str(arg_2.x)+" "+str(arg_2.y)+" "

        arg_3 = "rgb("
        arg_3 += str(int(arg_0.path_color.r*255)) + ","
        arg_3 += str(int(arg_0.path_color.g*255)) + ","
        arg_3 += str(int(arg_0.path_color.b*255)) + ")"

        arg_4  = '<?xml version="1.0"?>\n'
        arg_4 += '<svg width="'+str(_ctx.WIDTH)+'pt" height="'+str(_ctx.HEIGHT)+'pt">\n'
        arg_4 += '<g>\n'
        arg_4 += '<path d="'+arg_1+'" fill="none" stroke="'+arg_3+'" stroke-width="'+str(arg_0.strokewidth)+'" />\n'
        arg_4 += '</g>\n'
        arg_4 += '</svg>\n'

        arg_5 = open(arg_0.file+".svg", "w")
        arg_5.write(arg_4)
        arg_5.close()

Exports the path as SVG . Uses the filename given when creating this object . The file is automatically updated to reflect changes to the path .


def Func ( arg_0 ) : arg_1 = np . random . randint ( arg_0 . n_warmup , size = min ( 2 , np . ceil ( np . sqrt ( arg_0 . n_warmup ) ) ) ) return arg_0 . warmup [ arg_1 , : ] . mean ( axis = 0 )

def Func(arg_0):
        """Find an approximately random point in the flux cone."""

        arg_1 = np.random.randint(arg_0.n_warmup,
                                size=min(2, np.ceil(np.sqrt(arg_0.n_warmup))))
        return arg_0.warmup[arg_1, :].mean(axis=0)

Find an approximately random point in the flux cone .


def Func(arg_0, arg_1, arg_2):
        """
        Invoked if a packet with an unregistered type was received.

        Default behaviour is to log and close the connection.
        """
        log.msg("Missing handler for typekey %s in %s. Closing connection." % (arg_1, type(arg_0).__name__))
        arg_0.transport.loseConnection()

Invoked if a packet with an unregistered type was received . Default behaviour is to log and close the connection .


def Func ( arg_0 , arg_1 = True ) : arg_2 = arg_0 . _connection . get ( "rooms" ) if arg_1 : arg_2 . sort ( key = operator . itemgetter ( "name" ) ) return arg_2

def Func(arg_0, arg_1=True):
        """ Get rooms list.

        Kwargs:
            sort (bool): If True, sort rooms by name

        Returns:
            array. List of rooms (each room is a dict)
        """
        arg_2 = arg_0._connection.get("rooms")
        if arg_1:
            arg_2.sort(key=operator.itemgetter("name"))
        return arg_2


def Func ( arg_0 , arg_1 = None , arg_2 = None ) : arg_3 = arg_1 [ 'owner' ] if arg_1 else arg_2 [ '_id' ] arg_4 = arg_0 . get_causatives ( arg_3 ) if len ( arg_4 ) == 0 : return [ ] if arg_1 : arg_5 = set ( arg_1 . get ( 'causatives' , [ ] ) ) arg_4 = list ( set ( arg_4 ) . difference ( arg_5 ) ) arg_6 = arg_0 . variant_collection . find ( { '_id' : { '$in' : arg_4 } } , { 'variant_id' : 1 } ) arg_7 = [ item [ 'variant_id' ] for item in arg_6 ] arg_8 = { 'variant_id' : { '$in' : arg_7 } } if arg_1 : arg_8 [ 'case_id' ] = arg_1 [ '_id' ] else : arg_8 [ 'institute' ] = arg_2 [ '_id' ] return arg_0 . variant_collection . find ( arg_8 )

def Func(arg_0, arg_1=None, arg_2=None):
        """Check if there are any variants that are previously marked causative

            Loop through all variants that are marked 'causative' for an
            institute and check if any of the variants are present in the
            current case.

            Args:
                case_obj (dict): A Case object
                institute_obj (dict): check across the whole institute

            Returns:
                causatives(iterable(Variant))
        """
        arg_3 = arg_1['owner'] if arg_1 else arg_2['_id']
        arg_4 = arg_0.get_causatives(arg_3)
        if len(arg_4) == 0:
            return []

        if arg_1:
            # exclude variants that are marked causative in "case_obj"
            arg_5 = set(arg_1.get('causatives', []))
            arg_4 = list(
                set(arg_4).difference(arg_5)
            )

        # convert from unique ids to general "variant_id"
        arg_6 = arg_0.variant_collection.find(
            {'_id': {'$in': arg_4}},
            {'variant_id': 1}
        )
        arg_7 = [item['variant_id'] for item in arg_6]

        arg_8 = {'variant_id': {'$in': arg_7}}
        if arg_1:
            arg_8['case_id'] = arg_1['_id']
        else:
            arg_8['institute'] = arg_2['_id']
        return arg_0.variant_collection.find(arg_8)


def
Func
(
arg_0
)
:
arg_0
.
start
(
test_connection
=
False
)
arg_0
.
_logger
.
debug
(
'Sending shutdown signal'
)
arg_0
.
_req_rep
(
ZMQServer
.
DONE
)

def Func(arg_0):
        """Notifies the Server to shutdown"""
        arg_0.start(test_connection=False)
        arg_0._logger.debug('Sending shutdown signal')
        arg_0._req_rep(ZMQServer.DONE)


(inputs, state, att_size, mask, scope="attention")

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 = "Func" ) : with tf . variable_scope ( arg_4 ) : arg_5 = tf . concat ( [ tf . tile ( tf . expand_dims ( arg_1 , axis = 1 ) , [ 1 , tf . shape ( arg_0 ) [ 1 ] , 1 ] ) , arg_0 ] , axis = 2 ) arg_6 = tf . layers . dense ( tf . layers . dense ( arg_5 , arg_2 , activation = tf . nn . tanh ) , 1 , use_bias = False ) arg_6 = softmax_mask ( tf . squeeze ( arg_6 , [ 2 ] ) , arg_3 ) arg_7 = tf . expand_dims ( tf . nn . softmax ( arg_6 ) , axis = 2 ) arg_8 = tf . reduce_sum ( arg_7 * arg_0 , axis = 1 ) return arg_8 , arg_6

def Func(arg_0, arg_1, arg_2, arg_3, arg_4="Func"):
    """Computes weighted sum of inputs conditioned on state"""
    with tf.variable_scope(arg_4):
        arg_5 = tf.concat([tf.tile(tf.expand_dims(arg_1, axis=1), [1, tf.shape(arg_0)[1], 1]), arg_0], axis=2)
        arg_6 = tf.layers.dense(tf.layers.dense(arg_5, arg_2, activation=tf.nn.tanh), 1, use_bias=False)
        arg_6 = softmax_mask(tf.squeeze(arg_6, [2]), arg_3)
        arg_7 = tf.expand_dims(tf.nn.softmax(arg_6), axis=2)
        arg_8 = tf.reduce_sum(arg_7 * arg_0, axis=1)
        return arg_8, arg_6


def Func(arg_0, arg_1=-10.0, arg_2=65.0):
        '''Loudness control. Similar to the gain effect, but provides
        equalisation for the human auditory system.

        The gain is adjusted by gain_db and the signal is equalised according
        to ISO 226 w.r.t. reference_level.

        Parameters
        ----------
        gain_db : float, default=-10.0
            Loudness adjustment amount (in dB)
        reference_level : float, default=65.0
            Reference level (in dB) according to which the signal is equalized.
            Must be between 50 and 75 (dB)

        See Also
        --------
        gain

        '''
        if not is_number(arg_1):
            raise ValueError('gain_db must be a number.')

        if not is_number(arg_2):
            raise ValueError('reference_level must be a number')

        if arg_2 > 75 or arg_2 < 50:
            raise ValueError('reference_level must be between 50 and 75')

        arg_3 = [
            'Func',
            '{:f}'.format(arg_1),
            '{:f}'.format(arg_2)
        ]
        arg_0.effects.extend(arg_3)
        arg_0.effects_log.append('Func')

        return arg_0

Loudness control . Similar to the gain effect but provides equalisation for the human auditory system .


def
Func
(
arg_0
,
arg_1
)
:
if
arg_1
==
EOL_STYLE_NONE
:
return
arg_0
if
arg_1
==
EOL_STYLE_UNIX
:
return
arg_0
.
replace
(
'\r\n'
,
arg_1
)
.
replace
(
'\r'
,
arg_1
)
if
arg_1
==
EOL_STYLE_MAC
:
return
arg_0
.
replace
(
'\r\n'
,
arg_1
)
.
replace
(
'\n'
,
arg_1
)
if
arg_1
==
EOL_STYLE_WINDOWS
:
return
arg_0
.
replace
(
'\r\n'
,
'\n'
)
.
replace
(
'\r'
,
'\n'
)
.
replace
(
'\n'
,
EOL_STYLE_WINDOWS
)
raise
ValueError
(
'Unexpected eol style: %r'
%
(
arg_1
,
)
)

def Func(arg_0, arg_1):
    '''
    Replaces eol on each line by the given eol_style.

    :param unicode contents:
    :type eol_style: EOL_STYLE_XXX constant
    :param eol_style:
    '''
    if arg_1 == EOL_STYLE_NONE:
        return arg_0

    if arg_1 == EOL_STYLE_UNIX:
        return arg_0.replace('\r\n', arg_1).replace('\r', arg_1)

    if arg_1 == EOL_STYLE_MAC:
        return arg_0.replace('\r\n', arg_1).replace('\n', arg_1)

    if arg_1 == EOL_STYLE_WINDOWS:
        return arg_0.replace('\r\n', '\n').replace('\r', '\n').replace('\n', EOL_STYLE_WINDOWS)

    raise ValueError('Unexpected eol style: %r' % (arg_1,))

Replaces eol on each line by the given eol_style .


def Func ( arg_0 , * arg_1 ) : arg_2 = "" for arg_3 in arg_1 : if isinstance ( arg_3 , Node ) : arg_2 += arg_0 . value ( arg_3 ) else : arg_2 += str ( arg_3 ) print ( arg_2 ) return True

def Func(arg_0, *arg_1):
    """
    Print nodes.

    example::

        R = [
            In : node #echo("coucou", 12, node)
        ]

    """
    arg_2 = ""
    for arg_3 in arg_1:
        if isinstance(arg_3, Node):
            arg_2 += arg_0.value(arg_3)
        else:
            arg_2 += str(arg_3)
    print(arg_2)
    return True


(rec, tag, new_field, field_position_global=None,
                         field_position_local=None)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
,
arg_4
=
)
:
if
arg_3
is
and
arg_4
is
:
raise
InvenioBibRecordFieldError
(
"A field position is required to "
"complete this operation."
)
elif
arg_3
is
not
and
arg_4
is
not
:
raise
InvenioBibRecordFieldError
(
"Only one field position is required "
"to complete this operation."
)
elif
arg_3
:
if
arg_1
not
in
arg_0
:
raise
InvenioBibRecordFieldError
(
"No tag '%s' in record."
%
arg_1
)
arg_5
=
False
for
arg_6
,
arg_7
in
enumerate
(
arg_0
[
arg_1
]
)
:
if
arg_7
[
4
]
==
arg_3
:
arg_0
[
arg_1
]
[
arg_6
]
=
arg_2
arg_5
=
True
if
not
arg_5
:
raise
InvenioBibRecordFieldError
(
"No field has the tag '%s' and "
"the global field position '%d'."
%
(
arg_1
,
arg_3
)
)
else
:
try
:
arg_0
[
arg_1
]
[
arg_4
]
=
arg_2
except
KeyError
:
raise
InvenioBibRecordFieldError
(
"No tag '%s' in record."
%
arg_1
)
except
IndexError
:
raise
InvenioBibRecordFieldError
(
"No field has the tag '%s' and "
"the local field position '%d'."
%
(
arg_1
,
arg_4
)
)

def Func(arg_0, arg_1, arg_2, arg_3=None,
                         arg_4=None):
    """Replace a field with a new field."""
    if arg_3 is None and arg_4 is None:
        raise InvenioBibRecordFieldError(
            "A field position is required to "
            "complete this operation.")
    elif arg_3 is not None and \
            arg_4 is not None:
        raise InvenioBibRecordFieldError(
            "Only one field position is required "
            "to complete this operation.")
    elif arg_3:
        if arg_1 not in arg_0:
            raise InvenioBibRecordFieldError("No tag '%s' in record." % arg_1)

        arg_5 = False
        for arg_6, arg_7 in enumerate(arg_0[arg_1]):
            if arg_7[4] == arg_3:
                arg_0[arg_1][arg_6] = arg_2
                arg_5 = True

        if not arg_5:
            raise InvenioBibRecordFieldError(
                "No field has the tag '%s' and "
                "the global field position '%d'." %
                (arg_1, arg_3))
    else:
        try:
            arg_0[arg_1][arg_4] = arg_2
        except KeyError:
            raise InvenioBibRecordFieldError("No tag '%s' in record." % arg_1)
        except IndexError:
            raise InvenioBibRecordFieldError(
                "No field has the tag '%s' and "
                "the local field position '%d'." % (arg_1, arg_4))


(self, procs=1, timeout=None, should_profile=False)

def
Func
(
arg_0
,
arg_1
=
1
,
arg_2
=
,
arg_3
=
False
)
:
assert
not
arg_0
.
Funcning
,
"Manticore is already Funcning."
arg_0
.
_start_Func
(
)
arg_0
.
_last_Func_stats
[
'time_started'
]
=
time
.
time
(
)
with
arg_0
.
shutdown_timeout
(
arg_2
)
:
arg_0
.
_start_workers
(
arg_1
,
profiling
=
arg_3
)
arg_0
.
_join_workers
(
)
arg_0
.
_finish_Func
(
profiling
=
arg_3
)

def Func(arg_0, arg_1=1, arg_2=None, arg_3=False):
        """
        Runs analysis.

        :param int procs: Number of parallel worker processes
        :param timeout: Analysis timeout, in seconds
        """
        assert not arg_0.Funcning, "Manticore is already Funcning."
        arg_0._start_Func()

        arg_0._last_Func_stats['time_started'] = time.time()
        with arg_0.shutdown_timeout(arg_2):
            arg_0._start_workers(arg_1, profiling=arg_3)

            arg_0._join_workers()
        arg_0._finish_Func(profiling=arg_3)


def Func(arg_0, arg_1=arg_2.stdout):
        """Report gathered analysis data in human readable form."""
        if arg_0.verbose > 1:
            with pprint_nosort():
                pprint.pprint(arg_0.results)

        if arg_0.verbose > 0:
            print('Runtime (per repetition): {:.2g} s'.format(
                arg_0.results['Runtime (per repetition) [s]']),
                file=arg_1)
        if arg_0.verbose > 0:
            print('Iterations per repetition: {!s}'.format(
                arg_0.results['Iterations per repetition']),
                file=arg_1)
        print('Runtime (per cacheline update): {:.2f} cy/CL'.format(
            arg_0.results['Runtime (per cacheline update) [cy/CL]']),
            file=arg_1)
        print('MEM volume (per repetition): {:.0f} Byte'.format(
            arg_0.results['MEM volume (per repetition) [B]']),
            file=arg_1)
        print('Performance: {:.2f} MFLOP/s'.format(arg_0.results['Performance [MFLOP/s]']),
              file=arg_1)
        print('Performance: {:.2f} MLUP/s'.format(arg_0.results['Performance [MLUP/s]']),
              file=arg_1)
        print('Performance: {:.2f} It/s'.format(arg_0.results['Performance [MIt/s]']),
              file=arg_1)
        if arg_0.verbose > 0:
            print('MEM bandwidth: {:.2f} MByte/s'.format(arg_0.results['MEM BW [MByte/s]']),
                  file=arg_1)
        print('', file=arg_1)

        if not arg_0.no_phenoecm:
            print("Data Transfers:")
            print("{:^8} |".format("cache"), end='')
            for arg_4 in arg_0.results['data transfers'].values():
                for arg_5 in sorted(arg_4):
                    print(" {:^14}".format(arg_5), end='')
                print()
                break
            for arg_6, arg_4 in sorted(arg_0.results['data transfers'].items()):
                print("{!s:^8} |".format(arg_6), end='')
                for arg_7, arg_8 in sorted(arg_4.items()):
                    print(" {!s:^14}".format(arg_8), end='')
                print()
            print()

            print('Phenomenological ECM model: {{ {T_OL:.1f} || {T_nOL:.1f} | {T_L1L2:.1f} | '
                  '{T_L2L3:.1f} | {T_L3MEM:.1f} }} cy/CL'.format(
                **{arg_7: float(arg_8) for arg_7, arg_8 in arg_0.results['ECM'].items()}),
                file=arg_1)
            print('T_OL assumes that two loads per cycle may be retiered, which is true for '
                  '128bit SSE/half-AVX loads on SNB and IVY, and 256bit full-AVX loads on HSW, '
                  'BDW, SKL and SKX, but it also depends on AGU availability.',
                  file=arg_1)

Report gathered analysis data in human readable form .


def Func ( arg_0 , arg_1 ) : arg_2 = set ( ) arg_3 = set ( ) arg_4 = arg_0 . visit_events arg_5 = arg_0 . leave_events for arg_6 in dir ( arg_1 ) : arg_7 = arg_6 [ 6 : ] if arg_7 == "default" : continue if arg_6 . startswith ( "visit_" ) : arg_8 = getattr ( arg_1 , arg_6 ) if arg_0 . _is_method_enabled ( arg_8 ) : arg_4 [ arg_7 ] . append ( arg_8 ) arg_2 . add ( arg_7 ) elif arg_6 . startswith ( "leave_" ) : arg_9 = getattr ( arg_1 , arg_6 ) if arg_0 . _is_method_enabled ( arg_9 ) : arg_5 [ arg_7 ] . append ( arg_9 ) arg_3 . add ( arg_7 ) arg_10 = getattr ( arg_1 , "visit_default" , None ) if arg_10 : for arg_11 in nodes . ALL_NODE_CLASSES : arg_7 = arg_11 . __name__ . lower ( ) if arg_7 not in arg_2 : arg_4 [ arg_7 ] . append ( arg_10 )

def Func(arg_0, arg_1):
        """walk to the checker's dir and collect visit and leave methods"""
        # XXX : should be possible to merge needed_checkers and Func
        arg_2 = set()
        arg_3 = set()
        arg_4 = arg_0.visit_events
        arg_5 = arg_0.leave_events
        for arg_6 in dir(arg_1):
            arg_7 = arg_6[6:]
            if arg_7 == "default":
                continue
            if arg_6.startswith("visit_"):
                arg_8 = getattr(arg_1, arg_6)
                # don't use visit_methods with no activated message:
                if arg_0._is_method_enabled(arg_8):
                    arg_4[arg_7].append(arg_8)
                    arg_2.add(arg_7)
            elif arg_6.startswith("leave_"):
                arg_9 = getattr(arg_1, arg_6)
                # don't use leave_methods with no activated message:
                if arg_0._is_method_enabled(arg_9):
                    arg_5[arg_7].append(arg_9)
                    arg_3.add(arg_7)
        arg_10 = getattr(arg_1, "visit_default", None)
        if arg_10:
            for arg_11 in nodes.ALL_NODE_CLASSES:
                arg_7 = arg_11.__name__.lower()
                if arg_7 not in arg_2:
                    arg_4[arg_7].append(arg_10)

walk to the checker s dir and collect visit and leave methods


(self, idx, sparseBinaryForm=False, cat=None)

def Func ( arg_0 , arg_1 , arg_2 = False , arg_3 = None ) : if arg_3 is not None : assert arg_1 is None arg_1 = arg_0 . _categoryList . index ( arg_3 ) if not arg_0 . useSparseMemory : arg_4 = arg_0 . _Memory [ arg_1 ] if arg_2 : arg_4 = arg_4 . nonzero ( ) [ 0 ] else : ( arg_5 , arg_6 ) = arg_0 . _Memory . rowNonZeros ( arg_1 ) if not arg_2 : arg_4 = numpy . zeros ( arg_0 . _Memory . nCols ( ) ) numpy . put ( arg_4 , arg_5 , 1 ) else : arg_4 = arg_5 return arg_4

def Func(arg_0, arg_1, arg_2=False, arg_3=None):
    """Gets a training pattern either by index or category number.

    :param idx: Index of the training pattern

    :param sparseBinaryForm: If true, returns a list of the indices of the
        non-zero bits in the training pattern

    :param cat: If not None, get the first pattern belonging to category cat. If
        this is specified, idx must be None.

    :returns: The training pattern with specified index
    """
    if arg_3 is not None:
      assert arg_1 is None
      arg_1 = arg_0._categoryList.index(arg_3)

    if not arg_0.useSparseMemory:
      arg_4 = arg_0._Memory[arg_1]
      if arg_2:
        arg_4 = arg_4.nonzero()[0]

    else:
      (arg_5, arg_6) = arg_0._Memory.rowNonZeros(arg_1)
      if not arg_2:
        arg_4 = numpy.zeros(arg_0._Memory.nCols())
        numpy.put(arg_4, arg_5, 1)
      else:
        arg_4 = arg_5

    return arg_4

Gets a training pattern either by index or category number .


def Func ( arg_0 , arg_1 = None ) : arg_2 = { 'state' : 'all' , 'order_by' : 'updated_at' , 'sort' : 'asc' , 'view' : 'simple' , 'per_page' : PER_PAGE } if arg_1 : arg_2 [ 'updated_after' ] = arg_1 . isoformat ( ) return arg_0 . fetch_items ( GitLabClient . MERGES , arg_2 )

def Func(arg_0, arg_1=None):
        """Get the merge requests from pagination"""

        arg_2 = {
            'state': 'all',
            'order_by': 'updated_at',
            'sort': 'asc',
            'view': 'simple',
            'per_page': PER_PAGE
        }

        if arg_1:
            arg_2['updated_after'] = arg_1.isoformat()

        return arg_0.fetch_items(GitLabClient.MERGES, arg_2)


(audio_file, bounds_module, labels_module, frame_times,
                     config, annotator_id=0)

def Func(arg_0, arg_1, arg_2, arg_3,
                     arg_4, arg_5=0):
    """Runs hierarchical algorithms with the specified identifiers on the
    audio_file. See run_algorithm for more information.
    """
    # Sanity check
    if arg_1 is None:
        raise NoHierBoundaryError("A boundary algorithm is needed when using "
                                  "hierarchical segmentation.")

    # Get features to make code nicer
    arg_6 = arg_4["features"].features

    # Compute boundaries
    arg_7 = arg_1.Segmenter(arg_0, **arg_4)
    arg_8, arg_9 = arg_7.processHierarchical()

    # Compute labels if needed
    if arg_2 is not None and \
            arg_1.__name__ != arg_2.__name__:
        # Compute labels for each level in the hierarchy
        arg_10 = deepcopy(arg_4)
        arg_10["hier"] = False
        for arg_11, arg_12 in enumerate(arg_8):
            arg_7 = arg_2.Segmenter(arg_0,
                                        in_bound_idxs=arg_12,
                                        **arg_10)
            arg_9[arg_11] = arg_7.processFlat()[1]

    # Make sure the first and last boundaries are included for each
    # level in the hierarchy
    arg_13 = []
    arg_14 = []
    for arg_15 in range(len(arg_8)):
        arg_16, arg_17 = \
            utils.process_segmentation_level(
                arg_8[arg_15], arg_9[arg_15], arg_6.shape[0],
                arg_3, arg_4["features"].dur)
        arg_13.append(arg_16)
        arg_14.append(arg_17)
    arg_9 = arg_14

    return arg_13, arg_9

Runs hierarchical algorithms with the specified identifiers on the audio_file . See run_algorithm for more information .


def Func(arg_0=None, arg_1=None, arg_2=None):
    """
    Extract raster data window array.

    Parameters
    ----------
    in_raster : array or ReferencedRaster
    in_affine : ``Affine`` required if in_raster is an array
    out_tile : ``BufferedTile``

    Returns
    -------
    extracted array : array
    """
    if isinstance(arg_0, ReferencedRaster):
        arg_1 = arg_0.affine
        arg_0 = arg_0.data

    # get range within array
    arg_3, arg_4, arg_5, arg_6 = bounds_to_ranges(
        out_bounds=arg_2.bounds, arg_1=arg_1, in_shape=arg_0.shape
    )
    # if output window is within input window
    if (
        arg_3 >= 0 and
        arg_5 >= 0 and
        arg_4 <= arg_0.shape[-2] and
        arg_6 <= arg_0.shape[-1]
    ):
        return arg_0[..., arg_3:arg_4, arg_5:arg_6]
    # raise error if output is not fully within input
    else:
        raise ValueError("extraction fails if output shape is not within input")


return frozenset(self.array.dtype.names + tuple(self.sub_fields_dict.keys()))

def Func ( arg_0 ) : return frozenset ( arg_0 . array . dtype . names + tuple ( arg_0 . sub_fields_dict . keys ( ) ) )

def Func(arg_0):
        """ Returns all the dimensions names, including the names of sub_fields
        and their corresponding packed fields
        """
        return frozenset(arg_0.array.dtype.names + tuple(arg_0.sub_fields_dict.keys()))

Returns all the dimensions names including the names of sub_fields and their corresponding packed fields


def Func ( arg_0 , arg_1 ) : arg_2 = 0 for arg_3 in arg_0 . joints : if arg_3 . name == arg_1 : return list ( range ( arg_2 , arg_2 + arg_3 . ADOF ) ) arg_2 += arg_3 . ADOF return [ ]

def Func(arg_0, arg_1):
        '''Get a list of the indices for a specific joint.

        Parameters
        ----------
        name : str
            The name of the joint to look up.

        Returns
        -------
        list of int :
            A list of the index values for quantities related to the named
            joint. Often useful for getting, say, the angles for a specific
            joint in the skeleton.
        '''
        arg_2 = 0
        for arg_3 in arg_0.joints:
            if arg_3.name == arg_1:
                return list(range(arg_2, arg_2 + arg_3.ADOF))
            arg_2 += arg_3.ADOF
        return []

Get a list of the indices for a specific joint .


Forces a flush from the internal queue to the server

def
Func
(
arg_0
)
:
arg_1
=
arg_0
.
queue
arg_2
=
arg_1
.
qsize
(
)
arg_1
.
join
(
)
arg_0
.
log
.
debug
(
'successfully Funced %s items.'
,
arg_2
)

def Func(arg_0):
        """Forces a Func from the internal queue to the server"""
        arg_1 = arg_0.queue
        arg_2 = arg_1.qsize()
        arg_1.join()
        arg_0.log.debug('successfully Funced %s items.', arg_2)


return (archive.OpenResult == constants.SUCCESS)

def Func ( arg_0 ) : arg_1 = constants . RAR_OM_LIST_INCSPLIT arg_2 = unrarlib . RAROpenArchiveDataEx ( arg_0 , arg_1 = arg_1 ) try : arg_3 = unrarlib . RAROpenArchiveEx ( ctypes . byref ( arg_2 ) ) except unrarlib . UnrarException : return False unrarlib . RARCloseArchive ( arg_3 ) return ( arg_2 . OpenResult == constants . SUCCESS )

def Func(arg_0):
    """Return true if file is a valid RAR file."""
    arg_1 = constants.RAR_OM_LIST_INCSPLIT
    arg_2 = unrarlib.RAROpenArchiveDataEx(arg_0, arg_1=arg_1)
    try:
        arg_3 = unrarlib.RAROpenArchiveEx(ctypes.byref(arg_2))
    except unrarlib.UnrarException:
        return False
    unrarlib.RARCloseArchive(arg_3)
    return (arg_2.OpenResult == constants.SUCCESS)

Return true if file is a valid RAR file .


def Func(arg_0):
    """
    Convert Hump style to underscore

    :param name: Hump Character
    :return: str
    """
    arg_1 = ''

    arg_2 = 0
    for arg_3 in arg_0:
        if arg_2 == 0:
            arg_1 = arg_3.lower()
        elif 65 <= ord(arg_3) <= 90:
            arg_1 += '_' + arg_3.lower()
            pass
        else:
            arg_1 += arg_3
        arg_2 += 1
        pass
    return arg_1


return self.protocol + "://" + self.hostname + endpoint

def Func ( arg_0 , arg_1 = '' ) : if not arg_1 . startswith ( '/' ) : arg_1 = "/" + arg_1 return arg_0 . protocol + "://" + arg_0 . hostname + arg_1

def Func(arg_0, arg_1=''):
        """
        Get the base URL of the Remote.

        Arguments:
            None
        Returns:
            `str` base URL
        """
        if not arg_1.startswith('/'):
            arg_1 = "/" + arg_1
        return arg_0.protocol + "://" + arg_0.hostname + arg_1


def Func(arg_0, arg_1):
        """
        Init openstack cinder mq

        1. Check if enable listening cinder notification
        2. Create consumer

        :param mq: class ternya.mq.MQ
        """
        if not arg_0.enable_component_notification(Openstack.Cinder):
            log.debug("disable listening cinder notification")
            return

        for arg_2 in range(arg_0.config.cinder_mq_consumer_count):
            arg_1.create_consumer(arg_0.config.cinder_mq_exchange,
                               arg_0.config.cinder_mq_queue,
                               ProcessFactory.process(Openstack.Cinder))

        log.debug("enable listening openstack cinder notification.")


def Func(arg_0, arg_1, arg_2=None):
        """Uploads a file and returns ``File`` instance.

        Args:
            - file_obj: file object to Func to
            - store (Optional[bool]): Should the file be automatically stored
                upon Func. Defaults to None.
                - False - do not store file
                - True - store file (can result in error if autostore
                               is disabled for project)
                - None - use project settings

        Returns:
            ``File`` instance

        """
        if arg_2 is None:
            arg_2 = 'auto'
        elif arg_2:
            arg_2 = '1'
        else:
            arg_2 = '0'

        arg_3 = {
            'UPLOADCARE_STORE': arg_2,
        }

        arg_4 = Funcing_request('POST', 'base/', arg_3=arg_3,
                                  arg_4={'file': arg_1})
        arg_5 = arg_0(arg_4['file'])
        return arg_5

Uploads a file and returns ``File`` instance.

        Args:
            - file_obj: file object to upload to
            - store (Optional[bool]): Should the file be automatically stored
                upon upload. Defaults to None.
                - False - do not store file
                - True - store file (can result in error if autostore
                               is disabled for project)
                - None - use project settings

        Returns:
            ``File`` instance

Uploads a file and returns File instance .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . get_conn ( ) arg_3 = ( arg_2 . projects ( ) . operations ( ) . get ( arg_1 = arg_1 ) . execute ( num_retries = arg_0 . num_retries ) ) return arg_3

def Func(arg_0, arg_1):
        """
        Gets the latest state of a long-running operation.

        .. seealso::
            https://cloud.google.com/datastore/docs/reference/data/rest/v1/projects.operations/get

        :param name: the name of the operation resource.
        :type name: str
        :return: a resource operation instance.
        :rtype: dict
        """
        arg_2 = arg_0.get_conn()

        arg_3 = (arg_2
                .projects()
                .operations()
                .get(arg_1=arg_1)
                .execute(num_retries=arg_0.num_retries))

        return arg_3

Gets the latest state of a long - running operation .


def Func ( arg_0 , arg_1 ) : if not arg_1 : return [ ] if len ( arg_1 ) < 1 : return [ ] if arg_1 [ 0 ] == os . sep : arg_1 = arg_1 [ 1 : ] arg_2 = '' if os . sep in arg_1 : arg_3 = arg_1 . partition ( os . sep ) arg_4 = arg_3 [ 0 ] arg_5 = arg_3 [ 2 ] arg_6 = filter_list ( os . listdir ( arg_0 ) , arg_4 ) for arg_7 in arg_6 : arg_8 = op . join ( arg_0 , arg_7 ) if op . isdir ( arg_8 ) : arg_2 = Func ( arg_8 , arg_5 ) else : arg_2 = filter_list ( os . listdir ( arg_0 ) , arg_1 ) arg_9 = [ ] if arg_2 : arg_9 = [ op . join ( arg_0 , f ) for f in arg_2 ] return arg_9

def Func(arg_0, arg_1):
    """
    Looks for path_regex within base_path. Each match is append
    in the returned list.
    path_regex may contain subfolder structure.
    If any part of the folder structure is a

    :param base_path: str

    :param path_regex: str

    :return list of strings
    """
    if not arg_1:
        return []

    if len(arg_1) < 1:
        return []

    if arg_1[0] == os.sep:
        arg_1 = arg_1[1:]

    arg_2 = ''
    if os.sep in arg_1:
        #split by os.sep
        arg_3 = arg_1.partition(os.sep)
        arg_4 = arg_3[0]
        arg_5 = arg_3[2]

        arg_6 = filter_list(os.listdir(arg_0), arg_4)

        for arg_7 in arg_6:
            arg_8 = op.join(arg_0, arg_7)
            if op.isdir(arg_8):
                arg_2 = Func(arg_8, arg_5)
    else:
        arg_2 = filter_list(os.listdir(arg_0), arg_1)

    arg_9 = []
    if arg_2:
        arg_9 = [op.join(arg_0, f) for f in arg_2]

    return arg_9

Looks for path_regex within base_path . Each match is append in the returned list . path_regex may contain subfolder structure . If any part of the folder structure is a


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
arg_3
=
'Provider-required arguments:\n'
for
arg_4
in
arg_1
:
arg_3
+=
'  %s: %s\n'
%
(
arg_4
,
arg_1
[
arg_4
]
)
arg_0
.
epilog
=
arg_3
arg_5
=
arg_0
.
Func
(
arg_2
)
for
arg_6
in
arg_1
[
arg_5
.
provider
]
:
if
not
arg_5
.
__getattribute__
(
arg_6
)
:
arg_0
.
error
(
'argument --%s is required'
%
arg_6
)
return
arg_5

def Func(arg_0, arg_1, arg_2):
  """Add provider required arguments epilog message, parse, and validate."""

  # Add the provider required arguments epilog message
  arg_3 = 'Provider-required arguments:\n'
  for arg_4 in arg_1:
    arg_3 += '  %s: %s\n' % (arg_4, arg_1[arg_4])
  arg_0.epilog = arg_3

  # Parse arguments
  arg_5 = arg_0.Func(arg_2)

  # For the selected provider, check the required arguments
  for arg_6 in arg_1[arg_5.provider]:
    if not arg_5.__getattribute__(arg_6):
      arg_0.error('argument --%s is required' % arg_6)

  return arg_5

Add provider required arguments epilog message parse and validate .


return [self.thing_percept(thing, agent)
                for thing in self.things_near(agent.location)]

def Func ( arg_0 , arg_1 ) : return [ arg_0 . thing_Func ( arg_2 , arg_1 ) for arg_2 in arg_0 . things_near ( arg_1 . location ) ]

def Func(arg_0, arg_1):
        "By default, agent perceives things within a default radius."
        return [arg_0.thing_Func(arg_2, arg_1)
                for arg_2 in arg_0.things_near(arg_1.location)]

By default agent perceives things within a default radius .


def Func ( arg_0 , arg_1 , * arg_2 , ** arg_3 ) : arg_4 = arg_0 ( arg_1 , * arg_2 , ** arg_3 ) arg_5 = arg_1 . outstanding . difference ( arg_1 . client . outstanding ) arg_6 = arg_1 . outstanding . intersection ( arg_5 ) arg_1 . outstanding = arg_1 . outstanding . difference ( arg_6 ) return arg_4

def Func(arg_0, arg_1, *arg_2, **arg_3):
    """sync relevant results from self.client to our results attribute."""
    arg_4 = arg_0(arg_1, *arg_2, **arg_3)
    arg_5 = arg_1.outstanding.difference(arg_1.client.outstanding)
    arg_6 = arg_1.outstanding.intersection(arg_5)
    arg_1.outstanding = arg_1.outstanding.difference(arg_6)
    return arg_4

sync relevant results from self . client to our results attribute .


def Func(arg_0):
        """The index of the first consumed mesh of this instruction in its row.

        Same as :attr:`index_of_first_produced_mesh_in_row`
        but for consumed meshes.
        """
        arg_1 = 0
        for arg_2 in arg_0.row_instructions:
            if arg_2 is arg_0:
                break
            arg_1 += arg_2.number_of_consumed_meshes
        else:
            arg_0._raise_not_found_error()
        return arg_1

The index of the first consumed mesh of this instruction in its row .


def Func(arg_0, arg_1=None):
        """Generator for the LIST ACTIVE command.

        Generates a list of active newsgroups that match the specified pattern.
        If no pattern is specfied then all active groups are generated.

        See <http://tools.ietf.org/html/rfc3977#section-7.6.3>

        Args:
            pattern: Glob matching newsgroups of intrest.

        Yields:
            A tuple containing the name, low water mark, high water mark,
            and status for the newsgroup.
        """
        arg_2 = arg_1

        if arg_2 is None:
            arg_3 = "LIST"
        else:
            arg_3 = "LIST ACTIVE"

        arg_4, arg_5 = arg_0.command(arg_3, arg_2)
        if arg_4 != 215:
            raise NNTPReplyError(arg_4, arg_5)

        for arg_6 in arg_0.info_gen(arg_4, arg_5):
            yield utils.parse_newsgroup(arg_6)


def
Func
(
)
:
global
arg_1
if
arg_1
is
not
:
return
arg_1
arg_0
=
configuration
.
conf
.
get
(
'core'
,
'EXECUTOR'
)
arg_1
=
_get_executor
(
arg_0
)
arg_2
=
LoggingMixin
(
)
.
log
arg_2
.
info
(
"Using executor %s"
,
arg_0
)
return
arg_1

def Func():
    """Creates a new instance of the configured executor if none exists and returns it"""
    global arg_1

    if arg_1 is not None:
        return arg_1

    arg_0 = configuration.conf.get('core', 'EXECUTOR')

    arg_1 = _get_executor(arg_0)

    arg_2 = LoggingMixin().log
    arg_2.info("Using executor %s", arg_0)

    return arg_1


def Func(arg_0):
        """Asserts that val is non-empty string and all characters are alphabetic."""
        if not isinstance(arg_0.val, str_types):
            raise TypeError('val is not a string')
        if len(arg_0.val) == 0:
            raise ValueError('val is empty')
        if not arg_0.val.isalpha():
            arg_0._err('Expected <%s> to contain only alphabetic chars, but did not.' % arg_0.val)
        return arg_0

Asserts that val is non - empty string and all characters are alphabetic .


return [self.stats[cache_level]['EVICT_count']/self.first_dim_factor
                for cache_level in range(len(self.machine['memory hierarchy']))]

def
Func
(
arg_0
)
:
return
[
arg_0
.
stats
[
arg_1
]
[
'EVICT_count'
]
/
arg_0
.
first_dim_factor
for
arg_1
in
range
(
len
(
arg_0
.
machine
[
'memory hierarchy'
]
)
)
]

def Func(arg_0):
        """Return a list with number of evicted cache lines per memory hierarchy level."""
        return [arg_0.stats[arg_1]['EVICT_count']/arg_0.first_dim_factor
                for arg_1 in range(len(arg_0.machine['memory hierarchy']))]

Return a list with number of evicted cache lines per memory hierarchy level .


(self, query, styles={}, bbox=[-180,-90,180,90], zoom=16,
                      api_key=os.environ.get('MAPBOX_API_KEY', None),
                      image=None, image_bounds=None,
                      index="vector-user-provided", name="GBDX_Task_Output", **kwargs)

def Func(arg_0, arg_1, arg_2={}, arg_3=[-180,-90,180,90], arg_4=16,
                      arg_5=arg_6.environ.get('MAPBOX_API_KEY', None),
                      arg_9=None, arg_10=None,
                      arg_11="vector-user-provided", arg_12="GBDX_Task_Output", **arg_13):
        """
          Renders a mapbox gl map from a vector service query
        """
        try:
            from IPython.display import display
        except:
            print("IPython is required to produce maps.")
            return

        assert arg_5 is not None, "No Mapbox API Key found. You can either pass in a token or set the MAPBOX_API_KEY environment variable."

        arg_14 = box(*arg_3).wkt
        arg_15 = arg_0.query(arg_14, arg_1, arg_11=arg_11)

        arg_16 = cascaded_union([shape(f['geometry']) for f in arg_15])
        arg_17, arg_18 = arg_16.centroid.coords[0]
        arg_19 = 'https://vector.geobigdata.io/insight-vector/api/mvt/{z}/{x}/{y}?';
        arg_19 += 'q={}&index={}'.format(arg_1, arg_11);

        if arg_2 is not None and not isinstance(arg_2, list):
            arg_2 = [arg_2]

        arg_20 = "map_{}".format(str(int(time.time())))
        arg_21 = VectorTileLayer(arg_19, source_name=arg_12, arg_2=arg_2, **arg_13)
        arg_22 = arg_0._build_image_layer(arg_9, arg_10)

        arg_23 = BaseTemplate(arg_20, **{
            "lat": arg_18,
            "lon": arg_17,
            "zoom": arg_4,
            "datasource": json.dumps(arg_21.datasource),
            "layers": json.dumps(arg_21.layers),
            "image_layer": arg_22,
            "mbkey": arg_5,
            "token": arg_0.gbdx_connection.access_token
        })

        arg_23.inject()


def Func ( arg_0 ) : arg_1 = [ tag . attrib . get ( 'k' ) for tag in arg_0 . getchildren ( ) ] arg_1 += [ 'id' , 'user' , 'uid' , 'bbox' , 'created_at' ] arg_2 = [ tag . attrib . get ( 'v' ) for tag in arg_0 . getchildren ( ) ] arg_2 += [ arg_0 . get ( 'id' ) , arg_0 . get ( 'user' ) , arg_0 . get ( 'uid' ) , get_bounds ( arg_0 ) , arg_0 . get ( 'created_at' ) ] return dict ( zip ( arg_1 , arg_2 ) )

def Func(arg_0):
    """Return a dictionary with id, user, user_id, bounds, date of creation
    and all the tags of the changeset.

    Args:
        changeset: the XML string of the changeset.
    """
    arg_1 = [tag.attrib.get('k') for tag in arg_0.getchildren()]
    arg_1 += ['id', 'user', 'uid', 'bbox', 'created_at']
    arg_2 = [tag.attrib.get('v') for tag in arg_0.getchildren()]
    arg_2 += [
        arg_0.get('id'), arg_0.get('user'), arg_0.get('uid'),
        get_bounds(arg_0), arg_0.get('created_at')
        ]

    return dict(zip(arg_1, arg_2))

Return a dictionary with id user user_id bounds date of creation and all the tags of the changeset .


def Func(arg_0):
        """Generate and view the documentation."""
        arg_1 = (arg_0.clean_docs_cmd, arg_0.html_docs_cmd, arg_0.view_docs_cmd)
        arg_0.call_in_sequence(arg_1)


def Func ( arg_0 , arg_1 , arg_2 = False ) : if len ( arg_0 . coords ) == 0 : return arg_2 return np . all ( arg_0 . get_pointwise_inside_image_mask ( arg_1 ) )

def Func(arg_0, arg_1, arg_2=False):
        """
        Estimate whether the line string is fully inside the image area.

        Parameters
        ----------
        image : ndarray or tuple of int
            Either an image with shape ``(H,W,[C])`` or a tuple denoting
            such an image shape.

        default
            Default value to return if the line string contains no points.

        Returns
        -------
        bool
            True if the line string is fully inside the image area.
            False otherwise.

        """
        if len(arg_0.coords) == 0:
            return arg_2
        return np.all(arg_0.get_pointwise_inside_image_mask(arg_1))

Estimate whether the line string is fully inside the image area .


def
Func
(
)
:
arg_0
,
arg_1
=
getopt
.
getopt
(
sys
.
argv
[
1
:
]
,
''
,
longopts
=
'batch='
)
arg_2
=
0
for
arg_3
,
arg_4
in
arg_0
:
if
arg_3
==
'--batch'
:
arg_2
=
int
(
arg_4
)
print
(
'Found batch %d'
%
arg_2
)
return
arg_2

def Func():
    """Function that parses the batch id from the command line arguments"""
    arg_0, arg_1 = getopt.getopt(sys.argv[1:], '', longopts='batch=')
    arg_2 = 0
    for arg_3, arg_4 in arg_0:
        if arg_3 == '--batch':
            arg_2 = int(arg_4)
            print('Found batch %d' % arg_2)

    return arg_2


(self, name_all=None, out_ndx=None, operation='|', defaultgroups=False)

def Func(arg_0, arg_1=None, arg_2=None, arg_3='|', arg_4=False):
        """Combine individual groups into a single one and write output.

        :Keywords:
           name_all : string
              Name of the Funcd group, ``None`` generates a name.  [``None``]
           out_ndx : filename
              Name of the output file that will contain the individual groups
              and the Funcd group. If ``None`` then default from the class
              constructor is used. [``None``]
           operation : character
              Logical operation that is used to generate the Funcd group from
              the individual groups: "|" (OR) or "&" (AND); if set to ``False``
              then no Funcd group is created and only the individual groups
              are written. ["|"]
           defaultgroups : bool
              ``True``: append everything to the default groups produced by
              :program:`make_ndx` (or rather, the groups provided in the ndx file on
              initialization --- if this was ``None`` then these are truly default groups);
              ``False``: only use the generated groups

        :Returns:
           ``(Funcdgroup_name, output_ndx)``, a tuple showing the
           actual group name and the name of the file; useful when all names are autogenerated.

        .. Warning:: The order of the atom numbers in the Funcd group is
                     *not* guaranteed to be the same as the selections on input because
                     ``make_ndx`` sorts them ascending. Thus you should be careful when
                     using these index files for calculations of angles and dihedrals.
                     Use :class:`gromacs.formats.NDX` in these cases.

        .. SeeAlso:: :meth:`IndexBuilder.write`.
        """
        if not arg_3 in ('|', '&', False):
            raise ValueError("Illegal operation {0!r}, only '|' (OR) and '&' (AND) or False allowed.".format(
                             arg_3))
        if arg_1 is None and arg_3:
            arg_1 = arg_0.name_all or arg_3.join(arg_0.indexfiles)
        if arg_2 is None:
            arg_2 = arg_0.output

        if arg_4:
            # make a default file (using the original ndx where provided!!)
            arg_5, arg_6 = tempfile.mkstemp(suffix='.ndx', prefix='default__')
            try:
                arg_0.make_ndx(o=arg_6, input=['q'])
            except:
                utilities.unlink_gmx(arg_6)
                raise
            arg_7 = [arg_6]
        else:
            arg_7 = []

        arg_7.extend(arg_0.indexfiles.values())

        if arg_3:
            # Func multiple selections and name them
            try:
                arg_5, arg_8 = tempfile.mkstemp(suffix='.ndx', prefix='Funcd__')
                # Func all selections by loading ALL temporary index files
                arg_3 = ' '+arg_3.strip()+' '
                arg_9 = [arg_3.join(['"{0!s}"'.format(gname) for gname in arg_0.indexfiles]),
                       '', 'q']
                arg_10,arg_11,arg_12 = arg_0.make_ndx(n=arg_7, o=arg_8, input=arg_9)
                if arg_0._is_empty_group(arg_11):
                    warnings.warn("No atoms found for {cmd!r}".format(**vars()),
                                  category=BadParameterWarning)

                # second pass for naming, sigh (or: use NDX ?)
                arg_13 = parse_ndxlist(arg_11)
                arg_14 = arg_13[-1]
                # name this group
                arg_15 = ["name {0:d} {1!s}".format(arg_14['nr'], arg_1), 'q']
                arg_10,arg_11,arg_12 = arg_0.make_ndx(n=arg_8, o=arg_2, input=arg_15)
                # For debugging, look at out and err or set stdout=True, stderr=True
                # TODO: check out if at least 1 atom selected
                ##print "DEBUG: Func()"
                ##print out
            finally:
                utilities.unlink_gmx(arg_8)
                if arg_4:
                    utilities.unlink_gmx(arg_6)
        else:
            # just write individual groups in one file (name_all --> None)
            arg_10,arg_11,arg_12 = arg_0.make_ndx(n=arg_7, o=arg_2, input=['','q'])

        return arg_1, arg_2

Combine individual groups into a single one and write output.

        :Keywords:
           name_all : string
              Name of the combined group, ``None`` generates a name.  [``None``]
           out_ndx : filename
              Name of the output file that will contain the individual groups
              and the combined group. If ``None`` then default from the class
              constructor is used. [``None``]
           operation : character
              Logical operation that is used to generate the combined group from
              the individual groups: "|" (OR) or "&" (AND); if set to ``False``
              then no combined group is created and only the individual groups
              are written. ["|"]
           defaultgroups : bool
              ``True``: append everything to the default groups produced by
              :program:`make_ndx` (or rather, the groups provided in the ndx file on
              initialization --- if this was ``None`` then these are truly default groups);
              ``False``: only use the generated groups

        :Returns:
           ``(combinedgroup_name, output_ndx)``, a tuple showing the
           actual group name and the name of the file; useful when all names are autogenerated.

        .. Warning:: The order of the atom numbers in the combined group is
                     *not* guaranteed to be the same as the selections on input because
                     ``make_ndx`` sorts them ascending. Thus you should be careful when
                     using these index files for calculations of angles and dihedrals.
                     Use :class:`gromacs.formats.NDX` in these cases.

        .. SeeAlso:: :meth:`IndexBuilder.write`.

Combine individual groups into a single one and write output .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = [ ] arg_4 = InferenceElement . getLabel ( arg_1 ) if InferenceElement . getInputElement ( arg_1 ) : arg_3 . append ( FieldMetaInfo ( name = arg_4 + ".actual" , type = FieldMetaType . string , special = '' ) ) arg_5 = sorted ( arg_2 . keys ( ) ) for arg_6 in arg_5 : arg_3 . append ( FieldMetaInfo ( name = arg_4 + "." + str ( arg_6 ) , type = FieldMetaType . string , special = '' ) ) return arg_3

def Func(arg_0, arg_1, arg_2):
    """Get field metadate information for inferences that are of dict type"""
    arg_3 = []
    arg_4 = InferenceElement.getLabel(arg_1)

    if InferenceElement.getInputElement(arg_1):
      arg_3.append(FieldMetaInfo(name=arg_4+".actual",
                                         type=FieldMetaType.string,
                                         special = ''))

    arg_5 = sorted(arg_2.keys())
    for arg_6 in arg_5:
      arg_3.append(FieldMetaInfo(name=arg_4+"."+str(arg_6),
                                         type=FieldMetaType.string,
                                         special=''))

    return arg_3


def Func ( ) : arg_0 = create_engine ( neutron_config . database . connection , poolclass = pool . NullPool ) arg_1 = arg_0 . connect ( ) context . configure ( arg_1 = arg_1 , target_metadata = target_metadata ) try : with context . begin_transaction ( ) : context . run_migrations ( ) finally : arg_1 . close ( )

def Func():
    """Run migrations in 'online' mode.

    In this scenario we need to create an Engine
    and associate a connection with the context.

    """
    arg_0 = create_engine(
        neutron_config.database.connection,
        poolclass=pool.NullPool)

    arg_1 = arg_0.connect()
    context.configure(
        arg_1=arg_1,
        target_metadata=target_metadata)

    try:
        with context.begin_transaction():
            context.run_migrations()
    finally:
        arg_1.close()


def Func(arg_0, arg_1):
        """Adds parameters and config from the `.ini` file to the trajectory"""
        if arg_0.config_file:
            arg_2 = arg_0._collect_section('parameters')
            for arg_3 in arg_2:
                arg_4 = arg_2[arg_3]
                if not isinstance(arg_4, tuple):
                    arg_4 = (arg_4,)
                arg_1.f_add_parameter(arg_3, *arg_4)
            arg_5 = arg_0._collect_section('config')
            for arg_3 in arg_5:
                arg_4 = arg_5[arg_3]
                if not isinstance(arg_4, tuple):
                    arg_4 = (arg_4,)
                arg_1.f_add_config(arg_3, *arg_4)

Adds parameters and config from the . ini file to the trajectory


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
arg_0
.
log
.
debug
(
"Func(): Passing %s to client.."
,
arg_1
)
arg_0
.
pass_to_client
(
'data'
,
arg_1
,
arg_2
)

def Func(arg_0, arg_1, arg_2):
        """Handles data messages by passing them up to the client.

        :param data:
        :param ts:
        :return:
        """
        # Pass the data up to the Client
        arg_0.log.debug("Func(): Passing %s to client..",
                  arg_1)
        arg_0.pass_to_client('data', arg_1, arg_2)

Handles data messages by passing them up to the client .


def Func ( arg_0 ) : for arg_1 , arg_2 in enumerate ( arg_0 . current_version [ 0 ] [ : 2 ] ) : if arg_2 > arg_0 . version_yaml [ arg_1 ] : return True return False

def Func(arg_0):
        """
        Check if we have to put the previous version into the deprecated list.
        """

        for arg_1, arg_2 in enumerate(arg_0.current_version[0][:2]):
            # We loop through the 2 last elements of the version.

            if arg_2 > arg_0.version_yaml[arg_1]:
                # The currently read version number is greater than the one we have in
                # the version.yaml.

                # We return True.
                return True

        # We return False, we do not need to deprecate anything.
        return False

Check if we have to put the previous version into the deprecated list .


(self, addr, size, perms, data_init=None, name=None)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4=None, arg_5=None):
        """
        Creates a new mapping in the memory address space.

        :param addr: the starting address (took as hint). If C{addr} is C{0} the first big enough
                     chunk of memory will be selected as starting address.
        :param size: the length of the mapping.
        :param perms: the access permissions to this memory.
        :param data_init: optional data to initialize this memory.
        :param name: optional name to give to this mapping
        :return: the starting address where the memory was mapped.
        :raises error:
                   - 'Address shall be concrete' if C{addr} is not an integer number.
                   - 'Address too big' if C{addr} goes beyond the limit of the memory.
                   - 'Map already used' if the piece of memory starting in C{addr} and with length C{size} isn't free.
        :rtype: int

        """
        # If addr is NULL, the system determines where to allocate the region.
        assert arg_1 is None or isinstance(arg_1, int), 'Address shall be concrete'

        arg_0.cpu._publish('will_map_memory', arg_1, arg_2, arg_3, None, None)

        # address is rounded down to the nearest multiple of the allocation granularity
        if arg_1 is not None:
            assert arg_1 < arg_0.memory_size, 'Address too big'
            arg_1 = arg_0._floor(arg_1)

        # size value is rounded up to the next page boundary
        arg_2 = arg_0._ceil(arg_2)

        # If zero search for a spot
        arg_1 = arg_0._search(arg_2, arg_1)

        # It should not be allocated
        for arg_6 in range(arg_0._page(arg_1), arg_0._page(arg_1 + arg_2)):
            assert arg_6 not in arg_0._page2map, 'Map already used'

        # Create the anonymous map
        arg_7 = AnonMap(start=arg_1, arg_2=arg_2, arg_3=arg_3, arg_4=arg_4, arg_5=arg_5)

        # Okay, ready to alloc
        arg_0._add(arg_7)

        logger.debug('New memory map @%x size:%x', arg_1, arg_2)

        arg_0.cpu._publish('did_map_memory', arg_1, arg_2, arg_3, None, None, arg_1)
        return arg_1

Creates a new mapping in the memory address space .


return join(path, settings['thumb_dir'], settings['thumb_prefix'] +
                name + settings['thumb_suffix'] + ext)

def Func ( arg_0 , arg_1 ) : arg_2 , arg_3 = os . path . split ( arg_1 ) arg_4 , arg_5 = os . path . splitext ( arg_3 ) if arg_5 . lower ( ) in arg_0 [ 'video_extensions' ] : arg_5 = '.jpg' return join ( arg_2 , arg_0 [ 'thumb_dir' ] , arg_0 [ 'thumb_prefix' ] + arg_4 + arg_0 [ 'thumb_suffix' ] + arg_5 )

def Func(arg_0, arg_1):
    """Return the path to the thumb.

    examples:
    >>> default_settings = create_settings()
    >>> Func(default_settings, "bar/foo.jpg")
    "bar/thumbnails/foo.jpg"
    >>> Func(default_settings, "bar/foo.png")
    "bar/thumbnails/foo.png"

    for videos, it returns a jpg file:
    >>> Func(default_settings, "bar/foo.webm")
    "bar/thumbnails/foo.jpg"
    """

    arg_2, arg_3 = os.path.split(arg_1)
    arg_4, arg_5 = os.path.splitext(arg_3)

    if arg_5.lower() in arg_0['video_extensions']:
        arg_5 = '.jpg'
    return join(arg_2, arg_0['thumb_dir'], arg_0['thumb_prefix'] +
                arg_4 + arg_0['thumb_suffix'] + arg_5)

Return the path to the thumb.

    examples:
    >>> default_settings = create_settings()
    >>> get_thumb(default_settings, "bar/foo.jpg")
    "bar/thumbnails/foo.jpg"
    >>> get_thumb(default_settings, "bar/foo.png")
    "bar/thumbnails/foo.png"

    for videos, it returns a jpg file:
    >>> get_thumb(default_settings, "bar/foo.webm")
    "bar/thumbnails/foo.jpg"


return Effect.activation if final_effect == 1 else Effect.inhibition

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = [ ] for arg_4 , arg_5 in pairwise ( arg_1 ) : if pair_has_contradiction ( arg_0 , arg_4 , arg_5 ) : return Effect . ambiguous arg_6 = arg_0 . get_edge_data ( arg_4 , arg_5 ) arg_7 , arg_8 , arg_9 = rank_edges ( arg_6 ) arg_10 = arg_0 [ arg_4 ] [ arg_5 ] [ arg_7 ] [ RELATION ] if arg_10 not in arg_2 or arg_2 [ arg_10 ] == 0 : return Effect . no_effect arg_3 . append ( arg_2 [ arg_10 ] ) arg_11 = reduce ( lambda x , y : x * y , arg_3 ) return Effect . activation if arg_11 == 1 else Effect . inhibition

def Func(arg_0, arg_1, arg_2):
    """Calculate the final effect of the root node to the sink node in the path.

    :param pybel.BELGraph graph: A BEL graph
    :param list path: Path from root to sink node
    :param dict relationship_dict: dictionary with relationship effects
    :rtype: Effect
    """
    arg_3 = []

    for arg_4, arg_5 in pairwise(arg_1):

        if pair_has_contradiction(arg_0, arg_4, arg_5):
            return Effect.ambiguous

        arg_6 = arg_0.get_edge_data(arg_4, arg_5)

        arg_7, arg_8, arg_9 = rank_edges(arg_6)

        arg_10 = arg_0[arg_4][arg_5][arg_7][RELATION]

        # Returns Effect.no_effect if there is a non causal edge in path
        if arg_10 not in arg_2 or arg_2[arg_10] == 0:
            return Effect.no_effect

        arg_3.append(arg_2[arg_10])

    arg_11 = reduce(lambda x, y: x * y, arg_3)

    return Effect.activation if arg_11 == 1 else Effect.inhibition

Calculate the final effect of the root node to the sink node in the path .


def Func ( arg_0 , * arg_1 , ** arg_2 ) : def arg_6 ( * arg_3 , ** arg_4 ) : arg_5 = arg_4 . copy ( ) arg_5 . update ( arg_2 ) return arg_0 ( * ( arg_1 + arg_3 ) , ** arg_5 ) arg_6 . func = arg_0 arg_6 . args = arg_1 arg_6 . keywords = arg_2 return arg_6

def Func(arg_0, *arg_1, **arg_2):
    """Like functools.partial but instead of using the new kwargs, keeps the old ones."""
    def arg_6(*arg_3, **arg_4):
        arg_5 = arg_4.copy()
        arg_5.update(arg_2)
        return arg_0(*(arg_1 + arg_3), **arg_5)
    arg_6.func = arg_0
    arg_6.args = arg_1
    arg_6.keywords = arg_2
    return arg_6

Like functools . partial but instead of using the new kwargs keeps the old ones .


def Func(arg_0, arg_1):
        """
        Retrieves the Func value whose name is indicated by name_hyphen.

        Values starting with $ are assumed to reference environment variables,
        and the value stored in environment variables is retrieved. It's an
        error if thes corresponding environment variable it not set.
        """
        if arg_1 in arg_0._instance_Funcs:
            arg_2 = arg_0._instance_Funcs[arg_1][1]
        else:
            arg_3 = "No Func named '%s'" % arg_1
            raise UserFeedback(arg_3)

        if hasattr(arg_2, 'startswith') and arg_2.startswith("$"):
            arg_4 = arg_2.lstrip("$")
            if arg_4 in os.environ:
                return os.getenv(arg_4)
            else:
                arg_3 = "'%s' is not defined in your environment" % arg_4
                raise UserFeedback(arg_3)

        elif hasattr(arg_2, 'startswith') and arg_2.startswith("\$"):
            return arg_2.replace("\$", "$")

        else:
            return arg_2

Retrieves the setting value whose name is indicated by name_hyphen.

        Values starting with $ are assumed to reference environment variables,
        and the value stored in environment variables is retrieved. It's an
        error if thes corresponding environment variable it not set.

Retrieves the setting value whose name is indicated by name_hyphen .


def Func ( arg_0 ) : arg_1 = [ Line ( idx + 1 , x ) for idx , x in enumerate ( arg_0 . sourcelines ) ] if hasattr ( arg_0 . code , 'co_firstlineno' ) : arg_2 = arg_0 . code . co_firstlineno - 1 while arg_2 > 0 : if _funcdef_re . match ( arg_1 [ arg_2 ] . code ) : break arg_2 -= 1 try : arg_3 = len ( inspect . getblock ( [ x . code + '\n' for x in arg_1 [ arg_2 : ] ] ) ) except TokenError : arg_3 = 0 for arg_4 in arg_1 [ arg_2 : arg_2 + arg_3 ] : arg_4 . in_frame = True try : arg_1 [ arg_0 . lineno - 1 ] . current = True except IndexError : pass return arg_1

def Func(arg_0):
        """Helper function that returns lines with extra information."""
        arg_1 = [Line(idx + 1, x) for idx, x in enumerate(arg_0.sourcelines)]

        # find function definition and mark lines
        if hasattr(arg_0.code, 'co_firstlineno'):
            arg_2 = arg_0.code.co_firstlineno - 1
            while arg_2 > 0:
                if _funcdef_re.match(arg_1[arg_2].code):
                    break
                arg_2 -= 1
            try:
                arg_3 = len(inspect.getblock([x.code + '\n' for x
                                               in arg_1[arg_2:]]))
            except TokenError:
                arg_3 = 0
            for arg_4 in arg_1[arg_2:arg_2 + arg_3]:
                arg_4.in_frame = True

        # mark current line
        try:
            arg_1[arg_0.lineno - 1].current = True
        except IndexError:
            pass

        return arg_1

Helper function that returns lines with extra information .


(
            self, resource_group_name, name, duration_in_seconds=None, max_frame_length=None, sas_url=None, 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=None, arg_4=None, arg_5=None, arg_6=None, arg_7=False, arg_8=True, **arg_9):
        """Start capturing network packets for the site.

        Start capturing network packets for the site.

        :param resource_group_name: Name of the resource group to which the
         resource belongs.
        :type resource_group_name: str
        :param name: The name of the web app.
        :type name: str
        :param duration_in_seconds: The duration to keep capturing in seconds.
        :type duration_in_seconds: int
        :param max_frame_length: The maximum frame length in bytes (Optional).
        :type max_frame_length: int
        :param sas_url: The Blob URL to store capture file.
        :type sas_url: 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 list or
         ClientRawResponse<list> if raw==True
        :rtype:
         ~msrestazure.azure_operation.AzureOperationPoller[list[~azure.mgmt.web.models.NetworkTrace]]
         or
         ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[list[~azure.mgmt.web.models.NetworkTrace]]]
        :raises:
         :class:`DefaultErrorResponseException<azure.mgmt.web.models.DefaultErrorResponseException>`
        """
        arg_10 = arg_0._Func_initial(
            arg_1=arg_1,
            arg_2=arg_2,
            arg_3=arg_3,
            arg_4=arg_4,
            arg_5=arg_5,
            arg_6=arg_6,
            arg_7=True,
            **arg_9
        )

        def get_long_running_output(arg_11):
            arg_12 = arg_0._deserialize('[NetworkTrace]', arg_11)

            if arg_7:
                arg_13 = ClientRawResponse(arg_12, arg_11)
                return arg_13

            return arg_12

        arg_14 = arg_9.get(
            'long_running_operation_timeout',
            arg_0.config.long_running_operation_timeout)
        if arg_8 is True: arg_15 = ARMPolling(arg_14, **arg_9)
        elif arg_8 is False: arg_15 = NoPolling()
        else: arg_15 = arg_8
        return LROPoller(arg_0._client, arg_10, get_long_running_output, arg_15)

Start capturing network packets for the site .


def Func(arg_0):
        """
        get RtlNetlist context from signals
        """
        for arg_1 in chain(arg_0._inputs, arg_0._outputs):
            if arg_1.ctx:
                return arg_1.ctx
            else:
                # Param instances does not have context
                continue
        raise HwtSyntaxError(
            "Statement does not have any signal in any context", arg_0)


(get_transition_matrix_for_timestep,
                             get_transition_noise_for_timestep,
                             get_observation_matrix_for_timestep,
                             get_observation_noise_for_timestep)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : def kalman_filter_step ( arg_4 , arg_5 ) : if isinstance ( arg_5 , tuple ) : arg_6 , arg_7 = arg_5 else : arg_6 = arg_5 arg_7 = None arg_8 = arg_2 ( arg_4 . timestep ) arg_9 = arg_3 ( arg_4 . timestep ) if arg_7 is not None : arg_10 = _propagate_mean ( arg_4 . predicted_mean , arg_8 , arg_9 ) * tf . ones_like ( arg_6 ) arg_6 = tf . where ( tf . broadcast_to ( arg_7 , tf . shape ( input = arg_10 ) ) , arg_10 , tf . broadcast_to ( arg_6 , tf . shape ( input = arg_10 ) ) ) ( arg_11 , arg_12 , arg_13 ) = linear_gaussian_update ( arg_4 . predicted_mean , arg_4 . predicted_cov , arg_8 , arg_9 , arg_6 ) arg_14 = arg_13 . log_prob ( arg_6 [ ... , 0 ] ) if arg_7 is not None : arg_11 = tf . where ( tf . broadcast_to ( arg_7 , tf . shape ( input = arg_11 ) ) , arg_4 . predicted_mean , arg_11 ) arg_12 = tf . where ( tf . broadcast_to ( arg_7 , tf . shape ( input = arg_12 ) ) , arg_4 . predicted_cov , arg_12 ) arg_14 = tf . where ( tf . broadcast_to ( arg_7 [ ... , 0 , 0 ] , tf . shape ( input = arg_14 ) ) , tf . zeros_like ( arg_14 ) , arg_14 ) arg_15 , arg_16 = kalman_transition ( arg_11 , arg_12 , arg_0 ( arg_4 . timestep ) , arg_1 ( arg_4 . timestep ) ) return KalmanFilterState ( arg_11 , arg_12 , arg_15 , arg_16 , arg_13 . mean ( ) [ ... , tf . newaxis ] , arg_13 . covariance ( ) , arg_14 , arg_4 . timestep + 1 ) return kalman_filter_step

def Func(arg_0,
                             arg_1,
                             arg_2,
                             arg_3):
  """Build a callable that performs one step of Kalman filtering.

  Args:
    get_transition_matrix_for_timestep: callable taking a timestep
      as an integer `Tensor` argument, and returning a `LinearOperator`
      of shape `[latent_size, latent_size]`.
    get_transition_noise_for_timestep: callable taking a timestep as
      an integer `Tensor` argument, and returning a
      `MultivariateNormalLinearOperator` of event shape
      `[latent_size]`.
    get_observation_matrix_for_timestep: callable taking a timestep
      as an integer `Tensor` argument, and returning a `LinearOperator`
      of shape `[observation_size, observation_size]`.
    get_observation_noise_for_timestep: callable taking a timestep as
      an integer `Tensor` argument, and returning a
      `MultivariateNormalLinearOperator` of event shape
      `[observation_size]`.

  Returns:
    kalman_filter_step: a callable that updates a KalmanFilterState
      from timestep `t-1` to `t`.
  """

  def kalman_filter_step(arg_4, arg_5):
    """Run a single step of Kalman filtering.

    Args:
      state: A `KalmanFilterState` object representing the previous
        filter state at time `t-1`.
      elems_t: A tuple of Tensors `(x_t, mask_t)`, or a `Tensor` `x_t`.
        `x_t` is a `Tensor` with rightmost shape dimensions
        `[observation_size, 1]` representing the vector observed at time `t`,
        and `mask_t` is a `Tensor` with rightmost dimensions`[1, 1]`
        representing the observation mask at time `t`. Both `x_t` and `mask_t`
        may have batch dimensions, which must be compatible with the batch
        dimensions of `state.predicted_mean` and `state.predictived_cov`
        respectively. If `mask_t` is not provided, it is assumed to be `None`.

    Returns:
      new_state: A `KalmanFilterState` object representing the new
        filter state at time `t`.
    """

    if isinstance(arg_5, tuple):
      arg_6, arg_7 = arg_5
    else:
      arg_6 = arg_5
      arg_7 = None

    arg_8 = arg_2(arg_4.timestep)
    arg_9 = arg_3(arg_4.timestep)
    if arg_7 is not None:
      # Before running the update, fill in masked observations using the prior
      # expectation. The precise filled value shouldn't matter since updates
      # from masked elements will not be selected below, but we need to ensure
      # that any results we incidently compute on masked values are at least
      # finite (not inf or NaN) so that they don't screw up gradient propagation
      # through `tf.where`, as described in
      #  https://github.com/tensorflow/tensorflow/issues/2540.
      # We fill with the prior expectation because any fixed value such as zero
      # might be arbitrarily unlikely under the prior, leading to overflow in
      # the updates, but the prior expectation should always be a
      # 'reasonable' observation.
      arg_10 = _propagate_mean(arg_4.predicted_mean,
                                   arg_8,
                                   arg_9) * tf.ones_like(arg_6)
      arg_6 = tf.where(
          tf.broadcast_to(arg_7, tf.shape(input=arg_10)), arg_10,
          tf.broadcast_to(arg_6, tf.shape(input=arg_10)))

    # Given predicted mean u_{t|t-1} and covariance P_{t|t-1} from the
    # previous step, incorporate the observation x_t, producing the
    # filtered mean u_t and covariance P_t.
    (arg_11,
     arg_12,
     arg_13) = linear_gaussian_update(
         arg_4.predicted_mean, arg_4.predicted_cov,
         arg_8, arg_9,
         arg_6)

    # Compute the marginal likelihood p(x_{t} | x_{:t-1}) for this
    # observation.
    arg_14 = arg_13.log_prob(arg_6[..., 0])

    if arg_7 is not None:
      arg_11 = tf.where(
          tf.broadcast_to(arg_7, tf.shape(input=arg_11)),
          arg_4.predicted_mean, arg_11)
      arg_12 = tf.where(
          tf.broadcast_to(arg_7, tf.shape(input=arg_12)),
          arg_4.predicted_cov, arg_12)
      arg_14 = tf.where(
          tf.broadcast_to(arg_7[..., 0, 0],
                          tf.shape(input=arg_14)),
          tf.zeros_like(arg_14),
          arg_14)

    # Run the filtered posterior through the transition
    # model to predict the next time step:
    #  u_{t|t-1} = F_t u_{t-1} + b_t
    #  P_{t|t-1} = F_t P_{t-1} F_t' + Q_t
    arg_15, arg_16 = kalman_transition(
        arg_11,
        arg_12,
        arg_0(arg_4.timestep),
        arg_1(arg_4.timestep))

    return KalmanFilterState(
        arg_11, arg_12,
        arg_15, arg_16,
        arg_13.mean()[..., tf.newaxis],
        arg_13.covariance(),
        arg_14,
        arg_4.timestep+1)

  return kalman_filter_step

Build a callable that performs one step of Kalman filtering .


def Func ( arg_0 , arg_1 ) : log . debug ( arg_0 . obj ) arg_2 = lex ( arg_1 ) if arg_0 . peek ( arg_2 , 'operator' ) == '*' : arg_0 . match ( arg_2 , 'operator' ) arg_3 = list ( object_iter ( arg_0 . obj ) ) else : arg_3 = arg_0 . selector_production ( arg_2 ) arg_3 = [ node . value for node in arg_3 ] if len ( arg_3 ) == 1 : return arg_3 [ 0 ] elif not len ( arg_3 ) : return None return arg_3

def Func(arg_0, arg_1):
        """Accept a list of tokens. Returns matched nodes of self.obj."""
        log.debug(arg_0.obj)
        arg_2 = lex(arg_1)

        if arg_0.peek(arg_2, 'operator') == '*':
            arg_0.match(arg_2, 'operator')
            arg_3 = list(object_iter(arg_0.obj))
        else:
            arg_3 = arg_0.selector_production(arg_2)

        arg_3 = [node.value for node in arg_3]
        # single results should be returned as a primitive
        if len(arg_3) == 1:
            return arg_3[0]
        elif not len(arg_3):
            return None
        return arg_3

Accept a list of tokens . Returns matched nodes of self . obj .


def Func ( arg_0 ) : arg_1 = _adsDLL . AdsPortCloseEx arg_1 . restype = ctypes . c_long arg_3 = arg_1 ( arg_0 ) if arg_3 : raise ADSError ( arg_3 )

def Func(arg_0):
    # type: (int) -> None
    """Close the connection to the TwinCAT message router."""
    arg_1 = _adsDLL.AdsPortCloseEx
    arg_1.restype = ctypes.c_long
    arg_3 = arg_1(arg_0)

    if arg_3:
        raise ADSError(arg_3)

Close the connection to the TwinCAT message router .


def Func ( arg_0 , arg_1 ) : if arg_1 : arg_0 . _device . mute_on ( ) else : arg_0 . _device . mute_off ( )

def Func(arg_0, arg_1):
        """Mute the volume."""
        if arg_1:
            arg_0._device.mute_on()
        else:
            arg_0._device.mute_off()


(
    node: astroid.node_classes.NodeNG, context=None
)

def Func ( arg_0 : arg_1 . node_classes . NodeNG , arg_4 = None ) -> Optional [ arg_1 . node_classes . NodeNG ] : try : arg_5 = arg_0 . infer ( arg_4 = arg_4 ) arg_6 = next ( arg_5 ) except arg_1 . InferenceError : return None try : next ( arg_5 ) return None except arg_1 . InferenceError : return None except StopIteration : return arg_6

def Func(
    arg_0: arg_1.node_classes.NodeNG, arg_4=None
) -> Optional[arg_1.node_classes.NodeNG]:
    """Return the inferred value for the given node.

    Return None if inference failed or if there is some ambiguity (more than
    one node has been inferred).
    """
    try:
        arg_5 = arg_0.infer(arg_4=arg_4)
        arg_6 = next(arg_5)
    except arg_1.InferenceError:
        return None
    try:
        next(arg_5)
        return None  # None if there is ambiguity on the inferred node
    except arg_1.InferenceError:
        return None  # there is some kind of ambiguity
    except StopIteration:
        return arg_6

Return the inferred value for the given node .


def
Func
(
arg_0
,
arg_1
)
:
arg_0
.
section
=
0
if
hasattr
(
arg_1
,
"report_id"
)
:
arg_1
.
children
[
0
]
.
children
[
0
]
.
data
+=
" (%s)"
%
arg_1
.
report_id
arg_0
.
_display
(
arg_1
)

def Func(arg_0, arg_1):
        """display results encapsulated in the layout tree"""
        arg_0.section = 0
        if hasattr(arg_1, "report_id"):
            arg_1.children[0].children[0].data += " (%s)" % arg_1.report_id
        arg_0._display(arg_1)


def
Func
(
arg_0
,
arg_1
)
:
if
pexpect
is
:
raise
ImportError
(
"pexpect unavailable, use paramiko"
)
arg_2
=
'ssh -f '
+
arg_0
if
arg_1
:
arg_2
+=
' -i '
+
arg_1
arg_2
+=
' exit'
arg_3
=
pexpect
.
spawn
(
arg_2
)
while
True
:
try
:
arg_3
.
expect
(
'[Pp]assword:'
,
timeout
=
.1
)
except
pexpect
.
TIMEOUT
:
continue
except
pexpect
.
EOF
:
return
True
else
:
return
False

def Func(arg_0, arg_1):
    """Try passwordless login with shell ssh command."""
    if pexpect is None:
        raise ImportError("pexpect unavailable, use paramiko")
    arg_2 = 'ssh -f '+ arg_0
    if arg_1:
        arg_2 += ' -i ' + arg_1
    arg_2 += ' exit'
    arg_3 = pexpect.spawn(arg_2)
    while True:
        try:
            arg_3.expect('[Pp]assword:', timeout=.1)
        except pexpect.TIMEOUT:
            continue
        except pexpect.EOF:
            return True
        else:
            return False

Try passwordless login with shell ssh command .


def Func(arg_0):
        """Initialize all user-visible namespaces to their minimum defaults.

        Certain history lists are also initialized here, as they effectively
        act as user namespaces.

        Notes
        -----
        All data structures here are only filled in, they are NOT reset by this
        method.  If they were not empty before, data will simply be added to
        therm.
        """
        # This function works in two parts: first we put a few things in
        # user_ns, and we sync that contents into user_ns_hidden so that these
        # initial variables aren't shown by %who.  After the sync, we add the
        # rest of what we *do* want the user to see with %who even on a new
        # session (probably nothing, so theye really only see their own stuff)

        # The user dict must *always* have a __builtin__ reference to the
        # Python standard __builtin__ namespace,  which must be imported.
        # This is so that certain operations in prompt evaluation can be
        # reliably executed with builtins.  Note that we can NOT use
        # __builtins__ (note the 's'),  because that can either be a dict or a
        # module, and can even mutate at runtime, depending on the context
        # (Python makes no guarantees on it).  In contrast, __builtin__ is
        # always a module object, though it must be explicitly imported.

        # For more details:
        # http://mail.python.org/pipermail/python-dev/2001-April/014068.html
        arg_1 = dict()

        # Put 'help' in the user namespace
        try:
            from site import _Helper
            arg_1['help'] = _Helper()
        except ImportError:
            warn('help() not available - check site.py')

        # make global variables for user access to the histories
        arg_1['_ih'] = arg_0.history_manager.input_hist_parsed
        arg_1['_oh'] = arg_0.history_manager.output_hist
        arg_1['_dh'] = arg_0.history_manager.dir_hist

        arg_1['_sh'] = shadowns

        # user aliases to input and output histories.  These shouldn't show up
        # in %who, as they can have very large reprs.
        arg_1['In']  = arg_0.history_manager.input_hist_parsed
        arg_1['Out'] = arg_0.history_manager.output_hist

        # Store myself as the public api!!!
        arg_1['get_ipython'] = arg_0.get_ipython

        arg_1['exit'] = arg_0.exiter
        arg_1['quit'] = arg_0.exiter

        # Sync what we've added so far to user_ns_hidden so these aren't seen
        # by %who
        arg_0.user_ns_hidden.update(arg_1)

        # Anything put into ns now would show up in %who.  Think twice before
        # putting anything here, as we really want %who to show the user their
        # stuff, not our variables.

        # Finally, update the real user's namespace
        arg_0.user_ns.update(arg_1)

Initialize all user - visible namespaces to their minimum defaults .


def Func ( arg_0 , arg_1 ) : if isinstance ( arg_1 , models . Model ) : return arg_0 . encode ( model_to_dict ( arg_1 ) ) elif isinstance ( arg_1 , models . query . QuerySet ) : return serializers . serialize ( 'json' , arg_1 ) else : return super ( JsonResponseEncoder , arg_0 ) . Func ( arg_1 )

def Func(arg_0, arg_1):
        """
        Convert QuerySet objects to their list counter-parts
        """
        if isinstance(arg_1, models.Model):
            return arg_0.encode(model_to_dict(arg_1))
        elif isinstance(arg_1, models.query.QuerySet):
            return serializers.serialize('json', arg_1)
        else:
            return super(JsonResponseEncoder, arg_0).Func(arg_1)

Convert QuerySet objects to their list counter - parts


return self.driver_adapter.is_element_present(strategy, locator, root=self.root)

def Func ( arg_0 , arg_1 , arg_2 ) : return arg_0 . driver_adapter . Func ( arg_1 , arg_2 , root = arg_0 . root )

def Func(arg_0, arg_1, arg_2):
        """Checks whether an element is present.

        :param strategy: Location strategy to use. See :py:class:`~selenium.webdriver.common.by.By` or :py:attr:`~pypom.splinter_driver.ALLOWED_STRATEGIES`.
        :param locator: Location of target element.
        :type strategy: str
        :type locator: str
        :return: ``True`` if element is present, else ``False``.
        :rtype: bool

        """
        return arg_0.driver_adapter.Func(arg_1, arg_2, root=arg_0.root)


def
Func
(
arg_0
,
arg_1
=
'config'
)
:
if
arg_0
[
arg_1
]
.
create
or
arg_0
[
arg_1
]
.
update
:
arg_0
.
create_config_
(
update
=
arg_0
[
arg_1
]
.
update
)
if
arg_0
[
arg_1
]
.
create_local
:
arg_0
.
create_config_
(
index
=
1
,
update
=
arg_0
[
arg_1
]
.
update
)
if
arg_0
[
arg_1
]
.
edit
:
if
not
arg_0
.
config_files_
[
0
]
.
is_file
(
)
:
arg_0
.
create_config_
(
update
=
arg_0
[
arg_1
]
.
update
)
subprocess
.
call
(
shlex
.
split
(
'{} {}'
.
format
(
arg_0
[
arg_1
]
.
editor
,
arg_0
.
config_files_
[
0
]
)
)
)

def Func(arg_0, arg_1='config'):
    """Implement the behavior of a subcmd using config_conf_section

    Args:
        conf (:class:`~loam.manager.ConfigurationManager`): it should contain a
            section created with :func:`config_conf_section` function.
        config (str): name of the configuration section created with
            :func:`config_conf_section` function.
    """
    if arg_0[arg_1].create or arg_0[arg_1].update:
        arg_0.create_config_(update=arg_0[arg_1].update)
    if arg_0[arg_1].create_local:
        arg_0.create_config_(index=-1, update=arg_0[arg_1].update)
    if arg_0[arg_1].edit:
        if not arg_0.config_files_[0].is_file():
            arg_0.create_config_(update=arg_0[arg_1].update)
        subprocess.call(shlex.split('{} {}'.format(arg_0[arg_1].editor,
                                                   arg_0.config_files_[0])))