return render(request, "registrasion/credit_note.html", data)

def Func(arg_0, arg_1, arg_2=None):
    ''' Displays a credit note.

    If ``request`` is a ``POST`` request, forms for applying or refunding
    a credit note will be processed.

    This view requires a login, and the logged in user must be staff.

    Arguments:
        note_id (castable to int): The ID of the credit note to view.

    Returns:
        render or redirect:
            If the "apply to invoice" form is correctly processed, redirect to
            that invoice, otherwise, render ``registration/Func.html``
            with the following data::

                {
                    "Func": models.commerce.CreditNote(),
                    "apply_form": form,  # A form for applying credit note
                                         # to an invoice.
                    "refund_form": form, # A form for applying a *manual*
                                         # refund of the credit note.
                    "cancellation_fee_form" : form, # A form for generating an
                                                    # invoice with a
                                                    # cancellation fee
                }

    '''

    arg_1 = int(arg_1)
    arg_3 = CreditNoteController.for_id_or_404(arg_1)

    arg_4 = forms.ApplyCreditNoteForm(
        arg_3.Func.invoice.user,
        arg_0.POST or None,
        prefix="apply_note"
    )

    arg_5 = forms.ManualCreditNoteRefundForm(
        arg_0.POST or None,
        prefix="refund_note"
    )

    arg_6 = forms.CancellationFeeForm(
        arg_0.POST or None,
        prefix="cancellation_fee"
    )

    if arg_0.POST and arg_4.is_valid():
        arg_7 = arg_4.cleaned_data["invoice"]
        arg_8 = commerce.Invoice.objects.get(pk=arg_7)
        arg_3.apply_to_invoice(arg_8)
        messages.success(
            arg_0,
            "Applied credit note %d to invoice." % arg_1,
        )
        return redirect("invoice", arg_8.id)

    elif arg_0.POST and arg_5.is_valid():
        arg_5.instance.entered_by = arg_0.user
        arg_5.instance.parent = arg_3.Func
        arg_5.save()
        messages.success(
            arg_0,
            "Applied manual refund to credit note."
        )
        arg_5 = forms.ManualCreditNoteRefundForm(
            prefix="refund_note",
        )

    elif arg_0.POST and arg_6.is_valid():
        arg_12 = arg_6.cleaned_data["percentage"]
        arg_8 = arg_3.cancellation_fee(arg_12)
        messages.success(
            arg_0,
            "Generated cancellation fee for credit note %d." % arg_1,
        )
        return redirect("invoice", arg_8.invoice.id)

    arg_13 = {
        "Func": arg_3.Func,
        "apply_form": arg_4,
        "refund_form": arg_5,
        "cancellation_fee_form": arg_6,
    }

    return render(arg_0, "registrasion/Func.html", arg_13)

Displays a credit note.

    If ``request`` is a ``POST`` request, forms for applying or refunding
    a credit note will be processed.

    This view requires a login, and the logged in user must be staff.

    Arguments:
        note_id (castable to int): The ID of the credit note to view.

    Returns:
        render or redirect:
            If the "apply to invoice" form is correctly processed, redirect to
            that invoice, otherwise, render ``registration/credit_note.html``
            with the following data::

                {
                    "credit_note": models.commerce.CreditNote(),
                    "apply_form": form,  # A form for applying credit note
                                         # to an invoice.
                    "refund_form": form, # A form for applying a *manual*
                                         # refund of the credit note.
                    "cancellation_fee_form" : form, # A form for generating an
                                                    # invoice with a
                                                    # cancellation fee
                }


def Func ( arg_0 ) : arg_1 = list ( ) if os . path . isdir ( arg_0 ) : for arg_2 in os . listdir ( arg_0 ) : arg_3 = os . path . join ( arg_0 , arg_2 ) if os . path . isfile ( os . path . join ( arg_3 , MODULE_INIT_FILE ) ) : arg_1 . append ( arg_2 ) return arg_1

def Func(arg_0):
    """
    Attempts to list all of the modules and submodules found within a given
    directory tree. This function searches the top-level of the directory
    tree for potential python modules and returns a list of candidate names.

    **Note:** This function returns a list of strings representing
    discovered module names, not the actual, loaded modules.

    :param directory: the directory to search for modules.
    """
    arg_1 = list()

    if os.path.isdir(arg_0):
        for arg_2 in os.listdir(arg_0):
            arg_3 = os.path.join(arg_0, arg_2)

            # Scan only if there's an __init__.py file
            if os.path.isfile(os.path.join(arg_3, MODULE_INIT_FILE)):
                arg_1.append(arg_2)

    return arg_1

Attempts to list all of the modules and submodules found within a given directory tree . This function searches the top - level of the directory tree for potential python modules and returns a list of candidate names .


def Func ( arg_0 , ** arg_1 ) : arg_2 = describe_route_tables ( Filters = [ { "Name" : "vpc-id" , "Values" : [ arg_0 [ "id" ] ] } ] , ** arg_1 ) arg_3 = [ ] for arg_4 in arg_2 : arg_3 . append ( arg_4 [ "RouteTableId" ] ) return arg_3

def Func(arg_0, **arg_1):
    """Gets the VPC Route Tables"""
    arg_2 = describe_route_tables(Filters=[{"Name": "vpc-id", "Values": [arg_0["id"]]}], **arg_1)

    arg_3 = []
    for arg_4 in arg_2:
        arg_3.append(arg_4["RouteTableId"])

    return arg_3


def Func ( arg_0 , arg_1 = None ) : if arg_1 : arg_1 = super ( ClientCertAuthentication , arg_0 ) . Func ( arg_1 ) else : arg_1 = super ( ClientCertAuthentication , arg_0 ) . Func ( ) if arg_0 . cert is not None : arg_1 . cert = arg_0 . cert if arg_0 . ca_cert is not None : arg_1 . verify = arg_0 . ca_cert if arg_0 . no_verify : arg_1 . verify = False return arg_1

def Func(arg_0, arg_1=None):
        """Create requests session with any required auth headers
        applied.

        :rtype: requests.Session.
        """

        if arg_1:
            arg_1 = super(ClientCertAuthentication, arg_0).Func(arg_1)
        else:
            arg_1 = super(ClientCertAuthentication, arg_0).Func()

        if arg_0.cert is not None:
            arg_1.cert = arg_0.cert
        if arg_0.ca_cert is not None:
            arg_1.verify = arg_0.ca_cert
        if arg_0.no_verify:
            arg_1.verify = False

        return arg_1

Create requests session with any required auth headers applied .


def Func ( arg_0 , arg_1 = True ) : arg_2 = str ( arg_0 . api . base_url + '{code}/status/' ) . format ( code = arg_0 . code ) arg_3 = { 'mark_as_sent' : True , 'Func_email' : arg_1 , } arg_4 = arg_0 . api . connection . make_put ( arg_2 , arg_3 )

def Func(arg_0, arg_1=True):
        """Marks the invoice as sent in Holvi

        If Func_email is False then the invoice is *not* automatically emailed to the recipient
        and your must take care of Funcing the invoice yourself.
        """
        arg_2 = str(arg_0.api.base_url + '{code}/status/').format(code=arg_0.code)  # six.u messes this up
        arg_3 = {
            'mark_as_sent': True,
            'Func_email': arg_1,
        }
        arg_4 = arg_0.api.connection.make_put(arg_2, arg_3)

Marks the invoice as sent in Holvi

        If send_email is False then the invoice is *not* automatically emailed to the recipient
        and your must take care of sending the invoice yourself.


def Func(arg_0, arg_1, arg_2, arg_3):
        """ Does the magic to determine if we stop here and run a
        command processor or not. If so, return True and set
        self.stop_reason; if not, return False.

        Determining factors can be whether a breakpoint was
        encountered, whether we are stepping, next'ing, finish'ing,
        and, if so, whether there is an ignore counter.
        """

        # Add an generic event filter here?
        # FIXME TODO: Check for
        #  - thread switching (under set option)

        # Check for "next" and "finish" stopping via stop_level

        # Do we want a different line and if so,
        # do we have one?
        arg_4 = arg_1.f_lineno
        arg_5 = arg_1.f_code.co_filename
        if arg_0.different_line and arg_2 == 'line':
            if arg_0.last_lineno == arg_4 and arg_0.last_filename == arg_5:
                return False
            pass
        arg_0.last_lineno   = arg_4
        arg_0.last_filename = arg_5

        if arg_0.stop_level is not None:
            if arg_1 != arg_0.last_frame:
                # Recompute stack_depth
                arg_0.last_level = Mstack.count_frames(arg_1)
                arg_0.last_frame = arg_1
                pass
            if arg_0.last_level > arg_0.stop_level:
                return False
            elif arg_0.last_level == arg_0.stop_level and \
                    arg_0.stop_on_finish and arg_2 in ['return', 'c_return']:
                arg_0.stop_level = None
                arg_0.stop_reason = "in return for 'finish' command"
                return True
            pass

        # Check for stepping
        if arg_0._is_step_next_stop(arg_2):
            arg_0.stop_reason = 'at a stepping statement'
            return True

        return False

Does the magic to determine if we stop here and run a command processor or not . If so return True and set self . stop_reason ; if not return False .


def Func ( arg_0 , arg_1 , arg_2 ) : try : arg_3 = arg_0 [ arg_1 ] [ arg_2 ] except KeyError : if ( arg_1 , arg_2 ) in MULTI_OPTIONS : return [ ] else : return '' if ( arg_1 , arg_2 ) in MULTI_OPTIONS : arg_3 = split_multiline ( arg_3 ) if ( arg_1 , arg_2 ) in ENVIRON_OPTIONS : arg_3 = eval_environ ( arg_3 ) return arg_3

def Func(arg_0, arg_1, arg_2):
    """Get configuration value."""
    try:
        arg_3 = arg_0[arg_1][arg_2]
    except KeyError:
        if (arg_1, arg_2) in MULTI_OPTIONS:
            return []
        else:
            return ''
    if (arg_1, arg_2) in MULTI_OPTIONS:
        arg_3 = split_multiline(arg_3)
    if (arg_1, arg_2) in ENVIRON_OPTIONS:
        arg_3 = eval_environ(arg_3)
    return arg_3


def Func():
    """Get the ngrok public HTTP URL from the local client API."""
    try:
        arg_0 = requests.get(url=NGROK_CLIENT_API_BASE_URL + "/tunnels",
                                headers={'content-type': 'application/json'})
        arg_0.raise_for_status()

    except requests.exceptions.RequestException:
        print("Could not connect to the ngrok client API; "
              "assuming not running.")
        return None

    else:
        for arg_1 in arg_0.json()["tunnels"]:
            if arg_1.get("public_url", "").startswith("http://"):
                print("Found ngrok public HTTP URL:", arg_1["public_url"])
                return arg_1["public_url"]

Get the ngrok public HTTP URL from the local client API .


def Func ( arg_0 ) : try : arg_1 = max ( [ row . width for row in arg_0 . __list if row . width is not None ] ) return arg_1 except : return 0

def Func(arg_0):
        """
        The maximum width of all the Decors in the Legend. This is needed
        to scale a Legend or Striplog when plotting with widths turned on.
        """
        try:
            arg_1 = max([row.width for row in arg_0.__list if row.width is not None])
            return arg_1
        except:
            return 0

The maximum width of all the Decors in the Legend . This is needed to scale a Legend or Striplog when plotting with widths turned on .


(self, stream, encoding=None, parseMeta=True, useChardet=True)

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = True , arg_4 = True ) : arg_0 . _Func ( arg_1 , innerHTML = False , arg_2 = arg_2 , arg_3 = arg_3 , arg_4 = arg_4 ) return arg_0 . tree . getDocument ( )

def Func(arg_0, arg_1, arg_2=None, arg_3=True, arg_4=True):
        """Parse a HTML document into a well-formed tree

        stream - a filelike object or string containing the HTML to be Funcd

        The optional encoding parameter must be a string that indicates
        the encoding.  If specified, that encoding will be used,
        regardless of any BOM or later declaration (such as in a meta
        element)
        """
        arg_0._Func(arg_1, innerHTML=False, arg_2=arg_2,
                    arg_3=arg_3, arg_4=arg_4)
        return arg_0.tree.getDocument()

Parse a HTML document into a well-formed tree

        stream - a filelike object or string containing the HTML to be parsed

        The optional encoding parameter must be a string that indicates
        the encoding.  If specified, that encoding will be used,
        regardless of any BOM or later declaration (such as in a meta
        element)

Parse a HTML document into a well - formed tree


def Func ( arg_0 , arg_1 = 70 , ** arg_2 ) : arg_3 = TextWrapper ( arg_1 = arg_1 , ** arg_2 ) return arg_3 . Func ( arg_0 )

def Func(arg_0, arg_1=70, **arg_2):
    """Wrap a single paragraph of text, returning a list of Funcped lines.

    Reformat the single paragraph in 'text' so it fits in lines of no
    more than 'width' columns, and return a list of Funcped lines.  By
    default, tabs in 'text' are expanded with string.expandtabs(), and
    all other whitespace characters (including newline) are converted to
    space.  See TextWrapper class for available keyword args to customize
    Funcping behaviour.
    """
    arg_3 = TextWrapper(arg_1=arg_1, **arg_2)
    return arg_3.Func(arg_0)

