def Func(arg_0):
        """Returns a hash of the reports JSON file
        """

        if arg_0.watch:

            # Searches for the first occurence of the nextflow pipeline
            # file name in the .nextflow.log file
            arg_1 = get_nextflow_filepath(arg_0.log_file)

            # Get hash from the entire pipeline file
            arg_2 = hashlib.md5()
            with open(arg_1, "rb") as fh:
                for arg_3 in iter(lambda: fh.read(4096), b""):
                    arg_2.update(arg_3)
            # Get hash from the current working dir and hostname
            arg_4 = os.getcwd().encode("utf8")
            arg_5 = socket.gethostname().encode("utf8")
            arg_6 = str(uuid.getnode()).encode("utf8")
            arg_7 = hashlib.md5(arg_4 + arg_5 + arg_6)

            return arg_2.hexdigest() + arg_7.hexdigest()

        else:
            with open(arg_0.report_file) as fh:
                arg_8 = json.loads(fh.read())

            arg_9 = arg_8["data"]["results"][0]["nfMetadata"]

            try:
                arg_10 = arg_9["scriptId"] + arg_9["sessionId"]
            except KeyError:
                raise eh.ReportError("Incomplete or corrupt report JSON file "
                                     "missing the 'scriptId' and/or 'sessionId' "
                                     "metadata information")

            return arg_10


return self._call(JSONRPCMethods.GET_ASSET_STATE.value, params=[asset_id, ], **kwargs)

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

def Func(arg_0, arg_1, **arg_2):
        """ Returns the asset information associated with a specific asset ID.

        :param asset_id:
            an asset identifier (the transaction ID of the RegistTransaction when the asset is
            registered)
        :type asset_id: str
        :return: dictionary containing the asset state information
        :rtype: dict

        """
        return arg_0._call(JSONRPCMethods.GET_ASSET_STATE.value, params=[arg_1, ], **arg_2)

Returns the asset information associated with a specific asset ID .


(self, language_code, country_code=None, variant=None)

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None ) : arg_0 . locales [ arg_1 ] = ( arg_2 , arg_3 )

def Func(arg_0, arg_1, arg_2=None, arg_3=None):
        """Add a locale.

        :param str language_code: The language code of the locale.
        :param str country_code: The country code of the locale.
        :param str variant: The variant of the locale.
        """
        arg_0.locales[arg_1] = (arg_2, arg_3)


def Func ( arg_0 , arg_1 , arg_2 ) : for arg_3 in arg_2 : PersistentIdentifier . create ( pid_type = arg_3 . pid_type , pid_value = arg_3 . pid_value , pid_provider = arg_3 . provider . pid_provider if arg_3 . provider else None , object_type = 'rec' , object_uuid = arg_1 , status = PIDStatus . REGISTERED , ) db . session . commit ( )

def Func(arg_0, arg_1, arg_2):
        """Create persistent identifiers."""
        for arg_3 in arg_2:
            PersistentIdentifier.create(
                pid_type=arg_3.pid_type,
                pid_value=arg_3.pid_value,
                pid_provider=arg_3.provider.pid_provider if arg_3.provider else None,
                object_type='rec',
                object_uuid=arg_1,
                status=PIDStatus.REGISTERED,
            )
        db.session.commit()


(adapter, config, ped=None, update=False)

def Func(arg_0, arg_1, arg_2=None, arg_3=False):
    """Load a new case from a Scout config.

        Args:
            adapter(MongoAdapter)
            config(dict): loading info
            ped(Iterable(str)): Pedigree ingformation
            update(bool): If existing case should be updated

    """
    log.info("Check that the panels exists")
    if not check_panels(arg_0, arg_1.get('gene_panels', []),
                        arg_1.get('default_gene_panels')):
        raise ConfigError("Some panel(s) does not exist in the database")
    arg_4 = arg_0.load_case(arg_1, arg_3=arg_3)
    return arg_4


def
Func
(
arg_0
)
:
try
:
arg_0
=
int
(
arg_0
)
except
(
TypeError
,
ValueError
)
:
raise
PageNotAnInteger
(
'That page number is not an integer'
)
if
arg_0
<
1
:
raise
EmptyPage
(
'That page number is less than 1'
)
return
arg_0

def Func(arg_0):
    """Validate the given 1-based page number."""
    try:
        arg_0 = int(arg_0)
    except (TypeError, ValueError):
        raise PageNotAnInteger('That page number is not an integer')
    if arg_0 < 1:
        raise EmptyPage('That page number is less than 1')
    return arg_0

Validate the given 1 - based page number .


Builds the topology and returns the builder

def Func(arg_0, arg_1):
    """Builds the topology and returns the Funcer"""
    arg_2 = sets.Set()
    for arg_3 in arg_0._sources:
      arg_3._Func(arg_1, arg_2)
    for arg_3 in arg_0._sources:
      if not arg_3._all_built():
        raise RuntimeError("Topology cannot be fully built! Are all sources added?")


def Func(arg_0, arg_1, arg_2=True):
        """Convert the named field to bool.

        The current value should be one of the strings "yes" or "no".  It will
        be replaced with its boolean counterpart.  If the field is not present
        in the config object, the default value is used.

        :param config: the config section where to set the option
        :type config: configobj.ConfigObj
        :param name: the name of the option to convert
        :type name: str
        :param default: the default value to use if the option was not
            previously set
        :type default: bool
        :returns: None

        """
        if arg_1 not in arg_0:
            arg_0[arg_1] = arg_2
        elif arg_0[arg_1] == "yes":
            arg_0[arg_1] = True
        elif arg_0[arg_1] == "no":
            arg_0[arg_1] = False
        else:
            raise ValueError("Error in config file\nInvalid value for %s "
                             "parameter\nPossible values: yes, no" % arg_1)


(bind_addr,
                       wsgi_app,
                       numthreads = 10,
                       server_name = None,
                       max = -1,
                       request_queue_size = 5,
                       timeout = 10,
                       shutdown_timeout = 5)

return Rocket(bind_addr, 'wsgi', {'wsgi_app': wsgi_app},
                  min_threads = numthreads,
                  max_threads = max_threads,
                  queue_size = request_queue_size,
                  timeout = timeout)

def Func(arg_0,
                       arg_1,
                       arg_2 = 10,
                       arg_3 = None,
                       arg_4 = -1,
                       arg_5 = 5,
                       arg_6 = 10,
                       arg_7 = 5):
    """ A Cherrypy wsgiserver-compatible wrapper. """
    arg_8 = arg_4
    if arg_8 < 0:
        arg_8 = 0
    return Rocket(arg_0, 'wsgi', {'wsgi_app': arg_1},
                  min_threads = arg_2,
                  arg_8 = arg_8,
                  queue_size = arg_5,
                  arg_6 = arg_6)

A Cherrypy wsgiserver - compatible wrapper .


def Func ( arg_0 , arg_1 = None ) : if isinstance ( arg_1 , ( tuple , list , np . ndarray ) ) : if isinstance ( arg_0 , ( tuple , list , np . ndarray ) ) : return type ( arg_1 ) ( arg_0 ) return type ( arg_1 ) ( [ arg_0 ] ) else : if isinstance ( arg_0 , ( tuple , list , np . ndarray ) ) and len ( arg_0 ) == 1 : return arg_0 [ 0 ] return arg_0 return arg_0

def Func(arg_0, arg_1=None):
    """
    If a single element list, extract the element as an object, otherwise
    leave as it is.

    Examples
    --------
    >>> Func('string')
    'string'

    >>> Func(['string'])
    'string'

    >>> Func(['string', 'other'])
    ['string', 'other']

    >>> Func(np.array([1.0]))
    1.0

    >>> Func([1, 2, 3])
    [1, 2, 3]
    """
    if isinstance(arg_1, (tuple, list, np.ndarray)):
        if isinstance(arg_0, (tuple, list, np.ndarray)):
            return type(arg_1)(arg_0)
        return type(arg_1)([arg_0])
    else:
        if isinstance(arg_0, (tuple, list, np.ndarray)) and len(arg_0) == 1:
            return arg_0[0]
        return arg_0
    return arg_0

If a single element list, extract the element as an object, otherwise
    leave as it is.

    Examples
    --------
    >>> delistify('string')
    'string'

    >>> delistify(['string'])
    'string'

    >>> delistify(['string', 'other'])
    ['string', 'other']

    >>> delistify(np.array([1.0]))
    1.0

    >>> delistify([1, 2, 3])
    [1, 2, 3]

If a single element list extract the element as an object otherwise leave as it is .


return self.__lockImpl.isAcquired(lockID, self.__selfID, time.time())

def Func ( arg_0 , arg_1 ) : return arg_0 . __lockImpl . Func ( arg_1 , arg_0 . __selfID , time . time ( ) )

def Func(arg_0, arg_1):
        """Check if lock is acquired by ourselves.

        :param lockID: unique lock identifier.
        :type lockID: str
        :return True if lock is acquired by ourselves.
         """
        return arg_0.__lockImpl.Func(arg_1, arg_0.__selfID, time.time())

Check if lock is acquired by ourselves .


return cls(compressed, prefix=prefix or Prefix.prefix)

def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_1 = PrivateKey ( arg_1 , arg_2 = arg_2 or Prefix . prefix ) arg_3 = unhexlify ( repr ( arg_1 ) ) arg_4 = ecdsa . SigningKey . from_string ( arg_3 , curve = ecdsa . SECP256k1 ) . curve . generator . order ( ) arg_5 = ecdsa . SigningKey . from_string ( arg_3 , curve = ecdsa . SECP256k1 ) . verifying_key . pubkey . point arg_6 = ecdsa . util . number_to_string ( arg_5 . x ( ) , arg_4 ) arg_7 = hexlify ( chr ( 2 + ( arg_5 . y ( ) & 1 ) ) . encode ( "ascii" ) + arg_6 ) . decode ( "ascii" ) return arg_0 ( arg_7 , arg_2 = arg_2 or Prefix . prefix )

def Func(arg_0, arg_1, arg_2=None):
        """ Derive uncompressed public key """
        arg_1 = PrivateKey(arg_1, arg_2=arg_2 or Prefix.prefix)
        arg_3 = unhexlify(repr(arg_1))
        arg_4 = ecdsa.SigningKey.from_string(
            arg_3, curve=ecdsa.SECP256k1
        ).curve.generator.order()
        arg_5 = ecdsa.SigningKey.from_string(
            arg_3, curve=ecdsa.SECP256k1
        ).verifying_key.pubkey.point
        arg_6 = ecdsa.util.number_to_string(arg_5.x(), arg_4)
        # y_str = ecdsa.util.number_to_string(p.y(), order)
        arg_7 = hexlify(chr(2 + (arg_5.y() & 1)).encode("ascii") + arg_6).decode(
            "ascii"
        )
        # uncompressed = hexlify(
        #    chr(4).encode('ascii') + x_str + y_str).decode('ascii')
        return arg_0(arg_7, arg_2=arg_2 or Prefix.prefix)


(self, file: TextIO, use_names: bool = False)

def
Func
(
arg_0
,
arg_1
:
arg_2
,
arg_3
:
arg_4
=
False
)
->
:
if
not
arg_0
.
is_populated
(
)
:
arg_0
.
populate
(
)
if
arg_3
and
not
arg_0
.
has_names
:
raise
ValueError
arg_5
=
(
arg_0
.
_get_namespace_name_to_encoding
(
desc
=
'writing names'
)
if
arg_3
else
arg_0
.
_get_namespace_identifier_to_encoding
(
desc
=
'writing identifiers'
)
)
write_namespace
(
namespace_name
=
arg_0
.
_get_namespace_name
(
)
,
namespace_keyword
=
arg_0
.
_get_namespace_keyword
(
)
,
namespace_query_url
=
arg_0
.
identifiers_url
,
arg_5
=
arg_5
,
arg_1
=
arg_1
,
)

def Func(arg_0, arg_1: arg_2, arg_3: arg_4 = False) -> None:
        """Write as a BEL namespace file."""
        if not arg_0.is_populated():
            arg_0.populate()

        if arg_3 and not arg_0.has_names:
            raise ValueError

        arg_5 = (
            arg_0._get_namespace_name_to_encoding(desc='writing names')
            if arg_3 else
            arg_0._get_namespace_identifier_to_encoding(desc='writing identifiers')
        )

        write_namespace(
            namespace_name=arg_0._get_namespace_name(),
            namespace_keyword=arg_0._get_namespace_keyword(),
            namespace_query_url=arg_0.identifiers_url,
            arg_5=arg_5,
            arg_1=arg_1,
        )


def Func ( arg_0 , arg_1 , arg_2 ) : if arg_1 . method in [ 'PUT' , 'POST' , 'MERGE' , 'DELETE' ] : arg_1 . headers . append ( ( 'Content-Length' , str ( len ( arg_1 . body ) ) ) ) arg_1 . headers . append ( ( 'x-ms-version' , arg_2 or arg_0 . x_ms_version ) ) if not arg_1 . method in [ 'GET' , 'HEAD' ] : for arg_3 , arg_4 in arg_1 . headers : if 'content-type' == arg_3 . lower ( ) : break else : arg_1 . headers . append ( ( 'Content-Type' , arg_0 . content_type ) ) return arg_1 . headers

