def Func ( arg_0 ) : if "TCON" in arg_0 : arg_0 [ "TCON" ] . genres = arg_0 [ "TCON" ] . genres if arg_0 . version < arg_0 . _V23 : arg_2 = arg_0 . getall ( "APIC" ) arg_3 = { "PNG" : "image/png" , "JPG" : "image/jpeg" } arg_0 . delall ( "APIC" ) for arg_4 in arg_2 : arg_5 = APIC ( encoding = arg_4 . encoding , mime = arg_3 . get ( arg_4 . mime , arg_4 . mime ) , type = arg_4 . type , desc = arg_4 . desc , data = arg_4 . data ) arg_0 . add ( arg_5 ) arg_0 . delall ( "LINK" )

def Func(arg_0):
        """Updates done by both v23 and v24 update"""

        if "TCON" in arg_0:
            # Get rid of "(xx)Foobr" format.
            arg_0["TCON"].genres = arg_0["TCON"].genres

        if arg_0.version < arg_0._V23:
            # ID3v2.2 PIC frames are slightly different.
            arg_2 = arg_0.getall("APIC")
            arg_3 = {"PNG": "image/png", "JPG": "image/jpeg"}
            arg_0.delall("APIC")
            for arg_4 in arg_2:
                arg_5 = APIC(
                    encoding=arg_4.encoding, mime=arg_3.get(arg_4.mime, arg_4.mime),
                    type=arg_4.type, desc=arg_4.desc, data=arg_4.data)
                arg_0.add(arg_5)

            # ID3v2.2 LNK frames are just way too different to upgrade.
            arg_0.delall("LINK")


def Func ( arg_0 , arg_1 = False ) : try : arg_2 = arg_0 . FuncA ( ) arg_3 = arg_0 . FuncB ( ) if arg_2 and arg_3 : arg_0 . makeAB ( ) arg_0 . calculateFields ( ) arg_0 . updateObservers ( ) return True except : ekm_log ( traceback . format_exc ( sys . exc_info ( ) ) ) return False

def Func(arg_0, arg_1 = False):
        """ Combined A and B read for V4 meter.

        Args:
            send_terminator (bool): Send termination string at end of read.

        Returns:
            bool: True on completion.
        """
        try:
            arg_2 = arg_0.FuncA()
            arg_3 = arg_0.FuncB()
            if arg_2 and arg_3:
                arg_0.makeAB()
                arg_0.calculateFields()
                arg_0.updateObservers()
                return True
        except:
            ekm_log(traceback.format_exc(sys.exc_info()))

        return False


def
Func
(
arg_0
,
arg_1
,
arg_2
=
,
arg_3
=
''
)
:
arg_4
=
0
if
arg_2
==
'str'
or
arg_0
.
out
==
'str'
or
isinstance
(
arg_0
.
out
,
StringIO
.
StringIO
)
:
arg_5
=
arg_0
.
out
arg_0
.
out
=
StringIO
.
StringIO
(
)
arg_4
=
1
elif
arg_2
is
not
:
arg_0
.
out
=
arg_2
if
arg_3
==
'NoColor'
:
arg_6
=
False
arg_0
.
out
.
write
(
arg_1
)
if
arg_4
:
return
arg_1
,
arg_6
else
:
return
,
arg_6
arg_7
=
arg_0
.
color_table
[
arg_3
]
.
colors
arg_0
.
colors
=
arg_7
arg_0
.
raw
=
arg_1
.
expandtabs
(
)
.
rstrip
(
)
arg_0
.
lines
=
[
0
,
0
]
arg_9
=
0
arg_10
=
arg_0
.
raw
.
find
arg_11
=
arg_0
.
lines
.
append
while
1
:
arg_9
=
arg_10
(
'\n'
,
arg_9
)
+
1
if
not
arg_9
:
break
arg_11
(
arg_9
)
arg_11
(
len
(
arg_0
.
raw
)
)
arg_0
.
pos
=
0
arg_12
=
StringIO
.
StringIO
(
arg_0
.
raw
)
arg_6
=
False
try
:
for
arg_13
in
generate_tokens
(
arg_12
.
readline
)
:
arg_0
(
*
arg_13
)
except
tokenize
.
TokenError
as
ex
:
arg_14
=
ex
.
args
[
0
]
arg_15
=
ex
.
args
[
1
]
[
0
]
arg_0
.
out
.
write
(
"%s\n\n*** ERROR: %s%s%s\n"
%
(
arg_7
[
token
.
ERRORTOKEN
]
,
arg_14
,
arg_0
.
raw
[
arg_0
.
lines
[
arg_15
]
:
]
,
arg_7
.
normal
)
)
arg_6
=
True
arg_0
.
out
.
write
(
arg_7
.
normal
+
'\n'
)
if
arg_4
:
arg_16
=
arg_0
.
out
.
getvalue
(
)
arg_0
.
out
=
arg_5
return
(
arg_16
,
arg_6
)
return
(
,
arg_6
)

def Func(arg_0, arg_1, arg_2 = None, arg_3 = ''):
        """ Parse and send the colored source.

        If out and scheme are not specified, the defaults (given to
        constructor) are used.

        out should be a file-type object. Optionally, out can be given as the
        string 'str' and the parser will automatically return the output in a
        string."""

        arg_4 = 0
        if arg_2 == 'str' or arg_0.out == 'str' or \
           isinstance(arg_0.out,StringIO.StringIO):
            # XXX - I don't really like this state handling logic, but at this
            # point I don't want to make major changes, so adding the
            # isinstance() check is the simplest I can do to ensure correct
            # behavior.
            arg_5 = arg_0.out
            arg_0.out = StringIO.StringIO()
            arg_4 = 1
        elif arg_2 is not None:
            arg_0.out = arg_2

        # Fast return of the unmodified input for NoColor scheme
        if arg_3 == 'NoColor':
            arg_6 = False
            arg_0.out.write(arg_1)
            if arg_4:
                return arg_1,arg_6
            else:
                return None,arg_6

        # local shorthands
        arg_7 = arg_0.color_table[arg_3].colors
        arg_0.colors = arg_7 # put in object so __call__ sees it

        # Remove trailing whitespace and normalize tabs
        arg_0.raw = arg_1.expandtabs().rstrip()

        # store line offsets in self.lines
        arg_0.lines = [0, 0]
        arg_9 = 0
        arg_10 = arg_0.raw.find
        arg_11 = arg_0.lines.append
        while 1:
            arg_9 = arg_10('\n', arg_9) + 1
            if not arg_9: break
            arg_11(arg_9)
        arg_11(len(arg_0.raw))

        # parse the source and write it
        arg_0.pos = 0
        arg_12 = StringIO.StringIO(arg_0.raw)

        arg_6 = False
        try:
            for arg_13 in generate_tokens(arg_12.readline):
                arg_0(*arg_13)
        except tokenize.TokenError as ex:
            arg_14 = ex.args[0]
            arg_15 = ex.args[1][0]
            arg_0.out.write("%s\n\n*** ERROR: %s%s%s\n" %
                           (arg_7[token.ERRORTOKEN],
                            arg_14, arg_0.raw[arg_0.lines[arg_15]:],
                            arg_7.normal)
                           )
            arg_6 = True
        arg_0.out.write(arg_7.normal+'\n')
        if arg_4:
            arg_16 = arg_0.out.getvalue()
            arg_0.out = arg_5
            return (arg_16, arg_6)
        return (None, arg_6)


Gets the sum of the data portions of all datapoints within

def Func ( arg_0 ) : arg_1 = arg_0 . raw ( ) arg_2 = 0 for arg_3 in range ( len ( arg_1 ) ) : arg_2 += arg_1 [ arg_3 ] [ "d" ] return arg_2

def Func(arg_0):
        """Gets the Func of the data portions of all datapoints within"""
        arg_1 = arg_0.raw()
        arg_2 = 0
        for arg_3 in range(len(arg_1)):
            arg_2 += arg_1[arg_3]["d"]
        return arg_2


def Func ( ) : arg_0 = os . environ . copy ( ) arg_0 [ "PEX_ROOT" ] = os . path . join ( os . path . abspath ( '.' ) , ".pex" ) arg_1 = HeronExecutor ( sys . argv , arg_0 ) arg_1 . initialize ( ) start ( arg_1 )

def Func():
  """Register exit handlers, initialize the executor and run it."""
  # Since Heron on YARN runs as headless users, pex compiled
  # binaries should be exploded into the container working
  # directory. In order to do this, we need to set the
  # PEX_ROOT shell environment before forking the processes
  arg_0 = os.environ.copy()
  arg_0["PEX_ROOT"] = os.path.join(os.path.abspath('.'), ".pex")

  # Instantiate the executor, bind it to signal handlers and launch it
  arg_1 = HeronExecutor(sys.argv, arg_0)
  arg_1.initialize()

  start(arg_1)

Register exit handlers initialize the executor and run it .


def Func(arg_0, arg_1):
        """
        decode agents jsons, count diffs
        """
        arg_2 = []
        if arg_1:
            for arg_3 in arg_1.split('\n'):
                try:
                    if arg_3:
                        arg_4 = {}
                        arg_5 = json.loads(arg_3)
                        for arg_6, arg_7 in arg_5.iteritems():
                            for arg_8, arg_9 in arg_7.iteritems():
                                # key sample: diskio-sda1_io_time
                                # key_group sample: diskio
                                # key_name sample: io_time
                                try:
                                    arg_10, arg_11 = arg_8.split('_')[0].split('-')[0], '_'.join(arg_8.split('_')[1:])
                                except:  # noqa: E722
                                    arg_10, arg_11 = arg_8.split('_')[0], '_'.join(arg_8.split('_')[1:])
                                if arg_10 in decoder.diff_metrics.keys():
                                    if arg_11 in decoder.diff_metrics[arg_10]:
                                        arg_12 = decoder.find_common_names(
                                            arg_8)
                                        if arg_0.prev_check:
                                            try:
                                                arg_9 = arg_5[arg_6][arg_8] - \
                                                    arg_0.prev_check[arg_8]
                                            except KeyError:
                                                logger.debug(
                                                    'There is no diff value for metric %s.\n'
                                                    'Timestamp: %s. Is it initial data?', arg_8, arg_6, exc_info=True)
                                                arg_9 = 0
                                            arg_4[arg_12] = arg_9
                                    else:
                                        arg_12 = decoder.find_common_names(
                                            arg_8)
                                        arg_4[arg_12] = arg_9
                                else:
                                    arg_12 = decoder.find_common_names(
                                        arg_8)
                                    arg_4[arg_12] = arg_9
                            arg_0.prev_check = arg_5[arg_6]
                            arg_2.append((arg_6, arg_4))
                except ValueError:
                    logger.error(
                        'Telegraf agent send trash to output: %s', arg_3)
                    logger.debug(
                        'Telegraf agent data block w/ trash: %s',
                        exc_info=True)
                    return []
                except BaseException:
                    logger.error(
                        'Exception trying to parse agent data: %s',
                        arg_3,
                        exc_info=True)
                    return []
            if arg_2:
                return arg_2


def Func(arg_0, arg_1):
        """
        Parse MARC XML document to dicts, which are contained in
        self.controlfields and self.datafields.

        Args:
            xml (str or HTMLElement): input data

        Also detect if this is oai marc format or not (see elf.oai_marc).
        """
        if not isinstance(arg_1, HTMLElement):
            arg_1 = dhtmlparser.parseString(str(arg_1))

        # check if there are any records
        arg_2 = arg_1.find("record")
        if not arg_2:
            raise ValueError("There is no <record> in your MARC XML document!")
        arg_2 = arg_2[0]

        arg_0.oai_marc = len(arg_2.find("oai_marc")) > 0

        # leader is separate only in marc21
        if not arg_0.oai_marc:
            arg_4 = arg_2.find("leader")
            if len(arg_4) >= 1:
                arg_0.leader = arg_4[0].getContent()

        # parse body in respect of OAI MARC format possibility
        if arg_0.oai_marc:
            arg_0._parse_control_fields(arg_2.find("fixfield"), "id")
            arg_0._parse_data_fields(arg_2.find("varfield"), "id", "label")
        else:
            arg_0._parse_control_fields(arg_2.find("controlfield"), "tag")
            arg_0._parse_data_fields(arg_2.find("datafield"), "tag", "code")

        # for backward compatibility of MARC XML with OAI
        if arg_0.oai_marc and "LDR" in arg_0.controlfields:
            arg_0.leader = arg_0.controlfields["LDR"]

Parse MARC XML document to dicts which are contained in self . controlfields and self . datafields .


def Func ( arg_0 , * arg_1 ) : def check ( arg_2 , * arg_3 , ** arg_4 ) : @ require_api_auth ( ) @ require_oauth_scopes ( * arg_1 ) def can ( arg_5 ) : return arg_0 ( arg_2 ) return type ( 'CheckOAuth2Scope' , ( ) , { 'can' : can } ) ( ) return check

