DevSite Import: Using OAuth 2.0 for Web Server Applications

Notice: This DevSite page will soon be deleted per b/133171590. Please add this sample to GitHub if it is relevant still:
https://developers.google.com/api-client-library/python/auth/web-app

Using OAuth 2.0 for Web Server Applications

This document explains how web server applications use the Google API
Client Library for Python to implement OAuth 2.0
authorization to access Google APIs.
OAuth 2.0 allows users to share specific data with an application while
keeping their usernames, passwords, and other information private.
For example, an application can use OAuth 2.0 to obtain permission from
users to store files in their Google Drives.

This OAuth 2.0 flow is specifically for user authorization. It is designed
for applications that can store confidential information and maintain state.
A properly authorized web server application can access an API while the user
interacts with the application or after the user has left the application.
Web server applications frequently also use
service accounts to authorize API
requests, particularly when calling Cloud APIs to access project-based data
rather than user-specific data. Web server applications can use service
accounts in conjunction with user authorization.

Prerequisites
Enable APIs for your project
Any application that calls Google APIs needs to enable those APIs in the
API Console. To enable the appropriate APIs for your project:

Open the Library page in the
    API Console.
Select the project associated with your application. Create a project if
    you do not have one already.
Use the Library page to find each API that your application will
    use. Click on each API and enable it for your project.

Create authorization credentials
Any application that uses OAuth 2.0 to access Google APIs must have
authorization credentials that identify the application to Google's OAuth 2.0
server. The following steps explain how to create credentials for your project.
Your applications can then use the credentials to access APIs that you have
enabled for that project.

Open the Credentials page in the API Console.
Click Create credentials > OAuth client ID.
Complete the form. Set the application type to Web
      application. Applications that use languages and frameworks
      like PHP, Java, Python, Ruby, and .NET must specify authorized
      redirect URIs. The redirect URIs are the endpoints to which the
      OAuth 2.0 server can send responses.
      For testing, you can specify URIs that refer to the local machine,
      such as http://localhost:8080. With that in mind, please
      note that all of the examples in this document use
      http://localhost:8080 as the redirect URI.

      We recommend that you design your app's auth
      endpoints so that your application does not expose authorization
      codes to other resources on the page.

After creating your credentials, download the client_secret.json file
   from the API Console. Securely store the file in a location
   that only your application can access.
Important: Do not store the client_secret.json
   file in a publicly-accessible location. In addition, if you share the source
   code to your application—for example, on GitHub—store the
   client_secret.json file outside of your source tree to avoid
   inadvertently sharing your client credentials.
Identify access scopes
Scopes enable your application to only request access to the resources that
it needs while also enabling users to control the amount of access that they
grant to your application. Thus, there may be an inverse relationship between
the number of scopes requested and the likelihood of obtaining user consent.
Before you start implementing OAuth 2.0 authorization, we recommend that you
identify the scopes that your app will need permission to access.
We also recommend that your application request access to authorization
   scopes via an incremental authorization
   process, in which your application requests access to user data in context.
   This best practice helps users to more easily understand why your
   application needs the access it is requesting.
The OAuth 2.0 API Scopes
document contains a full list of scopes that you might use to access Google
APIs.
Language-specific requirements
To run any of the code samples in this document, you'll need a Google
   account, access to the Internet, and a web browser. If you are using one
   of the API client libraries, also see the language-specific requirements
   below.
To run the Python code samples in this document, you'll need:

Python 2.6 or greater
The pip package management tool.

The Google APIs Client Library for Python:
pip install --upgrade google-api-python-client

The google-auth, google-auth-oauthlib, and google-auth-httplib2 for user authorization.
pip install --upgrade google-auth google-auth-oauthlib google-auth-httplib2

The Flask Python web application framework.
pip install --upgrade flask

The requests HTTP library.
pip install --upgrade requests

Obtaining OAuth 2.0 access tokens
The following steps show how your application interacts with Google's OAuth
2.0 server to obtain a user's consent to perform an API request on the user's
behalf. Your application must have that consent before it can execute a Google
API request that requires user authorization.
The list below quickly summarizes these steps:

Your application identifies the permissions it needs.
Your application redirects the user to Google along with the
      list of requested permissions.
The user decides whether to grant the permissions to your
      application.
Your application finds out what the user decided.
If the user granted the requested permissions, your application
      retrieves tokens needed to make API requests on the user's behalf.

Step 1: Set authorization parameters
Your first step is to create the authorization request. That request sets
   parameters that identify your application and define the permissions that
   the user will be asked to grant to your application.
The following code snippet uses the google-auth-oauthlib.flow
   module to construct the authorization request.
The code constructs a Flow object, which identifies your
   application using information from the client_secret.json file
   that you downloaded after creating authorization
   credentials. That object also identifies the scopes that your
   application is requesting permission to access and the URL to your
   application's auth endpoint, which will handle the response from Google's
   OAuth 2.0 server. Finally, the code sets the optional
   access_type and include_granted_scopes
   parameters.

For example, this code requests read-only, offline access to a user's
Google Drive:

import google.oauth2.credentialsimport google_auth_oauthlib.flow# Use the client_secret.json file to identify the application requesting# authorization. The client ID (from that file) and access scopes are required.flow = google_auth_oauthlib.flow.Flow.from_client_secrets_file(    'client_secret.json',    scope=['https://www.googleapis.com/auth/drive.metadata.readonly'])# Indicate where the API server will redirect the user after the user completes# the authorization flow. The redirect URI is required.flow.redirect_uri = 'https://www.example.com/oauth2callback'# Generate URL for request to Google's OAuth 2.0 server.# Use kwargs to set optional request parameters.authorization_url, state = flow.authorization_url(    # Enable offline access so that you can refresh an access token without    # re-prompting the user for permission. Recommended for web server apps.    access_type='offline',    # Enable incremental authorization. Recommended as a best practice.    include_granted_scopes='true')
The request specifies the following information:

Parameters

