def
Func
(
arg_0
)
:
if
PyFunceble
.
INTERN
[
"to_test_type"
]
==
"domain"
:
if
Check
(
)
.
is_domain_valid
(
)
or
Check
(
)
.
is_ip_valid
(
)
:
return
SyntaxStatus
(
PyFunceble
.
STATUS
[
"official"
]
[
"valid"
]
)
.
handle
(
)
elif
PyFunceble
.
INTERN
[
"to_test_type"
]
==
"url"
:
if
Check
(
)
.
is_url_valid
(
)
:
return
SyntaxStatus
(
PyFunceble
.
STATUS
[
"official"
]
[
"valid"
]
)
.
handle
(
)
else
:
raise
Exception
(
"Unknow test type."
)
return
SyntaxStatus
(
PyFunceble
.
STATUS
[
"official"
]
[
"invalid"
]
)
.
handle
(
)

def Func(arg_0):
        """
        Execute the logic behind the Syntax handling.

        :return: The syntax status.
        :rtype: str
        """

        if PyFunceble.INTERN["to_test_type"] == "domain":
            # We are testing for domain or ip.

            if Check().is_domain_valid() or Check().is_ip_valid():
                # * The domain is valid.
                # or
                # * The IP is valid.

                # We handle and return the valid status.
                return SyntaxStatus(PyFunceble.STATUS["official"]["valid"]).handle()
        elif PyFunceble.INTERN["to_test_type"] == "url":
            # We are testing for URL.

            if Check().is_url_valid():
                # * The url is valid.

                # We handle and return the valid status.
                return SyntaxStatus(PyFunceble.STATUS["official"]["valid"]).handle()
        else:
            raise Exception("Unknow test type.")

        # We handle and return the invalid status.
        return SyntaxStatus(PyFunceble.STATUS["official"]["invalid"]).handle()

Execute the logic behind the Syntax handling .


(duration: int, amp: complex, freq: float = None,
        phase: float = 0, name: str = None)

return _sampled_sin_pulse(duration, amp, freq, phase=phase, name=name)

def Func(arg_0: arg_1, arg_2: arg_3, arg_4: arg_5 = None,
        arg_6: arg_5 = 0, arg_7: arg_8 = None) -> SamplePulse:
    """Generates Funce wave `SamplePulse`.

    Args:
        duration: Duration of pulse. Must be greater than zero.
        amp: Pulse amplitude.
        freq: Pulse frequency, units of 1/dt. If `None` defaults to Funcgle cycle.
        phase: Pulse phase.
        name: Name of pulse.
    """
    if arg_4 is None:
        arg_4 = 1/arg_0

    return _sampled_Func_pulse(arg_0, arg_2, arg_4, arg_6=arg_6, arg_7=arg_7)

Generates sine wave `SamplePulse`.

    Args:
        duration: Duration of pulse. Must be greater than zero.
        amp: Pulse amplitude.
        freq: Pulse frequency, units of 1/dt. If `None` defaults to single cycle.
        phase: Pulse phase.
        name: Name of pulse.


def Func(arg_0, arg_1):
        """Cancel the jobs specified by a list of job ids.

        Parameters
        ----------
        job_ids : list of str
            List of of job identifiers

        Returns
        -------
        list of bool
            Each entry in the list will contain False if the operation fails. Otherwise, the entry will be True.
        """

        if arg_0.linger is True:
            logger.debug("Ignoring Func requests due to linger mode")
            return [False for arg_2 in arg_1]

        try:
            arg_0.client.terminate_instances(InstanceIds=list(arg_1))
        except Exception as e:
            logger.error("Caught error while attempting to remove instances: {0}".format(arg_1))
            raise e
        else:
            logger.debug("Removed the instances: {0}".format(arg_1))

        for arg_3 in arg_1:
            arg_0.resources[arg_3]["status"] = "COMPLETED"

        for arg_3 in arg_1:
            arg_0.instances.remove(arg_3)

        return [True for arg_2 in arg_1]

Cancel the jobs specified by a list of job ids .


return {'name': name, 'datetime': dt, 'filepath': filepath}