def Func(arg_0, *arg_1):
    """Base permission factory that check OAuth2 scope and can_method.

    :param can_method: Permission check function that accept a record in input
        and return a boolean.
    :param myscopes: List of scopes required to permit the access.
    :returns: A :class:`flask_principal.Permission` factory.
    """
    def check(arg_2, *arg_3, **arg_4):
        @require_api_auth()
        @require_oauth_scopes(*arg_1)
        def can(arg_5):
            return arg_0(arg_2)

        return type('CheckOAuth2Scope', (), {'can': can})()
    return check

Base permission factory that check OAuth2 scope and can_method .


def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
)
:
if
not
hasattr
(
arg_0
,
'__path__'
)
:
return
for
arg_4
in
arg_1
:
if
not
hasattr
(
arg_4
,
'rindex'
)
:
raise
TypeError
(
"Item in ``from list'' not a string"
)
if
arg_4
==
'*'
:
if
arg_3
:
continue
try
:
arg_5
=
arg_0
.
__all__
except
AttributeError
:
pass
else
:
arg_6
=
Func
(
arg_0
,
arg_5
,
arg_2
,
1
)
if
not
arg_6
:
return
0
elif
not
hasattr
(
arg_0
,
arg_4
)
:
import_submodule
(
arg_0
,
arg_4
,
arg_2
+
'.'
+
arg_4
)

def Func(arg_0, arg_1, arg_2, arg_3):
    """Handle 'from module import a, b, c' imports."""
    if not hasattr(arg_0, '__path__'):
        return
    for arg_4 in arg_1:
        if not hasattr(arg_4, 'rindex'):
            raise TypeError("Item in ``from list'' not a string")
        if arg_4 == '*':
            if arg_3:
                continue # avoid endless recursion
            try:
                arg_5 = arg_0.__all__
            except AttributeError:
                pass
            else:
                arg_6 = Func(arg_0, arg_5, arg_2, 1)
                if not arg_6:
                    return 0
        elif not hasattr(arg_0, arg_4):
            import_submodule(arg_0, arg_4, arg_2 + '.' + arg_4)

Handle from module import a b c imports .


def Func(arg_0, arg_1, *arg_2, **arg_3):
        """Submits work to the the outgoing_q.

        The outgoing_q is an external process listens on this
        queue for new work. This method is simply pass through and behaves like a
        Func call as described here `Python docs: <https://docs.python.org/3/library/concurrent.futures.html#concurrent.futures.ThreadPoolExecutor>`_

        Args:
            - func (callable) : Callable function
            - *args (list) : List of arbitrary positional arguments.

        Kwargs:
            - **kwargs (dict) : A dictionary of arbitrary keyword args for func.

        Returns:
              Future
        """
        arg_4 = uuid.uuid4()

        logger.debug("Pushing function {} to queue with args {}".format(arg_1, arg_2))

        arg_0.tasks[arg_4] = Future()

        arg_6 = pack_apply_message(arg_1, arg_2, arg_3,
                                    buffer_threshold=1024 * 1024,
                                    item_threshold=1024)

        arg_7 = {"task_id": arg_4,
               "buffer": arg_6}

        # Post task to the the outgoing queue
        arg_0.outgoing_q.put(arg_7)

        # Return the future
        return arg_0.tasks[arg_4]

Submits work to the the outgoing_q.

        The outgoing_q is an external process listens on this
        queue for new work. This method is simply pass through and behaves like a
        submit call as described here `Python docs: <https://docs.python.org/3/library/concurrent.futures.html#concurrent.futures.ThreadPoolExecutor>`_

        Args:
            - func (callable) : Callable function
            - *args (list) : List of arbitrary positional arguments.

        Kwargs:
            - **kwargs (dict) : A dictionary of arbitrary keyword args for func.

        Returns:
              Future


(self, node,
                          copy_leaves=True,
                          overwrite=False,
                          with_links=True)

def Func(arg_0, arg_1,
                          arg_2=True,
                          arg_3=False,
                          arg_4=True):
        """Pass a ``node`` to insert the full tree to the trajectory.

        Considers all links in the given node!
        Ignored nodes already found in the current trajectory.

        :param node: The node to insert

        :param copy_leaves:

            If leaves should be **shallow** copied or simply referred to by both trees.
            **Shallow** copying is established using the copy module.

            Accepts the setting ``'explored'`` to only copy explored parameters.
            Note that ``v_full_copy`` determines how these will be copied.

        :param overwrite:

            If existing elemenst should be overwritten. Requries ``__getstate__`` and
            ``__setstate__`` being implemented in the leaves.

        :param with_links: If links should be ignored or followed and copied as well

        :return: The corresponding (new) node in the tree.

        """

        def _copy_skeleton(arg_5, arg_6):
            """Copies the skeleton of from `node_out` to `node_in`"""
            arg_7 = arg_6.v_annotations
            arg_5._annotations = arg_7
            arg_5.v_comment = arg_6.v_comment

        def _add_leaf(arg_10):
            """Adds a leaf to the trajectory"""
            arg_11 = arg_10.v_full_name
            try:
                arg_12 = arg_0.f_get(arg_11,
                                        arg_4=False,
                                        shortcuts=False,
                                        auto_load=False)
                if arg_3:
                    arg_12.__setstate__(arg_10.__getstate__())
                return arg_12
            except AttributeError:
                pass
            if arg_2 is True or (arg_2 == 'explored' and
                                           arg_10.v_is_parameter and arg_10.v_explored):
                arg_13 = arg_0.f_add_leaf(cp.copy(arg_10))
            else:
                arg_13 = arg_0.f_add_leaf(arg_10)
            if arg_13.v_is_parameter and arg_13.v_explored:
                arg_0._explored_parameters[arg_13.v_full_name] = arg_13
            return arg_13

        def _add_group(arg_16):
            """Adds a new group to the trajectory"""
            arg_17 = arg_16.v_full_name
            try:
                arg_18 = arg_0.f_get(arg_17,
                                             arg_4=False,
                                             shortcuts=False,
                                             auto_load=False)
                if arg_3:
                    _copy_skeleton(arg_18, arg_16)
                return arg_18
            except AttributeError:
                pass
            arg_19 = arg_0.f_add_group(arg_17)
            _copy_skeleton(arg_19, arg_16)
            return arg_19

        arg_20 = arg_0._is_run
        arg_0._is_run = False  # So that we can copy Config Groups and Config Data
        try:
            if arg_1.v_is_leaf:
                return _add_leaf(arg_1)
            elif arg_1.v_is_group:
                arg_22 = arg_1.v_root
                if arg_22 is arg_0:
                    raise RuntimeError('You cannot copy a given tree to itself!')
                arg_23 = _add_group(arg_1)
                arg_24 = arg_1.f_iter_nodes(recursive=True, arg_4=arg_4)
                arg_25 = []
                if arg_1._links:
                    arg_25.append(arg_1)
                for arg_26 in arg_24:
                    if arg_26.v_is_leaf:
                        _add_leaf(arg_26)
                    else:
                        _add_group(arg_26)
                        if arg_26._links:
                            arg_25.append(arg_26)

                if arg_4:
                    for arg_27 in arg_25:
                        arg_28 = arg_0.f_get(arg_27.v_full_name, arg_4=False,
                                          shortcuts=False, auto_load=False)
                        arg_29 = set(arg_28._links.keys())
                        arg_30 = set(arg_27._links.keys())
                        arg_31 = arg_30 - arg_29
                        for arg_32 in arg_31:
                            arg_33 = arg_27._links[arg_32].v_full_name
                            arg_28.f_add_link(arg_32, arg_33)

                return arg_23
            else:
                raise RuntimeError('You shall not pass!')
        except Exception:
            arg_0._is_run = arg_20

Pass a node to insert the full tree to the trajectory .


def Func ( arg_0 , arg_1 = arg_2 ) : if arg_1 == arg_2 : arg_0 . img = arg_0 . img . transpose ( Image . FLIP_LEFT_RIGHT ) if arg_1 == VERTICAL : arg_0 . img = arg_0 . img . transpose ( Image . FLIP_TOP_BOTTOM )

def Func(arg_0, arg_1=arg_2):

        """Flips the layer, either HORIZONTAL or VERTICAL.

        """

        if arg_1 == arg_2:
            arg_0.img = arg_0.img.transpose(Image.FLIP_LEFT_RIGHT)
        if arg_1 == VERTICAL:
            arg_0.img = arg_0.img.transpose(Image.FLIP_TOP_BOTTOM)

Flips the layer either HORIZONTAL or VERTICAL .


def
Func
(
arg_0
,
arg_1
=
True
,
arg_2
=
)
:
if
arg_2
is
not
and
len
(
arg_2
)
!=
len
(
arg_0
)
:
raise
ValueError
(
'Wrong number of column colors'
)
arg_3
=
[
max
(
len
(
cell
)
for
cell
in
column
)
for
column
in
arg_0
]
arg_4
=
max
(
len
(
column
)
for
column
in
arg_0
)
arg_5
=
'\n'
.
join
(
render_row
(
i
,
arg_0
,
arg_3
,
arg_2
)
for
i
in
range
(
arg_4
)
)
if
arg_1
:
arg_6
=
'+%s+'
%
'|'
.
join
(
'-'
*
(
w
+
2
)
for
w
in
arg_3
)
return
'%s\n%s\n%s'
%
(
arg_6
,
arg_5
,
arg_6
)
else
:
return
arg_5

def Func(arg_0, arg_1=True, arg_2=None):
    """
    Renders a list of columns.

    :param columns: A list of columns, where each column is a list of strings.
    :type columns: [[``str``]]
    :param write_borders: Whether to write the top and bottom borders.
    :type write_borders: ``bool``
    :param column_colors: A list of coloring functions, one for each column.
                          Optional.
    :type column_colors: [``str`` -> ``str``] or ``NoneType``

    :return: The rendered columns.
    :rtype: ``str``
    """
    if arg_2 is not None and len(arg_2) != len(arg_0):
        raise ValueError('Wrong number of column colors')
    arg_3 = [max(len(cell) for cell in column) for column in arg_0]
    arg_4 = max(len(column) for column in arg_0)
    arg_5 = '\n'.join(render_row(i, arg_0, arg_3, arg_2)
                       for i in range(arg_4))
    if arg_1:
        arg_6 = '+%s+' % '|'.join('-' * (w + 2) for w in arg_3)
        return '%s\n%s\n%s' % (arg_6, arg_5, arg_6)
    else:
        return arg_5


def Func ( arg_0 ) : for arg_1 , arg_1 , arg_2 in walk ( arg_0 ) : for arg_3 in arg_2 : yield arg_0 . get ( arg_3 , content = True )

def Func(arg_0):
    """
    Iterate over the contents of all files visible to ``mgr``.
    """
    for arg_1, arg_1, arg_2 in walk(arg_0):
        for arg_3 in arg_2:
            yield arg_0.get(arg_3, content=True)

Iterate over the contents of all files visible to mgr .


return self.get_users_for_course(
            self._sis_id(sis_course_id, sis_field="course"), params)

def Func ( arg_0 , arg_1 , arg_2 = { } ) : return arg_0 . get_users_for_course ( arg_0 . _sis_id ( arg_1 , sis_field = "course" ) , arg_2 )

def Func(arg_0, arg_1, arg_2={}):
        """
        Returns a list of users for the given sis course id.
        """
        return arg_0.get_users_for_course(
            arg_0._sis_id(arg_1, sis_field="course"), arg_2)

Returns a list of users for the given sis course id .


(directory, safe_mode=True,
                       include_examples=None)