client_id
Required. The client ID for your application. You can find
    this value in the API Console.
    In Python, call the from_client_secrets_file method to
    retrieve the client ID from a client_secret.json file. (You can
    also use the from_client_config method, which passes the
    client configuration as it originally appeared in a client secrets file
    but doesn't access the file itself.)

flow = google_auth_oauthlib.flow.Flow.from_client_secrets_file(
    'client_secret.json',
    scope=['https://www.googleapis.com/auth/drive.metadata.readonly'])

redirect_uri
Required.
  Determines where the API server redirects the user after the user
  completes the authorization flow. The value must exactly match one of the
  redirect_uri values listed for your project in the
  API Console. Note that the http or
  https scheme, case, and trailing slash ('/')
  must all match.

      To set this value in Python, set the flow object's
      redirect_uri property:

flow.redirect_uri = 'https://www.example.com/oauth2callback'

scope
Required. A
  list of scopes that identify the
  resources that your application could access on the user's behalf. These
  values inform the consent screen that Google displays to the user.

  Scopes enable your application to only request access to the resources
  that it needs while also enabling users to control the amount of access
  that they grant to your application. Thus, there is an inverse
  relationship between the number of scopes requested and the likelihood
  of obtaining user consent.

      In Python, use the same method you use to set the
      client_id to specify the list
      of scopes.

flow = google_auth_oauthlib.flow.Flow.from_client_secrets_file(
    'client_secret.json',
    scope=['https://www.googleapis.com/auth/drive.metadata.readonly'])

The OAuth 2.0 API Scopes
document provides a full list of scopes that you might use to access
Google APIs.

We recommend that your application request access to authorization scopes
in context whenever possible. By requesting access to user data in context,
via incremental authorization,
you help users to more easily understand why your application needs the
access it is requesting.

access_type
Recommended. Indicates whether your application can refresh
    access tokens when the user is not present at the browser.  Valid parameter
    values are online, which is the default value, and
    offline.
    Set the value to offline if your application needs to refresh
    access tokens when the user is not present at the browser. This is the
    method of refreshing access tokens described later in this document. This
    value instructs the Google authorization server to return a refresh token
    and an access token the first time that your application exchanges
    an authorization code for tokens.

    In Python, set the access_type parameter by specifying
    access_type as a keyword argument when calling the
    flow.<wbr>authorization_url method:

authorization_url, state = flow.authorization_url(
    access_type='offline',
    include_granted_scopes='true')

state
Recommended. Specifies any string value that your application
    uses to maintain state between your authorization request and the
    authorization server's response. The server returns the exact value that
    you send as a name=value pair in the hash
    (#) fragment of the
    redirect_uri after the user consents
    to or denies your application's access request.
    You can use this parameter for several purposes, such as directing the
    user to the correct resource in your application, sending nonces, and
    mitigating cross-site request forgery. Since your redirect_uri
    can be guessed, using a state value can increase your
    assurance that an incoming connection is the result of an authentication
    request. If you generate a random string or encode the hash of a cookie or
    another value that captures the client's state, you can validate the
    response to additionally ensure that the request and response originated
    in the same browser, providing protection against attacks such as
    cross-site request forgery. See the OpenID Connect
    documentation for an example of how to create and confirm a
    state token.

    In Python, set the state parameter by specifying
    state as a keyword argument when calling the
    flow.<wbr>authorization_url method:

authorization_url, state = flow.authorization_url(
    access_type='offline',
    state=sample_passthrough_value,
    include_granted_scopes='true')

include_granted_scopes
Optional. Enables applications to use incremental authorization
    to request access to additional scopes in context. If you set this
    parameter's value to true and the authorization request is
    granted, then the new access token will also cover any scopes to which the
    user previously granted the application access. See the
    incremental authorization section
    for examples.

    In Python, set the include_granted_scopes parameter by
    specifying include_granted_scopes as a keyword argument
    when calling the flow.<wbr>authorization_url method:

authorization_url, state = flow.authorization_url(
    access_type='offline',
    include_granted_scopes='true')

login_hint
Optional. If your application knows which user is trying to
    authenticate, it can use this parameter to provide a hint to the Google
    Authentication Server.  The server uses the hint to simplify the login
    flow either by prefilling the email field in the sign-in form or by
    selecting the appropriate multi-login session.
    Set the parameter value to an email address or sub
    identifier, which is equivalent to the user's Google ID.

    In Python, set the login_hint parameter by specifying
    login_hint as a keyword argument when calling the
    flow.<wbr>authorization_url method:

authorization_url, state = flow.authorization_url(
    access_type='offline',
    login_hint=<span<EMAIL_ADDRESS>class="pun">,
    include_granted_scopes='true')

prompt

Optional. A space-delimited, case-sensitive list of prompts to
      present the user. If you don't specify this parameter, the user will be
      prompted only the first time your app requests access.

      In Python, set the prompt parameter by specifying
      prompt as a keyword argument when calling the
      flow.<wbr>authorization_url method:

authorization_url, state = flow.authorization_url(
      access_type='offline',
      prompt='consent',
      include_granted_scopes='true')

  Possible values are:

      none
      Do not display any authentication or consent screens. Must not be
        specified with other values.

      consent
      Prompt the user for consent.

      select_account
      Prompt the user to select an account.

Step 2: Redirect to Google's OAuth 2.0 server
Redirect the user to Google's OAuth 2.0 server to initiate the
   authentication and authorization process. Typically, this occurs
   when your application first needs to access the user's data. In the case
   of incremental authorization, this step also
   occurs when your application first needs to access additional resources that
   it does not yet have permission to access.

This example shows how to redirect the user to the authorization URL

using the Flask web application framework:
return flask.redirect(authorization_url)
Google's OAuth 2.0 server authenticates the user and obtains consent from
the user for your application to access the requested scopes. The response
is sent back to your application using the redirect URL you specified.
Step 3: Google prompts user for consent
In this step, the user decides whether to grant your application the
requested access. At this stage, Google displays a consent window that shows
the name of your application and the Google API services that it is requesting
permission to access with the user's authorization credentials. The user can
then consent or refuse to grant access to your application.
Your application doesn't need to do anything at this stage as it waits for
the response from Google's OAuth 2.0 server indicating whether the access was
granted. That response is explained in the following step.
Step 4: Handle the OAuth 2.0 server response
The OAuth 2.0 server responds to your application's access request by using
the URL specified in the request.
If the user approves the access request, then the response contains an
authorization code. If the user does not approve the request, the response
contains an error message. The authorization code or error message that is
returned to the web server appears on the query string, as shown below:
An error response:
https://oauth2.example.com/auth?error=access_denied
An authorization code response:
https://oauth2.example.com/auth?code=4/P7q7W91a-oMsCeLvIaQm6bTrgtp7
Important: If your
response endpoint renders an HTML page, any resources on that page will be
able to see the authorization code in the URL. Scripts can read the URL
directly, and the URL in the Referer HTTP header may be sent
to any or all resources on the page.
Carefully consider whether you want to send authorization credentials to all
resources on that page (especially third-party scripts such as social plugins
and analytics). To avoid this issue, we recommend that the server first handle
the request, then redirect to another URL that doesn't include the response
parameters.
Sample OAuth 2.0 server response

You can test this flow by clicking on the following sample URL, which requests
read-only access to view metadata for files in your Google Drive:

https://accounts.google.com/o/oauth2/v2/auth?
 scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive.metadata.readonly&
 access_type=offline&
 include_granted_scopes=true&
 state=state_parameter_passthrough_value&
 redirect_uri=http%3A%2F%2Foauth2.example.com%2Fcallback&
 response_type=code&
 client_id=client_id
After completing the OAuth 2.0 flow, you should be redirected to
http://localhost/oauth2callback, which will likely yield a
404 NOT FOUND error unless your local machine serves a file
at that address. The next step provides more detail about the information
returned in the URI when the user is redirected back to your application.
Step 5: Exchange authorization code for refresh and access tokens
After the web server receives the authorization code, it can exchange the
authorization code for an access token.
On your callback page, use the google-auth library to verify
   the authorization server response. Then, use the
   flow.fetch_token method to exchange the authorization code
   in that response for an access token:
state = flask.session['state']flow = google_auth_oauthlib.flow.Flow.from_client_secrets_file(    'client_secret.json',    scopes=['https://www.googleapis.com/auth/youtube.force-ssl'],    state=state)flow.redirect_uri = flask.url_for('oauth2callback', _external=True)authorization_response = flask.request.urlflow.fetch_token(authorization_response=authorization_response)# Store the credentials in the session.# ACTION ITEM for developers:#     Store user's access and refresh tokens in your data store if#     incorporating this code into your real app.credentials = flow.credentialsflask.session['credentials'] = {    'token': credentials.token,    'refresh_token': credentials.refresh_token,    'token_uri': credentials.token_uri,    'client_id': credentials.client_id,    'client_secret': credentials.client_secret,    'scopes': credentials.scopes}
Calling Google APIs
After obtaining an access token, your application can use that token to
   authorize API requests on behalf of a given user account or service
   account. Use the user-specific authorization credentials to build a
   service object for the API that you want to call, and then use that object
   to make authorized API requests.

Build a service object for the API that you want to call. You build a
      service object by calling the googleapiclient.discovery
      library's build method with the name and version of the API
      and the user credentials:
For example, to call version 2 of the Drive API:

from googleapiclient.discovery import build

drive = build('drive', 'v2', credentials=credentials)

Make requests to the API service using the
  interface
  provided by the service object.
For example, to list the files in the authenticated user's Google Drive:
files = drive.files().list().execute()

Complete example
The following example prints a JSON-formatted list of files in a user's
Google Drive after the user authenticates and gives consent for the application
to access the user's Drive files.

This example uses the Flask

framework. It runs a web application at http://localhost:8080
that lets you test the OAuth 2.0 flow. If you go to that URL, you should
see four links:

Test an API request: This link points to a page that tries to
      to execute a sample API request. If necessary, it starts the authorization
      flow. If successful, the page displays the API response.
Test the auth flow directly: This link points to a page that tries
      to send the user through the authorization
      flow. The app requests permission to submit authorized API requests
      on the user's behalf.
Revoke current credentials: This link points to a page that
      revokes permissions that the user has already
      granted to the application.
Clear Flask session credentials: This link clears authorization
      credentials that are stored in the Flask session. This lets you see what
      would happen if a user who had already granted permission to your app
      tried to execute an API request in a new session. It also lets you see
      the API response your app would get if a user had revoked permissions
      granted to your app, and your app still tried to authorize a request
      with a revoked access token.

Note: To run this code locally, you must have followed the
   directions in the prerequisites section,
   including setting http://localhost:8080 as a valid redirect URI
   for your credentials and downloading the client_secret.json file
   for those credentials to your working directory.
# -*- coding: utf-8 -*-import osimport flaskimport requestsimport google.oauth2.credentialsimport google_auth_oauthlib.flowimport googleapiclient.discovery# This variable specifies the name of a file that contains the OAuth 2.0# information for this application, including its client_id and client_secret.CLIENT_SECRETS_FILE = "client_secret.json"# This OAuth 2.0 access scope allows for full read/write access to the# authenticated user's account and requires requests to use an SSL connection.SCOPES = ['https://www.googleapis.com/auth/drive.metadata.readonly']API_SERVICE_NAME = 'drive'API_VERSION = 'v2'app = flask.Flask(__name__)# Note: A secret key is included in the sample so that it works.# If you use this code in your application, replace this with a truly secret# key. See http://flask.pocoo.org/docs/0.12/quickstart/#sessions.app.secret_key = 'REPLACE ME - this value is here as a placeholder.'@app.route('/')def index():  return print_index_table()@app.route('/test')def test_api_request():  if 'credentials' not in flask.session:    return flask.redirect('authorize')  # Load credentials from the session.  credentials = google.oauth2.credentials.Credentials(      **flask.session['credentials'])  drive = googleapiclient.discovery.build(      API_SERVICE_NAME, API_VERSION, credentials=credentials)  files = drive.files().list().execute()  # Save credentials back to session in case access token was refreshed.  # ACTION ITEM: In a production app, you likely want to save these  #              credentials in a persistent database instead.  flask.session['credentials'] = credentials_to_dict(credentials)  return flask.jsonify(**files)@app.route('/authorize')def authorize():  # Create flow instance to manage the OAuth 2.0 Authorization Grant Flow steps.  flow = google_auth_oauthlib.flow.Flow.from_client_secrets_file(      CLIENT_SECRETS_FILE, scopes=SCOPES)  flow.redirect_uri = flask.url_for('oauth2callback', _external=True)  authorization_url, state = flow.authorization_url(      # Enable offline access so that you can refresh an access token without      # re-prompting the user for permission. Recommended for web server apps.      access_type='offline',      # Enable incremental authorization. Recommended as a best practice.      include_granted_scopes='true')  # Store the state so the callback can verify the auth server response.  flask.session['state'] = state  return flask.redirect(authorization_url)@app.route('/oauth2callback')def oauth2callback():  # Specify the state when creating the flow in the callback so that it can  # verified in the authorization server response.  state = flask.session['state']  flow = google_auth_oauthlib.flow.Flow.from_client_secrets_file(      CLIENT_SECRETS_FILE, scopes=SCOPES, state=state)  flow.redirect_uri = flask.url_for('oauth2callback', _external=True)  # Use the authorization server's response to fetch the OAuth 2.0 tokens.  authorization_response = flask.request.url  flow.fetch_token(authorization_response=authorization_response)  # Store credentials in the session.  # ACTION ITEM: In a production app, you likely want to save these  #              credentials in a persistent database instead.  credentials = flow.credentials  flask.session['credentials'] = credentials_to_dict(credentials)  return flask.redirect(flask.url_for('test_api_request'))@app.route('/revoke')def revoke():  if 'credentials' not in flask.session:    return ('You need to authorize before ' +            'testing the code to revoke credentials.')  credentials = google.oauth2.credentials.Credentials(    **flask.session['credentials'])  revoke = requests.post('https://accounts.google.com/o/oauth2/revoke',      params={'token': credentials.token},      headers = {'content-type': 'application/x-www-form-urlencoded'})  status_code = getattr(revoke, 'status_code')  if status_code == 200:    return('Credentials successfully revoked.' + print_index_table())  else:    return('An error occurred.' + print_index_table())@app.route('/clear')def clear_credentials():  if 'credentials' in flask.session:    del flask.session['credentials']  return ('Credentials have been cleared.

' +          print_index_table())def credentials_to_dict(credentials):  return {'token': credentials.token,          'refresh_token': credentials.refresh_token,          'token_uri': credentials.token_uri,          'client_id': credentials.client_id,          'client_secret': credentials.client_secret,          'scopes': credentials.scopes}def print_index_table():  return ('
' +          '
Test an API request	' +          'Submit an API request and see a formatted JSON response. ' +          '    Go through the authorization flow if there are no stored ' +          '    credentials for the user.
' +          '
Test the auth flow directly	' +          'Go directly to the authorization flow. If there are stored ' +          '    credentials, you still might not be prompted to reauthorize ' +          '    the application.
' +          '
Revoke current credentials	' +          'Revoke the access token associated with the current user ' +          '    session. After revoking credentials, if you go to the test ' +          '    page, you should see an invalid_grant error.' +          '
' +          '
Clear Flask session credentials	' +          'Clear the access token currently stored in the user session. ' +          '    After clearing the token, if you test the ' +          '    API request again, you should go back to the auth flow.' +          '

')if __name__ == '__main__':  # When running locally, disable OAuthlib's HTTPs verification.  # ACTION ITEM for developers:  #     When running in production *do not* leave this option enabled.  os.environ['OAUTHLIB_INSECURE_TRANSPORT'] = '1'  # Specify a hostname and port that are set as a valid redirect URI  # for your API project in the Google API Console.  app.run('localhost', 8080, debug=True)
Incremental authorization
In the OAuth 2.0 protocol, your app requests authorization to access
resources, which are identified by scopes. It is considered a best
user-experience practice to request authorization for resources at the time
you need them. To enable that practice, Google's authorization server supports
incremental authorization. This feature lets you request scopes as they are
needed and, if the user grants permission, add those scopes to your existing
access token for that user.
For example, an app that lets people sample music tracks and create mixes
might need very few resources at sign-in time, perhaps nothing more than the
name of the person signing in. However, saving a completed mix would require
access to their Google Drive. Most people would find it natural if they only
were asked for access to their Google Drive at the time the app actually
needed it.
In this case, at sign-in time the app might request the profile
scope to perform basic sign-in, and then later request the
https://www.googleapis.com/auth/drive.file scope at the time of the
first request to save a mix.
To implement incremental authorization, you complete the normal flow for
   requesting an access token but make sure that the authorization request
   includes previously granted scopes. This approach allows your app to avoid
   having to manage multiple access tokens.
The following rules apply to an access token obtained from an incremental
authorization:

The token can be used to access resources corresponding to any of the
      scopes rolled into the new, combined authorization.
When you use the refresh token for the combined authorization to obtain
      an access token, the access token represents the combined authorization
      and can be used for any of its scopes.
The combined authorization includes all scopes that the user granted
      to the API project even if the grants were requested from different
      clients. For example, if a user granted access to one scope using an
      application's desktop client and then granted another scope to the
      same application via a mobile client, the combined authorization would
      include both scopes.
If you revoke a token that represents a combined authorization, access
      to all of that authorization's scopes on behalf of the associated user
      are revoked simultaneously.

The example for setting authorization
     parameters demonstrates how to ensure authorization requests follow
     this best practice. The code snippet below also shows the code that you
     need to add to use incremental authorization.
In Python, set the include_granted_scopes keyword argument
   to true to ensure that an authorization request includes
   previously granted scopes. It is very possible that
   include_granted_scopes will not be the only keyword
   argument that you set, as shown in the example below.
authorization_url, state = flow.authorization_url(    # Enable offline access so that you can refresh an access token without    # re-prompting the user for permission. Recommended for web server apps.    access_type='offline',    # Enable incremental authorization. Recommended as a best practice.    include_granted_scopes='true')
Refreshing an access token (offline access)
Access tokens periodically expire. You can refresh an access token without
prompting the user for permission (including when the user is not present) if
you requested offline access to the scopes associated with the token.

If you use a Google API Client Library, the client
object refreshes the access token as needed as long as you configure that
object for offline access.

Requesting offline access is a requirement for any application that needs
   to access a Google API when the user is not present. For example, an app
   that performs backup services or executes actions at predetermined times
   needs to be able to refresh its access token when the user is not present.
   The default style of access is called online.
Server-side web applications, installed applications, and devices all
   obtain refresh tokens during the authorization process. Refresh tokens
   are not typically used in client-side (JavaScript) web applications.

In Python, set the access_type keyword argument to

offline to ensure that you will be able to refresh the
access token without having to re-prompt the user for permission.
It is very possible that access_type will not be the
only keyword argument that you set, as shown in the example below.
authorization_url, state = flow.authorization_url(    # Enable offline access so that you can refresh an access token without    # re-prompting the user for permission. Recommended for web server apps.    access_type='offline',    # Enable incremental authorization. Recommended as a best practice.    include_granted_scopes='true')
After a user grants offline access to the requested scopes, you can continue
   to use the API client to access Google APIs on the user's behalf when the
   user is offline. The client object will refresh the access token as
   needed.
Revoking a token
In some cases a user may wish to revoke access given to an application. A
user can revoke access by visiting
Account Settings.
It is also possible for an application to programmatically revoke the access
given to it. Programmatic revocation is important in instances where a user
unsubscribes or removes an application. In other words, part of the removal
process can include an API request to ensure the permissions granted to the
application are removed.
To programmatically revoke a token, make a request to
   https://accounts.google.com/o/oauth2/revoke that includes
   the token as a parameter and sets the Content-Type header:
requests.post('https://accounts.google.com/o/oauth2/revoke',    params={'token': credentials.token},    headers = {'content-type': 'application/x-www-form-urlencoded'})
Note: Following a successful revocation response, it
might take some time before the revocation has full effect.

I don't think this doc was fully imported into
https://github.com/googleapis/google-api-python-client/blob/master/docs/oauth-web.md
so I will leave it open until it is fully merged.

I've opened a PR to delete oauth-web.md as it is adds no additional value compared with https://developers.google.com/identity/protocols/oauth2/web-server.


NEXT-8546

1. Why is this change necessary?
The SystemConfigService would not return the values that were written to it. This inconsistency meant that values of e.g. 0 were not possible.
2. What does this change do, exactly?
Remove a faulty early return in the resolution of config arrays.
3. Describe each step to reproduce the issue or behaviour.

Set a config key's value to 0.
Get said config keys value. It is now null.

4. Please link to the relevant issues (if any).
https://github.com/shopware/platform/issues/861
5. Checklist

[x] I have written tests and verified that they fail without my change
[ ] I have squashed any insignificant commits
[ ] I have written or adjusted the documentation according to my changes
[ ] This change has comments for package types, values, functions, and non-obvious lines of code
[x] I have read the contribution requirements and fulfil them.

QA approved :heavy_check_mark:

@jkrzefski please squash the commits

@mitelg Squashed

Thanks for your Contribution! 💙


[Package Request] libcilkrts

Would it be possible to add libcilkrts so then an appropriate modification to the builtin gcc would allow for compilation of cilk programs?

I assume you want this for mingw-w64-*-gcc and not msys2/gcc? See some past discussion here: http://sourceforge.net/p/mingw-w64/mailman/message/34372983/
Can I ask that you try it and report back? I don't think anyone on the team will have the extra capacity to look into this for you.


TypeError: Value passed to parameter 'shape' has DataType float32 not in list of allowed values: int32, int64

When running train.py, I get this error. plz resolve

@awesome-yz please check it
https://github.com/antoine77340/Youtube-8M-WILLOW/issues/23#issuecomment-498943498


Do not run parallel integration test

Please describe what your change is about.
Test integration regularly failed with:

--- FAIL: TestJSONAPICompliance (0.70s)
    --- FAIL: TestJSONAPICompliance/TestListSpaces (0.11s)

https://github.com/fabric8-services/fabric8-wit/blob/master/controller/json_api_compliance_test.go#L67
The failure is intermittent and seems to occurs bc the of the state of the DB

What issues does it solve? (Use autoreferencing for this)
The proposal is to run integration test (only test requiring DB) forcing them to run on 1 program/test binaries.

> go help build
...
 -p n
                the number of programs, such as build commands or
                test binaries, that can be run in parallel.
                The default is the number of CPUs available.
...

If you are still working on the change please prefix the pull request title with "WIP"

@xcoulon indeed running test-integration with this option make the build succeed first time!
@MatousJobanek is it something you've implemented too in your build?
cc @jarifibrahim with this small hack, I think we can fix the intermittent test run.

@corinnekrych This is awesome. Thank you so much :)

@corinnekrych This is awesome. Thank you so much :)

@corinnekrych This is awesome. Thank you so much :)


Verify ledger support

https://github.com/cosmos/cosmjs/blob/main/packages/amino/src/signer.ts

This is related to #21, @Callum-A Can you test again in v.0.0.14 ?


extract interface from MathAstNode

As title says, we should extract an interface from MathAstNode, so that we can program to it instead of the implementation.

Fix is merged.


[subscription tier] Request rate value for burst control limit can be added more than the quota allocation.

Description:
Updating a burst control with more than allocated quota is successfully saved. As in below example
quota allocation = 1000/min
request rate = 1001/min
(see the image)
Expected: It should validate not to add burst control limit as more than the allocated quota.
Suggested Labels:
Type/bug
Priority/High
Product-scenario
Suggested Assignees:
Affected Product Version:
2.6.0 wum updated<PHONE_NUMBER>263)
OS, DB, other environment details and versions:
[1]

