text:
import {ChangeDetectorRef, Directive, EventEmitter, forwardRef, Host, inject, Inject, Input, OnChanges, OnDestroy, Optional, Output, Self, SimpleChanges, ɵcoerceToBoolean as coerceToBoolean} from '@angular/core';

import {FormHooks} from '../model/abstract_model';
import {FormControl} from '../model/form_control';
import {NG_ASYNC_VALIDATORS, NG_VALIDATORS} from '../validators';

import {AbstractFormGroupDirective} from './abstract_form_group_directive';
import {ControlContainer} from './control_container';
import {ControlValueAccessor, NG_VALUE_ACCESSOR} from './control_value_accessor';
import {NgControl} from './ng_control';
import {NgForm} from './ng_form';
import {NgModelGroup} from './ng_model_group';
import {CALL_SET_DISABLED_STATE, controlPath, isPropertyUpdated, selectValueAccessor, SetDisabledStateOption, setUpControl} from './shared';
import {formGroupNameException, missingNameException, modelParentException} from './template_driven_errors';
import {AsyncValidator, AsyncValidatorFn, Validator, ValidatorFn} from './validators';

export const formControlBinding: any = {
  provide: NgControl,
  useExisting: forwardRef(() => NgModel)
};

/**
 * `ngModel` forces an additional change detection run when its inputs change:
 * E.g.:
 * ```
 * <div>{{myModel.valid}}</div>
 * <input [(ngModel)]="myValue" #myModel="ngModel">
 * ```
 * I.e. `ngModel` can export itself on the element and then be used in the template.
 * Normally, this would result in expressions before the `input` that use the exported directive
 * to have an old value as they have been
 * dirty checked before. As this is a very common case for `ngModel`, we added this second change
 * detection run.
 *
 * Notes:
 * - this is just one extra run no matter how many `ngModel`s have been changed.
 * - this is a general problem when using `exportAs` for directives!
 */
const resolvedPromise = (() => Promise.resolve())();

/**
 * @description
 * Creates a `FormControl` instance from a domain model and binds it
 * to a form control element.
 *
 * The `FormControl` instance tracks the value, user interaction, and
 * validation status of the control and keeps the view synced with the model. If used
 * within a parent form, the directive also registers itself with the form as a child
 * control.
 *
 * This directive is used by itself or as part of a larger form. Use the
 * `ngModel` selector to activate it.
 *
 * It accepts a domain model as an optional `Input`. If you have a one-way binding
 * to `ngModel` with `[]` syntax, changing the domain model's value in the component
 * class sets the value in the view. If you have a two-way binding with `[()]` syntax
 * (also known as 'banana-in-a-box syntax'), the value in the UI always syncs back to
 * the domain model in your class.
 *
 * To inspect the properties of the associated `FormControl` (like the validity state),
 * export the directive into a local template variable using `ngModel` as the key (ex:
 * `#myVar="ngModel"`). You can then access the control using the directive's `control` property.
 * However, the most commonly used properties (like `valid` and `dirty`) also exist on the control
 * for direct access. See a full list of properties directly available in
 * `AbstractControlDirective`.
 *
 * @see `RadioControlValueAccessor`
 * @see `SelectControlValueAccessor`
 *
 * @usageNotes
 *
 * ### Using ngModel on a standalone control
 *
 * The following examples show a simple standalone control using `ngModel`:
 *
 * {@example forms/ts/simpleNgModel/simple_ng_model_example.ts region='Component'}
 *
 * When using the `ngModel` within `<form>` tags, you'll also need to supply a `name` attribute
 * so that the control can be registered with the parent form under that name.
 *
 * In the context of a parent form, it's often unnecessary to include one-way or two-way binding,
 * as the parent form syncs the value for you. You access its properties by exporting it into a
 * local template variable using `ngForm` such as (`#f="ngForm"`). Use the variable where
 * needed on form submission.
 *
 * If you do need to populate initial values into your form, using a one-way binding for
 * `ngModel` tends to be sufficient as long as you use the exported form's value rather
 * than the domain model's value on submit.
 *
 * ### Using ngModel within a form
 *
 * The following example shows controls using `ngModel` within a form:
 *
 * {@example forms/ts/simpleForm/simple_form_example.ts region='Component'}
 *
 * ### Using a standalone ngModel within a group
 *
 * The following example shows you how to use a standalone ngModel control
 * within a form. This controls the display of the form, but doesn't contain form data.
 *
 * ```html
 * <form>
 *   <input name="login" ngModel placeholder="Login">
 *   <input type="checkbox" ngModel [ngModelOptions]="{standalone: true}"> Show more options?
 * </form>
 * <!-- form value: {login: ''} -->
 * ```
 *
 * ### Setting the ngModel `name` attribute through options
 *
 * The following example shows you an alternate way to set the name attribute. Here,
 * an attribute identified as name is used within a custom form control component. To still be able
 * to specify the NgModel's name, you must specify it using the `ngModelOptions` input instead.
 *
 * ```html
 * <form>
 *   <my-custom-form-control name="Nancy" ngModel [ngModelOptions]="{name: 'user'}">
 *   </my-custom-form-control>
 * </form>
 * <!-- form value: {user: ''} -->
 * ```
 *
 * @ngModule FormsModule
 * @publicApi
 */
@Directive({
  selector: '[ngModel]:not([formControlName]):not([formControl])',
  providers: [formControlBinding],
  exportAs: 'ngModel'
})
export class NgModel extends NgControl implements OnChanges, OnDestroy {
  public override readonly control: FormControl = new FormControl();

  // At runtime we coerce arbitrary values assigned to the "disabled" input to a "boolean".
  // This is not reflected in the type of the property because outside of templates, consumers
  // should only deal with booleans. In templates, a string is allowed for convenience and to
  // match the native "disabled attribute" semantics which can be observed on input elements.
  // This static member tells the compiler that values of type "string" can also be assigned
  // to the input in a template.
  /** @nodoc */
  static ngAcceptInputType_isDisabled: boolean|string;

  /** @internal */
  _registered = false;

  /**
   * Internal reference to the view model value.
   * @nodoc
   */
  viewModel: any;

  /**
   * @description
   * Tracks the name bound to the directive. If a parent form exists, it
   * uses this name as a key to retrieve this control's value.
   */
  // TODO(issue/24571): remove '!'.
  @Input() override name!: string;

  /**
   * @description
   * Tracks whether the control is disabled.
   */
  // TODO(issue/24571): remove '!'.
  @Input('disabled') isDisabled!: boolean;

  /**
   * @description
   * Tracks the value bound to this directive.
   */
  @Input('ngModel') model: any;

  /**
   * @description
   * Tracks the configuration options for this `ngModel` instance.
   *
   * **name**: An alternative to setting the name attribute on the form control element. See
   * the [example](api/forms/NgModel#using-ngmodel-on-a-standalone-control) for using `NgModel`
   * as a standalone control.
   *
   * **standalone**: When set to true, the `ngModel` will not register itself with its parent form,
   * and acts as if it's not in the form. Defaults to false. If no parent form exists, this option
   * has no effect.
   *
   * **updateOn**: Defines the event upon which the form control value and validity update.
   * Defaults to 'change'. Possible values: `'change'` | `'blur'` | `'submit'`.
   *
   */
  // TODO(issue/24571): remove '!'.
  @Input('ngModelOptions') options!: {name?: string, standalone?: boolean, updateOn?: FormHooks};

  /**
   * @description
   * Event emitter for producing the `ngModelChange` event after
   * the view model updates.
   */
  @Output('ngModelChange') update = new EventEmitter();

  constructor(
      @Optional() @Host() parent: ControlContainer,
      @Optional() @Self() @Inject(NG_VALIDATORS) validators: (Validator|ValidatorFn)[],
      @Optional() @Self() @Inject(NG_ASYNC_VALIDATORS) asyncValidators:
          (AsyncValidator|AsyncValidatorFn)[],
      @Optional() @Self() @Inject(NG_VALUE_ACCESSOR) valueAccessors: ControlValueAccessor[],
      @Optional() @Inject(ChangeDetectorRef) private _changeDetectorRef?: ChangeDetectorRef|null,
      @Optional() @Inject(CALL_SET_DISABLED_STATE) private callSetDisabledState?:
          SetDisabledStateOption) {
    super();
    this._parent = parent;
    this._setValidators(validators);
    this._setAsyncValidators(asyncValidators);
    this.valueAccessor = selectValueAccessor(this, valueAccessors);
  }

  /** @nodoc */
  ngOnChanges(changes: SimpleChanges) {
    this._checkForErrors();
    if (!this._registered || 'name' in changes) {
      if (this._registered) {
        this._checkName();
        if (this.formDirective) {
          // We can't call `formDirective.removeControl(this)`, because the `name` has already been
          // changed. We also can't reset the name temporarily since the logic in `removeControl`
          // is inside a promise and it won't run immediately. We work around it by giving it an
          // object with the same shape instead.
          const oldName = changes['name'].previousValue;
          this.formDirective.removeControl({name: oldName, path: this._getPath(oldName)});
        }
      }
      this._setUpControl();
    }
    if ('isDisabled' in changes) {
      this._updateDisabled(changes);
    }

    if (isPropertyUpdated(changes, this.viewModel)) {
      this._updateValue(this.model);
      this.viewModel = this.model;
    }
  }

  /** @nodoc */
  ngOnDestroy(): void {
    this.formDirective && this.formDirective.removeControl(this);
  }

  /**
   * @description
   * Returns an array that represents the path from the top-level form to this control.
   * Each index is the string name of the control on that level.
   */
  override get path(): string[] {
    return this._getPath(this.name);
  }

  /**
   * @description
   * The top-level directive for this control if present, otherwise null.
   */
  get formDirective(): any {
    return this._parent ? this._parent.formDirective : null;
  }

  /**
   * @description
   * Sets the new value for the view model and emits an `ngModelChange` event.
   *
   * @param newValue The new value emitted by `ngModelChange`.
   */
  override viewToModelUpdate(newValue: any): void {
    this.viewModel = newValue;
    this.update.emit(newValue);
  }

  private _setUpControl(): void {
    this._setUpdateStrategy();
    this._isStandalone() ? this._setUpStandalone() : this.formDirective.addControl(this);
    this._registered = true;
  }

  private _setUpdateStrategy(): void {
    if (this.options && this.options.updateOn != null) {
      this.control._updateOn = this.options.updateOn;
    }
  }

  private _isStandalone(): boolean {
    return !this._parent || !!(this.options && this.options.standalone);
  }

  private _setUpStandalone(): void {
    setUpControl(this.control, this, this.callSetDisabledState);
    this.control.updateValueAndValidity({emitEvent: false});
  }

  private _checkForErrors(): void {
    if (!this._isStandalone()) {
      this._checkParentType();
    }
    this._checkName();
  }

  private _checkParentType(): void {
    if (typeof ngDevMode === 'undefined' || ngDevMode) {
      if (!(this._parent instanceof NgModelGroup) &&
          this._parent instanceof AbstractFormGroupDirective) {
        throw formGroupNameException();
      } else if (!(this._parent instanceof NgModelGroup) && !(this._parent instanceof NgForm)) {
        throw modelParentException();
      }
    }
  }

  private _checkName(): void {
    if (this.options && this.options.name) this.name = this.options.name;

    if (!this._isStandalone() && !this.name && (typeof ngDevMode === 'undefined' || ngDevMode)) {
      throw missingNameException();
    }
  }

  private _updateValue(value: any): void {
    resolvedPromise.then(() => {
      this.control.setValue(value, {emitViewToModelChange: false});
      this._changeDetectorRef?.markForCheck();
    });
  }

  private _updateDisabled(changes: SimpleChanges) {
    const disabledValue = changes['isDisabled'].currentValue;
    // checking for 0 to avoid breaking change
    const isDisabled = disabledValue !== 0 && coerceToBoolean(disabledValue);

    resolvedPromise.then(() => {
      if (isDisabled && !this.control.disabled) {
        this.control.disable();
      } else if (!isDisabled && this.control.disabled) {
        this.control.enable();
      }

      this._changeDetectorRef?.markForCheck();
    });
  }

