def Func ( arg_0 ) : with LiveExecution . lock : if arg_0 . edited_source : arg_1 , arg_2 = arg_0 . Func_tenuous ( ) if arg_1 : return arg_0 . do_exec ( arg_0 . known_good , arg_0 . ns )

def Func(arg_0):
        """
        Attempt to known good or tenuous source.
        """
        with LiveExecution.lock:
            if arg_0.edited_source:
                arg_1, arg_2 = arg_0.Func_tenuous()
                if arg_1:
                    return

            arg_0.do_exec(arg_0.known_good, arg_0.ns)

Attempt to known good or tenuous source .


def Func ( arg_0 , ** arg_1 ) : try : arg_1 [ 'project_id' ] = arg_0 arg_2 = _pybossa_req ( 'get' , 'helpingmaterial' , params = arg_1 ) if type ( arg_2 ) . __name__ == 'list' : return [ HelpingMaterial ( arg_3 ) for arg_3 in arg_2 ] else : return arg_2 except : raise

def Func(arg_0, **arg_1):
    """Return a list of matched helping materials for a given project ID.

    :param project_id: PYBOSSA Project ID
    :type project_id: integer
    :param kwargs: PYBOSSA HelpingMaterial members
    :type info: dict
    :rtype: list
    :returns: A list of helping materials that match the kwargs

    """
    try:
        arg_1['project_id'] = arg_0
        arg_2 = _pybossa_req('get', 'helpingmaterial', params=arg_1)
        if type(arg_2).__name__ == 'list':
            return [HelpingMaterial(arg_3) for arg_3 in arg_2]
        else:
            return arg_2
    except:  # pragma: no cover
        raise

Return a list of matched helping materials for a given project ID .


def Func ( arg_0 ) : try : arg_1 = _extra_dims_style_2 [ arg_0 ] if "uint" in arg_1 : return DimensionSignedness . UNSIGNED elif "int" in arg_1 : return DimensionSignedness . SIGNED else : return DimensionSignedness . FLOATING except IndexError : raise errors . UnknownExtraType ( arg_0 )

def Func(arg_0):
    """ Returns the signedness foe the given type index

    Parameters
    ----------
    type_index: int
        index of the type as defined in the LAS Specification

    Returns
    -------
    DimensionSignedness,
        the enum variant
    """
    try:
        arg_1 = _extra_dims_style_2[arg_0]
        if "uint" in arg_1:
            return DimensionSignedness.UNSIGNED
        elif "int" in arg_1:
            return DimensionSignedness.SIGNED
        else:
            return DimensionSignedness.FLOATING
    except IndexError:
        raise errors.UnknownExtraType(arg_0)


return sorted(list(modules), key=lambda x: x.name)

def Func ( ) : arg_0 = set ( ) arg_1 = os . getcwd ( ) for arg_2 in os . listdir ( arg_1 ) : if arg_2 == 'module.yml' : arg_0 . add ( Module ( arg_1 ) ) arg_3 = unipath ( arg_1 , arg_2 ) if utils . is_module ( arg_3 ) : arg_0 . add ( Module ( arg_1 ) ) arg_4 = get_module_paths ( ) for arg_5 in arg_4 : for arg_2 in os . listdir ( arg_5 ) : arg_3 = unipath ( arg_5 , arg_2 ) if utils . is_module ( arg_3 ) : arg_0 . add ( Module ( arg_3 ) ) return sorted ( list ( arg_0 ) , key = lambda x : x . name )

def Func():
    '''Returns a list of available modules.'''

    arg_0 = set()

    arg_1 = os.getcwd()
    for arg_2 in os.listdir(arg_1):

        if arg_2 == 'module.yml':
            arg_0.add(Module(arg_1))

        arg_3 = unipath(arg_1, arg_2)
        if utils.is_module(arg_3):
            arg_0.add(Module(arg_1))

    arg_4 = get_module_paths()
    for arg_5 in arg_4:
        for arg_2 in os.listdir(arg_5):

            arg_3 = unipath(arg_5, arg_2)
            if utils.is_module(arg_3):
                arg_0.add(Module(arg_3))

    return sorted(list(arg_0), key=lambda x: x.name)


Return the index of the closest in xarr to value val

def Func ( arg_0 , arg_1 ) : arg_2 = np . argmin ( np . abs ( np . array ( arg_0 ) - arg_1 ) ) return arg_2

def Func(arg_0, arg_1):
    """ Return the index of the Func in xarr to value val """
    arg_2 = np.argmin(np.abs(np.array(arg_0) - arg_1))
    return arg_2


def Func ( arg_0 ) : arg_1 = base64 . urlsafe_b64encode ( arg_0 ) return arg_1 . translate ( bytes . maketrans ( b"+/=" , b"._-" ) )

def Func(arg_0):
        """
        Implementation of Y64 non-standard URL-safe base64 variant.

        See http://en.wikipedia.org/wiki/Base64#Variants_summary_table

        :return: base64-encoded result with substituted
        ``{"+", "/", "="} => {".", "_", "-"}``.
        """
        arg_1 = base64.urlsafe_b64encode(arg_0)
        return arg_1.translate(bytes.maketrans(b"+/=", b"._-"))

Implementation of Y64 non - standard URL - safe base64 variant .


def Func ( arg_0 ) : arg_1 = Blueprint ( 'invenio_records_ui' , __name__ , url_prefix = '' , template_folder = 'templates' , static_folder = 'static' , ) @ arg_1 . errorhandler ( PIDDeletedError ) def tombstone_errorhandler ( arg_2 ) : return render_template ( current_app . config [ 'RECORDS_UI_TOMBSTONE_TEMPLATE' ] , pid = arg_2 . pid , record = arg_2 . record or { } , ) , 410 @ arg_1 . context_processor def inject_export_formats ( ) : return dict ( export_formats = ( current_app . extensions [ 'invenio-records-ui' ] . export_formats ) ) for arg_3 , arg_4 in ( arg_0 or { } ) . items ( ) : arg_1 . add_url_rule ( ** create_url_rule ( arg_3 , ** arg_4 ) ) return arg_1

def Func(arg_0):
    """Create Invenio-Records-UI blueprint.

    The factory installs one URL route per endpoint defined, and adds an
    error handler for rendering tombstones.

    :param endpoints: Dictionary of endpoints to be installed. See usage
        documentation for further details.
    :returns: The initialized blueprint.
    """
    arg_1 = Blueprint(
        'invenio_records_ui',
        __name__,
        url_prefix='',
        template_folder='templates',
        static_folder='static',
    )

    @arg_1.errorhandler(PIDDeletedError)
    def tombstone_errorhandler(arg_2):
        return render_template(
            current_app.config['RECORDS_UI_TOMBSTONE_TEMPLATE'],
            pid=arg_2.pid,
            record=arg_2.record or {},
        ), 410

    @arg_1.context_processor
    def inject_export_formats():
        return dict(
            export_formats=(
                current_app.extensions['invenio-records-ui'].export_formats)
            )

    for arg_3, arg_4 in (arg_0 or {}).items():
        arg_1.add_url_rule(**create_url_rule(arg_3, **arg_4))

    return arg_1

Create Invenio - Records - UI blueprint .


def Func ( arg_0 , arg_1 , arg_2 = arg_3 . KMIPVersion . KMIP_1_0 ) : arg_6 = BytearrayStream ( ) arg_0 . extension_name . Func ( arg_6 , arg_2 = arg_2 ) if arg_0 . extension_tag is not None : arg_0 . extension_tag . Func ( arg_6 , arg_2 = arg_2 ) if arg_0 . extension_type is not None : arg_0 . extension_type . Func ( arg_6 , arg_2 = arg_2 ) arg_0 . length = arg_6 . length ( ) super ( ExtensionInformation , arg_0 ) . Func ( arg_1 , arg_2 = arg_2 ) arg_1 . Func ( arg_6 . buffer )

def Func(arg_0, arg_1, arg_2=arg_3.KMIPVersion.KMIP_1_0):
        """
        Write the data encoding the ExtensionInformation object to a stream.

        Args:
            ostream (Stream): A data stream in which to encode object data,
                supporting a Func method; usually a BytearrayStream object.
            kmip_version (KMIPVersion): An enumeration defining the KMIP
                version with which the object will be encoded. Optional,
                defaults to KMIP 1.0.
        """
        arg_6 = BytearrayStream()

        arg_0.extension_name.Func(arg_6, arg_2=arg_2)

        if arg_0.extension_tag is not None:
            arg_0.extension_tag.Func(arg_6, arg_2=arg_2)
        if arg_0.extension_type is not None:
            arg_0.extension_type.Func(arg_6, arg_2=arg_2)

        arg_0.length = arg_6.length()
        super(ExtensionInformation, arg_0).Func(
            arg_1,
            arg_2=arg_2
        )
        arg_1.Func(arg_6.buffer)

Write the data encoding the ExtensionInformation object to a stream.

        Args:
            ostream (Stream): A data stream in which to encode object data,
                supporting a write method; usually a BytearrayStream object.
            kmip_version (KMIPVersion): An enumeration defining the KMIP
                version with which the object will be encoded. Optional,
                defaults to KMIP 1.0.

Write the data encoding the ExtensionInformation object to a stream .


(graph: BELGraph, node: BaseEntity, key: str)

return graph.in_degree(node) == 0 and key not in graph.nodes[node]

def Func(arg_0: arg_1, arg_2: arg_3, arg_4: arg_5) -> bool:
    """Check if the node is both a source and also has an annotation.

    :param graph: A BEL graph
    :param node: A BEL node
    :param key: The key in the node data dictionary representing the experimental data
    """
    return arg_0.in_degree(arg_2) == 0 and arg_4 not in arg_0.nodes[arg_2]

Check if the node is both a source and also has an annotation .


def Func(arg_0, arg_1=''):
        """Write a prompt and read a line.

        The returned line does not include the trailing newline.
        When the user enters the EOF key sequence, EOFError is raised.

        Optional inputs:

          - prompt(''): a string to be printed to prompt the user.

          - continue_prompt(False): whether this line is the first one or a
          continuation in a sequence of inputs.
        """
        # Code run by the user may have modified the readline completer state.
        # We must ensure that our completer is back in place.

        if arg_0.has_readline:
            arg_0.set_readline_completer()

        # Func expects str, but we pass it unicode sometimes
        arg_1 = py3compat.cast_bytes_py2(arg_1)

        try:
            arg_2 = py3compat.str_to_unicode(arg_0.Func_original(arg_1))
        except ValueError:
            warn("\n********\nYou or a %run:ed script called sys.stdin.close()"
                 " or sys.stdout.close()!\nExiting IPython!\n")
            arg_0.ask_exit()
            return ""

        # Try to be reasonably smart about not re-indenting pasted input more
        # than necessary.  We do this by trimming out the auto-indent initial
        # spaces, if the user's actual input started itself with whitespace.
        if arg_0.autoindent:
            if num_ini_spaces(arg_2) > arg_0.indent_current_nsp:
                arg_2 = arg_2[arg_0.indent_current_nsp:]
                arg_0.indent_current_nsp = 0

        return arg_2


(self, test_func, error, timeoutSecs=10, retryDelaySecs=0.5)

def Func(arg_0, arg_1, arg_2, arg_3=10, arg_4=0.5):
        '''Repeatedly test a function waiting for it to return True.

        Arguments:
        test_func      -- A function that will be run repeatedly
        error          -- A function that will be run to produce an error message
                          it will be called with (node, timeTakenSecs, numberOfRetries)
                    OR
                       -- A string that will be interpolated with a dictionary of
                          { 'timeTakenSecs', 'numberOfRetries' }
        timeoutSecs    -- How long in seconds to keep trying before declaring a failure
        retryDelaySecs -- How long to wait between retry attempts
        '''
        arg_5 = time.time()
        arg_6 = 0
        while h2o_args.no_timeout or (time.time() - arg_5 < arg_3):
            if arg_1(arg_0, tries=arg_6, arg_3=arg_3):
                break
            time.sleep(arg_4)
            arg_6 += 1
            # hey, check the sandbox if we've been waiting a long time...rather than wait for timeout
            # to find the badness?. can check_sandbox_for_errors at any time
            if ((arg_6 % 50) == 0):
                check_sandbox_for_errors(python_test_name=h2o_args.python_test_name)

        else:
            arg_7 = time.time() - arg_5
            if isinstance(arg_2, type('')):
                raise Exception('%s failed after %.2f seconds having retried %d times' % (
                    arg_2, arg_7, arg_6))
            else:
                arg_8 = arg_2(arg_0, arg_7, arg_6)
                raise Exception(arg_8)

Repeatedly test a function waiting for it to return True .


return any(fnmatch.fnmatch(i, prefix) for i in items_list)

