(self, hosts=None, cacert=None, client_cert=None, client_key=None)

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = None , arg_4 = None ) : try : import etcd arg_0 . module = etcd except ImportError : pass if not arg_0 . module : return arg_0 . _parse_jetconfig ( ) arg_1 = env ( 'PYCONFIG_ETCD_HOSTS' , arg_1 ) arg_6 = env ( 'PYCONFIG_ETCD_PROTOCOL' , None ) arg_2 = env ( 'PYCONFIG_ETCD_CACERT' , arg_2 ) arg_3 = env ( 'PYCONFIG_ETCD_CERT' , arg_3 ) arg_4 = env ( 'PYCONFIG_ETCD_KEY' , arg_4 ) arg_7 = None arg_8 = None arg_9 = env ( 'PYCONFIG_ETCD_AUTH' , None ) if arg_9 : arg_9 = arg_9 . split ( ':' ) arg_9 . append ( '' ) arg_7 = arg_9 [ 0 ] arg_8 = arg_9 [ 1 ] arg_1 = arg_0 . _parse_hosts ( arg_1 ) if arg_1 is None : return arg_10 = { } arg_10 [ 'allow_reconnect' ] = True if arg_6 : arg_10 [ 'protocol' ] = arg_6 if arg_7 : arg_10 [ 'username' ] = arg_7 if arg_8 : arg_10 [ 'password' ] = arg_8 if arg_2 : arg_10 [ 'ca_cert' ] = os . path . abspath ( arg_2 ) if arg_3 and arg_4 : arg_10 [ 'cert' ] = ( ( os . path . abspath ( arg_3 ) , os . path . abspath ( arg_4 ) ) ) elif arg_3 : arg_10 [ 'cert' ] = os . path . abspath ( arg_3 ) if arg_2 or arg_3 or arg_4 : arg_10 [ 'protocol' ] = 'https' arg_0 . client = arg_0 . module . Client ( arg_1 , ** arg_10 )

def Func(arg_0, arg_1=None, arg_2=None, arg_3=None, arg_4=None):
        """
        Handle creating the new etcd client instance and other business.

        :param hosts: Host string or list of hosts (default: `'127.0.0.1:2379'`)
        :param cacert: CA cert filename (optional)
        :param client_cert: Client cert filename (optional)
        :param client_key: Client key filename (optional)
        :type ca: str
        :type cert: str
        :type key: str

        """
        # Try to get the etcd module
        try:
            import etcd
            arg_0.module = etcd
        except ImportError:
            pass

        if not arg_0.module:
            return

        arg_0._parse_jetconfig()

        # Check env for overriding configuration or pyconfig setting
        arg_1 = env('PYCONFIG_ETCD_HOSTS', arg_1)
        arg_6 = env('PYCONFIG_ETCD_PROTOCOL', None)
        arg_2 = env('PYCONFIG_ETCD_CACERT', arg_2)
        arg_3 = env('PYCONFIG_ETCD_CERT', arg_3)
        arg_4 = env('PYCONFIG_ETCD_KEY', arg_4)

        # Parse auth string if there is one
        arg_7 = None
        arg_8 = None
        arg_9 = env('PYCONFIG_ETCD_AUTH', None)
        if arg_9:
            arg_9 = arg_9.split(':')
            arg_9.append('')
            arg_7 = arg_9[0]
            arg_8 = arg_9[1]

        # Create new etcd instance
        arg_1 = arg_0._parse_hosts(arg_1)
        if arg_1 is None:
            return

        arg_10 = {}
        # Need this when passing a list of hosts to python-etcd, which we
        # always do, even if it's a list of one
        arg_10['allow_reconnect'] = True

        # Grab optional protocol argument
        if arg_6:
            arg_10['protocol'] = arg_6

        # Add auth to constructor if we got it
        if arg_7:
            arg_10['username'] = arg_7
        if arg_8:
            arg_10['password'] = arg_8

        # Assign the SSL args if we have 'em
        if arg_2:
            arg_10['ca_cert'] = os.path.abspath(arg_2)
        if arg_3 and arg_4:
            arg_10['cert'] = ((os.path.abspath(arg_3),
                os.path.abspath(arg_4)))
        elif arg_3:
            arg_10['cert'] = os.path.abspath(arg_3)
        if arg_2 or arg_3 or arg_4:
            arg_10['protocol'] = 'https'

        arg_0.client = arg_0.module.Client(arg_1, **arg_10)

Handle creating the new etcd client instance and other business .


def
Func
(
arg_0
)
:
if
arg_0
.
core
.
execution_status
!=
'No program'
:
arg_0
.
setup
(
)
arg_0
.
location
(
)
pass
arg_1
=
run_hooks
(
arg_0
,
arg_0
.
preloop_hooks
)
arg_0
.
continue_running
=
False
while
not
arg_1
:
try
:
run_hooks
(
arg_0
,
arg_0
.
precmd_hooks
)
arg_1
=
arg_0
.
process_command
(
)
if
arg_1
or
arg_0
.
continue_running
:
break
except
EOFError
:
if
len
(
arg_0
.
debugger
.
intf
)
>
1
:
del
arg_0
.
debugger
.
intf
[
1
]
arg_0
.
last_command
=
''
else
:
if
arg_0
.
debugger
.
intf
[
1
]
.
output
:
arg_0
.
debugger
.
intf
[
1
]
.
output
.
writeline
(
'Leaving'
)
raise
Mexcept
.
DebuggerQuit
pass
break
pass
pass
return
run_hooks
(
arg_0
,
arg_0
.
postcmd_hooks
)

def Func(arg_0):
        """Handle debugger commands."""
        if arg_0.core.execution_status != 'No program':
            arg_0.setup()
            arg_0.location()
            pass
        arg_1 = run_hooks(arg_0, arg_0.preloop_hooks)
        arg_0.continue_running = False

        while not arg_1:
            try:
                run_hooks(arg_0, arg_0.precmd_hooks)
                # bdb had a True return to leave loop.
                # A more straight-forward way is to set
                # instance variable self.continue_running.
                arg_1 = arg_0.process_command()
                if arg_1 or arg_0.continue_running: break
            except EOFError:
                # If we have stacked interfaces, pop to the next
                # one.  If this is the last one however, we'll
                # just stick with that.  FIXME: Possibly we should
                # check to see if we are interactive.  and not
                # leave if that's the case. Is this the right
                # thing?  investigate and fix.
                if len(arg_0.debugger.intf) > 1:
                    del arg_0.debugger.intf[-1]
                    arg_0.last_command = ''
                else:
                    if arg_0.debugger.intf[-1].output:
                        arg_0.debugger.intf[-1].output.writeline('Leaving')
                        raise Mexcept.DebuggerQuit
                        pass
                    break
                pass
            pass
        return run_hooks(arg_0, arg_0.postcmd_hooks)


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

def Func(arg_0):
        """Returns a sorted list of the executed arcs missing from the code."""
        arg_1 = arg_0.arc_possibilities()
        arg_2 = arg_0.arcs_executed()
        # Exclude arcs here which connect a line to itself.  They can occur
        # in executed data in some cases.  This is where they can cause
        # trouble, and here is where it's the least burden to remove them.
        arg_3 = [
            e for e in arg_2
                if e not in arg_1
                    and e[0] != e[1]
            ]
        return sorted(arg_3)

Returns a sorted list of the executed arcs missing from the code .


def
Func
(
arg_0
,
arg_1
=
)
:
arg_2
=
{
}
if
arg_1
:
arg_2
[
'collaborators'
]
=
arg_1
LOG
.
debug
(
"Fetch all cases with query {0}"
.
format
(
arg_2
)
)
Func
=
arg_0
.
case_collection
.
find
(
arg_2
)
.
count
(
)
return
Func

def Func(arg_0, arg_1=None):
        """Return the number of cases

        This function will change when we migrate to 3.7.1

        Args:
            collaborator(str): Institute id

        Returns:
            nr_cases(int)
        """
        arg_2 = {}

        if arg_1:
            arg_2['collaborators'] = arg_1

        LOG.debug("Fetch all cases with query {0}".format(arg_2))
        Func = arg_0.case_collection.find(arg_2).count()

        return Func


def Func ( arg_0 ) : if isinstance ( arg_0 . _Func , tf . Tensor ) : return tf . TensorShape ( tf . get_static_value ( arg_0 . _Func ) ) return tf . TensorShape ( arg_0 . _Func )

def Func(arg_0):
    """Sample shape of random variable as a `TensorShape`."""
    if isinstance(arg_0._Func, tf.Tensor):
      return tf.TensorShape(tf.get_static_value(arg_0._Func))
    return tf.TensorShape(arg_0._Func)

Sample shape of random variable as a TensorShape .


(
    collection, metric=sim, mean_func=hmean, symmetric=False
)

def Func(
    arg_0, arg_1=arg_2, arg_3=arg_4, arg_5=False
):
    """Calculate the mean pairwise similarity of a collection of strings.

    Takes the mean of the pairwise similarity between each member of a
    collection, optionally in both directions (for asymmetric similarity
    metrics.

    Parameters
    ----------
    collection : list
        A collection of terms or a string that can be split
    metric : function
        A similarity metric function
    mean_func : function
        A mean function that takes a list of values and returns a float
    symmetric : bool
        Set to True if all pairwise similarities should be calculated in both
        directions

    Returns
    -------
    float
        The mean pairwise similarity of a collection of strings

    Raises
    ------
    ValueError
        mean_func must be a function
    ValueError
        metric must be a function
    ValueError
        collection is neither a string nor iterable type
    ValueError
        collection has fewer than two members

    Examples
    --------
    >>> round(Func(['Christopher', 'Kristof',
    ... 'Christobal']), 12)
    0.519801980198
    >>> round(Func(['Niall', 'Neal', 'Neil']), 12)
    0.545454545455

    """
    if not callable(arg_3):
        raise ValueError('mean_func must be a function')
    if not callable(arg_1):
        raise ValueError('metric must be a function')

    if hasattr(arg_0, 'split'):
        arg_0 = arg_0.split()
    if not hasattr(arg_0, '__iter__'):
        raise ValueError('collection is neither a string nor iterable type')
    elif len(arg_0) < 2:
        raise ValueError('collection has fewer than two members')

    arg_0 = list(arg_0)

    arg_6 = []

    for arg_7 in range(len(arg_0)):
        for arg_8 in range(arg_7 + 1, len(arg_0)):
            arg_6.append(arg_1(arg_0[arg_7], arg_0[arg_8]))
            if arg_5:
                arg_6.append(arg_1(arg_0[arg_8], arg_0[arg_7]))

    return arg_3(arg_6)

