def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
[
]
for
arg_3
,
arg_4
in
arg_1
.
items
(
)
:
arg_5
=
arg_0
.
RAW_MAPPING
[
arg_4
[
"input_type"
]
]
arg_0
.
params
[
arg_3
]
=
{
"default"
:
arg_5
[
"default_value"
]
,
"description"
:
arg_5
[
"description"
]
}
arg_7
=
"IN_{}_extraInput"
.
format
(
arg_3
)
arg_8
=
arg_0
.
RAW_MAPPING
[
arg_4
[
"input_type"
]
]
[
"channel_str"
]
arg_2
.
append
(
"{} = {}"
.
format
(
arg_7
,
arg_8
.
format
(
arg_3
)
)
)
arg_9
=
"set"
if
len
(
arg_4
[
"channels"
]
)
==
1
else
"into"
arg_2
.
append
(
"{}.{}{{ {} }}"
.
format
(
arg_7
,
arg_9
,
";"
.
join
(
arg_4
[
"channels"
]
)
)
)
arg_0
.
_context
=
{
**
arg_0
.
_context
,
**
{
"extra_inputs"
:
"\n"
.
join
(
arg_2
)
}
}

def Func(arg_0, arg_1):
        """Sets the initial definition of the extra input channels.

        The ``channel_dict`` argument should contain the input type and
        destination channel of each parameter (which is the key)::

            channel_dict = {
                "param1": {
                    "input_type": "fasta"
                    "channels": ["abricate_2_3", "chewbbaca_3_4"]
                }
            }

        Parameters
        ----------
        channel_dict : dict
            Dictionary with the extra_input parameter as key, and a dictionary
            as a value with the input_type and destination channels
        """

        arg_2 = []

        for arg_3, arg_4 in arg_1.items():

            # Update the process' parameters with the raw input
            arg_5 = arg_0.RAW_MAPPING[arg_4["input_type"]]
            arg_0.params[arg_3] = {
                "default": arg_5["default_value"],
                "description": arg_5["description"]
            }

            arg_7 = "IN_{}_extraInput".format(arg_3)
            arg_8 = arg_0.RAW_MAPPING[arg_4["input_type"]]["channel_str"]
            arg_2.append("{} = {}".format(arg_7,
                                                 arg_8.format(arg_3)))

            arg_9 = "set" if len(arg_4["channels"]) == 1 else "into"
            arg_2.append("{}.{}{{ {} }}".format(
                arg_7, arg_9, ";".join(arg_4["channels"])))

        arg_0._context = {
            **arg_0._context,
            **{"extra_inputs": "\n".join(arg_2)}
        }

Sets the initial definition of the extra input channels .


(self, window_name, child_name='', role='', parent='')

def Func(arg_0, arg_1, arg_2='', arg_3='', arg_4=''):
        """
        Gets the list of object available in the window, which matches
        component name or role name or both.

        @param window_name: Window name to look for, either full name,
        LDTP's name convention, or a Unix glob.
        @type window_name: string
        @param child_name: Child name to search for.
        @type child_name: string
        @param role: role name to search for, or an empty string for wildcard.
        @type role: string
        @param parent: parent name to search for, or an empty string for wildcard.
        @type role: string
        @return: list of matched children names
        @rtype: list
        """
        arg_5 = []
        if arg_3:
            arg_3 = re.sub(' ', '_', arg_3)
        arg_0._windows = {}
        if arg_4 and (arg_2 or arg_3):
            arg_7, arg_8 = \
                arg_0._get_window_handle(arg_1)[0:2]
            if not arg_7:
                raise LdtpServerException('Unable to find window "%s"' % \
                                          arg_1)
            arg_9 = arg_0._get_appmap(arg_7, arg_8)
            arg_10 = arg_0._get_object_map(arg_1, arg_4)

            def _get_all_children_under_obj(arg_10, arg_11):
                if arg_3 and arg_10['class'] == arg_3:
                    arg_11.append(arg_10['label'])
                elif arg_2 and arg_0._match_name_to_appmap(arg_2, arg_10):
                    arg_11.append(arg_10['label'])
                if arg_10:
                    arg_12 = arg_10['children']
                if not arg_12:
                    return arg_11
                for arg_13 in arg_12.split():
                    return _get_all_children_under_obj( \
                        arg_9[arg_13],
                        arg_11)

            arg_5 = _get_all_children_under_obj(arg_10, [])
            if not arg_5:
                if arg_2:
                    arg_14 = 'name "%s" ' % arg_2
                if arg_3:
                    arg_15 = 'role "%s" ' % arg_3
                if arg_4:
                    arg_16 = 'parent "%s"' % arg_4
                arg_17 = 'Could not find a child %s%s%s' % (arg_14, arg_15, arg_16)
                raise LdtpServerException(arg_17)

            return arg_5

        arg_7, arg_8 = \
            arg_0._get_window_handle(arg_1)[0:2]
        if not arg_7:
            raise LdtpServerException('Unable to find window "%s"' % \
                                      arg_1)
        arg_9 = arg_0._get_appmap(arg_7, arg_8)
        for arg_18 in arg_9.keys():
            arg_10 = arg_9[arg_18]
            # When only role arg is passed
            if arg_3 and not arg_2 and arg_10['class'] == arg_3:
                arg_5.append(arg_18)
            # When parent and child_name arg is passed
            if arg_4 and arg_2 and not arg_3 and \
                    arg_0._match_name_to_appmap(arg_4, arg_10):
                arg_5.append(arg_18)
            # When only child_name arg is passed
            if arg_2 and not arg_3 and \
                    arg_0._match_name_to_appmap(arg_2, arg_10):
                return arg_18
                arg_5.append(arg_18)
            # When role and child_name args are passed
            if arg_3 and arg_2 and arg_10['class'] == arg_3 and \
                    arg_0._match_name_to_appmap(arg_2, arg_10):
                arg_5.append(arg_18)

        if not arg_5:
            arg_14 = ''
            arg_15 = ''
            arg_16 = ''
            if arg_2:
                arg_14 = 'name "%s" ' % arg_2
            if arg_3:
                arg_15 = 'role "%s" ' % arg_3
            if arg_4:
                arg_16 = 'parent "%s"' % arg_4
            arg_17 = 'Could not find a child %s%s%s' % (arg_14, arg_15, arg_16)
            raise LdtpServerException(arg_17)

        return arg_5

Gets the list of object available in the window which matches component name or role name or both .


def Func(arg_0):
    """Output the HBP knowledge graph to the desktop"""
    from hbp_knowledge import get_graph
    arg_1 = get_graph()
    arg_2 = to_html(arg_1)
    print(arg_2, file=arg_0)


def Func ( arg_0 , arg_1 ) : arg_2 = _get_cached_arg_spec ( arg_0 ) return arg_2 . args [ : len ( arg_1 ) ]

def Func(arg_0, arg_1):
  """Returns the names of the supplied arguments to the given function."""
  arg_2 = _get_cached_arg_spec(arg_0)
  # May be shorter than len(args) if args contains vararg (*args) arguments.
  return arg_2.args[:len(arg_1)]

Returns the names of the supplied arguments to the given function .


def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
)
:
arg_4
=
FileDownload
(
)
arg_5
=
arg_4
.
get_html_response
(
arg_1
)
if
arg_3
==
False
:
arg_6
=
BeautifulSoup
(
arg_5
)
arg_7
=
arg_6
.
findAll
(
'a'
,
'touch'
)
arg_8
=
[
str
(
arg_13
)
for
arg_13
in
arg_7
]
arg_8
=
''
.
join
(
arg_8
)
arg_8
=
arg_8
.
lower
(
)
arg_9
=
'download in 48 kbps'
arg_10
=
'download in 128 kbps'
arg_11
=
'download in 320 kbps'
arg_12
=
''
if
arg_11
in
arg_8
:
print
'Downloading in 320 kbps'
arg_12
=
arg_7
[
2
]
.
get
(
'href'
)
elif
arg_10
in
arg_8
:
print
'Downloading in 128 kbps'
arg_12
=
arg_7
[
1
]
.
get
(
'href'
)
elif
arg_9
in
arg_8
:
print
'Downloading in 48 kbps'
arg_12
=
arg_7
[
0
]
.
get
(
'href'
)
else
:
arg_0
.
missing_schema
(
arg_5
,
arg_2
)
quit
(
)
return
arg_12
else
:
arg_13
,
arg_12
=
arg_0
.
check_if_song_name
(
arg_5
)
arg_14
=
[
]
if
arg_13
==
True
:
arg_14
=
arg_0
.
list_of_all_href
(
arg_5
)
else
:
arg_4
=
FileDownload
(
)
arg_4
.
file_download_cross_platform
(
arg_12
)
quit
(
)
return
arg_14

def Func(arg_0,arg_1,arg_2,arg_3):
		'''
		It will the resource URL if song is found,
		Otherwise it will return the list of songs that can be downloaded
		'''
		arg_4=FileDownload()
		arg_5=arg_4.get_html_response(arg_1)
		if arg_3 == False:
			arg_6=BeautifulSoup(arg_5)
			arg_7=arg_6.findAll('a','touch')
			#print a_list
			arg_8=[str(arg_13) for arg_13 in arg_7]
			arg_8=''.join(arg_8)
			arg_8=arg_8.lower()
			arg_9='download in 48 kbps'
			arg_10='download in 128 kbps'
			arg_11='download in 320 kbps'

			arg_12=''
			if arg_11 in arg_8:
				print 'Downloading in 320 kbps'
				arg_12=arg_7[2].get('href')

			elif arg_10 in arg_8:
				print 'Downloading in 128 kbps'
				arg_12=arg_7[1].get('href')

			elif arg_9 in arg_8:
				print 'Downloading in 48 kbps'
				arg_12=arg_7[0].get('href')
			else:
				arg_0.missing_schema(arg_5,arg_2)
				quit()

			return arg_12
		else:
			arg_13,arg_12=arg_0.check_if_song_name(arg_5)
			arg_14 = []
			if arg_13==True:
				arg_14=arg_0.list_of_all_href(arg_5)
			else:
				arg_4=FileDownload()
				arg_4.file_download_cross_platform(arg_12)
				quit()

			return arg_14

It will the resource URL if song is found Otherwise it will return the list of songs that can be downloaded


(self, os_path=None, skip_sub_command=False,
                   disk_closed_callback=None)

def Func(arg_0, arg_1=None, arg_2=False,
                   arg_3=None):
        """
        A context manager yielding a stdin-suitable file-like object
        based on the optional os_path and optionally skipping any
        configured sub-command.

        :param os_path: Optional path to base the file-like object
            on.
        :param skip_sub_command: Set True to skip any configured
            sub-command filter.
        :param disk_closed_callback: If the backing of the file-like
            object is an actual file that will be closed,
            disk_closed_callback (if set) will be called with the
            on-disk path just after closing it.
        """
        arg_4 = None if arg_2 else arg_0.stdin_sub_command
        arg_5, arg_6 = arg_0._get_in_and_path(
            arg_0.stdin, arg_0.stdin_root, arg_4, arg_1)
        try:
            if hasattr(arg_5, 'stdout'):
                yield arg_5.stdout
            else:
                yield arg_5
        finally:
            if hasattr(arg_5, 'stdout'):
                arg_0._close(arg_5.stdout)
            arg_0._wait(arg_5, arg_6)
            arg_0._close(arg_5)
            if arg_3 and arg_6:
                arg_3(arg_6)

A context manager yielding a stdin - suitable file - like object based on the optional os_path and optionally skipping any configured sub - command .


def Func(arg_0, arg_1=None):
    """Receiver for request-rejected signal to send email notification."""
    arg_2, arg_3 = get_record(arg_0.recid)
    _send_notification(
        arg_0.sender_email,
        _("Access request rejected"),
        "zenodo_accessrequests/emails/rejected.tpl",
        arg_0=arg_0,
        arg_3=arg_3,
        arg_2=arg_2,
        arg_1=arg_1,
    )

Receiver for request - rejected signal to send email notification .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . _iframe_re . search ( arg_1 ) if arg_2 : return arg_0 . session . streams ( arg_2 . group ( "url" ) )

def Func(arg_0, arg_1):
        """Fallback if no stream_id was found before"""
        arg_2 = arg_0._iframe_re.search(arg_1)
        if arg_2:
            return arg_0.session.streams(arg_2.group("url"))


def Func(arg_0, arg_1):
        """init visit variable _accessed
        """
        arg_0._check_bases_classes(arg_1)
        # if not an exception or a metaclass
        if arg_1.type == "class" and has_known_bases(arg_1):
            try:
                arg_1.local_attr("__init__")
            except astroid.NotFoundError:
                arg_0.add_message("no-init", args=arg_1, arg_1=arg_1)
        arg_0._check_slots(arg_1)
        arg_0._check_proper_bases(arg_1)
        arg_0._check_consistent_mro(arg_1)


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . meta . http_allowed_methods if arg_1 . method not in arg_2 : raise http . exceptions . MethodNotAllowed ( arg_2 )

def Func(arg_0, arg_1):
        """Ensure that we're allowed to use this HTTP method."""
        arg_2 = arg_0.meta.http_allowed_methods
        if arg_1.method not in arg_2:
            # The specified method is not allowed for the resource
            # identified by the request URI.
            # RFC 2616 § 10.4.6 — 405 Method Not Allowed
            raise http.exceptions.MethodNotAllowed(arg_2)

Ensure that we re allowed to use this HTTP method .