  private _getPath(controlName: string): string[] {
    return this._parent ? controlPath(controlName, this._parent) : [controlName];
  }
}


text:
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.42000
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace Qwack.Utils.Exceptions {
    using System;
    using System.Reflection;

    /// <summary>
    ///    A strongly-typed resource class, for looking up localized strings, etc.
    /// </summary>
    // This class was auto-generated by the StronglyTypedResourceBuilder
    // class via a tool like ResGen or Visual Studio.
    // To add or remove a member, edit your .ResX file then rerun ResGen
    // with the /str option, or rebuild your VS project.
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    public class SR {

        private static global::System.Resources.ResourceManager resourceMan;

        private static global::System.Globalization.CultureInfo resourceCulture;

        internal SR() {
        }

        /// <summary>
        ///    Returns the cached ResourceManager instance used by this class.
        /// </summary>
        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
        public static global::System.Resources.ResourceManager ResourceManager {
            get {
                if (object.ReferenceEquals(resourceMan, null)) {
                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Qwack.Utils.Exceptions.SR", typeof(SR).GetTypeInfo().Assembly);
                    resourceMan = temp;
                }
                return resourceMan;
            }
        }

        /// <summary>
        ///    Overrides the current thread's CurrentUICulture property for all
        ///    resource lookups using this strongly typed resource class.
        /// </summary>
        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
        public static global::System.Globalization.CultureInfo Culture {
            get {
                return resourceCulture;
            }
            set {
                resourceCulture = value;
            }
        }

        /// <summary>
        ///    Looks up a localized string similar to A file that was loaded had invalid structure or data.
        /// </summary>
        public static string InvalidFileInput {
            get {
                return ResourceManager.GetString("InvalidFileInput", resourceCulture);
            }
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
require 'rails_helper'

RSpec.describe "tasks/show", type: :view do
  it "renders attributes in <p>" do
    render
    expect(rendered).to match(/Name/)
    expect(rendered).to match(/MyText/)
    expect(rendered).to match(/2/)
    expect(rendered).to match(//)
    expect(rendered).to match(//)
  end
end


text:
package fr.openwide.core.basicapp.core.business.authority;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.google.common.collect.ImmutableList;

import fr.openwide.core.jpa.security.business.authority.model.Authority;
import fr.openwide.core.jpa.security.business.authority.service.IAuthorityService;
import fr.openwide.core.jpa.security.business.authority.util.CoreAuthorityConstants;

@Component("basicApplicationAuthorityUtils")
public class BasicApplicationAuthorityUtils {

	public static final List<String> PUBLIC_AUTHORITIES = ImmutableList.of(
			CoreAuthorityConstants.ROLE_AUTHENTICATED,
			CoreAuthorityConstants.ROLE_ADMIN);

	@Autowired
	private IAuthorityService authorityService;

	public List<Authority> getPublicAuthorities() {
		List<Authority> publicAuthorities = new ArrayList<Authority>();

		for (String authorityName : PUBLIC_AUTHORITIES) {
			Authority authority = authorityService.getByName(authorityName);
			if (authority != null) {
				publicAuthorities.add(authority);
			}
		}

		return publicAuthorities;
	}
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace TwitterExtractor.App.Models.DomainModel.Communication
{
    public class Url
    {
        public int Id { get; set; }
        public string Descricao { get; set; }

        public virtual ICollection<UrlEmbedded> Urls { get; set; }
    }
}


text:
void SyncMessageReplyDispatcher::Push(IPC::SyncMessage* msg,
                                      SyncMessageCallContext* context,
                                      void* key) {
  if (context) {
    context->message_type_ = msg->type();
    context->id_ = IPC::SyncMessage::GetMessageId(*msg);
    context->key_ = key;

    base::AutoLock lock(message_queue_lock_);
    message_queue_.push_back(context);
  }
}

bool SyncMessageReplyDispatcher::HandleMessageType(
    const IPC::Message& msg, SyncMessageCallContext* context) {
  return false;
}

bool SyncMessageReplyDispatcher::OnMessageReceived(const IPC::Message& msg) {
  SyncMessageCallContext* context = GetContext(msg);
  // No context e.g. no return values and/or don't care
  if (!context) {
    return false;
  }

  return HandleMessageType(msg, context);
}

void SyncMessageReplyDispatcher::Cancel(void* key) {
  DCHECK(key != NULL);
  base::AutoLock lock(message_queue_lock_);
  PendingSyncMessageQueue::iterator it = message_queue_.begin();
  while (it != message_queue_.end()) {
    SyncMessageCallContext* context = *it;
    if (context->key_ == key) {
      it = message_queue_.erase(it);
      delete context;
    } else {
      ++it;
    }
  }
}

SyncMessageReplyDispatcher::SyncMessageCallContext*
    SyncMessageReplyDispatcher::GetContext(const IPC::Message& msg) {
  if (!msg.is_reply())
    return NULL;

  int id = IPC::SyncMessage::GetMessageId(msg);
  base::AutoLock lock(message_queue_lock_);
  PendingSyncMessageQueue::iterator it;
  for (it = message_queue_.begin(); it != message_queue_.end(); ++it) {
    SyncMessageCallContext* context = *it;
    if (context->id_ == id) {
      message_queue_.erase(it);
      return context;
    }
  }
  return NULL;
}


text:
FactoryGirl.define do
  factory :forum do
    group nil
    name "MyString"
    slug "MyString"
    description "MyText"
    position 1
  end
end


text:
{% extends "base.html" %}

{% block title %}{{ SITENAME }} - Categories{% endblock %}

{% block content %}
{% block breadcrumb %}

Home

        Category

{% endblock %}

    {% for category, articles in categories %}

        {{ category }} ({{ articles|count }})

    {% endfor %}

{% endblock %}


text:
class SessionsController < Devise::SessionsController
  layout "memberships"
end


text:
import logging
import os
import vcr
from hypothesis import given
from hypothesis.strategies import lists, sampled_from, text, \
    tuples

from contentpacks.khanacademy import _get_video_ids, \
    retrieve_html_exercises, \
    retrieve_kalite_data, retrieve_translations, retrieve_subtitles, apply_dubbed_video_map, \
    retrieve_all_assessment_item_data, retrieve_assessment_item_data, \
    clean_assessment_item, localize_image_urls, localize_content_links, prune_assessment_items
from contentpacks.models import AssessmentItem
from contentpacks.utils import NODE_FIELDS_TO_TRANSLATE, translate_nodes, Catalog, NodeType

logging.basicConfig()
logging.getLogger("vcr").setLevel(logging.DEBUG)

class Test_apply_dubbed_video_map:

    def test_apply_dubbed(self):
        input_id = "y2-uaPiyoxc"
        test_content = [
            {"youtube_id": input_id, "kind": "Video", "translated_youtube_lang": "de"},
            {"youtube_id": input_id, "kind": "Video", "translated_youtube_lang": "es"}
        ]

        test_list, test_count = apply_dubbed_video_map(test_content, [], "de")
        assert test_list
        assert isinstance(test_list, list)
        assert test_list[0]["youtube_id"] == input_id
        assert test_count == 1

class Test_retrieve_subtitles:
    @vcr.use_cassette()
    def test_incorrect_youtube_id(self):
        incorrect_list = ["aaa"]
        empty_dict = retrieve_subtitles(incorrect_list, force=True)
        assert not empty_dict
        assert isinstance(empty_dict, dict)

    @vcr.use_cassette()
    def test_correct_youtube_id(self):
        correct_list = ["y2-uaPiyoxc"]
        filled_dict = retrieve_subtitles(correct_list, force=True)
        assert filled_dict
        assert isinstance(filled_dict, dict)

    @vcr.use_cassette()
    def test_correct_and_incorrect_youtube_id(self):
        mixed_list = ["y2-uaPiyoxc", "asdadsafa"]
        filled_dict = retrieve_subtitles(mixed_list, force=True)
        test_id = "y2-uaPiyoxc"
        assert filled_dict
        assert isinstance(filled_dict, dict)
        for id, path in filled_dict.items():
            assert id == test_id
            assert os.path.exists(path)

    @vcr.use_cassette()
    def test_directory_made(self):
        correct_list = ["y2-uaPiyoxc"]
        youtube_id = correct_list[0]
        file_suffix = '.vtt'
        retrieve_subtitles(correct_list, force=True)
        path = os.getcwd() + "/build/subtitles/en/" + youtube_id + file_suffix
        assert os.path.exists(path)

    @vcr.use_cassette()
    def test_correct_youtube_id_and_incorrect_langpack(self):
        correct_list = ["y2-uaPiyoxc"]
        empty_dict = retrieve_subtitles(correct_list, "falselang", force=True)
        assert not empty_dict
        assert isinstance(empty_dict, dict)

class Test_retrieve_translations:

    # Note, the CrowdIn request below has been cached by vcr, avoiding
    # the need for the crowdin key. If you do delete the file below,
    # then you need the key in your environment to successfully make
    # the request.
    @vcr.use_cassette("tests/fixtures/cassettes/crowdin/kalite/es.zip.yml")
    def test_returns_list_of_po_files(self):
        project_id = "ka-lite"
        project_key = "dummy"
        catalog = retrieve_translations(project_id, project_key)

        assert isinstance(catalog, Catalog)

class Test__get_video_ids:

    @given(lists(tuples(text(min_size=1), sampled_from(["Exercise", "Video", "Topic"]))))
    def test_given_list_returns_only_videos(self, contents):
        contents = [{"kind": kind, "id": content_id} for content_id, kind in contents]
        video_count = len([node for node in contents if node.get("kind") == "Video"])

        assert len(_get_video_ids(contents)) == video_count

    @vcr.use_cassette("tests/fixtures/cassettes/kalite/node_data.json.yml")
    def test_returns_something_in_production_json(self):
        """
        Since we know that test_given_list_returns_only_videos works, then
        we only need to check that we return something for the actual contents.json
        to make sure we're reading the right attributes.
        """
        data = retrieve_kalite_data()

        assert _get_video_ids(data)

class Test_retrieve_kalite_data:

    @vcr.use_cassette("tests/fixtures/cassettes/kalite/node_data.json.yml")
    def test_returns_dict(self):
        data = retrieve_kalite_data(force=True)
        assert isinstance(data, list)

    @vcr.use_cassette("tests/fixtures/cassettes/kalite/node_data.json.yml")
    def test_no_repeated_sort(self):
        """
        Check that the sort_order keys across the entire topic tree have no repetition.
        This means that we can use sort_order both locally and globally to sort nodes.
        """
        data = retrieve_kalite_data(force=True)
        sorts = set([node.get("sort_order") for node in data])
        assert len(data) == len(sorts)

class Test_retrieve_assessment_item_data:

    def setup(self):

        with vcr.use_cassette("tests/fixtures/cassettes/kalite/node_data.json.yml"):
            node_data = retrieve_kalite_data()
            self.assess_node = next(node for node in node_data if node.get("all_assessment_items"))
            self.assessment_item = self.assess_node.get("all_assessment_items")[0].get("id")

    def test_clean_assessment_item(self):
        data = {
            "test": "no",
            "item_data": "yes!",
            "id": "100001",
            "author_names": "author, author!",
            "shouldn'tbehere": 'nothere',
        }
        data = clean_assessment_item(data)

        assert all(a == b for a, b in zip(sorted(data.keys()), sorted(AssessmentItem._meta.get_field_names())))

    def test_retrieve_assessment_item_return_dict(self):
        with vcr.use_cassette("tests/fixtures/cassettes/kalite/assessment_item_data.json.yml", record_mode="all"):
            data, paths = retrieve_assessment_item_data(self.assessment_item)
        assert isinstance(data, dict), "Item data is not of kind dict"

    def test_retrieve_assessment_item_return_list(self):
        with vcr.use_cassette("tests/fixtures/cassettes/kalite/assessment_item_data.json.yml", record_mode="all"):
            data, paths = retrieve_assessment_item_data(self.assessment_item)
        assert isinstance(paths, list), "Paths are not returned as a list"

    def test_retrieve_assessment_item_files_exist(self):
        with vcr.use_cassette("tests/fixtures/cassettes/kalite/assessment_item_data.json.yml", record_mode="all"):
            data, paths = retrieve_assessment_item_data(self.assessment_item)
        for path in paths:
            assert isinstance(path, str), "Path is not of type str"
            assert os.path.exists(path), "Downloaded file does not exist"

    def test_retrieve_all_assessment_item_return_list_of_dicts(self):
        with vcr.use_cassette("tests/fixtures/cassettes/kalite/assessment_item_data.json.yml", record_mode="all"):
            data, paths = retrieve_all_assessment_item_data(node_data=[self.assess_node])
        for datum in data:
            assert isinstance(datum, dict), "Data is not of type dict"

    def test_retrieve_all_assessment_item_return_list_of_str(self):
        with vcr.use_cassette("tests/fixtures/cassettes/kalite/assessment_item_data.json.yml", record_mode="all"):
            data, paths = retrieve_all_assessment_item_data(node_data=[self.assess_node])
        for path in paths:
            assert isinstance(path, str), "Path is not of type str"

    def test_image_url_converted(self):
        url_string = "A string with http://example.com/cat_pics.gif"
        expected_string = "A string with /content/assessment/khan/cat/cat_pics.gif"
        assert expected_string == localize_image_urls({"item_data": url_string})["item_data"]

    def test_multiple_image_urls_in_one_string_converted(self):
        url_string = "A string with http://example.com/cat_pics.JPEG http://example.com/cat_pics2.gif"
        expected_string = "A string with /content/assessment/khan/cat/cat_pics.JPEG /content/assessment/khan/cat/cat_pics2.gif"
        assert expected_string == localize_image_urls({"item_data": url_string})["item_data"]

    def test_content_link_converted(self):
        link_string = "(and so that is the correct answer).**\\n\\n[Watch this video to review](https://www.khanacademy.org/humanities/history/ancient-medieval/Ancient/v/standard-of-ur-c-2600-2400-b-c-e)"
        expected_string = "(and so that is the correct answer).**\\n\\n[Watch this video to review](/learn/khan/test-prep/ap-art-history/ancient-mediterranean-AP/ancient-near-east-a/standard-of-ur-c-2600-2400-b-c-e/)"
        assert expected_string  == localize_content_links({"item_data": link_string})["item_data"]

    def test_bad_content_link_removed(self):
        link_string = "Wrong!\n\n**[Watch video to review](https://www.khanacademy.org/humanities/art-history/v/the-penguin-king-has-risen)**\n\nThat's a wrap!"
        expected_string = "Wrong!\n\n\n\nThat's a wrap!"
        assert expected_string  == localize_content_links({"item_data": link_string})["item_data"]

    def test_remove_non_live_assessment_items(self):
        test_data = [{"uses_assessment_items": True, "all_assessment_items": [{"live": False}, {"live": True}]}]
        out_data = prune_assessment_items(test_data)
        assert len(out_data) == 1, "prune_assessment_items does not return single node"
        assert len(out_data[0].get("all_assessment_items")) == 1, "all_assessment_items wrong length"

    def test_remove_non_live_assessment_item_exercise(self):
        test_data = [{"uses_assessment_items": True, "all_assessment_items": [{"live": False}]}]
        out_data = prune_assessment_items(test_data)
        assert len(out_data) == 0, "prune_assessment_items returns exercise with no assessment items"

    def test_not_remove_non_assessment_item_nodes(self):
        test_data = [{"uses_assessment_items": False}]
        out_data = prune_assessment_items(test_data)
        assert len(out_data) == 1, "prune_assessment_items filters non-asessment item nodes"

@vcr.use_cassette("tests/fixtures/cassettes/kalite/node_data.json.yml")
def _get_all_video_ids():
    """
    Test utility function so we only need to generate the list of video
    ids once, and then assign that to an instance variable. We
    wrap it as a function instead of assigning the value of
    retrieve_kalite_content_data directly so we can use the
    cassette system to cache the results, avoiding an expensive
    http request.

    """
    content_data = retrieve_kalite_data()

    ids = _get_video_ids(content_data)

    # return a tuple, to make sure it gets never modified.
    ids_tuple = tuple(ids)

    # just take the first 10 ids -- don't run too many
    return ids_tuple[:10]

class Test_translating_kalite_data:

    @classmethod
    @vcr.use_cassette("tests/fixtures/cassettes/translate_exercises.yml", filter_query_parameters=["key"])
    def setup_class(cls):
        cls.ka_catalog = retrieve_translations("khanacademy", "dummy", lang_code="es-ES", includes="*learn.*.po")

    @vcr.use_cassette("tests/fixtures/cassettes/translate_topics.yml")
    def test_translate_nodes(self):
        node_data = retrieve_kalite_data()
        translated_node_data = translate_nodes(
            node_data,
            self.ka_catalog,
        )

        for translated_node, untranslated_node in zip(translated_node_data,
                                                    node_data):
            for field in NODE_FIELDS_TO_TRANSLATE:
                untranslated_fieldval = untranslated_node.get(field)
                translated_fieldval = translated_node.get(field)

                assert (translated_fieldval ==
                        self.ka_catalog.get(
                            untranslated_fieldval,
                            untranslated_fieldval)
                )

class Test_retrieve_html_exercises:

    @vcr.use_cassette("tests/fixtures/cassettes/test_retrieve_html_exercises_setup.yml")
    def setup(self):
        self.exercise_data = retrieve_kalite_data()
        self.khan_exercises = [e.get("id") for e in self.exercise_data if not e.get("uses_assessment_items")\
                               and e.get("kind") == "Exercise"]
        self.khan_exercises.sort()

    @vcr.use_cassette("tests/fixtures/cassettes/test_retrieve_html_exercises.yml")
    def test_creates_folder_with_contents(self):
        exercises = sorted(self.khan_exercises)[:5]  # use only first five for fast testing
        exercise_path, retrieved_exercises = retrieve_html_exercises(exercises, lang="es")

        assert retrieved_exercises  # not empty
        assert set(retrieved_exercises).issubset(self.khan_exercises)
        assert os.path.exists(exercise_path)

    @vcr.use_cassette("tests/fixtures/cassettes/test_retrieve_html_exercises_2.yml")
    def test_doesnt_return_exercises_without_translation(self):
        # The expected behaviour from KA's API is that it would return
        # the english version of an exercise if either a translated
        # exercise for the given language doesn't exist, or the
        # language is unsupported.
        exercise = self.khan_exercises[0]
        lang = "aaa"            # there's no language with code aaa... I hope?

        path, retrieved_exercises = retrieve_html_exercises([exercise], lang, force=True)

        assert not retrieved_exercises

    @vcr.use_cassette("tests/fixtures/cassettes/test_retrieve_html_exercises_3.yml")
    def test_returns_exercise_with_translation(self):
        # espanol has almost complete
        # translation. Assuming this specific
        # exercise has one
        lang = "es"
        exercise = self.khan_exercises[0]

        path, retrieved_exercises = retrieve_html_exercises([exercise], lang, force=True)

        assert retrieved_exercises == [exercise]


text:
/**
 * 2017-9-26 Jifeng Cheng
 */

'use strict';

module.exports = app => {
  class StartController extends app.Controller {
    * add() {
      this.ctx.body = yield this.service.worker.add(this.ctx.request.body);
    }
    * delete() {
      this.ctx.body = yield this.service.worker.delete(this.ctx.request.body);
    }
    * select() {
      this.ctx.body = yield this.service.worker.select(this.ctx.request.body);
    }
    * update() {
      this.ctx.body = yield this.service.worker.update(this.ctx.request.body);
    }
    * update1() {
      this.ctx.body = yield this.service.worker.update1s(this.ctx.request.body);
    }
  }
  return StartController;
};


text:
package lib

import (
	"fmt"
	"io/ioutil"
	"os"
	"strings"

	oss "github.com/aliyun/aliyun-oss-go-sdk/oss"
	. "gopkg.in/check.v1"
)

func (s *OssutilCommandSuite) TestAllPartSize(c *C) {
	// create bucket
	bucketName := bucketNamePrefix + randLowStr(12)
	s.putBucket(bucketName, c)

	// object name
	objectName := "test-ossutil-object-" + randLowStr(10)

	// create file
	fileName := "test-ossutil-appendfile" + randLowStr(5)
	strText := randLowStr(1024 * 10)
	s.createFile(fileName, strText, c)

	// prepare chunks
	chunks, err := oss.SplitFileByPartNum(fileName, 10)
	c.Assert(err, IsNil)

	fd, err := os.Open(fileName)
	c.Assert(err, IsNil)
	defer fd.Close()

	// begin upload part
	client, err := oss.New(endpoint, accessKeyID, accessKeySecret)
	c.Assert(err, IsNil)

	bucket, err := client.Bucket(bucketName)
	c.Assert(err, IsNil)

	imur, err := bucket.InitiateMultipartUpload(objectName)
	c.Assert(err, IsNil)

	var parts []oss.UploadPart
	for _, chunk := range chunks {
		fd.Seek(chunk.Offset, os.SEEK_SET)
		part, err := bucket.UploadPart(imur, fd, chunk.Size, chunk.Number)
		c.Assert(err, IsNil)
		parts = append(parts, part)
	}

	// not CompleteMultipartUpload

	// begin getallpartsize
	var str string
	options := OptionMapType{
		"endpoint":        &str,
		"accessKeyID":     &str,
		"accessKeySecret": &str,
		"stsToken":        &str,
		"configFile":      &configFile,
	}

	// output to file
	outputFile := "test-file-" + randLowStr(5)
	testResultFile, err = os.OpenFile(outputFile, os.O_RDWR|os.O_TRUNC|os.O_CREATE, 0664)
	c.Assert(err, IsNil)

	oldStdout := os.Stdout
	os.Stdout = testResultFile

	alArgs := []string{CloudURLToString(bucketName, "")}
	_, err = cm.RunCommand("getallpartsize", alArgs, options)
	if err != nil {
		fmt.Printf("error:%s\n", err.Error())
	}
	c.Assert(err, IsNil)
	testResultFile.Close()

	os.Stdout = oldStdout

	// check file content
	outBody := s.readFile(outputFile, c)
	c.Assert(strings.Contains(outBody, "total part count:10"), Equals, true)

	os.Remove(outputFile)
	os.Remove(fileName)
	s.removeBucket(bucketName, true, c)
}

func (s *OssutilCommandSuite) TestAllPartSizeBucketError(c *C) {

	var str string
	options := OptionMapType{
		"endpoint":        &str,
		"accessKeyID":     &str,
		"accessKeySecret": &str,
		"stsToken":        &str,
		"configFile":      &configFile,
	}

	alArgs := []string{"oss:////"}
	_, err := cm.RunCommand("getallpartsize", alArgs, options)
	c.Assert(err, NotNil)
}

func (s *OssutilCommandSuite) TestAllPartSizeEmptyEndpoint(c *C) {
	bucketName := bucketNamePrefix + randLowStr(12)
	s.putBucket(bucketName, c)

	var str string
	options := OptionMapType{
		"endpoint":        &str,
		"accessKeyID":     &str,
		"accessKeySecret": &str,
		"stsToken":        &str,
		"configFile":      &configFile,
	}

	//set endpoint emtpy
	oldConfigStr, err := ioutil.ReadFile(configFile)
	c.Assert(err, IsNil)
	fd, _ := os.OpenFile(configFile, os.O_RDWR|os.O_TRUNC|os.O_CREATE, 0664)
	configStr := "[Credentials]" + "\n" + "language=CH" + "\n" + "accessKeyID=123" + "\n" + "accessKeySecret=456" + "\n" + "endpoint="
	fd.WriteString(configStr)
	fd.Close()

	alArgs := []string{CloudURLToString(bucketName, "")}
	_, err = cm.RunCommand("getallpartsize", alArgs, options)
	c.Assert(err, NotNil)

	err = ioutil.WriteFile(configFile, []byte(oldConfigStr), 0664)
	c.Assert(err, IsNil)

	s.removeBucket(bucketName, true, c)
}

func (s *OssutilCommandSuite) TestAllPartSizeHelp(c *C) {
	// mkdir command test
	options := OptionMapType{}

	mkArgs := []string{"getallpartsize"}
	_, err := cm.RunCommand("help", mkArgs, options)
	c.Assert(err, IsNil)

	mkArgs = []string{}
	_, err = cm.RunCommand("help", mkArgs, options)
	c.Assert(err, IsNil)
}


text:
using ProtoBuf;

namespace PlayerIOClient.Messages.ErrorLog
{
    [ProtoContract]
    internal class WriteErrorOutput
    {
    }
}


text:
package com.hazelcast.jet.impl.util;

public class ObjectWithPartitionId {

    private final Object item;
    private final int partitionId;

    public ObjectWithPartitionId(Object item, int partitionId) {
        this.item = item;
        this.partitionId = partitionId;
    }

    public Object getItem() {
        return item;
    }

    public int getPartitionId() {
        return partitionId;
    }

    @Override public String toString() {
        return "ObjectWithPartitionId{" +
                "item=" + item +
                ", partitionId=" + partitionId +
                '}';
    }
}


text:
ENV["RAILS_ENV"] ||= "test"
require File.expand_path("../../spec/dummy/config/environment", __FILE__)
require "rspec/rails"

RSpec.configure do |config|
  # If true, the base class of anonymous controllers will be inferred
  # automatically. This will be the default behavior in future versions of
  # rspec-rails.
  config.infer_base_class_for_anonymous_controllers = false

  # rspec-rails 3 will no longer automatically infer an example group's spec type
  # from the file location. You can explicitly opt-in to the feature using this
  # config option.
  # To explicitly tag specs without using automatic inference, set the `:type`
  # metadata manually:
  #
  #     describe ThingsController, :type => :controller do
  #       # Equivalent to being in spec/controllers
  #     end
  config.infer_spec_type_from_file_location!
end


text:
namespace mlir {
namespace iree_compiler {

// Appends math dialect to vm dialect patterns to the given pattern list.
void populateMathToVMPatterns(MLIRContext *context,
                              TypeConverter &typeConverter,
                              RewritePatternSet &patterns);

}  // namespace iree_compiler
}  // namespace mlir

#endif  // IREE_COMPILER_DIALECT_VM_CONVERSION_MATHTOVM_CONVERTMATHTOVM_H_


text:
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>JS 12</title>
</head>
<body>

    <script type="text/javascript" src="js/app.js"></script>
</body>
</html>


text:
package net.peterkuterna.android.apps.devoxxfrsched.io;

import java.io.IOException;
import java.io.InputStream;

import net.peterkuterna.android.apps.devoxxfrsched.io.BaseHandler.HandlerException;
import net.peterkuterna.android.apps.devoxxfrsched.util.JsonHandlerUtils;
import net.peterkuterna.android.apps.devoxxfrsched.util.XmlHandlerUtils;

import org.codehaus.jackson.JsonParseException;
import org.codehaus.jackson.JsonParser;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;

import android.content.ContentResolver;
import android.content.Context;
import android.content.res.Resources;
import android.content.res.XmlResourceParser;

/**
 * Opens a local resource file and passes the resulting {@link XmlPullParser} or
 * {@link JsonParser} to the given {@link XmlHandler} or {@link JsonHandler}.
 */
public class LocalExecutor {
	private Resources mRes;
	private ContentResolver mResolver;

	public LocalExecutor(Resources res, ContentResolver resolver) {
		mRes = res;
		mResolver = resolver;
	}

	public void execute(Context context, String assetName, XmlHandler handler)
			throws HandlerException {
		try {
			final InputStream input = context.getAssets().open(assetName);
			final XmlPullParser parser = XmlHandlerUtils.newPullParser(input);
			handler.parseAndApply(parser, mResolver);
		} catch (HandlerException e) {
			throw e;
		} catch (XmlPullParserException e) {
			throw new HandlerException("Problem parsing local asset: "
					+ assetName, e);
		} catch (IOException e) {
			throw new HandlerException("Problem parsing local asset: "
					+ assetName, e);
		}
	}

	public void execute(int resId, XmlHandler handler) throws HandlerException {
		final XmlResourceParser parser = mRes.getXml(resId);
		try {
			handler.parseAndApply(parser, mResolver);
		} finally {
			parser.close();
		}
	}

	public void execute(Context context, String assetName, JsonHandler handler)
			throws HandlerException {
		try {
			final InputStream input = context.getAssets().open(assetName);
			final JsonParser parser = JsonHandlerUtils.newJsonParser(input);
			handler.parseAndApply(parser, mResolver);
		} catch (HandlerException e) {
			throw e;
		} catch (JsonParseException e) {
			throw new HandlerException("Problem parsing local asset: "
					+ assetName, e);
		} catch (IOException e) {
			throw new HandlerException("Problem parsing local asset: "
					+ assetName, e);
		}
	}

}


text:
import socket

from django.shortcuts import render
from django.views.generic import TemplateView

from .models import ClientSite
from servers.models import Server

class ClientSiteView(TemplateView):
    template_name = 'clientsites.html'

    def get(self, request):
        clientsites = ClientSite.objects.all()
        servers = Server.objects.all()

        results = []
        pronto_ips = [each.ip for each in servers]

        for each in clientsites:
            ip_list = []
            try:
                ais = socket.getaddrinfo(each.domain, 80, 0, 0, 0)
                for result in ais:
                    ip_list.append(result[-1][0])
                ip_list = list(set(ip_list))
                for each_ip in ip_list:
                    if each_ip in pronto_ips:
                        results.append((each.domain, 'Yes', '---'))
                        break
                else:
                    results.append((each.domain, 'No', '---'))
            except:
                results.append((each.domain, '---', 'Cannot get IP'))

        return render(
            request,
            self.template_name,
            {
                'results': results,
                'servers': servers
            }
        )


text:
<?php

namespace Tests\Kopper\Aws;

use Kopper\Aws\CloudFront;

class CloudFrontTest extends AwsClientBaseTest {

  public function createClient() {
    return new CloudFront();
  }

}


text:
package com.cinchapi.concourse.server.storage.db;

import org.junit.Assert;
import org.junit.Test;

import com.cinchapi.concourse.server.model.PrimaryKey;
import com.cinchapi.concourse.server.model.Text;
import com.cinchapi.concourse.server.model.Value;
import com.cinchapi.concourse.server.storage.Action;
import com.cinchapi.concourse.server.storage.db.Block;
import com.cinchapi.concourse.server.storage.db.PrimaryBlock;
import com.cinchapi.concourse.server.storage.db.Record;
import com.cinchapi.concourse.time.Time;
import com.cinchapi.concourse.util.Convert;
import com.cinchapi.concourse.util.TestData;

/**
 *
 *
 * @author Jeff Nelson
 */
public class PrimaryBlockTest extends BlockTest<PrimaryKey, Text, Value> {

    @Test
    public void testInsertLocatorWithTrailingWhiteSpace() {
        PrimaryKey locator = PrimaryKey.wrap(1);
        Text key = Text.wrap("Youtube Embed Link ");
        Value value = Value.wrap(Convert.javaToThrift("http://youtube.com"));
        block.insert(locator, key, value, Time.now(), Action.ADD);
        Record<PrimaryKey, Text, Value> record = Record.createPrimaryRecordPartial(locator, key);
        block.sync();
        block.seek(locator, key, record);
        Assert.assertTrue(record.get(key).contains(value));
    }

    @Override
    protected PrimaryKey getLocator() {
        return TestData.getPrimaryKey();
    }

    @Override
    protected Text getKey() {
        return TestData.getText();
    }

    @Override
    protected Value getValue() {
        return TestData.getValue();
    }

    @Override
    protected PrimaryBlock getMutableBlock(String directory) {
        return Block.createPrimaryBlock(Long.toString(Time.now()), directory);
    }

}


text:
ACCEPTED

#### According to
Interim Register of Marine and Nonmarine Genera

#### Published in
Upper Precambrian and Cambrian Palaeontology of the East-European Platform. Contribution of the Soviet-Polish Working Group on the Precambrian-Cambrian Boundary Problem. Publishing House Wydawnictwa Geologiczne Warszawa: 35.

#### Original name
null

### Remarks
null


text:
/*
 * Author: Kim Min-Ho (ISKU)
 * Date: 2017.02.23
 * Email: minho1a@hanmail.net
 *
 * https://github.com/ISKU/Algorithm
 * https://www.acmicpc.net/problem/2145
 */

import java.util.Scanner;

public class Main {
	public static void main(String... args) {
		Scanner input = new Scanner(System.in);

		while (true) {
			String[] number = input.next().split("");
			int sum;

			if (number[0].equals("0"))
				break;

			do {
				sum = 0;
				for (int i = 0; i < number.length; i++)
					sum += Integer.parseInt(number[i]);

				number = String.valueOf(sum).split("");
			} while (sum >= 10);

			System.out.println(sum);
		}
	}
}


text:
// Debugging multiset implementation -*- C++ -*-

// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library.  This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.

// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.

// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
// <http://www.gnu.org/licenses/>.

/** @file debug/multiset.h
 *  This file is a GNU debug extension to the Standard C++ Library.
 */

#ifndef _GLIBCXX_DEBUG_MULTISET_H
#define _GLIBCXX_DEBUG_MULTISET_H 1

#include <debug/safe_sequence.h>
#include <debug/safe_iterator.h>
#include <utility>

namespace std _GLIBCXX_VISIBILITY(default)
{
namespace __debug
{
  /// Class std::multiset with safety/checking/debug instrumentation.
  template<typename _Key, typename _Compare = std::less<_Key>,
	   typename _Allocator = std::allocator<_Key> >
    class multiset
    : public _GLIBCXX_STD_C::multiset<_Key, _Compare, _Allocator>,
      public __gnu_debug::_Safe_sequence<multiset<_Key, _Compare, _Allocator> >
    {
      typedef _GLIBCXX_STD_C::multiset<_Key, _Compare, _Allocator> _Base;

      typedef typename _Base::const_iterator _Base_const_iterator;
      typedef typename _Base::iterator _Base_iterator;
      typedef __gnu_debug::_Equal_to<_Base_const_iterator> _Equal;
    public:
      // types:
      typedef _Key				     key_type;
      typedef _Key				     value_type;
      typedef _Compare				     key_compare;
      typedef _Compare				     value_compare;
      typedef _Allocator			     allocator_type;
      typedef typename _Base::reference	             reference;
      typedef typename _Base::const_reference        const_reference;

      typedef __gnu_debug::_Safe_iterator<_Base_iterator, multiset>
      iterator;
      typedef __gnu_debug::_Safe_iterator<_Base_const_iterator,
					  multiset> const_iterator;

      typedef typename _Base::size_type              size_type;
      typedef typename _Base::difference_type        difference_type;
      typedef typename _Base::pointer                pointer;
      typedef typename _Base::const_pointer          const_pointer;
      typedef std::reverse_iterator<iterator>        reverse_iterator;
      typedef std::reverse_iterator<const_iterator>  const_reverse_iterator;

      // 23.3.3.1 construct/copy/destroy:
      explicit multiset(const _Compare& __comp = _Compare(),
			const _Allocator& __a = _Allocator())
      : _Base(__comp, __a) { }

      template<typename _InputIterator>
        multiset(_InputIterator __first, _InputIterator __last,
		 const _Compare& __comp = _Compare(),
		 const _Allocator& __a = _Allocator())
	: _Base(__gnu_debug::__base(__gnu_debug::__check_valid_range(__first,
								     __last)),
		__gnu_debug::__base(__last),
		__comp, __a) { }

      multiset(const multiset& __x)
      : _Base(__x) { }

      multiset(const _Base& __x)
      : _Base(__x) { }

#ifdef __GXX_EXPERIMENTAL_CXX0X__
      multiset(multiset&& __x)
      noexcept(is_nothrow_copy_constructible<_Compare>::value)
      : _Base(std::move(__x))
      { this->_M_swap(__x); }

      multiset(initializer_list<value_type> __l,
	       const _Compare& __comp = _Compare(),
	       const allocator_type& __a = allocator_type())
      : _Base(__l, __comp, __a) { }
#endif

      ~multiset() _GLIBCXX_NOEXCEPT { }

      multiset&
      operator=(const multiset& __x)
      {
	*static_cast<_Base*>(this) = __x;
	this->_M_invalidate_all();
	return *this;
      }

#ifdef __GXX_EXPERIMENTAL_CXX0X__
      multiset&
      operator=(multiset&& __x)
      {
	// NB: DR 1204.
	// NB: DR 675.
	clear();
	swap(__x);
	return *this;
      }

      multiset&
      operator=(initializer_list<value_type> __l)
      {
	this->clear();
	this->insert(__l);
	return *this;
      }
#endif

      using _Base::get_allocator;

      // iterators:
      iterator
      begin() _GLIBCXX_NOEXCEPT
      { return iterator(_Base::begin(), this); }

      const_iterator
      begin() const _GLIBCXX_NOEXCEPT
      { return const_iterator(_Base::begin(), this); }

      iterator
      end() _GLIBCXX_NOEXCEPT
      { return iterator(_Base::end(), this); }

      const_iterator
      end() const _GLIBCXX_NOEXCEPT
      { return const_iterator(_Base::end(), this); }

      reverse_iterator
      rbegin() _GLIBCXX_NOEXCEPT
      { return reverse_iterator(end()); }

      const_reverse_iterator
      rbegin() const _GLIBCXX_NOEXCEPT
      { return const_reverse_iterator(end()); }

      reverse_iterator
      rend() _GLIBCXX_NOEXCEPT
      { return reverse_iterator(begin()); }

      const_reverse_iterator
      rend() const _GLIBCXX_NOEXCEPT
      { return const_reverse_iterator(begin()); }

#ifdef __GXX_EXPERIMENTAL_CXX0X__
      const_iterator
      cbegin() const noexcept
      { return const_iterator(_Base::begin(), this); }

      const_iterator
      cend() const noexcept
      { return const_iterator(_Base::end(), this); }

      const_reverse_iterator
      crbegin() const noexcept
      { return const_reverse_iterator(end()); }

      const_reverse_iterator
      crend() const noexcept
      { return const_reverse_iterator(begin()); }
#endif

      // capacity:
      using _Base::empty;
      using _Base::size;
      using _Base::max_size;

      // modifiers:
      iterator
      insert(const value_type& __x)
      { return iterator(_Base::insert(__x), this); }

#ifdef __GXX_EXPERIMENTAL_CXX0X__
      iterator
      insert(value_type&& __x)
      { return iterator(_Base::insert(std::move(__x)), this); }
#endif

      iterator
      insert(const_iterator __position, const value_type& __x)
      {
	__glibcxx_check_insert(__position);
	return iterator(_Base::insert(__position.base(), __x), this);
      }

#ifdef __GXX_EXPERIMENTAL_CXX0X__
      iterator
      insert(const_iterator __position, value_type&& __x)
      {
	__glibcxx_check_insert(__position);
	return iterator(_Base::insert(__position.base(), std::move(__x)),
			this);
      }
#endif

      template<typename _InputIterator>
	void
	insert(_InputIterator __first, _InputIterator __last)
	{
	  __glibcxx_check_valid_range(__first, __last);
	  _Base::insert(__gnu_debug::__base(__first),
			__gnu_debug::__base(__last));
	}

#ifdef __GXX_EXPERIMENTAL_CXX0X__
      void
      insert(initializer_list<value_type> __l)
      { _Base::insert(__l); }
#endif

#ifdef __GXX_EXPERIMENTAL_CXX0X__
      iterator
      erase(const_iterator __position)
      {
	__glibcxx_check_erase(__position);
	this->_M_invalidate_if(_Equal(__position.base()));
	return iterator(_Base::erase(__position.base()), this);
      }
#else
      void
      erase(iterator __position)
      {
	__glibcxx_check_erase(__position);
	this->_M_invalidate_if(_Equal(__position.base()));
	_Base::erase(__position.base());
      }
#endif

      size_type
      erase(const key_type& __x)
      {
	std::pair<_Base_iterator, _Base_iterator> __victims =
	  _Base::equal_range(__x);
	size_type __count = 0;
	_Base_iterator __victim = __victims.first;
	while (__victim != __victims.second)
	  {
	    this->_M_invalidate_if(_Equal(__victim));
	    _Base::erase(__victim++);
	    ++__count;
	  }
	return __count;
      }

#ifdef __GXX_EXPERIMENTAL_CXX0X__
      iterator
      erase(const_iterator __first, const_iterator __last)
      {
	// _GLIBCXX_RESOLVE_LIB_DEFECTS
	// 151. can't currently clear() empty container
	__glibcxx_check_erase_range(__first, __last);
	for (_Base_const_iterator __victim = __first.base();
	     __victim != __last.base(); ++__victim)
	  {
	    _GLIBCXX_DEBUG_VERIFY(__victim != _Base::end(),
				  _M_message(__gnu_debug::__msg_valid_range)
				  ._M_iterator(__first, "first")
				  ._M_iterator(__last, "last"));
	    this->_M_invalidate_if(_Equal(__victim));
	  }
	return iterator(_Base::erase(__first.base(), __last.base()), this);
      }
#else
      void
      erase(iterator __first, iterator __last)
      {
	// _GLIBCXX_RESOLVE_LIB_DEFECTS
	// 151. can't currently clear() empty container
	__glibcxx_check_erase_range(__first, __last);
	for (_Base_iterator __victim = __first.base();
	     __victim != __last.base(); ++__victim)
	  {
	    _GLIBCXX_DEBUG_VERIFY(__victim != _Base::end(),
				  _M_message(__gnu_debug::__msg_valid_range)
				  ._M_iterator(__first, "first")
				  ._M_iterator(__last, "last"));
	    this->_M_invalidate_if(_Equal(__victim));
	  }
	_Base::erase(__first.base(), __last.base());
      }
#endif

      void
      swap(multiset& __x)
      {
	_Base::swap(__x);
	this->_M_swap(__x);
      }

      void
      clear() _GLIBCXX_NOEXCEPT
      {
	this->_M_invalidate_all();
	_Base::clear();
      }

      // observers:
      using _Base::key_comp;
      using _Base::value_comp;

      // multiset operations:
      iterator
      find(const key_type& __x)
      { return iterator(_Base::find(__x), this); }

      // _GLIBCXX_RESOLVE_LIB_DEFECTS
      // 214. set::find() missing const overload
      const_iterator
      find(const key_type& __x) const
      { return const_iterator(_Base::find(__x), this); }

      using _Base::count;

      iterator
      lower_bound(const key_type& __x)
      { return iterator(_Base::lower_bound(__x), this); }

      // _GLIBCXX_RESOLVE_LIB_DEFECTS
      // 214. set::find() missing const overload
      const_iterator
      lower_bound(const key_type& __x) const
      { return const_iterator(_Base::lower_bound(__x), this); }

      iterator
      upper_bound(const key_type& __x)
      { return iterator(_Base::upper_bound(__x), this); }

      // _GLIBCXX_RESOLVE_LIB_DEFECTS
      // 214. set::find() missing const overload
      const_iterator
      upper_bound(const key_type& __x) const
      { return const_iterator(_Base::upper_bound(__x), this); }

      std::pair<iterator,iterator>
      equal_range(const key_type& __x)
      {
	std::pair<_Base_iterator, _Base_iterator> __res =
	  _Base::equal_range(__x);
	return std::make_pair(iterator(__res.first, this),
			      iterator(__res.second, this));
      }

      // _GLIBCXX_RESOLVE_LIB_DEFECTS
      // 214. set::find() missing const overload
      std::pair<const_iterator,const_iterator>
      equal_range(const key_type& __x) const
      {
	std::pair<_Base_const_iterator, _Base_const_iterator> __res =
	  _Base::equal_range(__x);
	return std::make_pair(const_iterator(__res.first, this),
			      const_iterator(__res.second, this));
      }

      _Base&
      _M_base() _GLIBCXX_NOEXCEPT       { return *this; }

      const _Base&
      _M_base() const _GLIBCXX_NOEXCEPT { return *this; }

    private:
      void
      _M_invalidate_all()
      {
	typedef __gnu_debug::_Not_equal_to<_Base_const_iterator> _Not_equal;
	this->_M_invalidate_if(_Not_equal(_Base::end()));
      }
    };

  template<typename _Key, typename _Compare, typename _Allocator>
    inline bool
    operator==(const multiset<_Key, _Compare, _Allocator>& __lhs,
	       const multiset<_Key, _Compare, _Allocator>& __rhs)
    { return __lhs._M_base() == __rhs._M_base(); }

  template<typename _Key, typename _Compare, typename _Allocator>
    inline bool
    operator!=(const multiset<_Key, _Compare, _Allocator>& __lhs,
	       const multiset<_Key, _Compare, _Allocator>& __rhs)
    { return __lhs._M_base() != __rhs._M_base(); }

  template<typename _Key, typename _Compare, typename _Allocator>
    inline bool
    operator<(const multiset<_Key, _Compare, _Allocator>& __lhs,
	      const multiset<_Key, _Compare, _Allocator>& __rhs)
    { return __lhs._M_base() < __rhs._M_base(); }

  template<typename _Key, typename _Compare, typename _Allocator>
    inline bool
    operator<=(const multiset<_Key, _Compare, _Allocator>& __lhs,
	       const multiset<_Key, _Compare, _Allocator>& __rhs)
    { return __lhs._M_base() <= __rhs._M_base(); }

  template<typename _Key, typename _Compare, typename _Allocator>
    inline bool
    operator>=(const multiset<_Key, _Compare, _Allocator>& __lhs,
	       const multiset<_Key, _Compare, _Allocator>& __rhs)
    { return __lhs._M_base() >= __rhs._M_base(); }

  template<typename _Key, typename _Compare, typename _Allocator>
    inline bool
    operator>(const multiset<_Key, _Compare, _Allocator>& __lhs,
	      const multiset<_Key, _Compare, _Allocator>& __rhs)
    { return __lhs._M_base() > __rhs._M_base(); }

  template<typename _Key, typename _Compare, typename _Allocator>
    void
    swap(multiset<_Key, _Compare, _Allocator>& __x,
	 multiset<_Key, _Compare, _Allocator>& __y)
    { return __x.swap(__y); }

} // namespace __debug
} // namespace std

#endif


text:
struct Error;

#[derive(Default)]
struct Struct(
    Error //~ ERROR
);

fn main() {}


text:
package com.interface21.remoting.rmi;

import java.lang.reflect.Method;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;

/**
 * Server-side implementation of RemoteInvocationHandler.
 * An instance of this class exists for each remote object.
 *
 * @author Juergen Hoeller
 * @since 14.05.2003
 */
class RemoteInvocationWrapper extends UnicastRemoteObject implements RemoteInvocationHandler {

	private Object wrappedObject;

	/**
	 * Create a new RemoteInvocationWrapper.
	 * @param wrappedObject	the locally wrapped object, on which methods are invoked
	 */
	public RemoteInvocationWrapper(Object wrappedObject) throws RemoteException {
		super();
		this.wrappedObject = wrappedObject;
	}

	public Object invokeRemote(String methodName, Class[] paramTypes, Object[] params) throws Exception {
		Method method = wrappedObject.getClass().getMethod(methodName, paramTypes);
		return method.invoke(wrappedObject, params);
	}

}


text:
package com.daodecode.scalaj.collection

import scala.collection.{Map => GenMap, Seq => GenSeq, Set => GenSet}
import scala.reflect.ClassTag

/**
  * Base trait for convertions of Scala classes to Java classes.
  * All deepAsJava methods require implicit parameter of this type
  * @tparam A Type convert from (represents Scala side)
  * @tparam B Type convert to (represents Java side)
  */
trait JConverter[-A, +B] {
  def convert(a: A): B
}

/**
  * Implementation of [[JConverter]] that casts A to B.
  * @tparam A Type convert from (represents Scala side)
  * @tparam B Type convert to (represents Java side)
  */
class JCastConverter[A, B] extends JConverter[A, B] {
  override def convert(a: A): B = a.asInstanceOf[B]
}

/**
  * Converter that "converts" A to A,
  * used as a fallback when there are no other implicit converters in scope
  */
object SelfJConverter extends JCastConverter[Any, Any]

trait LowImplicitSelfJConverter {

  implicit def selfConverter[A]: JConverter[A, A] = SelfJConverter.asInstanceOf[JConverter[A, A]]
}

/**
  * Scala to Java converters for "primitive types
  */
trait PrimitivesJConverter extends LowImplicitSelfJConverter {

  implicit object BytesConverter extends JCastConverter[Byte, JByte]

  implicit object ShortsConverter extends JCastConverter[Short, JShort]

  implicit object IntsConverter extends JCastConverter[Int, JInt]

  implicit object LongsConverter extends JCastConverter[Long, JLong]

  implicit object FloatConverter extends JCastConverter[Float, JFloat]

  implicit object DoublesConverter extends JCastConverter[Double, JDouble]

  implicit object CharConverter extends JCastConverter[Char, JChar]

  implicit object BooleanConverter extends JCastConverter[Boolean, JBoolean]

}

/**
  * Companion object of [[JConverter]] to bring implicit converters in following order
  *  - collection converters defined here
  *  - converters for primitive types defined in [[PrimitivesJConverter]]
  *  - "self" converter for fallback
  */
object JConverter extends PrimitivesJConverter {

  def apply[A, B](c: A => B): JConverter[A, B] = new JConverter[A, B] {
    override def convert(a: A): B = c(a)
  }

  /**
    * @return converter for converting Scala [[scala.collection.Seq]] to Java [[JList]].
    *         Given `converter` used to convert elements of Scala seq
    */
  implicit def seqConverter[A, B](implicit converter: JConverter[A, B]): JConverter[GenSeq[A], JList[B]] =
    JConverter[GenSeq[A], JList[B]](_.deepAsJava)

  /**
    * @return converter for converting Scala [[scala.collection.Set]] to Java [[JSet]].
    *         Given `converter` used to convert elements of Scala set
    */
  implicit def setConverter[A, B](implicit converter: JConverter[A, B]): JConverter[GenSet[A], JSet[B]] =
    JConverter[GenSet[A], JSet[B]](_.deepAsJava)

  /**
    * @return converter for converting Java [[scala.Array]] to Java [[scala.Array]] :).
    *         Given `converter` used to convert elements of the array
    */
  implicit def arrayConverter[A, B: ClassTag](implicit converter: JConverter[A, B]): JConverter[Array[A], Array[B]] =
    JConverter[Array[A], Array[B]](_.deepAsJava[B])

  /**
    * @return converter for converting Scala [[scala.collection.Map]] to Java [[JMap]].
    *         Given `converters` used to convert keys and values of Scala map
    */
  implicit def mapConverter[A, B, C, D](
      implicit keyConverter: JConverter[A, C],
      valueConverter: JConverter[B, D]
  ): JConverter[GenMap[A, B], JMap[C, D]] =
    JConverter[GenMap[A, B], JMap[C, D]](_.deepAsJava[C, D])
}


text:
#import <IDEKit/IDEInspectorProperty.h>

@interface IDEInspectorStringProperty : IDEInspectorProperty
{
}

+ (Class)propertyClassForPropertyDefinition:(id)arg1;

@end


text:
/**
 * Starting point for the inspirations section
 * @class inspirations.Inspirations
 */
var _self = _class('convoy.sections.AbstractSection');

/**
 * @constructor
 */
_self.__construct = function() {

  console.log('convoy.sections.AbstractSection __construct called');
};

/**
* Load app components through the convoy connection
*/
_self.loadAssets = function(callback) {

  //console.log('convoy.sections.AbstractSection loadAssets called');
  callback();
};

_self.show = function(callback) {
  //console.log('convoy.sections.AbstractSection show called');
  this.view.intro(callback);
}

_self.destroy = function(callback) {

  //console.log('convoy.sections.AbstractSection destroy called');
  //callback();
};


text:
<?xml version="1.0" encoding="UTF-8"?>
<billStatus>
  <bill>
    <updateDate>2017-06-23T20:15:09Z</updateDate>
    <recordedVotes />
    <laws />
    <sponsors>
      <item>
        <middleName />
        <lastName>Kinzinger</lastName>
        <party>R</party>
        <firstName>Adam</firstName>
        <state>IL</state>
        <bioguideId>K000378</bioguideId>
        <fullName>Rep. Kinzinger, Adam [R-IL-16]</fullName>
        <byRequestType />
        <identifiers>
          <bioguideId>K000378</bioguideId>
          <lisID>2014</lisID>
          <gpoId>7931</gpoId>
        </identifiers>
        <district>16</district>
      </item>
    </sponsors>
    <committees>
      <billCommittees>
        <item>
          <type>Standing</type>
          <subcommittees>
            <item>
              <activities>
                <item>
                  <name>Referred to</name>
                  <date>2017-03-31T18:46:51Z</date>
                </item>
              </activities>
              <name>Immigration and Border Security Subcommittee</name>
              <systemCode>hsju01</systemCode>
            </item>
          </subcommittees>
          <systemCode>hsju00</systemCode>
          <chamber>House</chamber>
          <activities>
            <item>
              <name>Referred to</name>
              <date>2017-03-15T20:34:35Z</date>
            </item>
          </activities>
          <name>Judiciary Committee</name>
        </item>
      </billCommittees>
    </committees>
    <title>Keeping Our Promise to Our Afghan Allies Act</title>
    <notes />
    <introducedDate>2017-03-15</introducedDate>
    <amendments />
    <subjects>
      <billSubjects>
        <policyArea>
          <name>Immigration</name>
        </policyArea>
        <legislativeSubjects>
          <item>
            <name>Afghanistan</name>
          </item>
          <item>
            <name>Asia</name>
          </item>
          <item>
            <name>Foreign labor</name>
          </item>
          <item>
            <name>Visas and passports</name>
          </item>
        </legislativeSubjects>
      </billSubjects>
    </subjects>
    <committeeReports />
    <calendarNumbers />
    <congress>115</congress>
    <summaries>
      <billSummaries>
        <item>
          <updateDate>2017-03-15T04:00:00Z</updateDate>
          <lastSummaryUpdateDate>2017-06-23T20:11:41Z</lastSummaryUpdateDate>
          <actionDate>2017-03-15</actionDate>
          <text><![CDATA[
Keeping Our Promise to Our Afghan Allies Act

This bill amends the Afghan Allies Protection Act of 2009 to increase from 8,500 to 11,000 the total number of visas available for the Afghan special immigrant visa program.

Such program is for Afghan translators who worked with the U.S. government or Armed Forces.
]]></text>
          <versionCode>00</versionCode>
          <actionDesc>Introduced in House</actionDesc>
          <name>Introduced in House</name>
        </item>
      </billSummaries>
    </summaries>
    <version>1.0.0</version>
    <constitutionalAuthorityStatementText><![CDATA[
From the Congressional Record Online through the Government Publishing Office [www.gpo.gov]By Mr. KINZINGER:H.R. 1544.Congress has the power to enact this legislation pursuantto the following:Article 1, Section 8 of the U.S. Constitution[Page H2083]
]]></constitutionalAuthorityStatementText>
    <relatedBills>
      <item>
        <relationshipDetails>
          <item>
            <identifiedBy>CRS</identifiedBy>
            <type>Identical bill</type>
          </item>
        </relationshipDetails>
        <number>630</number>
        <latestTitle>Keeping Our Promise to Our Afghan Allies Act</latestTitle>
        <congress>115</congress>
        <latestAction>
          <actionDate>2017-03-15</actionDate>
          <text>Read twice and referred to the Committee on the Judiciary. (Sponsor introductory remarks on measure: CR S1842-1843)</text>
        </latestAction>
        <type>S</type>
      </item>
    </relatedBills>
    <cosponsors>
      <item>
        <middleName />
        <lastName>BLUMENAUER</lastName>
        <firstName>EARL</firstName>
        <fullName>Rep. Blumenauer, Earl [D-OR-3]</fullName>
        <bioguideId>B000574</bioguideId>
        <identifiers>
          <bioguideId>B000574</bioguideId>
          <lisID>99</lisID>
          <gpoId>8116</gpoId>
        </identifiers>
        <state>OR</state>
        <party>D</party>
        <district>3</district>
        <sponsorshipDate>2017-03-15</sponsorshipDate>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>True</isOriginalCosponsor>
      </item>
      <item>
        <middleName />
        <lastName>Stivers</lastName>
        <firstName>Steve</firstName>
        <fullName>Rep. Stivers, Steve [R-OH-15]</fullName>
        <bioguideId>S001187</bioguideId>
        <identifiers>
          <gpoId>8105</gpoId>
          <bioguideId>S001187</bioguideId>
          <lisID>2047</lisID>
        </identifiers>
        <state>OH</state>
        <party>R</party>
        <district>15</district>
        <sponsorshipDate>2017-03-15</sponsorshipDate>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>True</isOriginalCosponsor>
      </item>
      <item>
        <middleName />
        <lastName>Moulton</lastName>
        <firstName>Seth</firstName>
        <fullName>Rep. Moulton, Seth [D-MA-6]</fullName>
        <bioguideId>M001196</bioguideId>
        <identifiers>
          <bioguideId>M001196</bioguideId>
          <lisID>2246</lisID>
          <gpoId />
        </identifiers>
        <state>MA</state>
        <party>D</party>
        <district>6</district>
        <sponsorshipDate>2017-03-15</sponsorshipDate>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>True</isOriginalCosponsor>
      </item>
      <item>
        <middleName />
        <lastName>Banks</lastName>
        <firstName>Jim</firstName>
        <fullName>Rep. Banks, Jim [R-IN-3]</fullName>
        <bioguideId>B001299</bioguideId>
        <identifiers>
          <lisID>2326</lisID>
          <gpoId />
          <bioguideId>B001299</bioguideId>
        </identifiers>
        <state>IN</state>
        <party>R</party>
        <district>3</district>
        <sponsorshipDate>2017-03-15</sponsorshipDate>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>True</isOriginalCosponsor>
      </item>
      <item>
        <middleName>H.</middleName>
        <lastName>Peters</lastName>
        <firstName>Scott</firstName>
        <fullName>Rep. Peters, Scott H. [D-CA-52]</fullName>
        <bioguideId>P000608</bioguideId>
        <identifiers>
          <gpoId />
          <bioguideId>P000608</bioguideId>
          <lisID>2113</lisID>
        </identifiers>
        <state>CA</state>
        <party>D</party>
        <district>52</district>
        <sponsorshipDate>2017-03-15</sponsorshipDate>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>True</isOriginalCosponsor>
      </item>
      <item>
        <middleName>R.</middleName>
        <lastName>Wenstrup</lastName>
        <firstName>Brad</firstName>
        <fullName>Rep. Wenstrup, Brad R. [R-OH-2]</fullName>
        <bioguideId>W000815</bioguideId>
        <identifiers>
          <gpoId />
          <bioguideId>W000815</bioguideId>
          <lisID>2152</lisID>
        </identifiers>
        <state>OH</state>
        <party>R</party>
        <district>2</district>
        <sponsorshipDate>2017-03-15</sponsorshipDate>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>True</isOriginalCosponsor>
      </item>
      <item>
        <middleName />
        <lastName>CONYERS</lastName>
        <firstName>JOHN</firstName>
        <fullName>Rep. Conyers, John, Jr. [D-MI-13]</fullName>
        <bioguideId>C000714</bioguideId>
        <identifiers>
          <bioguideId>C000714</bioguideId>
          <lisID>229</lisID>
          <gpoId>7999</gpoId>
        </identifiers>
        <state>MI</state>
        <party>D</party>
        <district>13</district>
        <sponsorshipDate>2017-03-15</sponsorshipDate>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>True</isOriginalCosponsor>
      </item>
      <item>
        <middleName>D.</middleName>
        <lastName>Hunter</lastName>
        <firstName>Duncan</firstName>
        <fullName>Rep. Hunter, Duncan D. [R-CA-50]</fullName>
        <bioguideId>H001048</bioguideId>
        <identifiers>
          <bioguideId>H001048</bioguideId>
          <lisID>1909</lisID>
          <gpoId>7857</gpoId>
        </identifiers>
        <state>CA</state>
        <party>R</party>
        <district>50</district>
        <sponsorshipDate>2017-03-15</sponsorshipDate>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>True</isOriginalCosponsor>
      </item>
      <item>
        <middleName />
        <lastName>RYAN</lastName>
        <firstName>TIM</firstName>
        <fullName>Rep. Ryan, Tim [D-OH-13]</fullName>
        <bioguideId>R000577</bioguideId>
        <identifiers>
          <gpoId>8107</gpoId>
          <lisID>1756</lisID>
          <bioguideId>R000577</bioguideId>
        </identifiers>
        <state>OH</state>
        <party>D</party>
        <district>13</district>
        <sponsorshipDate>2017-03-15</sponsorshipDate>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>True</isOriginalCosponsor>
      </item>
      <item>
        <middleName>M.</middleName>
        <lastName>Stefanik</lastName>
        <firstName>Elise</firstName>
        <fullName>Rep. Stefanik, Elise M. [R-NY-21]</fullName>
        <bioguideId>S001196</bioguideId>
        <identifiers>
          <gpoId />
          <bioguideId>S001196</bioguideId>
          <lisID>2263</lisID>
        </identifiers>
        <state>NY</state>
        <party>R</party>
        <district>21</district>
        <sponsorshipDate>2017-03-15</sponsorshipDate>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>True</isOriginalCosponsor>
      </item>
      <item>
        <middleName>L.</middleName>
        <lastName>HASTINGS</lastName>
        <firstName>ALCEE</firstName>
        <fullName>Rep. Hastings, Alcee L. [D-FL-20]</fullName>
        <bioguideId>H000324</bioguideId>
        <identifiers>
          <bioguideId>H000324</bioguideId>
          <lisID>511</lisID>
          <gpoId>7895</gpoId>
        </identifiers>
        <state>FL</state>
        <party>D</party>
        <district>20</district>
        <sponsorshipDate>2017-03-15</sponsorshipDate>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>True</isOriginalCosponsor>
      </item>
      <item>
        <middleName>G.</middleName>
        <lastName>Reichert</lastName>
        <firstName>David</firstName>
        <fullName>Rep. Reichert, David G. [R-WA-8]</fullName>
        <bioguideId>R000578</bioguideId>
        <identifiers>
          <bioguideId>R000578</bioguideId>
          <lisID>1810</lisID>
          <gpoId>8212</gpoId>
        </identifiers>
        <state>WA</state>
        <party>R</party>
        <district>8</district>
        <sponsorshipDate>2017-03-15</sponsorshipDate>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>True</isOriginalCosponsor>
      </item>
      <item>
        <middleName>C. "Hank"</middleName>
        <lastName>Johnson</lastName>
        <firstName>Henry</firstName>
        <fullName>Rep. Johnson, Henry C. "Hank," Jr. [D-GA-4]</fullName>
        <bioguideId>J000288</bioguideId>
        <identifiers>
          <gpoId>7901</gpoId>
          <bioguideId>J000288</bioguideId>
          <lisID>1843</lisID>
        </identifiers>
        <state>GA</state>
        <party>D</party>
        <district>4</district>
        <sponsorshipDate>2017-03-15</sponsorshipDate>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>True</isOriginalCosponsor>
      </item>
      <item>
        <middleName />
        <lastName>Gallagher</lastName>
        <firstName>Mike</firstName>
        <fullName>Rep. Gallagher, Mike [R-WI-8]</fullName>
        <bioguideId>G000579</bioguideId>
        <identifiers>
          <bioguideId>G000579</bioguideId>
          <lisID>2355</lisID>
          <gpoId />
        </identifiers>
        <state>WI</state>
        <party>R</party>
        <district>8</district>
        <sponsorshipDate>2017-03-15</sponsorshipDate>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>True</isOriginalCosponsor>
      </item>
      <item>
        <middleName />
        <lastName>Welch</lastName>
        <firstName>Peter</firstName>
        <fullName>Rep. Welch, Peter [D-VT-At Large]</fullName>
        <bioguideId>W000800</bioguideId>
        <identifiers>
          <gpoId>8204</gpoId>
          <lisID>1879</lisID>
          <bioguideId>W000800</bioguideId>
        </identifiers>
        <state>VT</state>
        <party>D</party>
        <district>0</district>
        <sponsorshipDate>2017-03-15</sponsorshipDate>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>True</isOriginalCosponsor>
      </item>
      <item>
        <middleName>W.</middleName>
        <lastName>Dent</lastName>
        <firstName>Charles</firstName>
        <fullName>Rep. Dent, Charles W. [R-PA-15]</fullName>
        <bioguideId>D000604</bioguideId>
        <identifiers>
          <lisID>1799</lisID>
          <gpoId>8133</gpoId>
          <bioguideId>D000604</bioguideId>
        </identifiers>
        <state>PA</state>
        <party>R</party>
        <district>15</district>
        <sponsorshipDate>2017-03-20</sponsorshipDate>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>False</isOriginalCosponsor>
      </item>
      <item>
        <middleName />
        <lastName>LOFGREN</lastName>
        <firstName>ZOE</firstName>
        <fullName>Rep. Lofgren, Zoe [D-CA-19]</fullName>
        <bioguideId>L000397</bioguideId>
        <identifiers>
          <bioguideId>L000397</bioguideId>
          <lisID>701</lisID>
          <gpoId>7821</gpoId>
        </identifiers>
        <state>CA</state>
        <party>D</party>
        <district>19</district>
        <sponsorshipDate>2017-03-20</sponsorshipDate>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>False</isOriginalCosponsor>
      </item>
      <item>
        <middleName>Scott</middleName>
        <lastName>Schneider</lastName>
        <firstName>Bradley</firstName>
        <fullName>Rep. Schneider, Bradley Scott [D-IL-10]</fullName>
        <bioguideId>S001190</bioguideId>
        <identifiers>
          <bioguideId>S001190</bioguideId>
          <lisID>2124</lisID>
          <gpoId />
        </identifiers>
        <state>IL</state>
        <party>D</party>
        <district>10</district>
        <sponsorshipDate>2017-03-29</sponsorshipDate>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>False</isOriginalCosponsor>
      </item>
      <item>
        <middleName />
        <lastName>Curbelo</lastName>
        <firstName>Carlos</firstName>
        <fullName>Rep. Curbelo, Carlos [R-FL-26]</fullName>
        <bioguideId>C001107</bioguideId>
        <identifiers>
          <lisID>2235</lisID>
          <gpoId />
          <bioguideId>C001107</bioguideId>
        </identifiers>
        <state>FL</state>
        <party>R</party>
        <district>26</district>
        <sponsorshipDate>2017-03-29</sponsorshipDate>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>False</isOriginalCosponsor>
      </item>
      <item>
        <middleName />
        <lastName>Wagner</lastName>
        <firstName>Ann</firstName>
        <fullName>Rep. Wagner, Ann [R-MO-2]</fullName>
        <bioguideId>W000812</bioguideId>
        <identifiers>
          <gpoId />
          <lisID>2137</lisID>
          <bioguideId>W000812</bioguideId>
        </identifiers>
        <state>MO</state>
        <party>R</party>
        <district>2</district>
        <sponsorshipDate>2017-03-29</sponsorshipDate>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>False</isOriginalCosponsor>
      </item>
      <item>
        <middleName />
        <lastName>Tsongas</lastName>
        <firstName>Niki</firstName>
        <fullName>Rep. Tsongas, Niki [D-MA-3]</fullName>
        <bioguideId>T000465</bioguideId>
        <identifiers>
          <bioguideId>T000465</bioguideId>
          <lisID>1884</lisID>
          <gpoId>7970</gpoId>
        </identifiers>
        <state>MA</state>
        <party>D</party>
        <district>3</district>
        <sponsorshipDate>2017-03-29</sponsorshipDate>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>False</isOriginalCosponsor>
      </item>
      <item>
        <middleName />
        <lastName>Herrera Beutler</lastName>
        <firstName>Jaime</firstName>
        <fullName>Rep. Herrera Beutler, Jaime [R-WA-3]</fullName>
        <bioguideId>H001056</bioguideId>
        <identifiers>
          <gpoId>8207</gpoId>
          <bioguideId>H001056</bioguideId>
          <lisID>2071</lisID>
        </identifiers>
        <state>WA</state>
        <party>R</party>
        <district>3</district>
        <sponsorshipDate>2017-03-30</sponsorshipDate>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>False</isOriginalCosponsor>
      </item>
      <item>
        <middleName>M.</middleName>
        <lastName>SLAUGHTER</lastName>
        <firstName>LOUISE</firstName>
        <fullName>Rep. Slaughter, Louise McIntosh [D-NY-25]</fullName>
        <bioguideId>S000480</bioguideId>
        <identifiers>
          <gpoId>8089</gpoId>
          <lisID>1069</lisID>
          <bioguideId>S000480</bioguideId>
        </identifiers>
        <state>NY</state>
        <party>D</party>
        <district>25</district>
        <sponsorshipDate>2017-03-30</sponsorshipDate>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>False</isOriginalCosponsor>
      </item>
      <item>
        <middleName />
        <lastName>O'Rourke</lastName>
        <firstName>Beto</firstName>
        <fullName>Rep. O'Rourke, Beto [D-TX-16]</fullName>
        <bioguideId>O000170</bioguideId>
        <identifiers>
          <bioguideId>O000170</bioguideId>
          <lisID>2162</lisID>
          <gpoId />
        </identifiers>
        <state>TX</state>
        <party>D</party>
        <district>16</district>
        <sponsorshipDate>2017-04-05</sponsorshipDate>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>False</isOriginalCosponsor>
      </item>
      <item>
        <middleName />
        <lastName>Hurd</lastName>
        <firstName>Will</firstName>
        <fullName>Rep. Hurd, Will [R-TX-23]</fullName>
        <bioguideId>H001073</bioguideId>
        <identifiers>
          <bioguideId>H001073</bioguideId>
          <lisID>2269</lisID>
          <gpoId />
        </identifiers>
        <state>TX</state>
        <party>R</party>
        <district>23</district>
        <sponsorshipDate>2017-04-05</sponsorshipDate>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>False</isOriginalCosponsor>
      </item>
      <item>
        <middleName />
        <lastName>Taylor</lastName>
        <firstName>Scott</firstName>
        <fullName>Rep. Taylor, Scott [R-VA-2]</fullName>
        <bioguideId>T000477</bioguideId>
        <identifiers>
          <gpoId />
          <bioguideId>T000477</bioguideId>
          <lisID>2351</lisID>
        </identifiers>
        <state>VA</state>
        <party>R</party>
        <district>2</district>
        <sponsorshipDate>2017-04-26</sponsorshipDate>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>False</isOriginalCosponsor>
      </item>
      <item>
        <middleName>O.</middleName>
        <lastName>Matsui</lastName>
        <firstName>Doris</firstName>
        <fullName>Rep. Matsui, Doris O. [D-CA-6]</fullName>
        <bioguideId>M001163</bioguideId>
        <identifiers>
          <gpoId>7810</gpoId>
          <lisID>1814</lisID>
          <bioguideId>M001163</bioguideId>
        </identifiers>
        <state>CA</state>
        <party>D</party>
        <district>6</district>
        <sponsorshipDate>2017-04-26</sponsorshipDate>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>False</isOriginalCosponsor>
      </item>
      <item>
        <middleName>J.</middleName>
        <lastName>Mast</lastName>
        <firstName>Brian</firstName>
        <fullName>Rep. Mast, Brian J. [R-FL-18]</fullName>
        <bioguideId>M001199</bioguideId>
        <identifiers>
          <bioguideId>M001199</bioguideId>
          <lisID>2322</lisID>
          <gpoId />
        </identifiers>
        <state>FL</state>
        <party>R</party>
        <district>18</district>
        <sponsorshipDate>2017-05-22</sponsorshipDate>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>False</isOriginalCosponsor>
      </item>
      <item>
        <middleName>P.</middleName>
        <lastName>MCGOVERN</lastName>
        <firstName>JAMES</firstName>
        <fullName>Rep. McGovern, James P. [D-MA-2]</fullName>
        <bioguideId>M000312</bioguideId>
        <identifiers>
          <bioguideId>M000312</bioguideId>
          <lisID>1504</lisID>
          <gpoId>7968</gpoId>
        </identifiers>
        <state>MA</state>
        <party>D</party>
        <district>2</district>
        <sponsorshipDate>2017-05-22</sponsorshipDate>
        <sponsorshipWithdrawnDate />
        <isOriginalCosponsor>False</isOriginalCosponsor>
      </item>
    </cosponsors>
    <billNumber>1544</billNumber>
    <policyArea>
      <name>Immigration</name>
    </policyArea>
    <originChamber>House</originChamber>
    <cboCostEstimates />
    <billType>HR</billType>
    <actions>
      <item>
        <actionDate>2017-03-31</actionDate>
        <committee>
          <name>Immigration and Border Security Subcommittee</name>
          <systemCode>hsju01</systemCode>
        </committee>
        <links />
        <sourceSystem>
          <name>House committee actions</name>
          1
        </sourceSystem>
        <text>Referred to the Subcommittee on Immigration and Border Security.</text>
        <type>Committee</type>
      </item>
      <item>
        <text>Referred to the House Committee on the Judiciary.</text>
        <actionDate>2017-03-15</actionDate>
        <committee>
          <name>Judiciary Committee</name>
          <systemCode>hsju00</systemCode>
        </committee>
        <links />
        <type>IntroReferral</type>
        <sourceSystem>
          <name>House floor actions</name>
          2
        </sourceSystem>
        <actionCode>H11100</actionCode>
      </item>
      <item>
        <text>Introduced in House</text>
        <actionDate>2017-03-15</actionDate>
        <committee />
        <links />
        <type>IntroReferral</type>
        <sourceSystem>
          <name>Library of Congress</name>
          9
        </sourceSystem>
        <actionCode>Intro-H</actionCode>
      </item>
      <item>
        <text>Introduced in House</text>
        <actionDate>2017-03-15</actionDate>
        <committee />
        <links />
        <type>IntroReferral</type>
        <sourceSystem>
          <name>Library of Congress</name>
          9
        </sourceSystem>
        <actionCode>1000</actionCode>
      </item>
      <actionTypeCounts>
        <introducedInHouse>1</introducedInHouse>
        <placeholderTextForH>1</placeholderTextForH>
        <billReferrals>1</billReferrals>
        <introducedInTheHouse>1</introducedInTheHouse>
      </actionTypeCounts>
      <actionByCounts>
        <houseOfRepresentatives>4</houseOfRepresentatives>
      </actionByCounts>
    </actions>
    <createDate>2017-03-16T05:28:12Z</createDate>
    <titles>
      <item>
        <chamberName />
        <title>Keeping Our Promise to Our Afghan Allies Act</title>
        <chamberCode />
        <parentTitleType />
        <titleType>(Extracted from GPO) Short Titles as Introduced</titleType>
      </item>
      <item>
        <chamberName />
        <title>Keeping Our Promise to Our Afghan Allies Act</title>
        <chamberCode />
        <parentTitleType />
        <titleType>Short Titles as Introduced</titleType>
      </item>
      <item>
        <chamberName />
        <title>To amend the Afghan Allies Protection Act of 2009 to make 2,500 visas available for the Afghan Special Immigrant Visa program, and for other purposes.</title>
        <chamberCode />
        <parentTitleType />
        <titleType>Official Title as Introduced</titleType>
      </item>
      <item>
        <chamberName />
        <title>Keeping Our Promise to Our Afghan Allies Act</title>
        <chamberCode />
        <parentTitleType />
        <titleType>Display Title</titleType>
      </item>
    </titles>
    <latestAction>
      <actionDate>2017-03-31</actionDate>
      <text>Referred to the Subcommittee on Immigration and Border Security.</text>
      <links />
    </latestAction>
  </bill>
  <dublinCore xmlns:dc="http://purl.org/dc/elements/1.1/">
    <dc:format>text/xml</dc:format>
    <dc:language>EN</dc:language>
    <dc:rights>Pursuant to Title 17 Section 105 of the United States Code, this file is not subject to copyright protection and is in the public domain.</dc:rights>
    <dc:contributor>Congressional Research Service, Library of Congress</dc:contributor>
    <dc:description>This file contains bill summaries and statuses for federal legislation. A bill summary describes the most significant provisions of a piece of legislation and details the effects the legislative text may have on current law and federal programs. Bill summaries are authored by the Congressional Research Service (CRS) of the Library of Congress. As stated in Public Law 91-510 (2 USC 166 (d)(6)), one of the duties of CRS is "to prepare summaries and digests of bills and resolutions of a public general nature introduced in the Senate or House of Representatives". For more information, refer to the User Guide that accompanies this file.</dc:description>
  </dublinCore>
</billStatus>


text:
using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;

using Vita.Entities;

namespace Vita.Testing.BasicTests.OneToOne {

  // Testing discovered bug in LINQ with one-to-one relationship
  [Entity]
  public interface IDocHeader {
    [PrimaryKey, Auto]
    Guid Id { get; set; }
    [Size(Sizes.Name)]
    string Name { get; set; }
    [OneToOne]
    IDocDetails Details { get; }
    [OneToOne]
    IDocDetails2 Details2 { get; } //we never create IDocDetails, to test null ref here
  }

  [Entity]
  public interface IDocDetails {
    [PrimaryKey]
    IDocHeader Header { get; set; } //one-to-one relation
    [Size(Sizes.Description)]
    string Details { get; set; }
  }

  [Entity]
  public interface IDocDetails2 {
    [PrimaryKey]
    IDocHeader Header { get; set; } //one-to-one relation
    [Size(Sizes.Description)]
    string Details2 { get; set; }
  }

  [Entity]
  public interface IDocComments {
    [PrimaryKey, Auto]
    Guid Id { get; set; }
    IDocDetails Details { get; set; }
    [Size(Sizes.Description)]
    string Comment { get; set; }
  }

  // We skip defining custom entity module and use base EntityModule class
  public class OneToOneEntityApp : EntityApp {
    public OneToOneEntityApp() {
      var area = AddArea("one");
      var mainModule = new EntityModule(area, "MainModule");
      mainModule.RegisterEntities(typeof(IDocHeader), typeof(IDocDetails), typeof(IDocDetails2), typeof(IDocComments));
    }
  }//class

  [TestClass]
  public class OneToOneRefTest {
    EntityApp _app;

    [TestCleanup]
    public void TestCleanup() {
      if(_app != null)
        _app.Flush();
    }

    [TestMethod]
    public void TestOneToOneRef() {
      _app = new OneToOneEntityApp();
      Startup.ActivateApp(_app);
      var session = _app.OpenSession();

      //initial setup
      session = _app.OpenSession();
      var header = session.NewEntity<IDocHeader>();
      header.Name = "Doc1";
      var det = session.NewEntity<IDocDetails>();
      det.Details = "Some details";
      det.Header = header;
      var cm = session.NewEntity<IDocComments>();
      cm.Details = det;
      cm.Comment = "Some comment";
      session.SaveChanges();
      //test LINQ queries - used to fail
      var query = session.EntitySet<IDocComments>().Where(dc => dc.Details == det);
      var cmList = query.ToList();
      Assert.IsTrue(cmList.Count == 1, "Expected 1 comment.");
      //Test can delete method, also used to fail with one-to-one
      Type[] bt;
      var canDel = session.CanDeleteEntity(det, out bt);
      Assert.IsFalse(canDel, "Expected CanDelete = false.");

      // test [OneToOne] entity
      // IDocHeader.Details is 'back-ref' property, marked with OneToOne attribute
      // IDocHeader.Details2 is similar, but we did not create IDocDetails2 record, so it should be null
      var docId = header.Id;
      session = _app.OpenSession();
      var doc = session.GetEntity<IDocHeader>(docId);
      var det1 = doc.Details;
      Assert.IsNotNull(det1, "Expected Details");
      var det2 = doc.Details2;
      Assert.IsNull(det2, "Expected Details2 = null");
      //do it again, to check it is correctly cached in record (so it does not blow up)
      det1 = doc.Details;
      det2 = doc.Details2;
      // test using [OneToOne] references in Linq
      session = _app.OpenSession();
      var q2 = session.EntitySet<IDocHeader>().Where(h => h.Details.Details == "Some details");
      var docs = q2.ToList();
      Assert.AreEqual(1, docs.Count, "Expected Doc header");

    }//method

  }//class
}


text:
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using Stankins.Interfaces;
using StankinsCommon;
using StankinsObjects;

namespace Stankins.Alive
{
    public abstract class AliveStatus : BaseObject, IReceive
    {
        public AliveStatus(CtorDictionary dataNeeded) : base(dataNeeded)
        {

        }

        protected DataTable CreateTable(IDataToSent dataToSent)
        {

            string nameTable = nameof(AliveStatus);
            try{
                return dataToSent.FindAfterName(nameTable).Value;
            }
            catch
            {
                //do nothing, create table is following
            }
            var m = new DataTable();
            m.TableName = nameTable;
            m.Columns.Add("Process",typeof(string));
            m.Columns.Add("Arguments", typeof(string));
            m.Columns.Add("To", typeof(string));
            m.Columns.Add("IsSuccess", typeof(bool));
            m.Columns.Add("Result", typeof(string));
            m.Columns.Add("Duration", typeof(long));
            m.Columns.Add("DetailedResult", typeof(string));
            m.Columns.Add("Exception", typeof(string));
            m.Columns.Add("StartedDate", typeof(DateTime));
            dataToSent.AddNewTable(m);
            dataToSent.Metadata.AddTable(m, dataToSent.Metadata.Tables.Count);

            return m;
        }

        public override Task<IMetadata> TryLoadMetadata()
        {
            throw new NotImplementedException();

        }

        public static IEnumerable<AliveResult> FromTable(DataTable result)
        {
            foreach(DataRow row in result.Rows)
            {
                var m = new AliveResult();
                m.StartedDate =(DateTime)row[nameof(m.StartedDate)] ;
                m.Arguments = row[nameof(m.Arguments)]?.ToString();
                m.DetailedResult = row[nameof(m.DetailedResult)]?.ToString();
                var duration = row[nameof(m.Duration)]?.ToString();
                try
                {
                    m.Duration = (string.IsNullOrWhiteSpace(duration )) ? (int?)null : int.Parse(duration);
                }
                catch(Exception ex)
                {
                    string s = ex.Message;
                    System.Console.WriteLine(s);
                }
                m.Exception = row[nameof(m.Exception)]?.ToString();
                m.IsSuccess =bool.Parse( row[nameof(m.IsSuccess)].ToString());
                m.Process = row[nameof(m.Process)]?.ToString();
                m.Result = row[nameof(m.Result)]?.ToString();
                m.To = row[nameof(m.To)]?.ToString();
                yield return m;

            }
        }
    }
}