def Func(arg_0):
        """
        Parse DAG files in a loop controlled by DagParsingSignal.
        Actual DAG parsing loop will run once upon receiving one
        agent heartbeat message and will report done when finished the loop.
        """
        while True:
            arg_1 = arg_0._signal_conn.recv()
            if arg_1 == DagParsingSignal.TERMINATE_MANAGER:
                arg_0.terminate()
                break
            elif arg_1 == DagParsingSignal.END_MANAGER:
                arg_0.end()
                sys.exit(os.EX_OK)
            elif arg_1 == DagParsingSignal.AGENT_HEARTBEAT:

                arg_0._refresh_dag_dir()

                arg_2 = arg_0.heartbeat()
                for arg_3 in arg_2:
                    arg_0._result_queue.put(arg_3)

                arg_0._print_stat()

                arg_4 = all(arg_0.get_last_finish_time(x) is not None
                                          for x in arg_0.file_paths)
                arg_5 = arg_0.max_runs_reached()

                arg_6 = DagParsingStat(arg_0._file_paths,
                                                  arg_0.get_all_pids(),
                                                  arg_0.max_runs_reached(),
                                                  arg_4,
                                                  len(arg_2))
                arg_0._stat_queue.put(arg_6)

                arg_0.wait_until_finished()
                arg_0._signal_conn.send(DagParsingSignal.MANAGER_DONE)

                if arg_5:
                    arg_0.log.info("Exiting dag parsing loop as all files "
                                  "have been processed %s times", arg_0._max_runs)
                    arg_0._signal_conn.send(DagParsingSignal.MANAGER_DONE)
                    break

Parse DAG files in a loop controlled by DagParsingSignal . Actual DAG parsing loop will run once upon receiving one agent heartbeat message and will report done when finished the loop .


def Func ( arg_0 ) : arg_1 = arg_0 . get_config_path ( ) arg_2 = arg_0 . get_contents ( ) with open ( arg_1 , mode = 'w' ) as cfg_file : cfg_file . write ( arg_2 )

def Func(arg_0):
        """ Save the config file """
        arg_1 = arg_0.get_config_path()
        arg_2 = arg_0.get_contents()
        with open(arg_1, mode='w') as cfg_file:
            cfg_file.write(arg_2)


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . _factories . pop ( arg_1 ) arg_2 . doStop ( ) return arg_2

def Func(arg_0, arg_1):
        """Removes a factory.

        After calling this method, remote clients will no longer be
        able to connect to it.

        This will call the factory's ``doStop`` method.

        """
        arg_2 = arg_0._factories.pop(arg_1)
        arg_2.doStop()
        return arg_2


def Func(arg_0, **arg_1):
        """
        Register Services that can be accessed by this DAL. Upon
        registration, the service is set up.

        :param **services: Keyword arguments where the key is the name
          to register the Service as and the value is the Service.
        """
        for arg_2, arg_3 in arg_1.items():
            if arg_2 in arg_0._services:
                raise AlreadyExistsException('A Service for {} is already registered.'.format(arg_2))

            arg_0._init_service(arg_2, arg_3)
        return arg_0

Register Services that can be accessed by this DAL . Upon registration the service is set up .


(self,
            name,
            value=None,
            modify=False,
            metadata=None,
            description='',
            encrypt=True,
            lock=False,
            key_type='secret',
            add=False)

def Func(arg_0,
            arg_1,
            arg_2=None,
            arg_3=False,
            arg_4=None,
            arg_5='',
            arg_6=True,
            arg_7=False,
            arg_8='secret',
            arg_9=False):
        """Put a key inside the stash

        if key exists and modify true: delete and create
        if key exists and modify false: fail
        if key doesn't exist and modify true: fail
        if key doesn't exist and modify false: create

        `name` is unique and cannot be changed.

        `value` must be provided if the key didn't already exist, otherwise,
        the previous value will be retained.

        `created_at` will be left unmodified if the key
        already existed. Otherwise, the current time will be used.

        `modified_at` will be changed to the current time
        if the field is being modified.

        `metadata` will be updated if provided. If it wasn't
        provided the field from the existing key will be used and the
        same goes for the `uid` which will be generated if it didn't
        previously exist.

        `lock` will lock the key to prevent it from being modified or deleted

        `add` allows to add values to an existing key instead of overwriting.

        Returns the id of the key in the database
        """
        def assert_key_is_unlocked(arg_10):
            if arg_10 and arg_10.get('lock'):
                raise GhostError(
                    'Key `{0}` is locked and therefore cannot be modified. '
                    'Unlock the key and try again'.format(arg_1))

        def assert_value_provided_for_new_key(arg_2, arg_10):
            if not arg_2 and not arg_10.get('value'):
                raise GhostError('You must provide a value for new keys')

        arg_0._assert_valid_stash()
        arg_0._validate_key_schema(arg_2, arg_8)
        if arg_2 and arg_6 and not isinstance(arg_2, dict):
            raise GhostError('Value must be of type dict')

        # TODO: This should be refactored. `_handle_existing_key` deletes
        # the key rather implicitly. It shouldn't do that.
        # `existing_key` will be an empty dict if it doesn't exist
        arg_11 = arg_0._handle_existing_key(arg_1, arg_3 or arg_9)
        assert_key_is_unlocked(arg_11)
        assert_value_provided_for_new_key(arg_2, arg_11)

        arg_12 = dict(arg_1=arg_1, arg_7=arg_7)
        if arg_2:
            # TODO: fix edge case in which encrypt is false and yet we might
            # try to add to an existing key. encrypt=false is only used when
            # `load`ing into a new stash, but someone might use it directly
            # from the API.
            if arg_9:
                arg_2 = arg_0._update_existing_key(arg_11, arg_2)
            arg_12['value'] = arg_0._encrypt(arg_2) if arg_6 else arg_2
        else:
            arg_12['value'] = arg_11.get('value')

        # TODO: Treat a case in which we try to update an existing key
        # but don't provide a value in which nothing will happen.
        arg_12['description'] = arg_5 or arg_11.get('description')
        arg_12['created_at'] = arg_11.get('created_at') or _get_current_time()
        arg_12['modified_at'] = _get_current_time()
        arg_12['metadata'] = arg_4 or arg_11.get('metadata')
        arg_12['uid'] = arg_11.get('uid') or str(uuid.uuid4())
        arg_12['type'] = arg_11.get('type') or arg_8

        arg_13 = arg_0._storage.Func(arg_12)

        audit(
            storage=arg_0._storage.db_path,
            action='MODIFY' if (arg_3 or arg_9) else 'PUT',
            message=json.dumps(dict(
                key_name=arg_12['name'],
                arg_2='HIDDEN',
                arg_5=arg_12['description'],
                uid=arg_12['uid'],
                arg_4=json.dumps(arg_12['metadata']),
                arg_7=arg_12['lock'],
                type=arg_12['type'])))

        return arg_13


return self._perform_put(self._get_vm_image_path(vm_image_name),
                                 _XmlSerializer.update_vm_image_to_xml(vm_image),
                                 as_async=True)

def Func(arg_0, arg_1, arg_2):
        '''
        Updates a VM Image in the image repository that is associated with the
        specified subscription.

        vm_image_name:
            Name of image to update.
        vm_image:
            An instance of VMImage class.
        vm_image.label: Optional. Specifies an identifier for the image.
        vm_image.os_disk_configuration:
            Required. Specifies configuration information for the operating
            system disk that is associated with the image.
        vm_image.os_disk_configuration.host_caching:
            Optional. Specifies the caching behavior of the operating system disk.
            Possible values are: None, ReadOnly, ReadWrite
        vm_image.data_disk_configurations:
            Optional. Specifies configuration information for the data disks
            that are associated with the image. A VM Image might not have data
            disks associated with it.
        vm_image.data_disk_configurations[].name:
            Required. Specifies the name of the data disk.
        vm_image.data_disk_configurations[].host_caching:
            Optional. Specifies the caching behavior of the data disk.
            Possible values are: None, ReadOnly, ReadWrite
        vm_image.data_disk_configurations[].lun:
            Optional if the lun for the disk is 0. Specifies the Logical Unit
            Number (LUN) for the data disk.
        vm_image.description: Optional. Specifies the description of the image.
        vm_image.language: Optional. Specifies the language of the image.
        vm_image.image_family:
            Optional. Specifies a value that can be used to group VM Images.
        vm_image.recommended_vm_size:
            Optional. Specifies the size to use for the Virtual Machine that
            is created from the VM Image.
        vm_image.eula:
            Optional. Specifies the End User License Agreement that is
            associated with the image. The value for this element is a string,
            but it is recommended that the value be a URL that points to a EULA.
        vm_image.icon_uri:
            Optional. Specifies the URI to the icon that is displayed for the
            image in the Management Portal.
        vm_image.small_icon_uri:
            Optional. Specifies the URI to the small icon that is displayed for
            the image in the Management Portal.
        vm_image.privacy_uri:
            Optional. Specifies the URI that points to a document that contains
            the privacy policy related to the image.
        vm_image.published_date:
            Optional. Specifies the date when the image was added to the image
            repository.
        vm_image.show_in_gui:
            Optional. Indicates whether the VM Images should be listed in the
            portal.
        '''
        _validate_not_none('vm_image_name', arg_1)
        _validate_not_none('vm_image', arg_2)
        return arg_0._perform_put(arg_0._get_vm_image_path(arg_1),
                                 _XmlSerializer.Func_to_xml(arg_2),
                                 as_async=True)

Updates a VM Image in the image repository that is associated with the specified subscription .


def Func ( arg_0 , arg_1 ) : if not arg_0 . task . pool : return False arg_2 = ( arg_1 . query ( Pool ) . filter ( Pool . pool == arg_0 . task . pool ) . first ( ) ) if not arg_2 : return False arg_3 = arg_2 . open_slots ( arg_1 = arg_1 ) return arg_3 <= 0

def Func(arg_0, arg_1):
        """
        Returns a boolean as to whether the slot pool has room for this
        task to run
        """
        if not arg_0.task.pool:
            return False

        arg_2 = (
            arg_1
            .query(Pool)
            .filter(Pool.pool == arg_0.task.pool)
            .first()
        )
        if not arg_2:
            return False
        arg_3 = arg_2.open_slots(arg_1=arg_1)

        return arg_3 <= 0


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
stream_info_pattern
.
findall
(
arg_1
)
if
not
arg_2
:
arg_0
.
logger
.
error
(
"Failed to extract stream_info."
)
arg_3
=
[
]
for
arg_4
in
arg_2
:
if
not
arg_4
[
1
]
:
arg_3
.
append
(
[
arg_4
[
0
]
,
"source"
]
)
else
:
arg_3
.
append
(
list
(
arg_4
)
)
return
arg_3

def Func(arg_0, arg_1):
        """
        Returns a nested list of different stream options.

        Each entry in the list will contain a stream_url and stream_quality_name
        for each stream occurrence that was found in the JS.
        """
        arg_2 = stream_info_pattern.findall(arg_1)

        if not arg_2:
            arg_0.logger.error("Failed to extract stream_info.")

        # Rename the "" quality to "source" by transforming the tuples to a
        # list and reassigning.
        arg_3 = []
        for arg_4 in arg_2:
            if not arg_4[1]:
                arg_3.append([arg_4[0], "source"])
            else:
                arg_3.append(list(arg_4))

        return arg_3

Returns a nested list of different stream options .


def Func(arg_0, arg_1, arg_2):
        """Modulo remainder operation"""
        try:
            arg_3 = Operators.ITEBV(256, arg_2 == 0, 0, arg_1 % arg_2)
        except ZeroDivisionError:
            arg_3 = 0
        return arg_3


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
if
'dns_search'
in
arg_1
:
return
arg_1
[
'dns_search'
]
if
arg_2
[
'proto'
]
==
'none'
:
return
arg_3
=
arg_0
.
netjson
.
get
(
'dns_search'
,
)
if
arg_3
:
return
' '
.
join
(
arg_3
)

def Func(arg_0, arg_1, arg_2):
        """
        determines UCI interface "dns_search" option
        """
        # allow override
        if 'dns_search' in arg_1:
            return arg_1['dns_search']
        # ignore if "proto" is none
        if arg_2['proto'] == 'none':
            return None
        arg_3 = arg_0.netjson.get('dns_search', None)
        if arg_3:
            return ' '.join(arg_3)

determines UCI interface dns_search option


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_0 . content . getSheet ( arg_1 ) for arg_4 , arg_5 in enumerate ( arg_3 ) : arg_6 = arg_0 . content . getCell ( arg_4 , arg_2 + 1 ) arg_6 . stringValue ( _escape_apostrophe ( arg_5 ) ) if arg_4 % 2 == 1 : arg_6 . setCellColor ( settings . EVEN_COLUMN_BG_COLOR ) else : arg_6 . setCellColor ( settings . ODD_COLUMN_BG_COLOR )

def Func(arg_0, arg_1, arg_2, arg_3):
    """
    Write row with translations to ods file into specified sheet and row_no.
    """
    arg_0.content.getSheet(arg_1)
    for arg_4, arg_5 in enumerate(arg_3):
        arg_6 = arg_0.content.getCell(arg_4, arg_2+1)
        arg_6.stringValue(_escape_apostrophe(arg_5))
        if arg_4 % 2 == 1:
            arg_6.setCellColor(settings.EVEN_COLUMN_BG_COLOR)
        else:
            arg_6.setCellColor(settings.ODD_COLUMN_BG_COLOR)

Write row with translations to ods file into specified sheet and row_no .


def Func ( arg_0 , arg_1 ) : arg_2 = Route ( 'GET' , '/Func' ) arg_3 = { 'ids' : arg_1 } return arg_0 . request ( arg_2 , params = arg_3 )

