def
Func
(
arg_0
,
arg_1
=
'> '
,
arg_2
=
)
:
arg_3
=
arg_0
.
_port
.
timeout
arg_2
=
arg_2
or
arg_0
.
_timeout
if
SYSTEM
!=
'Windows'
:
if
arg_0
.
_port
.
timeout
!=
MINIMAL_TIMEOUT
:
arg_0
.
_port
.
timeout
=
MINIMAL_TIMEOUT
arg_5
=
time
.
time
(
)
+
arg_2
arg_6
=
''
while
not
arg_6
.
endswith
(
arg_1
)
and
time
.
time
(
)
<=
arg_5
:
arg_6
+=
arg_0
.
_port
.
read
(
)
log
.
debug
(
'expect returned: `{0}`'
.
format
(
arg_6
)
)
if
time
.
time
(
)
>
arg_5
:
raise
CommunicationTimeout
(
'Timeout waiting for data'
,
arg_6
)
if
not
arg_6
.
endswith
(
arg_1
)
and
len
(
arg_1
)
>
0
:
raise
BadResponseException
(
'Bad response.'
,
arg_1
,
arg_6
)
if
SYSTEM
!=
'Windows'
:
arg_0
.
_port
.
timeout
=
arg_3
return
arg_6

def Func(arg_0, arg_1='> ', arg_2=None):
        """will wait for exp to be returned from nodemcu or timeout"""
        arg_3 = arg_0._port.timeout
        arg_2 = arg_2 or arg_0._timeout
        #do NOT set timeout on Windows
        if SYSTEM != 'Windows':
            # Checking for new data every 100us is fast enough
            if arg_0._port.timeout != MINIMAL_TIMEOUT:
                arg_0._port.timeout = MINIMAL_TIMEOUT

        arg_5 = time.time() + arg_2

        # Finish as soon as either exp matches or we run out of time (work like dump, but faster on success)
        arg_6 = ''
        while not arg_6.endswith(arg_1) and time.time() <= arg_5:
            arg_6 += arg_0._port.read()

        log.debug('expect returned: `{0}`'.format(arg_6))
        if time.time() > arg_5:
            raise CommunicationTimeout('Timeout waiting for data', arg_6)

        if not arg_6.endswith(arg_1) and len(arg_1) > 0:
            raise BadResponseException('Bad response.', arg_1, arg_6)

        if SYSTEM != 'Windows':
            arg_0._port.timeout = arg_3

        return arg_6


def Func ( arg_0 , arg_1 , arg_2 = "dist_params" ) : with tf . compat . v1 . name_scope ( arg_2 ) : tf . compat . v2 . summary . histogram ( arg_1 = "{}/{}" . format ( arg_1 , "mean" ) , data = arg_0 . mean ( ) , step = tf . compat . v1 . train . get_or_create_global_step ( ) ) tf . compat . v2 . summary . histogram ( arg_1 = "{}/{}" . format ( arg_1 , "stddev" ) , data = arg_0 . stddev ( ) , step = tf . compat . v1 . train . get_or_create_global_step ( ) )

def Func(arg_0, arg_1, arg_2="dist_params"):
  """Summarize the parameters of a distribution.

  Args:
    dist: A Distribution object with mean and standard deviation
      parameters.
    name: The name of the distribution.
    name_scope: The name scope of this summary.
  """
  with tf.compat.v1.name_scope(arg_2):
    tf.compat.v2.summary.histogram(
        arg_1="{}/{}".format(arg_1, "mean"),
        data=arg_0.mean(),
        step=tf.compat.v1.train.get_or_create_global_step())
    tf.compat.v2.summary.histogram(
        arg_1="{}/{}".format(arg_1, "stddev"),
        data=arg_0.stddev(),
        step=tf.compat.v1.train.get_or_create_global_step())

Summarize the parameters of a distribution .


return self.get_data(
            "images/%s" % self.id,
            type=PUT,
            params={"name": new_name}
        )

def Func ( arg_0 , arg_1 ) : return arg_0 . get_data ( "images/%s" % arg_0 . id , type = PUT , params = { "name" : arg_1 } )

def Func(arg_0, arg_1):
        """
            Rename an image
        """
        return arg_0.get_data(
            "images/%s" % arg_0.id,
            type=PUT,
            params={"name": arg_1}
        )


def Func(arg_0):
  """ Loads the configuration files and processes the config overrides.

  Args:
    filename: The name of the file being processed by the linter.

  Returns:
    False if the current |filename| should not be processed further.
  """

  arg_1 = os.path.abspath(arg_0)
  arg_2 = []
  arg_3 = True
  while arg_3:
    arg_4, arg_5 = os.path.split(arg_1)
    if not arg_5:
      break  # Reached the root directory.

    arg_6 = os.path.join(arg_4, "CPPLINT.cfg")
    arg_1 = arg_4
    if not os.path.isfile(arg_6):
      continue

    try:
      with open(arg_6) as file_handle:
        for arg_7 in file_handle:
          arg_7, arg_8, arg_8 = arg_7.partition('#')  # Remove comments.
          if not arg_7.strip():
            continue

          arg_9, arg_8, arg_10 = arg_7.partition('=')
          arg_9 = arg_9.strip()
          arg_10 = arg_10.strip()
          if arg_9 == 'set noparent':
            arg_3 = False
          elif arg_9 == 'filter':
            arg_2.append(arg_10)
          elif arg_9 == 'exclude_files':
            # When matching exclude_files pattern, use the base_name of
            # the current file name or the directory name we are processing.
            # For example, if we are checking for lint errors in /foo/bar/baz.cc
            # and we found the .cfg file at /foo/CPPLINT.cfg, then the config
            # file's "exclude_files" filter is meant to be checked against "bar"
            # and not "baz" nor "bar/baz.cc".
            if arg_5:
              arg_11 = re.compile(arg_10)
              if arg_11.match(arg_5):
                _cpplint_state.PrintInfo('Ignoring "%s": file excluded by '
                    '"%s". File path component "%s" matches pattern "%s"\n' %
                    (arg_0, arg_6, arg_5, arg_10))
                return False
          elif arg_9 == 'linelength':
            global arg_12
            try:
                arg_12 = int(arg_10)
            except ValueError:
                _cpplint_state.PrintError('Line length must be numeric.')
          elif arg_9 == 'extensions':
              global arg_14
              try:
                  arg_13 = [ext.strip() for ext in arg_10.split(',')]
                  arg_14 = set(arg_13)
              except ValueError:
                  sys.stderr.write('Extensions should be a comma-separated list of values;'
                                   'for example: extensions=hpp,cpp\n'
                                   'This could not be parsed: "%s"' % (arg_10,))
          elif arg_9 == 'headers':
              global arg_15
              try:
                  arg_13 = [ext.strip() for ext in arg_10.split(',')]
                  arg_15 = set(arg_13)
              except ValueError:
                  sys.stderr.write('Extensions should be a comma-separated list of values;'
                                   'for example: extensions=hpp,cpp\n'
                                   'This could not be parsed: "%s"' % (arg_10,))
          elif arg_9 == 'root':
            global arg_16
            arg_16 = arg_10
          else:
            _cpplint_state.PrintError(
                'Invalid configuration option (%s) in file %s\n' %
                (arg_9, arg_6))

    except IOError:
      _cpplint_state.PrintError(
          "Skipping config file '%s': Can't open for reading\n" % arg_6)
      arg_3 = False

  # Apply all the accumulated filters in reverse order (top-level directory
  # config options having the least priority).
  for arg_17 in reversed(arg_2):
     _AddFilters(arg_17)

  return True

Loads the configuration files and processes the config overrides .


(self, enterprise_customer, course_id=None, program_uuid=None)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
,
arg_3
=
)
:
arg_4
=
{
}
if
arg_2
:
arg_4
.
update
(
{
'course_id'
:
arg_2
,
'course_specific'
:
True
}
)
if
not
arg_0
.
preview_mode
:
try
:
arg_5
=
CourseCatalogApiServiceClient
(
arg_1
.
site
)
except
ImproperlyConfigured
:
raise
Http404
arg_6
=
arg_5
.
get_course_run
(
arg_2
)
arg_7
=
''
if
arg_6
[
'start'
]
:
arg_7
=
parse
(
arg_6
[
'start'
]
)
.
strftime
(
'%B %d, %Y'
)
arg_4
.
update
(
{
'course_title'
:
arg_6
[
'title'
]
,
'course_start_date'
:
arg_7
,
}
)
else
:
arg_4
.
update
(
{
'course_title'
:
'Demo Course'
,
'course_start_date'
:
datetime
.
datetime
.
now
(
)
.
strftime
(
'%B %d, %Y'
)
,
}
)
else
:
arg_4
.
update
(
{
'program_uuid'
:
arg_3
,
'program_specific'
:
True
,
}
)
return
arg_4

def Func(arg_0, arg_1, arg_2=None, arg_3=None):
        """
        Return a dict having course or program specific keys for data sharing consent page.
        """
        arg_4 = {}
        if arg_2:
            arg_4.update({'course_id': arg_2, 'course_specific': True})
            if not arg_0.preview_mode:
                try:
                    arg_5 = CourseCatalogApiServiceClient(arg_1.site)
                except ImproperlyConfigured:
                    raise Http404

                arg_6 = arg_5.get_course_run(arg_2)
                arg_7 = ''
                if arg_6['start']:
                    arg_7 = parse(arg_6['start']).strftime('%B %d, %Y')

                arg_4.update({
                    'course_title': arg_6['title'],
                    'course_start_date': arg_7,
                })
            else:
                arg_4.update({
                    'course_title': 'Demo Course',
                    'course_start_date': datetime.datetime.now().strftime('%B %d, %Y'),
                })
        else:
            arg_4.update({
                'program_uuid': arg_3,
                'program_specific': True,
            })
        return arg_4

Return a dict having course or program specific keys for data sharing consent page .


def Func ( arg_0 ) : if not arg_0 . initiator : if "plain" in arg_0 . auth_methods or "digest" in arg_0 . auth_methods : arg_0 . set_iq_get_handler ( "query" , "jabber:iq:auth" , arg_0 . auth_in_stage1 ) arg_0 . set_iq_set_handler ( "query" , "jabber:iq:auth" , arg_0 . auth_in_stage2 ) elif arg_0 . registration_callback : arg_1 = Iq ( stanza_type = "get" ) arg_1 . set_content ( Register ( ) ) arg_0 . set_response_handlers ( arg_1 , arg_0 . registration_form_received , arg_0 . registration_error ) arg_0 . send ( arg_1 ) return ClientStream . Func ( arg_0 )

def Func(arg_0):
        """Initialize authentication when the connection is established
        and we are the initiator."""
        if not arg_0.initiator:
            if "plain" in arg_0.auth_methods or "digest" in arg_0.auth_methods:
                arg_0.set_iq_get_handler("query","jabber:iq:auth",
                            arg_0.auth_in_stage1)
                arg_0.set_iq_set_handler("query","jabber:iq:auth",
                            arg_0.auth_in_stage2)
        elif arg_0.registration_callback:
            arg_1 = Iq(stanza_type = "get")
            arg_1.set_content(Register())
            arg_0.set_response_handlers(arg_1, arg_0.registration_form_received, arg_0.registration_error)
            arg_0.send(arg_1)
            return
        ClientStream.Func(arg_0)

Initialize authentication when the connection is established and we are the initiator .


return len(nums) / sum(1 / i for i in nums)

def
Func
(
arg_0
)
:
if
len
(
arg_0
)
<
1
:
raise
AttributeError
(
'Func requires at least one value'
)
elif
len
(
arg_0
)
==
1
:
return
arg_0
[
0
]
else
:
for
arg_1
in
range
(
1
,
len
(
arg_0
)
)
:
if
arg_0
[
0
]
!=
arg_0
[
arg_1
]
:
break
else
:
return
arg_0
[
0
]
if
0
in
arg_0
:
if
arg_0
.
count
(
0
)
>
1
:
return
float
(
'nan'
)
return
0
return
len
(
arg_0
)
/
sum
(
1
/
arg_1
for
arg_1
in
arg_0
)

def Func(arg_0):
    r"""Return harmonic mean.

    The harmonic mean is defined as:
    :math:`\frac{|nums|}{\sum\limits_{i}\frac{1}{nums_i}}`

    Following the behavior of Wolfram|Alpha:
    - If one of the values in nums is 0, return 0.
    - If more than one value in nums is 0, return NaN.

    Cf. https://en.wikipedia.org/wiki/Harmonic_mean

    Parameters
    ----------
    nums : list
        A series of numbers

    Returns
    -------
    float
        The harmonic mean of nums

    Raises
    ------
    AttributeError
        Func requires at least one value

    Examples
    --------
    >>> Func([1, 2, 3, 4])
    1.9200000000000004
    >>> Func([1, 2])
    1.3333333333333333
    >>> Func([0, 5, 1000])
    0

    """
    if len(arg_0) < 1:
        raise AttributeError('Func requires at least one value')
    elif len(arg_0) == 1:
        return arg_0[0]
    else:
        for arg_1 in range(1, len(arg_0)):
            if arg_0[0] != arg_0[arg_1]:
                break
        else:
            return arg_0[0]

    if 0 in arg_0:
        if arg_0.count(0) > 1:
            return float('nan')
        return 0
    return len(arg_0) / sum(1 / arg_1 for arg_1 in arg_0)