Calculate the mean pairwise similarity of a collection of strings.

    Takes the mean of the pairwise similarity between each member of a
    collection, optionally in both directions (for asymmetric similarity
    metrics.

    Parameters
    ----------
    collection : list
        A collection of terms or a string that can be split
    metric : function
        A similarity metric function
    mean_func : function
        A mean function that takes a list of values and returns a float
    symmetric : bool
        Set to True if all pairwise similarities should be calculated in both
        directions

    Returns
    -------
    float
        The mean pairwise similarity of a collection of strings

    Raises
    ------
    ValueError
        mean_func must be a function
    ValueError
        metric must be a function
    ValueError
        collection is neither a string nor iterable type
    ValueError
        collection has fewer than two members

    Examples
    --------
    >>> round(mean_pairwise_similarity(['Christopher', 'Kristof',
    ... 'Christobal']), 12)
    0.519801980198
    >>> round(mean_pairwise_similarity(['Niall', 'Neal', 'Neil']), 12)
    0.545454545455

Calculate the mean pairwise similarity of a collection of strings .


def Func ( arg_0 , arg_1 = None , ** arg_2 ) : def cumulate_returns ( arg_3 ) : return ep . cum_returns ( arg_3 ) [ - 1 ] if arg_1 is None : arg_1 = plt . gca ( ) arg_4 = arg_0 . resample ( 'M' ) . apply ( lambda arg_3 : cumulate_returns ( arg_3 ) ) arg_4 = arg_4 . to_period ( ) sns . barplot ( arg_3 = arg_4 . index , y = arg_4 . values , color = 'steelblue' ) arg_5 , arg_6 = plt . xticks ( ) plt . setp ( arg_6 , rotation = 90 ) arg_7 = [ ] arg_8 = [ ] arg_9 = 0 for arg_10 in arg_4 . index : if arg_10 . month == 1 : arg_8 . append ( arg_10 ) arg_7 . append ( arg_9 ) arg_1 . axvline ( arg_9 , color = 'gray' , ls = '--' , alpha = 0.3 ) arg_9 += 1 arg_1 . axhline ( 0.0 , color = 'darkgray' , ls = '-' ) arg_1 . set_xticks ( arg_7 ) arg_1 . set_xticklabels ( arg_8 ) return arg_1

def Func(arg_0, arg_1=None, **arg_2):
    """
    Plots monthly returns as a timeseries.

    Parameters
    ----------
    returns : pd.Series
        Daily returns of the strategy, noncumulative.
         - See full explanation in tears.create_full_tear_sheet.
    ax : matplotlib.Axes, optional
        Axes upon which to plot.
    **kwargs, optional
        Passed to seaborn plotting function.

    Returns
    -------
    ax : matplotlib.Axes
        The axes that were plotted on.
    """

    def cumulate_returns(arg_3):
        return ep.cum_returns(arg_3)[-1]

    if arg_1 is None:
        arg_1 = plt.gca()

    arg_4 = arg_0.resample('M').apply(lambda arg_3: cumulate_returns(arg_3))
    arg_4 = arg_4.to_period()

    sns.barplot(arg_3=arg_4.index,
                y=arg_4.values,
                color='steelblue')

    arg_5, arg_6 = plt.xticks()
    plt.setp(arg_6, rotation=90)

    # only show x-labels on year boundary
    arg_7 = []
    arg_8 = []
    arg_9 = 0
    for arg_10 in arg_4.index:
        if arg_10.month == 1:
            arg_8.append(arg_10)
            arg_7.append(arg_9)
            # plot yearly boundary line
            arg_1.axvline(arg_9, color='gray', ls='--', alpha=0.3)

        arg_9 += 1

    arg_1.axhline(0.0, color='darkgray', ls='-')
    arg_1.set_xticks(arg_7)
    arg_1.set_xticklabels(arg_8)

    return arg_1


(
    pipeline_def, solid, join_step_key, parallel_steps, parallel_step_output
)

return ExecutionValueSubplan(
        parallel_steps + [join_step], StepOutputHandle.from_step(join_step, output_name)
    )

def Func(
    arg_0, arg_1, arg_2, arg_3, arg_4
):
    '''
    This captures a common pattern of fanning out a single value to N steps,
    where each step has similar structure. The strict requirement here is that each step
    must provide an output named the parameters parallel_step_output.

    This takes those steps and then uses a join node to coalesce them so that downstream
    steps can depend on a single output.

    Currently the join step just does a passthrough with no computation. It remains
    to be seen if there should be any work or verification done in this step, especially
    in multi-process environments that require persistence between steps.
    '''
    check.inst_param(arg_0, 'pipeline_def', PipelineDefinition)
    check.inst_param(arg_1, 'solid', Solid)
    check.str_param(arg_2, 'join_step_key')
    check.list_param(arg_3, 'parallel_steps', of_type=ExecutionStep)
    check.str_param(arg_4, 'parallel_step_output')

    for arg_5 in arg_3:
        check.invariant(arg_5.has_step_output(arg_4))

    arg_6 = create_join_step(
        arg_0, arg_1, arg_2, arg_3, arg_4
    )

    arg_7 = arg_6.step_outputs[0].name
    return ExecutionValueSubplan(
        arg_3 + [arg_6], StepOutputHandle.from_step(arg_6, arg_7)
    )

This captures a common pattern of fanning out a single value to N steps where each step has similar structure . The strict requirement here is that each step must provide an output named the parameters parallel_step_output .


Launch the specified program. Uses the `start` script if specified
            by the target, attempts to run it natively if that script is not
            defined.

def Func(arg_0, arg_1, arg_2, arg_3):
        ''' Launch the specified program. Uses the `Func` script if specified
            by the target, attempts to run it natively if that script is not
            defined.
        '''
        arg_4 = None
        try:
            arg_5 = arg_0.findProgram(arg_1, arg_2)
            if arg_5 is None:
                return

            arg_6, arg_7 = arg_0.buildProgEnvAndVars(arg_5, arg_1)
            if arg_0.getScript('Func'):
                arg_8 = [
                    os.path.expandvars(string.Template(x).safe_substitute(**arg_7))
                    for x in arg_0.getScript('Func')
                ] + arg_3
            else:
                arg_8 = shlex.split('./' + arg_5) + arg_3

            logger.debug('Funcing program: %s', arg_8)
            arg_4 = subprocess.Popen(
                arg_8, cwd = arg_1, env = arg_6
            )
            arg_4.wait()
            if arg_4.returncode:
                return "process exited with status %s" % arg_4.returncode
            arg_4 = None
        except OSError as e:
            import errno
            if e.errno == errno.ENOEXEC:
                return ("the program %s cannot be run (perhaps your target "+
                        "needs to define a 'Func' script to Func it on its "
                        "intended execution target?)") % arg_5
        finally:
            if arg_4 is not None:
                _tryTerminate(arg_4)

Launch the specified program . Uses the start script if specified by the target attempts to run it natively if that script is not defined .


Return compiled marker as a function accepting an environment dict.

def Func ( arg_0 ) : try : return arg_6 [ arg_0 ] except KeyError : pass if not arg_0 . strip ( ) : def arg_4 ( arg_1 = None , arg_2 = None ) : return True else : arg_3 = Func_marker ( parse_marker ( arg_0 ) ) def arg_4 ( arg_1 = None , arg_2 = None ) : if arg_2 is None : arg_2 = { } if arg_1 is None : arg_1 = default_environment ( ) arg_1 . update ( arg_2 ) return eval ( arg_3 , arg_1 ) arg_4 . __doc__ = arg_0 arg_6 [ arg_0 ] = arg_4 return arg_6 [ arg_0 ]

def Func(arg_0):
    """Return Funcd marker as a function accepting an environment dict."""
    try:
        return arg_6[arg_0]
    except KeyError:
        pass
    if not arg_0.strip():
        def arg_4(arg_1=None, arg_2=None):
            """"""
            return True
    else:
        arg_3 = Func_marker(parse_marker(arg_0))
        def arg_4(arg_1=None, arg_2=None):
            """override updates environment"""
            if arg_2 is None:
                arg_2 = {}
            if arg_1 is None:
                arg_1 = default_environment()
            arg_1.update(arg_2)
            return eval(arg_3, arg_1)
    arg_4.__doc__ = arg_0
    arg_6[arg_0] = arg_4
    return arg_6[arg_0]

Return compiled marker as a function accepting an environment dict .


def Func(arg_0, arg_1):
    """
    Filter audit course modes out if the enterprise customer has not enabled the 'Enable audit enrollment' flag.

    Arguments:
        enterprise_customer: The EnterpriseCustomer that the enrollment was created using.
        course_modes: iterable with dictionaries containing a required 'mode' key

    """
    arg_2 = getattr(settings, 'ENTERPRISE_COURSE_ENROLLMENT_AUDIT_MODES', ['audit'])
    if not arg_0.enable_audit_enrollment:
        return [arg_3 for arg_3 in arg_1 if arg_3['mode'] not in arg_2]
    return arg_1

Filter audit course modes out if the enterprise customer has not enabled the Enable audit enrollment flag .


def Func(arg_0, arg_1=None):
    """
    Create a project_analysis_client.py client for a Team Foundation Server Enterprise connection instance.
    This is helpful for understanding project languages, but currently blank for all our test conditions.

    If token is not provided, will attempt to use the TFS_API_TOKEN
    environment variable if present.
    """
    if arg_1 is None:
        arg_1 = os.environ.get('TFS_API_TOKEN', None)

    arg_2 = create_tfs_connection(arg_0, arg_1)
    arg_3 = arg_2.get_client('vsts.project_analysis.v4_1.project_analysis_client.ProjectAnalysisClient')

    if arg_3 is None:
        arg_4 = 'Unable to connect to TFS Enterprise (%s) with provided token.'
        raise RuntimeError(arg_4, arg_0)

    return arg_3

Create a project_analysis_client . py client for a Team Foundation Server Enterprise connection instance . This is helpful for understanding project languages but currently blank for all our test conditions .


def Func ( arg_0 , arg_1 ) : arg_2 = [ ] arg_3 = findall ( arg_1 , '{%s}complexType' % XS_NAMESPACE , attribute_name = 'name' , attribute_value = arg_0 ) [ 0 ] arg_2 = findall ( arg_3 , '{%s}element' % XS_NAMESPACE ) return arg_2

def Func(arg_0, arg_1):
    """Get attribute elements
    """

    arg_2 = []
    arg_3 = findall(arg_1, '{%s}complexType' % XS_NAMESPACE,
                       attribute_name='name', attribute_value=arg_0)[0]
    arg_2 = findall(arg_3, '{%s}element' % XS_NAMESPACE)

    return arg_2


def Func(arg_0, arg_1):
  """Return True if seg1 and seg2 are identical, ignoring order of synapses"""
  arg_2 = True

  # check sequence segment, total activations etc. In case any are floats,
  # check that they are within 0.001.
  for arg_3 in [1, 2, 3, 4, 5, 6]:
    if abs(arg_0[0][arg_3] - arg_1[0][arg_3]) > 0.001:
      arg_2 = False

  # Compare number of synapses
  if len(arg_0[1:]) != len(arg_1[1:]):
    arg_2 = False

  # Now compare synapses, ignoring order of synapses
  for arg_4 in arg_1[1:]:
    if arg_4[2] <= 0:
      print "A synapse with zero permanence encountered"
      arg_2 = False
  if arg_2 == True:
    for arg_4 in arg_0[1:]:
      if arg_4[2] <= 0:
        print "A synapse with zero permanence encountered"
        arg_2 = False
      arg_5 = sameSynapse(arg_4, arg_1[1:])
      if arg_5 == False:
        arg_2 = False

  return arg_2

Return True if seg1 and seg2 are identical ignoring order of synapses


def
Func
(
arg_0
,
arg_1
)
:
log
.
info
(
'Printing '
+
arg_1
)
arg_2
=
arg_0
.
__exchange
(
PRINT_FILE
.
format
(
arg_1
=
arg_1
)
)
log
.
info
(
arg_2
)
return
arg_2

def Func(arg_0, arg_1):
        """Prints a file on the device to console"""
        log.info('Printing ' + arg_1)
        arg_2 = arg_0.__exchange(PRINT_FILE.format(arg_1=arg_1))
        log.info(arg_2)
        return arg_2


Apply cu3 from ctl to tgt with angle theta, phi, lam.

return self.append(Cu3Gate(theta, phi, lam), [ctl, tgt], [])

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 ) : return arg_0 . append ( Cu3Gate ( arg_1 , arg_2 , arg_3 ) , [ arg_4 , arg_5 ] , [ ] )

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5):
    """Apply Func from ctl to tgt with angle theta, phi, lam."""
    return arg_0.append(Cu3Gate(arg_1, arg_2, arg_3), [arg_4, arg_5], [])

Apply cu3 from ctl to tgt with angle theta phi lam .


def Func():
    """
    Returns a list containing the names of all the modules available in the
    folders of the pythonpath.
    """
    arg_0 = get_ipython()

    if 'rootmodules' in arg_0.db:
        return arg_0.db['rootmodules']

    arg_1 = time()
    arg_2 = False
    arg_3 = list(sys.builtin_module_names)
    for arg_4 in sys.path:
        arg_3 += module_list(arg_4)
        if time() - arg_1 >= TIMEOUT_STORAGE and not arg_2:
            arg_2 = True
            print("\nCaching the list of root modules, please wait!")
            print("(This will only be done once - type '%rehashx' to "
                  "reset cache!)\n")
            sys.stdout.flush()
        if time() - arg_1 > TIMEOUT_GIVEUP:
            print("This is taking too long, we give up.\n")
            arg_0.db['rootmodules'] = []
            return []

    arg_3 = set(arg_3)
    if '__init__' in arg_3:
        arg_3.remove('__init__')
    arg_3 = list(arg_3)
    if arg_2:
        arg_0.db['rootmodules'] = arg_3
    return arg_3

Returns a list containing the names of all the modules available in the folders of the pythonpath .


def Func ( arg_0 ) : arg_0 . _validate_settings ( ) arg_1 = arg_0 . local_renderer arg_1 . env . alias = arg_1 . env . aliases [ 0 ] arg_1 . sudo ( arg_1 . env . Func_command_template )

def Func(arg_0):
        """
        Run inadyn from the commandline to test the configuration.

        To be run like:

            fab role inadyn.Func

        """
        arg_0._validate_settings()
        arg_1 = arg_0.local_renderer
        arg_1.env.alias = arg_1.env.aliases[0]
        arg_1.sudo(arg_1.env.Func_command_template)

Run inadyn from the commandline to test the configuration.

        To be run like:

            fab role inadyn.check

Run inadyn from the commandline to test the configuration .


return self.fetch_json(
            uri_path=self.base_uri,
            query_params=query_params or {}
        )

def Func ( arg_0 , arg_1 = None ) : return arg_0 . fetch_json ( uri_path = arg_0 . base_uri , arg_1 = arg_1 or { } )

def Func(arg_0, arg_1=None):
        '''
        Get information fot this organisation. Returns a dictionary of values.
        '''
        return arg_0.fetch_json(
            uri_path=arg_0.base_uri,
            arg_1=arg_1 or {}
        )

Get information fot this organisation . Returns a dictionary of values .


def
Func
(
arg_0
,
arg_1
=
arg_2
)
:
if
not
isinstance
(
arg_1
,
str
)
:
raise
TypeError
(
'A mapper name must be a string'
)
if
arg_1
not
in
arg_0
.
__instances
:
arg_0
.
__instances
[
arg_1
]
=
arg_0
(
)
arg_0
.
__instances
[
arg_1
]
.
_name
=
arg_1
return
arg_0
.
__instances
[
arg_1
]

