<commit_before>import { Repository } from '../core/repository';
import { PostingPhotoOptions } from '../types/posting.photo.options';
import sizeOf = require('image-size');
import { MediaConfigureOptions } from '../types/media.configure.options';
export class PublishService extends Repository {
  /**
   * Uploads a single photo to the timeline-feed
   * @param options - the options, containing caption and image-data
   */
  public async photo(options: PostingPhotoOptions) {
    const uploadedPhoto = await this.client.upload.photo({
      file: options.file,
    });
    const imageSize = await sizeOf(options.file);
    const configureOptions: MediaConfigureOptions = {
      upload_id: uploadedPhoto.upload_id,
      width: imageSize.width,
      height: imageSize.height,
      caption: options.caption,
    };
    if (options.usertags !== null) {
      configureOptions.usertags = options.usertags;
    }
    if (options.location !== null) {
      const { lat, lng, external_id_source, external_id, name, address } = options.location;
      configureOptions.location = {
        name,
        lat,<commit_msg>fixed my own bug<commit_after>import { Repository } from '../core/repository';
import { PostingPhotoOptions } from '../types/posting.photo.options';
import sizeOf = require('image-size');
import { MediaConfigureOptions } from '../types/media.configure.options';
export class PublishService extends Repository {
  /**
   * Uploads a single photo to the timeline-feed
   * @param options - the options, containing caption and image-data
   */
  public async photo(options: PostingPhotoOptions) {
    const uploadedPhoto = await this.client.upload.photo({
      file: options.file,
    });
    const imageSize = await sizeOf(options.file);
    const configureOptions: MediaConfigureOptions = {
      upload_id: uploadedPhoto.upload_id,
      width: imageSize.width,
      height: imageSize.height,
      caption: options.caption,
    };
    if (options.usertags !== undefined) {
      configureOptions.usertags = options.usertags;
    }
    if (options.location !== undefined) {
      const { lat, lng, external_id_source, external_id, name, address } = options.location;
      configureOptions.location = {
        name,
        lat,
{'fraction_non_alphanumeric': 0.11204979991107158, 'fraction_numerical': 0.0, 'mean_word_length': 3.377431906614786, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2467635', 'n_tokens_mistral': 626, 'n_tokens_neox': 617, 'n_words': 160}