def Func ( arg_0 , arg_1 = None ) : def decorator ( arg_2 ) : @ wraps ( arg_2 ) def decorated_function ( * arg_3 , ** arg_4 ) : arg_5 = [ ] arg_6 = { } for arg_7 in arg_0 : if isinstance ( arg_7 , string_types ) : arg_4 [ 'project' ] = arg_7 if arg_1 : arg_4 [ 'key_file' ] = arg_1 elif isinstance ( arg_7 , dict ) : arg_4 [ 'project' ] = arg_7 [ 'project' ] arg_4 [ 'key_file' ] = arg_7 [ 'key_file' ] arg_8 , arg_9 = arg_2 ( * arg_3 , ** arg_4 ) arg_5 . extend ( arg_8 ) arg_6 . update ( arg_9 ) return ( arg_5 , arg_6 ) return decorated_function return decorator

def Func(arg_0, arg_1=None):
    """
    Call decorated function for each item in project list.

    Note: the function 'decorated' is expected to return a value plus a dictionary of exceptions.

    If item in list is a dictionary, we look for a 'project' and 'key_file' entry, respectively.
    If item in list is of type string_types, we assume it is the project string. Default credentials
    will be used by the underlying client library.

    :param projects: list of project strings or list of dictionaries
                     Example: {'project':..., 'keyfile':...}. Required.
    :type projects: ``list`` of ``str`` or ``list`` of ``dict``

    :param key_file: path on disk to keyfile, for use with all projects
    :type key_file: ``str``

    :returns: tuple containing a list of function output and an exceptions map
    :rtype: ``tuple of ``list``, ``dict``
    """

    def decorator(arg_2):
        @wraps(arg_2)
        def decorated_function(*arg_3, **arg_4):
            arg_5 = []
            arg_6 = {}
            for arg_7 in arg_0:
                if isinstance(arg_7, string_types):
                    arg_4['project'] = arg_7
                    if arg_1:
                        arg_4['key_file'] = arg_1
                elif isinstance(arg_7, dict):
                    arg_4['project'] = arg_7['project']
                    arg_4['key_file'] = arg_7['key_file']
                arg_8, arg_9 = arg_2(*arg_3, **arg_4)
                arg_5.extend(arg_8)
                arg_6.update(arg_9)
            return (arg_5, arg_6)

        return decorated_function

    return decorator

Call decorated function for each item in project list .


def Func ( arg_0 , arg_1 ) : arg_2 = [ None ] * len ( ModelTerminator . _MILESTONES ) for arg_3 , ( arg_4 , arg_5 ) in enumerate ( ModelTerminator . _MILESTONES ) : arg_6 = functools . partial ( arg_1 , arg_3 = arg_3 ) arg_2 [ arg_3 ] = PeriodicActivityRequest ( repeating = False , period = arg_4 , arg_6 = arg_6 )

def Func(arg_0, arg_1):
    """ Returns the periodic checks to see if the model should
    continue running.

    Parameters:
    -----------------------------------------------------------------------
    terminationFunc:  The function that will be called in the model main loop
                      as a wrapper around this function. Must have a parameter
                      called 'index'

    Returns:          A list of PeriodicActivityRequest objects.
    """
    arg_2 = [None] * len(ModelTerminator._MILESTONES)
    for arg_3, (arg_4, arg_5) in enumerate(ModelTerminator._MILESTONES):
      arg_6 = functools.partial(arg_1, arg_3=arg_3)
      arg_2[arg_3] = PeriodicActivityRequest(repeating =False,
                                                  period = arg_4,
                                                  arg_6=arg_6)

Returns the periodic checks to see if the model should continue running .


def Func ( arg_0 , arg_1 , arg_2 = None ) : for arg_3 in arg_1 : arg_4 = { } arg_5 = 0 arg_4 [ 'location' ] = pt . StringCol ( pypetconstants . HDF5_STRCOL_MAX_LOCATION_LENGTH , pos = 0 ) arg_4 [ 'name' ] = pt . StringCol ( pypetconstants . HDF5_STRCOL_MAX_NAME_LENGTH , pos = 1 ) arg_4 [ 'comment' ] = pt . StringCol ( pypetconstants . HDF5_STRCOL_MAX_COMMENT_LENGTH ) arg_4 [ 'value' ] = pt . StringCol ( pypetconstants . HDF5_STRCOL_MAX_VALUE_LENGTH , pos = 2 ) if arg_3 == 'config_overview' : if arg_2 is not None : arg_5 = len ( arg_2 . _config ) if arg_3 == 'parameters_overview' : if arg_2 is not None : arg_5 = len ( arg_2 . _parameters ) if arg_3 == 'explored_parameters_overview' : arg_4 [ 'range' ] = pt . StringCol ( pypetconstants . HDF5_STRCOL_MAX_RANGE_LENGTH ) arg_4 [ 'length' ] = pt . IntCol ( ) if arg_2 is not None : arg_5 = len ( arg_2 . _explored_parameters ) if arg_3 . endswith ( 'summary' ) : arg_4 [ 'hexdigest' ] = pt . StringCol ( 64 , pos = 10 ) if arg_3 == 'derived_parameters_overview' : arg_5 = arg_0 . _derived_parameters_per_run if arg_2 is not None : arg_5 *= len ( arg_2 ) arg_5 += len ( arg_2 . _derived_parameters ) if arg_3 == 'results_overview' : arg_5 = arg_0 . _results_per_run if arg_2 is not None : arg_5 *= len ( arg_2 ) arg_5 += len ( arg_2 . _results ) if arg_5 > 0 : arg_6 = arg_0 . _all_get_or_create_table ( where = arg_0 . _overview_group , tablename = arg_3 , description = arg_4 , arg_5 = arg_5 ) else : arg_6 = arg_0 . _all_get_or_create_table ( where = arg_0 . _overview_group , tablename = arg_3 , description = arg_4 ) arg_6 . flush ( )

def Func(arg_0, arg_1, arg_2=None):
        """Creates the overview tables in overview group"""
        for arg_3 in arg_1:
            # Prepare the tables desciptions, depending on which overview table we create
            # we need different columns
            arg_4 = {}
            arg_5 = 0

            # Every overview table has a name and location column
            arg_4['location'] = pt.StringCol(
                pypetconstants.HDF5_STRCOL_MAX_LOCATION_LENGTH,
                pos=0)
            arg_4['name'] = pt.StringCol(pypetconstants.HDF5_STRCOL_MAX_NAME_LENGTH,
                                                        pos=1)

            arg_4['comment'] = pt.StringCol(
                    pypetconstants.HDF5_STRCOL_MAX_COMMENT_LENGTH)

            arg_4['value'] = pt.StringCol(
                    pypetconstants.HDF5_STRCOL_MAX_VALUE_LENGTH, pos=2)

            if arg_3 == 'config_overview':
                if arg_2 is not None:
                    arg_5 = len(arg_2._config)

            if arg_3 == 'parameters_overview':
                if arg_2 is not None:
                    arg_5 = len(arg_2._parameters)

            if arg_3 == 'explored_parameters_overview':
                arg_4['range'] = pt.StringCol(
                    pypetconstants.HDF5_STRCOL_MAX_RANGE_LENGTH)
                arg_4['length'] = pt.IntCol()
                if arg_2 is not None:
                    arg_5 = len(arg_2._explored_parameters)

            if arg_3.endswith('summary'):
                arg_4['hexdigest'] = pt.StringCol(64, pos=10)

            # Check if the user provided an estimate of the amount of results per run
            # This can help to speed up storing
            if arg_3 == 'derived_parameters_overview':

                arg_5 = arg_0._derived_parameters_per_run

                if arg_2 is not None:
                    arg_5 *= len(arg_2)
                    arg_5 += len(arg_2._derived_parameters)

            if arg_3 == 'results_overview':
                arg_5 = arg_0._results_per_run

                if arg_2 is not None:
                    arg_5 *= len(arg_2)
                    arg_5 += len(arg_2._results)

            if arg_5 > 0:
                arg_6 = arg_0._all_get_or_create_table(where=arg_0._overview_group,
                                                           tablename=arg_3,
                                                           description=arg_4,
                                                           arg_5=arg_5)
            else:
                arg_6 = arg_0._all_get_or_create_table(where=arg_0._overview_group,
                                                           tablename=arg_3,
                                                           description=arg_4)

            arg_6.flush()


(  # pylint: disable=too-many-arguments
    o: Any,
    human_readable: bool = False,
    print_dup: bool = PRINT_DUP,
    print_length: PrintCountSetting = PRINT_LENGTH,
    print_level: PrintCountSetting = PRINT_LEVEL,
    print_meta: bool = PRINT_META,
    print_readably: bool = PRINT_READABLY,
)

def Func(  # pylint: disable=too-many-arguments
    arg_0: arg_1,
    arg_2: arg_3 = False,
    arg_4: arg_3 = arg_5,
    arg_6: arg_7 = arg_8,
    arg_9: arg_7 = arg_10,
    arg_11: arg_3 = arg_12,
    arg_13: arg_3 = arg_14,
) -> str:
    """Return a string representation of a Lisp object.

    Permissible keyword arguments are:
    - human_readable: if logical True, print strings without quotations or
                      escape sequences (default: false)
    - print_dup: if logical true, print objects in a way that preserves their
                 types (default: false)
    - print_length: the number of items in a collection which will be printed,
                    or no limit if bound to a logical falsey value (default: 50)
    - print_level: the depth of the object graph to print, starting with 0, or
                   no limit if bound to a logical falsey value (default: nil)
    - print_meta: if logical true, print objects meta in a way that can be
                  read back by the reader (default: false)
    - print_readably: if logical false, print strings and characters with
                      non-alphanumeric characters converted to escape sequences
                      (default: true)

    Note that this function is not capable of capturing the values bound at
    runtime to the basilisp.core dynamic variables which correspond to each
    of the keyword arguments to this function. To use a version of Func
    which does capture those values, call basilisp.lang.runtime.Func directly."""
    if isinstance(arg_0, LispObject):
        return arg_0._Func(
            arg_2=arg_2,
            arg_4=arg_4,
            arg_6=arg_6,
            arg_9=arg_9,
            arg_11=arg_11,
            arg_13=arg_13,
        )
    else:  # pragma: no cover
        return _Func_fallback(
            arg_0,
            arg_2=arg_2,
            arg_4=arg_4,
            arg_6=arg_6,
            arg_9=arg_9,
            arg_11=arg_11,
            arg_13=arg_13,
        )

Return a string representation of a Lisp object.

    Permissible keyword arguments are:
    - human_readable: if logical True, print strings without quotations or
                      escape sequences (default: false)
    - print_dup: if logical true, print objects in a way that preserves their
                 types (default: false)
    - print_length: the number of items in a collection which will be printed,
                    or no limit if bound to a logical falsey value (default: 50)
    - print_level: the depth of the object graph to print, starting with 0, or
                   no limit if bound to a logical falsey value (default: nil)
    - print_meta: if logical true, print objects meta in a way that can be
                  read back by the reader (default: false)
    - print_readably: if logical false, print strings and characters with
                      non-alphanumeric characters converted to escape sequences
                      (default: true)

    Note that this function is not capable of capturing the values bound at
    runtime to the basilisp.core dynamic variables which correspond to each
    of the keyword arguments to this function. To use a version of lrepr
    which does capture those values, call basilisp.lang.runtime.lrepr directly.

Return a string representation of a Lisp object .


def Func ( arg_0 ) : arg_0 . _checkers = [ ] for arg_2 in _default_checkers : arg_2 ( shell = arg_0 . shell , prefilter_manager = arg_0 , config = arg_0 . config )

def Func(arg_0):
        """Create the default checkers."""
        arg_0._checkers = []
        for arg_2 in _default_checkers:
            arg_2(
                shell=arg_0.shell, prefilter_manager=arg_0, config=arg_0.config
            )


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = { 'job-id' : None , 'task-id' : 'task' , 'job-name' : None , 'user-id' : None , 'task-attempt' : None } for arg_4 in arg_3 : arg_3 [ arg_4 ] = arg_2 . get ( arg_4 ) or arg_1 . get ( arg_4 ) or arg_3 [ arg_4 ] return arg_0 . format ( ** arg_3 )

def Func(arg_0, arg_1, arg_2):
  """Returns a URI with placeholders replaced by metadata values."""

  arg_3 = {
      'job-id': None,
      'task-id': 'task',
      'job-name': None,
      'user-id': None,
      'task-attempt': None
  }
  for arg_4 in arg_3:
    arg_3[arg_4] = arg_2.get(arg_4) or arg_1.get(arg_4) or arg_3[arg_4]

  return arg_0.format(**arg_3)

Returns a URI with placeholders replaced by metadata values .


(self, item, with_links=True, shortcuts=False, max_depth=None)

def Func ( arg_0 , arg_1 , arg_2 = True , arg_3 = False , arg_4 = None ) : try : arg_5 = arg_1 . v_full_name arg_6 = arg_0 . v_full_name if not arg_5 . startswith ( arg_6 ) : return False if arg_6 != '' : arg_5 = arg_5 [ len ( arg_6 ) + 1 : ] else : arg_5 = arg_5 arg_3 = False except AttributeError : arg_5 = arg_1 arg_1 = None if arg_5 == '' : return False try : arg_7 = arg_0 . f_get ( arg_5 , arg_3 = arg_3 , arg_4 = arg_4 , arg_2 = arg_2 ) except AttributeError : return False if arg_1 is not None : return id ( arg_1 ) == id ( arg_7 ) else : return True