def Func(arg_0, arg_1=None):
  """True iff an object exists matching the input GCS pattern.

  The GCS pattern must be a full object reference or a "simple pattern" that
  conforms to the dsub input and output parameter restrictions:

    * No support for **, ? wildcards or [] character ranges
    * Wildcards may only appear in the file name

  Args:
    file_pattern: eg. 'gs://foo/ba*'
    credentials: Optional credential to be used to load the file from gcs.

  Raises:
    ValueError: if file_pattern breaks the rules.

  Returns:
    True iff a file exists that matches that pattern.
  """
  if '*' not in arg_0:
    return _file_exists_in_gcs(arg_0, arg_1)
  if not arg_0.startswith('gs://'):
    raise ValueError('file name must start with gs://')
  arg_2 = _get_storage_service(arg_1)
  arg_3, arg_4 = arg_0[len('gs://'):].split('/', 1)
  if '*' in arg_3:
    raise ValueError('Wildcards may not appear in the bucket name')
  # There is a '*' in prefix because we checked there's one in file_pattern
  # and there isn't one in bucket_name. Hence it must be in prefix.
  assert '*' in arg_4
  arg_5 = arg_4[:arg_4.index('*')]
  arg_6 = arg_2.objects().list(
      bucket=arg_3, arg_4=arg_5)
  arg_7 = arg_6.execute()
  if 'items' not in arg_7:
    return False
  arg_8 = [arg_9['name'] for arg_9 in arg_7['items']]
  return any(fnmatch.fnmatch(arg_9, arg_4) for arg_9 in arg_8)

True iff an object exists matching the input GCS pattern .


return boto.connect_dynamodb(
            aws_access_key_id=aws_access_key,
            aws_secret_access_key=aws_secret_key,
        )

def Func ( arg_0 , arg_1 = None , arg_2 = None ) : return boto . connect_dynamodb ( aws_access_key_id = arg_1 , aws_secret_access_key = arg_2 , )

def Func(arg_0, arg_1=None, arg_2=None):
        '''
        Hook point for overriding how the CounterPool gets its connection to
        AWS.
        '''
        return boto.connect_dynamodb(
            aws_access_key_id=arg_1,
            aws_secret_access_key=arg_2,
        )

Hook point for overriding how the CounterPool gets its connection to AWS .


def Func ( arg_0 ) : try : signal . signal ( signal . SIGPIPE , signal . SIG_DFL ) except ValueError : pass try : sys . stdout . write ( arg_0 ) if not arg_0 . endswith ( '\n' ) : sys . stdout . write ( '\n' ) sys . stdout . flush ( ) except IOError : sys . exit ( 0 )

def Func(arg_0):
    """
        Print the given line to stdout
    """
    try:
        signal.signal(signal.SIGPIPE, signal.SIG_DFL)
    except ValueError:
        pass

    try:
        sys.stdout.write(arg_0)
        if not arg_0.endswith('\n'):
            sys.stdout.write('\n')
        sys.stdout.flush()
    except IOError:
        sys.exit(0)


(self, x, y, lr=0.01, train_epochs=1000, test_epochs=1000, idx=0, verbose=None, **kwargs)

def Func(arg_0, arg_1, arg_2, arg_3=0.01, arg_4=1000, arg_5=1000, arg_6=0, arg_7=None, **arg_8):
        """Run the GNN on a pair x,y of FloatTensor data."""
        arg_7 = SETTINGS.get_default(arg_7=arg_7)
        arg_9 = th.optim.Adam(arg_0.parameters(), arg_3=arg_3)
        arg_10 = 0
        arg_11 = 0

        for arg_12 in range(arg_4 + arg_5):
            arg_9.zero_grad()
            arg_13 = arg_0.forward(arg_1)
            arg_14 = arg_0.criterion(arg_13, arg_2)
            arg_10 += arg_14.item()

            if arg_12 < arg_4:
                arg_14.backward()
                arg_9.step()
            else:
                arg_11 += arg_10

            # print statistics
            if arg_7 and not arg_12 % 300:
                print('Idx:{}; epoch:{}; score:{}'.
                      format(arg_6, arg_12, arg_10/300))
                arg_10 = 0.0

        return arg_11 / arg_5

Run the GNN on a pair x y of FloatTensor data .


def Func ( arg_0 , arg_1 = [ ] , arg_2 = 10 ) : if isinstance ( arg_1 , str ) : arg_1 = [ arg_1 ] try : arg_3 = open ( arg_0 , arg_2 ) except : return False arg_4 = arg_3 . info ( ) [ "Content-Type" ] for arg_5 in arg_1 : if arg_4 . startswith ( arg_5 ) : return True return False

def Func(arg_0, arg_1=[], arg_2=10):

    """ Determine the MIME-type of the document behind the url.

    MIME is more reliable than simply checking the document extension.
    Returns True when the MIME-type starts with anything in the list of types.

    """

    # Types can also be a single string for convenience.
    if isinstance(arg_1, str):
        arg_1 = [arg_1]

    try: arg_3 = open(arg_0, arg_2)
    except:
        return False

    arg_4 = arg_3.info()["Content-Type"]
    for arg_5 in arg_1:
        if arg_4.startswith(arg_5): return True

    return False

Determine the MIME - type of the document behind the url .


def Func(arg_0, arg_1, arg_2, arg_3):
  """Checks for calls to thread-unsafe functions.

  Much code has been originally written without consideration of
  multi-threading. Also, engineers are relying on their old experience;
  they have learned posix before threading extensions were added. These
  tests guide the engineers to use thread-safe functions (when using
  posix directly).

  Args:
    filename: The name of the current file.
    clean_lines: A CleansedLines instance containing the file.
    linenum: The number of the line to check.
    error: The function to call with any errors found.
  """
  arg_4 = arg_1.elided[arg_2]
  for arg_5, arg_6, arg_7 in _THREADING_LIST:
    # Additional pattern matching check to confirm that this is the
    # function we are looking for
    if Search(arg_7, arg_4):
      arg_3(arg_0, arg_2, 'runtime/threadsafe_fn', 2,
            'Consider using ' + arg_6 +
            '...) instead of ' + arg_5 +
            '...) for improved thread safety.')

Checks for calls to thread - unsafe functions .


def Func(arg_0, **arg_1):
        """
        Search for companies by name.

        Args:
            query: CGI escpaed string.
            page: (optional) Minimum value of 1. Expected value is an integer.

        Returns:
            A dict respresentation of the JSON returned from the API.
        """
        arg_2 = arg_0._get_path('Func')

        arg_3 = arg_0._GET(arg_2, arg_1)
        arg_0._set_attrs_to_values(arg_3)
        return arg_3


def Func(arg_0, arg_1, arg_2=False):
        '''Removes a piece from the given square if present.'''
        arg_3 = arg_0.piece_type_at(arg_1)

        if arg_3 == NONE:
            return

        if arg_2:
            arg_0.add_piece_into_hand(arg_3, arg_0.turn)

        arg_4 = BB_SQUARES[arg_1]

        arg_0.piece_bb[arg_3] ^= arg_4

        arg_5 = int(bool(arg_0.occupied[WHITE] & arg_4))

        arg_0.pieces[arg_1] = NONE
        arg_0.occupied.ixor(arg_4, arg_5, arg_1)

        # Update incremental zobrist hash.
        if arg_5 == BLACK:
            arg_7 = (arg_3 - 1) * 2
        else:
            arg_7 = (arg_3 - 1) * 2 + 1
        arg_0.incremental_zobrist_hash ^= DEFAULT_RANDOM_ARRAY[81 * arg_7 + 9 * rank_index(arg_1) + file_index(arg_1)]

Removes a piece from the given square if present .


(lst: list, content: str, indent: int=1)

def Func(arg_0: arg_1, arg_2: arg_3, arg_4: arg_5=1):
    """recurs into list for string computing """
    for arg_6 in arg_0:
        if isinstance(arg_6, indentable):
            arg_2 = arg_6.to_str(arg_2, arg_4)
        elif isinstance(arg_6, arg_1):
            arg_2 = Func(arg_6, arg_2, arg_4)
        elif isinstance(arg_6, arg_3):
            arg_2 = catend(arg_2, arg_6, arg_4)
    return arg_2


def Func ( ) : try : termios . tcsetattr ( _fd , termios . TCSANOW , _new_settings ) arg_0 = sys . stdin . read ( 1 ) finally : termios . tcsetattr ( _fd , termios . TCSADRAIN , _old_settings ) return arg_0

def Func():
    """
    get character. waiting for key
    """
    try:
        termios.tcsetattr(_fd, termios.TCSANOW, _new_settings)
        arg_0 = sys.stdin.read(1)
    finally:
        termios.tcsetattr(_fd, termios.TCSADRAIN, _old_settings)
    return arg_0


def Func ( arg_0 , arg_1 = 'year' ) : def get_date ( arg_2 ) : return datetime . datetime . strptime ( arg_2 . creation_date ( ) , '%Y-%m-%dT%H:%M:%S.%fZ' ) arg_3 = datetime . datetime . now ( ) if arg_1 == 'year' : arg_4 = [ ( arg_3 - datetime . timedelta ( days = k * 365 / 12 ) ) for k in range ( 12 ) ] elif arg_1 == 'month' : arg_4 = [ ( arg_3 - datetime . timedelta ( days = k ) ) for k in range ( 30 ) ] elif arg_1 == 'week' : arg_4 = [ ( arg_3 - datetime . timedelta ( days = k ) ) for k in range ( 7 ) ] arg_5 = [ 0 ] * len ( arg_4 ) if arg_1 == 'year' : for arg_2 in arg_0 : for arg_6 , arg_7 in enumerate ( arg_4 ) : date = get_date ( arg_2 ) if date . month == arg_7 . month : arg_5 [ arg_6 ] += 1 break else : continue else : for arg_2 in arg_0 : for arg_6 , arg_7 in enumerate ( arg_4 ) : date = get_date ( arg_2 ) if date . day == arg_7 . day and date . month == arg_7 . month : arg_5 [ arg_6 ] += 1 break else : continue arg_8 = [ ] arg_9 = [ ] for arg_6 , arg_10 in enumerate ( arg_5 ) : if arg_10 != 0 : arg_9 . append ( arg_6 ) arg_8 . append ( arg_10 ) arg_11 = sum ( arg_5 ) arg_12 = [ '#003f5c' , '#ffa600' , '#374c80' , '#ff764a' , '#7a5195' , '#ef5675' , '#bc5090' ] if arg_1 == 'year' : arg_13 = [ '{}-{}' . format ( str ( arg_4 [ b ] . year ) [ 2 : ] , arg_4 [ b ] . month ) for b in arg_9 ] else : arg_13 = [ '{}-{}' . format ( arg_4 [ b ] . month , arg_4 [ b ] . day ) for b in arg_9 ] arg_14 , arg_15 = plt . subplots ( 1 , 1 , figsize = ( 5 , 5 ) ) arg_15 . pie ( arg_8 [ : : - 1 ] , arg_13 = arg_13 , arg_12 = arg_12 , textprops = { 'fontsize' : 14 } , rotatelabels = True , counterclock = False ) arg_15 . add_artist ( Circle ( ( 0 , 0 ) , 0.7 , color = 'white' , zorder = 1 ) ) arg_15 . text ( 0 , 0 , arg_11 , horizontalalignment = 'center' , verticalalignment = 'center' , fontsize = 26 ) arg_14 . tight_layout ( ) return arg_14

def Func(arg_0, arg_1='year'):
    """Plots the job history of the user from the given list of jobs.

    Args:
        jobs (list): A list of jobs with type IBMQjob.
        interval (str): Interval over which to examine.

    Returns:
        fig: A Matplotlib figure instance.
    """
    def get_date(arg_2):
        """Returns a datetime object from a IBMQJob instance.

        Args:
            job (IBMQJob): A job.

        Returns:
            dt: A datetime object.
        """
        return datetime.datetime.strptime(arg_2.creation_date(),
                                          '%Y-%m-%dT%H:%M:%S.%fZ')

    arg_3 = datetime.datetime.now()

    if arg_1 == 'year':
        arg_4 = [(arg_3 - datetime.timedelta(days=k*365/12))
                for k in range(12)]
    elif arg_1 == 'month':
        arg_4 = [(arg_3 - datetime.timedelta(days=k)) for k in range(30)]
    elif arg_1 == 'week':
        arg_4 = [(arg_3 - datetime.timedelta(days=k)) for k in range(7)]

    arg_5 = [0]*len(arg_4)

    if arg_1 == 'year':
        for arg_2 in arg_0:
            for arg_6, arg_7 in enumerate(arg_4):
                date = get_date(arg_2)
                if date.month == arg_7.month:
                    arg_5[arg_6] += 1
                    break
            else:
                continue
    else:
        for arg_2 in arg_0:
            for arg_6, arg_7 in enumerate(arg_4):
                date = get_date(arg_2)
                if date.day == arg_7.day and date.month == arg_7.month:
                    arg_5[arg_6] += 1
                    break
            else:
                continue

    arg_8 = []
    arg_9 = []
    for arg_6, arg_10 in enumerate(arg_5):
        if arg_10 != 0:
            arg_9.append(arg_6)
            arg_8.append(arg_10)

    arg_11 = sum(arg_5)

    arg_12 = ['#003f5c', '#ffa600', '#374c80', '#ff764a',
              '#7a5195', '#ef5675', '#bc5090']

    if arg_1 == 'year':
        arg_13 = ['{}-{}'.format(str(arg_4[b].year)[2:], arg_4[b].month) for b in arg_9]
    else:
        arg_13 = ['{}-{}'.format(arg_4[b].month, arg_4[b].day) for b in arg_9]
    arg_14, arg_15 = plt.subplots(1, 1, figsize=(5, 5))  # pylint: disable=invalid-name
    arg_15.pie(arg_8[::-1], arg_13=arg_13, arg_12=arg_12, textprops={'fontsize': 14},
           rotatelabels=True, counterclock=False)
    arg_15.add_artist(Circle((0, 0), 0.7, color='white', zorder=1))
    arg_15.text(0, 0, arg_11, horizontalalignment='center',
            verticalalignment='center', fontsize=26)
    arg_14.tight_layout()
    return arg_14

