def
Func
(
arg_0
)
:
arg_1
=
time
.
time
(
)
arg_2
=
os
.
path
.
join
(
arg_0
.
dirs
.
outfiles
,
"tmp-{}.h5"
.
format
(
arg_0
.
name
)
)
with
h5py
.
File
(
arg_2
,
'r'
)
as
io5
:
arg_3
=
io5
[
"maparr"
]
[
:
]
arg_4
=
np
.
where
(
np
.
all
(
arg_3
[
:
]
==
0
,
axis
=
1
)
)
[
0
]
if
np
.
any
(
arg_4
)
:
arg_4
=
arg_4
.
min
(
)
else
:
arg_4
=
arg_3
.
shape
[
0
]
arg_5
=
[
]
with
open
(
arg_0
.
outfiles
.
snpsmap
,
'w'
)
as
out
:
for
arg_6
in
xrange
(
arg_4
)
:
arg_7
=
arg_3
[
arg_6
,
:
]
arg_5
.
append
(
"{}\trad{}_snp{}\t{}\t{}\n"
.
format
(
arg_7
[
0
]
,
arg_7
[
1
]
,
arg_7
[
2
]
,
0
,
arg_7
[
3
]
)
)
if
not
arg_6
%
10000
:
out
.
write
(
""
.
join
(
arg_5
)
)
arg_5
=
[
]
out
.
write
(
""
.
join
(
arg_5
)
)
LOGGER
.
debug
(
"finished writing snps_map in: %s"
,
time
.
time
(
)
arg_1
)

def Func(arg_0):
    """ write a map file with linkage information for SNPs file"""

    ## grab map data from tmparr
    arg_1 = time.time()
    arg_2 = os.path.join(arg_0.dirs.outfiles, "tmp-{}.h5".format(arg_0.name))
    with h5py.File(arg_2, 'r') as io5:
        arg_3 = io5["maparr"][:]

        ## get last data
        arg_4 = np.where(np.all(arg_3[:] == 0, axis=1))[0]
        if np.any(arg_4):
            arg_4 = arg_4.min()
        else:
            arg_4 = arg_3.shape[0]

        ## write to map file (this is too slow...)
        arg_5 = []
        with open(arg_0.outfiles.snpsmap, 'w') as out:
            for arg_6 in xrange(arg_4):
                ## build to list
                arg_7 = arg_3[arg_6, :]
                #print(line)
                arg_5.append(\
                    "{}\trad{}_snp{}\t{}\t{}\n"\
                    .format(arg_7[0], arg_7[1], arg_7[2], 0, arg_7[3]))
                ## clear list
                if not arg_6 % 10000:
                    out.write("".join(arg_5))
                    arg_5 = []
            ## write remaining
            out.write("".join(arg_5))
    LOGGER.debug("finished writing snps_map in: %s", time.time() - arg_1)


def Func ( arg_0 ) : arg_1 = arg_0 . get_data ( "firewalls" ) arg_2 = list ( ) for arg_3 in arg_1 [ 'firewalls' ] : arg_4 = Firewall ( ** arg_3 ) arg_4 . token = arg_0 . token arg_6 = list ( ) for arg_7 in arg_3 [ 'inbound_rules' ] : arg_6 . append ( InboundRule ( ** arg_7 ) ) arg_4 . inbound_rules = arg_6 arg_9 = list ( ) for arg_7 in arg_3 [ 'outbound_rules' ] : arg_9 . append ( OutboundRule ( ** arg_7 ) ) arg_4 . outbound_rules = arg_9 arg_2 . append ( arg_4 ) return arg_2

def Func(arg_0):
        """
            This function returns a list of Firewall objects.
        """
        arg_1 = arg_0.get_data("firewalls")
        arg_2 = list()
        for arg_3 in arg_1['firewalls']:
            arg_4 = Firewall(**arg_3)
            arg_4.token = arg_0.token
            arg_6 = list()
            for arg_7 in arg_3['inbound_rules']:
                arg_6.append(InboundRule(**arg_7))
            arg_4.inbound_rules = arg_6
            arg_9 = list()
            for arg_7 in arg_3['outbound_rules']:
                arg_9.append(OutboundRule(**arg_7))
            arg_4.outbound_rules = arg_9
            arg_2.append(arg_4)
        return arg_2

This function returns a list of Firewall objects .


return cls.from_file(file, *args, **kwargs)

def Func ( arg_0 , * arg_1 , ** arg_2 ) : arg_3 = os . path . join ( Cache . cache_dir , Cache . cache_name ) return arg_0 . from_file ( arg_3 , * arg_1 , ** arg_2 )

def Func(arg_0, *arg_1, **arg_2):
        """Make a guess about the cache file location an try loading it."""
        arg_3 = os.path.join(Cache.cache_dir, Cache.cache_name)
        return arg_0.from_file(arg_3, *arg_1, **arg_2)

Make a guess about the cache file location an try loading it .


def Func(arg_0, arg_1):
    """
    Construct a _HTMClassificationRecord based on the state of the model
    passed in through the inputs.

    Types for self.classificationVectorType:
      1 - TM active cells in learn state
      2 - SP columns concatenated with error from TM column predictions and SP
    """
    # Count the number of unpredicted columns
    arg_2 = arg_1["spBottomUpOut"]
    arg_3 = arg_2.nonzero()[0]

    arg_4 = anomaly.computeRawAnomalyScore(arg_3,
                                           arg_0._prevPredictedColumns)

    arg_5 = len(arg_2)

    arg_6 = arg_1['tpTopDownOut']
    arg_7 = len(arg_1['tpLrnActiveStateT'])

    arg_8 = arg_11.array([])

    if arg_0.classificationVectorType == 1:
      # Classification Vector: [---TM Cells---]
      arg_8 = arg_11.zeros(arg_7)
      arg_9 = arg_1["tpLrnActiveStateT"].reshape(arg_7, 1)
      arg_10 = arg_11.where(arg_9 > 0)[0]
      if arg_10.shape[0] > 0:
        arg_8[arg_11.array(arg_10, arg_13=arg_11.uint16)] = 1
    elif arg_0.classificationVectorType == 2:
      # Classification Vecotr: [---SP---|---(TM-SP)----]
      arg_8 = arg_11.zeros(arg_5+arg_5)
      if arg_3.shape[0] > 0:
        arg_8[arg_3] = 1.0

      arg_15 = arg_11.setdiff1d(arg_0._prevPredictedColumns,
          arg_3)
      if arg_15.shape[0] > 0:
        arg_16 = ( arg_11.array(arg_15, arg_13=arg_11.uint16) +
          arg_5 )
        arg_8[arg_16] = 1.0
    else:
      raise TypeError("Classification vector type must be either 'tpc' or"
        " 'sp_tpe', current value is %s" % (arg_0.classificationVectorType))

    # Store the state for next time step
    arg_17 = len(arg_0._prevPredictedColumns)
    arg_18 = arg_6.nonzero()[0]
    arg_0._prevPredictedColumns = copy.deepcopy(arg_18)

    if arg_0._anomalyVectorLength is None:
      arg_0._anomalyVectorLength = len(arg_8)

    arg_21 = _CLAClassificationRecord(
      ROWID=arg_0._iteration, #__numRunCalls called
        #at beginning of model.run
      anomalyScore=arg_4,
      anomalyVector=arg_8.nonzero()[0].tolist(),
      anomalyLabel=[]
    )
    return arg_21

Construct a _HTMClassificationRecord based on the state of the model passed in through the inputs .


def Func ( arg_0 ) : arg_1 = "[" + arg_0 . replace ( "\n" , "," ) + "]" arg_1 = arg_1 . replace ( ",]" , "]" ) arg_2 = json . loads ( arg_1 ) arg_3 = [ ] for arg_4 in arg_2 : if 'project' in arg_4 . keys ( ) : arg_3 . append ( arg_4 ) return arg_3

def Func(arg_0):
        """Parse a Gerrit reviews list."""

        # Join isolated reviews in JSON in array for parsing
        arg_1 = "[" + arg_0.replace("\n", ",") + "]"
        arg_1 = arg_1.replace(",]", "]")
        arg_2 = json.loads(arg_1)
        arg_3 = []

        for arg_4 in arg_2:
            if 'project' in arg_4.keys():
                arg_3.append(arg_4)

        return arg_3


def Func ( arg_0 , arg_1 ) : if not ( inspect . isfunction ( arg_1 ) or inspect . ismethod ( arg_1 ) ) : if inspect . isclass ( arg_1 ) : arg_1 = ( getattr ( arg_1 , '__init__' , None ) or getattr ( arg_1 , '__new__' , None ) ) elif hasattr ( arg_1 , '__call__' ) : arg_1 = arg_1 . __call__ try : arg_2 , arg_3 , arg_4 , arg_5 = inspect . getargspec ( arg_1 ) if arg_5 : return arg_2 [ - len ( arg_5 ) : ] except TypeError : pass return [ ]

def Func(arg_0, arg_1):
        """Return the list of default arguments of obj if it is callable,
        or empty list otherwise."""

        if not (inspect.isfunction(arg_1) or inspect.ismethod(arg_1)):
            # for classes, check for __init__,__new__
            if inspect.isclass(arg_1):
                arg_1 = (getattr(arg_1,'__init__',None) or
                       getattr(arg_1,'__new__',None))
            # for all others, check if they are __call__able
            elif hasattr(arg_1, '__call__'):
                arg_1 = arg_1.__call__
            # XXX: is there a way to handle the builtins ?
        try:
            arg_2,arg_3,arg_4,arg_5 = inspect.getargspec(arg_1)
            if arg_5:
                return arg_2[-len(arg_5):]
        except TypeError: pass
        return []

Return the list of default arguments of obj if it is callable or empty list otherwise .


def Func ( arg_0 , arg_1 , arg_2 ) : return arg_0 . query . filter_by ( arg_1 = arg_1 , arg_2 = arg_2 ) . first ( )

def Func(arg_0, arg_1, arg_2):
        """Get the Grant object with the given client ID and code

        :param client_id: ID of the client
        :param code:
        """
        return arg_0.query.filter_by(arg_1=arg_1, arg_2=arg_2).first()


def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
)
:
arg_4
=
ConsensusManager
.
round_timeout
assert
arg_4
>
0
print
"in slow transport Func"
super
(
SlowTransport
,
arg_0
)
.
Func
(
arg_1
,
arg_2
,
arg_3
,
add_delay
=
arg_4
)

def Func(arg_0, arg_1, arg_2, arg_3):
        "Func on edge of timeout_window"
        arg_4 = ConsensusManager.round_timeout
        assert arg_4 > 0
        print "in slow transport Func"
        super(SlowTransport, arg_0).Func(arg_1, arg_2, arg_3, add_delay=arg_4)


(x, idx=0, device=None, nh=20, **kwargs)

def Func ( arg_0 , arg_1 = 0 , arg_2 = None , arg_3 = 20 , ** arg_4 ) : arg_2 = SETTINGS . get_default ( arg_2 = arg_2 ) arg_5 = scale ( arg_0 ) . astype ( 'float32' ) arg_6 = th . FloatTensor ( arg_5 [ : , [ 0 ] ] ) . to ( arg_2 ) arg_7 = th . FloatTensor ( arg_5 [ : , [ 1 ] ] ) . to ( arg_2 ) arg_8 = GNN_model ( arg_0 . shape [ 0 ] , arg_2 = arg_2 , arg_3 = arg_3 ) . to ( arg_2 ) arg_9 = GNN_model ( arg_0 . shape [ 0 ] , arg_2 = arg_2 , arg_3 = arg_3 ) . to ( arg_2 ) arg_8 . reset_parameters ( ) arg_9 . reset_parameters ( ) arg_10 = arg_8 . run ( arg_6 , arg_7 , ** arg_4 ) arg_11 = arg_9 . run ( arg_7 , arg_6 , ** arg_4 ) return [ arg_10 , arg_11 ]

def Func(arg_0, arg_1=0, arg_2=None, arg_3=20, **arg_4):
    """Run an instance of GNN, testing causal direction.

    :param m: data corresponding to the config : (N, 2) data, [:, 0] cause and [:, 1] effect
    :param pair_idx: print purposes
    :param run: numner of the run (for GPU dispatch)
    :param device: device on with the algorithm is going to be run on.
    :return:
    """
    arg_2 = SETTINGS.get_default(arg_2=arg_2)
    arg_5 = scale(arg_0).astype('float32')
    arg_6 = th.FloatTensor(arg_5[:, [0]]).to(arg_2)
    arg_7 = th.FloatTensor(arg_5[:, [1]]).to(arg_2)
    arg_8 = GNN_model(arg_0.shape[0], arg_2=arg_2, arg_3=arg_3).to(arg_2)
    arg_9 = GNN_model(arg_0.shape[0], arg_2=arg_2, arg_3=arg_3).to(arg_2)
    arg_8.reset_parameters()
    arg_9.reset_parameters()
    arg_10 = arg_8.run(arg_6, arg_7, **arg_4)
    arg_11 = arg_9.run(arg_7, arg_6, **arg_4)

    return [arg_10, arg_11]