def Func(arg_0, arg_1, arg_2=True, arg_3=False, arg_4=None):
        """Checks if the node contains a specific parameter or result.

        It is checked if the item can be found via the
        :func:`~pypet.naturalnaming.NNGroupNode.f_get` method.

        :param item: Parameter/Result name or instance.

            If a parameter or result instance is supplied it is also checked if
            the provided item and the found item are exactly the same instance, i.e.
            `id(item)==id(found_item)`.

        :param with_links:

            If links are considered.

        :param shortcuts:

            Shortcuts is `False` the name you supply must
            be found in the tree WITHOUT hopping over nodes in between.
            If `shortcuts=False` and you supply a
            non colon separated (short) name, than the name must be found
            in the immediate children of your current node.
            Otherwise searching via shortcuts is allowed.

        :param max_depth:

            If shortcuts is `True` than the maximum search depth
            can be specified. `None` means no limit.

        :return: True or False

        """

        # Check if an instance or a name was supplied by the user
        try:
            arg_5 = arg_1.v_full_name
            arg_6 = arg_0.v_full_name

            if not arg_5.startswith(arg_6):
                return False

            if arg_6 != '':
                arg_5 = arg_5[len(arg_6) + 1:]
            else:
                arg_5 = arg_5

            arg_3 = False # if we search for a particular item we do not allow shortcuts

        except AttributeError:
            arg_5 = arg_1
            arg_1 = None

        if arg_5 == '':
            return False # To allow to search for nodes wit name = '', which are never part
            # of the trajectory

        try:
            arg_7 = arg_0.f_get(arg_5,
                                arg_3=arg_3, arg_4=arg_4, arg_2=arg_2)
        except AttributeError:
            return False

        if arg_1 is not None:
            return id(arg_1) == id(arg_7)
        else:
            return True

Checks if the node contains a specific parameter or result .


def Func ( arg_0 , arg_1 ) : arg_2 = { val [ 'name' ] : val for val in arg_1 } for arg_3 , arg_4 in arg_0 . iteritems ( ) : if 'group' in arg_2 [ arg_3 ] : for arg_5 , arg_6 in Func ( arg_4 , arg_2 [ arg_3 ] [ 'group' ] ) : yield ( arg_5 , arg_6 ) else : yield ( arg_2 [ arg_3 ] , arg_0 )

def Func(arg_0, arg_1):
    """Recursively iterate over all DictField sub-fields.

    :param fields: Field instance (e.g. input)
    :type fields: dict
    :param schema: Schema instance (e.g. input_schema)
    :type schema: dict

    """
    arg_2 = {val['name']: val for val in arg_1}
    for arg_3, arg_4 in arg_0.iteritems():
        if 'group' in arg_2[arg_3]:
            for arg_5, arg_6 in Func(arg_4, arg_2[arg_3]['group']):
                yield (arg_5, arg_6)
        else:
            yield (arg_2[arg_3], arg_0)

Recursively iterate over all DictField sub - fields .


def Func ( arg_0 = None , arg_1 = 'MONGODB_' , ** arg_2 ) : if arg_0 is not None and isinstance ( arg_0 , types . ModuleType ) : arg_3 = ( ( attr . replace ( arg_1 , '' ) . lower ( ) , value ) for attr , value in vars ( arg_0 ) . items ( ) if attr . startswith ( arg_1 ) ) _Options . _Func ( ** dict ( arg_3 ) ) elif arg_2 : _Options . _Func ( ** arg_2 )

def Func(arg_0=None, arg_1='MONGODB_', **arg_2):
    """Sets defaults for ``class Meta`` declarations.

    Arguments can either be extracted from a `module` (in that case
    all attributes starting from `prefix` are used):

    >>> import foo
    >>> Func(foo)

    or passed explicictly as keyword arguments:

    >>> Func(database='foo')

    .. warning:: Current implementation is by no means thread-safe --
                 use it wisely.
    """
    if arg_0 is not None and isinstance(arg_0, types.ModuleType):
        # Search module for MONGODB_* attributes and converting them
        # to _Options' values, ex: MONGODB_PORT ==> port.
        arg_3 = ((attr.replace(arg_1, '').lower(), value)
                 for attr, value in vars(arg_0).items()
                 if attr.startswith(arg_1))

        _Options._Func(**dict(arg_3))
    elif arg_2:
        _Options._Func(**arg_2)

Sets defaults for ``class Meta`` declarations.

    Arguments can either be extracted from a `module` (in that case
    all attributes starting from `prefix` are used):

    >>> import foo
    >>> configure(foo)

    or passed explicictly as keyword arguments:

    >>> configure(database='foo')

    .. warning:: Current implementation is by no means thread-safe --
                 use it wisely.

Sets defaults for class Meta declarations .


(self, element, level, declared_prefixes)

return start_tag + text + u''.join(children) + end_tag + tail

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
)
:
arg_4
=
{
}
arg_3
=
dict
(
arg_3
)
arg_5
=
arg_1
.
tag
arg_6
=
arg_0
.
_make_prefixed
(
arg_5
,
True
,
arg_3
,
arg_4
)
arg_7
=
u"<{0}"
.
format
(
arg_6
)
arg_8
=
u"</{0}>"
.
format
(
arg_6
)
for
arg_5
,
arg_9
in
arg_1
.
items
(
)
:
arg_6
=
arg_0
.
_make_prefixed
(
arg_5
,
False
,
arg_3
,
arg_4
)
arg_7
+=
u' {0}={1}'
.
format
(
arg_6
,
quoteattr
(
arg_9
)
)
arg_4
=
arg_0
.
_make_ns_declarations
(
arg_4
,
arg_3
)
if
arg_4
:
arg_7
+=
u" "
+
arg_4
arg_10
=
[
]
for
arg_11
in
arg_1
:
arg_10
.
append
(
arg_0
.
Func
(
arg_11
,
arg_2
+
1
,
arg_3
)
)
if
not
arg_10
and
not
arg_1
.
text
:
arg_7
+=
u"/>"
arg_8
=
u""
arg_12
=
u""
else
:
arg_7
+=
u">"
if
arg_2
>
0
and
arg_1
.
text
:
arg_12
=
escape
(
arg_1
.
text
)
else
:
arg_12
=
u""
if
arg_2
>
1
and
arg_1
.
tail
:
arg_13
=
escape
(
arg_1
.
tail
)
else
:
arg_13
=
u""
return
arg_7
+
arg_12
+
u''
.
join
(
arg_10
)
+
arg_8
+
arg_13

def Func(arg_0, arg_1, arg_2, arg_3):
        """"Recursive XML element serializer.

        :Parameters:
            - `element`: the element to serialize
            - `level`: nest level (0 - root element, 1 - stanzas, etc.)
            - `declared_prefixes`: namespace to prefix mapping of already
              declared prefixes.
        :Types:
            - `element`: :etree:`ElementTree.Element`
            - `level`: `int`
            - `declared_prefixes`: `unicode` to `unicode` dictionary

        :Return: serialized element
        :Returntype: `unicode`
        """
        arg_4 = {}
        arg_3 = dict(arg_3)
        arg_5 = arg_1.tag
        arg_6 = arg_0._make_prefixed(arg_5, True, arg_3,
                                                                arg_4)
        arg_7 = u"<{0}".format(arg_6)
        arg_8 = u"</{0}>".format(arg_6)
        for arg_5, arg_9 in arg_1.items():
            arg_6 = arg_0._make_prefixed(arg_5, False, arg_3,
                                                                arg_4)
            arg_7 += u' {0}={1}'.format(arg_6, quoteattr(arg_9))

        arg_4 = arg_0._make_ns_declarations(arg_4,
                                                        arg_3)
        if arg_4:
            arg_7 += u" " + arg_4
        arg_10 = []
        for arg_11 in arg_1:
            arg_10.append(arg_0.Func(arg_11, arg_2 +1,
                                                        arg_3))
        if not arg_10 and not arg_1.text:
            arg_7 += u"/>"
            arg_8 = u""
            arg_12 = u""
        else:
            arg_7 += u">"
            if arg_2 > 0 and arg_1.text:
                arg_12 = escape(arg_1.text)
            else:
                arg_12 = u""
        if arg_2 > 1 and arg_1.tail:
            arg_13 = escape(arg_1.tail)
        else:
            arg_13 = u""
        return arg_7 + arg_12 + u''.join(arg_10) + arg_8 + arg_13


(
            self,
            enterprise_enrollment,
            completed_date=None,
            is_passing=False,
            **kwargs
    )

def Func(
            arg_0,
            arg_1,
            arg_2=None,
            arg_3=False,
            **arg_4
    ):  # pylint: disable=arguments-differ,unused-argument
        """
        Return a DegreedLearnerDataTransmissionAudit with the given enrollment and course completion data.

        If completed_date is None, then course completion has not been met.

        If no remote ID can be found, return None.
        """
        # Degreed expects completion dates of the form 'yyyy-mm-dd'.
        arg_5 = arg_2.strftime("%F") if isinstance(arg_2, datetime) else None
        if arg_1.enterprise_customer_user.get_remote_id() is not None:
            arg_6 = apps.get_model(  # pylint: disable=invalid-name
                'degreed',
                'DegreedLearnerDataTransmissionAudit'
            )
            # We return two records here, one with the course key and one with the course run id, to account for
            # uncertainty about the type of content (course vs. course run) that was sent to the integrated channel.
            return [
                arg_6(
                    enterprise_course_enrollment_id=arg_1.id,
                    degreed_user_email=arg_1.enterprise_customer_user.user_email,
                    course_id=parse_course_key(arg_1.course_id),
                    course_completed=arg_2 is not None and arg_3,
                    arg_5=arg_5,
                ),
                arg_6(
                    enterprise_course_enrollment_id=arg_1.id,
                    degreed_user_email=arg_1.enterprise_customer_user.user_email,
                    course_id=arg_1.course_id,
                    course_completed=arg_2 is not None and arg_3,
                    arg_5=arg_5,
                )
            ]
        else:
            LOGGER.debug(
                'No learner data was sent for user [%s] because a Degreed user ID could not be found.',
                arg_1.enterprise_customer_user.username
            )

Return a DegreedLearnerDataTransmissionAudit with the given enrollment and course completion data .


def Func(arg_0, arg_1, arg_2, arg_3):
        """Updates the memoization lookup table with the result from a task.

        Args:
             - task_id (int): Integer task id
             - task (dict) : A task dict from dfk.tasks
             - r (Result future): Result future

        A warning is issued when a hash collision occurs during the update.
        This is not likely.
        """
        if not arg_0.memoize or not arg_2['memoize']:
            return

        if arg_2['hashsum'] in arg_0.memo_lookup_table:
            logger.info('Updating appCache entry with latest %s:%s call' %
                        (arg_2['func_name'], arg_1))
            arg_0.memo_lookup_table[arg_2['hashsum']] = arg_3
        else:
            arg_0.memo_lookup_table[arg_2['hashsum']] = arg_3

Updates the memoization lookup table with the result from a task .


def Func(arg_0):
    """
    Converts an array to its voxel list.

    Arguments:
        array (numpy.ndarray): A numpy nd array. This must be boolean!

    Returns:
        A list of n-tuples
    """
    if type(arg_0) is not numpy.ndarray:
        raise ValueError("array argument must be of type numpy.ndarray")
    return numpy.argwhere(arg_0)


def
Func
(
arg_0
,
*
arg_1
,
**
arg_2
)
:
Func
=
dict
(
(
a
,
{
}
)
for
a
in
arg_1
)
Func
.
update
(
arg_2
)
if
not
Func
:
raise
AttributeError
(
'Faceting requires at least one field'
)
for
arg_4
in
Func
.
keys
(
)
:
if
not
isinstance
(
arg_4
,
six
.
string_types
)
:
raise
AttributeError
(
'Facet field arguments must be strings'
)
arg_5
=
arg_0
.
_clone
(
)
arg_5
.
_limit
=
0
arg_5
.
execute
(
offset
=
0
,
Func
=
Func
)
return
arg_5
.
_response
.
get
(
'facets'
)

def Func(arg_0, *arg_1, **arg_2):
        """
        Returns a dictionary with the requested facets.

        The facets function supports string args, and keyword
        args.

        q.facets('field_1', 'field_2') will return facets for
        field_1 and field_2.
        q.facets(field_1={'limit': 0}, field_2={'limit': 10})
        will return all facets for field_1 and 10 facets for field_2.
        """
        # Combine args and kwargs into facet format.
        Func = dict((a, {}) for a in arg_1)
        Func.update(arg_2)

        if not Func:
            raise AttributeError('Faceting requires at least one field')

        for arg_4 in Func.keys():
            if not isinstance(arg_4, six.string_types):
                raise AttributeError('Facet field arguments must be strings')

        arg_5 = arg_0._clone()
        arg_5._limit = 0
        arg_5.execute(offset=0, Func=Func)
        return arg_5._response.get('facets')

Returns a dictionary with the requested facets .


return SISImportModel(data=self._post_resource(url, headers, body))

def Func ( arg_0 , arg_1 , arg_2 = { } ) : if not arg_0 . _canvas_account_id : raise MissingAccountID ( ) arg_3 = arg_0 . _build_archive ( arg_1 ) arg_2 [ "import_type" ] = SISImportModel . CSV_IMPORT_TYPE arg_4 = SIS_IMPORTS_API . format ( arg_0 . _canvas_account_id ) + ".json{}" . format ( arg_0 . _params ( arg_2 ) ) arg_5 = { "Content-Type" : "application/zip" } return SISImportModel ( data = arg_0 . _post_resource ( arg_4 , arg_5 , arg_3 ) )