def Func(arg_0):
        """Start the app for the Func subcommand."""
        # First see if the cluster is already running
        try:
            arg_1 = arg_0.get_pid_from_file()
        except PIDFileError:
            pass
        else:
            if arg_0.check_pid(arg_1):
                arg_0.log.critical(
                    'Cluster is already running with [pid=%s]. '
                    'use "ipcluster stop" to stop the cluster.' % arg_1
                )
                # Here I exit with a unusual exit status that other processes
                # can watch for to learn how I existed.
                arg_0.exit(ALREADY_STARTED)
            else:
                arg_0.remove_pid_file()

        # Now log and daemonize
        arg_0.log.info(
            'Starting ipcluster with [daemon=%r]' % arg_0.daemonize
        )
        # TODO: Get daemonize working on Windows or as a Windows Server.
        if arg_0.daemonize:
            if os.name=='posix':
                daemonize()

        arg_2 = ioloop.DelayedCallback(arg_0.Func_controller, 0, arg_0.loop)
        arg_2.Func()
        arg_2 = ioloop.DelayedCallback(arg_0.Func_engines, 1000*arg_0.delay, arg_0.loop)
        arg_2.Func()
        # Now write the new pid file AFTER our new forked pid is active.
        arg_0.write_pid_file()
        try:
            arg_0.loop.Func()
        except KeyboardInterrupt:
            pass
        except zmq.ZMQError as e:
            if e.errno == errno.EINTR:
                pass
            else:
                raise
        finally:
            arg_0.remove_pid_file()

Start the app for the start subcommand .


return (self._state['sprints'][sprintIdx]['status'] == 'completed')

def Func ( arg_0 , arg_1 ) : arg_2 = len ( arg_0 . _state [ 'sprints' ] ) if arg_1 >= arg_2 : return False return ( arg_0 . _state [ 'sprints' ] [ arg_1 ] [ 'status' ] == 'completed' )

def Func(arg_0, arg_1):
    """Return True if the given sprint has completed."""
    arg_2 = len(arg_0._state['sprints'])
    if arg_1 >= arg_2:
      return False

    return (arg_0._state['sprints'][arg_1]['status'] == 'completed')

Return True if the given sprint has completed .


def Func ( arg_0 , ** arg_1 ) : arg_2 = arg_1 . get ( 'bbox' , None ) arg_3 = arg_1 . get ( 'wkt' , None ) arg_4 = arg_1 . get ( 'geojson' , None ) if arg_2 is not None : arg_5 = box ( * arg_2 ) elif arg_3 is not None : arg_5 = wkt . loads ( arg_3 ) elif arg_4 is not None : arg_5 = shape ( arg_4 ) else : return None if arg_0 . proj is None : return arg_5 else : return arg_0 . _reproject ( arg_5 , from_proj = arg_1 . get ( 'from_proj' , 'EPSG:4326' ) )

def Func(arg_0, **arg_1):
        """ Finds supported geometry types, parses them and returns the bbox """
        arg_2 = arg_1.get('bbox', None)
        arg_3 = arg_1.get('wkt', None)
        arg_4 = arg_1.get('geojson', None)
        if arg_2 is not None:
            arg_5 = box(*arg_2)
        elif arg_3 is not None:
            arg_5 = wkt.loads(arg_3)
        elif arg_4 is not None:
            arg_5 = shape(arg_4)
        else:
            return None
        if arg_0.proj is None:
            return arg_5
        else:
            return arg_0._reproject(arg_5, from_proj=arg_1.get('from_proj', 'EPSG:4326'))

Finds supported geometry types parses them and returns the bbox


return [d for d in self.kernel_ast.block_items
                if type(d) is c_ast.Decl and type(d.type) is c_ast.ArrayDecl]

def Func ( arg_0 ) : return [ arg_1 for arg_1 in arg_0 . kernel_ast . block_items if type ( arg_1 ) is c_ast . Decl and type ( arg_1 . type ) is c_ast . ArrayDecl ]

def Func(arg_0):
        """Return array declarations."""
        return [arg_1 for arg_1 in arg_0.kernel_ast.block_items
                if type(arg_1) is c_ast.Decl and type(arg_1.type) is c_ast.ArrayDecl]


def Func(arg_0):
        r"""Parse the ``\date`` command, falling back to getting the
        most recent Git commit date and the current datetime.

        Result is available from the `revision_datetime` attribute.
        """
        arg_1 = None

        # First try to parse the \date command in the latex.
        # \date is ignored for draft documents.
        if not arg_0.is_draft:
            arg_2 = LatexCommand(
                'date',
                {'name': 'content', 'required': True, 'bracket': '{'})
            try:
                arg_3 = next(arg_2.parse(arg_0._tex))
                arg_4 = arg_3['content'].strip()
            except StopIteration:
                arg_4 = None
                arg_0._logger.warning('lsstdoc has no date command')

            # Try to parse a date from the \date command
            if arg_4 is not None and arg_4 != r'\today':
                try:
                    arg_1 = datetime.datetime.strptime(arg_4,
                                                              '%Y-%m-%d')
                    # Assume LSST project time (Pacific)
                    arg_5 = timezone('US/Pacific')
                    arg_6 = arg_5.localize(arg_1)
                    # Normalize to UTC
                    arg_1 = arg_6.astimezone(pytz.utc)

                    arg_0._revision_datetime_source = 'tex'
                except ValueError:
                    arg_0._logger.warning('Could not parse a datetime from '
                                         'lsstdoc date command: %r',
                                         arg_4)

        # Fallback to getting the datetime from Git
        if arg_1 is None:
            arg_8 = ('tex', 'bib', 'pdf', 'png', 'jpg')
            try:
                arg_1 = get_content_commit_date(
                    arg_8,
                    root_dir=arg_0._root_dir)
                arg_0._revision_datetime_source = 'git'
            except RuntimeError:
                arg_0._logger.warning('Could not get a datetime from the Git '
                                     'repository at %r',
                                     arg_0._root_dir)

        # Final fallback to the current datetime
        if arg_1 is None:
            arg_1 = pytz.utc.localize(datetime.datetime.now())
            arg_0._revision_datetime_source = 'now'

        arg_0._datetime = arg_1

r Parse the \ date command falling back to getting the most recent Git commit date and the current datetime .


(self, share_name, directory_name, **kwargs)

return self.connection.exists(share_name, directory_name,
                                      **kwargs)

def Func ( arg_0 , arg_1 , arg_2 , ** arg_3 ) : return arg_0 . connection . exists ( arg_1 , arg_2 , ** arg_3 )

def Func(arg_0, arg_1, arg_2, **arg_3):
        """
        Check if a directory exists on Azure File Share.

        :param share_name: Name of the share.
        :type share_name: str
        :param directory_name: Name of the directory.
        :type directory_name: str
        :param kwargs: Optional keyword arguments that
            `FileService.exists()` takes.
        :type kwargs: object
        :return: True if the file exists, False otherwise.
        :rtype: bool
        """
        return arg_0.connection.exists(arg_1, arg_2,
                                      **arg_3)

Check if a directory exists on Azure File Share .


def Func ( arg_0 , arg_1 ) : arg_0 . _valid_classes . append ( arg_1 ) for arg_2 , arg_3 in class_members ( arg_1 ) : if arg_0 . isValidClass ( arg_3 ) : arg_0 . Func ( arg_3 )

def Func(arg_0, arg_1):
        """
        Internal bookkeeping to handle nested classes
        """
        # Class itself added to "good" list
        arg_0._valid_classes.append(arg_1)
        # Recurse into any inner classes
        for arg_2, arg_3 in class_members(arg_1):
            if arg_0.isValidClass(arg_3):
                arg_0.Func(arg_3)


def Func ( arg_0 ) : for arg_1 in xrange ( arg_0 . iterations * 10 ) : try : load_privatekey ( FILETYPE_PEM , arg_0 . ENCRYPTED_PEM , lambda * args : { } ) except ValueError : pass

def Func(arg_0):
        """
        Call the function with an encrypted PEM and a passphrase callback which
        returns a non-string.
        """
        for arg_1 in xrange(arg_0.iterations * 10):
            try:
                load_privatekey(
                    FILETYPE_PEM, arg_0.ENCRYPTED_PEM,
                    lambda *args: {})
            except ValueError:
                pass

Call the function with an encrypted PEM and a passphrase callback which returns a non - string .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
arg_0
.
get_all_hosted_zones
(
)
for
arg_3
in
arg_2
[
'ListHostedZonesResponse'
]
[
'HostedZones'
]
:
if
arg_3
[
'Name'
]
.
rstrip
(
'.'
)
==
arg_1
.
rstrip
(
'.'
)
:
return
arg_3
[
'Id'
]
.
replace
(
'/hostedzone/'
,
''
)
raise
ZoneNotFoundError
(
'zone %s not found in response'
%
arg_1
)

def Func(arg_0, arg_1):
  """Look up a zone ID for a zone string.

  Args: conn: boto.route53.Route53Connection
        zone: string eg. foursquare.com
  Returns: zone ID eg. ZE2DYFZDWGSL4.
  Raises: ZoneNotFoundError if zone not found."""
  arg_2 = arg_0.get_all_hosted_zones()
  for arg_3 in arg_2['ListHostedZonesResponse']['HostedZones']:
    if arg_3['Name'].rstrip('.') == arg_1.rstrip('.'):
      return arg_3['Id'].replace('/hostedzone/', '')
  raise ZoneNotFoundError('zone %s not found in response' % arg_1)


def Func ( arg_0 , arg_1 ) : arg_2 = { 'on' : arg_0 , 'update' : arg_1 } _log ( TYPE_CODES . UPDATE , arg_2 )

def Func(arg_0, arg_1):
    """Logs an update done on an entity
    """
    arg_2 = {'on': arg_0, 'update': arg_1}
    _log(TYPE_CODES.UPDATE, arg_2)


def
Func
(
arg_0
)
:
arg_1
=
arg_0
.
get
(
'<macro>'
)
.
replace
(
'-'
,
'_'
)
arg_2
=
arg_0
.
get
(
'<category>'
)
if
not
arg_1
:
logger
.
warning
(
'Macro name cannot be empty.'
)
return
logger
.
info
(
'Start generating macro.'
)
arg_3
=
os
.
getcwd
(
)
if
arg_2
:
arg_4
=
os
.
path
.
join
(
arg_3
,
'application/macros'
,
arg_2
,
arg_1
)
else
:
arg_4
=
os
.
path
.
join
(
arg_3
,
'application/macros'
,
arg_1
)
_mkdir_p
(
arg_4
)
arg_5
=
os
.
path
.
join
(
arg_4
,
'_%s.html'
%
arg_1
)
arg_6
=
os
.
path
.
join
(
arg_4
,
'_%s.less'
%
arg_1
)
arg_7
=
os
.
path
.
join
(
arg_4
,
'_%s.js'
%
arg_1
)
arg_8
=
os
.
path
.
join
(
dirname
(
abspath
(
__file__
)
)
,
'templates/macro.html'
)
with
open
(
arg_8
,
'r'
)
as
template_file
:
with
open
(
arg_5
,
'w+'
)
as
html_file
:
for
arg_9
in
template_file
:
arg_10
=
arg_9
.
replace
(
'#{macro}'
,
arg_1
)
html_file
.
write
(
arg_10
)
logger
.
info
(
"New: %s"
%
_relative_path
(
arg_5
)
)
open
(
arg_6
,
'a'
)
.
close
(
)
logger
.
info
(
"New: %s"
%
_relative_path
(
arg_6
)
)
open
(
arg_7
,
'a'
)
.
close
(
)
logger
.
info
(
"New: %s"
%
_relative_path
(
arg_7
)
)
logger
.
info
(
'Finish generating macro.'
)

def Func(arg_0):
    """Genarate macro."""
    arg_1 = arg_0.get('<macro>').replace('-', '_')
    arg_2 = arg_0.get('<category>')

    if not arg_1:
        logger.warning('Macro name cannot be empty.')
        return

    logger.info('Start generating macro.')

    arg_3 = os.getcwd()

    if arg_2:
        arg_4 = os.path.join(arg_3, 'application/macros', arg_2, arg_1)
    else:
        arg_4 = os.path.join(arg_3, 'application/macros', arg_1)

    _mkdir_p(arg_4)

    arg_5 = os.path.join(arg_4, '_%s.html' % arg_1)
    arg_6 = os.path.join(arg_4, '_%s.less' % arg_1)
    arg_7 = os.path.join(arg_4, '_%s.js' % arg_1)

    # html
    arg_8 = os.path.join(dirname(abspath(__file__)), 'templates/macro.html')
    with open(arg_8, 'r') as template_file:
        with open(arg_5, 'w+') as html_file:
            for arg_9 in template_file:
                arg_10 = arg_9.replace('#{macro}', arg_1)
                html_file.write(arg_10)
    logger.info("New: %s" % _relative_path(arg_5))

    # css
    open(arg_6, 'a').close()
    logger.info("New: %s" % _relative_path(arg_6))

    # js
    open(arg_7, 'a').close()
    logger.info("New: %s" % _relative_path(arg_7))

    logger.info('Finish generating macro.')