Plots the job history of the user from the given list of jobs .


(inputs, reconstruct, num=3, name="reconstruction")

def Func ( arg_0 , arg_1 , arg_2 = 3 , arg_3 = "reconstruction" ) : arg_1 = tf . clip_by_value ( arg_1 , 0. , 1. ) arg_4 = tf . concat ( ( arg_0 [ : arg_2 ] , arg_1 [ : arg_2 ] ) , axis = 0 ) image_summary ( arg_4 , arg_3 )

def Func(arg_0, arg_1, arg_2=3, arg_3="reconstruction"):
  """Visualizes the reconstruction of inputs in TensorBoard.

  Args:
    inputs: A tensor of the original inputs, of shape [batch, timesteps,
      h, w, c].
    reconstruct: A tensor of a reconstruction of inputs, of shape
      [batch, timesteps, h, w, c].
    num: Integer for the number of examples to visualize.
    name: String name of this summary.
  """
  arg_1 = tf.clip_by_value(arg_1, 0., 1.)
  arg_4 = tf.concat((arg_0[:arg_2], arg_1[:arg_2]), axis=0)
  image_summary(arg_4, arg_3)

Visualizes the reconstruction of inputs in TensorBoard .


return self.warn_on_shadowed_name or self._opts.entry(
            WARN_ON_SHADOWED_VAR, False
        )

def Func ( arg_0 ) -> bool : return arg_0 . warn_on_shadowed_name or arg_0 . _opts . entry ( WARN_ON_SHADOWED_VAR , False )

def Func(arg_0) -> bool:
        """If True, warn when a def'ed Var name is shadowed in an inner scope.

        Implied by warn_on_shadowed_name. The value of warn_on_shadowed_name
        supersedes the value of this flag."""
        return arg_0.warn_on_shadowed_name or arg_0._opts.entry(
            WARN_ON_SHADOWED_VAR, False
        )

If True warn when a def ed Var name is shadowed in an inner scope .


async
def
Func
(
arg_0
,
arg_1
=
arg_1
,
arg_2
=
)
:
arg_3
=
arg_0
.
headers
.
get
(
'Content-Type'
,
""
)
.
lower
(
)
try
:
if
"application/json"
in
arg_3
:
logger
.
info
(
"decoding data as json"
)
return
await
arg_0
.
json
(
arg_2
=
arg_2
,
arg_1
=
arg_1
)
if
"text"
in
arg_3
:
logger
.
info
(
"decoding data as text"
)
return
await
arg_0
.
text
(
arg_2
=
arg_2
)
except
(
UnicodeDecodeError
,
json
.
JSONDecodeError
)
as
exc
:
arg_4
=
await
arg_0
.
Func
(
)
raise
exceptions
.
PeonyDecodeError
(
arg_0
=
arg_0
,
arg_4
=
arg_4
,
exception
=
exc
)
return
await
arg_0
.
Func
(
)

async def Func(arg_0, arg_1=arg_1, arg_2=None):
    """
        Func the data of the response

    Parameters
    ----------
    response : aiohttp.ClientResponse
        response
    loads : callable
        json loads function
    encoding : :obj:`str`, optional
        character encoding of the response, if set to None
        aiohttp should guess the right encoding

    Returns
    -------
    :obj:`bytes`, :obj:`str`, :obj:`dict` or :obj:`list`
        the data returned depends on the response
    """
    arg_3 = arg_0.headers.get('Content-Type', "").lower()

    try:
        if "application/json" in arg_3:
            logger.info("decoding data as json")
            return await arg_0.json(arg_2=arg_2, arg_1=arg_1)

        if "text" in arg_3:
            logger.info("decoding data as text")
            return await arg_0.text(arg_2=arg_2)

    except (UnicodeDecodeError, json.JSONDecodeError) as exc:
        arg_4 = await arg_0.Func()
        raise exceptions.PeonyDecodeError(arg_0=arg_0,
                                          arg_4=arg_4,
                                          exception=exc)

    return await arg_0.Func()

read the data of the response

    Parameters
    ----------
    response : aiohttp.ClientResponse
        response
    loads : callable
        json loads function
    encoding : :obj:`str`, optional
        character encoding of the response, if set to None
        aiohttp should guess the right encoding

    Returns
    -------
    :obj:`bytes`, :obj:`str`, :obj:`dict` or :obj:`list`
        the data returned depends on the response


def Func ( arg_0 , arg_1 ) : if arg_1 == arg_0 . package_name : return os . path . join ( arg_0 . root_path , '__init__.py' ) arg_2 = arg_1 . replace ( '.' , os . path . sep ) arg_2 = arg_2 . replace ( arg_0 . package_name + os . path . sep , '' ) arg_2 = os . path . join ( arg_0 . root_path , arg_2 ) if os . path . exists ( arg_2 + '.py' ) : arg_2 += '.py' elif os . path . exists ( os . path . join ( arg_2 , '__init__.py' ) ) : arg_2 = os . path . join ( arg_2 , '__init__.py' ) else : return None return arg_2

def Func(arg_0, arg_1):
        ''' Convert uri to absolute filepath

        Parameters
        ----------
        uri : string
            URI of python module to return path for

        Returns
        -------
        path : None or string
            Returns None if there is no valid path for this URI
            Otherwise returns absolute file system path for URI

        Examples
        --------
        >>> docwriter = ApiDocWriter('sphinx')
        >>> import sphinx
        >>> modpath = sphinx.__path__[0]
        >>> res = docwriter.Func('sphinx.builder')
        >>> res == os.path.join(modpath, 'builder.py')
        True
        >>> res = docwriter.Func('sphinx')
        >>> res == os.path.join(modpath, '__init__.py')
        True
        >>> docwriter.Func('sphinx.does_not_exist')

        '''
        if arg_1 == arg_0.package_name:
            return os.path.join(arg_0.root_path, '__init__.py')
        arg_2 = arg_1.replace('.', os.path.sep)
        arg_2 = arg_2.replace(arg_0.package_name + os.path.sep, '')
        arg_2 = os.path.join(arg_0.root_path, arg_2)
        # XXX maybe check for extensions as well?
        if os.path.exists(arg_2 + '.py'): # file
            arg_2 += '.py'
        elif os.path.exists(os.path.join(arg_2, '__init__.py')):
            arg_2 = os.path.join(arg_2, '__init__.py')
        else:
            return None
        return arg_2

Convert uri to absolute filepath

        Parameters
        ----------
        uri : string
            URI of python module to return path for

        Returns
        -------
        path : None or string
            Returns None if there is no valid path for this URI
            Otherwise returns absolute file system path for URI

        Examples
        --------
        >>> docwriter = ApiDocWriter('sphinx')
        >>> import sphinx
        >>> modpath = sphinx.__path__[0]
        >>> res = docwriter._uri2path('sphinx.builder')
        >>> res == os.path.join(modpath, 'builder.py')
        True
        >>> res = docwriter._uri2path('sphinx')
        >>> res == os.path.join(modpath, '__init__.py')
        True
        >>> docwriter._uri2path('sphinx.does_not_exist')


def Func ( arg_0 : arg_1 [ arg_2 ] = None ) -> Session : if arg_0 is None : arg_0 = get_global_connection ( ) arg_3 = create_engine ( arg_0 ) create_all ( arg_3 ) arg_4 = sessionmaker ( bind = arg_3 ) arg_5 = arg_4 ( ) return arg_5

def Func(arg_0: arg_1[arg_2] = None) -> Session:
    """Make a session."""
    if arg_0 is None:
        arg_0 = get_global_connection()

    arg_3 = create_engine(arg_0)

    create_all(arg_3)

    arg_4 = sessionmaker(bind=arg_3)
    arg_5 = arg_4()

    return arg_5


def
Func
(
arg_0
,
arg_1
,
arg_2
=
)
:
arg_3
,
arg_4
=
institute_and_case
(
store
,
arg_0
,
arg_1
)
arg_5
=
url_for
(
'.case'
,
arg_0
=
arg_0
,
arg_1
=
arg_1
)
arg_6
=
request
.
args
.
get
(
'is_group'
)
==
'yes'
arg_7
=
store
.
user
(
current_user
.
email
)
if
arg_2
:
store
.
remove_phenotype
(
arg_3
,
arg_4
,
arg_7
,
arg_5
,
arg_2
,
arg_6
=
arg_6
)
else
:
try
:
arg_8
=
request
.
form
[
'hpo_term'
]
if
arg_8
.
startswith
(
'HP:'
)
or
len
(
arg_8
)
==
7
:
arg_9
=
arg_8
.
split
(
' | '
,
1
)
[
0
]
store
.
add_phenotype
(
arg_3
,
arg_4
,
arg_7
,
arg_5
,
arg_9
=
arg_9
,
arg_6
=
arg_6
)
else
:
store
.
add_phenotype
(
arg_3
,
arg_4
,
arg_7
,
arg_5
,
omim_term
=
arg_8
)
except
ValueError
:
return
abort
(
400
,
(
"unable to add phenotype: {}"
.
format
(
arg_8
)
)
)
return
redirect
(
arg_5
)

def Func(arg_0, arg_1, arg_2=None):
    """Handle Func."""
    arg_3, arg_4 = institute_and_case(store, arg_0, arg_1)
    arg_5 = url_for('.case', arg_0=arg_0, arg_1=arg_1)
    arg_6 = request.args.get('is_group') == 'yes'
    arg_7 = store.user(current_user.email)

    if arg_2:
        # DELETE a phenotype item/group from case
        store.remove_phenotype(arg_3, arg_4, arg_7, arg_5,
                               arg_2, arg_6=arg_6)
    else:
        try:
            # add a new phenotype item/group to the case
            arg_8 = request.form['hpo_term']
            if arg_8.startswith('HP:') or len(arg_8) == 7:
                arg_9 = arg_8.split(' | ', 1)[0]
                store.add_phenotype(arg_3, arg_4, arg_7, arg_5,
                                    arg_9=arg_9, arg_6=arg_6)
            else:
                # assume omim id
                store.add_phenotype(arg_3, arg_4, arg_7, arg_5,
                                    omim_term=arg_8)
        except ValueError:
            return abort(400, ("unable to add phenotype: {}".format(arg_8)))
    return redirect(arg_5)


def
Func
(
arg_0
,
arg_1
:
arg_2
)
->
arg_2
:
if
arg_1
not
in
arg_0
.
_vars
:
raise
ConfigError
(
f"{self.name}.{name} not defined."
)
return
arg_0
.
_vars
[
arg_1
]
.
description

def Func(arg_0, arg_1: arg_2) -> arg_2:
        """
        Return the description, or a help string of variable identified by |name|.
        """
        if arg_1 not in arg_0._vars:
            raise ConfigError(f"{self.name}.{name} not defined.")

        return arg_0._vars[arg_1].description

Return the description or a help string of variable identified by |name| .


def Func ( arg_0 ) : if arg_0 . _gone : return False try : return arg_0 . create_time == arg_0 . _platform_impl . get_process_create_time ( ) except NoSuchProcess : arg_0 . _gone = True return False

def Func(arg_0):
        """Return whether this process is running."""
        if arg_0._gone:
            return False
        try:
            # Checking if pid is alive is not enough as the pid might
            # have been reused by another process.
            # pid + creation time, on the other hand, is supposed to
            # identify a process univocally.
            return arg_0.create_time == \
                   arg_0._platform_impl.get_process_create_time()
        except NoSuchProcess:
            arg_0._gone = True
            return False

Return whether this process is running .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ) : if arg_0 . character in arg_4 [ 'bunker_hitters' ] : return arg_0 . _teleport ( ( - 1 , - 1 ) ) if arg_0 . position == arg_3 [ 'P' ] . position : arg_4 . terminate_episode ( ) arg_0 . _south ( arg_1 , arg_4 )

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
    """Handles the behaviour of visible bolts flying toward the player."""
    # Disappear if we've hit a bunker.
    if arg_0.character in arg_4['bunker_hitters']:
      return arg_0._teleport((-1, -1))
    # End the game if we've hit the player.
    if arg_0.position == arg_3['P'].position: arg_4.terminate_episode()
    arg_0._south(arg_1, arg_4)

Handles the behaviour of visible bolts flying toward the player .


def Func(arg_0):
    '''
    A decorator for a annotating a function that can take the selected properties
    of a ``config_value`` and an instance of a custom type and materialize it.

    Args:
        config_cls (Selector):
    '''
    arg_1 = resolve_config_cls_arg(arg_0)
    check.param_invariant(arg_1.is_selector, 'config_cls')

    def _wrap(arg_2):
        def _selector(arg_3, arg_4, arg_5):
            arg_6, arg_7 = single_item(arg_4)
            return arg_2(arg_3, arg_6, arg_7, arg_5)

        return _create_output_schema(arg_1, _selector)

    return _wrap

A decorator for a annotating a function that can take the selected properties of a config_value and an instance of a custom type and materialize it .


