Question: Change password for logged in django staff user

def Func ( arg_0 , arg_1 ) : arg_2 = PasswordChangeForm ( arg_1 . user , data = arg_1 . data ) if not arg_2 . is_valid ( ) : raise serializers . ValidationError ( arg_2 . errors ) arg_2 . save ( ) update_session_auth_hash ( arg_1 , arg_2 . user ) return Response ( status = status . HTTP_204_NO_CONTENT )

Main executor of the trimmomatic_report template.

    Parameters
    ----------
    log_files : list
        List of paths to the trimmomatic log files.


Question: Decorate a CLI function that might require authentication .

def Func ( arg_0 ) : @ wraps ( arg_0 ) def wrapper ( arg_1 ) : try : arg_2 = arg_0 ( arg_1 ) except UnauthorizedException as e : arg_3 = config_from_env ( config_from_file ( ) ) arg_4 = _get_username ( arg_1 , arg_3 ) if arg_4 is None : sys . exit ( "Please set a username (run `osf -h` for details)." ) else : sys . exit ( "You are not authorized to access this project." ) return arg_2 return wrapper

Leave a one-to-one conversation.

        One-to-one conversations are "sticky"; they can't actually be deleted.
        This API clears the event history of the specified conversation up to
        ``delete_upper_bound_timestamp``, hiding it if no events remain.


Question: Get privileges of a local file

def Func ( arg_0 , arg_1 ) : try : return str ( oct ( os . stat ( arg_1 ) . st_mode ) [ - 3 : ] ) except Exception as e : raise Failure ( 'Could not get stat for %s, error_message = %s' , arg_1 , e )

For a 2D array and mask, map the values of all unmasked pixels to a 1D array.

    The pixel coordinate origin is at the top left corner of the 2D array and goes right-wards and downwards, such
    that for an array of shape (3,3) where all pixels are unmasked:

    - pixel [0,0] of the 2D array will correspond to index 0 of the 1D array.
    - pixel [0,1] of the 2D array will correspond to index 1 of the 1D array.
    - pixel [1,0] of the 2D array will correspond to index 4 of the 1D array.

    Parameters
     ----------
    mask : ndarray
        A 2D array of bools, where *False* values mean unmasked and are included in the mapping.
    array_2d : ndarray
        The 2D array of values which are mapped to a 1D array.

    Returns
    --------
    ndarray
        A 1D array of values mapped from the 2D array with dimensions (total_unmasked_pixels).

    Examples
    --------
    mask = np.array([[True, False, True],
                     [False, False, False]
                     [True, False, True]])

    array_2d = np.array([[1.0, 2.0, 3.0],
                          [4.0, 5.0, 6.0],
                          [7.0, 8.0, 9.0]])

    array_1d = map_2d_array_to_masked_1d_array_from_array_2d_and_mask(mask=mask, array_2d=array_2d)


Question: Retrieves a dataset file matching a provided file path

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None ) : return arg_0 . Funcs ( arg_1 , "^{}$" . format ( arg_2 ) , version_number = arg_3 ) [ 0 ]


Question: Renders the selected social widget . You can specify optional settings that will be passed to widget template .

def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 . split_contents ( ) arg_3 = arg_2 [ 0 ] if len ( arg_2 ) < 2 : raise TemplateSyntaxError ( "'%s' takes at least one argument" % arg_3 ) arg_4 = [ ] arg_5 = { } arg_2 = arg_2 [ 1 : ] if len ( arg_2 ) : for arg_6 in arg_2 : arg_7 = kwarg_re . match ( arg_6 ) if not arg_7 : raise TemplateSyntaxError ( "Malformed arguments to %s tag" % arg_3 ) arg_8 , arg_9 = arg_7 . groups ( ) if arg_8 : arg_8 = arg_8 . replace ( '-' , '_' ) arg_5 [ arg_8 ] = arg_0 . compile_filter ( arg_9 ) else : arg_4 . append ( arg_0 . compile_filter ( arg_9 ) ) return SocialWidgetNode ( arg_4 , arg_5 )

Main executor of the trimmomatic_report template.

    Parameters
    ----------
    log_files : list
        List of paths to the trimmomatic log files.


Question: Set item of the dictionary .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None , arg_4 = None ) : with arg_0 . _lock : logger . debug ( "expdict.__setitem__({0!r}, {1!r}, {2!r}, {3!r})" . format ( arg_1 , arg_2 , arg_3 , arg_4 ) ) if not arg_3 : arg_3 = arg_0 . _default_timeout arg_0 . _timeouts [ arg_1 ] = ( time . time ( ) + arg_3 , arg_4 ) return dict . __setitem__ ( arg_0 , arg_1 , arg_2 )

Extracts the category from a GitHub item.

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


Question: This endpoint is used to set the health of an allocation that is in the deployment manually . In some use cases automatic detection of allocation health may not be desired . As such those task groups can be marked with an upgrade policy that uses health_check = manual . Those allocations must have their health marked manually using this endpoint . Marking an allocation as healthy will allow the rolling upgrade to proceed . Marking it as failed will cause the deployment to fail .

def Func ( arg_0 , arg_1 , arg_2 = arg_3 ( ) , arg_4 = arg_3 ( ) ) : arg_5 = { "HealthyAllocationIDs" : arg_2 , "UnHealthyAllocationIDs" : arg_4 , "DeploymentID" : arg_1 } return arg_0 . request ( "allocation-health" , arg_1 , json = arg_5 , method = "post" ) . json ( )

Get the underlying `botocore.Credentials` object.

        This contains the following authentication attributes: access_key, secret_key and token.


Question: Delete the external tool identified by external_tool_id .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = arg_1 . format ( arg_2 ) + "/external_tools/{}" . format ( arg_3 ) arg_5 = arg_0 . _delete_resource ( arg_4 ) return True

Return a response object from the given JSON data.

        :param data: Data to JSON-encode.
        :type data: mixed
        :param headers: Dict of headers to include in the requests.
        :type headers: dict
        :param status_code: HTTP status code.
        :type status_code: int
        :rtype: requests.Response


Question: Follow a set of marker data yielding kinematic joint angles .

def Func ( arg_0 , arg_1 = 0 , arg_2 = 1e100 , arg_3 = None , arg_4 = 20 ) : arg_5 = None if arg_4 > 0 : arg_0 . skeleton . enable_motors ( arg_4 ) arg_5 = np . zeros ( arg_0 . skeleton . num_dofs ) for arg_6 in arg_0 . follow_markers ( arg_1 , arg_2 , arg_3 ) : if arg_5 is not None : arg_0 . skeleton . set_target_angles ( arg_5 ) yield arg_0 . skeleton . joint_angles

Provides permissions for mongoadmin for use in the context


Question: Randomly reorder SRV records using their weights .

def Func ( arg_0 ) : if not arg_0 : return [ ] arg_1 = [ ] while len ( arg_0 ) > 1 : arg_2 = 0 for arg_3 in arg_0 : arg_2 += arg_3 . weight + 0.1 arg_4 = random . random ( ) * arg_2 arg_2 = 0 for arg_3 in arg_0 : arg_2 += arg_3 . weight + 0.1 if arg_4 < arg_2 : arg_0 . remove ( arg_3 ) arg_1 . append ( arg_3 ) break arg_1 . append ( arg_0 [ 0 ] ) return arg_1

Get experiment or experiment job logs.

    Uses [Caching](/references/polyaxon-cli/#caching)

    Examples for getting experiment logs:

    \b
    ```bash
    $ polyaxon experiment logs
    ```

    \b
    ```bash
    $ polyaxon experiment -xp 10 -p mnist logs
    ```

    Examples for getting experiment job logs:

    \b
    ```bash
    $ polyaxon experiment -xp 1 -j 1 logs
    ```


Question: Find addresses matching the command parameters .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 ) : arg_6 = AddressGenerator ( arg_1 , arg_4 , arg_5 ) if arg_3 is None : for arg_7 in arg_6 . create_iterator ( start = arg_2 ) : arg_8 = FindTransactionsCommand ( arg_0 . adapter ) ( addresses = [ arg_7 . address ] , ) if not arg_8 . get ( 'hashes' ) : return [ arg_7 ] return arg_6 . get_addresses ( start = arg_2 , arg_3 = arg_3 )

Drop a node from the network

        :param node: node to drop
        :type node: Node


Question: Properly Format Time for permlinks

def Func ( arg_0 ) : if isinstance ( arg_0 , float ) : return datetime . utcfromtimestamp ( arg_0 ) . strftime ( timeFormat ) if isinstance ( arg_0 , datetime ) : return arg_0 . strftime ( timeFormat )

Clip input array with a vector list.

    Parameters
    ----------
    array : array
        input raster data
    array_affine : Affine
        Affine object describing the raster's geolocation
    geometries : iterable
        iterable of dictionaries, where every entry has a 'geometry' and
        'properties' key.
    inverted : bool
        invert clip (default: False)
    clip_buffer : integer
        buffer (in pixels) geometries before clipping

    Returns
    -------
    clipped array : array


Question: Registers the up and down handlers . Also registers a scheduled function every 60th of a second causing pyglet to redraw your window with 60fps .

def Func ( arg_0 ) : arg_0 . peng . keybinds . add ( arg_0 . peng . cfg [ "controls.controls.crouch" ] , "peng3d:actor.%s.player.controls.crouch" % arg_0 . actor . uuid , arg_0 . on_crouch_down , False ) arg_0 . peng . keybinds . add ( arg_0 . peng . cfg [ "controls.controls.jump" ] , "peng3d:actor.%s.player.controls.jump" % arg_0 . actor . uuid , arg_0 . on_jump_down , False ) pyglet . clock . schedule_interval ( arg_0 . update , 1.0 / 60 )


Question: This function handles the retrieval of whether or not a chemical can be absorbed through the skin relevant to chemical safety calculations .

def Func ( arg_0 , arg_1 = False , arg_2 = None ) : def list_methods ( ) : arg_3 = [ ] if arg_0 in _OntarioExposureLimits : arg_3 . append ( ONTARIO ) arg_3 . append ( NONE ) return arg_3 if arg_1 : return list_methods ( ) if not arg_2 : arg_2 = list_methods ( ) [ 0 ] if arg_2 == ONTARIO : arg_4 = ( _OntarioExposureLimits [ arg_0 ] [ "Func" ] ) elif arg_2 == NONE : arg_4 = None else : raise Exception ( 'Failure in in function' ) return arg_4

Convert UTC datetime into user interface string.


Question: Given a single spinn3r feed entry produce a single StreamItem .

def Func ( arg_0 ) : if not hasattr ( arg_0 , 'permalink_entry' ) : return None arg_1 = arg_0 . permalink_entry arg_2 = streamcorpus . make_stream_item ( arg_1 . date_found [ : - 1 ] + '.0Z' , arg_1 . canonical_link . href . encode ( 'utf8' ) ) if not arg_2 . stream_time : logger . debug ( 'failed to generate stream_time from {0!r}' . format ( arg_1 . date_found ) ) return None if not arg_2 . abs_url : logger . debug ( 'failed to generate abs_url from {0!r}' . format ( arg_1 . canonical_link . href ) ) return None arg_2 . body = _make_content_item ( arg_1 . content , alternate_data = arg_0 . feed_entry . content . data ) if not arg_2 . body : return None if not arg_2 . body . raw : return None if arg_1 . content_extract . data : arg_2 . other_content [ 'extract' ] = _make_content_item ( arg_1 . content_extract ) arg_2 . other_content [ 'title' ] = streamcorpus . ContentItem ( raw = arg_1 . title . encode ( 'utf8' ) , media_type = arg_1 . content_extract . mime_type , encoding = 'UTF-8' ) arg_2 . other_content [ 'feed_entry_title' ] = streamcorpus . ContentItem ( raw = arg_0 . feed_entry . title . encode ( 'utf8' ) , media_type = arg_0 . feed_entry . content . mime_type , encoding = 'UTF-8' ) if arg_0 . feed_entry . content . data : arg_2 . other_content [ 'feed_entry' ] = _make_content_item ( arg_0 . feed_entry . content ) arg_2 . source_metadata [ 'lang' ] = arg_1 . lang [ 0 ] . code arg_2 . source_metadata [ 'author' ] = json . dumps ( dict ( name = arg_1 . author [ 0 ] . name , email = arg_1 . author [ 0 ] . email , link = arg_1 . author [ 0 ] . link [ 0 ] . href , ) ) arg_2 . source = arg_0 . source . publisher_type return arg_2

Change the given swarm's state to 'newState'. If 'newState' is
    'completed', then bestModelId and bestErrScore must be provided.

    Parameters:
    ---------------------------------------------------------------------
    swarmId:      swarm Id
    newStatus:    new status, either 'active', 'completing', 'completed', or
                    'killed'


Question: Replace child nodes on original function call with their partials

def Func ( arg_0 ) : for arg_1 in filter ( lambda n : len ( n . arg_name ) , arg_0 . child_list ) : arg_0 . data [ "bound_args" ] . arguments [ arg_1 . arg_name ] = arg_1 . partial ( ) arg_0 . updated = True

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


Question: Inserts a small icon to QR Code image