def
Func
(
arg_0
,
arg_1
=
True
,
arg_2
=
)
:
if
arg_2
is
:
arg_2
=
conf
.
getboolean
(
'core'
,
'LOAD_EXAMPLES'
)
arg_3
=
[
]
if
arg_0
is
:
return
[
]
elif
arg_12
.
path
.
isfile
(
arg_0
)
:
return
[
arg_0
]
elif
arg_12
.
path
.
isdir
(
arg_0
)
:
arg_4
=
{
}
for
arg_5
,
arg_6
,
arg_7
in
arg_12
.
walk
(
arg_0
,
followlinks
=
True
)
:
arg_8
=
arg_4
.
get
(
arg_5
,
[
]
)
arg_9
=
arg_12
.
path
.
join
(
arg_5
,
'.airflowignore'
)
if
arg_12
.
path
.
isfile
(
arg_9
)
:
with
open
(
arg_9
,
'r'
)
as
arg_15
:
arg_8
+=
[
re
.
compile
(
arg_10
)
for
arg_10
in
arg_15
.
read
(
)
.
split
(
'\n'
)
if
arg_10
]
arg_6
[
:
]
=
[
arg_11
for
arg_11
in
arg_6
if
not
any
(
arg_10
.
search
(
arg_12
.
path
.
join
(
arg_5
,
arg_11
)
)
for
arg_10
in
arg_8
)
]
for
arg_11
in
arg_6
:
arg_4
[
arg_12
.
path
.
join
(
arg_5
,
arg_11
)
]
=
arg_8
for
arg_15
in
arg_7
:
try
:
arg_16
=
arg_12
.
path
.
join
(
arg_5
,
arg_15
)
if
not
arg_12
.
path
.
isfile
(
arg_16
)
:
continue
arg_17
,
arg_18
=
arg_12
.
path
.
splitext
(
arg_12
.
path
.
split
(
arg_16
)
[
1
]
)
if
arg_18
!=
'.py'
and
not
zipfile
.
is_zipfile
(
arg_16
)
:
continue
if
any
(
[
re
.
findall
(
arg_10
,
arg_16
)
for
arg_10
in
arg_8
]
)
:
continue
arg_19
=
True
if
arg_1
and
not
zipfile
.
is_zipfile
(
arg_16
)
:
with
open
(
arg_16
,
'rb'
)
as
fp
:
arg_20
=
fp
.
read
(
)
arg_19
=
all
(
[
s
in
arg_20
for
s
in
(
b'DAG'
,
b'airflow'
)
]
)
if
not
arg_19
:
continue
arg_3
.
append
(
arg_16
)
except
Exception
:
arg_21
=
LoggingMixin
(
)
.
log
arg_21
.
exception
(
"Error while examining %s"
,
arg_15
)
if
arg_2
:
import
airflow
.
example_dags
arg_22
=
airflow
.
example_dags
.
__path__
[
0
]
arg_3
.
extend
(
Func
(
arg_22
,
arg_1
,
False
)
)
return
arg_3

def Func(arg_0, arg_1=True,
                       arg_2=None):
    """
    Traverse a directory and look for Python files.

    :param directory: the directory to traverse
    :type directory: unicode
    :param safe_mode: whether to use a heuristic to determine whether a file
        contains Airflow DAG definitions
    :return: a list of paths to Python files in the specified directory
    :rtype: list[unicode]
    """
    if arg_2 is None:
        arg_2 = conf.getboolean('core', 'LOAD_EXAMPLES')
    arg_3 = []
    if arg_0 is None:
        return []
    elif arg_12.path.isfile(arg_0):
        return [arg_0]
    elif arg_12.path.isdir(arg_0):
        arg_4 = {}
        for arg_5, arg_6, arg_7 in arg_12.walk(arg_0, followlinks=True):
            arg_8 = arg_4.get(arg_5, [])
            arg_9 = arg_12.path.join(arg_5, '.airflowignore')
            if arg_12.path.isfile(arg_9):
                with open(arg_9, 'r') as arg_15:
                    # If we have new patterns create a copy so we don't change
                    # the previous list (which would affect other subdirs)
                    arg_8 += [re.compile(arg_10) for arg_10 in arg_15.read().split('\n') if arg_10]

            # If we can ignore any subdirs entirely we should - fewer paths
            # to walk is better. We have to modify the ``dirs`` array in
            # place for this to affect os.walk
            arg_6[:] = [
                arg_11
                for arg_11 in arg_6
                if not any(arg_10.search(arg_12.path.join(arg_5, arg_11)) for arg_10 in arg_8)
            ]

            # We want patterns defined in a parent folder's .airflowignore to
            # apply to subdirs too
            for arg_11 in arg_6:
                arg_4[arg_12.path.join(arg_5, arg_11)] = arg_8

            for arg_15 in arg_7:
                try:
                    arg_16 = arg_12.path.join(arg_5, arg_15)
                    if not arg_12.path.isfile(arg_16):
                        continue
                    arg_17, arg_18 = arg_12.path.splitext(
                        arg_12.path.split(arg_16)[-1])
                    if arg_18 != '.py' and not zipfile.is_zipfile(arg_16):
                        continue
                    if any([re.findall(arg_10, arg_16) for arg_10 in arg_8]):
                        continue

                    # Heuristic that guesses whether a Python file contains an
                    # Airflow DAG definition.
                    arg_19 = True
                    if arg_1 and not zipfile.is_zipfile(arg_16):
                        with open(arg_16, 'rb') as fp:
                            arg_20 = fp.read()
                            arg_19 = all(
                                [s in arg_20 for s in (b'DAG', b'airflow')])

                    if not arg_19:
                        continue

                    arg_3.append(arg_16)
                except Exception:
                    arg_21 = LoggingMixin().log
                    arg_21.exception("Error while examining %s", arg_15)
    if arg_2:
        import airflow.example_dags
        arg_22 = airflow.example_dags.__path__[0]
        arg_3.extend(Func(arg_22, arg_1, False))
    return arg_3

Traverse a directory and look for Python files .


def Func ( arg_0 , arg_1 , arg_2 = 1 ) : arg_3 = "" for arg_4 in xrange ( len ( arg_1 ) ) : arg_5 = arg_1 [ arg_4 ] if arg_5 == None : arg_3 += "<reset>" if arg_4 < len ( arg_1 ) - 1 : arg_3 += "\n" else : arg_3 += arg_0 . patternMachine . prettyPrintPattern ( arg_5 , arg_2 = arg_2 ) return arg_3

def Func(arg_0, arg_1, arg_2=1):
    """
    Pretty print a sequence.

    @param sequence  (list) Sequence
    @param verbosity (int)  Verbosity level

    @return (string) Pretty-printed text
    """
    arg_3 = ""

    for arg_4 in xrange(len(arg_1)):
      arg_5 = arg_1[arg_4]

      if arg_5 == None:
        arg_3 += "<reset>"
        if arg_4 < len(arg_1) - 1:
          arg_3 += "\n"
      else:
        arg_3 += arg_0.patternMachine.prettyPrintPattern(arg_5,
                                                       arg_2=arg_2)

    return arg_3


def Func ( arg_0 ) : if hasattr ( sys , 'pypy_version_info' ) : arg_1 = 'site-packages' else : arg_1 = os . path . join ( 'lib' , 'python' ) return os . path . join ( arg_0 , arg_1 )

def Func(arg_0):
    """Return the lib dir under the 'home' installation scheme"""
    if hasattr(sys, 'pypy_version_info'):
        arg_1 = 'site-packages'
    else:
        arg_1 = os.path.join('lib', 'python')
    return os.path.join(arg_0, arg_1)

Return the lib dir under the home installation scheme


def Func ( arg_0 ) : def Func_func ( arg_1 ) : arg_2 = lambda x : get_real_fieldname ( arg_0 , x ) if getattr ( arg_1 , arg_2 ( get_language ( ) ) , None ) : arg_3 = getattr ( arg_1 , arg_2 ( get_language ( ) ) ) elif getattr ( arg_1 , arg_2 ( get_language ( ) [ : 2 ] ) , None ) : arg_3 = getattr ( arg_1 , arg_2 ( get_language ( ) [ : 2 ] ) ) else : arg_4 = fallback_language ( ) if getattr ( arg_1 , arg_2 ( arg_4 ) , None ) : arg_3 = getattr ( arg_1 , arg_2 ( arg_4 ) , None ) else : arg_3 = getattr ( arg_1 , arg_2 ( settings . LANGUAGE_CODE ) , None ) return arg_3 return Func_func

def Func(arg_0):
    '''
    When accessing to the name of the field itself, the value
    in the current language will be returned. Unless it's set,
    the value in the default language will be returned.
    '''

    def Func_func(arg_1):
        arg_2 = lambda x: get_real_fieldname(arg_0, x)

        if getattr(arg_1, arg_2(get_language()), None):
            arg_3 = getattr(arg_1, arg_2(get_language()))
        elif getattr(arg_1, arg_2(get_language()[:2]), None):
            arg_3 = getattr(arg_1, arg_2(get_language()[:2]))
        else:
            arg_4 = fallback_language()
            if getattr(arg_1, arg_2(arg_4), None):
                arg_3 = getattr(arg_1, arg_2(arg_4), None)
            else:
                arg_3 = getattr(arg_1, arg_2(settings.LANGUAGE_CODE), None)
        return arg_3

    return Func_func

When accessing to the name of the field itself the value in the current language will be returned . Unless it s set the value in the default language will be returned .


def Func ( arg_0 , arg_1 = None ) : if ( len ( arg_0 . all_graphs ) > 1 ) and ( arg_0 . select_graph ) : arg_2 = arg_0 . edit_traits ( arg_1 = arg_1 , view = "all_graphs_view" ) if not arg_2 . result : return None if arg_0 . selected_graph is not None : return arg_0 . selected_graph else : return arg_0 . model

def Func(arg_0, arg_1=None):
        """ Displays a dialog for graph selection if more than one exists.
            Returns None if the dialog is canceled.
        """

        if (len(arg_0.all_graphs) > 1) and (arg_0.select_graph):
            arg_2 = arg_0.edit_traits(arg_1 = arg_1,
                                      view   = "all_graphs_view")
            if not arg_2.result:
                return None

        if arg_0.selected_graph is not None:
            return arg_0.selected_graph
        else:
            return arg_0.model

Displays a dialog for graph selection if more than one exists . Returns None if the dialog is canceled .


def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
)
:
if
arg_0
.
_headers
:
print
(
"\n  Step 2: Filtering reads "
)
if
not
arg_0
.
samples
.
keys
(
)
:
raise
IPyradWarningExit
(
FIRST_RUN_1
)
arg_1
=
_get_samples
(
arg_0
,
arg_1
)
if
not
arg_2
:
if
all
(
[
arg_4
.
stats
.
state
>=
2
for
arg_4
in
arg_1
]
)
:
print
(
EDITS_EXIST
.
format
(
len
(
arg_1
)
)
)
return
assemble
.
rawedit
.
run2
(
arg_0
,
arg_1
,
arg_2
,
arg_3
)

def Func(arg_0, arg_1, arg_2, arg_3):
        """ hidden wrapped function to start step 2"""

        ## print header
        if arg_0._headers:
            print("\n  Step 2: Filtering reads ")

        ## If no samples in this assembly then it means you skipped step1,
        if not arg_0.samples.keys():
            raise IPyradWarningExit(FIRST_RUN_1)

        ## Get sample objects from list of strings, if API.
        arg_1 = _get_samples(arg_0, arg_1)

        if not arg_2:
            ## print warning and skip if all are finished
            if all([arg_4.stats.state >= 2 for arg_4 in arg_1]):
                print(EDITS_EXIST.format(len(arg_1)))
                return

        ## Run samples through rawedit
        assemble.rawedit.run2(arg_0, arg_1, arg_2, arg_3)


def Func ( arg_0 , arg_1 , arg_2 = 40 ) : arg_3 = [ ] for arg_4 in arg_0 . components_ : arg_5 = [ arg_1 [ i ] for i in arg_4 . argsort ( ) [ : - arg_2 - 1 : - 1 ] ] arg_3 += [ arg_5 ] return arg_3

def Func(arg_0, arg_1, arg_2=40):
    """ Return top forty words from each topic in trained topic model.
    """
    arg_3 = []
    for arg_4 in arg_0.components_:
        arg_5 = [arg_1[i] for i in arg_4.argsort()[:-arg_2-1:-1]]
        arg_3 += [arg_5]
    return arg_3

Return top forty words from each topic in trained topic model .


def Func ( arg_0 , arg_1 , arg_2 ) : if arg_2 is None : arg_3 = os . open ( os . devnull , os . O_RDWR ) else : arg_3 = arg_2 . fileno ( ) os . dup2 ( arg_3 , arg_1 . fileno ( ) )

def Func(arg_0, arg_1, arg_2):
        """Redirect a system stream to the provided target."""
        if arg_2 is None:
            arg_3 = os.open(os.devnull, os.O_RDWR)
        else:
            arg_3 = arg_2.fileno()
        os.dup2(arg_3, arg_1.fileno())

Redirect a system stream to the provided target .


def Func ( arg_0 ) : arg_1 = pyinotify . WatchManager ( ) arg_0 . notifier = pyinotify . Notifier ( arg_1 , default_proc_fun = arg_0 . callback ) arg_1 . add_Func ( arg_0 . directory , pyinotify . ALL_EVENTS ) try : arg_0 . notifier . loop ( ) except ( KeyboardInterrupt , AttributeError ) : print_notification ( "Stopping" ) finally : arg_0 . notifier . stop ( ) arg_0 . terminate_processes ( )

def Func(arg_0):
        """
            Watches directory for changes
        """
        arg_1 = pyinotify.WatchManager()
        arg_0.notifier = pyinotify.Notifier(arg_1, default_proc_fun=arg_0.callback)
        arg_1.add_Func(arg_0.directory, pyinotify.ALL_EVENTS)
        try:
            arg_0.notifier.loop()
        except (KeyboardInterrupt, AttributeError):
            print_notification("Stopping")
        finally:
            arg_0.notifier.stop()
            arg_0.terminate_processes()