def Func(arg_0):
  """
  Returns all the file state_managers.
  """
  arg_1 = []
  arg_2 = arg_0.get_state_locations_of_type("file")
  for arg_3 in arg_2:
    arg_4 = arg_3['name']
    arg_5 = os.path.expanduser(arg_3['rootpath'])
    LOG.info("Connecting to file state with rootpath: " + arg_5)
    arg_6 = FileStateManager(arg_4, arg_5)
    arg_1.append(arg_6)

  return arg_1


def Func ( arg_0 = 250 , ** arg_1 ) : arg_2 = minimal_random_graph ( arg_0 , ** arg_1 ) arg_3 = np . zeros ( arg_0 ) for arg_4 , arg_5 in nx . pagerank ( arg_2 ) . items ( ) : arg_3 [ arg_4 ] = arg_5 arg_2 = set_types_rank ( arg_2 , rank = arg_3 , ** arg_1 ) return arg_2

def Func(arg_0=250, **arg_1):
    """Creates a random graph where the vertex types are
    selected using their pagerank.

    Calls :func:`.minimal_random_graph` and then
    :func:`.set_types_rank` where the ``rank`` keyword argument
    is given by :func:`networkx.pagerank`.

    Parameters
    ----------
    num_vertices : int (optional, the default is 250)
        The number of vertices in the graph.
    **kwargs :
        Any parameters to send to :func:`.minimal_random_graph` or
        :func:`.set_types_rank`.

    Returns
    -------
    :class:`.QueueNetworkDiGraph`
        A graph with a ``pos`` vertex property and the ``edge_type``
        edge property.

    Notes
    -----
    This function sets the edge types of a graph to be either 1, 2, or
    3. It sets the vertices to type 2 by selecting the top
    ``pType2 * g.number_of_nodes()`` vertices given by the
    :func:`~networkx.pagerank` of the graph. A loop is added
    to all vertices identified this way (if one does not exist
    already). It then randomly sets vertices close to the type 2
    vertices as type 3, and adds loops to these vertices as well. These
    loops then have edge types that correspond to the vertices type.
    The rest of the edges are set to type 1.
    """
    arg_2 = minimal_random_graph(arg_0, **arg_1)
    arg_3 = np.zeros(arg_0)
    for arg_4, arg_5 in nx.pagerank(arg_2).items():
        arg_3[arg_4] = arg_5
    arg_2 = set_types_rank(arg_2, rank=arg_3, **arg_1)
    return arg_2

Creates a random graph where the vertex types are selected using their pagerank .


def Func ( arg_0 , arg_1 ) : if isinstance ( arg_1 , int ) : return sympy . Integer ( arg_1 ) elif isinstance ( arg_1 , list ) : return tuple ( [ arg_0 . Func ( arg_2 ) for arg_2 in arg_1 ] ) elif arg_1 is None : return None else : arg_3 = { c : symbol_pos_int ( c ) for c in arg_1 if c in string . ascii_letters } arg_4 = parse_expr ( arg_1 , arg_3 = arg_3 ) arg_3 . update ( { arg_1 . name : symbol_pos_int ( arg_1 . name ) for arg_1 in arg_4 . free_symbols } ) return parse_expr ( arg_1 , arg_3 = arg_3 )

def Func(arg_0, arg_1):
        """Convert any string to a sympy object or None."""
        if isinstance(arg_1, int):
            return sympy.Integer(arg_1)
        elif isinstance(arg_1, list):
            return tuple([arg_0.Func(arg_2) for arg_2 in arg_1])
        elif arg_1 is None:
            return None
        else:
            # Step 1 build expression with the whole alphabet redefined:
            arg_3 = {c: symbol_pos_int(c) for c in arg_1 if c in string.ascii_letters}
            # TODO find nicer solution for N and other pre-mapped letters
            arg_4 = parse_expr(arg_1, arg_3=arg_3)
            # Replace all free symbols with positive integer versions:
            arg_3.update(
                {arg_1.name: symbol_pos_int(arg_1.name) for arg_1 in arg_4.free_symbols})
            return parse_expr(arg_1, arg_3=arg_3)

Convert any string to a sympy object or None .


def Func(arg_0, arg_1, arg_2, arg_3):
  """Checks for horizontal spacing around parentheses.

  Args:
    filename: The name of the current file.
    clean_lines: A CleansedLines instance containing the file.
    linenum: The number of the line to check.
    error: The function to call with any errors found.
  """
  arg_4 = arg_1.elided[arg_2]

  # No spaces after an if, while, switch, or for
  arg_5 = Search(r' (if\(|for\(|while\(|switch\()', arg_4)
  if arg_5:
    arg_3(arg_0, arg_2, 'whitespace/parens', 5,
          'Missing space before ( in %s' % arg_5.group(1))

  # For if/for/while/switch, the left and right parens should be
  # consistent about how many spaces are inside the parens, and
  # there should either be zero or one spaces inside the parens.
  # We don't want: "if ( foo)" or "if ( foo   )".
  # Exception: "for ( ; foo; bar)" and "for (foo; bar; )" are allowed.
  arg_5 = Search(r'\b(if|for|while|switch)\s*'
                 r'\(([ ]*)(.).*[^ ]+([ ]*)\)\s*{\s*$',
                 arg_4)
  if arg_5:
    if len(arg_5.group(2)) != len(arg_5.group(4)):
      if not (arg_5.group(3) == ';' and
              len(arg_5.group(2)) == 1 + len(arg_5.group(4)) or
              not arg_5.group(2) and Search(r'\bfor\s*\(.*; \)', arg_4)):
        arg_3(arg_0, arg_2, 'whitespace/parens', 5,
              'Mismatching spaces inside () in %s' % arg_5.group(1))
    if len(arg_5.group(2)) not in [0, 1]:
      arg_3(arg_0, arg_2, 'whitespace/parens', 5,
            'Should have zero or one spaces inside ( and ) in %s' %
            arg_5.group(1))

Checks for horizontal spacing around parentheses .


def Func ( arg_0 ) : arg_1 = arg_0 . copy ( name = arg_0 . name + '_dg' ) arg_1 . data = [ ] for arg_3 , arg_4 , arg_5 in reversed ( arg_0 . data ) : arg_1 . data . append ( ( arg_3 . Func ( ) , arg_4 , arg_5 ) ) return arg_1

def Func(arg_0):
        """Invert this circuit.

        This is done by recursively inverting all gates.

        Returns:
            QuantumCircuit: the inverted circuit

        Raises:
            QiskitError: if the circuit cannot be inverted.
        """
        arg_1 = arg_0.copy(name=arg_0.name+'_dg')
        arg_1.data = []
        for arg_3, arg_4, arg_5 in reversed(arg_0.data):
            arg_1.data.append((arg_3.Func(), arg_4, arg_5))
        return arg_1


def Func(arg_0, arg_1):
    '''Create a new template module.

    You can also specify a filesystem path like "./modules/new_module"
    '''

    click.echo('Creating module {}...'.format(arg_0), nl=False)
    try:
        arg_2 = cpenv.Func_module(arg_0, arg_1)
    except Exception as e:
        click.echo(bold_red('FAILED'))
        raise
    else:
        click.echo(bold_green('OK!'))
        click.echo('Browse to your new module and make some changes.')
        click.echo("When you're ready add the module to an environment:")
        click.echo('    cpenv module add my_module ./path/to/my_module')
        click.echo('Or track your module on git and add it directly from the repo:')
        click.echo('    cpenv module add my_module git@github.com:user/my_module.git')


def Func(arg_0, arg_1):
        """Fetch an Askbot HTML question body.

        The method fetchs the HTML question retrieving the
        question body of the item question received

        :param question: item with the question itself

        :returns: a list of HTML page/s for the question
        """
        arg_2 = []

        arg_3 = 1
        arg_4 = True

        while arg_4:
            try:
                arg_5 = arg_0.client.get_html_question(arg_1['id'], arg_3)
                arg_2.append(arg_5)
                arg_6 = arg_0.ab_parser.parse_number_of_html_pages(arg_5)

                if arg_3 == arg_6:
                    arg_4 = False

                arg_3 = arg_3 + 1
            except requests.exceptions.TooManyRedirects as e:
                logger.warning("%s, data not retrieved for question %s", e, arg_1['id'])
                arg_4 = False

        return arg_2


(self, mux, gain, data_rate, mode, high_threshold,
                         low_threshold, active_low, traditional, latching,
                         num_readings)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5,
                         arg_6, arg_7, arg_8, arg_9,
                         arg_10):
        """Perform an ADC read with the provided mux, gain, data_rate, and mode
        values and with the comparator enabled as specified.  Returns the signed
        integer result of the read.
        """
        assert arg_10 == 1 or arg_10 == 2 or arg_10 == 4, 'Num readings must be 1, 2, or 4!'
        # Set high and low threshold register values.
        arg_0._device.writeList(ADS1x15_POINTER_HIGH_THRESHOLD, [(arg_5 >> 8) & 0xFF, arg_5 & 0xFF])
        arg_0._device.writeList(ADS1x15_POINTER_LOW_THRESHOLD, [(arg_6 >> 8) & 0xFF, arg_6 & 0xFF])
        # Now build up the appropriate config register value.
        arg_11 = ADS1x15_CONFIG_OS_SINGLE  # Go out of power-down mode for conversion.
        # Specify mux value.
        arg_11 |= (arg_1 & 0x07) << ADS1x15_CONFIG_MUX_OFFSET
        # Validate the passed in gain and then set it in the config.
        if arg_2 not in ADS1x15_CONFIG_GAIN:
            raise ValueError('Gain must be one of: 2/3, 1, 2, 4, 8, 16')
        arg_11 |= ADS1x15_CONFIG_GAIN[arg_2]
        # Set the mode (continuous or single shot).
        arg_11 |= arg_4
        # Get the default data rate if none is specified (default differs between
        # ADS1015 and ADS1115).
        if arg_3 is None:
            arg_3 = arg_0._data_rate_default()
        # Set the data rate (this is controlled by the subclass as it differs
        # between ADS1015 and ADS1115).
        arg_11 |= arg_0._data_rate_config(arg_3)
        # Enable window mode if required.
        if not arg_8:
            arg_11 |= ADS1x15_CONFIG_COMP_WINDOW
        # Enable active high mode if required.
        if not arg_7:
            arg_11 |= ADS1x15_CONFIG_COMP_ACTIVE_HIGH
        # Enable latching mode if required.
        if arg_9:
            arg_11 |= ADS1x15_CONFIG_COMP_LATCHING
        # Set number of comparator hits before alerting.
        arg_11 |= ADS1x15_CONFIG_COMP_QUE[arg_10]
        # Send the config value to start the ADC conversion.
        # Explicitly break the 16-bit value down to a big endian pair of bytes.
        arg_0._device.writeList(ADS1x15_POINTER_CONFIG, [(arg_11 >> 8) & 0xFF, arg_11 & 0xFF])
        # Wait for the ADC sample to finish based on the sample rate plus a
        # small offset to be sure (0.1 millisecond).
        time.sleep(1.0/arg_3+0.0001)
        # Retrieve the result.
        arg_12 = arg_0._device.readList(ADS1x15_POINTER_CONVERSION, 2)
        return arg_0._conversion_value(arg_12[1], arg_12[0])

Perform an ADC read with the provided mux gain data_rate and mode values and with the comparator enabled as specified . Returns the signed integer result of the read .


return Property(lambda obj: getattr(obj, name),
                    lambda obj, val: setattr(obj, name, val),
                    **metadata)

def Func ( arg_0 , ** arg_1 ) : return Property ( lambda obj : getattr ( obj , arg_0 ) , lambda obj , val : setattr ( obj , arg_0 , val ) , ** arg_1 )

def Func(arg_0, **arg_1):
    """ Syntactically concise alias trait but creates a pair of lambda
    functions for every alias you declare.

    class MyClass(HasTraits):
        line_width = Float(3.0)
        thickness = Func("line_width")

    """

    return Property(lambda obj: getattr(obj, arg_0),
                    lambda obj, val: setattr(obj, arg_0, val),
                    **arg_1)

Syntactically concise alias trait but creates a pair of lambda
    functions for every alias you declare.

    class MyClass(HasTraits):
        line_width = Float(3.0)
        thickness = Alias("line_width")

Syntactically concise alias trait but creates a pair of lambda functions for every alias you declare .


def Func ( arg_0 , arg_1 , arg_2 = False ) : save_logger . info ( arg_1 ) arg_3 = arg_0 . all_parameters arg_4 = [ p . get_value ( ) . copy ( ) for p in arg_3 ] if arg_2 : arg_5 = Thread ( target = save_network_params , args = ( arg_4 , arg_1 ) ) arg_5 . start ( ) else : save_network_params ( arg_4 , arg_1 ) arg_0 . train_logger . save ( arg_1 )

def Func(arg_0, arg_1, arg_2=False):
        """
        Save parameters to file.
        """
        save_logger.info(arg_1)
        arg_3 = arg_0.all_parameters
        arg_4 = [p.get_value().copy() for p in arg_3]
        if arg_2:
            arg_5 = Thread(target=save_network_params, args=(arg_4, arg_1))
            arg_5.start()
        else:
            save_network_params(arg_4, arg_1)
        arg_0.train_logger.save(arg_1)