def Func ( arg_0 , arg_1 ) : arg_2 = os . path . basename ( arg_1 ) [ : - src_ext_len ] try : arg_3 = datetime . strptime ( arg_2 , "%Y-%m-%d-%H-%M" ) except ValueError : raise PostNameInvalid return { 'name' : arg_2 , 'datetime' : arg_3 , 'filepath' : arg_1 }

def Func(arg_0, arg_1):
        """parse post source files name to datetime object"""
        arg_2 = os.path.basename(arg_1)[:-src_ext_len]
        try:
            arg_3 = datetime.strptime(arg_2, "%Y-%m-%d-%H-%M")
        except ValueError:
            raise PostNameInvalid
        return {'name': arg_2, 'datetime': arg_3, 'filepath': arg_1}


def Func ( arg_0 ) : class Datas ( object ) : pass arg_1 = Datas ( ) for arg_2 , arg_3 in arg_0 . columns . items ( ) : setattr ( arg_1 , arg_2 , arg_3 ) return arg_1

def Func(arg_0):
        """Gives direct access to the Func as numpy arrays.

        Convenient when working with IPython in combination with small DataFrames, since this gives tab-completion.
        Only real columns (i.e. no virtual) columns can be accessed, for getting the Func from virtual columns, use
        DataFrame.evalulate(...).

        Columns can be accesed by there names, which are attributes. The attribues are of type numpy.ndarray.

        Example:

        >>> df = vaex.example()
        >>> r = np.sqrt(df.Func.x**2 + df.Func.y**2)

        """
        class Datas(object):
            pass

        arg_1 = Datas()
        for arg_2, arg_3 in arg_0.columns.items():
            setattr(arg_1, arg_2, arg_3)
        return arg_1

Gives direct access to the data as numpy arrays.

        Convenient when working with IPython in combination with small DataFrames, since this gives tab-completion.
        Only real columns (i.e. no virtual) columns can be accessed, for getting the data from virtual columns, use
        DataFrame.evalulate(...).

        Columns can be accesed by there names, which are attributes. The attribues are of type numpy.ndarray.

        Example:

        >>> df = vaex.example()
        >>> r = np.sqrt(df.data.x**2 + df.data.y**2)

Gives direct access to the data as numpy arrays .


def Func ( arg_0 , arg_1 , arg_2 = None ) : try : arg_3 = arg_0 . conn . Func ( index = arg_0 . index , doc_type = arg_0 . type , id = eid ( arg_1 ) , _source = arg_0 . _source ( arg_2 ) ) return arg_0 . fc_from_dict ( arg_3 [ '_source' ] [ 'fc' ] ) except NotFoundError : return None except : raise

def Func(arg_0, arg_1, arg_2=None):
        '''Retrieve a feature collection.

        If a feature collection with the given id does not
        exist, then ``None`` is returned.

        :param str content_id: Content identifier.
        :param [str] feature_names:
          A list of feature names to retrieve. When ``None``, all
          features are retrieved. Wildcards are allowed.
        :rtype: :class:`dossier.fc.FeatureCollection` or ``None``
        '''
        try:
            arg_3 = arg_0.conn.Func(index=arg_0.index, doc_type=arg_0.type,
                                 id=eid(arg_1),
                                 _source=arg_0._source(arg_2))
            return arg_0.fc_from_dict(arg_3['_source']['fc'])
        except NotFoundError:
            return None
        except:
            raise


def Func(arg_0, arg_1=None):
    """
    Create HTML and plaintext message bodies for a notification.

    We receive a context with data we can use to render, as well as an optional site
    template configration - if we don't get a template configuration, we'll use the
    standard, built-in template.

    Arguments:
        template_context (dict): A set of data to render
        template_configuration: A database-backed object with templates
            stored that can be used to render a notification.

    """
    if (
            arg_1 is not None and
            arg_1.html_template and
            arg_1.plaintext_template
    ):
        arg_2, arg_3 = arg_1.render_all_templates(arg_0)
    else:
        arg_2 = render_to_string(
            'enterprise/emails/user_notification.txt',
            arg_0
        )
        arg_3 = render_to_string(
            'enterprise/emails/user_notification.html',
            arg_0
        )

    return arg_2, arg_3

