def import_data_from_uris(
            self,
            source_uris,
            dataset,
            table,
            schema=None,
            job=None,
            source_format=None,
            create_disposition=None,
            write_disposition=None,
            encoding=None,
            ignore_unknown_values=None,
            max_bad_records=None,
            allow_jagged_rows=None,
            allow_quoted_newlines=None,
            field_delimiter=None,
            quote=None,
            skip_leading_rows=None,
    ):
        """
        Imports data into a BigQuery table from cloud storage. Optional
        arguments that are not specified are determined by BigQuery as
        described:
            https://developers.google.com/bigquery/docs/reference/v2/jobs

        Parameters
        ----------
        source_urls : list
            A ``list`` of ``str`` objects representing the urls on cloud
            storage of the form: gs://bucket/filename
        dataset : str
            String id of the dataset
        table : str
            String id of the table
        job : str, optional
            Identifies the job (a unique job id is automatically generated if
            not provided)
        schema : list, optional
            Represents the BigQuery schema
        source_format : str, optional
            One of the JOB_SOURCE_FORMAT_* constants
        create_disposition : str, optional
            One of the JOB_CREATE_* constants
        write_disposition : str, optional
            One of the JOB_WRITE_* constants
        encoding : str, optional
            One of the JOB_ENCODING_* constants
        ignore_unknown_values : bool, optional
            Whether or not to ignore unknown values
        max_bad_records : int, optional
            Maximum number of bad records
        allow_jagged_rows : bool, optional
            For csv only
        allow_quoted_newlines : bool, optional
            For csv only
        field_delimiter : str, optional
            For csv only
        quote : str, optional
            Quote character for csv only
        skip_leading_rows : int, optional
            For csv only

        Returns
        -------
        dict
            A BigQuery job response

        Raises
        ------
        JobInsertException
            on http/auth failures or error in result
        """
        source_uris = source_uris if isinstance(source_uris, list) \
            else [source_uris]

        configuration = {
            "destinationTable": {
                "projectId": self.project_id,
                "tableId": table,
                "datasetId": dataset
            },
            "sourceUris": source_uris,
        }

        if max_bad_records:
            configuration['maxBadRecords'] = max_bad_records

        if ignore_unknown_values:
            configuration['ignoreUnknownValues'] = ignore_unknown_values

        if create_disposition:
            configuration['createDisposition'] = create_disposition

        if write_disposition:
            configuration['writeDisposition'] = write_disposition

        if encoding:
            configuration['encoding'] = encoding

        if schema:
            configuration['schema'] = {'fields': schema}

        if source_format:
            configuration['sourceFormat'] = source_format

        if not job:
            hex = self._generate_hex_for_uris(source_uris)
            job = "{dataset}-{table}-{digest}".format(
                dataset=dataset,
                table=table,
                digest=hex
            )

        if source_format == JOB_SOURCE_FORMAT_CSV:
            if field_delimiter:
                configuration['fieldDelimiter'] = field_delimiter

            if allow_jagged_rows:
                configuration['allowJaggedRows'] = allow_jagged_rows

            if allow_quoted_newlines:
                configuration['allowQuotedNewlines'] = allow_quoted_newlines

            if quote:
                configuration['quote'] = quote

            if skip_leading_rows:
                configuration['skipLeadingRows'] = skip_leading_rows

        elif field_delimiter or allow_jagged_rows \
                or allow_quoted_newlines or quote or skip_leading_rows:
            all_values = dict(field_delimiter=field_delimiter,
                              allow_jagged_rows=allow_jagged_rows,
                              allow_quoted_newlines=allow_quoted_newlines,
                              skip_leading_rows=skip_leading_rows,
                              quote=quote)
            non_null_values = dict((k, v) for k, v
                                   in list(all_values.items())
                                   if v)
            raise Exception("Parameters field_delimiter, allow_jagged_rows, "
                            "allow_quoted_newlines, quote and "
                            "skip_leading_rows are only allowed when "
                            "source_format=JOB_SOURCE_FORMAT_CSV: %s"
                            % non_null_values)

        body = {
            "configuration": {
                'load': configuration
            },
            "jobReference": {
                "projectId": self.project_id,
                "jobId": job
            }
        }

        logger.debug("Creating load job %s" % body)
        job_resource = self._insert_job(body)
        self._raise_insert_exception_if_error(job_resource)
        return job_resource
dataset/ETHPy150Open tylertreat/BigQuery-Python/bigquery/client.py/BigQueryClient.import_data_from_uris/original