def Func ( arg_0 , arg_1 = None , arg_2 = 4 , arg_3 = None , arg_4 = None ) : arg_5 , arg_6 = arg_0 . size arg_7 = int ( arg_5 ) / int ( arg_2 ) arg_8 = int ( arg_6 ) / int ( arg_2 ) try : arg_9 = os . path . join ( arg_1 ) if arg_4 : arg_9 = os . path . join ( arg_4 , arg_1 ) if arg_1 . split ( "://" ) [ 0 ] in [ "http" , "https" , "ftp" ] : arg_9 = BytesIO ( urlopen ( arg_1 ) . read ( ) ) arg_10 = Image . open ( arg_9 ) except : return arg_0 arg_11 , arg_12 = arg_10 . size arg_11 = arg_7 if arg_11 > arg_7 else arg_11 arg_12 = arg_8 if arg_12 > arg_8 else arg_12 arg_10 = arg_10 . resize ( ( int ( arg_11 ) , int ( arg_12 ) ) , Image . ANTIALIAS ) arg_10 = arg_10 . convert ( "RGBA" ) arg_13 = int ( ( arg_5 - arg_11 ) / 2 ) arg_14 = int ( ( arg_6 - arg_12 ) / 2 ) arg_3 = ( int ( arg_3 [ 0 ] ) , int ( arg_3 [ 1 ] ) ) if arg_3 else ( arg_13 , arg_14 ) arg_0 . paste ( im = arg_10 , box = arg_3 , mask = arg_10 ) return arg_0

Return the most recent timestamp in the operation.


Question: Load all Service Fabric commands

def Func ( arg_0 , arg_1 ) : with CommandSuperGroup ( __name__ , arg_0 , 'rcctl.custom_cluster#{}' ) as super_group : with super_group . group ( 'cluster' ) as group : group . command ( 'select' , 'select' ) with CommandSuperGroup ( __name__ , arg_0 , 'rcctl.custom_reliablecollections#{}' , client_factory = client_create ) as super_group : with super_group . group ( 'dictionary' ) as group : group . command ( 'query' , 'query_reliabledictionary' ) group . command ( 'execute' , 'execute_reliabledictionary' ) group . command ( 'schema' , 'get_reliabledictionary_schema' ) group . command ( 'list' , 'get_reliabledictionary_list' ) group . command ( 'type-schema' , 'get_reliabledictionary_type_schema' ) with ArgumentsContext ( arg_0 , 'dictionary' ) as ac : ac . argument ( 'application_name' , options_list = [ '--application-name' , '-a' ] ) ac . argument ( 'service_name' , options_list = [ '--service-name' , '-s' ] ) ac . argument ( 'dictionary_name' , options_list = [ '--dictionary-name' , '-d' ] ) ac . argument ( 'output_file' , options_list = [ '--output-file' , '-out' ] ) ac . argument ( 'input_file' , options_list = [ '--input-file' , '-in' ] ) ac . argument ( 'query_string' , options_list = [ '--query-string' , '-q' ] ) ac . argument ( 'type_name' , options_list = [ '--type-name' , '-t' ] ) return OrderedDict ( arg_0 . command_table )

Setup a handler to be called when a trait changes.

        This is used to setup dynamic notifications of trait changes.

        Static handlers can be created by creating methods on a HasTraits
        subclass with the naming convention '_[traitname]_changed'.  Thus,
        to create static handler for the trait 'a', create the method
        _a_changed(self, name, old, new) (fewer arguments can be used, see
        below).

        Parameters
        ----------
        handler : callable
            A callable that is called when a trait changes.  Its
            signature can be handler(), handler(name), handler(name, new)
            or handler(name, old, new).
        name : list, str, None
            If None, the handler will apply to all traits.  If a list
            of str, handler will apply to all names in the list.  If a
            str, the handler will apply just to that name.
        remove : bool
            If False (the default), then install the handler.  If True
            then unintall it.


Question: Write the value of the Boolean object to the output stream .

def Func ( arg_0 , arg_1 , arg_2 = arg_3 . KMIPVersion . KMIP_1_0 ) : try : arg_1 . write ( pack ( '!Q' , arg_0 . value ) ) except Exception : arg_0 . logger . error ( "Error writing boolean value to buffer" ) raise

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: Sets the beam moments directly .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_0 . _sx = arg_1 arg_0 . _sxp = arg_2 arg_0 . _sxxp = arg_3 arg_7 = _np . sqrt ( arg_1 ** 2 * arg_2 ** 2 - arg_3 ** 2 ) arg_0 . _store_emit ( arg_7 = arg_7 )

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


Question: Upload given metrics function into H2O cluster .

def Func ( arg_0 , arg_1 = "metrics.py" , arg_2 = None , arg_3 = None , arg_4 = None ) : import tempfile import inspect if not arg_4 : arg_4 = _default_source_provider arg_5 = """# Generated codeimport water.udf.CMetricFunc as MetricFunc# User given metric function as a class implementing# 3 methods defined by interface CMetricFunc{}# Generated user metric which satisfies the interface# of Java MetricFuncclass {}Wrapper({}, MetricFunc, object):    pass""" assert_satisfies ( arg_0 , inspect . isclass ( arg_0 ) or isinstance ( arg_0 , str ) , "The argument func needs to be string or class !" ) assert_satisfies ( arg_1 , arg_1 is not None , "The argument func_file is missing!" ) assert_satisfies ( arg_1 , arg_1 . endswith ( '.py' ) , "The argument func_file needs to end with '.py'" ) arg_6 = None arg_7 = None arg_8 = arg_1 [ : - 3 ] if isinstance ( arg_0 , str ) : assert_satisfies ( arg_3 , arg_3 is not None , "The argument class_name is missing! " + "It needs to reference the class in given string!" ) arg_6 = arg_5 . format ( arg_0 , arg_3 , arg_3 ) arg_7 = "metrics_{}" . format ( arg_3 ) arg_3 = "{}.{}Wrapper" . format ( arg_8 , arg_3 ) else : assert_satisfies ( arg_0 , inspect . isclass ( arg_0 ) , "The parameter `func` should be str or class" ) for arg_9 in [ 'map' , 'reduce' , 'metric' ] : assert_satisfies ( arg_0 , arg_9 in arg_0 . __dict__ , "The class `func` needs to define method `{}`" . format ( arg_9 ) ) assert_satisfies ( arg_3 , arg_3 is None , "If class is specified then class_name parameter needs to be None" ) arg_3 = "{}.{}Wrapper" . format ( arg_8 , arg_0 . __name__ ) arg_7 = "metrics_{}" . format ( arg_0 . __name__ ) arg_6 = arg_5 . format ( arg_4 ( arg_0 ) , arg_0 . __name__ , arg_0 . __name__ ) if not arg_2 : arg_2 = arg_7 arg_10 = tempfile . mkdtemp ( prefix = "h2o-func" ) arg_11 = _create_zip_file ( "{}/func.jar" . format ( arg_10 ) , ( arg_1 , arg_6 ) ) arg_12 = _put_key ( arg_11 , arg_12 = arg_2 ) return "python:{}={}" . format ( arg_12 , arg_3 )

Downloads the latest Raspbian image and writes it to a microSD card.

        Based on the instructions from:

        https://www.raspberrypi.org/documentation/installation/installing-images/linux.md


Question: Returns a list of the ancestors of this node but does not pass the root node even if the root has parents due to cycles .

def Func ( arg_0 ) : if arg_0 . is_root ( ) : return [ ] arg_1 = set ( [ ] ) arg_0 . _depth_ascend ( arg_0 , arg_1 , True ) try : arg_1 . remove ( arg_0 ) except KeyError : pass return list ( arg_1 )

_get_key_for_index - Returns the key name that would hold the indexes on a value
			Internal - does not validate that indexedFields is actually indexed. Trusts you. Don't let it down.

			@param indexedField - string of field name
			@param val - Value of field

			@return - Key name string, potentially hashed.


Question: Load crs object from esri code via spatialreference . org . Parses based on the proj4 representation .

def Func ( arg_0 ) : arg_0 = str ( arg_0 ) arg_1 = utils . crscode_to_string ( "esri" , arg_0 , "proj4" ) arg_2 = from_proj4 ( arg_1 ) return arg_2

Convert data to web output.

        Parameters
        ----------
        data : array

        Returns
        -------
        web data : array


Question: Similar to smart_unicode except that lazy instances are resolved to strings rather than kept as lazy objects .

def Func ( arg_0 , arg_1 = 'utf-8' , arg_2 = False , arg_3 = 'strict' ) : if isinstance ( arg_0 , str ) : return arg_0 if arg_2 and is_protected_type ( arg_0 ) : return arg_0 try : if not isinstance ( arg_0 , str ) : if hasattr ( arg_0 , '__unicode__' ) : arg_0 = arg_0 . __unicode__ ( ) else : try : arg_0 = str ( arg_0 , arg_1 , arg_3 ) except UnicodeEncodeError : if not isinstance ( arg_0 , Exception ) : raise arg_0 = ' ' . join ( [ Func ( arg , arg_1 , arg_2 , arg_3 ) for arg in arg_0 ] ) elif not isinstance ( arg_0 , str ) : arg_0 = arg_0 . decode ( arg_1 , arg_3 ) except UnicodeDecodeError as ex : if not isinstance ( arg_0 , Exception ) : raise DjangoUnicodeDecodeError ( arg_0 , * ex . args ) else : arg_0 = ' ' . join ( [ Func ( arg , arg_1 , arg_2 , arg_3 ) for arg in arg_0 ] ) return arg_0

Backtrack detected onset events to the nearest preceding local
    minimum of an energy function.

    This function can be used to roll back the timing of detected onsets
    from a detected peak amplitude to the preceding minimum.

    This is most useful when using onsets to determine slice points for
    segmentation, as described by [1]_.

    .. [1] Jehan, Tristan.
           "Creating music by listening"
           Doctoral dissertation
           Massachusetts Institute of Technology, 2005.

    Parameters
    ----------
    events : np.ndarray, dtype=int
        List of onset event frame indices, as computed by `onset_detect`

    energy : np.ndarray, shape=(m,)
        An energy function

    Returns
    -------
    events_backtracked : np.ndarray, shape=events.shape
        The input events matched to nearest preceding minima of `energy`.

    Examples
    --------
    >>> y, sr = librosa.load(librosa.util.example_audio_file(),
    ...                      offset=30, duration=2.0)
    >>> oenv = librosa.onset.onset_strength(y=y, sr=sr)
    >>> # Detect events without backtracking
    >>> onset_raw = librosa.onset.onset_detect(onset_envelope=oenv,
    ...                                        backtrack=False)
    >>> # Backtrack the events using the onset envelope
    >>> onset_bt = librosa.onset.onset_backtrack(onset_raw, oenv)
    >>> # Backtrack the events using the RMS values
    >>> rms = librosa.feature.rms(S=np.abs(librosa.stft(y=y)))
    >>> onset_bt_rms = librosa.onset.onset_backtrack(onset_raw, rms[0])

    >>> # Plot the results
    >>> import matplotlib.pyplot as plt
    >>> plt.figure()
    >>> plt.subplot(2,1,1)
    >>> plt.plot(oenv, label='Onset strength')
    >>> plt.vlines(onset_raw, 0, oenv.max(), label='Raw onsets')
    >>> plt.vlines(onset_bt, 0, oenv.max(), label='Backtracked', color='r')
    >>> plt.legend(frameon=True, framealpha=0.75)
    >>> plt.subplot(2,1,2)
    >>> plt.plot(rms[0], label='RMS')
    >>> plt.vlines(onset_bt_rms, 0, rms.max(), label='Backtracked (RMS)', color='r')
    >>> plt.legend(frameon=True, framealpha=0.75)


Question: Convert images to another colorspace .

def Func ( arg_0 , arg_1 = "RGB" , arg_2 = None , arg_3 = None , arg_4 = False , arg_5 = None ) : return WithColorspace ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 )

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


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

def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_3 = arg_0 . get_object ( ) arg_0 . check_object_permissions ( arg_1 , arg_3 ) arg_0 . ensure_data_exists ( arg_1 , arg_3 . catalog , error_message = "No catalog is associated with Enterprise {enterprise_name} from endpoint '{path}'." . format ( enterprise_name = arg_3 . name , path = arg_1 . get_full_path ( ) ) ) arg_4 = CourseCatalogApiClient ( arg_1 . user , arg_3 . site ) Func = arg_4 . get_paginated_catalog_courses ( arg_3 . catalog , arg_1 . GET ) arg_0 . ensure_data_exists ( arg_1 , Func , error_message = ( "Unable to fetch API response for catalog courses for " "Enterprise {enterprise_name} from endpoint '{path}'." . format ( enterprise_name = arg_3 . name , path = arg_1 . get_full_path ( ) ) ) ) arg_6 = serializers . EnterpriseCatalogCoursesReadOnlySerializer ( Func ) arg_6 . update_enterprise_courses ( arg_3 , catalog_id = arg_3 . catalog ) return get_paginated_response ( arg_6 . data , arg_1 )

Drop a node from the network

        :param node: node to drop
        :type node: Node


Question: Hack in a data directory

def Func ( arg_0 , arg_1 ) : arg_2 = list ( arg_0 . DATA_DIRS ) arg_2 . append ( arg_1 ) arg_0 . DATA_DIRS = arg_2

Generates a jobs_pending progress bar widget.


Question: Filter tags according between_tags option .

def Func ( arg_0 , arg_1 ) : arg_2 = [ t [ "name" ] for t in arg_1 ] arg_3 = [ ] for arg_4 in arg_0 . options . between_tags : try : arg_5 = arg_2 . index ( arg_4 ) except ValueError : raise ChangelogGeneratorError ( "ERROR: can't find tag {0}, specified with " "--between-tags option." . format ( arg_4 ) ) arg_3 . append ( arg_1 [ arg_5 ] ) arg_3 = arg_0 . sort_tags_by_date ( arg_3 ) if len ( arg_3 ) == 1 : arg_3 . append ( arg_3 [ 0 ] ) arg_6 = arg_0 . get_time_of_tag ( arg_3 [ 1 ] ) arg_7 = arg_0 . get_time_of_tag ( arg_3 [ 0 ] ) for arg_4 in arg_1 : if arg_6 < arg_0 . get_time_of_tag ( arg_4 ) < arg_7 : arg_3 . append ( arg_4 ) if arg_6 == arg_7 : arg_3 . pop ( 0 ) return arg_3