def Func(arg_0, arg_1):
        """Get a spotify Func by their IDs.

        Parameters
        ----------
        spotify_id : List[str]
            The spotify_ids to search with.
        """
        arg_2 = Route('GET', '/Func')
        arg_3 = {'ids': arg_1}
        return arg_0.request(arg_2, params=arg_3)

Get a spotify artists by their IDs.

        Parameters
        ----------
        spotify_id : List[str]
            The spotify_ids to search with.


return (len(nesting_state.stack) > 1 and
          nesting_state.stack[-1].check_namespace_indentation and
          isinstance(nesting_state.stack[-2], _NamespaceInfo))

def Func ( arg_0 , arg_1 ) : if arg_1 : return len ( arg_0 . stack ) >= 1 and ( isinstance ( arg_0 . stack [ - 1 ] , _NamespaceInfo ) ) return ( len ( arg_0 . stack ) > 1 and arg_0 . stack [ - 1 ] . check_namespace_indentation and isinstance ( arg_0 . stack [ - 2 ] , _NamespaceInfo ) )

def Func(arg_0, arg_1):
  """Checks that the new block is directly in a namespace.

  Args:
    nesting_state: The _NestingState object that contains info about our state.
    is_forward_declaration: If the class is a forward declared class.
  Returns:
    Whether or not the new block is directly in a namespace.
  """
  if arg_1:
    return len(arg_0.stack) >= 1 and (
      isinstance(arg_0.stack[-1], _NamespaceInfo))

  return (len(arg_0.stack) > 1 and
          arg_0.stack[-1].check_namespace_indentation and
          isinstance(arg_0.stack[-2], _NamespaceInfo))

Checks that the new block is directly in a namespace .


return ''.join(ch if ch in printable else r'0x{0:02x}'.format(ord(ch)) for ch in bin_str)

def
Func
(
arg_0
)
:
arg_1
=
string
.
ascii_letters
+
string
.
digits
+
string
.
punctuation
+
' '
return
''
.
join
(
arg_2
if
arg_2
in
arg_1
else
r'0x{0:02x}'
.
format
(
ord
(
arg_2
)
)
for
arg_2
in
arg_0
)

def Func(arg_0):
  """
  Hex encode a binary string
  """
  arg_1 = string.ascii_letters + string.digits + string.punctuation + ' '
  return ''.join(arg_2 if arg_2 in arg_1 else r'0x{0:02x}'.format(ord(arg_2)) for arg_2 in arg_0)


def Func ( arg_0 ) : if not pid_exists ( arg_0 . pid ) : raise NoSuchProcess ( arg_0 . pid , arg_0 . _process_name ) return _psutil_osx . Func ( arg_0 . pid )

def Func(arg_0):
        """Return process cmdline as a list of arguments."""
        if not pid_exists(arg_0.pid):
            raise NoSuchProcess(arg_0.pid, arg_0._process_name)
        return _psutil_osx.Func(arg_0.pid)

Return process cmdline as a list of arguments .


def Func ( arg_0 : arg_1 ) -> arg_1 : arg_0 = arg_0 . lower ( ) arg_2 = os . path . join ( BIO2BEL_DIR , arg_0 ) os . makedirs ( arg_2 , exist_ok = True ) return arg_2

def Func(arg_0: arg_1) -> arg_1:
    """Ensure the appropriate Bio2BEL data directory exists for the given module, then returns the file path.

    :param module_name: The name of the module. Ex: 'chembl'
    :return: The module's data directory
    """
    arg_0 = arg_0.lower()
    arg_2 = os.path.join(BIO2BEL_DIR, arg_0)
    os.makedirs(arg_2, exist_ok=True)
    return arg_2

Ensure the appropriate Bio2BEL data directory exists for the given module then returns the file path .


return super(ActionSubcommand, self).parse_args(ctx, args)

def Func ( arg_0 , arg_1 , arg_2 ) : if not arg_2 and arg_0 . no_args_is_help and not arg_1 . resilient_parsing : click . echo ( arg_1 . get_help ( ) ) arg_1 . exit ( ) return super ( ActionSubcommand , arg_0 ) . Func ( arg_1 , arg_2 )

def Func(arg_0, arg_1, arg_2):
        """Parse arguments sent to this command.

        The code for this method is taken from MultiCommand:
        https://github.com/mitsuhiko/click/blob/master/click/core.py

        It is Copyright (c) 2014 by Armin Ronacher.
        See the license:
        https://github.com/mitsuhiko/click/blob/master/LICENSE
        """
        if not arg_2 and arg_0.no_args_is_help and not arg_1.resilient_parsing:
            click.echo(arg_1.get_help())
            arg_1.exit()
        return super(ActionSubcommand, arg_0).Func(arg_1, arg_2)


def Func ( arg_0 ) : arg_0 . _done_event . wait ( MAXINT ) if arg_0 . _exception : raise arg_0 . _exception return arg_0 . _Func

def Func(arg_0):
        """Waits until TransferFuture is done and returns the Func

        If the TransferFuture succeeded, it will return the Func. If the
        TransferFuture failed, it will raise the exception associated to the
        failure.
        """
        # Doing a wait() with no timeout cannot be interrupted in python2 but
        # can be interrupted in python3 so we just wait with the largest
        # possible value integer value, which is on the scale of billions of
        # years...
        arg_0._done_event.wait(MAXINT)

        # Once done waiting, raise an exception if present or return the
        # final Func.
        if arg_0._exception:
            raise arg_0._exception
        return arg_0._Func

Waits until TransferFuture is done and returns the result

        If the TransferFuture succeeded, it will return the result. If the
        TransferFuture failed, it will raise the exception associated to the
        failure.


def
Func
(
arg_0
,
arg_1
)
:
try
:
arg_0
.
__wql
=
[
'wmic'
,
'-U'
,
arg_0
.
args
.
domain
+
'\\'
+
arg_0
.
args
.
user
+
'%'
+
arg_0
.
args
.
password
,
'//'
+
arg_0
.
args
.
host
,
'--namespace'
,
arg_0
.
args
.
namespace
,
'--delimiter'
,
arg_0
.
args
.
delimiter
,
arg_1
]
arg_0
.
logger
.
debug
(
"wql: {}"
.
format
(
arg_0
.
__wql
)
)
arg_0
.
__output
=
subprocess
.
check_output
(
arg_0
.
__wql
)
arg_0
.
logger
.
debug
(
"output: {}"
.
format
(
arg_0
.
__output
)
)
arg_0
.
logger
.
debug
(
"wmi connect succeed."
)
arg_0
.
__wmi_output
=
arg_0
.
__output
.
splitlines
(
)
[
1
:
]
arg_0
.
logger
.
debug
(
"wmi_output: {}"
.
format
(
arg_0
.
__wmi_output
)
)
arg_0
.
__csv_header
=
csv
.
DictReader
(
arg_0
.
__wmi_output
,
delimiter
=
'|'
)
arg_0
.
logger
.
debug
(
"csv_header: {}"
.
format
(
arg_0
.
__csv_header
)
)
return
list
(
arg_0
.
__csv_header
)
except
subprocess
.
CalledProcessError
as
e
:
arg_0
.
unknown
(
"Connect by wmi and run wql error: %s"
%
e
)

def Func(arg_0, arg_1):
        """Connect by wmi and run wql."""
        try:
            arg_0.__wql = ['wmic', '-U',
                          arg_0.args.domain + '\\' + arg_0.args.user + '%' + arg_0.args.password,
                          '//' + arg_0.args.host,
                          '--namespace', arg_0.args.namespace,
                          '--delimiter', arg_0.args.delimiter,
                          arg_1]
            arg_0.logger.debug("wql: {}".format(arg_0.__wql))
            arg_0.__output = subprocess.check_output(arg_0.__wql)
            arg_0.logger.debug("output: {}".format(arg_0.__output))
            arg_0.logger.debug("wmi connect succeed.")
            arg_0.__wmi_output = arg_0.__output.splitlines()[1:]
            arg_0.logger.debug("wmi_output: {}".format(arg_0.__wmi_output))
            arg_0.__csv_header = csv.DictReader(arg_0.__wmi_output, delimiter='|')
            arg_0.logger.debug("csv_header: {}".format(arg_0.__csv_header))
            return list(arg_0.__csv_header)
        except subprocess.CalledProcessError as e:
            arg_0.unknown("Connect by wmi and run wql error: %s" % e)


def Func ( arg_0 ) : if all ( arg_1 is None for arg_1 in arg_0 ) : return None return dtype_util . common_dtype ( arg_0 , tf . float32 )

def Func(arg_0):
  """Return common dtype of arg_list, or None.

  Args:
    arg_list: an iterable of items which are either `None` or have a `dtype`
      property.

  Returns:
    dtype: The common dtype of items in `arg_list`, or `None` if the list is
      empty or all items are `None`.
  """
  # Note that `all` defaults to `True` if `arg_list` is empty.
  if all(arg_1 is None for arg_1 in arg_0):
    return None
  return dtype_util.common_dtype(arg_0, tf.float32)

Return common dtype of arg_list or None .


def Func ( arg_0 , arg_1 , Func ) : arg_0 . obj = arg_0 . obj or { } arg_0 . obj [ 'project' ] = arg_1 arg_0 . obj [ 'experiment' ] = Func

def Func(arg_0, arg_1, Func):  # pylint:disable=redefined-outer-name
    """Commands for experiments."""
    arg_0.obj = arg_0.obj or {}
    arg_0.obj['project'] = arg_1
    arg_0.obj['experiment'] = Func


(self, report_type, account_id, term_id=None, params={})

def Func(arg_0, arg_1, arg_2, arg_3=None, arg_4={}):
        """
        Generates a report instance for the canvas account id.

        https://canvas.instructure.com/doc/api/account_reports.html#method.account_reports.create
        """
        if arg_3 is not None:
            arg_4["enrollment_term_id"] = arg_3

        arg_5 = ACCOUNTS_API.format(arg_2) + "/reports/{}".format(
            arg_1)
        arg_6 = {"parameters": arg_4}

        arg_7 = arg_0._post_resource(arg_5, arg_6)
        arg_7["account_id"] = arg_2
        return Report(arg_7=arg_7)

Generates a report instance for the canvas account id .


(x,
                             expect_ndims=None,
                             expect_ndims_at_least=None,
                             expect_static=False)

def
Func
(
arg_0
,
arg_1
=
,
arg_2
=
,
arg_3
=
False
)
:
arg_4
=
arg_0
.
shape
.
ndims
if
arg_4
is
:
if
arg_3
:
raise
ValueError
(
'Expected static ndims. Found: {}'
.
format
(
arg_0
)
)
return
if
arg_1
is
not
and
arg_4
!=
arg_1
:
raise
ValueError
(
'ndims must be {}.  Found: {}'
.
format
(
arg_1
,
arg_4
)
)
if
arg_2
is
not
and
arg_4
<
arg_2
:
raise
ValueError
(
'ndims must be at least {}. Found {}'
.
format
(
arg_2
,
arg_4
)
)

def Func(arg_0,
                             arg_1=None,
                             arg_2=None,
                             arg_3=False):
  """Assert that Tensor x has expected number of dimensions."""
  arg_4 = arg_0.shape.ndims
  if arg_4 is None:
    if arg_3:
      raise ValueError('Expected static ndims. Found: {}'.format(arg_0))
    return
  if arg_1 is not None and arg_4 != arg_1:
    raise ValueError('ndims must be {}.  Found: {}'.format(arg_1, arg_4))
  if arg_2 is not None and arg_4 < arg_2:
    raise ValueError('ndims must be at least {}. Found {}'.format(
        arg_2, arg_4))

Assert that Tensor x has expected number of dimensions .


def Func(arg_0, arg_1: arg_2[arg_3]):
        """Builds the SQL compiler for a insert query.

        Arguments:
            rows:
                A list of dictionaries, where each entry
                describes a record to insert.

        Returns:
            The SQL compiler for the insert.
        """

        # create model objects, we also have to detect cases
        # such as:
        #   [dict(first_name='swen'), dict(fist_name='swen', last_name='kooij')]
        # we need to be certain that each row specifies the exact same
        # amount of fields/columns
        arg_4 = []
        arg_5 = len(arg_1[0])
        for arg_6, arg_7 in enumerate(arg_1):
            if arg_5 != len(arg_7):
                raise SuspiciousOperation((
                    'In bulk upserts, you cannot have rows with different field '
                    'configurations. Row {0} has a different field config than '
                    'the first row.'
                ).format(arg_6))

            arg_4.append(arg_0.model(**arg_7))

        # indicate this query is going to perform write
        arg_0._for_write = True

        # get the fields to be used during update/insert
        arg_9, arg_10 = arg_0._get_upsert_fields(arg_1[0])

        # build a normal insert query
        arg_11 = PostgresInsertQuery(arg_0.model)
        arg_11.conflict_action = arg_0.conflict_action
        arg_11.conflict_target = arg_0.conflict_target
        arg_11.index_predicate = arg_0.index_predicate
        arg_11.values(arg_4, arg_9, arg_10)

        # use the postgresql insert query compiler to transform the insert
        # into an special postgresql insert
        arg_15 = django.db.connections[arg_0.db]
        arg_16 = PostgresInsertCompiler(arg_11, arg_15, arg_0.db)

        return arg_16

Builds the SQL compiler for a insert query .


def Func(arg_0, arg_1):
        """
        Create a new data set version.

        :param dataset_id: The ID of the dataset for which the version must be bumped.
        :type dataset_id: int
        :return: The new dataset version.
        :rtype: :class:`DatasetVersion`
        """
        arg_2 = "Failed to create dataset version for dataset {}".format(arg_1)
        arg_3 = arg_0._get_success_json(arg_0._post_json(routes.Func(arg_1), data={}, arg_2=arg_2))['dataset_scoped_id']

        return DatasetVersion(arg_3=arg_3)