I’m closing this issue because it has been inactive for more than two years. Please reopen if you still encounter this issue with the latest version.


chore(setuptools): add pyproject.toml and linting

Pull Request Test Coverage Report for Build<PHONE_NUMBER>

0 of 0   changed or added relevant lines in 0 files are covered.
No unchanged relevant lines lost coverage.
Overall coverage decreased (-94.7%) to 0.0%

Totals

Change from base Build<PHONE_NUMBER>:
-94.7%

Covered Lines:
0

Relevant Lines:
0

💛  - Coveralls


A question about calculating precision@k

Hello,
I have a question about the function precision_at_k in evaluation.py. I think the denominator should be the amount of 1 predictions made among the top k predictions, however, in the code, length of top k is used. For example, if only 1 true prediction in the top 5, the denominator should be 1 but in this case it would still be 5.
Here is my modification:
def precision_at_k(yhat, yhat_raw, y, k):
    #num true labels in top k predictions / num 1 predictions in top k
    sortd = np.argsort(yhat_raw)[:,::-1]
    topk = sortd[:,:k]

    #get precision at k for each example
    vals = []
    for i, tk in enumerate(topk):
        if len(tk) > 0:
            num_true_in_top_k = y[i,tk].sum()
            denom = yhat[i,tk].sum()
            if denom == 0: # in case no true predictions made in top k
                vals.append(1)
            else:
                vals.append(num_true_in_top_k / float(denom))

    return np.mean(vals)

Could you take a look at it? Correct me if I am wrong.

Ah, I see what you mean now. Yes you can define it that way. I'm not actually sure what the standard practice is in information retrieval, which is where I think this metric is most prevalent. I suspect the difference will not be major for this ICD coding task, as a trained model will usually predict more than 8 codes. For internal consistency I think I will update that comment, but keep the implementation as is now.

The original implementation doesn't seem to be wrong. This article may help: https://medium.com/@m_n_malaeb/recall-and-precision-at-k-for-recommender-systems-618483226c54


[cubestore] disable router mysql port by default

Signed-off-by: František Hána<EMAIL_ADDRESS>

Thanks @sinacek.
can you add "[cubestore]" in the PR title and remove the mysqlPort default value in README?