Question: Like union but ignores whether the two intervals intersect or not

def Func ( arg_0 , arg_1 ) : return Interval ( min ( arg_0 . start , arg_1 . start ) , max ( arg_0 . end , arg_1 . end ) )


Question: Splits the muscle alignment into chunks . Each chunk is run on a separate computing core . Because the largest clusters are at the beginning of the clusters file assigning equal clusters to each file would put all of the large cluster that take longer to align near the top . So instead we randomly distribute the clusters among the files . If assembly method is reference then this step is just a placeholder and nothing happens .

def Func ( arg_0 , arg_1 ) : LOGGER . info ( "inside Func" ) if arg_0 . paramsdict [ "assembly_method" ] != "reference" : arg_2 = os . path . join ( arg_0 . dirs . clusts , arg_1 . name + ".clust.gz" ) with iter ( gzip . open ( arg_2 , 'rb' ) ) as arg_5 : arg_3 = sum ( 1 for i in arg_5 if "//" in i ) // 2 arg_4 = ( arg_3 // 20 ) + ( arg_3 % 20 ) LOGGER . info ( "optim for align chunks: %s" , arg_4 ) arg_5 = gzip . open ( arg_2 , 'rb' ) arg_6 = iter ( arg_5 . read ( ) . strip ( ) . split ( "//\n//\n" ) ) arg_7 = arg_4 // 10 for arg_8 in range ( 10 ) : arg_9 = arg_4 + ( arg_8 * arg_7 ) arg_10 = arg_3 - arg_9 if arg_8 == 9 : arg_11 = list ( itertools . islice ( arg_6 , int ( 1e9 ) ) ) else : arg_11 = list ( itertools . islice ( arg_6 , arg_9 ) ) arg_3 = arg_10 arg_12 = os . path . join ( arg_0 . tmpdir , arg_1 . name + "_chunk_{}.ali" . format ( arg_8 ) ) with open ( arg_12 , 'wb' ) as out : out . write ( "//\n//\n" . join ( arg_11 ) ) arg_5 . close ( )

message_replied event is not truly a message event and does not have a message.text
        don't process such events

        commands may not be idempotent, so ignore message_changed events.


Question: Authenticate a user from a token form field

def Func ( arg_0 , arg_1 ) : try : arg_2 = arg_1 . data [ 'token' ] except KeyError : return try : arg_3 = AuthToken . objects . get ( arg_2 = arg_2 ) except AuthToken . DoesNotExist : return return ( arg_3 . user , arg_3 )

Creates a service from a constructor and checks which kwargs are not used


Question: Stop scheduling tasks because an engine has been unregistered from a pure ZMQ scheduler .

def Func ( arg_0 ) : arg_0 . _task_socket . close ( ) arg_0 . _task_socket = None arg_2 = "An engine has been unregistered, and we are using pure " + "ZMQ task scheduling.  Task farming will be disabled." if arg_0 . outstanding : arg_2 += " If you were running tasks when this happened, " + "some `outstanding` msg_ids may never resolve." warnings . warn ( arg_2 , RuntimeWarning )

Load the configuration.

    :param under_test:
        Tell us if we only have to load the configuration file (True)
        or load the configuration file and initate the output directory
        if it does not exist (False).
    :type under_test: bool

    :param custom:
        A dict with the configuration index (from .PyFunceble.yaml) to update.
    :type custom: dict

    .. warning::
        If :code:`custom` is given, the given :code:`dict` overwrite
        the last value of the given configuration indexes.


Question: Returns the front ID found in front at the given index .

def Func ( arg_0 , arg_1 ) : arg_2 , arg_3 = arg_1 arg_4 = arg_0 [ arg_2 , arg_3 ] if arg_4 == 0 : return - 1 else : return arg_4

Stop streaming samples from device and delete samples buffer


Question: Perform delta step by writing stacked values to signals

def Func ( arg_0 ) -> Generator [ None , None , None ] : arg_1 = arg_0 . _valuesToApply arg_0 . _applyValPlaned = False arg_3 = arg_0 . config . logApplyingValues if arg_1 and arg_3 : arg_3 ( arg_0 , arg_1 ) arg_0 . _valuesToApply = [ ] arg_5 = arg_0 . _seqProcsToRun . append for arg_6 , arg_7 , arg_8 , arg_9 in arg_1 : if arg_8 : arg_5 ( arg_9 ) else : arg_6 . simUpdateVal ( arg_0 , arg_7 ) arg_0 . _runCombProcesses ( ) if arg_0 . _valuesToApply and not arg_0 . _applyValPlaned : arg_0 . _scheduleApplyValues ( ) return yield

Enumerate all possible resonance forms and return them as a list.

        :param mol: The input molecule.
        :type mol: rdkit.Chem.rdchem.Mol
        :return: A list of all possible resonance forms of the molecule.
        :rtype: list of rdkit.Chem.rdchem.Mol


Question: Restores the database from a snapshot

def Func ( arg_0 ) : arg_1 = get_app ( ) if not arg_0 : arg_2 = arg_1 . get_latest_snapshot ( ) if not arg_2 : click . echo ( "Couldn't find any snapshots for project %s" % load_config ( ) [ 'project_name' ] ) sys . exit ( 1 ) else : arg_2 = arg_1 . get_snapshot ( arg_0 ) if not arg_2 : click . echo ( "Couldn't find snapshot with name %s.\n" "You can list snapshots with 'stellar list'" % arg_0 ) sys . exit ( 1 ) if not arg_2 . slaves_ready : if arg_1 . is_copy_process_running ( arg_2 ) : sys . stdout . write ( 'Waiting for background process(%s) to finish' % arg_2 . worker_pid ) sys . stdout . flush ( ) while not arg_2 . slaves_ready : sys . stdout . write ( '.' ) sys . stdout . flush ( ) sleep ( 1 ) arg_1 . db . session . refresh ( arg_2 ) click . echo ( '' ) else : click . echo ( 'Background process missing, doing slow Func.' ) arg_1 . inline_slave_copy ( arg_2 ) arg_1 . Func ( arg_2 ) click . echo ( 'Restore complete.' )

Generates a bytecode from an object.

    :param obb: The object to generate.
    :param previous: The previous bytecode to use when generating subobjects.
    :return: The generated bytecode.


Question: Perform param type mapping This requires a bit of logic since this isn t standardized . If a type doesn t map assume str

def Func ( arg_0 ) : arg_1 , arg_2 = TYPE_INFO_RE . match ( arg_0 ) . groups ( ) if arg_1 in ( 'list' , 'array' ) : if arg_2 is not None : arg_2 = arg_2 . strip ( ) if not arg_2 : arg_2 = 'str' arg_3 = TYPE_INFO_RE . match ( arg_2 ) if arg_3 : arg_2 = arg_3 . group ( 1 ) . lower ( ) return [ PARAM_TYPE_MAP . setdefault ( arg_2 , string_types ) ] return PARAM_TYPE_MAP . setdefault ( arg_1 , string_types )


Question: Search the handler list for handlers matching given stanza type and payload namespace . Run the handlers found ordering them by priority until the first one which returns True .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None ) : if arg_3 is None : arg_3 = arg_2 . stanza_type arg_4 = arg_2 . get_all_payload ( ) arg_5 = [ p . __class__ for p in arg_4 ] arg_6 = [ ( p . __class__ , p . handler_key ) for p in arg_4 ] for arg_7 in arg_1 : arg_8 = arg_7 . _pyxmpp_stanza_handled [ 1 ] arg_9 = arg_7 . _pyxmpp_payload_class_handled arg_10 = arg_7 . _pyxmpp_payload_key if arg_8 != arg_3 : continue if arg_9 : if arg_10 is None and arg_9 not in arg_5 : continue if arg_10 and ( arg_9 , arg_10 ) not in arg_6 : continue arg_11 = arg_7 ( arg_2 ) if arg_0 . _process_handler_result ( arg_11 ) : return True return False


Question: Creates a snapshot of a cluster

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_0 . get_conn ( ) . Func ( SnapshotIdentifier = arg_1 , ClusterIdentifier = arg_2 , ) return arg_3 [ 'Snapshot' ] if arg_3 [ 'Snapshot' ] else None

Yield egg or source distribution objects based on basename


Question: Sets the style to the specified Pygments style .

def Func ( arg_0 , arg_1 ) : if isinstance ( arg_1 , basestring ) : arg_1 = get_style_by_name ( arg_1 ) arg_0 . _style = arg_1 arg_0 . _clear_caches ( )

Fit structure-based AD. The training model  memorizes the unique set of reaction signature.

        Parameters
        ----------
        X : after read rdf file

        Returns
        -------
        self : object


Question: Automatically includes all submodules and role selectors in the top - level fabfile using spooky - scary black magic .

def Func ( ) : arg_0 = inspect . stack ( ) arg_1 = None for arg_2 , arg_3 , arg_4 , arg_5 , arg_5 , arg_5 in arg_0 : if 'fabfile.py' in arg_3 : arg_1 = arg_2 break if not arg_1 : return try : arg_6 = arg_1 . f_locals for arg_7 , arg_8 in sub_modules . items ( ) : arg_6 [ arg_7 ] = arg_8 for arg_9 , arg_10 in role_commands . items ( ) : assert arg_9 not in sub_modules , ( 'The role %s conflicts with a built-in submodule. ' 'Please choose a different name.' ) % ( arg_9 ) arg_6 [ arg_9 ] = arg_10 arg_6 [ 'common' ] = common arg_6 [ 'shell' ] = shell for arg_11 in common . post_import_modules : exec ( "import %s" % arg_11 ) arg_6 [ arg_11 ] = locals ( ) [ arg_11 ] finally : del arg_0

Update annotations of discretized continuous pulse function with duration.

    Args:
        discretized_pulse: Discretized decorated continuous pulse.


Question: This fits a univariate cubic spline to the phased light curve .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 = 0.01 , arg_5 = 30 , arg_6 = 30.0 , arg_7 = False , arg_8 = False , arg_9 = False , arg_10 = True ) : if arg_2 is None : arg_2 = npfull_like ( arg_1 , 0.005 ) arg_11 , arg_12 , arg_13 = sigclip_magseries ( arg_0 , arg_1 , arg_2 , arg_6 = arg_6 , arg_9 = arg_9 ) arg_14 = npnonzero ( arg_13 ) arg_11 , arg_12 , arg_13 = arg_11 [ arg_14 ] , arg_12 [ arg_14 ] , arg_13 [ arg_14 ] arg_15 , arg_16 , arg_17 , arg_18 , arg_19 = ( get_phased_quantities ( arg_11 , arg_12 , arg_13 , arg_3 ) ) arg_20 = len ( arg_15 ) arg_21 = int ( npfloor ( arg_4 * arg_20 ) ) arg_21 = arg_5 if arg_21 > arg_5 else arg_21 arg_22 = nplinspace ( arg_15 [ 0 ] + 0.01 , arg_15 [ - 1 ] - 0.01 , num = arg_21 ) arg_23 = npdiff ( arg_15 ) > 0.0 arg_24 = npconcatenate ( ( nparray ( [ True ] ) , arg_23 ) ) arg_15 , arg_16 , arg_17 = ( arg_15 [ arg_24 ] , arg_16 [ arg_24 ] , arg_17 [ arg_24 ] ) arg_25 = LSQUnivariateSpline ( arg_15 , arg_16 , t = arg_22 , w = 1.0 / arg_17 ) arg_26 = arg_25 ( arg_15 ) arg_27 = npsum ( ( ( arg_26 - arg_16 ) * ( arg_26 - arg_16 ) ) / ( arg_17 * arg_17 ) ) arg_28 = arg_27 / ( len ( arg_16 ) - arg_21 - 1 ) if arg_10 : LOGINFO ( 'spline fit done. nknots = %s,  ' 'chisq = %.5f, reduced chisq = %.5f' % ( arg_21 , arg_27 , arg_28 ) ) if not arg_9 : arg_29 = npwhere ( arg_26 == npmax ( arg_26 ) ) else : arg_29 = npwhere ( arg_26 == npmin ( arg_26 ) ) if len ( arg_29 [ 0 ] ) > 1 : arg_29 = ( arg_29 [ 0 ] [ 0 ] , ) arg_30 = arg_18 [ arg_29 ] arg_31 = { 'fittype' : 'spline' , 'fitinfo' : { 'nknots' : arg_21 , 'fitmags' : arg_26 , 'fitepoch' : arg_30 } , 'fitchisq' : arg_27 , 'fitredchisq' : arg_28 , 'fitplotfile' : None , 'magseries' : { 'times' : arg_18 , 'phase' : arg_15 , 'mags' : arg_16 , 'errs' : arg_17 , 'magsarefluxes' : arg_9 } , } if arg_7 and isinstance ( arg_7 , str ) : make_fit_plot ( arg_15 , arg_16 , arg_17 , arg_26 , arg_3 , arg_19 , arg_30 , arg_7 , arg_9 = arg_9 ) arg_31 [ 'fitplotfile' ] = arg_7 return arg_31

Overriding the default JSONEncoder.default for NDB support.


Question: Return a WHERE clause matching the given API path and user_id .

def Func ( arg_0 , arg_1 ) : arg_2 , arg_3 = split_api_filepath ( arg_1 ) return and_ ( files . c . name == arg_3 , files . c . user_id == arg_0 , files . c . parent_name == arg_2 , )