Run an instance of GNN testing causal direction .


def Func(arg_0, arg_1=None):
        """Fetch the pages from the backend url for MediaWiki >=1.27

        The method retrieves, from a MediaWiki url, the
        wiki pages.

        :returns: a generator of pages
        """

        logger.info("Looking for pages at url '%s'", arg_0.url)

        arg_2 = 0  # number of pages processed
        arg_3 = 0  # number of total pages
        arg_4 = []  # pages already retrieved in reviews API

        arg_5 = arg_0.__get_namespaces_contents()

        arg_6 = ''  # pagination for getting revisions and their pages
        while arg_6 is not None:
            arg_7 = arg_0.client.get_pages_from_allrevisions(arg_5, arg_1, arg_6)
            arg_8 = json.loads(arg_7)
            arg_6 = arg_8['continue']['arvcontinue'] if 'continue' in arg_8 else None
            arg_9 = arg_8['query']['allrevisions']
            for arg_10 in arg_9:

                if arg_10['pageid'] in arg_4:
                    logger.debug("Page %s already processed; skipped", arg_10['pageid'])
                    continue

                arg_3 += 1
                arg_4.append(arg_10['pageid'])
                arg_11 = arg_0.__get_page_reviews(arg_10)

                if not arg_11:
                    logger.warning("Revisions not found in %s [page id: %s], page skipped",
                                   arg_10['title'], arg_10['pageid'])
                    continue

                yield arg_11
                arg_2 += 1

        logger.info("Total number of pages: %i, skipped %i", arg_3, arg_3 - arg_2)

Fetch the pages from the backend url for MediaWiki > = 1 . 27


def
Func
(
arg_0
,
arg_1
)
:
if
arg_1
.
v_comment
==
''
:
return
False
arg_2
=
arg_1
.
v_branch
arg_3
=
True
arg_4
=
arg_1
.
v_comment
.
encode
(
'utf-8'
)
arg_5
=
hashlib
.
sha1
(
arg_4
)
.
hexdigest
(
)
arg_5
=
arg_5
.
encode
(
'utf-8'
)
arg_6
=
arg_2
+
'_summary'
if
arg_6
in
arg_0
.
_overview_group
:
arg_7
=
getattr
(
arg_0
.
_overview_group
,
arg_6
)
else
:
return
arg_3
try
:
arg_8
=
{
'hexdigestcol'
:
arg_7
.
cols
.
hexdigest
,
'hexdigest'
:
arg_5
}
arg_9
=
"""(hexdigestcol == hexdigest)"""
arg_10
=
arg_7
.
where
(
arg_9
,
arg_8
=
arg_8
)
arg_11
=
try
:
arg_11
=
next
(
arg_10
)
except
StopIteration
:
pass
if
arg_11
is
:
arg_0
.
_all_store_param_or_result_table_entry
(
arg_1
,
arg_7
,
flags
=
(
HDF5StorageService
.
ADD_ROW
,
)
,
additional_info
=
{
'hexdigest'
:
arg_5
}
)
arg_3
=
True
else
:
arg_3
=
False
arg_0
.
_all_kill_iterator
(
arg_10
)
except
pt
.
NoSuchNodeError
:
arg_3
=
True
return
arg_3

def Func(arg_0, arg_1):
        """Adds data to the summary tables and returns if `instance`s comment has to be stored.

        Also moves comments upwards in the hierarchy if purge_duplicate_comments is true
        and a lower index run has completed. Only necessary for *multiprocessing*.

        :return: Tuple

            * String specifying the subtree

            * Boolean whether to store the comment to `instance`s hdf5 node

        """
        if arg_1.v_comment == '':
            return False

        arg_2 = arg_1.v_branch
        arg_3 = True

        # Get the hexdigest of the comment to see if such a comment has been stored before
        arg_4 = arg_1.v_comment.encode('utf-8')
        arg_5 = hashlib.sha1(arg_4).hexdigest()
        arg_5 = arg_5.encode('utf-8')

        # Get the overview table
        arg_6 = arg_2 + '_summary'

        # Check if the overview table exists, otherwise skip the rest of
        # the meta adding
        if arg_6 in arg_0._overview_group:
            arg_7 = getattr(arg_0._overview_group, arg_6)
        else:
            return arg_3

        try:
            arg_8 = {'hexdigestcol': arg_7.cols.hexdigest,
                'hexdigest': arg_5}

            arg_9 = """(hexdigestcol == hexdigest)"""

            arg_10 = arg_7.where(arg_9, arg_8=arg_8)

            arg_11 = None
            try:
                arg_11 = next(arg_10)
            except StopIteration:
                pass

            if arg_11 is None:
                arg_0._all_store_param_or_result_table_entry(arg_1, arg_7,
                                                            flags=(
                                                                HDF5StorageService.ADD_ROW,),
                                                            additional_info={
                                                                'hexdigest': arg_5})

                arg_3 = True
            else:
                arg_3 = False
                arg_0._all_kill_iterator(arg_10)

        except pt.NoSuchNodeError:
            arg_3 = True

        return arg_3

Adds data to the summary tables and returns if instance s comment has to be stored .


def Func ( arg_0 ) : arg_1 = arg_0 . record . get ( 'other_config' ) . get ( 'nicira-iface-id' ) if arg_1 : return True return False

def Func(arg_0):
    """Determine if a vif is on isonet

    Returns True if a vif belongs to an isolated network by checking
    for a nicira interface id.
    """
    arg_1 = arg_0.record.get('other_config').get('nicira-iface-id')

    if arg_1:
        return True

    return False


return (
            (self.nick_re, self.new_nick),
            (self.nick_change_re, self.handle_nick_change),
            (self.ping_re, self.handle_ping),
            (self.part_re, self.handle_part),
            (self.join_re, self.handle_join),
            (self.quit_re, self.handle_quit),
            (self.chanmsg_re, self.handle_channel_message),
            (self.privmsg_re, self.handle_private_message),
            (self.registered_re, self.handle_registered),
        )

def Func(arg_0):
        """\
        Low-level dispatching of socket data based on regex matching, in general
        handles

        * In event a nickname is taken, registers under a different one
        * Responds to periodic PING messages from server
        * Dispatches to registered callbacks when
            - any user leaves or enters a room currently connected to
            - a channel message is observed
            - a private message is received
        """
        return (
            (arg_0.nick_re, arg_0.new_nick),
            (arg_0.nick_change_re, arg_0.handle_nick_change),
            (arg_0.ping_re, arg_0.handle_ping),
            (arg_0.part_re, arg_0.handle_part),
            (arg_0.join_re, arg_0.handle_join),
            (arg_0.quit_re, arg_0.handle_quit),
            (arg_0.chanmsg_re, arg_0.handle_channel_message),
            (arg_0.privmsg_re, arg_0.handle_private_message),
            (arg_0.registered_re, arg_0.handle_registered),
        )

\ Low - level dispatching of socket data based on regex matching in general handles


def
Func
(
arg_0
,
arg_1
)
:
print
"powering off"
arg_0
.
power_off
(
)
arg_0
.
wait
(
)
print
"taking snapshot"
arg_0
.
Func
(
arg_1
)
arg_0
.
wait
(
)
arg_2
=
arg_0
.
snapshots
(
)
print
"Current snapshots"
print
arg_2

def Func(arg_0, arg_1):
    """
    Take a snapshot of a droplet

    Parameters
    ----------
    name: str
        name for snapshot
    """
    print "powering off"
    arg_0.power_off()
    arg_0.wait() # wait for pending actions to complete
    print "taking snapshot"
    arg_0.Func(arg_1)
    arg_0.wait()
    arg_2 = arg_0.snapshots()
    print "Current snapshots"
    print arg_2


def Func ( arg_0 ) : if arg_0 . provider . lock_manager is None : return False return arg_0 . provider . lock_manager . is_url_locked ( arg_0 . get_ref_url ( ) )

def Func(arg_0):
        """Return True, if URI is locked."""
        if arg_0.provider.lock_manager is None:
            return False
        return arg_0.provider.lock_manager.is_url_locked(arg_0.get_ref_url())


def Func ( arg_0 , arg_1 , arg_2 ) : for arg_3 in arg_0 . keys ( ) : if arg_3 . startswith ( "detection" ) : arg_4 = arg_0 [ arg_3 ] for arg_5 in arg_4 : arg_5 . move_image ( - arg_2 , - arg_1 )

def Func(arg_0, arg_1, arg_2):
    """
    Move detections in direction dx, dy.

    :param label: The label dict containing all detection lists.
    :param dy: The delta in y direction as a number.
    :param dx: The delta in x direction as a number.
    :return:
    """
    for arg_3 in arg_0.keys():
        if arg_3.startswith("detection"):
            arg_4 = arg_0[arg_3]
            for arg_5 in arg_4:
                arg_5.move_image(-arg_2, -arg_1)


def Func ( arg_0 , arg_1 , arg_2 ) : if len ( arg_0 ) != len ( arg_1 ) : return False for arg_3 , arg_4 in zip ( arg_0 , arg_1 ) : if not arg_2 ( arg_3 , arg_4 ) : return False return True

def Func(arg_0, arg_1, arg_2):
    """Compare twolists using given comparing function.

    :param list1: first list to compare
    :param list2: second list to compare
    :param custom_cmp: a function taking two arguments (element of
        list 1, element of list 2) and
    :return: True or False depending if the values are the same
    """
    if len(arg_0) != len(arg_1):
        return False
    for arg_3, arg_4 in zip(arg_0, arg_1):
        if not arg_2(arg_3, arg_4):
            return False
    return True

Compare twolists using given comparing function .


def Func ( arg_0 , arg_1 ) : arg_2 = dict ( arg_1 ) for arg_3 in arg_0 : if arg_3 in arg_1 : if isinstance ( arg_0 [ arg_3 ] , dict ) and isinstance ( arg_1 [ arg_3 ] , dict ) : arg_2 [ arg_3 ] = Func ( arg_0 [ arg_3 ] , arg_1 [ arg_3 ] ) else : arg_2 [ arg_3 ] = arg_0 [ arg_3 ] return arg_2

def Func(arg_0, arg_1):
    """Recursively merge two dictionaries, with the elements from `top`
    taking precedence over elements from `top`.

    Returns
    -------
    out : dict
        A new dict, containing the merged records.
    """
    arg_2 = dict(arg_1)
    for arg_3 in arg_0:
        if arg_3 in arg_1:
            if isinstance(arg_0[arg_3], dict) and isinstance(arg_1[arg_3], dict):
                arg_2[arg_3] = Func(arg_0[arg_3], arg_1[arg_3])
        else:
            arg_2[arg_3] = arg_0[arg_3]
    return arg_2

Recursively merge two dictionaries with the elements from top taking precedence over elements from top .


(ctx, metrics, declarations, independent, group, query, sort, page)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
,
arg_5
,
arg_6
,
arg_7
)
:
arg_8
,
arg_9
=
get_project_or_local
(
arg_0
.
obj
.
get
(
'project'
)
)
arg_7
=
arg_7
or
1
try
:
arg_10
=
PolyaxonClient
(
)
.
project
.
list_Func
(
username
=
arg_8
,
arg_9
=
arg_9
,
arg_3
=
arg_3
,
arg_4
=
arg_4
,
arg_1
=
arg_1
,
arg_2
=
arg_2
,
arg_5
=
arg_5
,
arg_6
=
arg_6
,
arg_7
=
arg_7
)
except
(
PolyaxonHTTPError
,
PolyaxonShouldExitError
,
PolyaxonClientException
)
as
e
:
Printer
.
print_error
(
'Could not get Func for project `{}`.'
.
format
(
arg_9
)
)
Printer
.
print_error
(
'Error message `{}`.'
.
format
(
e
)
)
sys
.
exit
(
1
)
arg_11
=
get_meta_response
(
arg_10
)
if
arg_11
:
Printer
.
print_header
(
'Experiments for project `{}/{}`.'
.
format
(
arg_8
,
arg_9
)
)
Printer
.
print_header
(
'Navigation:'
)
dict_tabulate
(
arg_11
)
else
:
Printer
.
print_header
(
'No Func found for project `{}/{}`.'
.
format
(
arg_8
,
arg_9
)
)
if
arg_1
:
arg_12
=
get_Func_with_metrics
(
arg_10
)
elif
arg_2
:
arg_12
=
get_Func_with_declarations
(
arg_10
)
else
:
arg_12
=
[
Printer
.
add_status_color
(
o
.
to_light_dict
(
humanize_values
=
True
)
)
for
o
in
arg_10
[
'results'
]
]
arg_12
=
list_dicts_to_tabulate
(
arg_12
)
if
arg_12
:
Printer
.
print_header
(
"Experiments:"
)
arg_12
.
pop
(
'project_name'
,
)
dict_tabulate
(
arg_12
,
is_list_dict
=
True
)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6, arg_7):
    """List Func for this project.

    Uses [Caching](/references/polyaxon-cli/#caching)

    Examples:

    Get all Func:

    \b
    ```bash
    $ polyaxon project Func
    ```

    Get all Func with with status {created or running}, and
    creation date between 2018-01-01 and 2018-01-02, and declarations activation equal to sigmoid
    and metric loss less or equal to 0.2

    \b
    ```bash
    $ polyaxon project Func \
      -q "status:created|running, started_at:2018-01-01..2018-01-02, \
          declarations.activation:sigmoid, metric.loss:<=0.2"
    ```

    Get all Func sorted by update date

    \b
    ```bash
    $ polyaxon project Func -s "-updated_at"
    ```
    """
    arg_8, arg_9 = get_project_or_local(arg_0.obj.get('project'))

    arg_7 = arg_7 or 1
    try:
        arg_10 = PolyaxonClient().project.list_Func(username=arg_8,
                                                             arg_9=arg_9,
                                                             arg_3=arg_3,
                                                             arg_4=arg_4,
                                                             arg_1=arg_1,
                                                             arg_2=arg_2,
                                                             arg_5=arg_5,
                                                             arg_6=arg_6,
                                                             arg_7=arg_7)
    except (PolyaxonHTTPError, PolyaxonShouldExitError, PolyaxonClientException) as e:
        Printer.print_error('Could not get Func for project `{}`.'.format(arg_9))
        Printer.print_error('Error message `{}`.'.format(e))
        sys.exit(1)

    arg_11 = get_meta_response(arg_10)
    if arg_11:
        Printer.print_header('Experiments for project `{}/{}`.'.format(arg_8, arg_9))
        Printer.print_header('Navigation:')
        dict_tabulate(arg_11)
    else:
        Printer.print_header('No Func found for project `{}/{}`.'.format(arg_8, arg_9))

    if arg_1:
        arg_12 = get_Func_with_metrics(arg_10)
    elif arg_2:
        arg_12 = get_Func_with_declarations(arg_10)
    else:
        arg_12 = [Printer.add_status_color(o.to_light_dict(humanize_values=True))
                   for o in arg_10['results']]
    arg_12 = list_dicts_to_tabulate(arg_12)
    if arg_12:
        Printer.print_header("Experiments:")
        arg_12.pop('project_name', None)
        dict_tabulate(arg_12, is_list_dict=True)