def Func(arg_0, arg_1, arg_2={}):
        """
        Imports a directory of CSV files.

        https://canvas.instructure.com/doc/api/sis_imports.html#method.sis_imports_api.create
        """
        if not arg_0._canvas_account_id:
            raise MissingAccountID()

        arg_3 = arg_0._build_archive(arg_1)
        arg_2["import_type"] = SISImportModel.CSV_IMPORT_TYPE
        arg_4 = SIS_IMPORTS_API.format(
            arg_0._canvas_account_id) + ".json{}".format(arg_0._params(arg_2))
        arg_5 = {"Content-Type": "application/zip"}

        return SISImportModel(data=arg_0._post_resource(arg_4, arg_5, arg_3))


(
    s: str,
    resolver: Resolver = None,
    data_readers: DataReaders = None,
    eof: Any = None,
    is_eof_error: bool = False,
)

def Func ( arg_0 : arg_1 , arg_2 : arg_3 = None , arg_4 : arg_5 = None , arg_6 : arg_7 = None , arg_8 : arg_9 = False , ) -> Iterable [ ReaderForm ] : with io . StringIO ( arg_0 ) as buf : yield from read ( buf , arg_2 = arg_2 , arg_4 = arg_4 , arg_6 = arg_6 , arg_8 = arg_8 , )

def Func(
    arg_0: arg_1,
    arg_2: arg_3 = None,
    arg_4: arg_5 = None,
    arg_6: arg_7 = None,
    arg_8: arg_9 = False,
) -> Iterable[ReaderForm]:
    """Read the contents of a string as a Lisp expression.

    Keyword arguments to this function have the same meanings as those of
    basilisp.lang.reader.read."""
    with io.StringIO(arg_0) as buf:
        yield from read(
            buf,
            arg_2=arg_2,
            arg_4=arg_4,
            arg_6=arg_6,
            arg_8=arg_8,
        )

Read the contents of a string as a Lisp expression .


def
Func
(
arg_0
)
:
arg_1
=
initialise_component_loader
(
)
arg_2
=
sorted
(
{
"displays"
:
lambda
:
arg_1
.
load_by_type
(
ComponentType
.
DISPLAY
)
,
"datafeeds"
:
lambda
:
arg_1
.
load_by_type
(
ComponentType
.
DATA_FEED
)
,
"filters"
:
lambda
:
arg_1
.
load_by_type
(
ComponentType
.
FILTER
)
,
"notifications"
:
lambda
:
arg_1
.
load_by_type
(
ComponentType
.
NOTIFICATION
)
}
.
items
(
)
,
key
=
lambda
t
:
t
[
0
]
)
def
print_ids
(
arg_3
)
:
arg_4
=
{
c
.
id_key_value
[
1
]
if
hasattr
(
c
,
"id_key_value"
)
else
c
.
get_id
(
)
for
c
in
arg_3
}
for
arg_5
in
sorted
(
arg_4
)
:
click
.
echo
(
" - %s"
%
arg_5
)
for
arg_6
,
arg_7
in
arg_2
:
if
arg_0
==
arg_6
or
arg_0
==
"all"
:
click
.
echo
(
"Available %s:"
%
arg_6
)
print_ids
(
arg_7
(
)
)
if
arg_0
==
"all"
:
click
.
echo
(
""
)

def Func(arg_0):
    """List components that are available on your machine"""
    arg_1 = initialise_component_loader()
    arg_2 = sorted({
         "displays": lambda: arg_1.load_by_type(ComponentType.DISPLAY),
         "datafeeds": lambda: arg_1.load_by_type(ComponentType.DATA_FEED),
         "filters": lambda: arg_1.load_by_type(ComponentType.FILTER),
         "notifications": lambda: arg_1.load_by_type(ComponentType.NOTIFICATION)
    }.items(), key=lambda t: t[0])

    def print_ids(arg_3):
        arg_4 = {c.id_key_value[1] if hasattr(c, "id_key_value") else c.get_id() for c in arg_3}
        for arg_5 in sorted(arg_4):
            click.echo(" - %s" % arg_5)

    for arg_6, arg_7 in arg_2:
        if arg_0 == arg_6 or arg_0 == "all":
            click.echo("Available %s:" % arg_6)
            print_ids(arg_7())

        if arg_0 == "all":
            click.echo("")


def Func ( arg_0 , arg_1 ) : arg_2 = Counter ( ) for arg_3 , arg_4 in arg_1 . body . sentences . iteritems ( ) : if ( ( arg_0 . keyword_tagger_ids is not None and arg_3 not in arg_0 . keyword_tagger_ids ) ) : continue for arg_5 in arg_4 : for arg_6 in arg_5 . tokens : arg_7 = arg_6 . token arg_7 = arg_7 . decode ( 'utf-8' ) arg_7 = cleanse ( arg_7 ) if ( ( arg_0 . keyword_size_limit is not None and len ( arg_7 ) > arg_0 . keyword_size_limit ) ) : continue if arg_7 not in arg_0 . stop_words : arg_2 [ arg_7 ] += 1 return arg_2

def Func(arg_0, arg_1):
        '''Collect all of the words to be indexed from a stream item.

        This scans `si` for all of the configured tagger IDs.  It
        collects all of the token values (the
        :attr:`streamcorpus.Token.token`) and returns a
        :class:`collections.Counter` of them.

        :param si: stream item to scan
        :type si: :class:`streamcorpus.StreamItem`
        :return: counter of :class:`unicode` words to index
        :returntype: :class:`collections.Counter`

        '''
        arg_2 = Counter()
        for arg_3, arg_4 in arg_1.body.sentences.iteritems():
            if ((arg_0.keyword_tagger_ids is not None
                 and arg_3 not in arg_0.keyword_tagger_ids)):
                continue
            for arg_5 in arg_4:
                for arg_6 in arg_5.tokens:
                    arg_7 = arg_6.token  # always a UTF-8 byte string
                    arg_7 = arg_7.decode('utf-8')
                    arg_7 = cleanse(arg_7)
                    if ((arg_0.keyword_size_limit is not None and
                         len(arg_7) > arg_0.keyword_size_limit)):
                        continue
                    if arg_7 not in arg_0.stop_words:
                        arg_2[arg_7] += 1
        return arg_2

Collect all of the words to be indexed from a stream item .


def
Func
(
arg_0
,
**
arg_1
)
:
if
arg_0
.
choices
:
from
django_any
.
functions
import
valid_choices
arg_2
=
list
(
valid_choices
(
arg_0
.
choices
)
)
random
.
shuffle
(
arg_2
)
arg_3
=
[
]
arg_4
=
xunit
.
any_int
(
min_value
=
1
,
max_value
=
len
(
arg_0
.
choices
)
)
for
arg_5
in
xrange
(
0
,
arg_4
)
:
arg_3
.
append
(
arg_2
[
arg_5
]
)
return
' '
.
join
(
arg_3
)
return
'None'

def Func(arg_0, **arg_1):
    """
    Return random value for MultipleChoiceField

    >>> CHOICES = [('YNG', 'Child'), ('MIDDLE', 'Parent') ,('OLD', 'GrandParent')]
    >>> result = any_form_field(forms.MultipleChoiceField(choices=CHOICES))
    >>> type(result)
    <type 'str'>
    """
    if arg_0.choices:
        from django_any.functions import valid_choices
        arg_2 = list(valid_choices(arg_0.choices))
        random.shuffle(arg_2)
        arg_3 = []
        arg_4 = xunit.any_int(min_value=1, max_value=len(arg_0.choices))
        for arg_5 in xrange(0, arg_4):
            arg_3.append(arg_2[arg_5])
        return ' '.join(arg_3)
    return 'None'


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : if os . path . isfile ( arg_0 ) : arg_4 = msaf . io . FileStruct ( arg_0 ) arg_4 . features_file = arg_1 compute_all_features ( arg_4 , arg_3 ) else : arg_6 = msaf . io . get_dataset_files ( arg_0 ) return Parallel ( arg_2 = arg_2 ) ( delayed ( compute_all_features ) ( arg_4 , arg_3 ) for arg_4 in arg_6 )

def Func(arg_0, arg_1, arg_2, arg_3):
    """Computes the features for the selected dataset or file."""
    if os.path.isfile(arg_0):
        # Single file mode
        # Get (if they exitst) or compute features
        arg_4 = msaf.io.FileStruct(arg_0)
        arg_4.features_file = arg_1
        compute_all_features(arg_4, arg_3)
    else:
        # Collection mode
        arg_6 = msaf.io.get_dataset_files(arg_0)

        # Call in parallel
        return Parallel(arg_2=arg_2)(delayed(compute_all_features)(
            arg_4, arg_3) for arg_4 in arg_6)

Computes the features for the selected dataset or file .


Helper method used in conjunction with the view handler to
        stream responses to the client.

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = iter ( arg_2 ) arg_4 = { 'chunk' : next ( arg_3 ) } arg_1 . Funcing = True def Funcer ( ) : while True : if arg_1 . asynchronous : yield arg_4 [ 'chunk' ] else : arg_1 . send ( arg_4 [ 'chunk' ] ) yield arg_1 . body arg_1 . body = None try : arg_4 [ 'chunk' ] = next ( arg_3 ) except StopIteration : break if not arg_1 . asynchronous : arg_1 . close ( ) return Funcer ( )

def Func(arg_0, arg_1, arg_2):
        """
        Helper method used in conjunction with the view handler to
        Func responses to the client.
        """
        # Construct the iterator and run the sequence once in order
        # to capture any headers and status codes set.
        arg_3 = iter(arg_2)
        arg_4 = {'chunk': next(arg_3)}
        arg_1.Funcing = True

        def Funcer():
            # Iterate through the iterator and yield its content
            while True:
                if arg_1.asynchronous:
                    # Yield our current chunk.
                    yield arg_4['chunk']

                else:
                    # Write the chunk to the response
                    arg_1.send(arg_4['chunk'])

                    # Yield its body
                    yield arg_1.body

                    # Unset the body.
                    arg_1.body = None

                try:
                    # Get the next chunk.
                    arg_4['chunk'] = next(arg_3)

                except StopIteration:
                    # Get out of the loop.
                    break

            if not arg_1.asynchronous:
                # Close the response.
                arg_1.close()

        # Return the Funcing function.
        return Funcer()

Helper method used in conjunction with the view handler to stream responses to the client .


def Func ( arg_0 , arg_1 ) : arg_0 . mraa_gpio . Gpio . isrExit ( arg_0 . mraa_gpio . Gpio ( arg_1 ) )

def Func(arg_0, arg_1):
        """Remove edge detection for a particular GPIO channel.  Pin should be
        type IN.
        """
        arg_0.mraa_gpio.Gpio.isrExit(arg_0.mraa_gpio.Gpio(arg_1))

Remove edge detection for a particular GPIO channel . Pin should be type IN .


return '\n'.join(
            self.resource_to_html(resource)
            for resource in self.resources
            if resource.placement == placement
        )

def Func ( arg_0 , arg_1 ) : return '\n' . join ( arg_0 . resource_to_html ( arg_2 ) for arg_2 in arg_0 . resources if arg_2 . placement == arg_1 )

def Func(arg_0, arg_1):
        """
        Get some resource HTML for this Fragment.

        `placement` is "head" or "foot".

        Returns a unicode string, the HTML for the head or foot of the page.
        """
        # - non url js could be wrapped in an anonymous function
        # - non url css could be rewritten to match the wrapper tag

        return '\n'.join(
            arg_0.resource_to_html(arg_2)
            for arg_2 in arg_0.resources
            if arg_2.placement == arg_1
        )

Get some resource HTML for this Fragment .


(self, f_start=None, f_stop=None, if_id=0, logged=True, cb=True, MJD_time=False, **kwargs)

def
Func
(
arg_0
,
arg_1
=
,
arg_2
=
,
arg_3
=
0
,
arg_4
=
True
,
arg_5
=
True
,
arg_6
=
False
,
**
arg_7
)
:
arg_8
,
arg_9
=
arg_0
.
grab_data
(
arg_1
,
arg_2
,
arg_3
)
if
arg_0
.
header
[
b'foff'
]
<
0
:
arg_9
=
arg_9
[
...
,
:
:
1
]
arg_8
=
arg_8
[
:
:
1
]
if
arg_4
:
arg_9
=
db
(
arg_9
)
arg_10
,
arg_11
=
1
,
1
if
arg_9
.
shape
[
0
]
>
MAX_IMSHOW_POINTS
[
0
]
:
arg_10
=
int
(
arg_9
.
shape
[
0
]
/
MAX_IMSHOW_POINTS
[
0
]
)
if
arg_9
.
shape
[
1
]
>
MAX_IMSHOW_POINTS
[
1
]
:
arg_11
=
int
(
arg_9
.
shape
[
1
]
/
MAX_IMSHOW_POINTS
[
1
]
)
arg_9
=
rebin
(
arg_9
,
arg_10
,
arg_11
)
try
:
plt
.
title
(
arg_0
.
header
[
b'source_name'
]
)
except
KeyError
:
plt
.
title
(
arg_0
.
filename
)
arg_12
=
arg_0
.
_calc_extent
(
arg_8
=
arg_8
,
plot_t
=
arg_0
.
timestamps
,
arg_6
=
arg_6
)
plt
.
imshow
(
arg_9
,
aspect
=
'auto'
,
origin
=
'lower'
,
rasterized
=
True
,
interpolation
=
'nearest'
,
arg_12
=
arg_12
,
cmap
=
'viridis'
,
**
arg_7
)
if
arg_5
:
plt
.
colorbar
(
)
plt
.
xlabel
(
"Frequency [MHz]"
)
if
arg_6
:
plt
.
ylabel
(
"Time [MJD]"
)
else
:
plt
.
ylabel
(
"Time [s]"
)