Write the index.html file for this report.


Question: Splits the modpath into the dir that must be in PYTHONPATH for the module to be imported and the modulepath relative to this directory .

def Func ( arg_0 , arg_1 = True ) : if six . PY2 : if arg_0 . endswith ( '.pyc' ) : arg_0 = arg_0 [ : - 1 ] arg_2 = abspath ( expanduser ( arg_0 ) ) if arg_1 : if not exists ( arg_2 ) : if not exists ( arg_0 ) : raise ValueError ( 'modpath={} does not exist' . format ( arg_0 ) ) raise ValueError ( 'modpath={} is not a module' . format ( arg_0 ) ) if isdir ( arg_2 ) and not exists ( join ( arg_0 , '__init__.py' ) ) : raise ValueError ( 'modpath={} is not a module' . format ( arg_0 ) ) arg_3 , arg_4 = split ( arg_2 ) arg_5 = [ arg_4 ] arg_6 = arg_3 while exists ( join ( arg_6 , '__init__.py' ) ) : arg_6 , arg_7 = split ( arg_6 ) arg_5 . append ( arg_7 ) arg_8 = arg_5 [ : : - 1 ] arg_9 = os . path . sep . join ( arg_8 ) return arg_6 , arg_9


Question: Start connection and initialize session services

def Func ( arg_0 ) : arg_1 = _get_logger ( arg_0 . debug ) arg_2 = arg_0 . _session . Func ( ) if arg_2 : arg_3 = arg_0 . _session . nextEvent ( ) arg_4 = _EVENT_DICT [ arg_3 . eventType ( ) ] arg_1 . info ( 'Event Type: {!r}' . format ( arg_4 ) ) for arg_5 in arg_3 : arg_1 . info ( 'Message Received:\n{}' . format ( arg_5 ) ) if arg_3 . eventType ( ) != blpapi . Event . SESSION_STATUS : raise RuntimeError ( 'Expected a "SESSION_STATUS" event but ' 'received a {!r}' . format ( arg_4 ) ) arg_3 = arg_0 . _session . nextEvent ( ) arg_4 = _EVENT_DICT [ arg_3 . eventType ( ) ] arg_1 . info ( 'Event Type: {!r}' . format ( arg_4 ) ) for arg_5 in arg_3 : arg_1 . info ( 'Message Received:\n{}' . format ( arg_5 ) ) if arg_3 . eventType ( ) != blpapi . Event . SESSION_STATUS : raise RuntimeError ( 'Expected a "SESSION_STATUS" event but ' 'received a {!r}' . format ( arg_4 ) ) else : arg_3 = arg_0 . _session . nextEvent ( arg_0 . timeout ) if arg_3 . eventType ( ) == blpapi . Event . SESSION_STATUS : for arg_5 in arg_3 : arg_1 . warning ( 'Message Received:\n{}' . format ( arg_5 ) ) raise ConnectionError ( 'Could not Func blpapi.Session' ) arg_0 . _init_services ( ) return arg_0

Load a configuration module and return a Config


Question: Set brightness of bulb .

def Func ( arg_0 , arg_1 ) : arg_2 = "C {},,,,{},\r\n" . format ( arg_0 . _zid , arg_1 ) arg_3 = arg_0 . _hub . send_command ( arg_2 ) _LOGGER . debug ( "Set brightness %s: %s" , repr ( arg_2 ) , arg_3 ) return arg_3

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: Returns the summary of the learned topics .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = 10 , arg_4 = 10 ) : arg_1 = np . squeeze ( arg_1 , axis = 0 ) arg_5 = np . argsort ( - arg_1 , kind = "mergesort" ) arg_6 = np . argsort ( - arg_0 , axis = 1 ) arg_7 = [ ] for arg_8 in arg_5 [ : arg_3 ] : arg_9 = [ "index={} alpha={:.2f}" . format ( arg_8 , arg_1 [ arg_8 ] ) ] arg_9 += [ arg_2 [ arg_10 ] for arg_10 in arg_6 [ arg_8 , : arg_4 ] ] arg_7 . append ( " " . join ( arg_9 ) ) return np . array ( arg_7 )

Callable to configure Bokeh's show method when a proxy must be
    configured.

    If port is None we're asking about the URL
    for the origin header.


Question: Current instruction pointed by self . pc

def Func ( arg_0 ) : try : arg_1 = getattr ( arg_0 , '_decoding_cache' ) except Exception : arg_1 = arg_0 . _decoding_cache = { } arg_2 = arg_0 . pc if isinstance ( arg_2 , Constant ) : arg_2 = arg_2 . value if arg_2 in arg_1 : return arg_1 [ arg_2 ] def getcode ( ) : arg_3 = arg_0 . bytecode for arg_4 in range ( arg_2 , len ( arg_3 ) ) : yield simplify ( arg_3 [ arg_4 ] ) . value while True : yield 0 Func = EVMAsm . disassemble_one ( getcode ( ) , arg_2 = arg_2 , fork = DEFAULT_FORK ) arg_1 [ arg_2 ] = Func return Func

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: Writes out PNG image data in chunks to file pointer fp

def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . urlopen ( ) . fp while 1 : try : arg_1 . Func ( arg_2 . next ( ) ) except StopIteration : return

Concert velocities from a cartesian to a spherical coordinate system

        TODO: errors

        :param x: name of x column (input)
        :param y:         y
        :param z:         z
        :param vx:       vx
        :param vy:       vy
        :param vz:       vz
        :param vr: name of the column for the radial velocity in the r direction (output)
        :param vlong: name of the column for the velocity component in the longitude direction  (output)
        :param vlat: name of the column for the velocity component in the latitude direction, positive points to the north pole (output)
        :param distance: Expression for distance, if not given defaults to sqrt(x**2+y**2+z**2), but if this column already exists, passing this expression may lead to a better performance
        :return:


Question: visit an astroid . Import node

def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 . root ( ) . file for arg_3 in arg_1 . names : arg_4 = modutils . is_relative ( arg_3 [ 0 ] , arg_2 ) arg_0 . _imported_module ( arg_1 , arg_3 [ 0 ] , arg_4 )

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


Question: Removes a NIC from the load balancer .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = arg_0 . _perform_request ( url = '/datacenters/%s/loadbalancers/%s/balancednics/%s' % ( arg_1 , arg_2 , arg_3 ) , method = 'DELETE' ) return arg_4

Parses a file and returns a document object.
        File, a file like object.


Question: This method increases the permanence values of synapses of columns whose activity level has been too low . Such columns are identified by having an overlap duty cycle that drops too much below those of their peers . The permanence values for such columns are increased .

def Func ( arg_0 ) : arg_1 = numpy . where ( arg_0 . _overlapDutyCycles < arg_0 . _minOverlapDutyCycles ) [ 0 ] for arg_2 in arg_1 : arg_3 = arg_0 . _permanences [ arg_2 ] . astype ( realDType ) arg_4 = numpy . where ( arg_0 . _potentialPools [ arg_2 ] > 0 ) [ 0 ] arg_3 [ arg_4 ] += arg_0 . _synPermBelowStimulusInc arg_0 . _updatePermanencesForColumn ( arg_3 , arg_2 , raisePerm = False )

Open the editor at the given filename, linenumber, column and
    show an error message. This is used for correcting syntax errors.
    The current implementation only has special support for the VIM editor,
    and falls back on the 'editor' hook if VIM is not used.

    Call ip.set_hook('fix_error_editor',youfunc) to use your own function,


Question: Clean up children and remove the directory .

def Func ( arg_0 ) : for arg_1 in arg_0 . _children : arg_0 . _children [ arg_1 ] . Func ( ) if arg_0 . _Func : arg_0 . remove ( True )

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


Question: Returns a list of locations .

def Func ( arg_0 ) : arg_1 = "/2/locations" arg_2 = arg_0 . _get_resource ( arg_1 ) arg_3 = [ ] for arg_4 in arg_2 [ 'locations' ] : arg_3 . append ( arg_0 . location_from_json ( arg_4 ) ) return arg_3

Reassemble a Binder object coming out of the database.


Question: Update the internal line and column buffers after a new character is added .

def Func ( arg_0 , arg_1 ) : if newline_chars . match ( arg_1 ) : arg_0 . _col . append ( 0 ) arg_0 . _line . append ( arg_0 . _line [ - 1 ] + 1 ) else : arg_0 . _col . append ( arg_0 . _col [ - 1 ] + 1 ) arg_0 . _line . append ( arg_0 . _line [ - 1 ] )

scan through the java output text and extract the bad java messages that may or may not happened when
    unit tests are run.  It will not record any bad java messages that are stored in g_ok_java_messages.

    :return: none


Question: This decorator wraps descriptor methods with a new method that tries to delegate to a function of the same name defined on the owner instance for convenience for dispatcher clients .

def Func ( arg_0 ) : @ functools . wraps ( arg_0 ) def delegator ( arg_1 , * arg_2 , ** arg_3 ) : if arg_1 . Func : arg_4 = getattr ( arg_1 , 'inst' , None ) if arg_4 is not None : arg_5 = ( arg_1 . delegator_prefix or '' ) + arg_0 . __name__ arg_6 = getattr ( arg_4 , arg_5 , None ) if arg_6 is not None : return arg_6 ( * arg_2 , ** arg_3 ) return arg_0 ( arg_1 , * arg_2 , ** arg_3 ) return delegator


Question: Is the wx event loop running .

def Func ( arg_0 = None ) : if arg_0 is None : arg_0 = get_app_wx ( ) if hasattr ( arg_0 , '_in_event_loop' ) : return arg_0 . _in_event_loop else : return arg_0 . IsMainLoopRunning ( )

DRF view to list all catalogs.

        Arguments:
            request (HttpRequest): Current request

        Returns:
            (Response): DRF response object containing course catalogs.


Question: Function used to fit the exponential decay .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : return arg_1 * np . exp ( - arg_0 / arg_2 ) + arg_3

Given a KeyboardModifiers flags object, return whether the Control
        key is down.

        Parameters:
        -----------
        include_command : bool, optional (default True)
            Whether to treat the Command key as a (mutually exclusive) synonym
            for Control when in Mac OS.


Question: Dump data from Invenio legacy .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 , arg_6 ) : init_app_context ( ) arg_3 = arg_3 if arg_3 else '{0}_Func' . format ( arg_0 ) arg_7 = dict ( ( f . strip ( '-' ) . replace ( '-' , '_' ) , True ) for f in arg_6 ) try : arg_8 = collect_things_entry_points ( ) [ arg_0 ] except KeyError : click . Abort ( '{0} is not in the list of available things to migrate: ' '{1}' . format ( arg_0 , collect_things_entry_points ( ) ) ) click . echo ( "Querying {0}..." . format ( arg_0 ) ) arg_9 , arg_10 = arg_8 . get ( arg_1 , arg_2 , arg_5 = arg_5 , ** arg_7 ) arg_11 = 0 click . echo ( "Dumping {0}..." . format ( arg_0 ) ) with click . progressbar ( length = arg_9 ) as bar : for arg_12 , arg_13 in enumerate ( grouper ( arg_10 , arg_4 ) ) : with open ( '{0}_{1}.json' . format ( arg_3 , arg_12 ) , 'w' ) as fp : fp . write ( "[\n" ) for arg_14 in arg_13 : try : json . Func ( arg_8 . Func ( arg_14 , arg_2 , ** arg_7 ) , fp , default = set_serializer ) fp . write ( "," ) except Exception as e : click . secho ( "Failed Func {0} {1} ({2})" . format ( arg_0 , arg_14 , e . message ) , fg = 'red' ) arg_11 += 1 bar . update ( arg_11 ) fp . seek ( fp . tell ( ) - 1 ) fp . write ( "\n]" )


Question: Configure any additional default transport zone bindings .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = CONF . NVP . default_tz if not arg_4 : LOG . warn ( "additional_default_tz_types specified, " "but no default_tz. Skipping " "Func()." ) return if not arg_3 : LOG . warn ( "neutron network_id not specified, skipping " "Func()" ) return for arg_5 in CONF . NVP . additional_default_tz_types : if arg_5 in TZ_BINDINGS : arg_6 = TZ_BINDINGS [ arg_5 ] arg_6 . add ( arg_1 , arg_2 , arg_4 , arg_3 ) else : LOG . warn ( "Unknown default tz type %s" % ( arg_5 ) )

Method which indicates if the object matches specified criteria.

        Match accepts criteria as kwargs and looks them up on attributes.
        Actual matching is performed with fnmatch, so shell-like wildcards
        work within match strings. Examples:

        obj._match(AXTitle='Terminal*')
        obj._match(AXRole='TextField', AXRoleDescription='search text field')


Question: Creates a new affinity group for the specified subscription .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 = None ) : _validate_not_none ( 'name' , arg_1 ) _validate_not_none ( 'label' , arg_2 ) _validate_not_none ( 'location' , arg_3 ) return arg_0 . _perform_post ( '/' + arg_0 . subscription_id + '/affinitygroups' , _XmlSerializer . Func_to_xml ( arg_1 , arg_2 , arg_4 , arg_3 ) )

Common routine for reporting debugger error messages.


Question: Create sparse feature matrix and vocabulary where fixed_vocab = False