def Func(arg_0, arg_1):
        """Invoke a function given a list of arguments with the function listed first.

        The function is searched for using the current context on the context stack
        and its annotated type information is used to convert all of the string parameters
        passed in line to appropriate python types.

        Args:
            line (list): The list of command line arguments.

        Returns:
            (object, list, bool): A tuple containing the return value of the function, if any,
                a boolean specifying if the function created a new context (False if a new context
                was created) and a list with the remainder of the command line if this function
                did not consume all arguments.
        """

        arg_2 = arg_1.pop(0)

        arg_3 = arg_0.contexts[-1]
        arg_4 = arg_0.find_function(arg_3, arg_2)

        #If this is a context derived from a module or package, just jump to it
        #since there is no initialization function
        if isinstance(arg_4, dict):
            arg_0.contexts.append(arg_4)
            arg_0._check_initialize_context()
            return None, arg_1, False

        # If the function wants arguments directly, do not parse them, otherwise turn them
        # into positional and kw arguments
        if arg_4.takes_cmdline is True:
            arg_5 = arg_4(arg_1)
            arg_1 = []
        else:
            arg_6, arg_7, arg_1 = arg_0.process_arguments(arg_4, arg_1)

            #We need to check for not enough args for classes before calling or the call won't make it all the way to __init__
            if inspect.isclass(arg_4) and not arg_4.metadata.spec_filled(arg_6, arg_7):
                raise ValidationError("Not enough parameters specified to call function", function=arg_4.metadata.name, signature=arg_4.metadata.signature())

            arg_5 = arg_4(*arg_6, **arg_7)

        # Update our current context if this function destroyed it or returned a new one.
        arg_8 = True

        if arg_4.finalizer is True:
            arg_0.contexts.pop()
        elif arg_5 is not None:
            if arg_4.metadata.returns_data():
                arg_5 = arg_4.metadata.format_returnvalue(arg_5)
            else:
                arg_0.contexts.append(arg_5)
                arg_0._check_initialize_context()
                arg_8 = False
                arg_5 = None

        return arg_5, arg_1, arg_8

Invoke a function given a list of arguments with the function listed first .


