Question: Returns variants specified in question for a specific case .

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None , arg_4 = 'snv' , arg_5 = 10 , arg_6 = 0 , arg_7 = 'variant_rank' ) : LOG . debug ( "Fetching Func from {0}" . format ( arg_1 ) ) if arg_3 : arg_5 = len ( arg_3 ) elif arg_5 == - 1 : arg_5 = 0 else : arg_5 = arg_6 + arg_5 arg_8 = arg_0 . build_query ( arg_1 , arg_2 = arg_2 , arg_3 = arg_3 , arg_4 = arg_4 ) arg_9 = [ ] if arg_7 == 'variant_rank' : arg_9 = [ ( 'variant_rank' , pymongo . ASCENDING ) ] if arg_7 == 'rank_score' : arg_9 = [ ( 'rank_score' , pymongo . DESCENDING ) ] if arg_7 == 'position' : arg_9 = [ ( 'position' , pymongo . ASCENDING ) ] arg_10 = arg_0 . variant_collection . find ( arg_8 , arg_6 = arg_6 , limit = arg_5 ) . sort ( arg_9 ) return arg_10

Generate RENEWING time.

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

        T1
        defaults to (0.5 * duration_of_lease).  T2 defaults to (0.875 *
        duration_of_lease).  Times T1 and T2 SHOULD be chosen with some
        random "fuzz" around a fixed value, to avoid synchronization of
        client reacquisition.


Question: Returns whether this query resolves for the given session .

def Func ( arg_0 , arg_1 ) : if arg_0 . url : arg_0 . actual_path = arg_1 . current_url else : arg_3 = urlparse ( arg_1 . current_url ) if arg_0 . only_path : arg_0 . actual_path = arg_3 . path else : arg_4 = arg_3 . path if arg_3 . query : arg_4 += "?{0}" . format ( arg_3 . query ) arg_0 . actual_path = arg_4 if isregex ( arg_0 . expected_path ) : return arg_0 . expected_path . search ( arg_0 . actual_path ) else : return normalize_url ( arg_0 . actual_path ) == normalize_url ( arg_0 . expected_path )

Return an open file-object to the index file


Question: Check if a header is in alphabetical order with the previous header .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : if ( arg_0 . _last_header > arg_3 and Match ( r'^\s*#\s*include\b' , arg_1 . elided [ arg_2 - 1 ] ) ) : return False return True


Question: Returns a transformer function for the given signature .

def Func ( arg_0 ) : arg_1 = [ arg_5 for ( arg_5 , arg_4 ) in Funcs ( arg_0 ) ] def the_func ( arg_2 ) : if len ( arg_2 ) != len ( arg_1 ) : raise IntoDPValueError ( arg_2 , "objects" , "must have exactly %u items, has %u" % ( len ( arg_1 ) , len ( arg_2 ) ) ) return [ arg_3 for ( arg_3 , arg_4 ) in ( arg_5 ( arg_6 ) for ( arg_5 , arg_6 ) in zip ( arg_1 , arg_2 ) ) ] return the_func

This function adds the given stream to the logger, but does not check with a ConnectorDB database
        to make sure that the stream exists. Use at your own risk.


Question: determines the coalescent time scale that optimizes the coalescent likelihood of the tree

def Func ( arg_0 ) : from scipy . optimize import minimize_scalar arg_1 = arg_0 . Tc def cost ( arg_2 ) : arg_0 . set_Tc ( arg_2 ) return - arg_0 . total_LH ( ) arg_3 = minimize_scalar ( cost , bounds = [ ttconf . TINY_NUMBER , 10.0 ] ) if "success" in arg_3 and arg_3 [ "success" ] : arg_0 . set_Tc ( arg_3 [ 'x' ] ) else : arg_0 . logger ( "merger_models:optimze_Tc: optimization of coalescent time scale failed: " + str ( arg_3 ) , 0 , warn = True ) arg_0 . set_Tc ( arg_1 . y , T = arg_1 . x )

This is how an instance is created when we read a
           MatlabObject from a MAT file.


Question: Normalize and tokenize text . This is lifted from NIST mteval - v11a . pl .

def Func ( arg_0 ) : if ( nonorm ) : return arg_0 . split ( ) try : arg_0 . split ( ) except : arg_0 = " " . join ( arg_0 ) for ( arg_1 , arg_2 ) in Func1 : arg_0 = re . sub ( arg_1 , arg_2 , arg_0 ) arg_0 = xml . sax . saxutils . unescape ( arg_0 , { '"' : '"' } ) arg_0 = " %s " % arg_0 if not preserve_case : arg_0 = arg_0 . lower ( ) return [ arg_3 for arg_3 in Func3 . split ( arg_0 ) if arg_3 and arg_3 != ' ' ]

Returns the profile with the received ID as a dict

        If a local copy of the profile exists, it'll be returned. If not, it'll
        be downloaded from the web. The results are cached, so any subsequent
        calls won't hit the filesystem or the web.

        Args:
            profile_id (str): The ID of the profile you want.

        Raises:
            RegistryError: If there was some problem opening the profile file
                or its format was incorrect.


Question: Build fake MNIST - style data for unit testing .

def Func ( arg_0 = 10 ) : class Dummy ( object ) : pass arg_0 = 10 arg_1 = Dummy ( ) arg_1 . train = Dummy ( ) arg_1 . train . images = np . float32 ( np . random . randn ( arg_0 , * IMAGE_SHAPE ) ) arg_1 . train . labels = np . int32 ( np . random . permutation ( np . arange ( arg_0 ) ) ) arg_1 . train . num_examples = arg_0 arg_1 . validation = Dummy ( ) arg_1 . validation . images = np . float32 ( np . random . randn ( arg_0 , * IMAGE_SHAPE ) ) arg_1 . validation . labels = np . int32 ( np . random . permutation ( np . arange ( arg_0 ) ) ) arg_1 . validation . num_examples = arg_0 return arg_1


Question: Does a bitwise compare of the two bitmaps and returns a fractonal value between 0 and 1 of how similar they are .

def Func ( arg_0 , arg_1 , arg_2 , ** arg_3 ) : arg_4 = 1.0 arg_5 = int ( arg_1 . sum ( ) ) arg_6 = int ( arg_2 . sum ( ) ) if arg_6 > arg_5 : arg_7 = arg_6 - arg_5 if arg_7 < arg_5 : arg_4 = 1 - arg_7 / float ( arg_5 ) else : arg_4 = 1 / float ( arg_7 ) arg_8 = arg_1 & arg_2 arg_9 = int ( arg_8 . sum ( ) ) if arg_5 == 0 : arg_10 = 0.0 else : arg_10 = arg_9 / float ( arg_5 ) arg_10 = arg_10 * arg_4 return numpy . array ( [ arg_10 ] )

Return list of GATT descriptors that have been discovered for this
        characteristic.


Question: r Poisson tapering window

def Func ( arg_0 , arg_1 = 2 ) : arg_2 = linspace ( - arg_0 / 2. , ( arg_0 ) / 2. , arg_0 ) arg_3 = exp ( - arg_1 * abs ( arg_2 ) / ( arg_0 / 2. ) ) return arg_3

Overriding the default JSONEncoder.default for NDB support.


Question: Add values to the field i .

def Func ( arg_0 , arg_1 , arg_2 ) : assert ( len ( arg_0 . fields ) > arg_1 ) arg_3 = [ arg_0 . addValueToField ( arg_1 ) for n in range ( arg_2 ) ] return arg_3

Returns the current ZipkinAttrs and generates new ones if needed.

        :returns: (report_root_timestamp, zipkin_attrs)
        :rtype: (bool, ZipkinAttrs)


Question: It will print the list of songs that can be downloaded

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = BeautifulSoup ( arg_1 ) arg_4 = ' ' . join ( arg_2 ) print '%s not found' % arg_4 print "But you can download any of the following songs :" arg_5 = arg_3 . findAll ( 'a' , 'touch' ) for arg_6 in xrange ( len ( arg_5 ) - 1 ) : arg_7 = arg_5 [ arg_6 ] arg_8 = str ( arg_7 ) arg_9 = re . sub ( r'||||||' , '' , arg_8 ) print arg_9

Turn a mongodb-style search dict into an SQL query.


Question: Keeps track of the furthest point in the source code the parser has reached to this point .

def Func ( arg_0 , arg_1 ) : arg_2 = len ( arg_0 . original_text ) - len ( arg_1 ) arg_0 . most_consumed = max ( arg_2 , arg_0 . most_consumed )

Reshape input and output dimensions of operator.

        Arg:
            input_dims (tuple): new subsystem input dimensions.
            output_dims (tuple): new subsystem output dimensions.

        Returns:
            Operator: returns self with reshaped input and output dimensions.

        Raises:
            QiskitError: if combined size of all subsystem input dimension or
            subsystem output dimensions is not constant.


Question: Chunk input data into valid Touchstone file rows .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_2 = arg_2 . upper ( ) arg_3 = 4 for arg_4 , arg_5 in zip ( arg_0 , arg_1 ) : arg_5 = arg_5 . flatten ( ) for arg_6 in range ( 0 , arg_5 . size , arg_3 ) : arg_7 = [ arg_4 ] if not arg_6 else [ None ] arg_8 = arg_5 [ arg_6 : arg_6 + arg_3 ] if arg_2 == "MA" : arg_9 = np . abs ( arg_8 ) arg_10 = np . rad2deg ( np . angle ( arg_8 ) ) elif arg_2 == "RI" : arg_9 = np . real ( arg_8 ) arg_10 = np . imag ( arg_8 ) else : arg_9 = 20.0 * np . log10 ( np . abs ( arg_8 ) ) arg_10 = np . rad2deg ( np . angle ( arg_8 ) ) arg_11 = np . array ( [ ] ) for arg_12 , arg_13 in zip ( arg_9 , arg_10 ) : arg_11 = np . concatenate ( ( arg_11 , np . array ( [ arg_12 , arg_13 ] ) ) ) arg_14 = np . concatenate ( ( np . array ( arg_7 ) , arg_11 ) ) yield arg_14

Receive a StateUpdate and fan out to Conversations.

        Args:
            state_update: hangouts_pb2.StateUpdate instance


Question: Return a BytesIO instance of image cropped to width and height .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 ) : arg_6 = BytesIO ( ) arg_7 = arg_1 . getpalette ( ) arg_8 = arg_0 . crop_on_centerpoint ( arg_1 , arg_4 , arg_5 , arg_0 . ppoi ) if arg_2 == 'GIF' : arg_8 . putpalette ( arg_7 ) arg_8 . save ( arg_6 , ** arg_3 ) return arg_6

expression_terminal = identifier
                           | terminal
                           | option_group
                           | repetition_group
                           | grouping_group
                           | special_handling ;


Question: Remove all items .

def Func ( arg_0 ) : arg_0 . _fwdm . Func ( ) arg_0 . _invm . Func ( ) arg_0 . _sntl . nxt = arg_0 . _sntl . prv = arg_0 . _sntl

Places top drawdowns in a table.

    Parameters
    ----------
    returns : pd.Series
        Daily returns of the strategy, noncumulative.
         - See full explanation in tears.create_full_tear_sheet.
    top : int, optional
        The amount of top drawdowns to find (default 10).

    Returns
    -------
    df_drawdowns : pd.DataFrame
        Information about top drawdowns.


Question: The date and time of the person s last activity .

def Func ( arg_0 ) : arg_1 = arg_0 . _json_data . get ( 'Func' ) if arg_1 : return WebexTeamsDateTime . strptime ( arg_1 ) else : return None

Regenerates the primary or secondary access key for the specified
        storage account.

        service_name:
            Name of the storage service account.
        key_type:
            Specifies which key to regenerate. Valid values are:
            Primary, Secondary


Question: Write to a remote host via HTTP POST

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = True ) : if arg_1 is None : arg_1 = arg_0 . url if arg_2 is None : arg_2 = arg_0 . credentials if arg_3 is None : arg_3 = arg_0 . do_verify_certificate if arg_2 and "base64" in arg_2 : arg_4 = { "Content-Type" : "application/json" , 'Authorization' : 'Basic %s' % arg_2 [ "base64" ] } else : arg_4 = { "Content-Type" : "application/json" } try : arg_5 = requests . post ( arg_1 , arg_4 = arg_4 , data = arg_0 . store . get_json ( ) , verify = arg_3 ) except httplib . IncompleteRead as e : arg_5 = e . partial

Return the list of all sub-directories of path.


Question: Extract DICOM metadata from the given item

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = dict ( ) arg_3 [ 'token' ] = arg_1 arg_3 [ 'item' ] = arg_2 arg_4 = arg_0 . request ( 'midas.dicomextractor.extract' , arg_3 ) return arg_4