r"""Return harmonic mean.

    The harmonic mean is defined as:
    :math:`\frac{|nums|}{\sum\limits_{i}\frac{1}{nums_i}}`

    Following the behavior of Wolfram|Alpha:
    - If one of the values in nums is 0, return 0.
    - If more than one value in nums is 0, return NaN.

    Cf. https://en.wikipedia.org/wiki/Harmonic_mean

    Parameters
    ----------
    nums : list
        A series of numbers

    Returns
    -------
    float
        The harmonic mean of nums

    Raises
    ------
    AttributeError
        hmean requires at least one value

    Examples
    --------
    >>> hmean([1, 2, 3, 4])
    1.9200000000000004
    >>> hmean([1, 2])
    1.3333333333333333
    >>> hmean([0, 5, 1000])
    0


def Func ( arg_0 , arg_1 = 'image' ) : arg_2 = latex_to_png ( arg_0 , encode = True ) if arg_2 : return _data_uri_template_png % ( arg_2 , arg_1 )

def Func(arg_0, arg_1='image'):
    """Render LaTeX to HTML with embedded PNG data using data URIs.

    Parameters
    ----------
    s : str
        The raw string containing valid inline LateX.
    alt : str
        The alt text to use for the HTML.
    """
    arg_2 = latex_to_png(arg_0, encode=True)
    if arg_2:
        return _data_uri_template_png  % (arg_2, arg_1)

Render LaTeX to HTML with embedded PNG data using data URIs .


def Func(arg_0, arg_1):
        """
        Run each in a list of PIF queries against Citrination.

        :param multi_query: :class:`MultiQuery` object to execute.
        :return: :class:`PifMultiSearchResult` object with the results of the query.
        """
        arg_2 = "Error while making PIF multi search request"
        arg_3 = arg_0._get_success_json(
            arg_0._post(routes.Func, data=json.dumps(arg_1, cls=QueryEncoder),
                       arg_2=arg_2))

        return PifMultiSearchResult(**keys_to_snake_case(arg_3['results']))

Run each in a list of PIF queries against Citrination .


def Func ( ) : arg_0 = { 'os' : platform . system ( ) , 'memory' : psutil . virtual_memory ( ) . total / ( 1024 ** 3 ) , 'cpus' : psutil . cpu_count ( logical = False ) or 1 } return arg_0

def Func():
    """Basic hardware information about the local machine.

    Gives actual number of CPU's in the machine, even when hyperthreading is
    turned on. CPU count defaults to 1 when true count can't be determined.

    Returns:
        dict: The hardware information.
    """
    arg_0 = {
        'os': platform.system(),
        'memory': psutil.virtual_memory().total / (1024 ** 3),
        'cpus': psutil.cpu_count(logical=False) or 1
    }
    return arg_0

Basic hardware information about the local machine .


Override the scheduler heartbeat to determine when the test is complete

def Func(arg_0):
        """
        Override the scheduler Func to determine when the test is complete
        """
        super(SchedulerMetricsJob, arg_0).Func()
        arg_1 = settings.Session()
        # Get all the relevant task instances
        arg_2 = TaskInstance
        arg_3 = (
            arg_1
            .query(arg_2)
            .filter(arg_2.dag_id.in_(DAG_IDS))
            .filter(arg_2.state.in_([State.SUCCESS]))
            .all()
        )
        arg_1.commit()

        arg_4 = DagBag(SUBDIR)
        arg_5 = [arg_4.dags[dag_id] for dag_id in DAG_IDS]
        # the tasks in perf_dag_1 and per_dag_2 have a daily schedule interval.
        arg_6 = sum([(timezone.utcnow() - task.start_date).days
                                 for dag in arg_5 for task in dag.tasks])

        if (len(arg_3) == arg_6 or
                (timezone.utcnow() - arg_0.start_date).total_seconds() >
                MAX_RUNTIME_SECS):
            if len(arg_3) == arg_6:
                arg_0.log.info("All tasks processed! Printing stats.")
            else:
                arg_0.log.info("Test timeout reached. Printing available stats.")
            arg_0.print_stats()
            set_dags_paused_state(True)
            sys.exit()


def Func ( arg_0 ) : arg_0 . __thread = Thread ( target = arg_0 . __run , args = ( True , False ) ) arg_0 . __thread . setDaemon ( True ) arg_0 . __thread . Func ( )

def Func(arg_0):
        """Start DMESG job in thread"""

        arg_0.__thread = Thread(target=arg_0.__run, args=(True, False))
        arg_0.__thread.setDaemon(True)
        arg_0.__thread.Func()


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . copy ( ) arg_2 . l += arg_1 arg_2 . r += arg_1 return arg_2

def Func(arg_0, arg_1):
        """
        Translate a tile by an amount dr

        >>> Tile(5).Func(1)
        Tile [1, 1, 1] -> [6, 6, 6] ([5, 5, 5])
        """
        arg_2 = arg_0.copy()
        arg_2.l += arg_1
        arg_2.r += arg_1
        return arg_2

Translate a tile by an amount dr

        >>> Tile(5).translate(1)
        Tile [1, 1, 1] -> [6, 6, 6] ([5, 5, 5])


def Func(arg_0, arg_1):
        """Change the routing transitions probabilities for the
        network.

        Parameters
        ----------
        mat : dict or :class:`~numpy.ndarray`
            A transition routing matrix or transition dictionary. If
            passed a dictionary, the keys are source vertex indices and
            the values are dictionaries with target vertex indicies
            as the keys and the probabilities of routing from the
            source to the target as the values.

        Raises
        ------
        ValueError
            A :exc:`.ValueError` is raised if: the keys in the dict
            don't match with a vertex index in the graph; or if the
            :class:`~numpy.ndarray` is passed with the wrong shape,
            must be (``num_vertices``, ``num_vertices``); or the values
            passed are not probabilities (for each vertex they are
            positive and sum to 1);
        TypeError
            A :exc:`.TypeError` is raised if mat is not a dict or
            :class:`~numpy.ndarray`.

        Examples
        --------
        The default transition matrix is every out edge being equally
        likely:

        >>> import queueing_tool as qt
        >>> adjacency = {
        ...     0: [2],
        ...     1: [2, 3],
        ...     2: [0, 1, 2, 4],
        ...     3: [1],
        ...     4: [2],
        ... }
        >>> g = qt.adjacency2graph(adjacency)
        >>> net = qt.QueueNetwork(g)
        >>> net.transitions(False)  # doctest: +ELLIPSIS
        ...                         # doctest: +NORMALIZE_WHITESPACE
        {0: {2: 1.0},
         1: {2: 0.5, 3: 0.5},
         2: {0: 0.25, 1: 0.25, 2: 0.25, 4: 0.25},
         3: {1: 1.0},
         4: {2: 1.0}}

        If you want to change only one vertex's transition
        probabilities, you can do so with the following:

        >>> net.Func({1 : {2: 0.75, 3: 0.25}})
        >>> net.transitions(False)  # doctest: +ELLIPSIS
        ...                         # doctest: +NORMALIZE_WHITESPACE
        {0: {2: 1.0},
         1: {2: 0.75, 3: 0.25},
         2: {0: 0.25, 1: 0.25, 2: 0.25, 4: 0.25},
         3: {1: 1.0},
         4: {2: 1.0}}

        One can generate a transition matrix using
        :func:`.generate_transition_matrix`. You can change all
        transition probabilities with an :class:`~numpy.ndarray`:

        >>> mat = qt.generate_transition_matrix(g, seed=10)
        >>> net.Func(mat)
        >>> net.transitions(False)  # doctest: +ELLIPSIS
        ...                         # doctest: +NORMALIZE_WHITESPACE
        {0: {2: 1.0},
         1: {2: 0.962..., 3: 0.037...},
         2: {0: 0.301..., 1: 0.353..., 2: 0.235..., 4: 0.108...},
         3: {1: 1.0},
         4: {2: 1.0}}

        See Also
        --------
        :meth:`.transitions` : Return the current routing
            probabilities.
        :func:`.generate_transition_matrix` : Generate a random routing
            matrix.
        """
        if isinstance(arg_1, dict):
            for arg_2, arg_3 in arg_1.items():
                arg_4 = list(arg_3.values())

                if arg_2 not in arg_0.g.node:
                    arg_5 = "One of the keys don't correspond to a vertex."
                    raise ValueError(arg_5)
                elif len(arg_0.out_edges[arg_2]) > 0 and not np.isclose(sum(arg_4), 1):
                    arg_5 = "Sum of transition probabilities at a vertex was not 1."
                    raise ValueError(arg_5)
                elif (np.array(arg_4) < 0).any():
                    arg_5 = "Some transition probabilities were negative."
                    raise ValueError(arg_5)

                for arg_6, arg_7 in enumerate(sorted(arg_0.g.out_edges(arg_2))):
                    arg_0._route_probs[arg_2][arg_6] = arg_3.get(arg_7[1], 0)

        elif isinstance(arg_1, np.ndarray):
            arg_9 = np.array([arg_0.g.out_degree(v) > 0 for v in arg_0.g.nodes()])
            if arg_1.shape != (arg_0.nV, arg_0.nV):
                arg_5 = ("Matrix is the wrong shape, should "
                       "be {0} x {1}.").format(arg_0.nV, arg_0.nV)
                raise ValueError(arg_5)
            elif not np.allclose(np.sum(arg_1[arg_9, :], axis=1), 1):
                arg_5 = "Sum of transition probabilities at a vertex was not 1."
                raise ValueError(arg_5)
            elif (arg_1 < 0).any():
                raise ValueError("Some transition probabilities were negative.")

            for arg_6 in range(arg_0.nV):
                for arg_10, arg_7 in enumerate(sorted(arg_0.g.out_edges(arg_6))):
                    arg_0._route_probs[arg_6][arg_10] = arg_1[arg_6, arg_7[1]]
        else:
            raise TypeError("mat must be a numpy array or a dict.")

Change the routing transitions probabilities for the
        network.

        Parameters
        ----------
        mat : dict or :class:`~numpy.ndarray`
            A transition routing matrix or transition dictionary. If
            passed a dictionary, the keys are source vertex indices and
            the values are dictionaries with target vertex indicies
            as the keys and the probabilities of routing from the
            source to the target as the values.

        Raises
        ------
        ValueError
            A :exc:`.ValueError` is raised if: the keys in the dict
            don't match with a vertex index in the graph; or if the
            :class:`~numpy.ndarray` is passed with the wrong shape,
            must be (``num_vertices``, ``num_vertices``); or the values
            passed are not probabilities (for each vertex they are
            positive and sum to 1);
        TypeError
            A :exc:`.TypeError` is raised if mat is not a dict or
            :class:`~numpy.ndarray`.

        Examples
        --------
        The default transition matrix is every out edge being equally
        likely:

        >>> import queueing_tool as qt
        >>> adjacency = {
        ...     0: [2],
        ...     1: [2, 3],
        ...     2: [0, 1, 2, 4],
        ...     3: [1],
        ...     4: [2],
        ... }
        >>> g = qt.adjacency2graph(adjacency)
        >>> net = qt.QueueNetwork(g)
        >>> net.transitions(False)  # doctest: +ELLIPSIS
        ...                         # doctest: +NORMALIZE_WHITESPACE
        {0: {2: 1.0},
         1: {2: 0.5, 3: 0.5},
         2: {0: 0.25, 1: 0.25, 2: 0.25, 4: 0.25},
         3: {1: 1.0},
         4: {2: 1.0}}

        If you want to change only one vertex's transition
        probabilities, you can do so with the following:

        >>> net.set_transitions({1 : {2: 0.75, 3: 0.25}})
        >>> net.transitions(False)  # doctest: +ELLIPSIS
        ...                         # doctest: +NORMALIZE_WHITESPACE
        {0: {2: 1.0},
         1: {2: 0.75, 3: 0.25},
         2: {0: 0.25, 1: 0.25, 2: 0.25, 4: 0.25},
         3: {1: 1.0},
         4: {2: 1.0}}

        One can generate a transition matrix using
        :func:`.generate_transition_matrix`. You can change all
        transition probabilities with an :class:`~numpy.ndarray`:

        >>> mat = qt.generate_transition_matrix(g, seed=10)
        >>> net.set_transitions(mat)
        >>> net.transitions(False)  # doctest: +ELLIPSIS
        ...                         # doctest: +NORMALIZE_WHITESPACE
        {0: {2: 1.0},
         1: {2: 0.962..., 3: 0.037...},
         2: {0: 0.301..., 1: 0.353..., 2: 0.235..., 4: 0.108...},
         3: {1: 1.0},
         4: {2: 1.0}}

        See Also
        --------
        :meth:`.transitions` : Return the current routing
            probabilities.
        :func:`.generate_transition_matrix` : Generate a random routing
            matrix.

Change the routing transitions probabilities for the network .


(
            self, nodes_health_state_filter=0, applications_health_state_filter=0, events_health_state_filter=0, exclude_health_statistics=False, include_system_application_health_statistics=False, timeout=60, application_health_policy_map=None, cluster_health_policy=None, custom_headers=None, raw=False, **operation_config)

def Func(
            arg_0, arg_1=0, arg_2=0, arg_3=0, arg_4=False, arg_5=False, arg_6=60, arg_7=None, arg_8=None, arg_9=None, arg_10=False, **arg_11):
        """Gets the health of a Service Fabric cluster using the specified policy.

        Use EventsHealthStateFilter to filter the collection of health events
        reported on the cluster based on the health state.
        Similarly, use NodesHealthStateFilter and ApplicationsHealthStateFilter
        to filter the collection of nodes and applications returned based on
        their aggregated health state.
        Use ClusterHealthPolicies to override the health policies used to
        evaluate the health.

        :param nodes_health_state_filter: Allows filtering of the node health
         state objects returned in the result of cluster health query
         based on their health state. The possible values for this parameter
         include integer value of one of the
         following health states. Only nodes that match the filter are
         returned. All nodes are used to evaluate the aggregated health state.
         If not specified, all entries are returned.
         The state values are flag-based enumeration, so the value could be a
         combination of these values obtained using bitwise 'OR' operator.
         For example, if the provided value is 6 then health state of nodes
         with HealthState value of OK (2) and Warning (4) are returned.
         - Default - Default value. Matches any HealthState. The value is zero.
         - None - Filter that doesn't match any HealthState value. Used in
         order to return no results on a given collection of states. The value
         is 1.
         - Ok - Filter that matches input with HealthState value Ok. The value
         is 2.
         - Warning - Filter that matches input with HealthState value Warning.
         The value is 4.
         - Error - Filter that matches input with HealthState value Error. The
         value is 8.
         - All - Filter that matches input with any HealthState value. The
         value is 65535.
        :type nodes_health_state_filter: int
        :param applications_health_state_filter: Allows filtering of the
         application health state objects returned in the result of cluster
         health
         query based on their health state.
         The possible values for this parameter include integer value obtained
         from members or bitwise operations
         on members of HealthStateFilter enumeration. Only applications that
         match the filter are returned.
         All applications are used to evaluate the aggregated health state. If
         not specified, all entries are returned.
         The state values are flag-based enumeration, so the value could be a
         combination of these values obtained using bitwise 'OR' operator.
         For example, if the provided value is 6 then health state of
         applications with HealthState value of OK (2) and Warning (4) are
         returned.
         - Default - Default value. Matches any HealthState. The value is zero.
         - None - Filter that doesn't match any HealthState value. Used in
         order to return no results on a given collection of states. The value
         is 1.
         - Ok - Filter that matches input with HealthState value Ok. The value
         is 2.
         - Warning - Filter that matches input with HealthState value Warning.
         The value is 4.
         - Error - Filter that matches input with HealthState value Error. The
         value is 8.
         - All - Filter that matches input with any HealthState value. The
         value is 65535.
        :type applications_health_state_filter: int
        :param events_health_state_filter: Allows filtering the collection of
         HealthEvent objects returned based on health state.
         The possible values for this parameter include integer value of one of
         the following health states.
         Only events that match the filter are returned. All events are used to
         evaluate the aggregated health state.
         If not specified, all entries are returned. The state values are
         flag-based enumeration, so the value could be a combination of these
         values, obtained using the bitwise 'OR' operator. For example, If the
         provided value is 6 then all of the events with HealthState value of
         OK (2) and Warning (4) are returned.
         - Default - Default value. Matches any HealthState. The value is zero.
         - None - Filter that doesn't match any HealthState value. Used in
         order to return no results on a given collection of states. The value
         is 1.
         - Ok - Filter that matches input with HealthState value Ok. The value
         is 2.
         - Warning - Filter that matches input with HealthState value Warning.
         The value is 4.
         - Error - Filter that matches input with HealthState value Error. The
         value is 8.
         - All - Filter that matches input with any HealthState value. The
         value is 65535.
        :type events_health_state_filter: int
        :param exclude_health_statistics: Indicates whether the health
         statistics should be returned as part of the query result. False by
         default.
         The statistics show the number of children entities in health state
         Ok, Warning, and Error.
        :type exclude_health_statistics: bool
        :param include_system_application_health_statistics: Indicates whether
         the health statistics should include the fabric:/System application
         health statistics. False by default.
         If IncludeSystemApplicationHealthStatistics is set to true, the health
         statistics include the entities that belong to the fabric:/System
         application.
         Otherwise, the query result includes health statistics only for user
         applications.
         The health statistics must be included in the query result for this
         parameter to be applied.
        :type include_system_application_health_statistics: bool
        :param timeout: The server timeout for performing the operation in
         seconds. This timeout specifies the time duration that the client is
         willing to wait for the requested operation to complete. The default
         value for this parameter is 60 seconds.
        :type timeout: long
        :param application_health_policy_map: Defines a map that contains
         specific application health policies for different applications.
         Each entry specifies as key the application name and as value an
         ApplicationHealthPolicy used to evaluate the application health.
         If an application is not specified in the map, the application health
         evaluation uses the ApplicationHealthPolicy found in its application
         manifest or the default application health policy (if no health policy
         is defined in the manifest).
         The map is empty by default.
        :type application_health_policy_map:
         list[~azure.servicefabric.models.ApplicationHealthPolicyMapItem]
        :param cluster_health_policy: Defines a health policy used to evaluate
         the health of the cluster or of a cluster node.
        :type cluster_health_policy:
         ~azure.servicefabric.models.ClusterHealthPolicy
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: ClusterHealth or ClientRawResponse if raw=true
        :rtype: ~azure.servicefabric.models.ClusterHealth or
         ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`FabricErrorException<azure.servicefabric.models.FabricErrorException>`
        """
        arg_12 = None
        if arg_7 is not None or arg_8 is not None:
            arg_12 = models.ClusterHealthPolicies(arg_7=arg_7, arg_8=arg_8)

        arg_13 = "6.0"

        # Construct URL
        arg_14 = arg_0.Func.metadata['url']

        # Construct parameters
        arg_15 = {}
        arg_15['api-version'] = arg_0._serialize.query("api_version", arg_13, 'str')
        if arg_1 is not None:
            arg_15['NodesHealthStateFilter'] = arg_0._serialize.query("nodes_health_state_filter", arg_1, 'int')
        if arg_2 is not None:
            arg_15['ApplicationsHealthStateFilter'] = arg_0._serialize.query("applications_health_state_filter", arg_2, 'int')
        if arg_3 is not None:
            arg_15['EventsHealthStateFilter'] = arg_0._serialize.query("events_health_state_filter", arg_3, 'int')
        if arg_4 is not None:
            arg_15['ExcludeHealthStatistics'] = arg_0._serialize.query("exclude_health_statistics", arg_4, 'bool')
        if arg_5 is not None:
            arg_15['IncludeSystemApplicationHealthStatistics'] = arg_0._serialize.query("include_system_application_health_statistics", arg_5, 'bool')
        if arg_6 is not None:
            arg_15['timeout'] = arg_0._serialize.query("timeout", arg_6, 'long', maximum=4294967295, minimum=1)

        # Construct headers
        arg_16 = {}
        arg_16['Accept'] = 'application/json'
        arg_16['Content-Type'] = 'application/json; charset=utf-8'
        if arg_9:
            arg_16.update(arg_9)

        # Construct body
        if arg_12 is not None:
            arg_17 = arg_0._serialize.body(arg_12, 'ClusterHealthPolicies')
        else:
            arg_17 = None

        # Construct and send request
        arg_18 = arg_0._client.post(arg_14, arg_15, arg_16, arg_17)
        arg_19 = arg_0._client.send(arg_18, stream=False, **arg_11)

        if arg_19.status_code not in [200]:
            raise models.FabricErrorException(arg_0._deserialize, arg_19)

        arg_20 = None

        if arg_19.status_code == 200:
            arg_20 = arg_0._deserialize('ClusterHealth', arg_19)

        if arg_10:
            arg_21 = ClientRawResponse(arg_20, arg_19)
            return arg_21

        return arg_20

Gets the health of a Service Fabric cluster using the specified policy .


return configuration_helpers.get_value(val_name, default, **kwargs) if configuration_helpers else default

def Func ( arg_0 , arg_1 = None , ** arg_2 ) : if arg_2 . get ( 'type' ) == 'url' : return get_url ( arg_0 ) or arg_1 if callable ( get_url ) else arg_1 return configuration_helpers . get_value ( arg_0 , arg_1 , ** arg_2 ) if configuration_helpers else arg_1

def Func(arg_0, arg_1=None, **arg_2):
    """
    Get a configuration value, or fall back to ``default`` if it doesn't exist.

    Also takes a `type` argument to guide which particular upstream method to use when trying to retrieve a value.
    Current types include:
        - `url` to specifically get a URL.
    """
    if arg_2.get('type') == 'url':
        return get_url(arg_0) or arg_1 if callable(get_url) else arg_1
    return configuration_helpers.get_value(arg_0, arg_1, **arg_2) if configuration_helpers else arg_1

Get a configuration value or fall back to default if it doesn t exist .


(self, item, variant=VARIANT.MEDIUM, quantity=1)

def Func ( arg_0 , arg_1 , arg_2 = arg_3 . MEDIUM , arg_5 = 1 ) : arg_6 = arg_1 [ arg_2 ] arg_7 = arg_6 [ 'ingredients' ] . update ( [ 36 , 42 ] ) arg_8 = { 'stepId' : 0 , 'quantity' : arg_5 , 'sizeId' : arg_2 , 'productId' : arg_1 . item_id , 'ingredients' : arg_7 , 'productIdHalfTwo' : 0 , 'ingredientsHalfTwo' : [ ] , 'recipeReferrer' : 0 } return arg_0 . __post ( '/Basket/AddPizza' , json = arg_8 )

def Func(arg_0, arg_1, arg_2=arg_3.MEDIUM, arg_5=1):
        '''
        Add a pizza to the current basket.

        :param Item item: Item from menu.
        :param int variant: Item SKU id. Some defaults are defined in the VARIANT enum.
        :param int quantity: The quantity of pizza to be added.
        :return: A response having added a pizza to the current basket.
        :rtype: requests.Response
        '''
        arg_6 = arg_1[arg_2]
        arg_7 = arg_6['ingredients'].update([36, 42])

        arg_8 = {
            'stepId': 0,
            'quantity': arg_5,
            'sizeId': arg_2,
            'productId': arg_1.item_id,
            'ingredients': arg_7,
            'productIdHalfTwo': 0,
            'ingredientsHalfTwo': [],
            'recipeReferrer': 0
        }

        return arg_0.__post('/Basket/AddPizza', json=arg_8)


def Func ( arg_0 , arg_1 , * arg_2 ) : for arg_3 in arg_1 : if arg_3 ( arg_0 , * arg_2 ) : return True pass return False

def Func(arg_0, arg_1, *arg_2):
    """Run each function in `hooks' with args"""
    for arg_3 in arg_1:
        if arg_3(arg_0, *arg_2): return True
        pass
    return False


def Func ( arg_0 ) : arg_1 = arg_0 . cleaned_data . get ( arg_0 . Fields . COURSE ) if arg_1 : arg_2 = arg_0 . cleaned_data . get ( arg_0 . Fields . COURSE_MODE ) if not arg_2 : raise ValidationError ( ValidationMessages . COURSE_WITHOUT_COURSE_MODE ) arg_3 = arg_1 [ "course_modes" ] if all ( arg_2 != arg_4 [ "slug" ] for arg_4 in arg_3 ) : arg_5 = ValidationError ( ValidationMessages . COURSE_MODE_INVALID_FOR_COURSE . format ( arg_2 = arg_2 , course_id = arg_1 [ "course_id" ] , ) ) raise ValidationError ( { arg_0 . Fields . COURSE_MODE : arg_5 } )

def Func(arg_0):
        """
        Verify that the selected mode is valid for the given course .
        """
        # Verify that the selected mode is valid for the given course .
        arg_1 = arg_0.cleaned_data.get(arg_0.Fields.COURSE)
        if arg_1:
            arg_2 = arg_0.cleaned_data.get(arg_0.Fields.COURSE_MODE)
            if not arg_2:
                raise ValidationError(ValidationMessages.COURSE_WITHOUT_COURSE_MODE)
            arg_3 = arg_1["course_modes"]
            if all(arg_2 != arg_4["slug"] for arg_4 in arg_3):
                arg_5 = ValidationError(ValidationMessages.COURSE_MODE_INVALID_FOR_COURSE.format(
                    arg_2=arg_2,
                    course_id=arg_1["course_id"],
                ))
                raise ValidationError({arg_0.Fields.COURSE_MODE: arg_5})


(self, selection, name="default", executor=None)

def Func ( arg_0 , arg_1 , arg_2 = "default" , arg_3 = None ) : def create ( arg_4 ) : return arg_1 arg_0 . _selection ( create , arg_2 , arg_3 = arg_3 , execute_fully = True )

def Func(arg_0, arg_1, arg_2="default", arg_3=None):
        """Sets the selection object

        :param selection: Selection object
        :param name: selection 'slot'
        :param executor:
        :return:
        """
        def create(arg_4):
            return arg_1
        arg_0._selection(create, arg_2, arg_3=arg_3, execute_fully=True)


def
Func
(
arg_0
,
arg_1
)
:
assert
(
len
(
arg_0
)
==
len
(
arg_1
)
)
arg_2
=
list
(
map
(
_get_name
,
arg_0
)
)
assert
'content'
not
in
arg_2
,
"Unexpected content field."
return
dict
(
zip
(
arg_2
,
arg_1
)
)

def Func(arg_0, arg_1):
    """
    Convert a SQLAlchemy row that does not contain a 'content' field to a dict.

    If row is None, return None.

    Raises AssertionError if there is a field named 'content' in ``fields``.
    """
    assert(len(arg_0) == len(arg_1))

    arg_2 = list(map(_get_name, arg_0))
    assert 'content' not in arg_2, "Unexpected content field."

    return dict(zip(arg_2, arg_1))

Convert a SQLAlchemy row that does not contain a content field to a dict .


def Func ( arg_0 = 10 , arg_1 = [ 2 , 6 ] , arg_2 = [ 5 , 6 , 7 ] , arg_3 = 100 ) : arg_4 = range ( arg_0 ) for arg_5 in arg_1 : arg_4 . remove ( arg_5 ) arg_6 = [ ] for arg_7 in xrange ( arg_3 ) : arg_8 = random . choice ( arg_2 ) - 1 arg_9 = random . sample ( arg_4 , arg_8 ) arg_9 . insert ( arg_8 // 2 , random . choice ( arg_1 ) ) arg_6 . append ( arg_9 ) return arg_6

def Func(arg_0=10, arg_1 = [2,6], arg_2=[5,6,7], arg_3=100):
  """
  Generate a set of hub sequences. These are sequences which contain a hub
  element in the middle. The elements of the sequences will be integers
  from 0 to 'nCoinc'-1. The hub elements will only appear in the middle of
  each sequence. The length of each sequence will be randomly chosen from the
  'seqLength' list.

  Parameters:
  -----------------------------------------------
  nCoinc:        the number of elements available to use in the sequences
  hubs:          which of the elements will be used as hubs.
  seqLength:     a list of possible sequence lengths. The length of each
                        sequence will be randomly chosen from here.
  nSeq:          The number of sequences to generate

  retval:        a list of sequences. Each sequence is itself a list
                containing the coincidence indices for that sequence.
  """

  arg_4 = range(arg_0)
  for arg_5 in arg_1:
    arg_4.remove(arg_5)

  arg_6 = []
  for arg_7 in xrange(arg_3):
    arg_8 = random.choice(arg_2)-1
    arg_9 = random.sample(arg_4,arg_8)
    arg_9.insert(arg_8//2, random.choice(arg_1))
    arg_6.append(arg_9)

  return arg_6

Generate a set of hub sequences . These are sequences which contain a hub element in the middle . The elements of the sequences will be integers from 0 to nCoinc - 1 . The hub elements will only appear in the middle of each sequence . The length of each sequence will be randomly chosen from the seqLength list .


def
Func
(
arg_0
,
arg_1
)
:
if
isinstance
(
arg_1
,
bytes
)
:
arg_2
=
arg_0
.
prefix_bytes
+
arg_1
else
:
arg_2
=
tuples_as_bytes
(
arg_0
.
prefix
+
arg_1
)
debug
(
b'> '
+
arg_2
)
return
arg_2

def Func(arg_0, arg_1):
        """Prepare message to be sent.

        Parameters
        ----------
        commands : list of tuples or bytes string
            Commands as a list of tuples or a bytes string. cam.prefix is
            allways prepended before sending.

        Returns
        -------
        string
            Message to be sent.

        """
        if isinstance(arg_1, bytes):
            arg_2 = arg_0.prefix_bytes + arg_1
        else:
            arg_2 = tuples_as_bytes(arg_0.prefix + arg_1)
        debug(b'> ' + arg_2)
        return arg_2


(script, sidedim=0, textdim=1024, border=2, method=1)

def Func(arg_0, arg_1=0, arg_2=1024, arg_3=2, arg_4=1):
    """Trivial Per-Triangle parameterization

    """
    arg_5 = ''.join([
        '  <filter name="Parametrization: Trivial Per-Triangle ">\n',
        '    <Param name="sidedim"',
        'value="%d"' % arg_1,
        'description="Quads per line"',
        'type="RichInt"',
        'tooltip="Indicates how many triangles have to be put on each line (every quad contains two triangles). Leave 0 for automatic calculation"',
        '/>\n',
        '    <Param name="textdim"',
        'value="%d"' % arg_2,
        'description="Texture Dimension (px)"',
        'type="RichInt"',
        'tooltip="Gives an indication on how big the texture is"',
        '/>\n',
        '    <Param name="border"',
        'value="%d"' % arg_3,
        'description="Inter-Triangle border (px)"',
        'type="RichInt"',
        'tooltip="Specifies how many pixels to be left between triangles in parametrization domain"',
        '/>\n',
        '    <Param name="method"',
        'value="%d"' % arg_4,
        'description="Method"',
        'enum_val0="Basic"',
        'enum_val1="Space-optimizing"',
        'enum_cardinality="2"',
        'type="RichEnum"',
        'tooltip="Choose space optimizing to map smaller faces into smaller triangles in parametrizazion domain"'
        '/>\n',
        '  </filter>\n'])
    util.write_filter(arg_0, arg_5)
    return None


def Func ( arg_0 , arg_1 ) : arg_1 . endlexpos = arg_1 . lexpos + len ( arg_1 . value ) return arg_1

def Func(arg_0, arg_1):
        r"\<"
        arg_1.endlexpos = arg_1.lexpos + len(arg_1.value)
        return arg_1


return (
            Regex(element, cls.regex_replace, replace_with="@funilrys")
            .replace()
            .replace("@funilrys", "")
        )

def Func ( arg_0 , arg_1 ) : return ( Regex ( arg_1 , arg_0 . regex_replace , replace_with = "@funilrys" ) . replace ( ) . replace ( "@funilrys" , "" ) )

def Func(arg_0, arg_1):
        """
        Implement the Func and alphabetical sorting.

        :param element: The element we are currently reading.
        :type element: str

        :return: The formatted element.
        :rtype: str
        """

        # We remove all special characters and return the formatted string.
        return (
            Regex(arg_1, arg_0.regex_replace, replace_with="@funilrys")
            .replace()
            .replace("@funilrys", "")
        )

Implement the standard and alphabetical sorting.

        :param element: The element we are currently reading.
        :type element: str

        :return: The formatted element.
        :rtype: str

Implement the standard and alphabetical sorting .


def
Func
(
arg_0
)
:
if
not
arg_0
.
bucket_dry
:
return
arg_1
=
set
(
arg_0
.
meaningful
+
arg_0
.
common
)
for
arg_2
in
_extract_manytomany_relations
(
arg_1
)
:
arg_0
.
add_to_bucket
(
[
t
.
db_key
for
t
in
arg_2
]
)
if
arg_0
.
bucket_overflow
:
break
else
:
arg_0
.
debug
(
'No relation extrapolated.'
)

def Func(arg_0):
    """Try to extract the bigger group of interlinked tokens.

    Should generally be used at last in the collectors chain.
    """
    if not arg_0.bucket_dry:
        return  # No need.
    arg_1 = set(arg_0.meaningful + arg_0.common)
    for arg_2 in _extract_manytomany_relations(arg_1):
        arg_0.add_to_bucket([t.db_key for t in arg_2])
        if arg_0.bucket_overflow:
            break
    else:
        arg_0.debug('No relation extrapolated.')

Try to extract the bigger group of interlinked tokens .


def Func():
    """Something in the VM chain, either VirtualBox or Machine, helpfully
    sets up localhost-to-VM forwarding on port 22. We can inspect this
    rule to determine the port on localhost which gets forwarded to
    22 in the VM."""
    for arg_0 in _get_vm_config():
        if arg_0.startswith('Forwarding'):
            arg_1 = arg_0.split('=')[1].strip('"')
            arg_2, arg_3, arg_4, arg_5, arg_6, arg_7 = arg_1.split(',')
            if arg_2 == 'ssh' and arg_3 == 'tcp' and arg_7 == '22':
                return arg_5
    raise ValueError('Could not determine localhost port for SSH forwarding')

Something in the VM chain either VirtualBox or Machine helpfully sets up localhost - to - VM forwarding on port 22 . We can inspect this rule to determine the port on localhost which gets forwarded to 22 in the VM .


(manager: pybel.Manager, annotation_url: Optional[str] = None)

def Func(arg_0: arg_1.Manager, arg_3: arg_4[arg_5] = None) -> None:
    """Build a database of scores for NeuroMMSig annotated graphs.

    1. Get all networks that use the Subgraph annotation
    2. run on each
    """
    arg_3 = arg_3 or NEUROMMSIG_DEFAULT_URL

    arg_6 = arg_0.get_namespace_by_url(arg_3)

    if arg_6 is None:
        raise RuntimeError('no graphs in database with given annotation')

    arg_7 = get_networks_using_annotation(arg_0, arg_6)

    arg_8 = ...

    for arg_9 in arg_7:
        arg_10 = arg_9.as_bel()

        arg_11 = epicom_on_graph(arg_10, arg_8)

        for (arg_12, arg_13), arg_14 in arg_11.items():
            arg_15 = get_drug_model(arg_0, arg_12)
            arg_16 = arg_0.get_annotation_entry(arg_3, arg_13)

            arg_17 = Score(
                arg_9=arg_9,
                arg_6=arg_16,
                drug=arg_15,
                arg_14=arg_14
            )

            arg_0.session.add(arg_17)

    arg_18 = time.time()
    logger.info('committing scores')
    arg_0.session.commit()
    logger.info('committed scores in %.2f seconds', time.time() - arg_18)

Build a database of scores for NeuroMMSig annotated graphs .


def Func ( arg_0 , ** arg_1 ) : return arg_0 . _mc_client . _Func ( url = arg_0 . _build_path ( ) , ** arg_1 )

def Func(arg_0, **arg_1):
        """
        Get links to all other resources available in the API.

        :param queryparams: The query string parameters
        queryparams['fields'] = []
        queryparams['exclude_fields'] = []
        """
        return arg_0._mc_client._Func(url=arg_0._build_path(), **arg_1)

Get links to all other resources available in the API .


return ''.join([stat_type(mode), triple(root), triple(group), triple(user)])

def Func ( arg_0 ) : arg_1 = arg_0 . st_mode arg_2 = ( arg_1 & 0o700 ) >> 6 arg_3 = ( arg_1 & 0o070 ) >> 3 arg_4 = ( arg_1 & 0o7 ) def stat_type ( arg_5 ) : if stat . S_ISDIR ( arg_5 ) : return 'd' elif stat . S_ISSOCK ( arg_5 ) : return 's' else : return '-' def triple ( arg_5 ) : return '%c%c%c' % ( 'r' if arg_5 & 0b100 else '-' , 'w' if arg_5 & 0b010 else '-' , 'x' if arg_5 & 0b001 else '-' ) return '' . join ( [ stat_type ( arg_1 ) , triple ( arg_2 ) , triple ( arg_3 ) , triple ( arg_4 ) ] )

def Func(arg_0):
  """
  Format a line in the directory list based on the file's type and other attributes.
  """
  arg_1 = arg_0.st_mode

  arg_2 = (arg_1 & 0o700) >> 6
  arg_3 = (arg_1 & 0o070) >> 3
  arg_4 = (arg_1 & 0o7)

  def stat_type(arg_5):
    ''' stat type'''
    if stat.S_ISDIR(arg_5):
      return 'd'
    elif stat.S_ISSOCK(arg_5):
      return 's'
    else:
      return '-'

  def triple(arg_5):
    ''' triple '''
    return '%c%c%c' % (
        'r' if arg_5 & 0b100 else '-',
        'w' if arg_5 & 0b010 else '-',
        'x' if arg_5 & 0b001 else '-')

  return ''.join([stat_type(arg_1), triple(arg_2), triple(arg_3), triple(arg_4)])

Format a line in the directory list based on the file s type and other attributes .


def
Func
(
)
:
if
len
(
sys
.
argv
)
>
1
:
arg_0
=
sys
.
argv
[
1
]
arg_1
=
DocMapper
(
)
if
arg_1
.
is_pipe
:
arg_2
=
0
for
arg_3
in
arg_1
.
get_pipe
(
)
:
arg_3
.
Func
(
arg_0
)
arg_3
.
update
(
tags
=
arg_3
.
tags
)
arg_2
+=
1
print_success
(
"Added tag '{}' to {} object(s)"
.
format
(
arg_0
,
arg_2
)
)
else
:
print_error
(
"Please use this script with pipes"
)
else
:
print_error
(
"Usage: jk-add-tag <tag>"
)
sys
.
exit
(
)

def Func():
    """
        Obtains the data from the pipe and appends the given tag.
    """
    if len(sys.argv) > 1:
        arg_0 = sys.argv[1]
        arg_1 = DocMapper()
        if arg_1.is_pipe:
            arg_2 = 0
            for arg_3 in arg_1.get_pipe():
                arg_3.Func(arg_0)
                arg_3.update(tags=arg_3.tags)
                arg_2 += 1
            print_success("Added tag '{}' to {} object(s)".format(arg_0, arg_2))
        else:
            print_error("Please use this script with pipes")
    else:
        print_error("Usage: jk-add-tag <tag>")
        sys.exit()

Obtains the data from the pipe and appends the given tag .


def Func(arg_0):
    """Configures the pool and keeps the storage service"""
    arg_1.storage_service = arg_0['storage_service']
    _configure_niceness(arg_0)
    _configure_logging(arg_0, extract=False)


def Func ( arg_0 , arg_1 , arg_2 ) : arg_1 . pair = ( arg_0 . value ( arg_2 ) . strip ( '"' ) , str ) return True

def Func(arg_0, arg_1, arg_2):
    """Parse a str in parameter list"""
    arg_1.pair = (arg_0.value(arg_2).strip('"'), str)
    return True


def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
)
:
arg_0
.
store_id
=
arg_1
arg_0
.
product_id
=
arg_2
if
'id'
not
in
arg_3
:
raise
KeyError
(
'The product image must have an id'
)
if
'title'
not
in
arg_3
:
raise
KeyError
(
'The product image must have a url'
)
arg_4
=
arg_0
.
_mc_client
.
_post
(
url
=
arg_0
.
_build_path
(
arg_1
,
'products'
,
arg_2
,
'images'
)
,
arg_3
=
arg_3
)
if
arg_4
is
not
:
arg_0
.
image_id
=
arg_4
[
'id'
]
else
:
arg_0
.
image_id
=
return
arg_4

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Add a new image to the product.

        :param store_id: The store id.
        :type store_id: :py:class:`str`
        :param product_id: The id for the product of a store.
        :type product_id: :py:class:`str`
        :param data: The request body parameters
        :type data: :py:class:`dict`
        data = {
            "id": string*,
            "url": string*
        }
        """
        arg_0.store_id = arg_1
        arg_0.product_id = arg_2
        if 'id' not in arg_3:
            raise KeyError('The product image must have an id')
        if 'title' not in arg_3:
            raise KeyError('The product image must have a url')
        arg_4 = arg_0._mc_client._post(url=arg_0._build_path(arg_1, 'products', arg_2, 'images'), arg_3=arg_3)
        if arg_4 is not None:
            arg_0.image_id = arg_4['id']
        else:
            arg_0.image_id = None
        return arg_4


def Func ( arg_0 , arg_1 , arg_2 ) : try : arg_3 = arg_2 [ 'params' ] if isinstance ( arg_3 , dict ) : arg_4 = arg_1 ( ** arg_3 ) else : arg_4 = arg_1 ( * arg_3 ) except Exception as error : server_error ( arg_2 [ 'id' ] , error ) else : return arg_4

def Func(arg_0, arg_1, arg_2):
        """Apply application method."""

        try:
            arg_3 = arg_2['params']
            if isinstance(arg_3, dict):
                arg_4 = arg_1(**arg_3)
            else:
                arg_4 = arg_1(*arg_3)
        except Exception as error:
            server_error(arg_2['id'], error)
        else:
            return arg_4


def Func ( arg_0 , arg_1 , arg_2 = False ) : if not arg_0 . _file_mode : sys . stdout . write ( "\r" ) sys . stdout . write ( arg_1 ) if arg_2 and not isinstance ( arg_0 . _widget , _HiddenWidget ) : sys . stdout . write ( "\n" ) else : if not arg_0 . _file_mode : sys . stdout . write ( "\r" ) sys . stdout . flush ( )

def Func(arg_0, arg_1, arg_2=False):
        """Print the rendered string to the stdout."""
        if not arg_0._file_mode:
            # If the user presses Ctrl+C this ensures we still start writing from the beginning of the line
            sys.stdout.write("\r")
        sys.stdout.write(arg_1)
        if arg_2 and not isinstance(arg_0._widget, _HiddenWidget):
            sys.stdout.write("\n")
        else:
            if not arg_0._file_mode:
                sys.stdout.write("\r")
            sys.stdout.flush()

Print the rendered string to the stdout .


def Func(arg_0, arg_1='weight'):
    """Return the Pauli group with 4^n elements.

    The phases have been removed.
    case 'weight' is ordered by Pauli weights and
    case 'tensor' is ordered by I,X,Y,Z counting lowest qubit fastest.

    Args:
        number_of_qubits (int): number of qubits
        case (str): determines ordering of group elements ('weight' or 'tensor')

    Returns:
        list: list of Pauli objects

    Raises:
        QiskitError: case is not 'weight' or 'tensor'
        QiskitError: number_of_qubits is larger than 4
    """
    if arg_0 < 5:
        arg_2 = []

        if arg_1 == 'weight':
            arg_3 = Func(arg_0, arg_1='tensor')
            # sort on the weight of the Pauli operator
            return sorted(arg_3, key=lambda arg_6: -np.count_nonzero(
                np.array(arg_6.to_label(), 'c') == b'I'))
        elif arg_1 == 'tensor':
            # the Pauli set is in tensor order II IX IY IZ XI ...
            for arg_4 in range(4 ** arg_0):
                arg_5 = np.zeros(arg_0, dtype=np.bool)
                arg_6 = np.zeros(arg_0, dtype=np.bool)
                # looping over all the qubits
                for arg_7 in range(arg_0):
                    # making the Pauli for each j fill it in from the
                    # end first
                    arg_8 = (arg_4 // (4 ** arg_7)) % 4
                    if arg_8 == 1:
                        arg_6[arg_7] = True
                    elif arg_8 == 2:
                        arg_5[arg_7] = True
                        arg_6[arg_7] = True
                    elif arg_8 == 3:
                        arg_5[arg_7] = True
                arg_2.append(Pauli(arg_5, arg_6))
            return arg_2
        else:
            raise QiskitError("Only support 'weight' or 'tensor' cases "
                              "but you have {}.".format(arg_1))

    raise QiskitError("Only support number of qubits is less than 5")

Return the Pauli group with 4^n elements .


def Func ( arg_0 , arg_1 ) : arg_2 = dumps ( arg_0 ) arg_1 . write ( arg_2 ) arg_1 . write ( '\n\n' )

def Func(arg_0, arg_1):
        """
        dumps one element to file_obj, a file opened in write mode
        """
        arg_2 = dumps(arg_0)
        arg_1.write(arg_2)
        # record separator is a blank line
        # (since pickled_elt_str might contain its own newlines)
        arg_1.write('\n\n')

dumps one element to file_obj a file opened in write mode


def Func(arg_0, arg_1):
  """
  Translate an index into coordinates, using the given coordinate system.

  Similar to ``numpy.unravel_index``.

  :param index: (int) The index of the point. The coordinates are expressed as a
         single index by using the dimensions as a mixed radix definition. For
         example, in dimensions 42x10, the point [1, 4] is index
         1*420 + 4*10 = 460.

  :param dimensions (list of ints) The coordinate system.

  :returns: (list) of coordinates of length ``len(dimensions)``.
  """
  arg_2 = [0] * len(arg_1)

  arg_3 = arg_0
  for arg_4 in xrange(len(arg_1) - 1, 0, -1):
    arg_2[arg_4] = arg_3 % arg_1[arg_4]
    arg_3 = arg_3 / arg_1[arg_4]

  arg_2[0] = arg_3

  return arg_2

Translate an index into coordinates using the given coordinate system .


return [to_dict_no_content(fields, row) for row in rows]

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = _directory_default_fields ( ) arg_4 = arg_0 . execute ( select ( arg_3 , ) . where ( _is_in_directory ( directories , arg_1 , arg_2 ) , ) ) return [ to_dict_no_content ( arg_3 , arg_5 ) for arg_5 in arg_4 ]

def Func(arg_0, arg_1, arg_2):
    """
    Return subdirectories of a directory.
    """
    arg_3 = _directory_default_fields()
    arg_4 = arg_0.execute(
        select(
            arg_3,
        ).where(
            _is_in_directory(directories, arg_1, arg_2),
        )
    )
    return [to_dict_no_content(arg_3, arg_5) for arg_5 in arg_4]


def Func(arg_0):
    """ Monitor all processes in processes_to_monitor dict,
    restarting any if they fail, up to max_runs times.
    """
    # Now wait for any child to die
    Log.info("Start process monitor")
    while True:
      if len(arg_0.processes_to_monitor) > 0:
        (arg_1, arg_2) = os.wait()

        with arg_0.process_lock:
          if arg_1 in arg_0.processes_to_monitor.keys():
            arg_3 = arg_0.processes_to_monitor[arg_1]
            arg_4 = arg_3.name
            arg_5 = arg_3.command
            Log.info("%s (pid=%s) exited with status %d. command=%s" % (arg_4, arg_1, arg_2, arg_5))
            # Log the stdout & stderr of the failed process
            arg_0._wait_process_std_out_err(arg_4, arg_3.process)

            # Just make it world readable
            if os.path.isfile("core.%d" % arg_1):
              os.system("chmod a+r core.%d" % arg_1)
            if arg_3.attempts >= arg_0.max_runs:
              Log.info("%s exited too many times" % arg_4)
              sys.exit(1)
            time.sleep(arg_0.interval_between_runs)
            arg_6 = arg_0._run_process(arg_4, arg_5)
            del arg_0.processes_to_monitor[arg_1]
            arg_0.processes_to_monitor[arg_6.pid] =\
              ProcessInfo(arg_6, arg_4, arg_5, arg_3.attempts + 1)

            # Log down the pid file
            log_pid_for_process(arg_4, arg_6.pid)

Monitor all processes in processes_to_monitor dict restarting any if they fail up to max_runs times .


return ParseResult(
        scheme=uri.scheme,
        netloc=uri.netloc,
        path=uri.path,
        params=uri.params,
        query=normalized_query,
        fragment=uri.fragment).geturl()

def Func ( arg_0 ) : arg_1 = urlparse ( arg_0 ) arg_2 = arg_1 . query or "" arg_3 = parse_qsl ( arg_2 ) arg_4 = [ ( unquote ( key ) , value ) for key , value in arg_3 ] arg_5 = [ ( quote ( key ) , value ) for key , value in arg_4 ] arg_6 = urlencode ( arg_5 ) return ParseResult ( scheme = arg_1 . scheme , netloc = arg_1 . netloc , path = arg_1 . path , params = arg_1 . params , arg_2 = arg_6 , fragment = arg_1 . fragment ) . geturl ( )

def Func(arg_0):
    """
    Returns the given URL with all query keys properly escaped.

    Args:
        url (str): The URL to normalize.

    Returns:
        str: The normalized URL.
    """

    arg_1 = urlparse(arg_0)
    arg_2 = arg_1.query or ""

    arg_3 = parse_qsl(arg_2)
    arg_4 = [(unquote(key), value) for key, value in arg_3]
    arg_5 = [(quote(key), value) for key, value in arg_4]
    arg_6 = urlencode(arg_5)

    return ParseResult(
        scheme=arg_1.scheme,
        netloc=arg_1.netloc,
        path=arg_1.path,
        params=arg_1.params,
        arg_2=arg_6,
        fragment=arg_1.fragment).geturl()

Returns the given URL with all query keys properly escaped .


def Func ( arg_0 , arg_1 ) : try : arg_2 = arg_1 . pop ( 'user' ) arg_3 = arg_0 . slack . user_from_id ( arg_2 ) arg_1 [ u'user' ] = arg_3 [ 'name' ] except ( KeyError , IndexError , ValueError ) : pass try : if type ( arg_1 [ 'channel' ] ) == str : arg_4 = arg_1 . pop ( 'channel' ) else : arg_4 = arg_1 . pop ( 'channel' ) [ 'id' ] arg_0 . slack . reload_channels ( ) arg_5 = arg_0 . slack . channel_from_id ( arg_4 ) arg_1 [ u'channel' ] = arg_5 [ 'name' ] except ( KeyError , IndexError , ValueError ) : pass return arg_1

def Func(arg_0, arg_1):
        """
        Translate machine identifiers into human-readable
        """
        # Func user
        try:
            arg_2 = arg_1.pop('user')
            arg_3 = arg_0.slack.user_from_id(arg_2)
            arg_1[u'user'] = arg_3['name']
        except (KeyError, IndexError, ValueError):
            pass
        # Func channel
        try:
            if type(arg_1['channel']) == str:
                arg_4 = arg_1.pop('channel')
            else:
                arg_4 = arg_1.pop('channel')['id']
                arg_0.slack.reload_channels()
            arg_5 = arg_0.slack.channel_from_id(arg_4)
            arg_1[u'channel'] = arg_5['name']
        except (KeyError, IndexError, ValueError):
            pass
        return arg_1

Translate machine identifiers into human - readable


def Func(arg_0):
    """Grant superuser role to a user.

    Example:

    \b
    ```bash
    $ polyaxon superuser Func david
    ```
    """
    try:
        PolyaxonClient().user.Func_superuser(arg_0)
    except (PolyaxonHTTPError, PolyaxonShouldExitError, PolyaxonClientException) as e:
        Printer.print_error('Could not Func superuser role to user `{}`.'.format(arg_0))
        Printer.print_error('Error message `{}`.'.format(e))
        sys.exit(1)

    Printer.print_success(
        "Superuser role was Funced successfully to user `{}`.".format(arg_0))

Grant superuser role to a user.

    Example:

    \b
    ```bash
    $ polyaxon superuser grant david
    ```


def Func ( arg_0 ) : with open ( arg_0 , 'rb' ) as fd : arg_1 = yaml . load ( fd ) return arg_1 return False

def Func(arg_0):
    """Get data from .yml file
    """
    with open(arg_0, 'rb') as fd:
        arg_1 = yaml.load(fd)
        return arg_1
    return False


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = [ ] if arg_1 . detailed_list : arg_3 += [ "input_type" , "output_type" , "description" , "dependencies" , "conflicts" , "directives" ] if arg_1 . short_list : arg_3 += [ "description" ] if arg_3 : arg_4 = { } for arg_5 , arg_6 in arg_0 . items ( ) : arg_7 = arg_6 ( template = arg_5 ) if arg_2 : if arg_5 not in arg_2 : continue arg_8 = { arg_key : vars ( arg_7 ) [ arg_key ] for arg_key in vars ( arg_7 ) if arg_key in arg_3 } arg_4 [ arg_5 ] = arg_8 procs_dict_parser ( arg_4 ) sys . exit ( 0 )

def Func(arg_0, arg_1, arg_2):
    """
    Function that collects all processes available and stores a dictionary of
    the required arguments of each process class to be passed to
    procs_dict_parser

    Parameters
    ----------
    process_map: dict
        The dictionary with the Processes currently available in flowcraft
        and their corresponding classes as values
    args: argparse.Namespace
        The arguments passed through argparser that will be access to check the
        type of list to be printed
    pipeline_string: str
        the pipeline string

    """

    arg_3 = []

    # prints a detailed list of the process class arguments
    if arg_1.detailed_list:
        # list of attributes to be passed to Func
        arg_3 += [
            "input_type",
            "output_type",
            "description",
            "dependencies",
            "conflicts",
            "directives"
        ]

    # prints a short list with each process and the corresponding description
    if arg_1.short_list:
        arg_3 += [
            "description"
        ]

    if arg_3:
        # dict to store only the required entries
        arg_4 = {}
        # loops between all process_map Processes
        for arg_5, arg_6 in arg_0.items():

            # instantiates each Process class
            arg_7 = arg_6(template=arg_5)

            # checks if recipe is provided
            if arg_2:
                if arg_5 not in arg_2:
                    continue

            arg_8 = {arg_key: vars(arg_7)[arg_key] for arg_key in
                 vars(arg_7) if arg_key in arg_3}
            arg_4[arg_5] = arg_8

        procs_dict_parser(arg_4)

        sys.exit(0)


def Func ( arg_0 ) : arg_1 = re . compile ( arg_0 ) def checker ( arg_2 ) : arg_3 = arg_1 . match ( arg_2 ) if arg_3 is None : raise ValueError ( arg_2 ) return checker

def Func(arg_0):
    """
    Return a value check function which raises a ValueError if the value does
    not match the supplied regular expression, see also `re.match`.

    """

    arg_1 = re.compile(arg_0)
    def checker(arg_2):
        arg_3 = arg_1.match(arg_2)
        if arg_3 is None:
            raise ValueError(arg_2)
    return checker

Return a value check function which raises a ValueError if the value does not match the supplied regular expression see also re . match .


(bucket_name, src_path, dest_path,
             aws_access_key_id=None, aws_secret_access_key=None,
             aws_profile=None,
             surrogate_key=None, cache_control=None,
             surrogate_control=None,
             create_directory_redirect_object=True)

def Func(arg_0, arg_1, arg_2,
             arg_3=None, arg_4=None,
             arg_5=None,
             arg_6=None, arg_7=None,
             arg_8=None,
             arg_9=True):
    """Copy objects from one directory in a bucket to another directory in
    the same bucket.

    Object metadata is preserved while copying, with the following exceptions:

    - If a new surrogate key is provided it will replace the original one.
    - If ``cache_control`` and ``surrogate_control`` values are provided they
      will replace the old one.

    Parameters
    ----------
    bucket_name : `str`
        Name of an S3 bucket.
    src_path : `str`
        Source directory in the S3 bucket. The ``src_path`` should ideally end
        in a trailing `'/'`. E.g. `'dir/dir2/'`.
    dest_path : `str`
        Destination directory in the S3 bucket. The ``dest_path`` should
        ideally end in a trailing `'/'`. E.g. `'dir/dir2/'`. The destination
        path cannot contain the source path.
    aws_access_key_id : `str`
        The access key for your AWS account. Also set
        ``aws_secret_access_key``.
    aws_secret_access_key : `str`
        The secret key for your AWS account.
    aws_profile : `str`, optional
        Name of AWS profile in :file:`~/.aws/credentials`. Use this instead
        of ``aws_access_key_id`` and ``aws_secret_access_key`` for file-based
        credentials.
    surrogate_key : `str`, optional
        The surrogate key to insert in the header of all objects in the
        ``x-amz-meta-surrogate-key`` field. This key is used to purge
        builds from the Fastly CDN when Editions change.
        If `None` then no header will be set.
        If the object already has a ``x-amz-meta-surrogate-key`` header then
        it will be replaced.
    cache_control : `str`, optional
        This sets (and overrides) the ``Cache-Control`` header on the copied
        files. The ``Cache-Control`` header specifically dictates how content
        is cached by the browser (if ``surrogate_control`` is also set).
    surrogate_control : `str`, optional
        This sets (and overrides) the ``x-amz-meta-surrogate-control`` header
        on the copied files. The ``Surrogate-Control``
        or ``x-amz-meta-surrogate-control`` header is used in priority by
        Fastly to givern it's caching. This caching policy is *not* passed
        to the browser.
    create_directory_redirect_object : `bool`, optional
        Create a directory redirect object for the root directory. The
        directory redirect object is an empty S3 object named after the
        directory (without a trailing slash) that contains a
        ``x-amz-meta-dir-redirect=true`` HTTP header. LSST the Docs' Fastly
        VCL is configured to redirect requests for a directory path to the
        directory's ``index.html`` (known as *courtesy redirects*).

    Raises
    ------
    ltdconveyor.s3.S3Error
        Thrown by any unexpected faults from the S3 API.
    RuntimeError
        Thrown when the source and destination directories are the same.
    """
    if not arg_1.endswith('/'):
        arg_1 += '/'
    if not arg_2.endswith('/'):
        arg_2 += '/'

    # Ensure the src_path and dest_path don't contain each other
    arg_10 = os.path.commonprefix([arg_1, arg_2])
    if arg_10 == arg_1:
        arg_11 = 'Common prefix {0} is same as source dir {1}'.format(
            arg_10, arg_1)
        raise RuntimeError(arg_11)
    if arg_10 == arg_2:
        arg_11 = 'Common prefix {0} is same as dest dir {1}'.format(
            arg_10, arg_2)
        raise RuntimeError(arg_11)

    # Delete any existing objects in the destination
    delete_dir(arg_0, arg_2,
               arg_3, arg_4)

    arg_12 = boto3.session.Session(
        arg_3=arg_3,
        arg_4=arg_4,
        profile_name=arg_5)
    arg_13 = arg_12.resource('s3')
    arg_14 = arg_13.Bucket(arg_0)

    # Copy each object from source to destination
    for arg_15 in arg_14.objects.filter(Prefix=arg_1):
        arg_16 = os.path.relpath(arg_15.key, start=arg_1)
        arg_17 = os.path.join(arg_2, arg_16)

        # the src_obj (ObjectSummary) doesn't include headers afaik
        arg_18 = arg_13.meta.client.head_object(Bucket=arg_0,
                                          Key=arg_15.key)
        arg_19 = arg_18['Metadata']
        arg_20 = arg_18['ContentType']

        # try to use original Cache-Control header if new one is not set
        if arg_7 is None and 'CacheControl' in arg_18:
            arg_7 = arg_18['CacheControl']

        if arg_8 is not None:
            arg_19['surrogate-control'] = arg_8

        if arg_6 is not None:
            arg_19['surrogate-key'] = arg_6

        arg_13.meta.client.copy_object(
            Bucket=arg_0,
            Key=arg_17,
            CopySource={'Bucket': arg_0, 'Key': arg_15.key},
            MetadataDirective='REPLACE',
            Metadata=arg_19,
            ACL='public-read',
            CacheControl=arg_7,
            ContentType=arg_20)

    if arg_9:
        arg_21 = arg_2.rstrip('/')
        arg_22 = arg_14.Object(arg_21)
        arg_19 = {'dir-redirect': 'true'}
        arg_22.put(Body='',
                ACL='public-read',
                Metadata=arg_19,
                CacheControl=arg_7)

Copy objects from one directory in a bucket to another directory in the same bucket .


def Func ( arg_0 , * arg_1 , ** arg_2 ) : arg_3 = super ( RichTextWidget , arg_0 ) . Func ( * arg_1 , ** arg_2 ) if arg_3 is not None : arg_3 = arg_0 . get_sanitizer ( ) ( arg_3 ) return arg_3

def Func(arg_0, *arg_1, **arg_2):
        """
        Pass the submitted value through the sanitizer before returning it.
        """
        arg_3 = super(RichTextWidget, arg_0).Func(
            *arg_1, **arg_2)
        if arg_3 is not None:
            arg_3 = arg_0.get_sanitizer()(arg_3)
        return arg_3

Pass the submitted value through the sanitizer before returning it .


def Func ( arg_0 , arg_1 ) : arg_0 . nodes . remove ( arg_1 ) for arg_2 in xrange ( arg_0 . replicas ) : arg_3 = arg_0 . hash_method ( b ( "%s:%d" % ( arg_1 , arg_2 ) ) ) arg_0 . ring . pop ( arg_3 ) arg_0 . sorted_keys . remove ( arg_3 )

def Func(arg_0, arg_1):
        """Removes `node` from the hash ring and its replicas.
        """
        arg_0.nodes.remove(arg_1)
        for arg_2 in xrange(arg_0.replicas):
            arg_3 = arg_0.hash_method(b("%s:%d" % (arg_1, arg_2)))
            arg_0.ring.pop(arg_3)
            arg_0.sorted_keys.remove(arg_3)

Removes node from the hash ring and its replicas .


def Func(arg_0, arg_1, arg_2):
    '''Updates a rule and updates the ports'''
    LOG.info("Func for tenant %s" %
             (arg_0.tenant_id))
    arg_3 = arg_2["security_group_rule"]
    # Only allow updatable fields
    arg_3 = _filter_Func(arg_3)

    with arg_0.session.begin():
        arg_4 = db_api.security_group_rule_find(arg_0, arg_1=arg_1,
                                               scope=db_api.ONE)
        if not arg_4:
            raise sg_ext.SecurityGroupRuleNotFound(arg_1=arg_1)

        arg_5 = db_api.security_group_rule_update(arg_0, arg_4, **arg_3)

        arg_6 = arg_5.group_id
        arg_7 = db_api.security_group_find(arg_0, arg_1=arg_6,
                                           scope=db_api.ONE)
        if not arg_7:
            raise sg_ext.SecurityGroupNotFound(arg_1=arg_6)

    if arg_7:
        _perform_async_update_rule(arg_0, arg_6, arg_7, arg_4.id,
                                   RULE_UPDATE)

    return v._make_security_group_rule_dict(arg_5)


def Func ( arg_0 ) : arg_1 = arg_0 . arc_possibilities ( ) arg_2 = arg_0 . arcs_executed ( ) arg_3 = [ p for p in arg_1 if p not in arg_2 and p [ 0 ] not in arg_0 . no_branch ] return sorted ( arg_3 )

def Func(arg_0):
        """Returns a sorted list of the arcs in the code not executed."""
        arg_1 = arg_0.arc_possibilities()
        arg_2 = arg_0.arcs_executed()
        arg_3 = [
            p for p in arg_1
                if p not in arg_2
                    and p[0] not in arg_0.no_branch
            ]
        return sorted(arg_3)

Returns a sorted list of the arcs in the code not executed .


def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None ) : arg_4 = dict ( action = 'shorturl' , arg_1 = arg_1 , arg_2 = arg_2 , arg_3 = arg_3 ) arg_5 = arg_0 . _api_request ( params = arg_4 ) arg_1 = _json_to_Funced_url ( arg_5 [ 'url' ] , arg_5 [ 'shorturl' ] ) return arg_1

def Func(arg_0, arg_1, arg_2=None, arg_3=None):
        """Shorten URL with optional keyword and title.

        Parameters:
            url: URL to Func.
            keyword: Optionally choose keyword for short URL, otherwise automatic.
            title: Optionally choose title, otherwise taken from web page.

        Returns:
            ShortenedURL: Shortened URL and associated data.

        Raises:
            ~yourls.exceptions.YOURLSKeywordExistsError: The passed keyword
                already exists.

                .. note::

                    This exception has a ``keyword`` attribute.

            ~yourls.exceptions.YOURLSURLExistsError: The URL has already been
                Funced.

                .. note::

                    This exception has a ``url`` attribute, which is an instance
                    of :py:class:`ShortenedURL` for the existing short URL.

            ~yourls.exceptions.YOURLSNoURLError: URL missing.

            ~yourls.exceptions.YOURLSNoLoopError: Cannot Func a Funced URL.

            ~yourls.exceptions.YOURLSAPIError: Unhandled API error.

            ~yourls.exceptions.YOURLSHTTPError: HTTP error with response from
                YOURLS API.

            requests.exceptions.HTTPError: Generic HTTP error.
        """
        arg_4 = dict(action='shorturl', arg_1=arg_1, arg_2=arg_2, arg_3=arg_3)
        arg_5 = arg_0._api_request(params=arg_4)

        arg_1 = _json_to_Funced_url(arg_5['url'], arg_5['shorturl'])

        return arg_1

Shorten URL with optional keyword and title.

        Parameters:
            url: URL to shorten.
            keyword: Optionally choose keyword for short URL, otherwise automatic.
            title: Optionally choose title, otherwise taken from web page.

        Returns:
            ShortenedURL: Shortened URL and associated data.

        Raises:
            ~yourls.exceptions.YOURLSKeywordExistsError: The passed keyword
                already exists.

                .. note::

                    This exception has a ``keyword`` attribute.

            ~yourls.exceptions.YOURLSURLExistsError: The URL has already been
                shortened.

                .. note::

                    This exception has a ``url`` attribute, which is an instance
                    of :py:class:`ShortenedURL` for the existing short URL.

            ~yourls.exceptions.YOURLSNoURLError: URL missing.

            ~yourls.exceptions.YOURLSNoLoopError: Cannot shorten a shortened URL.

            ~yourls.exceptions.YOURLSAPIError: Unhandled API error.

            ~yourls.exceptions.YOURLSHTTPError: HTTP error with response from
                YOURLS API.

            requests.exceptions.HTTPError: Generic HTTP error.

Shorten URL with optional keyword and title .


(self, jid, name = None, groups = None,
                                callback = None, error_callback = None)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
,
arg_3
=
,
arg_4
=
,
arg_5
=
)
:
if
arg_1
in
arg_0
.
roster
:
raise
ValueError
(
"{0!r} already in the roster"
.
format
(
arg_1
)
)
arg_6
=
RosterItem
(
arg_1
,
arg_2
,
arg_3
)
arg_0
.
_roster_set
(
arg_6
,
arg_4
,
arg_5
)

def Func(arg_0, arg_1, arg_2 = None, arg_3 = None,
                                arg_4 = None, arg_5 = None):
        """Add a contact to the roster.

        :Parameters:
            - `jid`: contact's jid
            - `name`: name for the contact
            - `groups`: sequence of group names the contact should belong to
            - `callback`: function to call when the request succeeds. It should
              accept a single argument - a `RosterItem` describing the
              requested change
            - `error_callback`: function to call when the request fails. It
              should accept a single argument - an error stanza received
              (`None` in case of timeout)
        :Types:
            - `jid`: `JID`
            - `name`: `unicode`
            - `groups`: sequence of `unicode`
        """
        # pylint: disable=R0913
        if arg_1 in arg_0.roster:
            raise ValueError("{0!r} already in the roster".format(arg_1))
        arg_6 = RosterItem(arg_1, arg_2, arg_3)
        arg_0._roster_set(arg_6, arg_4, arg_5)


def
Func
(
arg_0
,
arg_1
=
True
)
:
arg_2
=
arg_0
.
ids
arg_3
=
arg_0
.
direct_view
(
)
arg_4
=
arg_3
.
apply_sync
(
socket
.
gethostname
)
arg_5
=
defaultdict
(
list
)
for
arg_6
,
arg_7
in
zip
(
arg_4
,
arg_2
)
:
arg_5
[
arg_6
]
.
append
(
arg_7
)
arg_8
=
arg_5
.
keys
(
)
for
arg_9
in
arg_8
:
arg_10
=
arg_5
[
arg_9
]
arg_11
=
len
(
arg_10
)
if
len
(
arg_10
)
>=
4
:
arg_11
=
2
if
(
len
(
arg_10
)
==
4
)
and
(
len
(
arg_4
)
>=
4
)
:
arg_11
=
4
if
len
(
arg_10
)
>=
6
:
arg_11
=
3
if
len
(
arg_10
)
>=
8
:
arg_11
=
4
if
len
(
arg_10
)
>=
16
:
arg_11
=
4
arg_12
=
[
arg_10
[
i
:
i
+
arg_11
]
for
i
in
xrange
(
0
,
len
(
arg_10
)
,
arg_11
)
]
arg_13
=
len
(
arg_12
)
if
arg_13
>
1
:
arg_5
.
pop
(
arg_9
)
for
arg_14
in
range
(
arg_13
)
:
arg_5
[
arg_15
(
arg_9
)
+
"_"
+
arg_15
(
arg_14
)
]
=
arg_12
[
arg_14
]
LOGGER
.
info
(
"threaded_view: %s"
,
dict
(
arg_5
)
)
return
arg_5

def Func(arg_0, arg_1=True):
    """ gets optimum threaded view of ids given the host setup """
    ## engine ids
    ## e.g., [0, 1, 2, 3, 4, 5, 6, 7, 8]
    arg_2 = arg_0.ids

    ## get host names
    ## e.g., ['a', 'a', 'b', 'b', 'a', 'c', 'c', 'c', 'c']
    arg_3 = arg_0.direct_view()
    arg_4 = arg_3.apply_sync(socket.gethostname)

    ## group ids into a dict by their hostnames
    ## e.g., {a: [0, 1, 4], b: [2, 3], c: [5, 6, 7, 8]}
    arg_5 = defaultdict(list)
    for arg_6, arg_7 in zip(arg_4, arg_2):
        arg_5[arg_6].append(arg_7)

    ## Now split threads on the same host into separate proc if there are many
    arg_8 = arg_5.keys()
    for arg_9 in arg_8:
        arg_10 = arg_5[arg_9]
        arg_11 = len(arg_10)
        if len(arg_10) >= 4:
            arg_11 = 2
        ## if 4 nodes and 4 ppn, put one sample per host
        if (len(arg_10) == 4) and (len(arg_4) >= 4):
            arg_11 = 4
        if len(arg_10) >= 6:
            arg_11 = 3
        if len(arg_10) >= 8:
            arg_11 = 4
        if len(arg_10) >= 16:
            arg_11 = 4
        ## split ids into groups of maxt
        arg_12 = [arg_10[i:i+arg_11] for i in xrange(0, len(arg_10), arg_11)]
        arg_13 = len(arg_12)
        ## if anything was split (lth>1) update hostdict with new proc
        if arg_13 > 1:
            arg_5.pop(arg_9)
            for arg_14 in range(arg_13):
                arg_5[arg_15(arg_9)+"_"+arg_15(arg_14)] = arg_12[arg_14]

    ## make sure split numbering is correct
    #threaded = hostdict.values()
    #assert len(ipyclient.ids) <= len(list(itertools.chain(*threaded)))
    LOGGER.info("threaded_view: %s", dict(arg_5))
    return arg_5


def Func ( arg_0 , arg_1 = arg_2 ) : arg_3 = [ ] if isinstance ( arg_0 , CannedObject ) and arg_0 . buffers : for arg_4 , arg_5 in enumerate ( arg_0 . buffers ) : arg_6 = _nbytes ( arg_5 ) if arg_6 > arg_1 : arg_0 . buffers [ arg_4 ] = None arg_3 . append ( arg_5 ) elif isinstance ( arg_5 , memoryview ) : arg_0 . buffers [ arg_4 ] = arg_5 . tobytes ( ) elif isinstance ( arg_5 , buffer ) : arg_0 . buffers [ arg_4 ] = bytes ( arg_5 ) return arg_3

def Func(arg_0, arg_1=arg_2):
    """Extract buffers larger than a certain threshold."""
    arg_3 = []
    if isinstance(arg_0, CannedObject) and arg_0.buffers:
        for arg_4, arg_5 in enumerate(arg_0.buffers):
            arg_6 = _nbytes(arg_5)
            if arg_6 > arg_1:
                # buffer larger than threshold, prevent pickling
                arg_0.buffers[arg_4] = None
                arg_3.append(arg_5)
            # buffer too small for separate send, coerce to bytes
            # because pickling buffer objects just results in broken pointers
            elif isinstance(arg_5, memoryview):
                arg_0.buffers[arg_4] = arg_5.tobytes()
            elif isinstance(arg_5, buffer):
                arg_0.buffers[arg_4] = bytes(arg_5)
    return arg_3

Extract buffers larger than a certain threshold .


(grammar=None, num=1, output=sys.stdout, max_recursion=10, seed=None)

def Func ( arg_0 = None , arg_1 = 1 , arg_2 = arg_3 . stdout , arg_5 = 10 , arg_6 = None ) : if arg_6 is not None : gramfuzz . rand . seed ( arg_6 ) arg_7 = gramfuzz . GramFuzzer ( ) arg_7 . load_grammar ( arg_0 ) arg_8 = os . path . basename ( arg_0 ) . replace ( ".py" , "" ) arg_9 = arg_7 . gen ( arg_8 = arg_8 , arg_1 = arg_1 , arg_5 = arg_5 ) for arg_10 in arg_9 : arg_2 . write ( arg_10 )

def Func(arg_0=None, arg_1=1, arg_2=arg_3.stdout, arg_5=10, arg_6=None):
    """Load and Func ``num`` number of top-level rules from the specified grammar.

    :param list grammar: The grammar file to load and Func data from
    :param int num: The number of times to Func data
    :param output: The output destination (an open, writable stream-type object. default=``sys.stdout``)
    :param int max_recursion: The maximum reference-recursion when generating data (default=``10``)
    :param int seed: The seed to initialize the PRNG with. If None, will not initialize it.
    """
    if arg_6 is not None:
        gramfuzz.rand.seed(arg_6)

    arg_7 = gramfuzz.GramFuzzer()
    arg_7.load_grammar(arg_0)

    arg_8 = os.path.basename(arg_0).replace(".py", "")

    arg_9 = arg_7.gen(arg_8=arg_8, arg_1=arg_1, arg_5=arg_5)
    for arg_10 in arg_9:
        arg_2.write(arg_10)

Load and generate ``num`` number of top-level rules from the specified grammar.

    :param list grammar: The grammar file to load and generate data from
    :param int num: The number of times to generate data
    :param output: The output destination (an open, writable stream-type object. default=``sys.stdout``)
    :param int max_recursion: The maximum reference-recursion when generating data (default=``10``)
    :param int seed: The seed to initialize the PRNG with. If None, will not initialize it.

Load and generate num number of top - level rules from the specified grammar .


def Func(arg_0, arg_1):
    """Add a number of months to a date"""
    arg_2 = arg_1.month
    arg_3 = arg_2 + arg_0
    arg_4 = 0

    while arg_3 < 1:
        arg_3 += 12
        arg_4 -= 1

    while arg_3 > 12:
        arg_3 -= 12
        arg_4 += 1

    # month = timestamp.month
    arg_5 = arg_1.year + arg_4

    try:
        return datetime.date(arg_5, arg_3, arg_1.day)
    except ValueError:
        # This means that the day exceeds the last day of the month, i.e. it is 30th March, and we are finding the day
        # 1 month ago, and it is trying to return 30th February
        if arg_0 > 0:
            # We are adding, so use the first day of the next month
            arg_3 += 1
            if arg_3 > 12:
                arg_3 -= 12
                arg_5 += 1

            return datetime.datetime(arg_5, arg_3, 1)
        else:
            # We are subtracting - use the last day of the same month
            arg_6 = calendar.monthrange(arg_5, arg_3)[1]
            return datetime.datetime(arg_5, arg_3, arg_6)


(self, channel, img_size=300, skip_cache=False)

def Func(arg_0, arg_1, arg_2=300, arg_3=False):
        """Get the logo for a channel"""
        from bs4 import BeautifulSoup
        from wikipedia.exceptions import PageError
        import re
        import wikipedia
        wikipedia.set_lang('fr')

        if not arg_1:
            _LOGGER.error('Channel is not set. Could not retrieve image.')
            return

        # Check if the image is in cache
        if arg_1 in arg_0._cache_channel_img and not arg_3:
            arg_4 = arg_0._cache_channel_img[arg_1]
            _LOGGER.debug('Cache hit: %s -> %s', arg_1, arg_4)
            return arg_4

        arg_5 = arg_0.get_channel_info(arg_1)
        arg_6 = arg_5['wiki_page']
        if not arg_6:
            _LOGGER.debug('Wiki page is not set for channel %s', arg_1)
            return
        _LOGGER.debug('Query: %s', arg_6)
        # If there is a max image size defined use it.
        if 'max_img_size' in arg_5:
            if arg_2 > arg_5['max_img_size']:
                _LOGGER.info(
                    'Requested image size is bigger than the max, '
                    'setting it to %s', arg_5['max_img_size']
                )
                arg_2 = arg_5['max_img_size']
        try:
            arg_7 = wikipedia.page(arg_6)
            _LOGGER.debug('Wikipedia article title: %s', arg_7.title)
            arg_8 = BeautifulSoup(arg_7.html(), 'html.parser')
            arg_9 = arg_8.find_all('img')
            arg_10 = None
            for arg_11 in arg_9:
                if arg_11['alt'].startswith('Image illustrative'):
                    arg_10 = re.sub(r'\d+px', '{}px'.format(arg_2),
                                     arg_11['src'])
            arg_4 = 'https:{}'.format(arg_10) if arg_10 else None
            # Cache result
            arg_0._cache_channel_img[arg_1] = arg_4
            return arg_4
        except PageError:
            _LOGGER.error('Could not fetch channel image for %s', arg_1)


(url: str, content_type: str, name: str = None, text: str = None, speak: str = None,
                    input_hint: Union[InputHints, str] = None)

return attachment_activity(AttachmentLayoutTypes.list, [attachment], text, speak, input_hint)

def Func(arg_0: arg_1, arg_2: arg_1, arg_3: arg_1 = None, arg_4: arg_1 = None, arg_5: arg_1 = None,
                    arg_6: arg_7[arg_8, arg_1] = None):
        """
        Returns a message that will display a single image or video to a user.

        :Example:
        message = MessageFactory.Func('https://example.com/hawaii.jpg', 'image/jpeg',
                                             'Hawaii Trip', 'A photo from our family vacation.')
        await context.send_activity(message)

        :param url:
        :param content_type:
        :param name:
        :param text:
        :param speak:
        :param input_hint:
        :return:
        """
        arg_9 = Attachment(arg_2=arg_2, Func=arg_0)
        if arg_3:
            arg_9.name = arg_3
        return attachment_activity(AttachmentLayoutTypes.list, [arg_9], arg_4, arg_5, arg_6)

Returns a message that will display a single image or video to a user.

        :Example:
        message = MessageFactory.content_url('https://example.com/hawaii.jpg', 'image/jpeg',
                                             'Hawaii Trip', 'A photo from our family vacation.')
        await context.send_activity(message)

        :param url:
        :param content_type:
        :param name:
        :param text:
        :param speak:
        :param input_hint:
        :return:

Returns a message that will display a single image or video to a user .


(src, tar, weights='exponential', max_length=8)

return Eudex().dist(src, tar, weights, max_length)

def Func ( arg_0 , arg_1 , arg_2 = 'exponential' , arg_3 = 8 ) : return Eudex ( ) . dist ( arg_0 , arg_1 , arg_2 , arg_3 )

def Func(arg_0, arg_1, arg_2='exponential', arg_3=8):
    """Return normalized Hamming distance between Eudex hashes of two terms.

    This is a wrapper for :py:meth:`Eudex.dist`.

    Parameters
    ----------
    src : str
        Source string for comparison
    tar : str
        Target string for comparison
    weights : str, iterable, or generator function
        The weights or weights generator function
    max_length : int
        The number of characters to encode as a eudex hash

    Returns
    -------
    int
        The normalized Eudex Hamming distance

    Examples
    --------
    >>> round(Func('cat', 'hat'), 12)
    0.062745098039
    >>> round(Func('Niall', 'Neil'), 12)
    0.000980392157
    >>> round(Func('Colin', 'Cuilen'), 12)
    0.004901960784
    >>> round(Func('ATCG', 'TAGC'), 12)
    0.197549019608

    """
    return Eudex().dist(arg_0, arg_1, arg_2, arg_3)

Return normalized Hamming distance between Eudex hashes of two terms.

    This is a wrapper for :py:meth:`Eudex.dist`.

    Parameters
    ----------
    src : str
        Source string for comparison
    tar : str
        Target string for comparison
    weights : str, iterable, or generator function
        The weights or weights generator function
    max_length : int
        The number of characters to encode as a eudex hash

    Returns
    -------
    int
        The normalized Eudex Hamming distance

    Examples
    --------
    >>> round(dist_eudex('cat', 'hat'), 12)
    0.062745098039
    >>> round(dist_eudex('Niall', 'Neil'), 12)
    0.000980392157
    >>> round(dist_eudex('Colin', 'Cuilen'), 12)
    0.004901960784
    >>> round(dist_eudex('ATCG', 'TAGC'), 12)
    0.197549019608

Return normalized Hamming distance between Eudex hashes of two terms .


def Func():
    """
    Creates .rollbar log file for use with rollbar-agent
    """
    arg_0 = SETTINGS['agent.log_file']
    if not arg_0.endswith('.rollbar'):
        log.error("Provided agent log file does not end with .rollbar, which it must. "
                  "Using default instead.")
        arg_0 = DEFAULTS['agent.log_file']

    arg_1 = logging.getLogger('rollbar_agent')
    arg_2 = logging.FileHandler(arg_0, 'a', 'utf-8')
    arg_3 = logging.Formatter('%(message)s')
    arg_2.setFormatter(arg_3)
    arg_1.addHandler(arg_2)
    arg_1.setLevel(logging.WARNING)
    return arg_1

Creates . rollbar log file for use with rollbar - agent


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
[
]
arg_2
.
append
(
arg_0
.
menu_panels_common
[
'Overview'
]
)
arg_3
=
arg_0
.
__get_menu_entries
(
arg_1
)
arg_4
=
arg_5
=
arg_6
=
[
pos
for
pos
,
menu
in
enumerate
(
arg_3
)
if
menu
[
'name'
]
==
KAFKA_NAME
]
if
arg_6
:
arg_4
=
arg_3
.
pop
(
arg_6
[
0
]
)
arg_7
=
[
pos
for
pos
,
menu
in
enumerate
(
arg_3
)
if
menu
[
'name'
]
==
COMMUNITY_NAME
]
if
arg_7
:
arg_5
=
arg_3
.
pop
(
arg_7
[
0
]
)
arg_3
.
sort
(
key
=
operator
.
itemgetter
(
'name'
)
)
arg_2
+=
arg_3
if
arg_4
:
arg_2
.
append
(
arg_4
)
if
arg_5
:
arg_2
.
append
(
arg_5
)
arg_2
.
append
(
arg_0
.
menu_panels_common
[
'Data Status'
]
)
arg_2
.
append
(
arg_0
.
menu_panels_common
[
'About'
]
)
logger
.
debug
(
"Menu for panels: %s"
,
json
.
dumps
(
arg_3
,
indent
=
4
)
)
return
arg_2

def Func(arg_0, arg_1):
        """Order the dashboard menu"""

        # omenu = OrderedDict()
        arg_2 = []
        # Start with Overview
        arg_2.append(arg_0.menu_panels_common['Overview'])

        # Now the data _getsources
        arg_3 = arg_0.__get_menu_entries(arg_1)

        # Remove the kafka and community menus, they will be included at the end
        arg_4 = None
        arg_5 = None

        arg_6 = [pos for pos, menu in enumerate(arg_3) if menu['name'] == KAFKA_NAME]
        if arg_6:
            arg_4 = arg_3.pop(arg_6[0])

        arg_7 = [pos for pos, menu in enumerate(arg_3) if menu['name'] == COMMUNITY_NAME]
        if arg_7:
            arg_5 = arg_3.pop(arg_7[0])

        arg_3.sort(key=operator.itemgetter('name'))
        arg_2 += arg_3

        # If kafka and community are present add them before the Data Status and About
        if arg_4:
            arg_2.append(arg_4)

        if arg_5:
            arg_2.append(arg_5)

        # At the end Data Status, About
        arg_2.append(arg_0.menu_panels_common['Data Status'])
        arg_2.append(arg_0.menu_panels_common['About'])

        logger.debug("Menu for panels: %s", json.dumps(arg_3, indent=4))
        return arg_2


return self.request("join", params=params, method="post").json()

def Func ( arg_0 , arg_1 ) : arg_2 = { "address" : arg_1 } return arg_0 . request ( "join" , arg_2 = arg_2 , method = "post" ) . json ( )

def Func(arg_0, arg_1):
        """Initiate a join between the agent and target peers.

           https://www.nomadproject.io/docs/http/agent-join.html

            returns: dict
            raises:
              - nomad.api.exceptions.BaseNomadException
              - nomad.api.exceptions.URLNotFoundNomadException
        """
        arg_2 = {"address": arg_1}
        return arg_0.request("join", arg_2=arg_2, method="post").json()

Initiate a join between the agent and target peers .


(ctx, app_id, sentence_file,
             json_flag, sentence, output_type, request_id)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 , arg_6 ) : arg_1 = clean_app_id ( arg_1 ) arg_4 = clean_sentence ( arg_4 , arg_2 ) arg_7 = GoolabsAPI ( arg_1 ) arg_8 = arg_7 . Func ( arg_4 = arg_4 , arg_5 = arg_5 , arg_6 = arg_6 ) if arg_3 : click . echo ( format_json ( arg_7 . response . json ( ) ) ) return click . echo ( arg_8 [ 'converted' ] )

def Func(arg_0, arg_1, arg_2,
             arg_3, arg_4, arg_5, arg_6):
    # type: (Context, unicode, Optional[IO], bool, unicode, unicode, unicode) -> None # NOQA
    """ Convert the Japanese to Hiragana or Katakana. """

    arg_1 = clean_app_id(arg_1)
    arg_4 = clean_sentence(arg_4, arg_2)

    arg_7 = GoolabsAPI(arg_1)
    arg_8 = arg_7.Func(
        arg_4=arg_4,
        arg_5=arg_5,
        arg_6=arg_6
    )

    if arg_3:
        click.echo(format_json(arg_7.response.json()))
        return

    click.echo(arg_8['converted'])

Convert the Japanese to Hiragana or Katakana .


return self.request("token", id, json=token, method="post").json()

def Func ( arg_0 , arg_1 , arg_2 ) : return arg_0 . request ( "token" , arg_1 , json = arg_2 , method = "post" ) . json ( )

def Func(arg_0, arg_1, arg_2):
        """ Update token.

            https://www.nomadproject.io/api/acl-tokens.html

            arguments:
                - AccdesorID
                - token
            returns: dict

            raises:
              - nomad.api.exceptions.BaseNomadException
              - nomad.api.exceptions.URLNotFoundNomadException
        """
        return arg_0.request("token", arg_1, json=arg_2, method="post").json()


return self.__class__(self.mol, newvalues, newdescs)

def Func ( arg_0 ) : arg_1 = [ ] arg_2 = [ ] for arg_3 , arg_4 in arg_0 . items ( ) : if not is_missing ( arg_4 ) : arg_1 . append ( arg_4 ) arg_2 . append ( arg_3 ) return arg_0 . __class__ ( arg_0 . mol , arg_1 , arg_2 )

def Func(arg_0):
        r"""Delete missing value.

        Returns:
            Result

        """
        arg_1 = []
        arg_2 = []
        for arg_3, arg_4 in arg_0.items():
            if not is_missing(arg_4):
                arg_1.append(arg_4)
                arg_2.append(arg_3)

        return arg_0.__class__(arg_0.mol, arg_1, arg_2)


return self.driver_adapter.find_elements(strategy, locator, root=self.root)

def Func ( arg_0 , arg_1 , arg_2 ) : return arg_0 . driver_adapter . Func ( arg_1 , arg_2 , root = arg_0 . root )

def Func(arg_0, arg_1, arg_2):
        """Finds elements on the page.

        :param strategy: Location strategy to use. See :py:class:`~selenium.webdriver.common.by.By` or :py:attr:`~pypom.splinter_driver.ALLOWED_STRATEGIES`.
        :param locator: Location of target elements.
        :type strategy: str
        :type locator: str
        :return: List of :py:class:`~selenium.webdriver.remote.webelement.WebElement` or :py:class:`~splinter.element_list.ElementList`
        :rtype: list

        """
        return arg_0.driver_adapter.Func(arg_1, arg_2, root=arg_0.root)