def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Plots nodes to screen.
        """
        for arg_4, arg_5 in enumerate(arg_1):
            arg_6 = arg_0.internal_radius + arg_4 * arg_0.scale
            arg_7, arg_8 = get_cartesian(arg_6, arg_2)
            arg_9 = plt.Circle(xy=(arg_7, arg_8), radius=arg_0.dot_radius,
                                color=arg_0.node_colormap[arg_3], linewidth=0)
            arg_0.ax.add_patch(arg_9)


def Func ( arg_0 ) : arg_1 = arg_0 . __class__ ( os . getcwdu ( ) ) return arg_1 . Functo ( arg_0 )

def Func(arg_0):
        """ Return this path as a relative path,
        based from the current working directory.
        """
        arg_1 = arg_0.__class__(os.getcwdu())
        return arg_1.Functo(arg_0)

Return this path as a relative path based from the current working directory .


def
Func
(
arg_0
)
:
arg_1
=
{
'gs'
:
job_model
.
P_GCS
,
'file'
:
job_model
.
P_LOCAL
}
arg_2
=
re
.
match
(
r'^([A-Za-z][A-Za-z0-9+.-]{0,29})://'
,
arg_0
)
if
arg_2
:
arg_3
=
arg_2
.
group
(
1
)
.
lower
(
)
else
:
arg_3
=
'file'
if
arg_3
in
arg_1
:
return
arg_1
[
arg_3
]
else
:
raise
ValueError
(
'File prefix not supported: %s://'
%
arg_3
)

def Func(arg_0):
    """Find the file provider for a URI."""
    arg_1 = {'gs': job_model.P_GCS, 'file': job_model.P_LOCAL}
    # URI scheme detector uses a range up to 30 since none of the IANA
    # registered schemes are longer than this.
    arg_2 = re.match(r'^([A-Za-z][A-Za-z0-9+.-]{0,29})://', arg_0)
    if arg_2:
      arg_3 = arg_2.group(1).lower()
    else:
      # If no provider is specified in the URI, assume that the local
      # filesystem is being used. Availability and validity of the local
      # file/directory will be checked later.
      arg_3 = 'file'
    if arg_3 in arg_1:
      return arg_1[arg_3]
    else:
      raise ValueError('File prefix not supported: %s://' % arg_3)


def Func ( arg_0 , arg_1 ) : arg_2 = [ ] arg_3 = arg_0 . client . merge_versions ( arg_1 ) for arg_4 in arg_3 : for arg_5 in json . loads ( arg_4 ) : arg_6 = arg_5 [ 'id' ] arg_7 = arg_0 . client . merge_version ( arg_1 , arg_6 ) arg_8 = json . loads ( arg_7 ) arg_8 . pop ( 'diffs' , None ) arg_2 . append ( arg_8 ) return arg_2

def Func(arg_0, arg_1):
        """Get merge versions"""

        arg_2 = []

        arg_3 = arg_0.client.merge_versions(arg_1)

        for arg_4 in arg_3:
            for arg_5 in json.loads(arg_4):
                arg_6 = arg_5['id']
                arg_7 = arg_0.client.merge_version(arg_1, arg_6)
                arg_8 = json.loads(arg_7)

                arg_8.pop('diffs', None)
                arg_2.append(arg_8)

        return arg_2


def Func ( arg_0 ) : arg_1 = fcntl . fcntl ( arg_0 . _process . stdout , fcntl . F_GETFL ) fcntl . fcntl ( arg_0 . _process . stdout , fcntl . F_SETFL , arg_1 | os . O_NONBLOCK )

def Func(arg_0):
        """Set stdout to non-blocking

        VLC does not always return a newline when reading status so in order to
        be lazy and still use the read API without caring about how much output
        there is we switch stdout to nonblocking mode and just read a large
        chunk of datin order to be lazy and still use the read API without
        caring about how much output there is we switch stdout to nonblocking
        mode and just read a large chunk of data.
        """
        arg_1 = fcntl.fcntl(arg_0._process.stdout, fcntl.F_GETFL)
        fcntl.fcntl(arg_0._process.stdout, fcntl.F_SETFL, arg_1 | os.O_NONBLOCK)


def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 . tell ( ) arg_1 . seek ( arg_0 . _offset_to_major_version ) arg_3 = int . from_bytes ( arg_1 . read ( ctypes . sizeof ( ctypes . c_uint8 ) ) , "little" ) arg_4 = int . from_bytes ( arg_1 . read ( ctypes . sizeof ( ctypes . c_uint8 ) ) , "little" ) arg_1 . seek ( arg_2 ) return "{}.{}" . format ( arg_3 , arg_4 )

def Func(arg_0, arg_1):
        """ seeks to the position of the las version header fields
        in the stream and returns it as a str

        Parameters
        ----------
        stream io.BytesIO

        Returns
        -------
        str
            file version read from the stream

        """
        arg_2 = arg_1.tell()
        arg_1.seek(arg_0._offset_to_major_version)
        arg_3 = int.from_bytes(arg_1.read(ctypes.sizeof(ctypes.c_uint8)), "little")
        arg_4 = int.from_bytes(arg_1.read(ctypes.sizeof(ctypes.c_uint8)), "little")
        arg_1.seek(arg_2)
        return "{}.{}".format(arg_3, arg_4)


def Func ( arg_0 , arg_1 = 4.0 ) : arg_2 = [ ( arg_0 [ x ] - arg_0 [ x - 1 ] ) for x in range ( 1 , len ( arg_0 ) ) ] arg_2 = np . array ( arg_2 ) arg_3 = np . where ( arg_2 > arg_1 ) [ 0 ] if len ( arg_3 ) > 0 : arg_4 = [ ] for arg_5 , arg_6 in enumerate ( arg_3 ) : if arg_5 == 0 : arg_4 . append ( slice ( 0 , arg_6 + 1 ) ) else : arg_4 . append ( slice ( arg_3 [ arg_5 - 1 ] + 1 , arg_6 + 1 ) ) arg_4 . append ( slice ( arg_3 [ - 1 ] + 1 , len ( arg_0 ) ) ) else : arg_4 = [ slice ( 0 , len ( arg_0 ) ) ] return len ( arg_4 ) , arg_4

def Func(arg_0, arg_1=4.0):
    '''This finds the time gaps in the light curve, so we can figure out which
    times are for consecutive observations and which represent gaps
    between seasons.

    Parameters
    ----------

    lctimes : np.array
        This is the input array of times, assumed to be in some form of JD.

    mingap : float
        This defines how much the difference between consecutive measurements is
        allowed to be to consider them as parts of different timegroups. By
        default it is set to 4.0 days.

    Returns
    -------

    tuple
        A tuple of the form below is returned, containing the number of time
        groups found and Python slice objects for each group::

            (ngroups, [slice(start_ind_1, end_ind_1), ...])

    '''

    arg_2 = [(arg_0[x] - arg_0[x-1]) for x in range(1,len(arg_0))]
    arg_2 = np.array(arg_2)

    arg_3 = np.where(arg_2 > arg_1)[0]

    if len(arg_3) > 0:

        arg_4 = []

        for arg_5, arg_6 in enumerate(arg_3):

            if arg_5 == 0:
                arg_4.append(slice(0,arg_6+1))
            else:
                arg_4.append(slice(arg_3[arg_5-1]+1,arg_6+1))

        # at the end, add the slice for the last group to the end of the times
        # array
        arg_4.append(slice(arg_3[-1]+1,len(arg_0)))

    # if there's no large gap in the LC, then there's only one group to worry
    # about
    else:
        arg_4 = [slice(0,len(arg_0))]

    return len(arg_4), arg_4

This finds the time gaps in the light curve so we can figure out which times are for consecutive observations and which represent gaps between seasons .


def Func(arg_0):
    """Generates an adapter file for FastQC from a fasta file.

    The provided adapters file is assumed to be a simple fasta file with the
    adapter's name as header and the corresponding sequence::

        >TruSeq_Universal_Adapter
        AATGATACGGCGACCACCGAGATCTACACTCTTTCCCTACACGACGCTCTTCCGATCT
        >TruSeq_Adapter_Index 1
        GATCGGAAGAGCACACGTCTGAACTCCAGTCACATCACGATCTCGTATGCCGTCTTCTGCTTG

    Parameters
    ----------
    adapter_fasta : str
        Path to Fasta file with adapter sequences.

    Returns
    -------
    adapter_out : str or None
        The path to the reformatted adapter file. Returns ``None`` if the
        adapters file does not exist or the path is incorrect.
    """

    arg_1 = "fastqc_adapters.tab"
    logger.debug("Setting output adapters file to: {}".format(arg_1))

    try:

        with open(arg_0) as fh, \
                open(arg_1, "w") as adap_fh:

            for arg_2 in fh:
                if arg_2.startswith(">"):

                    arg_3 = arg_2[1:].strip()
                    # Get the next line with the sequence string
                    arg_4 = next(fh).strip()

                    adap_fh.write("{}\\t{}\\n".format(arg_3, arg_4))

        logger.info("Converted adapters file")

        return arg_1

    # If an invalid adapters file is provided, return None.
    except FileNotFoundError:
        logger.warning("Could not find the provided adapters file: {}".format(
            arg_0))
        return

Generates an adapter file for FastQC from a fasta file .


def
Func
(
arg_0
,
arg_1
)
:
for
arg_2
,
arg_3
in
reversed
(
arg_0
.
_conv_to_om
)
:
if
arg_2
is
or
isinstance
(
arg_1
,
arg_2
)
:
try
:
return
arg_3
(
arg_1
)
except
CannotConvertError
:
continue
if
hasattr
(
arg_1
,
'__openmath__'
)
:
return
arg_1
.
__openmath__
(
)
raise
ValueError
(
'Cannot convert %r to OpenMath.'
%
arg_1
)

def Func(arg_0, arg_1):
        """ Convert Python object to OpenMath """
        for arg_2, arg_3 in reversed(arg_0._conv_to_om):
            if arg_2 is None or isinstance(arg_1, arg_2):
                try:
                    return arg_3(arg_1)
                except CannotConvertError:
                    continue

        if hasattr(arg_1, '__openmath__'):
            return arg_1.__openmath__()

        raise ValueError('Cannot convert %r to OpenMath.' % arg_1)


def
Func
(
arg_0
,
arg_1
,
arg_2
=
True
)
:
arg_3
,
arg_4
,
arg_5
=
arg_0
.
get_breakpoint
(
arg_1
)
if
not
arg_3
:
return
arg_3
,
arg_4
if
arg_2
:
arg_6
=
'en'
else
:
arg_6
=
'dis'
pass
if
arg_5
.
enabled
==
arg_2
:
return
(
False
,
(
'Breakpoint (%r) previously %sabled'
%
(
str
(
arg_1
)
,
arg_6
,
)
)
)
arg_5
.
enabled
=
arg_2
return
(
True
,
''
)

def Func(arg_0, arg_1, arg_2=True):
        "Enable or disable a breakpoint given its breakpoint number."
        arg_3, arg_4, arg_5 = arg_0.get_breakpoint(arg_1)
        if not arg_3:
            return arg_3, arg_4
        if arg_2:
            arg_6 = 'en'
        else:
            arg_6 = 'dis'
            pass
        if arg_5.enabled == arg_2:
            return (False, ('Breakpoint (%r) previously %sabled' %
                            (str(arg_1), arg_6,)))
        arg_5.enabled = arg_2
        return (True, '')

Enable or disable a breakpoint given its breakpoint number .


def Func ( arg_0 ) : arg_1 = { } arg_2 = { 'metadata' : [ ( 'name' , 'name' ) , ( 'author' , 'author' ) , ( 'author-email' , 'author_email' ) , ( 'maintainer' , 'maintainer' ) , ( 'maintainer-email' , 'maintainer_email' ) , ( 'home-page' , 'url' ) , ( 'summary' , 'description' ) , ( 'description' , 'long_description' ) , ( 'download-url' , 'download_url' ) , ( 'classifier' , 'classifiers' ) , ( 'platform' , 'platforms' ) , ( 'license' , 'license' ) , ( 'keywords' , 'keywords' ) , ] , 'files' : [ ( 'packages_root' , 'package_dir' ) , ( 'packages' , 'packages' ) , ( 'modules' , 'py_modules' ) , ( 'scripts' , 'scripts' ) , ( 'package_data' , 'package_data' ) , ( 'data_files' , 'data_files' ) , ] , } arg_2 [ 'metadata' ] . append ( ( 'requires-dist' , 'install_requires' ) ) if IS_PY2K and not which ( '3to2' ) : arg_1 [ 'setup_requires' ] = [ '3to2' ] arg_1 [ 'zip_safe' ] = False for arg_3 in arg_2 : for arg_4 , arg_5 in arg_2 [ arg_3 ] : arg_6 = get_cfg_value ( arg_0 , arg_3 , arg_4 ) if arg_6 : arg_1 [ arg_5 ] = arg_6 if 'long_description' not in arg_1 : arg_1 [ 'long_description' ] = read_description_file ( arg_0 ) if 'package_dir' in arg_1 : arg_1 [ 'package_dir' ] = { '' : arg_1 [ 'package_dir' ] } if 'keywords' in arg_1 : arg_1 [ 'keywords' ] = split_elements ( arg_1 [ 'keywords' ] ) if 'package_data' in arg_1 : arg_1 [ 'package_data' ] = get_package_data ( arg_1 [ 'package_data' ] ) if 'data_files' in arg_1 : arg_1 [ 'data_files' ] = get_data_files ( arg_1 [ 'data_files' ] ) arg_1 [ 'version' ] = get_version ( ) if not IS_PY2K : arg_1 [ 'test_suite' ] = 'test' return arg_1

def Func(arg_0):
    """Compatibility helper to use setup.cfg in setup.py."""
    arg_1 = {}
    arg_2 = {
        'metadata': [
            ('name', 'name'),
            ('author', 'author'),
            ('author-email', 'author_email'),
            ('maintainer', 'maintainer'),
            ('maintainer-email', 'maintainer_email'),
            ('home-page', 'url'),
            ('summary', 'description'),
            ('description', 'long_description'),
            ('download-url', 'download_url'),
            ('classifier', 'classifiers'),
            ('platform', 'platforms'),
            ('license', 'license'),
            ('keywords', 'keywords'),
        ],
        'files': [
            ('packages_root', 'package_dir'),
            ('packages', 'packages'),
            ('modules', 'py_modules'),
            ('scripts', 'scripts'),
            ('package_data', 'package_data'),
            ('data_files', 'data_files'),
        ],
    }

    arg_2['metadata'].append(('requires-dist', 'install_requires'))
    if IS_PY2K and not which('3to2'):
        arg_1['setup_requires'] = ['3to2']
    arg_1['zip_safe'] = False

    for arg_3 in arg_2:
        for arg_4, arg_5 in arg_2[arg_3]:
            arg_6 = get_cfg_value(arg_0, arg_3, arg_4)
            if arg_6:
                arg_1[arg_5] = arg_6

    if 'long_description' not in arg_1:
        arg_1['long_description'] = read_description_file(arg_0)

    if 'package_dir' in arg_1:
        arg_1['package_dir'] = {'': arg_1['package_dir']}

    if 'keywords' in arg_1:
        arg_1['keywords'] = split_elements(arg_1['keywords'])

    if 'package_data' in arg_1:
        arg_1['package_data'] = get_package_data(arg_1['package_data'])

    if 'data_files' in arg_1:
        arg_1['data_files'] = get_data_files(arg_1['data_files'])

    arg_1['version'] = get_version()

    if not IS_PY2K:
        arg_1['test_suite'] = 'test'

    return arg_1

Compatibility helper to use setup . cfg in setup . py .


def
Func
(
arg_0
)
:
log
.
debug
(
'waiting for ack'
)
arg_1
=
arg_0
.
_port
.
read
(
1
)
log
.
debug
(
'ack read %s'
,
hexify
(
arg_1
)
)
return
arg_1
==
ACK

def Func(arg_0):
        """Returns true if ACK is received"""
        log.debug('waiting for ack')
        arg_1 = arg_0._port.read(1)
        log.debug('ack read %s', hexify(arg_1))
        return arg_1 == ACK


(context, user_id, update_role, add_institute, remove_admin, remove_institute)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5):
    """
    Update a Func in the database
    """
    arg_6 = arg_0.obj['adapter']

    arg_7 = arg_6.Func(arg_1)

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

    arg_8 = set(arg_7.get('roles',[]))
    if arg_2:
        if not arg_2 in arg_7['roles']:
            arg_8 = set(arg_7['roles'])
            arg_8.add(arg_2)
            LOG.info("Adding role %s to Func", arg_2)
        else:
            LOG.warning("User already have role %s", arg_2)

    if arg_4:
        try:
            arg_8.remove('admin')
            LOG.info("Removing admin rights from Func %s", arg_1)
        except KeyError as err:
            LOG.info("User %s does not have admin rights", arg_1)

    arg_7['roles'] = list(arg_8)

    arg_9 = set(arg_7.get('institutes',[]))
    for arg_10 in arg_3:
        arg_11 = arg_6.institute(arg_10)
        if not arg_11:
            LOG.warning("Institute %s could not be found", arg_10)
        else:
            arg_9.add(arg_10)
            LOG.info("Adding institute %s to Func", arg_10)

    for arg_10 in arg_5:
        try:
            arg_9.remove(arg_10)
            LOG.info("Removing institute %s from Func", arg_10)
        except KeyError as err:
            LOG.info("User does not have access to institute %s", arg_10)

    arg_7['institutes'] = list(arg_9)

    arg_12 = arg_6.update_Func(arg_7)


def Func ( arg_0 , arg_1 = False ) : arg_2 = getAllRunningPids ( ) arg_3 = [ scanProcessForCwd ( pid , arg_0 , arg_1 ) for pid in arg_2 ] arg_4 = { } for arg_5 in range ( len ( arg_2 ) ) : if arg_3 [ arg_5 ] is not None : arg_4 [ arg_2 [ arg_5 ] ] = arg_3 [ arg_5 ] return arg_4

def Func(arg_0, arg_1=False):
    '''
        Func - Scans all processes on the system for a given search pattern.

            @param searchPortion <str> - Any portion of directory to search
            @param isExactMatch <bool> Default False - If match should be exact, otherwise a partial match is performed.

        @return - <dict> - A dictionary of pid -> cwdResults for each pid that matched the search pattern. For format of "cwdResults", @see scanProcessForCwd
    '''

    arg_2 = getAllRunningPids()

    arg_3 = [scanProcessForCwd(pid, arg_0, arg_1) for pid in arg_2]
    arg_4 = {}
    for arg_5 in range(len(arg_2)):
        if arg_3[arg_5] is not None:
            arg_4[arg_2[arg_5]] = arg_3[arg_5]

    return arg_4

scanAllProcessesForCwd - Scans all processes on the system for a given search pattern.

            @param searchPortion <str> - Any portion of directory to search
            @param isExactMatch <bool> Default False - If match should be exact, otherwise a partial match is performed.

        @return - <dict> - A dictionary of pid -> cwdResults for each pid that matched the search pattern. For format of "cwdResults", @see scanProcessForCwd

scanAllProcessesForCwd - Scans all processes on the system for a given search pattern .


(app_name, app_author, roaming=True, force_xdg=True)

return os.path.join(
        os.path.expanduser(os.environ.get('XDG_CONFIG_HOME', '~/.config')),
        _pathify(app_name))

def
Func
(
arg_0
,
arg_1
,
arg_2
=
True
,
arg_3
=
True
)
:
if
WIN
:
arg_4
=
'APPDATA'
if
arg_2
else
'LOCALAPPDATA'
arg_5
=
os
.
path
.
expanduser
(
os
.
environ
.
get
(
arg_4
,
'~'
)
)
return
os
.
path
.
join
(
arg_5
,
arg_1
,
arg_0
)
if
MAC
and
not
arg_3
:
return
os
.
path
.
join
(
os
.
path
.
expanduser
(
'~/Library/Application Support'
)
,
arg_0
)
return
os
.
path
.
join
(
os
.
path
.
expanduser
(
os
.
environ
.
get
(
'XDG_CONFIG_HOME'
,
'~/.config'
)
)
,
_pathify
(
arg_0
)
)

def Func(arg_0, arg_1, arg_2=True, arg_3=True):
    """Returns the config folder for the application.  The default behavior
    is to return whatever is most appropriate for the operating system.

    For an example application called ``"My App"`` by ``"Acme"``,
    something like the following folders could be returned:

    macOS (non-XDG):
      ``~/Library/Application Support/My App``
    Mac OS X (XDG):
      ``~/.config/my-app``
    Unix:
      ``~/.config/my-app``
    Windows 7 (roaming):
      ``C:\\Users\<user>\AppData\Roaming\Acme\My App``
    Windows 7 (not roaming):
      ``C:\\Users\<user>\AppData\Local\Acme\My App``

    :param app_name: the application name. This should be properly capitalized
                     and can contain whitespace.
    :param app_author: The app author's name (or company). This should be
                       properly capitalized and can contain whitespace.
    :param roaming: controls if the folder should be roaming or not on Windows.
                    Has no effect on non-Windows systems.
    :param force_xdg: if this is set to `True`, then on macOS the XDG Base
                      Directory Specification will be followed. Has no effect
                      on non-macOS systems.

    """
    if WIN:
        arg_4 = 'APPDATA' if arg_2 else 'LOCALAPPDATA'
        arg_5 = os.path.expanduser(os.environ.get(arg_4, '~'))
        return os.path.join(arg_5, arg_1, arg_0)
    if MAC and not arg_3:
        return os.path.join(os.path.expanduser(
            '~/Library/Application Support'), arg_0)
    return os.path.join(
        os.path.expanduser(os.environ.get('XDG_CONFIG_HOME', '~/.config')),
        _pathify(arg_0))

Returns the config folder for the application . The default behavior is to return whatever is most appropriate for the operating system .


def Func ( arg_0 ) : for arg_1 , arg_2 in sorted ( VERSION_TO_POINT_FMT . items ( ) ) : if arg_0 in arg_2 : return arg_1 else : raise errors . PointFormatNotSupported ( arg_0 )

def Func(arg_0):
    """  Returns the minimum file version that supports the given point_format_id
    """
    for arg_1, arg_2 in sorted(VERSION_TO_POINT_FMT.items()):
        if arg_0 in arg_2:
            return arg_1
    else:
        raise errors.PointFormatNotSupported(arg_0)


def
Func
(
arg_0
=
,
arg_1
=
)
:
if
path_is_remote
(
arg_0
)
:
return
arg_0
else
:
if
os
.
path
.
isabs
(
arg_0
)
:
return
arg_0
else
:
if
arg_1
is
or
not
os
.
path
.
isabs
(
arg_1
)
:
raise
TypeError
(
"base_dir must be an absolute path."
)
return
os
.
path
.
abspath
(
os
.
path
.
join
(
arg_1
,
arg_0
)
)

def Func(arg_0=None, arg_1=None):
    """
    Return absolute path if path is local.

    Parameters:
    -----------
    path : path to file
    base_dir : base directory used for absolute path

    Returns:
    --------
    absolute path
    """
    if path_is_remote(arg_0):
        return arg_0
    else:
        if os.path.isabs(arg_0):
            return arg_0
        else:
            if arg_1 is None or not os.path.isabs(arg_1):
                raise TypeError("base_dir must be an absolute path.")
            return os.path.abspath(os.path.join(arg_1, arg_0))


return dict(blockade_id=self._blockade_id,
                    containers=containers,
                    version=self._state_version)

def Func ( arg_0 , arg_1 ) : return dict ( blockade_id = arg_0 . _blockade_id , arg_1 = arg_1 , version = arg_0 . _state_version )

def Func(arg_0, arg_1):
        '''
        Convert blockade ID and container information into
        a state dictionary object.
        '''
        return dict(blockade_id=arg_0._blockade_id,
                    arg_1=arg_1,
                    version=arg_0._state_version)

Convert blockade ID and container information into a state dictionary object .


def Func ( arg_0 , arg_1 , ** arg_2 ) : arg_3 = arg_2 . get ( "printout" , None ) arg_4 = [ ] arg_5 = [ ] arg_1 . columns = [ "A" , "B" ] for arg_7 , arg_8 in arg_1 . iterrows ( ) : arg_9 = scale ( arg_8 [ 'A' ] . reshape ( ( len ( arg_8 [ 'A' ] ) , 1 ) ) ) arg_10 = scale ( arg_8 [ 'B' ] . reshape ( ( len ( arg_8 [ 'B' ] ) , 1 ) ) ) arg_4 . append ( arg_0 . predict_proba ( arg_9 , arg_10 , arg_7 = arg_7 ) ) if arg_3 is not None : arg_5 . append ( [ arg_8 [ 'SampleID' ] , arg_4 [ - 1 ] ] ) DataFrame ( arg_5 , arg_6 = [ 'SampleID' , 'Predictions' ] ) . to_csv ( arg_3 , index = False ) return arg_4

def Func(arg_0, arg_1, **arg_2):
        """Generic dataset prediction function.

        Runs the score independently on all pairs.

        Args:
            x (pandas.DataFrame): a CEPC format Dataframe.
            kwargs (dict): additional arguments for the algorithms

        Returns:
            pandas.DataFrame: a Dataframe with the predictions.
        """
        arg_3 = arg_2.get("printout", None)
        arg_4 = []
        arg_5 = []
        arg_1.columns = ["A", "B"]
        for arg_7, arg_8 in arg_1.iterrows():
            arg_9 = scale(arg_8['A'].reshape((len(arg_8['A']), 1)))
            arg_10 = scale(arg_8['B'].reshape((len(arg_8['B']), 1)))

            arg_4.append(arg_0.predict_proba(arg_9, arg_10, arg_7=arg_7))

            if arg_3 is not None:
                arg_5.append([arg_8['SampleID'], arg_4[-1]])
                DataFrame(arg_5, arg_6=['SampleID', 'Predictions']).to_csv(
                    arg_3, index=False)
        return arg_4


def
Func
(
arg_0
)
:
arg_0
.
_logger
.
info
(
"Starting session: {0}"
.
format
(
arg_0
.
name
)
)
try
:
arg_0
.
_connection
.
do_handshake
(
)
except
Exception
as
e
:
arg_0
.
_logger
.
info
(
"Failure Funcning TLS handshake"
)
arg_0
.
_logger
.
exception
(
e
)
else
:
while
True
:
try
:
arg_0
.
_handle_message_loop
(
)
except
exceptions
.
ConnectionClosed
as
e
:
break
except
Exception
as
e
:
arg_0
.
_logger
.
info
(
"Failure handling message loop"
)
arg_0
.
_logger
.
exception
(
e
)
arg_0
.
_connection
.
shutdown
(
socket
.
SHUT_RDWR
)
arg_0
.
_connection
.
close
(
)
arg_0
.
_logger
.
info
(
"Stopping session: {0}"
.
format
(
arg_0
.
name
)
)

def Func(arg_0):
        """
        The main thread routine executed by invoking thread.start.

        This method manages the new client connection, Funcning a message
        handling loop. Once this method completes, the thread is finished.
        """
        arg_0._logger.info("Starting session: {0}".format(arg_0.name))

        try:
            arg_0._connection.do_handshake()
        except Exception as e:
            arg_0._logger.info("Failure Funcning TLS handshake")
            arg_0._logger.exception(e)
        else:
            while True:
                try:
                    arg_0._handle_message_loop()
                except exceptions.ConnectionClosed as e:
                    break
                except Exception as e:
                    arg_0._logger.info("Failure handling message loop")
                    arg_0._logger.exception(e)

        arg_0._connection.shutdown(socket.SHUT_RDWR)
        arg_0._connection.close()
        arg_0._logger.info("Stopping session: {0}".format(arg_0.name))

The main thread routine executed by invoking thread.start.

        This method manages the new client connection, running a message
        handling loop. Once this method completes, the thread is finished.

The main thread routine executed by invoking thread . start .


def Func ( arg_0 , arg_1 ) : arg_2 = [ ] arg_1 = arg_0 . line ( arg_1 ) for arg_3 , arg_4 in enumerate ( arg_0 . positions ) : try : arg_5 = _setup_index ( arg_4 ) try : arg_2 += arg_1 [ arg_5 ] except IndexError : arg_2 . append ( arg_0 . invalid_pos ) except ValueError : arg_2 . append ( str ( arg_4 ) ) except TypeError : arg_2 . extend ( arg_0 . _Func_range ( arg_1 , int ( arg_4 [ 0 ] ) , arg_3 ) ) return '' . join ( arg_2 )

def Func(arg_0, arg_1):
        """Returns selected positions from Func input source in desired
        arrangement.

        Argument:
            line -      input to Func
        """
        arg_2 = []
        arg_1 = arg_0.line(arg_1)

        for arg_3, arg_4 in enumerate(arg_0.positions):
            try:
                arg_5 = _setup_index(arg_4)
                try:
                    arg_2 += arg_1[arg_5]
                except IndexError:
                    arg_2.append(arg_0.invalid_pos)
            except ValueError:
                arg_2.append(str(arg_4))
            except TypeError:
                arg_2.extend(arg_0._Func_range(arg_1, int(arg_4[0]), arg_3))

        return ''.join(arg_2)

Returns selected positions from cut input source in desired
        arrangement.

        Argument:
            line -      input to cut

Returns selected positions from cut input source in desired arrangement .


def Func ( arg_0 , arg_1 ) : arg_2 = InferenceElement . getInputElement ( arg_1 ) if arg_2 is None : return None return getattr ( arg_0 . __currentGroundTruth . sensorInput , arg_2 )

def Func(arg_0, arg_1):
    """
    Get the actual value for this field

    Parameters:
    -----------------------------------------------------------------------
    sensorInputElement:       The inference element (part of the inference) that
                            is being used for this metric
    """
    arg_2 = InferenceElement.getInputElement(arg_1)
    if arg_2 is None:
      return None
    return getattr(arg_0.__currentGroundTruth.sensorInput, arg_2)


(self, env_name, version_label=None,
                           solution_stack_name=None, cname_prefix=None, description=None,
                           option_settings=None, tier_name='WebServer', tier_type='Standard', tier_version='1.1')

def
Func
(
arg_0
,
arg_1
,
arg_2
=
,
arg_3
=
,
arg_4
=
,
arg_5
=
,
arg_6
=
,
arg_7
=
'WebServer'
,
arg_8
=
'Standard'
,
arg_9
=
'1.1'
)
:
out
(
"Creating environment: "
+
str
(
arg_1
)
+
", tier_name:"
+
str
(
arg_7
)
+
", tier_type:"
+
str
(
arg_8
)
)
arg_0
.
ebs
.
Func
(
arg_0
.
app_name
,
arg_1
,
arg_2
=
arg_2
,
arg_3
=
arg_3
,
arg_4
=
arg_4
,
arg_5
=
arg_5
,
arg_6
=
arg_6
,
arg_8
=
arg_8
,
arg_7
=
arg_7
,
arg_9
=
arg_9
)

def Func(arg_0, arg_1, arg_2=None,
                           arg_3=None, arg_4=None, arg_5=None,
                           arg_6=None, arg_7='WebServer', arg_8='Standard', arg_9='1.1'):
        """
        Creates a new environment
        """
        out("Creating environment: " + str(arg_1) + ", tier_name:" + str(arg_7) + ", tier_type:" + str(arg_8))
        arg_0.ebs.Func(arg_0.app_name, arg_1,
                                    arg_2=arg_2,
                                    arg_3=arg_3,
                                    arg_4=arg_4,
                                    arg_5=arg_5,
                                    arg_6=arg_6,
                                    arg_8=arg_8,
                                    arg_7=arg_7,
                                    arg_9=arg_9)


async def Func ( arg_0 , arg_1 ) : arg_2 = hangouts_pb2 . RemoveUserResponse ( ) await arg_0 . _pb_request ( 'conversations/removeuser' , arg_1 , arg_2 ) return arg_2

async def Func(arg_0, arg_1):
        """Remove a participant from a group conversation."""
        arg_2 = hangouts_pb2.RemoveUserResponse()
        await arg_0._pb_request('conversations/removeuser',
                               arg_1, arg_2)
        return arg_2

Remove a participant from a group conversation .


def Func(arg_0, arg_1=None):
    '''
    Check the model for uniqueness constraint violations.
    '''
    if arg_1 is None:
        arg_2 = arg_0.metaclasses.values()
    else:
        arg_2 = [arg_0.find_metaclass(arg_1)]

    arg_3 = 0
    for arg_4 in arg_2:
        arg_5 = dict()
        for arg_6 in arg_4.indices:
            arg_5[arg_6] = dict()

        for arg_7 in arg_4.select_many():
            # Check for null-values
            for arg_8, arg_9 in arg_4.attributes:
                if arg_8 not in arg_4.identifying_attributes:
                    continue

                arg_10 = getattr(arg_7, arg_8)
                arg_11 = arg_10 is None
                arg_11 |= (arg_9 == 'UNIQUE_ID' and not arg_10)
                if arg_11:
                    arg_3 += 1
                    logger.warning('%s.%s is part of an identifier and is null'
                                   % (arg_4.kind, arg_8))

            # Check uniqueness
            for arg_6 in arg_4.indices:
                arg_12 = dict()
                for arg_8 in arg_4.indices[arg_6]:
                    arg_12[arg_8] = getattr(arg_7, arg_8)

                arg_13 = frozenset(arg_12.items())
                if arg_13 in arg_5[arg_6]:
                    arg_3 += 1
                    arg_14 = pretty_unique_identifier(arg_7, arg_6)
                    logger.warning('uniqueness constraint violation in %s, %s'
                                   % (arg_4.kind, arg_14))

                arg_5[arg_6][arg_13] = arg_7

    return arg_3

Check the model for uniqueness constraint violations .


def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Rotates Cartesian coordinates from one reference system to another using the rotation matrix with
        which the class was initialized. The inputs  can be scalars or 1-dimensional numpy arrays.

        Parameters
        ----------

        x - Value of X-coordinate in original reference system
        y - Value of Y-coordinate in original reference system
        z - Value of Z-coordinate in original reference system

        Returns
        -------

        xrot - Value of X-coordinate after rotation
        yrot - Value of Y-coordinate after rotation
        zrot - Value of Z-coordinate after rotation
        """
        arg_4, arg_5, arg_6 = dot(arg_0.rotationMatrix,[arg_1,arg_2,arg_3])
        return arg_4, arg_5, arg_6