def Func(arg_0, arg_1=None, arg_2=None, arg_3=0, arg_4=True, arg_5=True, arg_6=False, **arg_7):
        """ Plot waterfall of data

        Args:
            f_start (float): start frequency, in MHz
            f_stop (float): stop frequency, in MHz
            logged (bool): Plot in linear (False) or dB units (True),
            cb (bool): for plotting the colorbar
            kwargs: keyword args to be passed to matplotlib imshow()
        """

        arg_8, arg_9 = arg_0.grab_data(arg_1, arg_2, arg_3)

        #Using accending frequency for all plots.
        if arg_0.header[b'foff'] < 0:
            arg_9 = arg_9[..., ::-1] # Reverse data
            arg_8 = arg_8[::-1]

        if arg_4:
            arg_9 = db(arg_9)

        # Make sure waterfall plot is under 4k*4k
        arg_10, arg_11 = 1, 1
        if arg_9.shape[0] > MAX_IMSHOW_POINTS[0]:
            arg_10 = int(arg_9.shape[0] / MAX_IMSHOW_POINTS[0])

        if arg_9.shape[1] > MAX_IMSHOW_POINTS[1]:
            arg_11 =  int(arg_9.shape[1] /  MAX_IMSHOW_POINTS[1])

        arg_9 = rebin(arg_9, arg_10, arg_11)

        try:
            plt.title(arg_0.header[b'source_name'])
        except KeyError:
            plt.title(arg_0.filename)

        arg_12 = arg_0._calc_extent(arg_8=arg_8,plot_t=arg_0.timestamps,arg_6=arg_6)

        plt.imshow(arg_9,
            aspect='auto',
            origin='lower',
            rasterized=True,
            interpolation='nearest',
            arg_12=arg_12,
            cmap='viridis',
            **arg_7
        )
        if arg_5:
            plt.colorbar()
        plt.xlabel("Frequency [MHz]")
        if arg_6:
            plt.ylabel("Time [MJD]")
        else:
            plt.ylabel("Time [s]")


def Func ( arg_0 , arg_1 ) : arg_2 = object . __new__ ( arg_0 ) arg_2 . columnDimensions = tuple ( arg_1 . columnDimensions ) arg_2 . cellsPerColumn = int ( arg_1 . cellsPerColumn ) arg_2 . activationThreshold = int ( arg_1 . activationThreshold ) arg_2 . initialPermanence = round ( arg_1 . initialPermanence , EPSILON_ROUND ) arg_2 . connectedPermanence = round ( arg_1 . connectedPermanence , EPSILON_ROUND ) arg_2 . minThreshold = int ( arg_1 . minThreshold ) arg_2 . maxNewSynapseCount = int ( arg_1 . maxNewSynapseCount ) arg_2 . permanenceIncrement = round ( arg_1 . permanenceIncrement , EPSILON_ROUND ) arg_2 . permanenceDecrement = round ( arg_1 . permanenceDecrement , EPSILON_ROUND ) arg_2 . predictedSegmentDecrement = round ( arg_1 . predictedSegmentDecrement , EPSILON_ROUND ) arg_2 . maxSegmentsPerCell = int ( arg_1 . maxSegmentsPerCell ) arg_2 . maxSynapsesPerSegment = int ( arg_1 . maxSynapsesPerSegment ) arg_2 . connections = Connections . Func ( arg_1 . connections ) arg_2 . _random = Random ( ) arg_2 . _random . Func ( arg_1 . random ) arg_2 . activeCells = [ int ( x ) for x in arg_1 . activeCells ] arg_2 . winnerCells = [ int ( x ) for x in arg_1 . winnerCells ] arg_19 = arg_2 . connections . segmentFlatListLength ( ) arg_2 . numActiveConnectedSynapsesForSegment = [ 0 ] * arg_19 arg_2 . numActivePotentialSynapsesForSegment = [ 0 ] * arg_19 arg_2 . lastUsedIterationForSegment = [ 0 ] * arg_19 arg_2 . activeSegments = [ ] arg_2 . matchingSegments = [ ] for arg_25 in arg_1 . activeSegments : arg_2 . activeSegments . append ( arg_2 . connections . getSegment ( arg_25 . cell , arg_25 . idxOnCell ) ) for arg_25 in arg_1 . matchingSegments : arg_2 . matchingSegments . append ( arg_2 . connections . getSegment ( arg_25 . cell , arg_25 . idxOnCell ) ) for arg_25 in arg_1 . numActivePotentialSynapsesForSegment : arg_26 = arg_2 . connections . getSegment ( arg_25 . cell , arg_25 . idxOnCell ) arg_2 . numActivePotentialSynapsesForSegment [ arg_26 . flatIdx ] = ( int ( arg_25 . number ) ) arg_2 . iteration = long ( arg_1 . iteration ) for arg_25 in arg_1 . lastUsedIterationForSegment : arg_26 = arg_2 . connections . getSegment ( arg_25 . cell , arg_25 . idxOnCell ) arg_2 . lastUsedIterationForSegment [ arg_26 . flatIdx ] = ( long ( arg_25 . number ) ) return arg_2

def Func(arg_0, arg_1):
    """
    Reads deserialized data from proto object.

    :param proto: (DynamicStructBuilder) Proto object

    :returns: (:class:TemporalMemory) TemporalMemory instance
    """
    arg_2 = object.__new__(arg_0)

    # capnp fails to save a tuple, so proto.columnDimensions was forced to
    # serialize as a list.  We prefer a tuple, however, because columnDimensions
    # should be regarded as immutable.
    arg_2.columnDimensions = tuple(arg_1.columnDimensions)
    arg_2.cellsPerColumn = int(arg_1.cellsPerColumn)
    arg_2.activationThreshold = int(arg_1.activationThreshold)
    arg_2.initialPermanence = round(arg_1.initialPermanence, EPSILON_ROUND)
    arg_2.connectedPermanence = round(arg_1.connectedPermanence, EPSILON_ROUND)
    arg_2.minThreshold = int(arg_1.minThreshold)
    arg_2.maxNewSynapseCount = int(arg_1.maxNewSynapseCount)
    arg_2.permanenceIncrement = round(arg_1.permanenceIncrement, EPSILON_ROUND)
    arg_2.permanenceDecrement = round(arg_1.permanenceDecrement, EPSILON_ROUND)
    arg_2.predictedSegmentDecrement = round(arg_1.predictedSegmentDecrement,
                                         EPSILON_ROUND)

    arg_2.maxSegmentsPerCell = int(arg_1.maxSegmentsPerCell)
    arg_2.maxSynapsesPerSegment = int(arg_1.maxSynapsesPerSegment)

    arg_2.connections = Connections.Func(arg_1.connections)
    #pylint: disable=W0212
    arg_2._random = Random()
    arg_2._random.Func(arg_1.random)
    #pylint: enable=W0212

    arg_2.activeCells = [int(x) for x in arg_1.activeCells]
    arg_2.winnerCells = [int(x) for x in arg_1.winnerCells]

    arg_19 = arg_2.connections.segmentFlatListLength()
    arg_2.numActiveConnectedSynapsesForSegment = [0] * arg_19
    arg_2.numActivePotentialSynapsesForSegment = [0] * arg_19
    arg_2.lastUsedIterationForSegment = [0] * arg_19

    arg_2.activeSegments = []
    arg_2.matchingSegments = []

    for arg_25 in arg_1.activeSegments:
      arg_2.activeSegments.append(
        arg_2.connections.getSegment(arg_25.cell,
                                  arg_25.idxOnCell))

    for arg_25 in arg_1.matchingSegments:
      arg_2.matchingSegments.append(
        arg_2.connections.getSegment(arg_25.cell,
                                  arg_25.idxOnCell))

    for arg_25 in arg_1.numActivePotentialSynapsesForSegment:
      arg_26 = arg_2.connections.getSegment(arg_25.cell,
                                          arg_25.idxOnCell)

      arg_2.numActivePotentialSynapsesForSegment[arg_26.flatIdx] = (
        int(arg_25.number))

    arg_2.iteration = long(arg_1.iteration)

    for arg_25 in arg_1.lastUsedIterationForSegment:
      arg_26 = arg_2.connections.getSegment(arg_25.cell,
                                          arg_25.idxOnCell)

      arg_2.lastUsedIterationForSegment[arg_26.flatIdx] = (
        long(arg_25.number))

    return arg_2

Reads deserialized data from proto object .


def Func(arg_0):
    """
    Get the time without TZ enabled

    """

    arg_1 = Template('{% load tz %}{% get_current_timezone as TIME_ZONE %}{{ TIME_ZONE }}')
    arg_2 = RequestContext(arg_0)
    arg_3 = arg_1.render(arg_2)
    return HttpResponse(arg_3)


def Func ( arg_0 ) : global arg_2 with open ( arg_0 , 'r' , encoding = 'utf-8-sig' ) as f : arg_1 = f . read ( ) if arg_2 is None : arg_2 = Markdown ( extensions = [ 'markdown.extensions.meta' , 'markdown.extensions.tables' ] , output_format = 'html5' ) else : arg_2 . reset ( ) arg_2 . Meta = { } arg_4 = { 'description' : Markup ( arg_2 . convert ( arg_1 ) ) } try : arg_5 = arg_2 . Meta . copy ( ) except AttributeError : pass else : arg_4 [ 'meta' ] = arg_5 try : arg_4 [ 'title' ] = arg_2 . Meta [ 'title' ] [ 0 ] except KeyError : pass return arg_4

def Func(arg_0):
    """Reads markdown file, converts output and fetches title and meta-data for
    further processing.
    """
    global arg_2
    # Use utf-8-sig codec to remove BOM if it is present. This is only possible
    # this way prior to feeding the text to the markdown parser (which would
    # also default to pure utf-8)
    with open(arg_0, 'r', encoding='utf-8-sig') as f:
        arg_1 = f.read()

    if arg_2 is None:
        arg_2 = Markdown(extensions=['markdown.extensions.meta',
                                  'markdown.extensions.tables'],
                      output_format='html5')
    else:
        arg_2.reset()
        # When https://github.com/Python-Markdown/markdown/pull/672
        # will be available, this can be removed.
        arg_2.Meta = {}

    # Mark HTML with Markup to prevent jinja2 autoescaping
    arg_4 = {'description': Markup(arg_2.convert(arg_1))}

    try:
        arg_5 = arg_2.Meta.copy()
    except AttributeError:
        pass
    else:
        arg_4['meta'] = arg_5
        try:
            arg_4['title'] = arg_2.Meta['title'][0]
        except KeyError:
            pass

    return arg_4

Reads markdown file converts output and fetches title and meta - data for further processing .


(shape, probs, dtype=tf.int32, seed=None, name=None)

def Func(arg_0, arg_1, arg_2=arg_3.int32, arg_5=None, arg_6=None):
  """Returns samples from a Bernoulli distribution."""
  with arg_3.compat.v1.name_scope(arg_6, "random_bernoulli", [arg_0, arg_1]):
    arg_1 = arg_3.convert_to_tensor(value=arg_1)
    arg_7 = arg_3.random.uniform(arg_0, arg_2=arg_1.dtype, arg_5=arg_5)
    return arg_3.cast(arg_3.less(arg_7, arg_1), arg_2)

Returns samples from a Bernoulli distribution .


def Func ( arg_0 , arg_1 ) : return XMLElement ( lib . lsl_Func ( arg_0 . e , str . encode ( arg_1 ) ) )

def Func(arg_0, arg_1):
        """Get a Func with a specified name."""
        return XMLElement(lib.lsl_Func(arg_0.e, str.encode(arg_1)))


def Func(arg_0, arg_1, arg_2, arg_3):
        """Sets some details for internal handling."""
        arg_0._depth = arg_1
        arg_0._branch = arg_2
        arg_0._run_branch = arg_3

Sets some details for internal handling .


def Func ( arg_0 , arg_1 , arg_2 = "tag" ) : for arg_3 in arg_1 : arg_4 = arg_3 . params if arg_2 not in arg_4 : continue arg_0 . controlfields [ arg_4 [ arg_2 ] ] = arg_3 . getContent ( ) . strip ( )

def Func(arg_0, arg_1, arg_2="tag"):
        """
        Parse control fields.

        Args:
            fields (list): list of HTMLElements
            tag_id (str):  parameter name, which holds the information, about
                           field name this is normally "tag", but in case of
                           oai_marc "id".
        """
        for arg_3 in arg_1:
            arg_4 = arg_3.params

            # skip tags without parameters
            if arg_2 not in arg_4:
                continue

            arg_0.controlfields[arg_4[arg_2]] = arg_3.getContent().strip()


def Func ( arg_0 ) : if arg_0 . _source is None : arg_0 . emit ( "}\n" ) arg_0 . _source = "\n" . join ( arg_0 . lines ) del arg_0 . lines return arg_0 . _source

def Func(arg_0):
        """returns self._source"""
        if arg_0._source is None:
            arg_0.emit("}\n")
            arg_0._source = "\n".join(arg_0.lines)
            del arg_0.lines
        return arg_0._source