def Func(arg_0, arg_1, arg_2):
        ''' Add additional headers for management. '''

        if arg_1.method in ['PUT', 'POST', 'MERGE', 'DELETE']:
            arg_1.headers.append(('Content-Length', str(len(arg_1.body))))

        # append additional headers base on the service
        arg_1.headers.append(('x-ms-version', arg_2 or arg_0.x_ms_version))

        # if it is not GET or HEAD request, must set content-type.
        if not arg_1.method in ['GET', 'HEAD']:
            for arg_3, arg_4 in arg_1.headers:
                if 'content-type' == arg_3.lower():
                    break
            else:
                arg_1.headers.append(
                    ('Content-Type',
                     arg_0.content_type))

        return arg_1.headers


(self, queue_name, sequence_number, lock_token)

def Func(arg_0, arg_1, arg_2, arg_3):
        '''
        Unlocks a message for processing by other receivers on a given
        queue. This operation deletes the lock object, causing the
        message to be unlocked. A message must have first been locked by a
        receiver before this operation is called.

        queue_name:
            Name of the queue.
        sequence_number:
            The sequence number of the message to be unlocked as returned in
            BrokerProperties['SequenceNumber'] by the Peek Message operation.
        lock_token:
            The ID of the lock as returned by the Peek Message operation in
            BrokerProperties['LockToken']
        '''
        _validate_not_none('queue_name', arg_1)
        _validate_not_none('sequence_number', arg_2)
        _validate_not_none('lock_token', arg_3)
        arg_4 = HTTPRequest()
        arg_4.method = 'PUT'
        arg_4.host = arg_0._get_host()
        arg_4.path = '/' + _str(arg_1) + \
                       '/messages/' + _str(arg_2) + \
                       '/' + _str(arg_3) + ''
        arg_4.path, arg_4.query = arg_0._httpclient._update_request_uri_query(arg_4)  # pylint: disable=protected-access
        arg_4.headers = arg_0._update_service_bus_header(arg_4)
        arg_0._perform_request(arg_4)

Unlocks a message for processing by other receivers on a given queue . This operation deletes the lock object causing the message to be unlocked . A message must have first been locked by a receiver before this operation is called .


def Func(arg_0, arg_1, arg_2):
    """Output a figure which consists of a set of subplot,, either as an image on the screen or to the hard-disk as a \
    .png file.

    Parameters
    -----------
    output_path : str
        The path on the hard-disk where the figure is output.
    output_filename : str
        The filename of the figure that is output.
    output_format : str
        The format the figue is output:
        'show' - display on computer screen.
        'png' - output to hard-disk as a png.
    """
    if arg_2 is 'show':
        plt.show()
    elif arg_2 is 'png':
        plt.savefig(arg_0 + arg_1 + '.png', bbox_inches='tight')
    elif arg_2 is 'fits':
        raise exc.PlottingException('You cannot output a subplots with format .fits')

Output a figure which consists of a set of subplot either as an image on the screen or to the hard - disk as a \ . png file .


def Func(arg_0, arg_1: arg_2):
        """
        Set the current time. This can be used to jump in the timeline.

        Args:
            value (float): The new time
        """
        if arg_1 < 0:
            arg_1 = 0

        arg_0.offset += arg_0.get_time() - arg_1

Set the current time . This can be used to jump in the timeline .


Opens local preview of your blog website

def
Func
(
arg_0
)
:
arg_1
=
arg_0
.
obj
pelican
(
arg_1
,
'--verbose'
,
'--ignore-cache'
)
arg_2
=
os
.
chdir
(
arg_1
[
'OUTPUT_DIR'
]
)
try
:
try
:
arg_3
=
'python -m http.server '
+
str
(
PORT
)
arg_2
=
run
(
arg_3
,
bg
=
True
)
time
.
sleep
(
3
)
click
.
launch
(
'http://localhost:8000'
)
time
.
sleep
(
5
)
pelican
(
arg_1
,
'--autoreload'
)
except
Exception
:
if
arg_2
is
not
:
arg_2
.
kill
(
)
raise
except
KeyboardInterrupt
:
abort
(
arg_0
)

def Func(arg_0):
    """Opens local Func of your blog website"""

    arg_1 = arg_0.obj

    pelican(arg_1, '--verbose', '--ignore-cache')

    arg_2 = None
    os.chdir(arg_1['OUTPUT_DIR'])
    try:
        try:
            arg_3 = 'python -m http.server ' + str(PORT)
            arg_2 = run(arg_3, bg=True)

            time.sleep(3)
            click.launch('http://localhost:8000')

            time.sleep(5)
            pelican(arg_1, '--autoreload')
        except Exception:
            if arg_2 is not None:
                arg_2.kill()
            raise
    except KeyboardInterrupt:
        abort(arg_0)


def Func ( arg_0 ) : if not hasattr ( arg_0 . gallery , "exifCache" ) : _restore_cache ( arg_0 . gallery ) arg_1 = arg_0 . gallery . exifCache for arg_2 in arg_0 . medias : if arg_2 . type == "image" : arg_3 = os . path . join ( arg_2 . path , arg_2 . filename ) if arg_3 in arg_1 : arg_2 . exif = arg_1 [ arg_3 ]

def Func(arg_0):
    """Loads the exif data of all images in an album from cache"""
    if not hasattr(arg_0.gallery, "exifCache"):
        _restore_cache(arg_0.gallery)
    arg_1 = arg_0.gallery.exifCache

    for arg_2 in arg_0.medias:
        if arg_2.type == "image":
            arg_3 = os.path.join(arg_2.path, arg_2.filename)
            if arg_3 in arg_1:
                arg_2.exif = arg_1[arg_3]


def Func ( arg_0 : arg_1 ) -> Mapping [ str , List [ int ] ] : arg_2 = defaultdict ( list ) for arg_3 , arg_4 , arg_3 in arg_0 . warnings : arg_2 [ str ( arg_4 ) ] . append ( arg_4 . line_number ) return dict ( arg_2 )

def Func(arg_0: arg_1) -> Mapping[str, List[int]]:
    """Group the errors together for analysis of the most frequent error.

    :return: A dictionary of {error string: list of line numbers}
    """
    arg_2 = defaultdict(list)

    for arg_3, arg_4, arg_3 in arg_0.warnings:
        arg_2[str(arg_4)].append(arg_4.line_number)

    return dict(arg_2)

Group the errors together for analysis of the most frequent error .


(self, messages, message_timeout=0, session=None, **kwargs)

async def Func(arg_0, arg_1, arg_2=0, arg_3=None, **arg_4):
        """Send one or more messages to the current entity.

        This operation will open a single-use connection, Func the supplied messages, and close
        connection. If the entity requires sessions, a session ID must be either
        provided here, or set on each outgoing message.

        :param messages: One or more messages to be sent.
        :type messages: ~azure.servicebus.aio.async_message.Message or
         list[~azure.servicebus.aio.async_message.Message]
        :param message_timeout: The period in seconds during which the Message must be
         sent. If the Func is not completed in this time it will return a failure result.
        :type message_timeout: int
        :param session: An optional session ID. If supplied this session ID will be
         applied to every outgoing message sent with this Sender.
         If an individual message already has a session ID, that will be
         used instead. If no session ID is supplied here, nor set on an outgoing
         message, a ValueError will be raised if the entity is sessionful.
        :type session: str or ~uuid.Guid
        :raises: ~azure.servicebus.common.errors.MessageSendFailed
        :returns: A list of the Func results of all the messages. Each
         Func result is a tuple with two values. The first is a boolean, indicating `True`
         if the message sent, or `False` if it failed. The second is an error if the message
         failed, otherwise it will be `None`.
        :rtype: list[tuple[bool, ~azure.servicebus.common.errors.MessageSendFailed]]

        Example:
            .. literalinclude:: ../examples/async_examples/test_examples_async.py
                :start-after: [START queue_client_Func]
                :end-before: [END queue_client_Func]
                :language: python
                :dedent: 4
                :caption: Send a single message.

            .. literalinclude:: ../examples/async_examples/test_examples_async.py
                :start-after: [START queue_client_Func_multiple]
                :end-before: [END queue_client_Func_multiple]
                :language: python
                :dedent: 4
                :caption: Send multiple messages.

        """
        async with arg_0.get_Funcer(arg_2=arg_2, arg_3=arg_3, **arg_4) as Funcer:
            if isinstance(arg_1, Message):
                Funcer.queue_message(arg_1)
            else:
                try:
                    arg_1 = list(arg_1)
                except TypeError:
                    raise TypeError(
                        "Value of messages must be a 'Message' object or a synchronous iterable of 'Message' objects.")

                for arg_5 in arg_1:
                    if not isinstance(arg_5, Message):
                        raise TypeError("Item in iterator is not of type 'Message'.")
                    Funcer.queue_message(arg_5)

            return await Funcer.Func_pending_messages()

Send one or more messages to the current entity.

        This operation will open a single-use connection, send the supplied messages, and close
        connection. If the entity requires sessions, a session ID must be either
        provided here, or set on each outgoing message.

        :param messages: One or more messages to be sent.
        :type messages: ~azure.servicebus.aio.async_message.Message or
         list[~azure.servicebus.aio.async_message.Message]
        :param message_timeout: The period in seconds during which the Message must be
         sent. If the send is not completed in this time it will return a failure result.
        :type message_timeout: int
        :param session: An optional session ID. If supplied this session ID will be
         applied to every outgoing message sent with this Sender.
         If an individual message already has a session ID, that will be
         used instead. If no session ID is supplied here, nor set on an outgoing
         message, a ValueError will be raised if the entity is sessionful.
        :type session: str or ~uuid.Guid
        :raises: ~azure.servicebus.common.errors.MessageSendFailed
        :returns: A list of the send results of all the messages. Each
         send result is a tuple with two values. The first is a boolean, indicating `True`
         if the message sent, or `False` if it failed. The second is an error if the message
         failed, otherwise it will be `None`.
        :rtype: list[tuple[bool, ~azure.servicebus.common.errors.MessageSendFailed]]

        Example:
            .. literalinclude:: ../examples/async_examples/test_examples_async.py
                :start-after: [START queue_client_send]
                :end-before: [END queue_client_send]
                :language: python
                :dedent: 4
                :caption: Send a single message.

            .. literalinclude:: ../examples/async_examples/test_examples_async.py
                :start-after: [START queue_client_send_multiple]
                :end-before: [END queue_client_send_multiple]
                :language: python
                :dedent: 4
                :caption: Send multiple messages.

Send one or more messages to the current entity .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 = 2 ) : if arg_0 . path != None and len ( arg_0 . path ) > 1 and arg_0 . path . contains ( arg_1 , arg_2 ) : if not arg_0 . path . contains ( arg_1 + arg_3 , arg_2 ) or not arg_0 . path . contains ( arg_1 , arg_2 + arg_3 ) or not arg_0 . path . contains ( arg_1 - arg_3 , arg_2 ) or not arg_0 . path . contains ( arg_1 , arg_2 - arg_3 ) or not arg_0 . path . contains ( arg_1 + arg_3 , arg_2 + arg_3 ) or not arg_0 . path . contains ( arg_1 - arg_3 , arg_2 - arg_3 ) or not arg_0 . path . contains ( arg_1 + arg_3 , arg_2 - arg_3 ) or not arg_0 . path . contains ( arg_1 - arg_3 , arg_2 + arg_3 ) : return True return False

def Func(arg_0, arg_1, arg_2, arg_3=2):

        """ Returns true when x, y is on the path stroke outline.
        """

        if arg_0.path != None and len(arg_0.path) > 1 \
        and arg_0.path.contains(arg_1, arg_2):
            # If all points around the mouse are also part of the path,
            # this means we are somewhere INSIDE the path.
            # Only points near the edge (i.e. on the outline stroke)
            # should propagate.
            if not arg_0.path.contains(arg_1+arg_3, arg_2) \
            or not arg_0.path.contains(arg_1, arg_2+arg_3) \
            or not arg_0.path.contains(arg_1-arg_3, arg_2) \
            or not arg_0.path.contains(arg_1, arg_2-arg_3) \
            or not arg_0.path.contains(arg_1+arg_3, arg_2+arg_3) \
            or not arg_0.path.contains(arg_1-arg_3, arg_2-arg_3) \
            or not arg_0.path.contains(arg_1+arg_3, arg_2-arg_3) \
            or not arg_0.path.contains(arg_1-arg_3, arg_2+arg_3):
                return True

        return False

Returns true when x y is on the path stroke outline .


(self, expression, percentage=50., binby=[], limits=None, shape=default_shape, percentile_shape=256, percentile_limits="minmax", selection=False, delay=False)

return self.percentile_approx(expression, 50, binby=binby, limits=limits, shape=shape, percentile_shape=percentile_shape, percentile_limits=percentile_limits, selection=selection, delay=delay)

def Func(arg_0, arg_1, arg_2=50., arg_3=[], arg_4=None, arg_5=arg_6, arg_7=256, arg_8="minmax", arg_9=False, arg_10=False):
        """Calculate the median , possibly on a grid defined by binby.

        NOTE: this value is approximated by calculating the cumulative distribution on a grid defined by
        percentile_shape and percentile_limits

        :param expression: {expression}
        :param binby: {binby}
        :param limits: {limits}
        :param shape: {shape}
        :param percentile_limits: {percentile_limits}
        :param percentile_shape: {percentile_shape}
        :param selection: {selection}
        :param delay: {delay}
        :return: {return_stat_scalar}
        """
        return arg_0.percentile_approx(arg_1, 50, arg_3=arg_3, arg_4=arg_4, arg_5=arg_5, arg_7=arg_7, arg_8=arg_8, arg_9=arg_9, arg_10=arg_10)