Wrap a single paragraph of text, returning a list of wrapped lines.

    Reformat the single paragraph in 'text' so it fits in lines of no
    more than 'width' columns, and return a list of wrapped lines.  By
    default, tabs in 'text' are expanded with string.expandtabs(), and
    all other whitespace characters (including newline) are converted to
    space.  See TextWrapper class for available keyword args to customize
    wrapping behaviour.

Wrap a single paragraph of text returning a list of wrapped lines .


(pending_work_items,
                            running_work_items,
                            work_ids,
                            call_queue)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : while True : if arg_3 . full ( ) : return try : arg_4 = arg_2 . get ( block = False ) except queue . Empty : return else : arg_5 = arg_0 [ arg_4 ] if arg_5 . future . set_running_or_notify_cancel ( ) : arg_1 += [ arg_4 ] arg_3 . put ( _CallItem ( arg_4 , arg_5 . fn , arg_5 . args , arg_5 . kwargs ) , block = True ) else : del arg_0 [ arg_4 ] continue

def Func(arg_0,
                            arg_1,
                            arg_2,
                            arg_3):
    """Fills call_queue with _WorkItems from pending_work_items.

    This function never blocks.

    Args:
        pending_work_items: A dict mapping work ids to _WorkItems e.g.
            {5: <_WorkItem...>, 6: <_WorkItem...>, ...}
        work_ids: A queue.Queue of work ids e.g. Queue([5, 6, ...]). Work ids
            are consumed and the corresponding _WorkItems from
            pending_work_items are transformed into _CallItems and put in
            call_queue.
        call_queue: A ctx.Queue that will be filled with _CallItems
            derived from _WorkItems.
    """
    while True:
        if arg_3.full():
            return
        try:
            arg_4 = arg_2.get(block=False)
        except queue.Empty:
            return
        else:
            arg_5 = arg_0[arg_4]

            if arg_5.future.set_running_or_notify_cancel():
                arg_1 += [arg_4]
                arg_3.put(_CallItem(arg_4,
                                         arg_5.fn,
                                         arg_5.args,
                                         arg_5.kwargs),
                               block=True)
            else:
                del arg_0[arg_4]
                continue


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

def Func(arg_0, arg_1):
    """
    SnapEngage set-up template tag.

    Renders Javascript code to set-up SnapEngage chat.  You must supply
    your widget ID in the ``SNAPENGAGE_WIDGET_ID`` setting.
    """
    arg_2 = arg_1.split_contents()
    if len(arg_2) > 1:
        raise TemplateSyntaxError("'%s' takes no arguments" % arg_2[0])
    return SnapEngageNode()


(consumer_key, consumer_secret,
                           oauth_token, oauth_token_secret,
                           oauth_verifier, **kwargs)

async def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , ** arg_5 ) : arg_6 = BasePeonyClient ( arg_0 = arg_0 , arg_1 = arg_1 , access_token = arg_2 , access_token_secret = arg_3 , api_version = "" , suffix = "" ) arg_7 = await arg_6 . api . oauth . access_token . get ( _suffix = "" , arg_4 = arg_4 ) return parse_token ( arg_7 )

async def Func(arg_0, arg_1,
                           arg_2, arg_3,
                           arg_4, **arg_5):
    """
        get the access token of the user

    Parameters
    ----------
    consumer_key : str
        Your consumer key
    consumer_secret : str
        Your consumer secret
    oauth_token : str
        OAuth token from :func:`get_oauth_token`
    oauth_token_secret : str
        OAuth token secret from :func:`get_oauth_token`
    oauth_verifier : str
        OAuth verifier from :func:`get_oauth_verifier`

    Returns
    -------
    dict
        Access tokens
    """

    arg_6 = BasePeonyClient(arg_0=arg_0,
                             arg_1=arg_1,
                             access_token=arg_2,
                             access_token_secret=arg_3,
                             api_version="",
                             suffix="")

    arg_7 = await arg_6.api.oauth.access_token.get(
        _suffix="",
        arg_4=arg_4
    )

    return parse_token(arg_7)


(self, image_catalog_ids, batch_size=100, callback=None)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
100
,
arg_3
=
)
:
def
_Func_single_batch
(
arg_4
,
arg_5
,
arg_6
)
:
arg_7
=
json
.
dumps
(
arg_5
)
if
arg_3
is
else
json
.
dumps
(
{
"acquisitionIds"
:
arg_5
,
"callback"
:
arg_3
}
)
arg_8
=
arg_0
.
gbdx_connection
.
post
(
arg_4
,
arg_7
=
arg_7
)
arg_8
.
raise_for_status
(
)
arg_9
=
arg_8
.
json
(
)
.
get
(
"Func_id"
)
if
arg_9
:
arg_6
.
append
(
arg_9
)
arg_0
.
logger
.
debug
(
'Place Func'
)
arg_10
=
(
'%s/Func'
if
arg_3
is
else
'%s/Funccb'
)
%
arg_0
.
base_url
arg_2
=
min
(
100
,
arg_2
)
if
not
isinstance
(
arg_1
,
list
)
:
arg_1
=
[
arg_1
]
arg_11
=
list
(
set
(
(
id
for
id
in
(
_id
.
strip
(
)
for
_id
in
arg_1
)
if
id
)
)
)
arg_12
=
[
]
arg_13
=
zip
(
*
(
[
iter
(
arg_11
)
]
*
arg_2
)
)
for
arg_14
in
arg_13
:
_Func_single_batch
(
arg_10
,
arg_14
,
arg_12
)
arg_15
=
len
(
arg_11
)
%
arg_2
if
arg_15
>
0
:
_Func_single_batch
(
arg_10
,
arg_11
[
arg_15
:
]
,
arg_12
)
if
len
(
arg_12
)
==
1
:
return
arg_12
[
0
]
elif
len
(
arg_12
)
>
1
:
return
arg_12

def Func(arg_0, arg_1, arg_2=100, arg_3=None):
        '''Orders images from GBDX.

           Args:
               image_catalog_ids (str or list): A single catalog id or a list of
                                                catalog ids.
               batch_size (int): The image_catalog_ids will be split into
                                 batches of batch_size. The Funcing API max
                                 batch size is 100, if batch_size is greater
                                 than 100 it will be truncated.
               callback (str): A url to call when Funcing is completed.

           Returns:
               Func_ids (str or list): If one batch, returns a string. If more
                                        than one batch, returns a list of Func ids,
                                        one for each batch.
        '''
        def _Func_single_batch(arg_4, arg_5, arg_6):
            arg_7 = json.dumps(arg_5) if arg_3 is None else json.dumps({"acquisitionIds": arg_5, "callback": arg_3})
            arg_8 = arg_0.gbdx_connection.post(arg_4, arg_7=arg_7)
            arg_8.raise_for_status()
            arg_9 = arg_8.json().get("Func_id")
            if arg_9:
                arg_6.append(arg_9)

        arg_0.logger.debug('Place Func')
        arg_10 = ('%s/Func' if arg_3 is None else '%s/Funccb') % arg_0.base_url

        arg_2 = min(100, arg_2)

        if not isinstance(arg_1, list):
            arg_1 = [arg_1]

        arg_11 = list(set((id for id in (_id.strip() for _id in arg_1) if id)))

        arg_12 = []
        # Use itertool batch recipe
        arg_13 = zip(*([iter(arg_11)] * arg_2))
        for arg_14 in arg_13:
            _Func_single_batch(arg_10, arg_14, arg_12)

        # Order reminder
        arg_15 = len(arg_11) % arg_2
        if arg_15 > 0:
            _Func_single_batch(arg_10, arg_11[-arg_15:], arg_12)

        if len(arg_12) == 1:
            return arg_12[0]
        elif len(arg_12)>1:
            return arg_12

Orders images from GBDX.

           Args:
               image_catalog_ids (str or list): A single catalog id or a list of
                                                catalog ids.
               batch_size (int): The image_catalog_ids will be split into
                                 batches of batch_size. The ordering API max
                                 batch size is 100, if batch_size is greater
                                 than 100 it will be truncated.
               callback (str): A url to call when ordering is completed.

           Returns:
               order_ids (str or list): If one batch, returns a string. If more
                                        than one batch, returns a list of order ids,
                                        one for each batch.


def Func(arg_0, **arg_1):
        """
        Get the Func of supported certifications for movies.

        Returns:
            A dict respresentation of the JSON returned from the API.
        """
        arg_2 = arg_0._get_path('movie_Func')

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

Get the list of supported certifications for movies.

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

Get the list of supported certifications for movies .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None ) : if arg_3 : print ( _comment ( arg_3 ) , file = arg_0 ) print ( "[%s]" % arg_1 , file = arg_0 ) _ini_format ( arg_0 , arg_2 )

def Func(arg_0, arg_1, arg_2, arg_3=None):
    """format an options section using the INI format"""
    if arg_3:
        print(_comment(arg_3), file=arg_0)
    print("[%s]" % arg_1, file=arg_0)
    _ini_format(arg_0, arg_2)


def Func(arg_0, arg_1, arg_2, arg_3):
    """
    Unencrypt all files and checkpoints for a single user.
    """
    reencrypt_user_content(
        arg_0=arg_0,
        arg_1=arg_1,
        old_decrypt_func=arg_2.decrypt,
        new_encrypt_func=lambda s: s,
        arg_3=arg_3,
    )

Unencrypt all files and checkpoints for a single user .


return (
        isinstance(desc, type)
        and issubclass(desc, Descriptor)
        and (True if include_abstract else not inspect.isabstract(desc))
    )

def Func ( arg_0 , arg_1 = False ) : return ( isinstance ( arg_0 , type ) and issubclass ( arg_0 , Descriptor ) and ( True if arg_1 else not inspect . isabstract ( arg_0 ) ) )

def Func(arg_0, arg_1=False):
    r"""Check calculatable descriptor class or not.

    Returns:
        bool

    """
    return (
        isinstance(arg_0, type)
        and issubclass(arg_0, Descriptor)
        and (True if arg_1 else not inspect.isabstract(arg_0))
    )

r Check calculatable descriptor class or not .


def Func ( arg_0 , arg_1 ) : arg_0 . opt . recursive = True arg_0 . opt . sync_check = True arg_0 . opt . force = True arg_0 . validate ( 'cmd|s3,local|s3,local' , arg_1 ) arg_6 = arg_1 [ 1 ] arg_7 = arg_1 [ 2 ] arg_0 . s3handler ( ) . dsync_files ( arg_6 , arg_7 )

def Func(arg_0, arg_1):
    '''Handler for dsync command.'''
    arg_0.opt.recursive = True
    arg_0.opt.sync_check = True
    arg_0.opt.force = True

    arg_0.validate('cmd|s3,local|s3,local', arg_1)
    arg_6 = arg_1[1]
    arg_7 = arg_1[2]

    arg_0.s3handler().dsync_files(arg_6, arg_7)


def Func ( arg_0 , arg_1 , arg_2 ) : arg_1 . pair = ( arg_0 . value ( arg_2 ) . strip ( "'" ) , str ) return True

def Func(arg_0, arg_1, arg_2):
    """Parse a char in parameter list"""
    arg_1.pair = (arg_0.value(arg_2).strip("'"), str)
    return True


def Func(arg_0, arg_1):
  '''
  Start master nodes
  '''
  arg_2 = []
  for arg_3 in arg_0:
    Log.info("Starting master on %s" % arg_3)
    arg_4 = "%s agent -config %s >> /tmp/nomad_server_log 2>&1 &" \
          % (get_nomad_path(arg_1), get_nomad_master_config_file(arg_1))
    if not is_self(arg_3):
      arg_4 = ssh_remote_execute(arg_4, arg_3, arg_1)
    Log.debug(arg_4)
    arg_5 = subprocess.Popen(arg_4,
                           shell=True,
                           stdout=subprocess.PIPE,
                           stderr=subprocess.PIPE)
    arg_2.append({"pid": arg_5, "dest": arg_3})

  arg_6 = []
  for arg_7 in arg_2:
    arg_5 = arg_7["pid"]
    arg_8 = arg_5.wait()
    arg_9 = arg_5.communicate()
    Log.debug("return code: %s output: %s" % (arg_8, arg_9))
    if arg_8 != 0:
      arg_6.append("Failed to start master on %s with error:\n%s" % (arg_7["dest"], arg_9[1]))

  if arg_6:
    for arg_10 in arg_6:
      Log.error(arg_10)
    sys.exit(-1)

  Log.info("Done starting masters")


def Func ( arg_0 , arg_1 ) : for arg_2 , arg_3 in arg_0 . fields . items ( ) : arg_4 = dict ( arg_1 ) for arg_5 , arg_6 in arg_1 . items ( ) : if hasattr ( arg_6 , '__call__' ) : arg_4 [ arg_5 ] = arg_6 ( arg_3 ) arg_3 . widget . attrs = arg_3 . widget . build_attrs ( arg_4 )