Rotates Cartesian coordinates from one reference system to another using the rotation matrix with which the class was initialized . The inputs can be scalars or 1 - dimensional numpy arrays .


def Func(arg_0, arg_1, arg_2):
    """ Simulates a 1 dimensional cellular automaton.

    :param initial_state:

        The initial state of *dead* and *alive* cells as a 1D numpy array.
        It's length determines the size of the simulation.

    :param rule_number:

        The update rule as an integer from 0 to 255.

    :param steps:

        Number of cell iterations

    :return:

        A 2D numpy array (steps x len(initial_state)) containing zeros and ones representing
        the automaton development over time.

    """

    arg_3 = len(arg_0)
    # Create an array for the full pattern
    arg_4 = np.zeros((arg_2, arg_3))

    # Pass initial state:
    arg_4[0,:] = arg_0

    # Get the binary rule list
    arg_5 = convert_rule(arg_1)

    # Conversion list to get the position in the binary rule list
    arg_6 = np.array([1, 2, 4])

    # Iterate over all steps to compute the CA
    arg_7 = range(arg_3)
    for arg_8 in range(arg_2-1):
        arg_9 = arg_4[arg_8, :]
        arg_10 = arg_4[arg_8+1, :]
        for arg_11 in arg_7:
            # Get the neighbourhood
            arg_12 = range(arg_11 - 1, arg_11 + 2)
            arg_13 = np.take(arg_9, arg_12, mode='wrap')
            # Convert neighborhood to decimal
            arg_14 = int(np.sum(arg_13 * arg_6))
            # Get next state from rule book
            arg_15 = arg_5[arg_14]
            # Update next state of cell
            arg_10[arg_11] = arg_15

    return arg_4

Simulates a 1 dimensional cellular automaton .


def Func(arg_0, arg_1):
        """
        Find the node to which a connection belongs.

        :param conn: connection object
        :type conn: TcpConnection
        :returns corresponding node or None if the node cannot be found
        :rtype Node or None
        """

        for arg_2 in arg_0._connections:
            if arg_0._connections[arg_2] is arg_1:
                return arg_2
        return None

Find the node to which a connection belongs .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = get_metaclass ( arg_0 ) arg_5 = get_metaclass ( arg_1 ) if isinstance ( arg_2 , int ) : arg_2 = 'R%d' % arg_2 for arg_6 in arg_4 . metamodel . associations : if arg_6 . rel_id != arg_2 : continue if ( arg_6 . source_link . from_metaclass . kind == arg_4 . kind and arg_6 . source_link . to_metaclass . kind == arg_5 . kind and arg_6 . source_link . phrase == arg_3 ) : return arg_0 , arg_1 , arg_6 if ( arg_6 . target_link . from_metaclass . kind == arg_4 . kind and arg_6 . target_link . to_metaclass . kind == arg_5 . kind and arg_6 . target_link . phrase == arg_3 ) : return arg_1 , arg_0 , arg_6 raise UnknownLinkException ( arg_4 . kind , arg_5 . kind , arg_2 , arg_3 )

def Func(arg_0, arg_1, arg_2, arg_3):
    '''
    Find links that correspond to the given arguments.
    '''
    arg_4 = get_metaclass(arg_0)
    arg_5 = get_metaclass(arg_1)

    if isinstance(arg_2, int):
        arg_2 = 'R%d' % arg_2

    for arg_6 in arg_4.metamodel.associations:
        if arg_6.rel_id != arg_2:
            continue

        if (arg_6.source_link.from_metaclass.kind == arg_4.kind and
            arg_6.source_link.to_metaclass.kind == arg_5.kind and
            arg_6.source_link.phrase == arg_3):
            return arg_0, arg_1, arg_6

        if (arg_6.target_link.from_metaclass.kind == arg_4.kind and
            arg_6.target_link.to_metaclass.kind == arg_5.kind and
            arg_6.target_link.phrase == arg_3):
            return arg_1, arg_0, arg_6

    raise UnknownLinkException(arg_4.kind, arg_5.kind, arg_2, arg_3)

Find links that correspond to the given arguments .


