def strip_name(name):
    if not any([s in name for s in "(,),-,_".split(',')]):
        return name

    paren_regex = re.compile("(.*?)\s*\(")
    dash_regex = re.compile("(.*?)\s*\-")
    under_dash_regex = re.compile("(.*?)\s*\_")

    r1 = paren_regex.match(name)
    r2 = dash_regex.match(name)
    r3 = under_dash_regex.match(name)
    shortest = 'AVeryLongStringForDefualt'
    for r in [r1, r2, r3]:
        if r and len(r.group(1)) < len(shortest):
            shortest = r.group(1)

    return shortest
Requests that a job be cancelled. This call will return immediately, and the client will need to poll for the job status to see if the cancel completed successfully. Cancelled jobs may still incur costs.
dataset/ETHPy150Open openstack/compass-core/compass/actions/health_check/utils.py/strip_name--crossover with--dataset/ETHPy150Open GoogleCloudPlatform/DataflowPythonSDK/google/cloud/dataflow/internal/clients/bigquery/bigquery_v2_client.py/BigqueryV2.JobsService.Cancel