List experiments for this project.

    Uses [Caching](/references/polyaxon-cli/#caching)

    Examples:

    Get all experiments:

    \b
    ```bash
    $ polyaxon project experiments
    ```

    Get all experiments with with status {created or running}, and
    creation date between 2018-01-01 and 2018-01-02, and declarations activation equal to sigmoid
    and metric loss less or equal to 0.2

    \b
    ```bash
    $ polyaxon project experiments \
      -q "status:created|running, started_at:2018-01-01..2018-01-02, \
          declarations.activation:sigmoid, metric.loss:<=0.2"
    ```

    Get all experiments sorted by update date

    \b
    ```bash
    $ polyaxon project experiments -s "-updated_at"
    ```


(table, *, padding=DEFAULT_PADDING, divider='|', header_div='-')

def Func(arg_0, *, arg_1=arg_2, arg_3='|', arg_4='-'):
    """
    Convert a 2D array of items into a Markdown table.

    padding: the number of padding spaces on either side of each divider
    divider: the vertical divider to place between columns
    header_div: the horizontal divider to place between the header row and
        body cells
    """
    arg_0 = normalize_cols(arg_0)
    arg_0 = pad_cells(arg_0)
    arg_5 = arg_0[0]
    arg_6 = arg_0[1:]

    arg_7 = [len(cell) for cell in arg_5]
    arg_8 = horiz_div(arg_7, arg_4, arg_3, arg_1)

    arg_5 = add_dividers(arg_5, arg_3, arg_1)
    arg_6 = [add_dividers(row, arg_3, arg_1) for row in arg_6]

    arg_0 = [arg_5, arg_8]
    arg_0.extend(arg_6)
    arg_0 = [row.rstrip() for row in arg_0]
    return '\n'.join(arg_0)

Convert a 2D array of items into a Markdown table .


(self, longitude, latitude, altitude=None)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None ) : arg_4 = PROJ ( arg_1 , arg_2 ) if arg_3 is not None : arg_4 = transform ( PROJ , geocentric , arg_4 [ 0 ] , arg_4 [ 1 ] , arg_3 ) arg_5 = numpy . array ( arg_4 ) arg_5 = arg_5 / arg_0 . scale return arg_5 . astype ( int )

def Func(arg_0, arg_1, arg_2, arg_3=None):
    """
    Returns coordinate for given GPS position.

    :param: longitude (float) Longitude of position
    :param: latitude (float) Latitude of position
    :param: altitude (float) Altitude of position
    :returns: (numpy.array) Coordinate that the given GPS position
                          maps to
    """
    arg_4 = PROJ(arg_1, arg_2)

    if arg_3 is not None:
      arg_4 = transform(PROJ, geocentric, arg_4[0], arg_4[1], arg_3)

    arg_5 = numpy.array(arg_4)
    arg_5 = arg_5 / arg_0.scale
    return arg_5.astype(int)

Returns coordinate for given GPS position .


def
Func
(
arg_0
,
arg_1
=
True
)
:
if
arg_1
and
not
is_dot
(
arg_0
)
:
raise
ValueError
(
'Func: invalid IP: "%s"'
%
arg_0
)
arg_2
=
str
(
arg_0
)
.
split
(
'.'
)
arg_3
=
0
arg_3
|=
int
(
arg_2
[
0
]
)
<<
24
arg_3
|=
int
(
arg_2
[
1
]
)
<<
16
arg_3
|=
int
(
arg_2
[
2
]
)
<<
8
arg_3
|=
int
(
arg_2
[
3
]
)
return
arg_3

def Func(arg_0, arg_1=True):
    """Dotted decimal notation to decimal conversion."""
    if arg_1 and not is_dot(arg_0):
        raise ValueError('Func: invalid IP: "%s"' % arg_0)
    arg_2 = str(arg_0).split('.')
    arg_3 = 0
    arg_3 |= int(arg_2[0]) << 24
    arg_3 |= int(arg_2[1]) << 16
    arg_3 |= int(arg_2[2]) << 8
    arg_3 |= int(arg_2[3])
    return arg_3

Dotted decimal notation to decimal conversion .


def Func ( arg_0 , arg_1 , arg_2 ) : if arg_0 . link is None : arg_0 . link = arg_1 . find_requirement ( arg_0 , arg_2 )

def Func(arg_0, arg_1, arg_2):
        """Ensure that if a link can be found for this, that it is found.

        Note that self.link may still be None - if Upgrade is False and the
        requirement is already installed.
        """
        if arg_0.link is None:
            arg_0.link = arg_1.find_requirement(arg_0, arg_2)

Ensure that if a link can be found for this that it is found .


def Func ( arg_0 ) : arg_1 = StringIO . StringIO ( ) arg_1 . write ( '"' ) for arg_2 in arg_0 : if arg_2 in _ESCAPES : arg_1 . write ( _ESCAPES [ arg_2 ] ) elif arg_2 in _SIMPLE_CHARS : arg_1 . write ( arg_2 ) else : arg_1 . write ( r'\x{:02x}' . format ( ord ( arg_2 ) ) ) arg_1 . write ( '"' ) return arg_1 . getvalue ( )

def Func(arg_0):
  """Returns value as a valid Go string literal."""
  arg_1 = StringIO.StringIO()
  arg_1.write('"')
  for arg_2 in arg_0:
    if arg_2 in _ESCAPES:
      arg_1.write(_ESCAPES[arg_2])
    elif arg_2 in _SIMPLE_CHARS:
      arg_1.write(arg_2)
    else:
      arg_1.write(r'\x{:02x}'.format(ord(arg_2)))
  arg_1.write('"')
  return arg_1.getvalue()

Returns value as a valid Go string literal .


def Func(arg_0, arg_1, arg_2):
    """Apply update to serialization metrics"""
    arg_0.update_count(arg_0.TUPLE_SERIALIZATION_TIME_NS, incr_by=arg_2, key=arg_1)


def Func ( arg_0 , arg_1 ) : arg_2 = abs ( len ( arg_0 ) - len ( arg_1 ) ) if arg_2 != 0 : if len ( arg_1 ) > len ( arg_0 ) : try : arg_0 . extend ( [ 0. ] * arg_2 ) except : arg_0 = np . append ( arg_0 , [ 0 ] * arg_2 ) elif len ( arg_0 ) > len ( arg_1 ) : try : arg_1 . extend ( [ 0. ] * arg_2 ) except : arg_1 = np . append ( arg_1 , [ 0 ] * arg_2 ) return arg_0 , arg_1 else : return arg_0 , arg_1

def Func(arg_0,arg_1):
    """Given two list or arrays, pad with zeros the shortest array

    :param b: list or array
    :param a: list or array

    .. doctest::

        >>> from spectrum.transfer import Func
        >>> a = [1,2]
        >>> b = [1,2,3,4]
        >>> a, b, = Func(a,b)

    """
    arg_2 = abs(len(arg_0)-len(arg_1))
    if arg_2 != 0:
        if len(arg_1) > len(arg_0):
            try:
                arg_0.extend([0.]*arg_2)
            except:
                arg_0 = np.append(arg_0, [0]*arg_2)
        elif len(arg_0)>len(arg_1):
            try:
                arg_1.extend([0.]*arg_2)
            except:
                arg_1 = np.append(arg_1, [0]*arg_2)
        return arg_0,arg_1
    else:
        return arg_0,arg_1

Given two list or arrays, pad with zeros the shortest array

    :param b: list or array
    :param a: list or array

    .. doctest::

        >>> from spectrum.transfer import eqtflength
        >>> a = [1,2]
        >>> b = [1,2,3,4]
        >>> a, b, = eqtflength(a,b)

Given two list or arrays pad with zeros the shortest array


(self, url, params=None, data=None, files=None, **kwargs)

return self.call_api(
            "PUT",
            url,
            params=params,
            data=data,
            files=files,
            **kwargs
        )

def Func(arg_0, arg_1, arg_2=None, arg_3=None, arg_4=None, **arg_5):
        """ Call the API with a PUT request.

        Args:
            url (str): Resource location relative to the base URL.
            params (dict or None): Query-string parameters.
            data (dict or None): Request body contents.
            files (dict or None: Files to be passed to the request.

        Returns:
            An instance of ResultParser or ErrorParser.
        """
        return arg_0.call_api(
            "PUT",
            arg_1,
            arg_2=arg_2,
            arg_3=arg_3,
            arg_4=arg_4,
            **arg_5
        )


def Func(arg_0, arg_1, arg_2=arg_3.KMIPVersion.KMIP_1_0):
        """
        Read the data encoding the SignatureVerify response payload and decode
        it into its constituent parts.

        Args:
            input_stream (stream): A data stream containing encoded object
                data, supporting a Func method; usually a BytearrayStream
                object.
            kmip_version (KMIPVersion): An enumeration defining the KMIP
                version with which the object will be decoded. Optional,
                defaults to KMIP 1.0.

        Raises:
            ValueError: Raised if the data attribute is missing from the
                encoded payload.
        """
        super(SignatureVerifyResponsePayload, arg_0).Func(
            arg_1,
            arg_2=arg_2
        )
        arg_6 = utils.BytearrayStream(arg_1.Func(arg_0.length))

        if arg_0.is_tag_next(arg_3.Tags.UNIQUE_IDENTIFIER, arg_6):
            arg_0._unique_identifier = primitives.TextString(
                tag=arg_3.Tags.UNIQUE_IDENTIFIER
            )
            arg_0._unique_identifier.Func(
                arg_6,
                arg_2=arg_2
            )
        else:
            raise ValueError(
                "Parsed payload encoding is missing the unique identifier "
                "field."
            )
        if arg_0.is_tag_next(arg_3.Tags.VALIDITY_INDICATOR, arg_6):
            arg_0._validity_indicator = primitives.Enumeration(
                arg_3.ValidityIndicator,
                tag=arg_3.Tags.VALIDITY_INDICATOR
            )
            arg_0._validity_indicator.Func(
                arg_6,
                arg_2=arg_2
            )
        else:
            raise ValueError(
                "Parsed payload encoding is missing the validity indicator "
                "field."
            )
        if arg_0.is_tag_next(arg_3.Tags.DATA, arg_6):
            arg_0._data = primitives.ByteString(tag=arg_3.Tags.DATA)
            arg_0._data.Func(arg_6, arg_2=arg_2)
        if arg_0.is_tag_next(arg_3.Tags.CORRELATION_VALUE, arg_6):
            arg_0._correlation_value = primitives.ByteString(
                tag=arg_3.Tags.CORRELATION_VALUE
            )
            arg_0._correlation_value.Func(
                arg_6,
                arg_2=arg_2
            )

        arg_0.is_oversized(arg_6)

Read the data encoding the SignatureVerify response payload and decode
        it into its constituent parts.

        Args:
            input_stream (stream): A data stream containing encoded object
                data, supporting a read method; usually a BytearrayStream
                object.
            kmip_version (KMIPVersion): An enumeration defining the KMIP
                version with which the object will be decoded. Optional,
                defaults to KMIP 1.0.

        Raises:
            ValueError: Raised if the data attribute is missing from the
                encoded payload.