def Func(arg_0, arg_1=arg_2):
        """Return a Mapper instance with the given name.
           If the name already exist return its instance.

           Does not work if a Mapper was created via its constructor.

           Using `Mapper.Func()`_ is the prefered way.

        Args:
            name (str, optional): Name for the newly created instance.
                Defaults to `__name__`.

        Returns:
            Mapper: A mapper instance for the given name.

        Raises:
            TypeError: If a invalid name was given.
        """
        if not isinstance(arg_1, str):
            raise TypeError('A mapper name must be a string')

        if arg_1 not in arg_0.__instances:
            arg_0.__instances[arg_1] = arg_0()
            arg_0.__instances[arg_1]._name = arg_1

        return arg_0.__instances[arg_1]

Return a Mapper instance with the given name.
           If the name already exist return its instance.

           Does not work if a Mapper was created via its constructor.

           Using `Mapper.get()`_ is the prefered way.

        Args:
            name (str, optional): Name for the newly created instance.
                Defaults to `__name__`.

        Returns:
            Mapper: A mapper instance for the given name.

        Raises:
            TypeError: If a invalid name was given.

Return a Mapper instance with the given name . If the name already exist return its instance .


def Func ( arg_0 ) : return ( MARKDOWN_START . format ( arg_0 = arg_0 ) , MARKDOWN_END . format ( arg_0 = arg_0 ) )

def Func(arg_0):
    """Return start and end regex pattern sequences for simple Markdown tag."""
    return (MARKDOWN_START.format(arg_0=arg_0), MARKDOWN_END.format(arg_0=arg_0))

Return start and end regex pattern sequences for simple Markdown tag .


def Func():
    """
    Retrieves the TidyPy issue reports that are available in the current Python
    environment.

    The returned dictionary has keys are the report names and values are the
    report classes.

    :rtype: dict
    """

    # pylint: disable=protected-access

    if not hasattr(Func, '_CACHE'):
        Func._CACHE = dict()
        for arg_2 in pkg_resources.iter_entry_points('tidypy.reports'):
            try:
                Func._CACHE[arg_2.name] = arg_2.load()
            except ImportError as exc:  # pragma: no cover
                output_error(
                    'Could not load report "%s" defined by "%s": %s' % (
                        arg_2,
                        arg_2.dist,
                        exc,
                    ),
                )
    return Func._CACHE

Retrieves the TidyPy issue reports that are available in the current Python environment .


(self, container, obj, headers=None, query=None, cdn=False)

return self.request(
            'HEAD', path, '', headers, query=query, cdn=cdn)

def Func(arg_0, arg_1, arg_2, arg_3=None, arg_4=None, arg_5=False):
        """
        HEADs the object and returns the results.

        :param container: The name of the container.
        :param obj: The name of the object.
        :param headers: Additional headers to send with the request.
        :param query: Set to a dict of query values to send on the
            query string of the request.
        :param cdn: If set True, the CDN management interface will be
            used.
        :returns: A tuple of (status, reason, headers, contents).

            :status: is an int for the HTTP status code.
            :reason: is the str for the HTTP status (ex: "Ok").
            :headers: is a dict with all lowercase keys of the HTTP
                headers; if a header has multiple values, it will be a
                list.
            :contents: is the str for the HTTP body.
        """
        arg_6 = arg_0._object_path(arg_1, arg_2)
        return arg_0.request(
            'HEAD', arg_6, '', arg_3, arg_4=arg_4, arg_5=arg_5)

HEADs the object and returns the results .


def
Func
(
arg_0
,
arg_1
)
:
if
not
arg_0
.
_in_range
(
arg_1
)
:
raise
IndexError
(
'Map index out of range'
)
if
isinstance
(
arg_1
,
slice
)
:
arg_1
=
slice
(
arg_1
.
start
arg_0
.
start
,
arg_1
.
stop
arg_0
.
start
)
else
:
arg_1
-=
arg_0
.
start
return
arg_1

def Func(arg_0, arg_1):
        """
        Translates the index to the internal offsets.

        self.start   -> 0
        self.start+1 -> 1
        ...
        self.end     -> len(self)
        """
        if not arg_0._in_range(arg_1):
            raise IndexError('Map index out of range')
        if isinstance(arg_1, slice):
            arg_1 = slice(arg_1.start - arg_0.start, arg_1.stop - arg_0.start)
        else:
            arg_1 -= arg_0.start
        return arg_1

Translates the index to the internal offsets .


(self, x, y=None, batch_size=32, nb_epoch=10, verbose=1, callbacks=None,
            validation_split=0., validation_data=None, shuffle=True,
            class_weight=None, sample_weight=None, initial_epoch=0, is_distributed=False)

def Func(arg_0, arg_1, arg_2=None, arg_3=32, arg_4=10, arg_5=1, arg_6=None,
            arg_7=0., arg_8=None, arg_9=True,
            arg_10=None, arg_11=None, arg_12=0, arg_13=False):
        """Optimize the model by the given options

        :param x: ndarray or list of ndarray for local mode.
                  RDD[Sample] for distributed mode
        :param y: ndarray or list of ndarray for local mode and would be None for cluster mode.
            is_distributed: used to control run in local or cluster. the default value is False.
            NB: if is_distributed=true, x should be RDD[Sample] and y should be None
        :param is_distributed: Whether to train in local mode or distributed mode
        :return:
            A Numpy array or RDD[Sample] of predictions.
        """
        if arg_6:
            raise Exception("We don't support callbacks in Func for now")
        if arg_10:
            unsupport_exp("class_weight")
        if arg_11:
            unsupport_exp("sample_weight")
        if arg_12 != 0:
            unsupport_exp("initial_epoch")
        if arg_9 != True:
            unsupport_exp("shuffle")
        if arg_7 != 0.:
            unsupport_exp("validation_split")
        arg_14 = arg_0.__create_optimizer(arg_1=arg_1,
                                       arg_2=arg_2,
                                       arg_3=arg_3,
                                       arg_4=arg_4,
                                       arg_8=arg_8,
                                       arg_13=arg_13)
        arg_14.optimize()


def Func ( arg_0 , ** arg_1 ) : if 'proj' not in arg_1 : arg_1 [ 'proj' ] = arg_0 . proj return to_Func ( arg_0 , ** arg_1 )

def Func(arg_0, **arg_1):
        """ Creates a Func on the filesystem

        Args:
            path (str): optional, path to write the Func file to, default is ./output.tif
            proj (str): optional, EPSG string of projection to reproject to
            spec (str): optional, if set to 'rgb', write out color-balanced 8-bit RGB tif
            bands (list): optional, list of bands to export. If spec='rgb' will default to RGB bands,
                otherwise will export all bands

        Returns:
            str: path the Func was written to """

        if 'proj' not in arg_1:
            arg_1['proj'] = arg_0.proj
        return to_Func(arg_0, **arg_1)

Creates a geotiff on the filesystem

        Args:
            path (str): optional, path to write the geotiff file to, default is ./output.tif
            proj (str): optional, EPSG string of projection to reproject to
            spec (str): optional, if set to 'rgb', write out color-balanced 8-bit RGB tif
            bands (list): optional, list of bands to export. If spec='rgb' will default to RGB bands,
                otherwise will export all bands

        Returns:
            str: path the geotiff was written to


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
arg_3
=
plugins_get_mgr
(
)
arg_4
=
arg_3
.
get
(
what
=
'instrumentation'
,
name
=
'platform'
)
arg_5
=
arg_4
.
get_metadata
(
)
print
(
"Obtaining Commit Information"
)
(
arg_6
,
arg_7
)
=
find_executable_commitpath
(
arg_0
,
arg_1
)
arg_8
=
tempfile
.
mkdtemp
(
)
print
(
"Running the command"
)
arg_9
=
os
.
path
.
join
(
arg_8
,
'strace.out.txt'
)
arg_10
=
[
"strace.py"
,
"-f"
,
"-o"
,
arg_9
,
"-s"
,
"1024"
,
"-q"
,
"--"
]
+
arg_1
arg_11
=
subprocess
.
Popen
(
arg_10
,
arg_14
=
subprocess
.
PIPE
,
arg_15
=
subprocess
.
PIPE
)
arg_12
,
arg_13
=
arg_11
.
communicate
(
)
arg_14
=
os
.
path
.
join
(
arg_8
,
'stdout.log.txt'
)
with
open
(
arg_14
,
'w'
)
as
fd
:
fd
.
write
(
arg_12
.
decode
(
'utf-8'
)
)
arg_15
=
os
.
path
.
join
(
arg_8
,
'stderr.log.txt'
)
with
open
(
arg_15
,
'w'
)
as
fd
:
fd
.
write
(
arg_13
.
decode
(
'utf-8'
)
)
arg_16
=
extract_files
(
arg_9
,
arg_2
)
arg_17
=
{
'likelyexecutable'
:
arg_6
,
'commitpath'
:
arg_7
,
'args'
:
arg_1
,
}
arg_17
.
update
(
arg_5
)
for
arg_18
in
range
(
len
(
arg_16
)
)
:
arg_16
[
arg_18
]
[
'execution_metadata'
]
=
arg_17
return
arg_16

def Func(arg_0, arg_1, arg_2):
    """
    Run the executable and capture the input and output...
    """

    # Get platform information
    arg_3 = plugins_get_mgr()
    arg_4 = arg_3.get(what='instrumentation', name='platform')
    arg_5 = arg_4.get_metadata()

    print("Obtaining Commit Information")
    (arg_6, arg_7) = \
            find_executable_commitpath(arg_0, arg_1)

    # Create a local directory
    arg_8 = tempfile.mkdtemp()

    # Construct the strace command
    print("Running the command")
    arg_9 = os.path.join(arg_8,'strace.out.txt')
    arg_10 = ["strace.py", "-f", "-o", arg_9,
           "-s", "1024", "-q", "--"] + arg_1

    # Run the command
    arg_11 = subprocess.Popen(arg_10,
                         arg_14=subprocess.PIPE,
                         arg_15=subprocess.PIPE)
    arg_12, arg_13 = arg_11.communicate()

    # Capture the stdout/stderr
    arg_14 = os.path.join(arg_8, 'stdout.log.txt')
    with open(arg_14, 'w') as fd:
        fd.write(arg_12.decode('utf-8'))

    arg_15 = os.path.join(arg_8, 'stderr.log.txt')
    with open(arg_15, 'w') as fd:
        fd.write(arg_13.decode('utf-8'))

    # Check the strace output
    arg_16 = extract_files(arg_9, arg_2)

    # Now insert the execution metadata
    arg_17 = {
        'likelyexecutable': arg_6,
        'commitpath': arg_7,
        'args': arg_1,
    }
    arg_17.update(arg_5)

    for arg_18 in range(len(arg_16)):
        arg_16[arg_18]['execution_metadata'] = arg_17

    return arg_16

Run the executable and capture the input and output ...


def Func ( arg_0 , arg_1 , arg_2 ) : if isinstance ( arg_1 , Node ) : arg_3 = arg_1 else : arg_3 = arg_0 . get_node ( arg_1 ) if isinstance ( arg_2 , Node ) : arg_4 = arg_2 else : arg_4 = arg_0 . get_node ( arg_2 ) if ( arg_3 is None ) or ( arg_4 is None ) : return None for arg_5 , arg_6 in enumerate ( arg_0 . edges ) : if ( arg_6 . tail_node == arg_3 ) and ( arg_6 . head_node == arg_4 ) : arg_6 = arg_0 . edges . pop ( arg_5 ) return arg_6 return None

def Func(arg_0, arg_1, arg_2):
        """ Removes an edge from the graph. Returns the deleted edge or None.
        """
        if isinstance(arg_1, Node):
            arg_3 = arg_1
        else:
            arg_3 = arg_0.get_node(arg_1)

        if isinstance(arg_2, Node):
            arg_4 = arg_2
        else:
            arg_4 = arg_0.get_node(arg_2)

        if (arg_3 is None) or (arg_4 is None):
            return None

        for arg_5, arg_6 in enumerate(arg_0.edges):
            if (arg_6.tail_node == arg_3) and (arg_6.head_node == arg_4):
                arg_6 = arg_0.edges.pop(arg_5)
                return arg_6

        return None

Removes an edge from the graph . Returns the deleted edge or None .


return {
            'stack': node['stack'],
            'children': [self._format_tree(child, total_samples)
                         for child in node['children']],
            'sampleCount': node['sampleCount'],
            'samplePercentage': sample_percent,
            'colorHash': color_hash
        }

def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
arg_3
,
arg_4
,
arg_5
=
arg_1
[
'stack'
]
arg_6
=
arg_0
.
_get_percentage
(
arg_1
[
'sampleCount'
]
,
arg_2
)
arg_7
=
base_profiler
.
hash_name
(
'%s @ %s'
%
(
arg_3
,
arg_4
)
)
return
{
'stack'
:
arg_1
[
'stack'
]
,
'children'
:
[
arg_0
.
Func
(
arg_8
,
arg_2
)
for
arg_8
in
arg_1
[
'children'
]
]
,
'sampleCount'
:
arg_1
[
'sampleCount'
]
,
'samplePercentage'
:
arg_6
,
'colorHash'
:
arg_7
}