def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . vocabulary_ arg_3 = _make_int_array ( ) arg_4 = _make_int_array ( ) arg_4 . append ( 0 ) for arg_5 in arg_1 : for arg_6 in arg_5 : try : arg_3 . append ( arg_2 [ arg_6 ] ) except KeyError : continue arg_4 . append ( len ( arg_3 ) ) arg_3 = frombuffer_empty ( arg_3 , dtype = np . intc ) arg_4 = np . frombuffer ( arg_4 , dtype = np . intc ) arg_7 = np . ones ( len ( arg_3 ) ) arg_8 = sp . csr_matrix ( ( arg_7 , arg_3 , arg_4 ) , shape = ( len ( arg_4 ) - 1 , len ( arg_2 ) ) , dtype = arg_0 . dtype ) arg_8 . sum_duplicates ( ) if arg_0 . binary : arg_8 . data . fill ( 1 ) return arg_8


Question: List of users of this slack team

def Func ( arg_0 ) : if not arg_0 . _Func : arg_0 . _Func = arg_0 . _call_api ( 'Func.list' ) [ 'members' ] return arg_0 . _Func

Using the record length and appropriate start points, seek to the
        country that corresponds to the converted IP address integer.
        Return offset of record.

        :arg ipnum: Result of ip2long conversion


Question: Filter all issues that don t have a label .

def Func ( arg_0 , arg_1 ) : arg_2 = [ ] if not arg_0 . options . add_issues_wo_labels : for arg_3 in arg_1 : if not arg_3 [ 'labels' ] : arg_2 . append ( arg_3 ) return arg_2

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: It will download file specified by url using requests module

def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 . split ( '/' ) [ - 1 ] if os . path . exists ( os . path . join ( os . getcwd ( ) , arg_2 ) ) : print 'File already exists' return try : arg_3 = requests . get ( arg_1 , stream = True , timeout = 200 ) except requests . exceptions . SSLError : try : arg_4 = requests . get ( arg_1 , stream = True , verify = False , timeout = 200 ) except requests . exceptions . RequestException as e : print e quit ( ) except requests . exceptions . RequestException as e : print e quit ( ) arg_5 = 1024 arg_6 = int ( arg_3 . headers [ 'Content-Length' ] ) arg_7 = arg_6 / arg_5 arg_8 = arg_3 . iter_content ( arg_5 = arg_5 ) arg_9 = tqdm ( iterable = arg_8 , total = arg_7 , unit = 'KB' , leave = False ) with open ( arg_2 , 'wb' ) as f : for arg_10 in arg_9 : f . write ( arg_10 ) '''print 'Total size of file to be downloaded %.2f MB '%total_size		total_downloaded_size=0.0		with open(file_name,'wb') as f:			for chunk in r.iter_content(chunk_size=1*1024*1024):				if chunk:					size_of_chunk=float(len(chunk))/(1024*1024)					total_downloaded_size+=size_of_chunk					print '{0:.0%} Downloaded'.format(total_downloaded_size/total_size)					f.write(chunk)''' print 'Downloaded file %s ' % arg_2

Overriding the default JSONEncoder.default for NDB support.


Question: list builders or instances for the project . They should start with sregistry - builder

def Func ( arg_0 , arg_1 = None , arg_2 = 'us-west1-a' ) : arg_3 = [ ] arg_4 = arg_0 . _get_instances ( arg_1 , arg_2 ) for arg_5 in arg_4 [ 'items' ] : arg_3 . append ( [ arg_5 [ 'name' ] , arg_5 [ 'status' ] ] ) bot . info ( "[google-compute] Found %s instances" % ( len ( arg_3 ) ) ) bot . table ( arg_3 ) bot . newline ( )

Finishes the load job. Called automatically when the connection closes.

        :return: The exit code returned when applying rows to the table


Question: Used by cache to get a unique key per URL

def Func ( * arg_0 , ** arg_1 ) : arg_2 = request . path arg_0 = str ( hash ( frozenset ( request . args . items ( ) ) ) ) return ( arg_2 + arg_0 ) . encode ( 'ascii' , 'ignore' )

Read a varint from file, parse it, and return the decoded integer.


Question: Task to send content metadata to each linked integrated channel .

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = time . time ( ) arg_4 = User . objects . get ( arg_0 = arg_0 ) arg_5 = INTEGRATED_CHANNEL_CHOICES [ arg_1 ] . objects . get ( pk = arg_2 ) LOGGER . info ( 'Transmitting content metadata to integrated channel using configuration: [%s]' , arg_5 ) try : arg_5 . Func ( arg_4 ) except Exception : LOGGER . exception ( 'Transmission of content metadata failed for user [%s] and for integrated ' 'channel with code [%s] and id [%s].' , arg_0 , arg_1 , arg_2 ) arg_6 = time . time ( ) - arg_3 LOGGER . info ( 'Content metadata transmission task for integrated channel configuration [%s] took [%s] seconds' , arg_5 , arg_6 )

Return file-like object for 'member'.

           'member' may be a filename or a RarInfo object.


Question: Checks file sizes for host

def Func ( arg_0 , arg_1 ) : if os . path . getsize ( arg_0 ) > arg_1 : return False else : return True

Discard deposit changes.

        #. The signal :data:`invenio_records.signals.before_record_update` is
            sent before the edit execution.

        #. It restores the last published version.

        #. The following meta information are saved inside the deposit:

        .. code-block:: python

            deposit['$schema'] = deposit_schema_from_record_schema

        #. The signal :data:`invenio_records.signals.after_record_update` is
            sent after the edit execution.

        #. The deposit index is updated.

        Status required: ``'draft'``.

        :param pid: Force a pid object. (Default: ``None``)
        :returns: A new Deposit object.


Question: Produce the scree plot .

def Func ( arg_0 , arg_1 = "barplot" , ** arg_2 ) : arg_3 = arg_2 . pop ( "server" ) if arg_2 : raise ValueError ( "Unknown arguments %s to Func()" % ", " . join ( arg_2 . keys ( ) ) ) try : import matplotlib if arg_3 : matplotlib . use ( 'Agg' , warn = False ) import matplotlib . pyplot as plt except ImportError : print ( "matplotlib is required for this function!" ) return arg_4 = [ s ** 2 for s in arg_0 . _model_json [ 'output' ] [ 'importance' ] . cell_values [ 0 ] [ 1 : ] ] plt . xlabel ( 'Components' ) plt . ylabel ( 'Variances' ) plt . title ( 'Scree Plot' ) plt . xticks ( list ( range ( 1 , len ( arg_4 ) + 1 ) ) ) if arg_1 == "barplot" : plt . bar ( list ( range ( 1 , len ( arg_4 ) + 1 ) ) , arg_4 ) elif arg_1 == "lines" : plt . plot ( list ( range ( 1 , len ( arg_4 ) + 1 ) ) , arg_4 , 'b--' ) if not arg_3 : plt . show ( )

Sequentially update the actors, the world, and the messaging system.
        The theater terminates once all of the actors indicate that they are done.


Question: Read metadata and apply that to the next object in the input stream .

def Func ( arg_0 : arg_1 ) -> IMeta : arg_2 = arg_0 . reader . advance ( ) assert arg_2 == "^" arg_3 = _read_next_consuming_comment ( arg_0 ) arg_4 : Optional [ lmap . Map [ LispForm , LispForm ] ] = None if isinstance ( arg_3 , symbol . Symbol ) : arg_4 = lmap . map ( { keyword . keyword ( "tag" ) : arg_3 } ) elif isinstance ( arg_3 , keyword . Keyword ) : arg_4 = lmap . map ( { arg_3 : True } ) elif isinstance ( arg_3 , lmap . Map ) : arg_4 = arg_3 else : raise SyntaxError ( f"Expected symbol, keyword, or map for metadata, not {type(meta)}" ) arg_5 = _read_next_consuming_comment ( arg_0 ) try : return arg_5 . with_meta ( arg_4 ) except AttributeError : raise SyntaxError ( f"Can not attach metadata to object of type {type(obj_with_meta)}" )

Converts size string into megabytes

        Parameters
        ----------
        s : str
            The size string can be '30KB', '20MB' or '1GB'

        Returns
        -------
        float
            With the size in bytes


Question: Expand file patterns to a list of package_data paths .

def Func ( arg_0 , arg_1 = None ) : if arg_1 is None : arg_1 = [ '*' ] return _get_files ( arg_1 , pjoin ( HERE , arg_0 ) )

Return the most recent timestamp in the operation.


Question: Receive data on the connection .

def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_3 = _no_zero_allocator ( "char[]" , arg_1 ) if arg_2 is not None and arg_2 & socket . MSG_PEEK : arg_4 = _lib . SSL_peek ( arg_0 . _ssl , arg_3 , arg_1 ) else : arg_4 = _lib . SSL_read ( arg_0 . _ssl , arg_3 , arg_1 ) arg_0 . _raise_ssl_error ( arg_0 . _ssl , arg_4 ) return _ffi . buffer ( arg_3 , arg_4 ) [ : ]

Enables uniform interface to value and batch jacobian calculation.

  Works in both eager and graph modes.

  Arguments:
    f: The scalar function to evaluate.
    x: The value at which to compute the value and the batch jacobian.

  Returns:
    A tuple (f(x), J(x)), where J(x) is the batch jacobian.


Question: Get weights for this layer

def Func ( arg_0 ) : arg_1 = callBigDlFunc ( arg_0 . bigdl_type , "getWeights" , arg_0 . value ) if arg_1 is not None : return [ arg_2 . to_ndarray ( ) for arg_2 in arg_1 ] else : print ( "The layer does not have weight/bias" ) return None

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: Forcibly terminates all Celery processes .

def Func ( arg_0 ) : arg_1 = arg_0 . local_renderer with arg_0 . settings ( warn_only = True ) : arg_1 . sudo ( 'pkill -9 -f celery' ) arg_1 . sudo ( 'rm -f /tmp/celery*.pid' )

Checks if an blob_name is updated in Google Cloud Storage.

        :param bucket_name: The Google cloud storage bucket where the object is.
        :type bucket_name: str
        :param object_name: The name of the object to check in the Google cloud
            storage bucket.
        :type object_name: str
        :param ts: The timestamp to check against.
        :type ts: datetime.datetime


Question: Creates the an empty file if it does not already exist .

def Func ( arg_0 ) : if os . path . exists ( arg_0 ) : return False else : open ( arg_0 , 'a+b' ) . close ( ) logger . info ( 'Credential file {0} created' . format ( arg_0 ) ) return True


Question: Allocate or reallocate a scaling IP .

def Func ( arg_0 , arg_1 ) : LOG . info ( 'Func for tenant %s and body %s' , arg_0 . tenant_id , arg_1 ) arg_2 = arg_1 . get ( 'scaling_network_id' ) arg_3 = arg_1 . get ( 'scaling_ip_address' ) arg_4 = arg_1 . get ( 'ports' , [ ] ) arg_5 = _get_network ( arg_0 , arg_2 ) arg_6 = { } for arg_7 in arg_4 : arg_8 = _get_port ( arg_0 , arg_7 [ 'port_id' ] ) arg_9 = _get_fixed_ip ( arg_0 , arg_7 . get ( 'fixed_ip_address' ) , arg_8 ) arg_6 [ arg_8 . id ] = { "port" : arg_8 , "fixed_ip" : arg_9 } arg_11 = _allocate_ip ( arg_0 , arg_5 , None , arg_3 , ip_types . SCALING ) _create_flip ( arg_0 , arg_11 , arg_6 ) return v . _make_scaling_ip_dict ( arg_11 )

Return single program by name, or None if not found.

        Arguments:
            program_title(string): Program title as seen by students and in Course Catalog Admin

        Returns:
            dict: Program data provided by Course Catalog API


Question: Rebuilds the graph around the given node id .

def Func ( arg_0 , arg_1 ) : arg_0 . clear ( ) arg_0 . add_node ( arg_1 , root = True ) for arg_2 , arg_3 in arg_0 . get_links ( arg_1 ) : arg_0 . add_edge ( arg_1 , arg_3 , weight = arg_2 ) if len ( arg_0 ) > arg_0 . max : break for arg_2 , arg_3 , arg_4 in arg_0 . get_cluster ( arg_1 ) : for arg_5 in arg_4 : arg_0 . add_edge ( arg_5 , arg_3 , weight = arg_2 ) arg_0 . add_edge ( arg_1 , arg_5 , weight = arg_2 ) if len ( arg_0 ) > arg_0 . max : break if arg_0 . event . clicked : g . add_node ( arg_0 . event . clicked )

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: Get the summary of exceptions for component_name and list of instances . Empty instance list will fetch all exceptions .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = [ ] , arg_4 = None ) : if not arg_1 or not arg_1 . host or not arg_1 . stats_port : return arg_5 = tmaster_pb2 . ExceptionLogRequest ( ) arg_5 . component_name = arg_2 if len ( arg_3 ) > 0 : arg_5 . instances . extend ( arg_3 ) arg_6 = arg_5 . SerializeToString ( ) arg_7 = str ( arg_1 . stats_port ) arg_8 = arg_1 . host arg_9 = "http://{0}:{1}/exceptionsummary" . format ( arg_8 , arg_7 ) Log . debug ( "Creating request object." ) arg_10 = tornado . httpclient . HTTPRequest ( arg_9 , body = arg_6 , method = 'POST' , request_timeout = 5 ) Log . debug ( 'Making HTTP call to fetch exceptionsummary url: %s' , arg_9 ) try : arg_11 = tornado . httpclient . AsyncHTTPClient ( ) arg_12 = yield arg_11 . fetch ( arg_10 ) Log . debug ( "HTTP call complete." ) except tornado . httpclient . HTTPError as e : raise Exception ( str ( e ) ) arg_13 = arg_12 . code if arg_13 >= 400 : arg_14 = "Error in getting exceptions from Tmaster, code: " + arg_13 Log . error ( arg_14 ) raise tornado . gen . Return ( { "message" : arg_14 } ) arg_15 = tmaster_pb2 . ExceptionLogResponse ( ) arg_15 . ParseFromString ( arg_12 . body ) if arg_15 . status . status == common_pb2 . NOTOK : if arg_15 . status . HasField ( "message" ) : raise tornado . gen . Return ( { "message" : arg_15 . status . message } ) arg_16 = [ ] for arg_17 in arg_15 . exceptions : arg_16 . append ( { 'class_name' : arg_17 . stacktrace , 'lasttime' : arg_17 . lasttime , 'firsttime' : arg_17 . firsttime , 'count' : str ( arg_17 . count ) } ) raise tornado . gen . Return ( arg_16 )