Read the data encoding the SignatureVerify response payload and decode it into its constituent parts .


def Func(arg_0, arg_1):
        '''
        Update the HyperLogLog with a new data value in bytes.
        The value will be hashed using the hash function specified by
        the `hashfunc` argument in the constructor.

        Args:
            b: The value to be hashed using the hash function specified.

        Example:
            To Func with a new string value (using the default SHA1 hash
            function, which requires bytes as input):

            .. code-block:: python

                hll = HyperLogLog()
                hll.Func("new value".encode('utf-8'))

            We can also use a different hash function, for example, `pyfarmhash`:

            .. code-block:: python

                import farmhash
                def _hash_32(b):
                    return farmhash.hash32(b)
                hll = HyperLogLog(hashfunc=_hash_32)
                hll.Func("new value")
        '''
        # Digest the hash object to get the hash value
        arg_2 = arg_0.hashfunc(arg_1)
        # Get the index of the register using the first p bits of the hash
        arg_3 = arg_2 & (arg_0.m - 1)
        # Get the rest of the hash
        arg_4 = arg_2 >> arg_0.p
        # Update the register
        arg_0.reg[arg_3] = max(arg_0.reg[arg_3], arg_0._get_rank(arg_4))

Update the HyperLogLog with a new data value in bytes.
        The value will be hashed using the hash function specified by
        the `hashfunc` argument in the constructor.

        Args:
            b: The value to be hashed using the hash function specified.

        Example:
            To update with a new string value (using the default SHA1 hash
            function, which requires bytes as input):

            .. code-block:: python

                hll = HyperLogLog()
                hll.update("new value".encode('utf-8'))

            We can also use a different hash function, for example, `pyfarmhash`:

            .. code-block:: python

                import farmhash
                def _hash_32(b):
                    return farmhash.hash32(b)
                hll = HyperLogLog(hashfunc=_hash_32)
                hll.update("new value")

Update the HyperLogLog with a new data value in bytes . The value will be hashed using the hash function specified by the hashfunc argument in the constructor .


Implements Pulsar Spout's initialize method

def Func(arg_0, arg_1, arg_2):
    """Implements Pulsar Spout's Func method"""
    arg_0.logger.info("Initializing PulsarSpout with the following")
    arg_0.logger.info("Component-specific config: \n%s" % str(arg_1))
    arg_0.logger.info("Context: \n%s" % str(arg_2))

    arg_0.emit_count = 0
    arg_0.ack_count = 0
    arg_0.fail_count = 0

    if not PulsarSpout.serviceUrl in arg_1 or not PulsarSpout.topicName in arg_1:
      arg_0.logger.fatal("Need to specify both serviceUrl and topicName")
    arg_0.pulsar_cluster = str(arg_1[PulsarSpout.serviceUrl])
    arg_0.topic = str(arg_1[PulsarSpout.topicName])
    arg_8 = arg_1[api_constants.TOPOLOGY_RELIABILITY_MODE]
    if arg_8 == api_constants.TopologyReliabilityMode.ATLEAST_ONCE:
      arg_0.acking_timeout = 1000 * int(arg_1[api_constants.TOPOLOGY_MESSAGE_TIMEOUT_SECS])
    else:
      arg_0.acking_timeout = 30000
    if PulsarSpout.receiveTimeoutMs in arg_1:
      arg_0.receive_timeout_ms = arg_1[PulsarSpout.receiveTimeoutMs]
    else:
      arg_0.receive_timeout_ms = 10
    if PulsarSpout.deserializer in arg_1:
      arg_0.deserializer = arg_1[PulsarSpout.deserializer]
      if not callable(arg_0.deserializer):
        arg_0.logger.fatal("Pulsar Message Deserializer needs to be callable")
    else:
      arg_0.deserializer = arg_0.default_deserializer

    # First generate the config
    arg_0.logConfFileName = GenerateLogConfig(arg_2)
    arg_0.logger.info("Generated LogConf at %s" % arg_0.logConfFileName)

    # We currently use the high level consumer API
    # For supporting effectively once, we will need to switch
    # to using lower level Reader API, when it becomes
    # available in python
    arg_0.client = pulsar.Client(arg_0.pulsar_cluster, log_conf_file_path=arg_0.logConfFileName)
    arg_0.logger.info("Setup Client with cluster %s" % arg_0.pulsar_cluster)
    try:
      arg_0.consumer = arg_0.client.subscribe(arg_0.topic, arg_2.get_topology_name(),
                                            consumer_type=pulsar.ConsumerType.Failover,
                                            unacked_messages_timeout_ms=arg_0.acking_timeout)
    except Exception as e:
      arg_0.logger.fatal("Pulsar client subscription failed: %s" % str(e))

    arg_0.logger.info("Subscribed to topic %s" % arg_0.topic)

Implements Pulsar Spout s initialize method


def Func(arg_0, **arg_1):
        """
        Get the basic movie Funcrmation for a specific movie id.

        Args:
            language: (optional) ISO 639-1 code.
            append_to_response: (optional) Comma separated, any movie method.

        Returns:
            A dict representation of the JSON returned from the API.
        """
        arg_2 = arg_0._get_id_path('Func')

        arg_3 = arg_0._GET(arg_2, arg_1)
        arg_0._set_attrs_to_values(arg_3)
        return arg_3

Get the basic movie information for a specific movie id.

        Args:
            language: (optional) ISO 639-1 code.
            append_to_response: (optional) Comma separated, any movie method.

        Returns:
            A dict representation of the JSON returned from the API.

Get the basic movie information for a specific movie id .


def Func(arg_0):
        ''' Method to request a PIN from ecobee for authorization '''
        arg_1 = 'https://api.ecobee.com/authorize'
        arg_2 = {'response_type': 'ecobeePin',
                  'client_id': arg_0.api_key, 'scope': 'smartWrite'}
        try:
            arg_3 = requests.get(arg_1, arg_2=arg_2)
        except RequestException:
            logger.warn("Error connecting to Ecobee.  Possible connectivity outage."
                        "Could not request pin.")
            return
        arg_0.authorization_code = arg_3.json()['code']
        arg_0.pin = arg_3.json()['ecobeePin']
        logger.error('Please authorize your ecobee developer app with PIN code '
              + arg_0.pin + '\nGoto https://www.ecobee.com/consumerportal'
              '/index.html, click\nMy Apps, Add application, Enter Pin'
              ' and click Authorize.\nAfter authorizing, call request_'
              'tokens() method.')


def
Func
(
arg_0
)
:
arg_1
=
logging
.
getLogger
(
__name__
)
arg_2
=
{
}
arg_3
=
{
}
try
:
arg_4
=
_read_image
(
arg_0
)
arg_3
=
IptcImagePlugin
.
getiptcinfo
(
arg_4
)
except
SyntaxError
:
arg_1
.
info
(
'IPTC Error in %s'
,
arg_0
)
if
arg_3
and
(
2
,
5
)
in
arg_3
:
arg_2
[
"title"
]
=
arg_3
[
(
2
,
5
)
]
.
decode
(
'utf-8'
,
errors
=
'replace'
)
if
arg_3
and
(
2
,
120
)
in
arg_3
:
arg_2
[
"description"
]
=
arg_3
[
(
2
,
120
)
]
.
decode
(
'utf-8'
,
errors
=
'replace'
)
if
arg_3
and
(
2
,
105
)
in
arg_3
:
arg_2
[
"headline"
]
=
arg_3
[
(
2
,
105
)
]
.
decode
(
'utf-8'
,
errors
=
'replace'
)
return
arg_2

def Func(arg_0):
    """Return a dict with the raw IPTC data."""

    arg_1 = logging.getLogger(__name__)

    arg_2 = {}
    arg_3 = {}

    # PILs IptcImagePlugin issues a SyntaxError in certain circumstances
    # with malformed metadata, see PIL/IptcImagePlugin.py", line 71.
    # ( https://github.com/python-pillow/Pillow/blob/9dd0348be2751beb2c617e32ff9985aa2f92ae5f/src/PIL/IptcImagePlugin.py#L71 )
    try:
        arg_4 = _read_image(arg_0)
        arg_3 = IptcImagePlugin.getiptcinfo(arg_4)
    except SyntaxError:
        arg_1.info('IPTC Error in %s', arg_0)

    # IPTC fields are catalogued in:
    # https://www.iptc.org/std/photometadata/specification/IPTC-PhotoMetadata
    # 2:05 is the IPTC title property
    if arg_3 and (2, 5) in arg_3:
        arg_2["title"] = arg_3[(2, 5)].decode('utf-8', errors='replace')

    # 2:120 is the IPTC description property
    if arg_3 and (2, 120) in arg_3:
        arg_2["description"] = arg_3[(2, 120)].decode('utf-8',
                                                             errors='replace')

    # 2:105 is the IPTC headline property
    if arg_3 and (2, 105) in arg_3:
        arg_2["headline"] = arg_3[(2, 105)].decode('utf-8',
                                                          errors='replace')

    return arg_2


saves an object to the REST service
        gets the object's REST location and the data from the object,
        then POSTS the request.

def Func(arg_0, arg_1, arg_2="application/xml"):
        """
        Funcs an object to the REST service
        gets the object's REST location and the data from the object,
        then POSTS the request.
        """
        arg_3 = arg_1.href
        arg_4 = arg_1.message()

        arg_5 = {
            "Content-type": arg_2,
            "Accept": arg_2
        }

        logger.debug("{} {}".format(arg_1.Func_method, arg_1.href))
        arg_6 = arg_0.http_request(arg_3, method=arg_1.Func_method.lower(), arg_4=arg_4, arg_5=arg_5)

        if arg_6.status_code not in (200, 201):
            raise FailedRequestError('Failed to Func to Geoserver catalog: {}, {}'.format(arg_6.status_code, arg_6.text))

        arg_0._cache.clear()
        return arg_6

saves an object to the REST service gets the object s REST location and the data from the object then POSTS the request .


return math.sqrt(s * (s - a) * (s - b) * (s - c))

def Func(arg_0, arg_1, arg_2):
    """
    Uses Heron's formula to find the area of a triangle
    based on the coordinates of three points.

    Args:
        point1: list or tuple, the x y coordinate of point one.

        point2: list or tuple, the x y coordinate of point two.

        point3: list or tuple, the x y coordinate of point three.

    Returns:
        The area of a triangle as a floating point number.

    Requires:
        The math module, point_distance().
    """

    """Lengths of the three sides of the triangle"""
    arg_3 = point_distance(arg_0, arg_1)
    arg_4 = point_distance(arg_0, arg_2)
    arg_5 = point_distance(arg_1, arg_2)

    """Where s is the semiperimeter"""
    arg_6 = (arg_3 + arg_4 + arg_5) / 2.0

    """Return the area of the triangle (using Heron's formula)"""
    return math.sqrt(arg_6 * (arg_6 - arg_3) * (arg_6 - arg_4) * (arg_6 - arg_5))

Uses Heron s formula to find the area of a triangle based on the coordinates of three points .


def Func ( arg_0 ) : arg_1 = r"\+" arg_2 = re . compile ( arg_1 ) return arg_2 . sub ( "%2B" , arg_0 )

def Func(arg_0):
    """
    Literally encodes the plus sign
    input is a string
    returns the string with plus signs encoded
    """
    arg_1 = r"\+"
    arg_2 = re.compile(arg_1)
    return arg_2.sub("%2B", arg_0)


def Func ( arg_0 ) : arg_0 . registry . celery_app . conf [ 'pyramid_config' ] = arg_0 return arg_0 . registry . celery_app

def Func(arg_0):
    """This exposes the celery app. The app is actually created as part
    of the configuration. However, this does make the celery app functional
    as a stand-alone celery application.

    This puts the pyramid configuration object on the celery app to be
    used for making the registry available to tasks running inside the
    celery worker process pool. See ``CustomTask.__call__``.

    """
    # Tack the pyramid config on the celery app for later use.
    arg_0.registry.celery_app.conf['pyramid_config'] = arg_0
    return arg_0.registry.celery_app

This exposes the celery app . The app is actually created as part of the configuration . However this does make the celery app functional as a stand - alone celery application .


def Func ( arg_0 ) : arg_0 = arg_0 . to_dict ( 'records' ) arg_1 = arg_4 = None arg_2 = False for arg_3 in arg_0 : if arg_3 [ 'isKickoff' ] or arg_2 : arg_1 , arg_4 = _team_and_opp ( arg_3 ) else : arg_1 , arg_4 = _team_and_opp ( arg_3 , arg_1 , arg_4 ) arg_3 [ 'team' ] , arg_3 [ 'opp' ] = arg_1 , arg_4 arg_2 = arg_3 [ 'isKickoff' ] arg_0 = pd . DataFrame ( arg_0 ) arg_0 . team . fillna ( method = 'bfill' , inplace = True ) arg_0 . opp . fillna ( method = 'bfill' , inplace = True ) arg_0 . team . fillna ( method = 'ffill' , inplace = True ) arg_0 . opp . fillna ( method = 'ffill' , inplace = True ) return arg_0