Calculate the median possibly on a grid defined by binby .


def
Func
(
)
:
print
(
"Looking for FANN libs..."
)
find_fann
(
)
print
(
"running SWIG..."
)
arg_0
=
find_swig
(
)
arg_1
=
[
arg_0
,
'-c++'
,
'-python'
,
'fann2/fann2.i'
]
subprocess
.
Popen
(
arg_1
)
.
wait
(
)

def Func():
    '''Run SWIG with specified parameters'''
    print("Looking for FANN libs...")
    find_fann()
    print("running SWIG...")
    arg_0 = find_swig()
    arg_1 = [arg_0, '-c++', '-python', 'fann2/fann2.i']
    subprocess.Popen(arg_1).wait()


def Func ( ) : arg_0 = imp . load_module ( 'strptime_patched' , * imp . find_module ( '_strptime' ) ) arg_1 = imp . load_module ( 'calendar_patched' , * imp . find_module ( '_strptime' ) ) arg_0 . _getlang = lambda : ( 'en_US' , 'UTF-8' ) arg_0 . calendar = arg_1 arg_0 . calendar . day_abbr = [ 'mon' , 'tue' , 'wed' , 'thu' , 'fri' , 'sat' , 'sun' ] arg_0 . calendar . day_name = [ 'monday' , 'tuesday' , 'wednesday' , 'thursday' , 'friday' , 'saturday' , 'sunday' ] arg_0 . calendar . month_abbr = [ '' , 'jan' , 'feb' , 'mar' , 'apr' , 'may' , 'jun' , 'jul' , 'aug' , 'sep' , 'oct' , 'nov' , 'dec' ] arg_0 . calendar . month_name = [ '' , 'january' , 'february' , 'march' , 'april' , 'may' , 'june' , 'july' , 'august' , 'september' , 'october' , 'november' , 'december' ] return arg_0 . _strptime_time

def Func():
    """Monkey patching _strptime to avoid problems related with non-english
    locale changes on the system.

    For example, if system's locale is set to fr_FR. Parser won't recognize
    any date since all languages are translated to english dates.
    """

    arg_0 = imp.load_module(
        'strptime_patched', *imp.find_module('_strptime')
    )

    arg_1 = imp.load_module(
        'calendar_patched', *imp.find_module('_strptime')
    )

    arg_0._getlang = lambda: ('en_US', 'UTF-8')
    arg_0.calendar = arg_1
    arg_0.calendar.day_abbr = [
        'mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun'
    ]
    arg_0.calendar.day_name = [
        'monday', 'tuesday', 'wednesday', 'thursday',
        'friday', 'saturday', 'sunday'
    ]
    arg_0.calendar.month_abbr = [
        '', 'jan', 'feb', 'mar', 'apr', 'may', 'jun',
        'jul', 'aug', 'sep', 'oct', 'nov', 'dec'
    ]
    arg_0.calendar.month_name = [
        '', 'january', 'february', 'march', 'april',
        'may', 'june', 'july', 'august', 'september',
        'october', 'november', 'december'
    ]

    return arg_0._strptime_time

Monkey patching _strptime to avoid problems related with non - english locale changes on the system .


def Func ( arg_0 , arg_1 , arg_2 = 6 ) : arg_3 = [ ] arg_4 = re . findall ( arg_0 . re [ "image" ] , arg_1 ) for arg_5 in arg_4 : arg_5 = arg_0 . parse_balanced_image ( arg_5 ) arg_6 = arg_5 . split ( "|" ) arg_7 = arg_6 [ 0 ] . replace ( "[[Image:" , "" ) . strip ( ) arg_8 = u"" arg_9 = { } arg_10 = [ ] if len ( arg_6 ) > 1 : arg_6 = "|" . join ( arg_6 [ 1 : ] ) arg_9 = arg_0 . parse_links ( arg_6 ) arg_10 = arg_0 . plain ( arg_6 ) . split ( "|" ) arg_8 = u"" if len ( arg_10 [ - 1 ] ) > arg_2 : arg_8 = arg_10 [ - 1 ] arg_10 = arg_10 [ : - 1 ] arg_6 = WikipediaImage ( arg_7 , arg_8 , arg_9 , arg_10 ) arg_3 . append ( arg_6 ) arg_1 = arg_1 . replace ( arg_5 , "" ) return arg_3 , arg_1 . strip ( )

def Func(arg_0, arg_1, arg_2=6):

        """ Returns a list of images found in the markup.

        An image has a pathname, a description in plain text
        and a list of properties Wikipedia uses to size and place images.

        # A Wikipedia image looks like:
        # [[Image:Columbia Supercomputer - NASA Advanced Supercomputing Facility.jpg|right|thumb|
        #   The [[NASA]] [[Columbia (supercomputer)|Columbia Supercomputer]].]]
        # Parts are separated by "|".
        # The first part is the image file, the last part can be a description.
        # In between are display properties, like "right" or "thumb".

        """

        arg_3 = []
        arg_4 = re.findall(arg_0.re["image"], arg_1)
        for arg_5 in arg_4:
            arg_5 = arg_0.parse_balanced_image(arg_5)
            arg_6 = arg_5.split("|")
            arg_7 = arg_6[0].replace("[[Image:", "").strip()
            arg_8 = u""
            arg_9 = {}
            arg_10 = []
            if len(arg_6) > 1:
                arg_6 = "|".join(arg_6[1:])
                arg_9 = arg_0.parse_links(arg_6)
                arg_10 = arg_0.plain(arg_6).split("|")
                arg_8 = u""
                # Best guess: an image description is normally
                # longer than six characters, properties like
                # "thumb" and "right" are less than six characters.
                if len(arg_10[-1]) > arg_2:
                    arg_8 = arg_10[-1]
                    arg_10 = arg_10[:-1]
            arg_6 = WikipediaImage(arg_7, arg_8, arg_9, arg_10)
            arg_3.append(arg_6)
            arg_1 = arg_1.replace(arg_5, "")

        return arg_3, arg_1.strip()

Returns a list of images found in the markup . An image has a pathname a description in plain text and a list of properties Wikipedia uses to size and place images .