Read data synchronous from 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: data name
    :param Type data_type: type of the data given to the PLC, according to
        PLCTYPE constants
    :param bool return_ctypes: return ctypes instead of python types if True
        (default: False)
    :rtype: data_type
    :return: value: **value**


Question: Get an SMTP session with SSL .

def Func ( arg_0 ) : return smtplib . SMTP_SSL ( arg_0 . server , arg_0 . port , context = ssl . create_default_context ( ) )

Overriding the default JSONEncoder.default for NDB support.


Question: Get a named attribute from an object .

def Func ( arg_0 , arg_1 = None ) : def getter ( arg_2 ) : return _Func ( arg_2 , arg_0 , arg_1 ) return transform ( getter )


Question: Reraises exception appending message to its string representation .

def Func ( arg_0 , arg_1 ) : class arg_5 ( type ( arg_0 ) ) : arg_2 = type ( arg_0 ) . __module__ def __init__ ( arg_3 ) : pass def __getattr__ ( arg_3 , arg_4 ) : return getattr ( arg_0 , arg_4 ) def __str__ ( arg_3 ) : return str ( arg_0 ) + arg_1 arg_5 . __name__ = type ( arg_0 ) . __name__ arg_7 = arg_5 ( ) if six . PY3 : arg_5 . __qualname__ = type ( arg_0 ) . __qualname__ six . raise_from ( arg_7 . with_traceback ( arg_0 . __traceback__ ) , None ) else : six . reraise ( arg_7 , None , sys . exc_info ( ) [ 2 ] )

Sparse matrix roll

    This operation is equivalent to ``numpy.roll``, but operates on sparse matrices.

    Parameters
    ----------
    x : scipy.sparse.spmatrix or np.ndarray
        The sparse matrix input

    shift : int
        The number of positions to roll the specified axis

    axis : (0, 1, -1)
        The axis along which to roll.

    Returns
    -------
    x_rolled : same type as `x`
        The rolled matrix, with the same format as `x`

    See Also
    --------
    numpy.roll

    Examples
    --------
    >>> # Generate a random sparse binary matrix
    >>> X = scipy.sparse.lil_matrix(np.random.randint(0, 2, size=(5,5)))
    >>> X_roll = roll_sparse(X, 2, axis=0)  # Roll by 2 on the first axis
    >>> X_dense_r = roll_sparse(X.toarray(), 2, axis=0)  # Equivalent dense roll
    >>> np.allclose(X_roll, X_dense_r.toarray())
    True


Question: Recovers x and y coordinates from the compressed point .

def Func ( arg_0 : arg_1 ) -> G1Uncompressed : arg_2 = ( arg_0 % POW_2_383 ) // POW_2_382 if arg_2 == 1 : return Z1 arg_3 = arg_0 % POW_2_381 arg_4 = pow ( ( arg_3 ** 3 + b . n ) % q , ( q + 1 ) // 4 , q ) if pow ( arg_4 , 2 , q ) != ( arg_3 ** 3 + b . n ) % q : raise ValueError ( "The given point is not on G1: y**2 = x**3 + b" ) arg_5 = ( arg_0 % POW_2_382 ) // POW_2_381 if ( arg_4 * 2 ) // q != arg_5 : arg_4 = q - arg_4 return ( FQ ( arg_3 ) , FQ ( arg_4 ) , FQ ( 1 ) )


Question: load the configuration information from the target hierarchy

def Func ( arg_0 ) : arg_1 = [ arg_0 . additional_config , arg_0 . app_config ] + [ t . getConfig ( ) for t in arg_0 . hierarchy ] arg_2 = [ _mirrorStructure ( arg_0 . additional_config , 'command-line config' ) , _mirrorStructure ( arg_0 . app_config , 'application\'s config.json' ) , ] + [ _mirrorStructure ( t . getConfig ( ) , t . getName ( ) ) for t in arg_0 . hierarchy ] arg_0 . config = _mergeDictionaries ( * arg_1 ) arg_0 . config_blame = _mergeDictionaries ( * arg_2 )

Update the estimate.

        Parameters
        ----------
        new_val: float
            new observated value of estimated quantity.


Question: Associate event handlers

def Func ( arg_0 , arg_1 = None ) : if not arg_1 or isinstance ( arg_1 , dict ) : if not arg_1 : arg_1 = util . get_caller_module_dict ( ) arg_2 = arg_1 [ '__name__' ] arg_3 = arg_1 else : arg_2 = arg_1 . __class__ . __name__ arg_3 = dict ( [ ( k , getattr ( arg_1 , k ) ) for k in dir ( arg_1 ) if k . startswith ( "on_" ) ] ) for arg_4 in [ n for n in arg_3 if n . startswith ( "on_" ) ] : arg_5 = arg_4 . split ( "_" ) arg_6 = arg_5 . pop ( 0 ) + arg_5 . pop ( - 1 ) arg_7 = arg_0 for arg_8 in arg_5 : try : arg_7 = arg_7 [ arg_8 ] except KeyError : arg_7 = None break if not arg_7 : from . component import COMPONENTS for arg_9 , arg_7 in COMPONENTS . items ( ) : if arg_7 . name == arg_8 : print "WARNING: %s should be %s" % ( arg_8 , arg_9 . replace ( "." , "_" ) ) break else : raise NameError ( "'%s' component not found (%s.%s)" % ( arg_8 , arg_2 , arg_4 ) ) if arg_6 in PYTHONCARD_EVENT_MAP : arg_10 = PYTHONCARD_EVENT_MAP [ arg_6 ] print "WARNING: %s should be %s (%s)" % ( arg_6 , arg_10 , arg_4 ) arg_6 = arg_10 if not hasattr ( arg_7 , arg_6 ) : raise NameError ( "'%s' event not valid (%s.%s)" % ( arg_6 , arg_2 , arg_4 ) ) setattr ( arg_7 , arg_6 , arg_3 [ arg_4 ] )

Generate requested statistics for a dataset and cache to a file.
  If filename is None, then don't cache to a file


Question: Returns the concordance scores for each stratified graph based on the given annotation

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None ) : return { arg_4 : calculate_concordance ( arg_5 , arg_2 , arg_3 = arg_3 ) for arg_4 , arg_5 in get_subgraphs_by_annotation ( arg_0 , arg_1 ) . items ( ) }

Put us back at the beginning of the file again.


Question: Convert hex to a color name using matplotlib s colour names .

def Func ( arg_0 ) : for arg_1 , arg_2 in defaults . COLOURS . items ( ) : if ( len ( arg_1 ) > 1 ) and ( arg_2 == arg_0 . upper ( ) ) : return arg_1 . lower ( ) return None

This method increases the permanence values of synapses of columns whose
    activity level has been too low. Such columns are identified by having an
    overlap duty cycle that drops too much below those of their peers. The
    permanence values for such columns are increased.


Question: Maintain current time during context

def Func ( ) : arg_0 = cmds . currentTime ( query = True ) try : yield finally : cmds . currentTime ( arg_0 , edit = True )

Read data synchronous from 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: data name
    :param Type data_type: type of the data given to the PLC, according to
        PLCTYPE constants
    :param bool return_ctypes: return ctypes instead of python types if True
        (default: False)
    :rtype: data_type
    :return: value: **value**


Question: Matches the string with the pattern caching the compiled regexp .

def Func ( arg_0 , arg_1 ) : if arg_0 not in arg_2 : arg_2 [ arg_0 ] = sre_compile . compile ( arg_0 ) return arg_2 [ arg_0 ] . match ( arg_1 )

Sequentially update the actors, the world, and the messaging system.
        The theater terminates once all of the actors indicate that they are done.


Question: List all files in all app storages .

def Func ( arg_0 , arg_1 ) : for arg_2 in six . itervalues ( arg_0 . storages ) : if arg_2 . exists ( '' ) : for arg_3 in utils . get_files ( arg_2 , arg_1 ) : yield arg_3 , arg_2

Given a dictionary mapping unique keys to amino acid sequences,
        run MHC binding predictions on all candidate epitopes extracted from
        sequences and return a EpitopeCollection.

        Parameters
        ----------
        fasta_dictionary : dict or string
            Mapping of protein identifiers to protein amino acid sequences.
            If string then converted to dictionary.


Question: Read the commits of a pack .

def Func ( arg_0 , arg_1 ) : arg_2 = 'objects/pack/pack-' + arg_1 arg_3 = [ 'git' , 'verify-pack' , '-v' , arg_2 ] arg_4 = arg_0 . _exec ( arg_3 , cwd = arg_0 . dirpath , env = arg_0 . gitenv ) arg_4 = arg_4 . decode ( 'utf-8' , errors = 'surrogateescape' ) . rstrip ( ) arg_5 = [ line . split ( ' ' ) for line in arg_4 . split ( '\n' ) ] arg_6 = [ parts [ 0 ] for parts in arg_5 if parts [ 1 ] == 'commit' ] arg_6 . reverse ( ) return arg_6

Generate new sequences.

    Args:
      batch_size: Number of sequences to generate.
      length: Number of timesteps to generate for each sequence.
      samples: Number of samples to draw from the latent distributions.
      fix_static: Boolean for whether or not to share the same random
        sample of the static latent variable `f` from its prior across
        all examples.
      fix_dynamic: Boolean for whether or not to share the same random
        sample of the dynamic latent variable `z_{1:T}` from its prior
        across all examples.

    Returns:
      A batched Independent distribution wrapping a set of Normal
      distributions over the pixels of the generated sequences, where
      the Independent distribution has event shape [height, width,
      channels], batch shape [samples, batch_size, timesteps], and
      sample shape [sample_shape, samples, batch_size, timesteps,
      height, width, channels].


Question: Reuses the same db session

def Func ( arg_0 ) : if not arg_0 . session : arg_0 . session = dal . get_default_session ( ) return arg_0 . session


Question: Return the next batch of items to upload .

def Func ( arg_0 ) : arg_1 = arg_0 . queue arg_2 = [ ] arg_3 = arg_0 . Func_item ( ) if arg_3 is None : return arg_2 arg_2 . append ( arg_3 ) while len ( arg_2 ) < arg_0 . upload_size and not arg_1 . empty ( ) : arg_3 = arg_0 . Func_item ( ) if arg_3 : arg_2 . append ( arg_3 ) return arg_2


Question: See docstrings for generate_files and generate_checkpoints .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 , arg_6 ) : arg_7 = [ ] if arg_4 is not None : arg_7 . append ( arg_1 >= arg_4 ) if arg_5 is not None : arg_7 . append ( arg_1 < arg_5 ) if arg_0 is files : arg_7 . append ( files . c . name . like ( u'%.ipynb' ) ) arg_8 = select ( [ arg_0 ] ) . order_by ( arg_1 ) for arg_9 in arg_7 : arg_8 = arg_8 . where ( arg_9 ) arg_10 = arg_2 . execute ( arg_8 ) for arg_11 in arg_10 : try : arg_12 = arg_11 [ 'user_id' ] arg_13 = arg_3 ( arg_12 ) . decrypt arg_14 = to_dict_with_content ( arg_0 . c , arg_11 , arg_13 ) if arg_0 is files : arg_14 [ 'path' ] = arg_14 [ 'parent_name' ] + arg_14 [ 'name' ] arg_14 [ 'last_modified' ] = arg_14 [ 'created_at' ] yield { 'id' : arg_14 [ 'id' ] , 'user_id' : arg_12 , 'path' : to_api_path ( arg_14 [ 'path' ] ) , 'last_modified' : arg_14 [ 'last_modified' ] , 'content' : reads_base64 ( arg_14 [ 'content' ] ) , } except CorruptedFile : if arg_6 is not None : arg_6 . warning ( 'Corrupted file with id %d in table %s.' % ( arg_11 [ 'id' ] , arg_0 . name ) )

Convert any non-DAVError exception to HTTP_INTERNAL_ERROR.


Question: r Generate one of the two sequences that generated a delta .

def Func ( arg_0 , arg_1 ) : try : arg_2 = { 1 : "- " , 2 : "+ " } [ int ( arg_1 ) ] except KeyError : raise ValueError , ( 'unknown delta choice (must be 1 or 2): %r' % arg_1 ) arg_3 = ( "  " , arg_2 ) for arg_4 in arg_0 : if arg_4 [ : 2 ] in arg_3 : yield arg_4 [ 2 : ]

Bind the server unless it is already bound, this is a read-only node, or the last attempt was too recently.

        :raises TransportNotReadyError if the bind attempt fails


Question: Wrapper for the other log methods decide which one based on the URL parameter .

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = True ) : if arg_1 is None : arg_1 = arg_0 . url if re . match ( "file://" , arg_1 ) : arg_0 . Func_file ( arg_1 ) elif re . match ( "https://" , arg_1 ) or re . match ( "http://" , arg_1 ) : arg_0 . Func_post ( arg_1 , arg_2 , arg_3 ) else : arg_0 . Func_stdout ( )

List all events occurring at or after a timestamp.