Create HTML and plaintext message bodies for a notification .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
', '
.
join
(
name
for
name
,
present
in
arg_1
if
not
present
)
return
arg_0
.
MISSING_REQUIRED_PARAMS_MSG
.
format
(
arg_2
)

def Func(arg_0, arg_1):
        """
        Get a user-friendly message indicating a missing parameter for the API endpoint.
        """
        arg_2 = ', '.join(name for name, present in arg_1 if not present)
        return arg_0.MISSING_REQUIRED_PARAMS_MSG.format(arg_2)

Get a user - friendly message indicating a missing parameter for the API endpoint .


return list(map(lambda positions, deflections: np.subtract(positions, deflections),
                        self.positions, self.deflections))

def Func ( arg_0 ) : return list ( map ( lambda positions , deflections : np . subtract ( positions , deflections ) , arg_0 . positions , arg_0 . deflections ) )

def Func(arg_0):
        """Trace the positions to the next plane."""
        return list(map(lambda positions, deflections: np.subtract(positions, deflections),
                        arg_0.positions, arg_0.deflections))


def
Func
(
arg_0
,
arg_1
)
:
if
arg_0
.
v_locked
:
raise
pex
.
ParameterLockedException
(
'Parameter `%s` is locked!'
%
arg_0
.
v_full_name
)
if
'data'
in
arg_1
:
arg_0
.
_data
=
arg_1
[
'data'
]
[
'data'
]
[
0
]
arg_0
.
_default
=
arg_0
.
_data
else
:
arg_0
.
_logger
.
warning
(
'Your parameter `%s` is empty, '
'I did not find any data on disk.'
%
arg_0
.
v_full_name
)
if
'explored_data'
in
arg_1
:
arg_0
.
_explored_range
=
[
x
for
x
in
arg_1
[
'explored_data'
]
[
'data'
]
.
tolist
(
)
]
arg_0
.
_explored
=
True
arg_0
.
_locked
=
True

def Func(arg_0, arg_1):
        """Loads the data and exploration range from the `load_dict`.

        The `load_dict` needs to be in the same format as the result of the
        :func:`~pypet.parameter.Parameter._store` method.

        """
        if arg_0.v_locked:
            raise pex.ParameterLockedException('Parameter `%s` is locked!' % arg_0.v_full_name)

        if 'data' in arg_1:
            arg_0._data = arg_1['data']['data'][0]
            arg_0._default = arg_0._data
        else:
            arg_0._logger.warning('Your parameter `%s` is empty, '
                                 'I did not find any data on disk.' % arg_0.v_full_name)

        if 'explored_data' in arg_1:
            arg_0._explored_range = [x for x in arg_1['explored_data']['data'].tolist()]
            arg_0._explored = True

        arg_0._locked = True

Loads the data and exploration range from the load_dict .


def
Func
(
arg_0
,
arg_1
=
)
:
if
arg_1
is
:
arg_1
=
glob
.
glob
(
arg_0
+
"/*.*"
)
arg_2
=
[
]
for
arg_3
in
arg_1
:
arg_4
=
os
.
path
.
basename
(
arg_3
)
.
split
(
"."
)
[
1
]
.
lower
(
)
if
arg_4
in
[
'tif'
,
'tiff'
]
:
if
not
os
.
path
.
exists
(
arg_3
+
".png"
)
:
print
(
" -- converting %s to PNG..."
%
os
.
path
.
basename
(
arg_3
)
)
cm
.
image_convert
(
arg_3
)
arg_2
.
append
(
arg_3
)
else
:
pass
return
arg_2