def Func(arg_0):
    """Function that adds 'team' and 'opp' columns to the features by iterating
    through the rows in order. A precondition is that the features dicts are in
    order in a continuous game sense and that all rows are from the same game.

    :features: A DataFrame with each row representing each play (in order).
    :returns: A similar DataFrame but with 'team' and 'opp' columns added.
    """
    arg_0 = arg_0.to_dict('records')
    arg_1 = arg_4 = None
    arg_2 = False
    # fill in team and opp columns
    for arg_3 in arg_0:
        # if it's a kickoff or the play after a kickoff,
        # figure out who has possession manually
        if arg_3['isKickoff'] or arg_2:
            arg_1, arg_4 = _team_and_opp(arg_3)
        else:
            arg_1, arg_4 = _team_and_opp(arg_3, arg_1, arg_4)
        arg_3['team'], arg_3['opp'] = arg_1, arg_4
        # set playAfterKickoff
        arg_2 = arg_3['isKickoff']

    arg_0 = pd.DataFrame(arg_0)
    arg_0.team.fillna(method='bfill', inplace=True)
    arg_0.opp.fillna(method='bfill', inplace=True)
    # ffill for last row
    arg_0.team.fillna(method='ffill', inplace=True)
    arg_0.opp.fillna(method='ffill', inplace=True)
    return arg_0

Function that adds team and opp columns to the features by iterating through the rows in order . A precondition is that the features dicts are in order in a continuous game sense and that all rows are from the same game .


(self, service_name, deployment_name, role_name)

return self._perform_post(
            self._get_role_instance_operations_path(
                service_name, deployment_name, role_name),
            _XmlSerializer.restart_role_operation_to_xml(
            ),
            as_async=True)

def Func(arg_0, arg_1, arg_2, arg_3):
        '''
        Restarts the specified virtual machine.

        service_name:
            The name of the service.
        deployment_name:
            The name of the deployment.
        role_name:
            The name of the role.
        '''
        _validate_not_none('service_name', arg_1)
        _validate_not_none('deployment_name', arg_2)
        _validate_not_none('role_name', arg_3)
        return arg_0._perform_post(
            arg_0._get_role_instance_operations_path(
                arg_1, arg_2, arg_3),
            _XmlSerializer.Func_operation_to_xml(
            ),
            as_async=True)

Restarts the specified virtual machine .


(self, fa: F[A], z: B, f: Callable[[A], B], g: Callable[[Z, B], Z]=operator.add)

def Func ( arg_0 , arg_1 : arg_2 [ arg_3 ] , arg_4 : arg_5 , arg_6 : arg_7 [ [ arg_3 ] , arg_5 ] , arg_8 : arg_7 [ [ arg_9 , arg_5 ] , arg_9 ] = arg_10 . add ) -> arg_9 : arg_12 = Functor . fatal ( type ( arg_1 ) ) . map ( arg_1 , arg_6 ) return arg_0 . fold_left ( arg_12 ) ( arg_4 ) ( arg_8 )

def Func(arg_0, arg_1: arg_2[arg_3], arg_4: arg_5, arg_6: arg_7[[arg_3], arg_5], arg_8: arg_7[[arg_9, arg_5], arg_9]=arg_10.add) -> arg_9:
        ''' map `f` over the traversable, then fold over the result
        using the supplied initial element `z` and operation `g`,
        defaulting to addition for the latter.
        '''
        arg_12 = Functor.fatal(type(arg_1)).map(arg_1, arg_6)
        return arg_0.fold_left(arg_12)(arg_4)(arg_8)

map f over the traversable then fold over the result using the supplied initial element z and operation g defaulting to addition for the latter .


def Func(arg_0, arg_1, arg_2):
        """
        Returns a ``SettingDict`` object.
        """
        if arg_2 is None:
            arg_3 = arg_0.setting_model.objects.as_dict()
        else:
            arg_3 = arg_0.setting_model.objects.as_dict(arg_2=arg_2)
        return arg_3


def Func ( arg_0 , arg_1 ) : if isinstance ( arg_1 , string_types ) : with open ( arg_1 ) as f : arg_0 . lexer . Func ( f . read ( ) ) else : arg_0 . lexer . Func ( arg_1 . read ( ) )

def Func(arg_0, arg_1):
        """
        Load lexer with content from `file` which can be a path or a file
        like object.
        """
        if isinstance(arg_1, string_types):
            with open(arg_1) as f:
                arg_0.lexer.Func(f.read())
        else:
            arg_0.lexer.Func(arg_1.read())

Load lexer with content from file which can be a path or a file like object .


def Func(arg_0, arg_1, arg_2):
        """Assigns a parameter value to matching instructions in-place."""
        for (arg_3, arg_4) in arg_0._parameter_table[arg_1]:
            arg_3.params[arg_4] = arg_2

Assigns a parameter value to matching instructions in - place .


def Func(arg_0, arg_1, arg_2):
        """Check for conflicts and problems in the options.

        Returns True if everything is ok, or False if not.

        """
        for arg_3 in ['erase', 'execute']:
            for arg_4 in ['annotate', 'html', 'report', 'combine']:
                if (arg_3 in arg_1.actions) and (arg_4 in arg_1.actions):
                    arg_0.help_fn("You can't specify the '%s' and '%s' "
                              "options at the same time." % (arg_3, arg_4))
                    return False

        if not arg_1.actions:
            arg_0.help_fn(
                "You must specify at least one of -e, -x, -c, -r, -a, or -b."
                )
            return False
        arg_5 = (
            'execute' in arg_1.actions or
            'annotate' in arg_1.actions or
            'html' in arg_1.actions or
            'debug' in arg_1.actions or
            'report' in arg_1.actions or
            'xml' in arg_1.actions
            )
        if not arg_5 and arg_2:
            arg_0.help_fn("Unexpected arguments: %s" % " ".join(arg_2))
            return False

        if 'execute' in arg_1.actions and not arg_2:
            arg_0.help_fn("Nothing to do.")
            return False

        return True

Check for conflicts and problems in the options .


def Func(arg_0, arg_1, arg_2):
        """
        Prepare the entity for execution.

        :param clock: The clock containing the execution start time and
          execution period information.
        :param period_count: The total amount of periods this activity will be
          requested to be run for.
        """

        arg_0.period_count = arg_2

        arg_0._exec_year_end_datetime = arg_1.get_datetime_at_period_ix(
            arg_2)
        arg_0._prev_year_end_datetime = arg_1.start_datetime
        arg_0._curr_year_end_datetime = arg_1.start_datetime + relativedelta(
            years=1)

        # Remove all the transactions
        del arg_0.gl.transactions[:]

        for arg_6 in arg_0.components:
            arg_6.Func(arg_1, arg_2)

        arg_0.negative_income_tax_total = 0


def Func(arg_0, arg_1):
        """Initializes profiler with a package."""
        arg_0.profile = arg_0.profile_package
        arg_0._run_object, arg_4, arg_0._run_args = arg_1.partition(' ')
        arg_0._object_name = '%s (package)' % arg_0._run_object
        arg_0._replace_sysargs()


def Func ( arg_0 , arg_1 ) : arg_2 = { 16 : 'CX' , 32 : 'ECX' , 64 : 'RCX' } [ arg_0 . address_bit_size ] arg_3 = arg_0 . write_register ( arg_2 , arg_0 . read_register ( arg_2 ) - 1 ) arg_0 . PC = Operators . ITEBV ( arg_0 . address_bit_size , arg_3 != 0 , ( arg_0 . PC + arg_1 . read ( ) ) & ( ( 1 << arg_1 . size ) - 1 ) , arg_0 . PC + arg_0 . instruction . size )

def Func(arg_0, arg_1):
        """
        Loops if ECX counter is nonzero.

        :param cpu: current CPU.
        :param target: destination operand.
        """
        arg_2 = {16: 'CX', 32: 'ECX', 64: 'RCX'}[arg_0.address_bit_size]
        arg_3 = arg_0.write_register(arg_2, arg_0.read_register(arg_2) - 1)
        arg_0.PC = Operators.ITEBV(arg_0.address_bit_size, arg_3 != 0, (arg_0.PC + arg_1.read()) & ((1 << arg_1.size) - 1), arg_0.PC + arg_0.instruction.size)


(self, webhookId, name=None, targetUrl=None,
               **request_parameters)

def Func(arg_0, arg_1, arg_2=None, arg_3=None,
               **arg_4):
        """Update a webhook, by ID.

        Args:
            webhookId(basestring): The webhook ID.
            name(basestring): A user-friendly name for this webhook.
            targetUrl(basestring): The URL that receives POST requests for
                each event.
            **request_parameters: Additional request parameters (provides
                support for parameters that may be added in the future).

        Returns:
            Webhook: A Webhook object with the Funcd Webex Teams webhook
                details.

        Raises:
            TypeError: If the parameter types are incorrect.
            ApiError: If the Webex Teams cloud returns an error.

        """
        check_type(arg_1, basestring, may_be_none=False)
        check_type(arg_2, basestring)
        check_type(arg_3, basestring)

        arg_5 = dict_from_items_with_values(
            arg_4,
            arg_2=arg_2,
            arg_3=arg_3,
        )

        # API request
        arg_6 = arg_0._session.put(API_ENDPOINT + '/' + arg_1,
                                      json=arg_5)

        # Return a webhook object created from the response JSON data
        return arg_0._object_factory(OBJECT_TYPE, arg_6)

Update a webhook, by ID.

        Args:
            webhookId(basestring): The webhook ID.
            name(basestring): A user-friendly name for this webhook.
            targetUrl(basestring): The URL that receives POST requests for
                each event.
            **request_parameters: Additional request parameters (provides
                support for parameters that may be added in the future).

        Returns:
            Webhook: A Webhook object with the updated Webex Teams webhook
                details.

        Raises:
            TypeError: If the parameter types are incorrect.
            ApiError: If the Webex Teams cloud returns an error.


def Func(arg_0, arg_1, arg_2=False):
        """
        Crop to a new depth range.

        Args:
            extent (tuple): The new start and stop depth. Must be 'inside'
                existing striplog.
            copy (bool): Whether to operate in place or make a copy.

        Returns:
            Operates in place by deault; if copy is True, returns a striplog.
        """
        try:
            if arg_1[0] is None:
                arg_1 = (arg_0.start.z, arg_1[1])
            if arg_1[1] is None:
                arg_1 = (arg_1[0], arg_0.stop.z)
        except:
            arg_3 = "You must provide a 2-tuple for the new extents. Use None for"
            arg_3 += " the existing start or stop."
            raise StriplogError(arg_3)

        arg_4 = arg_0.read_at(arg_1[0], index=True)
        arg_5 = arg_0.read_at(arg_1[1], index=True)

        arg_6 = arg_0[arg_4].split_at(arg_1[0])[1]
        arg_7 = arg_0[arg_5].split_at(arg_1[1])[0]

        arg_8 = arg_0.__list[arg_4:arg_5+1].copy()
        arg_8[0] = arg_6
        arg_8[-1] = arg_7

        if arg_2:
            return Striplog(arg_8)
        else:
            arg_0.__list = arg_8
            return


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
arg_3
=
arg_0
.
_get_object_handle
(
arg_1
,
arg_2
)
if
not
arg_3
.
AXEnabled
:
raise
LdtpServerException
(
u"Object %s state disabled"
%
arg_2
)
arg_3
.
Press
(
)
arg_0
.
wait
(
1
)
arg_4
=
try
:
if
not
arg_3
.
AXChildren
:
raise
LdtpServerException
(
u"Unable to find menu"
)
arg_5
=
arg_3
.
AXChildren
[
0
]
if
not
arg_5
:
raise
LdtpServerException
(
u"Unable to find menu"
)
arg_5
=
arg_5
.
AXChildren
arg_6
=
[
]
for
arg_4
in
arg_5
:
arg_7
=
arg_0
.
_get_title
(
arg_4
)
if
arg_7
:
arg_6
.
append
(
arg_7
)
finally
:
if
arg_4
:
arg_4
.
Cancel
(
)
return
arg_6

def Func(arg_0, arg_1, arg_2):
        """
        Get all combo box item

        @param window_name: Window name to type in, either full name,
        LDTP's name convention, or a Unix glob.
        @type window_name: string
        @param object_name: Object name to type in, either full name,
        LDTP's name convention, or a Unix glob.
        @type object_name: string

        @return: list of string on success.
        @rtype: list
        """
        arg_3 = arg_0._get_object_handle(arg_1, arg_2)
        if not arg_3.AXEnabled:
            raise LdtpServerException(u"Object %s state disabled" % arg_2)
        arg_3.Press()
        # Required for menuitem to appear in accessibility list
        arg_0.wait(1)
        arg_4 = None
        try:
            if not arg_3.AXChildren:
                raise LdtpServerException(u"Unable to find menu")
            # Get AXMenu
            arg_5 = arg_3.AXChildren[0]
            if not arg_5:
                raise LdtpServerException(u"Unable to find menu")
            arg_5 = arg_5.AXChildren
            arg_6 = []
            for arg_4 in arg_5:
                arg_7 = arg_0._get_title(arg_4)
                # Don't add empty label
                # Menu separator have empty label's
                if arg_7:
                    arg_6.append(arg_7)
        finally:
            if arg_4:
                # Set it back, by clicking combo box
                arg_4.Cancel()
        return arg_6