It's updated

Merged. Thanks @sinacek


Adding parameters to control the sleep duration

use different intervals to print logs every random(100, 400) milliseconds
docker run chentex/random-logger:latest 100 400
Added a way to test sleep with milliseconds

Good catch. Fixed.


⚠ Samsung has degraded performance

In 9cbffbc, Samsung (https://samsung.com) experienced degraded performance:

HTTP code: 200
Response time: 1869 ms

Resolved: Samsung performance has improved in 5f16bc8.


Allow adding existing Okta users to Organizations

Tried to add Nick Clyde to an organization in test and ran into the following error
{ "graphQLErrors": [ { "message": "HTTP 400, Okta E0000001 (Api validation failed: login - login: An object with this field already exists in the current organization), ErrorId oaerpZo7CViT8mUEP9xvjXZmw" } ], "networkError": null, "message": "HTTP 400, Okta E0000001 (Api validation failed: login - login: An object with this field already exists in the current organization), ErrorId oaerpZo7CViT8mUEP9xvjXZmw" }

It seems unlikely that an end user would run into this issue but for account spoofing and developer quality of life. It would be helpful to add existing Okta Users to Organizations

Something we only really see internally where we do a lot of org spoofing. From a process and sec standpoint should have a better way to do this. Our current way is HIPPA compliant.
"Sneaking in and sneaking out"

fixed with new account spoofing tool


Add nginx sidecar to geth

Description
Add nginx sidecar to handle the geth rpc/ws services. Workaround to sessionAffinity not working as expected (celo-blockchain#1600)
Other changes
Describe any minor or "drive-by" changes here.
Tested
Nginx seems to work well. Additional tests will be done when deployed.
Related issues

Fixes celo-blockchain#1600
It will require updating the blockscout endpoints if we confirm this solution works as expected.

Backwards compatibility
Not impact

Closing in favor of https://github.com/celo-org/celo-monorepo/pull/8161


Function calling does not seem to work with ollama models

I'm not sure if this is because the models are not smart enough to understand how to call a function, or if something inherently prevents them from calling functions, but here is what I am getting:
 aichat -r %functions% --model azure_ai:gpt-4-turbo-1106-preview what is the weather i
n paris ?
Call get_current_weather '{"location":"Paris"}'
The current weather in Paris is partly cloudy with a temperature of +21°C and a moderate northeast wind blowing at 5.3 meters per second.

but
 aichat -r %functions% --model ollama:llama3:8b what is the weather in paris ?
Paris, the City of Light! The weather in Paris can be quite unpredictable, but I'll give you an update on what's currently happening.
[etc...]

I tried repeatedly, with various models, including llama3:70b which is supposed to be quite a bit smarter.
my config file looks like
save: true
conversation_first: true # optional, If set true, start a conversation immediately upon repl
function_calling: true
compress_threshold: 50000
[...]
- type: azure-openai
  name: azure_ai
  api_base: http://[HOSTNAME]:8080/api/azure/
  api_key: [API_KEY]
  models:
    - name:  gpt-4-turbo-1106-preview # 128k
      max_input_tokens: 128000
      max_output_tokens: 4096
      supports_function_calling: true
- type: ollama
  api_base: http://[HOSTNAME]
  models:
    - name: llama3:8b
      supports_function_calling: true

Ollama doesn't support function calling.

oh, I see. So that's a limitation of ollama rather than the underlying models, I take it ?

yes


500 error when open main page

After login I get a 500 (Internal Server Error) on all api links in console. But when i open, as example, api/plugins i've got this:
{"status":"error","code":404,"message":"/api/plugins does not exist","data":{"code":"ResourceNotFound"}}

I did not have this error for 1.0.0-rc.1, please reopen if you still see this error (btw, it's possible to use debug:true in config.js to have a better message / stack)


Fix checked radio button issue when value is false

Setting the :checked value to false for a radio button collection didn't render the correct HTML. The radio button with the value of false didn't get the selected attribute. This commit fixes the issue.

Great, thanks!


Handle error from FetchServiceLogs properly

Small fix to handle the error from FetchServiceLogs before handling the error from the Pretty print in ocm servicelog list

/lgtm


Fix preload after refreshing

This PR adds preload property to every webContents, so that when LiteLoader.LiteLoader.preload is invoked, we can get the preload path from event.sender.preload. In this way, we can refresh the page and handle qqnt preload correctly.

感谢您的贡献！


GraphQL dependency update (0.8.*)

This library needs to be updated to support new GraphQL as the resolve function's info.fieldASTs value has been renamed to info.fieldNodes (#554)

We just updated to v0.8.2 graphql and using graphql-parse-fields in our project this fix would be really appreciated.

Added support in<EMAIL_ADDRESS>


crash at cache_init();

dyld: lazy symbol binding failed: Symbol not found: _task_restartable_ranges_register
Referenced from: /Users/hsz/Library/Developer/Xcode/DerivedData/objc-bcmgrkittkwfkggudysyarbtscjy/Build/Products/Debug/libobjc.A.dylib (which was built for Mac OS X 10.15)
Expected in: /usr/lib/libSystem.B.dylib
dyld: Symbol not found: _task_restartable_ranges_register
Referenced from: /Users/hsz/Library/Developer/Xcode/DerivedData/objc-bcmgrkittkwfkggudysyarbtscjy/Build/Products/Debug/libobjc.A.dylib (which was built for Mac OS X 10.15)
Expected in: /usr/lib/libSystem.B.dylib

Updata mac system to 10.15.4


wip: Support MDX PROPERTIES in execute_mdx_dataframe

use display_attribute=True and user PROPERTIES in MDX query
Related to #470

Prototype for MDX PORPERTIES support in execute_mdx_dataframe functions:
from TM1py import TM1Service

with TM1Service(address="", port=12354, user="admin", password="apple", ssl=True) as tm1:
    mdx = """
    SELECT
    {Tm1SubsetAll([d1])} PROPERTIES [d1].[Attribute Something] ON 0,
    {Tm1SubsetAll([d2])} PROPERTIES [d2].[Number] ON 1
    FROM [c1]
    """

    data = tm1.cells.execute_mdx_dataframe(mdx, display_attribute=True)

    print(data)

@MariusWirtz this works, but behaves differently than the old content endpoint. When properties appear on the rows, the display_attributes replaces the element which is problematic when a query includes multiple attributes. I think the the desired behavior is to add a new column for each row property, then users could drop the original member name if desired.
For this query:
SELECT        NON EMPTY         {[Scenario].[Scenario].[Planning]}        ON COLUMNS ,        NON EMPTY         {[Product].[Product].[C1],[Product].[Product].[C3],[Product].[Product].[C4]}         DIMENSION PROPERTIES [Product].[Product].[Usage], [Product].[Product].[Reporting Name]       ON ROWS      FROM [Test]
The structure would look something like this

Thanks @rclapp. I will adjust it accordingly.

@rclapp I changed it accordingly. The only problem I see now is that if you don't provide PROPERTIES for any dimension in the MDX, it will retrieve all attributes for that dimension by default.
Do you know a "dummy" PROPERTY of a dimension, that users could specify in the MDX in order to avoid all attributes being loaded?

Yes, you could include "DIMENSION PROPERTIES MEMBER_NAME"
It works on all axis. Ideally include attributes would be false by default. When set to true the user should have a well defined query to prevent getting too many attributes.
Sent from my mobile phone
On Feb 4, 2021 8:19 AM, Marius Wirtz<EMAIL_ADDRESS>wrote:
@rclapphttps://github.com/rclapp I changed it accordingly. The only problem I see now is that if you don't provide PROPERTIES for any dimension in the MDX, it will retrieve all attributes for that dimension by default.
Do you know a "dummy" PROPERTY of a dimension, that users could specify in the MDX in order to avoid all attributes being loaded?

You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/cubewise-code/tm1py/pull/479#issuecomment-773429020, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AEK7GZRK5PYSPOPYQT45YY3S5LCGNANCNFSM4XAO5NDQ.

Nice one. PROPERTIES MEMBER_NAME  does the trick.  Yes, include_attributes is False by default.
As you say, it's up to the user now to use this feature with care.
For the execute_mdx_dataframe_shaped, I suggest we use a different approach and a different argument name: display_attribute. If it's passed as True we would show the (first) attribute value instead of the element name. That's also how it works in Arc and what @yyzz1010 asked for in #470.

Agree 100%, Shaped frames don’t need any more complexity.
From: Marius Wirtz<EMAIL_ADDRESS>Reply-To: cubewise-code/tm1py<EMAIL_ADDRESS>Date: Thursday, February 4, 2021 at 10:41 AM
To: cubewise-code/tm1py<EMAIL_ADDRESS>Cc: "Clapp, Ryan"<EMAIL_ADDRESS>Mention<EMAIL_ADDRESS>Subject: Re: [cubewise-code/tm1py] wip: Support MDX PROPERTIES in execute_mdx_dataframe (#479)
Nice one. PROPERTIES MEMBER_NAME does the trick. Yes, include_attributes is False by default.
As you say, it's up to the user now to use this feature with care.
For the execute_mdx_dataframe_shaped, I suggest we use a different approach and a different argument name: display_attribute. If it's passed as True we would show the (first) attribute value instead of the element name. That's also how it works in Arc and what @yyzz1010https://github.com/yyzz1010 asked for in #470https://github.com/cubewise-code/tm1py/issues/470.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/cubewise-code/tm1py/pull/479#issuecomment-773522132, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AEK7GZWH3F54K6GYD4YQSILS5LS25ANCNFSM4XAO5NDQ.


 When we try to view the log files, they appear empty on some and after clicking a couple times it pulls up the right log based on the instance it's hitting - i'm guessing.

Hey @dewebdesigns
There are 2 problems in this case:
1. Logs are spread across multiple server instances
Currently, Log Viewer does not support loading logs from multiple server instances. It only loads the logs found on the same file system, locally. So if the load balancer routes the request to instance # 2, then it will returns logs found in the instance # 2.
It's not a feature that's currently prioritised and I don't think it will be any time soon.
2. Server is behind load balancer, thus it keeps switching to a different server instance
Luckily, this is meant to be fixed by Livewire (see https://github.com/livewire/livewire/pull/4354), so I don't think load balancers are the issue here. If you select to view the log file laravel.log, does every server instance have that file? And if so, does every file on each server instance have the same contents? Probably not. So if the load balancer keeps switching the requests to different server instances, then you'll keep getting different & inconsistent results.
Hope this explains why this is happening. Unfortunately, there isn't a quick fix at the moment, as the package simply does not support showing log files from multiple server instances :)


Example code is broken

example/composition.yaml:
 fromFieldPath: "location"
should be (as in README.md)
 fromFieldPath: "spec.location"

Also, the example code could be better. I propose to use another default for spec.forProvider.region so that it is obvious what the result of the function is.

https://github.com/crossplane-contrib/function-patch-and-transform/pull/63 should fix the incorrect fromFieldPath, also adds a few other examples of usage


Missing support for "erfcinv" and "erfinv" math functions in TICK scripts

The Math functions included in this list [1] do not include the inverse function for both the "erf" and "erfc" functions.    It would be useful to include "erfcinv" and "erfinv" to the supported list.
[1] https://docs.influxdata.com/kapacitor/v1.5/tick/expr/

I have tested this locally and am willing to propose a PR if you are willing to accept this change.


Remove package:cli_config dependency in pubspec.yaml: This package is not used anywhere

Let me drop this and include in another PR in future.


Help in menu is missing

@pelikhan Is this regression from your change?

I think it arrived here: https://github.com/Microsoft/pxt/commit/0f91eb016eb49231b9fc76aecdd01c7d7ec9e67f . Cleanup of app.tsx was overdue.

Fixed.


Removing requirement for EPEL on RedHat/Centos and use

Create and use the erlang-solutions repository for RedHat/Centos.  Also remove the requirement to use EPEL so that you can get a more modern version of erlang installed.
This is similar to the setup for APT in the module currently

I'm not sure what the reason(s) might be for the travis failures, but I wanted to chip in with my 👍 that this change set is functional for me on CentOS 7. Anything I can do to help get this into a future release?

Closing moved to new branch #25


Is it necessary that both the RM client and the TM client start a timer for reconnecting to seata server ？

[x] I have searched the issues of this repository and believe that this is not a duplicate.

Ⅰ. Issue Description
Is it necessary that both rm client and tm client start a timer for reconnecting to seata server？
The log of 2 timeoutCheckers is as follows：
2023-02-13 10:12:51.547  INFO 4079 --- [eoutChecker_1_1] i.s.d.r.k8s.K8sRegistryServiceImpl
2023-02-13 10:12:51.917  INFO 4079 --- [eoutChecker_2_1] i.s.d.r.k8s.K8sRegistryServiceImpl
2023-02-13 10:13:01.547  INFO 4079 --- [eoutChecker_1_1] i.s.d.r.k8s.K8sRegistryServiceImpl
2023-02-13 10:13:01.916  INFO 4079 --- [eoutChecker_2_1] i.s.d.r.k8s.K8sRegistryServiceImpl
io.seata.core.rpc.netty.AbstractNettyRemotingClient#init
public void init() {
        timerExecutor.scheduleAtFixedRate(new Runnable() {
            @Override
            public void run() {
                clientChannelManager.reconnect(getTransactionServiceGroup());
            }
        }, SCHEDULE_DELAY_MILLS, SCHEDULE_INTERVAL_MILLS, TimeUnit.MILLISECONDS);

I want to try and see if I can solve this, can you assign it to me?


this.error should fire the stop callbacks

Per http://docs.meteor.com/api/pubsub.html#Subscription-error

Probably some orphaned Redis connections due to this @ttacon


dbeaver/dbeaver#34425 - Network profile now set to datasource for per…

Network profile now set to datasource for persisting

Verified


Consider renaming the packages directory in the  Flutter repo.

The current convention of storing package sources in a packages directory of the flutter repo is at odds with the Dart convention that treats these directories as special in package URI resolution.
For reference, see the pkgspec DEP.  The salient bit from the Resolving package: URIs section is:

If a tool does not find a .packages file in the previous step, it should look for a packages directory next to the entry point. If the entry point is a file: URI this means checking if a packages directory exists, in all other cases, the directory is assumed to exist. The tool then resolves package URIs as if the packages directory had been specified using --package-root.
If the entry point was file: URI and a packages directory was not found in the previous step, then the tool checks for the presence of a .packages file in the parent directory of the entry point, and recursively check each parent directory up to the root directory until a .packages file is found. That .packages file is used to resolve package URIs.

A consequence of the current flutter repo layout is that IDEs need to do extra heroics to play nice (https://github.com/flutter/flutter-intellij/issues/38).
The world would be a much better place for tools if the packages directory got a new name.  Maybe we could follow the Dart SDK convention and opt for pkg?
Any thoughts greatly appreciated.
cc @Hixie @abarth @danrubel

Sort of an API stability question, since it's asking about renaming our directory structure.

The pub sdk: flutter feature may need to be updated if this layout changes.  I'm not sure how it goes about finding packages in the flutter sdk.

packages/ directories are going away, right? That's actually why we picked this name. We considered the conflict, but it was only going to be temporary so we figured we'd take the short-term hit in favour of the right long-term name.
(Not clear what else we'd call it.)

(pkg is an abbreviation and we try hard to avoid those in Flutter land)

Bikesheading!

_packages
bundled_packages
vendored_packages

packages is better than all of those :-P

packages/ directories are going away, right?

Yes!
Which implies (and this is really the point) that the pkgspec DEP may get a rewrite to not treat packages directories as special.  Not sure how far down the road that is though.
paging @kevmoo and @lrhn for insight into a possible timeline...

If packages/ directories are still eventually going away then I recommend leaving this as-is since that means there's no new information since we originally decided on the name. :-)

@Hixie, I think pub using truckloads of symlinks in packages/ directories is going away (pub get --no-packages-dir should soon be the default). But I think the pkgspec DEP will keep packages/ as an alternative way to resolve package: references - alternative to the .packages file.

The pub sdk: flutter feature may need to be updated if this layout changes. I'm not sure how it goes about finding packages in the flutter sdk.

Does it locate things based on being in the <repo-root>/packages/ dir? I see these references in flutter app pubspecs:
dependencies:
  flutter:
    sdk: flutter

and know we need to pass in the FLUTTER_ROOT env var when running pub, but not sure how the resolution happens.

@devoncarew pub is hard-coded to look in FLUTTER_ROOT/packages/<foo> for package foo in sdk: flutter.

@Hixie we will ship Dart SDK 1.20 to stable later this week / early next week, and with that release the default behavoir of pub changes to produce a .packages file, not a packages dir. However, we still support, and will likely have to support for many quarters, the ability to produce a packages dir for compatibility reasons, so pub has a flag you can use to get such a dir.

I'm sure it'll be many more quarters before we're done with Flutter. :-)

I think we should table this.  The motivation, ultimately, was to explore a quick and easy route to have the repo structure play nice in the IDE but thats not what we're looking at. 😃  Luckily, there are other angles on that and I'll pick 'em up over on flutter/flutter-intellij#38.  Thanks everyone for the input!


Check array contiguity in copy

Fix #2061 and #1534.

jenkins, test this please.

Jenkins CI test (for commit 4efa024a7265809c2bfa5f179831a1ad2b029fa1, target branch master) failed with status FAILURE.
(For contributors, please wait until the reviewer confirms the details of the error.)

jenkins, test this please.

Jenkins CI test (for commit 4efa024a7265809c2bfa5f179831a1ad2b029fa1, target branch master) succeeded!

LGTM!


added hostname and port property to SshShell

Pull Request Test Coverage Report for Build 113

2 of 2 (100.0%)  changed or added relevant lines in 1 file are covered.
No unchanged relevant lines lost coverage.
Overall coverage increased (+0.04%) to 89.037%

Totals

Change from base Build 112:
0.04%

Covered Lines:
536

Relevant Lines:
602

💛  - Coveralls


implement historical fire data layer (BurnMD)

Add functionality to:

[ ] place historical perimeters on displayed fire-map from BurnMD dataset
[ ] update FireManagers() with BurnMD time-based mitigations recorded for a given fire
[ ] Calculate the fire extent (burned area) against the perimeters at a given time that a perimeter was recorded in the historical data

@doyled-it @michaelthreet what are the remaining tasks that need to be completed before this PR is ready to merge?


project_Nomis.md

Project Abstract

Please provide a brief description of your project here summarising key points (1-2 paragraphs).
If your application is a follow-up to a previous grant, please mention which one in the first line of the abstract and include a link to previous pull requests if applicable.

For which grant level are you applying?

[ ] Level 1:  Up to $10,000, 2 approvals
[ ] Level 2:  Up to $30,000, 3 approvals
[x] Level 3:  Unlimited, 5 approvals (for >$100k: Web3 Foundation Council approval)

Application Checklist

[x] The application template has been copied, renamed ( project_name.md) and updated.
[x] I have read and understood the FAQs, application guidelines and announcement guidelines.
[x] A BTC, Ethereum (USDT/USDC/DAI) or Polkadot/Kusama (aUSD) address for the payment of the milestones is provided inside the application.
[x] I have read and acknowledge the terms and conditions.
[x] The software delivered for this grant will be released under an open-source license specified in the application.
[x] The initial PR contains only one commit (squash and force-push if needed).
[x] The grant will only be announced once the first milestone has been accepted.
[x] I prefer the discussion of this application to be in a private Element/Matrix channel. My username is: @sxlveign

How Did You Hear About our grants program?

[x] Social Media
[ ] Hackathon
[ ] Personal Recommendation
[ ] Substrate Builders Program
[ ] Investor/VC
[ ] Online Search
[ ] Other: _______

 Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.You have signed the CLA already but the status is still pending? Let us recheck it.

@sxlveign, is your homeserver matrix.org?

Hi @sxlveign, thanks for your application. We will look into it as soon as possible. Is your homeserver matrix.org?

Hi @semuelle. Thanks for your response. No, we're not using matrix.org.

Well, I need it in order to invite you to the private chat.

Chat is here


Add Lefthook.gitignore

Reasons for making this change:

I'm a lefthook user. Lefthook supports local config overrides that should not be checked into git.
Links to documentation supporting these rule changes:
See links in the comments of the added gitignore.
If this is a new template:

Link to application or project’s homepage: https://github.com/evilmartians/lefthook

FYI @mrexox


[databroker] optional dependency for TLS

The current version of databroker always adds tonic::tls as a mandatory dependency. Can this be moved a feature based dependency ? since tls is anyways an optional feature

The reason was to get a leaner version of databroker for systems that don't support openssl. adding tls makes it pull lot more dependencies like rusttls, hyper-tls. this can be avoided if tls is not used.

I think it might make sense, we should however for "default" builds and things we release for Linux always default to include TLS, as this is the right thing™ to do. So in terms of Cargo would be good, if we could express it as antifeature "no-tls" that needs to be enabled explicitly, if that is possible.

maybe this can be  some inspiration https://github.com/seanmonstar/reqwest/pull/375

Yes, something like
Cargo.toml
default = ["tls"]
notls = [ tonic/transport , tonic/channel, tonic/prost]
tls   = [ tonic/transport , tonic/channel, tonic/prost, tonic/tls ]

and then wrap everything with tls in
#[cfg(feature = "tls")]


kaslr support

Symbol table does not exists on latest ps4 (>3.15), and kaslr is introduced since 3.55, which makes current implementation of kernel_resolve completely broken. Is there any solution working without hardcoding?

no, i haven't found a dynamic workaround.

(i am lazy so thanks @5lipper  )


47252 public keyprovider

This PR simply exposes a Datastore's key provider to the outside world. This is primarily intended so that the Query index code and the Attachments code can get access to the key provider.
reviewer @emlaver
reviewer @tomblench

Looks reasonable to me, but I have a style question. I seem to recall you had a campaign to abolish 'simple getters' in favour of making the class member public final, so which is appropriate?
It seems we have a mixture in BasicDatastore, does it depend on whether we expect the getter to perform additional logic/preconditions?

Here, I think we need to use the getter approach because of exposing the attribute via the Datastore interface.

:+1:

I agree with using the getter approach.  +1


Remove unneeded encapsulation of Concerto / Concerto Tools

Markdown Transform use an uncommon idiom of packaging a dependency (composer-concerto and composer-concerto-tools) to avoid problems with multiple versions of the concerto package.
This can be removed whenever the corresponding issues has been resolved: https://github.com/hyperledger/composer-concerto/issues/47 and

Fixed in PR #58


Added 'ref' function

This a dead simple implementation of #2507 which could definitely be improved upon. (Which I'm more than open for)
Can write more tests and write docs once design and featureset has been finalized.

Maybe support for aliases..?

Added docs https://github.com/knex/documentation/pull/112

thanks!


pitr status became paused after injecting network partition between two AZs

Bug Report

What version of TiKV are you using?
./tikv-server -V
TiKV
Release Version:   7.1.0-alpha
Edition:           Community
Git Commit Hash:   abb672b8218307e3811281c22643e0eb2e13cc2c
Git Commit Branch: heads/refs/tags/v7.1.0-alpha
UTC Build Time:    2023-04-08 11:41:27
Rust Version:      rustc 1.67.0-nightly (96ddd32c4 2022-11-14)
Enable Features:   pprof-fp jemalloc mem-profiling portable sse test-engine-kv-rocksdb test-engine-raft-raft-engine cloud-aws cloud-gcp cloud-azure
Profile:           dist_release
2023-04-10T10:18:48.343+0800	INFO	k8s/client.go:132	it should be noted that a long-running command will not be interrupted even the use case has ended. For more information, please refer to https://github.com/pingcap/test-infra/discussions/129
What operating system and CPU are you using?
8c/32g
Steps to reproduce
inject network partition between two AZs
http://perf.pingcap.net:3000/d/WOw1JWmVk/ha-test-case-detail?orgId=1&refresh=10s&var-case_id=2821205
What did you expect?
pitr status should be normal
What did happened?
pitr status became to paused after inject network partition between two AZs

/type bug
/severity critical
/assign 3pointer

we had 1 minute retry for observe region and after that the task enter paused. we can negotiate the proper retry time for this scenario internally.

It's not a critical bug. It's a better have feature

v6.5.7, pitr paused after inject one of az failure lasts for 10mins，after fault recover，pitr status is always paused
clinic：https://clinic.pingcap.com.cn/portal/#/orgs/31/clusters/7319508904069820562?from=1704248700&to=1704250538

Should be duplicated with https://github.com/tikv/tikv/issues/16554.


OpenLayer events problem with React 17

I want to put react components as overlays on top of OpenLayers maps. The events on the components seem to be problematic after upgrade to React 17.0.2 (from 16.14.0). For a reproduction see this. By clicking, on the red div an alert is displayed on React 16.14.0. But, after upgrading React to 17.0.2, the alert is not displayed anymore.

I presume it is a React parsing issue as it works when the ReactDOM call is replaced with
dom.innerHTML = '
' +
'
' +
'    Click here' +
'
' +
'
';


TextEditingController.clear() throws errors

Steps to Reproduce

Call TextEditingController.clear()

Source is available here.
TextField(
  decoration: InputDecoration(
    labelText: "Filter",
    contentPadding: EdgeInsets.symmetric(
      horizontal: 16.0,
      vertical: 16.0,
    ),
    suffixIcon: controller.text != ""
        ? IconButton(
            icon: Icon(Icons.clear),
            onPressed: () {
              FocusScope.of(context).unfocus();
              controller.clear();
              filter();
            },
          )
        : null,
  ),
  controller: controller,
  onChanged: (text) => filter(),
),

Logs

[+7409 ms] W/IInputConnectionWrapper(22544): getTextBeforeCursor on inactive
InputConnection
[        ] W/IInputConnectionWrapper(22544): getSelectedText on inactive
InputConnection
[        ] W/IInputConnectionWrapper(22544): getTextAfterCursor on inactive
InputConnection
[  +28 ms] I/flutter (22544): ══╡ EXCEPTION CAUGHT BY GESTURE
╞═══════════════════════════════════════════════════════════════════
[        ] I/flutter (22544): The following assertion was thrown while handling a
gesture:
[        ] I/flutter (22544): invalid text selection: TextSelection(baseOffset: 1,
extentOffset: 1, affinity:
[        ] I/flutter (22544): TextAffinity.upstream, isDirectional: false)
[        ] I/flutter (22544):
[        ] I/flutter (22544): When the exception was thrown, this was the stack:
[        ] I/flutter (22544): #0      TextEditingController.selection=
(package:flutter/src/widgets/editable_text.dart:169:7)
[        ] I/flutter (22544): #1      EditableTextState._handleSelectionChanged
(package:flutter/src/widgets/editable_text.dart:1219:23)
[        ] I/flutter (22544): #2
RenderEditable._handlePotentialSelectionChange
(package:flutter/src/rendering/editable.dart:376:5)
[        ] I/flutter (22544): #3      RenderEditable.selectPositionAt
(package:flutter/src/rendering/editable.dart:1449:9)
[        ] I/flutter (22544): #4      RenderEditable.selectPosition
(package:flutter/src/rendering/editable.dart:1421:5)
[        ] I/flutter (22544): #5      _TextFieldState._handleSingleTapUp
(package:flutter/src/material/text_field.dart:772:27)
[        ] I/flutter (22544): #6
_TextSelectionGestureDetectorState._handleTapUp
(package:flutter/src/widgets/text_selection.dart:957:16)
[        ] I/flutter (22544): #7      TapGestureRecognizer._checkUp.<anonymous
closure> (package:flutter/src/gestures/tap.dart:363:49)
[        ] I/flutter (22544): #8      GestureRecognizer.invokeCallback
(package:flutter/src/gestures/recognizer.dart:182:24)
[        ] I/flutter (22544): #9      TapGestureRecognizer._checkUp
(package:flutter/src/gestures/tap.dart:363:11)
[        ] I/flutter (22544): #10     TapGestureRecognizer.acceptGesture
(package:flutter/src/gestures/tap.dart:312:7)
[        ] I/flutter (22544): #11
_TransparentTapGestureRecognizer.rejectGesture
(package:flutter/src/widgets/text_selection.dart:1159:7)
[        ] I/flutter (22544): #12     GestureArenaManager.sweep
(package:flutter/src/gestures/arena.dart:159:26)
[        ] I/flutter (22544): #13
_WidgetsFlutterBinding&BindingBase&GestureBinding.handleEvent
(package:flutter/src/gestures/binding.dart:222:20)
[        ] I/flutter (22544): #14
_WidgetsFlutterBinding&BindingBase&GestureBinding.dispatchEvent
(package:flutter/src/gestures/binding.dart:198:22)
[        ] I/flutter (22544): #15
_WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerEvent
(package:flutter/src/gestures/binding.dart:156:7)
[        ] I/flutter (22544): #16
_WidgetsFlutterBinding&BindingBase&GestureBinding._flushPointerEventQueue
(package:flutter/src/gestures/binding.dart:102:7)
[        ] I/flutter (22544): #17
_WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerDataPacket
(package:flutter/src/gestures/binding.dart:86:7)
[        ] I/flutter (22544): #21     _invoke1 (dart:ui/hooks.dart:250:10)
[        ] I/flutter (22544): #22     _dispatchPointerDataPacket
(dart:ui/hooks.dart:159:5)
[        ] I/flutter (22544): (elided 3 frames from package dart:async)
[        ] I/flutter (22544):
[        ] I/flutter (22544): Handler: "onTapUp"
[        ] I/flutter (22544): Recognizer:
[        ] I/flutter (22544):   _TransparentTapGestureRecognizer#5346f
[        ] I/flutter (22544):
═══════════════════════════════════════════════════════════════════════════════════
═════════════════

Analyzing download_lineageos_demo...
No issues found! (ran in 2.1s)

[✓] Flutter (Channel master, v1.8.1-pre.52, on Linux, locale en_GB.UTF-8)
    • Flutter version 1.8.1-pre.52 at /home/gendnat/Applications/flutter
    • Framework revision adf45d1e40 (25 hours ago), 2019-07-09 13:10:26 -0700
    • Engine revision e695a516f1
    • Dart version 2.5.0 (build 2.5.0-dev.0.0 b5aeaa6796)

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.0)
    • Android SDK at /home/gendnat/Android/Sdk
    • Android NDK location not configured (optional; useful for native profiling
      support)
    • Platform android-29, build-tools 29.0.0
    • Java binary at: /snap/android-studio/76/android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build
      1.8.0_152-release-1343-b16-5323222)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at google-chrome

[✓] Linux toolchain - develop for Linux desktop
    • clang++ 8.0.0
    • GNU Make 4.2.1

[✓] Android Studio (version 3.4)
    • Android Studio at /snap/android-studio/76/android-studio
    • Flutter plugin version 37.0.1
    • Dart plugin version 183.6270
    • Java version OpenJDK Runtime Environment (build
      1.8.0_152-release-1343-b16-5323222)

[✓] Connected device (3 available)
    • Pixel 3 • 898X06N8W • android-arm64  • Android 10 (API 29)
    • Linux   • Linux     • linux-x64      • Linux
    • Chrome  • chrome    • web-javascript • Google Chrome 77.0.3833.0 dev

• No issues found!

One solution I've read long ago was to drop the focus from the field and dismiss the keyboard then clear the input. I've tried with the new FocusScope.of(context).unfocus(); (and the old method) but there's still plenty of errors.

This appears to be caused by the tap gesture being forwarded to the TextField itself, after it has cleared the input. The gesture then triggers a text selection, which fails as there is no text anymore.
Consider this minimal example, where the clearing fails only for the button which is embedded in the TextField.
https://gist.github.com/C-gotoh/3ab0ee6f591db5efd2f9c746e2bbf3a7

I tried to put the button outside of the TextField, but it doesn't look very good, it's jerky, and it still has some errors.
ListTile(
  title: TextField(
    decoration: InputDecoration(
      labelText: "Filter",
    ),
    controller: _controller,
    onChanged: (text) => filter(),
  ),
  trailing: _controller.text != ""
      ? IconButton(
          icon: Icon(Icons.clear),
          onPressed: () {
            FocusScope.of(context).unfocus();
            _controller.clear();
            filter();
          },
        )
      : null,
),

I/_lineageos_dem(19313): Waiting for a blocking GC ProfileSaver
W/IInputConnectionWrapper(19313): getTextBeforeCursor on inactive InputConnection
W/IInputConnectionWrapper(19313): getSelectedText on inactive InputConnection
W/IInputConnectionWrapper(19313): getTextAfterCursor on inactive InputConnection

Yes, I agree. This was working before. I was just pointing out a possible cause for this issue.

Definetly the bug. For a temporary solution I have to use a layout with a Stack:
Widget buildSearchTextField({TextEditingController controller, FocusNode focus}) {
  return Stack(
    children: <Widget>[
      TextField(
        maxLines: 1,
        focusNode: focus,
        controller: controller,
        decoration: InputDecoration(
          prefixIcon: Icon(Icons.search),
          // TODO wait for Flutter bug resolved
          // suffixIcon: focus.hasFocus || controller.text.isNotEmpty
          //     ? IconButton(
          //         icon: Icon(Icons.cancel,
          //             color: Theme.of(context).accentColor),
          //         onPressed: () {
          //           focus.unfocus();
          //           controller.clear();
          //         },
          //       )
          //     : null,
        ),
      ),
      if (focus.hasFocus || controller.text.isNotEmpty)
        Align(
          alignment: Alignment.centerRight,
          child: IconButton(
            icon: Icon(Icons.cancel, color: Theme.of(context).accentColor),
            onPressed: () {
              focus.unfocus();
              controller.clear();
            },
          ),
        ),
    ],
  );
}

A slightly cleaner workaround is to wrap the clear in a post frame callback.  This allows the selection code to run and then the clear is applied as opposed to the other way around.
Still not ideal, but less code than the Stack.
Widget buildSearchTextField({TextEditingController controller, FocusNode focus}) {
  return TextField(
    maxLines: 1,
    focusNode: focus,
    controller: controller,
    decoration: InputDecoration(
      prefixIcon: Icon(Icons.search),
      suffixIcon: focus.hasFocus || controller.text.isNotEmpty
          ? IconButton(
              icon: Icon(Icons.cancel,
                  color: Theme.of(context).accentColor),
              onPressed: () {
                SchedulerBinding.instance.addPostFrameCallback((_) {
                  focus.unfocus();
                  controller.clear();
                });
              },
            )
          : null,
    ),
  );
}

@jpeiffer That's works. Thanks!

On Flutter Web channel master version 1.10.6-pre.61, the clear is working but as soon as you type again, the old text comes back.
@jpeiffer solution fixed it. In my case though, no need for the post frame callback, just this:
_inputFocusNode.unfocus();
_inputController.clear();
_inputFocusNode.requestFocus();

:)

Very Similar To How to add clear button to TextField Widget

@obshksw solution looks nice (although still some boilerplate). Personally I started using a setState() where I reset the autovalidate flag on android and set a new TextController. Although I only needed a clear once and that was in an isolated form Widget, separate from the rest of my tree. Hence the set state only affected said form and not the entire tree. Thus take caution when using this approach.

Hi @NatoBoram
Testing on latest dev, i couldn't reproduce the `` errors

Code Sample
import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Material App',
      theme: ThemeData.dark(),
      home: Home(),
    );
  }
}

class Home extends StatefulWidget {
  @override
  _HomeState createState() => _HomeState();
}

class _HomeState extends State<Home> {
  TextEditingController _controller = TextEditingController();

  @override
  void dispose() {
    _controller.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Material App Bar'),
      ),
      body: TextField(
        decoration: InputDecoration(
          labelText: "Filter",
          contentPadding: EdgeInsets.symmetric(
            horizontal: 16.0,
            vertical: 16.0,
          ),
          suffixIcon: _controller.text != ""
              ? IconButton(
                  icon: Icon(Icons.clear),
                  onPressed: () {
                    FocusScope.of(context).unfocus();
                    _controller.clear();
                  },
                )
              : null,
        ),
        controller: _controller,
      ),
      floatingActionButton: FloatingActionButton(
        child: Icon(Icons.add),
        onPressed: () {},
      ),
    );
  }
}