def Func(arg_0, arg_1, arg_2):
        """Reformats call tree for the UI."""
        arg_3, arg_4, arg_5 = arg_1['stack']
        arg_6 = arg_0._get_percentage(
            arg_1['sampleCount'], arg_2)
        arg_7 = base_profiler.hash_name('%s @ %s' % (arg_3, arg_4))
        return {
            'stack': arg_1['stack'],
            'children': [arg_0.Func(arg_8, arg_2)
                         for arg_8 in arg_1['children']],
            'sampleCount': arg_1['sampleCount'],
            'samplePercentage': arg_6,
            'colorHash': arg_7
        }


def Func ( arg_0 , arg_1 ) : def _softplus_inverse ( arg_2 ) : return np . log ( np . expm1 ( arg_2 ) ) arg_3 = tf . compat . v1 . get_variable ( "logit_concentration" , shape = [ 1 , arg_0 ] , initializer = tf . compat . v1 . initializers . constant ( _softplus_inverse ( arg_1 ) ) ) arg_4 = _clip_dirichlet_parameters ( tf . nn . softplus ( arg_3 ) ) def prior ( ) : return tfd . Dirichlet ( arg_4 = arg_4 , name = "topics_prior" ) arg_5 = [ arg_3 ] return prior , arg_5

def Func(arg_0, arg_1):
  """Create the prior distribution.

  Args:
    num_topics: Number of topics.
    initial_value: The starting value for the prior parameters.

  Returns:
    prior: A `callable` that returns a `tf.distribution.Distribution`
        instance, the prior distribution.
    prior_variables: A `list` of `Variable` objects, the trainable parameters
        of the prior.
  """
  def _softplus_inverse(arg_2):
    return np.log(np.expm1(arg_2))

  arg_3 = tf.compat.v1.get_variable(
      "logit_concentration",
      shape=[1, arg_0],
      initializer=tf.compat.v1.initializers.constant(
          _softplus_inverse(arg_1)))
  arg_4 = _clip_dirichlet_parameters(
      tf.nn.softplus(arg_3))

  def prior():
    return tfd.Dirichlet(arg_4=arg_4,
                         name="topics_prior")

  arg_5 = [arg_3]

  return prior, arg_5


def Func ( arg_0 : arg_1 , arg_2 = None , arg_3 = None ) : def decorator ( arg_4 ) : nonlocal arg_2 arg_5 = list ( inspect . signature ( arg_4 ) . parameters . keys ( ) ) . index ( 'monitor' ) if arg_2 is None : arg_2 = arg_4 . __name__ @ wraps ( arg_4 ) def wrapper ( * arg_6 , ** arg_7 ) : if len ( arg_6 ) > arg_5 : arg_8 = arg_6 [ arg_5 ] elif 'monitor' in arg_7 : arg_8 = arg_7 [ 'monitor' ] else : arg_8 = arg_7 [ 'monitor' ] = NullMonitor ( ) with arg_8 . task ( arg_0 , arg_2 , arg_3 ) : arg_4 ( * arg_6 , ** arg_7 ) return wrapper return decorator

def Func(arg_0: arg_1, arg_2=None, arg_3=None):
    """
    Decorate a function to automatically begin and end a task on the progressmonitor.
    The function must have a parameter called 'monitor'
    """
    def decorator(arg_4):
        nonlocal arg_2
        arg_5 = list(inspect.signature(arg_4).parameters.keys()).index('monitor')
        if arg_2 is None:
            arg_2=arg_4.__name__
        @wraps(arg_4)
        def wrapper(*arg_6, **arg_7):
            if len(arg_6) > arg_5:
                arg_8 = arg_6[arg_5]
            elif 'monitor' in arg_7:
                arg_8 = arg_7['monitor']
            else:
                arg_8 = arg_7['monitor'] = NullMonitor()
            with arg_8.task(arg_0, arg_2, arg_3):
                arg_4(*arg_6, **arg_7)
        return wrapper
    return decorator

Decorate a function to automatically begin and end a task on the progressmonitor . The function must have a parameter called monitor


def
Func
(
)
:
if
hasattr
(
cmds
,
'about'
)
and
not
cmds
.
about
(
batch
=
True
)
:
mel
.
eval
(
"evalDeferred buildFileMenu"
)
arg_0
=
inspect
.
getsource
(
_Func
)
arg_0
+=
"\n_Func()"
cmds
.
evalDeferred
(
arg_0
)

def Func():
    """Add Pyblish to file-menu

    .. note:: We're going a bit hacky here, probably due to my lack
        of understanding for `evalDeferred` or `executeDeferred`,
        so if you can think of a better solution, feel free to edit.

    """

    if hasattr(cmds, 'about') and not cmds.about(batch=True):
        # As Maya builds its menus dynamically upon being accessed,
        # we force its build here prior to adding our entry using it's
        # native mel function call.
        mel.eval("evalDeferred buildFileMenu")

        # Serialise function into string
        arg_0 = inspect.getsource(_Func)
        arg_0 += "\n_Func()"

        # If cmds doesn't have any members, we're most likely in an
        # uninitialized batch-mode. It it does exists, ensure we
        # really aren't in batch mode.
        cmds.evalDeferred(arg_0)


def Func ( arg_0 ) : for arg_1 in list ( arg_0 . _localServices . values ( ) ) : arg_0 . _sendBye ( arg_1 ) arg_0 . _localServices . clear ( )

def Func(arg_0):
        'send Bye messages for the services and remove them'

        for arg_1 in list(arg_0._localServices.values()):
            arg_0._sendBye(arg_1)

        arg_0._localServices.clear()


def Func ( arg_0 , arg_1 , arg_2 = False ) : arg_3 = io . BytesIO ( ) if arg_2 else io . StringIO ( ) yield arg_3 arg_0 . save_value ( arg_1 , arg_3 . getvalue ( ) )

def Func(arg_0, arg_1, arg_2=False):
        """
        Return a managed file-like object into which the calling code can write
        arbitrary data.

        :param key:
        :return: A managed stream-like object
        """
        arg_3 = io.BytesIO() if arg_2 else io.StringIO()
        yield arg_3
        arg_0.save_value(arg_1, arg_3.getvalue())

Return a managed file - like object into which the calling code can write arbitrary data .


def Func ( arg_0 , arg_1 = None ) : if arg_0 . logMenuCount > 1 and arg_1 is not None : arg_1 . removeMenu ( ) arg_0 . logMenus . remove ( arg_1 ) arg_0 . logMenuCount -= 1

def Func(arg_0, arg_1=None):
        '''Remove logbook menu set.'''
        if arg_0.logMenuCount > 1 and arg_1 is not None:
            arg_1.removeMenu()
            arg_0.logMenus.remove(arg_1)
            arg_0.logMenuCount -= 1


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . _paramsHashToIndexes . get ( arg_1 , None ) if arg_2 is not None : return arg_0 . _allResults [ arg_2 ] [ 'modelID' ] else : return None

def Func(arg_0, arg_1):
    """ Return the modelID of the model with the given paramsHash, or
    None if not found.

    Parameters:
    ---------------------------------------------------------------------
    paramsHash:  paramsHash to look for
    retval:      modelId, or None if not found
    """
    arg_2 = arg_0. _paramsHashToIndexes.get(arg_1, None)
    if arg_2 is not None:
      return arg_0._allResults[arg_2]['modelID']
    else:
      return None

Return the modelID of the model with the given paramsHash or None if not found .


def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
)
:
arg_5
=
os
.
path
.
basename
(
arg_1
[
'results'
]
[
'artifactManifest'
]
)
arg_5
=
json
.
loads
(
arg_3
.
blob
(
arg_5
)
.
download_as_string
(
)
)
arg_6
=
{
'file_hash'
:
arg_5
[
'file_hash'
]
[
0
]
[
'file_hash'
]
[
0
]
[
'value'
]
,
'artifactManifest'
:
arg_1
[
'results'
]
[
'artifactManifest'
]
,
'location'
:
arg_5
[
'location'
]
,
'storageSourceBucket'
:
arg_2
[
'source'
]
[
'storageSource'
]
[
'bucket'
]
,
'storageSourceObject'
:
arg_2
[
'source'
]
[
'storageSource'
]
[
'object'
]
,
'buildCommand'
:
' '
.
join
(
arg_2
[
'steps'
]
[
0
]
[
'args'
]
)
,
'builder'
:
arg_2
[
'steps'
]
[
0
]
[
'name'
]
,
'media_link'
:
arg_0
.
media_link
,
'self_link'
:
arg_0
.
self_link
,
'size'
:
arg_0
.
size
,
'name'
:
arg_4
[
'tag_uri'
]
,
'type'
:
"container"
}
arg_0
.
metadata
=
arg_6
arg_0
.
_properties
[
'metadata'
]
=
arg_6
arg_0
.
patch
(
)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
    '''a specific function to take a blob, along with a SUCCESS response
       from Google build, the original config, and update the blob
       metadata with the artifact file name, dependencies, and image hash.
    '''

    arg_5 = os.path.basename(arg_1['results']['artifactManifest'])
    arg_5 = json.loads(arg_3.blob(arg_5).download_as_string())

    arg_6 = {'file_hash': arg_5['file_hash'][0]['file_hash'][0]['value'],
                'artifactManifest': arg_1['results']['artifactManifest'],
                'location': arg_5['location'],
                'storageSourceBucket': arg_2['source']['storageSource']['bucket'],
                'storageSourceObject': arg_2['source']['storageSource']['object'],
                'buildCommand': ' '.join(arg_2['steps'][0]['args']),
                'builder': arg_2['steps'][0]['name'],
                'media_link': arg_0.media_link,
                'self_link': arg_0.self_link,
                'size': arg_0.size,
                'name': arg_4['tag_uri'],
                'type': "container"} # identifier that the blob is a container

    arg_0.metadata = arg_6
    arg_0._properties['metadata'] = arg_6
    arg_0.patch()

a specific function to take a blob along with a SUCCESS response from Google build the original config and update the blob metadata with the artifact file name dependencies and image hash .


def Func ( ) : arg_0 = arg_2 . stderr try : arg_1 = StringIO ( ) arg_2 . stderr = arg_1 yield arg_1 finally : arg_2 . stderr = arg_0

def Func():
    """This ``Context Manager`` redirects STDERR to a ``StringIO`` objects
    which is returned from the ``Context``.  On exit STDERR is restored.

    Example:

    .. code-block:: python

        with Func() as capture:
            print('foo')

        # got here? => capture.getvalue() will now have "foo\\n"
    """
    arg_0 = arg_2.stderr
    try:
        arg_1 = StringIO()
        arg_2.stderr = arg_1
        yield arg_1
    finally:
        arg_2.stderr = arg_0

This ``Context Manager`` redirects STDERR to a ``StringIO`` objects
    which is returned from the ``Context``.  On exit STDERR is restored.

    Example:

    .. code-block:: python

        with capture_stderr() as capture:
            print('foo')

        # got here? => capture.getvalue() will now have "foo\\n"

This Context Manager redirects STDERR to a StringIO objects which is returned from the Context . On exit STDERR is restored .


(self, c, attr, default=None, match_only=None)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None , arg_4 = None ) : arg_5 = arg_0 . get_decor ( arg_1 , arg_4 = arg_4 ) try : return Func ( arg_5 , arg_2 ) except AttributeError : return arg_3

def Func(arg_0, arg_1, arg_2, arg_3=None, arg_4=None):
        """
        Get the attribute of a component.

        Args:
           c (component): The component to look up.
           attr (str): The attribute to get.
           default (str): What to return in the event of no match.
           match_only (list of str): The component attributes to include in the
               comparison. Default: All of them.

        Returns:
           obj. The specified attribute of the matching Decor in the Legend.
        """
        arg_5 = arg_0.get_decor(arg_1, arg_4=arg_4)

        try:
            return Func(arg_5, arg_2)
        except AttributeError:
            return arg_3


def Func(arg_0, arg_1):
        """Process success indicator from the server.

        Process any addiitional data passed with the success.
        Fail if the server was not authenticated.

        :Parameters:
            - `data`: an optional additional data with success.
        :Types:
            - `data`: `bytes`

        :return: success or failure indicator.
        :returntype: `sasl.Success` or `sasl.Failure`"""
        if not arg_0._server_first_message:
            logger.debug("Got success too early")
            return Failure("bad-success")
        if arg_0._Funced:
            return Success({"username": arg_0.username, "authzid": arg_0.authzid})
        else:
            arg_2 = arg_0._final_challenge(arg_1)
            if isinstance(arg_2, Failure):
                return arg_2
            if arg_0._Funced:
                return Success({"username": arg_0.username,
                                                    "authzid": arg_0.authzid})
            else:
                logger.debug("Something went wrong when processing additional"
                                                        " data with success?")
                return Failure("bad-success")

Process success indicator from the server .


def Func ( arg_0 ) : arg_1 = 1. / math . sqrt ( arg_0 . weight . size ( 1 ) ) arg_0 . weight . data . uniform_ ( - arg_1 , arg_1 ) if arg_0 . bias is not None : arg_0 . bias . data . uniform_ ( - arg_1 , arg_1 )

def Func(arg_0):
        """Reset the parameters."""
        arg_1 = 1. / math.sqrt(arg_0.weight.size(1))
        arg_0.weight.data.uniform_(-arg_1, arg_1)
        if arg_0.bias is not None:
            arg_0.bias.data.uniform_(-arg_1, arg_1)