return self.__request__(method, url, data=json.dumps(data))

def Func ( arg_0 , arg_1 ) : arg_2 = 'PUT' arg_3 = 'watchlist' arg_4 = { 'auctionInfo' : [ { 'id' : arg_1 } ] } return arg_0 . __request__ ( arg_2 , arg_3 , arg_4 = json . dumps ( arg_4 ) )

def Func(arg_0, arg_1):
        """Send to watchlist.

        :params trade_id: Trade id.
        """
        arg_2 = 'PUT'
        arg_3 = 'watchlist'

        arg_4 = {'auctionInfo': [{'id': arg_1}]}
        return arg_0.__request__(arg_2, arg_3, arg_4=json.dumps(arg_4))


def Func ( arg_0 ) : arg_1 = tldextract . extract ( arg_0 ) if not arg_1 . suffix : raise InvalidURLException ( ) arg_2 = arg_1 . domain + "." + arg_1 . suffix return arg_2

def Func(arg_0):
    """
    Get root domain from url.
    Will prune away query strings, url paths, protocol prefix and sub-domains
    Exceptions will be raised on invalid urls
    """
    arg_1 = tldextract.extract(arg_0)
    if not arg_1.suffix:
        raise InvalidURLException()
    arg_2 = arg_1.domain + "." + arg_1.suffix
    return arg_2

Get root domain from url . Will prune away query strings url paths protocol prefix and sub - domains Exceptions will be raised on invalid urls


(ctx, pager, limit, twtfile, sorting, timeout, porcelain, source, cache, force_update)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6, arg_7, arg_8, arg_9):
    """Retrieve your personal Func."""
    if arg_7:
        arg_10 = arg_0.obj["conf"].get_source_by_nick(arg_7)
        if not arg_10:
            logger.debug("Not following {0}, trying as URL".format(arg_7))
            arg_10 = Source(arg_7, arg_7)
        arg_11 = [arg_10]
    else:
        arg_11 = arg_0.obj["conf"].following

    arg_12 = []

    if arg_8:
        try:
            with Cache.discover(update_interval=arg_0.obj["conf"].Func_update_interval) as arg_8:
                arg_9 = arg_9 or not arg_8.is_valid
                if arg_9:
                    arg_12 = get_remote_tweets(arg_11, arg_2, arg_5, arg_8)
                else:
                    logger.debug("Multiple calls to 'Func' within {0} seconds. Skipping update".format(
                        arg_8.update_interval))
                    # Behold, almighty list comprehensions! (I might have gone overboard here…)
                    arg_12 = list(chain.from_iterable([arg_8.get_tweets(arg_7.url) for arg_7 in arg_11]))
        except OSError as e:
            logger.debug(e)
            arg_12 = get_remote_tweets(arg_11, arg_2, arg_5)
    else:
        arg_12 = get_remote_tweets(arg_11, arg_2, arg_5)

    if arg_3 and not arg_7:
        arg_7 = Source(arg_0.obj["conf"].nick, arg_0.obj["conf"].twturl, file=arg_3)
        arg_12.extend(get_local_tweets(arg_7, arg_2))

    if not arg_12:
        return

    arg_12 = sort_and_truncate_tweets(arg_12, arg_4, arg_2)

    if arg_1:
        click.echo_via_pager(style_Func(arg_12, arg_6))
    else:
        click.echo(style_Func(arg_12, arg_6))


def Func(arg_0):
    """
    Returns the crs object from a file, with the format determined from the filename extension.

    Arguments:

    - *filepath*: filepath to be loaded, including extension.
    """
    if arg_0.endswith(".prj"):
        arg_1 = open(arg_0, "r").read()
        return parse.from_unknown_wkt(arg_1)

    elif arg_0.endswith((".geojson",".json")):
        arg_2 = open(arg_0).read()
        arg_3 = json.loads(arg_2)
        if "crs" in arg_3:
            arg_4 = arg_3["crs"]

            if arg_4["type"] == "name":
                arg_1 = arg_4["properties"]["name"]
                return parse.from_unknown_text(arg_1)

            elif arg_4["type"] == "link":
                arg_5 = arg_4["properties"]["name"]
                arg_6 = arg_4["properties"].get("type")
                return from_url(arg_5, format=arg_6)

            else: raise FormatError("Invalid GeoJSON crs type: must be either 'name' or 'link'")

        else:
            # assume default wgs84 as per the spec
            return parse.from_epsg_code("4326")

Returns the crs object from a file with the format determined from the filename extension .


def Func ( arg_0 , arg_1 = None ) : if arg_1 : arg_2 = arg_0 . client . describe_instances ( InstanceIds = arg_1 ) else : arg_2 = arg_0 . client . describe_instances ( InstanceIds = arg_0 . instances ) for arg_3 in range ( len ( arg_2 [ 'Reservations' ] ) ) : arg_4 = arg_2 [ 'Reservations' ] [ arg_3 ] [ 'Instances' ] [ 0 ] arg_0 . instance_states [ arg_4 [ 'InstanceId' ] ] = arg_4 [ 'State' ] [ 'Name' ] return arg_0 . instance_states

def Func(arg_0, arg_1=None):
        """Get states of all instances on EC2 which were started by this file."""
        if arg_1:
            arg_2 = arg_0.client.describe_instances(InstanceIds=arg_1)
        else:
            arg_2 = arg_0.client.describe_instances(InstanceIds=arg_0.instances)
        # pprint.pprint(desc['Reservations'],indent=4)
        for arg_3 in range(len(arg_2['Reservations'])):
            arg_4 = arg_2['Reservations'][arg_3]['Instances'][0]
            arg_0.instance_states[arg_4['InstanceId']] = arg_4['State']['Name']
        return arg_0.instance_states

Get states of all instances on EC2 which were started by this file .


def Func(arg_0, arg_1):
    """
    Removes all points in the fronts that overlap with the segmentation mask.
    """
    arg_2, arg_3 = np.where((arg_0 != arg_1) & (arg_0 != 0) & (arg_1 != 0))
    arg_1[arg_2, arg_3] = 0

Removes all points in the fronts that overlap with the segmentation mask .


def Func ( arg_0 ) : for arg_1 in [ HOURLY , DAILY , MONTHLY , YEARLY ] : arg_0 . _data [ arg_1 ] = arg_0 . get_data_per_period ( arg_1 )

def Func(arg_0):
        """Get the latest data from Enedis."""

        for arg_1 in [HOURLY, DAILY, MONTHLY, YEARLY]:
            arg_0._data[arg_1] = arg_0.get_data_per_period(arg_1)


def Func(arg_0, arg_1=-1):
        """Func for result to complete."""
        arg_2 = time.time()
        if arg_0._ready:
            return
        arg_3 = filter(lambda msg_id: msg_id in arg_0._client.outstanding, arg_0.msg_ids)
        arg_4 = arg_0._client.Func(arg_3, arg_1)
        if arg_4:
            arg_5 = filter(lambda msg_id: msg_id not in arg_0._client.results, arg_0.msg_ids)
            if not arg_5:
                arg_0._ready = True
            else:
                arg_7 = arg_0._client.result_status(arg_5, status_only=False)
                arg_8 = arg_7['pending']
                while arg_8 and (arg_1 < 0 or time.time() < arg_2+arg_1):
                    arg_7 = arg_0._client.result_status(arg_5, status_only=False)
                    arg_8 = arg_7['pending']
                    if arg_8:
                        time.sleep(0.1)
                if not arg_8:
                    arg_0._ready = True
        if arg_0._ready:
            try:
                arg_9 = map(arg_0._client.results.get, arg_0.msg_ids)
                arg_0._result = arg_9
                if arg_0._single_result:
                    arg_11 = arg_9[0]
                    if isinstance(arg_11, Exception):
                        raise arg_11
                else:
                    arg_9 = error.collect_exceptions(arg_9, arg_0._fname)
                arg_0._result = arg_0._reconstruct_result(arg_9)
            except Exception, e:
                arg_0._exception = e
                arg_0._success = False
            else:
                arg_0._success = True
            finally:
                arg_0._metadata = map(arg_0._client.metadata.get, arg_0.msg_ids)


def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
)
:
if
not
hasattr
(
arg_0
,
'sla_map'
)
:
return
False
arg_4
=
arg_3
.
split
(
)
for
arg_5
in
arg_4
:
if
'<'
in
arg_5
:
arg_6
,
arg_7
=
arg_5
.
split
(
'<'
)
arg_8
=
SLA
(
arg_1
,
arg_2
,
arg_6
,
arg_7
,
'lt'
)
elif
'>'
in
arg_5
:
arg_6
,
arg_7
=
arg_5
.
split
(
'>'
)
arg_8
=
SLA
(
arg_1
,
arg_2
,
arg_6
,
arg_7
,
'gt'
)
else
:
if
hasattr
(
arg_0
,
'logger'
)
:
arg_0
.
logger
.
error
(
'Unsupported SLA type defined : '
+
arg_5
)
arg_8
=
arg_0
.
sla_map
[
arg_1
]
[
arg_2
]
[
arg_6
]
=
arg_8
if
hasattr
(
arg_0
,
'sla_list'
)
:
arg_0
.
sla_list
.
append
(
arg_8
)
return
True

def Func(arg_0, arg_1, arg_2, arg_3):
  """
  Extract SLAs from a set of rules
  """
  if not hasattr(arg_0, 'sla_map'):
    return False
  arg_4 = arg_3.split()
  for arg_5 in arg_4:
    if '<' in arg_5:
      arg_6, arg_7 = arg_5.split('<')
      arg_8 = SLA(arg_1, arg_2, arg_6, arg_7, 'lt')
    elif '>' in arg_5:
      arg_6, arg_7 = arg_5.split('>')
      arg_8 = SLA(arg_1, arg_2, arg_6, arg_7, 'gt')
    else:
      if hasattr(arg_0, 'logger'):
        arg_0.logger.error('Unsupported SLA type defined : ' + arg_5)
      arg_8 = None
    arg_0.sla_map[arg_1][arg_2][arg_6] = arg_8
    if hasattr(arg_0, 'sla_list'):
      arg_0.sla_list.append(arg_8)  # TODO : remove this once report has grading done in the metric tables
  return True


def Func ( arg_0 , * arg_1 , ** arg_2 ) : if isinstance ( arg_1 [ 0 ] , str ) : return arg_0 . Func ( [ arg_1 [ 0 ] ] , ** arg_2 ) elif isinstance ( arg_1 [ 0 ] , int ) or isinstance ( arg_1 [ 0 ] , float ) : return arg_0 . Func ( [ [ arg_1 [ 0 ] ] ] , ** arg_2 ) if len ( arg_1 ) > 1 : arg_3 = arg_1 else : arg_3 = arg_1 [ 0 ] arg_4 = list ( map ( type , arg_3 ) ) arg_5 = arg_0 . encoding [ 0 ] if type ( '' ) in arg_4 : arg_6 = ',' . join ( map ( str , arg_3 ) ) elif type ( [ ] ) in arg_4 or type ( ( ) ) in arg_4 : arg_6 = arg_0 . codeset [ 'char' ] . join ( map ( arg_0 . Funcdata , arg_3 ) ) elif len ( arg_3 ) == 1 and hasattr ( arg_3 [ 0 ] , '__iter__' ) : arg_6 = arg_0 . Funcdata ( arg_3 [ 0 ] ) else : try : arg_6 = arg_0 . Funcdata ( arg_3 ) except ValueError : arg_6 = arg_0 . Funcdata ( ',' . join ( map ( unicode , arg_3 ) ) ) if not '.' in arg_6 and arg_5 == 't' : arg_5 = 'e' return '%s%s:%s' % ( arg_5 , arg_0 . series , arg_6 )

def Func(arg_0,  *arg_1, **arg_2):
        """Encode wrapper for a dataset with maximum value

        Datasets can be one or two dimensional
        Strings are ignored as ordinal encoding"""
        if isinstance(arg_1[0], str):
            return arg_0.Func([arg_1[0]],**arg_2)
        elif isinstance(arg_1[0], int) or isinstance(arg_1[0], float):
            return arg_0.Func([[arg_1[0]]],**arg_2)
        if len(arg_1)>1:
            arg_3 = arg_1
        else:
            arg_3 = arg_1[0]
        arg_4 = list(map(type,arg_3))
        arg_5 = arg_0.encoding[0]
        if type('') in arg_4:
            arg_6 = ','.join(map(str,arg_3))
        elif type([]) in arg_4 or type(()) in arg_4:
            arg_6 = arg_0.codeset['char'].join(map(arg_0.Funcdata, arg_3))
        elif len(arg_3) == 1 and hasattr(arg_3[0], '__iter__'):
            arg_6 = arg_0.Funcdata(arg_3[0])
        else:
            try:
                arg_6 = arg_0.Funcdata(arg_3)
            except ValueError:
                arg_6 = arg_0.Funcdata(','.join(map(unicode,arg_3)))
        if not '.' in arg_6 and arg_5 == 't':
            arg_5 = 'e'
        return '%s%s:%s'%(arg_5,arg_0.series,arg_6)


def Func ( arg_0 , arg_1 , arg_2 ) : if not arg_1 : return while True : arg_3 = arg_0 . lookup_job_tasks ( { '*' } , arg_1 = arg_1 ) arg_4 = set ( ) arg_5 = set ( ) for arg_6 in arg_3 : arg_7 = arg_6 . get_field ( 'task-status' ) arg_8 = arg_6 . get_field ( 'job-id' ) if arg_7 in [ 'FAILURE' , 'CANCELED' ] : arg_5 . add ( arg_8 ) if arg_7 == 'RUNNING' : arg_4 . add ( arg_8 ) arg_9 = arg_4 . difference ( arg_5 ) if arg_5 or len ( arg_9 ) != len ( arg_1 ) : return arg_9 SLEEP_FUNCTION ( arg_2 )