def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Packed shuffle words.

        Copies doublewords from source operand (second operand) and inserts them in the destination operand
        (first operand) at locations selected with the order operand (third operand).

        :param cpu: current CPU.
        :param op0: destination operand.
        :param op1: source operand.
        :param op3: order operand.
         """
        arg_4 = arg_1.size
        arg_5 = arg_1.read()
        arg_6 = arg_2.read()
        arg_7 = Operators.ZEXTEND(arg_3.read(), arg_4)
        assert arg_4 == 64
        arg_5 |= ((arg_6 >> ((arg_7 >> 0) & 3 * 16)) & 0xffff)
        arg_5 |= ((arg_6 >> ((arg_7 >> 2) & 3 * 16)) & 0xffff) << 16
        arg_5 |= ((arg_6 >> ((arg_7 >> 4) & 3 * 16)) & 0xffff) << 32
        arg_5 |= ((arg_6 >> ((arg_7 >> 6) & 3 * 16)) & 0xffff) << 48
        arg_1.write(arg_5)


def
Func
(
arg_0
,
arg_1
=
"Error not specified!"
)
:
if
not
arg_0
.
_error
:
LOG
.
error
(
"Connection failed: %s"
,
str
(
arg_1
)
)
arg_0
.
_error
=
arg_1

def Func(arg_0, arg_1="Error not specified!"):
        """Clean up after connection failure detected."""
        if not arg_0._error:
            LOG.error("Connection failed: %s", str(arg_1))
            arg_0._error = arg_1

Clean up after connection failure detected .


return Firewall.get_object(
            api_token=self.token,
            firewall_id=firewall_id,
        )

def Func ( arg_0 , arg_1 ) : return Firewall . get_object ( api_token = arg_0 . token , arg_1 = arg_1 , )

def Func(arg_0, arg_1):
        """
            Return a Firewall by its ID.
        """
        return Firewall.get_object(
            api_token=arg_0.token,
            arg_1=arg_1,
        )


return JobDescriptor(job_metadata, job_params, job_resources,
                         task_descriptors)

def Func ( arg_0 , arg_1 ) : try : arg_2 = yaml . full_load ( arg_1 ) except AttributeError : arg_2 = yaml . load ( arg_1 ) arg_3 = arg_2 . get ( 'dsub-version' ) if not arg_3 : return arg_0 . _Func_v0 ( arg_2 ) arg_4 = { } for arg_5 in [ 'job-id' , 'job-name' , 'task-ids' , 'user-id' , 'dsub-version' , 'user-project' , 'script-name' ] : if arg_2 . get ( arg_5 ) is not None : arg_4 [ arg_5 ] = arg_2 . get ( arg_5 ) arg_4 [ 'create-time' ] = dsub_util . replace_timezone ( arg_2 . get ( 'create-time' ) , pytz . utc ) arg_6 = Resources ( logging = arg_2 . get ( 'logging' ) ) arg_7 = { } arg_7 [ 'labels' ] = arg_0 . _label_params_from_dict ( arg_2 . get ( 'labels' , { } ) ) arg_7 [ 'envs' ] = arg_0 . _env_params_from_dict ( arg_2 . get ( 'envs' , { } ) ) arg_7 [ 'inputs' ] = arg_0 . _input_file_params_from_dict ( arg_2 . get ( 'inputs' , { } ) , False ) arg_7 [ 'input-recursives' ] = arg_0 . _input_file_params_from_dict ( arg_2 . get ( 'input-recursives' , { } ) , True ) arg_7 [ 'outputs' ] = arg_0 . _output_file_params_from_dict ( arg_2 . get ( 'outputs' , { } ) , False ) arg_7 [ 'output-recursives' ] = arg_0 . _output_file_params_from_dict ( arg_2 . get ( 'output-recursives' , { } ) , True ) arg_7 [ 'mounts' ] = arg_0 . _mount_params_from_dict ( arg_2 . get ( 'mounts' , { } ) ) arg_8 = [ ] for arg_9 in arg_2 . get ( 'tasks' , [ ] ) : arg_10 = { 'task-id' : arg_9 . get ( 'task-id' ) } arg_11 = arg_9 . get ( 'create-time' ) if arg_11 : arg_10 [ 'create-time' ] = dsub_util . replace_timezone ( arg_11 , pytz . utc ) if arg_9 . get ( 'task-attempt' ) is not None : arg_10 [ 'task-attempt' ] = arg_9 . get ( 'task-attempt' ) arg_12 = { } arg_12 [ 'labels' ] = arg_0 . _label_params_from_dict ( arg_9 . get ( 'labels' , { } ) ) arg_12 [ 'envs' ] = arg_0 . _env_params_from_dict ( arg_9 . get ( 'envs' , { } ) ) arg_12 [ 'inputs' ] = arg_0 . _input_file_params_from_dict ( arg_9 . get ( 'inputs' , { } ) , False ) arg_12 [ 'input-recursives' ] = arg_0 . _input_file_params_from_dict ( arg_9 . get ( 'input-recursives' , { } ) , True ) arg_12 [ 'outputs' ] = arg_0 . _output_file_params_from_dict ( arg_9 . get ( 'outputs' , { } ) , False ) arg_12 [ 'output-recursives' ] = arg_0 . _output_file_params_from_dict ( arg_9 . get ( 'output-recursives' , { } ) , True ) arg_13 = Resources ( logging_path = arg_9 . get ( 'logging-path' ) ) arg_8 . append ( TaskDescriptor ( arg_10 , arg_12 , arg_13 ) ) return JobDescriptor ( arg_4 , arg_7 , arg_6 , arg_8 )

def Func(arg_0, arg_1):
    """Populate and return a JobDescriptor from a YAML string."""
    try:
      arg_2 = yaml.full_load(arg_1)
    except AttributeError:
      # For installations that cannot update their PyYAML version
      arg_2 = yaml.load(arg_1)

    # If the YAML does not contain a top-level dsub version, then assume that
    # the string is coming from the local provider, reading an old version of
    # its meta.yaml.
    arg_3 = arg_2.get('dsub-version')
    if not arg_3:
      return arg_0._Func_v0(arg_2)

    arg_4 = {}
    for arg_5 in [
        'job-id', 'job-name', 'task-ids', 'user-id', 'dsub-version',
        'user-project', 'script-name'
    ]:
      if arg_2.get(arg_5) is not None:
        arg_4[arg_5] = arg_2.get(arg_5)

    # Make sure that create-time string is turned into a datetime
    arg_4['create-time'] = dsub_util.replace_timezone(
        arg_2.get('create-time'), pytz.utc)

    arg_6 = Resources(logging=arg_2.get('logging'))

    arg_7 = {}
    arg_7['labels'] = arg_0._label_params_from_dict(arg_2.get('labels', {}))
    arg_7['envs'] = arg_0._env_params_from_dict(arg_2.get('envs', {}))
    arg_7['inputs'] = arg_0._input_file_params_from_dict(
        arg_2.get('inputs', {}), False)
    arg_7['input-recursives'] = arg_0._input_file_params_from_dict(
        arg_2.get('input-recursives', {}), True)
    arg_7['outputs'] = arg_0._output_file_params_from_dict(
        arg_2.get('outputs', {}), False)
    arg_7['output-recursives'] = arg_0._output_file_params_from_dict(
        arg_2.get('output-recursives', {}), True)
    arg_7['mounts'] = arg_0._mount_params_from_dict(arg_2.get('mounts', {}))

    arg_8 = []
    for arg_9 in arg_2.get('tasks', []):
      arg_10 = {'task-id': arg_9.get('task-id')}

      # Old instances of the meta.yaml do not have a task create time.
      arg_11 = arg_9.get('create-time')
      if arg_11:
        arg_10['create-time'] = dsub_util.replace_timezone(
            arg_11, pytz.utc)

      if arg_9.get('task-attempt') is not None:
        arg_10['task-attempt'] = arg_9.get('task-attempt')

      arg_12 = {}
      arg_12['labels'] = arg_0._label_params_from_dict(
          arg_9.get('labels', {}))
      arg_12['envs'] = arg_0._env_params_from_dict(arg_9.get('envs', {}))
      arg_12['inputs'] = arg_0._input_file_params_from_dict(
          arg_9.get('inputs', {}), False)
      arg_12['input-recursives'] = arg_0._input_file_params_from_dict(
          arg_9.get('input-recursives', {}), True)
      arg_12['outputs'] = arg_0._output_file_params_from_dict(
          arg_9.get('outputs', {}), False)
      arg_12['output-recursives'] = arg_0._output_file_params_from_dict(
          arg_9.get('output-recursives', {}), True)

      arg_13 = Resources(logging_path=arg_9.get('logging-path'))

      arg_8.append(
          TaskDescriptor(arg_10, arg_12, arg_13))

    return JobDescriptor(arg_4, arg_7, arg_6,
                         arg_8)

Populate and return a JobDescriptor from a YAML string .


def Func ( arg_0 , arg_1 = None , arg_2 = False ) : if arg_1 is None : arg_1 = arg_0 . filename arg_3 = open ( arg_1 , 'rb+' ) try : arg_0 . metadata_blocks . append ( Padding ( b'\x00' * 1020 ) ) MetadataBlock . group_padding ( arg_0 . metadata_blocks ) arg_4 = arg_0 . __check_header ( arg_3 ) arg_5 = arg_0 . __find_audio_offset ( arg_3 ) - arg_4 arg_6 = MetadataBlock . writeblocks ( arg_0 . metadata_blocks ) if arg_2 and arg_4 > 4 : arg_5 += arg_4 - 4 arg_4 = 4 if len ( arg_6 ) > arg_5 : arg_7 = arg_0 . metadata_blocks [ - 1 ] arg_8 = arg_7 . length - ( len ( arg_6 ) - arg_5 ) if arg_8 > 0 : arg_7 . length = arg_8 arg_6 = MetadataBlock . writeblocks ( arg_0 . metadata_blocks ) assert len ( arg_6 ) == arg_5 elif len ( arg_6 ) < arg_5 : arg_0 . metadata_blocks [ - 1 ] . length += ( arg_5 - len ( arg_6 ) ) arg_6 = MetadataBlock . writeblocks ( arg_0 . metadata_blocks ) assert len ( arg_6 ) == arg_5 if len ( arg_6 ) != arg_5 : arg_10 = ( len ( arg_6 ) - arg_5 ) insert_bytes ( arg_3 , arg_10 , arg_4 ) arg_3 . seek ( arg_4 - 4 ) arg_3 . write ( b"fLaC" + arg_6 ) if arg_2 : try : arg_3 . seek ( - 128 , 2 ) except IOError : pass else : if arg_3 . read ( 3 ) == b"TAG" : arg_3 . seek ( - 128 , 2 ) arg_3 . truncate ( ) finally : arg_3 . close ( )

def Func(arg_0, arg_1=None, arg_2=False):
        """Save metadata blocks to a file.

        If no filename is given, the one most recently loaded is used.
        """

        if arg_1 is None:
            arg_1 = arg_0.filename
        arg_3 = open(arg_1, 'rb+')

        try:
            # Ensure we've got padding at the end, and only at the end.
            # If adding makes it too large, we'll scale it down later.
            arg_0.metadata_blocks.append(Padding(b'\x00' * 1020))
            MetadataBlock.group_padding(arg_0.metadata_blocks)

            arg_4 = arg_0.__check_header(arg_3)
            # "fLaC" and maybe ID3
            arg_5 = arg_0.__find_audio_offset(arg_3) - arg_4
            arg_6 = MetadataBlock.writeblocks(arg_0.metadata_blocks)

            # Delete ID3v2
            if arg_2 and arg_4 > 4:
                arg_5 += arg_4 - 4
                arg_4 = 4

            if len(arg_6) > arg_5:
                # If we have too much data, see if we can reduce padding.
                arg_7 = arg_0.metadata_blocks[-1]
                arg_8 = arg_7.length - (len(arg_6) - arg_5)
                if arg_8 > 0:
                    arg_7.length = arg_8
                    arg_6 = MetadataBlock.writeblocks(arg_0.metadata_blocks)
                    assert len(arg_6) == arg_5

            elif len(arg_6) < arg_5:
                # If we have too little data, increase padding.
                arg_0.metadata_blocks[-1].length += (arg_5 - len(arg_6))
                arg_6 = MetadataBlock.writeblocks(arg_0.metadata_blocks)
                assert len(arg_6) == arg_5

            if len(arg_6) != arg_5:
                # We couldn't reduce the padding enough.
                arg_10 = (len(arg_6) - arg_5)
                insert_bytes(arg_3, arg_10, arg_4)

            arg_3.seek(arg_4 - 4)
            arg_3.write(b"fLaC" + arg_6)

            # Delete ID3v1
            if arg_2:
                try:
                    arg_3.seek(-128, 2)
                except IOError:
                    pass
                else:
                    if arg_3.read(3) == b"TAG":
                        arg_3.seek(-128, 2)
                        arg_3.truncate()
        finally:
            arg_3.close()


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = ACCOUNTS_API . format ( arg_1 ) + "/roles/{}" . format ( arg_2 ) return CanvasRole ( data = arg_0 . _get_resource ( arg_3 ) )

def Func(arg_0, arg_1, arg_2):
        """
        Get information about a single role, for the passed Canvas account ID.

        https://canvas.instructure.com/doc/api/roles.html#method.role_overrides.show
        """
        arg_3 = ACCOUNTS_API.format(arg_1) + "/roles/{}".format(arg_2)
        return CanvasRole(data=arg_0._get_resource(arg_3))

Get information about a single role for the passed Canvas account ID .


def Func ( arg_0 , arg_1 ) : if isinstance ( arg_1 , np . ndarray ) : return arg_1 . tolist ( ) elif isinstance ( arg_1 , bytes ) : return arg_1 . decode ( ) elif isinstance ( arg_1 , complex ) : return ( arg_1 . real , arg_1 . imag ) elif ( isinstance ( arg_1 , ( float , np . float64 , np . float_ ) ) and not np . isfinite ( arg_1 ) ) : return None elif isinstance ( arg_1 , ( np . int8 , np . int16 , np . int32 , np . int64 ) ) : return int ( arg_1 ) else : return json . JSONEncoder . Func ( arg_0 , arg_1 )

def Func(arg_0, arg_1):
        '''Overrides the Func serializer for `JSONEncoder`.

        This can serialize the following objects in addition to what
        `JSONEncoder` can already do.

        - `np.array`
        - `bytes`
        - `complex`
        - `np.float64` and other `np.dtype` objects

        Parameters
        ----------

        obj : object
            A Python object to serialize to JSON.

        Returns
        -------

        str
            A JSON encoded representation of the input object.

        '''

        if isinstance(arg_1, np.ndarray):
            return arg_1.tolist()
        elif isinstance(arg_1, bytes):
            return arg_1.decode()
        elif isinstance(arg_1, complex):
            return (arg_1.real, arg_1.imag)
        elif (isinstance(arg_1, (float, np.float64, np.float_)) and
              not np.isfinite(arg_1)):
            return None
        elif isinstance(arg_1, (np.int8, np.int16, np.int32, np.int64)):
            return int(arg_1)
        else:
            return json.JSONEncoder.Func(arg_0, arg_1)

Overrides the default serializer for `JSONEncoder`.

        This can serialize the following objects in addition to what
        `JSONEncoder` can already do.

        - `np.array`
        - `bytes`
        - `complex`
        - `np.float64` and other `np.dtype` objects

        Parameters
        ----------

        obj : object
            A Python object to serialize to JSON.

        Returns
        -------

        str
            A JSON encoded representation of the input object.

Overrides the default serializer for JSONEncoder .


(self, i, r,
                              summarize=False,
                              report_unexpected_exceptions=True,
                              context=None)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
False
,
arg_4
=
True
,
arg_5
=
)
:
for
arg_6
in
dir
(
arg_0
)
:
if
arg_6
.
startswith
(
'assert'
)
:
arg_7
=
arg_0
.
_as_dict
(
arg_2
)
arg_8
=
getattr
(
arg_0
,
arg_6
)
try
:
arg_8
(
arg_7
)
except
AssertionError
as
e
:
arg_9
=
ASSERT_CHECK_FAILED
arg_10
=
MESSAGES
[
ASSERT_CHECK_FAILED
]
if
len
(
e
.
args
)
>
0
:
arg_11
=
e
.
args
[
0
]
if
isinstance
(
arg_11
,
(
list
,
tuple
)
)
:
if
len
(
arg_11
)
>
0
:
arg_9
=
arg_11
[
0
]
if
len
(
arg_11
)
>
1
:
arg_10
=
arg_11
[
1
]
else
:
arg_9
=
arg_11
arg_12
=
{
'code'
:
arg_9
}
if
not
arg_3
:
arg_12
[
'message'
]
=
arg_10
arg_12
[
'row'
]
=
arg_1
+
1
arg_12
[
'record'
]
=
arg_2
if
arg_5
is
not
:
arg_12
[
'context'
]
=
arg_5
yield
arg_12
except
Exception
as
e
:
if
arg_4
:
arg_12
=
{
'code'
:
UNEXPECTED_EXCEPTION
}
if
not
arg_3
:
arg_12
[
'message'
]
=
MESSAGES
[
UNEXPECTED_EXCEPTION
]
%
(
e
.
__class__
.
__name__
,
e
)
arg_12
[
'row'
]
=
arg_1
+
1
arg_12
[
'record'
]
=
arg_2
arg_12
[
'exception'
]
=
e
arg_12
[
'function'
]
=
'%s: %s'
%
(
arg_8
.
__name__
,
arg_8
.
__doc__
)
if
arg_5
is
not
:
arg_12
[
'context'
]
=
arg_5
yield
arg_12

def Func(arg_0, arg_1, arg_2,
                              arg_3=False,
                              arg_4=True,
                              arg_5=None):
        """Apply 'assert' methods on `r`."""

        for arg_6 in dir(arg_0):
            if arg_6.startswith('assert'):
                arg_7 = arg_0._as_dict(arg_2)
                arg_8 = getattr(arg_0, arg_6)
                try:
                    arg_8(arg_7)
                except AssertionError as e:
                    arg_9 = ASSERT_CHECK_FAILED
                    arg_10 = MESSAGES[ASSERT_CHECK_FAILED]
                    if len(e.args) > 0:
                        arg_11 = e.args[0]
                        if isinstance(arg_11, (list, tuple)):
                            if len(arg_11) > 0:
                                arg_9 = arg_11[0]
                            if len(arg_11) > 1:
                                arg_10 = arg_11[1]
                        else:
                            arg_9 = arg_11
                    arg_12 = {'code': arg_9}
                    if not arg_3:
                        arg_12['message'] = arg_10
                        arg_12['row'] = arg_1 + 1
                        arg_12['record'] = arg_2
                        if arg_5 is not None: arg_12['context'] = arg_5
                    yield arg_12
                except Exception as e:
                    if arg_4:
                        arg_12 = {'code': UNEXPECTED_EXCEPTION}
                        if not arg_3:
                            arg_12['message'] = MESSAGES[UNEXPECTED_EXCEPTION] % (e.__class__.__name__, e)
                            arg_12['row'] = arg_1 + 1
                            arg_12['record'] = arg_2
                            arg_12['exception'] = e
                            arg_12['function'] = '%s: %s' % (arg_8.__name__,
                                                        arg_8.__doc__)
                            if arg_5 is not None: arg_12['context'] = arg_5
                        yield arg_12


def Func ( arg_0 , arg_1 ) : arg_2 = getattr ( arg_0 , "__setstate__" , None ) if arg_2 : arg_2 ( arg_1 ) return arg_0 arg_3 = None if isinstance ( arg_1 , tuple ) and len ( arg_1 ) == 2 : arg_1 , arg_3 = arg_1 if arg_1 : try : arg_4 = arg_0 . __dict__ try : for arg_5 , arg_6 in arg_7 . iteritems ( arg_1 ) : arg_4 [ arg_7 . moves . intern ( arg_5 ) ] = arg_6 except TypeError : arg_4 . update ( arg_1 ) except RuntimeError : for arg_5 , arg_6 in arg_1 . items ( ) : setattr ( arg_0 , arg_5 , arg_6 ) if arg_3 : for arg_5 , arg_6 in arg_3 . items ( ) : setattr ( arg_0 , arg_5 , arg_6 ) return arg_0

def Func(arg_0, arg_1):
    """
    Apply the setstate protocol to initialize `inst` from `state`.

    INPUT:

    - ``inst`` -- a raw instance of a class
    - ``state`` -- the state to restore; typically a dictionary mapping attribute names to their values

    EXAMPLES::

        >>> from openmath.convert_pickle import Func
        >>> class A(object): pass
        >>> inst = A.__new__(A)
        >>> state = {"foo": 1, "bar": 4}
        >>> inst2 = Func(inst,state)
        >>> inst is inst2
        True
        >>> inst.foo
        1
        >>> inst.bar
        4
    """
    # Copied from Pickler.load_build
    arg_2 = getattr(arg_0, "__setstate__", None)
    if arg_2:
        arg_2(arg_1)
        return arg_0
    arg_3 = None
    if isinstance(arg_1, tuple) and len(arg_1) == 2:
        arg_1, arg_3 = arg_1

    if arg_1:
        try:
            arg_4 = arg_0.__dict__
            try:
                for arg_5, arg_6 in arg_7.iteritems(arg_1):
                    arg_4[arg_7.moves.intern(arg_5)] = arg_6
            # keys in state don't have to be strings
            # don't blow up, but don't go out of our way
            except TypeError:
                arg_4.update(arg_1)

        except RuntimeError:
            # XXX In restricted execution, the instance's __dict__
            # is not accessible.  Use the old way of unpickling
            # the instance variables.  This is a semantic
            # difference when unpickling in restricted
            # vs. unrestricted modes.
            # Note, however, that cPickle has never tried to do the
            # .update() business, and always uses
            #     PyObject_SetItem(inst.__dict__, key, value) in a
            # loop over state.items().
            for arg_5, arg_6 in arg_1.items():
                setattr(arg_0, arg_5, arg_6)
    if arg_3:
        for arg_5, arg_6 in arg_3.items():
            setattr(arg_0, arg_5, arg_6)
    return arg_0

Apply the setstate protocol to initialize `inst` from `state`.

    INPUT:

    - ``inst`` -- a raw instance of a class
    - ``state`` -- the state to restore; typically a dictionary mapping attribute names to their values

    EXAMPLES::

        >>> from openmath.convert_pickle import cls_build
        >>> class A(object): pass
        >>> inst = A.__new__(A)
        >>> state = {"foo": 1, "bar": 4}
        >>> inst2 = cls_build(inst,state)
        >>> inst is inst2
        True
        >>> inst.foo
        1
        >>> inst.bar
        4

Apply the setstate protocol to initialize inst from state .


(self, headers=None, query=None, cdn=False, body=None)

return self.request(
            'POST', '', body or '', headers, query=query, cdn=cdn)

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = False , arg_4 = None ) : return arg_0 . request ( 'POST' , '' , arg_4 or '' , arg_1 , arg_2 = arg_2 , arg_3 = arg_3 )

def Func(arg_0, arg_1=None, arg_2=None, arg_3=False, arg_4=None):
        """
        POSTs the account and returns the results. This is usually
        done to set X-Account-Meta-xxx headers. Note that any existing
        X-Account-Meta-xxx headers will remain untouched. To remove an
        X-Account-Meta-xxx header, send the header with an empty
        string as its value.

        :param headers: Additional headers to send with the request.
        :param query: Set to a dict of query values to send on the
            query string of the request.
        :param cdn: If set True, the CDN management interface will be
            used.
        :param body: No known Swift POSTs take a body; but the option
            is there for the future.
        :returns: A tuple of (status, reason, headers, contents).

            :status: is an int for the HTTP status code.
            :reason: is the str for the HTTP status (ex: "Ok").
            :headers: is a dict with all lowercase keys of the HTTP
                headers; if a header has multiple values, it will be a
                list.
            :contents: is the str for the HTTP body.
        """
        return arg_0.request(
            'POST', '', arg_4 or '', arg_1, arg_2=arg_2, arg_3=arg_3)

POSTs the account and returns the results . This is usually done to set X - Account - Meta - xxx headers . Note that any existing X - Account - Meta - xxx headers will remain untouched . To remove an X - Account - Meta - xxx header send the header with an empty string as its value .


return self.make_oauth_session(
            resource_owner_key=access_token,
            resource_owner_secret=access_token_secret)

def Func(arg_0, arg_1):
        """Creates a client with specific access token pair.

        :param token: a tuple of access token pair ``(token, token_secret)``
                      or a dictionary of access token response.
        :returns: a :class:`requests_oauthlib.oauth1_session.OAuth1Session`
                  object.
        """
        if isinstance(arg_1, dict):
            arg_2 = arg_1['oauth_token']
            arg_3 = arg_1['oauth_token_secret']
        else:
            arg_2, arg_3 = arg_1
        return arg_0.make_oauth_session(
            resource_owner_key=arg_2,
            resource_owner_secret=arg_3)

Creates a client with specific access token pair .


def Func ( arg_0 ) : if sys . version_info [ 0 ] == 2 and isinstance ( arg_0 , unicode ) : try : arg_0 = arg_0 . encode ( 'utf-8' ) except UnicodeError : return [ ] arg_1 = ListReporter ( ) try : pyflakes . api . Func ( arg_0 , filename = '<string>' , arg_1 = arg_1 ) except ( AttributeError , RecursionError , UnicodeDecodeError ) : pass return arg_1 . messages

def Func(arg_0):
    """Return messages from pyflakes."""
    if sys.version_info[0] == 2 and isinstance(arg_0, unicode):
        # Convert back to original byte string encoding, otherwise pyflakes
        # call to compile() will complain. See PEP 263. This only affects
        # Python 2.
        try:
            arg_0 = arg_0.encode('utf-8')
        except UnicodeError:  # pragma: no cover
            return []

    arg_1 = ListReporter()
    try:
        pyflakes.api.Func(arg_0, filename='<string>', arg_1=arg_1)
    except (AttributeError, RecursionError, UnicodeDecodeError):
        pass
    return arg_1.messages


def Func ( arg_0 , arg_1 , arg_2 ) : arg_0 . _coroutine_queue . put ( arg_0 . _conversation . rename ( arg_1 ) ) arg_2 ( )

def Func(arg_0, arg_1, arg_2):
        """Rename conversation and call callback."""
        arg_0._coroutine_queue.put(arg_0._conversation.rename(arg_1))
        arg_2()


def Func ( arg_0 : arg_1 . DataFrame , arg_3 , ** arg_4 ) -> arg_1 . DataFrame : if arg_0 . empty : return arg_1 . DataFrame ( ) arg_0 . columns = arg_1 . MultiIndex . from_product ( [ [ arg_3 ] , arg_0 . rename ( arg_5 = dict ( numEvents = 'num_trds' ) ) . columns ] , names = [ 'ticker' , 'field' ] ) arg_0 . index . name = None if arg_4 . get ( 'price_only' , False ) : arg_8 = dict ( axis = 1 , level = 1 ) arg_9 = arg_0 . xs ( 'close' , ** arg_8 ) arg_10 = arg_0 . xs ( 'volume' , ** arg_8 ) . iloc [ : , 0 ] return arg_9 . loc [ arg_10 > 0 ] if arg_10 . min ( ) > 0 else arg_9 else : return arg_0

def Func(arg_0: arg_1.DataFrame, arg_3, **arg_4) -> arg_1.DataFrame:
    """
    Format intraday data

    Args:
        data: pd.DataFrame from bdib
        ticker: ticker

    Returns:
        pd.DataFrame

    Examples:
        >>> Func(
        ...     data=pd.read_parquet('xbbg/tests/data/sample_bdib.parq'),
        ...     ticker='SPY US Equity',
        ... ).xs('close', axis=1, level=1, drop_level=False)
        ticker                    SPY US Equity
        field                             close
        2018-12-28 09:30:00-05:00        249.67
        2018-12-28 09:31:00-05:00        249.54
        2018-12-28 09:32:00-05:00        249.22
        2018-12-28 09:33:00-05:00        249.01
        2018-12-28 09:34:00-05:00        248.86
        >>> Func(
        ...     data=pd.read_parquet('xbbg/tests/data/sample_bdib.parq'),
        ...     ticker='SPY US Equity', price_only=True
        ... )
        ticker                     SPY US Equity
        2018-12-28 09:30:00-05:00         249.67
        2018-12-28 09:31:00-05:00         249.54
        2018-12-28 09:32:00-05:00         249.22
        2018-12-28 09:33:00-05:00         249.01
        2018-12-28 09:34:00-05:00         248.86
    """
    if arg_0.empty: return arg_1.DataFrame()
    arg_0.columns = arg_1.MultiIndex.from_product([
        [arg_3], arg_0.rename(arg_5=dict(numEvents='num_trds')).columns
    ], names=['ticker', 'field'])
    arg_0.index.name = None
    if arg_4.get('price_only', False):
        arg_8 = dict(axis=1, level=1)
        arg_9 = arg_0.xs('close', **arg_8)
        arg_10 = arg_0.xs('volume', **arg_8).iloc[:, 0]
        return arg_9.loc[arg_10 > 0] if arg_10.min() > 0 else arg_9
    else: return arg_0


def Func ( arg_0 ) : if arg_0 . _pool is not None : arg_0 . _pool . Func ( ) arg_0 . _pool . join ( ) arg_0 . _pool = None

def Func(arg_0):
        """Terminate the pool immediately."""
        if arg_0._pool is not None:
            arg_0._pool.Func()
            arg_0._pool.join()
            arg_0._pool = None


def Func ( arg_0 ) : arg_1 = urlparse . urlparse ( arg_0 ) . hostname if arg_1 : return arg_1 else : return arg_0

def Func(arg_0):
        """
        The purpose of this function is to be robust to improper connections
        settings provided by users, specifically in the host field.

        For example -- when users supply ``https://xx.cloud.databricks.com`` as the
        host, we must strip out the protocol to get the host.::

            h = DatabricksHook()
            assert h.Func('https://xx.cloud.databricks.com') == \
                'xx.cloud.databricks.com'

        In the case where users supply the correct ``xx.cloud.databricks.com`` as the
        host, this function is a no-op.::

            assert h.Func('xx.cloud.databricks.com') == 'xx.cloud.databricks.com'

        """
        arg_1 = urlparse.urlparse(arg_0).hostname
        if arg_1:
            # In this case, host = https://xx.cloud.databricks.com
            return arg_1
        else:
            # In this case, host = xx.cloud.databricks.com
            return arg_0

The purpose of this function is to be robust to improper connections
        settings provided by users, specifically in the host field.

        For example -- when users supply ``https://xx.cloud.databricks.com`` as the
        host, we must strip out the protocol to get the host.::

            h = DatabricksHook()
            assert h._parse_host('https://xx.cloud.databricks.com') == \
                'xx.cloud.databricks.com'

        In the case where users supply the correct ``xx.cloud.databricks.com`` as the
        host, this function is a no-op.::

            assert h._parse_host('xx.cloud.databricks.com') == 'xx.cloud.databricks.com'

The purpose of this function is to be robust to improper connections settings provided by users specifically in the host field .


def Func ( arg_0 , * arg_1 , ** arg_2 ) : for arg_3 , arg_4 in arg_0 . plugins : arg_5 = arg_4 ( * arg_1 , ** arg_2 ) if arg_5 is not None : return arg_5

def Func(arg_0, *arg_1, **arg_2):
        """Call all plugins, returning the first non-None result.
        """
        for arg_3, arg_4 in arg_0.plugins:
            arg_5 = arg_4(*arg_1, **arg_2)
            if arg_5 is not None:
                return arg_5

Call all plugins returning the first non - None result .


Returns the color and its complement in a list.

def Func ( arg_0 ) : arg_0 = color ( arg_0 ) arg_1 = colorlist ( arg_0 ) arg_1 . append ( arg_0 . Func ) return arg_1

def Func(arg_0):
    """
    Returns the color and its Func in a list.
    """
    arg_0 = color(arg_0)
    arg_1 = colorlist(arg_0)
    arg_1.append(arg_0.Func)

    return arg_1

Returns the color and its complement in a list .


def Func ( arg_0 : arg_1 , arg_2 : arg_1 ) -> arg_1 : if isinstance ( arg_0 , int ) and isinstance ( arg_2 , int ) : return Fraction ( arg_0 , arg_2 ) return arg_0 / arg_2

def Func(arg_0: arg_1, arg_2: arg_1) -> arg_1:
    """Division reducer. If both arguments are integers, return a Fraction.
    Otherwise, return the true division of x and y."""
    if isinstance(arg_0, int) and isinstance(arg_2, int):
        return Fraction(arg_0, arg_2)
    return arg_0 / arg_2

Division reducer . If both arguments are integers return a Fraction . Otherwise return the true division of x and y .


def Func ( arg_0 ) : for arg_1 in arg_0 . getiterator ( ) : if not hasattr ( arg_1 . tag , 'find' ) : continue arg_2 = arg_1 . tag . find ( '}' ) if arg_2 >= 0 : arg_1 . tag = arg_1 . tag [ arg_2 + 1 : ] objectify . deannotate ( arg_0 , cleanup_namespaces = True )

def Func(arg_0):
    """Call this on an lxml.etree document to remove all namespaces"""
    for arg_1 in arg_0.getiterator():
        if not hasattr(arg_1.tag, 'find'):
            continue

        arg_2 = arg_1.tag.find('}')
        if arg_2 >= 0:
            arg_1.tag = arg_1.tag[arg_2 + 1:]

    objectify.deannotate(arg_0, cleanup_namespaces=True)

Call this on an lxml . etree document to remove all namespaces


(pos, alt, category, snvend=None, svend=None, svlen=None)

def Func(arg_0, arg_1, arg_2, arg_3=None, arg_4=None, arg_5=None):
    """Return the end coordinate for a variant

    Args:
        pos(int)
        alt(str)
        category(str)
        snvend(str)
        svend(int)
        svlen(int)

    Returns:
        end(int)
    """
    # If nothing is known we set end to be same as start
    arg_6 = arg_0
    # If variant is snv or indel we know that cyvcf2 can handle end pos
    if arg_2 in ('snv', 'indel', 'cancer'):
        arg_6 = arg_3

    # With SVs we have to be a bit more careful
    elif arg_2 == 'sv':
        # The END field from INFO usually works fine
        arg_6 = arg_4

        # For some cases like insertions the callers set end to same as pos
        # In those cases we can hope that there is a svlen...
        if arg_4 == arg_0:
            if arg_5:
                arg_6 = arg_0 + arg_5
        # If variant is 'BND' they have ':' in alt field
        # Information about other end is in the alt field
        if ':' in arg_1:
            arg_7 = BND_ALT_PATTERN.match(arg_1)
            if arg_7:
                arg_6 = int(arg_7.group(2))

    return arg_6


(
            self,
            task_ids=None,
            dag_id=None,
            key=XCOM_RETURN_KEY,
            include_prior_dates=False)

def Func(
            arg_0,
            arg_1=None,
            arg_2=None,
            arg_3=arg_4,
            arg_5=False):
        """
        Pull XComs that optionally meet certain criteria.

        The default value for `key` limits the search to XComs
        that were returned by other tasks (as opposed to those that were pushed
        manually). To remove this filter, pass key=None (or any desired value).

        If a single task_id string is provided, the result is the value of the
        most recent matching XCom from that task_id. If multiple task_ids are
        provided, a tuple of matching values is returned. None is returned
        whenever no matches are found.

        :param key: A key for the XCom. If provided, only XComs with matching
            keys will be returned. The default key is 'return_value', also
            available as a constant XCOM_RETURN_KEY. This key is automatically
            given to XComs returned by tasks (as opposed to being pushed
            manually). To remove the filter, pass key=None.
        :type key: str
        :param task_ids: Only XComs from tasks with matching ids will be
            pulled. Can pass None to remove the filter.
        :type task_ids: str or iterable of strings (representing task_ids)
        :param dag_id: If provided, only pulls XComs from this DAG.
            If None (default), the DAG of the calling task is used.
        :type dag_id: str
        :param include_prior_dates: If False, only XComs from the current
            execution_date are returned. If True, XComs from previous dates
            are returned as well.
        :type include_prior_dates: bool
        """

        if arg_2 is None:
            arg_2 = arg_0.dag_id

        arg_6 = functools.partial(
            XCom.get_one,
            execution_date=arg_0.execution_date,
            arg_3=arg_3,
            arg_2=arg_2,
            arg_5=arg_5)

        if is_container(arg_1):
            return tuple(arg_6(task_id=arg_7) for arg_7 in arg_1)
        else:
            return arg_6(task_id=arg_1)

Pull XComs that optionally meet certain criteria .


return activ(fc(h3, 'fc1', nh=512, init_scale=np.sqrt(2)))

def Func ( arg_0 , ** arg_1 ) : arg_2 = tf . cast ( arg_0 , tf . float32 ) / 255. arg_3 = tf . nn . relu arg_4 = arg_3 ( conv ( arg_2 , 'c1' , nf = 32 , rf = 8 , stride = 4 , init_scale = np . sqrt ( 2 ) , ** arg_1 ) ) arg_5 = arg_3 ( conv ( arg_4 , 'c2' , nf = 64 , rf = 4 , stride = 2 , init_scale = np . sqrt ( 2 ) , ** arg_1 ) ) arg_6 = arg_3 ( conv ( arg_5 , 'c3' , nf = 64 , rf = 3 , stride = 1 , init_scale = np . sqrt ( 2 ) , ** arg_1 ) ) arg_6 = conv_to_fc ( arg_6 ) return arg_3 ( fc ( arg_6 , 'fc1' , nh = 512 , init_scale = np . sqrt ( 2 ) ) )

def Func(arg_0, **arg_1):
    """
    CNN from Nature paper.
    """
    arg_2 = tf.cast(arg_0, tf.float32) / 255.
    arg_3 = tf.nn.relu
    arg_4 = arg_3(conv(arg_2, 'c1', nf=32, rf=8, stride=4, init_scale=np.sqrt(2),
                   **arg_1))
    arg_5 = arg_3(conv(arg_4, 'c2', nf=64, rf=4, stride=2, init_scale=np.sqrt(2), **arg_1))
    arg_6 = arg_3(conv(arg_5, 'c3', nf=64, rf=3, stride=1, init_scale=np.sqrt(2), **arg_1))
    arg_6 = conv_to_fc(arg_6)
    return arg_3(fc(arg_6, 'fc1', nh=512, init_scale=np.sqrt(2)))


def
Func
(
arg_0
,
arg_1
)
:
log
.
debug
(
'Running LargestFragmentChooser'
)
arg_2
=
Chem
.
GetMolFrags
(
arg_1
,
asMols
=
True
)
arg_3
=
for
arg_4
in
arg_2
:
arg_5
=
Chem
.
MolToSmiles
(
arg_4
,
isomericSmiles
=
True
)
log
.
debug
(
'Fragment: %s'
,
arg_5
)
arg_6
=
is_organic
(
arg_4
)
if
arg_0
.
prefer_organic
:
if
arg_3
and
arg_3
[
'organic'
]
and
not
arg_6
:
continue
if
arg_3
and
arg_6
and
not
arg_3
[
'organic'
]
:
arg_3
=
arg_7
=
0
for
arg_8
in
arg_4
.
GetAtoms
(
)
:
arg_7
+=
1
+
arg_8
.
GetTotalNumHs
(
)
if
arg_3
and
arg_7
<
arg_3
[
'atoms'
]
:
continue
arg_9
=
rdMolDescriptors
.
CalcExactMolWt
(
arg_4
)
if
arg_3
and
arg_7
==
arg_3
[
'atoms'
]
and
arg_9
<
arg_3
[
'weight'
]
:
continue
if
arg_3
and
arg_7
==
arg_3
[
'atoms'
]
and
arg_9
==
arg_3
[
'weight'
]
and
arg_5
>
arg_3
[
'smiles'
]
:
continue
log
.
debug
(
'New largest fragment: %s (%s)'
,
arg_5
,
arg_7
)
arg_3
=
{
'smiles'
:
arg_5
,
'fragment'
:
arg_4
,
'atoms'
:
arg_7
,
'weight'
:
arg_9
,
'organic'
:
arg_6
}
return
arg_3
[
'fragment'
]

def Func(arg_0, arg_1):
        """Return the largest covalent unit.

        The largest fragment is determined by number of atoms (including hydrogens). Ties are broken by taking the
        fragment with the higher molecular weight, and then by taking the first alphabetically by SMILES if needed.

        :param mol: The molecule to Func the largest fragment from.
        :type mol: rdkit.Chem.rdchem.Mol
        :return: The largest fragment.
        :rtype: rdkit.Chem.rdchem.Mol
        """
        log.debug('Running LargestFragmentChooser')
        # TODO: Alternatively allow a list of fragments to be passed as the mol parameter
        arg_2 = Chem.GetMolFrags(arg_1, asMols=True)
        arg_3 = None
        for arg_4 in arg_2:
            arg_5 = Chem.MolToSmiles(arg_4, isomericSmiles=True)
            log.debug('Fragment: %s', arg_5)
            arg_6 = is_organic(arg_4)
            if arg_0.prefer_organic:
                # Skip this fragment if not organic and we already have an organic fragment as the largest so far
                if arg_3 and arg_3['organic'] and not arg_6:
                    continue
                # Reset largest if it wasn't organic and this fragment is organic
                if arg_3 and arg_6 and not arg_3['organic']:
                    arg_3 = None
            # Count atoms
            arg_7 = 0
            for arg_8 in arg_4.GetAtoms():
                arg_7 += 1 + arg_8.GetTotalNumHs()
            # Skip this fragment if fewer atoms than the largest
            if arg_3 and arg_7 < arg_3['atoms']:
                continue
            # Skip this fragment if equal number of atoms but weight is lower
            arg_9 = rdMolDescriptors.CalcExactMolWt(arg_4)
            if arg_3 and arg_7 == arg_3['atoms'] and arg_9 < arg_3['weight']:
                continue
            # Skip this fragment if equal atoms and equal weight but smiles comes last alphabetically
            if arg_3 and arg_7 == arg_3['atoms'] and arg_9 == arg_3['weight'] and arg_5 > arg_3['smiles']:
                continue
            # Otherwise this is the largest so far
            log.debug('New largest fragment: %s (%s)', arg_5, arg_7)
            arg_3 = {'smiles': arg_5, 'fragment': arg_4, 'atoms': arg_7, 'weight': arg_9, 'organic': arg_6}
        return arg_3['fragment']

Return the largest covalent unit.

        The largest fragment is determined by number of atoms (including hydrogens). Ties are broken by taking the
        fragment with the higher molecular weight, and then by taking the first alphabetically by SMILES if needed.

        :param mol: The molecule to choose the largest fragment from.
        :type mol: rdkit.Chem.rdchem.Mol
        :return: The largest fragment.
        :rtype: rdkit.Chem.rdchem.Mol


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_0 . get_table ( arg_1 , arg_2 ) return arg_3 [ 'StorageDescriptor' ] [ 'Location' ]

def Func(arg_0, arg_1, arg_2):
        """
        Get the physical location of the table

        :param database_name: Name of hive database (schema) @table belongs to
        :type database_name: str
        :param table_name: Name of hive table
        :type table_name: str
        :return: str
        """

        arg_3 = arg_0.get_table(arg_1, arg_2)

        return arg_3['StorageDescriptor']['Location']


def
Func
(
arg_0
,
arg_1
)
:
arg_2
,
arg_3
,
arg_4
=
arg_1
arg_5
=
arg_0
.
transform_output_coordinates
(
(
0
,
arg_2
)
)
[
1
]
arg_6
=
arg_0
.
graph_width
arg_7
=
etree
.
SubElement
(
arg_0
.
graph
,
'path'
,
{
'd'
:
'M 0 %(start)s h%(stop)s'
%
locals
(
)
,
'class'
:
'constantLine'
}
)
if
arg_4
:
arg_7
.
set
(
'style'
,
arg_4
)
arg_8
=
etree
.
SubElement
(
arg_0
.
graph
,
'text'
,
{
'x'
:
str
(
2
)
,
'y'
:
str
(
arg_5
2
)
,
'class'
:
'constantLine'
}
)
arg_8
.
text
=
arg_3

def Func(arg_0, arg_1):
		"Draw a constant line on the y-axis with the label"
		arg_2, arg_3, arg_4 = arg_1
		arg_5 = arg_0.transform_output_coordinates((0, arg_2))[1]
		arg_6 = arg_0.graph_width
		arg_7 = etree.SubElement(arg_0.graph, 'path', {
			'd': 'M 0 %(start)s h%(stop)s' % locals(),
			'class': 'constantLine'})
		if arg_4:
			arg_7.set('style', arg_4)
		arg_8 = etree.SubElement(arg_0.graph, 'text', {
			'x': str(2),
			'y': str(arg_5 - 2),
			'class': 'constantLine'})
		arg_8.text = arg_3

Draw a constant line on the y - axis with the label


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
arg_0
.
obj
[
'adapter'
]
LOG
.
info
(
"Running scout update Func"
)
arg_3
=
arg_2
.
case
(
arg_1
)
if
not
arg_3
:
LOG
.
warning
(
"Case %s could not be found"
,
arg_1
)
arg_0
.
abort
(
)
try
:
arg_2
.
update_case_Func
(
arg_3
)
except
Exception
as
err
:
LOG
.
warning
(
err
)
arg_0
.
abort
(
)

def Func(arg_0, arg_1):
    """
    Update all Func for a case
    """
    arg_2 = arg_0.obj['adapter']
    LOG.info("Running scout update Func")
    # Check if the case exists
    arg_3 = arg_2.case(arg_1)

    if not arg_3:
        LOG.warning("Case %s could not be found", arg_1)
        arg_0.abort()

    try:
        arg_2.update_case_Func(arg_3)
    except Exception as err:
        LOG.warning(err)
        arg_0.abort()


def Func ( arg_0 , arg_1 ) : assert isinstance ( arg_1 , int ) or isinstance ( arg_1 , BitVec ) and arg_1 . size == 256 if len ( arg_0 . stack ) >= 1024 : raise StackOverflow ( ) if isinstance ( arg_1 , int ) : arg_1 = arg_1 & TT256M1 arg_1 = simplify ( arg_1 ) if isinstance ( arg_1 , Constant ) and not arg_1 . taint : arg_1 = arg_1 . value arg_0 . stack . append ( arg_1 )

def Func(arg_0, arg_1):
        """
        Push into the stack

              ITEM0
              ITEM1
              ITEM2
        sp->  {empty}
        """
        assert isinstance(arg_1, int) or isinstance(arg_1, BitVec) and arg_1.size == 256
        if len(arg_0.stack) >= 1024:
            raise StackOverflow()

        if isinstance(arg_1, int):
            arg_1 = arg_1 & TT256M1

        arg_1 = simplify(arg_1)
        if isinstance(arg_1, Constant) and not arg_1.taint:
            arg_1 = arg_1.value
        arg_0.stack.append(arg_1)


return isinstance(call, astroid.Call) and len(call.args) == 1 and not call.keywords

def Func ( arg_0 ) : return isinstance ( arg_0 , astroid . Call ) and len ( arg_0 . args ) == 1 and not arg_0 . keywords

def Func(arg_0):
    """Is this a call with exactly 1 argument,
    where that argument is positional?
    """
    return isinstance(arg_0, astroid.Call) and len(arg_0.args) == 1 and not arg_0.keywords

Is this a call with exactly 1 argument where that argument is positional?


def Func ( arg_0 ) : arg_1 = arg_0 [ 'delta_ts' ] [ 0 ] [ '__text__' ] arg_1 = str_to_datetime ( arg_1 ) arg_1 = arg_1 . replace ( tzinfo = dateutil . tz . tzutc ( ) ) return arg_1 . timestamp ( )

def Func(arg_0):
        """Extracts and coverts the update time from a Bugzilla item.

        The timestamp is extracted from 'delta_ts' field. This date is
        converted to UNIX timestamp format. Due Bugzilla servers ignore
        the timezone on HTTP requests, it will be ignored during the
        conversion, too.

        :param item: item generated by the backend

        :returns: a UNIX timestamp
        """
        arg_1 = arg_0['delta_ts'][0]['__text__']
        arg_1 = str_to_datetime(arg_1)
        arg_1 = arg_1.replace(tzinfo=dateutil.tz.tzutc())

        return arg_1.timestamp()

Extracts and coverts the update time from a Bugzilla item .


(self, analytes=None, filt=True,
                     stats=['mean', 'std'],
                     eachtrace=True, csf_dict={})

def
Func
(
arg_0
,
arg_1
=
,
arg_2
=
True
,
arg_3
=
[
'mean'
,
'std'
]
,
arg_4
=
True
,
arg_5
=
{
}
)
:
if
arg_1
is
:
arg_1
=
arg_0
.
analytes
elif
isinstance
(
arg_1
,
str
)
:
arg_1
=
[
arg_1
]
arg_0
.
stats
=
Bunch
(
)
arg_0
.
stats_calced
=
[
]
arg_7
=
Bunch
(
)
arg_8
=
{
'mean'
:
np
.
nanmean
,
'std'
:
np
.
nanstd
,
'nanmean'
:
np
.
nanmean
,
'nanstd'
:
np
.
nanstd
,
'se'
:
stderr
,
'H15_mean'
:
H15_mean
,
'H15_std'
:
H15_std
,
'H15_se'
:
H15_se
}
for
arg_9
in
arg_3
:
if
isinstance
(
arg_9
,
str
)
:
if
arg_9
in
arg_8
.
keys
(
)
:
arg_0
.
stats_calced
.
append
(
arg_9
)
arg_7
[
arg_9
]
=
arg_8
[
arg_9
]
if
arg_9
in
arg_5
.
keys
(
)
:
arg_0
.
stats_calced
.
append
(
arg_9
)
exec
(
arg_5
[
arg_9
]
)
arg_7
[
arg_9
]
=
eval
(
arg_9
)
elif
callable
(
arg_9
)
:
arg_0
.
stats_calced
.
append
(
arg_9
.
__name__
)
arg_7
[
arg_9
.
__name__
]
=
arg_9
if
not
hasattr
(
arg_0
,
'custom_stat_functions'
)
:
arg_0
.
custom_stat_functions
=
''
arg_0
.
custom_stat_functions
+=
inspect
.
getsource
(
arg_9
)
+
'\n\n\n\n'
with
arg_0
.
pbar
.
set
(
total
=
len
(
arg_0
.
samples
)
,
desc
=
'Calculating Stats'
)
as
prog
:
for
arg_9
in
arg_0
.
samples
:
if
arg_0
.
srm_identifier
not
in
arg_9
:
arg_0
.
data
[
arg_9
]
.
Func
(
arg_1
,
arg_2
=
arg_2
,
arg_7
=
arg_7
,
arg_4
=
arg_4
)
arg_0
.
stats
[
arg_9
]
=
arg_0
.
data
[
arg_9
]
.
stats
prog
.
update
(
)

def Func(arg_0, arg_1=None, arg_2=True,
                     arg_3=['mean', 'std'],
                     arg_4=True, arg_5={}):
        """
        Calculate sample statistics.

        Returns samples, analytes, and arrays of statistics
        of shape (samples, analytes). Statistics are calculated
        from the 'focus' data variable, so output depends on how
        the data have been processed.

        Included stat functions:

        * :func:`~latools.stat_fns.mean`: arithmetic mean
        * :func:`~latools.stat_fns.std`: arithmetic standard deviation
        * :func:`~latools.stat_fns.se`: arithmetic standard error
        * :func:`~latools.stat_fns.H15_mean`: Huber mean (outlier removal)
        * :func:`~latools.stat_fns.H15_std`: Huber standard deviation (outlier removal)
        * :func:`~latools.stat_fns.H15_se`: Huber standard error (outlier removal)

        Parameters
        ----------
        analytes : optional, array_like or str
            The analyte(s) to calculate statistics for. Defaults to
            all analytes.
        filt : str, dict or bool
            Either logical filter expression contained in a str,
            a dict of expressions specifying the filter string to
            use for each analyte or a boolean. Passed to `grab_filt`.
        stats : array_like
            take a single array_like input, and return a single statistic.
            list of functions or names (see above) or functions that
            Function should be able to cope with NaN values.
        eachtrace : bool
            Whether to calculate the statistics for each analysis
            spot individually, or to produce per - sample means.
            Default is True.

        Returns
        -------
        None
            Adds dict to analyse object containing samples, analytes and
            functions and data.
        """
        if arg_1 is None:
            arg_1 = arg_0.analytes
        elif isinstance(arg_1, str):
            arg_1 = [arg_1]

        arg_0.stats = Bunch()

        arg_0.stats_calced = []
        arg_7 = Bunch()

        arg_8 = {'mean': np.nanmean,
                     'std': np.nanstd,
                     'nanmean': np.nanmean,
                     'nanstd': np.nanstd,
                     'se': stderr,
                     'H15_mean': H15_mean,
                     'H15_std': H15_std,
                     'H15_se': H15_se}

        for arg_9 in arg_3:
            if isinstance(arg_9, str):
                if arg_9 in arg_8.keys():
                    arg_0.stats_calced.append(arg_9)
                    arg_7[arg_9] = arg_8[arg_9]
                if arg_9 in arg_5.keys():
                    arg_0.stats_calced.append(arg_9)
                    exec(arg_5[arg_9])
                    arg_7[arg_9] = eval(arg_9)
            elif callable(arg_9):
                arg_0.stats_calced.append(arg_9.__name__)
                arg_7[arg_9.__name__] = arg_9
                if not hasattr(arg_0, 'custom_stat_functions'):
                    arg_0.custom_stat_functions = ''
                arg_0.custom_stat_functions += inspect.getsource(arg_9) + '\n\n\n\n'

        # calculate stats for each sample
        with arg_0.pbar.set(total=len(arg_0.samples), desc='Calculating Stats') as prog:
            for arg_9 in arg_0.samples:
                if arg_0.srm_identifier not in arg_9:
                    arg_0.data[arg_9].Func(arg_1, arg_2=arg_2,
                                            arg_7=arg_7,
                                            arg_4=arg_4)

                    arg_0.stats[arg_9] = arg_0.data[arg_9].stats
                prog.update()


def Func ( arg_0 , arg_1 , arg_2 ) : if hasattr ( arg_0 . current_request . user . is_authenticated , '__call__' ) : arg_3 = arg_0 . current_request . user . is_authenticated ( ) else : arg_3 = arg_0 . current_request . user . is_authenticated if arg_1 . access_loggedin and not arg_3 : return False if arg_1 . access_guest and arg_3 : return False if arg_1 . access_restricted : arg_4 = arg_0 . _current_user_permissions if arg_4 is _UNSET : arg_4 = set ( arg_2 [ 'user' ] . get_all_permissions ( ) ) arg_0 . _current_user_permissions = arg_4 if arg_1 . access_perm_type == MODEL_TREE_ITEM_CLASS . PERM_TYPE_ALL : if len ( arg_1 . perms ) != len ( arg_1 . perms . intersection ( arg_4 ) ) : return False else : if not len ( arg_1 . perms . intersection ( arg_4 ) ) : return False return True

def Func(arg_0, arg_1, arg_2):
        """Checks whether a current user has an access to a certain item.

        :param TreeItemBase item:
        :param Context context:
        :rtype: bool
        """
        if hasattr(arg_0.current_request.user.is_authenticated, '__call__'):
            arg_3 = arg_0.current_request.user.is_authenticated()
        else:
            arg_3 = arg_0.current_request.user.is_authenticated

        if arg_1.access_loggedin and not arg_3:
            return False

        if arg_1.access_guest and arg_3:
            return False

        if arg_1.access_restricted:
            arg_4 = arg_0._current_user_permissions

            if arg_4 is _UNSET:
                arg_4 = set(arg_2['user'].get_all_permissions())
                arg_0._current_user_permissions = arg_4

            if arg_1.access_perm_type == MODEL_TREE_ITEM_CLASS.PERM_TYPE_ALL:
                if len(arg_1.perms) != len(arg_1.perms.intersection(arg_4)):
                    return False
            else:
                if not len(arg_1.perms.intersection(arg_4)):
                    return False

        return True

Checks whether a current user has an access to a certain item .


def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
        "Record conflicts caused by addition or deletion of a Queen."
        arg_5 = len(arg_0.vars)
        arg_0.rows[arg_3] += arg_4
        arg_0.downs[arg_2 + arg_3] += arg_4
        arg_0.ups[arg_2 - arg_3 + arg_5 - 1] += arg_4

Record conflicts caused by addition or deletion of a Queen .


def Func(arg_0, arg_1, arg_2, arg_3):
        """Creates a REQUIRED CONSTRAINT for the specified hstore key."""

        arg_4 = arg_0._required_constraint_name(
            arg_1, arg_2, arg_3)

        arg_5 = arg_0.sql_hstore_required_create.format(
            arg_4=arg_0.quote_name(arg_4),
            table=arg_0.quote_name(arg_1),
            arg_2=arg_0.quote_name(arg_2.column),
            arg_3=arg_3
        )
        arg_0.execute(arg_5)

Creates a REQUIRED CONSTRAINT for the specified hstore key .


(s, pos=0, stop_upon_closing_brace=None, stop_upon_end_environment=None,
                    stop_upon_closing_mathmode=None, **parse_flags)

return LatexWalker(s, **parse_flags).get_latex_nodes(stop_upon_closing_brace=stop_upon_closing_brace,
                                                         stop_upon_end_environment=stop_upon_end_environment,
                                                         stop_upon_closing_mathmode=stop_upon_closing_mathmode)

def Func ( arg_0 , arg_1 = 0 , arg_2 = None , arg_3 = None , arg_4 = None , ** arg_5 ) : return LatexWalker ( arg_0 , ** arg_5 ) . Func ( arg_2 = arg_2 , arg_3 = arg_3 , arg_4 = arg_4 )

def Func(arg_0, arg_1=0, arg_2=None, arg_3=None,
                    arg_4=None, **arg_5):
    """
    Parses latex content `s`.

    Returns a tuple `(nodelist, pos, len)` where nodelist is a list of `LatexNode` 's.

    If `stop_upon_closing_brace` is given, then `len` includes the closing brace, but the
    closing brace is not included in any of the nodes in the `nodelist`.

    .. deprecated:: 1.0
       Please use :py:meth:`LatexWalker.Func()` instead.
    """

    return LatexWalker(arg_0, **arg_5).Func(arg_2=arg_2,
                                                         arg_3=arg_3,
                                                         arg_4=arg_4)

Parses latex content `s`.

    Returns a tuple `(nodelist, pos, len)` where nodelist is a list of `LatexNode` 's.

    If `stop_upon_closing_brace` is given, then `len` includes the closing brace, but the
    closing brace is not included in any of the nodes in the `nodelist`.

    .. deprecated:: 1.0
       Please use :py:meth:`LatexWalker.get_latex_nodes()` instead.


return "{0} {1}".format(humanize.naturaldelta(now - self.created_at), tense)

def
Func
(
arg_0
)
:
arg_1
=
datetime
.
now
(
timezone
.
utc
)
arg_2
=
"from now"
if
arg_0
.
created_at
>
arg_1
else
"ago"
return
"{0} {1}"
.
format
(
humanize
.
naturaldelta
(
arg_1
arg_0
.
created_at
)
,
arg_2
)

def Func(arg_0):
        """Return human-readable relative time string."""
        arg_1 = datetime.now(timezone.utc)
        arg_2 = "from now" if arg_0.created_at > arg_1 else "ago"
        return "{0} {1}".format(humanize.naturaldelta(arg_1 - arg_0.created_at), arg_2)

Return human - readable relative time string .


def
Func
(
arg_0
)
:
if
arg_0
is
:
raise
ValueError
(
"path must be a string"
)
arg_1
=
arg_0
.
strip
(
"/"
)
.
split
(
"/"
)
arg_2
=
unquote_plus
(
arg_1
[
0
]
)
if
len
(
arg_1
)
else
arg_3
=
arg_1
[
1
]
if
len
(
arg_1
)
>
1
else
return
arg_2
,
arg_3

def Func(arg_0):
    """
    Get database name and database schema from path.

    :param path: "/"-delimited path, parsed as
     "/<database name>/<database schema>"
    :return: tuple with (database or None, schema or None)
    """
    if arg_0 is None:
        raise ValueError("path must be a string")

    arg_1 = arg_0.strip("/").split("/")

    arg_2 = unquote_plus(arg_1[0]) if len(arg_1) else None
    arg_3 = arg_1[1] if len(arg_1) > 1 else None

    return arg_2, arg_3

Get database name and database schema from path .


def Func ( arg_0 , arg_1 = False ) : arg_2 = astime . Time ( arg_0 , format = 'jd' , scale = 'utc' ) if arg_1 : return arg_2 . iso else : return arg_2 . datetime

def Func(arg_0, arg_1=False):
    '''This converts a UTC JD to a Python `datetime` object or ISO date string.

    Parameters
    ----------

    jd : float
        The Julian date measured at UTC.

    returniso : bool
        If False, returns a naive Python `datetime` object corresponding to
        `jd`. If True, returns the ISO format string corresponding to the date
        and time at UTC from `jd`.

    Returns
    -------

    datetime or str
        Depending on the value of `returniso`.

    '''

    arg_2 = astime.Time(arg_0, format='jd', scale='utc')

    if arg_1:
        return arg_2.iso
    else:
        return arg_2.datetime

This converts a UTC JD to a Python datetime object or ISO date string .


def Func(arg_0, arg_1):
        """Reads out the properties for storing new data into the hdf5file

        :param traj:

            The trajectory

        """

        for arg_2 in HDF5StorageService.ATTR_LIST:
            try:
                arg_3 = arg_1.f_get('config.hdf5.' + arg_2).f_get()
                setattr(arg_0, arg_2, arg_3)
            except AttributeError:
                arg_0._logger.debug('Could not find `%s` in traj config, '
                                     'using (default) value `%s`.' %
                                     (arg_2, str(getattr(arg_0, arg_2))))

        for arg_2, arg_4 in HDF5StorageService.NAME_TABLE_MAPPING.items():
            try:
                if arg_4 in ('parameters', 'config'):
                    arg_4 += '_overview'
                arg_3 = arg_1.f_get('config.hdf5.overview.' + arg_4).f_get()
                setattr(arg_0, arg_2, arg_3)
            except AttributeError:
                arg_0._logger.debug('Could not find `%s` in traj config, '
                                     'using (default) value `%s`.' %
                                     (arg_4, str(getattr(arg_0, arg_2))))

        for arg_2, arg_5 in HDF5StorageService.PR_ATTR_NAME_MAPPING.items():
            try:
                arg_3 = arg_1.f_get('config.hdf5.' + arg_5).f_get()
                setattr(arg_0, arg_2, arg_3)
            except AttributeError:
                arg_0._logger.debug('Could not find `%s` in traj config, '
                                     'using (default) value `%s`.' %
                                     (arg_5, str(getattr(arg_0, arg_2))))

        if ((not arg_0._overview_results_summary or
                    not arg_0._overview_derived_parameters_summary) and
                    arg_0._purge_duplicate_comments):
            raise RuntimeError('You chose to purge duplicate comments but disabled a summary '
                                   'table. You can only use the purging if you enable '
                                   'the summary tables.')

        arg_0._filters = None


def
Func
(
arg_0
=
,
arg_1
=
False
)
:
arg_2
=
'2.5.29.37.0'
arg_3
=
system_path
(
)
arg_4
=
[
]
with
open
(
arg_3
,
'rb'
)
as
f
:
for
arg_5
,
arg_6
,
arg_7
in
unarmor
(
f
.
read
(
)
,
multiple
=
True
)
:
if
arg_5
==
'CERTIFICATE'
:
if
arg_0
:
arg_0
(
Certificate
.
load
(
arg_7
)
,
)
arg_4
.
append
(
(
arg_7
,
set
(
)
,
set
(
)
)
)
elif
arg_5
==
'TRUSTED CERTIFICATE'
:
arg_8
,
arg_9
=
TrustedCertificate
.
load
(
arg_7
)
arg_10
=
False
arg_11
=
set
(
)
arg_12
=
set
(
)
for
arg_13
in
arg_9
[
'trust'
]
:
if
arg_13
.
dotted
==
arg_2
:
arg_11
=
set
(
[
arg_13
.
dotted
]
)
break
arg_11
.
add
(
arg_13
.
dotted
)
for
arg_13
in
arg_9
[
'reject'
]
:
if
arg_13
.
dotted
==
arg_2
:
arg_10
=
True
break
arg_12
.
add
(
arg_13
.
dotted
)
if
arg_10
:
if
arg_0
:
arg_0
(
arg_8
,
'explicitly distrusted'
)
continue
if
arg_0
and
not
arg_1
:
arg_0
(
arg_8
,
)
arg_4
.
append
(
(
arg_8
.
dump
(
)
,
arg_11
,
arg_12
)
)
return
arg_4

def Func(arg_0=None, arg_1=False):
    """
    Extracts trusted CA certs from the system CA cert bundle

    :param cert_callback:
        A callback that is called once for each certificate in the trust store.
        It should accept two parameters: an asn1crypto.x509.Certificate object,
        and a reason. The reason will be None if the certificate is being
        exported, otherwise it will be a unicode string of the reason it won't.

    :param callback_only_on_failure:
        A boolean - if the callback should only be called when a certificate is
        not exported.

    :return:
        A list of 3-element tuples:
         - 0: a byte string of a DER-encoded certificate
         - 1: a set of unicode strings that are OIDs of purposes to trust the
              certificate for
         - 2: a set of unicode strings that are OIDs of purposes to reject the
              certificate for
    """

    arg_2 = '2.5.29.37.0'
    arg_3 = system_path()

    arg_4 = []
    with open(arg_3, 'rb') as f:
        for arg_5, arg_6, arg_7 in unarmor(f.read(), multiple=True):
            # Without more info, a certificate is trusted for all purposes
            if arg_5 == 'CERTIFICATE':
                if arg_0:
                    arg_0(Certificate.load(arg_7), None)
                arg_4.append((arg_7, set(), set()))

            # The OpenSSL TRUSTED CERTIFICATE construct adds OIDs for trusted
            # and rejected purposes, so we extract that info.
            elif arg_5 == 'TRUSTED CERTIFICATE':
                arg_8, arg_9 = TrustedCertificate.load(arg_7)
                arg_10 = False
                arg_11 = set()
                arg_12 = set()
                for arg_13 in arg_9['trust']:
                    if arg_13.dotted == arg_2:
                        arg_11 = set([arg_13.dotted])
                        break
                    arg_11.add(arg_13.dotted)
                for arg_13 in arg_9['reject']:
                    if arg_13.dotted == arg_2:
                        arg_10 = True
                        break
                    arg_12.add(arg_13.dotted)
                if arg_10:
                    if arg_0:
                        arg_0(arg_8, 'explicitly distrusted')
                    continue
                if arg_0 and not arg_1:
                    arg_0(arg_8, None)
                arg_4.append((arg_8.dump(), arg_11, arg_12))

    return arg_4


(self, x0, y0, x1, y1, color=None, colorFunc=None, aa=False)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5=None, arg_6=None, arg_7=False):
        """
        Draw a between x0, y0 and x1, y1 in an RGB color.

        :param colorFunc: a function that takes an integer from x0 to x1 and
            returns a color corresponding to that point
        :param aa: if True, use Bresenham's algorithm for line drawing;
            otherwise use Xiaolin Wu's algorithm
        """
        md.draw_line(arg_0.set, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6, arg_7)

Draw a between x0 y0 and x1 y1 in an RGB color .


(climan, path, cmd, *cmds, zsh_sourceable=False)

def Func ( arg_0 , arg_1 , arg_2 , * arg_3 , arg_4 = False ) : arg_1 = pathlib . Path ( arg_1 ) arg_5 = arg_1 / 'zsh' if not arg_5 . exists ( ) : arg_5 . mkdir ( parents = True ) arg_6 = arg_5 / '_{}.sh' . format ( arg_2 ) arg_7 = arg_1 / 'bash' if not arg_7 . exists ( ) : arg_7 . mkdir ( parents = True ) arg_8 = arg_7 / '{}.sh' . format ( arg_2 ) arg_0 . zsh_complete ( arg_6 , arg_2 , * arg_3 , sourceable = arg_4 ) arg_0 . bash_complete ( arg_8 , arg_2 , * arg_3 )

def Func(arg_0, arg_1, arg_2, *arg_3, arg_4=False):
    """Create completion files for bash and zsh.

    Args:
        climan (:class:`~loam.cli.CLIManager`): CLI manager.
        path (path-like): directory in which the config files should be
            created. It is created if it doesn't exist.
        cmd (str): command name that should be completed.
        cmds (str): extra command names that should be completed.
        zsh_sourceable (bool): if True, the generated file will contain an
            explicit call to ``compdef``, which means it can be sourced
            to activate CLI completion.
    """
    arg_1 = pathlib.Path(arg_1)
    arg_5 = arg_1 / 'zsh'
    if not arg_5.exists():
        arg_5.mkdir(parents=True)
    arg_6 = arg_5 / '_{}.sh'.format(arg_2)
    arg_7 = arg_1 / 'bash'
    if not arg_7.exists():
        arg_7.mkdir(parents=True)
    arg_8 = arg_7 / '{}.sh'.format(arg_2)
    arg_0.zsh_complete(arg_6, arg_2, *arg_3, sourceable=arg_4)
    arg_0.bash_complete(arg_8, arg_2, *arg_3)

Create completion files for bash and zsh .


def Func(arg_0, arg_1='', arg_2=None):
        """
        Creates a certificate signing request to be submitted to a formal
        certificate authority to generate a certificate.

        Note, the provider may say the CSR must be created on the target server,
        but this is not necessary.
        """
        arg_2 = arg_2 or arg_0.local_renderer
        arg_2.env.domain = arg_1 or arg_2.env.domain
        arg_4 = arg_0.genv.ROLE or ALL
        arg_5 = arg_0.genv.SITE or arg_0.genv.default_site
        print('self.genv.default_site:', arg_0.genv.default_site, file=sys.stderr)
        print('site.csr0:', arg_5, file=sys.stderr)
        arg_6 = 'roles/%s/ssl' % (arg_4,)
        print('ssl_dst:', arg_6)
        if not os.path.isdir(arg_6):
            os.makedirs(arg_6)
        for arg_5, arg_7 in arg_0.iter_sites():
            print('site.csr1:', arg_5, file=sys.stderr)
            assert arg_2.env.domain, 'No SSL domain defined.'
            arg_2.env.ssl_base_dst = '%s/%s' % (arg_6, arg_2.env.domain.replace('*.', ''))
            arg_2.env.ssl_csr_year = date.today().year
            arg_2.local('openssl req -nodes -newkey rsa:{ssl_length} '
                '-subj "/C={ssl_country}/ST={ssl_state}/L={ssl_city}/O={ssl_organization}/CN={ssl_domain}" '
                '-keyout {ssl_base_dst}.{ssl_csr_year}.key -out {ssl_base_dst}.{ssl_csr_year}.csr')

Creates a certificate signing request to be submitted to a formal certificate authority to generate a certificate .


def Func ( arg_0 ) : arg_0 . cm = np . zeros ( ( len ( arg_0 . postcard ) , 2 ) ) for arg_2 in range ( len ( arg_0 . postcard ) ) : arg_3 = arg_0 . postcard [ arg_2 ] arg_3 [ arg_0 . targets != 1 ] = 0.0 arg_0 . cm [ arg_2 ] = center_of_mass ( arg_3 )

def Func(arg_0):
        """
        Identify the centroid positions for the target star at all epochs. Useful for verifying that there is
        no correlation between flux and position, as might be expected for high proper motion stars.
        """
        arg_0.cm = np.zeros((len(arg_0.postcard), 2))
        for arg_2 in range(len(arg_0.postcard)):
            arg_3 = arg_0.postcard[arg_2]
            arg_3[arg_0.targets != 1] = 0.0
            arg_0.cm[arg_2] = center_of_mass(arg_3)

Identify the centroid positions for the target star at all epochs . Useful for verifying that there is no correlation between flux and position as might be expected for high proper motion stars .


def Func ( arg_0 ) : if hasattr ( arg_0 , '_table' ) : arg_1 = arg_0 . _table else : try : arg_1 = arg_0 . conn . Func ( arg_0 . Func_name ( ) ) except boto . exception . DynamoDBResponseError : if arg_0 . auto_create_table : arg_1 = arg_0 . create_table ( ) else : raise arg_0 . _table = arg_1 return arg_1

def Func(arg_0):
        '''
        Hook point for overriding how the CounterPool transforms table_name
        into a boto DynamoDB Table object.
        '''
        if hasattr(arg_0, '_table'):
            arg_1 = arg_0._table
        else:
            try:
                arg_1 = arg_0.conn.Func(arg_0.Func_name())
            except boto.exception.DynamoDBResponseError:
                if arg_0.auto_create_table:
                    arg_1 = arg_0.create_table()
                else:
                    raise

            arg_0._table = arg_1

        return arg_1

Hook point for overriding how the CounterPool transforms table_name into a boto DynamoDB Table object .