flutter doctor -v
[✓] Flutter (Channel dev, 1.19.0-3.0.pre, on Mac OS X 10.15.5 19F101, locale
    en-GB)
    • Flutter version 1.19.0-3.0.pre at /Users/tahatesser/Code/flutter_dev
    • Framework revision 6135091de9 (3 days ago), 2020-06-01 17:17:03 -0700
    • Engine revision e39301f23f
    • Dart version 2.9.0 (build 2.9.0-13.0.dev 6489a0c68d)

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at /Users/tahatesser/Code/sdk
    • Platform android-29, build-tools 29.0.3
    • ANDROID_HOME = /Users/tahatesser/Code/sdk
    • Java binary at: /Applications/Android
      Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      1.8.0_242-release-1644-b3-6222593)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.5)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.5, Build version 11E608c
    • CocoaPods version 1.9.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.0)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 46.0.2
    • Dart plugin version 193.7361
    • Java version OpenJDK Runtime Environment (build
      1.8.0_242-release-1644-b3-6222593)

[✓] VS Code (version 1.45.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.11.0

[✓] Connected device (5 available)
    • SM M305F      • 32003c30dc19668f          • android-arm64  • Android 10
      (API 29)
    • Taha’s iPhone • 00008020-001059882212002E • ios            • iOS 13.5.1
    • macOS         • macOS                     • darwin-x64     • Mac OS X
      10.15.5 19F101
    • Web Server    • web-server                • web-javascript • Flutter Tools
    • Chrome        • chrome                    • web-javascript • Google Chrome
      83.0.4103.97

• No issues found!

Could everyone who still has this problem please file a new issue with the exact description of what happens, logs and the output of flutter doctor -v.
All system setups can be slightly different, so it's always better to open new issues and reference related issues.
Thank you


chore(deps): bump prometheus dependencies

Signed-off-by: william.vanhevelingen<EMAIL_ADDRESS>fixes #12429, fixes #12272, fixes #11957

Motivation

Modifications

Verification

@agilgur5 should be all set now. I had to downgrade to go 1.21 because go 1.22 has issues

@blkperl what is the issue with go 1.22?


Add sync after mv

Pr for #22

@jpillora ping?

Do all posix systems have "sync" ? Sorry haven't had time to look into this
yet
On Mon, 7 May 2018 at 9:48 am Jon Stevens<EMAIL_ADDRESS>wrote:

@jpillora https://github.com/jpillora ping?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/jpillora/overseer/pull/23#issuecomment-386926037, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAmr85bWS-oGBqBaw7pGzOc0uYxqFgwPks5tv4vXgaJpZM4TyeeU
.

@jpillora Linux (coreutils), BusyBox (what I care about) and Darwin do.
https://www.freebsd.org/cgi/man.cgi?query=sync&sektion=8
A sync utility appeared in	Version	4 AT&T UNIX.
Maybe not posix standard, but been around forever now.

@jpillora Ping?

Thanks @lookfirst Sorry for the delay


Allow OpenID Connect login from Micronaut

This PR makes the same change as in the main UI in https://github.com/MauroDataMapper/mdm-ui/pull/912 in order to allow login using OpenID Connect when using mauro-micronaut instead of mdm-core, which needed some tweaks as we're using Micronaut's provided OpenID plugin rather than our custom implementation.
Raising this PR even though we're still working on mauro-micronaut as want to keep all the UI code in one codebase.

sorry @pjmonks requested your review by accident!


stm32 spi driver adds the frame format

this PR includes the support of the Format (TI vs MOTOROLA) of the SPI frame
The spi frame format is a property added to the spi device through an overlay for the led_strip sample on ws2812
$ west build -p auto -b nucleo_l476rg samples/drivers/led_ws2812/
After the new https://github.com/zephyrproject-rtos/zephyr/pull/39990
fixes https://github.com/zephyrproject-rtos/zephyr/issues/38683
Signed-off-by: Francois Ramu<EMAIL_ADDRESS>

stm32F1xx and some of the stm32L1 MCUs do not support the frame format.

includes overlay for nucleo_g071rb board

change to get the frame format info from the spi config
and not as a SPI instance configuration
It requires a new .frame_format field in the include/drivers/spi.h  set by the <frame-format> entry of the device DTS

Since the PR https://github.com/zephyrproject-rtos/zephyr/pull/39990, the frame_format property is missing in the spi_config structure
.frame_format = DT_PROP(node_id, frame_format),
However there bit [15] in the .operation bitfield
 *     format              [ 15 ]      - Motorola or TI frame format (optional).
but it seems not immediately compatible with the frame-format as described in the dts/bindings/spi/spi-device.yaml

rebase on f882d43b56e909465dd2c2dc904512f1e2c5cef7

@tbursztyka Since the PR #39990, the frame_format property is missing in the spi_config structure as follows: .frame_format = DT_PROP(node_id, frame_format),  However there is a bit [15] in the .operation bitfield  * format [ 15 ] - Motorola or TI frame format (optional). but it seems not immediately compatible with the frame-format as described in the dts/bindings/spi/spi-device.yaml

there isn't a property match between dts and spi_config. in dts it's frame_format, and in in spi_config.operation it's a bit there. Where is the issue?

@FRASTM  looks like I forgot to update SPI_CONFIG_DT() macro. see pr #41641

rebase
get the PR https://github.com/zephyrproject-rtos/zephyr/pull/41641
--> the stm32 drivers takes the frame_format from the DTS property : operation bitfield

rebase

changed to have else flagged by #if defined(LL_SPI_PROTOCOL_MOTOROLA) && defined(SPI_CR2_FRF)

Codecov Report

Merging #40860 (bb00120) into main (bb00120) will not change coverage.
The diff coverage is n/a.

:exclamation: Current head bb00120 differs from pull request most recent head b6efb3f. Consider uploading reports for the commit b6efb3f to get more accurate results

@@           Coverage Diff           @@
##             main   #40860   +/-   ##
=======================================
  Coverage   51.45%   51.45%
=======================================
  Files         616      616
  Lines       72357    72357
  Branches    16651    16651
=======================================
  Hits        37234    37234
  Misses      29003    29003
  Partials     6120     6120

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bb00120...b6efb3f. Read the comment docs.


Does not work as an npm module

package.json contains:
  "main": "dist/zone-node.js",
  "browser": "dist/zone.js",

which points to a Webpack-compiled files, which are not CommonJS module files and do not export anything.  This is because Webpack-built bundles are reduced to be fully encapsulated vanilla JS files, and not CJS modules.
The effect of this is that require('zone.js') in Node does nothing — returns {} instead of Zone's public symbols. Similarly when require('zone.js') is used in 3rd party's Webpack build, it will end up running Webpack runtime inside Webpack runtime, instead of importing the module.

$ node
require('zone.js')

{}

require('zone.js').Zone
undefined

The main and browser fields must point to CJS modules that do not have Webpack runtime, and have module.exports = … statements instead.

Exactly, similar issue: https://github.com/angular/zone.js/issues/362

javascript require('zone.js'); console.log(Zone ); // => { [Function: Zone] current: [Getter],   currentTask: [Getter],   __symbol__: [Function: __symbol__] }

@AepKill , you are missing the point, we should be able to do var zone = require('zone.js'); like any other package in npm. You don't see lodash being used like this do you?
require('lodash');
console.log(_);

@pornel In node.js, to be able to do var something = require('something');, we need to have something like module.exports = something; in the respective module.
I had a very quick look at the code and I couldn't find anything relevant. I might be missing something but is zone.js designed to be used in node at all?

@nasooz , module bundlers like webpack and browserify can use the require syntax to know what modules to include in the bundle.

@jmlopez-rod, thank you for your response but I obviously need to educate myself further because I have only very little experience with browserify and as a result I don't quite understand what you're saying (entirely my bad). I believed that browserify was used to package npm modules for the browser but your response suggests that there is more to it, if I understand it correctly.
Anyway, do you think you could recommend an article or something to get me started on zone.js with node?

@nasooz , I would suggest to look at some article that uses webpack. Looking around I found this page https://web-design-weekly.com/2014/09/24/diving-webpack/ that has a sample git repo: https://github.com/web-design-weekly/basic-webpack. What you can do is simply try to play around with it and try to include other npm modules in there and see how webpack puts them in the generated file dist/bundle.js. Each file gets assigned a unique id. In this way every time you use require('some_module') webpack replaces the string by something like webpack_require(#) where # is the unique id. I suggest to try it out and play with lodash to see how things should work.

@jmlopez-rod, Thank you very much mate! Much appreciated indeed.

@pornel, I did a little bit of digging and found out that require('zone.js') actually creates a member in the global object called Zone. In other words, code like:
require('zone.js');
Zone.current.fork({ ... }).run(function () { ... });

should work in node.js. It works for me at least.
The way I see it, your attempt require('zone.js').Zone wouldn't work because the module doesn't export a Zone.
On a different note, I still haven't been able to get the hooks working but that's not a critical issue for me at this stage.
Hope this helps.

@nasooz I tried with your code, but it does not work: stackoverflow link


Minor sklearn docs patch

This is a temorary branch to check if the CLA works as expected.

 Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.You have signed the CLA already but the status is still pending? Let us recheck it.

The CLA seems to work. Closing.


Jesse: Watch hondamotopub.com

Jesse requests the watch of the watch_keyword hondamotopub\.com. See the MS search here and the Stack Exchange search in text, in URLs, and in code.

hondamotopub\.com has been seen in 1 true positive, 0 false positives, and 0 NAAs.

Approved by Jeff Schaller in Charcoal HQ


Update README.md

even though the project isn't been doing anything, it would be great for temporary basis that we provide info on how to run for development purposes...

Please comment the main components for a better README.md file, like what should be added and what should be avoided and I will do it


need to keep a record of the ouput stream

I am using  this code for hand and gesture recognition: https://github.com/kinivi/hand-gesture-recognition-mediapipe
I was wondering how to print an output file in csv or excel of the landmarks coordinatess. For now the stream runs live while mediapipe is working.
I would like to print, at the end of each mediapipe session when I stop the code, a csv or excel file of the live stream landmarks with all the coordinates
I have tried to create a clock to stop the mediapipe from running and print an output but it did not work,
Help would be amazing ! thanks !

Hi @schieleines,
You can try the similar implementation as mentioned here #1803 (comment) But you need to update the python implementation for the hands solution.


[zh-cn] resync: some file's commented English texts under docks/tasks

Signed-off-by: Hu Shuai<EMAIL_ADDRESS>

All files in sync. Update makes sense.
/lgtm
/approve


Deprecate old lifecycle syntax

Throws a warning that looks like this:
modal.exception.DeprecationError: 2023-04-20: @stub.function on methods is deprecated. Use the @stub.cls and @method decorators. Usage:

```
@stub.cls(cpu=8)
class MyCls:
    @method()
    def f(self):
        ...
```

There's a slightly more correct implementation that changes this in the backend so that we pass the class name as a part of the Function definition. But this is a bit more work to implement and it gets easier once remove support for deprecate the old syntax. So I'd rather do that first.

This passes all integration tests btw


How to start Xandra as child process?

I am trying to use Xandra for my Phoenix project for which I am connecting to Cassandra like
{:ok, conn} = Xandra.start_link([
nodes: ["localhost:9042"]
])
Every time I am suppose to run a query I need to start_link, Is there a way I can provide all connection details in config file and it runs once the app is started?
Like below
config :xandra, Xandra,
  pool_size: 10,
  nodes: ["localhost:9042"],
  authentication: {Xandra.Authenticator.Password, [username: "", password: ""]}

Thanks

You need to manually read that from the app env.
# in config/config.exs
config :my_app, :my_xandra,
  nodes: ...

# in lib/my_app/application.ex
children = [
  # ...,
  {Xandra, Application.fetch_env!(:my_app, :my_xandra)}
]

Closing this as there's no issue here with Xandra per se. Thanks for the question! 💟


Low resolution titlebar on Retina Macs on 10.10

I just bought a 13" Retina Mac and noticed that GLFW-created windows have a low-resolution titlebar (the window buttons in the top left corner and the window title text). The GLFW_USE_RETINA cmake flag is on, but I think this only affects the GL rendering surface (but on the screenshot it looks like the rendering is also low resolution, the _GLFW_USE_RETINA flag is definitely set though and in the debugger the setWantsBestResolution code path is taken):
#if defined(_GLFW_USE_RETINA)
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
    if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_6)
        [window->ns.view setWantsBestResolutionOpenGLSurface:YES];