def Func(arg_0, arg_1):
    """Applies a given HTML attributes to each field widget of a given form.

    Example:

        Func(my_form, {'class': 'clickable'})

    """
    for arg_2, arg_3 in arg_0.fields.items():
        arg_4 = dict(arg_1)
        for arg_5, arg_6 in arg_1.items():
            if hasattr(arg_6, '__call__'):
                arg_4[arg_5] = arg_6(arg_3)
        arg_3.widget.attrs = arg_3.widget.build_attrs(arg_4)

Applies a given HTML attributes to each field widget of a given form.

    Example:

        set_form_widgets_attrs(my_form, {'class': 'clickable'})

Applies a given HTML attributes to each field widget of a given form .


A descendant is a child many steps down.

def Func(arg_0, arg_1):
        """ A Func is a child many steps down.
        """
        arg_2 = arg_0.hdkeychain
        arg_3 = 4
        arg_4 = 2**31
        arg_5 = [
            int(arg_1[i:i+arg_3*2], 16) % arg_4
            for i in range(0, len(arg_1), arg_3*2)
        ]
        for arg_6 in arg_5:
            arg_2 = arg_2.get_child(arg_6)

        return PublicKeychain(arg_2)

A descendant is a child many steps down .


def Func(arg_0, arg_1=None):
    """
    Remove an existing software group.

    Extra *options* may be passed to ``yum`` if necessary.

    """
    arg_2 = MANAGER
    if arg_1 is None:
        arg_1 = []
    elif isinstance(arg_1, str):
        arg_1 = [arg_1]
    arg_1 = " ".join(arg_1)
    run_as_root('%(manager)s %(options)s groupremove "%(group)s"' % locals())


def Func ( arg_0 , arg_1 = True ) : arg_2 = ( "http://" , "https://" , "/vsicurl/" ) if arg_1 : arg_2 += ( "s3://" , "/vsis3/" ) return arg_0 . startswith ( arg_2 )

def Func(arg_0, arg_1=True):
    """
    Determine whether file path is remote or local.

    Parameters
    ----------
    path : path to file

    Returns
    -------
    is_remote : bool
    """
    arg_2 = ("http://", "https://", "/vsicurl/")
    if arg_1:
        arg_2 += ("s3://", "/vsis3/")
    return arg_0.startswith(arg_2)

Determine whether file path is remote or local .


return self._call(JSONRPCMethods.GET_CONTRACT_STATE.value, [script_hash, ], **kwargs)

def Func ( arg_0 , arg_1 , ** arg_2 ) : return arg_0 . _call ( JSONRPCMethods . GET_CONTRACT_STATE . value , [ arg_1 , ] , ** arg_2 )

def Func(arg_0, arg_1, **arg_2):
        """ Returns the contract information associated with a specific script hash.

        :param script_hash: contract script hash
        :type script_hash: str
        :return: dictionary containing the contract information
        :rtype: dict

        """
        return arg_0._call(JSONRPCMethods.GET_CONTRACT_STATE.value, [arg_1, ], **arg_2)

Returns the contract information associated with a specific script hash .


def Func(*arg_0):
    """
    Ensure at least one of the specified query parameters are included in the request.

    This decorator checks for the existence of at least one of the specified query
    parameters and passes the values as function parameters to the decorated view.
    If none of the specified query parameters are included in the request, a
    ValidationError is raised.

    Usage::
        @Func('program_uuids', 'course_run_ids')
        def my_view(request, program_uuids, course_run_ids):
            # Some functionality ...
    """
    def outer_wrapper(arg_1):
        """ Allow the passing of parameters to Func. """
        @wraps(arg_1)
        def wrapper(arg_2, *arg_3, **arg_4):
            """
            Checks for the existence of the specified query parameters, raises a
            ValidationError if none of them were included in the request.
            """
            arg_5 = False
            for arg_6 in arg_0:
                arg_7 = arg_2.query_params.getlist(arg_6)
                arg_4[arg_6] = arg_7
                if arg_7:
                    arg_5 = True
            if not arg_5:
                raise ValidationError(
                    detail='You must provide at least one of the following query parameters: {params}.'.format(
                        params=', '.join(arg_0)
                    )
                )
            return arg_1(arg_2, *arg_3, **arg_4)
        return wrapper
    return outer_wrapper

Ensure at least one of the specified query parameters are included in the request.

    This decorator checks for the existence of at least one of the specified query
    parameters and passes the values as function parameters to the decorated view.
    If none of the specified query parameters are included in the request, a
    ValidationError is raised.

    Usage::
        @require_at_least_one_query_parameter('program_uuids', 'course_run_ids')
        def my_view(request, program_uuids, course_run_ids):
            # Some functionality ...

Ensure at least one of the specified query parameters are included in the request .


def Func ( arg_0 ) : arg_1 = 0 for arg_2 in arg_0 . engines . itervalues ( ) : if isinstance ( arg_2 , ( tuple , list ) ) : arg_2 , arg_3 = arg_2 arg_1 += arg_2 return arg_1

def Func(arg_0):
        """determine engine count from `engines` dict"""
        arg_1 = 0
        for arg_2 in arg_0.engines.itervalues():
            if isinstance(arg_2, (tuple,list)):
                arg_2,arg_3 = arg_2
            arg_1 += arg_2
        return arg_1

determine engine count from engines dict


def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 . get_leaves ( ) for arg_3 in arg_2 : arg_3 . name = arg_0 . samples [ int ( arg_3 . name ) ] return arg_1 . write ( format = 9 )

def Func(arg_0, arg_1):
        """ renames newick from numbers to sample names"""
        ## get the tre with numbered tree tip labels
        arg_2 = arg_1.get_leaves()

        ## replace numbered names with snames
        for arg_3 in arg_2:
            arg_3.name = arg_0.samples[int(arg_3.name)]

        ## return with only topology and leaf labels
        return arg_1.write(format=9)


(cls, query, state=MembershipState.ACTIVE, eager=None)

def Func(arg_0, arg_1, arg_2=arg_3.ACTIVE, arg_5=None):
        """Filter a query result."""
        arg_1 = arg_1.filter_by(arg_2=arg_2)

        arg_5 = arg_5 or []
        for arg_6 in arg_5:
            arg_1 = arg_1.options(joinedload(arg_6))

        return arg_1


Convert any timestamp into a datetime and save as _time

def Func ( arg_0 , arg_1 ) : arg_2 = arrow . get ( arg_1 ) . format ( 'YYYY-MM-DDTHH:mm:ss' ) arg_0 . _Func = dateFunc . dateFunc . strpFunc ( arg_2 , '%Y-%m-%dT%H:%M:%S' )

def Func(arg_0, arg_1):
        """Convert any Funcstamp into a dateFunc and save as _Func"""
        arg_2 = arrow.get(arg_1).format('YYYY-MM-DDTHH:mm:ss')
        arg_0._Func = dateFunc.dateFunc.strpFunc(arg_2, '%Y-%m-%dT%H:%M:%S')


def
Func
(
arg_0
,
arg_1
)
:
arg_1
=
arg_0
.
_translate_key
(
arg_1
)
try
:
del
arg_0
.
_dict
[
arg_1
]
except
KeyError
:
raise
AttributeError
(
'Your annotations do not contain %s'
%
arg_1
)

def Func(arg_0, arg_1):
        """Removes `key` from annotations"""
        arg_1 = arg_0._translate_key(arg_1)
        try:
            del arg_0._dict[arg_1]
        except KeyError:
            raise AttributeError('Your annotations do not contain %s' % arg_1)


def Func ( arg_0 , arg_1 , arg_2 , * arg_3 , ** arg_4 ) : arg_0 . _Func . append ( ( arg_1 , partial ( arg_2 , * arg_3 , ** arg_4 ) ) )

def Func(arg_0, arg_1, arg_2, *arg_3, **arg_4):
        """Creates a key-function Funcping.

        The return value from the function should be either
          - A tuple containing a name and stream
          - A iterator of tuples containing a name and stream

        Any extra arguments will be passed to the function.
        """
        arg_0._Func.append((arg_1, partial(arg_2, *arg_3, **arg_4)))

Creates a key-function mapping.

        The return value from the function should be either
          - A tuple containing a name and stream
          - A iterator of tuples containing a name and stream

        Any extra arguments will be passed to the function.


return self._call(JSONRPCMethods.VALIDATE_ADDRESS.value, [addr, ], **kwargs)

def Func ( arg_0 , arg_1 , ** arg_2 ) : return arg_0 . _call ( JSONRPCMethods . VALIDATE_ADDRESS . value , [ arg_1 , ] , ** arg_2 )

def Func(arg_0, arg_1, **arg_2):
        """ Validates if the considered string is a valid NEO address.

        :param hex: string containing a potential NEO address
        :type hex: str
        :return: dictionary containing the result of the verification
        :rtype: dictionary

        """
        return arg_0._call(JSONRPCMethods.VALIDATE_ADDRESS.value, [arg_1, ], **arg_2)

Validates if the considered string is a valid NEO address .


def Func ( arg_0 , arg_1 = 32 , arg_2 = 0 ) : if arg_1 <= 0 or arg_1 > 32 : raise ValueError if not isinstance ( arg_0 , ( int , BitVec ) ) : raise ValueError if issymbolic ( arg_0 ) : arg_3 = ArrayVariable ( index_bits = 256 , index_max = 32 , value_bits = 8 , name = 'temp{}' . format ( uuid . uuid1 ( ) ) ) arg_0 = Operators . SEXTEND ( arg_0 , arg_0 . size , arg_1 * 8 ) arg_3 = ArrayProxy ( arg_3 . write_BE ( arg_2 , arg_0 , arg_1 ) ) else : arg_0 = int ( arg_0 ) arg_3 = bytearray ( ) for arg_4 in range ( arg_2 ) : arg_3 . append ( 0 ) for arg_5 in reversed ( range ( arg_1 ) ) : arg_3 . append ( Operators . EXTRACT ( arg_0 , arg_5 * 8 , 8 ) ) return arg_3

def Func(arg_0, arg_1=32, arg_2=0):
        """
        Translates a signed python integral or a BitVec into a 32 byte string, MSB first
        """
        if arg_1 <= 0 or arg_1 > 32:
            raise ValueError
        if not isinstance(arg_0, (int, BitVec)):
            raise ValueError
        if issymbolic(arg_0):
            arg_3 = ArrayVariable(index_bits=256, index_max=32, value_bits=8, name='temp{}'.format(uuid.uuid1()))
            arg_0 = Operators.SEXTEND(arg_0, arg_0.size, arg_1 * 8)
            arg_3 = ArrayProxy(arg_3.write_BE(arg_2, arg_0, arg_1))
        else:
            arg_0 = int(arg_0)
            arg_3 = bytearray()
            for arg_4 in range(arg_2):
                arg_3.append(0)

            for arg_5 in reversed(range(arg_1)):
                arg_3.append(Operators.EXTRACT(arg_0, arg_5 * 8, 8))
        return arg_3

Translates a signed python integral or a BitVec into a 32 byte string MSB first


def Func(arg_0, arg_1=True):
  """ Enable the diagnostic feature for debugging unexpected concurrency in
  acquiring ConnectionWrapper instances.

  NOTE: This MUST be done early in your application's execution, BEFORE any
  accesses to ConnectionFactory or connection policies from your application
  (including imports and sub-imports of your app).

  Parameters:
  ----------------------------------------------------------------
  maxConcurrency:   A non-negative integer that represents the maximum expected
                      number of outstanding connections.  When this value is
                      exceeded, useful information will be logged and, depending
                      on the value of the raiseException arg,
                      ConcurrencyExceededError may be raised.
  raiseException:   If true, ConcurrencyExceededError will be raised when
                      maxConcurrency is exceeded.
  """
  global arg_2, arg_3

  assert arg_0 >= 0

  arg_2 = arg_0
  arg_3 = arg_1
  return

Enable the diagnostic feature for debugging unexpected concurrency in acquiring ConnectionWrapper instances .


def
Func
(
arg_0
,
arg_1
=
,
**
arg_2
)
:
if
not
plt
:
raise
ImportError
(
"Try installing matplotlib first."
)
arg_0
.
guess_plot_columns
(
)
arg_0
.
x
=
arg_0
.
x
or
range
(
len
(
arg_0
.
ys
[
0
]
)
)
arg_4
=
reduce
(
operator
.
add
,
[
(
arg_0
.
x
,
y
)
for
y
in
arg_0
.
ys
]
)
Func
=
plt
.
plot
(
*
arg_4
,
**
arg_2
)
if
hasattr
(
arg_0
.
x
,
'name'
)
:
plt
.
xlabel
(
arg_0
.
x
.
name
)
arg_6
=
", "
.
join
(
y
.
name
for
y
in
arg_0
.
ys
)
plt
.
title
(
arg_1
or
arg_6
)
plt
.
ylabel
(
arg_6
)
return
Func