def Func(arg_0, arg_1):
        """
        Find all the arguments required by name

        :param name: name of the argument the find the dependencies

        :return: list of dependant arguments
        """
        arg_2 = set([arg_1])
        arg_3 = arg_0.get(arg_1)
        for arg_4 in arg_3.Func:
            arg_5 = arg_0.get(arg_4)
            if not arg_5:
                raise KeyError("{0} is not a valid argument for this plugin".format(arg_4))

            if arg_5.name in arg_2:
                raise RuntimeError("cycle detected in plugin argument config")
            arg_2.add(arg_5.name)
            yield arg_5

            for arg_6 in arg_0.Func(arg_5.name):
                if arg_6.name in arg_2:
                    raise RuntimeError("cycle detected in plugin argument config")
                arg_2.add(arg_6.name)
                yield arg_6


def Func ( arg_0 ) : arg_1 = libssl . BIO_ctrl_pending ( arg_0 . _wbio ) if arg_1 == 0 : return b'' arg_2 = min ( arg_0 . _buffer_size , arg_1 ) arg_3 = libssl . BIO_read ( arg_0 . _wbio , arg_0 . _bio_write_buffer , arg_2 ) arg_4 = bytes_from_buffer ( arg_0 . _bio_write_buffer , arg_3 ) arg_5 = arg_4 while len ( arg_4 ) : arg_6 = False try : arg_7 = arg_0 . _socket . send ( arg_4 ) except ( socket_ . error ) as e : if e . errno == 104 or e . errno == 32 : arg_6 = True else : raise if arg_6 : raise_disconnection ( ) arg_4 = arg_4 [ arg_7 : ] if len ( arg_4 ) : arg_0 . select_write ( ) return arg_5

def Func(arg_0):
        """
        Takes ciphertext from the memory bio and writes it to the
        socket.

        :return:
            A byte string of ciphertext going to the socket. Used
            for debugging the handshake only.
        """

        arg_1 = libssl.BIO_ctrl_pending(arg_0._wbio)
        if arg_1 == 0:
            return b''
        arg_2 = min(arg_0._buffer_size, arg_1)
        arg_3 = libssl.BIO_read(arg_0._wbio, arg_0._bio_write_buffer, arg_2)
        arg_4 = bytes_from_buffer(arg_0._bio_write_buffer, arg_3)
        arg_5 = arg_4
        while len(arg_4):
            arg_6 = False
            try:
                arg_7 = arg_0._socket.send(arg_4)
            except (socket_.error) as e:
                # Handle ECONNRESET and EPIPE
                if e.errno == 104 or e.errno == 32:
                    arg_6 = True
                else:
                    raise

            if arg_6:
                raise_disconnection()
            arg_4 = arg_4[arg_7:]
            if len(arg_4):
                arg_0.select_write()
        return arg_5

Takes ciphertext from the memory bio and writes it to the socket .


def Func(arg_0):
    '''Func uses HTTP basic authentication to attempt to authenticate
    given a 401 response. We take as input previous headers, and update
    them.

    Parameters
    ==========
    response: the http request response to parse for the challenge.

    '''
    try:
        from awscli.clidriver import create_clidriver
    except:
        bot.exit('Please install pip install sregistry[aws]')

    arg_1 = create_clidriver()
    arg_2 = arg_1.session.create_client('ecr')
    arg_3 = arg_2.get_authorization_token()
    arg_4 = arg_3['authorizationData'][0]['authorizationToken']

    try:
        arg_4 = {"Authorization": "Basic %s" % arg_4}
        arg_0.update(arg_4)

    except Exception:
        bot.error("Error getting token.")
        sys.exit(1)

    return arg_0

update_token uses HTTP basic authentication to attempt to authenticate
    given a 401 response. We take as input previous headers, and update
    them.

    Parameters
    ==========
    response: the http request response to parse for the challenge.

update_token uses HTTP basic authentication to attempt to authenticate given a 401 response . We take as input previous headers and update them .


(sub_grid, regular_to_nearest_pix, sub_to_regular, pixel_centres,
                                               pixel_neighbors, pixel_neighbors_size)

def Func(arg_0, arg_1, arg_2, arg_3,
                                               arg_4, arg_5):
    """ Compute the mappings between a set of sub-grid pixels and pixelization pixels, using information on \
    how the regular pixels hosting each sub-pixel map to their closest pixelization pixel on the image-plane pix-grid \
    and the pixelization's pixel centres.

    To determine the complete set of sub-pixel to pixelization pixel mappings, we must pair every sub-pixel to \
    its nearest pixel. Using a full nearest neighbor search to do this is slow, thus the pixel neighbors (derived via \
    the Voronoi grid) are used to localize each nearest neighbor search by using a graph search.

    Parameters
    ----------
    regular_grid : RegularGrid
        The grid of (y,x) arc-second coordinates at the centre of every unmasked pixel, which has been traced to \
        to an irregular grid via lens.
    regular_to_nearest_pix : ndarray
        A 1D array that maps every regular-grid pixel to its nearest pix-grid pixel (as determined on the unlensed \
        2D array).
    pixel_centres : (float, float)
        The (y,x) centre of every Voronoi pixel in arc-seconds.
    pixel_neighbors : ndarray
        An array of length (voronoi_pixels) which provides the index of all neighbors of every pixel in \
        the Voronoi grid (entries of -1 correspond to no neighbor).
    pixel_neighbors_size : ndarray
        An array of length (voronoi_pixels) which gives the number of neighbors of every pixel in the \
        Voronoi grid.
     """

    arg_6 = np.zeros((arg_0.shape[0]))

    for arg_7 in range(arg_0.shape[0]):

        arg_8 = arg_1[arg_2[arg_7]]

        while True:

            arg_9 = arg_3[arg_8]

            arg_10 = (arg_0[arg_7, 0] - arg_9[0]) ** 2 + \
                                          (arg_0[arg_7, 1] - arg_9[1]) ** 2

            arg_11 = 1.0e8

            for arg_12 in range(arg_5[arg_8]):

                arg_13 = arg_4[arg_8, arg_12]

                arg_14 = (arg_0[arg_7, 0] - arg_3[arg_13, 0]) ** 2 + \
                                           (arg_0[arg_7, 1] - arg_3[arg_13, 1]) ** 2

                if arg_14 < arg_11:
                    arg_11 = arg_14
                    arg_15 = arg_12

            arg_16 = arg_4[arg_8, arg_15]
            arg_17 = arg_11

            if arg_10 <= arg_17:
                arg_6[arg_7] = arg_8
                break
            else:
                arg_8 = arg_16

    return arg_6

Compute the mappings between a set of sub - grid pixels and pixelization pixels using information on \ how the regular pixels hosting each sub - pixel map to their closest pixelization pixel on the image - plane pix - grid \ and the pixelization s pixel centres .


def Func ( arg_0 , arg_1 ) : arg_1 = arg_0 . _remessage_invalid_subparser ( arg_1 ) raise utils . UsageError ( arg_1 )

def Func(arg_0, arg_1):
        '''Suppress default exit behavior'''
        arg_1 = arg_0._remessage_invalid_subparser(arg_1)
        raise utils.UsageError(arg_1)


def Func(arg_0, arg_1=None):
        """
        Return process bounding box for zoom level.

        Parameters
        ----------
        zoom : int or None
            if None, the union of all zoom level areas is returned

        Returns
        -------
        process area : shapely geometry
        """
        if arg_1 is None:
            if not arg_0._cache_full_process_area:
                logger.debug("calculate process area ...")
                arg_0._cache_full_process_area = cascaded_union([
                    arg_0._Func(z) for z in arg_0.init_zoom_levels]
                ).buffer(0)
            return arg_0._cache_full_process_area
        else:
            if arg_1 not in arg_0.init_zoom_levels:
                raise ValueError(
                    "zoom level not available with current configuration")
            return arg_0._Func(arg_1)

Return process bounding box for zoom level .


def Func ( arg_0 ) : arg_0 . frames += 1 glfw . Func ( arg_0 . window ) arg_0 . poll_events ( )

def Func(arg_0):
        """
        Swaps buffers, incement the framecounter and pull events.
        """
        arg_0.frames += 1
        glfw.Func(arg_0.window)
        arg_0.poll_events()

Swaps buffers incement the framecounter and pull events .


def Func(arg_0):
        """ Copy the config template into user's directory """
        arg_1 = arg_0.__get_config_template_path()
        arg_2 = os.path.abspath(arg_1)

        if not os.path.exists(arg_2):
            arg_3 = f"Config template not found {src}"
            arg_0.logger.error(arg_3)
            raise FileNotFoundError(arg_3)

        arg_4 = os.path.abspath(arg_0.get_config_path())

        shutil.copyfile(arg_2, arg_4)

        if not os.path.exists(arg_4):
            raise FileNotFoundError("Config file could not be copied to user dir!")

Copy the config template into user s directory


def Func ( arg_0 , arg_1 = False ) : _AssertIsLocal ( arg_0 ) import shutil def OnError ( arg_2 , arg_3 , arg_4 ) : if IsLink ( arg_3 ) : return if arg_2 is os . remove and os . access ( arg_3 , os . W_OK ) : raise import stat os . chmod ( arg_3 , stat . S_IWRITE ) arg_2 ( arg_3 ) try : if not os . path . isdir ( arg_0 ) : if arg_1 : return from . _exceptions import DirectoryNotFoundError raise DirectoryNotFoundError ( arg_0 ) shutil . rmtree ( arg_0 , onerror = OnError ) except : if not arg_1 : raise

def Func(arg_0, arg_1=False):
    '''
    Deletes a directory.

    :param unicode directory:

    :param bool skip_on_error:
        If True, ignore any errors when trying to delete directory (for example, directory not
        found)

    :raises NotImplementedForRemotePathError:
        If trying to delete a remote directory.
    '''
    _AssertIsLocal(arg_0)

    import shutil
    def OnError(arg_2, arg_3, arg_4):
        '''
        Remove the read-only flag and try to remove again.
        On Windows, rmtree fails when trying to remove a read-only file. This fix it!
        Another case: Read-only directories return True in os.access test. It seems that read-only
        directories has it own flag (looking at the property windows on Explorer).
        '''
        if IsLink(arg_3):
            return

        if arg_2 is os.remove and os.access(arg_3, os.W_OK):
            raise

        # Make the file WRITEABLE and executes the original delete function (osfunc)
        import stat
        os.chmod(arg_3, stat.S_IWRITE)
        arg_2(arg_3)

    try:
        if not os.path.isdir(arg_0):
            if arg_1:
                return
            from ._exceptions import DirectoryNotFoundError
            raise DirectoryNotFoundError(arg_0)
        shutil.rmtree(arg_0, onerror=OnError)
    except:
        if not arg_1:
            raise


return '(%s)' % ','.join(conflict_target)

def Func(arg_0):
        """Builds the `conflict_target` for the ON CONFLICT
        clause."""

        arg_1 = []

        if not isinstance(arg_0.query.conflict_target, list):
            raise SuspiciousOperation((
                '%s is not a valid conflict target, specify '
                'a list of column names, or tuples with column '
                'names and hstore key.'
            ) % str(arg_0.query.conflict_target))

        def _assert_valid_field(arg_2):
            arg_2 = arg_0._normalize_field_name(arg_2)
            if arg_0._get_model_field(arg_2):
                return

            raise SuspiciousOperation((
                '%s is not a valid conflict target, specify '
                'a list of column names, or tuples with column '
                'names and hstore key.'
            ) % str(arg_2))

        for arg_2 in arg_0.query.conflict_target:
            _assert_valid_field(arg_2)

            # special handling for hstore keys
            if isinstance(arg_2, tuple):
                arg_1.append(
                    '(%s->\'%s\')' % (
                        arg_0._format_field_name(arg_2),
                        arg_2[1]
                    )
                )
            else:
                arg_1.append(
                    arg_0._format_field_name(arg_2))

        return '(%s)' % ','.join(arg_1)

Builds the conflict_target for the ON CONFLICT clause .


return ConversationReference(activity_id=activity.id,
                                     user=copy(activity.from_property),
                                     bot=copy(activity.recipient),
                                     conversation=copy(activity.conversation),
                                     channel_id=activity.channel_id,
                                     service_url=activity.service_url)

def Func ( arg_0 : arg_1 ) -> ConversationReference : return ConversationReference ( activity_id = arg_0 . id , user = copy ( arg_0 . from_property ) , bot = copy ( arg_0 . recipient ) , conversation = copy ( arg_0 . conversation ) , channel_id = arg_0 . channel_id , service_url = arg_0 . service_url )

def Func(arg_0: arg_1) -> ConversationReference:
        """
        Returns the conversation reference for an activity. This can be saved as a plain old JSON
        object and then later used to message the user proactively.

        Usage Example:
        reference = TurnContext.Func(context.request)
        :param activity:
        :return:
        """
        return ConversationReference(activity_id=arg_0.id,
                                     user=copy(arg_0.from_property),
                                     bot=copy(arg_0.recipient),
                                     conversation=copy(arg_0.conversation),
                                     channel_id=arg_0.channel_id,
                                     service_url=arg_0.service_url)