#endif /*MAC_OS_X_VERSION_MAX_ALLOWED*/
#endif /*_GLFW_USE_RETINA*/

Since this is an app bundle, I know it's possible to fix this problem by adding:
<key>NSHighResolutionCapable</key>
<true/>

To the app bundle's Info.plist file (located at *.app/Contents/Info.plist path).
In fact, I do not know of any other way except doing that. If you don't include that, the app may or may not get treated as HiDPI-capable, which results in low resolution window decorations, etc.
If someone knows an alternative, feel free to share.

What @shurcooL said.
I will add a better plist template for the next release.

Thanks that worked! It's explained in the lower half of this page: https://developer.apple.com/library/mac/documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/Explained/Explained.html#//apple_ref/doc/uid/TP40012302-CH4-SW10

Was this a change from 10.9 or has it always worked this way? I can't recall anyone mentioning this before 10.10 was released.

If someone will end up here using search. This indeed fixes an issue but if does not for you, try to change application path. It appears that OSX caching plist partially. After I moved app to a /tmp (for testing) the option have applied.
Have fun.

FWIW: SDL can do this programmatically on MacOS, with the SDL_WINDOW_ALLOW_HIGHDPI flag. And it works, you get the window in hidpi mode or in normal mode depending on whether you set that flag or not, no matter if you don't even have a plist.