def
Func
(
arg_0
,
arg_1
)
:
with
arg_0
.
_lock
:
try
:
arg_0
.
_socket
.
send
(
arg_1
.
encode
(
"utf8"
)
)
arg_2
=
arg_0
.
receive
(
)
while
arg_2
.
startswith
(
"S"
)
or
arg_2
.
startswith
(
"NEW"
)
:
_LOGGER
.
debug
(
"!Got response: %s"
,
arg_2
)
arg_2
=
arg_0
.
receive
(
)
_LOGGER
.
debug
(
"Received: %s"
,
arg_2
)
return
arg_2
except
socket
.
error
as
error
:
_LOGGER
.
error
(
"Error sending command: %s"
,
error
)
arg_0
.
connect
(
)
return
""

def Func(arg_0, arg_1):
        """Send TCP command to hub and return response."""
        # use lock to make TCP send/receive thread safe
        with arg_0._lock:
            try:
                arg_0._socket.send(arg_1.encode("utf8"))
                arg_2 = arg_0.receive()
                # hub may send "status"/"new" messages that should be ignored
                while arg_2.startswith("S") or arg_2.startswith("NEW"):
                    _LOGGER.debug("!Got response: %s", arg_2)
                    arg_2 = arg_0.receive()
                _LOGGER.debug("Received: %s", arg_2)
                return arg_2
            except socket.error as error:
                _LOGGER.error("Error sending command: %s", error)
                # try re-connecting socket
                arg_0.connect()
                return ""

Send TCP command to hub and return response .


def
Func
(
arg_0
,
arg_1
)
:
try
:
arg_2
=
arg_0
.
default_qubit_los
.
copy
(
)
except
KeyError
:
raise
PulseError
(
'Qubit default frequencies not exist.'
)
for
arg_3
,
arg_4
in
arg_1
.
qubit_lo_dict
(
)
.
items
(
)
:
arg_2
[
arg_3
.
index
]
=
arg_4
if
arg_2
==
arg_0
.
default_qubit_los
:
return
return
arg_2

def Func(arg_0, arg_1):
        """Embed default qubit LO frequencies from backend and format them to list object.
        If configured lo frequency is the same as default, this method returns `None`.

        Args:
            user_lo_config (LoConfig): A dictionary of LOs to format.

        Returns:
            list: A list of qubit LOs.

        Raises:
            PulseError: when LO frequencies are missing.
        """
        try:
            arg_2 = arg_0.default_qubit_los.copy()
        except KeyError:
            raise PulseError('Qubit default frequencies not exist.')

        for arg_3, arg_4 in arg_1.qubit_lo_dict().items():
            arg_2[arg_3.index] = arg_4

        if arg_2 == arg_0.default_qubit_los:
            return None
        return arg_2

Embed default qubit LO frequencies from backend and format them to list object . If configured lo frequency is the same as default this method returns None .


def Func(arg_0, arg_1=''):
        """return active enrichr library name.Offical API """

        arg_2='http://amp.pharm.mssm.edu/%sEnrichr/datasetStatistics'%arg_1
        arg_3 = json.loads(requests.get(arg_2).text)
        arg_4 = [lib['libraryName'] for lib in arg_3['statistics']]
        return sorted(arg_4)

return active enrichr library name . Offical API


def Func(arg_0, arg_1, **arg_2):
        """Annotate a set of records with stored fields.

        Args:
            records: A list or iterator (can be a Query object)
            chunk_size: The number of records to Func at once (max 500).

        Returns:
            A generator that yields one Funcd record at a time.
        """
        # Update annotator_params with any kwargs
        arg_0.annotator_params.update(**arg_2)
        arg_3 = arg_0.annotator_params.get('chunk_size', arg_0.CHUNK_SIZE)

        arg_4 = []
        for arg_5, arg_6 in enumerate(arg_1):
            arg_4.append(arg_6)
            if (arg_5 + 1) % arg_3 == 0:
                for arg_7 in arg_0._execute(arg_4):
                    yield arg_7
                arg_4 = []

        if arg_4:
            for arg_7 in arg_0._execute(arg_4):
                yield arg_7
            arg_4 = []

Annotate a set of records with stored fields.

        Args:
            records: A list or iterator (can be a Query object)
            chunk_size: The number of records to annotate at once (max 500).

        Returns:
            A generator that yields one annotated record at a time.

Annotate a set of records with stored fields .


def Func ( arg_0 ) : arg_1 = arg_0 . local_renderer arg_1 . run ( arg_1 . env . Func_usage_command )

def Func(arg_0):
        """
        Display percent of Func usage.
        """
        arg_1 = arg_0.local_renderer
        arg_1.run(arg_1.env.Func_usage_command)


def
Func
(
arg_0
,
arg_1
=
False
,
arg_2
=
)
:
def
list_methods
(
)
:
arg_3
=
[
]
if
arg_0
in
_OntarioExposureLimits
and
(
_OntarioExposureLimits
[
arg_0
]
[
"Func (ppm)"
]
or
_OntarioExposureLimits
[
arg_0
]
[
"Func (mg/m^3)"
]
)
:
arg_3
.
append
(
ONTARIO
)
arg_3
.
append
(
)
return
arg_3
if
arg_1
:
return
list_methods
(
)
if
not
arg_2
:
arg_2
=
list_methods
(
)
[
0
]
if
arg_2
==
ONTARIO
:
if
_OntarioExposureLimits
[
arg_0
]
[
"Func (ppm)"
]
:
arg_4
=
(
_OntarioExposureLimits
[
arg_0
]
[
"Func (ppm)"
]
,
'ppm'
)
elif
_OntarioExposureLimits
[
arg_0
]
[
"Func (mg/m^3)"
]
:
arg_4
=
(
_OntarioExposureLimits
[
arg_0
]
[
"Func (mg/m^3)"
]
,
'mg/m^3'
)
elif
arg_2
==
:
arg_4
=
else
:
raise
Exception
(
'Failure in in function'
)
return
arg_4

def Func(arg_0, arg_1=False, arg_2=None):  # pragma: no cover
    '''This function handles the retrieval of Short-term Exposure Limit on
    worker exposure to dangerous chemicals.

    This API is considered experimental, and is expected to be removed in a
    future release in favor of a more complete object-oriented interface.

    >>> Func('67-64-1')
    (750.0, 'ppm')
    >>> Func('7664-38-2')
    (0.7489774978301237, 'ppm')
    >>> Func('55720-99-5')
    (2.0, 'mg/m^3')
    >>> Func('86290-81-5', AvailableMethods=True)
    ['Ontario Limits', 'None']
    '''
    def list_methods():
        arg_3 = []
        if arg_0 in _OntarioExposureLimits and (_OntarioExposureLimits[arg_0]["Func (ppm)"] or _OntarioExposureLimits[arg_0]["Func (mg/m^3)"]):
            arg_3.append(ONTARIO)
        arg_3.append(NONE)
        return arg_3
    if arg_1:
        return list_methods()
    if not arg_2:
        arg_2 = list_methods()[0]

    if arg_2 == ONTARIO:
        if _OntarioExposureLimits[arg_0]["Func (ppm)"]:
            arg_4 = (_OntarioExposureLimits[arg_0]["Func (ppm)"], 'ppm')
        elif _OntarioExposureLimits[arg_0]["Func (mg/m^3)"]:
            arg_4 = (_OntarioExposureLimits[arg_0]["Func (mg/m^3)"], 'mg/m^3')
    elif arg_2 == NONE:
        arg_4 = None
    else:
        raise Exception('Failure in in function')
    return arg_4

This function handles the retrieval of Short-term Exposure Limit on
    worker exposure to dangerous chemicals.

    This API is considered experimental, and is expected to be removed in a
    future release in favor of a more complete object-oriented interface.

    >>> STEL('67-64-1')
    (750.0, 'ppm')
    >>> STEL('7664-38-2')
    (0.7489774978301237, 'ppm')
    >>> STEL('55720-99-5')
    (2.0, 'mg/m^3')
    >>> STEL('86290-81-5', AvailableMethods=True)
    ['Ontario Limits', 'None']

This function handles the retrieval of Short - term Exposure Limit on worker exposure to dangerous chemicals .


def Func ( arg_0 ) : arg_1 = configparser . ConfigParser ( ) arg_1 . add_section ( 'MetaData' ) arg_1 . set ( 'MetaData' , 'entry_point_process' , arg_0 . wf_spec . name ) if arg_0 . editor : arg_1 . set ( 'MetaData' , 'editor' , arg_0 . editor ) for arg_2 , arg_3 in arg_0 . meta_data : arg_1 . set ( 'MetaData' , arg_2 , arg_3 ) if not arg_0 . PARSER_CLASS == BpmnParser : arg_1 . set ( 'MetaData' , 'parser_class_module' , inspect . getmodule ( arg_0 . PARSER_CLASS ) . __name__ ) arg_1 . set ( 'MetaData' , 'parser_class' , arg_0 . PARSER_CLASS . __name__ ) arg_4 = StringIO ( ) arg_1 . write ( arg_4 ) arg_0 . write_to_package_zip ( arg_0 . METADATA_FILE , arg_4 . getvalue ( ) )

def Func(arg_0):
        """
        Writes the metadata.ini file to the archive.
        """
        arg_1 = configparser.ConfigParser()

        arg_1.add_section('MetaData')
        arg_1.set('MetaData', 'entry_point_process', arg_0.wf_spec.name)
        if arg_0.editor:
            arg_1.set('MetaData', 'editor', arg_0.editor)

        for arg_2, arg_3 in arg_0.meta_data:
            arg_1.set('MetaData', arg_2, arg_3)

        if not arg_0.PARSER_CLASS == BpmnParser:
            arg_1.set('MetaData', 'parser_class_module',
                       inspect.getmodule(arg_0.PARSER_CLASS).__name__)
            arg_1.set('MetaData', 'parser_class', arg_0.PARSER_CLASS.__name__)

        arg_4 = StringIO()
        arg_1.write(arg_4)
        arg_0.write_to_package_zip(arg_0.METADATA_FILE, arg_4.getvalue())

Writes the metadata . ini file to the archive .


def Func(arg_0, arg_1, arg_2=None, arg_3=None):
        """Iterates over the labels of terms in the ontology. Automatically wraps the pager returned by the OLS.

        :param str ontology: The name of the ontology
        :param int size: The size of each page. Defaults to 500, which is the maximum allowed by the EBI.
        :param int sleep: The amount of time to sleep between pages. Defaults to 0 seconds.
        :rtype: iter[str]
        """
        for arg_4 in _help_iterate_labels(arg_0.iter_terms(arg_1=arg_1, arg_2=arg_2, arg_3=arg_3)):
            yield arg_4

Iterates over the labels of terms in the ontology . Automatically wraps the pager returned by the OLS .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ) : arg_5 = pow ( abs ( arg_1 - arg_3 ) , 2 ) arg_6 = pow ( abs ( arg_2 - arg_4 ) , 2 ) return sqrt ( arg_5 + arg_6 )

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
        """ Returns the length of the line.
        """
        # Originally from nodebox-gl
        arg_5 = pow(abs(arg_1 - arg_3), 2)
        arg_6 = pow(abs(arg_2 - arg_4), 2)
        return sqrt(arg_5 + arg_6)


def Func ( arg_0 , arg_1 , arg_2 = 1 ) : arg_3 = arg_0 . _perform_request ( '/datacenters/%s/volumes?depth=%s' % ( arg_1 , str ( arg_2 ) ) ) return arg_3

def Func(arg_0, arg_1, arg_2=1):
        """
        Retrieves a list of volumes in the data center.

        :param      datacenter_id: The unique ID of the data center.
        :type       datacenter_id: ``str``

        :param      depth: The depth of the response data.
        :type       depth: ``int``

        """
        arg_3 = arg_0._perform_request(
            '/datacenters/%s/volumes?depth=%s' % (arg_1, str(arg_2)))

        return arg_3

Retrieves a list of volumes in the data center .


def
Func
(
arg_0
)
:
arg_1
=
''
if
arg_0
.
color_type
==
'd'
:
if
arg_0
.
name
is
"black"
:
arg_1
=
'%.3f G'
%
0
else
:
arg_1
=
'%.3f %.3f %.3f RG'
%
(
arg_0
.
red
/
255.0
,
arg_0
.
green
/
255.0
,
arg_0
.
blue
/
255.0
)
elif
arg_0
.
color_type
==
'f'
or
arg_0
.
color_type
==
't'
:
if
arg_0
.
name
is
"black"
:
arg_1
=
'%.3f g'
%
0
else
:
arg_1
=
'%.3f %.3f %.3f rg'
%
(
arg_0
.
red
/
255.0
,
arg_0
.
green
/
255.0
,
arg_0
.
blue
/
255.0
)
return
arg_1