Returns the conversation reference for an activity. This can be saved as a plain old JSON
        object and then later used to message the user proactively.

        Usage Example:
        reference = TurnContext.get_conversation_reference(context.request)
        :param activity:
        :return:

Returns the conversation reference for an activity . This can be saved as a plain old JSON object and then later used to message the user proactively .


def Func ( arg_0 ) : arg_1 = ( criterion . Func ( ) for criterion in arg_0 . _criteria ) return '__' . join ( sorted ( arg_1 ) )

def Func(arg_0):
        """Concatenates the Funcs of the given criteria in alphabetical order.

        If a sub-criterion is itself a combined criterion, its Func is
        first split into the individual Funcs and the Funcs of the
        sub-sub criteria is used instead of the Func of the sub-criterion.
        This is done recursively to ensure that the order and the hierarchy
        of the criteria does not influence the Func.

        Returns
        -------
        str
            The alphabetically sorted Funcs of the sub-criteria concatenated
            using double underscores between them.

        """
        arg_1 = (criterion.Func() for criterion in arg_0._criteria)
        return '__'.join(sorted(arg_1))

Concatenates the names of the given criteria in alphabetical order.

        If a sub-criterion is itself a combined criterion, its name is
        first split into the individual names and the names of the
        sub-sub criteria is used instead of the name of the sub-criterion.
        This is done recursively to ensure that the order and the hierarchy
        of the criteria does not influence the name.

        Returns
        -------
        str
            The alphabetically sorted names of the sub-criteria concatenated
            using double underscores between them.

Concatenates the names of the given criteria in alphabetical order .


def Func ( arg_0 , arg_1 = False ) : if arg_0 . _payload is None : arg_0 . decode_payload ( arg_1 ) elif arg_1 : for arg_2 , arg_3 in enumerate ( arg_0 . _payload ) : if isinstance ( arg_3 , XMLPayload ) : arg_4 = payload_class_for_element_name ( arg_3 . element . tag ) if arg_4 is not XMLPayload : arg_3 = arg_4 . from_xml ( arg_3 . element ) arg_0 . _payload [ arg_2 ] = arg_3 return list ( arg_0 . _payload )

def Func(arg_0, arg_1 = False):
        """Return list of stanza payload objects.

        :Parameters:
            - `specialize`: If `True`, then return objects of specialized
              `StanzaPayload` classes whenever possible, otherwise the
              representation already available will be used (often
              `XMLPayload`)

        :Returntype: `list` of `StanzaPayload`
        """
        if arg_0._payload is None:
            arg_0.decode_payload(arg_1)
        elif arg_1:
            for arg_2, arg_3 in enumerate(arg_0._payload):
                if isinstance(arg_3, XMLPayload):
                    arg_4 = payload_class_for_element_name(
                                                        arg_3.element.tag)
                    if arg_4 is not XMLPayload:
                        arg_3 = arg_4.from_xml(arg_3.element)
                        arg_0._payload[arg_2] = arg_3
        return list(arg_0._payload)


def
Func
(
arg_0
,
**
arg_1
)
:
arg_0
.
_fill_project_info
(
arg_1
)
arg_0
.
db
.
Dataset
.
delete_many
(
arg_1
)
logging
.
info
(
"[Database] Delete Dataset SUCCESS"
)

def Func(arg_0, **arg_1):
        """Delete datasets.

        Parameters
        -----------
        kwargs : logging information
            Find items to delete, leave it empty to delete all log.

        """

        arg_0._fill_project_info(arg_1)
        arg_0.db.Dataset.delete_many(arg_1)
        logging.info("[Database] Delete Dataset SUCCESS")


def Func ( arg_0 ) : assert arg_0 . type == syms . file_input arg_1 = None for arg_2 in arg_0 . post_order ( ) : if arg_1 is not None : if arg_2 . type == token . NEWLINE and is_assignment ( arg_1 ) : fix_variable_annotation_type_comment ( arg_2 , arg_1 ) elif arg_2 . type == syms . funcdef and arg_1 . type == syms . suite : fix_signature_annotation_type_comment ( arg_2 , arg_1 , offset = 1 ) elif arg_2 . type == syms . async_funcdef and arg_1 . type == syms . suite : fix_signature_annotation_type_comment ( arg_2 , arg_1 , offset = 2 ) arg_1 = arg_2

def Func(arg_0):
    """Converts type comments in `node` to proper annotated assignments."""
    assert arg_0.type == syms.file_input

    arg_1 = None
    for arg_2 in arg_0.post_order():
        if arg_1 is not None:
            if arg_2.type == token.NEWLINE and is_assignment(arg_1):
                fix_variable_annotation_type_comment(arg_2, arg_1)
            elif arg_2.type == syms.funcdef and arg_1.type == syms.suite:
                fix_signature_annotation_type_comment(arg_2, arg_1, offset=1)
            elif arg_2.type == syms.async_funcdef and arg_1.type == syms.suite:
                fix_signature_annotation_type_comment(arg_2, arg_1, offset=2)
        arg_1 = arg_2

Converts type comments in node to proper annotated assignments .


(self, location=0, silence_threshold=0.1,
                min_silence_duration=0.1, buffer_around_silence=False)

def Func(arg_0, arg_1=0, arg_2=0.1,
                arg_3=0.1, arg_4=False):
        '''Removes silent regions from an audio file.

        Parameters
        ----------
        location : int, default=0
            Where to remove Func. One of:
             * 0 to remove Func throughout the file (default),
             * 1 to remove Func from the beginning,
             * -1 to remove Func from the end,
        Func_threshold : float, default=0.1
            Silence threshold as percentage of maximum sample amplitude.
            Must be between 0 and 100.
        min_Func_duration : float, default=0.1
            The minimum ammount of time in seconds required for a region to be
            considered non-silent.
        buffer_around_Func : bool, default=False
            If True, leaves a buffer of min_Func_duration around removed
            silent regions.

        See Also
        --------
        vad

        '''
        if arg_1 not in [-1, 0, 1]:
            raise ValueError("location must be one of -1, 0, 1.")

        if not is_number(arg_2) or arg_2 < 0:
            raise ValueError(
                "Func_threshold must be a number between 0 and 100"
            )
        elif arg_2 >= 100:
            raise ValueError(
                "Func_threshold must be a number between 0 and 100"
            )

        if not is_number(arg_3) or arg_3 <= 0:
            raise ValueError(
                "min_Func_duration must be a positive number."
            )

        if not isinstance(arg_4, bool):
            raise ValueError("buffer_around_Func must be a boolean.")

        arg_5 = []

        if arg_1 == -1:
            arg_5.append('reverse')

        if arg_4:
            arg_5.extend(['Func', '-l'])
        else:
            arg_5.append('Func')

        arg_5.extend([
            '1',
            '{:f}'.format(arg_3),
            '{:f}%'.format(arg_2)
        ])

        if arg_1 == 0:
            arg_5.extend([
                '-1',
                '{:f}'.format(arg_3),
                '{:f}%'.format(arg_2)
            ])

        if arg_1 == -1:
            arg_5.append('reverse')

        arg_0.effects.extend(arg_5)
        arg_0.effects_log.append('Func')

        return arg_0

Removes silent regions from an audio file.

        Parameters
        ----------
        location : int, default=0
            Where to remove silence. One of:
             * 0 to remove silence throughout the file (default),
             * 1 to remove silence from the beginning,
             * -1 to remove silence from the end,
        silence_threshold : float, default=0.1
            Silence threshold as percentage of maximum sample amplitude.
            Must be between 0 and 100.
        min_silence_duration : float, default=0.1
            The minimum ammount of time in seconds required for a region to be
            considered non-silent.
        buffer_around_silence : bool, default=False
            If True, leaves a buffer of min_silence_duration around removed
            silent regions.

        See Also
        --------
        vad

Removes silent regions from an audio file .


def Func ( arg_0 ) : for arg_1 in list ( arg_0 . sigs . keys ( ) ) : if not arg_0 . check_and_adjust_sighandler ( arg_1 , arg_0 . sigs ) : break pass return

def Func(arg_0):
        """Check to see if any of the signal handlers we are interested in have
        changed or is not initially set. Change any that are not right. """
        for arg_1 in list(arg_0.sigs.keys()):
            if not arg_0.check_and_adjust_sighandler(arg_1, arg_0.sigs):
                break
            pass
        return

Check to see if any of the signal handlers we are interested in have changed or is not initially set . Change any that are not right .


def Func(arg_0, *arg_1, **arg_2):
        """Set the default headers for all requests."""
        arg_0.set_header('Access-Control-Allow-Origin', '*')
        arg_0.set_header('Access-Control-Allow-Headers',
                        'Origin, X-Requested-With, Content-Type, Accept')
        arg_0.set_header('Access-Control-Allow-Methods',
                        'GET, HEAD, PUT, POST, DELETE')

Set the default headers for all requests .


def Func ( arg_0 ) : arg_1 = { 'name' : arg_0 . name , 'region' : arg_0 . region , 'url' : arg_0 . url , 'distribution' : arg_0 . distribution , 'description' : arg_0 . description , 'tags' : arg_0 . tags } arg_2 = arg_0 . get_data ( 'images' , type = POST , arg_1 = arg_1 ) if arg_2 : for arg_3 in arg_2 [ 'image' ] . keys ( ) : setattr ( arg_0 , arg_3 , arg_2 [ 'image' ] [ arg_3 ] ) return arg_0

def Func(arg_0):
        """
        Creates a new custom DigitalOcean Image from the Linux virtual machine
        image located at the provided `url`.
        """
        arg_1 = {'name': arg_0.name,
                  'region': arg_0.region,
                  'url': arg_0.url,
                  'distribution': arg_0.distribution,
                  'description': arg_0.description,
                  'tags': arg_0.tags}

        arg_2 = arg_0.get_data('images', type=POST, arg_1=arg_1)

        if arg_2:
            for arg_3 in arg_2['image'].keys():
                setattr(arg_0, arg_3, arg_2['image'][arg_3])

        return arg_0

Creates a new custom DigitalOcean Image from the Linux virtual machine image located at the provided url .


def Func ( arg_0 ) : arg_1 = [ ] for arg_2 in arg_0 . ids : arg_3 = arg_0 [ arg_2 ] if not arg_3 . outstanding : arg_1 . append ( arg_3 . apply ( socket . gethostname ) ) arg_1 = [ i . get ( ) for i in arg_1 ] arg_4 = set ( arg_1 ) arg_5 = zip ( arg_1 , arg_0 . ids ) arg_6 = { host : [ i [ 1 ] for i in arg_5 if i [ 0 ] == host ] for host in arg_4 } arg_7 = list ( itertools . chain ( * [ arg_6 [ i ] [ : 2 ] for i in arg_6 ] ) ) return arg_7

def Func(arg_0):
    """
    A function to find 2 engines per hostname on the ipyclient.
    We'll assume that the CPUs are hyperthreaded, which is why
    we grab two. If they are not then no foul. Two multi-threaded
    jobs will be run on each of the 2 engines per host.
    """
    ## fill hosts with async[gethostname]
    arg_1 = []
    for arg_2 in arg_0.ids:
        arg_3 = arg_0[arg_2]
        if not arg_3.outstanding:
            arg_1.append(arg_3.apply(socket.gethostname))

    ## capture results of asyncs
    arg_1 = [i.get() for i in arg_1]
    arg_4 = set(arg_1)
    arg_5 = zip(arg_1, arg_0.ids)
    arg_6 = {host: [i[1] for i in arg_5 if i[0] == host] for host in arg_4}
    arg_7 = list(itertools.chain(*[arg_6[i][:2] for i in arg_6]))

    ## return first two engines from each host
    return arg_7

A function to find 2 engines per hostname on the ipyclient . We ll assume that the CPUs are hyperthreaded which is why we grab two . If they are not then no foul . Two multi - threaded jobs will be run on each of the 2 engines per host .


def Func ( arg_0 ) : arg_1 = type ( arg_0 ) ( ) arg_1 . __dict__ = arg_0 . __dict__ . Func ( ) arg_1 . _headers = arg_0 . headers . Func ( ) return arg_1

def Func(arg_0):
        """
        Copies the current Request object instance for side-effects purposes.

        Returns:
            pook.Request: Func of the current Request instance.
        """
        arg_1 = type(arg_0)()
        arg_1.__dict__ = arg_0.__dict__.Func()
        arg_1._headers = arg_0.headers.Func()
        return arg_1

Copies the current Request object instance for side-effects purposes.

        Returns:
            pook.Request: copy of the current Request instance.

Copies the current Request object instance for side - effects purposes .


def Func(arg_0, **arg_1):
        '''
        Get all cards this member is attached to. Return a list of Card
        objects.

        Returns:
            list(Card): Return all cards this member is attached to
        '''
        arg_2 = arg_0.Func_json(arg_0.base_uri, arg_1=arg_1)

        arg_3 = []
        for arg_4 in arg_2:
            arg_3.append(arg_0.create_card(arg_4))

        return arg_3