@cblc Does this not work for you with GLFW_SCALE_FRAMEBUFFER? At a glance, SDL seems to do the same thing.

@cblc Does this not work for you with GLFW_SCALE_FRAMEBUFFER? At a glance, SDL seems to do the same thing.

Oh, I thought that was just related to how resize callbacks behave, not to the actual resolution of the created window...


digitalWeite( led, HIGH ) doesn't work!

I tried the code on my arduino, everything works well but "digitalWrite(led, HIGH)"  has no reply. I also tried digitalRead(pin), the value is LOW all the time. Is there something wrong with Arduino library? I'm using General esp8266 module.

I cannot speak for the esp8266, but on Arduino, as long as the led pin is defined correctly, that is all it should take:
https://www.arduino.cc/en/Tutorial/Blink?from=Tutorial.BlinkingLED
The built in LED pin is different on different devices, so you may have to customize those settings (for instance, it's pin 13 on my device, rather than 6 as this source code defaults to).


Fix #213 (Swipe ticket flow should match design)

resolves #213
Updated design of the "swipe to use ticket" view.
Now is a card that looks like a ticket/coffee card.
Furthermore, added hero animation between the two cards.
Replaced the slider widget.
Now uses a modified version of imtoori/flutter-slide-to-act
(ironed out some kinks and stripped down to meet our needs).
Tidied up

what was wrong with the previous slider? Did it not support all required functionality? Also is the slider not too large compared to the spec?
actual:

expected:

what was wrong with the previous slider? Did it not support all required functionality?

The old slider determined its width based on the device screen size (its width would always be 90% of the screen width). This made the padding different based on what device you are using, see screenshot

The replacement widget uses up all the horizontal space it can use. It's far from perfect, but it serves as a good starting point (specifically, the code to determine the slider's width is really clever IMO).

Also is the slider not too large compared to the spec?

The slider height in the spec was chosen because the height of the swipe card would then be the same height as the ticket/coffeecard card. (the idea was to minimize problems during the hero animation between the two cards).
Obviously, we want to decide the height based on how easy/comfortable it is to hit instead. Flutter doesn't seem to care about the height difference between the two cards while doing the hero animation anyway.

I just checked the height of the slider on a small device and determined it could be less tall on smaller devices. So now it's less tall on small devices, see screenshot

IMO the slider is still way too big. I would expect it to be as slim as the one in Figma, now it is nearly double the height

How about this?

How about this? @fremartini

yes this looks good! :)


New version: ByteDance.Lark version 5.28.11

[X] Have you signed the Contributor License Agreement?
[X] Have you checked that there aren't other open pull requests for the same manifest update/change?

[ ] Have you tested your manifest locally with winget install --manifest <path>?
[X] Does your manifest conform to the 1.4 schema?

Microsoft Reviewers: Open in CodeFlow

/azp run