Question: check that the signature of the two given methods match

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ) : if not ( isinstance ( arg_1 , astroid . FunctionDef ) and isinstance ( arg_2 , astroid . FunctionDef ) ) : arg_0 . add_message ( "method-check-failed" , args = ( arg_1 , arg_2 ) , node = arg_1 ) return arg_5 = arg_4 . instantiate_class ( ) arg_1 = function_to_method ( arg_1 , arg_5 ) arg_2 = function_to_method ( arg_2 , arg_5 ) if arg_1 . args . args is None or arg_2 . args . args is None : return if is_attr_private ( arg_1 . name ) : return if arg_1 . decorators : for arg_6 in arg_1 . decorators . nodes : if ( isinstance ( arg_6 , astroid . Attribute ) and arg_6 . attrname == "setter" ) : return if _different_parameters ( arg_2 , arg_1 , dummy_parameter_regex = arg_0 . _dummy_rgx ) : arg_0 . add_message ( "arguments-differ" , args = ( arg_3 , arg_1 . name ) , node = arg_1 ) elif len ( arg_1 . args . defaults ) < len ( arg_2 . args . defaults ) : arg_0 . add_message ( "signature-differs" , args = ( arg_3 , arg_1 . name ) , node = arg_1 )

Create required links from a sensor region to a classifier region.


Question: Generate an intermediate if statement which assigns to a temporary variable which is returned as the expression value at the end of evaluation .

def Func ( arg_0 : arg_1 , arg_2 : arg_3 ) -> GeneratedPyAST : assert arg_2 . op == NodeOp . IF arg_4 = gen_py_ast ( arg_0 , arg_2 . test ) arg_5 = genname ( _IF_RESULT_PREFIX ) arg_6 = __if_body_to_py_ast ( arg_0 , arg_2 . then , arg_5 ) arg_7 = __if_body_to_py_ast ( arg_0 , arg_2 . else_ , arg_5 ) arg_8 = genname ( _IF_TEST_PREFIX ) arg_9 = ast . Assign ( targets = [ ast . Name ( id = arg_8 , arg_0 = ast . Store ( ) ) ] , value = arg_4 . node ) arg_10 = ast . If ( test = ast . BoolOp ( op = ast . Or ( ) , values = [ ast . Compare ( left = ast . NameConstant ( None ) , ops = [ ast . Is ( ) ] , comparators = [ ast . Name ( id = arg_8 , arg_0 = ast . Load ( ) ) ] , ) , ast . Compare ( left = ast . NameConstant ( False ) , ops = [ ast . Is ( ) ] , comparators = [ ast . Name ( id = arg_8 , arg_0 = ast . Load ( ) ) ] , ) , ] , ) , values = [ ] , body = list ( map ( statementize , chain ( arg_7 . dependencies , [ arg_7 . node ] ) ) ) , orelse = list ( map ( statementize , chain ( arg_6 . dependencies , [ arg_6 . node ] ) ) ) , ) return GeneratedPyAST ( arg_2 = ast . Name ( id = arg_5 , arg_0 = ast . Load ( ) ) , dependencies = list ( chain ( arg_4 . dependencies , [ arg_9 , arg_10 ] ) ) , )

Set the rotation of this body using a rotation matrix.

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


Question: Calculate the minimum and maximum for expressions possibly on a grid defined by binby .

def Func ( arg_0 , arg_1 , arg_2 = [ ] , arg_3 = None , arg_4 = arg_5 , arg_6 = False , arg_7 = False , arg_8 = None ) : @ delayed def finish ( * arg_9 ) : arg_10 = vaex . utils . unlistify ( arg_12 , np . array ( arg_9 ) ) arg_10 = arg_10 . astype ( arg_15 ) return arg_10 @ delayed def calculate ( arg_1 , arg_3 ) : arg_11 = tasks . TaskStatistic ( arg_0 , arg_2 , arg_4 , arg_3 , weight = arg_1 , op = tasks . OP_MIN_MAX , arg_6 = arg_6 ) arg_0 . executor . schedule ( arg_11 ) arg_17 . add_task ( arg_11 , "Func for %s" % arg_1 ) return arg_11 @ delayed def finish ( * arg_9 ) : arg_10 = vaex . utils . unlistify ( arg_12 , np . array ( arg_9 ) ) arg_10 = arg_10 . astype ( arg_15 ) return arg_10 arg_1 = _ensure_strings_from_expressions ( arg_1 ) arg_2 = _ensure_strings_from_expressions ( arg_2 ) arg_12 , [ arg_13 , ] = vaex . utils . listify ( arg_1 ) arg_14 = [ arg_0 . dtype ( expr ) for expr in arg_13 ] arg_15 = arg_14 [ 0 ] if not all ( [ arg_16 . kind == arg_15 . kind for arg_16 in arg_14 ] ) : raise ValueError ( "cannot mix datetime and non-datetime expressions" ) arg_17 = vaex . utils . progressbars ( arg_8 , name = "Funces" ) arg_3 = arg_0 . limits ( arg_2 , arg_3 , arg_6 = arg_6 , arg_7 = True ) arg_18 = [ calculate ( arg_1 , arg_3 ) for arg_1 in arg_13 ] arg_19 = finish ( * arg_18 ) return arg_0 . _delay ( arg_7 , arg_19 )

Read the current ADS-state and the machine-state.

    Read the current ADS-state and the machine-state from the
    ADS-server.

    :param pyads.structs.AmsAddr address: local or remote AmsAddr
    :rtype: (int, int)
    :return: ads_state, device_state


Question: Return a random Pauli on number of qubits .

def Func ( arg_0 , arg_1 , arg_2 = None ) : if arg_2 is not None : np . Func . seed ( arg_2 ) arg_3 = np . Func . randint ( 2 , size = arg_1 ) . astype ( np . bool ) arg_4 = np . Func . randint ( 2 , size = arg_1 ) . astype ( np . bool ) return arg_0 ( arg_3 , arg_4 )

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: don t output message of the given id

def Func ( arg_0 , arg_1 , arg_2 = "package" , arg_3 = None , arg_4 = False ) : arg_0 . _set_msg_status ( arg_1 , enable = False , arg_2 = arg_2 , arg_3 = arg_3 , arg_4 = arg_4 ) arg_0 . _register_by_id_managed_msg ( arg_1 , arg_3 )

Register a file reader for use in parse_config_file.

  Registered file readers will be used to try reading files passed to
  `parse_config_file`. All file readers (beginning with the default `open`) will
  be tried until one of them succeeds at opening the file.

  This function may also be be used used as a decorator. For example:

      @register_file_reader(IOError)
      def exotic_data_source(filename):
        ...

  Args:
    *args: (When used as a decorator, only the existence check is supplied.)
      - file_reader_fn: The file reader function to register. This should be a
        function that can be used as a context manager to open a file and
        provide a file-like object, similar to Python's built-in `open`.
      - is_readable_fn: A function taking the file path and returning a boolean
        indicating whether the file can be read by `file_reader_fn`.

  Returns:
    `None`, or when used as a decorator, a function that will perform the
    registration using the supplied readability predicate.


Question: Test whether a file target is not exists or it exists but allow overwrite .

def Func ( arg_0 , arg_1 = False ) : if arg_0 . exists ( ) and arg_1 is False : return False else : return True

Overriding the default JSONEncoder.default for NDB support.


Question: Attach a method to a class .

def Func ( arg_0 ) : def wrapper ( arg_1 ) : setattr ( arg_0 , arg_1 . __name__ , arg_1 ) return arg_1 return wrapper

Show Program Landing page for the Enterprise's Program.

        Render the Enterprise's Program Enrollment page for a specific program.
        The Enterprise and Program are both selected by their respective UUIDs.

        Unauthenticated learners will be redirected to enterprise-linked SSO.

        A 404 will be raised if any of the following conditions are met:
            * No enterprise customer UUID query parameter ``enterprise_uuid`` found in request.
            * No enterprise customer found against the enterprise customer
                uuid ``enterprise_uuid`` in the request kwargs.
            * No Program can be found given ``program_uuid`` either at all or associated with
                the Enterprise..


Question: Unregisters the block associated with block_type from the registry .

def Func ( arg_0 , arg_1 ) : if arg_1 not in arg_0 . _registry : raise NotRegistered ( 'There is no block registered as "{}" with the ' 'RegisteredBlockStreamFieldRegistry registry.' . format ( arg_1 ) ) else : del arg_0 . _registry [ arg_1 ]

Export the contents to a file as comma separated values.

        Parameters
        ----------
        path : string
            File path where the data should be saved to

        Example
        -------
        Export the last ten elements of AME2012 to a new file:

        >>> Table('AME2012').tail(10).to_file('last_ten.txt')


Question: Return an adapter factory for ob from registry

def Func ( arg_0 , arg_1 ) : for arg_2 in _get_mro ( getattr ( arg_1 , '__class__' , type ( arg_1 ) ) ) : if arg_2 in arg_0 : return arg_0 [ arg_2 ]


Question: Convert PythonCard font description to gui2py style

def Func ( arg_0 ) : if 'faceName' in arg_0 : arg_0 [ 'face' ] = arg_0 . pop ( 'faceName' ) if 'family' in arg_0 and arg_0 [ 'family' ] == 'sansSerif' : arg_0 [ 'family' ] = 'sans serif' return arg_0

Check if templates directories are setup and issue a warning and help.

    Set the environment variable  :envvar:`GROMACSWRAPPER_SUPPRESS_SETUP_CHECK`
    skip the check and make it always return ``True``

    :return ``True`` if directories were found and ``False`` otherwise

     .. versionchanged:: 0.3.1
        Uses :envvar:`GROMACSWRAPPER_SUPPRESS_SETUP_CHECK` to suppress check
        (useful for scripts run on a server)


Question: Returns a Google web query formatted as a GoogleSearch list object .

def Func ( arg_0 , arg_1 = 0 , arg_2 = 10 , arg_3 = False , arg_4 = False ) : arg_5 = GOOGLE_SEARCH return GoogleSearch ( arg_0 , arg_1 , arg_5 , "" , arg_2 , arg_3 , arg_4 )

Reassemble a Binder object coming out of the database.


Question: Derives a PEP386 - compliant version number from VERSION .

def Func ( arg_0 = None ) : if arg_0 is None : arg_0 = VERSION assert len ( arg_0 ) == 5 assert arg_0 [ 3 ] in ( "alpha" , "beta" , "rc" , "final" ) arg_1 = 2 if arg_0 [ 2 ] == 0 else 3 arg_2 = "." . join ( str ( x ) for x in arg_0 [ : arg_1 ] ) arg_3 = "" if arg_0 [ 3 ] != "final" : arg_4 = { "alpha" : "a" , "beta" : "b" , "rc" : "c" } arg_3 = arg_4 [ arg_0 [ 3 ] ] + str ( arg_0 [ 4 ] ) return arg_2 + arg_3

Indicates the start of a new sequence. Clears any predictions and makes sure
    synapses don't grow to the currently active cells in the next time step.


Question: Load users .

def Func ( arg_0 ) : from . tasks . users import load_user loadcommon ( arg_0 , load_user , asynchronous = False )


Question: Build Sphinx docs and publish to Confluence .

def Func ( arg_0 , arg_1 = False , arg_2 = False , arg_3 = '' ) : arg_4 = config . load ( ) if arg_2 : arg_0 . run ( "invoke clean --docs" ) arg_5 = [ 'sphinx-build' , '-b' , 'Func' ] arg_5 . extend ( [ '-E' , '-a' ] ) if arg_3 : arg_5 . append ( arg_3 ) arg_5 . extend ( [ '.' , arg_0 . rituals . docs . build + '_cf' ] ) if arg_1 : arg_5 . extend ( [ '-DFunc_publish=False' ] ) notify . info ( "Starting Sphinx build..." ) with pushd ( arg_0 . rituals . docs . sources ) : arg_0 . run ( ' ' . join ( arg_5 ) , pty = True )

Load the configuration.

    :param under_test:
        Tell us if we only have to load the configuration file (True)
        or load the configuration file and initate the output directory
        if it does not exist (False).
    :type under_test: bool

    :param custom:
        A dict with the configuration index (from .PyFunceble.yaml) to update.
    :type custom: dict

    .. warning::
        If :code:`custom` is given, the given :code:`dict` overwrite
        the last value of the given configuration indexes.


Question: Decorator that prevents callbacks from calling into link methods that are not reentrant

def Func ( arg_0 ) : def wrap ( * arg_1 , ** arg_2 ) : arg_3 = arg_1 [ 0 ] if arg_3 . _callback_lock . in_callback : arg_4 = "Link %s cannot be invoked from a callback!" % arg_0 raise RuntimeError ( arg_4 ) return arg_0 ( * arg_1 , ** arg_2 ) return wrap

Write the manifest content to the zip file. It must be a predictable
        order.


Question: Calls pre and post delete hooks for DelteViews .

def Func ( arg_0 , arg_1 , * arg_2 , ** arg_3 ) : arg_0 . object = arg_0 . get_object ( ) arg_5 = arg_0 . get_success_url ( ) arg_0 . pre_Func ( arg_0 . object ) arg_0 . object . Func ( ) arg_0 . post_Func ( arg_0 . object ) return HttpResponseRedirect ( arg_5 )

Parse a Supybot IRC log file.

        The method parses the Supybot IRC log file and returns an iterator of
        dictionaries. Each one of this, contains a message from the file.

        :param filepath: path to the IRC log file

        :returns: a generator of parsed messages

        :raises ParseError: raised when the format of the Supybot log file
            is invalid
        :raises OSError: raised when an error occurs reading the
            given file


Question: Returns Python array from Js array