def Func(arg_0, arg_1=None, **arg_2):
        """Generates a pylab plot from the result set.

        ``matplotlib`` must be installed, and in an
        IPython Notebook, inlining must be on::

            %%matplotlib inline

        The first and last columns are taken as the X and Y
        values.  Any columns between are ignored.

        :param title: plot title, defaults to names of Y value columns

        Any additional keyword arguments will be passsed
        through to ``matplotlib.pylab.plot``.
        """
        if not plt:
            raise ImportError("Try installing matplotlib first.")
        arg_0.guess_plot_columns()
        arg_0.x = arg_0.x or range(len(arg_0.ys[0]))
        arg_4 = reduce(operator.add, [(arg_0.x, y) for y in arg_0.ys])
        Func = plt.plot(*arg_4, **arg_2)
        if hasattr(arg_0.x, 'name'):
            plt.xlabel(arg_0.x.name)
        arg_6 = ", ".join(y.name for y in arg_0.ys)
        plt.title(arg_1 or arg_6)
        plt.ylabel(arg_6)
        return Func

Generates a pylab plot from the result set .


def Func ( arg_0 ) : for arg_1 , arg_2 in arg_0 . options : arg_3 = arg_2 . get ( "action" ) if arg_3 != "callback" : if arg_2 is None : arg_2 = arg_0 . get_option_def ( arg_1 ) arg_4 = arg_2 . get ( "default" ) arg_0 . set_option ( arg_1 , arg_4 , arg_3 , arg_2 )

def Func(arg_0):
        """initialize the provider using default values"""
        for arg_1, arg_2 in arg_0.options:
            arg_3 = arg_2.get("action")
            if arg_3 != "callback":
                # callback action have no default
                if arg_2 is None:
                    arg_2 = arg_0.get_option_def(arg_1)
                arg_4 = arg_2.get("default")
                arg_0.set_option(arg_1, arg_4, arg_3, arg_2)


(algorithms=[PluralityLearner, NaiveBayesLearner,
                        NearestNeighborLearner, DecisionTreeLearner],
            datasets=[iris, orings, zoo, restaurant, SyntheticRestaurant(20),
                      Majority(7, 100), Parity(7, 100), Xor(100)],
            k=10, trials=1)

def Func(arg_0=[arg_1, arg_2,
                        arg_3, arg_4],
            arg_5=[arg_6, arg_7, arg_8, arg_9, arg_10(20),
                      arg_11(7, 100), arg_12(7, 100), arg_13(100)],
            arg_14=10, arg_15=1):
    """Compare various learners on various datasets using cross-validation.
    Print results as a table."""
    print_table([[arg_17.__name__.replace('Learner','')] +
                 [cross_validation(arg_17, arg_16, arg_14, arg_15) for arg_16 in arg_5]
                 for arg_17 in arg_0],
                header=[''] + [arg_16.name[0:7] for arg_16 in arg_5], numfmt='%.2f')

Compare various learners on various datasets using cross - validation . Print results as a table .


def Func ( ) : context . configure ( url = settings . SQL_ALCHEMY_CONN , target_metadata = target_metadata , literal_binds = True , compare_type = COMPARE_TYPE ) with context . begin_transaction ( ) : context . run_migrations ( )

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

    This configures the context with just a URL
    and not an Engine, though an Engine is acceptable
    here as well.  By skipping the Engine creation
    we don't even need a DBAPI to be available.

    Calls to context.execute() here emit the given string to the
    script output.

    """
    context.configure(
        url=settings.SQL_ALCHEMY_CONN, target_metadata=target_metadata,
        literal_binds=True, compare_type=COMPARE_TYPE)

    with context.begin_transaction():
        context.run_migrations()


(self, gradient, image=None, strict=True)

def Func(arg_0, arg_1, arg_2=None, arg_3=True):
        """Interface to model.Func for attacks.

        Parameters
        ----------
        gradient : `numpy.ndarray`
            Gradient of some loss w.r.t. the logits.
        image : `numpy.ndarray`
            Single input with shape as expected by the model
            (without the batch dimension).

        Returns
        -------
        gradient : `numpy.ndarray`
            The gradient w.r.t the image.

        See Also
        --------
        :meth:`gradient`

        """
        assert arg_0.has_gradient()
        assert arg_1.ndim == 1

        if arg_2 is None:
            arg_2 = arg_0.__original_image

        assert not arg_3 or arg_0.in_bounds(arg_2)

        arg_0._total_gradient_calls += 1
        arg_1 = arg_0.__model.Func(arg_1, arg_2)

        assert arg_1.shape == arg_2.shape
        return arg_1

Interface to model.backward for attacks.

        Parameters
        ----------
        gradient : `numpy.ndarray`
            Gradient of some loss w.r.t. the logits.
        image : `numpy.ndarray`
            Single input with shape as expected by the model
            (without the batch dimension).

        Returns
        -------
        gradient : `numpy.ndarray`
            The gradient w.r.t the image.

        See Also
        --------
        :meth:`gradient`

Interface to model . backward for attacks .


Attempt to connect to the websocket - and returns either True or False depending on if
        the connection was successful or not

def Func ( arg_0 ) : arg_0 . ws_openlock . acquire ( ) arg_0 . ws_openlock . release ( ) if arg_0 . status == "Funced" : return True if arg_0 . status == "disFuncing" : time . sleep ( 0.1 ) return arg_0 . Func ( ) if arg_0 . status == "disFunced" or arg_0 . status == "reFuncing" : arg_0 . ws = websocket . WebSocketApp ( arg_0 . ws_url , header = arg_0 . headers , on_message = arg_0 . __on_message , on_ping = arg_0 . __on_ping , on_open = arg_0 . __on_open , on_close = arg_0 . __on_close , on_error = arg_0 . __on_error ) arg_0 . ws_thread = threading . Thread ( target = arg_0 . ws . run_forever ) arg_0 . ws_thread . daemon = True arg_0 . status = "Funcing" arg_0 . ws_openlock . acquire ( ) arg_0 . ws_thread . start ( ) arg_0 . ws_openlock . acquire ( ) arg_0 . ws_openlock . release ( ) return arg_0 . status == "Funced"

def Func(arg_0):
        """Attempt to Func to the websocket - and returns either True or False depending on if
        the Funcion was successful or not"""

        # Wait for the lock to be available (ie, the websocket is not being used (yet))
        arg_0.ws_openlock.acquire()
        arg_0.ws_openlock.release()

        if arg_0.status == "Funced":
            return True  # Already Funced
        if arg_0.status == "disFuncing":
            # If currently disFuncing, wait a moment, and retry Func
            time.sleep(0.1)
            return arg_0.Func()
        if arg_0.status == "disFunced" or arg_0.status == "reFuncing":
            arg_0.ws = websocket.WebSocketApp(arg_0.ws_url,
                                             header=arg_0.headers,
                                             on_message=arg_0.__on_message,
                                             on_ping=arg_0.__on_ping,
                                             on_open=arg_0.__on_open,
                                             on_close=arg_0.__on_close,
                                             on_error=arg_0.__on_error)
            arg_0.ws_thread = threading.Thread(target=arg_0.ws.run_forever)
            arg_0.ws_thread.daemon = True

            arg_0.status = "Funcing"
            arg_0.ws_openlock.acquire()
            arg_0.ws_thread.start()

        arg_0.ws_openlock.acquire()
        arg_0.ws_openlock.release()

        return arg_0.status == "Funced"


def Func ( arg_0 , arg_1 ) : try : return arg_0 / arg_1 except TypeError : return arg_0 . total_seconds ( ) / arg_1 . total_seconds ( )

def Func(arg_0, arg_1):
	"""
	Get the ratio of two timedeltas

	>>> one_day = datetime.timedelta(days=1)
	>>> one_hour = datetime.timedelta(hours=1)
	>>> Func(one_hour, one_day) == 1 / 24
	True
	"""
	try:
		return arg_0 / arg_1
	except TypeError:
		# Python 3.2 gets division
		# http://bugs.python.org/issue2706
		return arg_0.total_seconds() / arg_1.total_seconds()

Get the ratio of two timedeltas

	>>> one_day = datetime.timedelta(days=1)
	>>> one_hour = datetime.timedelta(hours=1)
	>>> divide_timedelta(one_hour, one_day) == 1 / 24
	True


return self._mc_client._delete(url=self._build_path(workflow_id, 'emails', email_id))

def Func(arg_0, arg_1, arg_2):
        """
        Removes an individual Automation workflow email.

        :param workflow_id: The unique id for the Automation workflow.
        :type workflow_id: :py:class:`str`
        :param email_id: The unique id for the Automation workflow email.
        :type email_id: :py:class:`str`
        """

        arg_0.workflow_id = arg_1
        arg_0.email_id = arg_2
        return arg_0._mc_client._Func(url=arg_0._build_path(arg_1, 'emails', arg_2))

Removes an individual Automation workflow email .


def Func ( arg_0 , arg_1 = None ) : arg_0 = numpy . array ( arg_0 ) arg_2 = arg_0 . max ( ) + 1 if arg_1 is not None : arg_2 = max ( arg_2 , arg_1 . size ) if arg_1 is not None : if arg_1 . size != arg_2 : arg_3 = numpy . zeros ( arg_2 , dtype = 'int32' ) arg_3 [ 0 : arg_1 . size ] = arg_1 else : arg_3 = arg_1 else : arg_3 = numpy . zeros ( arg_2 , dtype = 'int32' ) for arg_5 in arg_0 : arg_3 [ arg_5 ] += 1 return arg_3

def Func(arg_0, arg_1=None):
  """
  Accumulate a list of values 'values' into the frequency counts 'freqCounts',
  and return the updated frequency counts

  For example, if values contained the following: [1,1,3,5,1,3,5], and the initial
  freqCounts was None, then the return value would be:
  [0,3,0,2,0,2]
  which corresponds to how many of each value we saw in the input, i.e. there
  were 0 0's, 3 1's, 0 2's, 2 3's, 0 4's, and 2 5's.

  If freqCounts is not None, the values will be added to the existing counts and
  the length of the frequency Counts will be automatically extended as necessary

  Parameters:
  -----------------------------------------------
  values:         The values to accumulate into the frequency counts
  freqCounts:     Accumulated frequency counts so far, or none
  """

  # How big does our freqCounts vector need to be?
  arg_0 = numpy.array(arg_0)
  arg_2 = arg_0.max() + 1
  if arg_1 is not None:
    arg_2 = max(arg_2, arg_1.size)

  # Where do we accumulate the results?
  if arg_1 is not None:
    if arg_1.size != arg_2:
      arg_3 = numpy.zeros(arg_2, dtype='int32')
      arg_3[0:arg_1.size] = arg_1
    else:
      arg_3 = arg_1
  else:
    arg_3 = numpy.zeros(arg_2, dtype='int32')

  # Accumulate the new values
  for arg_5 in arg_0:
    arg_3[arg_5] += 1

  return arg_3

Accumulate a list of values values into the frequency counts freqCounts and return the updated frequency counts


def Func(arg_0, arg_1: arg_2) -> arg_2:
        """ Create a new Set with values present in only one Set """
        arg_3 = arg_2(arg_1=arg_0._hsig.values(), state=arg_0.state)
        arg_3 ^= arg_1
        return arg_3


def Func ( arg_0 , arg_1 , arg_2 = False ) : with arg_0 . lock : arg_0 . authenticated = True arg_0 . me = arg_1 if arg_2 : arg_0 . _restart_stream ( ) arg_0 . event ( AuthenticatedEvent ( arg_0 . me ) )

def Func(arg_0, arg_1, arg_2 = False):
        """Mark stream authenticated as `me`.

        :Parameters:
            - `me`: local JID just authenticated
            - `restart_stream`: `True` when stream should be restarted (needed
              after SASL authentication)
        :Types:
            - `me`: `JID`
            - `restart_stream`: `bool`
        """
        with arg_0.lock:
            arg_0.authenticated = True
            arg_0.me = arg_1
            if arg_2:
                arg_0._restart_stream()
        arg_0.event(AuthenticatedEvent(arg_0.me))


def Func():
    """Main function for molvs command line interface."""

    # Root options
    arg_0 = MolvsParser(epilog='use "molvs <command> -h" to show help for a specific command')
    arg_1 = arg_0.add_subparsers(title='Available commands')

    # Options common to all commands

    arg_2 = MolvsParser(add_help=False)
    arg_2.add_argument('infile', nargs='?', help='input filename', type=argparse.FileType('r'), default=sys.stdin)
    arg_2.add_argument('-i', '--intype', help='input filetype', choices=FILETYPES)
    arg_2.add_argument('-:', '--smiles', help='input SMILES instead of file', metavar='<smiles>')
    arg_2.add_argument('-O', '--outfile', help='output filename', type=argparse.FileType('w'), default=sys.stdout, metavar='<outfile>')

    # Standardize options
    arg_3 = arg_1.add_parser('standardize', help='standardize a molecule', parents=[arg_2])
    arg_3.add_argument('-o', '--outtype', help='output filetype', choices=FILETYPES)
    arg_3.set_defaults(func=standardize_Func)

    # Validate options
    arg_4 = arg_1.add_parser('validate', help='validate a molecule', parents=[arg_2])
    arg_4.set_defaults(func=validate_Func)

    arg_5 = arg_0.parse_args()
    try:
        arg_5.func(arg_5)
    except Exception as e:
        sys.stderr.write('Error: %s\n\n'.encode() % e.message)
        arg_0.print_help()
        sys.exit(2)

Main function for molvs command line interface .


def Func ( arg_0 , arg_1 ) : arg_2 = controllers . Func ( store , arg_0 , arg_1 ) if arg_2 [ 'case' ] . get ( 'Func' ) is None : return abort ( 404 ) arg_3 = os . path . abspath ( os . path . dirname ( arg_2 [ 'case' ] [ 'Func' ] ) ) arg_4 = os . path . basename ( arg_2 [ 'case' ] [ 'Func' ] ) return send_from_directory ( arg_3 , arg_4 )

def Func(arg_0, arg_1):
    """Load Func report for the case."""
    arg_2 = controllers.Func(store, arg_0, arg_1)
    if arg_2['case'].get('Func') is None:
        return abort(404)
    arg_3 = os.path.abspath(os.path.dirname(arg_2['case']['Func']))
    arg_4 = os.path.basename(arg_2['case']['Func'])
    return send_from_directory(arg_3, arg_4)


(self, service_name, deployment_name, dns_server_name)

return self._perform_delete(
            self._get_dns_server_path(service_name,
                                      deployment_name,
                                      dns_server_name),
            as_async=True)

def Func(arg_0, arg_1, arg_2, arg_3):
        '''
        Deletes a DNS server from a deployment.

        service_name:
            The name of the service.
        deployment_name:
            The name of the deployment.
        dns_server_name:
            Name of the DNS server that you want to delete.
        '''
        _validate_not_none('service_name', arg_1)
        _validate_not_none('deployment_name', arg_2)
        _validate_not_none('dns_server_name', arg_3)
        return arg_0._perform_delete(
            arg_0._get_dns_server_path(arg_1,
                                      arg_2,
                                      arg_3),
            as_async=True)

Deletes a DNS server from a deployment .


(data, headers, column_types=(), integer_format=None,
                   float_format=None, **_)

def Func ( arg_0 , arg_1 , arg_2 = ( ) , arg_3 = None , arg_4 = None , ** arg_5 ) : if ( arg_3 is None and arg_4 is None ) or not arg_2 : return iter ( arg_0 ) , arg_1 def _format_number ( arg_6 , arg_7 ) : if arg_3 and arg_7 is int and type ( arg_6 ) in int_types : return format ( arg_6 , arg_3 ) elif arg_4 and arg_7 is float and type ( arg_6 ) in float_types : return format ( arg_6 , arg_4 ) return arg_6 arg_0 = ( [ _format_number ( v , arg_2 [ i ] ) for i , v in enumerate ( row ) ] for row in arg_0 ) return arg_0 , arg_1

def Func(arg_0, arg_1, arg_2=(), arg_3=None,
                   arg_4=None, **arg_5):
    """Format numbers according to a format specification.

    This uses Python's format specification to format numbers of the following
    types: :class:`int`, :class:`py2:long` (Python 2), :class:`float`, and
    :class:`~decimal.Decimal`. See the :ref:`python:formatspec` for more
    information about the format strings.

    .. NOTE::
       A column is only formatted if all of its values are the same type
       (except for :data:`None`).

    :param iterable data: An :term:`iterable` (e.g. list) of rows.
    :param iterable headers: The column headers.
    :param iterable column_types: The columns' type objects (e.g. int or float).
    :param str integer_format: The format string to use for integer columns.
    :param str float_format: The format string to use for float columns.
    :return: The processed data and headers.
    :rtype: tuple

    """
    if (arg_3 is None and arg_4 is None) or not arg_2:
        return iter(arg_0), arg_1

    def _format_number(arg_6, arg_7):
        if arg_3 and arg_7 is int and type(arg_6) in int_types:
            return format(arg_6, arg_3)
        elif arg_4 and arg_7 is float and type(arg_6) in float_types:
            return format(arg_6, arg_4)
        return arg_6

    arg_0 = ([_format_number(v, arg_2[i]) for i, v in enumerate(row)] for row in arg_0)
    return arg_0, arg_1

Format numbers according to a format specification .


def Func ( ) : arg_0 = "ascii" if 0 : import locale arg_1 = locale . getdefaultlocale ( ) if arg_1 [ 1 ] : arg_0 = arg_1 [ 1 ] if 0 : arg_0 = "undefined" if arg_0 != "ascii" : sys . setdefaultencoding ( arg_0 )

def Func():
    """Set the string encoding used by the Unicode implementation.  The
    default is 'ascii', but if you're willing to experiment, you can
    change this."""
    arg_0 = "ascii" # Default value set by _PyUnicode_Init()
    if 0:
        # Enable to support locale aware default string encodings.
        import locale
        arg_1 = locale.getdefaultlocale()
        if arg_1[1]:
            arg_0 = arg_1[1]
    if 0:
        # Enable to switch off string to Unicode coercion and implicit
        # Unicode to string conversion.
        arg_0 = "undefined"
    if arg_0 != "ascii":
        # On Non-Unicode builds this will raise an AttributeError...
        sys.setdefaultencoding(arg_0)

Set the string encoding used by the Unicode implementation . The default is ascii but if you re willing to experiment you can change this .


return ((k, v) for k, v in zip(self.keys(), self.values()))

def Func ( arg_0 ) : return ( ( arg_1 , arg_2 ) for arg_1 , arg_2 in zip ( arg_0 . keys ( ) , arg_0 . values ( ) ) )

def Func(arg_0):
        r"""Get Func.

        Returns:
            Iterable[(Descriptor, value)]

        """
        return ((arg_1, arg_2) for arg_1, arg_2 in zip(arg_0.keys(), arg_0.values()))

r"""Get items.

        Returns:
            Iterable[(Descriptor, value)]