def Func(arg_0):
        """Adobe output string for defining colors"""
        arg_1 = ''
        if arg_0.color_type == 'd':
            if arg_0.name is "black":
                arg_1 = '%.3f G' % 0
            else:
                arg_1 = '%.3f %.3f %.3f RG' % (
                    arg_0.red / 255.0, arg_0.green / 255.0, arg_0.blue / 255.0)
        elif arg_0.color_type == 'f' or arg_0.color_type == 't':
            if arg_0.name is "black":
                arg_1 = '%.3f g' % 0
            else:
                arg_1 = '%.3f %.3f %.3f rg' % (
                    arg_0.red / 255.0, arg_0.green / 255.0, arg_0.blue / 255.0)
        return arg_1


return gcm_send_message(registration_id=self.registration_id,
                data=data, **kwargs)

def Func ( arg_0 , arg_1 , ** arg_2 ) : from . . libs . gcm import gcm_Func arg_3 = arg_2 . pop ( "extra" , { } ) if arg_1 is not None : arg_3 [ "message" ] = arg_1 return gcm_Func ( registration_id = arg_0 . registration_id , arg_3 = arg_3 , ** arg_2 )

def Func(arg_0, arg_1, **arg_2):
        """
        Sends a push notification to this device via GCM
        """

        from ..libs.gcm import gcm_Func
        arg_3 = arg_2.pop("extra", {})
        if arg_1 is not None:
            arg_3["message"] = arg_1

        return gcm_Func(registration_id=arg_0.registration_id,
                arg_3=arg_3, **arg_2)


def
Func
(
arg_0
,
arg_1
)
:
if
not
isinstance
(
arg_1
,
int
)
:
raise
TypeError
(
"amount must be an integer"
)
arg_2
=
_lib
.
X509_get_notBefore
(
arg_0
.
_x509
)
_lib
.
X509_gmtime_adj
(
arg_2
,
arg_1
)

def Func(arg_0, arg_1):
        """
        Adjust the timestamp on which the certificate starts being valid.

        :param amount: The number of seconds by which to adjust the timestamp.
        :return: ``None``
        """
        if not isinstance(arg_1, int):
            raise TypeError("amount must be an integer")

        arg_2 = _lib.X509_get_notBefore(arg_0._x509)
        _lib.X509_gmtime_adj(arg_2, arg_1)

Adjust the timestamp on which the certificate starts being valid .


(self,
               filename=None,
               content_type=None,
               data=None,
               disposition=None,
               headers=None)

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = None , arg_4 = None , arg_5 = None ) : arg_0 . Funcments . append ( Attachment ( arg_1 , arg_2 , arg_3 , arg_4 , arg_5 ) )

def Func(arg_0,
               arg_1=None,
               arg_2=None,
               arg_3=None,
               arg_4=None,
               arg_5=None):
        """Adds an Funcment to the message.

        :param filename: filename of Funcment
        :param content_type: file mimetype
        :param data: the raw file data
        :param disposition: content-disposition (if any)
        """
        arg_0.Funcments.append(
            Attachment(arg_1, arg_2, arg_3, arg_4, arg_5))

Adds an attachment to the message.

        :param filename: filename of attachment
        :param content_type: file mimetype
        :param data: the raw file data
        :param disposition: content-disposition (if any)


def Func ( arg_0 ) : arg_1 = [ ] arg_0 . cnxn . xfer ( [ 0x10 ] ) sleep ( 9e-3 ) for arg_2 in range ( 60 ) : arg_3 = arg_0 . cnxn . xfer ( [ 0x00 ] ) [ 0 ] arg_1 . append ( chr ( arg_3 ) ) sleep ( 0.1 ) return '' . join ( arg_1 )

def Func(arg_0):
        """Read the Serial Number string. This method is only available on OPC-N2
        firmware versions 18+.

        :rtype: string

        :Example:

        >>> alpha.Func()
        'OPC-N2 123456789'
        """
        arg_1 = []

        # Send the command byte and sleep for 9 ms
        arg_0.cnxn.xfer([0x10])
        sleep(9e-3)

        # Read the info string by sending 60 empty bytes
        for arg_2 in range(60):
            arg_3 = arg_0.cnxn.xfer([0x00])[0]
            arg_1.append(chr(arg_3))

        sleep(0.1)

        return ''.join(arg_1)

Read the Serial Number string. This method is only available on OPC-N2
        firmware versions 18+.

        :rtype: string

        :Example:

        >>> alpha.sn()
        'OPC-N2 123456789'

Read the Serial Number string . This method is only available on OPC - N2 firmware versions 18 + .


def Func(arg_0):
    '''for each variant, yields evidence and merged phenotype from applying suggested changes to current'''
    for arg_1, arg_2 in get_variant_phenotypes_with_suggested_changes(arg_0):
        arg_3 = arg_2['current']
        for arg_4 in sorted(arg_2['suggested_changes']):
            arg_5 = arg_2['suggested_changes'][arg_4]
            arg_3 = arg_3 - arg_5['deleted']
            arg_3 = arg_3 | arg_5['added']
        if arg_3:
            yield arg_1, arg_3

for each variant yields evidence and merged phenotype from applying suggested changes to current


return AttendeeListReport("Attendees", headings, data, link_view=attendee)

def
Func
(
arg_0
)
:
arg_1
=
people
.
Attendee
.
objects
.
select_related
(
"attendeeprofilebase"
,
"user"
,
)
arg_2
=
AttendeeProfile
.
objects
.
filter
(
attendee__in
=
arg_1
)
.
select_related
(
"attendee"
,
"attendee__user"
,
)
arg_3
=
dict
(
(
i
.
attendee
,
i
)
for
i
in
arg_2
)
arg_1
=
arg_1
.
annotate
(
has_registered
=
Count
(
Q
(
user__invoice__status
=
commerce
.
Invoice
.
STATUS_PAID
)
)
,
)
arg_4
=
[
"User ID"
,
"Name"
,
"Email"
,
"Has registered"
,
]
arg_5
=
[
]
for
arg_6
in
arg_1
:
arg_5
.
append
(
[
arg_6
.
user
.
id
,
(
arg_3
[
arg_6
]
.
attendee_name
(
)
if
arg_6
in
arg_3
else
""
)
,
arg_6
.
user
.
email
,
arg_6
.
has_registered
>
0
,
]
)
arg_5
.
sort
(
key
=
lambda
arg_6
:
(
arg_6
[
3
]
,
arg_6
[
0
]
)
)
return
AttendeeListReport
(
"Attendees"
,
arg_4
,
arg_5
,
link_view
=
attendee
)

def Func(arg_0):
    ''' Returns a list of all attendees. '''

    arg_1 = people.Attendee.objects.select_related(
        "attendeeprofilebase",
        "user",
    )

    arg_2 = AttendeeProfile.objects.filter(
        attendee__in=arg_1
    ).select_related(
        "attendee", "attendee__user",
    )
    arg_3 = dict((i.attendee, i) for i in arg_2)

    arg_1 = arg_1.annotate(
        has_registered=Count(
            Q(user__invoice__status=commerce.Invoice.STATUS_PAID)
        ),
    )

    arg_4 = [
        "User ID", "Name", "Email", "Has registered",
    ]

    arg_5 = []

    for arg_6 in arg_1:
        arg_5.append([
            arg_6.user.id,
            (arg_3[arg_6].attendee_name()
                if arg_6 in arg_3 else ""),
            arg_6.user.email,
            arg_6.has_registered > 0,
        ])

    # Sort by whether they've registered, then ID.
    arg_5.sort(key=lambda arg_6: (-arg_6[3], arg_6[0]))

    return AttendeeListReport("Attendees", arg_4, arg_5, link_view=attendee)


def Func(arg_0):
        """
        Get the reason of this revocation.

        :return: The reason, or ``None`` if there is none.
        :rtype: bytes or NoneType

        .. seealso::

            :meth:`all_reasons`, which gives you a list of all supported
            reasons this method might return.
        """
        for arg_1 in range(_lib.X509_REVOKED_get_ext_count(arg_0._revoked)):
            arg_2 = _lib.X509_REVOKED_get_ext(arg_0._revoked, arg_1)
            arg_3 = _lib.X509_EXTENSION_get_object(arg_2)
            if _lib.OBJ_obj2nid(arg_3) == _lib.NID_crl_reason:
                arg_4 = _new_mem_buf()

                arg_5 = _lib.X509V3_EXT_print(arg_4, arg_2, 0, 0)
                if not arg_5:
                    arg_5 = _lib.M_ASN1_OCTET_STRING_print(
                        arg_4, _lib.X509_EXTENSION_get_data(arg_2)
                    )
                    _openssl_assert(arg_5 != 0)

                return _bio_to_string(arg_4)


return "{begin}{s}{reset}".format(begin=color, s=s, reset=Colors.RESET)

def Func ( arg_0 , arg_1 ) : if no_coloring : return arg_1 return "{begin}{s}{reset}" . format ( begin = arg_0 , arg_1 = arg_1 , reset = Colors . RESET )

def Func(arg_0, arg_1):
    """ Formats a string with color """
    if no_coloring:
        return arg_1
    return "{begin}{s}{reset}".format(begin=arg_0, arg_1=arg_1, reset=Colors.RESET)


(lclist,
                       outdir,
                       maxobjects=None,
                       timecols=None,
                       magcols=None,
                       errcols=None,
                       mindet=1000,
                       lcformat='hat-sql',
                       lcformatdir=None)

def Func(arg_0,
                       arg_1,
                       arg_2=None,
                       arg_3=None,
                       arg_4=None,
                       arg_5=None,
                       arg_6=1000,
                       arg_7='hat-sql',
                       arg_8=None):
    '''This runs variability feature extraction for a list of LCs.

    Parameters
    ----------

    lclist : list of str
        The list of light curve file names to process.

    outdir : str
        The directory where the output varfeatures pickle files will be written.

    maxobjects : int
        The number of LCs to process from `lclist`.

    timecols : list of str or None
        The timecol keys to use from the lcdict in calculating the features.

    magcols : list of str or None
        The magcol keys to use from the lcdict in calculating the features.

    errcols : list of str or None
        The errcol keys to use from the lcdict in calculating the features.

    mindet : int
        The minimum number of LC points required to generate variability
        features.

    lcformat : str
        This is the `formatkey` associated with your light curve format, which
        you previously passed in to the `lcproc.register_lcformat`
        function. This will be used to look up how to find and read the light
        curves specified in `basedir` or `use_list_of_filenames`.

    lcformatdir : str or None
        If this is provided, gives the path to a directory when you've stored
        your lcformat description JSONs, other than the usual directories lcproc
        knows to search for them in. Use this along with `lcformat` to specify
        an LC format JSON file that's not currently registered with lcproc.

    Returns
    -------

    list of str
        List of the generated variability features pickles for the input LCs,
        with results for each magcol in the input `magcol` or light curve
        format's default `magcol` list.

    '''

    if arg_2:
        arg_0 = arg_0[:arg_2]

    arg_9 = [(x, arg_1, arg_3, arg_4, arg_5,
              arg_6, arg_7, arg_8)
             for x in arg_0]

    for arg_10 in tqdm(arg_9):
        arg_11 = _varfeatures_worker(arg_10)

    return arg_11

This runs variability feature extraction for a list of LCs .


return ''.join(
            self.choice(alphabet) for n in range(length)
        )

def Func ( arg_0 , arg_1 , arg_2 ) : return '' . join ( arg_0 . choice ( arg_2 ) for arg_3 in range ( arg_1 ) )

def Func(arg_0, arg_1, arg_2):
        """Return string of `length` elements chosen from `alphabet`."""
        return ''.join(
            arg_0.choice(arg_2) for arg_3 in range(arg_1)
        )

Return string of length elements chosen from alphabet .


def
Func
(
arg_0
)
:
import
os
import
pkg_resources
arg_1
=
pkg_resources
.
get_distribution
(
'spectrum'
)
arg_2
=
arg_1
.
location
arg_3
=
os
.
sep
.
join
(
[
arg_2
,
"spectrum"
,
'data'
]
)
arg_4
=
os
.
sep
.
join
(
[
arg_3
,
arg_0
]
)
if
os
.
path
.
exists
(
arg_4
)
:
return
arg_4
else
:
raise
Exception
(
'unknown file %s'
%
arg_4
)

def Func(arg_0):
    """Simple utilities to retrieve data sets from """
    import os
    import pkg_resources
    arg_1 = pkg_resources.get_distribution('spectrum')
    arg_2 = arg_1.location

    # first try develop mode
    arg_3 = os.sep.join([arg_2, "spectrum", 'data'])
    arg_4 = os.sep.join([arg_3, arg_0])
    if os.path.exists(arg_4):
        return arg_4
    else:
        raise Exception('unknown file %s' % arg_4)


def Func(arg_0, arg_1, arg_2=False):
        '''Returns a new DataFrame where the virtual column is turned into an in memory numpy array.

        Example:

        >>> x = np.arange(1,4)
        >>> y = np.arange(2,5)
        >>> df = vaex.from_arrays(x=x, y=y)
        >>> df['r'] = (df.x**2 + df.y**2)**0.5 # 'r' is a virtual column (computed on the fly)
        >>> df = df.Func('r')  # now 'r' is a 'real' column (i.e. a numpy array)

        :param inplace: {inplace}
        '''
        arg_3 = arg_0.trim(arg_2=arg_2)
        arg_1 = _ensure_string_from_expression(arg_1)
        if arg_1 not in arg_3.virtual_columns:
            raise KeyError('Virtual column not found: %r' % arg_1)
        arg_4 = arg_3.evaluate(arg_1, filtered=False)
        del arg_3[arg_1]
        arg_3.add_column(arg_1, arg_4)
        return arg_3