def Func(arg_0):
        """Timeout requesting in REQUESTING state.

        Not specifiyed in [:rfc:`7844`]

        [:rfc:`2131#section-3.1`]::

            might retransmit the
            DHCPREQUEST message four times, for a total delay of 60 seconds

        """
        logger.debug("C3.2: T. In %s, timeout receiving response to request, ",
                     arg_0.current_state)
        if arg_0.discover_requests >= MAX_ATTEMPTS_REQUEST:
            logger.debug('C2.3: T. Maximum number %s of REQUESTs '
                         'reached, already sent %s, raise ERROR.',
                         MAX_ATTEMPTS_REQUEST, arg_0.disover_requests)
            raise arg_0.ERROR()
        logger.debug("C2.3: F. Maximum number of REQUESTs retries not reached,"
                     "raise REQUESTING.")
        raise arg_0.REQUESTING()

Timeout requesting in REQUESTING state .


(cluster_id, profile, engines, timeout, cores, quiet, spacer, **kwargs)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
,
arg_5
,
arg_6
,
**
arg_7
)
:
arg_8
=
arg_10
.
stdout
arg_9
=
arg_10
.
stderr
arg_10
.
stdout
=
cStringIO
.
StringIO
(
)
arg_10
.
stderr
=
cStringIO
.
StringIO
(
)
arg_13
=
"{}establishing parallel connection:"
.
format
(
arg_6
)
try
:
if
arg_1
not
in
[
,
"default"
]
:
arg_14
=
{
'profile'
:
arg_1
,
"timeout"
:
arg_3
}
else
:
arg_15
=
[
arg_0
,
arg_1
,
arg_3
]
arg_16
=
[
"cluster_id"
,
"profile"
,
"timeout"
]
arg_14
=
{
key
:
value
for
key
,
value
in
zip
(
arg_16
,
arg_15
)
}
arg_17
=
ipp
.
Client
(
**
arg_14
)
arg_10
.
stdout
=
arg_8
arg_10
.
stderr
=
arg_9
if
(
arg_2
==
"MPI"
)
or
(
"ipyrad-cli-"
in
arg_0
)
:
if
not
arg_5
:
print
(
arg_13
)
for
arg_18
in
range
(
6000
)
:
arg_19
=
len
(
arg_17
)
time
.
sleep
(
0.01
)
if
(
arg_2
==
"MPI"
)
or
(
"ipyrad-cli-"
in
arg_0
)
:
if
arg_4
:
time
.
sleep
(
0.1
)
if
arg_19
==
arg_4
:
break
if
arg_19
:
time
.
sleep
(
3
)
if
len
(
arg_17
)
==
arg_19
:
break
else
:
if
arg_4
:
if
arg_19
==
arg_4
:
break
else
:
if
arg_19
:
break
except
KeyboardInterrupt
as
inst
:
arg_10
.
stdout
=
arg_8
arg_10
.
stderr
=
arg_9
raise
inst
except
IOError
as
inst
:
arg_10
.
stdout
=
arg_8
arg_10
.
stderr
=
arg_9
if
"ipyrad-cli-"
in
arg_0
:
raise
IPyradWarningExit
(
NO_IPCLUSTER_CLI
)
else
:
raise
IPyradWarningExit
(
NO_IPCLUSTER_API
)
except
(
ipp
.
TimeoutError
,
ipp
.
NoEnginesRegistered
)
as
inst
:
arg_10
.
stdout
=
arg_8
arg_10
.
stderr
=
arg_9
raise
inst
except
Exception
as
inst
:
arg_10
.
stdout
=
arg_8
arg_10
.
stderr
=
arg_9
raise
inst
finally
:
arg_10
.
stdout
=
arg_8
arg_10
.
stderr
=
arg_9
return
arg_17

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6, **arg_7):
    """
    Creates a client to view ipcluster engines for a given profile and
    returns it with at least one engine spun up and ready to go. If no
    engines are found after nwait amount of time then an error is raised.
    If engines==MPI it waits a bit longer to find engines. If the number
    of engines is set then it waits even longer to try to find that number
    of engines.
    """

    ## save stds for later, we're gonna hide them to prevent external printing
    arg_8 = arg_10.stdout
    arg_9 = arg_10.stderr
    arg_10.stdout = cStringIO.StringIO()
    arg_10.stderr = cStringIO.StringIO()

    ## get cluster_info print string
    arg_13 = "{}establishing parallel connection:".format(arg_6)

    ## wrapped search for ipcluster
    try:
        ## are we looking for a running ipcluster instance?
        if arg_1 not in [None, "default"]:
            arg_14 = {'profile': arg_1, "timeout": arg_3}
        else:
            arg_15 = [arg_0, arg_1, arg_3]
            arg_16 = ["cluster_id", "profile", "timeout"]
            arg_14 = {key:value for key, value in zip(arg_16, arg_15)}

        ## get connection within timeout window of wait time and hide messages
        arg_17 = ipp.Client(**arg_14)
        arg_10.stdout = arg_8
        arg_10.stderr = arg_9

        ## check that all engines have connected
        if (arg_2 == "MPI") or ("ipyrad-cli-" in arg_0):
            if not arg_5:
                print(arg_13)

        for arg_18 in range(6000):
            arg_19 = len(arg_17)
            time.sleep(0.01)
            ## If MPI then wait for all engines to start so we can report
            ## how many cores are on each host. If Local then only wait for
            ## one engine to be ready and then just go.
            if (arg_2 == "MPI") or ("ipyrad-cli-" in arg_0):
                ## wait for cores to be connected
                if arg_4:
                    time.sleep(0.1)
                    if arg_19 == arg_4:
                        break
                if arg_19:
                    time.sleep(3)
                    if len(arg_17) == arg_19:
                        break
            else:
                if arg_4:
                    if arg_19 == arg_4:
                        break
                else:
                    if arg_19:
                        break

    except KeyboardInterrupt as inst:
        ## ensure stdout is reset even if Exception was raised
        arg_10.stdout = arg_8
        arg_10.stderr = arg_9
        raise inst

    ## This is raised if ipcluster is not running ------------
    except IOError as inst:
        ## ensure stdout is reset even if Exception was raised
        arg_10.stdout = arg_8
        arg_10.stderr = arg_9
        if "ipyrad-cli-" in arg_0:
            raise IPyradWarningExit(NO_IPCLUSTER_CLI)
        else:
            raise IPyradWarningExit(NO_IPCLUSTER_API)

    except (ipp.TimeoutError, ipp.NoEnginesRegistered) as inst:
        ## raised by ipp if no connection file is found for 'nwait' seconds
        arg_10.stdout = arg_8
        arg_10.stderr = arg_9
        raise inst

    except Exception as inst:
        ## if any other exceptions were missed...
        arg_10.stdout = arg_8
        arg_10.stderr = arg_9
        raise inst

    finally:
        ## ensure that no matter what we reset the stds
        arg_10.stdout = arg_8
        arg_10.stderr = arg_9

    return arg_17

Creates a client to view ipcluster engines for a given profile and returns it with at least one engine spun up and ready to go . If no engines are found after nwait amount of time then an error is raised . If engines == MPI it waits a bit longer to find engines . If the number of engines is set then it waits even longer to try to find that number of engines .


def
Func
(
arg_0
,
arg_1
=
,
arg_2
=
{
}
)
:
arg_3
=
getArgumentDescriptions
(
arg_0
)
arg_3
=
arg_3
[
1
:
]
arg_4
=
TMRegion
.
__init__
arg_5
=
[
t
[
0
]
for
t
in
getArgumentDescriptions
(
arg_4
)
]
arg_5
+=
[
'numberOfCols'
,
]
for
arg_6
in
arg_3
[
:
]
:
if
arg_6
[
0
]
in
arg_5
:
arg_3
.
remove
(
arg_6
)
if
arg_1
:
for
arg_6
in
arg_3
:
arg_7
=
arg_6
[
0
]
if
arg_7
in
arg_2
:
arg_8
=
arg_2
.
pop
(
arg_7
)
else
:
if
len
(
arg_6
)
==
2
:
raise
TypeError
(
"Must provide '%s'"
%
arg_7
)
arg_8
=
arg_6
[
2
]
setattr
(
arg_1
,
arg_7
,
arg_8
)
return
arg_3

def Func(arg_0, arg_1=None, arg_2={}):
  """
  Get the default arguments from the function and assign as instance vars.

  Return a list of 3-tuples with (name, description, defaultValue) for each
    argument to the function.

  Assigns all arguments to the function as instance variables of TMRegion.
  If the argument was not provided, uses the default value.

  Pops any values from kwargs that go to the function.
  """
  # Get the name, description, and default value for each argument
  arg_3 = getArgumentDescriptions(arg_0)
  arg_3 = arg_3[1:]  # Remove 'self'

  # Get the names of the parameters to our own constructor and remove them
  # Check for _originial_init first, because if LockAttributesMixin is used,
  #  __init__'s signature will be just (self, *args, **kw), but
  #  _original_init is created with the original signature
  #init = getattr(self, '_original_init', self.__init__)
  arg_4 = TMRegion.__init__
  arg_5 = [t[0] for t in getArgumentDescriptions(arg_4)]
  # Also remove a few other names that aren't in our constructor but are
  #  computed automatically (e.g. numberOfCols for the TM)
  arg_5 += [
    'numberOfCols',    # TM
  ]
  for arg_6 in arg_3[:]:
    if arg_6[0] in arg_5:
      arg_3.remove(arg_6)

  # Build the dictionary of arguments
  if arg_1:
    for arg_6 in arg_3:
      arg_7 = arg_6[0]
      if arg_7 in arg_2:
        # Argument was provided
        arg_8 = arg_2.pop(arg_7)
      else:
        # Argument was not provided; use the default value if there is one, and
        #  raise an exception otherwise
        if len(arg_6) == 2:
          # No default value
          raise TypeError("Must provide '%s'" % arg_7)
        arg_8 = arg_6[2]
      # Set as an instance variable if 'self' was passed in
      setattr(arg_1, arg_7, arg_8)

  return arg_3

Get the default arguments from the function and assign as instance vars .


(default='', whole_words=0, case_sensitive=0, parent=None)

return {'text': result.searchText, 'whole_words': result.wholeWordsOnly,
            'case_sensitive': result.caseSensitive}

def Func ( arg_0 = '' , arg_1 = 0 , arg_2 = 0 , arg_3 = None ) : arg_4 = dialogs . FuncDialog ( arg_3 , arg_0 , arg_1 , arg_2 ) return { 'text' : arg_4 . searchText , 'whole_words' : arg_4 . wholeWordsOnly , 'case_sensitive' : arg_4 . caseSensitive }

def Func(arg_0='', arg_1=0, arg_2=0, arg_3=None):
    "Shows a Func text dialog"
    arg_4 = dialogs.FuncDialog(arg_3, arg_0, arg_1, arg_2)
    return {'text': arg_4.searchText, 'whole_words': arg_4.wholeWordsOnly,
            'case_sensitive': arg_4.caseSensitive}


(internal_id, display_name, sanger_recipients=None,
                    coverage_cutoff=None, frequency_cutoff=None)

def Func(arg_0, arg_1, arg_2=None,
                    arg_3=None, arg_4=None):
    """Build a institute object

    Args:
        internal_id(str)
        display_name(str)
        sanger_recipients(list(str)): List with email addresses

    Returns:
        institute_obj(scout.models.Institute)

    """

    LOG.info("Building institute %s with display name %s", arg_0,arg_1)

    arg_5 = Institute(
        arg_0=arg_0,
        arg_1=arg_1,
        arg_2=arg_2,
        arg_3 = arg_3,
        arg_4 = arg_4
    )

    for arg_6 in list(arg_5):
        if arg_5[arg_6] is None:
            arg_5.pop(arg_6)

    return arg_5


def Func ( arg_0 , arg_1 : arg_2 ) -> List [ List [ int ] ] : return arg_0 . _type_to_spans [ arg_1 ]

def Func(arg_0, arg_1: arg_2) -> List[List[int]]:
        """Return all the sub-span including self._span."""
        return arg_0._type_to_spans[arg_1]

Return all the sub - span including self . _span .