(cls, format_name, handler, preprocessors=(),
                               kwargs=None)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = ( ) , arg_4 = None ) : arg_0 . _output_formats [ arg_1 ] = OutputFormatHandler ( arg_1 , arg_3 , arg_2 , arg_4 or { } )

def Func(arg_0, arg_1, arg_2, arg_3=(),
                               arg_4=None):
        """Register a new output formatter.

        :param str format_name: The name of the format.
        :param callable handler: The function that formats the data.
        :param tuple preprocessors: The preprocessors to call before
            formatting.
        :param dict kwargs: Keys/values for keyword argument defaults.

        """
        arg_0._output_formats[arg_1] = OutputFormatHandler(
            arg_1, arg_3, arg_2, arg_4 or {})


return ''.join(
            c
            for c in self._delete_consecutive_repeats(word)
            if c in self._uc_set
        )

def Func(arg_0, arg_1):
        """Return the Phonem code for a word.

        Parameters
        ----------
        word : str
        The word to transform

        Returns
        -------
        str
            The Phonem value

        Examples
        --------
        >>> pe = Phonem()
        >>> pe.Func('Christopher')
        'CRYSDOVR'
        >>> pe.Func('Niall')
        'NYAL'
        >>> pe.Func('Smith')
        'SMYD'
        >>> pe.Func('Schmidt')
        'CMYD'

        """
        arg_1 = unicode_normalize('NFC', text_type(arg_1.upper()))
        for arg_2, arg_3 in arg_0._substitutions:
            arg_1 = arg_1.replace(arg_2, arg_3)
        arg_1 = arg_1.translate(arg_0._trans)

        return ''.join(
            arg_4
            for arg_4 in arg_0._delete_consecutive_repeats(arg_1)
            if arg_4 in arg_0._uc_set
        )

Return the Phonem code for a word.

        Parameters
        ----------
        word : str
        The word to transform

        Returns
        -------
        str
            The Phonem value

        Examples
        --------
        >>> pe = Phonem()
        >>> pe.encode('Christopher')
        'CRYSDOVR'
        >>> pe.encode('Niall')
        'NYAL'
        >>> pe.encode('Smith')
        'SMYD'
        >>> pe.encode('Schmidt')
        'CMYD'


def Func(arg_0, arg_1):
        """
        Start spark and hdfs master containers

        :param job: The underlying job.
        """

        if arg_0.hostname is None:
            arg_0.hostname = subprocess.check_output(["hostname", "-f",])[:-1]

        _log.info("Started Spark master container.")
        arg_0.sparkContainerID = dockerCheckOutput(arg_1=arg_1,
                                                  defer=STOP,
                                                  workDir=os.getcwd(),
                                                  tool="quay.io/ucsc_cgl/apache-spark-master:1.5.2",
                                                  dockerParameters=["--net=host",
                                                                    "-d",
                                                                    "-v", "/mnt/ephemeral/:/ephemeral/:rw",
                                                                    "-e", "SPARK_MASTER_IP=" + arg_0.hostname,
                                                                    "-e", "SPARK_LOCAL_DIRS=/ephemeral/spark/local",
                                                                    "-e", "SPARK_WORKER_DIR=/ephemeral/spark/work"],
                                                  parameters=[arg_0.hostname])[:-1]
        _log.info("Started HDFS Datanode.")
        arg_0.hdfsContainerID = dockerCheckOutput(arg_1=arg_1,
                                           defer=STOP,
                                           workDir=os.getcwd(),
                                           tool="quay.io/ucsc_cgl/apache-hadoop-master:2.6.2",
                                           dockerParameters=["--net=host",
                                                              "-d"],
                                           parameters=[arg_0.hostname])[:-1]

        return arg_0.hostname


def Func(arg_0):
    """ Get the possible events from settings """
    if arg_0 is None:
        arg_1 = "Please add some events in settings.WEBHOOK_EVENTS."
        raise ImproperlyConfigured(arg_1)
    try:
        arg_2 = [(x, x) for x in arg_0]
    except TypeError:
        """ Not a valid iterator, so we raise an exception """
        arg_1 = "settings.WEBHOOK_EVENTS must be an iterable object."
        raise ImproperlyConfigured(arg_1)
    return arg_2


def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 arg_0 . configured = True arg_0 . handler . room_configured ( )

def Func(arg_0, arg_1):
        """
        Process success response for a room configuration request.

        :Parameters:
            - `stanza`: the stanza received.
        :Types:
            - `stanza`: `Presence`
        """
        arg_2 = arg_1
        arg_0.configured = True
        arg_0.handler.room_configured()

Process success response for a room configuration request .


def Func(arg_0, arg_1):
        """
        Create the conversion object automatically from the tree

        Parameters
        ----------

         clock_model : dict
            dictionary as returned from TreeRegression with fields intercept and slope

        """
        arg_2 = arg_0()
        arg_2.clock_rate = arg_1['slope']
        arg_2.intercept = arg_1['intercept']
        arg_2.chisq = arg_1['chisq'] if 'chisq' in arg_1 else None
        arg_2.valid_confidence = arg_1['valid_confidence'] if 'valid_confidence' in arg_1 else False
        if 'cov' in arg_1 and arg_2.valid_confidence:
            arg_2.cov = arg_1['cov']
        arg_2.r_val = arg_1['r_val']
        return arg_2


def Func ( arg_0 , arg_1 ) : arg_2 = [ ] for arg_3 in arg_1 . tags : if arg_0 . is_tag ( arg_3 ) : arg_2 . append ( arg_3 ) if arg_2 : for arg_3 in arg_2 : arg_1 . tags . remove ( arg_3 ) return arg_2

def Func(arg_0, arg_1):
        """Pop all matching tags off the model and return them."""
        arg_2 = []

        # collect any exsiting tags with matching prefix
        for arg_3 in arg_1.tags:
            if arg_0.is_tag(arg_3):
                arg_2.append(arg_3)

        # remove collected tags from model
        if arg_2:
            for arg_3 in arg_2:
                arg_1.tags.remove(arg_3)

        return arg_2

Pop all matching tags off the model and return them .


def Func ( arg_0 , Func ) : arg_0 . lmotor . axes = [ Func [ 0 ] ] arg_0 . ode_obj . setAxis ( tuple ( Func [ 0 ] ) )

def Func(arg_0, Func):
        '''Set the linear axis of displacement for this joint.

        Parameters
        ----------
        axes : list containing one 3-tuple of floats
            A list of the axes for this joint. For a slider joint, which has one
            degree of freedom, this must contain one 3-tuple specifying the X,
            Y, and Z axis for the joint.
        '''
        arg_0.lmotor.axes = [Func[0]]
        arg_0.ode_obj.setAxis(tuple(Func[0]))

Set the linear axis of displacement for this joint .


def Func ( arg_0 , arg_1 , arg_2 ) : for arg_3 in arg_0 . comps : arg_3 . Func ( arg_1 , arg_2 )

def Func(arg_0, arg_1, arg_2):
        """ Set the shape for all components """
        for arg_3 in arg_0.comps:
            arg_3.Func(arg_1, arg_2)