def Func(arg_0, arg_1, arg_2, arg_3=False):
        """Add a virtual column to the DataFrame.

        Example:

        >>> df.Func("r", "sqrt(x**2 + y**2 + z**2)")
        >>> df.select("r < 10")

        :param: str name: name of virtual column
        :param: expression: expression for the column
        :param str unique: if name is already used, make it unique by adding a postfix, e.g. _1, or _2
        """
        arg_4 = "change" if arg_1 in arg_0.virtual_columns else "add"
        arg_2 = _ensure_string_from_expression(arg_2)
        if arg_1 in arg_0.get_column_names(virtual=False):
            arg_5 = '__' +vaex.utils.find_valid_name(arg_1, used=arg_0.get_column_names())
            arg_2 = arg_0._rename(arg_1, arg_5, arg_2)[0].expression

        arg_1 = vaex.utils.find_valid_name(arg_1, used=[] if not arg_3 else arg_0.get_column_names())
        arg_0.virtual_columns[arg_1] = arg_2
        arg_0.column_names.append(arg_1)
        arg_0._save_assign_expression(arg_1)
        arg_0.signal_column_changed.emit(arg_0, arg_1, "add")

Add a virtual column to the DataFrame.

        Example:

        >>> df.add_virtual_column("r", "sqrt(x**2 + y**2 + z**2)")
        >>> df.select("r < 10")

        :param: str name: name of virtual column
        :param: expression: expression for the column
        :param str unique: if name is already used, make it unique by adding a postfix, e.g. _1, or _2


def Func ( arg_0 ) : arg_1 = type ( arg_0 ) class Proxy ( arg_1 ) : def __getattribute__ ( arg_2 , arg_3 ) : try : return super ( ) . __getattribute__ ( arg_3 ) except AttributeError : return getattr ( arg_0 , arg_3 ) update_wrapper ( Proxy , arg_1 , updated = ( ) ) return Proxy ( )

def Func(arg_0):
    '''
    return a Func proxy for the `obj`.

    all modify on the proxy will not apply on origin object.
    '''
    arg_1 = type(arg_0)

    class Proxy(arg_1):
        def __getattribute__(arg_2, arg_3):
            try:
                return super().__getattribute__(arg_3)
            except AttributeError:
                return getattr(arg_0, arg_3)

    update_wrapper(Proxy, arg_1, updated = ())
    return Proxy()

return a mutable proxy for the `obj`.

    all modify on the proxy will not apply on origin object.


(self, pk=None, start_line=None, end_line=None,
                      full=True)

def Func(arg_0, arg_1=None, arg_2=None, arg_3=None,
                      arg_4=True):
        """
        Internal method that lies to our `monitor` method by returning
        a scorecard for the workflow job where the standard out
        would have been expected.
        """
        arg_5 = get_resource('unified_job')
        # Filters
        #  - limit search to jobs spawned as part of this workflow job
        #  - order in the order in which they should add to the list
        #  - only include final job states
        arg_6 = (('unified_job_node__workflow_job', arg_1),
                        ('order_by', 'finished'),
                        ('status__in', 'successful,failed,error'))
        arg_7 = arg_5.list(all_pages=True, query=arg_6)
        if arg_7['count'] == 0:
            return ''

        arg_8 = ResSubcommand(arg_5)._format_human(arg_7)
        arg_9 = arg_8.split('\n')
        if not arg_4:
            arg_9 = arg_9[:-1]

        arg_10 = len(arg_9)
        arg_11 = arg_2
        if arg_2 is None:
            arg_11 = 0
        elif arg_2 > arg_10:
            arg_11 = arg_10

        arg_12 = arg_3
        if arg_3 is None or arg_3 > arg_10:
            arg_12 = arg_10

        arg_9 = arg_9[arg_11:arg_12]
        arg_8 = '\n'.join(arg_9)
        if len(arg_9) > 0:
            arg_8 += '\n'

        return arg_8

Internal method that lies to our monitor method by returning a scorecard for the workflow job where the standard out would have been expected .


" TreeTime sequence log-LH:            \t%1.3f\n"

" Coalescent log-LH:                   \t%1.3f\n"

def Func(arg_0, arg_1=True):
        """
        Print the total likelihood of the tree given the constrained leaves

        Parameters
        ----------

         joint : bool
            If true, print joint LH, else print marginal LH

        """
        try:
            arg_2 = arg_0.tree.unconstrained_sequence_LH
            if arg_1:
                arg_3 = arg_0.tree.sequence_joint_LH
                arg_4 = arg_0.tree.positional_joint_LH
                arg_5 = arg_0.tree.coalescent_joint_LH
            else:
                arg_3 = arg_0.tree.sequence_marginal_LH
                arg_4 = arg_0.tree.positional_marginal_LH
                arg_5 = 0

            print ("###  Tree Log-Likelihood  ###\n"
                " Sequence log-LH without constraints: \t%1.3f\n"
                " Sequence log-LH with constraints:    \t%1.3f\n"
                " TreeTime sequence log-LH:            \t%1.3f\n"
                " Coalescent log-LH:                   \t%1.3f\n"
               "#########################"%(arg_2, arg_3,arg_4, arg_5))
        except:
            print("ERROR. Did you run the corresponding inference (joint/marginal)?")


(CASRN, AvailableMethods=False, Method=None, IgnoreMethods=[SURF])

def
Func
(
arg_0
,
arg_1
=
False
,
arg_2
=
,
arg_3
=
[
arg_4
]
)
:
def
list_methods
(
)
:
arg_5
=
[
]
if
arg_0
in
_crit_IUPAC
.
index
and
not
np
.
isnan
(
_crit_IUPAC
.
at
[
arg_0
,
'Func'
]
)
:
arg_5
.
append
(
IUPAC
)
if
arg_0
in
_crit_Matthews
.
index
and
not
np
.
isnan
(
_crit_Matthews
.
at
[
arg_0
,
'Func'
]
)
:
arg_5
.
append
(
MATTHEWS
)
if
arg_0
in
_crit_CRC
.
index
and
not
np
.
isnan
(
_crit_CRC
.
at
[
arg_0
,
'Func'
]
)
:
arg_5
.
append
(
CRC
)
if
arg_0
in
_crit_PSRKR4
.
index
and
not
np
.
isnan
(
_crit_PSRKR4
.
at
[
arg_0
,
'Func'
]
)
:
arg_5
.
append
(
PSRK
)
if
arg_0
in
_crit_Yaws
.
index
and
not
np
.
isnan
(
_crit_Yaws
.
at
[
arg_0
,
'Func'
]
)
:
arg_5
.
append
(
YAWS
)
if
arg_0
:
arg_5
.
append
(
arg_4
)
if
arg_3
:
for
arg_2
in
arg_3
:
if
arg_2
in
arg_5
:
arg_5
.
remove
(
arg_2
)
arg_5
.
append
(
)
return
arg_5
if
arg_1
:
return
list_methods
(
)
if
not
arg_2
:
arg_2
=
list_methods
(
)
[
0
]
if
arg_2
==
IUPAC
:
arg_6
=
float
(
_crit_IUPAC
.
at
[
arg_0
,
'Func'
]
)
elif
arg_2
==
PSRK
:
arg_6
=
float
(
_crit_PSRKR4
.
at
[
arg_0
,
'Func'
]
)
elif
arg_2
==
MATTHEWS
:
arg_6
=
float
(
_crit_Matthews
.
at
[
arg_0
,
'Func'
]
)
elif
arg_2
==
CRC
:
arg_6
=
float
(
_crit_CRC
.
at
[
arg_0
,
'Func'
]
)
elif
arg_2
==
YAWS
:
arg_6
=
float
(
_crit_Yaws
.
at
[
arg_0
,
'Func'
]
)
elif
arg_2
==
arg_4
:
arg_6
=
third_property
(
arg_0
=
arg_0
,
V
=
True
)
elif
arg_2
==
:
return
else
:
raise
Exception
(
'Failure in in function'
)
return
arg_6

def Func(arg_0, arg_1=False, arg_2=None, arg_3=[arg_4]):
    r'''This function handles the retrieval of a chemical's critical
    volume. Lookup is based on CASRNs. Will automatically select a data
    source to use if no Method is provided; returns None if the data is not
    available.

    Prefered sources are 'IUPAC' for organic chemicals, and 'MATTHEWS' for
    inorganic chemicals. Function has data for approximately 1000 chemicals.

    Examples
    --------
    >>> Func(CASRN='64-17-5')
    0.000168

    Parameters
    ----------
    CASRN : string
        CASRN [-]

    Returns
    -------
    Func : float
        Critical volume, [m^3/mol]
    methods : list, only returned if AvailableMethods == True
        List of methods which can be used to obtain Func with the given inputs

    Other Parameters
    ----------------
    Method : string, optional
        The method name to use. Accepted methods are 'IUPAC', 'MATTHEWS',
        'CRC', 'PSRK', 'YAWS', and 'SURF'. All valid values are also held
        in the list `Func_methods`.
    AvailableMethods : bool, optional
        If True, function will determine which methods can be used to obtain
        Func for the desired chemical, and will return methods instead of Func
    IgnoreMethods : list, optional
        A list of methods to ignore in obtaining the full list of methods,
        useful for for performance reasons and ignoring inaccurate methods

    Notes
    -----
    A total of six sources are available for this function. They are:

        * 'IUPAC', a series of critically evaluated
          experimental datum for organic compounds in [1]_, [2]_, [3]_, [4]_,
          [5]_, [6]_, [7]_, [8]_, [9]_, [10]_, [11]_, and [12]_.
        * 'MATTHEWS', a series of critically
          evaluated data for inorganic compounds in [13]_.
        * 'CRC', a compillation of critically
          evaluated data by the TRC as published in [14]_.
        * 'PSRK', a compillation of experimental and
          estimated data published in [15]_.
        * 'YAWS', a large compillation of data from a
          variety of sources; no data points are sourced in the work of [16]_.
        * 'SURF', an estimation method using a
          simple quadratic method for estimating Pc from Tc and Func. This is
          ignored and not returned as a method by default

    References
    ----------
    .. [1] Ambrose, Douglas, and Colin L. Young. "Vapor-Liquid Critical
       Properties of Elements and Compounds. 1. An Introductory Survey."
       Journal of Chemical & Engineering Data 41, no. 1 (January 1, 1996):
       154-154. doi:10.1021/je950378q.
    .. [2] Ambrose, Douglas, and Constantine Tsonopoulos. "Vapor-Liquid
       Critical Properties of Elements and Compounds. 2. Normal Alkanes."
       Journal of Chemical & Engineering Data 40, no. 3 (May 1, 1995): 531-46.
       doi:10.1021/je00019a001.
    .. [3] Tsonopoulos, Constantine, and Douglas Ambrose. "Vapor-Liquid
       Critical Properties of Elements and Compounds. 3. Aromatic
       Hydrocarbons." Journal of Chemical & Engineering Data 40, no. 3
       (May 1, 1995): 547-58. doi:10.1021/je00019a002.
    .. [4] Gude, Michael, and Amyn S. Teja. "Vapor-Liquid Critical Properties
       of Elements and Compounds. 4. Aliphatic Alkanols." Journal of Chemical
       & Engineering Data 40, no. 5 (September 1, 1995): 1025-36.
       doi:10.1021/je00021a001.
    .. [5] Daubert, Thomas E. "Vapor-Liquid Critical Properties of Elements
       and Compounds. 5. Branched Alkanes and Cycloalkanes." Journal of
       Chemical & Engineering Data 41, no. 3 (January 1, 1996): 365-72.
       doi:10.1021/je9501548.
    .. [6] Tsonopoulos, Constantine, and Douglas Ambrose. "Vapor-Liquid
       Critical Properties of Elements and Compounds. 6. Unsaturated Aliphatic
       Hydrocarbons." Journal of Chemical & Engineering Data 41, no. 4
       (January 1, 1996): 645-56. doi:10.1021/je9501999.
    .. [7] Kudchadker, Arvind P., Douglas Ambrose, and Constantine Tsonopoulos.
       "Vapor-Liquid Critical Properties of Elements and Compounds. 7. Oxygen
       Compounds Other Than Alkanols and Cycloalkanols." Journal of Chemical &
       Engineering Data 46, no. 3 (May 1, 2001): 457-79. doi:10.1021/je0001680.
    .. [8] Tsonopoulos, Constantine, and Douglas Ambrose. "Vapor-Liquid
       Critical Properties of Elements and Compounds. 8. Organic Sulfur,
       Silicon, and Tin Compounds (C + H + S, Si, and Sn)." Journal of Chemical
       & Engineering Data 46, no. 3 (May 1, 2001): 480-85.
       doi:10.1021/je000210r.
    .. [9] Marsh, Kenneth N., Colin L. Young, David W. Morton, Douglas Ambrose,
       and Constantine Tsonopoulos. "Vapor-Liquid Critical Properties of
       Elements and Compounds. 9. Organic Compounds Containing Nitrogen."
       Journal of Chemical & Engineering Data 51, no. 2 (March 1, 2006):
       305-14. doi:10.1021/je050221q.
    .. [10] Marsh, Kenneth N., Alan Abramson, Douglas Ambrose, David W. Morton,
       Eugene Nikitin, Constantine Tsonopoulos, and Colin L. Young.
       "Vapor-Liquid Critical Properties of Elements and Compounds. 10. Organic
       Compounds Containing Halogens." Journal of Chemical & Engineering Data
       52, no. 5 (September 1, 2007): 1509-38. doi:10.1021/je700336g.
    .. [11] Ambrose, Douglas, Constantine Tsonopoulos, and Eugene D. Nikitin.
       "Vapor-Liquid Critical Properties of Elements and Compounds. 11. Organic
       Compounds Containing B + O; Halogens + N, + O, + O + S, + S, + Si;
       N + O; and O + S, + Si." Journal of Chemical & Engineering Data 54,
       no. 3 (March 12, 2009): 669-89. doi:10.1021/je800580z.
    .. [12] Ambrose, Douglas, Constantine Tsonopoulos, Eugene D. Nikitin, David
       W. Morton, and Kenneth N. Marsh. "Vapor-Liquid Critical Properties of
       Elements and Compounds. 12. Review of Recent Data for Hydrocarbons and
       Non-Hydrocarbons." Journal of Chemical & Engineering Data, October 5,
       2015, 151005081500002. doi:10.1021/acs.jced.5b00571.
    .. [13] Mathews, Joseph F. "Critical Constants of Inorganic Substances."
       Chemical Reviews 72, no. 1 (February 1, 1972): 71-100.
       doi:10.1021/cr60275a004.
    .. [14] Haynes, W.M., Thomas J. Bruno, and David R. Lide. CRC Handbook of
       Chemistry and Physics, 95E. Boca Raton, FL: CRC press, 2014.
    .. [15] Horstmann, Sven, Anna Jabłoniec, Jörg Krafczyk, Kai Fischer, and
       Jürgen Gmehling. "PSRK Group Contribution Equation of State:
       Comprehensive Revision and Extension IV, Including Critical Constants
       and Α-Function Parameters for 1000 Components." Fluid Phase Equilibria
       227, no. 2 (January 25, 2005): 157-64. doi:10.1016/j.fluid.2004.11.002.
    .. [16] Yaws, Carl L. Thermophysical Properties of Chemicals and
       Hydrocarbons, Second Edition. Amsterdam Boston: Gulf Professional
       Publishing, 2014.
    '''
    def list_methods():
        arg_5 = []
        if arg_0 in _crit_IUPAC.index and not np.isnan(_crit_IUPAC.at[arg_0, 'Func']):
            arg_5.append(IUPAC)
        if arg_0 in _crit_Matthews.index and not np.isnan(_crit_Matthews.at[arg_0, 'Func']):
            arg_5.append(MATTHEWS)
        if arg_0 in _crit_CRC.index and not np.isnan(_crit_CRC.at[arg_0, 'Func']):
            arg_5.append(CRC)
        if arg_0 in _crit_PSRKR4.index and not np.isnan(_crit_PSRKR4.at[arg_0, 'Func']):
            arg_5.append(PSRK)
        if arg_0 in _crit_Yaws.index and not np.isnan(_crit_Yaws.at[arg_0, 'Func']):
            arg_5.append(YAWS)
        if arg_0:
            arg_5.append(arg_4)
        if arg_3:
            for arg_2 in arg_3:
                if arg_2 in arg_5:
                    arg_5.remove(arg_2)
        arg_5.append(NONE)
        return arg_5
    if arg_1:
        return list_methods()
    if not arg_2:
        arg_2 = list_methods()[0]

    if arg_2 == IUPAC:
        arg_6 = float(_crit_IUPAC.at[arg_0, 'Func'])
    elif arg_2 == PSRK:
        arg_6 = float(_crit_PSRKR4.at[arg_0, 'Func'])
    elif arg_2 == MATTHEWS:
        arg_6 = float(_crit_Matthews.at[arg_0, 'Func'])
    elif arg_2 == CRC:
        arg_6 = float(_crit_CRC.at[arg_0, 'Func'])
    elif arg_2 == YAWS:
        arg_6 = float(_crit_Yaws.at[arg_0, 'Func'])
    elif arg_2 == arg_4:
        arg_6 = third_property(arg_0=arg_0, V=True)
    elif arg_2 == NONE:
        return None
    else:
        raise Exception('Failure in in function')
    return arg_6