def Func(arg_0=None):
    """
    By wrapping a test function with this decorator, you can return a
    twisted Deferred and the test will wait for the Func to be triggered.
    The whole test function will run inside the Twisted event loop.

    The optional timeout parameter specifies the maximum duration of the test.
    The difference with timed() is that timed() will still wait for the test
    to end, while Func() will stop the test when its timeout has expired.
    The latter is more desireable when dealing with network tests, because
    the result may actually never arrive.

    If the callback is triggered, the test has passed.
    If the errback is triggered or the timeout expires, the test has failed.

    Example::

        @Func(timeout=5.0)
        def test_resolve():
            return reactor.resolve("www.python.org")

    Attention! If you combine this decorator with other decorators (like
    "raises"), Func() must be called *first*!

    In other words, this is good::

        @raises(DNSLookupError)
        @Func()
        def test_error():
            return reactor.resolve("xxxjhjhj.biz")

    and this is bad::

        @Func()
        @raises(DNSLookupError)
        def test_error():
            return reactor.resolve("xxxjhjhj.biz")
    """
    arg_1, arg_2 = threaded_reactor()
    if arg_1 is None:
        raise ImportError("twisted is not available or could not be imported")
    # Check for common syntax mistake
    # (otherwise, tests can be silently ignored
    # if one writes "@Func" instead of "@Func()")
    try:
        arg_0 is None or arg_0 + 0
    except TypeError:
        raise TypeError("'timeout' argument must be a number or None")

    def decorate(arg_3):
        def arg_14(*arg_4, **arg_5):
            arg_6 = Queue()
            def callback(arg_7):
                arg_6.put(None)
            def errback(arg_8):
                # Retrieve and save full exception info
                try:
                    arg_8.raiseException()
                except:
                    arg_6.put(sys.exc_info())
            def g():
                try:
                    arg_9 = arg_3(*arg_4, **arg_5)
                    try:
                        arg_9.addCallbacks(callback, errback)
                    # Check for a common mistake and display a nice error
                    # message
                    except AttributeError:
                        raise TypeError("you must return a twisted Deferred "
                                        "from your test case!")
                # Catch exceptions raised in the test body (from the
                # Twisted thread)
                except:
                    arg_6.put(sys.exc_info())
            arg_1.callFromThread(g)
            try:
                arg_10 = arg_6.get(arg_0=arg_0)
            except Empty:
                raise TimeExpired("timeout expired before end of test (%f s.)"
                                  % arg_0)
            # Re-raise all exceptions
            if arg_10 is not None:
                arg_11, arg_12, arg_13 = arg_10
                raise arg_11, arg_12, arg_13
        arg_14 = make_decorator(arg_3)(arg_14)
        return arg_14
    return decorate

By wrapping a test function with this decorator, you can return a
    twisted Deferred and the test will wait for the deferred to be triggered.
    The whole test function will run inside the Twisted event loop.

    The optional timeout parameter specifies the maximum duration of the test.
    The difference with timed() is that timed() will still wait for the test
    to end, while deferred() will stop the test when its timeout has expired.
    The latter is more desireable when dealing with network tests, because
    the result may actually never arrive.

    If the callback is triggered, the test has passed.
    If the errback is triggered or the timeout expires, the test has failed.

    Example::

        @deferred(timeout=5.0)
        def test_resolve():
            return reactor.resolve("www.python.org")

    Attention! If you combine this decorator with other decorators (like
    "raises"), deferred() must be called *first*!

    In other words, this is good::

        @raises(DNSLookupError)
        @deferred()
        def test_error():
            return reactor.resolve("xxxjhjhj.biz")

    and this is bad::

        @deferred()
        @raises(DNSLookupError)
        def test_error():
            return reactor.resolve("xxxjhjhj.biz")

By wrapping a test function with this decorator you can return a twisted Deferred and the test will wait for the deferred to be triggered . The whole test function will run inside the Twisted event loop .


def Func ( arg_0 , * arg_1 , ** arg_2 ) : arg_3 = arg_0 . get_data ( 'floating_ips/' , type = POST , params = { 'droplet_id' : arg_0 . droplet_id } ) if arg_3 : arg_0 . ip = arg_3 [ 'floating_ip' ] [ 'ip' ] arg_0 . region = arg_3 [ 'floating_ip' ] [ 'region' ] return arg_0

def Func(arg_0, *arg_1, **arg_2):
        """
            Creates a FloatingIP and assigns it to a Droplet.

            Note: Every argument and parameter given to this method will be
            assigned to the object.

            Args:
                droplet_id: int - droplet id
        """
        arg_3 = arg_0.get_data('floating_ips/',
                             type=POST,
                             params={'droplet_id': arg_0.droplet_id})

        if arg_3:
            arg_0.ip = arg_3['floating_ip']['ip']
            arg_0.region = arg_3['floating_ip']['region']

        return arg_0

Creates a FloatingIP and assigns it to a Droplet .