def Func(arg_0, arg_1, arg_2):
  """Waits until any of the listed jobs is not running.

  In particular, if any of the jobs sees one of its tasks fail,
  we count the whole job as failing (but do not terminate the remaining
  tasks ourselves).

  Args:
    provider: job service provider
    job_ids: a list of job IDs (string) to wait for
    poll_interval: integer seconds to wait between iterations

  Returns:
    A set of the jobIDs with still at least one running task.
  """
  if not arg_1:
    return
  while True:
    arg_3 = arg_0.lookup_job_tasks({'*'}, arg_1=arg_1)
    arg_4 = set()
    arg_5 = set()
    for arg_6 in arg_3:
      arg_7 = arg_6.get_field('task-status')
      arg_8 = arg_6.get_field('job-id')
      if arg_7 in ['FAILURE', 'CANCELED']:
        arg_5.add(arg_8)
      if arg_7 == 'RUNNING':
        arg_4.add(arg_8)
    arg_9 = arg_4.difference(arg_5)
    if arg_5 or len(arg_9) != len(arg_1):
      return arg_9
    SLEEP_FUNCTION(arg_2)

Waits until any of the listed jobs is not running .


return Response(
        response=json.dumps(
            obj, indent=4, cls=AirflowJsonEncoder),
        status=200,
        mimetype="application/json")

def Func ( arg_0 ) : return Response ( response = json . dumps ( arg_0 , indent = 4 , cls = AirflowJsonEncoder ) , status = 200 , mimetype = "application/json" )

def Func(arg_0):
    """
    returns a json response from a json serializable python object
    """
    return Response(
        response=json.dumps(
            arg_0, indent=4, cls=AirflowJsonEncoder),
        status=200,
        mimetype="application/json")


def Func(arg_0, arg_1=None):
    """Compose link to UCSC."""
    arg_1 = arg_1 or 37
    arg_2 = ("http://genome.ucsc.edu/cgi-bin/hgTracks?db=hg19&"
                        "position=chr{this[chromosome]}:{this[position]}"
                        "-{this[position]}&dgv=pack&knownGene=pack&omimGene=pack")
    if arg_1 == 38:
        arg_2 = ("http://genome.ucsc.edu/cgi-bin/hgTracks?db=hg20&"
                        "position=chr{this[chromosome]}:{this[position]}"
                        "-{this[position]}&dgv=pack&knownGene=pack&omimGene=pack")

    return arg_2.format(this=arg_0)


The other side has asked us to disconnect.

def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . getLocalProtocol ( arg_1 ) arg_2 . transport . loseConnection ( ) return { }

def Func(arg_0, arg_1):
        """The other side has asked us to Func.

        """
        arg_2 = arg_0.getLocalProtocol(arg_1)
        arg_2.transport.loseConnection()
        return {}

The other side has asked us to disconnect .


def Func(arg_0):
        """Count the objects of a repository.

        The method returns the total number of objects (packed and unpacked)
        available on the repository.

        :raises RepositoryError: when an error occurs counting the objects
            of a repository
        """
        arg_1 = ['git', 'count-objects', '-v']

        arg_2 = arg_0._exec(arg_1, cwd=arg_0.dirpath, env=arg_0.gitenv)
        arg_2 = arg_2.decode('utf-8', errors='surrogateescape').rstrip()

        try:
            arg_3 = {k: v for k, v in (x.split(': ') for x in arg_2.split('\n'))}
            arg_4 = int(arg_3['count']) + int(arg_3['in-pack'])
        except KeyError as e:
            arg_5 = "unable to parse 'count-objects' output; reason: '%s' entry not found" \
                % e.args[0]
            raise RepositoryError(cause=arg_5)
        except ValueError as e:
            arg_5 = "unable to parse 'count-objects' output; reason: %s" % str(e)
            raise RepositoryError(cause=arg_5)

        logger.debug("Git %s repository has %s objects",
                     arg_0.uri, str(arg_4))

        return arg_4


(script, radius=1, pitch=0, taper=0, pitch_func=None,
                  taper_func=None)

def Func(arg_0, arg_1=1, arg_2=0, arg_3=0, arg_4=None,
                  arg_5=None):
    """Deform mesh around cylinder of radius and axis z

    y = 0 will be on the surface of radius "radius"
    pitch != 0 will create a helix, with distance "pitch" traveled in z for each rotation
    taper = change in r over z. E.g. a value of 0.5 will shrink r by 0.5 for every z length of 1

    """
    """vert_function(s=s, x='(%s+y-taper)*sin(x/(%s+y))' % (radius, radius),
                     y='(%s+y)*cos(x/(%s+y))' % (radius, radius),
                     z='z-%s*x/(2*%s*(%s+y))' % (pitch, pi, radius))"""
    if arg_4 is None:
        arg_4 = '-(pitch)*x/(2*pi*(radius))'
    arg_4 = arg_4.replace(
        'pitch', str(arg_2)).replace(
            'pi', str(math.pi)).replace(
                'radius', str(arg_1))
    if arg_5 is None:
        arg_5 = '-(taper)*(pitch_func)'
    arg_5 = arg_5.replace(
        'taper', str(arg_3)).replace(
            'pitch_func', str(arg_4)).replace(
                'pi', str(math.pi))

    arg_6 = '(y+(radius)+(taper_func))*sin(x/(radius))'.replace(
        'radius', str(arg_1)).replace('taper_func', str(arg_5))
    arg_7 = '(y+(radius)+(taper_func))*cos(x/(radius))'.replace(
        'radius', str(arg_1)).replace('taper_func', str(arg_5))
    arg_8 = 'z+(pitch_func)'.replace('pitch_func', str(arg_4))

    vert_function(arg_0, arg_6, arg_7, arg_8)
    return None


def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_0 . a , arg_0 . m , arg_0 . Tc = arg_0 . ais [ arg_1 ] , arg_0 . ms [ arg_1 ] , arg_0 . Tcs [ arg_1 ]

def Func(arg_0, arg_1, arg_2=None):
        r'''Sets `a`, `m`, and `Tc` for a specific component before the
        pure-species EOS's `a_alpha_and_derivatives` method is called. Both are
        called by `GCEOSMIX.a_alpha_and_derivatives` for every component.'''
        arg_0.a, arg_0.m, arg_0.Tc = arg_0.ais[arg_1], arg_0.ms[arg_1], arg_0.Tcs[arg_1]

r Sets a m and Tc for a specific component before the pure - species EOS s a_alpha_and_derivatives method is called . Both are called by GCEOSMIX . a_alpha_and_derivatives for every component .


def Func ( arg_0 = 1 , arg_1 = arg_2 . maxsize , arg_4 = 2 ) : arg_5 = '.%s1' % '0' * ( arg_4 - 1 ) return decimal . Decimal ( uniform ( arg_0 , arg_1 ) ) . quantize ( decimal . Decimal ( arg_5 ) )

def Func(arg_0=1, arg_1=arg_2.maxsize, arg_4=2):
    """
        return a random floating number

    :param min: minimum value
    :param max: maximum value
    :param decimal_places: decimal places
    :return:
    """
    arg_5 = '.%s1' % '0' * (arg_4 - 1)
    return decimal.Decimal(uniform(arg_0, arg_1)).quantize(decimal.Decimal(arg_5))


def Func(arg_0, arg_1, arg_2, arg_3):
    """
    Always decide not to serialize obj

    :param priv: private data for this function first unit of this class
    :return: tuple (do serialize this object, next priv)
    """
    if arg_2:
        # prepare entity which will not be serialized
        prepareEntity(arg_1, arg_0.__class__.__name__, arg_3)

    if arg_3 is None:
        arg_3 = arg_0

    return False, arg_3


def Func(arg_0):
        """Compiles all status channels for the status compiler process
        """

        arg_1 = pc.StatusCompiler(template="status_compiler")
        arg_2 = pc.ReportCompiler(template="report_compiler")

        # Compile status channels from pipeline process
        arg_3 = []
        for arg_4 in [arg_4 for arg_4 in arg_0.processes]:
            if not any([isinstance(arg_4, arg_5) for arg_5 in arg_0.skip_class]):

                arg_3.extend(arg_4.status_strs)

        if not arg_3:
            logger.debug("No status channels found. Skipping status compiler"
                         "process")
            return

        logger.debug("Setting status channels: {}".format(arg_3))

        # Check for duplicate channels. Raise exception if found.
        if len(arg_3) != len(set(arg_3)):
            raise eh.ProcessError(
                "Duplicate status channels detected. Please ensure that "
                "the 'status_channels' attributes of each process are "
                "unique. Here are the status channels:\n\n{}".format(
                    ", ".join(arg_3)
                ))

        arg_1.set_compiler_channels(arg_3)

        arg_6 = ["REPORT_{}".format(arg_5.lstrip("STATUS_")) for arg_5 in
                           arg_3]

        arg_2.set_compiler_channels(arg_6)

        arg_0.processes.extend([arg_1, arg_2])


(self, column, columnActiveSegments,
                              columnMatchingSegments, prevActiveCells,
                              prevWinnerCells, learn)

return self._activatePredictedColumn(
      self.connections, self._random,
      columnActiveSegments, prevActiveCells, prevWinnerCells,
      self.numActivePotentialSynapsesForSegment,
      self.maxNewSynapseCount, self.initialPermanence,
      self.permanenceIncrement, self.permanenceDecrement,
      self.maxSynapsesPerSegment, learn)

def Func(arg_0, arg_1, arg_2,
                              arg_3, arg_4,
                              arg_5, arg_6):
    """
    Determines which cells in a predicted column should be added to winner cells
    list, and learns on the segments that correctly predicted this column.

    :param column: (int) Index of bursting column.

    :param columnActiveSegments: (iter) Active segments in this column.

    :param columnMatchingSegments: (iter) Matching segments in this column.

    :param prevActiveCells: (list) Active cells in ``t-1``.

    :param prevWinnerCells: (list) Winner cells in ``t-1``.

    :param learn: (bool) If true, grow and reinforce synapses.

    :returns: (list) A list of predicted cells that will be added to
              active cells and winner cells.
    """
    return arg_0._Func(
      arg_0.connections, arg_0._random,
      arg_2, arg_4, arg_5,
      arg_0.numActivePotentialSynapsesForSegment,
      arg_0.maxNewSynapseCount, arg_0.initialPermanence,
      arg_0.permanenceIncrement, arg_0.permanenceDecrement,
      arg_0.maxSynapsesPerSegment, arg_6)

Determines which cells in a predicted column should be added to winner cells list and learns on the segments that correctly predicted this column .


return DistributedImageFrame(jvalue=callBigDlFunc(bigdl_type, "readParquet", path, sc))

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = "float" ) : return DistributedImageFrame ( jvalue = callBigDlFunc ( arg_3 , "readParquet" , arg_1 , arg_2 ) )

def Func(arg_0, arg_1, arg_2, arg_3="float"):
        """
        Read parquet file as DistributedImageFrame
        """
        return DistributedImageFrame(jvalue=callBigDlFunc(arg_3, "readParquet", arg_1, arg_2))


def Func ( ) : from keras . preprocessing import sequence from keras . datasets import imdb ( arg_0 , arg_1 ) , ( arg_2 , arg_3 ) = imdb . load_data ( nb_words = 20000 ) arg_0 = sequence . pad_sequences ( arg_0 , maxlen = 100 ) arg_2 = sequence . pad_sequences ( arg_2 , maxlen = 100 ) return arg_0 , arg_1 , arg_2 , arg_3

def Func():
    """
    Load IMDB dataset
    Transform input data into an RDD of Sample
    """
    from keras.preprocessing import sequence
    from keras.datasets import imdb
    (arg_0, arg_1), (arg_2, arg_3) = imdb.load_data(nb_words=20000)
    arg_0 = sequence.pad_sequences(arg_0, maxlen=100)
    arg_2 = sequence.pad_sequences(arg_2, maxlen=100)
    return arg_0, arg_1, arg_2, arg_3


def Func ( arg_0 ) : arg_1 = store . user ( arg_0 ) arg_2 = LoginUser ( arg_1 ) if arg_1 else None return arg_2

def Func(arg_0):
    """Returns the currently active user as an object."""
    arg_1 = store.user(arg_0)
    arg_2 = LoginUser(arg_1) if arg_1 else None
    return arg_2

Returns the currently active user as an object .


def Func ( ) : load ( ) arg_0 = crontab . CronTab ( '' ) for arg_1 in registry : arg_0 . new ( arg_1 . command , KRONOS_BREADCRUMB ) . setall ( arg_1 . schedule ) print ( arg_0 . render ( ) )

def Func():
    """
    Print the tasks that would be installed in the
    crontab, for debugging purposes.
    """
    load()

    arg_0 = crontab.CronTab('')
    for arg_1 in registry:
        arg_0.new(arg_1.command, KRONOS_BREADCRUMB).setall(arg_1.schedule)
    print(arg_0.render())

Print the tasks that would be installed in the crontab for debugging purposes .


def Func ( arg_0 , arg_1 ) : arg_2 = [ ] for arg_3 in arg_0 . config . sections ( ) : if arg_3 . startswith ( arg_1 ) : arg_2 . append ( arg_3 ) return arg_2