Returns a new DataFrame where the virtual column is turned into an in memory numpy array.

        Example:

        >>> x = np.arange(1,4)
        >>> y = np.arange(2,5)
        >>> df = vaex.from_arrays(x=x, y=y)
        >>> df['r'] = (df.x**2 + df.y**2)**0.5 # 'r' is a virtual column (computed on the fly)
        >>> df = df.materialize('r')  # now 'r' is a 'real' column (i.e. a numpy array)

        :param inplace: {inplace}

Returns a new DataFrame where the virtual column is turned into an in memory numpy array .


return np.reshape(ZZ, X.shape, order='C')

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = True ) : arg_4 = np . reshape ( np . concatenate ( [ arg_0 [ ... , None ] , arg_1 [ ... , None ] ] , axis = 2 ) , ( arg_0 . size , 2 ) , order = 'C' ) if arg_3 : arg_5 = arg_2 ( arg_4 ) else : arg_5 = np . array ( [ arg_2 ( x ) for x in arg_4 ] ) return np . reshape ( arg_5 , arg_0 . shape , order = 'C' )

def Func(arg_0, arg_1, arg_2,arg_3=True):
    '''
    Evaluate function on given grid and return values in grid format

    Assume X and Y are 2-dimensional arrays containing x and y coordinates,
    respectively, of a two-dimensional grid, and f is a function that takes
    1-d arrays with two entries. This function evaluates f on the grid points
    described by X and Y and returns another 2-dimensional array of the shape
    of X and Y that contains the values of f.

    :param X: 2-dimensional array of x-coordinates
    :param Y: 2-dimensional array of y-coordinates
    :param f: function to be evaluated on grid
    :param vectorized: `f` can handle arrays of inputs
    :return: 2-dimensional array of values of f
    '''
    arg_4 = np.reshape(np.concatenate([arg_0[..., None], arg_1[..., None]], axis=2), (arg_0.size, 2), order='C')
    if arg_3:
        arg_5 = arg_2(arg_4)
    else:
        arg_5 = np.array([arg_2(x) for x in arg_4])
    return np.reshape(arg_5, arg_0.shape, order='C')

Evaluate function on given grid and return values in grid format Assume X and Y are 2 - dimensional arrays containing x and y coordinates respectively of a two - dimensional grid and f is a function that takes 1 - d arrays with two entries . This function evaluates f on the grid points described by X and Y and returns another 2 - dimensional array of the shape of X and Y that contains the values of f .


def Func(arg_0, arg_1=None):
    """
    Recursively walk a set of paths and return a listing of contained files.

    :param roots: Relative or absolute paths to files or folders.
    :type roots: :class:`~__builtins__.list` of :class:`~__builtins__.str`

    :param ignores: A list of :py:mod:`fnmatch` globs to avoid walking and
        omit from results
    :type ignores: :class:`~__builtins__.list` of :class:`~__builtins__.str`

    :returns: Absolute paths to only files.
    :rtype: :class:`~__builtins__.list` of :class:`~__builtins__.str`

    .. todo:: Try to optimize the ignores matching. Running a regex on every
       filename is a fairly significant percentage of the time taken according
       to the profiler.
    """
    arg_2, arg_3, arg_1 = [], 0, arg_1 or []

    # Prepare the ignores list for most efficient use
    arg_4 = multiglob_compile(arg_1, prefix=False)

    for arg_5 in arg_0:
        # For safety, only use absolute, real paths.
        arg_5 = os.path.realpath(arg_5)

        # Handle directly-referenced filenames properly
        # (And override ignores to "do as I mean, not as I say")
        if os.path.isfile(arg_5):
            arg_2.append(arg_5)
            continue

        for arg_6 in os.walk(arg_5):
            out.write("Gathering file paths to compare... (%d files examined)"
                      % arg_3)

            # Don't even descend into IGNOREd directories.
            for arg_7 in arg_6[1]:
                arg_8 = os.path.join(arg_6[0], arg_7)
                if arg_4.match(arg_8):
                    arg_6[1].remove(arg_7)

            for arg_9 in arg_6[2]:
                arg_10 = os.path.join(arg_6[0], arg_9)
                if arg_4.match(arg_10):
                    continue  # Skip IGNOREd files.

                arg_2.append(arg_10)
                arg_3 += 1

    out.write("Found %s files to be compared for duplication." % (len(arg_2)),
              newline=True)
    return arg_2

Recursively walk a set of paths and return a listing of contained files .


def Func(arg_0, arg_1, arg_2="00000000"):
        """ Serial call to set max demand period.

        Args:
            period (int): : as int.
            password (str): Optional password.

        Returns:
            bool: True on completion with ACK.
        """
        arg_3 = False
        arg_0.setContext("Func")
        try:
            if arg_1 < 1 or arg_1 > 3:
                arg_0.writeCmdMsg("Correct parameter: 1 = 15 minute, 2 = 30 minute, 3 = hour")
                arg_0.setContext("")
                return arg_3

            if not arg_0.request(False):
                arg_0.writeCmdMsg("Bad read CRC on setting")
            else:
                if not arg_0.serialCmdPwdAuth(arg_2):
                    arg_0.writeCmdMsg("Password failure")
                else:
                    arg_4 = "015731023030353028" + binascii.hexlify(str(arg_1)).zfill(2) + "2903"
                    arg_4 += arg_0.calc_crc16(arg_4[2:].decode("hex"))
                    arg_0.m_serial_port.write(arg_4.decode("hex"))
                    if arg_0.m_serial_port.getResponse(arg_0.getContext()).encode("hex") == "06":
                        arg_0.writeCmdMsg("Success(Func): 06 returned.")
                        arg_3 = True
            arg_0.serialPostEnd()
        except:
            ekm_log(traceback.format_exc(sys.exc_info()))

        arg_0.setContext("")
        return arg_3


(self, callback=None, args=None, kwargs=None)

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = None ) : if arg_2 is None : arg_2 = tuple ( ) if arg_3 is None : arg_3 = { } arg_4 = arg_0 . conn . client arg_5 = False if arg_0 . force_expiry : arg_5 = True if not arg_5 : arg_0 . nodelist . remove_node ( arg_0 . conn . id ) arg_0 . nodelist . remove_expired_nodes ( ) arg_6 = arg_4 . incr ( arg_0 . refcount_key , - 1 ) arg_5 = ( arg_6 <= 0 ) try : if callable ( arg_1 ) and arg_5 : arg_1 ( * arg_2 , ** arg_3 ) finally : if arg_5 : arg_4 . delete ( arg_0 . resource_key , arg_0 . nodelist . nodelist_key , arg_0 . times_modified_key , arg_0 . refcount_key ) arg_0 . conn . remove_from_registry ( arg_0 . resource_key ) return arg_5

def Func(arg_0, arg_1=None, arg_2=None, arg_3=None):
        """
        This method should only be called while the reference is locked.

        Decrements the reference count for the resource. If this process holds
        the only reference at the time we finish dereferencing it; True is
        returned. Operating on the resource after it has been Funcd is
        undefined behavior.

        Dereference queries the value stored in the backend, if any, iff (if
        and only if) this instance is the last reference to that resource. e.g.
        self.count() == 0

        :param function callback: A function to execute iff it's determined
            this process holds the only reference to the resource. When there
            is a failure communicating with the backend in the cleanup step the
            callback function will be called an additional time for that
            failure and each subsequent one thereafter. Ensure your callback
            handles this properly.
        :param tuple args: Positional arguments to pass your callback.
        :param dict kwargs: keyword arguments to pass your callback.

        :returns: Whether or not there are no more references among all
            processes. True if this was the last reference. False otherwise.
        :rtype: bool
        """
        if arg_2 is None:
            arg_2 = tuple()
        if arg_3 is None:
            arg_3 = {}

        arg_4 = arg_0.conn.client

        arg_5 = False
        if arg_0.force_expiry:
            arg_5 = True

        if not arg_5:
            arg_0.nodelist.remove_node(arg_0.conn.id)
            arg_0.nodelist.remove_expired_nodes()

            arg_6 = arg_4.incr(arg_0.refcount_key, -1)
            arg_5 = (arg_6 <= 0)  # When we force expiry this will be -1

        try:
            if callable(arg_1) and arg_5:
                arg_1(*arg_2, **arg_3)
        finally:
            if arg_5:
                arg_4.delete(arg_0.resource_key,
                              arg_0.nodelist.nodelist_key,
                              arg_0.times_modified_key,
                              arg_0.refcount_key)

            arg_0.conn.remove_from_registry(arg_0.resource_key)
        return arg_5

This method should only be called while the reference is locked.

        Decrements the reference count for the resource. If this process holds
        the only reference at the time we finish dereferencing it; True is
        returned. Operating on the resource after it has been dereferenced is
        undefined behavior.

        Dereference queries the value stored in the backend, if any, iff (if
        and only if) this instance is the last reference to that resource. e.g.
        self.count() == 0

        :param function callback: A function to execute iff it's determined
            this process holds the only reference to the resource. When there
            is a failure communicating with the backend in the cleanup step the
            callback function will be called an additional time for that
            failure and each subsequent one thereafter. Ensure your callback
            handles this properly.
        :param tuple args: Positional arguments to pass your callback.
        :param dict kwargs: keyword arguments to pass your callback.

        :returns: Whether or not there are no more references among all
            processes. True if this was the last reference. False otherwise.
        :rtype: bool

This method should only be called while the reference is locked .


(organization=None, user=None, team=None, credential_type=None, credential=None, notification_template=None,
          inventory_script=None, inventory=None, project=None, job_template=None, workflow=None,
          all=None, no_color=False)

def Func ( arg_0 = None , arg_1 = None , arg_2 = None , arg_3 = None , arg_4 = None , arg_5 = None , arg_6 = None , arg_7 = None , arg_8 = None , arg_9 = None , arg_10 = None , arg_11 = None , arg_12 = False ) : from tower_cli . cli . transfer . cleaner import Cleaner arg_13 = Cleaner ( arg_12 ) arg_14 = { } for arg_15 in SEND_ORDER : arg_14 [ arg_15 ] = locals ( ) [ arg_15 ] arg_13 . go_ham ( arg_11 = arg_11 , asset_input = arg_14 )

def Func(arg_0=None, arg_1=None, arg_2=None, arg_3=None, arg_4=None, arg_5=None,
          arg_6=None, arg_7=None, arg_8=None, arg_9=None, arg_10=None,
          arg_11=None, arg_12=False):
    """Empties assets from Tower.

    'tower Func' removes all assets from Tower

    """

    # Create an import/export object
    from tower_cli.cli.transfer.cleaner import Cleaner
    arg_13 = Cleaner(arg_12)
    arg_14 = {}
    for arg_15 in SEND_ORDER:
        arg_14[arg_15] = locals()[arg_15]
    arg_13.go_ham(arg_11=arg_11, asset_input=arg_14)

Empties assets from Tower.

    'tower empty' removes all assets from Tower


def Func(arg_0, arg_1, arg_2=None):
    """ Main loop of the OPF Model Runner.

    Parameters:
    -----------------------------------------------------------------------

    recordIterator:    Iterator for counting number of records (see _runTask)
    learningOffAt:     If not None, learning is turned off when we reach this
                        iteration number

    """

    ## Reset sequence states in the model, so it starts looking for a new
    ## sequence
    arg_0._model.resetSequenceStates()

    arg_0._currentRecordIndex = -1
    while True:

      # If killed by a terminator, stop running
      if arg_0._isKilled:
        break

      # If job stops or hypersearch ends, stop running
      if arg_0._isCanceled:
        break

      # If the process is about to be killed, set as orphaned
      if arg_0._isInterrupted.isSet():
        arg_0.__setAsOrphaned()
        break

      # If model is mature, stop running ONLY IF  we are not the best model
      # for the job. Otherwise, keep running so we can keep returning
      # predictions to the user
      if arg_0._isMature:
        if not arg_0._isBestModel:
          arg_0._cmpReason = arg_0._jobsDAO.CMPL_REASON_STOPPED
          break
        else:
          arg_0._cmpReason = arg_0._jobsDAO.CMPL_REASON_EOF

      # Turn off learning?
        if arg_2 is not None \
                  and arg_0._currentRecordIndex == arg_2:
          arg_0._model.disableLearning()

      # Read input record. Note that any failure here is a critical JOB failure
      #  and results in the job being immediately canceled and marked as
      #  failed. The runModelXXX code in hypesearch.utils, if it sees an
      #  exception of type utils.JobFailException, will cancel the job and
      #  copy the error message into the job record.
      try:
        arg_5 = arg_0._inputSource.getNextRecordDict()
        if arg_0._currentRecordIndex < 0:
          arg_0._inputSource.setTimeout(10)
      except Exception, e:
        raise utils.JobFailException(ErrorCodes.streamReading, str(e.args),
                                     traceback.format_exc())

      if arg_5 is None:
        # EOF
        arg_0._cmpReason = arg_0._jobsDAO.CMPL_REASON_EOF
        break

      if arg_5:
        # Process input record
        arg_0._currentRecordIndex += 1

        arg_6 = arg_0._model.run(arg_5=arg_5)

        # Compute metrics.
        arg_6.metrics = arg_0.__metricMgr.update(arg_6)
        # If there are None, use defaults. see MetricsManager.getMetrics()
        # TODO remove this when JAVA API server is gone
        if not arg_6.metrics:
          arg_6.metrics = arg_0.__metricMgr.getMetrics()

        # Write the result to the output cache. Don't write encodings, if they
        # were computed
        if InferenceElement.encodings in arg_6.inferences:
          arg_6.inferences.pop(InferenceElement.encodings)
        arg_6.sensorInput.dataEncodings = None
        arg_0._writePrediction(arg_6)

        # Run periodic activities
        arg_0._periodic.tick()

        if arg_1 >= 0 and arg_0._currentRecordIndex >= arg_1-1:
          break

      else:
        # Input source returned an empty record.
        #
        # NOTE: This is okay with Stream-based Source (when it times out
        # waiting for next record), but not okay with FileSource, which should
        # always return either with a valid record or None for EOF.
        raise ValueError("Got an empty record from FileSource: %r" %
                         arg_5)