Brackets the minimum and performs a line search.

  Args:
    value_and_gradients_function: A Python callable that accepts a real scalar
      tensor and returns a namedtuple with the fields 'x', 'f', and 'df' that
      correspond to scalar tensors of real dtype containing the point at which
      the function was evaluated, the value of the function, and its
      derivative at that point. The other namedtuple fields, if present,
      should be tensors or sequences (possibly nested) of tensors.
      In usual optimization application, this function would be generated by
      projecting the multivariate objective function along some specific
      direction. The direction is determined by some other procedure but should
      be a descent direction (i.e. the derivative of the projected univariate
      function must be negative at 0.).
      Alternatively, the function may represent the batching of `n` such line
      functions (e.g. projecting a single multivariate objective function along
      `n` distinct directions at once) accepting n points as input, i.e. a
      tensor of shape [n], and the fields 'x', 'f' and 'df' in the returned
      namedtuple should each be a tensor of shape [n], with the corresponding
      input points, function values, and derivatives at those input points.
    init_interval: Instance of `HagerZhangLineSearchResults` containing
      the initial line search interval. The gradient of init_interval.left must
      be negative (i.e. must be a descent direction), while init_interval.right
      must be positive and finite.
    f_lim: Scalar `Tensor` of float dtype.
    max_iterations: Positive scalar `Tensor` of integral dtype. The maximum
      number of iterations to perform in the line search. The number of
      iterations used to bracket the minimum are also counted against this
      parameter.
    shrinkage_param: Scalar positive Tensor of real dtype. Must be less than
      `1.`. Corresponds to the parameter `gamma` in [Hager and Zhang (2006)][2].
    expansion_param: Scalar positive `Tensor` of real dtype. Must be greater
      than `1.`. Used to expand the initial interval in case it does not bracket
      a minimum. Corresponds to `rho` in [Hager and Zhang (2006)][2].
    sufficient_decrease_param: Positive scalar `Tensor` of real dtype.
      Bounded above by the curvature param. Corresponds to `delta` in the
      terminology of [Hager and Zhang (2006)][2].
    curvature_param: Positive scalar `Tensor` of real dtype. Bounded above
      by `1.`. Corresponds to 'sigma' in the terminology of
      [Hager and Zhang (2006)][2].

  Returns:
    A namedtuple containing the following fields.
      converged: Boolean `Tensor` of shape [n]. Whether a point satisfying
        Wolfe/Approx wolfe was found.
      failed: Boolean `Tensor` of shape [n]. Whether line search failed e.g.
        if either the objective function or the gradient are not finite at
        an evaluation point.
      iterations: Scalar int32 `Tensor`. Number of line search iterations made.
      func_evals: Scalar int32 `Tensor`. Number of function evaluations made.
      left: A namedtuple, as returned by value_and_gradients_function,
        of the left end point of the updated bracketing interval.
      right: A namedtuple, as returned by value_and_gradients_function,
        of the right end point of the updated bracketing interval.


Question: Get the next event from the queue and pass it to the appropriate handlers .

def Func ( arg_0 , arg_1 = False , arg_2 = None ) : logger . debug ( " Funcing..." ) try : arg_3 = arg_0 . queue . get ( arg_1 , arg_2 ) except Queue . Empty : logger . debug ( "    queue empty" ) return None try : logger . debug ( "    event: {0!r}" . format ( arg_3 ) ) if arg_3 is QUIT : return QUIT arg_4 = list ( arg_0 . _handler_map [ None ] ) arg_5 = arg_3 . __class__ if arg_5 in arg_0 . _handler_map : arg_4 += arg_0 . _handler_map [ arg_5 ] logger . debug ( "    handlers: {0!r}" . format ( arg_4 ) ) arg_4 . sort ( key = lambda x : x [ 0 ] ) for arg_6 , arg_7 in arg_4 : logger . debug ( u"  passing the event to: {0!r}" . format ( arg_7 ) ) arg_8 = arg_7 ( arg_3 ) if isinstance ( arg_8 , Event ) : arg_0 . queue . put ( arg_8 ) elif arg_8 and arg_3 is not QUIT : return arg_3 return arg_3 finally : arg_0 . queue . task_done ( )

Return an open file-object to the index file


Question: Delete a mac_address_range .

def Func ( arg_0 , arg_1 ) : LOG . info ( "Func %s for tenant %s" % ( arg_1 , arg_0 . tenant_id ) ) if not arg_0 . is_admin : raise n_exc . NotAuthorized ( ) with arg_0 . session . begin ( ) : arg_2 = db_api . mac_address_range_find ( arg_0 , arg_1 = arg_1 , scope = db_api . ONE ) if not arg_2 : raise q_exc . MacAddressRangeNotFound ( mac_address_range_id = arg_1 ) _Func ( arg_0 , arg_2 )

Overriding the default JSONEncoder.default for NDB support.


Question: Add pFBA objective

def Func ( arg_0 , arg_1 = None , arg_2 = 1.0 ) : if arg_1 is not None : arg_0 . objective = arg_1 if arg_0 . solver . objective . name == '_pfba_objective' : raise ValueError ( 'The model already has a pFBA objective.' ) sutil . fix_objective_as_constraint ( arg_0 , fraction = arg_2 ) arg_3 = ( ( rxn . forward_variable , rxn . reverse_variable ) for rxn in arg_0 . reactions ) arg_4 = chain ( * arg_3 ) arg_0 . objective = arg_0 . problem . Objective ( Zero , direction = 'min' , sloppy = True , name = "_pfba_objective" ) arg_0 . objective . set_linear_coefficients ( { arg_5 : 1.0 for arg_5 in arg_4 } )

Synchronize local po files with translations on GDocs Spreadsheet.
        Downloads two csv files, merges them and converts into po files
        structure. If new msgids appeared in po files, this method creates
        new ods with appended content and sends it to GDocs.


Question: Build regression weights from model parameters .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 ) : arg_6 = ( arg_2 * tf . sqrt ( arg_1 ) * arg_0 . weights_prior_scale ) arg_7 = arg_4 * tf . sqrt ( arg_3 ) return arg_5 * arg_7 * arg_6 [ ... , tf . newaxis ]


Question: Return call formatted appropriately for args .

def Func ( arg_0 , arg_1 ) : arg_2 = '' if arg_1 . source : arg_2 += arg_0 . annotation ( ) + '\n' if arg_1 . only_keys : arg_2 += arg_0 . get_key ( ) return arg_2 if arg_1 . view_call : arg_2 += arg_0 . as_call ( ) elif arg_1 . load_configs : arg_2 += arg_0 . as_live ( ) else : arg_2 += arg_0 . as_namespace ( ) return arg_2


Question: This method is called to create the default OPTIONS response . This can be changed through subclassing to change the default behavior of OPTIONS responses .

def Func ( arg_0 ) : arg_1 = _request_ctx_stack . top . url_adapter if hasattr ( arg_1 , 'allowed_methods' ) : arg_2 = arg_1 . allowed_methods ( ) else : arg_2 = [ ] try : arg_1 . match ( method = '--' ) except MethodNotAllowed as e : arg_2 = e . valid_methods except HTTPException as e : pass arg_3 = arg_0 . response_class ( ) arg_3 . allow . update ( arg_2 ) return arg_3

Returns the profile with the received ID as a dict

        If a local copy of the profile exists, it'll be returned. If not, it'll
        be downloaded from the web. The results are cached, so any subsequent
        calls won't hit the filesystem or the web.

        Args:
            profile_id (str): The ID of the profile you want.

        Raises:
            RegistryError: If there was some problem opening the profile file
                or its format was incorrect.


Question: TARGET power button

def Func ( arg_0 , arg_1 = 200 ) : if arg_0 . __Func_port is None : cij . err ( "cij.usb.relay: Invalid USB_RELAY_POWER_BTN" ) return 1 return arg_0 . __press ( arg_0 . __Func_port , arg_1 = arg_1 )

Clean up stats file, if configured to do so.


Question: Compute the harmonic number from its analytic continuation .

def Func ( arg_0 ) : arg_1 = tf . ones ( [ ] , dtype = arg_0 . dtype ) return tf . math . digamma ( arg_0 + arg_1 ) - tf . math . digamma ( arg_1 )

Check that a binary operator is surrounded by exactly one space.


Question: Update a Label

def Func ( arg_0 , arg_1 ) : arg_2 = { 'id' : arg_1 [ 'id' ] , 'name' : arg_1 [ 'name' ] , 'appearance' : arg_1 [ 'appearance' ] , 'description' : arg_1 [ 'description' ] , 'title' : arg_1 [ 'title' ] , } return arg_0 . _post ( request = ApiActions . UPDATE . value , uri = ApiUri . TAGS . value , params = arg_2 )


Question: Runs a subprocess with a PTY attached via fork and exec . The output from the PTY is streamed through log_to_client . This should not be necessary for most subprocesses we built this to handle Compose up which only streams pull progress if it is attached to a TTY .

def Func ( * arg_0 ) : arg_1 = copy ( os . environ ) arg_1 . update ( get_docker_env ( ) ) arg_0 += ( arg_1 , ) arg_2 = arg_0 [ 0 ] arg_3 = demote_to_user ( get_config_value ( constants . CONFIG_MAC_USERNAME_KEY ) ) arg_4 , arg_5 = pty . fork ( ) if arg_4 == 0 : arg_3 ( ) os . execle ( _executable_path ( arg_2 ) , * arg_0 ) else : arg_6 = psutil . Process ( arg_4 ) arg_7 = os . fdopen ( arg_5 , 'r' , 0 ) with streaming_to_client ( ) : while arg_6 . status ( ) == 'running' : arg_8 = arg_7 . read ( 1 ) log_to_client ( arg_8 ) arg_9 , arg_10 = os . waitpid ( arg_4 , 0 ) if arg_10 != 0 : raise subprocess . CalledProcessError ( arg_10 , ' ' . join ( arg_0 [ : - 1 ] ) )

Unregister an extension code.  For testing only.


Question: Creates a network from a specification dict .

def Func ( arg_0 , arg_1 = None ) : arg_2 = util . get_object ( obj = arg_0 , default_object = LayeredNetwork , arg_1 = arg_1 ) assert isinstance ( arg_2 , Network ) return arg_2

Clears out the current store and gets a cookie. Set the cross site
        request forgery token for each subsequent request.

        :return: A response having cleared the current store.
        :rtype: requests.Response


Question: Copies the contents of vector x1 into vector x2 .

def Func ( arg_0 , arg_1 ) : arg_2 = len ( arg_0 ) for arg_3 in range ( arg_2 ) : arg_1 [ arg_3 ] = arg_0 [ arg_3 ]

Shorthand access to the color table scheme selector method.


Question: Fit the transformer on the stacked points .

def Func ( arg_0 , arg_1 , arg_2 = None , ** arg_3 ) : arg_1 = as_features ( arg_1 , stack = True ) arg_0 . transformer . Func ( arg_1 . stacked_features , arg_2 , ** arg_3 ) return arg_0

Send data synchronous to an ADS-device from data name.

    :param int port: local AMS port as returned by adsPortOpenEx()
    :param pyads.structs.AmsAddr address: local or remote AmsAddr
    :param string data_name: PLC storage address
    :param value: value to write to the storage address of the PLC
    :param Type data_type: type of the data given to the PLC,
        according to PLCTYPE constants


Question: Read some protobuf - encoded object stored in a single block out of the file .

def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 ( ) arg_2 . ParseFromString ( arg_0 . _read_block ( ) ) return arg_2

Check if hdl process has event depenency on signal


Question: A shortcut for typical confirmation prompt .

def Func ( arg_0 , arg_1 = None , arg_2 = False ) : arg_3 = 3 if arg_2 : return arg_1 else : arg_4 = { None : ( 'y' , 'n' ) , True : ( 'Y' , 'n' ) , False : ( 'y' , 'N' ) , } arg_5 , arg_6 = arg_4 [ arg_1 ] arg_7 = text_type ( '{action}? ({y}/{n})' ) . format ( ** locals ( ) ) arg_8 = None try : if arg_1 is None : arg_9 = 1 while not arg_8 and arg_9 < arg_3 : arg_8 = safe_input ( arg_7 ) arg_9 += 1 else : arg_8 = safe_input ( arg_7 ) except KeyboardInterrupt : return None if arg_8 in ( 'yes' , 'y' , 'Y' ) : return True if arg_8 in ( 'no' , 'n' , 'N' ) : return False if arg_1 is not None : return arg_1 return None


Question: Shortcut for creating Users

def Func ( arg_0 = None , arg_1 = [ ] , arg_2 = [ ] , ** arg_3 ) : arg_4 = arg_3 . pop ( 'is_active' , True ) arg_5 = arg_3 . pop ( 'is_superuser' , False ) arg_6 = arg_3 . pop ( 'is_staff' , False ) arg_7 = any_model ( User , arg_4 = arg_4 , arg_5 = arg_5 , arg_6 = arg_6 , ** arg_3 ) for arg_8 in arg_2 : arg_9 = Group . objects . get ( name = arg_8 ) arg_7 . groups . add ( arg_9 ) for arg_10 in arg_1 : arg_11 , arg_12 = arg_10 . split ( '.' ) arg_13 = Permission . objects . get ( content_type__app_label = arg_11 , arg_12 = arg_12 ) arg_7 . user_permissions . add ( arg_13 ) if arg_0 : arg_7 . set_password ( arg_0 ) arg_7 . save ( ) return arg_7

Unmarks the remote server as currently being deployed to.


Question: Return the number of conflicts var = val has with other variables .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : def conflict ( arg_4 ) : return ( arg_4 in arg_3 and not arg_0 . constraints ( arg_1 , arg_2 , arg_4 , arg_3 [ arg_4 ] ) ) return count_if ( conflict , arg_0 . neighbors [ arg_1 ] )

Remove cards from watchlist.

        :params trade_id: Trade id.


Question: Indent all lines in the given string

def Func ( arg_0 , arg_1 = 1 , arg_2 = True ) : arg_3 = _ONE_INDENT * arg_1 arg_4 = arg_0 . splitlines ( True ) arg_5 = '' if len ( arg_4 ) > 0 and not arg_2 : arg_6 = 1 arg_5 += arg_4 [ 0 ] else : arg_6 = 0 for arg_7 in arg_4 [ arg_6 : ] : arg_5 += arg_3 + arg_7 return arg_5

Returns the maximum delay for the InferenceElements in the inference
    dictionary

    Parameters:
    -----------------------------------------------------------------------
    inferences:   A dictionary where the keys are InferenceElements


Question: Inserts new continuation prompt using the specified cursor .

def Func ( arg_0 , arg_1 ) : if arg_0 . _continuation_prompt_html is None : arg_0 . _insert_plain_text ( arg_1 , arg_0 . _continuation_prompt ) else : arg_0 . _continuation_prompt = arg_0 . _insert_html_fetching_plain_text ( arg_1 , arg_0 . _continuation_prompt_html )


Question: This decides if a value is to be fit for or is fixed in a model fit .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 , arg_4 = arg_1 . keys ( ) , arg_2 . keys ( ) if arg_0 in arg_3 : arg_5 = arg_1 [ arg_0 ] elif arg_0 in arg_4 : arg_5 = arg_2 [ arg_0 ] return arg_5