def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
)
:
try
:
arg_4
=
arg_0
.
_get_object_map
(
arg_1
,
arg_2
,
wait_for_object
=
False
)
except
atomac
.
_a11y
.
ErrorInvalidUIElement
:
arg_0
.
_windows
=
{
}
arg_4
=
arg_0
.
_get_object_map
(
arg_1
,
arg_2
,
wait_for_object
=
False
)
if
arg_4
and
arg_3
!=
"obj"
and
arg_3
in
arg_4
:
if
arg_3
==
"class"
:
return
ldtp_class_type
.
get
(
arg_4
[
arg_3
]
,
arg_4
[
arg_3
]
)
else
:
return
arg_4
[
arg_3
]
raise
LdtpServerException
(
'Unknown property "%s" in %s'
%
(
arg_3
,
arg_2
)
)

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Get object property value.

        @param window_name: Window name to look for, either full name,
        LDTP's name convention, or a Unix glob.
        @type window_name: string
        @param object_name: Object name to look for, either full name,
        LDTP's name convention, or a Unix glob.
        @type object_name: string
        @param prop: property name.
        @type prop: string

        @return: property
        @rtype: string
        """
        try:
            arg_4 = arg_0._get_object_map(arg_1, arg_2,
                                            wait_for_object=False)
        except atomac._a11y.ErrorInvalidUIElement:
            # During the test, when the window closed and reopened
            # ErrorInvalidUIElement exception will be thrown
            arg_0._windows = {}
            # Call the method again, after updating apps
            arg_4 = arg_0._get_object_map(arg_1, arg_2,
                                            wait_for_object=False)
        if arg_4 and arg_3 != "obj" and arg_3 in arg_4:
            if arg_3 == "class":
                # ldtp_class_type are compatible with Linux and Windows class name
                # If defined class name exist return that,
                # else return as it is
                return ldtp_class_type.get(arg_4[arg_3], arg_4[arg_3])
            else:
                return arg_4[arg_3]
        raise LdtpServerException('Unknown property "%s" in %s' % \
                                  (arg_3, arg_2))


def Func(arg_0, arg_1, **arg_2):
    """
    Callback to collect the Server-Sent Events content of a response. Callbacks
    passed will receive event data.

    :param response:
        The response from the SSE request.
    :param handler:
        The handler for the SSE protocol.
    """
    # An SSE response must be 200/OK and have content-type 'text/event-stream'
    raise_for_not_ok_status(arg_0)
    raise_for_header(arg_0, 'Content-Type', 'text/event-stream')

    arg_3, arg_4 = _Func_with_protocol(arg_0, arg_1, **arg_2)
    return arg_3

Callback to collect the Server - Sent Events content of a response . Callbacks passed will receive event data .


async def Func(arg_0, arg_1: arg_2) -> Response:
        """Home page request handler."""
        if arg_0.description:
            arg_3 = f'{self.name} - {self.description}'
        else:
            arg_3 = arg_0.name

        arg_4 = dedent(
            f'''<!DOCTYPE html>

                <title>{title}</title>

{title}

                  Metric are exported at the
                  /metrics endpoint.

            ''')
        return Response(content_type='text/html', arg_4=arg_4)


Return a basic meaningful name based on device type

def Func ( arg_0 ) : if ( arg_0 . device_type and arg_0 . device_type . code in ( DeviceType . MOBILE , DeviceType . TABLET ) ) : return arg_0 . device else : return arg_0 . browser

def Func(arg_0):
        """ Return a basic meaningful Func based on device type """
        if (
            arg_0.device_type and
            arg_0.device_type.code in (DeviceType.MOBILE, DeviceType.TABLET)
        ):
            return arg_0.device
        else:
            return arg_0.browser


(self, kvalues, max_var_multiple=0, quiet=False)

def Func(arg_0, arg_1, arg_2=0, arg_3=False):
        """
        Calculates the Evanno table from results files for tests with
        K-values in the input list kvalues. The values lnPK, lnPPK,
        and deltaK are calculated. The max_var_multiplier arg can be used
        to exclude results files based on variance of the likelihood as a
        proxy for convergence.

        Parameters:
        -----------
        kvalues : list
            The list of K-values for which structure was run for this object.
            e.g., kvalues = [3, 4, 5]

        max_var_multiple: int
            A multiplier value to use as a filter for convergence of runs.
            Default=0=no filtering. As an example, if 10 replicates
            were run then the variance of the run with the minimum variance is
            used as a benchmark. If other runs have a variance that is N times
            greater then that run will be excluded. Remember, if replicate runs
            sampled different distributions of SNPs then it is not unexpected that
            they will have very different variances. However, you may still want
            to exclude runs with very high variance since they likely have
            not converged.

        quiet: bool
            Suppresses printed messages about convergence.

        Returns:
        --------
        table : pandas.DataFrame
            A data frame with LPK, LNPPK, and delta K. The latter is typically
            used to find the best fitting value of K. But be wary of over
            interpreting a single best K value.
        """
        ## do not allow bad vals
        if arg_2:
            if arg_2 < 1:
                raise ValueError('max_variance_multiplier must be >1')

        arg_4 = _Func(arg_0, arg_1, arg_2, arg_3)
        return arg_4

Calculates the Evanno table from results files for tests with K - values in the input list kvalues . The values lnPK lnPPK and deltaK are calculated . The max_var_multiplier arg can be used to exclude results files based on variance of the likelihood as a proxy for convergence .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
0
if
arg_0
.
tracking_enabled
:
try
:
arg_3
=
udp_messenger
(
arg_0
.
domain_name
,
arg_0
.
UDP_IP
,
arg_0
.
UDP_PORT
,
arg_0
.
sock_timeout
,
arg_1
)
arg_0
.
procs
.
append
(
arg_3
)
except
Exception
as
e
:
logger
.
debug
(
"Usage tracking failed: {}"
.
format
(
e
)
)
else
:
arg_2
=
1
return
arg_2

def Func(arg_0, arg_1):
        """Send UDP message."""
        arg_2 = 0
        if arg_0.tracking_enabled:
            try:
                arg_3 = udp_messenger(arg_0.domain_name, arg_0.UDP_IP, arg_0.UDP_PORT, arg_0.sock_timeout, arg_1)
                arg_0.procs.append(arg_3)
            except Exception as e:
                logger.debug("Usage tracking failed: {}".format(e))
        else:
            arg_2 = -1

        return arg_2


(words=None, vocabulary_size=50000, printable=True, unk_key='UNK')

return data, count, dictionary, reverse_dictionary

def Func(arg_0=None, arg_1=50000, arg_2=True, arg_3='UNK'):
    """Build the words dictionary and replace rare words with 'UNK' token.
    The most common word has the smallest integer id.

    Parameters
    ----------
    words : list of str or byte
        The context in list format. You may need to do preprocessing on the words, such as lower case, remove marks etc.
    vocabulary_size : int
        The maximum vocabulary size, limiting the vocabulary size. Then the script replaces rare words with 'UNK' token.
    printable : boolean
        Whether to print the read vocabulary size of the given words.
    unk_key : str
        Represent the unknown words.

    Returns
    --------
    data : list of int
        The context in a list of ID.
    count : list of tuple and list
        Pair words and IDs.
            - count[0] is a list : the number of rare words
            - count[1:] are tuples : the number of occurrence of each word
            - e.g. [['UNK', 418391], (b'the', 1061396), (b'of', 593677), (b'and', 416629), (b'one', 411764)]
    dictionary : dictionary
        It is `word_to_id` that maps word to ID.
    reverse_dictionary : a dictionary
        It is `id_to_word` that maps ID to word.

    Examples
    --------
    >>> words = tl.files.load_matt_mahoney_text8_dataset()
    >>> vocabulary_size = 50000
    >>> data, count, dictionary, reverse_dictionary = tl.nlp.Func(words, vocabulary_size)

    References
    -----------------
    - `tensorflow/examples/tutorials/word2vec/word2vec_basic.py <https://github.com/tensorflow/tensorflow/blob/r0.7/tensorflow/examples/tutorials/word2vec/word2vec_basic.py>`__

    """
    if arg_0 is None:
        raise Exception("words : list of str or byte")

    arg_4 = [[arg_3, -1]]
    arg_4.extend(collections.Counter(arg_0).most_common(arg_1 - 1))
    arg_5 = dict()
    for arg_6, arg_7 in arg_4:
        arg_5[arg_6] = len(arg_5)
    arg_8 = list()
    arg_9 = 0
    for arg_6 in arg_0:
        if arg_6 in arg_5:
            arg_10 = arg_5[arg_6]
        else:
            arg_10 = 0  # dictionary['UNK']
            arg_9 += 1
        arg_8.append(arg_10)
    arg_4[0][1] = arg_9
    arg_11 = dict(zip(arg_5.values(), arg_5.keys()))
    if arg_2:
        tl.logging.info('Real vocabulary size    %d' % len(collections.Counter(arg_0).keys()))
        tl.logging.info('Limited vocabulary size {}'.format(arg_1))
    if len(collections.Counter(arg_0).keys()) < arg_1:
        raise Exception(
            "len(collections.Counter(words).keys()) >= vocabulary_size , the limited vocabulary_size must be less than or equal to the read vocabulary_size"
        )
    return arg_8, arg_4, arg_5, arg_11

Build the words dictionary and replace rare words with 'UNK' token.
    The most common word has the smallest integer id.

    Parameters
    ----------
    words : list of str or byte
        The context in list format. You may need to do preprocessing on the words, such as lower case, remove marks etc.
    vocabulary_size : int
        The maximum vocabulary size, limiting the vocabulary size. Then the script replaces rare words with 'UNK' token.
    printable : boolean
        Whether to print the read vocabulary size of the given words.
    unk_key : str
        Represent the unknown words.

    Returns
    --------
    data : list of int
        The context in a list of ID.
    count : list of tuple and list
        Pair words and IDs.
            - count[0] is a list : the number of rare words
            - count[1:] are tuples : the number of occurrence of each word
            - e.g. [['UNK', 418391], (b'the', 1061396), (b'of', 593677), (b'and', 416629), (b'one', 411764)]
    dictionary : dictionary
        It is `word_to_id` that maps word to ID.
    reverse_dictionary : a dictionary
        It is `id_to_word` that maps ID to word.

    Examples
    --------
    >>> words = tl.files.load_matt_mahoney_text8_dataset()
    >>> vocabulary_size = 50000
    >>> data, count, dictionary, reverse_dictionary = tl.nlp.build_words_dataset(words, vocabulary_size)

    References
    -----------------
    - `tensorflow/examples/tutorials/word2vec/word2vec_basic.py <https://github.com/tensorflow/tensorflow/blob/r0.7/tensorflow/examples/tutorials/word2vec/word2vec_basic.py>`__

Build the words dictionary and replace rare words with UNK token . The most common word has the smallest integer id .


def Func(arg_0, arg_1):
        """
        Write batch items to dynamodb table with provisioned throughout capacity.
        """

        arg_2 = arg_0.get_conn()

        try:
            arg_3 = arg_2.Table(arg_0.table_name)

            with arg_3.batch_writer(overwrite_by_pkeys=arg_0.table_keys) as batch:
                for arg_4 in arg_1:
                    batch.put_item(Item=arg_4)
            return True
        except Exception as general_error:
            raise AirflowException(
                'Failed to insert items in dynamodb, error: {error}'.format(
                    error=str(general_error)
                )
            )

Write batch items to dynamodb table with provisioned throughout capacity .


def Func ( arg_0 , arg_1 , * arg_2 , ** arg_3 ) : for arg_4 , arg_5 , arg_6 in os . Func ( arg_1 ) : for arg_7 in arg_6 : yield os . path . join ( arg_4 , arg_7 )

def Func(arg_0, arg_1, *arg_2, **arg_3):
    """This pipe wrap os.Func and yield absolute path one by one.

    :param prev: The previous iterator of pipe.
    :type prev: Pipe
    :param args: The end-of-line symbol for each output.
    :type args: list of string.
    :param kw: The end-of-line symbol for each output.
    :type kw: dictionary of options. Add 'endl' in kw to specify end-of-line symbol.
    :returns: generator
    """
    for arg_4, arg_5, arg_6 in os.Func(arg_1):
        for arg_7 in arg_6:
            yield os.path.join(arg_4, arg_7)

This pipe wrap os.walk and yield absolute path one by one.

    :param prev: The previous iterator of pipe.
    :type prev: Pipe
    :param args: The end-of-line symbol for each output.
    :type args: list of string.
    :param kw: The end-of-line symbol for each output.
    :type kw: dictionary of options. Add 'endl' in kw to specify end-of-line symbol.
    :returns: generator

This pipe wrap os . walk and yield absolute path one by one .


def Func(arg_0, arg_1):
  """Helper which interpolates between two scales."""
  if len(arg_1) != 2:
    raise NotImplementedError("Currently only bimixtures are supported; "
                              "len(scale)={} is not 2.".format(len(arg_1)))
  arg_2 = tf.compat.dimension_value(
      tensorshape_util.with_rank_at_least(arg_0.shape, 1)[-1])
  if arg_2 is None:
    raise ValueError("Num quadrature grid points must be known prior "
                     "to graph execution.")
  with tf.name_scope("Func"):
    return [linop_add_lib.add_operators([
        linop_scale(arg_0[..., arg_3, arg_5], arg_4)
        for arg_3, arg_4 in enumerate(arg_1)
    ])[0] for arg_5 in range(arg_2)]

Helper which interpolates between two scales .


def Func ( arg_0 ) : arg_1 = PyFunceble . CURRENT_DIRECTORY arg_2 = [ ] arg_2 . append ( arg_1 + PyFunceble . CONFIGURATION [ "outputs" ] [ "default_files" ] [ "dir_structure" ] ) arg_2 . append ( arg_1 + PyFunceble . CONFIGURATION [ "outputs" ] [ "default_files" ] [ "iana" ] ) arg_2 . append ( arg_1 + PyFunceble . CONFIGURATION [ "outputs" ] [ "default_files" ] [ "public_suffix" ] ) arg_2 . append ( arg_1 + PyFunceble . CONFIGURATION [ "outputs" ] [ "default_files" ] [ "inactive_db" ] ) arg_2 . append ( arg_1 + PyFunceble . CONFIGURATION [ "outputs" ] [ "default_files" ] [ "mining" ] ) arg_2 . append ( arg_1 + PyFunceble . CONFIGURATION [ "outputs" ] [ "default_files" ] [ "whois_db" ] ) return arg_2

def Func(arg_0):  # pragma: no cover
        """
        Set the databases files to delete.
        """

        # We initiate the directory we have to look for.
        arg_1 = PyFunceble.CURRENT_DIRECTORY

        # We initate the result variable.
        arg_2 = []

        # We append the dir_structure file.
        arg_2.append(
            arg_1
            + PyFunceble.CONFIGURATION["outputs"]["default_files"]["dir_structure"]
        )

        # We append the iana file.
        arg_2.append(
            arg_1 + PyFunceble.CONFIGURATION["outputs"]["default_files"]["iana"]
        )

        # We append the public suffix file.
        arg_2.append(
            arg_1
            + PyFunceble.CONFIGURATION["outputs"]["default_files"]["public_suffix"]
        )

        # We append the inactive database file.
        arg_2.append(
            arg_1
            + PyFunceble.CONFIGURATION["outputs"]["default_files"]["inactive_db"]
        )

        # We append the mining database file.
        arg_2.append(
            arg_1 + PyFunceble.CONFIGURATION["outputs"]["default_files"]["mining"]
        )

        # We append the whois database file.
        arg_2.append(
            arg_1 + PyFunceble.CONFIGURATION["outputs"]["default_files"]["whois_db"]
        )

        return arg_2


def Func ( arg_0 , arg_1 ) : if arg_0 . auth is None : return b'' arg_2 = arg_0 . auth . copy ( ) for arg_3 in arg_1 : arg_2 . update ( arg_3 ) return str_to_bytes ( arg_2 . hexdigest ( ) )

def Func(arg_0, arg_1):
        """Sign a message with HMAC digest. If no auth, return b''.

        Parameters
        ----------
        msg_list : list
            The [p_header,p_parent,p_content] part of the message list.
        """
        if arg_0.auth is None:
            return b''
        arg_2 = arg_0.auth.copy()
        for arg_3 in arg_1:
            arg_2.update(arg_3)
        return str_to_bytes(arg_2.hexdigest())

Sign a message with HMAC digest . If no auth return b .


def Func ( arg_0 , arg_1 , arg_2 ) : for arg_3 in arg_0 . tile_pyramid . Func ( arg_1 , arg_2 ) : yield arg_0 . tile ( * arg_3 . id )

def Func(arg_0, arg_1, arg_2):
        """
        All metatiles intersecting with given bounding box.

        Parameters
        ----------
        geometry : ``shapely.geometry``
        zoom : integer
            zoom level

        Yields
        ------
        intersecting tiles : generator
            generates ``BufferedTiles``
        """
        for arg_3 in arg_0.tile_pyramid.Func(arg_1, arg_2):
            yield arg_0.tile(*arg_3.id)

All metatiles intersecting with given bounding box .


def Func ( arg_0 , arg_1 ) : arg_2 = deepcopy ( arg_0 . config ) arg_2 . _merge ( arg_1 ) arg_0 . config = arg_2

def Func(arg_0, arg_1):
        """Fire the traits events when the config is updated."""
        # Save a copy of the current config.
        arg_2 = deepcopy(arg_0.config)
        # Merge the new config into the current one.
        arg_2._merge(arg_1)
        # Save the combined config as self.config, which triggers the traits
        # events.
        arg_0.config = arg_2

Fire the traits events when the config is updated .


(dtype, shape, name, trainable,
                                   add_variable_fn)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ) : del arg_2 , arg_3 , arg_4 arg_5 = tfd . Normal ( loc = tf . zeros ( arg_1 , arg_0 ) , scale = arg_0 . as_numpy_dtype ( 1 ) ) arg_6 = tf . size ( input = arg_5 . batch_shape_tensor ( ) ) return tfd . Independent ( arg_5 , reinterpreted_batch_ndims = arg_6 )

def Func(arg_0, arg_1, arg_2, arg_3,
                                   arg_4):
  """Creates multivariate standard `Normal` distribution.

  Args:
    dtype: Type of parameter's event.
    shape: Python `list`-like representing the parameter's event shape.
    name: Python `str` name prepended to any created (or existing)
      `tf.Variable`s.
    trainable: Python `bool` indicating all created `tf.Variable`s should be
      added to the graph collection `GraphKeys.TRAINABLE_VARIABLES`.
    add_variable_fn: `tf.get_variable`-like `callable` used to create (or
      access existing) `tf.Variable`s.

  Returns:
    Multivariate standard `Normal` distribution.
  """
  del arg_2, arg_3, arg_4   # unused
  arg_5 = tfd.Normal(loc=tf.zeros(arg_1, arg_0), scale=arg_0.as_numpy_dtype(1))
  arg_6 = tf.size(input=arg_5.batch_shape_tensor())
  return tfd.Independent(arg_5, reinterpreted_batch_ndims=arg_6)

Creates multivariate standard Normal distribution .


def Func ( arg_0 , ** arg_1 ) : super ( ) . Func ( ** arg_1 ) return np . polyval ( arg_0 . _coeffs , arg_1 [ 'T' ] )

def Func(arg_0, **arg_1):
        """
        Calculate the material physical property at the specified temperature
        in the units specified by the object's 'property_units' property.

        :param T: [K] temperature

        :returns: physical property value
        """
        super().Func(**arg_1)
        return np.polyval(arg_0._coeffs, arg_1['T'])

Calculate the material physical property at the specified temperature in the units specified by the object s property_units property .


(params, w_name, scope_name, inputs, layers, weights, names)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
,
arg_5
,
arg_6
)
:
print
(
'Converting constant ...'
)
arg_7
=
arg_0
[
'value'
]
.
numpy
(
)
def
target_layer
(
arg_8
,
arg_9
=
arg_7
)
:
return
tf
.
constant
(
arg_9
.
tolist
(
)
,
shape
=
arg_9
.
shape
)
arg_10
=
keras
.
layers
.
Lambda
(
target_layer
)
arg_4
[
arg_2
+
'_np'
]
=
arg_7
arg_4
[
arg_2
]
=
arg_10
(
arg_4
[
list
(
arg_4
.
keys
(
)
)
[
0
]
]
)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6):
    """
    Convert constant layer.

    Args:
        params: dictionary with layer parameters
        w_name: name prefix in state_dict
        scope_name: pytorch scope name
        inputs: pytorch node inputs
        layers: dictionary with keras tensors
        weights: pytorch state_dict
        names: use short names for keras layers
    """
    print('Converting constant ...')

    arg_7 = arg_0['value'].numpy()

    def target_layer(arg_8, arg_9=arg_7):
        return tf.constant(arg_9.tolist(), shape=arg_9.shape)

    arg_10 = keras.layers.Lambda(target_layer)
    arg_4[arg_2 + '_np'] = arg_7  # ad-hoc
    arg_4[arg_2] = arg_10(arg_4[list(arg_4.keys())[0]])


def Func ( * arg_0 ) : arg_1 = set ( ) for arg_2 in arg_0 : try : arg_1 . add ( _opcode ( arg_2 ) ) except KeyError : pass return arg_1

def Func(*arg_0):
    """Return a set of opcodes by the names in `names`."""
    arg_1 = set()
    for arg_2 in arg_0:
        try:
            arg_1.add(_opcode(arg_2))
        except KeyError:
            pass
    return arg_1

Return a set of opcodes by the names in names .


def Func ( arg_0 , arg_1 ) : def Functer ( arg_2 ) : return arg_0 . _optic . Func ( arg_2 , arg_1 ) return Functer

def Func(arg_0, arg_1):
        # type: (B) -> Callable[[S], T]
        '''Set the focus to `newvalue`.

            >>> from lenses import lens
            >>> Func_item_one_to_four = lens[1].Func(4)
            >>> Func_item_one_to_four([1, 2, 3])
            [1, 4, 3]
        '''

        def Functer(arg_2):
            return arg_0._optic.Func(arg_2, arg_1)

        return Functer

Set the focus to `newvalue`.

            >>> from lenses import lens
            >>> set_item_one_to_four = lens[1].set(4)
            >>> set_item_one_to_four([1, 2, 3])
            [1, 4, 3]


def Func ( * arg_0 , ** arg_1 ) : try : from invenio . modules . accounts . models import UserEXT except ImportError : from invenio_accounts . models import UserEXT arg_2 = UserEXT . query return arg_2 . count ( ) , arg_2 . all ( )

def Func(*arg_0, **arg_1):
    """Get UserEXT objects."""
    try:
        from invenio.modules.accounts.models import UserEXT
    except ImportError:
        from invenio_accounts.models import UserEXT
    arg_2 = UserEXT.query
    return arg_2.count(), arg_2.all()


def Func(arg_0=None):
    """
    Returns a subset of the env dictionary containing
    only those keys with the name prefix.
    """
    arg_0 = arg_0 or []
    assert isinstance(arg_0, (tuple, list)), 'Prefixes must be a sequence type, not %s.' % type(arg_0)
    arg_1 = {}
    for arg_2 in arg_0:
        arg_2 = arg_2.lower().strip()
        for arg_3 in sorted(env):
            if arg_3.startswith('%s_' % arg_2):
                arg_4 = arg_3[len(arg_2)+1:]
                arg_1[arg_4] = env[arg_3]
    return arg_1

Returns a subset of the env dictionary containing only those keys with the name prefix .


def
Func
(
arg_0
,
arg_1
)
:
try
:
arg_1
=
json
.
loads
(
arg_1
)
except
ValueError
:
try
:
arg_0
.
write_message
(
json
.
dumps
(
{
'messageType'
:
'error'
,
'data'
:
{
'status'
:
'400 Bad Request'
,
'message'
:
'Parsing request failed'
,
}
,
}
)
)
except
tornado
.
websocket
.
WebSocketClosedError
:
pass
return
if
'messageType'
not
in
arg_1
or
'data'
not
in
arg_1
:
try
:
arg_0
.
write_message
(
json
.
dumps
(
{
'messageType'
:
'error'
,
'data'
:
{
'status'
:
'400 Bad Request'
,
'message'
:
'Invalid message'
,
}
,
}
)
)
except
tornado
.
websocket
.
WebSocketClosedError
:
pass
return
arg_2
=
arg_1
[
'messageType'
]
if
arg_2
==
'setProperty'
:
for
arg_3
,
arg_4
in
arg_1
[
'data'
]
.
items
(
)
:
try
:
arg_0
.
thing
.
set_property
(
arg_3
,
arg_4
)
except
PropertyError
as
e
:
arg_0
.
write_message
(
json
.
dumps
(
{
'messageType'
:
'error'
,
'data'
:
{
'status'
:
'400 Bad Request'
,
'message'
:
str
(
e
)
,
}
,
}
)
)
elif
arg_2
==
'requestAction'
:
for
arg_5
,
arg_6
in
arg_1
[
'data'
]
.
items
(
)
:
arg_7
=
if
'input'
in
arg_6
:
arg_7
=
arg_6
[
'input'
]
arg_8
=
arg_0
.
thing
.
perform_action
(
arg_5
,
arg_7
)
if
arg_8
:
tornado
.
ioloop
.
IOLoop
.
current
(
)
.
spawn_callback
(
perform_action
,
arg_8
,
)
else
:
arg_0
.
write_message
(
json
.
dumps
(
{
'messageType'
:
'error'
,
'data'
:
{
'status'
:
'400 Bad Request'
,
'message'
:
'Invalid action request'
,
'request'
:
arg_1
,
}
,
}
)
)
elif
arg_2
==
'addEventSubscription'
:
for
arg_9
in
arg_1
[
'data'
]
.
keys
(
)
:
arg_0
.
thing
.
add_event_subscriber
(
arg_9
,
arg_0
)
else
:
try
:
arg_0
.
write_message
(
json
.
dumps
(
{
'messageType'
:
'error'
,
'data'
:
{
'status'
:
'400 Bad Request'
,
'message'
:
'Unknown messageType: '
+
arg_2
,
'request'
:
arg_1
,
}
,
}
)
)
except
tornado
.
websocket
.
WebSocketClosedError
:
pass

def Func(arg_0, arg_1):
        """
        Handle an incoming message.

        message -- message to handle
        """
        try:
            arg_1 = json.loads(arg_1)
        except ValueError:
            try:
                arg_0.write_message(json.dumps({
                    'messageType': 'error',
                    'data': {
                        'status': '400 Bad Request',
                        'message': 'Parsing request failed',
                    },
                }))
            except tornado.websocket.WebSocketClosedError:
                pass

            return

        if 'messageType' not in arg_1 or 'data' not in arg_1:
            try:
                arg_0.write_message(json.dumps({
                    'messageType': 'error',
                    'data': {
                        'status': '400 Bad Request',
                        'message': 'Invalid message',
                    },
                }))
            except tornado.websocket.WebSocketClosedError:
                pass

            return

        arg_2 = arg_1['messageType']
        if arg_2 == 'setProperty':
            for arg_3, arg_4 in arg_1['data'].items():
                try:
                    arg_0.thing.set_property(arg_3, arg_4)
                except PropertyError as e:
                    arg_0.write_message(json.dumps({
                        'messageType': 'error',
                        'data': {
                            'status': '400 Bad Request',
                            'message': str(e),
                        },
                    }))
        elif arg_2 == 'requestAction':
            for arg_5, arg_6 in arg_1['data'].items():
                arg_7 = None
                if 'input' in arg_6:
                    arg_7 = arg_6['input']

                arg_8 = arg_0.thing.perform_action(arg_5, arg_7)
                if arg_8:
                    tornado.ioloop.IOLoop.current().spawn_callback(
                        perform_action,
                        arg_8,
                    )
                else:
                    arg_0.write_message(json.dumps({
                        'messageType': 'error',
                        'data': {
                            'status': '400 Bad Request',
                            'message': 'Invalid action request',
                            'request': arg_1,
                        },
                    }))
        elif arg_2 == 'addEventSubscription':
            for arg_9 in arg_1['data'].keys():
                arg_0.thing.add_event_subscriber(arg_9, arg_0)
        else:
            try:
                arg_0.write_message(json.dumps({
                    'messageType': 'error',
                    'data': {
                        'status': '400 Bad Request',
                        'message': 'Unknown messageType: ' + arg_2,
                        'request': arg_1,
                    },
                }))
            except tornado.websocket.WebSocketClosedError:
                pass


return Snapshot(self.num_qubits, self.num_clbits, self.params[0],
                        self.params[1])

def Func ( arg_0 ) : return Snapshot ( arg_0 . num_qubits , arg_0 . num_clbits , arg_0 . params [ 0 ] , arg_0 . params [ 1 ] )

def Func(arg_0):
        """Special case. Return self."""
        return Snapshot(arg_0.num_qubits, arg_0.num_clbits, arg_0.params[0],
                        arg_0.params[1])


def Func(arg_0):
  """Merge a set of fetched Route 53 config Etrees into a canonical form.

  Args: cfg_chunks: [ lxml.etree.ETree ]
  Returns: lxml.etree.Element"""
  arg_1 = lxml.etree.XML('<ResourceRecordSets xmlns="%s"></ResourceRecordSets>' % R53_XMLNS, parser=XML_PARSER)
  for arg_2 in arg_0:
    for arg_3 in arg_2.iterfind('.//{%s}ResourceRecordSet' % R53_XMLNS):
      arg_1.append(arg_3)
  return arg_1

Merge a set of fetched Route 53 config Etrees into a canonical form .


def
Func
(
arg_0
)
:
arg_1
=
arg_0
.
_relay_output
[
'result'
]
for
arg_2
in
arg_1
:
arg_3
=
time
.
strftime
(
"%Y-%m-%dT%H:%M:%SZ"
,
time
.
gmtime
(
int
(
arg_2
[
1
]
[
'ts'
]
)
)
)
print
(
"{0} {1} {2} {3}"
.
format
(
arg_2
[
0
]
,
arg_3
,
arg_2
[
1
]
[
'type'
]
,
arg_2
[
1
]
[
'msg'
]
)
)

def Func(arg_0):
        """
        Send output in textual format
        """
        arg_1 = arg_0._relay_output['result'];

        for arg_2 in arg_1:
            arg_3 = time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime(int(arg_2[1]['ts'])))
            print("{0} {1} {2} {3}".format(arg_2[0], arg_3, arg_2[1]['type'], arg_2[1]['msg']))


def Func ( arg_0 ) : arg_1 = arg_0 . db . read ( arg_0 . path , { "q" : "ls" } ) if arg_1 is None or arg_1 . json ( ) is None : return [ ] Func = [ ] for arg_3 in arg_1 . json ( ) : arg_4 = arg_0 [ arg_3 [ "name" ] ] arg_4 . metadata = arg_3 Func . append ( arg_4 ) return Func

def Func(arg_0):
        """Returns the list of streams that belong to the device"""
        arg_1 = arg_0.db.read(arg_0.path, {"q": "ls"})

        if arg_1 is None or arg_1.json() is None:
            return []
        Func = []
        for arg_3 in arg_1.json():
            arg_4 = arg_0[arg_3["name"]]
            arg_4.metadata = arg_3
            Func.append(arg_4)
        return Func


def Func(arg_0, arg_1, *arg_2):
        """Determine the position in the list

        id: A string or a :class:`~cobra.core.Object.Object`

        """
        # because values are unique, start and stop are not relevant
        if isinstance(arg_1, string_types):
            try:
                return arg_0._dict[arg_1]
            except KeyError:
                raise ValueError("%s not found" % arg_1)
        try:
            arg_3 = arg_0._dict[arg_1.id]
            if arg_0[arg_3] is not arg_1:
                raise ValueError(
                    "Another object with the identical id (%s) found" % arg_1.id)
            return arg_3
        except KeyError:
            raise ValueError("%s not found" % str(arg_1))


return "".join(map(decode_bytes, filter(None, parts)))

def Func ( arg_0 ) : from lxml import etree arg_1 = [ arg_0 . text ] for arg_2 in arg_0 . getchildren ( ) : arg_1 . append ( etree . tostring ( arg_2 , encoding = "utf-8" , method = "text" ) ) arg_1 . append ( arg_2 . tail ) return "" . join ( map ( decode_bytes , filter ( None , arg_1 ) ) )

def Func(arg_0):
    """
    Returns the inner text of a given XML node, excluding tags.

    Args:
        node: (lxml.etree.Element): The node whose inner text is desired.

    Returns:
        str: The inner text of the node.
    """

    from lxml import etree

    # Include text content at the start of the node.
    arg_1 = [arg_0.text]

    for arg_2 in arg_0.getchildren():
        # Include the raw text content of the child.
        arg_1.append(etree.tostring(arg_2, encoding="utf-8", method="text"))

        # Include any text following the child.
        arg_1.append(arg_2.tail)

    # Discard any non-existent text parts and return.
    return "".join(map(decode_bytes, filter(None, arg_1)))

Returns the inner text of a given XML node excluding tags .


def Func(arg_0, arg_1, arg_2=None):
        """Save this instance to the path and format provided.

        Arguments:
        to -- output path as str, file, or MemFileIO instance
        Keyword args:
        driver -- GDAL driver name as string or ImageDriver
        """
        arg_3 = getattr(arg_1, 'name', arg_1)
        if not arg_2 and hasattr(arg_3, 'encode'):
            arg_2 = driver_for_path(arg_3, arg_0.driver.filter_copyable())
        elif hasattr(arg_2, 'encode'):
            arg_2 = ImageDriver(arg_2)
        if arg_2 is None or not arg_2.copyable:
            raise ValueError('Copy supporting driver not found for %s' % arg_3)
        arg_2.copy(arg_0, arg_3).close()

Save this instance to the path and format provided .


def Func ( arg_0 , arg_1 ) : arg_2 = sum ( 1 for method in arg_1 . mymethods ( ) if not method . name . startswith ( "_" ) ) if arg_2 > arg_0 . config . max_public_methods : arg_0 . add_message ( "too-many-public-methods" , arg_1 = arg_1 , args = ( arg_2 , arg_0 . config . max_public_methods ) , ) if ( arg_1 . type != "class" or _is_enum_class ( arg_1 ) or _is_dataclass ( arg_1 ) or _is_typing_namedtuple ( arg_1 ) ) : return arg_3 = _count_methods_in_class ( arg_1 ) if arg_3 < arg_0 . config . min_public_methods : arg_0 . add_message ( "too-few-public-methods" , arg_1 = arg_1 , args = ( arg_3 , arg_0 . config . min_public_methods ) , )

def Func(arg_0, arg_1):
        """check number of public methods"""
        arg_2 = sum(
            1 for method in arg_1.mymethods() if not method.name.startswith("_")
        )

        # Does the class contain less than n public methods ?
        # This checks only the methods defined in the current class,
        # since the user might not have control over the classes
        # from the ancestors. It avoids some false positives
        # for classes such as unittest.TestCase, which provides
        # a lot of assert methods. It doesn't make sense to warn
        # when the user subclasses TestCase to add his own tests.
        if arg_2 > arg_0.config.max_public_methods:
            arg_0.add_message(
                "too-many-public-methods",
                arg_1=arg_1,
                args=(arg_2, arg_0.config.max_public_methods),
            )

        # Stop here for exception, metaclass, interface classes and other
        # classes for which we don't need to count the methods.
        if (
            arg_1.type != "class"
            or _is_enum_class(arg_1)
            or _is_dataclass(arg_1)
            or _is_typing_namedtuple(arg_1)
        ):
            return

        # Does the class contain more than n public methods ?
        # This checks all the methods defined by ancestors and
        # by the current class.
        arg_3 = _count_methods_in_class(arg_1)
        if arg_3 < arg_0.config.min_public_methods:
            arg_0.add_message(
                "too-few-public-methods",
                arg_1=arg_1,
                args=(arg_3, arg_0.config.min_public_methods),
            )