def
Func
(
)
:
arg_0
=
[
]
arg_1
=
config
(
'logging'
)
if
arg_1
[
'syslog'
]
:
arg_0
.
append
(
logging
.
handlers
.
SysLogHandler
(
address
=
'/dev/log'
)
)
if
arg_1
[
'stderr'
]
:
arg_0
.
append
(
logging
.
StreamHandler
(
sys
.
stderr
)
)
if
arg_1
[
'file'
]
:
arg_0
.
append
(
logging
.
handlers
.
WatchedFileHandler
(
arg_1
[
'file'
]
)
)
for
arg_2
in
arg_0
:
arg_2
.
setFormatter
(
logging
.
Formatter
(
arg_1
[
'format'
]
)
)
logging
.
root
.
addHandler
(
arg_2
)
logging
.
root
.
setLevel
(
arg_1
[
'level'
]
.
upper
(
)
)
logger
.
info
(
'Log level set to %s'
%
arg_1
[
'level'
]
)

def Func():
    '''Initialize logger based on configuration
    '''
    arg_0 = []
    arg_1 = config('logging')
    if arg_1['syslog']:
        arg_0.append(logging.handlers.SysLogHandler(address='/dev/log'))
    if arg_1['stderr']:
        arg_0.append(logging.StreamHandler(sys.stderr))
    if arg_1['file']:
        arg_0.append(logging.handlers.WatchedFileHandler(arg_1['file']))
    for arg_2 in arg_0:
        arg_2.setFormatter(logging.Formatter(arg_1['format']))
        logging.root.addHandler(arg_2)

    logging.root.setLevel(arg_1['level'].upper())
    logger.info('Log level set to %s' % arg_1['level'])


call a function on each element of a sequence remotely.
        This should behave very much like the builtin map, but return an AsyncMapResult
        if self.block is False.

def Func ( arg_0 , * arg_1 ) : arg_0 . _Func = True try : arg_3 = arg_0 . __call__ ( * arg_1 ) finally : del arg_0 . _Func return arg_3

def Func(arg_0, *arg_1):
        """call a function on each element of a sequence remotely.
        This should behave very much like the builtin Func, but return an AsyncMapResult
        if self.block is False.
        """
        # set _Func as a flag for use inside self.__call__
        arg_0._Func = True
        try:
            arg_3 = arg_0.__call__(*arg_1)
        finally:
            del arg_0._Func
        return arg_3

call a function on each element of a sequence remotely . This should behave very much like the builtin map but return an AsyncMapResult if self . block is False .


def Func ( * arg_0 , ** arg_1 ) : arg_2 = arg_1 . pop ( 'raw' , False ) if arg_2 : for arg_3 in arg_0 : publish_latex ( arg_3 ) else : display ( * arg_0 , include = [ 'text/plain' , 'text/latex' ] )

def Func(*arg_0, **arg_1):
    """Display the LaTeX representation of an object.

    Parameters
    ----------
    objs : tuple of objects
        The Python objects to display, or if raw=True raw latex data to
        display.
    raw : bool
        Are the data objects raw data or Python objects that need to be
        formatted before display? [default: False]
    """
    arg_2 = arg_1.pop('raw',False)
    if arg_2:
        for arg_3 in arg_0:
            publish_latex(arg_3)
    else:
        display(*arg_0, include=['text/plain','text/latex'])

Display the LaTeX representation of an object .


def Func(arg_0, arg_1, arg_2):
        """
        Builds an ingest query for an HDFS TSV load.

        :param static_path: The path on hdfs where the data is
        :type static_path: str
        :param columns: List of all the columns that are available
        :type columns: list
        """

        # backward compatibility for num_shards,
        # but target_partition_size is the default setting
        # and overwrites the num_shards
        arg_3 = arg_0.num_shards
        arg_4 = arg_0.target_partition_size
        if arg_0.target_partition_size == -1:
            if arg_0.num_shards == -1:
                arg_4 = DEFAULT_TARGET_PARTITION_SIZE
        else:
            arg_3 = -1

        arg_5 = [m['fieldName'] for m in arg_0.metric_spec if m['type'] != 'count']

        # Take all the columns, which are not the time dimension
        # or a metric, as the dimension columns
        arg_6 = [c for c in arg_2 if c not in arg_5 and c != arg_0.ts_dim]

        arg_7 = {
            "type": "index_hadoop",
            "spec": {
                "dataSchema": {
                    "metricsSpec": arg_0.metric_spec,
                    "granularitySpec": {
                        "queryGranularity": arg_0.query_granularity,
                        "intervals": arg_0.intervals,
                        "type": "uniform",
                        "segmentGranularity": arg_0.segment_granularity,
                    },
                    "parser": {
                        "type": "string",
                        "parseSpec": {
                            "columns": arg_2,
                            "dimensionsSpec": {
                                "dimensionExclusions": [],
                                "dimensions": arg_6,  # list of names
                                "spatialDimensions": []
                            },
                            "timestampSpec": {
                                "column": arg_0.ts_dim,
                                "format": "auto"
                            },
                            "format": "tsv"
                        }
                    },
                    "dataSource": arg_0.druid_datasource
                },
                "tuningConfig": {
                    "type": "hadoop",
                    "jobProperties": {
                        "mapreduce.job.user.classpath.first": "false",
                        "mapreduce.map.output.compress": "false",
                        "mapreduce.output.fileoutputformat.compress": "false",
                    },
                    "partitionsSpec": {
                        "type": "hashed",
                        "targetPartitionSize": arg_4,
                        "numShards": arg_3,
                    },
                },
                "ioConfig": {
                    "inputSpec": {
                        "paths": arg_1,
                        "type": "static"
                    },
                    "type": "hadoop"
                }
            }
        }

        if arg_0.job_properties:
            arg_7['spec']['tuningConfig']['jobProperties'] \
                .update(arg_0.job_properties)

        if arg_0.hadoop_dependency_coordinates:
            arg_7['hadoopDependencyCoordinates'] \
                = arg_0.hadoop_dependency_coordinates

        return arg_7

Builds an ingest query for an HDFS TSV load .


return placeholder, encode_observation(ob_space, placeholder)

def Func(arg_0, arg_1=None, arg_2='Ob'):
    '''
    Create placeholder to feed observations into of the size appropriate to the observation space, and add input
    encoder of the appropriate type.
    '''

    arg_3 = observation_placeholder(arg_0, arg_1, arg_2)
    return arg_3, encode_observation(arg_0, arg_3)

Create placeholder to feed observations into of the size appropriate to the observation space and add input encoder of the appropriate type .


def Func(arg_0, arg_1, arg_2):
        """
        Diff two thrift structs and return the result as a ThriftDiff instance
        """
        arg_3 = ThriftDiff(arg_1, arg_2)
        arg_3._do_diff()
        return arg_3


def Func ( arg_0 ) : arg_0 . data = [ gate . Func ( ) for gate in reversed ( arg_0 . data ) ] arg_0 . Func_flag = not arg_0 . Func_flag return arg_0

def Func(arg_0):
        """Invert this gate."""
        arg_0.data = [gate.Func() for gate in reversed(arg_0.data)]
        arg_0.Func_flag = not arg_0.Func_flag
        return arg_0


def Func(arg_0, arg_1=100):
    """
    Seeks and removes the sourcemap comment. If found, the sourcemap line is
    returned.

    Bundled output files can have massive amounts of lines, and the sourceMap
    comment is always at the end. So, to extract it efficiently, we read out the
    lines of the file starting from the end. We look back at most 2 lines.

    :param:filepath: path to output bundle file containing the sourcemap comment
    :param:blocksize: integer saying how many bytes to read at once
    :return:string with the sourcemap comment or None
    """

    arg_2 = 2  # look back at most 2 lines, catching potential blank line at the end

    arg_3 = -1
    # blocks of size block_size, in reverse order starting from the end of the file
    arg_4 = []
    arg_5 = None

    try:
        # open file in binary read+write mode, so we can seek with negative offsets
        arg_6 = io.open(arg_0, 'br+')
        # figure out what's the end byte
        arg_6.seek(0, os.SEEK_END)
        arg_7 = arg_6.tell()

        # track back for maximum MAX_TRACKBACK lines and while we can track back
        while arg_7 > 0 and arg_2 > 0:
            if (arg_7 - arg_1 > 0):
                # read the last block we haven't yet read
                arg_6.seek(arg_3*arg_1, os.SEEK_END)
                arg_4.append(arg_6.read(arg_1))
            else:
                # file too small, start from begining
                arg_6.seek(0, os.SEEK_SET)
                # only read what was not read
                arg_4 = [arg_6.read(arg_7)]

            # update variables that control while loop
            arg_8 = b''.join(reversed(arg_4))
            arg_9 = arg_8.count(b'\n')
            arg_2 -= arg_9
            arg_7 -= arg_1
            arg_3 -= 1

            # early check and bail out if we found the sourcemap comment
            if SOURCEMAPPING_URL_COMMENT in arg_8:
                arg_10 = 0
                # splitlines eats the last \n if its followed by a blank line
                arg_11 = arg_8.split(b'\n')
                for arg_12, arg_13 in enumerate(arg_11):
                    if arg_13.startswith(SOURCEMAPPING_URL_COMMENT):
                        arg_10 = len(arg_13)
                        arg_5 = arg_13
                        break
                while arg_12+1 < len(arg_11):
                    arg_10 += 1  # for the newline char
                    arg_10 += len(arg_11[arg_12+1])
                    arg_12 += 1
                # track back until the start of the comment, and truncate the comment
                if arg_5:
                    arg_10 += 1  # for the newline before the sourcemap comment
                    arg_6.seek(-arg_10, os.SEEK_END)
                    arg_6.truncate()
                return force_text(arg_5)
    finally:
        arg_6.close()
    return arg_5

Seeks and removes the sourcemap comment . If found the sourcemap line is returned .


def Func ( arg_0 , * arg_1 , ** arg_2 ) : def decorator ( arg_3 ) : @ wraps ( arg_3 ) def decorated ( * arg_4 , ** arg_5 ) : arg_0 . response = make_response ( ) arg_7 = WerkzeugAdapter ( request , arg_0 . response ) arg_2 . setdefault ( 'session' , session ) arg_2 . setdefault ( 'session_saver' , arg_0 . session_saver ) arg_0 . result = super ( FlaskAuthomatic , arg_0 ) . Func ( arg_7 , * arg_1 , ** arg_2 ) return arg_3 ( * arg_4 , ** arg_5 ) return decorated return decorator

def Func(arg_0, *arg_1, **arg_2):
        """
        Decorator for Flask view functions.
        """

        def decorator(arg_3):
            @wraps(arg_3)
            def decorated(*arg_4, **arg_5):
                arg_0.response = make_response()
                arg_7 = WerkzeugAdapter(request, arg_0.response)
                arg_2.setdefault('session', session)
                arg_2.setdefault('session_saver', arg_0.session_saver)
                arg_0.result = super(FlaskAuthomatic, arg_0).Func(
                    arg_7,
                    *arg_1,
                    **arg_2)
                return arg_3(*arg_4, **arg_5)
            return decorated
        return decorator


def Func ( arg_0 , arg_1 , arg_2 = 0.05 ) : def _partition_groups ( arg_3 ) : arg_4 = [ ] for arg_5 , arg_6 in arg_3 : arg_7 = False for arg_8 , arg_9 in enumerate ( arg_4 ) : arg_10 , arg_11 = arg_9 if abs ( arg_10 - arg_6 ) < arg_2 : arg_4 [ arg_8 ] [ 1 ] . append ( ( arg_5 , arg_6 ) ) arg_4 [ arg_8 ] [ 0 ] = sum ( [ s for arg_12 , s in arg_11 ] ) / len ( arg_11 ) arg_7 = True break if not arg_7 : arg_4 . append ( [ arg_6 , [ ( arg_5 , arg_6 ) ] ] ) return [ [ arg_5 for arg_5 , arg_6 in arg_9 ] for arg_12 , arg_9 in arg_4 ] arg_13 = { } arg_14 = [ ] for arg_15 in arg_0 : with open ( arg_15 ) as audit_file : arg_16 = audit_file . readline ( ) [ : - 1 ] arg_5 = arg_16 [ arg_16 . index ( ":" ) + 1 : ] arg_14 . append ( arg_5 ) arg_17 = load_audit_confusion_matrices ( arg_15 ) for arg_18 , arg_19 in arg_17 : arg_6 = arg_1 ( arg_19 ) if arg_18 not in arg_13 : arg_13 [ arg_18 ] = { } arg_13 [ arg_18 ] [ arg_5 ] = arg_6 arg_20 = sorted ( arg_13 . keys ( ) ) arg_4 = [ arg_14 ] while arg_20 : arg_21 = arg_20 . pop ( ) arg_22 = [ ] for arg_9 in arg_4 : arg_23 = [ ( f , arg_13 [ arg_21 ] [ f ] ) for f in arg_9 ] arg_24 = _partition_groups ( arg_23 ) arg_22 . extend ( arg_24 ) arg_4 = arg_22 return arg_4