def Func(arg_0):
        '''since the user needs a job id and other parameters, save this
           for them.
        '''
        arg_1 = {'SREGISTRY_GITLAB_FOLDER': arg_0.artifacts,
                    'api_base': arg_0.api_base,
                    'SREGISTRY_GITLAB_BASE': arg_0.base,
                    'SREGISTRY_GITLAB_JOB': arg_0.job }
        return arg_1

since the user needs a job id and other parameters save this for them .


def
Func
(
arg_0
,
arg_1
,
arg_2
=
,
arg_3
=
)
:
if
arg_2
is
:
arg_2
=
'auto'
elif
arg_2
:
arg_2
=
'1'
else
:
arg_2
=
'0'
arg_4
=
{
'source_url'
:
arg_1
,
'store'
:
arg_2
,
}
if
arg_3
:
arg_4
[
'filename'
]
=
arg_3
arg_5
=
uploading_request
(
'POST'
,
'from_url/'
,
arg_4
=
arg_4
)
if
'token'
not
in
arg_5
:
raise
APIError
(
'could not find token in result: {0}'
.
format
(
arg_5
)
)
arg_6
=
arg_0
.
FileFromUrl
(
arg_5
[
'token'
]
)
return
arg_6

def Func(arg_0, arg_1, arg_2=None, arg_3=None):
        """Uploads file from given url and returns ``FileFromUrl`` instance.

        Args:
            - url (str): URL of file 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
            - filename (Optional[str]): Name of the uploaded file. If this not
                specified the filename will be obtained from response headers
                or source URL. Defaults to None.

        Returns:
            ``FileFromUrl`` instance

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

        arg_4 = {
            'source_url': arg_1,
            'store': arg_2,
        }
        if arg_3:
            arg_4['filename'] = arg_3

        arg_5 = uploading_request('POST', 'from_url/',
                                   arg_4=arg_4)
        if 'token' not in arg_5:
            raise APIError(
                'could not find token in result: {0}'.format(arg_5)
            )
        arg_6 = arg_0.FileFromUrl(arg_5['token'])
        return arg_6

Uploads file from given url and returns FileFromUrl instance .


def Func(arg_0):
        """self.parsed_data->self.config, parse unrecognized extra args via KVLoader."""
        # remove subconfigs list from namespace before transforming the Namespace
        if '_flags' in arg_0.parsed_data:
            arg_1 = arg_0.parsed_data._flags
            del arg_0.parsed_data._flags
        else:
            arg_1 = []

        for arg_2, arg_3 in vars(arg_0.parsed_data).iteritems():
            if arg_3 is None:
                # it was a flag that shares the name of an alias
                arg_1.append(arg_0.alias_flags[arg_2])
            else:
                # eval the KV assignment
                arg_0._exec_config_str(arg_2, arg_3)

        for arg_4 in arg_1:
            arg_0._load_flag(arg_4)

        if arg_0.extra_args:
            arg_5 = KeyValueConfigLoader()
            arg_5.load_config(arg_0.extra_args)
            arg_0.config._merge(arg_5.config)
            arg_0.extra_args = arg_5.extra_args

self . parsed_data - > self . config parse unrecognized extra args via KVLoader .


return textwrap.fill(text,
                             text_width,
                             initial_indent=indent,
                             subsequent_indent=indent)

def Func(arg_0, arg_1):
        """
        Format a paragraph of free-form text for inclusion in the
        help output at the current indentation level.
        """
        arg_2 = max(arg_0.width - arg_0.current_indent, 11)
        arg_3 = " "*arg_0.current_indent
        return textwrap.fill(arg_1,
                             arg_2,
                             initial_indent=arg_3,
                             subsequent_indent=arg_3)

Format a paragraph of free - form text for inclusion in the help output at the current indentation level .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
.
_register_app
=
arg_0
.
original_register_app
if
not
hasattr
(
arg_1
,
'extensions'
)
:
arg_1
.
extensions
=
dict
(
)
if
'celery'
in
arg_1
.
extensions
:
raise
ValueError
(
'Already registered extension CELERY.'
)
arg_1
.
extensions
[
'celery'
]
=
_CeleryState
(
arg_0
,
arg_1
)
super
(
Celery
,
arg_0
)
.
__init__
(
arg_1
.
import_name
,
broker
=
arg_1
.
config
[
'CELERY_BROKER_URL'
]
)
if
'CELERY_RESULT_BACKEND'
in
arg_1
.
config
:
arg_0
.
_preconf
[
'CELERY_RESULT_BACKEND'
]
=
arg_1
.
config
[
'CELERY_RESULT_BACKEND'
]
arg_0
.
conf
.
update
(
arg_1
.
config
)
arg_6
=
arg_0
.
Task
class
ContextTask
(
arg_6
)
:
def
__call__
(
arg_0
,
*
arg_7
,
**
arg_8
)
:
with
arg_1
.
app_context
(
)
:
return
arg_6
.
__call__
(
arg_0
,
*
arg_7
,
**
arg_8
)
setattr
(
ContextTask
,
'abstract'
,
True
)
setattr
(
arg_0
,
'Task'
,
ContextTask
)

def Func(arg_0, arg_1):
        """Actual method to read celery settings from app configuration and initialize the celery instance.

        :param app: Flask application instance.
        """
        arg_2._register_app = arg_0.original_register_app  # Restore Celery app registration function.
        if not hasattr(arg_1, 'extensions'):
            arg_1.extensions = dict()
        if 'celery' in arg_1.extensions:
            raise ValueError('Already registered extension CELERY.')
        arg_1.extensions['celery'] = _CeleryState(arg_0, arg_1)

        # Instantiate celery and read config.
        super(Celery, arg_0).__init__(arg_1.import_name, broker=arg_1.config['CELERY_BROKER_URL'])

        # Set result backend default.
        if 'CELERY_RESULT_BACKEND' in arg_1.config:
            arg_0._preconf['CELERY_RESULT_BACKEND'] = arg_1.config['CELERY_RESULT_BACKEND']

        arg_0.conf.update(arg_1.config)
        arg_6 = arg_0.Task

        # Add Flask app context to celery instance.
        class ContextTask(arg_6):
            def __call__(arg_0, *arg_7, **arg_8):
                with arg_1.app_context():
                    return arg_6.__call__(arg_0, *arg_7, **arg_8)
        setattr(ContextTask, 'abstract', True)
        setattr(arg_0, 'Task', ContextTask)

Actual method to read celery settings from app configuration and initialize the celery instance .


def
Func
(
arg_0
,
arg_1
=
300
,
arg_2
=
300
,
arg_3
=
False
)
:
try
:
from
rdkit
.
Chem
import
Draw
from
rdkit
.
Chem
.
Draw
import
IPythonConsole
if
arg_3
:
arg_4
=
arg_0
.
rdkitmol_Hs
else
:
arg_4
=
arg_0
.
rdkitmol
return
Draw
.
MolToImage
(
arg_4
,
size
=
(
arg_1
,
arg_2
)
)
except
:
return
'Rdkit is required for this feature.'

def Func(arg_0, arg_1=300, arg_2=300, arg_3=False): # pragma: no cover
        r'''Interface for drawing a 2D image of the molecule.
        Requires an HTML5 browser, and the libraries RDKit and
        IPython. An exception is raised if either of these libraries is
        absent.

        Parameters
        ----------
        width : int
            Number of pixels wide for the view
        height : int
            Number of pixels tall for the view
        Hs : bool
            Whether or not to show hydrogen

        Examples
        --------
        >>> Chemical('decane').Func() # doctest: +ELLIPSIS
        <PIL.Image.Image image mode=RGBA size=300x300 at 0x...>
        '''
        try:
            from rdkit.Chem import Draw
            from rdkit.Chem.Draw import IPythonConsole
            if arg_3:
                arg_4 = arg_0.rdkitmol_Hs
            else:
                arg_4 = arg_0.rdkitmol
            return Draw.MolToImage(arg_4, size=(arg_1, arg_2))
        except:
            return 'Rdkit is required for this feature.'

r'''Interface for drawing a 2D image of the molecule.
        Requires an HTML5 browser, and the libraries RDKit and
        IPython. An exception is raised if either of these libraries is
        absent.

        Parameters
        ----------
        width : int
            Number of pixels wide for the view
        height : int
            Number of pixels tall for the view
        Hs : bool
            Whether or not to show hydrogen

        Examples
        --------
        >>> Chemical('decane').draw_2d() # doctest: +ELLIPSIS
        <PIL.Image.Image image mode=RGBA size=300x300 at 0x...>

r Interface for drawing a 2D image of the molecule . Requires an HTML5 browser and the libraries RDKit and IPython . An exception is raised if either of these libraries is absent .


def Func ( arg_0 , arg_1 = None ) : arg_2 = arg_1 or arg_0 . _registration_id arg_3 = { "registration_ids" : arg_2 } if arg_0 . _data is not None : arg_3 [ "data" ] = arg_0 . _data for arg_4 , arg_5 in arg_0 . _kwargs . items ( ) : if arg_5 : arg_3 [ arg_4 ] = arg_5 arg_6 = json . dumps ( arg_3 , separators = ( "," , ":" ) , sort_keys = True ) . encode ( arg_0 . encoding ) arg_7 = json . loads ( arg_0 . _send ( arg_6 , "application/json" ) ) if ( "failure" in arg_7 ) and ( arg_7 [ "failure" ] ) : arg_8 = [ ] arg_9 = False for arg_10 , arg_11 in enumerate ( arg_7 . get ( "results" , [ ] ) ) : arg_11 = arg_11 . get ( "error" , "" ) if arg_11 in ( "NotRegistered" , "InvalidRegistration" ) : arg_8 . append ( arg_2 [ arg_10 ] ) elif arg_11 != "" : arg_9 = True arg_0 . deactivate_unregistered_devices ( arg_8 ) if arg_9 : raise GCMPushError ( arg_7 ) return arg_7

def Func(arg_0, arg_1=None):
        """
        Sends a json GCM message
        """

        arg_2 = arg_1 or arg_0._registration_id
        arg_3 = {"registration_ids": arg_2}

        if arg_0._data is not None:
            arg_3["data"] = arg_0._data

        for arg_4, arg_5 in arg_0._kwargs.items():
            if arg_5:
                arg_3[arg_4] = arg_5

        arg_6 = json.dumps(arg_3, separators=(",", ":"), sort_keys=True).encode(
                arg_0.encoding)

        arg_7 = json.loads(arg_0._send(arg_6, "application/json"))

        if ("failure" in arg_7) and (arg_7["failure"]):
            arg_8 = []
            arg_9 = False

            for arg_10, arg_11 in enumerate(arg_7.get("results", [])):
                arg_11 = arg_11.get("error", "")
                if arg_11 in ("NotRegistered", "InvalidRegistration"):
                    arg_8.append(arg_2[arg_10])
                elif arg_11 != "":
                    arg_9 = True

            arg_0.deactivate_unregistered_devices(arg_8)
            if arg_9:
                raise GCMPushError(arg_7)

        return arg_7


def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_1 = urljoin ( arg_0 . base_url , arg_1 ) try : arg_3 = arg_0 . _make_request ( ** dict ( method = 'POST' , arg_1 = arg_1 , json = arg_2 , auth = arg_0 . auth , timeout = arg_0 . timeout , hooks = arg_0 . request_hooks , headers = arg_0 . request_headers ) ) except requests . exceptions . RequestException as e : raise e else : if arg_3 . status_code >= 400 : try : arg_4 = arg_3 . json ( ) except ValueError : arg_4 = { "response" : arg_3 } raise MailChimpError ( arg_4 ) if arg_3 . status_code == 204 : return None return arg_3 . json ( )

def Func(arg_0, arg_1, arg_2=None):
        """
        Handle authenticated POST requests

        :param url: The url for the endpoint including path parameters
        :type url: :py:class:`str`
        :param data: The request body parameters
        :type data: :py:data:`none` or :py:class:`dict`
        :returns: The JSON output from the API or an error message
        """
        arg_1 = urljoin(arg_0.base_url, arg_1)
        try:
            arg_3 = arg_0._make_request(**dict(
                method='POST',
                arg_1=arg_1,
                json=arg_2,
                auth=arg_0.auth,
                timeout=arg_0.timeout,
                hooks=arg_0.request_hooks,
                headers=arg_0.request_headers
            ))
        except requests.exceptions.RequestException as e:
            raise e
        else:
            if arg_3.status_code >= 400:
                # in case of a 500 error, the response might not be a JSON
                try:
                    arg_4 = arg_3.json()
                except ValueError:
                    arg_4 = { "response": arg_3 }
                raise MailChimpError(arg_4)
            if arg_3.status_code == 204:
                return None
            return arg_3.json()


def Func(arg_0, arg_1, arg_2):
    """Runs one iteration of Hamiltonian Monte Carlo.

    Args:
      current_state: `Tensor` or Python `list` of `Tensor`s representing the
        current state(s) of the Markov chain(s). The first `r` dimensions index
        independent chains, `r = tf.rank(target_log_prob_fn(*current_state))`.
      previous_kernel_results: `collections.namedtuple` containing `Tensor`s
        representing values from previous calls to this function (or from the
        `bootstrap_results` function.)

    Returns:
      next_state: Tensor or Python list of `Tensor`s representing the state(s)
        of the Markov chain(s) after taking exactly one step. Has same type and
        shape as `current_state`.
      kernel_results: `collections.namedtuple` of internal calculations used to
        advance the chain.

    Raises:
      ValueError: if there isn't one `step_size` or a list with same length as
        `current_state`.
    """
    arg_3 = (
        [] if arg_0.step_size_update_fn is None
        else (arg_2.extra.step_size_assign
              if mcmc_util.is_list_like(
                  arg_2.extra.step_size_assign)
              else [arg_2.extra.step_size_assign]))

    with tf.control_dependencies(arg_3):
      arg_4, arg_5 = arg_0._impl.Func(
          arg_1, arg_2)
      if arg_0.step_size_update_fn is not None:
        arg_6 = arg_0.step_size_update_fn(  # pylint: disable=not-callable
            arg_0.step_size, arg_5)
        arg_5 = arg_5._replace(
            extra=HamiltonianMonteCarloExtraKernelResults(
                arg_6=arg_6))
      return arg_4, arg_5

Runs one iteration of Hamiltonian Monte Carlo .


def Func ( arg_0 ) : @ wraps ( arg_0 ) def wrapper ( arg_1 , * arg_2 , ** arg_3 ) : arg_4 = { } for arg_5 in arg_1 : arg_6 = arg_0 ( arg_5 , * arg_2 , ** arg_3 ) if arg_6 is not None : arg_4 . setdefault ( arg_6 , set ( ) ) . add ( arg_5 ) return arg_4 return wrapper

def Func(arg_0):
    """Decorator to convert a function which takes a single value and returns
    a key into one which takes a list of values and returns a dict of key-group
    mappings.

    :param function: A function which takes a value and returns a hash key.
    :type function: ``function(value) -> key``

    :rtype:
        .. parsed-literal::
            function(iterable) ->
                {key: :class:`~__builtins__.set` ([value, ...]), ...}
    """

    @wraps(arg_0)
    def wrapper(arg_1, *arg_2, **arg_3):  # pylint: disable=missing-docstring
        arg_4 = {}

        for arg_5 in arg_1:
            arg_6 = arg_0(arg_5, *arg_2, **arg_3)
            if arg_6 is not None:
                arg_4.setdefault(arg_6, set()).add(arg_5)

        return arg_4
    return wrapper

Decorator to convert a function which takes a single value and returns a key into one which takes a list of values and returns a dict of key - group mappings .


def Func ( arg_0 ) : if not hasattr ( arg_0 , 'hook' ) : from airflow . contrib . hooks . aws_glue_catalog_hook import AwsGlueCatalogHook arg_0 . hook = AwsGlueCatalogHook ( aws_conn_id = arg_0 . aws_conn_id , region_name = arg_0 . region_name ) return arg_0 . hook

def Func(arg_0):
        """
        Gets the AwsGlueCatalogHook
        """
        if not hasattr(arg_0, 'hook'):
            from airflow.contrib.hooks.aws_glue_catalog_hook import AwsGlueCatalogHook
            arg_0.hook = AwsGlueCatalogHook(
                aws_conn_id=arg_0.aws_conn_id,
                region_name=arg_0.region_name)

        return arg_0.hook


def Func(arg_0, arg_1, arg_2, arg_3):
        """Sets plugin specific options used by plugins originating
        from this session object.

        :param plugin: name of the plugin
        :param key: key of the option
        :param value: value to set the option to

        """

        if arg_1 in arg_0.plugins:
            arg_1 = arg_0.plugins[arg_1]
            arg_1.set_option(arg_2, arg_3)

Sets plugin specific options used by plugins originating from this session object .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
dumps
(
arg_1
)
if
arg_0
.
_async
:
arg_0
.
publisher_client
.
publish
(
arg_0
.
topic_path
,
arg_2
=
arg_2
)
logger
.
info
(
'Task {} queued.'
.
format
(
arg_1
.
id
)
)
else
:
arg_3
=
unpickle
(
arg_2
)
logger
.
info
(
'Executing task {} synchronously.'
.
format
(
arg_3
.
id
)
)
with
measure_time
(
)
as
summary
,
arg_0
.
queue_context
(
)
:
arg_3
.
execute
(
queue
=
arg_0
)
summary
(
arg_3
.
summary
(
)
)
return
TaskResult
(
arg_1
.
id
,
arg_0
)

def Func(arg_0, arg_1):
        """Enqueues a task directly. This is used when a task is retried or if
        a task was manually created.

        Note that this does not store the task.
        """
        arg_2 = dumps(arg_1)

        if arg_0._async:
            arg_0.publisher_client.publish(arg_0.topic_path, arg_2=arg_2)
            logger.info('Task {} queued.'.format(arg_1.id))
        else:
            arg_3 = unpickle(arg_2)
            logger.info(
                'Executing task {} synchronously.'.format(arg_3.id)
            )
            with measure_time() as summary, arg_0.queue_context():
                arg_3.execute(queue=arg_0)
                summary(arg_3.summary())

        return TaskResult(arg_1.id, arg_0)

Enqueues a task directly . This is used when a task is retried or if a task was manually created .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . _perform_request ( url = '/ipblocks/' + arg_1 , method = 'DELETE' ) return arg_2

def Func(arg_0, arg_1):
        """
        Removes a single IP block from your account.

        :param      ipblock_id: The unique ID of the IP block.
        :type       ipblock_id: ``str``

        """
        arg_2 = arg_0._perform_request(
            url='/ipblocks/' + arg_1, method='DELETE')

        return arg_2

Removes a single IP block from your account .


return _get_bounds(
            self.handle, core.rt.Index_GetBounds, coordinate_interleaved)

def Func ( arg_0 , arg_1 = None ) : if arg_1 is None : arg_1 = arg_0 . interleaved return _Func ( arg_0 . handle , core . rt . Index_GetBounds , arg_1 )

def Func(arg_0, arg_1=None):
        """Returns the bounds of the index

        :param coordinate_interleaved: If True, the coordinates are turned
            in the form [xmin, ymin, ..., kmin, xmax, ymax, ..., kmax],
            otherwise they are returned as
            [xmin, xmax, ymin, ymax, ..., ..., kmin, kmax].  If not specified,
            the :attr:`interleaved` member of the index is used, which
            defaults to True.
        """
        if arg_1 is None:
            arg_1 = arg_0.interleaved
        return _Func(
            arg_0.handle, core.rt.Index_GetBounds, arg_1)


return (ec, self.addCaptureToErr(ev, records), tb)

def Func ( arg_0 , arg_1 , arg_2 ) : arg_1 . capturedLogging = records = arg_0 . formatLogRecords ( ) if not records : return arg_2 arg_4 , arg_5 , arg_6 = arg_2 return ( arg_4 , arg_0 . addCaptureToErr ( arg_5 , records ) , arg_6 )

def Func(arg_0, arg_1, arg_2):
        """Add captured log messages to error output.
        """
        # logic flow copied from Capture.Func
        arg_1.capturedLogging = records = arg_0.formatLogRecords()
        if not records:
            return arg_2
        arg_4, arg_5, arg_6 = arg_2
        return (arg_4, arg_0.addCaptureToErr(arg_5, records), arg_6)

Add captured log messages to error output .


(self, target, effects=None, make_public=None,
                           pattern=None)

return rest_request('POST', 'files/', data=data)

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None , arg_4 = None ) : arg_2 = arg_0 . _build_effects ( arg_2 ) arg_5 = { 'source' : arg_0 . cdn_path ( arg_2 ) , 'target' : arg_1 } if arg_3 is not None : arg_5 [ 'make_public' ] = arg_3 if arg_4 is not None : arg_5 [ 'pattern' ] = arg_4 return rest_request ( 'POST' , 'files/' , arg_5 = arg_5 )

def Func(arg_0, arg_1, arg_2=None, arg_3=None,
                           arg_4=None):
        """Creates file copy in remote storage.

        Args:
            - target:
                Name of a custom storage connected to the project.
            - effects:
                Adds CDN image effects to ``self.default_effects`` if any.
            - make_public:
                To forbid public from accessing your files on the storage set
                ``make_public`` option to be False.
                Default value is None. Files have public access by default.
            - pattern:
                Specify ``pattern`` option to set S3 object key name.
                Takes precedence over pattern set in project settings.
                If neither is specified defaults to
                `${uuid}/${filename}${effects}${ext}`.

        For more information on each of the options above please refer to
        REST API docs https://uploadcare.com/docs/api_reference/rest/accessing_files/.

        Following example copies a file to custom storage named ``samplefs``:

             >>> file = File('e8ebfe20-8c11-4a94-9b40-52ecad7d8d1a')
             >>> file.Func(target='samplefs',
             >>>                         make_public=True,
             >>>                         pattern='${uuid}/${filename}${ext}')

        Now custom storage ``samplefs`` contains publicly available file
        with original filename billmurray.jpg in
        in the directory named ``e8ebfe20-8c11-4a94-9b40-52ecad7d8d1a``.

        """
        arg_2 = arg_0._build_effects(arg_2)
        arg_5 = {
            'source': arg_0.cdn_path(arg_2),
            'target': arg_1
        }

        if arg_3 is not None:
            arg_5['make_public'] = arg_3
        if arg_4 is not None:
            arg_5['pattern'] = arg_4
        return rest_request('POST', 'files/', arg_5=arg_5)

Creates file copy in remote storage.

        Args:
            - target:
                Name of a custom storage connected to the project.
            - effects:
                Adds CDN image effects to ``self.default_effects`` if any.
            - make_public:
                To forbid public from accessing your files on the storage set
                ``make_public`` option to be False.
                Default value is None. Files have public access by default.
            - pattern:
                Specify ``pattern`` option to set S3 object key name.
                Takes precedence over pattern set in project settings.
                If neither is specified defaults to
                `${uuid}/${filename}${effects}${ext}`.

        For more information on each of the options above please refer to
        REST API docs https://uploadcare.com/docs/api_reference/rest/accessing_files/.

        Following example copies a file to custom storage named ``samplefs``:

             >>> file = File('e8ebfe20-8c11-4a94-9b40-52ecad7d8d1a')
             >>> file.create_remote_copy(target='samplefs',
             >>>                         make_public=True,
             >>>                         pattern='${uuid}/${filename}${ext}')

        Now custom storage ``samplefs`` contains publicly available file
        with original filename billmurray.jpg in
        in the directory named ``e8ebfe20-8c11-4a94-9b40-52ecad7d8d1a``.


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_0 . name if not arg_3 and arg_0 . field . placeholder_image_name : arg_3 = arg_0 . field . placeholder_image_name arg_0 . filters = FilterLibrary ( arg_3 , arg_0 . storage , versatileimagefield_registry , arg_1 , arg_2 ) for ( arg_5 , arg_6 ) in iteritems ( versatileimagefield_registry . _sizedimage_registry ) : setattr ( arg_0 , arg_5 , arg_6 ( path_to_image = arg_3 , storage = arg_0 . storage , arg_2 = arg_2 , ppoi = arg_1 ) )

def Func(arg_0, arg_1, arg_2):
        """Build the filters and sizers for a field."""
        arg_3 = arg_0.name
        if not arg_3 and arg_0.field.placeholder_image_name:
            arg_3 = arg_0.field.placeholder_image_name
        arg_0.filters = FilterLibrary(
            arg_3,
            arg_0.storage,
            versatileimagefield_registry,
            arg_1,
            arg_2
        )
        for (
            arg_5,
            arg_6
        ) in iteritems(versatileimagefield_registry._sizedimage_registry):
            setattr(
                arg_0,
                arg_5,
                arg_6(
                    path_to_image=arg_3,
                    storage=arg_0.storage,
                    arg_2=arg_2,
                    ppoi=arg_1
                )
            )

Build the filters and sizers for a field .


def
Func
(
arg_0
,
arg_1
)
:
with
ConnectionFactory
.
get
(
)
as
conn
:
arg_2
=
'SELECT count(job_id) '
'FROM %s '
'WHERE client_info = %%s '
' AND status != %%s'
%
arg_0
.
jobsTableName
conn
.
cursor
.
execute
(
arg_2
,
[
arg_1
,
arg_0
.
STATUS_COMPLETED
]
)
arg_3
=
conn
.
cursor
.
fetchone
(
)
[
0
]
return
arg_3

def Func(arg_0, arg_1):
    """ Return the number of jobs for the given clientInfo and a status that is
    not completed.
    """
    with ConnectionFactory.get() as conn:
      arg_2 = 'SELECT count(job_id) ' \
              'FROM %s ' \
              'WHERE client_info = %%s ' \
              ' AND status != %%s' %  arg_0.jobsTableName
      conn.cursor.execute(arg_2, [arg_1, arg_0.STATUS_COMPLETED])
      arg_3 = conn.cursor.fetchone()[0]

    return arg_3

Return the number of jobs for the given clientInfo and a status that is not completed .


def
Func
(
arg_0
,
arg_1
)
:
if
arg_0
.
lower
(
)
==
'description'
:
return
'\n'
.
join
(
[
arg_2
[
8
:
]
if
arg_2
.
startswith
(
' '
*
8
)
else
arg_2
for
arg_2
in
arg_1
.
strip
(
)
.
splitlines
(
)
]
)
else
:
return
' '
.
join
(
[
arg_2
.
strip
(
)
for
arg_2
in
arg_1
.
splitlines
(
)
]
)

def Func(arg_0, arg_1):
    """
    ``Description`` header must preserve newlines; all others need not
    """
    if arg_0.lower() == 'description':  # preserve newlines
        return '\n'.join([arg_2[8:] if arg_2.startswith(' ' * 8) else arg_2
                          for arg_2 in arg_1.strip().splitlines()])
    else:
        return ' '.join([arg_2.strip() for arg_2 in arg_1.splitlines()])

Description header must preserve newlines ; all others need not


def Func(arg_0):
    """Read color_names.txt and find the red, green, and blue values
        for a named color.
    """
    # Get the directory where this script file is located:
    arg_1 = os.path.dirname(
        os.path.realpath(
            inspect.getsourcefile(
                lambda: 0)))
    arg_2 = os.path.join(arg_1, 'color_names.txt')
    arg_3 = False
    for arg_4 in open(arg_2, 'r'):
        arg_4 = arg_4.rstrip()
        if arg_0.lower() == arg_4.split()[0]:
            #hex_color = line.split()[1]
            arg_5 = arg_4.split()[2]
            arg_6 = arg_4.split()[3]
            arg_7 = arg_4.split()[4]
            arg_3 = True
            break
    if not arg_3:
        print('Color name "%s" not found, using default (white)' % arg_0)
        arg_5 = 255
        arg_6 = 255
        arg_7 = 255
    return arg_5, arg_6, arg_7

Read color_names . txt and find the red green and blue values for a named color .


def Func ( arg_0 ) : if not arg_0 . _is_topology_running ( ) : return False arg_1 = arg_0 . pplan_helper . context . get_cluster_config ( ) . get ( api_constants . TOPOLOGY_MAX_SPOUT_PENDING ) if not arg_0 . acking_enabled and arg_0 . output_helper . is_out_queue_available ( ) : return True elif arg_0 . acking_enabled and arg_0 . output_helper . is_out_queue_available ( ) and len ( arg_0 . in_flight_tuples ) < arg_1 : return True elif arg_0 . acking_enabled and not arg_0 . in_stream . is_empty ( ) : return True else : return False

def Func(arg_0):
    """Checks whether we still need to do more work

    When the topology state is RUNNING:
    1. if the out_queue is not full and ack is not enabled, we could wake up next time to
       produce more tuples and push to the out_queue
    2. if the out_queue is not full but the acking is enabled, we need to make sure that
      the number of pending tuples is smaller than max_spout_pending
    3. if there are more to read, we will wake up itself next time.
    """
    if not arg_0._is_topology_running():
      return False

    arg_1 = \
      arg_0.pplan_helper.context.get_cluster_config().get(api_constants.TOPOLOGY_MAX_SPOUT_PENDING)

    if not arg_0.acking_enabled and arg_0.output_helper.is_out_queue_available():
      return True
    elif arg_0.acking_enabled and arg_0.output_helper.is_out_queue_available() and \
        len(arg_0.in_flight_tuples) < arg_1:
      return True
    elif arg_0.acking_enabled and not arg_0.in_stream.is_empty():
      return True
    else:
      return False


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
0
while
True
:
try
:
arg_3
=
requests
.
get
(
"http://%s:4646/v1/job/%s"
%
(
arg_0
,
arg_1
)
)
if
arg_3
.
status_code
==
200
and
arg_3
.
json
(
)
[
"Status"
]
==
"running"
:
break
else
:
raise
RuntimeError
(
)
except
:
Log
.
debug
(
sys
.
exc_info
(
)
[
0
]
)
Log
.
info
(
"Waiting for %s to come up... %s"
%
(
arg_1
,
arg_2
)
)
time
.
sleep
(
1
)
if
arg_2
>
20
:
Log
.
error
(
"Failed to start Nomad Cluster!"
)
sys
.
exit
(
1
)
arg_2
=
arg_2
+
1

def Func(arg_0, arg_1):
  '''
  Wait for a Nomad job to start
  '''
  arg_2 = 0
  while True:
    try:
      arg_3 = requests.get("http://%s:4646/v1/job/%s" % (arg_0, arg_1))
      if arg_3.status_code == 200 and arg_3.json()["Status"] == "running":
        break
      else:
        raise RuntimeError()
    except:
      Log.debug(sys.exc_info()[0])
      Log.info("Waiting for %s to come up... %s" % (arg_1, arg_2))
      time.sleep(1)
      if arg_2 > 20:
        Log.error("Failed to start Nomad Cluster!")
        sys.exit(-1)
    arg_2 = arg_2 + 1


(self, group, event, is_new, is_sample, **kwargs)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
,
**
arg_5
)
:
if
not
arg_0
.
is_configured
(
arg_1
.
project
)
:
return
arg_6
=
arg_0
.
get_option
(
'server_host'
,
arg_1
.
project
)
arg_7
=
int
(
arg_0
.
get_option
(
'server_port'
,
arg_1
.
project
)
)
arg_8
=
arg_0
.
get_option
(
'prefix'
,
arg_1
.
project
)
arg_9
=
arg_0
.
get_option
(
'hostname'
,
arg_1
.
project
)
or
socket
.
gethostname
(
)
arg_10
=
arg_1
.
project
.
get_option
(
'sentry:resolve_age'
,
)
arg_11
=
int
(
time
.
time
(
)
)
arg_12
=
'%s.%%s[%s]'
%
(
arg_8
,
arg_1
.
project
.
slug
)
arg_13
=
arg_1
.
get_level_display
(
)
arg_14
=
arg_12
%
arg_13
arg_15
=
arg_1
.
project
.
group_set
.
filter
(
status
=
STATUS_UNRESOLVED
)
if
arg_10
:
arg_16
=
timezone
.
now
(
)
timedelta
(
hours
=
int
(
arg_10
)
)
arg_15
=
arg_15
.
filter
(
last_seen__gt
=
arg_16
)
arg_17
=
arg_15
.
filter
(
arg_13
=
arg_1
.
level
)
.
count
(
)
arg_18
=
Metric
(
arg_9
,
arg_14
,
arg_17
,
arg_11
)
log
.
info
(
'will send %s=%s to zabbix'
,
arg_14
,
arg_17
)
send_to_zabbix
(
[
arg_18
]
,
arg_6
,
arg_7
)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, **arg_5):
        """
        Process error.
        """
        if not arg_0.is_configured(arg_1.project):
            return

        arg_6 = arg_0.get_option('server_host', arg_1.project)
        arg_7 = int(arg_0.get_option('server_port', arg_1.project))
        arg_8 = arg_0.get_option('prefix', arg_1.project)
        arg_9 = arg_0.get_option('hostname', arg_1.project) or socket.gethostname()
        arg_10 = arg_1.project.get_option('sentry:resolve_age', None)

        arg_11 = int(time.time())
        arg_12 = '%s.%%s[%s]' % (arg_8, arg_1.project.slug)

        arg_13 = arg_1.get_level_display()
        arg_14 = arg_12 % arg_13

        arg_15 = arg_1.project.group_set.filter(status=STATUS_UNRESOLVED)

        if arg_10:
            arg_16 = timezone.now() - timedelta(hours=int(arg_10))
            arg_15 = arg_15.filter(last_seen__gt=arg_16)

        arg_17 = arg_15.filter(arg_13=arg_1.level).count()

        arg_18 = Metric(arg_9, arg_14, arg_17, arg_11)

        log.info('will send %s=%s to zabbix', arg_14, arg_17)

        send_to_zabbix([arg_18], arg_6, arg_7)


def Func ( arg_0 , arg_1 , arg_2 ) : if distob . engine is None : arg_0 . _initial_proxy_types [ arg_1 ] = arg_2 elif isinstance ( distob . engine , ObjectHub ) : distob . engine . _runtime_reg_proxy_type ( arg_1 , arg_2 ) else : distob . engine . _singleeng_reg_proxy_type ( arg_1 , arg_2 ) pass

def Func(arg_0, arg_1, arg_2):
        """Configure engines so that remote methods returning values of type
        `real_type` will instead return by proxy, as type `proxy_type`
        """
        if distob.engine is None:
            arg_0._initial_proxy_types[arg_1] = arg_2
        elif isinstance(distob.engine, ObjectHub):
            distob.engine._runtime_reg_proxy_type(arg_1, arg_2)
        else:
            # TODO: remove next line after issue #58 in dill is fixed.
            distob.engine._singleeng_reg_proxy_type(arg_1, arg_2)
            pass

Configure engines so that remote methods returning values of type real_type will instead return by proxy as type proxy_type


def Func(arg_0, arg_1):
        """Receive ACK in REBINDING state."""
        logger.debug("C3. Received ACK?, in REBINDING state.")
        if arg_0.process_received_ack(arg_1):
            logger.debug("C3: T. Received ACK, in REBINDING state, "
                         "raise BOUND.")
            raise arg_0.BOUND()


(data, client_port, server_port, is_loopback=False)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
False
)
:
arg_4
=
_loopback
if
arg_3
else
_ethernet
try
:
arg_4
.
unpack
(
arg_0
)
except
Exception
as
ex
:
raise
ValueError
(
'Bad header: %s'
%
ex
)
arg_5
=
getattr
(
arg_4
.
data
,
'data'
,
)
if
type
(
arg_5
)
!=
dpkt
.
tcp
.
TCP
:
raise
ValueError
(
'Not a TCP packet'
)
if
arg_5
.
dport
==
arg_2
:
if
arg_1
!=
0
and
arg_5
.
sport
!=
arg_1
:
raise
ValueError
(
'Request from different client'
)
elif
arg_5
.
sport
==
arg_2
:
if
arg_1
!=
0
and
arg_5
.
dport
!=
arg_1
:
raise
ValueError
(
'Reply for different client'
)
else
:
raise
ValueError
(
'Packet not for/from client/server'
)
return
arg_4
.
data

def Func(arg_0, arg_1, arg_2, arg_3=False):
    """ if client_port is 0 any client_port is good """
    arg_4 = _loopback if arg_3 else _ethernet

    try:
        arg_4.unpack(arg_0)
    except Exception as ex:
        raise ValueError('Bad header: %s' % ex)

    arg_5 = getattr(arg_4.data, 'data', None)
    if type(arg_5) != dpkt.tcp.TCP:
        raise ValueError('Not a TCP packet')

    if arg_5.dport == arg_2:
        if arg_1 != 0 and arg_5.sport != arg_1:
            raise ValueError('Request from different client')
    elif arg_5.sport == arg_2:
        if arg_1 != 0 and arg_5.dport != arg_1:
            raise ValueError('Reply for different client')
    else:
        raise ValueError('Packet not for/from client/server')

    return arg_4.data


(get_transition_matrix_for_timestep,
                             get_transition_noise_for_timestep,
                             get_observation_matrix_for_timestep,
                             get_observation_noise_for_timestep,
                             full_sample_and_batch_shape,
                             stream,
                             validate_args=False)

def Func(arg_0,
                             arg_1,
                             arg_2,
                             arg_3,
                             arg_4,
                             arg_5,
                             arg_6=False):
  """Build a callable for one step of Kalman sampling recursion.

  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]`.
    full_sample_and_batch_shape: Desired sample and batch shape of the
      returned samples, concatenated in a single `Tensor`.
    stream: `tfd.SeedStream` instance used to generate a
      sequence of random seeds.
    validate_args: if True, perform error checking at runtime.

  Returns:
    sample_step: a callable that samples the latent state and
      observation at time `t`, given latent state at time `t-1`.
  """

  def sample_step(arg_7, arg_8):
    """Sample values for a single timestep."""
    arg_9, arg_10 = arg_7

    arg_11 = arg_0(arg_8 - 1)
    arg_12 = arg_1(arg_8 - 1)

    arg_13 = arg_11.matmul(arg_9)
    arg_14 = arg_13 + arg_12.sample(
        sample_shape=_augment_sample_shape(
            arg_12,
            arg_4,
            arg_6),
        seed=arg_5())[..., tf.newaxis]

    arg_15 = arg_2(arg_8)
    arg_16 = arg_3(arg_8)

    arg_17 = arg_15.matmul(arg_14)
    arg_18 = arg_17 + arg_16.sample(
        sample_shape=_augment_sample_shape(
            arg_16,
            arg_4,
            arg_6),
        seed=arg_5())[..., tf.newaxis]

    return (arg_14, arg_18)

  return sample_step

Build a callable for one step of Kalman sampling recursion .