def Func ( arg_0 ) : return [ arg_0 . get ( str ( arg_1 ) ) for arg_1 in xrange ( len ( arg_0 ) ) ]

Add feedback on a specific campaign.

        :param campaign_id: The unique id for the campaign.
        :type campaign_id: :py:class:`str`
        :param data: The request body parameters
        :type data: :py:class:`dict`
        data = {
            "message": string*
        }
        :param queryparams: The query string parameters
        queryparams['fields'] = []
        queryparams['exclude_fields'] = []


Question: Returns the status of Home Mode

def Func ( arg_0 , ** arg_1 ) : arg_2 = arg_0 . _api_info [ 'home_mode' ] arg_3 = dict ( { 'api' : arg_2 [ 'name' ] , 'method' : 'GetInfo' , 'version' : arg_2 [ 'version' ] , '_sid' : arg_0 . _sid } , ** arg_1 ) arg_4 = arg_0 . _get_json_with_retry ( arg_2 [ 'url' ] , arg_3 ) return arg_4 [ 'data' ] [ 'on' ]


Question: Print a list of all rules

def Func ( arg_0 ) : for arg_1 in sorted ( arg_0 . all_rules , key = lambda arg_1 : arg_1 . name ) : print ( arg_1 ) if arg_0 . args . verbose : for arg_2 in arg_1 . doc . split ( "\n" ) : print ( "    " , arg_2 )

Register a file reader for use in parse_config_file.

  Registered file readers will be used to try reading files passed to
  `parse_config_file`. All file readers (beginning with the default `open`) will
  be tried until one of them succeeds at opening the file.

  This function may also be be used used as a decorator. For example:

      @register_file_reader(IOError)
      def exotic_data_source(filename):
        ...

  Args:
    *args: (When used as a decorator, only the existence check is supplied.)
      - file_reader_fn: The file reader function to register. This should be a
        function that can be used as a context manager to open a file and
        provide a file-like object, similar to Python's built-in `open`.
      - is_readable_fn: A function taking the file path and returning a boolean
        indicating whether the file can be read by `file_reader_fn`.

  Returns:
    `None`, or when used as a decorator, a function that will perform the
    registration using the supplied readability predicate.


Question: Not accurate false due to spikes are observed

def Func ( ) : arg_0 = legion_parameters ( ) arg_0 . teta_x = - 1.1 template_dynamic_legion ( 16 , 2000 , 1500 , conn_type = conn_type . GRID_FOUR , params = arg_0 , stimulus = [ 1 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 1 , 1 ] )

Load a default value for redshift from config and set it as the redshift for source or lens galaxies that have
    falsey redshifts

    Parameters
    ----------
    key: str

    Returns
    -------
    decorator
        A decorator that wraps the setter function to set defaults


Question: Leave group .

def Func ( arg_0 ) : arg_1 = Group . query . get_or_404 ( arg_0 ) if arg_1 . can_Func ( current_user ) : try : arg_1 . remove_member ( current_user ) except Exception as e : flash ( str ( e ) , "error" ) return redirect ( url_for ( '.index' ) ) flash ( _ ( 'You have successfully left %(group_name)s group.' , group_name = arg_1 . name ) , 'success' ) return redirect ( url_for ( '.index' ) ) flash ( _ ( 'You cannot Func the group %(group_name)s' , group_name = arg_1 . name ) , 'error' ) return redirect ( url_for ( '.index' ) )


Question: Returns a message that will display a set of attachments in list form .

def Func ( arg_0 : arg_1 [ arg_2 ] , arg_3 : arg_4 = None , arg_5 : arg_4 = None , arg_6 : arg_7 [ arg_8 , arg_4 ] = None ) -> Activity : return attachment_activity ( AttachmentLayoutTypes . Func , arg_0 , arg_3 , arg_5 , arg_6 )

Concert velocities from a cartesian to a spherical coordinate system

        TODO: errors

        :param x: name of x column (input)
        :param y:         y
        :param z:         z
        :param vx:       vx
        :param vy:       vy
        :param vz:       vz
        :param vr: name of the column for the radial velocity in the r direction (output)
        :param vlong: name of the column for the velocity component in the longitude direction  (output)
        :param vlat: name of the column for the velocity component in the latitude direction, positive points to the north pole (output)
        :param distance: Expression for distance, if not given defaults to sqrt(x**2+y**2+z**2), but if this column already exists, passing this expression may lead to a better performance
        :return:


Question: Connect to port item on subunit

def Func ( arg_0 , arg_1 ) : if arg_0 . direction == DIRECTION . IN : if arg_0 . src is not None : raise HwtSyntaxError ( "Port %s is already associated with %r" % ( arg_0 . name , arg_0 . src ) ) arg_0 . src = arg_1 arg_1 . endpoints . append ( arg_0 ) elif arg_0 . direction == DIRECTION . OUT : if arg_0 . dst is not None : raise HwtSyntaxError ( "Port %s is already associated with %r" % ( arg_0 . name , arg_0 . dst ) ) arg_0 . dst = arg_1 arg_1 . drivers . append ( arg_0 ) else : raise NotImplementedError ( arg_0 ) arg_1 . hidden = False arg_1 . ctx . subUnits . add ( arg_0 . unit )

Return HgResource object for path.

        See DAVProvider.get_resource_inst()


Question: Report elapsed time .

def Func ( arg_0 ) : if not arg_0 . end_time : arg_0 . end ( ) print ( "Time: {} mins" . format ( ( arg_0 . end_time - arg_0 . start_time ) / 60 ) )

Deletes the specified file from the given S3 bucket.


Question: Return the database specifier for a database string . This accepts a database name or URL and returns a database specifier in the format accepted by specifier_to_db . It is recommended that you consult the documentation for that function for an explanation of the format .

def Func ( arg_0 ) : arg_1 = PLAIN_RE . match ( arg_0 ) arg_2 = URL_RE . match ( arg_0 ) if arg_1 : return 'local:' + arg_1 . groupdict ( ) [ 'database' ] elif arg_2 : arg_3 , arg_4 , arg_5 = map ( arg_2 . groupdict ( ) . get , ( 'hostname' , 'portnum' , 'database' ) ) arg_6 = settings . _ ( 'COUCHDB_SERVER' , 'http://127.0.0.1:5984/' ) arg_7 , arg_8 = urlparse . urlparse ( arg_6 ) [ 1 ] . split ( ':' ) if ( arg_7 == arg_3 ) and ( arg_8 == arg_4 ) : return 'local:' + arg_5 return 'remote:%s:%s:%s' % ( arg_3 , arg_4 , arg_5 ) raise ValueError ( 'Invalid database string: %r' % ( arg_0 , ) )

Wrapper function for TUN and serial port monitoring

        Wraps the necessary functions to loop over until self._isRunning
        threading.Event() is set(). This checks for data on the TUN/serial
        interfaces and then sends data over the appropriate interface. This
        function is automatically run when Threading.start() is called on the
        Monitor class.


Question: Decorator to log user actions

def Func ( arg_0 ) : @ functools . wraps ( arg_0 ) def wrapper ( * arg_1 , ** arg_2 ) : with create_session ( ) as session : if g . user . is_anonymous : arg_3 = 'anonymous' else : arg_3 = g . user . username arg_4 = Log ( event = arg_0 . __name__ , task_instance = None , owner = arg_3 , extra = str ( list ( request . args . items ( ) ) ) , task_id = request . args . get ( 'task_id' ) , dag_id = request . args . get ( 'dag_id' ) ) if 'execution_date' in request . args : arg_4 . execution_date = pendulum . parse ( request . args . get ( 'execution_date' ) ) session . add ( arg_4 ) return arg_0 ( * arg_1 , ** arg_2 ) return wrapper

Returns the maximum delay for the InferenceElements in the inference
    dictionary

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


Question: Remove padding .

def Func ( arg_0 , arg_1 = 0 ) : arg_2 = copy . deepcopy ( arg_0 ) for arg_3 , arg_4 in enumerate ( arg_0 ) : for arg_5 in range ( 1 , len ( arg_0 [ arg_3 ] ) ) : if arg_0 [ arg_3 ] [ - arg_5 ] != arg_1 : arg_2 [ arg_3 ] = arg_2 [ arg_3 ] [ 0 : - arg_5 + 1 ] break return arg_2


Question: Checks if a bundle exists at the provided path

def Func ( arg_0 , arg_1 ) : for arg_2 in arg_0 . _attached_bundles : if arg_1 == arg_2 . path : return True return False

Calculate the seconds to reset the token requests, by obtaining the different
        between the current date and the next date when the token is fully regenerated.


Question: Much like the built - in function range but accepts floats

def Func ( arg_0 = 0 , arg_1 = None , arg_2 = 1 ) : arg_0 = float ( arg_0 ) while arg_0 < arg_1 : yield arg_0 arg_0 += arg_2

Returns protobuf mapcontainer. Read from translation file.


Question: Save a model to protobuf files so that it can be used in tensorflow inference .

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = "little_endian" , arg_4 = "nhwc" ) : callBigDlFunc ( arg_0 . bigdl_type , "saveTF" , arg_0 . value , arg_1 , arg_2 , arg_3 , arg_4 )

One way to calibrate the band pass is to take the median value
            for every frequency fine channel, and divide by it.


Question: Merges two Reservation s .

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None , arg_4 = False , arg_5 = True , ** arg_6 ) : arg_7 = arg_0 . _Func_initial ( arg_1 = arg_1 , arg_2 = arg_2 , arg_3 = arg_3 , arg_4 = True , ** arg_6 ) def get_long_running_output ( arg_8 ) : arg_9 = arg_0 . _deserialize ( '[ReservationResponse]' , arg_8 ) if arg_4 : arg_10 = ClientRawResponse ( arg_9 , arg_8 ) return arg_10 return arg_9 arg_11 = arg_6 . get ( 'long_running_operation_timeout' , arg_0 . config . long_running_operation_timeout ) if arg_5 is True : arg_12 = ARMPolling ( arg_11 , ** arg_6 ) elif arg_5 is False : arg_12 = NoPolling ( ) else : arg_12 = arg_5 return LROPoller ( arg_0 . _client , arg_7 , get_long_running_output , arg_12 )

delete a backend, and update the secrets file


Question: Checks the video upload status Newly uploaded videos may be in the processing state

def Func ( arg_0 , arg_1 ) : if not arg_0 . authenticated : raise ApiError ( _ ( "Authentication is required" ) ) arg_2 = arg_0 . fetch_video ( arg_1 ) arg_3 = Api . yt_service . CheckUploadStatus ( arg_2 ) if arg_3 is not None : arg_4 = arg_3 [ 0 ] arg_5 = arg_3 [ 1 ] return { "upload_state" : arg_4 , "detailed_message" : arg_5 } else : return True

Compute the deflections of a list of galaxies from an input grid, by summing the individual deflections \
    of each galaxy's mass profile.

    If the input grid is a *grids.SubGrid*, the potential is calculated on the sub-grid and binned-up to the \
    original regular grid by taking the mean value of every set of sub-pixels.

    If no galaxies are entered into the function, an array of all zeros is returned.

    Parameters
    -----------
    grid : RegularGrid
        The grid (regular or sub) of (y,x) arc-second coordinates at the centre of every unmasked pixel which the \
        deflections is calculated on.
    galaxies : [galaxy.Galaxy]
        The galaxies whose mass profiles are used to compute the surface densities.


Question: Get CAs whose certificates are suggested for client authentication .

def Func ( arg_0 ) : arg_1 = _lib . SSL_get_client_CA_list ( arg_0 . _ssl ) if arg_1 == _ffi . NULL : return [ ] arg_2 = [ ] for arg_3 in range ( _lib . sk_X509_NAME_num ( arg_1 ) ) : arg_4 = _lib . sk_X509_NAME_value ( arg_1 , arg_3 ) arg_5 = _lib . X509_NAME_dup ( arg_4 ) _openssl_assert ( arg_5 != _ffi . NULL ) arg_6 = X509Name . __new__ ( X509Name ) arg_6 . _name = _ffi . gc ( arg_5 , _lib . X509_NAME_free ) arg_2 . append ( arg_6 ) return arg_2


Question: alternative to os .

def Func ( arg_0 , arg_1 , arg_2 = True ) : if arg_2 : arg_3 = 'Func -R %s %s' % ( arg_1 , arg_0 ) else : arg_3 = 'Func %s %s' % ( arg_1 , arg_0 ) return sh ( arg_3 )

Removes the video from youtube and from db
    Requires POST


Question: Returns the transaction as seen by the blockchain after being included into a block

def Func ( arg_0 , arg_1 , arg_2 = 10 ) : arg_3 = 10 for arg_4 in arg_0 . blocks ( ) : arg_3 += 1 for arg_5 in arg_4 [ "transactions" ] : if sorted ( arg_5 [ "signatures" ] ) == sorted ( arg_1 [ "signatures" ] ) : return arg_5 if arg_3 > arg_2 : raise Exception ( "The operation has not been added after 10 blocks!" )

The speed limit for a boid.

        Boids can momentarily go very fast,
        something that is impossible for real animals.


Question: This uploads a file to S3 .

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = False ) : if not arg_2 : arg_2 = boto3 . client ( 's3' ) try : arg_2 . upload_file ( arg_0 , arg_1 , os . path . basename ( arg_0 ) ) return 's3://%s/%s' % ( arg_1 , os . path . basename ( arg_0 ) ) except Exception as e : LOGEXCEPTION ( 'could not upload %s to bucket: %s' % ( arg_0 , arg_1 ) ) if arg_3 : raise return None

Returns a dictionary with all the past baking statuses of a single book.