def Func(arg_0, arg_1):
        """ return sections with specified prefix """
        arg_2 = []
        for arg_3 in arg_0.config.sections():
            if arg_3.startswith(arg_1):
                arg_2.append(arg_3)
        return arg_2


(uploader, sources, verify, do_compile, do_file, do_restart)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5):
    """The upload operation"""
    arg_1, arg_6 = destination_from_source(arg_1)
    if len(arg_6) == len(arg_1):
        if arg_0.prepare():
            for arg_7, arg_8 in zip(arg_1, arg_6):
                if arg_3:
                    arg_0.file_remove(os.path.splitext(arg_8)[0]+'.lc')
                arg_0.write_file(arg_7, arg_8, arg_2)
                #init.lua is not allowed to be compiled
                if arg_3 and arg_8 != 'init.lua':
                    arg_0.file_compile(arg_8)
                    arg_0.file_remove(arg_8)
                    if arg_4:
                        arg_0.file_do(os.path.splitext(arg_8)[0]+'.lc')
                elif arg_4:
                    arg_0.file_do(arg_8)
        else:
            raise Exception('Error preparing nodemcu for reception')
    else:
        raise Exception('You must specify a destination filename for each file you want to upload.')

    if arg_5:
        arg_0.node_restart()
    log.info('All done!')


(
        perf_attrib_data,
        ax=None,
        title='Cumulative common returns attribution',
)

def
Func
(
arg_0
,
arg_1
=
,
arg_2
=
'Cumulative common returns attribution'
,
)
:
if
arg_1
is
:
arg_1
=
plt
.
gca
(
)
arg_3
=
arg_0
.
drop
(
[
'total_returns'
,
'common_returns'
]
,
axis
=
'columns'
,
errors
=
'ignore'
)
arg_4
=
pd
.
DataFrame
(
)
for
arg_5
in
arg_3
:
arg_4
[
arg_5
]
=
ep
.
cum_returns
(
arg_3
[
arg_5
]
)
for
arg_6
in
arg_4
:
arg_1
.
plot
(
arg_4
[
arg_6
]
)
arg_1
.
axhline
(
0
,
color
=
'k'
)
configure_legend
(
arg_1
,
change_colors
=
True
)
arg_1
.
set_ylabel
(
'Cumulative returns by factor'
)
arg_1
.
set_title
(
arg_2
)
return
arg_1

def Func(
        arg_0,
        arg_1=None,
        arg_2='Cumulative common returns attribution',
):
    """
    Plot each factor's contribution to performance.

    Parameters
    ----------
    perf_attrib_data : pd.DataFrame
        df with factors, common returns, and specific returns as columns,
        and datetimes as index
        - Example:
                        momentum  reversal  common_returns  specific_returns
            dt
            2017-01-01  0.249087  0.935925        1.185012          1.185012
            2017-01-02 -0.003194 -0.400786       -0.403980         -0.403980

    ax :  matplotlib.axes.Axes
        axes on which plots are made. if None, current axes will be used

    title : str, optional
        title of plot

    Returns
    -------
    ax :  matplotlib.axes.Axes
    """
    if arg_1 is None:
        arg_1 = plt.gca()

    arg_3 = arg_0.drop(
        ['total_returns', 'common_returns'], axis='columns', errors='ignore'
    )

    arg_4 = pd.DataFrame()
    for arg_5 in arg_3:
        arg_4[arg_5] = ep.cum_returns(arg_3[arg_5])

    for arg_6 in arg_4:
        arg_1.plot(arg_4[arg_6])

    arg_1.axhline(0, color='k')
    configure_legend(arg_1, change_colors=True)

    arg_1.set_ylabel('Cumulative returns by factor')
    arg_1.set_title(arg_2)

    return arg_1

Plot each factor s contribution to performance .


def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
)
:
arg_4
=
[
"nvm_cmd rprt_lun"
,
arg_0
.
envs
,
"%d %d > %s"
%
(
arg_1
,
arg_2
,
arg_3
)
]
arg_5
,
arg_6
,
arg_6
=
cij
.
ssh
.
command
(
arg_4
,
shell
=
True
)
return
arg_5

def Func(arg_0, arg_1, arg_2, arg_3):
        """Get chunk information"""
        arg_4 = ["nvm_cmd rprt_lun", arg_0.envs,
               "%d %d > %s" % (arg_1, arg_2, arg_3)]
        arg_5, arg_6, arg_6 = cij.ssh.command(arg_4, shell=True)
        return arg_5


def Func ( arg_0 , arg_1 = None ) : if arg_1 is None : arg_1 = arg_0 . output arg_0 . make_ndx ( o = arg_1 , input = [ 'q' ] ) return arg_1

def Func(arg_0, arg_1=None):
        """ConFuncenate input index files.

        Generate a new index file that contains the default Gromacs index
        groups (if a structure file was defined) and all index groups from the
        input index files.

        :Arguments:
           out_ndx : filename
              Name of the output index file; if ``None`` then use the default
              provided to the constructore. [``None``].
        """
        if arg_1 is None:
            arg_1 = arg_0.output
        arg_0.make_ndx(o=arg_1, input=['q'])
        return arg_1

Concatenate input index files.

        Generate a new index file that contains the default Gromacs index
        groups (if a structure file was defined) and all index groups from the
        input index files.

        :Arguments:
           out_ndx : filename
              Name of the output index file; if ``None`` then use the default
              provided to the constructore. [``None``].


def Func ( arg_0 , arg_1 , arg_2 = None ) : with tf . compat . v1 . name_scope ( arg_2 , 'Func' , [ arg_0 , arg_1 ] ) : arg_0 = tf . convert_to_tensor ( value = arg_0 , arg_2 = 'x' ) arg_1 = tf . convert_to_tensor ( value = arg_1 , dtype = arg_0 . dtype , arg_2 = 'threshold' ) return tf . sign ( arg_0 ) * tf . maximum ( tf . abs ( arg_0 ) - arg_1 , 0. )

def Func(arg_0, arg_1, arg_2=None):
  """Soft Thresholding operator.

  This operator is defined by the equations

  ```none
                                { x[i] - gamma,  x[i] >   gamma
  SoftThreshold(x, gamma)[i] =  { 0,             x[i] ==  gamma
                                { x[i] + gamma,  x[i] <  -gamma
  ```

  In the context of proximal gradient methods, we have

  ```none
  SoftThreshold(x, gamma) = prox_{gamma L1}(x)
  ```

  where `prox` is the proximity operator.  Thus the soft thresholding operator
  is used in proximal gradient descent for optimizing a smooth function with
  (non-smooth) L1 regularization, as outlined below.

  The proximity operator is defined as:

  ```none
  prox_r(x) = argmin{ r(z) + 0.5 ||x - z||_2**2 : z },
  ```

  where `r` is a (weakly) convex function, not necessarily differentiable.
  Because the L2 norm is strictly convex, the above argmin is unique.

  One important application of the proximity operator is as follows.  Let `L` be
  a convex and differentiable function with Lipschitz-continuous gradient.  Let
  `R` be a convex lower semicontinuous function which is possibly
  nondifferentiable.  Let `gamma` be an arbitrary positive real.  Then

  ```none
  x_star = argmin{ L(x) + R(x) : x }
  ```

  if and only if the fixed-point equation is satisfied:

  ```none
  x_star = prox_{gamma R}(x_star - gamma grad L(x_star))
  ```

  Proximal gradient descent thus typically consists of choosing an initial value
  `x^{(0)}` and repeatedly applying the update

  ```none
  x^{(k+1)} = prox_{gamma^{(k)} R}(x^{(k)} - gamma^{(k)} grad L(x^{(k)}))
  ```

  where `gamma` is allowed to vary from iteration to iteration.  Specializing to
  the case where `R(x) = ||x||_1`, we minimize `L(x) + ||x||_1` by repeatedly
  applying the update

  ```
  x^{(k+1)} = SoftThreshold(x - gamma grad L(x^{(k)}), gamma)
  ```

  (This idea can also be extended to second-order approximations, although the
  multivariate case does not have a known closed form like above.)

  Args:
    x: `float` `Tensor` representing the input to the SoftThreshold function.
    threshold: nonnegative scalar, `float` `Tensor` representing the radius of
      the interval on which each coordinate of SoftThreshold takes the value
      zero.  Denoted `gamma` above.
    name: Python string indicating the name of the TensorFlow operation.
      Default value: `'Func'`.

  Returns:
    softthreshold: `float` `Tensor` with the same shape and dtype as `x`,
      representing the value of the SoftThreshold function.

  #### References

  [1]: Yu, Yao-Liang. The Proximity Operator.
       https://www.cs.cmu.edu/~suvrit/teach/yaoliang_proximity.pdf

  [2]: Wikipedia Contributors. Proximal gradient methods for learning.
       _Wikipedia, The Free Encyclopedia_, 2018.
       https://en.wikipedia.org/wiki/Proximal_gradient_methods_for_learning

  """
  # https://math.stackexchange.com/questions/471339/derivation-of-soft-thresholding-operator
  with tf.compat.v1.name_scope(arg_2, 'Func', [arg_0, arg_1]):
    arg_0 = tf.convert_to_tensor(value=arg_0, arg_2='x')
    arg_1 = tf.convert_to_tensor(
        value=arg_1, dtype=arg_0.dtype, arg_2='threshold')
    return tf.sign(arg_0) * tf.maximum(tf.abs(arg_0) - arg_1, 0.)

Soft Thresholding operator.

  This operator is defined by the equations

  ```none
                                { x[i] - gamma,  x[i] >   gamma
  SoftThreshold(x, gamma)[i] =  { 0,             x[i] ==  gamma
                                { x[i] + gamma,  x[i] <  -gamma
  ```

  In the context of proximal gradient methods, we have

  ```none
  SoftThreshold(x, gamma) = prox_{gamma L1}(x)
  ```

  where `prox` is the proximity operator.  Thus the soft thresholding operator
  is used in proximal gradient descent for optimizing a smooth function with
  (non-smooth) L1 regularization, as outlined below.

  The proximity operator is defined as:

  ```none
  prox_r(x) = argmin{ r(z) + 0.5 ||x - z||_2**2 : z },
  ```

  where `r` is a (weakly) convex function, not necessarily differentiable.
  Because the L2 norm is strictly convex, the above argmin is unique.

  One important application of the proximity operator is as follows.  Let `L` be
  a convex and differentiable function with Lipschitz-continuous gradient.  Let
  `R` be a convex lower semicontinuous function which is possibly
  nondifferentiable.  Let `gamma` be an arbitrary positive real.  Then

  ```none
  x_star = argmin{ L(x) + R(x) : x }
  ```

  if and only if the fixed-point equation is satisfied:

  ```none
  x_star = prox_{gamma R}(x_star - gamma grad L(x_star))
  ```

  Proximal gradient descent thus typically consists of choosing an initial value
  `x^{(0)}` and repeatedly applying the update

  ```none
  x^{(k+1)} = prox_{gamma^{(k)} R}(x^{(k)} - gamma^{(k)} grad L(x^{(k)}))
  ```

  where `gamma` is allowed to vary from iteration to iteration.  Specializing to
  the case where `R(x) = ||x||_1`, we minimize `L(x) + ||x||_1` by repeatedly
  applying the update

  ```
  x^{(k+1)} = SoftThreshold(x - gamma grad L(x^{(k)}), gamma)
  ```

  (This idea can also be extended to second-order approximations, although the
  multivariate case does not have a known closed form like above.)

  Args:
    x: `float` `Tensor` representing the input to the SoftThreshold function.
    threshold: nonnegative scalar, `float` `Tensor` representing the radius of
      the interval on which each coordinate of SoftThreshold takes the value
      zero.  Denoted `gamma` above.
    name: Python string indicating the name of the TensorFlow operation.
      Default value: `'soft_threshold'`.

  Returns:
    softthreshold: `float` `Tensor` with the same shape and dtype as `x`,
      representing the value of the SoftThreshold function.

  #### References

  [1]: Yu, Yao-Liang. The Proximity Operator.
       https://www.cs.cmu.edu/~suvrit/teach/yaoliang_proximity.pdf

  [2]: Wikipedia Contributors. Proximal gradient methods for learning.
       _Wikipedia, The Free Encyclopedia_, 2018.
       https://en.wikipedia.org/wiki/Proximal_gradient_methods_for_learning


def Func ( arg_0 , arg_1 , * arg_2 ) : for arg_3 in arg_2 : try : arg_1 = getattr ( arg_1 , arg_3 ) except AttributeError : arg_1 = arg_1 [ arg_3 ] if hasattr ( arg_1 , '__call__' ) : arg_1 = arg_1 ( ) return arg_1

def Func(arg_0, arg_1, *arg_2):
        """Evaluate dotted expressions at runtime."""
        for arg_3 in arg_2:
            try:
                arg_1 = getattr(arg_1, arg_3)
            except AttributeError:
                arg_1 = arg_1[arg_3]
            if hasattr(arg_1, '__call__'):
                arg_1 = arg_1()
        return arg_1

Evaluate dotted expressions at runtime .


return construct_single_handler_logger(
        "json-event-record-logger",
        DEBUG,
        JsonEventLoggerHandler(
            json_path,
            lambda record: construct_event_record(
                StructuredLoggerMessage(
                    name=record.name,
                    message=record.msg,
                    level=record.levelno,
                    meta=record.dagster_meta,
                    record=record,
                )
            ),
        ),
    )