Question: Called when a message has been received where msg . attempts > max_tries

def Func ( arg_0 , arg_1 ) : logger . warning ( '[%s] giving up on message %s after %d tries (max:%d) %r' , arg_0 . name , arg_1 . id , arg_1 . attempts , arg_0 . max_tries , arg_1 . body )

Helper function to get packing_plan with
    a callback. The future watch is placed
    only if isWatching is True.


Question: Handle the field value pair .

def Func ( arg_0 , arg_1 , arg_2 ) : if arg_1 == 'event' : arg_0 . _event = arg_2 elif arg_1 == 'data' : arg_0 . _data_lines . append ( arg_2 ) elif arg_1 == 'id' : pass elif arg_1 == 'retry' : pass

Save the model in the given directory.

    :param saveModelDir: (string)
         Absolute directory path for saving the model. This directory should
         only be used to store a saved model. If the directory does not exist,
         it will be created automatically and populated with model data. A
         pre-existing directory will only be accepted if it contains previously
         saved model data. If such a directory is given, the full contents of
         the directory will be deleted and replaced with current model data.


Question: Handle stream disconnection event .

def Func ( arg_0 , arg_1 ) : with arg_0 . lock : if arg_1 . stream != arg_0 . stream : return if arg_0 . stream is not None and arg_1 . stream == arg_0 . stream : if arg_0 . stream . transport in arg_0 . _ml_handlers : arg_0 . _ml_handlers . remove ( arg_0 . stream . transport ) arg_0 . main_loop . remove_handler ( arg_0 . stream . transport ) arg_0 . stream = None arg_0 . uplink = None


Question: Delete next unapplied patch If remove is True the patch file will also be removed . If remove and backup are True a copy of the deleted patch file will be made .

def Func ( arg_0 , arg_1 = False , arg_2 = False ) : arg_3 = arg_0 . db . top_patch ( ) if arg_3 : arg_4 = arg_0 . series . patch_after ( arg_3 ) else : arg_4 = arg_0 . series . first_patch ( ) if not arg_4 : raise QuiltError ( "No next patch" ) arg_0 . _delete_patch ( arg_4 , arg_1 = arg_1 , arg_2 = arg_2 )