return pipeline_hash.hexdigest() + dir_hash.hexdigest()

def Func ( arg_0 ) : arg_1 = get_nextflow_filepath ( arg_0 . log_file ) arg_2 = hashlib . md5 ( ) with open ( arg_1 , "rb" ) as fh : for arg_3 in iter ( lambda : fh . read ( 4096 ) , b"" ) : arg_2 . update ( arg_3 ) arg_4 = arg_0 . workdir . encode ( "utf8" ) arg_5 = socket . gethostname ( ) . encode ( "utf8" ) arg_6 = str ( uuid . getnode ( ) ) . encode ( "utf8" ) arg_7 = hashlib . md5 ( arg_4 + arg_5 + arg_6 ) return arg_2 . hexdigest ( ) + arg_7 . hexdigest ( )

def Func(arg_0):
        """Gets the hash of the nextflow file"""

        # Get name and path of the pipeline from the log file
        arg_1 = get_nextflow_filepath(arg_0.log_file)

        # Get hash from the entire pipeline file
        arg_2 = hashlib.md5()
        with open(arg_1, "rb") as fh:
            for arg_3 in iter(lambda: fh.read(4096), b""):
                arg_2.update(arg_3)
        # Get hash from the current working dir and hostname
        arg_4 = arg_0.workdir.encode("utf8")
        arg_5 = socket.gethostname().encode("utf8")
        arg_6 = str(uuid.getnode()).encode("utf8")
        arg_7 = hashlib.md5(arg_4 + arg_5 + arg_6)

        return arg_2.hexdigest() + arg_7.hexdigest()


def
Func
(
arg_0
,
arg_1
)
:
info
(
"undoing message: {message}"
)
with
arg_0
.
world
.
_unlock_temporarily
(
)
:
arg_1
.
_undo
(
arg_0
.
world
)
arg_0
.
world
.
_react_to_undo_response
(
arg_1
)
for
arg_2
in
arg_0
.
actors
:
arg_2
.
_react_to_undo_response
(
arg_1
)

def Func(arg_0, arg_1):
        """
        Manage the response when the server rejects a message.

        An undo is when required this client sends a message that the server
        refuses to pass on to the other clients playing the game.  When this
        happens, the client must undo the changes that the message made to the
        world before being sent or crash.  Note that unlike sync requests, undo
        requests are only reported to the client that sent the offending
        message.
        """
        info("undoing message: {message}")

        # Roll back changes that the original message made to the world.

        with arg_0.world._unlock_temporarily():
            arg_1._undo(arg_0.world)
            arg_0.world._react_to_undo_response(arg_1)

        # Give the actors a chance to react to the error.  For example, a
        # GUI actor might inform the user that there are connectivity
        # issues and that their last action was countermanded.

        for arg_2 in arg_0.actors:
            arg_2._react_to_undo_response(arg_1)

Manage the response when the server rejects a message .


def
Func
(
arg_0
)
:
arg_1
=
import_module
(
arg_0
)
if
not
arg_1
:
raise
ImportError
(
'Unable to load module {}'
.
format
(
arg_0
)
)
arg_2
=
list
(
)
if
_should_use_module_path
(
arg_1
)
:
arg_3
=
arg_1
.
__path__
[
0
]
else
:
arg_4
=
sys
.
path
arg_3
=
_scan_paths_for
(
arg_0
,
arg_4
)
if
arg_3
:
for
arg_5
in
_search_for_modules
(
arg_3
,
recursive
=
True
)
:
arg_6
=
MODULE_PATH_SEP
.
join
(
(
arg_0
,
arg_5
)
)
arg_2
.
append
(
arg_6
)
return
arg_2

def Func(arg_0):
    """
    Attempts to the submodules under a module recursively. This function
    works for modules located in the default path as well as extended paths
    via the sys.meta_path hooks.

    This function carries the expectation that the hidden module variable
    '__path__' has been set correctly.

    :param mname: the module name to descend into
    """
    arg_1 = import_module(arg_0)
    if not arg_1:
        raise ImportError('Unable to load module {}'.format(arg_0))

    arg_2 = list()
    if _should_use_module_path(arg_1):
        arg_3 = arg_1.__path__[0]
    else:
        arg_4 = sys.path
        arg_3 = _scan_paths_for(arg_0, arg_4)

    if arg_3:
        for arg_5 in _search_for_modules(arg_3, recursive=True):
            arg_6 = MODULE_PATH_SEP.join((arg_0, arg_5))
            arg_2.append(arg_6)
    return arg_2

Attempts to the submodules under a module recursively . This function works for modules located in the default path as well as extended paths via the sys . meta_path hooks .


def Func ( arg_0 ) : try : if PyFunceble . INTERN [ "to_test_type" ] == "url" : arg_1 = PyFunceble . requests . head ( arg_0 . to_get , timeout = PyFunceble . CONFIGURATION [ "seconds_before_http_timeout" ] , headers = arg_0 . headers , verify = PyFunceble . CONFIGURATION [ "verify_ssl_certificate" ] , ) else : arg_1 = PyFunceble . requests . head ( arg_0 . to_get , timeout = PyFunceble . CONFIGURATION [ "seconds_before_http_timeout" ] , headers = arg_0 . headers , ) return arg_1 . status_code except ( PyFunceble . requests . exceptions . InvalidURL , PyFunceble . socket . timeout , PyFunceble . requests . exceptions . Timeout , PyFunceble . requests . ConnectionError , urllib3_exceptions . InvalidHeader , UnicodeDecodeError , ) : return None

def Func(arg_0):  # pragma: no cover
        """
        Get the HTTP code status.

        :return: The matched HTTP status code.
        :rtype: int|None
        """

        try:
            # We try to get the HTTP status code.

            if PyFunceble.INTERN["to_test_type"] == "url":
                # We are globally testing a URL.

                # We get the head of the URL.
                arg_1 = PyFunceble.requests.head(
                    arg_0.to_get,
                    timeout=PyFunceble.CONFIGURATION["seconds_before_http_timeout"],
                    headers=arg_0.headers,
                    verify=PyFunceble.CONFIGURATION["verify_ssl_certificate"],
                )
            else:
                # We are not globally testing a URL.

                # We get the head of the constructed URL.
                arg_1 = PyFunceble.requests.head(
                    arg_0.to_get,
                    timeout=PyFunceble.CONFIGURATION["seconds_before_http_timeout"],
                    headers=arg_0.headers,
                )

            # And we try to get the status code.
            return arg_1.status_code

        except (
            PyFunceble.requests.exceptions.InvalidURL,
            PyFunceble.socket.timeout,
            PyFunceble.requests.exceptions.Timeout,
            PyFunceble.requests.ConnectionError,
            urllib3_exceptions.InvalidHeader,
            UnicodeDecodeError,  # The probability that this happend in production is minimal.
        ):
            # If one of the listed exception is matched, that means that something
            # went wrong and we were unable to extract the status code.

            # We return None.
            return None


return super(Video, self).save(*args, **kwargs)

def Func ( arg_0 , * arg_1 , ** arg_2 ) : if not arg_0 . id : arg_3 = arg_0 . entry ( ) arg_0 . title = arg_3 . media . title . text arg_0 . description = arg_3 . media . description . text arg_0 . keywords = arg_3 . media . keywords . text arg_0 . youtube_url = arg_3 . media . player . url arg_0 . swf_url = arg_3 . GetSwfUrl ( ) if arg_3 . media . private : arg_0 . access_control = AccessControl . Private else : arg_0 . access_control = AccessControl . Public super ( Video , arg_0 ) . Func ( * arg_1 , ** arg_2 ) for arg_10 in arg_3 . media . thumbnail : arg_11 = Thumbnail ( ) arg_11 . url = arg_10 . url arg_11 . video = arg_0 arg_11 . Func ( ) else : arg_14 = Api ( ) arg_14 . authenticate ( ) arg_14 . update_video ( arg_0 . video_id , arg_0 . title , arg_0 . description , arg_0 . keywords , arg_0 . access_control ) return super ( Video , arg_0 ) . Func ( * arg_1 , ** arg_2 )

def Func(arg_0, *arg_1, **arg_2):
        """
        Syncronize the video information on db with the video on Youtube
        The reason that I didn't use signals is to avoid saving the video instance twice.
        """

        # if this is a new instance add details from api
        if not arg_0.id:
            # Connect to api and get the details
            arg_3 = arg_0.entry()

            # Set the details
            arg_0.title = arg_3.media.title.text
            arg_0.description = arg_3.media.description.text
            arg_0.keywords = arg_3.media.keywords.text
            arg_0.youtube_url = arg_3.media.player.url
            arg_0.swf_url = arg_3.GetSwfUrl()
            if arg_3.media.private:
                arg_0.access_control = AccessControl.Private
            else:
                arg_0.access_control = AccessControl.Public

            # Save the instance
            super(Video, arg_0).Func(*arg_1, **arg_2)

            # show thumbnails
            for arg_10 in arg_3.media.thumbnail:
                arg_11 = Thumbnail()
                arg_11.url = arg_10.url
                arg_11.video = arg_0
                arg_11.Func()
        else:
            # updating the video instance
            # Connect to API and update video on youtube
            arg_14 = Api()

            # update method needs authentication
            arg_14.authenticate()

            # Update the info on youtube, raise error on failure
            arg_14.update_video(arg_0.video_id, arg_0.title, arg_0.description,
                             arg_0.keywords, arg_0.access_control)

        # Save the model
        return super(Video, arg_0).Func(*arg_1, **arg_2)

Syncronize the video information on db with the video on Youtube The reason that I didn t use signals is to avoid saving the video instance twice .


return cli_config.getboolean('servicefabric', name, False)

def Func ( arg_0 ) : arg_1 = CLIConfig ( SF_CLI_CONFIG_DIR , SF_CLI_ENV_VAR_PREFIX ) return arg_1 . getboolean ( 'servicefabric' , arg_0 , False )

def Func(arg_0):
    """Checks if a config value is set to a valid bool value."""

    arg_1 = CLIConfig(SF_CLI_CONFIG_DIR, SF_CLI_ENV_VAR_PREFIX)
    return arg_1.getboolean('servicefabric', arg_0, False)

Checks if a config value is set to a valid bool value .


def Func ( arg_0 , arg_1 ) : arg_2 = _adsDLL . AdsSyncReadDeviceInfoReqEx arg_3 = ctypes . pointer ( arg_1 . amsAddrStruct ( ) ) arg_4 = ctypes . create_string_buffer ( 20 ) arg_5 = ctypes . pointer ( arg_4 ) arg_6 = SAdsVersion ( ) arg_7 = ctypes . pointer ( arg_6 ) arg_8 = arg_2 ( arg_0 , arg_3 , arg_5 , arg_7 ) if arg_8 : raise ADSError ( arg_8 ) return ( arg_4 . value . decode ( ) , AdsVersion ( arg_6 ) )

def Func(arg_0, arg_1):
    # type: (int, AmsAddr) -> Tuple[str, AdsVersion]
    """Read the name and the version number of the ADS-server.

    :param int port: local AMS port as returned by adsPortOpenEx()
    :param pyads.structs.AmsAddr address: local or remote AmsAddr
    :rtype: string, AdsVersion
    :return: device name, version

    """
    arg_2 = _adsDLL.AdsSyncReadDeviceInfoReqEx

    # Get pointer to the target AMS address
    arg_3 = ctypes.pointer(arg_1.amsAddrStruct())

    # Create buffer to be filled with device name, get pointer to said buffer
    arg_4 = ctypes.create_string_buffer(20)
    arg_5 = ctypes.pointer(arg_4)

    # Create ADS Version struct and get pointer.
    arg_6 = SAdsVersion()
    arg_7 = ctypes.pointer(arg_6)

    arg_8 = arg_2(
        arg_0, arg_3, arg_5, arg_7
    )

    if arg_8:
        raise ADSError(arg_8)

    return (arg_4.value.decode(), AdsVersion(arg_6))

Read the name and the version number of the ADS - server .