def Func(arg_0,arg_1=None):
    """Convert each TIF to PNG. Return filenames of new PNGs."""
    if arg_1 is None:
        arg_1=glob.glob(arg_0+"/*.*")
    arg_2=[]
    for arg_3 in arg_1:
        arg_4=os.path.basename(arg_3).split(".")[-1].lower()
        if arg_4 in ['tif','tiff']:
            if not os.path.exists(arg_3+".png"):
                print(" -- converting %s to PNG..."%os.path.basename(arg_3))
                cm.image_convert(arg_3)
                arg_2.append(arg_3) #fancy burn-in of image data
            else:
                pass
                #print(" -- already converted %s to PNG..."%os.path.basename(fname))
    return arg_2

Convert each TIF to PNG . Return filenames of new PNGs .


def Func ( arg_0 ) : if arg_0 . attachments : if not isinstance ( arg_0 . attachments , list ) : arg_0 . attachments = [ arg_0 . attachments ] arg_0 . message [ "attachments" ] = [ { "image_url" : url , "author_name" : "" } for url in arg_0 . attachments ] if arg_0 . params : for arg_3 in arg_0 . message [ "attachments" ] : arg_3 . update ( arg_0 . params )

def Func(arg_0):
        """Add attachments."""
        if arg_0.attachments:
            if not isinstance(arg_0.attachments, list):
                arg_0.attachments = [arg_0.attachments]

            arg_0.message["attachments"] = [
                {"image_url": url, "author_name": ""} for url in arg_0.attachments
            ]
            if arg_0.params:
                for arg_3 in arg_0.message["attachments"]:
                    arg_3.update(arg_0.params)


(strng, start=0, screen_lines=0, pager_cmd=None,
         html=None, auto_html=False)

def Func(arg_0, arg_1=0, arg_2=0, arg_3=None,
         arg_4=None, arg_5=False):
    """Print a string, piping through a Funcr.

    This version ignores the screen_lines and Funcr_cmd arguments and uses
    IPython's payload system instead.

    Parameters
    ----------
    strng : str
      Text to Func.

    start : int
      Starting line at which to place the display.

    html : str, optional
      If given, an html string to send as well.

    auto_html : bool, optional
      If true, the input string is assumed to be valid reStructuredText and is
      converted to HTML with docutils.  Note that if docutils is not found,
      this option is silently ignored.

    Note
    ----

    Only one of the ``html`` and ``auto_html`` options can be given, not
    both.
    """

    # Some routines may auto-compute start offsets incorrectly and pass a
    # negative value.  Offset to 0 for robustness.
    arg_1 = max(0, arg_1)
    arg_6 = InteractiveShell.instance()

    if arg_5:
        try:
            # These defaults ensure user configuration variables for docutils
            # are not loaded, only our config is used here.
            arg_7 = {'file_insertion_enabled': 0,
                        'raw_enabled': 0,
                        '_disable_config': 1}
            arg_4 = publish_string(arg_0, writer_name='html',
                                  settings_overrides=arg_7)
        except:
            pass

    arg_8 = dict(
        source='IPython.zmq.Func.Func',
        text=arg_0,
        arg_4=arg_4,
        start_line_number=arg_1
        )
    arg_6.payload_manager.write_payload(arg_8)

Print a string, piping through a pager.

    This version ignores the screen_lines and pager_cmd arguments and uses
    IPython's payload system instead.

    Parameters
    ----------
    strng : str
      Text to page.

    start : int
      Starting line at which to place the display.

    html : str, optional
      If given, an html string to send as well.

    auto_html : bool, optional
      If true, the input string is assumed to be valid reStructuredText and is
      converted to HTML with docutils.  Note that if docutils is not found,
      this option is silently ignored.

    Note
    ----

    Only one of the ``html`` and ``auto_html`` options can be given, not
    both.


def Func(arg_0, arg_1, arg_2=-1):
    """Pack rdd with a specific collection constructor."""
    arg_3 = 0
    arg_4 = []
    for arg_5 in arg_0:
        if (arg_2 > 0) and (arg_3 >= arg_2):
            yield _pack_accumulated(arg_4, arg_1)
            arg_4 = []
            arg_3 = 0
        arg_4.append(arg_5)
        arg_3 += 1
    if arg_3 > 0:
        yield _pack_accumulated(arg_4, arg_1)

Pack rdd with a specific collection constructor .