Get all cards this member is attached to . Return a list of Card objects .


def Func ( arg_0 , arg_1 ) : arg_2 = [ ( arg_0 , ( ) ) ] while len ( arg_2 ) > 0 : arg_3 , arg_4 = arg_2 . pop ( ) for arg_5 , arg_6 in arg_3 . iteritems ( ) : arg_7 = arg_4 + ( arg_5 , ) if isinstance ( arg_6 , dict ) : arg_2 . insert ( 0 , ( arg_6 , arg_7 ) ) else : arg_1 ( arg_6 , arg_7 )

def Func(arg_0, arg_1):
  """Recursively applies f to the values in dict d.

  Args:
    d: The dict to recurse over.
    f: A function to apply to values in d that takes the value and a list of
        keys from the root of the dict to the value.
  """
  arg_2 = [(arg_0, ())]
  while len(arg_2) > 0:
    arg_3, arg_4 = arg_2.pop()
    for arg_5, arg_6 in arg_3.iteritems():
      arg_7 = arg_4 + (arg_5,)
      if isinstance(arg_6, dict):
        arg_2.insert(0, (arg_6, arg_7))
      else:
        arg_1(arg_6, arg_7)

Recursively applies f to the values in dict d .


def Func ( arg_0 , arg_1 , arg_2 ) : if arg_1 < 1 or arg_1 > sum ( _LANG_DICT [ arg_3 ] for arg_3 in BMDATA [ arg_2 ] [ 'languages' ] ) : return L_ANY if ( arg_1 & ( arg_1 - 1 ) ) != 0 : return L_ANY return arg_1

def Func(arg_0, arg_1, arg_2):
        """Return the index value for a language code.

        This returns l_any if more than one code is specified or the code is
        out of bounds.

        Parameters
        ----------
        code : int
            The language code to interpret
        name_mode : str
            The name mode of the algorithm: ``gen`` (default),
            ``ash`` (Ashkenazi), or ``sep`` (Sephardic)

        Returns
        -------
        int
            Language code index

        """
        if arg_1 < 1 or arg_1 > sum(
            _LANG_DICT[arg_3] for arg_3 in BMDATA[arg_2]['languages']
        ):  # code out of range
            return L_ANY
        if (
            arg_1 & (arg_1 - 1)
        ) != 0:  # choice was more than one language; use any
            return L_ANY
        return arg_1

Return the index value for a language code .


def
Func
(
arg_0
)
:
if
len
(
arg_0
)
==
5
and
arg_0
[
1
]
==
'{'
and
arg_0
[
4
]
==
'}'
:
arg_1
=
arg_0
[
2
:
4
]
arg_2
=
''
.
join
(
s
for
(
arg_12
,
s
)
in
arg_1
)
[
arg_3
,
arg_4
]
=
[
f
for
(
f
,
arg_12
)
in
arg_1
]
def
the_dict_func
(
arg_5
,
arg_6
=
0
)
:
arg_7
=
[
(
arg_3
(
arg_11
)
,
arg_4
(
arg_13
)
)
for
(
arg_11
,
arg_13
)
in
arg_5
.
items
(
)
]
arg_8
=
0
if
arg_7
==
[
]
else
max
(
max
(
arg_11
,
arg_13
)
for
(
(
arg_12
,
arg_11
)
,
(
arg_12
,
arg_13
)
)
in
arg_7
)
(
arg_9
,
arg_10
)
=
_ToDbusXformer
.
_variant_levels
(
arg_8
,
arg_6
)
return
(
dbus
.
types
.
Dictionary
(
(
(
arg_11
,
arg_13
)
for
(
(
arg_11
,
arg_12
)
,
(
arg_13
,
arg_12
)
)
in
arg_7
)
,
arg_2
=
arg_2
,
variant_level
=
arg_9
)
,
arg_10
)
return
(
the_dict_func
,
'a{'
+
arg_2
+
'}'
)
if
len
(
arg_0
)
==
2
:
(
arg_14
,
arg_15
)
=
arg_0
[
1
]
def
the_array_func
(
arg_16
,
arg_6
=
0
)
:
if
isinstance
(
arg_16
,
dict
)
:
raise
IntoDPValueError
(
arg_16
,
"a_list"
,
"is a dict, must be an array"
)
arg_7
=
[
arg_14
(
arg_11
)
for
arg_11
in
arg_16
]
arg_8
=
0
if
arg_7
==
[
]
else
max
(
arg_11
for
(
arg_12
,
arg_11
)
in
arg_7
)
(
arg_9
,
arg_10
)
=
_ToDbusXformer
.
_variant_levels
(
arg_8
,
arg_6
)
return
(
dbus
.
types
.
Array
(
(
arg_11
for
(
arg_11
,
arg_12
)
in
arg_7
)
,
arg_2
=
arg_15
,
variant_level
=
arg_9
)
,
arg_10
)
return
(
the_array_func
,
'a'
+
arg_15
)
raise
IntoDPValueError
(
arg_0
,
"toks"
,
"unexpected tokens"
)

def Func(arg_0):
        """
        Generate the correct function for an array signature.

        :param toks: the list of parsed tokens
        :returns: function that returns an Array or Dictionary value
        :rtype: ((or list dict) -> ((or Array Dictionary) * int)) * str
        """

        if len(arg_0) == 5 and arg_0[1] == '{' and arg_0[4] == '}':
            arg_1 = arg_0[2:4]
            arg_2 = ''.join(s for (arg_12, s) in arg_1)
            [arg_3, arg_4] = [f for (f, arg_12) in arg_1]

            def the_dict_func(arg_5, arg_6=0):
                """
                Function for generating a Dictionary from a dict.

                :param a_dict: the dictionary to transform
                :type a_dict: dict of (`a * `b)
                :param int variant: variant level

                :returns: a dbus dictionary of transformed values and level
                :rtype: Dictionary * int
                """
                arg_7 = \
                   [(arg_3(arg_11), arg_4(arg_13)) for (arg_11, arg_13) in arg_5.items()]
                arg_8 = 0 if arg_7 == [] \
                   else max(max(arg_11, arg_13) for ((arg_12, arg_11), (arg_12, arg_13)) in arg_7)
                (arg_9, arg_10) = \
                   _ToDbusXformer._variant_levels(arg_8, arg_6)
                return (dbus.types.Dictionary(
                    ((arg_11, arg_13) for ((arg_11, arg_12), (arg_13, arg_12)) in arg_7),
                    arg_2=arg_2,
                    variant_level=arg_9), arg_10)

            return (the_dict_func, 'a{' + arg_2 + '}')

        if len(arg_0) == 2:
            (arg_14, arg_15) = arg_0[1]

            def the_array_func(arg_16, arg_6=0):
                """
                Function for generating an Array from a list.

                :param a_list: the list to transform
                :type a_list: list of `a
                :param int variant: variant level of the value
                :returns: a dbus Array of transformed values and variant level
                :rtype: Array * int
                """
                if isinstance(arg_16, dict):
                    raise IntoDPValueError(arg_16, "a_list",
                                           "is a dict, must be an array")
                arg_7 = [arg_14(arg_11) for arg_11 in arg_16]
                arg_8 = 0 if arg_7 == [] else max(arg_11 for (arg_12, arg_11) in arg_7)
                (arg_9, arg_10) = \
                   _ToDbusXformer._variant_levels(arg_8, arg_6)

                return (dbus.types.Array(
                    (arg_11 for (arg_11, arg_12) in arg_7),
                    arg_2=arg_15,
                    variant_level=arg_9), arg_10)

            return (the_array_func, 'a' + arg_15)

        raise IntoDPValueError(arg_0, "toks",
                               "unexpected tokens")

Generate the correct function for an array signature .


def
Func
(
arg_0
,
arg_1
,
arg_2
=
True
)
:
arg_3
=
[
]
for
arg_4
in
arg_0
.
request
.
params
.
getall
(
arg_1
)
:
arg_4
=
arg_0
.
decode_argument
(
arg_4
,
arg_1
=
arg_1
)
if
isinstance
(
arg_4
,
unicode
)
:
arg_4
=
re
.
sub
(
r"[\x00-\x08\x0e-\x1f]"
,
" "
,
arg_4
)
if
arg_2
:
arg_4
=
arg_4
.
strip
(
)
arg_3
.
append
(
arg_4
)
return
arg_3

def Func(arg_0, arg_1, arg_2=True):
        """Returns a list of the arguments with the given name.

        If the argument is not present, returns an empty list.

        The returned values are always unicode.
        """
        arg_3 = []
        for arg_4 in arg_0.request.params.getall(arg_1):
            arg_4 = arg_0.decode_argument(arg_4, arg_1=arg_1)
            if isinstance(arg_4, unicode):
                # Get rid of any weird control chars (unless decoding gave
                # us bytes, in which case leave it alone)
                arg_4 = re.sub(r"[\x00-\x08\x0e-\x1f]", " ", arg_4)
            if arg_2:
                arg_4 = arg_4.strip()
            arg_3.append(arg_4)
        return arg_3

Returns a list of the arguments with the given name .


def Func ( ) : Host . init ( ) Range . init ( ) Service . init ( ) User . init ( ) Credential . init ( ) Log . init ( )

def Func():
    """
        Initializes the indices
    """
    Host.init()
    Range.init()
    Service.init()
    User.init()
    Credential.init()
    Log.init()


(project_id, info, media_url=None, file_path=None)

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None ) : try : arg_4 = dict ( arg_0 = arg_0 , arg_1 = arg_1 , arg_2 = None , ) if arg_3 : arg_5 = { 'file' : open ( arg_3 , 'rb' ) } arg_6 = { 'project_id' : arg_0 } arg_7 = _pybossa_req ( 'post' , 'helpingmaterial' , arg_6 = arg_6 , arg_5 = arg_5 ) else : arg_7 = _pybossa_req ( 'post' , 'helpingmaterial' , arg_6 = arg_4 ) if arg_7 . get ( 'id' ) : return HelpingMaterial ( arg_7 ) else : return arg_7 except : raise

def Func(arg_0, arg_1, arg_2=None, arg_3=None):
    """Create a helping material for a given project ID.

    :param project_id: PYBOSSA Project ID
    :type project_id: integer
    :param info: PYBOSSA Helping Material info JSON field
    :type info: dict
    :param media_url: URL for a media file (image, video or audio)
    :type media_url: string
    :param file_path: File path to the local image, video or sound to upload.
    :type file_path: string
    :returns: True -- the response status code
    """
    try:
        arg_4 = dict(
            arg_0=arg_0,
            arg_1=arg_1,
            arg_2=None,
        )
        if arg_3:
            arg_5 = {'file': open(arg_3, 'rb')}
            arg_6 = {'project_id': arg_0}
            arg_7 = _pybossa_req('post', 'helpingmaterial',
                               arg_6=arg_6, arg_5=arg_5)
        else:
            arg_7 = _pybossa_req('post', 'helpingmaterial', arg_6=arg_4)
        if arg_7.get('id'):
            return HelpingMaterial(arg_7)
        else:
            return arg_7
    except:  # pragma: no cover
        raise

Create a helping material for a given project ID .


(
    mname,
    fname,
    module_prefix,
    callable_names,
    no_print,
    module_exclude=None,
    callable_exclude=None,
    debug=False,
)

def Func(
    arg_0,
    arg_1,
    arg_2,
    arg_3,
    arg_4,
    arg_5=None,
    arg_6=None,
    arg_7=False,
):
    """Run module tracing."""
    # pylint: disable=R0913
    arg_5 = [] if arg_5 is None else arg_5
    arg_6 = [] if arg_6 is None else arg_6
    arg_8 = trace_pars(arg_0)
    arg_9 = datetime.datetime.now()
    with pexdoc.exdoc.ExDocCxt(
        exclude=arg_8.exclude + arg_5,
        pickle_fname=arg_8.pickle_fname,
        in_callables_fname=arg_8.in_callables_fname,
        out_callables_fname=arg_8.out_callables_fname,
        _no_print=arg_4,
    ) as exdoc_obj:
        arg_1 = os.path.realpath(
            os.path.join(
                os.path.dirname(__file__),
                "..",
                "..",
                "tests",
                "test_{0}.py".format(arg_1),
            )
        )
        arg_10 = (
            ["--color=yes"]
            + (["-s", "-vv"] if arg_7 else ["-q", "-q", "-q"])
            + ["--disable-warnings"]
            + ["-x"]
            + ([arg_8.noption] if arg_8.noption else [])
            + ["-m " + arg_0]
            + [arg_1]
        )
        with warnings.catch_warnings():
            warnings.filterwarnings("ignore", category=PytestWarning)
            if pytest.main(arg_10):
                raise RuntimeError("Tracing did not complete successfully")
    arg_11 = datetime.datetime.now()
    if not arg_4:
        print(
            "Auto-generation of exceptions documentation time: {0}".format(
                pmisc.elapsed_time_string(arg_9, arg_11)
            )
        )
        for arg_12 in arg_3:
            arg_12 = arg_2 + arg_12
            print("\nCallable: {0}".format(arg_12))
            print(exdoc_obj.get_sphinx_doc(arg_12, exclude=arg_6))
            print("\n")
    return copy.copy(exdoc_obj)