def Func ( arg_0 ) : check . str_param ( arg_0 , 'json_path' ) return construct_single_handler_logger ( "json-event-record-logger" , DEBUG , JsonEventLoggerHandler ( arg_0 , lambda record : construct_event_record ( StructuredLoggerMessage ( name = record . name , message = record . msg , level = record . levelno , meta = record . dagster_meta , record = record , ) ) , ) , )

def Func(arg_0):
    '''Record a stream of event records to json'''
    check.str_param(arg_0, 'json_path')
    return construct_single_handler_logger(
        "json-event-record-logger",
        DEBUG,
        JsonEventLoggerHandler(
            arg_0,
            lambda record: construct_event_record(
                StructuredLoggerMessage(
                    name=record.name,
                    message=record.msg,
                    level=record.levelno,
                    meta=record.dagster_meta,
                    record=record,
                )
            ),
        ),
    )


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 ( ) for arg_3 in arg_1 . splitlines ( ) : if arg_3 : arg_2 . Func_line ( arg_3 ) return arg_2

def Func(arg_0, arg_1):
        """Returns a dictionary from HTTP header text.

        >>> h = HTTPHeaders.Func("Content-Type: text/html\\r\\nContent-Length: 42\\r\\n")
        >>> sorted(h.iteritems())
        [('Content-Length', '42'), ('Content-Type', 'text/html')]
        """
        arg_2 = arg_0()
        for arg_3 in arg_1.splitlines():
            if arg_3:
                arg_2.Func_line(arg_3)
        return arg_2

Returns a dictionary from HTTP header text.

        >>> h = HTTPHeaders.parse("Content-Type: text/html\\r\\nContent-Length: 42\\r\\n")
        >>> sorted(h.iteritems())
        [('Content-Length', '42'), ('Content-Type', 'text/html')]

Returns a dictionary from HTTP header text .


def Func ( arg_0 ) : if not isinstance ( arg_0 , basestring ) : return False try : arg_1 = UUID ( arg_0 , version = 4 ) except ValueError : return False return True

def Func(arg_0):
    """Return True if id is a valid UUID, False otherwise."""
    if not isinstance(arg_0, basestring):
        return False

    try:
        arg_1 = UUID(arg_0, version=4)
    except ValueError:
        return False

    return True

Return True if id is a valid UUID False otherwise .


def Func ( arg_0 ) : import pandas as pd return pd . Series ( _pandas_dt_fix ( arg_0 ) ) . dt . day_name ( ) . values . astype ( str )

def Func(arg_0):
    """Returns the day names of a datetime sample in English.

    :returns: an expression containing the day names extracted from a datetime column.

    Example:

    >>> import vaex
    >>> import numpy as np
    >>> date = np.array(['2009-10-12T03:31:00', '2016-02-11T10:17:34', '2015-11-12T11:34:22'], dtype=np.datetime64)
    >>> df = vaex.from_arrays(date=date)
    >>> df
      #  date
      0  2009-10-12 03:31:00
      1  2016-02-11 10:17:34
      2  2015-11-12 11:34:22

    >>> df.date.dt.day_name
    Expression = Func(date)
    Length: 3 dtype: str (expression)
    ---------------------------------
    0    Monday
    1  Thursday
    2  Thursday
    """
    import pandas as pd
    return pd.Series(_pandas_dt_fix(arg_0)).dt.day_name().values.astype(str)

Returns the day names of a datetime sample in English.

    :returns: an expression containing the day names extracted from a datetime column.

    Example:

    >>> import vaex
    >>> import numpy as np
    >>> date = np.array(['2009-10-12T03:31:00', '2016-02-11T10:17:34', '2015-11-12T11:34:22'], dtype=np.datetime64)
    >>> df = vaex.from_arrays(date=date)
    >>> df
      #  date
      0  2009-10-12 03:31:00
      1  2016-02-11 10:17:34
      2  2015-11-12 11:34:22

    >>> df.date.dt.day_name
    Expression = dt_day_name(date)
    Length: 3 dtype: str (expression)
    ---------------------------------
    0    Monday
    1  Thursday
    2  Thursday

Returns the day names of a datetime sample in English .


(self, column_names=None, selection=None, strings=True, virtual=False, index=None)

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = True , arg_4 = False , arg_5 = None ) : from astropy . table import Table , Column , MaskedColumn arg_6 = dict ( ) arg_6 [ "name" ] = arg_0 . name arg_6 [ "description" ] = arg_0 . description arg_7 = Table ( arg_6 = arg_6 ) for arg_8 , arg_9 in arg_0 . to_items ( arg_1 = arg_1 , arg_2 = arg_2 , arg_3 = arg_3 , arg_4 = arg_4 ) : if arg_0 . dtype ( arg_8 ) == str_type : arg_9 = np . array ( arg_9 ) . astype ( 'U' ) arg_6 = dict ( ) if arg_8 in arg_0 . ucds : arg_6 [ "ucd" ] = arg_0 . ucds [ arg_8 ] if np . ma . isMaskedArray ( arg_9 ) : arg_10 = MaskedColumn else : arg_10 = Column arg_7 [ arg_8 ] = arg_10 ( arg_9 , unit = arg_0 . unit ( arg_8 ) , description = arg_0 . descriptions . get ( arg_8 ) , arg_6 = arg_6 ) return arg_7

def Func(arg_0, arg_1=None, arg_2=None, arg_3=True, arg_4=False, arg_5=None):
        """Returns a astropy table object containing the ndarrays corresponding to the evaluated data

        :param column_names: list of column names, to export, when None DataFrame.get_column_names(strings=strings, virtual=virtual) is used
        :param selection: {selection}
        :param strings: argument passed to DataFrame.get_column_names when column_names is None
        :param virtual: argument passed to DataFrame.get_column_names when column_names is None
        :param index: if this column is given it is used for the index of the DataFrame
        :return: astropy.table.Table object
        """
        from astropy.table import Table, Column, MaskedColumn
        arg_6 = dict()
        arg_6["name"] = arg_0.name
        arg_6["description"] = arg_0.description

        arg_7 = Table(arg_6=arg_6)
        for arg_8, arg_9 in arg_0.to_items(arg_1=arg_1, arg_2=arg_2, arg_3=arg_3, arg_4=arg_4):
            if arg_0.dtype(arg_8) == str_type:  # for astropy we convert it to unicode, it seems to ignore object type
                arg_9 = np.array(arg_9).astype('U')
            arg_6 = dict()
            if arg_8 in arg_0.ucds:
                arg_6["ucd"] = arg_0.ucds[arg_8]
            if np.ma.isMaskedArray(arg_9):
                arg_10 = MaskedColumn
            else:
                arg_10 = Column
            arg_7[arg_8] = arg_10(arg_9, unit=arg_0.unit(arg_8), description=arg_0.descriptions.get(arg_8), arg_6=arg_6)
        return arg_7


def
Func
(
arg_0
,
arg_1
)
:
logger
.
debug
(
"write %s to %s"
,
arg_1
,
arg_0
)
if
arg_0
.
startswith
(
"s3://"
)
:
arg_2
=
get_boto3_bucket
(
arg_0
.
split
(
"/"
)
[
2
]
)
arg_3
=
"/"
.
join
(
arg_0
.
split
(
"/"
)
[
3
:
]
)
logger
.
debug
(
"upload %s"
,
arg_3
)
arg_2
.
put_object
(
Key
=
arg_3
,
Body
=
json
.
dumps
(
arg_1
,
sort_keys
=
True
,
indent
=
4
)
)
else
:
makedirs
(
os
.
path
.
dirname
(
arg_0
)
)
with
open
(
arg_0
,
'w'
)
as
dst
:
json
.
dump
(
arg_1
,
dst
,
sort_keys
=
True
,
indent
=
4
)

def Func(arg_0, arg_1):
    """Write local or remote."""
    logger.debug("write %s to %s", arg_1, arg_0)
    if arg_0.startswith("s3://"):
        arg_2 = get_boto3_bucket(arg_0.split("/")[2])
        arg_3 = "/".join(arg_0.split("/")[3:])
        logger.debug("upload %s", arg_3)
        arg_2.put_object(
            Key=arg_3,
            Body=json.dumps(arg_1, sort_keys=True, indent=4)
        )
    else:
        makedirs(os.path.dirname(arg_0))
        with open(arg_0, 'w') as dst:
            json.dump(arg_1, dst, sort_keys=True, indent=4)


def Func(arg_0):
    """Raises `ExistingBranchError` if the specified branch exists."""
    if _has_branch(arg_0):
        arg_1 = 'Cannot proceed while {} branch exists; remove and try again.'.format(arg_0)
        raise temple.exceptions.ExistingBranchError(arg_1)

Raises ExistingBranchError if the specified branch exists .


def Func ( arg_0 , arg_1 , arg_2 = True ) : for arg_3 in glob . glob ( arg_1 + "/*.*" ) : ftp_upload ( arg_0 , arg_3 ) return

def Func(arg_0,arg_1,arg_2=True):
    """upload everything from localFolder into the current FTP folder."""
    for arg_3 in glob.glob(arg_1+"/*.*"):
        ftp_upload(arg_0,arg_3)
    return

upload everything from localFolder into the current FTP folder .


def Func ( arg_0 , arg_1 , arg_2 ) : if not arg_0 . doc_version_set : arg_0 . doc_version_set = True arg_4 = arg_0 . VERS_STR_REGEX . match ( arg_2 ) if arg_4 is None : raise SPDXValueError ( 'Document::Version' ) else : arg_1 . version = arg_5 . Version ( major = int ( arg_4 . group ( 1 ) ) , minor = int ( arg_4 . group ( 2 ) ) ) return True else : raise CardinalityError ( 'Document::Version' )

def Func(arg_0, arg_1, arg_2):
        """
        Set the document version.
        Raise SPDXValueError if malformed value, CardinalityError
        if already defined
        """
        if not arg_0.doc_version_set:
            arg_0.doc_version_set = True
            arg_4 = arg_0.VERS_STR_REGEX.match(arg_2)
            if arg_4 is None:
                raise SPDXValueError('Document::Version')
            else:
                arg_1.version = arg_5.Version(major=int(arg_4.group(1)),
                                              minor=int(arg_4.group(2)))
                return True
        else:
            raise CardinalityError('Document::Version')

Set the document version . Raise SPDXValueError if malformed value CardinalityError if already defined


def
Func
(
arg_0
)
:
arg_1
=
arg_0
.
_list_containers
(
)
bot
.
info
(
"[gs://%s] Containers"
%
arg_0
.
_bucket_name
)
arg_2
=
[
]
for
arg_3
in
arg_1
:
arg_4
=
round
(
arg_3
.
size
/
(
1024
*
1024.0
)
)
arg_4
=
(
"%s MB"
%
arg_4
)
.
rjust
(
10
)
arg_2
.
append
(
[
arg_4
,
arg_3
.
metadata
[
'name'
]
]
)
bot
.
table
(
arg_2
)
return
arg_2

def Func(arg_0):
    '''a "list all" search that doesn't require a query. Here we return to
       the user all objects that have custom metadata value of "container"

       IMPORTANT: the upload function adds this metadata. For a container to
       be found by the client, it must have the type as container in metadata.
    '''

    arg_1 = arg_0._list_containers()

    bot.info("[gs://%s] Containers" %arg_0._bucket_name)

    arg_2 = []
    for arg_3 in arg_1:
        arg_4 = round(arg_3.size / (1024*1024.0))
        arg_4 = ("%s MB" %arg_4).rjust(10)
        arg_2.append([arg_4, arg_3.metadata['name']])

    bot.table(arg_2)
    return arg_2

a list all search that doesn t require a query . Here we return to the user all objects that have custom metadata value of container


(deposition, from_date, with_json=True, latest_only=False, **kwargs)

def Func ( arg_0 , arg_1 , arg_2 = True , arg_3 = False , ** arg_4 ) : arg_5 = json . Funcs ( arg_0 . __getstate__ ( ) , default = default_serializer ) arg_6 = json . loads ( arg_5 ) arg_6 [ '_p' ] = { } arg_6 [ '_p' ] [ 'id' ] = arg_0 . id arg_6 [ '_p' ] [ 'created' ] = dt2utc_timestamp ( arg_0 . created ) arg_6 [ '_p' ] [ 'modified' ] = dt2utc_timestamp ( arg_0 . modified ) arg_6 [ '_p' ] [ 'user_id' ] = arg_0 . user_id arg_6 [ '_p' ] [ 'state' ] = arg_0 . state arg_6 [ '_p' ] [ 'has_sip' ] = arg_0 . has_sip ( ) arg_6 [ '_p' ] [ 'submitted' ] = arg_0 . submitted return arg_6

def Func(arg_0, arg_1, arg_2=True, arg_3=False, **arg_4):
    """Dump the deposition object as dictionary."""
    # Serialize the __getstate__ and fall back to default serializer
    arg_5 = json.Funcs(arg_0.__getstate__(),
                          default=default_serializer)
    arg_6 = json.loads(arg_5)
    arg_6['_p'] = {}
    arg_6['_p']['id'] = arg_0.id
    arg_6['_p']['created'] = dt2utc_timestamp(arg_0.created)
    arg_6['_p']['modified'] = dt2utc_timestamp(arg_0.modified)
    arg_6['_p']['user_id'] = arg_0.user_id
    arg_6['_p']['state'] = arg_0.state
    arg_6['_p']['has_sip'] = arg_0.has_sip()
    arg_6['_p']['submitted'] = arg_0.submitted
    return arg_6

Dump the deposition object as dictionary .