def Func ( arg_0 , arg_1 ) : arg_2 = [ ] for arg_3 in context : arg_4 = context [ arg_3 ] for arg_5 in arg_4 : if arg_5 . startswith ( arg_1 ) or arg_1 . startswith ( arg_5 ) : arg_2 . append ( arg_3 ) break arg_2 = [ color ( name ) for name in arg_2 ] return arg_2

def Func(arg_0, arg_1):
        """ Returns the colors that have the given word in their context.

        For example, the word "anger" appears
        in black, orange and red contexts,
        so the list will contain those three colors.

        """
        arg_2 = []
        for arg_3 in context:
            arg_4 = context[arg_3]
            for arg_5 in arg_4:
                if arg_5.startswith(arg_1) \
                        or arg_1.startswith(arg_5):
                    arg_2.append(arg_3)
                    break

        arg_2 = [color(name) for name in arg_2]
        return arg_2

Returns the colors that have the given word in their context .


def Func ( arg_0 ) : arg_1 = { } arg_2 = [ arg_0 . tmaster_binary , '--topology_name=%s' % arg_0 . topology_name , '--topology_id=%s' % arg_0 . topology_id , '--zkhostportlist=%s' % arg_0 . state_manager_connection , '--zkroot=%s' % arg_0 . state_manager_root , '--myhost=%s' % arg_0 . master_host , '--master_port=%s' % str ( arg_0 . master_port ) , '--controller_port=%s' % str ( arg_0 . tmaster_controller_port ) , '--stats_port=%s' % str ( arg_0 . tmaster_stats_port ) , '--config_file=%s' % arg_0 . heron_internals_config_file , '--override_config_file=%s' % arg_0 . override_config_file , '--metrics_sinks_yaml=%s' % arg_0 . metrics_sinks_config_file , '--metricsmgr_port=%s' % str ( arg_0 . metrics_manager_port ) , '--ckptmgr_port=%s' % str ( arg_0 . checkpoint_manager_port ) ] arg_3 = arg_0 . shell_env . copy ( ) if arg_0 . shell_env is not None else { } arg_4 = Command ( arg_2 , arg_3 ) if os . environ . get ( 'ENABLE_HEAPCHECK' ) is not None : arg_4 . env . update ( { 'LD_PRELOAD' : "/usr/lib/libtcmalloc.so" , 'HEAPCHECK' : "normal" } ) arg_1 [ "heron-tmaster" ] = arg_4 if arg_0 . metricscache_manager_mode . lower ( ) != "disabled" : arg_1 [ "heron-metricscache" ] = arg_0 . _get_metrics_cache_cmd ( ) if arg_0 . health_manager_mode . lower ( ) != "disabled" : arg_1 [ "heron-healthmgr" ] = arg_0 . _get_healthmgr_cmd ( ) arg_1 [ arg_0 . metricsmgr_ids [ 0 ] ] = arg_0 . _get_metricsmgr_cmd ( arg_0 . metricsmgr_ids [ 0 ] , arg_0 . metrics_sinks_config_file , arg_0 . metrics_manager_port ) if arg_0 . is_stateful_topology : arg_1 . update ( arg_0 . _get_ckptmgr_process ( ) ) return arg_1

def Func(arg_0):
    ''' get the command to start the tmaster processes '''
    arg_1 = {}
    arg_2 = [
        arg_0.tmaster_binary,
        '--topology_name=%s' % arg_0.topology_name,
        '--topology_id=%s' % arg_0.topology_id,
        '--zkhostportlist=%s' % arg_0.state_manager_connection,
        '--zkroot=%s' % arg_0.state_manager_root,
        '--myhost=%s' % arg_0.master_host,
        '--master_port=%s' % str(arg_0.master_port),
        '--controller_port=%s' % str(arg_0.tmaster_controller_port),
        '--stats_port=%s' % str(arg_0.tmaster_stats_port),
        '--config_file=%s' % arg_0.heron_internals_config_file,
        '--override_config_file=%s' % arg_0.override_config_file,
        '--metrics_sinks_yaml=%s' % arg_0.metrics_sinks_config_file,
        '--metricsmgr_port=%s' % str(arg_0.metrics_manager_port),
        '--ckptmgr_port=%s' % str(arg_0.checkpoint_manager_port)]

    arg_3 = arg_0.shell_env.copy() if arg_0.shell_env is not None else {}
    arg_4 = Command(arg_2, arg_3)
    if os.environ.get('ENABLE_HEAPCHECK') is not None:
      arg_4.env.update({
          'LD_PRELOAD': "/usr/lib/libtcmalloc.so",
          'HEAPCHECK': "normal"
      })

    arg_1["heron-tmaster"] = arg_4

    if arg_0.metricscache_manager_mode.lower() != "disabled":
      arg_1["heron-metricscache"] = arg_0._get_metrics_cache_cmd()

    if arg_0.health_manager_mode.lower() != "disabled":
      arg_1["heron-healthmgr"] = arg_0._get_healthmgr_cmd()

    arg_1[arg_0.metricsmgr_ids[0]] = arg_0._get_metricsmgr_cmd(
        arg_0.metricsmgr_ids[0],
        arg_0.metrics_sinks_config_file,
        arg_0.metrics_manager_port)

    if arg_0.is_stateful_topology:
      arg_1.update(arg_0._get_ckptmgr_process())

    return arg_1


def Func(arg_0, arg_1=arg_2.stdout):
        """Print human readable Func of model."""
        arg_4 = arg_0.results['cpu bottleneck']['performance throughput']

        if arg_0.verbose >= 3:
            print('{}'.format(pformat(arg_0.results)), file=arg_1)

        if arg_0.verbose >= 1:
            print('Bottlenecks:', file=arg_1)
            print('  level | a. intensity |   performance   |   peak bandwidth  | peak bandwidth kernel',
                  file=arg_1)
            print('--------+--------------+-----------------+-------------------+----------------------',
                  file=arg_1)
            print('    CPU |              | {!s:>15} |                   |'.format(
                arg_4[arg_0._args.unit]),
                  file=arg_1)
            for arg_5 in arg_0.results['mem bottlenecks']:
                # Skip CPU-L1 from Roofline model
                if arg_5 is None:
                    continue
                print('{level:>7} | {arithmetic intensity:>5.2} FLOP/B | {0!s:>15} |'
                      ' {bandwidth!s:>17} | {bw kernel:<8}'.format(
                          arg_5['performance'][arg_0._args.unit], **arg_5),
                      file=arg_1)
            print('', file=arg_1)
            print('IACA analisys:', file=arg_1)
            print('{!s}'.format(
                {arg_6: arg_7
                 for arg_6, arg_7 in list(arg_0.results['cpu bottleneck'].items())
                 if arg_6 not in['IACA output']}),
                file=arg_1)

        if arg_0.results['min performance']['FLOP/s'] > arg_4['FLOP/s']:
            # CPU bound
            print('CPU bound. {!s} due to CPU bottleneck'.format(arg_4[arg_0._args.unit]),
                  file=arg_1)
        else:
            # Cache or mem bound
            print('Cache or mem bound.', file=arg_1)

            arg_8 = arg_0.results['mem bottlenecks'][arg_0.results['bottleneck level']]
            print('{!s} due to {} transfer bottleneck (with bw from {} benchmark)'.format(
                      arg_8['performance'][arg_0._args.unit],
                      arg_8['level'],
                      arg_8['bw kernel']),
                  file=arg_1)
            print('Arithmetic Intensity: {:.2f} FLOP/B'.format(arg_8['arithmetic intensity']),
                  file=arg_1)


Output a simple table with several columns.

def Func ( arg_0 ) : arg_1 = '<Func>' for arg_2 in arg_0 : arg_1 += '
' for arg_3 in arg_2 : arg_1 += '{s}	' . format ( s = arg_3 ) arg_1 += '
' arg_1 += '</Func>' return arg_1

def Func(arg_0):
    '''
    Output a simple Func with several columns.
    '''

    arg_1 = '<Func>'

    for arg_2 in arg_0:
        arg_1 += '
'
        for arg_3 in arg_2:
            arg_1 += '{s}	'.format(s=arg_3)
        arg_1 += '
'

    arg_1 += '</Func>'

    return arg_1

Output a simple table with several columns .


def Func(arg_0, arg_1, arg_2):
    """Build CLI dynamically based on the package structure.
    """
    for arg_3, arg_4, arg_5 in iter_modules(arg_1):
        arg_6 = import_module(f'.{name}', arg_2)
        if arg_5:
            Func(arg_0.group(arg_4)(arg_6.group),
                  arg_6.__path__,
                  arg_6.__package__)
        else:
            arg_0.command(arg_4)(arg_6.command)

Build CLI dynamically based on the package structure .


def Func ( arg_0 = None , arg_1 = None ) : if arg_0 : Settings . bind ( arg_0 , arg_1 = arg_1 ) return Settings . _wrapped

def Func(arg_0=None, arg_1=None):
    """
    Get or set `Settings._wrapped`

    :param str path: a python module file,
        if user set it,write config to `Settings._wrapped`
    :param str with_path: search path
    :return: A instance of `Settings`
    """

    if arg_0:
        Settings.bind(arg_0, arg_1=arg_1)

    return Settings._wrapped


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
arg_3
=
'application/json'
arg_4
=
NamedTemporaryFile
(
delete
=
True
)
if
arg_0
.
schema
is
not
and
isinstance
(
arg_0
.
schema
,
string_types
)
:
arg_2
=
arg_0
.
schema
.
encode
(
'utf-8'
)
elif
arg_0
.
schema
is
not
and
isinstance
(
arg_0
.
schema
,
list
)
:
arg_2
=
json
.
dumps
(
arg_0
.
schema
)
.
encode
(
'utf-8'
)
else
:
arg_5
=
[
]
for
arg_6
in
arg_1
.
description
:
arg_7
=
arg_6
[
0
]
arg_8
=
arg_0
.
type_map
(
arg_6
[
1
]
)
if
arg_6
[
6
]
or
arg_8
==
'TIMESTAMP'
:
arg_9
=
'NULLABLE'
else
:
arg_9
=
'REQUIRED'
arg_5
.
append
(
{
'name'
:
arg_7
,
'type'
:
arg_8
,
'mode'
:
arg_9
,
}
)
arg_2
=
json
.
dumps
(
arg_5
,
sort_keys
=
True
)
.
encode
(
'utf-8'
)
arg_4
.
write
(
arg_2
)
arg_0
.
log
.
info
(
'Using schema for %s: %s'
,
arg_0
.
schema_filename
,
arg_2
)
arg_10
=
{
'file_name'
:
arg_0
.
schema_filename
,
'file_handle'
:
arg_4
,
'file_mime_type'
:
arg_3
}
return
arg_10

def Func(arg_0, arg_1):
        """
        Takes a cursor, and writes the BigQuery schema in .json format for the
        results to a local file system.

        :return: A dictionary where key is a filename to be used as an object
            name in GCS, and values are file handles to local files that
            contains the BigQuery schema fields in .json format.
        """
        arg_2 = None
        arg_3 = 'application/json'
        arg_4 = NamedTemporaryFile(delete=True)
        if arg_0.schema is not None and isinstance(arg_0.schema, string_types):
            arg_2 = arg_0.schema.encode('utf-8')
        elif arg_0.schema is not None and isinstance(arg_0.schema, list):
            arg_2 = json.dumps(arg_0.schema).encode('utf-8')
        else:
            arg_5 = []
            for arg_6 in arg_1.description:
                # See PEP 249 for details about the description tuple.
                arg_7 = arg_6[0]
                arg_8 = arg_0.type_map(arg_6[1])
                # Always allow TIMESTAMP to be nullable. MySQLdb returns None types
                # for required fields because some MySQL timestamps can't be
                # represented by Python's datetime (e.g. 0000-00-00 00:00:00).
                if arg_6[6] or arg_8 == 'TIMESTAMP':
                    arg_9 = 'NULLABLE'
                else:
                    arg_9 = 'REQUIRED'
                arg_5.append({
                    'name': arg_7,
                    'type': arg_8,
                    'mode': arg_9,
                })
            arg_2 = json.dumps(arg_5, sort_keys=True).encode('utf-8')
        arg_4.write(arg_2)

        arg_0.log.info('Using schema for %s: %s', arg_0.schema_filename, arg_2)
        arg_10 = {
            'file_name': arg_0.schema_filename,
            'file_handle': arg_4,
            'file_mime_type': arg_3
        }
        return arg_10

Takes a cursor and writes the BigQuery schema in . json format for the results to a local file system .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_0 . filter ( models . IPAddress . version == 4L ) . filter ( models . IPAddress . network_id == PUBLIC_NETWORK_ID ) . filter ( models . IPAddress . used_by_tenant_id is not None ) . filter ( models . IPAddress . allocated_at != null ( ) ) . filter ( models . IPAddress . allocated_at < arg_1 ) . filter ( or_ ( models . IPAddress . _deallocated is False , models . IPAddress . deallocated_at == null ( ) , models . IPAddress . deallocated_at >= arg_2 ) ) . all ( ) return arg_3

def Func(arg_0, arg_1, arg_2):
    """Method to build an IP list for the case 1

    when the IP was allocated before the period start
    and is still allocated after the period end.
    This method only looks at public IPv4 addresses.
    """
    # Filter out only IPv4 that have not been deallocated
    arg_3 = arg_0.\
        filter(models.IPAddress.version == 4L).\
        filter(models.IPAddress.network_id == PUBLIC_NETWORK_ID).\
        filter(models.IPAddress.used_by_tenant_id is not None).\
        filter(models.IPAddress.allocated_at != null()).\
        filter(models.IPAddress.allocated_at < arg_1).\
        filter(or_(models.IPAddress._deallocated is False,
                   models.IPAddress.deallocated_at == null(),
                   models.IPAddress.deallocated_at >= arg_2)).all()

    return arg_3