def Func(arg_0, arg_1, arg_2=0.05):
  """
  Given a list of audit files, rank them using the `measurer` and
  return the features that never deviate more than `similarity_bound`
  across repairs.
  """

  def _partition_groups(arg_3):
    arg_4 = []
    for arg_5, arg_6 in arg_3:
      arg_7 = False

      # Check to see if the feature belongs in a group with any other features.
      for arg_8, arg_9 in enumerate(arg_4):
        arg_10, arg_11 = arg_9
        if abs(arg_10 - arg_6) < arg_2:
          arg_4[arg_8][1].append( (arg_5, arg_6) )

          # Recalculate the representative mean.
          arg_4[arg_8][0] = sum([s for arg_12, s in arg_11])/len(arg_11)
          arg_7 = True
          break

      # If this feature did not much with the current groups, create another group.
      if not arg_7:
        arg_4.append( [arg_6, [(arg_5,arg_6)]] )

    # Return just the features.
    return [[arg_5 for arg_5, arg_6 in arg_9] for arg_12, arg_9 in arg_4]

  arg_13 = {}
  arg_14 = []
  for arg_15 in arg_0:
    with open(arg_15) as audit_file:
      arg_16 = audit_file.readline()[:-1] # Remove the trailing endline.
      arg_5 = arg_16[arg_16.index(":")+1:]
      arg_14.append(arg_5)

    arg_17 = load_audit_confusion_matrices(arg_15)
    for arg_18, arg_19 in arg_17:
      arg_6 = arg_1(arg_19)
      if arg_18 not in arg_13:
        arg_13[arg_18] = {}
      arg_13[arg_18][arg_5] = arg_6

  # Sort by repair level increasing repair level.
  arg_20 = sorted(arg_13.keys())

  arg_4 = [arg_14]
  while arg_20:
    arg_21 = arg_20.pop()
    arg_22 = []
    for arg_9 in arg_4:
      arg_23 = [(f, arg_13[arg_21][f]) for f in arg_9]
      arg_24 = _partition_groups(arg_23)
      arg_22.extend(arg_24)
    arg_4 = arg_22

  return arg_4

Given a list of audit files rank them using the measurer and return the features that never deviate more than similarity_bound across repairs .


def Func(arg_0, arg_1=None, **arg_2):
    """Creates a storage service, to be extended if new storage services are added

    :param storage_service:

        Storage Service instance of constructor or a string pointing to a file

    :param trajectory:

        A trajectory instance

    :param kwargs:

        Arguments passed to the storage service

    :return:

        A storage service and a set of not used keyword arguments from kwargs

    """

    if 'filename' in arg_2 and arg_0 is None:
        arg_3 = arg_2['filename']
        arg_4, arg_5 = os.path.splitext(arg_3)
        if arg_5 in ('.hdf', '.h4', '.hdf4', '.he2', '.h5', '.hdf5', '.he5'):
            arg_0 = HDF5StorageService
        else:
            raise ValueError('Extension `%s` of filename `%s` not understood.' %
                             (arg_5, arg_3))
    elif isinstance(arg_0, str):
        arg_6 = arg_0.split('.')[-1]
        arg_0 = create_class(arg_6, [arg_0, HDF5StorageService])

    if inspect.isclass(arg_0):
        return _create_storage(arg_0, arg_1, **arg_2)
    else:
        return arg_0, set(arg_2.keys())

Creates a storage service to be extended if new storage services are added


def Func ( arg_0 , arg_1 , arg_2 ) : if arg_2 . found : arg_3 = arg_1 . split ( '.' ) arg_4 = '.' . join ( arg_3 [ : - 1 ] ) if arg_2 . parent is not None : try : arg_5 = getattr ( arg_2 . parent , '__class__' ) try : arg_5 = getattr ( arg_5 , arg_3 [ - 1 ] ) if isinstance ( arg_5 , property ) : arg_1 = arg_4 + '.__class__.' + arg_3 [ - 1 ] arg_2 = Struct ( arg_0 . _ofind ( arg_1 ) ) except AttributeError : pass except AttributeError : pass return arg_2

def Func(arg_0, arg_1, arg_2):
        """Second part of object finding, to look for property details."""
        if arg_2.found:
            # Get the docstring of the class property if it exists.
            arg_3 = arg_1.split('.')
            arg_4 = '.'.join(arg_3[:-1])
            if arg_2.parent is not None:
                try:
                    arg_5 = getattr(arg_2.parent, '__class__')
                    # The object belongs to a class instance.
                    try:
                        arg_5 = getattr(arg_5, arg_3[-1])
                        # The class defines the object.
                        if isinstance(arg_5, property):
                            arg_1 = arg_4 + '.__class__.' + arg_3[-1]
                            arg_2 = Struct(arg_0._ofind(arg_1))
                    except AttributeError: pass
                except AttributeError: pass

        # We return either the new info or the unmodified input if the object
        # hadn't been found
        return arg_2

Second part of object finding to look for property details .


def Func ( arg_0 ) : if arg_0 . package : arg_1 = arg_0 . __get_url_distribution_package ( ) else : arg_1 = arg_0 . __get_url_distribution ( ) return arg_1

def Func(arg_0):
        """Build URL project"""

        if arg_0.package:
            arg_1 = arg_0.__get_url_distribution_package()
        else:
            arg_1 = arg_0.__get_url_distribution()

        return arg_1


def Func(arg_0, arg_1):
        """Initializes Journey extension

        :param app: App passed from constructor or directly to Func
        :raises:
            - NoBundlesAttached if no bundles has been attached attached

        """

        if len(arg_0._attached_bundles) == 0:
            raise NoBundlesAttached("At least one bundle must be attached before initializing Journey")

        for arg_2 in arg_0._attached_bundles:
            arg_3 = {
                'path': arg_2.path,
                'description': arg_2.description,
                'blueprints': []
            }

            for (arg_4, arg_5) in arg_2.blueprints:
                # Register the BP
                arg_6 = arg_0._register_blueprint(arg_1, arg_4, arg_2.path,
                                                     arg_0.get_bp_path(arg_4), arg_5)

                # Finally, attach the blueprints to its parent
                arg_3['blueprints'].append(arg_6)

            arg_0._registered_bundles.append(arg_3)

Initializes Journey extension

        :param app: App passed from constructor or directly to init_app
        :raises:
            - NoBundlesAttached if no bundles has been attached attached


def Func ( arg_0 , arg_1 = 10.0 ) : arg_2 = np . log ( arg_1 ) arg_3 = np . sign ( arg_0 ) arg_4 = np . log ( np . abs ( arg_0 ) / arg_2 ) return arg_3 * arg_4

def Func(arg_0, arg_1=10.0):
    """Symmetrical logarithmic scale.

    Optional arguments:

    *base*:
        The base of the logarithm.
    """
    arg_2 = np.log(arg_1)
    arg_3 = np.sign(arg_0)
    arg_4 = np.log(np.abs(arg_0) / arg_2)
    return arg_3 * arg_4


def
Func
(
arg_0
,
arg_1
=
False
)
:
arg_2
=
arg_0
.
get
(
"CONTENT_LENGTH"
,
""
)
.
strip
(
)
if
arg_2
==
""
:
arg_3
=
""
else
:
try
:
arg_4
=
int
(
arg_2
)
if
arg_4
<
0
:
raise
DAVError
(
HTTP_BAD_REQUEST
,
"Negative content-length."
)
except
ValueError
:
raise
DAVError
(
HTTP_BAD_REQUEST
,
"content-length is not numeric."
)
if
arg_4
==
0
:
arg_3
=
""
else
:
arg_3
=
arg_0
[
"wsgi.input"
]
.
read
(
arg_4
)
arg_0
[
"wsgidav.all_input_read"
]
=
1
if
arg_3
==
""
:
if
arg_1
:
return
else
:
raise
DAVError
(
HTTP_BAD_REQUEST
,
"Body must not be empty."
)
try
:
arg_5
=
etree
.
fromstring
(
arg_3
)
except
Exception
as
e
:
raise
DAVError
(
HTTP_BAD_REQUEST
,
"Invalid XML format."
,
src_exception
=
e
)
if
arg_0
.
get
(
"wsgidav.dump_request_body"
)
:
_logger
.
info
(
"{} XML request body:\n{}"
.
format
(
arg_0
[
"REQUEST_METHOD"
]
,
compat
.
to_native
(
xml_to_bytes
(
arg_5
,
pretty_print
=
True
)
)
,
)
)
arg_0
[
"wsgidav.dump_request_body"
]
=
False
return
arg_5

def Func(arg_0, arg_1=False):
    """Read request body XML into an etree.Element.

    Return None, if no request body was sent.
    Raise HTTP_BAD_REQUEST, if something else went wrong.

    TODO: this is a very relaxed interpretation: should we raise HTTP_BAD_REQUEST
    instead, if CONTENT_LENGTH is missing, invalid, or 0?

    RFC: For compatibility with HTTP/1.0 applications, HTTP/1.1 requests containing
    a message-body MUST include a valid Content-Length header field unless the
    server is known to be HTTP/1.1 compliant.
    If a request contains a message-body and a Content-Length is not given, the
    server SHOULD respond with 400 (bad request) if it cannot determine the
    length of the message, or with 411 (length required) if it wishes to insist
    on receiving a valid Content-Length."

    So I'd say, we should accept a missing CONTENT_LENGTH, and try to read the
    content anyway.
    But WSGI doesn't guarantee to support input.read() without length(?).
    At least it locked, when I tried it with a request that had a missing
    content-type and no body.

    Current approach: if CONTENT_LENGTH is

    - valid and >0:
      read body (exactly <CONTENT_LENGTH> bytes) and parse the result.
    - 0:
      Assume empty body and return None or raise exception.
    - invalid (negative or not a number:
      raise HTTP_BAD_REQUEST
    - missing:
      NOT: Try to read body until end and parse the result.
      BUT: assume '0'
    - empty string:
      WSGI allows it to be empty or absent: treated like 'missing'.
    """
    #
    arg_2 = arg_0.get("CONTENT_LENGTH", "").strip()
    #    content_length = -1 # read all of stream
    if arg_2 == "":
        # No Content-Length given: read to end of stream
        # TODO: etree.parse() locks, if input is invalid?
        #        pfroot = etree.parse(environ["wsgi.input"]).getroot()
        # requestbody = environ["wsgi.input"].read()  # TODO: read() should be
        # called in a loop?
        arg_3 = ""
    else:
        try:
            arg_4 = int(arg_2)
            if arg_4 < 0:
                raise DAVError(HTTP_BAD_REQUEST, "Negative content-length.")
        except ValueError:
            raise DAVError(HTTP_BAD_REQUEST, "content-length is not numeric.")

        if arg_4 == 0:
            arg_3 = ""
        else:
            arg_3 = arg_0["wsgi.input"].read(arg_4)
            arg_0["wsgidav.all_input_read"] = 1

    if arg_3 == "":
        if arg_1:
            return None
        else:
            raise DAVError(HTTP_BAD_REQUEST, "Body must not be empty.")

    try:
        arg_5 = etree.fromstring(arg_3)
    except Exception as e:
        raise DAVError(HTTP_BAD_REQUEST, "Invalid XML format.", src_exception=e)

    # If dumps of the body are desired, then this is the place to do it pretty:
    if arg_0.get("wsgidav.dump_request_body"):
        _logger.info(
            "{} XML request body:\n{}".format(
                arg_0["REQUEST_METHOD"],
                compat.to_native(xml_to_bytes(arg_5, pretty_print=True)),
            )
        )
        arg_0["wsgidav.dump_request_body"] = False

    return arg_5

Read request body XML into an etree . Element .


def Func ( arg_0 , arg_1 ) : arg_2 = tf . concat ( [ tf . shape ( input = arg_0 ) , tf . ones ( arg_1 - tf . rank ( arg_0 ) , dtype = tf . int32 ) ] , axis = 0 ) arg_3 = None if arg_0 . shape . is_fully_defined ( ) and isinstance ( arg_1 , int ) : arg_3 = arg_0 . shape . as_list ( ) arg_4 = arg_1 - len ( arg_3 ) arg_3 . extend ( [ 1 ] * arg_4 ) arg_5 = tf . reshape ( arg_0 , arg_3 or arg_2 ) return arg_5

def Func(arg_0, arg_1):
  """Pads the shape of x to the right to be of rank final_rank.

  Expands the dims of `x` to the right such that its rank is equal to
  final_rank. For example, if `x` is of shape [1, 5, 7, 2] and `final_rank` is
  7, we return padded_x, which is of shape [1, 5, 7, 2, 1, 1, 1].

  Args:
    x: The tensor whose shape is to be padded.
    final_rank: Scalar int32 `Tensor` or Python `int`. The desired rank of x.

  Returns:
    padded_x: A tensor of rank final_rank.
  """
  arg_2 = tf.concat(
      [tf.shape(input=arg_0),
       tf.ones(arg_1 - tf.rank(arg_0), dtype=tf.int32)],
      axis=0)
  arg_3 = None
  if arg_0.shape.is_fully_defined() and isinstance(arg_1, int):
    arg_3 = arg_0.shape.as_list()
    arg_4 = arg_1 - len(arg_3)
    arg_3.extend([1] * arg_4)

  arg_5 = tf.reshape(arg_0, arg_3 or arg_2)
  return arg_5