Used to identify when buffered messages should be processed and responded to.

        When max_in_flight > 1 and you're batching messages together to perform work
        is isn't possible to just compare the len of your list of buffered messages against
        your configured max_in_flight (because max_in_flight may not be evenly divisible
        by the number of producers you're connected to, ie. you might never get that many
        messages... it's a *max*).

        Example::

            def message_handler(self, nsq_msg, reader):
                # buffer messages
                if reader.is_starved():
                    # perform work

            reader = nsq.Reader(...)
            reader.set_message_handler(functools.partial(message_handler, reader=reader))
            nsq.run()


Question: Find all method names this input dispatches to .

def Func ( arg_0 , * arg_1 , ** arg_2 ) : arg_3 = arg_1 [ 0 ] arg_4 = arg_0 . inst arg_5 = arg_0 . _method_prefix for arg_6 in arg_0 . gen_method_keys ( * arg_1 , ** arg_2 ) : arg_7 = getattr ( arg_4 , arg_5 + arg_6 , None ) if arg_7 is not None : yield arg_7 arg_8 = type ( arg_3 ) . __name__ yield from arg_0 . check_basetype ( arg_3 , arg_8 , arg_0 . builtins . get ( arg_8 ) ) for arg_9 in arg_0 . interp_types : yield from arg_0 . check_basetype ( arg_3 , arg_9 , getattr ( arg_0 . types , arg_9 , None ) ) for arg_9 in arg_0 . abc_types : yield from arg_0 . check_basetype ( arg_3 , arg_9 , getattr ( arg_0 . collections , arg_9 , None ) ) yield from arg_0 . gen_generic ( )

r'''Method to calculate pressure-dependent liquid molar volume at
        temperature `T` and pressure `P` with a given method.

        This method has no exception handling; see `TP_dependent_property`
        for that.

        Parameters
        ----------
        T : float
            Temperature at which to calculate molar volume, [K]
        P : float
            Pressure at which to calculate molar volume, [K]
        method : str
            Name of the method to use

        Returns
        -------
        Vm : float
            Molar volume of the liquid at T and P, [m^3/mol]


Question: Print emphasized based on rval

def Func ( arg_0 , arg_1 = None ) : if arg_1 is None : info ( arg_0 ) elif arg_1 == 0 : good ( arg_0 ) else : err ( arg_0 )

Prepare the actors, the world, and the messaging system to begin
        playing the game.

        This method is guaranteed to be called exactly once upon entering the
        game stage.


Question: Authenticate using OAuth refresh token .

def Func ( arg_0 , arg_1 ) : arg_2 = { 'client_id' : OAUTH2_CLIENT_ID , 'client_secret' : OAUTH2_CLIENT_SECRET , 'grant_type' : 'refresh_token' , 'refresh_token' : arg_1 , } arg_3 = _make_token_request ( arg_0 , arg_2 ) return arg_3 [ 'access_token' ]

Translates the given metrics value to JSON string

    metrics:        A list of dictionaries per OPFTaskDriver.getMetrics():

    Returns:        JSON string representing the given metrics object.


Question: See tfkl . Layer . build .

def Func ( arg_0 , arg_1 ) : if arg_0 . _event_shape is None : arg_0 . _event_shape = [ tf . compat . dimension_value ( arg_1 [ - 1 ] ) ] arg_0 . _event_size = arg_0 . _event_shape [ - 1 ] arg_0 . _event_ndims = len ( arg_0 . _event_shape ) if arg_1 [ - 1 ] != arg_0 . _event_shape [ - 1 ] : raise ValueError ( "Invalid final dimension of `input_shape`. " "Expected `{!r}`, but got `{!r}`" . format ( arg_0 . _event_shape [ - 1 ] , arg_1 [ - 1 ] ) ) arg_0 . _input_order = _create_input_order ( arg_0 . _event_size , arg_0 . _input_order_param ) arg_0 . _masks = _create_masks ( _create_degrees ( input_size = arg_0 . _event_size , hidden_units = arg_0 . _hidden_units , input_order = arg_0 . _input_order , hidden_degrees = arg_0 . _hidden_degrees ) ) arg_0 . _masks [ - 1 ] = np . reshape ( np . tile ( arg_0 . _masks [ - 1 ] [ ... , tf . newaxis ] , [ 1 , 1 , arg_0 . _params ] ) , [ arg_0 . _masks [ - 1 ] . shape [ 0 ] , arg_0 . _event_size * arg_0 . _params ] ) arg_0 . _network = tf . keras . Sequential ( [ tf . keras . layers . InputLayer ( ( arg_0 . _event_size , ) , dtype = arg_0 . dtype ) ] ) arg_8 = arg_0 . _hidden_units + [ arg_0 . _event_size * arg_0 . _params ] for arg_9 in range ( len ( arg_0 . _masks ) ) : arg_0 . _network . add ( tf . keras . layers . Dense ( arg_8 [ arg_9 ] , kernel_initializer = _make_masked_initializer ( arg_0 . _masks [ arg_9 ] , arg_0 . _kernel_initializer ) , kernel_constraint = _make_masked_constraint ( arg_0 . _masks [ arg_9 ] ) , activation = arg_0 . _activation if arg_9 + 1 < len ( arg_0 . _masks ) else None , use_bias = arg_0 . _use_bias , ** arg_0 . _kwargs ) ) super ( AutoregressiveLayer , arg_0 ) . Func ( arg_1 )

Synchronize local po files with translations on GDocs Spreadsheet.
        Downloads two csv files, merges them and converts into po files
        structure. If new msgids appeared in po files, this method creates
        new ods with appended content and sends it to GDocs.


Question: Engage the exit actions .

def Func ( arg_0 ) : arg_0 . exit_now = True arg_2 = dict ( source = 'IPython.zmq.zmqshell.ZMQInteractiveShell.Func' , exit = True , keepkernel = arg_0 . keepkernel_on_exit , ) arg_0 . payload_manager . write_payload ( arg_2 )

Shift the model result and return the new instance.

    Queues up the T(i+1) prediction value and emits a T(i)
    input/prediction pair, if possible. E.g., if the previous T(i-1)
    iteration was learn-only, then we would not have a T(i) prediction in our
    FIFO and would not be able to emit a meaningful input/prediction pair.

    :param modelResult: A :class:`~.nupic.frameworks.opf.opf_utils.ModelResult`
                        instance to shift.
    :return: A :class:`~.nupic.frameworks.opf.opf_utils.ModelResult` instance that
             has been shifted


Question: Test to see if the page has enough space for the given text height .

def Func ( arg_0 , arg_1 ) : if ( arg_0 . y + arg_1 ) >= arg_0 . ymax : return False else : return True

This function adds the given stream to the logger, but does not check with a ConnectorDB database
        to make sure that the stream exists. Use at your own risk.


Question: This is both verified and self asserted information . As expected verified information beats self - asserted so if there is both self - asserted and verified values for a claim then only the verified will be returned .

def Func ( arg_0 ) : if arg_0 . sup : arg_1 = { } for arg_2 , arg_3 in arg_0 . le . items ( ) : if arg_2 not in arg_0 . sup . le : arg_1 [ arg_2 ] = arg_3 else : arg_1 [ arg_2 ] = arg_0 . sup . le [ arg_2 ] return arg_1 else : return arg_0 . le

An integer-valued dimension bounded between `min` <= x <= `max`.
        Note that the right endpoint of the interval includes `max`.

        When `warp` is None, the base measure associated with this dimension
        is a categorical distribution with each weight on each of the integers
        in [min, max]. With `warp == 'log'`, the base measure is a uniform
        distribution on the log of the variable, with bounds at `log(min)` and
        `log(max)`. This is appropriate for variables that are "naturally" in
        log-space. Other `warp` functions are not supported (yet), but may be
        at a later time. Please note that this functionality is not supported
        for `hyperopt_tpe`.


Question: Cache a refresh token ignoring any failure .

def Func ( arg_0 , arg_1 ) : logger . info ( 'Saving refresh_token to %s' , repr ( arg_0 . _filename ) ) try : with open ( arg_0 . _filename , 'w' ) as f : f . write ( arg_1 ) except IOError as e : logger . warning ( 'Failed to save refresh_token: %s' , e )

Embeds checks that categorical distributions don't have too many classes.

  A categorical-type distribution is one which, e.g., returns the class label
  rather than a one-hot encoding.  E.g., `Categorical(probs)`.

  Since distributions output samples in the same dtype as the parameters, we
  must ensure that casting doesn't lose precision. That is, the
  `parameter.dtype` implies a maximum number of classes. However, since shape is
  `int32` and categorical variables are presumed to be indexes into a `Tensor`,
  we must also ensure that the number of classes is no larger than the largest
  possible `int32` index, i.e., `2**31-1`.

  In other words the number of classes, `K`, must satisfy the following
  condition:

  ```python
  K <= min(
      int(2**31 - 1),  # Largest float as an index.
      {
          tf.float16: int(2**11),   # Largest int as a float16.
          tf.float32: int(2**24),
          tf.float64: int(2**53),
      }.get(dtype_util.base_dtype(categorical_param.dtype), 0))
  ```

  Args:
    categorical_param: Floating-point `Tensor` representing parameters of
      distribution over categories. The rightmost shape is presumed to be the
      number of categories.
    name: A name for this operation (optional).

  Returns:
    categorical_param: Input `Tensor` with appropriate assertions embedded.

  Raises:
    TypeError: if `categorical_param` has an unknown `dtype`.
    ValueError: if we can statically identify `categorical_param` as being too
      large (for being closed under int32/float casting).


Question: List aggregation bookmarks .

def Func ( arg_0 = None , arg_1 = None , arg_2 = None , arg_3 = None ) : arg_0 = ( arg_0 or list ( current_stats . enabled_aggregations ) ) for arg_4 in arg_0 : arg_5 = current_stats . aggregations [ arg_4 ] arg_6 = arg_5 . aggregator_class ( name = arg_5 . name , ** arg_5 . aggregator_config ) arg_7 = arg_6 . list_bookmarks ( arg_1 , arg_2 , arg_3 ) click . echo ( '{}:' . format ( arg_4 ) ) for arg_8 in arg_7 : click . echo ( ' - {}' . format ( arg_8 . date ) )

Return the generation index of the first generation in the given
    swarm that does not have numParticles particles in it, either still in the
    running state or completed. This does not include orphaned particles.

    Parameters:
    ---------------------------------------------------------------------
    swarmId:  A string representation of the sorted list of encoders in this
                 swarm. For example '__address_encoder.__gym_encoder'
    minNumParticles: minium number of partices required for a full
                  generation.

    retval:  generation index, or None if no particles at all.


Question: Returns the maximum delay for the InferenceElements in the inference dictionary

def Func ( arg_0 ) : arg_1 = 0 for arg_2 , arg_3 in arg_0 . iteritems ( ) : if isinstance ( arg_3 , dict ) : for arg_4 in arg_3 . iterkeys ( ) : arg_1 = max ( InferenceElement . getTemporalDelay ( arg_2 , arg_4 ) , arg_1 ) else : arg_1 = max ( InferenceElement . getTemporalDelay ( arg_2 ) , arg_1 ) return arg_1

Writes the value given to the bit in the address specified.

        :param value: The value to write.
        :type value: int
        :param bit_num: The bit number to write to.
        :type bit_num: int
        :param address: The address to write to.
        :type address: int


Question: Convert sigmoid layer .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 , arg_6 ) : print ( 'Converting sigmoid ...' ) if arg_6 == 'short' : arg_7 = 'SIGM' + random_string ( 4 ) elif arg_6 == 'keep' : arg_7 = arg_1 else : arg_7 = arg_1 + str ( random . random ( ) ) arg_8 = keras . layers . Activation ( 'sigmoid' , name = arg_7 ) arg_4 [ arg_2 ] = arg_8 ( arg_4 [ arg_3 [ 0 ] ] )

Synchronize local po files with translations on GDocs Spreadsheet.
        Downloads two csv files, merges them and converts into po files
        structure. If new msgids appeared in po files, this method creates
        new ods with appended content and sends it to GDocs.


Question: Return user friendly help on program options .

def Func ( arg_0 , arg_1 = 0 , arg_2 = 25 , arg_3 = 79 ) : def makelabels ( arg_4 ) : arg_5 = '%*s--%s' % ( arg_1 , ' ' , arg_4 . name ) if arg_4 . abbreviation : arg_5 += ', -' + arg_4 . abbreviation return arg_5 + ': ' arg_6 = [ ] arg_7 = _autoindent ( [ makelabels ( o ) for o in arg_0 . options . values ( ) ] , arg_1 , arg_2 ) for arg_8 in arg_0 . option_order : arg_4 = arg_0 . options [ arg_8 ] arg_5 = makelabels ( arg_4 ) arg_9 = "%s(%s). %s" % ( arg_4 . formatname , arg_4 . strvalue , arg_4 . docs ) arg_10 = arg_0 . _wrap_labelled ( arg_5 , arg_9 , arg_7 , arg_3 ) arg_6 . extend ( arg_10 ) return '\n' . join ( arg_6 )

Post processes the estimations from the algorithm, removing empty
        segments and making sure the lenghts of the boundaries and labels
        match.


Question: Find an object already created

def Func ( arg_0 , arg_1 = False ) : arg_2 = None if isinstance ( arg_0 , basestring ) : arg_3 = COMPONENTS . Func ( arg_0 ) if not arg_3 : arg_2 = wx . FindWindowByName ( arg_0 ) if arg_2 : arg_3 = Funcattr ( arg_2 , "obj" ) else : for arg_4 in COMPONENTS . values ( ) : if arg_4 . name == arg_0 : arg_3 = arg_4 else : arg_3 = arg_0 return arg_3 or arg_2

issue a command to read the archive records after a known time stamp.


Question: Joins first and second read file names

def Func ( arg_0 ) : arg_1 = glob . glob ( arg_0 ) arg_2 = [ i for i in arg_1 if "_R1_" in i ] if not arg_2 : raise IPyradWarningExit ( "First read files names must contain '_R1_'." ) arg_3 = [ ff . replace ( "_R1_" , "_R2_" ) for ff in arg_2 ] return zip ( arg_2 , arg_3 )

Return arithmetic-geometric mean.

    Iterates between arithmetic & geometric means until they converge to
    a single value (rounded to 12 digits).

    Cf. https://en.wikipedia.org/wiki/Arithmetic-geometric_mean

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

    Returns
    -------
    float
        The arithmetic-geometric mean of nums

    Examples
    --------
    >>> agmean([1, 2, 3, 4])
    2.3545004777751077
    >>> agmean([1, 2])
    1.4567910310469068
    >>> agmean([0, 5, 1000])
    2.9753977059954195e-13


Question: Re - create all views .

def Func ( arg_0 ) : print ( "creating views" ) arg_1 = GTFS ( fname_or_conn = arg_0 ) . conn for arg_2 in Loaders : arg_2 ( None ) . make_views ( arg_1 ) arg_1 . commit ( )

Add a specific enqueue time to the message.

        :param schedule_time: The scheduled time to enqueue the message.
        :type schedule_time: ~datetime.datetime


Question: Signal handler for when a registered model has been deleted .

def Func ( arg_0 , arg_1 , ** arg_2 ) : logger . debug ( 'RECEIVE pre_delete FOR %s' , arg_1 . __class__ ) arg_0 . delete_record ( arg_1 )

Shows some stats about the currently playing song.


Question: Get the collected data and reset the collector .

def Func ( arg_0 ) : if not arg_0 . _measured : return arg_0 . data . add_line_data ( arg_0 . collector . get_line_data ( ) ) arg_0 . data . add_arc_data ( arg_0 . collector . get_arc_data ( ) ) arg_0 . collector . reset ( ) if arg_0 . _warn_unimported_source : for arg_1 in arg_0 . source_pkgs : arg_0 . _warn ( "Module %s was never imported." % arg_1 ) arg_2 = arg_0 . data . summary ( ) if not arg_2 and arg_0 . _warn_no_data : arg_0 . _warn ( "No data was collected." ) for arg_3 in arg_0 . source : for arg_4 in find_python_files ( arg_3 ) : arg_4 = arg_0 . file_locator . canonical_filename ( arg_4 ) if arg_0 . omit_match and arg_0 . omit_match . match ( arg_4 ) : continue arg_0 . data . touch_file ( arg_4 ) arg_0 . _measured = False

Create the prior distribution.

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

  Returns:
    prior: A `callable` that returns a `tf.distribution.Distribution`
        instance, the prior distribution.
    prior_variables: A `list` of `Variable` objects, the trainable parameters
        of the prior.


Question: Returns an IAgent that makes requests to this fake server .

def Func ( arg_0 , arg_1 = None , arg_2 = None ) : return ProxyAgentWithContext ( arg_0 . endpoint , arg_1 = arg_1 , arg_2 = arg_2 )

Add members found in prior versions up till the next major release

    These members are to be considered deprecated. When a new major
    release is made, these members are removed.


Question: Show usage and available palettes .

def Func ( arg_0 ) : arg_0 . print_usage ( ) print ( '' ) print ( 'available palettes:' ) for arg_1 in sorted ( PALETTE ) : print ( '    %-12s' % ( arg_1 , ) ) return 0

This will output the nginx HTTP config string for specific port spec


Question: Replaces entire cache entry parameter data by its name with new data .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_0 . cache [ arg_1 ] [ arg_2 ] = arg_3

Get the reason of this revocation.

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

        .. seealso::

            :meth:`all_reasons`, which gives you a list of all supported
            reasons this method might return.


Question: Load a configuration module and return a Config

def Func ( arg_0 ) : arg_1 = importlib . import_module ( arg_0 ) arg_2 = { } for arg_3 in dir ( arg_1 ) : if arg_3 . isupper ( ) : arg_2 [ arg_3 ] = getattr ( arg_1 , arg_3 ) return Config ( arg_2 )

Configure the Outstation's database of input point definitions.

            Configure two Analog points (group/variation 30.1) at indexes 1 and 2.
            Configure two Binary points (group/variation 1.2) at indexes 1 and 2.


Question: Gets the level for the variant .

def Func ( arg_0 , arg_1 ) : return ( arg_0 + arg_1 , arg_0 + arg_1 ) if arg_1 != 0 else ( arg_1 , arg_0 )

update secrets will take a secrets credential file
        either located at .sregistry or the environment variable
        SREGISTRY_CLIENT_SECRETS and update the current client
        secrets as well as the associated API base.


Question: Rotates the queued texts and determines display time .

def Func ( arg_0 ) : if arg_0 . delay > 0 : arg_0 . delay -= 1 return if arg_0 . fi == 0 : if len ( arg_0 . q ) == 1 : arg_0 . fn = float ( "inf" ) else : arg_0 . fn = len ( arg_0 . q [ arg_0 . i ] ) / arg_0 . speed arg_0 . fn = max ( arg_0 . fn , arg_0 . mf ) arg_0 . fi += 1 if arg_0 . fi > arg_0 . fn : arg_0 . fi = 0 arg_0 . i = ( arg_0 . i + 1 ) % len ( arg_0 . q )


Question: Returns an initial state for the LSTM cell .

def Func ( arg_0 , arg_1 = ( ) ) : arg_2 = tf . zeros ( [ 1 , arg_0 . hidden_size ] ) arg_3 = tf . zeros ( [ 1 , arg_0 . hidden_size ] ) arg_4 = tf . concat ( ( tf . convert_to_tensor ( value = arg_1 , dtype = tf . int32 ) , [ arg_0 . dimensions ] ) , axis = - 1 ) arg_5 = tf . zeros ( arg_4 ) return arg_5 , ( arg_2 , arg_3 )


Question: Create a canvas and a bot with the same canvas attached to it

def Func ( arg_0 = None , arg_1 = arg_2 , arg_3 = None , arg_4 = None , arg_5 = 1 , arg_6 = None , arg_7 = False , arg_8 = None , arg_9 = None , arg_10 = False , arg_11 = 7777 , arg_12 = False , arg_13 = None , arg_14 = None ) : arg_15 = create_canvas ( arg_0 , arg_3 , arg_4 , arg_5 > 1 , arg_6 , arg_7 , arg_8 , arg_9 = arg_9 , arg_12 = arg_12 ) if arg_1 == DRAWBOT : from shoebot . grammar import DrawBot arg_16 = DrawBot ( arg_15 , arg_14 = arg_14 , arg_13 = arg_13 ) else : from shoebot . grammar import NodeBot arg_16 = NodeBot ( arg_15 , arg_14 = arg_14 , arg_13 = arg_13 ) if arg_10 : from shoebot . sbio import SocketServer arg_17 = SocketServer ( arg_16 , "" , arg_11 = arg_11 ) return arg_16

Set the rotation of this body using a rotation matrix.

        Parameters
        ----------
        rotation : sequence of 9 floats
            The desired rotation matrix for this body.


Question: Returns args dictionary from the calling method

def Func ( ) : import inspect import copy arg_0 = inspect . stack ( ) [ 1 ] [ 0 ] arg_1 , arg_2 , arg_2 , arg_3 = inspect . getargvalues ( arg_0 ) arg_1 . remove ( "self" ) arg_4 = copy . copy ( arg_3 ) for arg_5 in arg_3 : if arg_5 not in arg_1 : arg_4 . pop ( arg_5 ) return arg_4

Set the input or output mode for a specified pin.  Mode should be
        either GPIO.OUT or GPIO.IN.


Question: Use a model to do prediction .

def Func ( arg_0 , arg_1 , arg_2 = True ) : if is_distributed : if isinstance ( arg_1 , np . ndarray ) : arg_3 = to_sample_rdd ( arg_1 , np . zeros ( [ arg_1 . shape [ 0 ] ] ) ) elif isinstance ( arg_1 , RDD ) : arg_3 = arg_1 else : raise TypeError ( "Unsupported Funcion data type: %s" % type ( arg_1 ) ) return arg_0 . Func_distributed ( arg_3 ) else : if isinstance ( arg_1 , np . ndarray ) : return arg_0 . Func_local ( arg_1 ) else : raise TypeError ( "Unsupported Funcion data type: %s" % type ( arg_1 ) )

Uploads file to GDocs spreadsheet.
        Content type can be provided as argument, default is ods.


Question: Prepare all iPython engines for distributed object processing .

def Func ( arg_0 = None ) : if not arg_0 : try : arg_0 = ipyparallel . Client ( ) except : raise DistobClusterError ( u"""Could not connect to an ipyparallel cluster. Make                 sure a cluster is started (e.g. to use the CPUs of a                 single computer, can type 'ipcluster start')""" ) arg_1 = arg_0 . ids if not arg_1 : raise DistobClusterError ( u'No ipyparallel compute engines are available' ) arg_2 = len ( arg_1 ) arg_3 = arg_0 [ arg_1 ] arg_3 . use_dill ( ) with arg_3 . sync_imports ( quiet = True ) : import arg_8 arg_4 = [ ] for arg_5 in arg_1 : arg_3 . targets = arg_5 arg_4 . append ( arg_3 . apply_async ( _remote_setup_engine , arg_5 , arg_2 ) ) arg_3 . wait ( arg_4 ) for arg_7 in arg_4 : if not arg_7 . successful ( ) : raise arg_7 . r if arg_8 . engine is None : arg_8 . engine = ObjectHub ( - 1 , arg_0 )

If peptide lengths not specified, then try using the default
        lengths associated with this predictor object. If those aren't
        a valid non-empty sequence of integers, then raise an exception.
        Otherwise return the peptide lengths.


Question: Fetch items using the given backend .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = False , arg_4 = None ) : arg_5 = find_signature_parameters ( arg_0 . __init__ , arg_1 ) arg_6 = arg_4 . create_archive ( ) if arg_4 else None arg_5 [ 'archive' ] = arg_6 arg_7 = arg_0 ( ** arg_5 ) if arg_2 : arg_1 [ 'category' ] = arg_2 if arg_3 : arg_1 [ 'filter_classified' ] = arg_3 arg_8 = find_signature_parameters ( arg_7 . Func , arg_1 ) arg_9 = arg_7 . Func ( ** arg_8 ) try : for arg_10 in arg_9 : yield arg_10 except Exception as e : if arg_4 : arg_11 = arg_6 . archive_path arg_4 . remove_archive ( arg_11 ) raise e

Generate RENEWING time.

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

        T1
        defaults to (0.5 * duration_of_lease).  T2 defaults to (0.875 *
        duration_of_lease).  Times T1 and T2 SHOULD be chosen with some
        random "fuzz" around a fixed value, to avoid synchronization of
        client reacquisition.


Question: Read the data encoding the Cancel response payload and decode it into its constituent parts .

def Func ( arg_0 , arg_1 , arg_2 = arg_3 . KMIPVersion . KMIP_1_0 ) : super ( CancelResponsePayload , arg_0 ) . Func ( arg_1 , arg_2 = arg_2 ) arg_6 = utils . BytearrayStream ( arg_1 . Func ( arg_0 . length ) ) if arg_0 . is_tag_next ( arg_3 . Tags . ASYNCHRONOUS_CORRELATION_VALUE , arg_6 ) : arg_0 . _asynchronous_correlation_value = primitives . ByteString ( tag = arg_3 . Tags . ASYNCHRONOUS_CORRELATION_VALUE ) arg_0 . _asynchronous_correlation_value . Func ( arg_6 , arg_2 = arg_2 ) if arg_0 . is_tag_next ( arg_3 . Tags . CANCELLATION_RESULT , arg_6 ) : arg_0 . _cancellation_result = primitives . Enumeration ( arg_3 . CancellationResult , tag = arg_3 . Tags . CANCELLATION_RESULT ) arg_0 . _cancellation_result . Func ( arg_6 , arg_2 = arg_2 ) arg_0 . is_oversized ( arg_6 )

Attach an observer.

        Args:
            observer (func): A function to be called when new messages arrive

        Returns:
            :class:`Stream`. Current instance to allow chaining


Question: Delete previous webhooks . If local ngrok tunnel create a webhook .

def Func ( ) : arg_0 = WebexTeamsAPI ( ) delete_webhooks_with_name ( arg_0 , name = WEBHOOK_NAME ) arg_1 = get_ngrok_public_url ( ) if arg_1 is not None : create_ngrok_webhook ( arg_0 , arg_1 )

Remove all binary files in the adslib directory.


Question: Can compress an HDF5 to reduce file size .

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = True ) : if arg_1 is None and arg_2 is None : arg_2 = - 1 arg_4 = load_trajectory ( arg_1 , arg_2 , as_new = False , load_all = pypetconstants . LOAD_NOTHING , force = True , arg_0 = arg_0 ) arg_5 = arg_4 . v_storage_service arg_6 = arg_5 . complevel arg_7 = arg_5 . complib arg_8 = arg_5 . shuffle arg_9 = arg_5 . fletcher32 arg_10 , arg_11 = os . path . splitext ( arg_0 ) arg_12 = arg_10 + '_tmp' + arg_11 arg_13 = os . path . abspath ( arg_0 ) arg_14 = os . path . abspath ( arg_12 ) arg_15 = [ 'ptrepack' , '-v' , '--complib' , arg_7 , '--complevel' , str ( arg_6 ) , '--shuffle' , str ( int ( arg_8 ) ) , '--fletcher32' , str ( int ( arg_9 ) ) , arg_13 , arg_14 ] arg_16 = ' ' . join ( arg_15 ) print ( 'Executing command `%s`' % arg_16 ) arg_17 = subprocess . call ( arg_15 ) if arg_17 != 0 : print ( '#### ERROR: Compacting `%s` failed with errorcode %s! ####' % ( arg_0 , str ( arg_17 ) ) ) else : print ( '#### Compacting successful ####' ) print ( 'Renaming files' ) if arg_3 : arg_18 = arg_10 + '_backup' + arg_11 os . rename ( arg_0 , arg_18 ) else : os . remove ( arg_0 ) os . rename ( arg_12 , arg_0 ) print ( '### Compacting and Renaming finished ####' ) return arg_17

Disconnect any connected devices that have any of the specified
        service UUIDs.


Question: Test the functionality of the rController object

def Func ( ) : import time print ( 'Testing controller in position 1:' ) print ( 'Running 3 x 3 seconds tests' ) arg_0 = rController ( 1 ) for arg_1 in range ( 3 ) : print ( 'Waiting...' ) time . sleep ( 2.5 ) print ( 'State: ' , arg_0 . gamepad ) print ( 'Buttons: ' , arg_0 . buttons ) time . sleep ( 0.5 ) print ( 'Done!' )

Overriding the default JSONEncoder.default for NDB support.


Question: Get the type of the item .

def Func ( arg_0 ) : arg_1 = arg_0 . xmlnode . prop ( "type" ) if not arg_1 : arg_1 = "?" return arg_1 . decode ( "utf-8" )

Synchronize local po files with translations on GDocs Spreadsheet.
        Downloads two csv files, merges them and converts into po files
        structure. If new msgids appeared in po files, this method creates
        new ods with appended content and sends it to GDocs.


Question: The mode of the von Mises - Fisher distribution is the mean direction .

def Func ( arg_0 ) : return ( arg_0 . mean_direction + tf . zeros_like ( arg_0 . concentration ) [ ... , tf . newaxis ] )


Question: Load the config and defaults from files .

def Func ( arg_0 , arg_1 = False ) : if arg_1 or not arg_0 . _Funced : if arg_0 . _defaults_file and type ( arg_0 . _defaults_file ) == str : arg_0 . _defaults_file = File ( arg_0 . _defaults_file , parent = arg_0 . _parent ) arg_3 = { } if arg_0 . _defaults_file : arg_3 = yaml . safe_Func ( arg_0 . _defaults_file . read ( ) . replace ( '\t' , '    ' ) ) arg_4 = { } if arg_0 . exists : arg_4 = yaml . safe_Func ( arg_0 . read ( ) . replace ( '\t' , '    ' ) ) arg_0 . _defaults = arg_3 arg_0 . _data = copy . deepcopy ( arg_0 . _defaults ) arg_0 . update ( arg_4 = arg_4 ) if arg_0 . _apply_env : arg_0 . update ( ConfigEnv ( arg_0 . _env_prefix ) ) arg_0 . _Funced = True return arg_0

Get the reason of this revocation.

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

        .. seealso::

            :meth:`all_reasons`, which gives you a list of all supported
            reasons this method might return.


Question: This finds a set of solutions for symbolic using policy . This raises TooManySolutions if more solutions than maxcount

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = 7 ) : assert arg_0 . constraints == arg_0 . platform . constraints arg_1 = arg_0 . migrate_expression ( arg_1 ) arg_4 = [ ] if arg_2 == 'MINMAX' : arg_4 = arg_0 . _solver . minmax ( arg_0 . _constraints , arg_1 ) elif arg_2 == 'MAX' : arg_4 = arg_0 . _solver . max ( arg_0 . _constraints , arg_1 ) elif arg_2 == 'MIN' : arg_4 = arg_0 . _solver . min ( arg_0 . _constraints , arg_1 ) elif arg_2 == 'SAMPLED' : arg_5 , arg_6 = arg_0 . _solver . minmax ( arg_0 . _constraints , arg_1 ) arg_4 += [ arg_5 , arg_6 ] if arg_6 - arg_5 > 3 : if arg_0 . _solver . can_be_true ( arg_0 . _constraints , arg_1 == ( arg_5 + arg_6 ) // 2 ) : arg_4 . append ( ( arg_5 + arg_6 ) // 2 ) if arg_6 - arg_5 > 100 : for arg_7 in ( 0 , 1 , 2 , 5 , 32 , 64 , 128 , 320 ) : if arg_0 . _solver . can_be_true ( arg_0 . _constraints , arg_1 == arg_5 + arg_7 ) : arg_4 . append ( arg_5 + arg_7 ) if arg_3 <= len ( arg_4 ) : break if arg_6 - arg_5 > 1000 and arg_3 > len ( arg_4 ) : arg_4 += arg_0 . _solver . get_all_values ( arg_0 . _constraints , arg_1 , maxcnt = arg_3 - len ( arg_4 ) , silent = True ) elif arg_2 == 'ONE' : arg_4 = [ arg_0 . _solver . get_value ( arg_0 . _constraints , arg_1 ) ] else : assert arg_2 == 'ALL' arg_4 = solver . get_all_values ( arg_0 . _constraints , arg_1 , maxcnt = arg_3 , silent = True ) return tuple ( set ( arg_4 ) )

Converts py_zipkin's annotations dict to protobuf.

    :param annotations: annotations dict.
    :type annotations: dict
    :return: corresponding protobuf's list of annotations.
    :rtype: list


Question: Yield the digits of pi read from a . txt file .

def Func ( arg_0 , arg_1 = arg_2 ) : with open ( arg_0 , 'r' ) as f : for arg_3 in f . readlines ( ) : for arg_4 in arg_3 : if arg_4 != '\n' and arg_4 != ' ' : yield arg_1 ( arg_4 )

Initialize the BLE provider.  Must be called once before any other
        calls are made to the provider.


Question: Run the actual simulation .

def Func ( arg_0 ) : if arg_0 . _hasFunc : raise RuntimeError ( "This spreader instance has already been run: " "create a new Spreader object for a new run." ) arg_1 = 1 while arg_0 . event_heap . size ( ) > 0 and len ( arg_0 . _uninfected_stops ) > 0 : arg_2 = arg_0 . event_heap . pop_next_event ( ) arg_3 = arg_0 . _stop_I_to_spreading_stop [ arg_2 . from_stop_I ] if arg_2 . arr_time_ut > arg_0 . start_time_ut + arg_0 . max_duration_ut : break if arg_3 . can_infect ( arg_2 ) : arg_4 = arg_0 . _stop_I_to_spreading_stop [ arg_2 . to_stop_I ] arg_5 = arg_4 . has_been_visited ( ) arg_4 . visit ( arg_2 ) if not arg_5 : arg_0 . _uninfected_stops . remove ( arg_2 . to_stop_I ) print ( arg_1 , arg_0 . event_heap . size ( ) ) arg_6 = arg_0 . gtfs . get_straight_line_transfer_distances ( arg_2 . to_stop_I ) arg_0 . event_heap . add_walk_events_to_heap ( arg_6 , arg_2 , arg_0 . start_time_ut , arg_0 . walk_speed , arg_0 . _uninfected_stops , arg_0 . max_duration_ut ) arg_1 += 1 arg_0 . _hasFunc = True

Remove hidden notes and tag a CERN if detected.


Question: Returns the number of parameters in the network .

def Func ( arg_0 ) : arg_1 = 0 for arg_2 , arg_3 in enumerate ( arg_0 . all_params ) : arg_4 = 1 for arg_5 in arg_3 . get_shape ( ) : try : arg_5 = int ( arg_5 ) except Exception : arg_5 = 1 if arg_5 : arg_4 = arg_4 * arg_5 arg_1 = arg_1 + arg_4 return arg_1

Clears out the current store and gets a cookie. Set the cross site
        request forgery token for each subsequent request.

        :return: A response having cleared the current store.
        :rtype: requests.Response


Question: Read the contents of a file as a Lisp expression .

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

Adjust contrast of an Image.

    Args:
        img (PIL Image): PIL Image to be adjusted.
        contrast_factor (float): How much to adjust the contrast. Can be any
            non negative number. 0 gives a solid gray image, 1 gives the
            original image while 2 increases the contrast by a factor of 2.

    Returns:
        PIL Image: Contrast adjusted image.


Question: Convert the value to its final form by unit conversions and multiplying by mass .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_1 / 3.6E6 arg_3 = arg_3 / arg_0 . molar_mass arg_3 = arg_3 * arg_2 return arg_3

Handle marking messages as read and keeping client active.


Question: Return the items from GitLab API using links pagination

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = 0 arg_4 = None arg_5 = urijoin ( arg_0 . base_url , GitLabClient . PROJECTS , arg_0 . owner + '%2F' + arg_0 . repository , arg_1 ) logger . debug ( "Get GitLab paginated items from " + arg_5 ) arg_6 = arg_0 . fetch ( arg_5 , arg_2 = arg_2 ) arg_7 = arg_6 . text arg_3 += 1 if 'last' in arg_6 . links : arg_8 = arg_6 . links [ 'last' ] [ 'url' ] arg_4 = arg_8 . split ( '&page=' ) [ 1 ] . split ( '&' ) [ 0 ] arg_4 = int ( arg_4 ) logger . debug ( "Page: %i/%i" % ( arg_3 , arg_4 ) ) while arg_7 : yield arg_7 arg_7 = None if 'next' in arg_6 . links : arg_5 = arg_6 . links [ 'next' ] [ 'url' ] arg_6 = arg_0 . fetch ( arg_5 , arg_2 = arg_2 ) arg_3 += 1 arg_7 = arg_6 . text logger . debug ( "Page: %i/%i" % ( arg_3 , arg_4 ) )

This is a parallel worker for running period-recovery.

    Parameters
    ----------

    task : tuple
        This is used to pass args to the `periodicvar_recovery` function::

            task[0] = period-finding result pickle to work on
            task[1] = simbasedir
            task[2] = period_tolerance

    Returns
    -------

    dict
        This is the dict produced by the `periodicvar_recovery` function for the
        input period-finding result pickle.


Question: Setup this colorful object by setting a colormode and the colorpalette . The extend_colors flag is used to extend the currently active color palette instead of replacing it .

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = False ) : if arg_1 : arg_0 . colormode = arg_1 if arg_2 : if arg_3 : arg_0 . update_palette ( arg_2 ) else : arg_0 . colorpalette = arg_2

Returns uptime in seconds or None, on MINIX.


Question: extract subdict of keys

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = { } arg_3 [ 'msg_id' ] = arg_1 [ 'msg_id' ] for arg_4 in arg_2 : arg_3 [ arg_4 ] = arg_1 [ arg_4 ] return copy ( arg_3 )


Question: Write the data into a raw format file . Big endian is always used .

def Func ( arg_0 , arg_1 ) : if arg_1 . ndim == 3 : arg_1 = arg_1 . reshape ( [ arg_1 . shape [ 0 ] , arg_1 . shape [ 1 ] * arg_1 . shape [ 2 ] ] ) arg_2 = array . array ( 'f' ) for arg_3 in arg_1 : arg_2 . fromlist ( list ( arg_3 . flatten ( ) ) ) with open ( arg_0 , 'wb' ) as rawf : arg_2 . tofile ( rawf )

Checks on whether the task instance is in the right state and timeframe
        to be retried.


Question: r | \

def Func ( arg_0 , arg_1 ) : if arg_1 . value [ 0 ] == '"' : arg_1 . lexer . push_state ( 'istringquotes' ) elif arg_1 . value [ 0 ] == '\'' : arg_1 . lexer . push_state ( 'istringapostrophe' ) return arg_1

Compute the average size of the largest cluster

    Helper function for :func:`microcanonical_averages`

    Parameters
    ----------

    max_cluster_size : 1-D :py:class:`numpy.ndarray` of int
        Each entry is the ``max_cluster_size`` field of the output of
        :func:`sample_states`:
        The size of the largest cluster (absolute number of sites).

    alpha: float
        Significance level.

    Returns
    -------

    ret : dict
        Largest cluster statistics

    ret['max_cluster_size'] : float
        Average size of the largest cluster (absolute number of sites)

    ret['max_cluster_size_ci'] : 1-D :py:class:`numpy.ndarray` of float, size 2
        Lower and upper bounds of the normal confidence interval of the average
        size of the largest cluster (absolute number of sites)

    See Also
    --------

    sample_states : largest cluster detection

    microcanonical_averages : largest cluster statistics


Question: update self . config from a flag which can be a dict or Config

def Func ( arg_0 , arg_1 ) : if isinstance ( arg_1 , ( dict , Config ) ) : for arg_2 , arg_3 in arg_1 . iteritems ( ) : arg_0 . config [ arg_2 ] . update ( arg_3 ) else : raise TypeError ( "Invalid flag: %r" % arg_1 )

Convert any non-DAVError exception to HTTP_INTERNAL_ERROR.


Question: It turns out that r tags can contain both t tags and drawing tags . Since we need both this function will return them in the order in which they are found .

def Func ( arg_0 ) : arg_1 = get_namespace ( arg_0 , 'w' ) arg_2 = ( '%st' % arg_1 , '%sdrawing' % arg_1 , '%spict' % arg_1 , '%sbr' % arg_1 , ) for arg_3 in arg_0 : if arg_3 . tag in arg_2 : yield arg_3


Question: destroy an instance meaning take down the instance and stop the build .

def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . _get_instances ( ) arg_3 = arg_0 . _get_project ( ) arg_4 = arg_0 . _get_zone ( ) arg_5 = False if 'items' in arg_2 : for arg_6 in arg_2 [ 'items' ] : if arg_6 [ 'name' ] == arg_1 : arg_5 = True break if arg_5 : bot . info ( 'Killing instance %s' % arg_1 ) return arg_0 . _compute_service . instances ( ) . delete ( arg_3 = arg_3 , arg_4 = arg_4 , arg_6 = arg_1 ) . execute ( )

Synchronize local po files with translations on GDocs Spreadsheet.
        Downloads two csv files, merges them and converts into po files
        structure. If new msgids appeared in po files, this method creates
        new ods with appended content and sends it to GDocs.


Question: Select a circular region centred on xc yc with a radius of r .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 , arg_6 = "replace" , arg_7 = "default" , arg_8 = True ) : if arg_8 : arg_9 = ( arg_0 [ arg_1 ] - arg_3 ) ** 2 + ( arg_0 [ arg_2 ] - arg_4 ) ** 2 <= arg_5 ** 2 else : arg_9 = ( arg_0 [ arg_1 ] - arg_3 ) ** 2 + ( arg_0 [ arg_2 ] - arg_4 ) ** 2 < arg_5 ** 2 arg_0 . select ( boolean_expression = arg_9 , arg_6 = arg_6 , arg_7 = arg_7 )

Convert any non-DAVError exception to HTTP_INTERNAL_ERROR.


Question: Returns the filename of the appropriate sakefile

def Func ( arg_0 ) : arg_1 = arg_0 [ "error" ] if arg_0 [ "customsake" ] : arg_2 = arg_0 [ "customsake" ] if not os . path . isfile ( arg_2 ) : arg_1 ( "Specified sakefile '{}' doesn't exist" , arg_2 ) sys . exit ( 1 ) return arg_2 for arg_3 in [ "Sakefile" , "Sakefile.yaml" , "Sakefile.yml" ] : if os . path . isfile ( arg_3 ) : return arg_3 arg_1 ( "Error: there is no Sakefile to read" ) sys . exit ( 1 )

Whether a connection can be established between those two meshes.


Question: Partitions a list into two based on a condition .

def Func ( arg_0 , arg_1 ) -> Tuple [ List , List ] : arg_2 , arg_3 = [ ] , [ ] for arg_4 in arg_1 : if arg_0 ( arg_4 ) : arg_2 . append ( arg_4 ) else : arg_3 . append ( arg_4 ) return arg_2 , arg_3

Return the class corresponding to the given temporalImp string


Question: r Bernoulli likelihood sampling .

def Func ( arg_0 , arg_1 , arg_2 = 0.5 , arg_3 = None , arg_4 = 0 , arg_5 = None , ) : arg_6 = LogitLink ( ) arg_7 , arg_8 = _mean_cov ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 ) arg_9 = BernoulliProdLik ( arg_6 ) arg_10 = GGPSampler ( arg_9 , arg_7 , arg_8 ) return arg_10 . sample ( arg_5 )

Performs completion at the current cursor location.


Question: Fetch the builds from the url .

def Func ( arg_0 , arg_1 = arg_2 ) : arg_3 = { } arg_4 = super ( ) . Func ( arg_1 , ** arg_3 ) return arg_4

Convenience function to efficiently construct a MultivariateNormalDiag.


Question: Returns a circuit putting 2 qubits in the Bell state .

def Func ( ) : arg_0 = QuantumRegister ( 2 ) arg_1 = ClassicalRegister ( 2 ) arg_2 = QuantumCircuit ( arg_0 , arg_1 ) arg_2 . h ( arg_0 [ 0 ] ) arg_2 . cx ( arg_0 [ 0 ] , arg_0 [ 1 ] ) arg_2 . measure ( arg_0 , arg_1 ) return arg_2


Question: Creates a payload for the redis server

def Func ( arg_0 , arg_1 ) : arg_2 = [ ] for arg_3 in arg_1 : arg_2 . extend ( arg_0 . serialize_rules ( arg_3 . rules ) ) return arg_2

Releases renderer resources associated with this image.


Question: Transform Choi representation to the Chi representation .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = int ( np . log2 ( arg_1 ) ) return _transform_to_pauli ( arg_0 , arg_3 )

Downloads a MP4 or WebM file that is associated with the video at the URL passed.

        :param str url: URL of the video to be downloaded
        :return str: Filename of the file in local storage


Question: Adds a callback to be completed once future is done

def Func ( arg_0 , arg_1 ) : def done_callback ( arg_2 ) : return arg_1 ( ) arg_0 . _future . Func ( done_callback )

Post processes the estimations from the algorithm, removing empty
        segments and making sure the lenghts of the boundaries and labels
        match.


Question: Creates Operators needed for model evaluation and returns .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 , arg_6 = None , arg_7 = None , arg_8 = None , arg_9 = None , arg_10 = None , arg_11 = None , arg_12 = None , arg_13 = None ) : if not re . match ( r"^[a-zA-Z][-A-Za-z0-9]*$" , arg_0 ) : raise AirflowException ( "Malformed task_id for DataFlowPythonOperator (only alphanumeric " "and hyphens are allowed but got: " + arg_0 ) arg_14 , arg_15 = arg_4 if not callable ( arg_14 ) : raise AirflowException ( "`metric_fn` param must be callable." ) if not callable ( arg_5 ) : raise AirflowException ( "`validate_fn` param must be callable." ) if arg_13 is not None and arg_13 . default_args is not None : arg_16 = arg_13 . default_args arg_7 = arg_7 or arg_16 . get ( 'project_id' ) arg_8 = arg_8 or arg_16 . get ( 'region' ) arg_11 = arg_11 or arg_16 . get ( 'model_name' ) arg_12 = arg_12 or arg_16 . get ( 'version_name' ) arg_9 = arg_9 or arg_16 . get ( 'dataflow_default_options' ) arg_17 = MLEngineBatchPredictionOperator ( task_id = ( arg_0 + "-prediction" ) , arg_7 = arg_7 , job_id = arg_6 , arg_8 = arg_8 , arg_1 = arg_1 , arg_2 = arg_2 , output_path = arg_3 , uri = arg_10 , arg_11 = arg_11 , arg_12 = arg_12 , arg_13 = arg_13 ) arg_18 = base64 . b64encode ( dill . dumps ( arg_14 , recurse = True ) ) arg_19 = DataFlowPythonOperator ( task_id = ( arg_0 + "-summary" ) , py_options = [ "-m" ] , py_file = "airflow.contrib.utils.mlengine_prediction_summary" , dataflow_default_options = arg_9 , options = { "prediction_path" : arg_3 , "metric_fn_encoded" : arg_18 , "metric_keys" : ',' . join ( arg_15 ) } , arg_13 = arg_13 ) arg_19 . set_upstream ( arg_17 ) def apply_validate_fn ( * arg_20 , ** arg_21 ) : arg_3 = arg_21 [ "templates_dict" ] [ "prediction_path" ] arg_22 , arg_23 , arg_24 , arg_25 , arg_25 = urlsplit ( arg_3 ) if arg_22 != "gs" or not arg_23 or not arg_24 : raise ValueError ( "Wrong format prediction_path: %s" , arg_3 ) arg_26 = os . path . join ( arg_24 . strip ( "/" ) , "prediction.summary.json" ) arg_27 = GoogleCloudStorageHook ( ) arg_26 = json . loads ( arg_27 . download ( arg_23 , arg_26 ) ) return arg_5 ( arg_26 ) arg_28 = PythonOperator ( task_id = ( arg_0 + "-validation" ) , python_callable = apply_validate_fn , provide_context = True , templates_dict = { "prediction_path" : arg_3 } , arg_13 = arg_13 ) arg_28 . set_upstream ( arg_19 ) return arg_17 , arg_19 , arg_28

Gets a 3D CoordinateMap from img.

    Parameters
    ----------
    img: nib.Nifti1Image or nipy Image

    Returns
    -------
    nipy.core.reference.coordinate_map.CoordinateMap


Question: Callback Receiving messages from publisher

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 , arg_6 ) : log . debug ( "msg={payload}" , arg_2 = arg_2 )

This is a parallel worker for running period-recovery.

    Parameters
    ----------

    task : tuple
        This is used to pass args to the `periodicvar_recovery` function::

            task[0] = period-finding result pickle to work on
            task[1] = simbasedir
            task[2] = period_tolerance

    Returns
    -------

    dict
        This is the dict produced by the `periodicvar_recovery` function for the
        input period-finding result pickle.


Question: Merges a named option collection .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None ) : arg_4 = None for arg_5 in arg_2 : if arg_5 is None : continue arg_6 = getattr ( arg_5 , arg_1 , None ) if arg_6 is None : continue arg_4 = utils . cons ( arg_4 , arg_6 ) arg_6 = arg_0 . get ( arg_1 ) if arg_6 is not None : arg_4 = utils . cons ( arg_4 , arg_6 ) return arg_4 or arg_3

Look through the jobs table and reactivate all that are already in the
    running state by setting their _eng_allocate_new_workers fields to True;
    used by Nupic Scheduler as part of its failure-recovery procedure.


Question: Remove cards from watchlist .

def Func ( arg_0 , arg_1 ) : arg_2 = 'DELETE' arg_3 = 'watchlist' if not isinstance ( arg_1 , ( list , tuple ) ) : arg_1 = ( arg_1 , ) arg_1 = ( str ( i ) for i in arg_1 ) arg_4 = { 'tradeId' : ',' . join ( arg_1 ) } arg_0 . __request__ ( arg_2 , arg_3 , arg_4 = arg_4 ) return True

Plots the rolling volatility versus date.

    Parameters
    ----------
    returns : pd.Series
        Daily returns of the strategy, noncumulative.
         - See full explanation in tears.create_full_tear_sheet.
    factor_returns : pd.Series, optional
        Daily noncumulative returns of the benchmark factor to which betas are
        computed. Usually a benchmark such as market returns.
         - This is in the same style as returns.
    rolling_window : int, optional
        The days window over which to compute the volatility.
    legend_loc : matplotlib.loc, optional
        The location of the legend on the plot.
    ax : matplotlib.Axes, optional
        Axes upon which to plot.
    **kwargs, optional
        Passed to plotting function.

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


Question: Create a topic entity .

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None , arg_4 = None , arg_5 = None , arg_6 = None ) : arg_7 = Topic ( arg_3 = arg_3 , arg_4 = arg_4 , arg_2 = arg_2 , arg_5 = arg_5 , arg_6 = arg_6 ) try : return arg_0 . mgmt_client . Func ( arg_1 , topic = arg_7 , fail_on_exist = True ) except requests . exceptions . ConnectionError as e : raise ServiceBusConnectionError ( "Namespace: {} not found" . format ( arg_0 . service_namespace ) , e )

Trim all the annotations inside the jam and return as a new `JAMS`
        object.

        See `Annotation.trim` for details about how the annotations
        are trimmed.

        This operation is also documented in the jam-level sandbox
        with a list keyed by ``JAMS.sandbox.trim`` containing a tuple for each
        jam-level trim of the form ``(start_time, end_time)``.

        This function also copies over all of the file metadata from the
        original jam.

        Note: trimming does not affect the duration of the jam, i.e. the value
        of ``JAMS.file_metadata.duration`` will be the same for the original
        and trimmed jams.

        Parameters
        ----------
        start_time : float
            The desired start time for the trimmed annotations in seconds.
        end_time
            The desired end time for trimmed annotations in seconds. Must be
            greater than ``start_time``.
        strict : bool
            When ``False`` (default) observations that lie at the boundaries of
            the trimming range (see `Annotation.trim` for details), will have
            their time and/or duration adjusted such that only the part of the
            observation that lies within the trim range is kept. When ``True``
            such observations are discarded and not included in the trimmed
            annotation.

        Returns
        -------
        jam_trimmed : JAMS
            The trimmed jam with trimmed annotations, returned as a new JAMS
            object.


Question: Calculates the quartet weights for the test at a random subsampled chunk of loci .

def Func ( arg_0 ) : arg_1 = arg_0 . sample_loci ( ) arg_2 = itertools . product ( * arg_0 . imap . values ( ) ) arg_3 = uuid . uuid4 ( ) . hex arg_4 = [ ] for arg_5 , arg_6 in enumerate ( arg_2 ) : arg_7 , arg_8 , arg_9 , arg_10 = arg_6 arg_11 = { } for arg_12 in arg_6 : if arg_0 . rmap [ arg_12 ] == "p1" : arg_11 [ "A" ] = arg_1 [ arg_12 ] elif arg_0 . rmap [ arg_12 ] == "p2" : arg_11 [ "B" ] = arg_1 [ arg_12 ] elif arg_0 . rmap [ arg_12 ] == "p3" : arg_11 [ "C" ] = arg_1 [ arg_12 ] else : arg_11 [ "D" ] = arg_1 [ arg_12 ] arg_13 = [ ] for arg_14 in list ( "ABCD" ) : arg_13 . append ( ">{}         {}" . format ( arg_14 , arg_11 [ arg_14 ] ) ) arg_15 , arg_16 = count_var ( arg_13 ) if arg_16 > arg_0 . minsnps : arg_17 = "{} {}\n" . format ( 4 , len ( arg_1 [ arg_7 ] ) ) + "\n" . join ( arg_13 ) arg_18 = arg_0 . run_tree_inference ( arg_17 , "{}.{}" . format ( arg_3 , arg_5 ) ) arg_4 . append ( arg_18 ) arg_19 = glob . glob ( os . path . join ( tempfile . tempdir , "*{}*" . format ( arg_3 ) ) ) for arg_20 in arg_19 : if os . path . exists ( arg_20 ) : os . remove ( arg_20 ) arg_21 = [ "ABCD" , "ACBD" , "ADBC" ] arg_22 = { arg_12 : float ( arg_4 . count ( arg_12 ) ) / len ( arg_4 ) for arg_12 in arg_21 } return arg_22

Displays the default pipeline inspection overview


Question: Print status of containers and networks

def Func ( arg_0 ) : arg_1 = load_config ( arg_0 . config ) arg_2 = get_blockade ( arg_1 , arg_0 ) arg_3 = arg_2 . status ( ) print_containers ( arg_3 , arg_0 . json )

Simple and fast implementation of the covariance AR estimate

    This code is 10 times faster than :func:`modcovar_marple` and more importantly
    only 10 lines of code, compared to a 200 loc for :func:`modcovar_marple`

    :param X:        Array of complex data samples
    :param int order:   Order of linear prediction model

    :return:
        * P    - Real linear prediction variance at order IP
        * A    - Array of complex linear prediction coefficients

    .. plot::
        :include-source:
        :width: 80%

        from spectrum import modcovar, marple_data, arma2psd, cshift
        from pylab import log10, linspace, axis, plot

        a, p = modcovar(marple_data, 15)
        PSD = arma2psd(a)
        PSD = cshift(PSD, len(PSD)/2) # switch positive and negative freq
        plot(linspace(-0.5, 0.5, 4096), 10*log10(PSD/max(PSD)))
        axis([-0.5,0.5,-60,0])

    .. seealso:: :class:`~spectrum.modcovar.pmodcovar`

    :validation: the AR parameters are the same as those returned by
        a completely different function :func:`modcovar_marple`.

    :References: Mathworks


Question: Updates the editor when the object trait changes externally to the editor .

def Func ( arg_0 ) : arg_1 = arg_0 . value arg_2 = arg_0 . factory . canvas if arg_2 is not None : for arg_3 in arg_2 . node_children : arg_4 = getattr ( arg_1 , arg_3 ) arg_0 . _add_nodes ( arg_4 ) for arg_5 in arg_2 . edge_children : arg_6 = getattr ( arg_1 , arg_5 ) arg_0 . _add_edges ( arg_6 ) arg_0 . _add_listeners ( )

Remove card from tradepile.

        :params trade_id: Trade id.


Question: Generic IOP reader that interpolates the iop to the common wavelengths defined in the constructor

def Func ( arg_0 , arg_1 ) : lg . info ( 'Reading :: ' + arg_1 + ' :: and interpolating to ' + str ( arg_0 . wavelengths ) ) if os . path . isfile ( arg_1 ) : arg_2 = csv . reader ( open ( arg_1 ) , delimiter = ',' , quotechar = '"' ) arg_3 = arg_2 . next ( ) arg_4 = arg_2 . next ( ) else : lg . exception ( 'Problem reading file :: ' + arg_1 ) raise IOError try : arg_3 = map ( float , arg_3 ) arg_4 = map ( float , arg_4 ) return scipy . interp ( arg_0 . wavelengths , arg_3 , arg_4 ) except IOError : lg . exception ( 'Error interpolating IOP to common wavelength' ) return - 1

Add noise to the given input.

  Parameters:
  -----------------------------------------------
  input:         the input to add noise to
  noise:         how much noise to add
  doForeground:  If true, turn off some of the 1 bits in the input
  doBackground:  If true, turn on some of the 0 bits in the input


Question: Subscribe a user to the given topic .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = _request ( 'POST' , url = arg_0 . url_v1 ( '/user/subscriptions/' + arg_2 ) , user_agent = arg_0 . user_agent , arg_1 = arg_1 , ) _raise_for_status ( arg_3 )

Write the index.html file for this report.


Question: Export the density grid to an OpenDX file .

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = '"' , ** arg_4 ) : arg_5 , arg_6 = os . path . splitext ( arg_1 ) arg_1 = arg_5 + '.dx' arg_7 = [ 'OpenDX density file written by gridDataFormats.Grid.export()' , 'File format: http://opendx.sdsc.edu/docs/html/pages/usrgu068.htm#HDREDF' , 'Data are embedded in the header and tied to the grid positions.' , 'Data is written in C array order: In grid[x,y,z] the axis z is fastest' , 'varying, then y, then finally x, i.e. z is the innermost loop.' ] if arg_0 . metadata : arg_7 . append ( 'Meta data stored with the python Grid object:' ) for arg_8 in arg_0 . metadata : arg_7 . append ( '   ' + str ( arg_8 ) + ' = ' + str ( arg_0 . metadata [ arg_8 ] ) ) arg_7 . append ( '(Note: the VMD dx-reader chokes on comments below this line)' ) arg_9 = dict ( positions = OpenDX . gridpositions ( 1 , arg_0 . grid . shape , arg_0 . origin , arg_0 . delta ) , connections = OpenDX . gridconnections ( 2 , arg_0 . grid . shape ) , data = OpenDX . array ( 3 , arg_0 . grid , arg_2 = arg_2 , arg_3 = arg_3 ) , ) arg_10 = OpenDX . field ( 'density' , arg_9 = arg_9 , arg_7 = arg_7 ) arg_10 . write ( arg_1 )

Removes this element from the tree, including its children and
        text.  The tail text is joined to the previous element or
        parent.


Question: Sets byte if not greater .

def Func ( arg_0 , arg_1 ) : arg_1 . write ( Operators . ITEBV ( arg_1 . size , Operators . OR ( arg_0 . ZF , arg_0 . SF != arg_0 . OF ) , 1 , 0 ) )

Get the reason of this revocation.

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

        .. seealso::

            :meth:`all_reasons`, which gives you a list of all supported
            reasons this method might return.


Question: Rollback to previous saved position .

def Func ( arg_0 ) -> bool : arg_0 . _cursor . position = arg_0 . _contexts . pop ( ) return False

Uploads file to GDocs spreadsheet.
        Content type can be provided as argument, default is ods.


Question: Retrieve a task handler from the queue .

def Func ( arg_0 , arg_1 = False , arg_2 = None , arg_3 = 0.5 , arg_4 = None ) : Func = time . time ( ) while 1 : arg_6 = arg_0 . _dequeue_task ( arg_4 ) if arg_6 is None and arg_1 : if arg_2 is not None and ( time . time ( ) - Func ) > arg_2 : break time . sleep ( arg_3 * ( random . random ( ) + 0.1 ) ) else : break return arg_6


Question: Search for domain or URL related to the original URL or domain .

def Func ( arg_0 ) : if PyFunceble . CONFIGURATION [ "mining" ] : try : arg_1 = PyFunceble . requests . get ( arg_0 . to_get , timeout = PyFunceble . CONFIGURATION [ "seconds_before_http_timeout" ] , headers = arg_0 . headers , ) . history arg_2 = { arg_0 . to_get_bare : [ ] } for arg_3 in arg_1 : arg_3 = arg_3 . url if PyFunceble . INTERN [ "to_test_type" ] == "url" : arg_4 = Check ( ) . is_url_valid ( arg_3 , return_base = False ) elif PyFunceble . INTERN [ "to_test_type" ] == "domain" : arg_4 = Check ( ) . is_url_valid ( arg_3 , return_base = True ) else : raise Exception ( "Unknown tested." ) if arg_4 : if arg_4 . endswith ( ":80" ) : arg_4 = arg_4 [ : - 3 ] if arg_4 != arg_0 . to_get_bare : arg_2 [ arg_0 . to_get_bare ] . append ( arg_4 ) if arg_2 [ arg_0 . to_get_bare ] : return arg_2 return None except ( PyFunceble . requests . ConnectionError , PyFunceble . requests . exceptions . Timeout , PyFunceble . requests . exceptions . InvalidURL , PyFunceble . socket . timeout , urllib3_exceptions . InvalidHeader , UnicodeDecodeError , ) : return None return None


Question: Sets given string as command name instead of the function name . The string is used verbatim without further processing .

def Func ( arg_0 ) : def wrapper ( arg_1 ) : setattr ( arg_1 , ATTR_NAME , arg_0 ) return arg_1 return wrapper


Question: pip install redbaron

def Func ( ) : import redbaron import ubelt as ub arg_0 = 'docs/conf.py' arg_1 = ub . readfrom ( arg_0 ) arg_2 = redbaron . RedBaron ( arg_1 ) arg_3 = [ '"sphinxcontrib.napoleon"' ] arg_4 = arg_2 . find ( 'name' , arg_6 = 'extensions' ) . parent arg_4 . value . value . extend ( arg_3 ) arg_5 = arg_2 . find ( 'name' , arg_6 = 'html_theme' ) . parent arg_5 . value . value = '"sphinx_rtd_theme"' ub . writeto ( arg_0 , arg_2 . dumps ( ) )

Retrieve the list of courses contained within the catalog linked to this enterprise.

        Only courses with active course runs are returned. A course run is considered active if it is currently
        open for enrollment, or will open in the future.


Question: Converts gate tuples into a nested list of integers .

def Func ( arg_0 , arg_1 ) : arg_2 = [ qr . size for qr in arg_1 . values ( ) ] arg_3 = np . cumsum ( [ 0 ] + arg_2 ) arg_4 = { } for arg_5 , arg_6 in enumerate ( arg_1 . values ( ) ) : arg_4 [ arg_6 ] = arg_5 arg_7 = np . zeros ( 2 * len ( arg_0 ) , dtype = np . int32 ) for arg_8 , arg_9 in enumerate ( arg_0 ) : arg_7 [ 2 * arg_8 ] = arg_3 [ arg_4 [ arg_9 [ 0 ] [ 0 ] ] ] + arg_9 [ 0 ] [ 1 ] arg_7 [ 2 * arg_8 + 1 ] = arg_3 [ arg_4 [ arg_9 [ 1 ] [ 0 ] ] ] + arg_9 [ 1 ] [ 1 ] return arg_7

Draw this line segment as a binary image mask.

        Parameters
        ----------
        image_shape : tuple of int
            The shape of the image onto which to draw the line mask.

        size_lines : int, optional
            Thickness of the line segments.

        size_points : int, optional
            Size of the points in pixels.

        raise_if_out_of_image : bool, optional
            Whether to raise an error if the line string is fully
            outside of the image. If set to False, no error will be raised and
            only the parts inside the image will be drawn.

        Returns
        -------
        ndarray
            Boolean line mask of shape `image_shape` (no channel axis).


Question: Determine if a file is empty or not .

def Func ( arg_0 ) : if six . PY2 : arg_1 = arg_0 . read ( ) arg_0 . seek ( 0 ) return not bool ( arg_1 ) else : return not arg_0 . peek ( )


Question: canonical cluster statistics for a single run and a single probability

def Func ( arg_0 , arg_1 , ** arg_2 ) : arg_3 = ( 'has_spanning_cluster' in arg_0 . dtype . names ) arg_4 = np . empty ( 1 , dtype = canonical_statistics_dtype ( arg_3 ) ) if arg_3 : arg_4 [ 'percolation_probability' ] = np . sum ( arg_1 * arg_0 [ 'has_spanning_cluster' ] ) arg_4 [ 'max_cluster_size' ] = np . sum ( arg_1 * arg_0 [ 'max_cluster_size' ] ) arg_4 [ 'moments' ] = np . sum ( arg_1 [ : , np . newaxis ] * arg_0 [ 'moments' ] , axis = 0 , ) return arg_4

Post processes the estimations from the algorithm, removing empty
        segments and making sure the lenghts of the boundaries and labels
        match.


Question: Returns the jQuery DataTables ThemeRoller CSS file according to version number .

def Func ( arg_0 = None ) : if arg_0 is None : if not getattr ( settings , 'DJFRONTEND_JQUERY_DATATABLES_THEMEROLLER' , False ) : arg_0 = getattr ( settings , 'DJFRONTEND_JQUERY_DATATABLES_VERSION' , DJFRONTEND_JQUERY_DATATABLES_VERSION_DEFAULT ) else : arg_0 = getattr ( settings , 'DJFRONTEND_JQUERY_DATATABLES_THEMEROLLER' , DJFRONTEND_JQUERY_DATATABLES_VERSION_DEFAULT ) return format_html ( '<link rel="stylesheet" href="href="{static}djfrontend/css/jquery/jquery.dataTables/{v}/jquery.dataTables_themeroller.min.css">' , static = _static_url , v = arg_0 )

Given a unicode string, will do its dandiest to give you back a
    valid ascii charset string you can use in, say, http headers and the
    like.


Question: Parse a string of HTML data into an Element tree using the BeautifulSoup parser .

def Func ( arg_0 , arg_1 = None , arg_2 = None , ** arg_3 ) : return _parse ( arg_0 , arg_1 , arg_2 , ** arg_3 )


Question: Apply unique checks on r .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 = False , arg_5 = None ) : for arg_6 , arg_7 , arg_8 in arg_0 . _unique_checks : arg_9 = None arg_10 = arg_3 [ arg_6 ] if isinstance ( arg_6 , basestring ) : arg_11 = arg_0 . _field_names . index ( arg_6 ) if arg_11 >= len ( arg_2 ) : continue arg_9 = arg_2 [ arg_11 ] else : arg_9 = [ ] for arg_12 in arg_6 : arg_11 = arg_0 . _field_names . index ( arg_12 ) if arg_11 >= len ( arg_2 ) : break arg_9 . append ( arg_2 [ arg_11 ] ) arg_9 = tuple ( arg_9 ) if arg_9 in arg_10 : arg_13 = { 'code' : arg_7 } if not arg_4 : arg_13 [ 'message' ] = arg_8 arg_13 [ 'row' ] = arg_1 + 1 arg_13 [ 'record' ] = arg_2 arg_13 [ 'key' ] = arg_6 arg_13 [ 'value' ] = arg_9 if arg_5 is not None : arg_13 [ 'context' ] = arg_5 yield arg_13 arg_10 . add ( arg_9 )


Question: Set Console handler .

def Func ( arg_0 , arg_1 = False ) : arg_2 = logging . StreamHandler ( ) arg_2 . setFormatter ( Formatter ( LFORMAT ) ) if not arg_1 : arg_2 . setLevel ( logging . INFO ) arg_0 . addHandler ( arg_2 )

Updates the current set of parameter values and previous values,
        sets a flag to re-calculate J.

        Parameters
        ----------
            new_vals : numpy.ndarray
                The new values to update to
            incremental : Bool, optional
                Set to True to make it an incremental update relative
                to the old parameters. Default is False


Question: Returns assignment data for the given course_id .

def Func ( arg_0 , arg_1 ) : arg_2 = "/api/v1/courses/%s/analytics/assignments.json" % ( arg_0 . _sis_id ( arg_1 , sis_field = "course" ) ) return arg_0 . _get_resource ( arg_2 )

Post processes the estimations from the algorithm, removing empty
        segments and making sure the lenghts of the boundaries and labels
        match.


Question: Print a string snipping the midsection to fit in width .

def Func ( arg_0 , arg_1 = 75 , arg_2 = 0 , arg_3 = '' ) : if arg_2 == 1 : page ( arg_3 + arg_0 ) return 0 print arg_3 , if len ( arg_0 ) < arg_1 : print arg_0 arg_4 = 0 else : arg_5 = int ( ( arg_1 - 5 ) / 2 ) print arg_0 [ : arg_5 ] + ' <...> ' + arg_0 [ - arg_5 : ] arg_4 = 1 if arg_4 and arg_2 == 2 : if raw_input ( arg_3 + ' Snipped. View (y/n)? [N]' ) . lower ( ) == 'y' : page ( arg_0 ) return arg_4


Question: Set the timeout for the communication with the device .

def Func ( arg_0 , arg_1 ) : arg_1 = int ( arg_1 ) arg_0 . _timeout = arg_1 == 0 and 999999 or arg_1

Fetch items using the given backend.

    Generator to get items using the given backend class. When
    an archive manager is given, this function will store
    the fetched items in an `Archive`. If an exception is raised,
    this archive will be removed to avoid corrupted archives.

    The parameters needed to initialize the `backend` class and
    get the items are given using `backend_args` dict parameter.

    :param backend_class: backend class to fetch items
    :param backend_args: dict of arguments needed to fetch the items
    :param category: category of the items to retrieve.
       If None, it will use the default backend category
    :param filter_classified: remove classified fields from the resulting items
    :param manager: archive manager needed to store the items

    :returns: a generator of items


Question: Display a list of files and prompt for ones to be kept .

def Func ( arg_0 , arg_1 = 1 , arg_2 = 1 ) : arg_0 = sorted ( arg_0 ) print for arg_3 , arg_4 in enumerate ( arg_0 ) : print "%d) %s" % ( arg_3 + 1 , arg_4 ) while True : arg_5 = raw_input ( "[%s/%s] Keepers: " % ( arg_1 , arg_2 ) ) . strip ( ) if not arg_5 : print ( "Please enter a space/comma-separated list of numbers or " "'all'." ) continue elif arg_5 . lower ( ) == 'all' : return [ ] try : arg_6 = [ int ( x ) - 1 for x in arg_5 . replace ( ',' , ' ' ) . split ( ) ] return [ arg_4 for arg_3 , arg_4 in enumerate ( arg_0 ) if arg_3 not in arg_6 ] except ValueError : print ( "Invalid choice. Please enter a space/comma-separated list" "of numbers or 'all'." )

Extract metadata entries from an xml node


Question: Get a list

def Func ( arg_0 , arg_1 , arg_2 = None ) : return arg_0 . create_list ( dict ( arg_1 = arg_1 , arg_2 = arg_2 ) )

Utility method to visualize decision boundaries in R^2.

  Args:
    features: Input points, as a Numpy `array` of shape `[num_examples, 2]`.
    labels: Numpy `float`-like array of shape `[num_examples, 1]` giving a
      label for each point.
    true_w_b: A `tuple` `(w, b)` where `w` is a Numpy array of
       shape `[2]` and `b` is a scalar `float`, interpreted as a
       decision rule of the form `dot(features, w) + b > 0`.
    candidate_w_bs: Python `iterable` containing tuples of the same form as
       true_w_b.
    fname: The filename to save the plot as a PNG image (Python `str`).


Question: Show the variables window .

def Func ( arg_0 ) : if arg_0 . var_window is None and arg_0 . bot . _vars : arg_0 . var_window = VarWindow ( arg_0 , arg_0 . bot , '%s variables' % ( arg_0 . title or 'Shoebot' ) ) arg_0 . var_window . window . connect ( "destroy" , arg_0 . var_window_closed )

Overriding the default JSONEncoder.default for NDB support.


Question: Add POST data .

def Func ( arg_0 , arg_1 ) : if not arg_0 . _data : arg_0 . _data = { } arg_0 . _data . update ( arg_1 )

Creates the variational distribution for LDA.

  Args:
    activation: Activation function to use.
    num_topics: The number of topics.
    layer_sizes: The number of hidden units per layer in the encoder.

  Returns:
    lda_variational: A function that takes a bag-of-words Tensor as
      input and returns a distribution over topics.


Question: Activate a user .

def Func ( arg_0 ) : try : PolyaxonClient ( ) . user . Func_user ( arg_0 ) except ( PolyaxonHTTPError , PolyaxonShouldExitError , PolyaxonClientException ) as e : Printer . print_error ( 'Could not Func user `{}`.' . format ( arg_0 ) ) Printer . print_error ( 'Error message `{}`.' . format ( e ) ) sys . exit ( 1 ) Printer . print_success ( "User `{}` was Funcd successfully." . format ( arg_0 ) )

Copy file from `src` path to `dst` path. If `dst` already exists, will add '+' characters
    to the end of the basename without extension.

    Parameters
    ----------
    src: str

    dst: str

    Returns
    -------
    dstpath: str


Question: Search for messages

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = 20 , arg_4 = 0 , arg_5 = None , arg_6 = None , arg_7 = None ) : arg_2 = { 'thread_id' : arg_1 , 'query' : arg_2 , 'limit' : arg_3 , 'offset' : arg_4 } if arg_5 : arg_2 [ 'message_context_details' ] = arg_5 if arg_6 : arg_2 [ 'window_above' ] = arg_6 if arg_7 : arg_2 [ 'window_below' ] = arg_7 arg_8 = make_get_request ( arg_0 , 'messages/search' , params_data = arg_2 ) arg_9 = arg_8 . json ( ) if arg_8 . status_code == 200 : return arg_9 [ 'result' ] else : raise MessagesNotFoundException ( message = arg_9 [ 'message' ] , error_code = arg_9 [ 'error_code' ] , request_id = arg_9 [ 'request_id' ] )


Question: Convert the name argument to a list of names .

def Func ( arg_0 ) : if isinstance ( arg_0 , str ) : return [ arg_0 ] elif arg_0 is None : return [ 'anytrait' ] elif isinstance ( arg_0 , ( list , tuple ) ) : for arg_1 in arg_0 : assert isinstance ( arg_1 , str ) , "names must be strings" return arg_0


Question: Converts xml response to service bus namespace availability

def Func ( arg_0 ) : arg_1 = minidom . parseString ( arg_0 ) arg_2 = AvailabilityResponse ( ) for arg_3 in _MinidomXmlToObject . get_children_from_path ( arg_1 , 'entry' , 'content' , 'NamespaceAvailability' ) : arg_4 = _MinidomXmlToObject . get_first_child_node_value ( arg_3 , 'Result' ) if arg_4 is not None : arg_2 . result = _parse_bool ( arg_4 ) return arg_2

Simple and fast implementation of the covariance AR estimate

    This code is 10 times faster than :func:`modcovar_marple` and more importantly
    only 10 lines of code, compared to a 200 loc for :func:`modcovar_marple`

    :param X:        Array of complex data samples
    :param int order:   Order of linear prediction model

    :return:
        * P    - Real linear prediction variance at order IP
        * A    - Array of complex linear prediction coefficients

    .. plot::
        :include-source:
        :width: 80%

        from spectrum import modcovar, marple_data, arma2psd, cshift
        from pylab import log10, linspace, axis, plot

        a, p = modcovar(marple_data, 15)
        PSD = arma2psd(a)
        PSD = cshift(PSD, len(PSD)/2) # switch positive and negative freq
        plot(linspace(-0.5, 0.5, 4096), 10*log10(PSD/max(PSD)))
        axis([-0.5,0.5,-60,0])

    .. seealso:: :class:`~spectrum.modcovar.pmodcovar`

    :validation: the AR parameters are the same as those returned by
        a completely different function :func:`modcovar_marple`.

    :References: Mathworks


Question: Set the active client .

async def Func ( arg_0 , arg_1 ) : arg_2 = hangouts_pb2 . SetActiveClientResponse ( ) await arg_0 . _pb_request ( 'clients/setactiveclient' , arg_1 , arg_2 ) return arg_2

Extracts the category from a GitHub item.

        This backend generates two types of item which are
        'issue' and 'pull_request'.


Question: We work out all combinations using this internal recursion method

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ) : if arg_3 < arg_4 : for arg_5 , arg_6 in enumerate ( arg_1 ) : arg_7 = list ( arg_2 ) arg_7 . append ( arg_6 ) arg_0 . Func ( arg_1 [ arg_5 + 1 : ] , arg_7 , arg_3 + 1 , arg_4 ) else : arg_0 . _options . append ( arg_2 )

Send a Gauge metric with the specified value


Question: Estimate the remaining time left .

def Func ( arg_0 , arg_1 ) : if arg_1 : arg_2 = ( time . time ( ) - arg_0 . t_start ) / arg_1 * ( arg_0 . iter - arg_1 ) else : arg_2 = 0 arg_3 = datetime . datetime ( 1 , 1 , 1 ) + datetime . timedelta ( seconds = arg_2 ) arg_4 = "%02d:%02d:%02d:%02d" % ( arg_3 . day - 1 , arg_3 . hour , arg_3 . minute , arg_3 . second ) return arg_4


Question: An alternative translate implementation that uses a geometric function . This is more accurate than the built - in version .

def Func ( arg_0 , arg_1 = ( 0.0 , 0.0 , 0.0 ) ) : if not isinstance ( arg_1 , list ) : arg_1 = list ( arg_1 ) vert_function ( arg_0 , x_func = 'x+(%s)' % arg_1 [ 0 ] , y_func = 'y+(%s)' % arg_1 [ 1 ] , z_func = 'z+(%s)' % arg_1 [ 2 ] ) return None


Question: Generates a confusion matrix between rater_a and rater_b A confusion matrix shows how often 2 values agree and disagree See quadratic_weighted_kappa for argument descriptions

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None ) : assert ( len ( arg_0 ) == len ( arg_1 ) ) arg_0 = [ int ( arg_6 ) for arg_6 in arg_0 ] arg_1 = [ int ( arg_7 ) for arg_7 in arg_1 ] arg_2 = int ( arg_2 ) arg_3 = int ( arg_3 ) if arg_2 is None : arg_2 = min ( arg_0 ) if arg_3 is None : arg_3 = max ( arg_0 ) arg_4 = int ( arg_3 - arg_2 + 1 ) arg_5 = [ [ 0 for i in range ( arg_4 ) ] for j in range ( arg_4 ) ] for arg_6 , arg_7 in zip ( arg_0 , arg_1 ) : arg_5 [ int ( arg_6 - arg_2 ) ] [ int ( arg_7 - arg_2 ) ] += 1 return arg_5

Get a texture by its label

        Args:
            label (str): The Label for the texture

        Returns:
            The py:class:`moderngl.Texture` instance


Question: Initialize the required tables in the database

def Func ( arg_0 ) : with arg_0 . _db_conn ( ) as conn : for arg_1 in arg_0 . _tables . values ( ) : conn . execute ( arg_1 ) return arg_0


Question: Raises OrderError if no package or file defined . Raises CardinalityError if already set . Raises SPDXValueError if malformed .

def Func ( arg_0 , arg_1 , arg_2 ) : if arg_0 . has_package ( arg_1 ) and arg_0 . has_file ( arg_1 ) : if not arg_0 . file_conc_lics_set : arg_0 . file_conc_lics_set = True if validations . validate_lics_conc ( arg_2 ) : arg_0 . file ( arg_1 ) . conc_lics = arg_2 return True else : raise SPDXValueError ( 'File::ConcludedLicense' ) else : raise CardinalityError ( 'File::ConcludedLicense' ) else : raise OrderError ( 'File::ConcludedLicense' )

Wait for the termination of a process and log its stdout & stderr