def Func ( arg_0 , arg_1 ) : write_value ( 'LicenseID' , arg_0 . identifier , arg_1 ) if arg_0 . full_name is not None : write_value ( 'LicenseName' , arg_0 . full_name , arg_1 ) if arg_0 . comment is not None : write_text_value ( 'LicenseComment' , arg_0 . comment , arg_1 ) for arg_2 in sorted ( arg_0 . cross_ref ) : write_value ( 'LicenseCrossReference' , arg_2 , arg_1 ) write_text_value ( 'ExtractedText' , arg_0 . text , arg_1 )

def Func(arg_0, arg_1):
    """
    Write extracted licenses fields to out.
    """
    write_value('LicenseID', arg_0.identifier, arg_1)

    if arg_0.full_name is not None:
        write_value('LicenseName', arg_0.full_name, arg_1)

    if arg_0.comment is not None:
        write_text_value('LicenseComment', arg_0.comment, arg_1)

    for arg_2 in sorted(arg_0.cross_ref):
        write_value('LicenseCrossReference', arg_2, arg_1)

    write_text_value('ExtractedText', arg_0.text, arg_1)

Write extracted licenses fields to out .


return "{}({})".format(class_name, ", ".join(arguments))

def
Func
(
arg_0
,
*
arg_1
,
**
arg_2
)
:
arg_3
=
[
repr
(
arg
)
for
arg
in
arg_1
]
arg_3
.
extend
(
"{}={!r}"
.
format
(
arg_4
,
arg_5
)
for
arg_4
,
(
arg_5
,
arg_6
)
in
sorted
(
arg_2
.
items
(
)
)
if
arg_5
!=
arg_6
)
return
"{}({})"
.
format
(
arg_0
,
", "
.
join
(
arg_3
)
)

def Func(arg_0, *arg_1, **arg_2):
    """
    Generate a repr string.

    Positional arguments should be the positional arguments used to
    construct the class. Keyword arguments should consist of tuples of
    the attribute value and default. If the value is the default, then
    it won't be rendered in the output.

    Here's an example::

        def __repr__(self):
            return make_repr('MyClass', 'foo', name=(self.name, None))

    The output of this would be something line ``MyClass('foo',
    name='Will')``.

    """
    arg_3 = [repr(arg) for arg in arg_1]
    arg_3.extend(
        "{}={!r}".format(arg_4, arg_5)
        for arg_4, (arg_5, arg_6) in sorted(arg_2.items())
        if arg_5 != arg_6
    )
    return "{}({})".format(arg_0, ", ".join(arg_3))