def
Func
(
arg_0
,
arg_1
=
False
)
:
if
arg_0
.
_executing
:
arg_0
.
_executing
=
False
arg_0
.
_request_info
[
'execute'
]
=
{
}
arg_0
.
_reading
=
False
arg_0
.
_highlighter
.
highlighting_on
=
False
if
arg_0
.
clear_on_kernel_restart
or
arg_1
:
arg_0
.
_control
.
clear
(
)
arg_0
.
_append_plain_text
(
arg_0
.
banner
)
else
:
arg_0
.
_append_plain_text
(
"# restarting kernel..."
)
arg_0
.
_append_html
(
"

"
)
arg_0
.
_append_before_prompt_pos
=
arg_0
.
_get_cursor
(
)
.
position
(
)
arg_0
.
_show_interpreter_prompt
(
)

def Func(arg_0, arg_1=False):
        """ Resets the widget to its initial state if ``clear`` parameter or
        ``clear_on_kernel_restart`` configuration setting is True, otherwise
        prints a visual indication of the fact that the kernel restarted, but
        does not clear the traces from previous usage of the kernel before it
        was restarted.  With ``clear=True``, it is similar to ``%clear``, but
        also re-writes the banner and aborts execution if necessary.
        """
        if arg_0._executing:
            arg_0._executing = False
            arg_0._request_info['execute'] = {}
        arg_0._reading = False
        arg_0._highlighter.highlighting_on = False

        if arg_0.clear_on_kernel_restart or arg_1:
            arg_0._control.clear()
            arg_0._append_plain_text(arg_0.banner)
        else:
            arg_0._append_plain_text("# restarting kernel...")
            arg_0._append_html("

")
            # XXX: Reprinting the full banner may be too much, but once #1680 is
            # addressed, that will mitigate it.
            #self._append_plain_text(self.banner)
        # update output marker for stdout/stderr, so that startup
        # messages appear after banner:
        arg_0._append_before_prompt_pos = arg_0._get_cursor().position()
        arg_0._show_interpreter_prompt()

Resets the widget to its initial state if clear parameter or clear_on_kernel_restart configuration setting is True otherwise prints a visual indication of the fact that the kernel restarted but does not clear the traces from previous usage of the kernel before it was restarted . With clear = True it is similar to %clear but also re - writes the banner and aborts execution if necessary .


def Func(arg_0, arg_1):
        """Parse token from the URI fragment, used by MobileApplicationClients.

        :param authorization_response: The full URL of the redirect back to you
        :return: A token dict
        """
        arg_0._client.parse_request_uri_response(
            arg_1, state=arg_0._state
        )
        arg_0.token = arg_0._client.token
        return arg_0.token

Parse token from the URI fragment used by MobileApplicationClients .


(self, token, batchmaketaskid, dagfilename,
                       dagmanoutfilename)

def Func(arg_0, arg_1, arg_2, arg_3,
                       arg_4):
        """
        Add a Condor DAG to the given Batchmake task.

        :param token: A valid token for the user in question.
        :type token: string
        :param batchmaketaskid: id of the Batchmake task for this DAG
        :type batchmaketaskid: int | long
        :param dagfilename: Filename of the DAG file
        :type dagfilename: string
        :param dagmanoutfilename: Filename of the DAG processing output
        :type dagmanoutfilename: string
        :returns: The created Condor DAG DAO
        :rtype: dict
        """
        arg_5 = dict()
        arg_5['token'] = arg_1
        arg_5['batchmaketaskid'] = arg_2
        arg_5['dagfilename'] = arg_3
        arg_5['outfilename'] = arg_4
        arg_6 = arg_0.request('midas.batchmake.add.condor.dag', arg_5)
        return arg_6

Add a Condor DAG to the given Batchmake task .


Custom json dump using the custom encoder above.

def Func ( arg_0 , arg_1 , ** arg_2 ) : for arg_3 in NdbEncoder ( ** arg_2 ) . iterencode ( arg_0 ) : arg_1 . write ( arg_3 )

def Func(arg_0, arg_1, **arg_2):
  """Custom json Func using the custom encoder above."""
  for arg_3 in NdbEncoder(**arg_2).iterencode(arg_0):
    arg_1.write(arg_3)

Custom json dump using the custom encoder above .


def Func ( arg_0 , arg_1 = None , arg_2 = None ) : arg_3 = arg_0 . data if getattr ( arg_0 , 'encoding' , None ) == 'zlib' : try : arg_3 = zlib . decompress ( arg_0 . data ) except Exception , exc : if arg_2 is not None : try : arg_3 = zlib . decompress ( arg_2 ) except Exception : raise exc else : raise if arg_1 is None : arg_1 = arg_0 . mime_type arg_3 = arg_3 . decode ( 'utf8' ) . encode ( 'utf8' ) return streamcorpus . ContentItem ( arg_3 = arg_3 , media_type = arg_1 )

def Func(arg_0, arg_1=None, arg_2=None):
    """Create a ContentItem from a node in the spinn3r data tree.

    The ContentItem is created with raw data set to ``node.data``,
    decompressed if the node's encoding is 'zlib', and UTF-8
    normalized, with a MIME type from ``node.mime_type``.

    ``node``
      the actual node from the spinn3r protobuf data
    ``mime_type``
      string MIME type to use (defaults to ``node.mime_type``)
    ``alternate_data``
      alternate (compressed) data to use, if ``node.data`` is missing
      or can't be decompressed

    """
    arg_3 = arg_0.data
    if getattr(arg_0, 'encoding', None) == 'zlib':
        try:
            arg_3 = zlib.decompress(arg_0.data)
        except Exception, exc:
            if arg_2 is not None:
                try:
                    arg_3 = zlib.decompress(arg_2)
                except Exception:
                    raise exc  # the original exception
                else:
                    raise
    if arg_1 is None:
        arg_1 = arg_0.mime_type
    arg_3 = arg_3.decode('utf8').encode('utf8')
    return streamcorpus.ContentItem(arg_3=arg_3, media_type=arg_1)

Create a ContentItem from a node in the spinn3r data tree .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . hashfunc ( arg_1 ) arg_3 , arg_1 = arg_0 . permutations arg_4 = np . bitwise_and ( ( arg_3 * arg_2 + arg_1 ) % _mersenne_prime , np . uint64 ( _max_hash ) ) arg_0 . hashvalues = np . minimum ( arg_4 , arg_0 . hashvalues )

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

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

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

            .. code-block:: python

                minhash = Minhash()
                minhash.Func("new value".encode('utf-8'))

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

            .. code-block:: python

                import farmhash
                def _hash_32(b):
                    return farmhash.hash32(b)
                minhash = MinHash(hashfunc=_hash_32)
                minhash.Func("new value")
        '''
        arg_2 = arg_0.hashfunc(arg_1)
        arg_3, arg_1 = arg_0.permutations
        arg_4 = np.bitwise_and((arg_3 * arg_2 + arg_1) % _mersenne_prime, np.uint64(_max_hash))
        arg_0.hashvalues = np.minimum(arg_4, arg_0.hashvalues)

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

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

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

            .. code-block:: python

                minhash = Minhash()
                minhash.update("new value".encode('utf-8'))

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

            .. code-block:: python

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

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


def Func ( arg_0 : arg_1 [ arg_2 ] , arg_3 : arg_1 [ arg_2 ] ) -> float : arg_4 , arg_5 = set ( arg_0 ) , set ( arg_3 ) if not arg_4 or not arg_5 : return 0.0 return len ( arg_4 & arg_5 ) / min ( len ( arg_4 ) , len ( arg_5 ) )

def Func(arg_0: arg_1[arg_2], arg_3: arg_1[arg_2]) -> float:
    """Calculate the tanimoto set similarity using the minimum size.

    :param set x: A set
    :param set y: Another set
    :return: The similarity between
        """
    arg_4, arg_5 = set(arg_0), set(arg_3)

    if not arg_4 or not arg_5:
        return 0.0

    return len(arg_4 & arg_5) / min(len(arg_4), len(arg_5))

Calculate the tanimoto set similarity using the minimum size .


def Func(arg_0, arg_1):
        """
        Load configuration settings from the file pointed to by path.

        This will overwrite all current setting values.

        Args:
            path (string): The path to the configuration file containing
                the settings to load. Required.
        Raises:
            ConfigurationError: Raised if the path does not point to an
                existing file or if a setting value is invalid.
        """
        if not os.path.exists(arg_1):
            raise exceptions.ConfigurationError(
                "The server configuration file ('{0}') could not be "
                "located.".format(arg_1)
            )

        arg_0._logger.info(
            "Loading server configuration settings from: {0}".format(arg_1)
        )

        arg_2 = configparser.ConfigParser()
        arg_2.read(arg_1)
        arg_0._parse_settings(arg_2)
        arg_0.parse_auth_settings(arg_2)

Load configuration settings from the file pointed to by path .


def Func(arg_0):
    """Creates a run set name based on ``idx``"""
    arg_1 = 1000
    arg_2 = arg_0 // arg_1
    if arg_2 >= 0:
        return pypetconstants.FORMATTED_SET_NAME % arg_2
    else:
        return pypetconstants.SET_NAME_DUMMY


def Func ( arg_0 ) : assert arg_0 . kernel is not None return swhlab . common . convolve ( arg_0 . sweepY , arg_0 . kernel )

def Func(arg_0):
        """
        Get the filtered sweepY of the current sweep.
        Only works if self.kernel has been generated.
        """
        assert arg_0.kernel is not None
        return swhlab.common.convolve(arg_0.sweepY,arg_0.kernel)

Get the filtered sweepY of the current sweep . Only works if self . kernel has been generated .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = [ ] if len ( arg_2 ) > 0 : arg_4 = arg_0 . _get_empty_statement ( arg_1 ) for arg_5 in arg_2 : if ( arg_5 [ 'conditions' ] is None or len ( arg_5 [ 'conditions' ] ) == 0 ) : arg_4 [ 'Resource' ] . append ( arg_5 [ 'resource_arn' ] ) else : arg_6 = arg_0 . _get_empty_statement ( arg_1 ) arg_6 [ 'Resource' ] . append ( arg_5 [ 'resource_arn' ] ) arg_6 [ 'Condition' ] = arg_5 [ 'conditions' ] arg_3 . append ( arg_6 ) arg_3 . append ( arg_4 ) return arg_3

def Func(arg_0, arg_1, arg_2):
        """
        This function loops over an array of objects containing
        a resourceArn and conditions statement and generates
        the array of statements for the policy.
        """
        arg_3 = []

        if len(arg_2) > 0:
            arg_4 = arg_0._get_empty_statement(arg_1)

            for arg_5 in arg_2:
                if (arg_5['conditions'] is None or
                        len(arg_5['conditions']) == 0):
                    arg_4['Resource'].append(arg_5['resource_arn'])
                else:
                    arg_6 = arg_0._get_empty_statement(arg_1)
                    arg_6['Resource'].append(arg_5['resource_arn'])
                    arg_6['Condition'] = arg_5['conditions']
                    arg_3.append(arg_6)
            arg_3.append(arg_4)

        return arg_3

This function loops over an array of objects containing a resourceArn and conditions statement and generates the array of statements for the policy .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 [ arg_0 . output_name ] arg_3 = TT . argmax ( arg_2 , axis = - 1 ) arg_4 = TT . eq ( arg_3 , arg_0 . _target ) arg_5 = arg_4 . mean ( ) if arg_0 . _weights is not None : arg_5 = ( arg_0 . _weights * arg_4 ) . sum ( ) / arg_0 . _weights . sum ( ) return arg_5

def Func(arg_0, arg_1):
        '''Build a Theano expression for computing the Func of graph output.

        Parameters
        ----------
        outputs : dict of Theano expressions
            A dictionary mapping network output names to Theano expressions
            representing the outputs of a computation graph.

        Returns
        -------
        acc : Theano expression
            A Theano expression representing the Func of the output compared
            to the target data.
        '''
        arg_2 = arg_1[arg_0.output_name]
        arg_3 = TT.argmax(arg_2, axis=-1)
        arg_4 = TT.eq(arg_3, arg_0._target)
        arg_5 = arg_4.mean()
        if arg_0._weights is not None:
            arg_5 = (arg_0._weights * arg_4).sum() / arg_0._weights.sum()
        return arg_5

Build a Theano expression for computing the accuracy of graph output.

        Parameters
        ----------
        outputs : dict of Theano expressions
            A dictionary mapping network output names to Theano expressions
            representing the outputs of a computation graph.

        Returns
        -------
        acc : Theano expression
            A Theano expression representing the accuracy of the output compared
            to the target data.

Build a Theano expression for computing the accuracy of graph output .


def
Func
(
arg_0
,
arg_1
)
:
for
arg_2
in
arg_1
:
arg_3
=
arg_2
.
getName
(
)
arg_4
=
arg_2
.
getComponent
(
)
if
arg_3
==
"dNSName"
:
arg_5
=
"DNS"
arg_6
=
_decode_asn1_string
(
arg_4
)
elif
arg_3
==
"uniformResourceIdentifier"
:
arg_5
=
"URI"
arg_6
=
_decode_asn1_string
(
arg_4
)
elif
arg_3
==
"otherName"
:
arg_7
=
arg_4
.
getComponentByName
(
"type-id"
)
arg_6
=
arg_4
.
getComponentByName
(
"value"
)
if
arg_7
==
XMPPADDR_OID
:
arg_5
=
"XmppAddr"
arg_6
=
der_decoder
.
decode
(
arg_6
,
asn1Spec
=
UTF8String
(
)
)
[
0
]
arg_6
=
_decode_asn1_string
(
arg_6
)
elif
arg_7
==
SRVNAME_OID
:
arg_5
=
"SRVName"
arg_6
=
der_decoder
.
decode
(
arg_6
,
asn1Spec
=
IA5String
(
)
)
[
0
]
arg_6
=
_decode_asn1_string
(
arg_6
)
else
:
logger
.
debug
(
"Unknown other name: {0}"
.
format
(
arg_7
)
)
continue
else
:
logger
.
debug
(
"Unsupported general name: {0}"
.
format
(
arg_3
)
)
continue
arg_0
.
alt_names
[
arg_5
]
.
append
(
arg_6
)

def Func(arg_0, arg_1):
        """Load SubjectAltName from a ASN.1 GeneralNames value.

        :Values:
            - `alt_names`: the SubjectAltNama extension value
        :Types:
            - `alt_name`: `GeneralNames`
        """
        for arg_2 in arg_1:
            arg_3 = arg_2.getName()
            arg_4 = arg_2.getComponent()
            if arg_3 == "dNSName":
                arg_5 = "DNS"
                arg_6 = _decode_asn1_string(arg_4)
            elif arg_3 == "uniformResourceIdentifier":
                arg_5 = "URI"
                arg_6 = _decode_asn1_string(arg_4)
            elif arg_3 == "otherName":
                arg_7 = arg_4.getComponentByName("type-id")
                arg_6 = arg_4.getComponentByName("value")
                if arg_7 == XMPPADDR_OID:
                    arg_5 = "XmppAddr"
                    arg_6 = der_decoder.decode(arg_6,
                                            asn1Spec = UTF8String())[0]
                    arg_6 = _decode_asn1_string(arg_6)
                elif arg_7 == SRVNAME_OID:
                    arg_5 = "SRVName"
                    arg_6 = der_decoder.decode(arg_6,
                                            asn1Spec = IA5String())[0]
                    arg_6 = _decode_asn1_string(arg_6)
                else:
                    logger.debug("Unknown other name: {0}".format(arg_7))
                    continue
            else:
                logger.debug("Unsupported general name: {0}"
                                                        .format(arg_3))
                continue
            arg_0.alt_names[arg_5].append(arg_6)

Load SubjectAltName from a ASN . 1 GeneralNames value .


def Func(arg_0) -> List[Argument]:
        """Parse template content. Create self.name and self.arguments."""
        arg_1 = arg_0._shadow
        arg_2 = arg_0._args_matcher(arg_1).spans('arg')
        if not arg_2:
            return []
        Func = []
        arg_4 = Func.append
        arg_5 = arg_0._type_to_spans
        arg_6, arg_7 = span = arg_0._span
        arg_8 = id(span)
        arg_9 = arg_0._lststr
        arg_10 = arg_9[0]
        arg_11 = arg_5.setdefault(arg_8, [])
        arg_12 = {(arg_15[0], arg_15[1]): arg_15 for arg_15 in arg_11}.get
        for arg_13, arg_14 in arg_2:
            arg_15, arg_16 = arg_18 = [arg_6 + arg_13, arg_6 + arg_14]
            arg_17 = arg_12((arg_15, arg_16))
            if arg_17 is None:
                insort(arg_11, arg_18)
            else:
                arg_18 = arg_17
            arg_19 = Argument(arg_9, arg_5, arg_18, arg_8)
            arg_19._shadow_cache = (
                arg_10[arg_15:arg_16], arg_1[arg_13:arg_14])
            arg_4(arg_19)
        return Func

Parse template content . Create self . name and self . arguments .


def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
)
:
arg_4
=
arg_0
.
value
(
arg_2
)
if
arg_4
==
'!!'
:
arg_0
.
_stream
.
restore_context
(
)
arg_0
.
diagnostic
.
notify
(
error
.
Severity
.
ERROR
,
"Cannot repeat a lookahead rule"
,
error
.
LocationInfo
.
from_stream
(
arg_0
.
_stream
,
is_error
=
True
)
)
raise
arg_0
.
diagnostic
if
arg_4
==
'!'
:
arg_0
.
_stream
.
restore_context
(
)
arg_0
.
diagnostic
.
notify
(
error
.
Severity
.
ERROR
,
"Cannot repeat a negated rule"
,
error
.
LocationInfo
.
from_stream
(
arg_0
.
_stream
,
is_error
=
True
)
)
raise
arg_0
.
diagnostic
arg_5
=
arg_1
arg_1
.
parser_tree
=
arg_3
.
functor
(
arg_5
.
parser_tree
)
return
True

def Func(arg_0, arg_1, arg_2, arg_3):
    """Add a repeater to the previous sequence"""
    arg_4 = arg_0.value(arg_2)
    if arg_4 == '!!':
        # cursor on the REPEATER
        arg_0._stream.restore_context()
        # log the error
        arg_0.diagnostic.notify(
            error.Severity.ERROR,
            "Cannot repeat a lookahead rule",
            error.LocationInfo.from_stream(arg_0._stream, is_error=True)
        )
        raise arg_0.diagnostic
    if arg_4 == '!':
        # cursor on the REPEATER
        arg_0._stream.restore_context()
        # log the error
        arg_0.diagnostic.notify(
            error.Severity.ERROR,
            "Cannot repeat a negated rule",
            error.LocationInfo.from_stream(arg_0._stream, is_error=True)
        )
        raise arg_0.diagnostic
    arg_5 = arg_1
    arg_1.parser_tree = arg_3.functor(arg_5.parser_tree)
    return True


def Func ( arg_0 ) : if "#" in arg_0 : arg_0 = arg_0 [ 1 : ] try : arg_1 = bytes . fromhex ( arg_0 ) except : arg_1 = binascii . unhexlify ( arg_0 ) return color_from_rgb ( * struct . unpack ( 'BBB' , arg_1 ) )

def Func(arg_0):
    """ Takes an HTML hex code
        and converts it to a proper hue value """
    if "#" in arg_0:
        arg_0 = arg_0[1:]

    try:
        arg_1 = bytes.fromhex(arg_0)
    except:
        arg_1 = binascii.unhexlify(arg_0) # Fallback for 2.7 compatibility
    return color_from_rgb(*struct.unpack('BBB',arg_1))


def Func(arg_0, arg_1, arg_2, arg_3='ditaa'):
    """Render ditaa code into a PNG output file."""
    arg_4 = arg_1.encode('utf-8') + str(arg_2) + \
              str(arg_0.builder.config.ditaa) + \
              str(arg_0.builder.config.ditaa_args)
    arg_5 = '%s-%s.%s' % (arg_3, sha(arg_4).hexdigest(), "ditaa")
    arg_6 = '%s-%s.%s' % (arg_3, sha(arg_4).hexdigest(), "png")

    arg_7 = posixpath.join(arg_0.builder.imgpath, arg_5)
    arg_8 = path.join(arg_0.builder.outdir, '_images', arg_5)
    arg_9 = posixpath.join(arg_0.builder.imgpath, arg_6)
    arg_10 = path.join(arg_0.builder.outdir, '_images', arg_6)

    if path.isfile(arg_10):
        return arg_9, arg_10

    ensuredir(path.dirname(arg_10))

    # ditaa expects UTF-8 by default
    if isinstance(arg_1, unicode):
        arg_1 = arg_1.encode('utf-8')

    arg_11 = [arg_0.builder.config.ditaa]
    arg_11.extend(arg_0.builder.config.ditaa_args)
    arg_11.extend(arg_2)
    arg_11.extend( [arg_8] )
    arg_11.extend( [arg_10] )

    arg_12 = open(arg_8, 'w')
    arg_12.write(arg_1)
    arg_12.close()

    try:
        arg_0.builder.warn(arg_11)
        arg_13 = Popen(arg_11, arg_17=PIPE, stdin=PIPE, arg_18=PIPE)
    except OSError, err:
        if err.errno != ENOENT:   # No such file or directory
            raise
        arg_0.builder.warn('ditaa command %r cannot be run (needed for ditaa '
                          'output), check the ditaa setting' %
                          arg_0.builder.config.ditaa)
        arg_0.builder._ditaa_warned_dot = True
        return None, None
    arg_16 = False
    try:
        # Ditaa may close standard input when an error occurs,
        # resulting in a broken pipe on communicate()
        arg_17, arg_18 = arg_13.communicate(arg_1)
    except OSError, err:
        if err.errno != EPIPE:
            raise
        arg_16 = True
    except IOError, err:
        if err.errno != EINVAL:
            raise
        arg_16 = True
    if arg_16:
        # in this case, read the standard output and standard error streams
        # directly, to get the error message(s)
        arg_17, arg_18 = arg_13.stdout.read(), arg_13.stderr.read()
        arg_13.wait()
    if arg_13.returncode != 0:
        raise DitaaError('ditaa exited with error:\n[stderr]\n%s\n'
                            '[stdout]\n%s' % (arg_18, arg_17))
    return arg_9, arg_10

Render ditaa code into a PNG output file .


"""    <script>        requirejs.config({            paths: {                qVisualization: "https://qvisualization.mybluemix.net/q-visualizations"            }        });        require(["qVisualization"], function(qVisualizations) {            qVisualizations.plotState("hinton_$divNumber",                                      "hinton",                                      $executions,                                      $options);        });    </script>    """

def Func(arg_0, arg_1=None):
    """ Create a hinton representation.

        Graphical representation of the input array using a 2D city style
        graph (hinton).

        Args:
            rho (array): Density matrix
            figsize (tuple): Figure size in pixels.
    """

    # HTML
    arg_2 = Template("""

    """)

    # JavaScript
    arg_3 = Template("""

    """)
    arg_0 = _validate_input_state(arg_0)
    if arg_1 is None:
        arg_4 = {}
    else:
        arg_4 = {'width': arg_1[0], 'height': arg_1[1]}

    # Process data and execute
    arg_5 = str(time.time())
    arg_5 = re.sub('[.]', '', arg_5)

    # Process data and execute
    arg_6 = []
    arg_7 = []
    for arg_8 in arg_0:
        arg_9 = []
        arg_10 = []

        for arg_11 in arg_8.real:
            arg_9.append(float(arg_11))
        arg_6.append(arg_9)

        for arg_12 in arg_8.imag:
            arg_10.append(float(arg_12))
        arg_7.append(arg_10)

    arg_13 = arg_2.substitute({
        'divNumber': arg_5
    })

    arg_14 = arg_3.substitute({
        'divNumber': arg_5,
        'executions': [{'data': arg_6}, {'data': arg_7}],
        'options': arg_4
    })

    display(HTML(arg_13 + arg_14))


def Func ( arg_0 , arg_1 = None ) : arg_2 = arg_0 / COLLECTION_FILENAME if not arg_2 . exists ( ) : raise MissingFile ( arg_2 ) arg_3 = _parse_document_id ( etree . parse ( arg_2 . open ( ) ) ) arg_1 = arg_1 or [ ] arg_1 . extend ( [ lambda filepath : filepath . name == COLLECTION_FILENAME , lambda filepath : filepath . is_dir ( ) , ] ) arg_4 = _find_resources ( arg_0 , arg_1 = arg_1 ) arg_5 = tuple ( _resource_from_path ( res ) for res in arg_4 ) return Collection ( arg_3 , arg_2 , arg_5 )

def Func(arg_0, arg_1=None):
    """Parse a file structure to a data structure given the path to
    a collection directory.

    """
    arg_2 = arg_0 / COLLECTION_FILENAME
    if not arg_2.exists():
        raise MissingFile(arg_2)
    arg_3 = _parse_document_id(etree.parse(arg_2.open()))

    arg_1 = arg_1 or []
    arg_1.extend([
        lambda filepath: filepath.name == COLLECTION_FILENAME,
        lambda filepath: filepath.is_dir(),
    ])
    arg_4 = _find_resources(arg_0, arg_1=arg_1)
    arg_5 = tuple(_resource_from_path(res) for res in arg_4)

    return Collection(arg_3, arg_2, arg_5)

Parse a file structure to a data structure given the path to a collection directory .