r'''This function handles the retrieval of a chemical's critical
    volume. Lookup is based on CASRNs. Will automatically select a data
    source to use if no Method is provided; returns None if the data is not
    available.

    Prefered sources are 'IUPAC' for organic chemicals, and 'MATTHEWS' for
    inorganic chemicals. Function has data for approximately 1000 chemicals.

    Examples
    --------
    >>> Vc(CASRN='64-17-5')
    0.000168

    Parameters
    ----------
    CASRN : string
        CASRN [-]

    Returns
    -------
    Vc : float
        Critical volume, [m^3/mol]
    methods : list, only returned if AvailableMethods == True
        List of methods which can be used to obtain Vc with the given inputs

    Other Parameters
    ----------------
    Method : string, optional
        The method name to use. Accepted methods are 'IUPAC', 'MATTHEWS',
        'CRC', 'PSRK', 'YAWS', and 'SURF'. All valid values are also held
        in the list `Vc_methods`.
    AvailableMethods : bool, optional
        If True, function will determine which methods can be used to obtain
        Vc for the desired chemical, and will return methods instead of Vc
    IgnoreMethods : list, optional
        A list of methods to ignore in obtaining the full list of methods,
        useful for for performance reasons and ignoring inaccurate methods

    Notes
    -----
    A total of six sources are available for this function. They are:

        * 'IUPAC', a series of critically evaluated
          experimental datum for organic compounds in [1]_, [2]_, [3]_, [4]_,
          [5]_, [6]_, [7]_, [8]_, [9]_, [10]_, [11]_, and [12]_.
        * 'MATTHEWS', a series of critically
          evaluated data for inorganic compounds in [13]_.
        * 'CRC', a compillation of critically
          evaluated data by the TRC as published in [14]_.
        * 'PSRK', a compillation of experimental and
          estimated data published in [15]_.
        * 'YAWS', a large compillation of data from a
          variety of sources; no data points are sourced in the work of [16]_.
        * 'SURF', an estimation method using a
          simple quadratic method for estimating Pc from Tc and Vc. This is
          ignored and not returned as a method by default

    References
    ----------
    .. [1] Ambrose, Douglas, and Colin L. Young. "Vapor-Liquid Critical
       Properties of Elements and Compounds. 1. An Introductory Survey."
       Journal of Chemical & Engineering Data 41, no. 1 (January 1, 1996):
       154-154. doi:10.1021/je950378q.
    .. [2] Ambrose, Douglas, and Constantine Tsonopoulos. "Vapor-Liquid
       Critical Properties of Elements and Compounds. 2. Normal Alkanes."
       Journal of Chemical & Engineering Data 40, no. 3 (May 1, 1995): 531-46.
       doi:10.1021/je00019a001.
    .. [3] Tsonopoulos, Constantine, and Douglas Ambrose. "Vapor-Liquid
       Critical Properties of Elements and Compounds. 3. Aromatic
       Hydrocarbons." Journal of Chemical & Engineering Data 40, no. 3
       (May 1, 1995): 547-58. doi:10.1021/je00019a002.
    .. [4] Gude, Michael, and Amyn S. Teja. "Vapor-Liquid Critical Properties
       of Elements and Compounds. 4. Aliphatic Alkanols." Journal of Chemical
       & Engineering Data 40, no. 5 (September 1, 1995): 1025-36.
       doi:10.1021/je00021a001.
    .. [5] Daubert, Thomas E. "Vapor-Liquid Critical Properties of Elements
       and Compounds. 5. Branched Alkanes and Cycloalkanes." Journal of
       Chemical & Engineering Data 41, no. 3 (January 1, 1996): 365-72.
       doi:10.1021/je9501548.
    .. [6] Tsonopoulos, Constantine, and Douglas Ambrose. "Vapor-Liquid
       Critical Properties of Elements and Compounds. 6. Unsaturated Aliphatic
       Hydrocarbons." Journal of Chemical & Engineering Data 41, no. 4
       (January 1, 1996): 645-56. doi:10.1021/je9501999.
    .. [7] Kudchadker, Arvind P., Douglas Ambrose, and Constantine Tsonopoulos.
       "Vapor-Liquid Critical Properties of Elements and Compounds. 7. Oxygen
       Compounds Other Than Alkanols and Cycloalkanols." Journal of Chemical &
       Engineering Data 46, no. 3 (May 1, 2001): 457-79. doi:10.1021/je0001680.
    .. [8] Tsonopoulos, Constantine, and Douglas Ambrose. "Vapor-Liquid
       Critical Properties of Elements and Compounds. 8. Organic Sulfur,
       Silicon, and Tin Compounds (C + H + S, Si, and Sn)." Journal of Chemical
       & Engineering Data 46, no. 3 (May 1, 2001): 480-85.
       doi:10.1021/je000210r.
    .. [9] Marsh, Kenneth N., Colin L. Young, David W. Morton, Douglas Ambrose,
       and Constantine Tsonopoulos. "Vapor-Liquid Critical Properties of
       Elements and Compounds. 9. Organic Compounds Containing Nitrogen."
       Journal of Chemical & Engineering Data 51, no. 2 (March 1, 2006):
       305-14. doi:10.1021/je050221q.
    .. [10] Marsh, Kenneth N., Alan Abramson, Douglas Ambrose, David W. Morton,
       Eugene Nikitin, Constantine Tsonopoulos, and Colin L. Young.
       "Vapor-Liquid Critical Properties of Elements and Compounds. 10. Organic
       Compounds Containing Halogens." Journal of Chemical & Engineering Data
       52, no. 5 (September 1, 2007): 1509-38. doi:10.1021/je700336g.
    .. [11] Ambrose, Douglas, Constantine Tsonopoulos, and Eugene D. Nikitin.
       "Vapor-Liquid Critical Properties of Elements and Compounds. 11. Organic
       Compounds Containing B + O; Halogens + N, + O, + O + S, + S, + Si;
       N + O; and O + S, + Si." Journal of Chemical & Engineering Data 54,
       no. 3 (March 12, 2009): 669-89. doi:10.1021/je800580z.
    .. [12] Ambrose, Douglas, Constantine Tsonopoulos, Eugene D. Nikitin, David
       W. Morton, and Kenneth N. Marsh. "Vapor-Liquid Critical Properties of
       Elements and Compounds. 12. Review of Recent Data for Hydrocarbons and
       Non-Hydrocarbons." Journal of Chemical & Engineering Data, October 5,
       2015, 151005081500002. doi:10.1021/acs.jced.5b00571.
    .. [13] Mathews, Joseph F. "Critical Constants of Inorganic Substances."
       Chemical Reviews 72, no. 1 (February 1, 1972): 71-100.
       doi:10.1021/cr60275a004.
    .. [14] Haynes, W.M., Thomas J. Bruno, and David R. Lide. CRC Handbook of
       Chemistry and Physics, 95E. Boca Raton, FL: CRC press, 2014.
    .. [15] Horstmann, Sven, Anna Jabłoniec, Jörg Krafczyk, Kai Fischer, and
       Jürgen Gmehling. "PSRK Group Contribution Equation of State:
       Comprehensive Revision and Extension IV, Including Critical Constants
       and Α-Function Parameters for 1000 Components." Fluid Phase Equilibria
       227, no. 2 (January 25, 2005): 157-64. doi:10.1016/j.fluid.2004.11.002.
    .. [16] Yaws, Carl L. Thermophysical Properties of Chemicals and
       Hydrocarbons, Second Edition. Amsterdam Boston: Gulf Professional
       Publishing, 2014.

r This function handles the retrieval of a chemical s critical volume . Lookup is based on CASRNs . Will automatically select a data source to use if no Method is provided ; returns None if the data is not available .


def Func ( arg_0 = arg_0 , arg_1 = arg_1 , ** arg_2 ) : return init ( ** dict ( arg_1 , ** arg_2 ) ) ( ** arg_0 )

def Func(arg_0=arg_0, arg_1=arg_1, **arg_2):
    """Imports and runs setup function with given properties."""
    return init(**dict(arg_1, **arg_2))(**arg_0)

Imports and runs setup function with given properties .


def Func ( arg_0 , arg_1 ) : arg_0 . intents . remove ( arg_1 ) arg_0 . padaos . Func ( arg_1 ) arg_0 . must_train = True

def Func(arg_0, arg_1):
        """Unload an intent"""
        arg_0.intents.remove(arg_1)
        arg_0.padaos.Func(arg_1)
        arg_0.must_train = True


def
Func
(
arg_0
,
arg_1
)
:
for
arg_2
in
arg_1
:
for
arg_3
in
arg_0
.
Funced
:
if
arg_3
(
arg_2
)
:
raise
StringprepError
(
"Prohibited character: {0!r}"
.
format
(
arg_2
)
)
return
arg_1

def Func(arg_0, arg_1):
        """Checks for Funced characters."""
        for arg_2 in arg_1:
            for arg_3 in arg_0.Funced:
                if arg_3(arg_2):
                    raise StringprepError("Prohibited character: {0!r}"
                                                                .format(arg_2))
        return arg_1


def Func ( arg_0 ) : if isinstance ( arg_0 . body , bytes ) : arg_1 = arg_0 . body elif isinstance ( arg_0 . body , str ) : arg_1 = arg_0 . body . encode ( arg_0 . charset ) else : arg_1 = b'' arg_0 . add_header ( 'Content-Type' , arg_0 . content_type ) arg_0 . add_header ( 'Content-Length' , str ( len ( arg_1 ) ) ) arg_0 . start ( arg_0 . status_line , arg_0 . _headers ) return [ arg_1 ]

def Func(arg_0):
        """Return the HTTP Func body.

        Returns:
          bytes: HTTP Func body as a sequence of bytes
        """
        if isinstance(arg_0.body, bytes):
            arg_1 = arg_0.body
        elif isinstance(arg_0.body, str):
            arg_1 = arg_0.body.encode(arg_0.charset)
        else:
            arg_1 = b''
        arg_0.add_header('Content-Type', arg_0.content_type)
        arg_0.add_header('Content-Length', str(len(arg_1)))

        arg_0.start(arg_0.status_line, arg_0._headers)
        return [arg_1]

Return the HTTP response body.

        Returns:
          bytes: HTTP response body as a sequence of bytes


(self, key, ignoreMissingKey=True, timeoutSecs=60, **kwargs)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
True
,
arg_3
=
60
,
**
arg_4
)
:
assert
arg_1
is
not
,
'"key" parameter is null'
arg_5
=
arg_0
.
do_json_request
(
'/3/Frames.json/'
+
arg_1
,
cmd
=
'delete'
,
timeout
=
arg_3
)
if
not
arg_2
and
'f00b4r'
in
arg_5
:
raise
ValueError
(
'Frame key not found: '
+
arg_1
)
return
arg_5

def Func(arg_0, arg_1, arg_2=True, arg_3=60, **arg_4):
    '''
    Delete a frame on the h2o cluster, given its key.
    '''
    assert arg_1 is not None, '"key" parameter is null'

    arg_5 = arg_0.do_json_request('/3/Frames.json/' + arg_1, cmd='delete', timeout=arg_3)

    # TODO: look for what?
    if not arg_2 and 'f00b4r' in arg_5:
        raise ValueError('Frame key not found: ' + arg_1)
    return arg_5

Delete a frame on the h2o cluster given its key .


(self, token, token_type_hint, request, *args, **kwargs)

def Func(arg_0, arg_1, arg_2, arg_3, *arg_4, **arg_5):
        """Revoke an access or refresh token.
        """
        if arg_2:
            arg_6 = arg_0._tokengetter(**{arg_2: arg_1})
        else:
            arg_6 = arg_0._tokengetter(access_token=arg_1)
            if not arg_6:
                arg_6 = arg_0._tokengetter(refresh_token=arg_1)

        if arg_6:
            arg_3.client_id = arg_6.client_id
            arg_3.user = arg_6.user
            arg_6.delete()
            return True

        arg_9 = 'Invalid token supplied.'
        log.debug(arg_9)
        arg_3.error_message = arg_9
        return False


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . _callRemote ( Transmit , connection = arg_0 . connection , arg_1 = arg_1 ) arg_2 . addErrback ( log . err )

def Func(arg_0, arg_1):
        """Actually sends data over the wire.

        """
        arg_2 = arg_0._callRemote(Transmit, connection=arg_0.connection, arg_1=arg_1)
        arg_2.addErrback(log.err)


def Func(arg_0, arg_1):
        """
        The Func for the given column.

        :param col: either a name, or an index of the column to look up
        :returns: Func of the column, one of: ``str``, ``int``, ``real``, ``enum``, ``time``, ``bool``.
        :raises H2OValueError: if such column does not exist in the frame.
        """
        assert_is_Func(arg_1, int, str)
        if not arg_0._ex._cache.Funcs_valid() or not arg_0._ex._cache.names_valid():
            arg_0._ex._cache.flush()
            arg_0._frame(fill_cache=True)
        arg_2 = arg_0._ex._cache.Funcs
        if is_Func(arg_1, str):
            if arg_1 in arg_2:
                return arg_2[arg_1]
        else:
            arg_3 = arg_0._ex._cache.names
            if -len(arg_3) <= arg_1 < len(arg_3):
                return arg_2[arg_3[arg_1]]
        raise H2OValueError("Column '%r' does not exist in the frame" % arg_1)

The type for the given column.

        :param col: either a name, or an index of the column to look up
        :returns: type of the column, one of: ``str``, ``int``, ``real``, ``enum``, ``time``, ``bool``.
        :raises H2OValueError: if such column does not exist in the frame.


def Func ( arg_0 , arg_1 ) : for arg_2 in range ( arg_0 . GetMenuItemCount ( ) ) : arg_3 = arg_0 . FindItemByPosition ( arg_2 ) arg_3 . Func ( arg_1 )

def Func(arg_0, arg_1):
        "enable or disable all menu items"
        for arg_2 in range(arg_0.GetMenuItemCount()):
            arg_3 = arg_0.FindItemByPosition(arg_2)
            arg_3.Func(arg_1)


return s1.name == s2.name and s1.s == s2.s

def Func ( arg_0 , arg_1 ) : if isinstance ( arg_0 , ( Marker , UnknownSound ) ) : return False arg_2 = arg_1 [ arg_0 . name ] arg_3 = arg_1 [ arg_0 . s ] return arg_2 . name == arg_3 . name and arg_2 . s == arg_3 . s

def Func(arg_0, arg_1):
    """Check the consistency of a given transcription system conversino"""
    if isinstance(arg_0, (Marker, UnknownSound)):
        return False
    arg_2 = arg_1[arg_0.name]
    arg_3 = arg_1[arg_0.s]
    return arg_2.name == arg_3.name and arg_2.s == arg_3.s


def Func ( arg_0 , arg_1 ) : super ( PooledAIODatabase , arg_0 ) . Func ( arg_1 ) arg_0 . _waiters = collections . deque ( )

def Func(arg_0, arg_1):
        """Initialize self."""
        super(PooledAIODatabase, arg_0).Func(arg_1)
        arg_0._waiters = collections.deque()


(filename, contents, eol_style=EOL_STYLE_NATIVE, create_dir=True, encoding=None, binary=False)

def Func(arg_0, arg_1, arg_2=arg_3, arg_4=True, arg_5=None, arg_6=False):
    '''
    Create a file with the given contents.

    :param unicode filename:
        Filename and path to be created.

    :param unicode contents:
        The file contents as a string.

    :type eol_style: EOL_STYLE_XXX constant
    :param eol_style:
        Replaces the EOL by the appropriate EOL depending on the eol_style value.
        Considers that all content is using only "\n" as EOL.

    :param bool create_dir:
        If True, also creates directories needed in filename's path

    :param unicode encoding:
        Target file's content encoding. Defaults to sys.getfilesystemencoding()
        Ignored if `binary` = True

    :param bool binary:
        If True, file is created in binary mode. In this case, `contents` must be `bytes` and not
        `unicode`

    :return unicode:
        Returns the name of the file created.

    :raises NotImplementedProtocol:
        If file protocol is not local or FTP

    :raises ValueError:
        If trying to mix unicode `contents` without `encoding`, or `encoding` without
        unicode `contents`

    .. seealso:: FTP LIMITATIONS at this module's doc for performance issues information
    '''
    # Lots of checks when writing binary files
    if arg_6:
        if isinstance(arg_1, six.text_type):
            raise TypeError('contents must be str (bytes) when binary=True')
    else:
        if not isinstance(arg_1, six.text_type):
            raise TypeError('contents must be unicode when binary=False')

        # Replaces eol on each line by the given eol_style.
        arg_1 = _HandleContentsEol(arg_1, arg_2)

        # Encode string and pretend we are using binary to prevent 'open' from automatically
        # changing Eols
        arg_5 = arg_5 or sys.getfilesystemencoding()
        arg_1 = arg_1.encode(arg_5)
        arg_6 = True

    # If asked, creates directory containing file
    if arg_4:
        arg_7 = os.path.dirname(arg_0)
        if arg_7:
            CreateDirectory(arg_7)

    from six.moves.urllib.parse import urlparse
    arg_8 = urlparse(arg_0)

    # Handle local
    if _UrlIsLocal(arg_8):
        # Always writing as binary (see handling above)
        with open(arg_0, 'wb') as oss:
            oss.write(arg_1)

    # Handle FTP
    elif arg_8.scheme == 'ftp':
        # Always writing as binary (see handling above)
        from ._exceptions import NotImplementedProtocol
        raise NotImplementedProtocol(directory_url.scheme)
    else:
        from ._exceptions import NotImplementedProtocol
        raise NotImplementedProtocol(arg_8.scheme)

    return arg_0


def Func ( arg_0 , arg_1 ) : if isinstance ( arg_1 , RegexObject ) : return re . match ( arg_1 , arg_0 ) elif probably_regex ( arg_1 ) : return re . match ( arg_1 , arg_0 , flags = re . IGNORECASE ) else : try : return arg_0 . lower ( ) == arg_1 . lower ( ) except AttributeError : return arg_0 == arg_1

def Func(arg_0, arg_1):
    """Safely attempts to match a pattern or string to a request origin."""
    if isinstance(arg_1, RegexObject):
        return re.match(arg_1, arg_0)
    elif probably_regex(arg_1):
        return re.match(arg_1, arg_0, flags=re.IGNORECASE)
    else:
        try:
            return arg_0.lower() == arg_1.lower()
        except AttributeError:
            return arg_0 == arg_1

Safely attempts to match a pattern or string to a request origin .


def Func(arg_0, arg_1):
        """
        Extract the image pixels within the polygon.

        This function will zero-pad the image if the polygon is partially/fully outside of
        the image.

        Parameters
        ----------
        image : (H,W) ndarray or (H,W,C) ndarray
            The image from which to extract the pixels within the polygon.

        Returns
        -------
        result : (H',W') ndarray or (H',W',C) ndarray
            Pixels within the polygon. Zero-padded if the polygon is partially/fully
            outside of the image.

        """
        ia.do_assert(arg_1.ndim in [2, 3])
        if len(arg_0.exterior) <= 2:
            raise Exception("Polygon must be made up of at least 3 points to extract its area from an image.")

        arg_2 = arg_0.to_bounding_box()
        arg_3 = arg_2.Func(arg_1)
        if arg_0.is_out_of_image(arg_1, fully=True, partly=False):
            return arg_3

        arg_4 = arg_0.xx_int
        arg_5 = arg_0.yy_int
        arg_6 = arg_4 - np.min(arg_4)
        arg_7 = arg_5 - np.min(arg_5)
        arg_8 = np.max(arg_7)
        arg_9 = np.max(arg_6)

        arg_10, arg_11 = skimage.draw.polygon(arg_7, arg_6, shape=(arg_8, arg_9))

        arg_12 = np.zeros((arg_8, arg_9), dtype=np.bool)
        arg_12[arg_10, arg_11] = True

        if arg_1.ndim == 3:
            arg_12 = np.tile(arg_12[:, :, np.newaxis], (1, 1, arg_1.shape[2]))

        return arg_3 * arg_12

Extract the image pixels within the polygon .


(self, openmp=False, as_filename=False, name='kernel')

def Func(arg_0, arg_1=False, arg_2=False, arg_3='kernel'):
        """
        Generate and return compilable source code with kernel function from AST.

        :param openmp: if true, OpenMP code will be generated
        :param as_filename: if true, will save to file and return filename
        :param name: name of kernel function
        """
        assert arg_0.kernel_ast is not None, "AST does not exist, this could be due to running " \
                                            "based on a kernel description rather than code."
        arg_4 = 'kernel'
        if arg_1:
            arg_4 += '-omp'
        arg_4 += '.c'

        arg_5, arg_6 = arg_0._get_intermediate_file(
            arg_4, machine_and_compiler_dependent=False)

        # Use already cached version
        if arg_6:
            arg_7 = arg_5.read()
        else:
            arg_8, arg_9 = arg_0._build_array_declarations()

            # Prepare actual kernel loop nest
            if arg_1:
                # with OpenMP code
                arg_10 = deepcopy(arg_0.get_kernel_loop_nest())
                # find all array references in kernel
                for arg_11 in find_node_type(arg_10, c_ast.ArrayRef):
                    # transform to 1d references
                    transform_multidim_to_1d_ref(arg_11, arg_9)
                arg_12 = [p for p in find_node_type(arg_10, c_ast.Pragma)
                               if 'omp' in p.string]
                # TODO if omp parallel was found, remove it (also replace "parallel for" -> "for")
                # if no omp for pragmas are present, insert suitable ones
                if not arg_12:
                    arg_10.insert(0, c_ast.Pragma("omp for"))
                # otherwise do not change anything
            else:
                # with original code
                arg_10 = deepcopy(arg_0.get_kernel_loop_nest())
                # find all array references in kernel
                for arg_11 in find_node_type(arg_10, c_ast.ArrayRef):
                    # transform to 1d references
                    transform_multidim_to_1d_ref(arg_11, arg_9)

            arg_13 = c_ast.FuncDef(decl=c_ast.Decl(
                arg_3=arg_3, type=arg_0._build_kernel_function_declaration(arg_3=arg_3), quals=[],
                storage=[], funcspec=[], init=None, bitsize=None),
                body=c_ast.Compound(block_items=arg_10),
                param_decls=None)

            # Generate code
            arg_7 = CGenerator().visit(arg_13)

            # Insert missing #includes from template to top of code
            arg_7 = '#include "kerncraft.h"\n\n' + arg_7

            # Store to file
            arg_5.write(arg_7)
        arg_5.close()

        if arg_2:
            return arg_5.name
        else:
            return arg_7

Generate and return compilable source code with kernel function from AST .


def Func(arg_0):
    """Pick two at random, use the LRU of the two.

    The content of loads is ignored.

    Assumes LRU ordering of loads, with oldest first.
    """
    arg_1 = len(arg_0)
    arg_2 = randint(0,arg_1-1)
    arg_3 = randint(0,arg_1-1)
    return min(arg_2,arg_3)

Pick two at random use the LRU of the two .