Pads the shape of x to the right to be of rank final_rank .


def
Func
(
arg_0
,
*
arg_1
)
:
arg_2
=
arg_0
.
pop
(
'palette'
,
)
if
arg_2
:
arg_3
=
[
k
for
k
,
_
in
arg_1
if
k
in
arg_0
]
if
arg_3
:
raise
ValueError
(
'Cannot set palette and '
+
', '
.
join
(
arg_3
)
)
return
arg_2
arg_4
=
[
arg_0
.
pop
(
k
,
v
)
for
k
,
v
in
arg_1
]
if
arg_4
and
arg_1
[
0
]
[
0
]
in
(
'colors'
,
'palette'
)
:
arg_4
=
arg_4
[
0
]
return
make
.
colors
(
arg_4
or
)

def Func(arg_0, *arg_1):
    """
    Older animations in BPA and other areas use all sorts of different names for
    what we are now representing with palettes.

    This function mutates a kwds dictionary to remove these legacy fields and
    extract a palette from it, which it returns.
 """
    arg_2 = arg_0.pop('palette', None)
    if arg_2:
        arg_3 = [k for k, _ in arg_1 if k in arg_0]
        if arg_3:
            raise ValueError('Cannot set palette and ' + ', '.join(arg_3))
        return arg_2

    arg_4 = [arg_0.pop(k, v) for k, v in arg_1]
    if arg_4 and arg_1[0][0] in ('colors', 'palette'):
        arg_4 = arg_4[0]

    return make.colors(arg_4 or None)

Older animations in BPA and other areas use all sorts of different names for what we are now representing with palettes .


def Func(arg_0):
        """
        Func partial fitting procedure
        """
        if arg_0.__head_less:
            warn(f'{self.__class__.__name__} configured to head less mode. Func unusable')
        elif not arg_0.__head_generate:
            warn(f'{self.__class__.__name__} already Funcd or fitted')
        elif not arg_0.__head_dict:
            raise NotFittedError(f'{self.__class__.__name__} instance is not fitted yet')
        else:
            if arg_0.remove_rare_ratio:
                arg_0.__clean_head(*arg_0.__head_rare)
                arg_0.__prepare_header()
                arg_0.__head_rare = None
            arg_0.__head_generate = False


def Func ( arg_0 ) : for arg_1 in arg_0 . indicators : if arg_1 not in arg_0 . costs : arg_0 . costs [ arg_1 ] = arg_1 . cost else : if arg_1 . _get_primal ( ) > arg_0 . integer_threshold : arg_0 . costs [ arg_1 ] += arg_1 . cost arg_0 . model . objective . set_linear_coefficients ( arg_0 . costs )

def Func(arg_0):
        """Update the coefficients for the indicator variables in the objective.

        Done incrementally so that second time the function is called,
        active indicators in the current solutions gets higher cost than the
        unused indicators.
        """
        for arg_1 in arg_0.indicators:
            if arg_1 not in arg_0.costs:
                arg_0.costs[arg_1] = arg_1.cost
            else:
                if arg_1._get_primal() > arg_0.integer_threshold:
                    arg_0.costs[arg_1] += arg_1.cost
        arg_0.model.objective.set_linear_coefficients(arg_0.costs)

Update the coefficients for the indicator variables in the objective .


return format_html(template, static=_static_url, v=version)

def Func(arg_0=None):
    """
    Returns jQuery JavaScript file according to version number.
    TEMPLATE_DEBUG returns full file, otherwise returns minified file from Google CDN with local fallback.
    Included in HTML5 Boilerplate.
    """
    if arg_0 is None:
        arg_0 = getattr(settings, 'DJFRONTEND_JQUERY', DJFRONTEND_JQUERY_DEFAULT)

    if getattr(settings, 'TEMPLATE_DEBUG', False):
        arg_1 = '<script src="{static}djfrontend/js/jquery/{v}/jquery.js"></script>'
    else:
        arg_1 = (
            '<script src="//ajax.googleapis.com/ajax/libs/jquery/{v}/jquery.min.js"></script>'
            '<script>window.jQuery || document.write(\'<script src="{static}djfrontend/js/jquery/{v}/jquery.min.js"><\/script>\')</script>')
    return format_html(arg_1, static=_static_url, v=arg_0)

Returns jQuery JavaScript file according to version number . TEMPLATE_DEBUG returns full file otherwise returns minified file from Google CDN with local fallback . Included in HTML5 Boilerplate .


def Func ( arg_0 , arg_1 ) : arg_1 . classdesc = arg_0 . classdesc for arg_3 in arg_0 . classdesc . fields_names : arg_1 . __setattr__ ( arg_3 , getattr ( arg_0 , arg_3 ) )

def Func(arg_0, arg_1):
    """Func an object"""
    arg_1.classdesc = arg_0.classdesc

    for arg_3 in arg_0.classdesc.fields_names:
      arg_1.__setattr__(arg_3, getattr(arg_0, arg_3))


def Func ( arg_0 ) : if not os . path . isabs ( arg_0 ) : arg_0 = os . path . normpath ( os . path . abspath ( os . path . join ( os . getcwd ( ) , arg_0 ) ) ) if arg_0 is None or not os . path . isdir ( arg_0 ) : return None return arg_0

def Func(arg_0):
    """Return absolute, normalized path to directory, if it exists; None
    otherwise.
    """
    if not os.path.isabs(arg_0):
        arg_0 = os.path.normpath(os.path.abspath(os.path.join(os.getcwd(),
                                                             arg_0)))
    if arg_0 is None or not os.path.isdir(arg_0):
        return None
    return arg_0

Return absolute normalized path to directory if it exists ; None otherwise .


(port, adr, notification_handle, user_handle)

def Func(arg_0, arg_1, arg_2, arg_3):
    # type: (int, AmsAddr, int, int) -> None
    """Remove a device notification.

    :param int port: local AMS port as returned by adsPortOpenEx()
    :param pyads.structs.AmsAddr adr: local or remote AmsAddr
    :param int notification_handle: Notification Handle
    :param int user_handle: User Handle

    """
    arg_4 = _adsDLL.AdsSyncDelDeviceNotificationReqEx

    arg_5 = ctypes.pointer(arg_1.amsAddrStruct())
    arg_6 = ctypes.c_ulong(arg_2)
    arg_7 = arg_4(arg_0, arg_5, arg_6)
    callback_store.pop(arg_2, None)
    if arg_7:
        raise ADSError(arg_7)

    adsSyncWriteReqEx(arg_0, arg_1, ADSIGRP_SYM_RELEASEHND, 0, arg_3, PLCTYPE_UDINT)


def Func ( arg_0 ) -> Optional [ ISeq ] : if arg_0 is None : return None if isinstance ( arg_0 , ISeq ) : return _seq_or_nil ( arg_0 ) if isinstance ( arg_0 , ISeqable ) : return _seq_or_nil ( arg_0 . seq ( ) ) return _seq_or_nil ( lseq . sequence ( arg_0 ) )

def Func(arg_0) -> Optional[ISeq]:
    """Coerce the argument o to a ISeq. If o is None, return None."""
    if arg_0 is None:
        return None
    if isinstance(arg_0, ISeq):
        return _seq_or_nil(arg_0)
    if isinstance(arg_0, ISeqable):
        return _seq_or_nil(arg_0.seq())
    return _seq_or_nil(lseq.sequence(arg_0))

Coerce the argument o to a ISeq . If o is None return None .


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
if
env
(
)
:
cij
.
err
(
"cij.nvme.meta: Invalid NVMe ENV."
)
return
1
arg_3
=
cij
.
env_to_dict
(
PREFIX
,
EXPORTED
+
REQUIRED
)
arg_4
=
0x40000
with
open
(
arg_2
,
"wb"
)
as
fout
:
for
arg_5
in
range
(
arg_0
,
arg_1
,
arg_4
)
:
arg_6
=
min
(
arg_1
arg_5
,
arg_4
)
arg_7
=
[
"nvme get-log"
,
arg_3
[
"DEV_PATH"
]
,
"-i 0xca"
,
"-o 0x%x"
%
arg_5
,
"-l 0x%x"
%
arg_6
,
"-b"
]
arg_8
,
arg_9
,
arg_10
=
cij
.
ssh
.
command
(
arg_7
,
shell
=
True
)
if
arg_8
:
cij
.
err
(
"cij.nvme.meta: Error get chunk meta"
)
return
1
fout
.
write
(
arg_9
)
return
0

def Func(arg_0, arg_1, arg_2):
    """Get chunk meta of NVMe device"""

    if env():
        cij.err("cij.nvme.meta: Invalid NVMe ENV.")
        return 1

    arg_3 = cij.env_to_dict(PREFIX, EXPORTED + REQUIRED)

    arg_4 = 0x40000
    with open(arg_2, "wb") as fout:
        for arg_5 in range(arg_0, arg_1, arg_4):
            arg_6 = min(arg_1 - arg_5, arg_4)
            arg_7 = ["nvme get-log",
                   arg_3["DEV_PATH"],
                   "-i 0xca",
                   "-o 0x%x" % arg_5,
                   "-l 0x%x" % arg_6,
                   "-b"]
            arg_8, arg_9, arg_10 = cij.ssh.command(arg_7, shell=True)
            if arg_8:
                cij.err("cij.nvme.meta: Error get chunk meta")
                return 1

            fout.write(arg_9)

    return 0


def
Func
(
arg_0
)
:
if
arg_0
.
TryConsumeByteString
(
)
:
while
arg_0
.
TryConsumeByteString
(
)
:
pass
return
if
(
not
arg_0
.
TryConsumeIdentifier
(
)
and
not
arg_0
.
TryConsumeInt64
(
)
and
not
arg_0
.
TryConsumeUint64
(
)
and
not
arg_0
.
TryConsumeFloat
(
)
)
:
raise
ParseError
(
'Invalid field value: '
+
arg_0
.
token
)

def Func(arg_0):
  """Skips over a field value.

  Args:
    tokenizer: A tokenizer to parse the field name and values.

  Raises:
    ParseError: In case an invalid field value is found.
  """
  # String/bytes tokens can come in multiple adjacent string literals.
  # If we can consume one, consume as many as we can.
  if arg_0.TryConsumeByteString():
    while arg_0.TryConsumeByteString():
      pass
    return

  if (not arg_0.TryConsumeIdentifier() and
      not arg_0.TryConsumeInt64() and
      not arg_0.TryConsumeUint64() and
      not arg_0.TryConsumeFloat()):
    raise ParseError('Invalid field value: ' + arg_0.token)


(self, breaks="sturges", plot=True, **kwargs)

def Func(arg_0, arg_1="sturges", arg_2=True, **arg_3):
        """
        Compute a histogram over a numeric column.

        :param breaks: Can be one of ``"sturges"``, ``"rice"``, ``"sqrt"``, ``"doane"``, ``"fd"``, ``"scott"``;
            or a single number for the number of breaks; or a list containing the split points, e.g:
            ``[-50, 213.2123, 9324834]``. If breaks is "fd", the MAD is used over the IQR in computing bin width.
        :param bool plot: If True (default), then a plot will be generated using ``matplotlib``.

        :returns: If ``plot`` is False, return H2OFrame with these columns: breaks, counts, mids_true,
            mids, and density; otherwise this method draws a plot and returns nothing.
        """
        arg_4 = arg_3.pop("server") if "server" in arg_3 else False
        assert_is_type(arg_1, int, [numeric], Enum("sturges", "rice", "sqrt", "doane", "fd", "scott"))
        assert_is_type(arg_2, bool)
        assert_is_type(arg_4, bool)
        if arg_3:
            raise H2OValueError("Unknown parameters to hist(): %r" % arg_3)
        Func = H2OFrame._expr(expr=ExprNode("hist", arg_0, arg_1))._frame()

        if arg_2:
            try:
                import matplotlib
                if arg_4:
                    matplotlib.use("Agg", warn=False)
                import matplotlib.pyplot as plt
            except ImportError:
                print("ERROR: matplotlib is required to make the histogram plot. "
                      "Set `plot` to False, if a plot is not desired.")
                return

            Func["widths"] = Func["breaks"].difflag1()
            # [2:] because we're removing the title and the first row (which consists of NaNs)
            arg_6 = [float(c[0]) for c in h2o.as_list(Func["breaks"], use_pandas=False)[2:]]
            arg_7 = [float(c[0]) for c in h2o.as_list(Func["widths"], use_pandas=False)[2:]]
            arg_8 = [float(c[0]) for c in h2o.as_list(Func["counts"], use_pandas=False)[2:]]

            plt.xlabel(arg_0.names[0])
            plt.ylabel("Frequency")
            plt.title("Histogram of %s" % arg_0.names[0])
            plt.bar(left=arg_6, width=arg_7, height=arg_8, bottom=0)
            if not arg_4:
                plt.show()
        else:
            Func["density"] = Func["counts"] / (Func["breaks"].difflag1() * Func["counts"].sum())
            return Func

Compute a histogram over a numeric column .