def Func ( arg_0 , arg_1 = None , arg_2 = None ) : if arg_1 and arg_2 : arg_3 = int ( arg_2 ) - int ( arg_1 ) else : arg_3 = PyFunceble . INTERN [ "end" ] - PyFunceble . INTERN [ "start" ] arg_4 = PyFunceble . OrderedDict ( ) arg_4 [ "days" ] = str ( arg_3 // ( 24 * 60 * 60 ) ) . zfill ( 2 ) arg_4 [ "hours" ] = str ( ( arg_3 // ( 60 * 60 ) ) % 24 ) . zfill ( 2 ) arg_4 [ "minutes" ] = str ( ( arg_3 % 3600 ) // 60 ) . zfill ( 2 ) arg_4 [ "seconds" ] = str ( arg_3 % 60 ) . zfill ( 2 ) return arg_4

def Func(arg_0, arg_1=None, arg_2=None):
        """
        calculate the difference between starting and ending time.

        :param start: A starting time.
        :type start: int|str

        :param stop: A ending time.
        :type stop: int|str

        :return:
            A dict with following as index.

                * :code:`days`
                * :code:`hours`
                * :code:`minutes`
                * :code:`seconds`

            as index.
        :rtype: dict
        """

        if arg_1 and arg_2:
            # The start and end time is explicitly given.

            # We get the difference between the ending and the starting time.
            arg_3 = int(arg_2) - int(arg_1)
        else:
            # The start and end time is not explicitly given.

            # We get the difference between the ending and the starting time.
            arg_3 = PyFunceble.INTERN["end"] - PyFunceble.INTERN["start"]

        # We initiate an OrderedDict.
        # Indeed, we use an ordered dict because we want the structuration and the
        # order to stay always the same.
        # As a dictionnary is always unordered, we can use it. Otherwise the time will
        # not be shown correctly.
        arg_4 = PyFunceble.OrderedDict()

        # We calculate and append the day to our data.
        arg_4["days"] = str(arg_3 // (24 * 60 * 60)).zfill(2)

        # We calculate and append the hours to our data.
        arg_4["hours"] = str((arg_3 // (60 * 60)) % 24).zfill(2)

        # We calculate and append the minutes to our data.
        arg_4["minutes"] = str((arg_3 % 3600) // 60).zfill(2)

        # We calculate and append the minutes to our data.
        arg_4["seconds"] = str(arg_3 % 60).zfill(2)

        # We finaly return our data.
        return arg_4

calculate the difference between starting and ending time .


def Func(arg_0, arg_1, arg_2):
    """Verify that install_requires is a valid requirements list"""
    try:
        list(pkg_resources.parse_requirements(arg_2))
    except (TypeError, ValueError) as error:
        arg_3 = (
            "{attr!r} must be a string or list of strings "
            "containing valid project/version requirement specifiers; {error}"
        )
        raise DistutilsSetupError(arg_3.format(arg_1=arg_1, error=error))


def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
)
:
arg_4
=
arg_0
.
get_conn
(
)
arg_5
=
storage
.
Bucket
(
arg_4
=
arg_4
,
name
=
arg_1
)
arg_6
=
arg_5
.
get_blob
(
blob_name
=
arg_2
)
arg_6
.
reload
(
)
arg_7
=
arg_6
.
updated
if
arg_7
is
not
:
import
dateutil
.
tz
if
not
arg_3
.
tzinfo
:
arg_3
=
arg_3
.
replace
(
tzinfo
=
dateutil
.
tz
.
tzutc
(
)
)
arg_0
.
log
.
info
(
"Verify object date: %s > %s"
,
arg_7
,
arg_3
)
if
arg_7
>
arg_3
:
return
True
return
False

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Checks if an blob_name is updated in Google Cloud Storage.

        :param bucket_name: The Google cloud storage bucket where the object is.
        :type bucket_name: str
        :param object_name: The name of the object to check in the Google cloud
            storage bucket.
        :type object_name: str
        :param ts: The timestamp to check against.
        :type ts: datetime.datetime
        """
        arg_4 = arg_0.get_conn()
        arg_5 = storage.Bucket(arg_4=arg_4, name=arg_1)
        arg_6 = arg_5.get_blob(blob_name=arg_2)
        arg_6.reload()

        arg_7 = arg_6.updated

        if arg_7 is not None:
            import dateutil.tz

            if not arg_3.tzinfo:
                arg_3 = arg_3.replace(tzinfo=dateutil.tz.tzutc())

            arg_0.log.info("Verify object date: %s > %s", arg_7, arg_3)

            if arg_7 > arg_3:
                return True

        return False

Checks if an blob_name is updated in Google Cloud Storage .


def Func ( arg_0 , arg_1 ) : if isinstance ( arg_1 , dict ) : for arg_2 in arg_0 : arg_3 = dict ( ) for arg_4 in arg_1 . keys ( ) : if hasattr ( arg_2 , arg_4 ) : arg_3 [ arg_4 ] = getattr ( arg_2 , arg_4 ) else : arg_3 [ arg_4 ] = arg_1 [ arg_4 ] yield arg_3 else : for arg_2 in arg_0 : arg_3 = dict ( ) for arg_4 in arg_1 : if hasattr ( arg_2 , arg_4 ) : arg_3 [ arg_4 ] = getattr ( arg_2 , arg_4 ) yield arg_3

def Func(arg_0, arg_1):
    """Func pipe can extract attribute values of object into a dict.

    The argument attr_names can be a list or a dict.

    If attr_names is a list and its item is not a valid attribute of
    prev's object. It will be excluded from yielded dict.

    If attr_names is dict and the key doesn't exist in prev's object.
    the value of corresponding attr_names key will be copy to yielded dict.

    :param prev: The previous iterator of pipe.
    :type prev: Pipe
    :param attr_names: The list or dict of attribute names
    :type attr_names: str of list or dict
    :returns: generator
    """
    if isinstance(arg_1, dict):
        for arg_2 in arg_0:
            arg_3 = dict()
            for arg_4 in arg_1.keys():
                if hasattr(arg_2, arg_4):
                    arg_3[arg_4] = getattr(arg_2, arg_4)
                else:
                    arg_3[arg_4] = arg_1[arg_4]
            yield arg_3
    else:
        for arg_2 in arg_0:
            arg_3 = dict()
            for arg_4 in arg_1:
                if hasattr(arg_2, arg_4):
                    arg_3[arg_4] = getattr(arg_2, arg_4)
            yield arg_3

attrdict pipe can extract attribute values of object into a dict.

    The argument attr_names can be a list or a dict.

    If attr_names is a list and its item is not a valid attribute of
    prev's object. It will be excluded from yielded dict.

    If attr_names is dict and the key doesn't exist in prev's object.
    the value of corresponding attr_names key will be copy to yielded dict.

    :param prev: The previous iterator of pipe.
    :type prev: Pipe
    :param attr_names: The list or dict of attribute names
    :type attr_names: str of list or dict
    :returns: generator

attrdict pipe can extract attribute values of object into a dict .


def
Func
(
arg_0
,
arg_1
)
:
if
STALE_CONNECTION
in
arg_1
:
yield
from
arg_0
.
_process_op_err
(
ErrStaleConnection
)
return
if
AUTHORIZATION_VIOLATION
in
arg_1
:
arg_0
.
_err
=
ErrAuthorization
else
:
arg_3
=
b'nats: '
+
arg_1
[
0
]
arg_0
.
_err
=
NatsError
(
arg_3
.
decode
(
)
)
arg_4
=
False
if
not
arg_0
.
is_connecting
:
arg_4
=
True
arg_0
.
_loop
.
create_task
(
arg_0
.
_close
(
Client
.
CLOSED
,
arg_4
)
)

def Func(arg_0, arg_1):
        """
        Processes the raw error message sent by the server
        and close connection with current server.
        """
        if STALE_CONNECTION in arg_1:
            yield from arg_0._process_op_err(ErrStaleConnection)
            return

        if AUTHORIZATION_VIOLATION in arg_1:
            arg_0._err = ErrAuthorization
        else:
            arg_3 = b'nats: ' + arg_1[0]
            arg_0._err = NatsError(arg_3.decode())

        arg_4 = False
        if not arg_0.is_connecting:
            arg_4 = True

        # FIXME: Some errors such as 'Invalid Subscription'
        # do not cause the server to close the connection.
        # For now we handle similar as other clients and close.
        arg_0._loop.create_task(arg_0._close(Client.CLOSED, arg_4))

Processes the raw error message sent by the server and close connection with current server .


def Func(arg_0, arg_1, arg_2):
  """Computes the standard deviation of a mixture distribution.

  This function works regardless of the component distribution, so long as
  each component's mean and standard deviation can be provided.

  Args:
    mixture_weight_vector: A 2D tensor with shape [batch_size, num_components]
    mean_vector: A 2D tensor of mixture component means. Has shape `[batch_size,
      num_components]`.
    stddev_vector: A 2D tensor of mixture component standard deviations. Has
      shape `[batch_size, num_components]`.

  Returns:
    A 1D tensor of shape `[batch_size]` representing the standard deviation of
    the mixture distribution with given weights and component means and standard
    deviations.
  Raises:
    ValueError: If the shapes of the input tensors are not as expected.
  """
  tensorshape_util.assert_has_rank(arg_0.shape, 2)
  if not tensorshape_util.is_compatible_with(arg_1.shape,
                                             arg_0.shape):
    raise ValueError("Expecting means to have same shape as mixture weights.")
  if not tensorshape_util.is_compatible_with(arg_2.shape,
                                             arg_0.shape):
    raise ValueError("Expecting stddevs to have same shape as mixture weights.")

  # Reshape the distribution parameters for batched vectorized dot products.
  arg_3 = tf.expand_dims(arg_0, axis=1)
  arg_4 = tf.expand_dims(arg_1, axis=2)
  arg_5 = tf.expand_dims(arg_2, axis=2)

  # weighted average of component means under mixture distribution.
  arg_6 = tf.matmul(arg_3, arg_4)
  arg_6 = tf.reshape(arg_6, (-1,))
  # weighted average of component variances under mixture distribution.
  arg_7 = tf.matmul(arg_3, tf.square(arg_5))
  arg_7 = tf.reshape(arg_7, (-1,))
  # weighted average of component squared means under mixture distribution.
  arg_8 = tf.matmul(arg_3, tf.square(arg_4))
  arg_8 = tf.reshape(arg_8, (-1,))
  arg_9 = arg_7 + arg_8 - tf.square(arg_6)
  return tf.sqrt(arg_9)

Computes the standard deviation of a mixture distribution .


def Func(arg_0):
		"""
		Run a scan in the path setted.
		"""

		arg_0.checkProperties()

		arg_0.debug("[*] Iniciando escaneo de AtomShields con las siguientes propiedades. . . ")

		arg_0.showScanProperties()

		arg_0.loadConfig()

		# Init time counter
		arg_1 = datetime.now()

		# Execute plugins
		arg_2 = os.getcwd()
		os.chdir(arg_0.path)
		arg_3 = arg_0.executeCheckers()
		os.chdir(arg_2)

		# Finish time counter
		arg_4 = datetime.now()
		arg_5 = '{}'.format(arg_4 - arg_1)

		# Process and set issues
		for arg_6 in arg_3.keys():
			arg_7 = arg_3[arg_6]
			if isinstance(arg_7, list):
				map(arg_0.saveIssue, arg_7)
			else:
				arg_0.saveIssue(arg_7)

		# Execute reports
		print ""
		arg_0.executeReports()

		# Print summary output.
		arg_0.debug("")
		arg_0.debug("Duration: {t}".format(t=arg_5))
		arg_0.showSummary()

		return arg_0.issues


def Func ( arg_0 ) : arg_1 = os . getcwd ( ) arg_2 = '%s.py' % ( arg_0 . split ( '.' ) [ - 1 ] ) while arg_1 : if arg_2 in os . listdir ( arg_1 ) : break arg_1 = os . path . split ( arg_1 ) [ 0 ] if os . name == 'nt' and NT_ROOT . match ( arg_1 ) : return None elif arg_1 == '/' : return None return arg_1

def Func(arg_0):
    '''
    Hunt down the settings.py module by going up the FS path
    '''
    arg_1 = os.getcwd()
    arg_2 = '%s.py' % (
        arg_0.split('.')[-1]
    )
    while arg_1:
        if arg_2 in os.listdir(arg_1):
            break
        arg_1 = os.path.split(arg_1)[0]
        if os.name == 'nt' and NT_ROOT.match(arg_1):
            return None
        elif arg_1 == '/':
            return None
    return arg_1

Hunt down the settings . py module by going up the FS path


Returns read only property for band nodata value, assuming single
        band rasters for now.

def Func ( arg_0 ) : if arg_0 . _Func is None : arg_0 . _Func = arg_0 [ 0 ] . GetNoDataValue ( ) return arg_0 . _Func

def Func(arg_0):
        """Returns read only property for band Func value, assuming single
        band rasters for now.
        """
        if arg_0._Func is None:
            arg_0._Func = arg_0[0].GetNoDataValue()
        return arg_0._Func

Returns read only property for band nodata value assuming single band rasters for now .


def
Func
(
arg_0
)
:
arg_1
=
Membership
.
query
.
get_or_404
(
(
current_user
.
get_id
(
)
,
arg_0
)
)
try
:
arg_1
.
Func
(
)
except
Exception
as
e
:
flash
(
str
(
e
)
,
'error'
)
return
redirect
(
url_for
(
'.invitations'
,
arg_0
=
arg_1
.
group
.
id
)
)
flash
(
_
(
'You are now part of %(name)s group.'
,
user
=
arg_1
.
user
.
email
,
name
=
arg_1
.
group
.
name
)
,
'success'
)
return
redirect
(
url_for
(
'.invitations'
,
arg_0
=
arg_1
.
group
.
id
)
)

def Func(arg_0):
    """Accpet pending invitation."""
    arg_1 = Membership.query.get_or_404((current_user.get_id(), arg_0))

    # no permission check, because they are checked during Memberships creating

    try:
        arg_1.Func()
    except Exception as e:
        flash(str(e), 'error')
        return redirect(url_for('.invitations', arg_0=arg_1.group.id))

    flash(_('You are now part of %(name)s group.',
            user=arg_1.user.email,
            name=arg_1.group.name), 'success')
    return redirect(url_for('.invitations', arg_0=arg_1.group.id))


def
Func
(
arg_0
,
arg_1
,
**
arg_2
)
:
arg_3
=
arg_0
.
_api_info
[
'camera'
]
arg_4
=
dict
(
{
'_sid'
:
arg_0
.
_sid
,
'api'
:
arg_3
[
'name'
]
,
'method'
:
'GetInfo'
,
'version'
:
arg_3
[
'version'
]
,
'cameraIds'
:
', '
.
join
(
str
(
id
)
for
id
in
arg_1
)
,
}
,
**
arg_2
)
arg_5
=
arg_0
.
_get_json_with_retry
(
arg_3
[
'url'
]
,
arg_4
)
arg_6
=
[
]
for
arg_7
in
arg_5
[
'data'
]
[
'cameras'
]
:
arg_6
.
append
(
Camera
(
arg_7
,
arg_0
.
_video_stream_url
)
)
return
arg_6

def Func(arg_0, arg_1, **arg_2):
        """Return a list of cameras matching camera_ids."""
        arg_3 = arg_0._api_info['camera']
        arg_4 = dict({
            '_sid': arg_0._sid,
            'api': arg_3['name'],
            'method': 'GetInfo',
            'version': arg_3['version'],
            'cameraIds': ', '.join(str(id) for id in arg_1),
        }, **arg_2)
        arg_5 = arg_0._get_json_with_retry(arg_3['url'], arg_4)

        arg_6 = []

        for arg_7 in arg_5['data']['cameras']:
            arg_6.append(Camera(arg_7, arg_0._video_stream_url))

        return arg_6

Return a list of cameras matching camera_ids .


def
Func
(
arg_0
,
arg_1
)
:
if
not
_is_pil_image
(
arg_0
)
:
raise
TypeError
(
'img should be PIL Image. Got {}'
.
format
(
type
(
arg_0
)
)
)
arg_2
=
ImageEnhance
.
Color
(
arg_0
)
arg_0
=
arg_2
.
enhance
(
arg_1
)
return
arg_0

def Func(arg_0, arg_1):
    """Adjust color saturation of an image.

    Args:
        img (PIL Image): PIL Image to be adjusted.
        saturation_factor (float):  How much to adjust the saturation. 0 will
            give a black and white image, 1 will give the original image while
            2 will enhance the saturation by a factor of 2.

    Returns:
        PIL Image: Saturation adjusted image.
    """
    if not _is_pil_image(arg_0):
        raise TypeError('img should be PIL Image. Got {}'.format(type(arg_0)))

    arg_2 = ImageEnhance.Color(arg_0)
    arg_0 = arg_2.enhance(arg_1)
    return arg_0


(self, url, name, data, callback=None, params=None, headers=None)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4=None, arg_5=None, arg_6=None):
        """
        Asynchronous PUT request with the process pool.
        """
        if arg_2 is None: arg_2 = ''
        arg_5 = arg_5 or {}
        arg_6 = arg_6 or {}
        arg_7 = arg_0._build_endpoint_url(arg_1, arg_2)
        arg_0._authenticate(arg_5, arg_6)
        arg_3 = json.dumps(arg_3, cls=JSONEncoder)
        process_pool.apply_async(make_put_request,
                                 args=(arg_7, arg_3, arg_5, arg_6),
                                 arg_4=arg_4)

Asynchronous PUT request with the process pool .


def Func ( arg_0 , arg_1 , arg_2 ) : try : arg_3 = User . objects . get ( email = arg_2 ) arg_0 . get_or_create ( arg_1 = arg_1 , user_id = arg_3 . id ) except User . DoesNotExist : PendingEnterpriseCustomerUser . objects . get_or_create ( arg_1 = arg_1 , arg_2 = arg_2 )

def Func(arg_0, arg_1, arg_2):
        """
        Link user email to Enterprise Customer.

        If :class:`django.contrib.auth.models.User` instance with specified email does not exist,
        :class:`.PendingEnterpriseCustomerUser` instance is created instead.
        """
        try:
            arg_3 = User.objects.get(email=arg_2)
            arg_0.get_or_create(arg_1=arg_1, user_id=arg_3.id)
        except User.DoesNotExist:
            PendingEnterpriseCustomerUser.objects.get_or_create(arg_1=arg_1,
                                                                arg_2=arg_2)

Link user email to Enterprise Customer .


def Func ( arg_0 , arg_1 ) : arg_1 . lexer . is_tabbed = True arg_0 . _init_heredoc ( arg_1 ) arg_1 . lexer . begin ( 'tabbedheredoc' )

def Func(arg_0, arg_1):
        r'<<-\S+\r?\n'
        arg_1.lexer.is_tabbed = True
        arg_0._init_heredoc(arg_1)
        arg_1.lexer.begin('tabbedheredoc')


def Func ( arg_0 , arg_1 , arg_2 = - 1 , ** arg_3 ) : arg_3 . setdefault ( 'mode' , 'constant' ) arg_4 = arg_0 . shape [ arg_2 ] if arg_4 > arg_1 : arg_5 = [ slice ( None ) ] * arg_0 . ndim arg_5 [ arg_2 ] = slice ( 0 , arg_1 ) return arg_0 [ tuple ( arg_5 ) ] elif arg_4 < arg_1 : arg_6 = [ ( 0 , 0 ) ] * arg_0 . ndim arg_6 [ arg_2 ] = ( 0 , arg_1 - arg_4 ) return np . pad ( arg_0 , arg_6 , ** arg_3 ) return arg_0

def Func(arg_0, arg_1, arg_2=-1, **arg_3):
    '''Fix the length an array `data` to exactly `size`.

    If `data.shape[axis] < n`, pad according to the provided kwargs.
    By default, `data` is padded with trailing zeros.

    Examples
    --------
    >>> y = np.arange(7)
    >>> # Default: pad with zeros
    >>> librosa.util.Func(y, 10)
    array([0, 1, 2, 3, 4, 5, 6, 0, 0, 0])
    >>> # Trim to a desired length
    >>> librosa.util.Func(y, 5)
    array([0, 1, 2, 3, 4])
    >>> # Use edge-padding instead of zeros
    >>> librosa.util.Func(y, 10, mode='edge')
    array([0, 1, 2, 3, 4, 5, 6, 6, 6, 6])

    Parameters
    ----------
    data : np.ndarray
      array to be length-adjusted

    size : int >= 0 [scalar]
      desired length of the array

    axis : int, <= data.ndim
      axis along which to fix length

    kwargs : additional keyword arguments
        Parameters to `np.pad()`

    Returns
    -------
    data_fixed : np.ndarray [shape=data.shape]
        `data` either trimmed or padded to length `size`
        along the specified axis.

    See Also
    --------
    numpy.pad
    '''

    arg_3.setdefault('mode', 'constant')

    arg_4 = arg_0.shape[arg_2]

    if arg_4 > arg_1:
        arg_5 = [slice(None)] * arg_0.ndim
        arg_5[arg_2] = slice(0, arg_1)
        return arg_0[tuple(arg_5)]

    elif arg_4 < arg_1:
        arg_6 = [(0, 0)] * arg_0.ndim
        arg_6[arg_2] = (0, arg_1 - arg_4)
        return np.pad(arg_0, arg_6, **arg_3)

    return arg_0

Fix the length an array `data` to exactly `size`.

    If `data.shape[axis] < n`, pad according to the provided kwargs.
    By default, `data` is padded with trailing zeros.

    Examples
    --------
    >>> y = np.arange(7)
    >>> # Default: pad with zeros
    >>> librosa.util.fix_length(y, 10)
    array([0, 1, 2, 3, 4, 5, 6, 0, 0, 0])
    >>> # Trim to a desired length
    >>> librosa.util.fix_length(y, 5)
    array([0, 1, 2, 3, 4])
    >>> # Use edge-padding instead of zeros
    >>> librosa.util.fix_length(y, 10, mode='edge')
    array([0, 1, 2, 3, 4, 5, 6, 6, 6, 6])

    Parameters
    ----------
    data : np.ndarray
      array to be length-adjusted

    size : int >= 0 [scalar]
      desired length of the array

    axis : int, <= data.ndim
      axis along which to fix length

    kwargs : additional keyword arguments
        Parameters to `np.pad()`

    Returns
    -------
    data_fixed : np.ndarray [shape=data.shape]
        `data` either trimmed or padded to length `size`
        along the specified axis.

    See Also
    --------
    numpy.pad

Fix the length an array data to exactly size .


def Func(arg_0, arg_1, arg_2, arg_3):
        r'''Method to calculate pressure-dependent liquid molar volume at
        temperature `T` and pressure `P` with a given method.

        This method has no exception handling; see `TP_dependent_property`
        for that.

        Parameters
        ----------
        T : float
            Temperature at which to calculate molar volume, [K]
        P : float
            Pressure at which to calculate molar volume, [K]
        method : str
            Name of the method to use

        Returns
        -------
        Vm : float
            Molar volume of the liquid at T and P, [m^3/mol]
        '''
        if arg_3 == COSTALD_COMPRESSED:
            arg_4 = arg_0.T_dependent_property(arg_1)
            arg_5 = arg_0.Psat(arg_1) if hasattr(arg_0.Psat, '__call__') else arg_0.Psat
            arg_4 = COSTALD_compressed(arg_1, arg_2, arg_5, arg_0.Tc, arg_0.Pc, arg_0.omega, arg_4)
        elif arg_3 == COOLPROP:
            arg_4 = 1./PropsSI('DMOLAR', 'T', arg_1, 'P', arg_2, arg_0.CASRN)
        elif arg_3 == EOS:
            arg_0.eos[0] = arg_0.eos[0].to_TP(arg_1=arg_1, arg_2=arg_2)
            arg_4 = arg_0.eos[0].V_l
        elif arg_3 in arg_0.tabular_data:
            arg_4 = arg_0.interpolate_P(arg_1, arg_2, arg_3)
        return arg_4

r Method to calculate pressure - dependent liquid molar volume at temperature T and pressure P with a given method .


(self, config, wait_for_completion=True,
                        check_interval=30, max_ingestion_time=None)

def Func(arg_0, arg_1, arg_2=True,
                        arg_3=30, arg_4=None):
        """
        Create an endpoint

        :param config: the config for endpoint
        :type config: dict
        :param wait_for_completion: if the program should keep running until job finishes
        :type wait_for_completion: bool
        :param check_interval: the time interval in seconds which the operator
            will check the status of any SageMaker job
        :type check_interval: int
        :param max_ingestion_time: the maximum ingestion time in seconds. Any
            SageMaker jobs that run longer than this will fail. Setting this to
            None implies no timeout for any SageMaker job.
        :type max_ingestion_time: int
        :return: A response to endpoint creation
        """

        arg_5 = arg_0.get_conn().Func(**arg_1)
        if arg_2:
            arg_0.check_status(arg_1['EndpointName'],
                              'EndpointStatus',
                              arg_0.describe_endpoint,
                              arg_3, arg_4,
                              non_terminal_states=arg_0.endpoint_non_terminal_states
                              )
        return arg_5


def
Func
(
arg_0
,
arg_1
,
arg_2
=
)
:
if
arg_1
:
arg_3
=
arg_0
.
tree
.
GetItemData
(
arg_1
)
if
arg_3
:
arg_4
=
arg_3
.
GetData
(
)
if
arg_4
:
arg_0
.
highlight
(
arg_4
.
wx_obj
)
arg_0
.
obj
=
arg_4
arg_5
=
wx
.
Menu
(
)
arg_6
,
arg_7
,
arg_8
,
arg_9
=
[
wx
.
NewId
(
)
for
i
in
range
(
4
)
]
arg_5
.
Append
(
arg_6
,
"Delete"
)
arg_5
.
Append
(
arg_7
,
"Duplicate"
)
arg_5
.
Append
(
arg_8
,
"Bring to Front"
)
arg_5
.
Append
(
arg_9
,
"Send to Back"
)
arg_10
=
wx
.
Menu
(
)
for
arg_11
in
sorted
(
arg_4
.
_meta
.
valid_children
,
key
=
lambda
c
:
registry
.
ALL
.
index
(
c
.
_meta
.
name
)
)
:
arg_12
=
wx
.
NewId
(
)
arg_10
.
Append
(
arg_12
,
arg_11
.
_meta
.
name
)
arg_0
.
Bind
(
wx
.
EVT_MENU
,
lambda
evt
,
arg_11
=
arg_11
:
arg_0
.
add_child
(
arg_11
,
arg_2
)
,
id
=
arg_12
)
arg_5
.
AppendMenu
(
wx
.
NewId
(
)
,
"Add child"
,
arg_10
)
arg_0
.
Bind
(
wx
.
EVT_MENU
,
arg_0
.
delete
,
id
=
arg_6
)
arg_0
.
Bind
(
wx
.
EVT_MENU
,
arg_0
.
duplicate
,
id
=
arg_7
)
arg_0
.
Bind
(
wx
.
EVT_MENU
,
arg_0
.
bring_to_front
,
id
=
arg_8
)
arg_0
.
Bind
(
wx
.
EVT_MENU
,
arg_0
.
send_to_back
,
id
=
arg_9
)
arg_0
.
PopupMenu
(
arg_5
)
arg_5
.
Destroy
(
)
arg_0
.
load_object
(
arg_0
.
root_obj
)

def Func(arg_0, arg_1, arg_2=None):
        "Open a popup menu with options regarding the selected object"
        if arg_1:
            arg_3 = arg_0.tree.GetItemData(arg_1)
            if arg_3:
                arg_4 = arg_3.GetData()
                if arg_4:
                    # highligh and store the selected object:
                    arg_0.highlight(arg_4.wx_obj)
                    arg_0.obj = arg_4

                    # make the context menu
                    arg_5 = wx.Menu()
                    arg_6, arg_7, arg_8, arg_9 = [wx.NewId() for i
                                                            in range(4)]
                    arg_5.Append(arg_6, "Delete")
                    arg_5.Append(arg_7, "Duplicate")
                    arg_5.Append(arg_8, "Bring to Front")
                    arg_5.Append(arg_9, "Send to Back")

                    # make submenu!
                    arg_10 = wx.Menu()
                    for arg_11 in sorted(arg_4._meta.valid_children,
                                       key=lambda c:
                                            registry.ALL.index(c._meta.name)):
                        arg_12 = wx.NewId()
                        arg_10.Append(arg_12, arg_11._meta.name)
                        arg_0.Bind(wx.EVT_MENU,
                                  lambda evt, arg_11=arg_11: arg_0.add_child(arg_11, arg_2),
                                  id=arg_12)

                    arg_5.AppendMenu(wx.NewId(), "Add child", arg_10)

                    arg_0.Bind(wx.EVT_MENU, arg_0.delete, id=arg_6)
                    arg_0.Bind(wx.EVT_MENU, arg_0.duplicate, id=arg_7)
                    arg_0.Bind(wx.EVT_MENU, arg_0.bring_to_front, id=arg_8)
                    arg_0.Bind(wx.EVT_MENU, arg_0.send_to_back, id=arg_9)

                    arg_0.PopupMenu(arg_5)
                    arg_5.Destroy()
                    arg_0.load_object(arg_0.root_obj)


return issubclass(cls, date) and not issubclass(cls, datetime)

def Func ( arg_0 ) : if not isinstance ( arg_0 , type ) : return False return issubclass ( arg_0 , date ) and not issubclass ( arg_0 , datetime )

def Func(arg_0):
    """Return True if the class is a date type."""
    if not isinstance(arg_0, type):
        return False
    return issubclass(arg_0, date) and not issubclass(arg_0, datetime)

Return True if the class is a date type .


Intercept all requests and add the OAuth 2 token if present.

(
        self,
        method,
        url,
        data=None,
        headers=None,
        withhold_token=False,
        client_id=None,
        client_secret=None,
        **kwargs
    )

return super(OAuth2Session, self).request(
            method, url, headers=headers, data=data, **kwargs
        )

def Func(
        arg_0,
        arg_1,
        arg_2,
        arg_3=None,
        arg_4=None,
        arg_5=False,
        arg_6=None,
        arg_7=None,
        **arg_8
    ):
        """Intercept all Funcs and add the OAuth 2 token if present."""
        if not is_secure_transport(arg_2):
            raise InsecureTransportError()
        if arg_0.token and not arg_5:
            log.debug(
                "Invoking %d protected resource Func hooks.",
                len(arg_0.compliance_hook["protected_Func"]),
            )
            for arg_9 in arg_0.compliance_hook["protected_Func"]:
                log.debug("Invoking hook %s.", arg_9)
                arg_2, arg_4, arg_3 = arg_9(arg_2, arg_4, arg_3)

            log.debug("Adding token %s to Func.", arg_0.token)
            try:
                arg_2, arg_4, arg_3 = arg_0._client.add_token(
                    arg_2, http_method=arg_1, body=arg_3, arg_4=arg_4
                )
            # Attempt to retrieve and save new access token if expired
            except TokenExpiredError:
                if arg_0.auto_refresh_url:
                    log.debug(
                        "Auto refresh is set, attempting to refresh at %s.",
                        arg_0.auto_refresh_url,
                    )

                    # We mustn't pass auth twice.
                    arg_10 = arg_8.pop("auth", None)
                    if arg_6 and arg_7 and (arg_10 is None):
                        log.debug(
                            'Encoding client_id "%s" with client_secret as Basic auth credentials.',
                            arg_6,
                        )
                        arg_10 = Funcs.auth.HTTPBasicAuth(arg_6, arg_7)
                    arg_11 = arg_0.refresh_token(
                        arg_0.auto_refresh_url, arg_10=arg_10, **arg_8
                    )
                    if arg_0.token_updater:
                        log.debug(
                            "Updating token to %s using %s.", arg_11, arg_0.token_updater
                        )
                        arg_0.token_updater(arg_11)
                        arg_2, arg_4, arg_3 = arg_0._client.add_token(
                            arg_2, http_method=arg_1, body=arg_3, arg_4=arg_4
                        )
                    else:
                        raise TokenUpdated(arg_11)
                else:
                    raise

        log.debug("Requesting url %s using method %s.", arg_2, arg_1)
        log.debug("Supplying headers %s and data %s", arg_4, arg_3)
        log.debug("Passing through key word arguments %s.", arg_8)
        return super(OAuth2Session, arg_0).Func(
            arg_1, arg_2, arg_4=arg_4, arg_3=arg_3, **arg_8
        )

Intercept all requests and add the OAuth 2 token if present .


def Func(arg_0, arg_1):
    ''' Builds input arguments by stitching input filepaths and input
    formats together.
    '''
    if len(arg_1) != len(arg_0):
        raise ValueError(
            "input_format_list & input_filepath_list are not the same size"
        )

    arg_2 = []
    arg_3 = zip(arg_0, arg_1)
    for arg_4, arg_5 in arg_3:
        arg_2.extend(arg_5)
        arg_2.append(arg_4)

    return arg_2

Builds input arguments by stitching input filepaths and input formats together .


(inputs, units, name,
                                    nats_name_scope="nats",
                                    bits_name_scope="bits_per_dim")

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = "nats" , arg_4 = "bits_per_dim" ) : arg_5 = tf . reduce_mean ( input_tensor = arg_0 ) with tf . compat . v1 . name_scope ( arg_3 ) : tf . compat . v2 . summary . scalar ( arg_2 , arg_5 , step = tf . compat . v1 . train . get_or_create_global_step ( ) ) with tf . compat . v1 . name_scope ( arg_4 ) : tf . compat . v2 . summary . scalar ( arg_2 , arg_5 / arg_1 / tf . math . log ( 2. ) , step = tf . compat . v1 . train . get_or_create_global_step ( ) )

def Func(arg_0, arg_1, arg_2,
                                    arg_3="nats",
                                    arg_4="bits_per_dim"):
  """Summarize the mean of a tensor in nats and bits per unit.

  Args:
    inputs: A tensor of values measured in nats.
    units: The units of the tensor with which to compute the mean bits
      per unit.
    name: The name of the tensor.
    nats_name_scope: The name scope of the nats summary.
    bits_name_scope: The name scope of the bits summary.
  """
  arg_5 = tf.reduce_mean(input_tensor=arg_0)
  with tf.compat.v1.name_scope(arg_3):
    tf.compat.v2.summary.scalar(
        arg_2,
        arg_5,
        step=tf.compat.v1.train.get_or_create_global_step())
  with tf.compat.v1.name_scope(arg_4):
    tf.compat.v2.summary.scalar(
        arg_2,
        arg_5 / arg_1 / tf.math.log(2.),
        step=tf.compat.v1.train.get_or_create_global_step())

Summarize the mean of a tensor in nats and bits per unit .


def Func ( arg_0 , arg_1 ) : from . api import get_home_path arg_1 = unipath ( get_home_path ( ) , arg_1 ) if is_environment ( arg_1 ) : return VirtualEnvironment ( arg_1 ) raise ResolveError

def Func(arg_0, arg_1):
    '''Resolves VirtualEnvironments in CPENV_HOME'''

    from .api import get_home_path

    arg_1 = unipath(get_home_path(), arg_1)

    if is_environment(arg_1):
        return VirtualEnvironment(arg_1)

    raise ResolveError


def Func ( arg_0 , arg_1 , arg_2 ) : if isinstance ( arg_2 , QuantumRegister ) : arg_2 = arg_2 [ : ] else : arg_2 = _convert_to_bits ( [ arg_2 ] , [ qbit for qreg in arg_0 . qregs for qbit in qreg ] ) [ 0 ] return arg_0 . append ( Initialize ( arg_1 ) , arg_2 )

def Func(arg_0, arg_1, arg_2):
    """Apply Func to circuit."""
    if isinstance(arg_2, QuantumRegister):
        arg_2 = arg_2[:]
    else:
        arg_2 = _convert_to_bits([arg_2], [qbit for qreg in arg_0.qregs for qbit in qreg])[0]
    return arg_0.append(Initialize(arg_1), arg_2)


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = ACCOUNTS_API . format ( arg_1 ) + "/courses" arg_4 = { "course" : { "name" : arg_2 } } return CanvasCourse ( data = arg_0 . _post_resource ( arg_3 , arg_4 ) )

def Func(arg_0, arg_1, arg_2):
        """
        Create a canvas course with the given subaccount id and course name.

        https://canvas.instructure.com/doc/api/courses.html#method.courses.create
        """
        arg_3 = ACCOUNTS_API.format(arg_1) + "/courses"
        arg_4 = {"course": {"name": arg_2}}
        return CanvasCourse(data=arg_0._post_resource(arg_3, arg_4))

Create a canvas course with the given subaccount id and course name .


def Func ( arg_0 , ** arg_1 ) : arg_2 = arg_1 . pop ( '_soft' , False ) try : arg_3 = arg_0 . render_context [ WIDGET_CONTEXT_KEY ] except KeyError : arg_3 = arg_0 . render_context [ WIDGET_CONTEXT_KEY ] = { } for arg_4 , arg_5 in arg_1 . items ( ) : if arg_2 and arg_4 in arg_3 : continue with arg_0 . render_context . push ( { BLOCK_CONTEXT_KEY : BlockContext ( ) } ) : arg_6 = resolve_blocks ( arg_5 , arg_0 ) arg_3 [ arg_4 ] = arg_6 return ''

def Func(arg_0, **arg_1):
    '''
    Load a series of widget libraries.
    '''
    arg_2 = arg_1.pop('_soft', False)

    try:
        arg_3 = arg_0.render_context[WIDGET_CONTEXT_KEY]
    except KeyError:
        arg_3 = arg_0.render_context[WIDGET_CONTEXT_KEY] = {}

    for arg_4, arg_5 in arg_1.items():
        if arg_2 and arg_4 in arg_3:
            continue

        with arg_0.render_context.push({BLOCK_CONTEXT_KEY: BlockContext()}):
            arg_6 = resolve_blocks(arg_5, arg_0)
            arg_3[arg_4] = arg_6

    return ''


def Func(arg_0, arg_1):
        """
        Returns participation data for the given sis_course_id.

        https://canvas.instructure.com/doc/api/analytics.html#method.analytics_api.course_participation
        """
        arg_2 = "/api/v1/courses/%s/analytics/activity.json" % (
            arg_0._sis_id(arg_1, sis_field="course"))
        return arg_0._get_resource(arg_2)

Returns participation data for the given sis_course_id .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 [ 'parent_breadth_path' ] [ - 1 ] if ( arg_0 [ 'sib_seq' ] == 0 ) : if ( arg_2 == 0 ) : pass else : arg_3 = arg_2 - 1 arg_4 = arg_1 [ arg_3 ] if ( arg_4 [ 'leaf' ] ) : pass else : arg_5 = copy . deepcopy ( arg_4 [ 'path' ] ) arg_5 . append ( arg_4 [ 'sons_count' ] - 1 ) arg_0 [ 'lcin_path' ] = arg_5 else : pass return ( arg_0 )

def Func(arg_0,arg_1):
    '''
        leftCousin
        previousCousin
        leftCin
        prevCin
        lcin
        pcin

        parents are neighbors,and on the left
    '''
    arg_2 = arg_0['parent_breadth_path'][-1]
    if(arg_0['sib_seq']==0):
        if(arg_2==0):
            pass
        else:
            arg_3 = arg_2 - 1
            arg_4 = arg_1[arg_3]
            if(arg_4['leaf']):
                pass
            else:
                arg_5 = copy.deepcopy(arg_4['path'])
                arg_5.append(arg_4['sons_count'] - 1)
                arg_0['lcin_path'] = arg_5
    else:
        pass
    return(arg_0)

leftCousin previousCousin leftCin prevCin lcin pcin parents are neighbors and on the left


(atlas_filepath, anatbrain_filepath, meanfunc_filepath,
                            atlas2anat_nonlin_xfm_filepath, is_atlas2anat_inverted,
                            anat2func_lin_xfm_filepath,
                            atlasinanat_out_filepath, atlasinfunc_out_filepath,
                            interp='nn', rewrite=True, parallel=False)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
,
arg_5
,
arg_6
,
arg_7
,
arg_8
=
'nn'
,
arg_9
=
True
,
arg_10
=
False
)
:
if
arg_4
:
arg_11
=
arg_3
else
:
arg_12
=
op
.
abspath
(
op
.
dirname
(
arg_6
)
)
arg_13
=
get_extension
(
arg_3
)
arg_11
=
op
.
join
(
arg_12
,
remove_ext
(
op
.
basename
(
arg_3
)
)
+
'_inv'
+
arg_13
)
arg_14
=
op
.
join
(
'${FSLDIR}'
,
'bin'
,
'invwarp'
)
arg_15
=
op
.
join
(
'${FSLDIR}'
,
'bin'
,
'applywarp'
)
arg_16
=
op
.
join
(
'${FSLDIR}'
,
'bin'
,
'fsl_sub'
)
if
arg_10
:
arg_14
=
arg_16
+
' '
+
arg_14
arg_15
=
arg_16
+
' '
+
arg_15
if
arg_9
or
(
not
arg_4
and
not
op
.
exists
(
arg_11
)
)
:
log
.
debug
(
'Creating {}.\n'
.
format
(
arg_11
)
)
arg_17
=
arg_14
+
' '
arg_17
+=
'-w {} '
.
format
(
arg_3
)
arg_17
+=
'-o {} '
.
format
(
arg_11
)
arg_17
+=
'-r {} '
.
format
(
arg_1
)
log
.
debug
(
'Running {}'
.
format
(
arg_17
)
)
check_call
(
arg_17
)
if
arg_9
or
not
op
.
exists
(
arg_6
)
:
log
.
debug
(
'Creating {}.\n'
.
format
(
arg_6
)
)
arg_17
=
arg_15
+
' '
arg_17
+=
'--in={}     '
.
format
(
arg_0
)
arg_17
+=
'--ref={}    '
.
format
(
arg_1
)
arg_17
+=
'--warp={}   '
.
format
(
arg_11
)
arg_17
+=
'--interp={} '
.
format
(
arg_8
)
arg_17
+=
'--out={}    '
.
format
(
arg_6
)
log
.
debug
(
'Running {}'
.
format
(
arg_17
)
)
check_call
(
arg_17
)
if
arg_9
or
not
op
.
exists
(
arg_7
)
:
log
.
debug
(
'Creating {}.\n'
.
format
(
arg_7
)
)
arg_17
=
arg_15
+
' '
arg_17
+=
'--in={}     '
.
format
(
arg_6
)
arg_17
+=
'--ref={}    '
.
format
(
arg_2
)
arg_17
+=
'--premat={} '
.
format
(
arg_5
)
arg_17
+=
'--interp={} '
.
format
(
arg_8
)
arg_17
+=
'--out={}    '
.
format
(
arg_7
)
log
.
debug
(
'Running {}'
.
format
(
arg_17
)
)
check_call
(
arg_17
)

def Func(arg_0, arg_1, arg_2,
                            arg_3, arg_4,
                            arg_5,
                            arg_6, arg_7,
                            arg_8='nn', arg_9=True, arg_10=False):
    """Call FSL tools to apply transformations to a given atlas to a functional image.
    Given the transformation matrices.

    Parameters
    ----------
    atlas_filepath: str
        Path to the 3D atlas volume file.

    anatbrain_filepath: str
        Path to the anatomical brain volume file (skull-stripped and registered to the same space as the atlas,
        e.g., MNI).

    meanfunc_filepath: str
        Path to the average functional image to be used as reference in the last applywarp step.

    atlas2anat_nonlin_xfm_filepath: str
        Path to the atlas to anatomical brain linear transformation .mat file.
        If you have the inverse transformation, i.e., anatomical brain to atlas, set is_atlas2anat_inverted to True.

    is_atlas2anat_inverted: bool
        If False will have to calculate the inverse atlas2anat transformation to apply the transformations.
        This step will be performed with FSL invwarp.

    anat2func_lin_xfm_filepath: str
        Path to the anatomical to functional .mat linear transformation file.

    atlasinanat_out_filepath: str
        Path to output file which will contain the 3D atlas in the subject anatomical space.

    atlasinfunc_out_filepath: str
        Path to output file which will contain the 3D atlas in the subject functional space.

    verbose: bool
        If verbose will show DEBUG log info.

    rewrite: bool
        If True will re-run all the commands overwriting any existing file. Otherwise will check if
        each file exists and if it does won't run the command.

    parallel: bool
        If True will launch the commands using ${FSLDIR}/fsl_sub to use the cluster infrastructure you have setup
        with FSL (SGE or HTCondor).
    """
    if arg_4:
        # I already have the inverted fields I need
        arg_11 = arg_3
    else:
        # I am creating the inverted fields then...need output file path:
        arg_12         = op.abspath   (op.dirname(arg_6))
        arg_13                = get_extension(arg_3)
        arg_11 = op.join(arg_12, remove_ext(op.basename(arg_3)) + '_inv' + arg_13)

    # setup the commands to be called
    arg_14   = op.join('${FSLDIR}', 'bin', 'invwarp')
    arg_15 = op.join('${FSLDIR}', 'bin', 'applywarp')
    arg_16    = op.join('${FSLDIR}', 'bin', 'fsl_sub')

    # add fsl_sub before the commands
    if arg_10:
        arg_14   = arg_16 + ' ' + arg_14
        arg_15 = arg_16 + ' ' + arg_15

    # create the inverse fields
    if arg_9 or (not arg_4 and not op.exists(arg_11)):
        log.debug('Creating {}.\n'.format(arg_11))
        arg_17  = arg_14 + ' '
        arg_17 += '-w {} '.format(arg_3)
        arg_17 += '-o {} '.format(arg_11)
        arg_17 += '-r {} '.format(arg_1)
        log.debug('Running {}'.format(arg_17))
        check_call(arg_17)

    # transform the atlas to anatomical space
    if arg_9 or not op.exists(arg_6):
        log.debug('Creating {}.\n'.format(arg_6))
        arg_17  = arg_15 + ' '
        arg_17 += '--in={}     '.format(arg_0)
        arg_17 += '--ref={}    '.format(arg_1)
        arg_17 += '--warp={}   '.format(arg_11)
        arg_17 += '--interp={} '.format(arg_8)
        arg_17 += '--out={}    '.format(arg_6)
        log.debug('Running {}'.format(arg_17))
        check_call(arg_17)

    # transform the atlas to functional space
    if arg_9 or not op.exists(arg_7):
        log.debug('Creating {}.\n'.format(arg_7))
        arg_17  = arg_15 + ' '
        arg_17 += '--in={}     '.format(arg_6)
        arg_17 += '--ref={}    '.format(arg_2)
        arg_17 += '--premat={} '.format(arg_5)
        arg_17 += '--interp={} '.format(arg_8)
        arg_17 += '--out={}    '.format(arg_7)
        log.debug('Running {}'.format(arg_17))
        check_call(arg_17)

Call FSL tools to apply transformations to a given atlas to a functional image . Given the transformation matrices .


def
Func
(
arg_0
,
arg_1
,
*
arg_2
,
**
arg_3
)
:
if
not
arg_1
.
session
:
_logger
.
debug
(
'Creating new db session'
)
arg_1
.
_init_db_session
(
)
try
:
arg_4
=
arg_0
(
arg_1
,
*
arg_2
,
**
arg_3
)
arg_1
.
session
.
commit
(
)
except
:
arg_1
.
session
.
rollback
(
)
arg_5
=
traceback
.
format_exc
(
)
_logger
.
debug
(
arg_5
)
raise
finally
:
_logger
.
debug
(
'Closing db session'
)
arg_1
.
session
.
close
(
)
return
arg_4

def Func(arg_0, arg_1, *arg_2, **arg_3):
    """ Use as a decorator for operations on the database, to ensure connection setup and
    teardown. Can only be used on methods on objects with a `self.session` attribute.
    """
    if not arg_1.session:
        _logger.debug('Creating new db session')
        arg_1._init_db_session()
    try:
        arg_4 = arg_0(arg_1, *arg_2, **arg_3)
        arg_1.session.commit()
    except:
        arg_1.session.rollback()
        arg_5 = traceback.format_exc()
        _logger.debug(arg_5)
        raise
    finally:
        _logger.debug('Closing db session')
        arg_1.session.close()
    return arg_4

Use as a decorator for operations on the database to ensure connection setup and teardown . Can only be used on methods on objects with a self . session attribute .


def Func(arg_0, arg_1):
        """Create link from request for a receiver."""
        arg_2 = ReceiverLink(arg_0._connection, arg_1)
        arg_0._links.add(arg_2)
        return arg_2

Create link from request for a receiver .


def Func(arg_0, arg_1, arg_2=None, arg_3=None):
        """Perform an HTTP GET, using the saved requests.Session and auth info.
        If "Accept" isn't one of the given headers, a default TAXII mime type is
        used.  Regardless, the response type is checked against the accept
        header value, and an exception is raised if they don't match.

        Args:
            url (str): URL to retrieve
            headers (dict): Any other headers to be added to the request.
            params: dictionary or bytes to be sent in the query string for the
                request. (optional)

        """

        arg_4 = arg_0._merge_headers(arg_2)

        if "Accept" not in arg_4:
            arg_4["Accept"] = MEDIA_TYPE_TAXII_V20
        arg_5 = arg_4["Accept"]

        arg_6 = arg_0.session.Func(arg_1, arg_2=arg_4, arg_3=arg_3)

        arg_6.raise_for_status()

        arg_7 = arg_6.headers["Content-Type"]

        if not arg_0.valid_content_type(arg_7=arg_7, arg_5=arg_5):
            arg_8 = "Unexpected Response. Got Content-Type: '{}' for Accept: '{}'"
            raise TAXIIServiceException(arg_8.format(arg_7, arg_5))

        return _to_json(arg_6)

Perform an HTTP GET using the saved requests . Session and auth info . If Accept isn t one of the given headers a default TAXII mime type is used . Regardless the response type is checked against the accept header value and an exception is raised if they don t match .


def Func ( arg_0 ) : arg_1 = [ k for k in arg_0 . __dict__ . keys ( ) if k not in SPECIAL ] return arg_1

def Func(arg_0):
        """
        Lists the Func in the lexicon, except the
        optional Func.

        Returns:
            list: A list of strings of category names.
        """
        arg_1 = [k for k in arg_0.__dict__.keys() if k not in SPECIAL]
        return arg_1

Lists the categories in the lexicon, except the
        optional categories.

        Returns:
            list: A list of strings of category names.

Lists the categories in the lexicon except the optional categories .


def
Func
(
arg_0
)
:
arg_1
=
"select {fields} from pg_settings"
.
format
(
fields
=
', '
.
join
(
SETTINGS_FIELDS
)
)
Func
=
[
]
for
arg_3
in
arg_0
.
_iter_results
(
arg_1
)
:
arg_3
[
'setting'
]
=
arg_0
.
_vartype_map
[
arg_3
[
'vartype'
]
]
(
arg_3
[
'setting'
]
)
Func
.
append
(
Settings
(
**
arg_3
)
)
return
Func

def Func(arg_0):
        """Returns settings from the server."""
        arg_1 = "select {fields} from pg_settings".format(fields=', '.join(SETTINGS_FIELDS))
        Func = []
        for arg_3 in arg_0._iter_results(arg_1):
            arg_3['setting'] = arg_0._vartype_map[arg_3['vartype']](arg_3['setting'])
            Func.append(Settings(**arg_3))
        return Func


def Func ( arg_0 , arg_1 ) : _reset ( arg_0 ) time . sleep ( leadInOutDelay ) for arg_2 in arg_1 : _sendBit ( arg_0 , arg_2 ) time . sleep ( leadInOutDelay )

def Func(arg_0, arg_1):
    """Send a string of binary data to the FireCracker with proper timing.

    See the diagram in the spec referenced above for timing information.
    The module level variables leadInOutDelay and bitDelay represent how
    long each type of delay should be in seconds. They may require tweaking
    on some setups.
    """
    _reset(arg_0)
    time.sleep(leadInOutDelay)
    for arg_2 in arg_1:
        _sendBit(arg_0, arg_2)
    time.sleep(leadInOutDelay)

Send a string of binary data to the FireCracker with proper timing .


def
Func
(
arg_0
,
arg_1
=
)
:
arg_2
=
os
.
path
.
expanduser
(
'~/.lsi'
)
if
not
os
.
path
.
exists
(
arg_2
)
:
return
LsiProfile
(
)
arg_3
=
ConfigParser
(
)
arg_3
.
read
(
arg_2
)
if
arg_1
is
:
if
arg_3
.
has_section
(
'default'
)
:
arg_1
=
'default'
else
:
return
arg_0
(
)
elif
not
arg_3
.
has_section
(
arg_1
)
:
raise
arg_0
.
LoadError
(
'No such profile {}'
.
format
(
arg_1
)
)
def
_get
(
arg_4
,
arg_5
=
)
:
if
arg_3
.
has_option
(
arg_1
,
arg_4
)
:
return
arg_3
.
get
(
arg_1
,
arg_4
)
else
:
return
arg_5
if
arg_3
.
has_option
(
arg_1
,
'inherit'
)
:
arg_6
=
arg_0
.
Func
(
arg_3
.
get
(
arg_1
,
'inherit'
)
)
else
:
arg_6
=
arg_0
(
)
arg_6
.
override
(
'username'
,
_get
(
'username'
)
)
arg_6
.
override
(
'identity_file'
,
_get
(
'identity file'
)
)
arg_6
.
override
(
'command'
,
_get
(
'command'
)
)
arg_7
=
[
s
for
s
in
_get
(
'filters'
,
''
)
.
split
(
','
)
if
len
(
s
)
>
0
]
arg_8
=
[
s
for
s
in
_get
(
'exclude'
,
''
)
.
split
(
','
)
if
len
(
s
)
>
0
]
arg_6
.
filters
.
extend
(
arg_7
)
arg_6
.
exclude
.
extend
(
arg_8
)
return
arg_6

def Func(arg_0, arg_1=None):
        """Loads the user's LSI profile, or provides a default."""
        arg_2 = os.path.expanduser('~/.lsi')
        if not os.path.exists(arg_2):
            return LsiProfile()
        arg_3 = ConfigParser()
        arg_3.read(arg_2)
        if arg_1 is None:
            # Load the default profile if one exists; otherwise return empty.
            if arg_3.has_section('default'):
                arg_1 = 'default'
            else:
                return arg_0()
        elif not arg_3.has_section(arg_1):
            raise arg_0.LoadError('No such profile {}'.format(arg_1))
        def _get(arg_4, arg_5=None):
            """Gets an option if it exists; else returns `alt`."""
            if arg_3.has_option(arg_1, arg_4):
                return arg_3.get(arg_1, arg_4)
            else:
                return arg_5
        if arg_3.has_option(arg_1, 'inherit'):
            arg_6 = arg_0.Func(arg_3.get(arg_1, 'inherit'))
        else:
            arg_6 = arg_0()
        arg_6.override('username', _get('username'))
        arg_6.override('identity_file', _get('identity file'))
        arg_6.override('command', _get('command'))
        arg_7 = [s for s in _get('filters', '').split(',') if len(s) > 0]
        arg_8 = [s for s in _get('exclude', '').split(',') if len(s) > 0]
        arg_6.filters.extend(arg_7)
        arg_6.exclude.extend(arg_8)
        return arg_6

Loads the user s LSI profile or provides a default .


def Func ( arg_0 ) : return datetime . strptime ( arg_0 , timeFormat ) . replace ( tzinfo = timezone . utc )

def Func(arg_0):
    """Take a string representation of time from the blockchain, and parse it
       into datetime object.
    """
    return datetime.strptime(arg_0, timeFormat).replace(tzinfo=timezone.utc)

Take a string representation of time from the blockchain and parse it into datetime object .


def
Func
(
arg_0
,
arg_1
)
:
if
not
hasattr
(
arg_1
,
'__iter__'
)
:
arg_1
=
[
arg_1
]
if
len
(
arg_1
)
==
0
:
return
arg_1
=
[
arg_3
for
arg_3
in
arg_1
if
arg_3
.
id
not
in
arg_0
.
metabolites
]
arg_2
=
[
m
for
m
in
arg_1
if
not
isinstance
(
m
.
id
,
string_types
)
or
len
(
m
.
id
)
<
1
]
if
len
(
arg_2
)
!=
0
:
raise
ValueError
(
'invalid identifiers in {}'
.
format
(
repr
(
arg_2
)
)
)
for
arg_3
in
arg_1
:
arg_3
.
_model
=
arg_0
arg_0
.
metabolites
+=
arg_1
arg_5
=
[
]
for
arg_6
in
arg_1
:
if
arg_6
.
id
not
in
arg_0
.
constraints
:
arg_7
=
arg_0
.
problem
.
Constraint
(
Zero
,
name
=
arg_6
.
id
,
lb
=
0
,
ub
=
0
)
arg_5
+=
[
arg_7
]
arg_0
.
add_cons_vars
(
arg_5
)
arg_8
=
get_context
(
arg_0
)
if
arg_8
:
arg_8
(
partial
(
arg_0
.
metabolites
.
__isub__
,
arg_1
)
)
for
arg_3
in
arg_1
:
arg_8
(
partial
(
setattr
,
arg_3
,
'_model'
,
)
)

def Func(arg_0, arg_1):
        """Will add a list of metabolites to the model object and add new
        constraints accordingly.

        The change is reverted upon exit when using the model as a context.

        Parameters
        ----------
        metabolite_list : A list of `cobra.core.Metabolite` objects

        """
        if not hasattr(arg_1, '__iter__'):
            arg_1 = [arg_1]
        if len(arg_1) == 0:
            return None

        # First check whether the metabolites exist in the model
        arg_1 = [arg_3 for arg_3 in arg_1
                           if arg_3.id not in arg_0.metabolites]

        arg_2 = [m for m in arg_1
                   if not isinstance(m.id, string_types) or len(m.id) < 1]
        if len(arg_2) != 0:
            raise ValueError('invalid identifiers in {}'.format(repr(arg_2)))

        for arg_3 in arg_1:
            arg_3._model = arg_0
        arg_0.metabolites += arg_1

        # from cameo ...
        arg_5 = []
        for arg_6 in arg_1:
            if arg_6.id not in arg_0.constraints:
                arg_7 = arg_0.problem.Constraint(
                    Zero, name=arg_6.id, lb=0, ub=0)
                arg_5 += [arg_7]

        arg_0.add_cons_vars(arg_5)

        arg_8 = get_context(arg_0)
        if arg_8:
            arg_8(partial(arg_0.metabolites.__isub__, arg_1))
            for arg_3 in arg_1:
                # Do we care?
                arg_8(partial(setattr, arg_3, '_model', None))

Will add a list of metabolites to the model object and add new constraints accordingly .


def Func(arg_0, arg_1=0.1, arg_2=-80):
    """Log-normalizes features such that each vector is between min_db to 0."""
    assert arg_2 < 0
    arg_0 = min_max_normalize(arg_0, arg_1=arg_1)
    arg_0 = np.abs(arg_2) * np.log10(arg_0)  # Normalize from min_db to 0
    return arg_0

Log - normalizes features such that each vector is between min_db to 0 .


(
        peptides,
        max_peptides_per_file=None,
        group_by_length=False)

def Func ( arg_0 , arg_1 = None , arg_2 = False ) : if arg_2 : arg_3 = { len ( arg_5 ) for arg_5 in arg_0 } arg_4 = { l : [ ] for l in arg_3 } for arg_5 in arg_0 : arg_4 [ len ( arg_5 ) ] . append ( arg_5 ) else : arg_4 = { "" : arg_0 } arg_6 = [ ] for arg_7 , arg_8 in arg_4 . items ( ) : arg_9 = len ( arg_8 ) if not arg_1 : arg_1 = arg_9 arg_10 = None for arg_11 , arg_5 in enumerate ( arg_8 ) : if arg_11 % arg_1 == 0 : if arg_10 is not None : arg_6 . append ( arg_10 . name ) arg_10 . close ( ) arg_10 = make_writable_tempfile ( prefix_number = arg_11 // arg_1 , prefix_name = arg_7 , suffix = ".txt" ) arg_10 . write ( "%s\n" % arg_5 ) if arg_10 is not None : arg_6 . append ( arg_10 . name ) arg_10 . close ( ) return arg_6

def Func(
        arg_0,
        arg_1=None,
        arg_2=False):
    """
    Creates one or more files containing one peptide per line,
    returns names of files.
    """
    if arg_2:
        arg_3 = {len(arg_5) for arg_5 in arg_0}
        arg_4 = {l: [] for l in arg_3}
        for arg_5 in arg_0:
            arg_4[len(arg_5)].append(arg_5)
    else:
        arg_4 = {"": arg_0}

    arg_6 = []
    for arg_7, arg_8 in arg_4.items():
        arg_9 = len(arg_8)
        if not arg_1:
            arg_1 = arg_9
        arg_10 = None
        for arg_11, arg_5 in enumerate(arg_8):
            if arg_11 % arg_1 == 0:
                if arg_10 is not None:
                    arg_6.append(arg_10.name)
                    arg_10.close()
                arg_10 = make_writable_tempfile(
                    prefix_number=arg_11 // arg_1,
                    prefix_name=arg_7,
                    suffix=".txt")
            arg_10.write("%s\n" % arg_5)
        if arg_10 is not None:
            arg_6.append(arg_10.name)
            arg_10.close()
    return arg_6

Creates one or more files containing one peptide per line returns names of files .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . open_file ( arg_1 . module_path ) if arg_2 : TextHelper ( arg_2 ) . goto_line ( arg_1 . line , arg_1 . column )

def Func(arg_0, arg_1):
        """
        Open the a new tab when goto goes out of the current document.

        :param assignment: Destination
        """
        arg_2 = arg_0.open_file(arg_1.module_path)
        if arg_2:
            TextHelper(arg_2).goto_line(arg_1.line, arg_1.column)

Open the a new tab when goto goes out of the current document .


def
Func
(
arg_0
)
:
arg_1
=
[
]
arg_2
=
False
arg_3
=
0
arg_2
=
(
" "
in
arg_0
)
or
(
"\t"
in
arg_0
)
if
arg_2
:
arg_1
.
append
(
'"'
)
for
arg_4
in
arg_0
:
if
arg_4
==
'\\'
:
arg_3
+=
1
elif
arg_4
==
'"'
:
arg_1
.
append
(
'\\'
*
(
arg_3
*
2
)
+
'\\"'
)
arg_3
=
0
else
:
if
arg_3
:
arg_1
.
append
(
'\\'
*
arg_3
)
arg_3
=
0
arg_1
.
append
(
arg_4
)
if
arg_3
:
arg_1
.
append
(
'\\'
*
arg_3
)
if
arg_2
:
arg_1
.
append
(
'\\'
*
arg_3
)
arg_1
.
append
(
'"'
)
return
''
.
join
(
arg_1
)

def Func(arg_0):
    """Quote a command line argument according to Windows parsing rules"""

    arg_1 = []
    arg_2 = False
    arg_3 = 0

    arg_2 = (" " in arg_0) or ("\t" in arg_0)
    if arg_2:
        arg_1.append('"')

    for arg_4 in arg_0:
        if arg_4 == '\\':
            arg_3 += 1
        elif arg_4 == '"':
            # double preceding backslashes, then add a \"
            arg_1.append('\\' * (arg_3*2) + '\\"')
            arg_3 = 0
        else:
            if arg_3:
                arg_1.append('\\' * arg_3)
                arg_3 = 0
            arg_1.append(arg_4)

    if arg_3:
        arg_1.append('\\' * arg_3)

    if arg_2:
        arg_1.append('\\' * arg_3)    # double the trailing backslashes
        arg_1.append('"')

    return ''.join(arg_1)


def Func(arg_0, arg_1, arg_2, arg_3):
        """Builds the neuron groups.

        Build is only performed if neuron group was not
        pre-Func before.

        :param traj: Trajectory container

        :param brian_list:

            List of objects passed to BRIAN network constructor.

            Adds:

            Inhibitory neuron group

            Excitatory neuron group

        :param network_dict:

            Dictionary of elements shared among the components

            Adds:

            'neurons_i': Inhibitory neuron group

            'neurons_e': Excitatory neuron group

        """
        if not hasattr(arg_0, '_pre_Func') or not arg_0._pre_Func:
            arg_0._Func_model(arg_1, arg_2, arg_3)

Builds the neuron groups.

        Build is only performed if neuron group was not
        pre-build before.

        :param traj: Trajectory container

        :param brian_list:

            List of objects passed to BRIAN network constructor.

            Adds:

            Inhibitory neuron group

            Excitatory neuron group

        :param network_dict:

            Dictionary of elements shared among the components

            Adds:

            'neurons_i': Inhibitory neuron group

            'neurons_e': Excitatory neuron group