text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ChangeListManager">
    <list default="true" id="8e80cc79-56d9-45f8-a39f-75315d662d0c" name="Default" comment="" />
    <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
    <option name="TRACKING_ENABLED" value="true" />
    <option name="SHOW_DIALOG" value="false" />
    <option name="HIGHLIGHT_CONFLICTS" value="true" />
    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
    <option name="LAST_RESOLUTION" value="IGNORE" />
  </component>
  <component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
  <component name="FileEditorManager">
    <leaf>
      <file leaf-file-name="Main.php" pinned="false" current-in-tab="true">
        <entry file="file://$PROJECT_DIR$/application/controllers/Main.php">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="340">
              <caret line="43" column="24" lean-forward="false" selection-start-line="43" selection-start-column="24" selection-end-line="43" selection-end-column="24" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
    </leaf>
  </component>
  <component name="IdeDocumentHistory">
    <option name="CHANGED_PATHS">
      <list>
        <option value="$PROJECT_DIR$/application/config/database.php" />
        <option value="$PROJECT_DIR$/application/config/config.php" />
        <option value="$PROJECT_DIR$/application/.htaccess" />
        <option value="$PROJECT_DIR$/.htaccess" />
      </list>
    </option>
  </component>
  <component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
  <component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
  <component name="JsGulpfileManager">
    <detection-done>true</detection-done>
    <sorting>DEFINITION_ORDER</sorting>
  </component>
  <component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" />
  <component name="ProjectFrameBounds">
    <option name="x" value="3832" />
    <option name="y" value="-8" />
    <option name="width" value="1936" />
    <option name="height" value="1056" />
  </component>
  <component name="ProjectView">
    <navigator currentView="ProjectPane" proportions="" version="1">
      <flattenPackages />
      <showMembers />
      <showModules />
      <showLibraryContents />
      <hideEmptyPackages />
      <abbreviatePackageNames />
      <autoscrollToSource />
      <autoscrollFromSource />
      <sortByType />
      <manualOrder />
      <foldersAlwaysOnTop value="true" />
    </navigator>
    <panes>
      <pane id="Scope" />
      <pane id="Scratches" />
      <pane id="ProjectPane">
        <subPane>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="WP2" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="WP2" />
              <option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="WP2" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="WP2" />
              <option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="application" />
              <option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="WP2" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="WP2" />
              <option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="application" />
              <option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="views" />
              <option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="WP2" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="WP2" />
              <option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="application" />
              <option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="controllers" />
              <option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="WP2" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="WP2" />
              <option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="application" />
              <option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="config" />
              <option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
            </PATH_ELEMENT>
          </PATH>
        </subPane>
      </pane>
    </panes>
  </component>
  <component name="PropertiesComponent">
    <property name="WebServerToolWindowFactoryState" value="false" />
    <property name="last_opened_file_path" value="$PROJECT_DIR$" />
  </component>
  <component name="RecentsManager">
    <key name="CopyFile.RECENT_KEYS">
      <recent name="D:\Git\WebAdvanced\WP2\application" />
      <recent name="D:\Git\WebAdvanced\WP2" />
    </key>
  </component>
  <component name="RunDashboard">
    <option name="ruleStates">
      <list>
        <RuleState>
          <option name="name" value="ConfigurationTypeDashboardGroupingRule" />
        </RuleState>
        <RuleState>
          <option name="name" value="StatusDashboardGroupingRule" />
        </RuleState>
      </list>
    </option>
  </component>
  <component name="RunManager">
    <configuration default="true" type="CodeceptionConfigurationType" factoryName="Codeception">
      <PhpTestRunnerSettings />
      <method />
    </configuration>
    <configuration default="true" type="JavaScriptTestRunnerJest" factoryName="Jest">
      <node-interpreter value="project" />
      <working-dir value="" />
      <envs />
      <scope-kind value="ALL" />
      <method />
    </configuration>
    <configuration default="true" type="JavaScriptTestRunnerProtractor" factoryName="Protractor">
      <config-file value="" />
      <node-interpreter value="project" />
      <envs />
      <method />
    </configuration>
    <configuration default="true" type="JavascriptDebugType" factoryName="JavaScript Debug">
      <method />
    </configuration>
    <configuration default="true" type="NodeJSConfigurationType" factoryName="Node.js" path-to-node="project" working-dir="">
      <method />
    </configuration>
    <configuration default="true" type="PHPUnitRunConfigurationType" factoryName="PHPUnit">
      <TestRunner />
      <method />
    </configuration>
    <configuration default="true" type="PhpBehatConfigurationType" factoryName="Behat">
      <BehatRunner />
      <method />
    </configuration>
    <configuration default="true" type="PhpLocalRunConfigurationType" factoryName="PHP Console">
      <method />
    </configuration>
    <configuration default="true" type="PhpSpecConfigurationType" factoryName="PHPSpec">
      <PhpTestRunnerSettings />
      <method />
    </configuration>
    <configuration default="true" type="js.build_tools.gulp" factoryName="Gulp.js">
      <node-interpreter>project</node-interpreter>
      <node-options />
      <gulpfile />
      <tasks />
      <arguments />
      <envs />
      <method />
    </configuration>
    <configuration default="true" type="js.build_tools.npm" factoryName="npm">
      <command value="run" />
      <scripts />
      <node-interpreter value="project" />
      <envs />
      <method />
    </configuration>
    <configuration default="true" type="mocha-javascript-test-runner" factoryName="Mocha">
      <node-interpreter>project</node-interpreter>
      <node-options />
      <working-directory />
      <pass-parent-env>true</pass-parent-env>
      <envs />
      <ui />
      <extra-mocha-options />
      <test-kind>DIRECTORY</test-kind>
      <test-directory />
      <recursive>false</recursive>
      <method />
    </configuration>
  </component>
  <component name="ShelveChangesManager" show_recycled="false">
    <option name="remove_strategy" value="false" />
  </component>
  <component name="TaskManager">
    <task active="true" id="Default" summary="Default task">
      <changelist id="8e80cc79-56d9-45f8-a39f-75315d662d0c" name="Default" comment="" />
      <created>1494416743421</created>
      <option name="number" value="Default" />
      <option name="presentableId" value="Default" />
      <updated>1494416743421</updated>
      <workItem from="1494416744658" duration="2699000" />
      <workItem from="1494939916504" duration="52000" />
      <workItem from="1494941450693" duration="40000" />
      <workItem from="1495561335753" duration="656000" />
      <workItem from="1495562577274" duration="95000" />
    </task>
    <servers />
  </component>
  <component name="TimeTrackingManager">
    <option name="totallyTimeSpent" value="3542000" />
  </component>
  <component name="ToolWindowManager">
    <frame x="3832" y="-8" width="1936" height="1056" extended-state="6" />
    <editor active="true" />
    <layout>
      <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
      <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
      <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
      <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
      <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
      <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
      <window_info id="File Transfer" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32980973" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
      <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32980973" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
    </layout>
  </component>
  <component name="TypeScriptGeneratedFilesManager">
    <option name="processedProjectFiles" value="true" />
  </component>
  <component name="VcsContentAnnotationSettings">
    <option name="myLimit" value="2678400000" />
  </component>
  <component name="XDebuggerManager">
    <breakpoint-manager />
    <watches-manager />
  </component>
  <component name="editorHistoryManager">
    <entry file="file://$PROJECT_DIR$/application/views/start.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="-6">
          <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/application/config/database.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="445">
          <caret line="74" column="0" lean-forward="true" selection-start-line="74" selection-start-column="0" selection-end-line="74" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/application/config/config.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="425">
          <caret line="37" column="25" lean-forward="false" selection-start-line="37" selection-start-column="25" selection-end-line="37" selection-end-column="25" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/application/.htaccess" />
    <entry file="file://$PROJECT_DIR$/.htaccess">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="34">
          <caret line="2" column="19" lean-forward="true" selection-start-line="2" selection-start-column="19" selection-end-line="2" selection-end-column="19" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/application/controllers/Main.php">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="340">
          <caret line="43" column="24" lean-forward="false" selection-start-line="43" selection-start-column="24" selection-end-line="43" selection-end-column="24" />
          <folding />
        </state>
      </provider>
    </entry>
  </component>
</project>


text:
package za.redbridge.simulator.physics;

import org.jbox2d.collision.AABB;
import org.jbox2d.common.Vec2;

/**
 * A set of utility methods for axis-aligned bounding boxes.
 *
 * Created by jamie on 2014/10/14.
 */
public final class AABBUtil {

    private AABBUtil() {
    }

    /** Tests if the provided point is inside the provided AABB. */
    public static boolean testPoint(Vec2 point, AABB aabb) {
        return point.x >= aabb.lowerBound.x && point.x <= aabb.upperBound.x
                && point.y >= aabb.lowerBound.y && point.y <= aabb.upperBound.y;
    }

    /** Move an AABB, keeping the same size. */
    public static void moveAABB(AABB aabb, float x, float y) {
        // Upper bound is top right vertex
        // Lower bound is bottom left vertex
        float halfWidth = (aabb.upperBound.x - aabb.lowerBound.x) / 2;
        float halfHeight = (aabb.upperBound.y - aabb.lowerBound.y) / 2;

        aabb.upperBound.set(x + halfWidth, y + halfHeight);
        aabb.lowerBound.set(x - halfWidth, y - halfHeight);
    }

    /** Resize an AABB, keeping the same center position. */
    public static void resizeAABB(AABB aabb, float width, float height) {
        Vec2 center = aabb.getCenter();

        float halfWidth = width / 2;
        float halfHeight = height / 2;

        aabb.upperBound.set(center.x + halfWidth, center.y + halfHeight);
        aabb.lowerBound.set(center.x - halfWidth, center.y - halfHeight);
    }

    /** Create an AABB at the given position with the given size. */
    public static AABB createAABB(float x, float y, float width, float height) {
        float halfWidth = width / 2;
        float halfHeight = height / 2;

        Vec2 lowerBound = new Vec2(x - halfWidth, y - halfHeight);
        Vec2 upperBound = new Vec2(x + halfWidth, y + halfHeight);

        return new AABB(lowerBound, upperBound);
    }

    /** Gets the width of the given AABB */
    public static float getAABBWidth(AABB aabb) {
        return aabb.upperBound.x - aabb.lowerBound.x;
    }

    /** Gets the height of the given AABB */
    public static float getAABBHeight(AABB aabb) {
        return aabb.upperBound.y - aabb.lowerBound.y;
    }
}

redpajama_set_name: RedPajamaGithub


text:
module Telegram
  module Bot
    module Types
      class OrderInfo < Base
        attribute :name, String
        attribute :phone_number, String
        attribute :email, String
        attribute :shipping_address, ShippingAddress
      end
    end
  end
end


text:
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
 *
 * The contents of this file are subject to the Mozilla Public License Version
 * 1.1 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 * http://www.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 * The Original Code is the Netscape Portable Runtime (NSPR).
 *
 * The Initial Developer of the Original Code is
 * Netscape Communications Corporation.
 * Portions created by the Initial Developer are Copyright (C) 1998-2000
 * the Initial Developer. All Rights Reserved.
 *
 * Contributor(s):
 *
 * Alternatively, the contents of this file may be used under the terms of
 * either the GNU General Public License Version 2 or later (the "GPL"), or
 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 * in which case the provisions of the GPL or the LGPL are applicable instead
 * of those above. If you wish to allow use of your version of this file only
 * under the terms of either the GPL or the LGPL, and not to allow others to
 * use your version of this file under the terms of the MPL, indicate your
 * decision by deleting the provisions above and replace them with the notice
 * and other provisions required by the GPL or the LGPL. If you do not delete
 * the provisions above, a recipient may use your version of this file under
 * the terms of any one of the MPL, the GPL or the LGPL.
 *
 * ***** END LICENSE BLOCK ***** */

#ifndef prlink_h___
#define prlink_h___

/*
** API to static and dynamic linking.
*/
#include "prtypes.h"

PR_BEGIN_EXTERN_C

typedef struct PRLibrary PRLibrary;

typedef struct PRStaticLinkTable {
    const char *name;
    void (*fp)();
} PRStaticLinkTable;

/*
** Change the default library path to the given string. The string is
** copied. This call will fail if it runs out of memory.
**
** The string provided as 'path' is copied. The caller can do whatever is
** convenient with the argument when the function is complete.
*/
NSPR_API(PRStatus) PR_SetLibraryPath(const char *path);

/*
** Return a character string which contains the path used to search for
** dynamically loadable libraries.
**
** The returned value is basically a copy of a PR_SetLibraryPath().
** The storage is allocated by the runtime and becomes the responsibilty
** of the caller.
*/
NSPR_API(char*) PR_GetLibraryPath(void);

/*
** Given a directory name "dir" and a library name "lib" construct a full
** path name that will refer to the actual dynamically loaded
** library. This does not test for existance of said file, it just
** constructs the full filename. The name constructed is system dependent
** and prepared for PR_LoadLibrary. The result must be free'd when the
** caller is done with it.
**
** The storage for the result is allocated by the runtime and becomes the
** responsibility of the caller.
*/
NSPR_API(char*) PR_GetLibraryName(const char *dir, const char *lib);

/*
**
** Free the memory allocated, for the caller, by PR_GetLibraryName
*/
NSPR_API(void) PR_FreeLibraryName(char *mem);

/*
** Given a library "name" try to load the library. The argument "name"
** is a machine-dependent name for the library, such as the full pathname
** returned by PR_GetLibraryName.  If the library is already loaded,
** this function will avoid loading the library twice.
**
** If the library is loaded successfully, then a pointer to the PRLibrary
** structure representing the library is returned.  Otherwise, NULL is
** returned.
**
** This increments the reference count of the library.
*/
NSPR_API(PRLibrary*) PR_LoadLibrary(const char *name);

/*
** Each operating system has its preferred way of specifying
** a file in the file system.  Most operating systems use
** a pathname.  Mac OS Classic, on the other hand, uses the FSSpec
** structure to specify a file. PRLibSpec allows NSPR clients
** to use the type of file specification that is most efficient
** for a particular platform.
**
** On some operating systems such as Mac OS Classic, a shared library
** may contain code fragments that can be individually loaded.
** PRLibSpec also allows NSPR clients to identify a code fragment
** in a library, if code fragments are supported by the OS.
** A code fragment can be specified by name or by an integer index.
**
** Right now PRLibSpec supports four types of library specification:
** a pathname in the native character encoding, a Mac code fragment
** by name, a Mac code fragment by index, and a UTF-16 pathname.
*/

typedef enum PRLibSpecType {
    PR_LibSpec_Pathname,
    PR_LibSpec_MacNamedFragment,   /* obsolete (for Mac OS Classic) */
    PR_LibSpec_MacIndexedFragment, /* obsolete (for Mac OS Classic) */
    PR_LibSpec_PathnameU           /* supported only on Win32 */
} PRLibSpecType;

struct FSSpec; /* Mac OS Classic FSSpec */

typedef struct PRLibSpec {
    PRLibSpecType type;
    union {
        /* if type is PR_LibSpec_Pathname */
        const char *pathname;

        /* if type is PR_LibSpec_MacNamedFragment */
        struct {
            const struct FSSpec *fsspec;
            const char *name;
        } mac_named_fragment;      /* obsolete (for Mac OS Classic) */

        /* if type is PR_LibSpec_MacIndexedFragment */
        struct {
            const struct FSSpec *fsspec;
            PRUint32 index;
        } mac_indexed_fragment;    /* obsolete (for Mac OS Classic) */

        /* if type is PR_LibSpec_PathnameU */
        const PRUnichar *pathname_u; /* supported only on Win32 */
    } value;
} PRLibSpec;

/*
** The following bit flags may be or'd together and passed
** as the 'flags' argument to PR_LoadLibraryWithFlags.
** Flags not supported by the underlying OS are ignored.
*/

#define PR_LD_LAZY   0x1  /* equivalent to RTLD_LAZY on Unix */
#define PR_LD_NOW    0x2  /* equivalent to RTLD_NOW on Unix */
#define PR_LD_GLOBAL 0x4  /* equivalent to RTLD_GLOBAL on Unix */
#define PR_LD_LOCAL  0x8  /* equivalent to RTLD_LOCAL on Unix */
/* The following is equivalent to LOAD_WITH_ALTERED_SEARCH_PATH on Windows */
#define PR_LD_ALT_SEARCH_PATH  0x10
/*                0x8000     reserved for NSPR internal use */

/*
** Load the specified library, in the manner specified by 'flags'.
*/

NSPR_API(PRLibrary *)
PR_LoadLibraryWithFlags(
    PRLibSpec libSpec,    /* the shared library */
    PRIntn flags          /* flags that affect the loading */
);

/*
** Unload a previously loaded library. If the library was a static
** library then the static link table will no longer be referenced. The
** associated PRLibrary object is freed.
**
** PR_FAILURE is returned if the library cannot be unloaded.
**
** This function decrements the reference count of the library.
*/
NSPR_API(PRStatus) PR_UnloadLibrary(PRLibrary *lib);

/*
** Given the name of a procedure, return the address of the function that
** implements the procedure, or NULL if no such function can be
** found. This does not find symbols in the main program (the ".exe");
** use PR_LoadStaticLibrary to register symbols in the main program.
**
** This function does not modify the reference count of the library.
*/
NSPR_API(void*) PR_FindSymbol(PRLibrary *lib, const char *name);

/*
** Similar to PR_FindSymbol, except that the return value is a pointer to
** a function, and not a pointer to void. Casting between a data pointer
** and a function pointer is not portable according to the C standard.
** Any function pointer can be cast to any other function pointer.
**
** This function does not modify the reference count of the library.
*/
typedef void (*PRFuncPtr)();
NSPR_API(PRFuncPtr) PR_FindFunctionSymbol(PRLibrary *lib, const char *name);

/*
** Finds a symbol in one of the currently loaded libraries. Given the
** name of a procedure, return the address of the function that
** implements the procedure, and return the library that contains that
** symbol, or NULL if no such function can be found. This does not find
** symbols in the main program (the ".exe"); use PR_AddStaticLibrary to
** register symbols in the main program.
**
** This increments the reference count of the library.
*/
NSPR_API(void*) PR_FindSymbolAndLibrary(const char *name,
						      PRLibrary* *lib);

/*
** Similar to PR_FindSymbolAndLibrary, except that the return value is
** a pointer to a function, and not a pointer to void. Casting between a
** data pointer and a function pointer is not portable according to the C
** standard. Any function pointer can be cast to any other function pointer.
**
** This increments the reference count of the library.
*/
NSPR_API(PRFuncPtr) PR_FindFunctionSymbolAndLibrary(const char *name,
						      PRLibrary* *lib);

/*
** Register a static link table with the runtime under the name
** "name". The symbols present in the static link table will be made
** available to PR_FindSymbol. If "name" is null then the symbols will be
** made available to the library which represents the executable. The
** tables are not copied.
**
** Returns the library object if successful, null otherwise.
**
** This increments the reference count of the library.
*/
NSPR_API(PRLibrary*) PR_LoadStaticLibrary(
    const char *name, const PRStaticLinkTable *table);

/*
** Return the pathname of the file that the library "name" was loaded
** from. "addr" is the address of a function defined in the library.
**
** The caller is responsible for freeing the result with PR_Free.
*/
NSPR_API(char *) PR_GetLibraryFilePathname(const char *name, PRFuncPtr addr);

PR_END_EXTERN_C

#endif /* prlink_h___ */


text:
require 'fileutils'

module CucumberTimingPresenter
  class Configuration

    class << self

      $tmp_path = 'tmp/cucumber_timing_presenter'

      def clean_tmp_dir
        FileUtils.rm_r tmp_dir
      end

      def tmp_dir
        dir = resolve_path_from_root $tmp_path
        FileUtils.mkdir_p dir unless File.exists? dir

        dir
      end

      def tmp_file(filename)
        "#{tmp_dir}/#{filename}"
      end

      def resolve_path_from_root(relative_path)
        if defined?(Rails)
          Rails.root.join(relative_path)
        elsif defined?(Rake.original_dir)
          File.expand_path(relative_path, Rake.original_dir)
        else
          File.expand_path(relative_path, Dir.pwd)
        end
      end

      def all_usage_results
        File.expand_path('templates/all_usage_results.html', File.dirname(__FILE__))
      end

      def unused_steps
        File.expand_path('templates/unused_steps.html', File.dirname(__FILE__))
      end

      def step_times_of_whole
        File.expand_path('templates/step_times_of_whole.html', File.dirname(__FILE__))
      end

      def step_average_and_total
        File.expand_path('templates/step_average_and_total.html', File.dirname(__FILE__))
      end
    end
  end
end


text:
#include <aws/quicksight/model/CreateIAMPolicyAssignmentRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>

#include <utility>

using namespace Aws::QuickSight::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;

CreateIAMPolicyAssignmentRequest::CreateIAMPolicyAssignmentRequest() :
    m_awsAccountIdHasBeenSet(false),
    m_assignmentNameHasBeenSet(false),
    m_assignmentStatus(AssignmentStatus::NOT_SET),
    m_assignmentStatusHasBeenSet(false),
    m_policyArnHasBeenSet(false),
    m_identitiesHasBeenSet(false),
    m_namespaceHasBeenSet(false)
{
}

Aws::String CreateIAMPolicyAssignmentRequest::SerializePayload() const
{
  JsonValue payload;

  if(m_assignmentNameHasBeenSet)
  {
   payload.WithString("AssignmentName", m_assignmentName);

  }

  if(m_assignmentStatusHasBeenSet)
  {
   payload.WithString("AssignmentStatus", AssignmentStatusMapper::GetNameForAssignmentStatus(m_assignmentStatus));
  }

  if(m_policyArnHasBeenSet)
  {
   payload.WithString("PolicyArn", m_policyArn);

  }

  if(m_identitiesHasBeenSet)
  {
   JsonValue identitiesJsonMap;
   for(auto& identitiesItem : m_identities)
   {
     Array<JsonValue> identityNameListJsonList(identitiesItem.second.size());
     for(unsigned identityNameListIndex = 0; identityNameListIndex < identityNameListJsonList.GetLength(); ++identityNameListIndex)
     {
       identityNameListJsonList[identityNameListIndex].AsString(identitiesItem.second[identityNameListIndex]);
     }
     identitiesJsonMap.WithArray(identitiesItem.first, std::move(identityNameListJsonList));
   }
   payload.WithObject("Identities", std::move(identitiesJsonMap));

  }

  return payload.View().WriteReadable();
}


text:
package org.jetbrains.plugins.scala.config.ui;

import com.intellij.openapi.fileChooser.FileChooserDescriptor;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.TextFieldWithBrowseButton;
import com.intellij.ui.DocumentAdapter;
import org.jetbrains.plugins.scala.config.Libraries;
import org.jetbrains.plugins.scala.config.LibraryLevel;
import org.jetbrains.plugins.scala.config.ScalaDistribution;
import org.jetbrains.plugins.scala.icons.Icons;
import scala.Option;

import javax.swing.*;
import javax.swing.event.DocumentEvent;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;

/**
 * User: Dmitry Naydanov
 * Date: 11/10/12
 */
public class ScalaSupportUiBase {
  private static final Color DEFAULT_COLOR = UIManager.getColor("TextField.foreground");

  private TextFieldWithBrowseButton fieldHome;
  private JLabel scalaHomeComment;
  private Project myProject;
  private JTextField fieldCompilerName;
  private JTextField fieldLibraryName;
  private JCheckBox makeLibrariesGlobalCheckBox;
  private JRadioButton[] choiceButtons;

  public ScalaSupportUiBase(Project myProject, TextFieldWithBrowseButton fieldHome, JLabel scalaHomeComment,
                            JTextField fieldCompilerName, JTextField fieldLibraryName,
                            JCheckBox makeLibrariesGlobalCheckBox, JRadioButton[] choiceButtons) {
    this.fieldHome = fieldHome;
    this.scalaHomeComment = scalaHomeComment;
    this.myProject = myProject;
    this.fieldCompilerName = fieldCompilerName;
    this.fieldLibraryName = fieldLibraryName;
    this.makeLibrariesGlobalCheckBox = makeLibrariesGlobalCheckBox;
    this.choiceButtons = choiceButtons;
  }

  public void initControls() {

    final ButtonsListener buttonsListener = new ButtonsListener();
    for (JRadioButton button : choiceButtons) {
      button.addActionListener(buttonsListener);
    }

    fieldHome.getTextField().getDocument().addDocumentListener(new HomeListener());
    fieldHome.addBrowseFolderListener("Scala home", null, myProject,
        new FileChooserDescriptor(false, true, false, false, false, false));

    FieldUpdater updateListener = new FieldUpdater();
    fieldCompilerName.getDocument().addDocumentListener(updateListener);
    fieldLibraryName.getDocument().addDocumentListener(updateListener);
    makeLibrariesGlobalCheckBox.addActionListener(updateListener);

    updateSectionsState();
  }

  public void guessHome() {
    Option<String> home = ScalaDistribution.findHome();

    if(home.isDefined()) {
      fieldHome.setText(home.get());
    }
  }

  protected void updateSectionsState() { }

  protected LibraryLevel getSelectedLibrariesLevel() {
    return makeLibrariesGlobalCheckBox.isSelected()? LibraryLevel.Global : LibraryLevel.Project;
  }

  public void updateHomeState() {
    updateHomeState(scalaHomeComment);
  }

  public void updateHomeState(JLabel stateLabel) {
    fieldHome.getTextField().setForeground(DEFAULT_COLOR);
    fieldHome.getTextField().setToolTipText(null);

    stateLabel.setIcon(null);
    stateLabel.setText("");

    String path = fieldHome.getText();
    if(path.length() == 0) {
      stateLabel.setText("Please, provide a path to Scala SDK");
      return;
    }

    File home = new File(path);
    if(!home.exists()) {
      fieldHome.getTextField().setForeground(Color.RED);
      fieldHome.getTextField().setToolTipText("Path not found");
      return;
    }

    stateLabel.setIcon(Icons.ERROR);

    ScalaDistribution distribution = ScalaDistribution.from(home);

    if(!distribution.valid()) {
      stateLabel.setText("(not valid Scala home)");
      return;
    }

    if(distribution.libraryPath().length() == 0) {
      stateLabel.setText("(compiler missing)");
      return;
    }

    if(distribution.compilerVersion().length() == 0) {
      stateLabel.setText("(invalid compiler file)");
      return;
    }

    if(distribution.libraryVersion().length() == 0) {
      stateLabel.setText("(invalid library file)");
      return;
    }

    if(!distribution.compilerVersion().equals(distribution.libraryVersion())) {
      stateLabel.setText("(mismatch of file versions)");
      return;
    }

    String missing = distribution.missing();
    if(missing.length() > 0) {
      stateLabel.setText("Missing files:
" + missing + "");
      return;
    }

    String version = distribution.version();

    boolean versionOkay = version.startsWith("2.8") || version.startsWith("2.9") || version.startsWith("2.10") || version.startsWith("2.11");
    if(!versionOkay) {
      stateLabel.setText("(version " + version + ", 2.8-2.11 required)");
      stateLabel.setIcon(Icons.WARNING);
      return;
    }

    if(!distribution.hasDocs()) {
      stateLabel.setText("(version " + version + ", no /doc/scala-devel-docs/api)");
      stateLabel.setIcon(Icons.WARNING);
    } else {
      stateLabel.setText("(version " + version + ")");
      stateLabel.setIcon(null);
    }

    LibraryLevel selectedLevel = getSelectedLibrariesLevel();
    fieldCompilerName.setText(Libraries.uniqueName("scala-compiler", selectedLevel, myProject));
    fieldLibraryName.setText(Libraries.uniqueName("scala-library", selectedLevel, myProject));
  }

  public void setEnabled(boolean enabled, JComponent... components) {
    for (JComponent component : components) {
      component.setEnabled(enabled);
    }
  }

  protected class ButtonsListener implements ActionListener {
    public void actionPerformed(ActionEvent e) {
      updateSectionsState();
    }
  }

  protected class HomeListener extends DocumentAdapter {
    @Override
    protected void textChanged(DocumentEvent e) {
      updateHomeState();
    }
  }

  protected class FieldUpdater extends DocumentAdapter implements ActionListener {
    @Override
    protected void textChanged(DocumentEvent e) {
      updateFiledState();
    }

    public void actionPerformed(ActionEvent e) {
      if (hasFieldNameClashes(fieldCompilerName))
        fieldCompilerName.setText(Libraries.uniqueName(fieldCompilerName.getText().trim(), getLevel(), myProject));
      if (hasFieldNameClashes(fieldLibraryName))
        fieldLibraryName.setText(Libraries.uniqueName(fieldLibraryName.getText().trim(), getLevel(), myProject));

      updateFiledState();
    }

    protected void updateFiledState() {
      showNameClashError(fieldCompilerName, hasFieldNameClashes(fieldCompilerName));
      showNameClashError(fieldLibraryName, hasFieldNameClashes(fieldLibraryName));
    }

    private boolean hasFieldNameClashes(JTextField myNameField) {
      return Libraries.nameClashes(myNameField.getText().trim(), getLevel(), myProject);
    }

    private void showNameClashError(JTextField myNameField, boolean hasClashes) {
      myNameField.setForeground(hasClashes ? Color.RED : DEFAULT_COLOR);
      myNameField.setToolTipText(hasClashes ? "Name is already in use" : null);
    }

    protected LibraryLevel getLevel() {
      return ScalaSupportUiBase.this.getSelectedLibrariesLevel();
    }
  }
}


text:
#include <stdio.h>
#include "cmsis_compiler.h"

#ifndef __TFM_NS_SVC_H__
#define __TFM_NS_SVC_H__

#ifdef __cplusplus
extern "C" {
#endif

/**
 * \brief Include all the SVC handler headers
 */
#include "tfm_nspm_svc_handler.h"

/**
 * \brief Macro to encode an svc instruction
 *
 */
#define SVC(code) __ASM volatile("svc %0" : : "I" (code))

/**
 * \def LIST_SVC_NSPM
 *
 * \brief This is an X macro which lists
 *        the SVC interface exposed by TF-M
 *        for the NS OS.
 *
 */
#define LIST_SVC_NSPM \
    X(SVC_TFM_NSPM_REGISTER_CLIENT_ID, tfm_nspm_svc_register_client_id) \

/**
 * \brief Numbers associated to each SVC available
 *
 * \details Start from 1 as 0 is reserved by RTX
 */
enum tfm_svc_num {
    SVC_INVALID = 0,

#define X(SVC_ENUM, SVC_HANDLER) SVC_ENUM,

    /* SVC API for Services */
#ifdef TFM_NS_CLIENT_IDENTIFICATION
    LIST_SVC_NSPM
#endif

#undef X

    /* add all the new entries above this line */
    SVC_TFM_MAX,
};

/* number of user SVC functions */
#define USER_SVC_COUNT ((uint32_t)SVC_TFM_MAX - 1)

#ifdef __cplusplus
}
#endif

#endif /* __TFM_NS_SVC_H__ */


text:
{% load wagtailcore_tags wagtailimages_tags core_tags %}
{% social_media_footer %}
{% if footers %}

  {% for page in footers %}

{{page.title}}

  {% endfor %}

{% endif %}


text:
package mani.beatsalbumsearch.modules;

import android.app.Application;

import dagger.Module;
import dagger.Provides;
import mani.beatsalbumsearch.adapter.AlbumTrackListAdapter;
import mani.beatsalbumsearch.adapter.AlbumsSearchListAdapter;
import mani.beatsalbumsearch.ui.activity.AlbumSearchActivity;
import mani.beatsalbumsearch.ui.fragment.AlbumDetailsFragment;
import mani.beatsalbumsearch.ui.fragment.AlbumSearchFragment;

/**
 * This Module defines what are the UI classes that require necessary objects for
 * its dependencies.
 *
 */
@Module (
        injects = {
            AlbumSearchActivity.class,
            AlbumSearchFragment.class,
            AlbumDetailsFragment.class,
            AlbumsSearchListAdapter.class,
            AlbumTrackListAdapter.class
        },
        includes = {
                AlbumSearchModule.class,
                ApiModule.class,
                DataModule.class
        }
)
public class UIModule {

    @Provides
    AlbumsSearchListAdapter provideAlbumListAdapter(Application application) {
       return new AlbumsSearchListAdapter(application);
    }

    @Provides
    AlbumTrackListAdapter provideAlbumTrackListAdapter(Application application) {
        return new AlbumTrackListAdapter(application);
    }

}


text:
    {% include headlines.html %}

{% comment %}

    {% include alert.html %}
    {% include change.html %}

{% endcomment %}

    {% include wikipedia.html %}

    {% include supporters.html %}

    {% include status.html %}

		{% include photos.html %}

About Bassel

		{% include testimonials.html %}

		{% include introduction.html %}


text:
import React, {PropTypes} from 'react';

const formatDate = (props) => {
  const monthNames = [
    'January', 'February', 'March',
    'April', 'May', 'June', 'July',
    'August', 'September', 'October',
    'November', 'December',
  ];
  const date = new Date(props.pubDate);
  const day = date.getDate();
  const monthIndex = date.getMonth();
  const year = date.getFullYear();

  return (

{`${day}  ${monthNames[monthIndex]} ${ year}`}

  );
};

formatDate.propTypes = {
  pubDate: PropTypes.string,
};

export default formatDate;


text:
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd

# Data Preprocessing
dataset = pd.read_csv('Market_Basket_Optimisation.csv', header = None)
transactions = []
for i in range(0, 7501):
    transactions.append([str(dataset.values[i,j]) for j in range(0, 20)])

# Training Apriori on the dataset
from apyori import apriori
rules = apriori(transactions, min_support = 0.003, min_confidence = 0.2, min_lift = 3, min_length = 2)

# Visualising the results
results = list(rules)


text:
package org.maera.plugin.osgi.factory.transform;

public interface Fooable extends Barable {
}


text:
<?xml version="1.0" encoding="utf-8"?><!--
  ~ Copyright (c) 2018 NECTEC
  ~   National Electronics and Computer Technology Center, Thailand
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~    http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:theme="@style/AppTheme.TranslucentStatus">

    <fragment
        android:id="@+id/mapFragment"
        android:name="th.or.nectec.marlo.PointMarloFragment"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.0"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.0" />

    <android.support.design.widget.FloatingActionButton
        android:id="@+id/done"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_margin="@dimen/fab_margin"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:srcCompat="@drawable/ic_done_black_24dp"
        tools:ignore="VectorDrawableCompat" />

</android.support.constraint.ConstraintLayout>


text:
"""
Image caching and management.
"""
import os
import re

from os_win import utilsfactory
from oslo_log import log as logging
from oslo_utils import excutils
from oslo_utils import units
from oslo_utils import uuidutils

import nova.conf
from nova import exception
from nova.i18n import _
from nova import utils
from nova.virt.hyperv import pathutils
from nova.virt import imagecache
from nova.virt import images

LOG = logging.getLogger(__name__)

CONF = nova.conf.CONF

class ImageCache(imagecache.ImageCacheManager):
    def __init__(self):
        super(ImageCache, self).__init__()
        self._pathutils = pathutils.PathUtils()
        self._vhdutils = utilsfactory.get_vhdutils()

    def _get_root_vhd_size_gb(self, instance):
        if instance.old_flavor:
            return instance.old_flavor.root_gb
        else:
            return instance.flavor.root_gb

    def _resize_and_cache_vhd(self, instance, vhd_path):
        vhd_size = self._vhdutils.get_vhd_size(vhd_path)['VirtualSize']

        root_vhd_size_gb = self._get_root_vhd_size_gb(instance)
        root_vhd_size = root_vhd_size_gb * units.Gi

        root_vhd_internal_size = (
                self._vhdutils.get_internal_vhd_size_by_file_size(
                    vhd_path, root_vhd_size))

        if root_vhd_internal_size < vhd_size:
            raise exception.FlavorDiskSmallerThanImage(
                flavor_size=root_vhd_size, image_size=vhd_size)
        if root_vhd_internal_size > vhd_size:
            path_parts = os.path.splitext(vhd_path)
            resized_vhd_path = '%s_%s%s' % (path_parts[0],
                                            root_vhd_size_gb,
                                            path_parts[1])

            lock_path = os.path.dirname(resized_vhd_path)
            lock_name = "%s-cache.lock" % os.path.basename(resized_vhd_path)

            @utils.synchronized(name=lock_name, external=True,
                                lock_path=lock_path)
            def copy_and_resize_vhd():
                if not self._pathutils.exists(resized_vhd_path):
                    try:
                        LOG.debug("Copying VHD %(vhd_path)s to "
                                  "%(resized_vhd_path)s",
                                  {'vhd_path': vhd_path,
                                   'resized_vhd_path': resized_vhd_path})
                        self._pathutils.copyfile(vhd_path, resized_vhd_path)
                        LOG.debug("Resizing VHD %(resized_vhd_path)s to new "
                                  "size %(root_vhd_size)s",
                                  {'resized_vhd_path': resized_vhd_path,
                                   'root_vhd_size': root_vhd_size})
                        self._vhdutils.resize_vhd(resized_vhd_path,
                                                  root_vhd_internal_size,
                                                  is_file_max_size=False)
                    except Exception:
                        with excutils.save_and_reraise_exception():
                            if self._pathutils.exists(resized_vhd_path):
                                self._pathutils.remove(resized_vhd_path)

            copy_and_resize_vhd()
            return resized_vhd_path

    def get_cached_image(self, context, instance, rescue_image_id=None):
        image_id = rescue_image_id or instance.image_ref

        base_vhd_dir = self._pathutils.get_base_vhd_dir()
        base_vhd_path = os.path.join(base_vhd_dir, image_id)

        lock_name = "%s-cache.lock" % image_id

        @utils.synchronized(name=lock_name, external=True,
                            lock_path=base_vhd_dir)
        def fetch_image_if_not_existing():
            vhd_path = None
            for format_ext in ['vhd', 'vhdx']:
                test_path = base_vhd_path + '.' + format_ext
                if self._pathutils.exists(test_path):
                    vhd_path = test_path
                    break

            if not vhd_path:
                try:
                    images.fetch(context, image_id, base_vhd_path)

                    format_ext = self._vhdutils.get_vhd_format(base_vhd_path)
                    vhd_path = base_vhd_path + '.' + format_ext.lower()
                    self._pathutils.rename(base_vhd_path, vhd_path)
                except Exception:
                    with excutils.save_and_reraise_exception():
                        if self._pathutils.exists(base_vhd_path):
                            self._pathutils.remove(base_vhd_path)

            return vhd_path

        vhd_path = fetch_image_if_not_existing()

        # Note: rescue images are not resized.
        is_vhd = vhd_path.split('.')[-1].lower() == 'vhd'
        if CONF.use_cow_images and is_vhd and not rescue_image_id:
            # Resize the base VHD image as it's not possible to resize a
            # differencing VHD. This does not apply to VHDX images.
            resized_vhd_path = self._resize_and_cache_vhd(instance, vhd_path)
            if resized_vhd_path:
                return resized_vhd_path

        if rescue_image_id:
            self._verify_rescue_image(instance, rescue_image_id,
                                      vhd_path)

        return vhd_path

    def _verify_rescue_image(self, instance, rescue_image_id,
                             rescue_image_path):
        rescue_image_info = self._vhdutils.get_vhd_info(rescue_image_path)
        rescue_image_size = rescue_image_info['VirtualSize']
        flavor_disk_size = instance.flavor.root_gb * units.Gi

        if rescue_image_size > flavor_disk_size:
            err_msg = _('Using a rescue image bigger than the instance '
                        'flavor disk size is not allowed. '
                        'Rescue image size: %(rescue_image_size)s. '
                        'Flavor disk size:%(flavor_disk_size)s.') % dict(
                            rescue_image_size=rescue_image_size,
                            flavor_disk_size=flavor_disk_size)
            raise exception.ImageUnacceptable(reason=err_msg,
                                              image_id=rescue_image_id)

    def get_image_details(self, context, instance):
        image_id = instance.image_ref
        return images.get_info(context, image_id)

    def _age_and_verify_cached_images(self, context, all_instances, base_dir):
        for img in self.originals:
            if img in self.used_images:
                # change the timestamp on the image so as to reflect the last
                # time it was used
                self._update_image_timestamp(img)
            else:
                self._remove_if_old_image(img)

    def _update_image_timestamp(self, image):
        backing_files = self._get_image_backing_files(image)
        for img in backing_files:
            os.utime(img, None)

    def _get_image_backing_files(self, image):
        base_file = self._pathutils.get_image_path(image)
        if not base_file:
            # not vhd or vhdx, ignore.
            return []

        backing_files = [base_file]
        resize_re = re.compile('%s_[0-9]+$' % image)
        for img in self.unexplained_images:
            match = resize_re.match(img)
            if match:
                backing_files.append(self._pathutils.get_image_path(img))

        return backing_files

    def _remove_if_old_image(self, image):
        backing_files = self._get_image_backing_files(image)
        max_age_seconds = CONF.remove_unused_original_minimum_age_seconds

        for img in backing_files:
            age_seconds = self._pathutils.get_age_of_file(img)
            if age_seconds > max_age_seconds:
                LOG.info("Removing old, unused image: %s", img)
                self._remove_old_image(img)

    def _remove_old_image(self, image_path):
        lock_path = os.path.dirname(image_path)
        lock_name = "%s-cache.lock" % os.path.basename(image_path)

        @utils.synchronized(name=lock_name, external=True,
                            lock_path=lock_path)
        def _image_synchronized_remove():
            self._pathutils.remove(image_path)

        _image_synchronized_remove()

    def update(self, context, all_instances):
        base_vhd_dir = self._pathutils.get_base_vhd_dir()

        running = self._list_running_instances(context, all_instances)
        self.used_images = running['used_images'].keys()
        all_files = self._list_base_images(base_vhd_dir)
        self.originals = all_files['originals']
        self.unexplained_images = all_files['unexplained_images']

        self._age_and_verify_cached_images(context, all_instances,
                                           base_vhd_dir)

    def _list_base_images(self, base_dir):
        unexplained_images = []
        originals = []

        for entry in os.listdir(base_dir):
            file_name, extension = os.path.splitext(entry)
            # extension has a leading '.'. E.g.: '.vhdx'
            if extension.lstrip('.').lower() not in ['vhd', 'vhdx']:
                # File is not an image. Ignore it.
                # imagecache will not store images of any other formats.
                continue

            if uuidutils.is_uuid_like(file_name):
                originals.append(file_name)
            else:
                unexplained_images.append(file_name)

        return {'unexplained_images': unexplained_images,
                'originals': originals}


text:
import React from 'react';
import PropTypes from 'prop-types';
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';  //material-ui
import darkBaseTheme from 'material-ui/styles/baseThemes/darkBaseTheme';
import lightBaseTheme from 'material-ui/styles/baseThemes/lightBaseTheme';
import getMuiTheme from 'material-ui/styles/getMuiTheme';
import Navigation from './Navigation';
import Footer from './Footer';

export default function Main(props) {
  return (
    <MuiThemeProvider muiTheme={getMuiTheme(lightBaseTheme)}>

        <Navigation />

{props.children}

    </MuiThemeProvider>
  );
}

Main.propTypes = {
  children: PropTypes.element.isRequired,
};


text:
<?xml version="1.0" encoding="utf-8"?>

<com.balysv.materialripple.MaterialRippleLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="70dp"
    app:mrl_rippleAlpha="0.2"
    app:mrl_rippleColor="#585858"
    app:mrl_rippleHover="true"
    app:mrl_rippleOverlay="true">

    <TextView
        android:id="@android:id/text1"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:paddingLeft="8dp"
        android:paddingRight="8dp"
        android:gravity="center_vertical"
        android:background="@drawable/selector"
        android:ellipsize="end"
        android:singleLine="true"
        android:textSize="20sp" />

</com.balysv.materialripple.MaterialRippleLayout>


text:
import time
import os
import socket
import re

import supybot.log as log
import supybot.conf as conf
import supybot.ircdb as ircdb
import supybot.drivers as drivers
import supybot.ircmsgs as ircmsgs

import silc

# TODOs
# 1. Silc nicks do not need to be unique, so there can be nick collisions.
#    IRC has nick collisions, so you cannot have two users with same nick name.
#    I presume SupyBot assumes this.

SILC_KEY_NAME = "silckey"

def strip_leading_hash(supybot_channel_name):
    return supybot_channel_name[1:]

class SupySilcClient(silc.SilcClient):
    """Supybot SILC to IRC emulator."""

    def __init__(self, irc, parent):
        self.nickname = conf.supybot.nick()
        self.username = conf.supybot.ident()
        self.realname = conf.supybot.user()

        keybase = os.path.join(conf.supybot.directories.conf(), SILC_KEY_NAME)
        pubkey = keybase + '.pub'
        privkey = keybase + '.prv'
        self.keys = None

        if os.path.exists(pubkey) and os.path.exists(privkey):
            try:
                self.keys = silc.load_key_pair(pubkey, privkey, "")
            except RuntimeError:
                self.keys = silc.load_key_pair(pubkey, privkey, None)
        else:
            drivers.log.info("SILC: Generating Keys")
            self.keys = silc.create_key_pair(pubkey, privkey, passphrase=None)

        silc.SilcClient.__init__(self, self.keys,
                                 self.nickname,
                                 self.username,
                                 self.realname)

        self.irc = irc
        self.parent = parent
        self.last_ping = 0
        self.users = {}    # use this to lookup nick to SilcUser objects
        self.channels = {} # use this to lookup channels to SilcChannel objects

    def _cache_user(self, user):
        self.users[user.nickname] = user

    def _cache_channel(self, channel):
        self.channels[channel.channel_name] = channel

    def ask_passphrase(self):
        import getpass
        return getpass.getpass('Passphrase:')

    def running(self):
        drivers.log.info("SILC: Running.")
        self.parent.running = True
        self.parent.reconnect()

    def connected(self):
        drivers.log.info("SILC: Connected to server.")
        self.parent.connected = True
        self.irc.driver = self.parent

    def disconnected(self, msg):
        drivers.log.info('SILC: Disconnected from server.')
        self.parent.connected = False

    def command(self, success, code, command, status):
        drivers.log.info('SILC: Command: %s %s %s %s', success, code, command, status)

    def say(self, msg):
        drivers.log.info('SILC: Say received: %s', str([msg]))

    def channel_message(self, sender, channel, flags, msg):
        drivers.log.info('SILC: Channel Message: %s [%s] %s' % (sender.nickname, channel, msg))
        self._cache_channel(channel)
        self._cache_user(sender)

        ircemu = ':%s!%s@%s PRIVMSG #%s :%s' % (sender.nickname, sender.username,
                                               sender.hostname, channel.channel_name,
                                               msg)
        ircmsg = drivers.parseMsg(ircemu)
        self.irc.feedMsg(ircmsg)

    def private_message(self, sender, flags, msg):
        drivers.log.info('SILC: Private Message: [%s] %s', sender, msg)
        self._cache_user(sender)

        ircemu = ':%s!%s@%s PRIVMSG %s :%s' % (sender.nickname, sender.username,
                                               sender.hostname, self.username,
                                               msg)
        ircmsg = drivers.parseMsg(ircemu)
        if ircmsg: self.irc.feedMsg(ircmsg)

    def notify_none(self, msg):
        drivers.log.info('SILC: Notify (None): %s', msg)

    def notify_join(self, joiner, channel):
        self._cache_user(joiner)
        drivers.log.info('SILC: Notify (Join): %s %s', joiner, channel)

        ircemu = ':%s!n=%s@%s JOIN #%s' % (joiner.nickname, joiner.username,
                                           joiner.hostname,
                                           channel.channel_name)
        ircmsg = drivers.parseMsg(ircemu)
        if ircmsg: self.irc.feedMsg(ircmsg)

    def notify_invite(self, channel, channel_name, inviter):
        self._cache_channel(channel)
        self._cache_user(user)
        drivers.log.info('SILC: Notify (Invite): %s %s %s', channel, channel_name, inviter)

    def notify_leave(self, leaver, channel):
        self._cache_user(leaver)
        self._cache_channel(channel)
        drivers.log.info('SILC: Notify (Leave): %s %s', leaver, channel.channel_name)

        ircemu = ':%s!n=%s@%s PART #%s :' % (leaver.nickname, leaver.username,
                                           leaver.hostname,
                                           channel.channel_name)
        ircmsg = drivers.parseMsg(ircemu)
        if ircmsg: self.irc.feedMsg(ircmsg)

    def notify_signoff(self, user, msg, channel):
        self._cache_user(user)
        drivers.log.info('SILC: Notify (Signoff): %s', user)

        ircemu = ':%s!n=%s@%s QUIT :' % (user.nickname, user.username,
                                           user.hostname)
        ircmsg = drivers.parseMsg(ircemu)
        if ircmsg: self.irc.feedMsg(ircmsg)

    def notify_topic_set(self, changer_type, changer, channel, topic):
        self._cache_user(changer)
        self._cache_channel(channel)
        drivers.log.info('SILC: Notify (Topic Set):', channel, topic)
        if changer_type == silc.SILC_ID_CLIENT:
            ircemu = ':%s!n=%s@%s TOPIC #%s :%s' % \
                (changer.nickname, changer.username, changer.hostname,
                 channel.channel_name, topic)
            ircmsg = drivers.parseMsg(ircemu)
            if ircmsg: self.irc.feedMsg(ircmsg)
        elif changer_type == silc.SILC_ID_CHANNEL:
            ircemu = ':%s TOPIC #%s :%s' % \
                (changer.channel_name, channel.channel_name, topic)
            ircmsg = drivers.parseMsg(ircemu)
            if ircmsg: self.irc.feedMsg(ircmsg)

    def notify_nick_change(self, user, olduser, newuser):
        self._cache_user(user)
        drivers.log.info('SILC: Notify (Nick Change):', olduser, newuser)
        ircemu = ':%s!n=%s@%s NICK %s' % \
                 (olduser, user.username, user.hostname, newuser)
        ircmsg = drivers.parseMsg(ircemu)
        if ircmsg: self.irc.feedMsg(ircmsg)

    def notify_cmode_change(self, type, changer, chan_mode, cipher_name,
                            hmac_name, passphrase, founder_key,
                            channel_pubkeys, channel):
        self._cache_channel(channel)
        drivers.log.info('SILC: Notify (CMODE): for %s: %08x' %
                         (channel, chan_mode))

    def notify_cumode_change(self, type, changer, chan_user_mode, user,
                            for_channel):
        self._cache_channel(for_channel)
        self._cache_user(user)
        drivers.log.info('SILC: Notify (CUMODE): for %s in %s: %08x' %
                         (user, for_channel, chan_user_mode))

    def notify_motd(self, msg):
        drivers.log.info('SILC: Notify (MOTD):', msg)

    def notify_server_signoff(self):
        drivers.log.info('SILC: Notify (Server Signoff)')

    def notify_kicked(self, kicked, reason, kicker, channel):
        self._cache_user(kicked)
        self._cache_user(kicker)
        self._cache_channel(channel)
        drivers.log.info('SILC: Notify (Kick):', kicked, reason, kicker, channel)
        ircemu = ':%s!n=%s@%s KICK #%s %s' % \
                 (kicker.nickname, kicker.username, kicker.hostname,
                  channel.channel_name, kicked.nickname)
        ircmsg = drivers.parseMsg(ircemu)
        if ircmsg: self.irc.feedMsg(ircmsg)

    def notify_killed(self, killed, reason, killer, channel):
        self._cache_user(kicked)
        self._cache_user(kicker)
        self._cache_channel(channel)
        drivers.log.info('SILC: Notify (Killed):', killed, reason, killer, channel)

    def notify_error(self, type, message):
        drivers.log.info('SILC: Notify (Error):', type, message)

    def notify_watch(self, watched, new_nick, new_user_mode, notification, _):
        self._cache_user(watched)
        drivers.log.info('SILC: Notify (Watch):', watched)

    def command_reply_whois(self, user, nickname, username, realname, mode, idle):
        self._cache_user(user)
        drivers.log.info('SILC: Reply (Whois): %s mode: %x idle: %d' % (nickname, mode, idle))

    def command_reply_whowas(self, user, nickname, username, realname):
        self._cache_user(user)
        drivers.log.info('SILC: Reply (Whowas):', nickname)

    def command_reply_nick(self, user, nickname, olduserid):
        self._cache_user(user)
        drivers.log.info('SILC: Reply (Nick):', nickname)

    def command_reply_list(self, channel, channel_name, channel_topic, user_count):
        if channel == None:
            drivers.log.info('SILC: Reply (List): END')
        else:
            self._cache_channel(channel)
            drivers.log.info('SILC: Reply (List):', channel_name, channel_topic)

    def command_reply_topic(self, channel, topic):
        self._cache_channel(channel)
        ircemu = ':%s TOPIC #%s :%s' % \
            (channel.channel_name, channel.channel_name, topic)
        ircmsg = drivers.parseMsg(ircemu)
        if ircmsg: self.irc.feedMsg(ircmsg)
        drivers.log.info('SILC: Reply (Topic):', channel, topic)

    def command_reply_invite(self, channel, invite_list):
        pass # TODO: not implemented

    def command_reply_kill(self, user):
        self._cache_user(user)
        drivers.log.info('SILC: Reply (Kill):', user)

    def command_reply_info(self, *args):
        pass # TODO: not implemented

    def command_reply_stats(self, *args):
        pass # TODO: not implemented

    def command_reply_ping(self):
        drivers.log.info('SILC: Reply (Ping): PONG')
        ircemu = ':%s PONG %s :%s' % (self.remote_host(), self.remote_host(), self.last_ping)
        ircmsg = drivers.parseMsg(ircemu)
        if ircmsg: self.irc.feedMsg(ircmsg)

    def command_reply_oper(self):
        drivers.log.info('SILC: Reply (Oper)')

    def command_reply_join(self, channel, channel_name, topic, hmac_name, mode, user_limit, users):
        self._cache_channel(channel)
        myself = self.user()

        drivers.log.info('SILC: Reply (Join)', channel, topic, users)
        ircemu = ':%s!%s@%s JOIN :#%s' % (myself.nickname,
                                          myself.username,
                                          myself.hostname,
                                          channel_name)

        ircmsg = drivers.parseMsg(ircemu)
        self.irc.feedMsg(ircmsg)

        ircemu = ':%s MODE #%s %s' % (self.remote_host(), channel_name, "+ns")
        ircmsg = drivers.parseMsg(ircemu)
        if ircmsg: self.irc.feedMsg(ircmsg)

        # really need names to be passed from the reply
        ircemu = ':%s 353 %s @ #%s :%s' % (self.remote_host(),
                                    self.username,
                                    channel_name,
                                    ' '.join([u.nickname for u in users]))
        ircmsg = drivers.parseMsg(ircemu)
        if ircmsg: self.irc.feedMsg(ircmsg)

        # TODO: other list of names
        ircemu = ':%s 366 %s :End of /NAMES list' % (self.remote_host(), self.username)
        ircmsg = drivers.parseMsg(ircemu)
        if ircmsg: self.irc.feedMsg(ircmsg)

        # send topic as well
        ircemu = ':%s 332 %s #%s :%s' % (self.remote_host(),
                                         self.username,
                                         channel_name,
                                         topic)
        ircmsg = drivers.parseMsg(ircemu)
        if ircmsg: self.irc.feedMsg(ircmsg)

    def command_reply_motd(self, msg):
        drivers.log.info('SILC: Reply (MOTD):', msg)

    def command_reply_cmode(self, channel, mode, user_limit, founder_key, _):
        self._cache_channel(channel)
        drivers.log.info('SILC: Reply (Cmode):', channel, mode)

        ircemu = ':%s 324 %s #%s %s' % (self.remote_host(),
                                    self.user().nickname,
                                    channel.channel_name,
                                     "+sn")
        ircmsg = drivers.parseMsg(ircemu)
        if ircmsg: self.irc.feedMsg(ircmsg)

        ircemu = ':%s 329 %s #%s %d' % (self.remote_host(),
                                    self.user().nickname,
                                    channel.channel_name,
                                     time.time())
        ircmsg = drivers.parseMsg(ircemu)
        if ircmsg: self.irc.feedMsg(ircmsg)

    def command_reply_cumode(self, mode, channel, user):
        self._cache_channel(channel)
        self._cache_user(user)
        drivers.log.info('SILC: Reply (CUmode):', channel, user, mode)

    def command_reply_kick(self, channel, user):
        self._cache_channel(channel)
        self._cache_user(user)
        drivers.log.info('SILC: Reply (Kick):', channel, user)

    def command_reply_ban(self, channel, banlist):
        self._cache_channel(channel)
        drivers.log.info('SILC: Reply (Ban):', channel)

    def command_reply_detach(self):
        drivers.log.info('SILC: Reply (Detach)')

    def command_reply_watch(self):
        drivers.log.info('SILC: Reply (Watch)')

    def command_reply_silcoper(self):
        drivers.log.info('SILC: Reply (SilcOper)')

    def command_reply_leave(self, channel):
        self._cache_channel(channel)
        drivers.log.info('SILC: Reply (Leave):', channel)

    def command_reply_users(self, channel, users):
        for user in users:
            self._cache_user(user)
        drivers.log.info('SILC: Reply (Users): %s %s', channel, users)

        myself = self.user().nickname
        for user in users:
            data = {'server': self.remote_host(),
                    'channel': '#' + channel.channel_name,
                    'myself': myself,
                    'ident': user.username,
                    'host': user.hostname,
                    'nickname': user.nickname,
                    'mode': 'H@',
                    'fullname': user.realname}

            ircemu = ':%(server)s 352 %(myself)s %(channel)s n=%(ident)s ' % data
            ircemu += ' %(host)s %(server) %(nickname) %(mode)s ' % data
            ircemu += ':0 %(fullname)s' % data
            ircmsg = drivers.parseMsg(ircemu)
            if ircmsg: self.irc.feedMsg(ircmsg)

        ircemu = ':%s 315 %s #%s' % (self.remote_host(), myself, channel.channel_name)
        ircmsg = drivers.parseMsg(ircemu)
        if ircmsg: self.irc.feedMsg(ircmsg)

    def command_reply_service(self, *args):
        pass # not implemented

    def command_reply_failed(self, command, commandstr, errorcode, errormsg):
        # global catching failed commands and their error codes
        drivers.log.info('SILC: Reply (FAILED)! %s %s', commandstr, errormsg)

class SilcDriver(drivers.IrcDriver, drivers.ServersMixin):
    def __init__(self, irc):
        self.__parent = super(SilcDriver, self)
        self.__parent.__init__(irc)
        self.irc = irc
        self.running = False
        self.connected = False
        self.silc = SupySilcClient(irc, self)

    def run(self):
        try:
            self.silc.run_one()
            time.sleep(conf.supybot.drivers.poll())
        except:
            import traceback
            traceback.print_exc()
            raise

        self.checkIrcForMsgs()

    def reconnect(self):
        drivers.log.info('SilcDriver: Logging into server')
        host, port = self.__parent._getNextServer()
        self.silc.connect_to_server(host, port)

    def checkIrcForMsgs(self):
        # convert irc messages into silc command equivalents and send it off.

        if self.connected:
            msg = self.irc.takeMsg()
            if msg:
                drivers.log.info('IRC MSG: %s', repr(msg))
                handler = 'do_' + msg.command
                handler = getattr(self, handler, None)
                if handler:
                    handler(msg)
                else:
                    drivers.log.info('!! MSG UNKNOWN: %s', msg.command)

    def do_PRIVMSG(self, msg):
        if msg.args[0][0] == '#':
            chan = self.silc.channels[strip_leading_hash(msg.args[0])]
            self.silc.send_channel_message(chan, msg.args[1].decode('utf8', 'replace'))
        else:
            user = self.silc.users[msg.args[0]]
            self.silc.send_private_message(user, msg.args[1].decode('utf8', 'replace'))

    def do_JOIN(self, msg):
        self.silc.command_call('JOIN %s' % strip_leading_hash(msg.args[0]))

    def do_PART(self, msg):
        self.silc.command_call('LEAVE %s' % strip_leading_hash(msg.args[0]))

    def do_NICK(self, msg):
        self.silc.command_call('NICK %s' % msg.args[0])

        ircemu =self.makeEmulatedIrcMsg('001', 'Welcome')
        ircmsg = drivers.parseMsg(ircemu)
        self.irc.feedMsg(ircmsg)

    def do_PING(self, msg):
        self.silc.last_ping = msg.args[0]
        self.silc.command_call('PING %s' % self.silc.remote_host())

    def do_USER(self, msg):
        ircemu = self.makeEmulatedIrcMsg('002', 'Your host')
        ircmsg = drivers.parseMsg(ircemu)
        self.irc.feedMsg(ircmsg)

        ircemu = self.makeEmulatedIrcMsg('376', 'End MOTD')
        ircmsg = drivers.parseMsg(ircemu)
        self.irc.feedMsg(ircmsg)

    def do_MODE(self, msg):
        pass # don't know what to do with this yet

    def do_WHO(self, msg):
        if msg.args[0][0] == '#':
            self.silc.command_call('USERS %s' % strip_leading_hash(msg.args[0]))
        else:
            print '!! Command Not recognised'

    def do_TOPIC(self, msg):
        if len(msg.args) > 1:
            self.silc.command_call('TOPIC %s %s' %
                                    (strip_leading_hash(msg.args[0]),
                                     msg.args[1]))
        else:
            self.silc.command_call('TOPIC %s' % strip_leading_hash(msg.args[0]))

    def do_QUIT(self, msg):
        self.silc.command_call('QUIT %s' % msg.args[0])

    def do_NAMES(self, msg):
        self.silc.command_call('USERS %s' % strip_leading_hash(msg.args[0]))

    def makeEmulatedIrcMsg(self, cmd, msg, prefix = None, username = None):
        if not prefix:
            prefix = self.silc.remote_host()
        if not username:
            username = self.silc.username
        return ':%s %s %s :%s' % (prefix, cmd, username, msg)

Driver = SilcDriver


text:
from __future__ import unicode_literals

from django.db import models, migrations
import m2m_history.fields
import annoying.fields

class Migration(migrations.Migration):

    dependencies = [
        ('odnoklassniki_users', '0002_user_age'),
    ]

    operations = [
        migrations.CreateModel(
            name='Group',
            fields=[
                ('fetched', models.DateTimeField(db_index=True, null=True, verbose_name='\u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u043e', blank=True)),
                ('id', models.BigIntegerField(help_text='\u0423\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440', serialize=False, verbose_name='ID', primary_key=True)),
                ('albums_count', models.PositiveIntegerField(null=True)),
                ('discussions_count', models.PositiveIntegerField(null=True)),
                ('name', models.CharField(max_length=800)),
                ('description', models.TextField()),
                ('shortname', models.CharField(max_length=50)),
                ('members_count', models.PositiveIntegerField(null=True)),
                ('photo_id', models.BigIntegerField(null=True)),
                ('pic128x128', models.URLField()),
                ('pic50x50', models.URLField()),
                ('pic640x480', models.URLField()),
                ('premium', models.NullBooleanField()),
                ('private', models.NullBooleanField()),
                ('shop_visible_admin', models.NullBooleanField()),
                ('shop_visible_public', models.NullBooleanField()),
                ('attrs', annoying.fields.JSONField(null=True)),
                ('users', m2m_history.fields.ManyToManyHistoryField(to='odnoklassniki_users.User')),
            ],
            options={
                'verbose_name': 'Odnoklassniki group',
                'verbose_name_plural': 'Odnoklassniki groups',
            },
            bases=(models.Model,),
        ),
    ]


text:
function legend(varargin)
   h = legend(varargin{:});
   set(h, 'EdgeColor', mdadata.LEGEND_EDGE_COLOR);
end


text:
<?php
declare(strict_types=1);

namespace AOC\Day9\Part2;

class Decompressor
{
    public function decompress($input)
    {
        $toProcess = $input;
        $length = 0;
        echo PHP_EOL;
        while (strlen($toProcess) > 0) {
            echo "\rTo process: " . strlen($toProcess) . " Length: " . $length;
            if ($toProcess[0] === '(') {
                $toProcess = $this->processMarkedData($toProcess);
            } else {
                $segmentLength = strpos($toProcess, '(') ?: strlen($toProcess);
                $length += $segmentLength;
                $toProcess = substr($toProcess, $segmentLength);
            }
        }
        echo PHP_EOL;
        return $length;
    }

    private function extractCommand(string $command): array
    {
        $matches = [];
        preg_match('/^\((\d+)x(\d+)\)/', $command, $matches);
        $matches = array_slice($matches, 1);
        return [(int)$matches[0], (int)$matches[1]];
    }

    private function processMarkedData($toProcess)
    {
        $command = $this->extractCommand($toProcess);

        // Remove command from string
        $cursor = strpos($toProcess, ')') + 1;
        $toProcess = substr($toProcess, $cursor);

        $toRepeat = substr($toProcess, 0, $command[0]);
        $toProcess = substr($toProcess, $command[0]);

        $decompressed = str_repeat($toRepeat, $command[1]);

        return $decompressed . $toProcess;
    }
}


text:
package io.reactivex.properties;

import io.reactivex.properties.exceptions.StateIsMovingToNullException;
import io.reactivex.properties.exceptions.StateNotValidToMoveException;

/**
 * an interface that is implemented by Objects that can switch between States in a next/back
 * manner
 * <p>
 * Created by Ahmed Adel on 12/31/2016.
 */
public interface SwitchableState<State extends SwitchableState> {

    /**
     * move to the next {@link SwitchableState}
     *
     * @return the next {@link SwitchableState}
     * @throws StateIsMovingToNullException if the next {@link SwitchableState} is {@code null}
     * @throws StateNotValidToMoveException if the current {@link SwitchableState} is not considered
     *                                      valid so it can move to the next one
     */
    State next() throws StateIsMovingToNullException, StateNotValidToMoveException;

    /**
     * move to the previous {@link SwitchableState}
     *
     * @return the previous {@link SwitchableState}
     * @throws StateIsMovingToNullException if the previous {@link SwitchableState} is {@code null}
     * @throws StateNotValidToMoveException if the current {@link SwitchableState} is not considered
     *                                      valid so it can move to the previous one
     */
    State back() throws StateIsMovingToNullException, StateNotValidToMoveException;

}


text:
// Copyright 2018 by PeopleWare n.v..
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

using System;
using System.Data;
using System.Reflection;

using Castle.Core;
using Castle.MicroKernel.Facilities;
using Castle.MicroKernel.Registration;
using Castle.MicroKernel.Resolvers.SpecializedResolvers;

using NHibernate;
using NHibernate.Mapping;

using PPWCode.Vernacular.Exceptions.IV;
using PPWCode.Vernacular.NHibernate.III.Async.Implementations.Providers;
using PPWCode.Vernacular.NHibernate.III.Async.Interfaces.Providers;
using PPWCode.Vernacular.NHibernate.III.DbConstraint;
using PPWCode.Vernacular.NHibernate.III.Providers;
using PPWCode.Vernacular.Persistence.IV;

using Component = Castle.MicroKernel.Registration.Component;

namespace PPWCode.Vernacular.NHibernate.III.CastleWindsor
{
    public class NHibernateFacility : AbstractFacility
    {
        private Type _exceptionTranslator;
        private Type _interceptor;
        private IsolationLevel? _isolationLevel;
        private LifestyleType? _lifestyleType;
        private Type _mappingAssemblies;
        private Type _nhConfiguration;
        private Type _nhibernateSessionFactory;
        private Type _nhProperties;
        private Type _ppwHbmMapping;
        private Type _queryOverCustomExpressions;
        private Type _safeEnvironmentProvider;
        private Type _sessionProvider;
        private Type _transactionProvider;
        private Type _safeEnvironmentProviderAsync;
        private Type _sessionProviderAsync;
        private Type _transactionProviderAsync;
        private Type _identityProvider;
        private Type _timeProvider;
        private bool _useCivilizedEventListener = true;

        public NHibernateFacility UseQueryOverCustomExpressions<T>()
            where T : IQueryOverCustomExpressions
        {
            _queryOverCustomExpressions = typeof(T);
            return this;
        }

        public NHibernateFacility UseTransactionProvider<T>()
            where T : ITransactionProvider
        {
            _transactionProvider = typeof(T);
            return this;
        }

        public NHibernateFacility UseTransactionProviderAsync<T>()
            where T : ITransactionProviderAsync
        {
            _transactionProviderAsync = typeof(T);
            return this;
        }

        public NHibernateFacility UseSafeEnvironmentProvider<T>()
            where T : ISafeEnvironmentProvider
        {
            _safeEnvironmentProvider = typeof(T);
            return this;
        }

        public NHibernateFacility UseSafeEnvironmentProviderAsync<T>()
            where T : ISafeEnvironmentProviderAsync
        {
            _safeEnvironmentProviderAsync = typeof(T);
            return this;
        }

        public NHibernateFacility UseExceptionTranslator<T>()
            where T : IExceptionTranslator
        {
            _exceptionTranslator = typeof(T);
            return this;
        }

        public NHibernateFacility UseSessionProvider<T>(IsolationLevel? isolationLevel)
            where T : ISessionProvider
        {
            _sessionProvider = typeof(T);
            _isolationLevel = isolationLevel;
            return this;
        }

        public NHibernateFacility UseSessionProviderAsync<T>(IsolationLevel? isolationLevel)
            where T : ISessionProviderAsync
        {
            _sessionProviderAsync = typeof(T);
            _isolationLevel = isolationLevel;
            return this;
        }

        public NHibernateFacility UseCivilizedEventListener(bool usage)
        {
            _useCivilizedEventListener = usage;
            return this;
        }

        public NHibernateFacility UseHbmMapping<T>()
            where T : IPpwHbmMapping
        {
            _ppwHbmMapping = typeof(T);
            return this;
        }

        public NHibernateFacility UseNhProperties<T>()
            where T : INhProperties
        {
            _nhProperties = typeof(T);
            return this;
        }

        public NHibernateFacility UseInterceptor<T>()
            where T : IInterceptor
        {
            _interceptor = typeof(T);
            return this;
        }

        public NHibernateFacility UseConfiguration<T>()
            where T : INhConfiguration
        {
            _nhConfiguration = typeof(T);
            return this;
        }

        public NHibernateFacility UseNHibernateSessionFactory<T>()
            where T : INHibernateSessionFactory
        {
            _nhibernateSessionFactory = typeof(T);
            return this;
        }

        public NHibernateFacility UseMappingAssemblies<T>()
            where T : IMappingAssemblies
        {
            _mappingAssemblies = typeof(T);
            return this;
        }

        public NHibernateFacility UseLifestyleTypeForSessions(LifestyleType lifestyleType)
        {
            _lifestyleType = lifestyleType;
            return this;
        }

        public NHibernateFacility UseTimeProvider<T>()
            where T : ITimeProvider
        {
            _timeProvider = typeof(T);
            return this;
        }

        public NHibernateFacility UseIdentityProvider<T>()
            where T : IIdentityProvider
        {
            _identityProvider = typeof(T);
            return this;
        }

        /// <inheritdoc />
        protected override void Init()
        {
            if (_ppwHbmMapping == null)
            {
                throw new Error($"You must supply a dependency of type {nameof(IPpwHbmMapping)}, using the {nameof(UseHbmMapping)} method.");
            }

            if (_mappingAssemblies == null)
            {
                throw new Error($"You must supply a dependency of type {nameof(IMappingAssemblies)}, using the {nameof(UseMappingAssemblies)} method.");
            }

            Kernel.AddSubResolverConditionally(k => new CollectionResolver(k, true));

            Kernel
                .Register(
                    Component
                        .For<IMappingAssemblies>()
                        .ImplementedBy(_mappingAssemblies)
                        .LifeStyle.Singleton,
                    Component
                        .For<IPpwHbmMapping>()
                        .ImplementedBy(_ppwHbmMapping)
                        .LifeStyle.Singleton,
                    Component
                        .For<INhInterceptor>()
                        .ImplementedBy<NhInterceptor>()
                        .IsFallback()
                        .LifeStyle.Singleton);

            IMappingAssemblies mappingAssemblies = Kernel.Resolve<IMappingAssemblies>();
            foreach (Assembly assembly in mappingAssemblies.GetAssemblies())
            {
                Kernel
                    .Register(
                        Classes
                            .FromAssembly(assembly)
                            .BasedOn<IRegisterEventListener>()
                            .WithService.Base()
                            .LifestyleSingleton(),
                        Classes
                            .FromAssembly(assembly)
                            .BasedOn<IAuxiliaryDatabaseObject>()
                            .WithService.Base()
                            .LifestyleSingleton());
            }

            if ((_transactionProviderAsync == null) && (_transactionProvider == null))
            {
                _transactionProviderAsync = typeof(TransactionProviderAsync);
            }

            if (_transactionProviderAsync != null)
            {
                Kernel
                    .Register(
                        Component
                            .For<ITransactionProvider, ITransactionProviderAsync>()
                            .ImplementedBy(_transactionProviderAsync)
                            .LifeStyle.Singleton);
            }
            else
            {
                Kernel
                    .Register(
                        Component
                            .For<ITransactionProvider>()
                            .ImplementedBy(_transactionProvider)
                            .LifeStyle.Singleton);
            }

            Type exceptionTranslator = _exceptionTranslator ?? typeof(ExceptionTranslator);
            Kernel
                .Register(
                    Component
                        .For<IExceptionTranslator>()
                        .ImplementedBy(exceptionTranslator)
                        .LifeStyle.Singleton);

            if ((_safeEnvironmentProviderAsync == null) && (_safeEnvironmentProvider == null))
            {
                _safeEnvironmentProviderAsync = typeof(SafeEnvironmentProviderAsync);
            }

            if (_safeEnvironmentProviderAsync != null)
            {
                Kernel
                    .Register(
                        Component
                            .For<ISafeEnvironmentProvider, ISafeEnvironmentProviderAsync>()
                            .ImplementedBy(_safeEnvironmentProviderAsync)
                            .LifeStyle.Singleton);
            }
            else
            {
                Kernel
                    .Register(
                        Component
                            .For<ISafeEnvironmentProvider>()
                            .ImplementedBy(_safeEnvironmentProvider)
                            .LifeStyle.Singleton);
            }

            if (_useCivilizedEventListener && !Kernel.HasComponent(typeof(CivilizedEventListener)))
            {
                Kernel
                    .Register(
                        Component
                            .For<IRegisterEventListener>()
                            .ImplementedBy<CivilizedEventListener>()
                            .LifeStyle.Singleton);
            }

            Type nhProperties = _nhProperties ?? typeof(EmptyNhProperties);
            Kernel
                .Register(
                    Component
                        .For<INhProperties>()
                        .ImplementedBy(nhProperties)
                        .LifeStyle.Singleton);

            if (_interceptor != null)
            {
                Kernel
                    .Register(
                        Component
                            .For<IInterceptor>()
                            .ImplementedBy(_interceptor)
                            .LifeStyle.Singleton);
            }

            Type configuration = _nhConfiguration ?? typeof(NhConfiguration);
            Kernel
                .Register(
                    Component
                        .For<INhConfiguration>()
                        .ImplementedBy(configuration)
                        .LifeStyle.Singleton);

            LifestyleType lifestyleType = _lifestyleType ?? LifestyleType.Singleton;
            Type nhibernateSessionFactory = _nhibernateSessionFactory ?? typeof(NHibernateSessionFactory);
            Kernel
                .Register(
                    Component
                        .For<INHibernateSessionFactory>()
                        .ImplementedBy(nhibernateSessionFactory)
                        .LifeStyle.Singleton,
                    Component
                        .For<ISession>()
                        .UsingFactoryMethod(
                            _ =>
                            {
                                INHibernateSessionFactory sessionFactoryFactory = Kernel.Resolve<INHibernateSessionFactory>();
                                return sessionFactoryFactory.SessionFactory.OpenSession();
                            })
                        .LifeStyle.Is(lifestyleType),
                    Component
                        .For<IStatelessSession>()
                        .UsingFactoryMethod(
                            _ =>
                            {
                                INHibernateSessionFactory sessionFactoryFactory = Kernel.Resolve<INHibernateSessionFactory>();
                                return sessionFactoryFactory.SessionFactory.OpenStatelessSession();
                            })
                        .LifeStyle.Is(lifestyleType));

            IsolationLevel isolationLevel = _isolationLevel ?? IsolationLevel.Unspecified;
            if ((_sessionProviderAsync == null) && (_sessionProvider == null))
            {
                _sessionProviderAsync = typeof(SessionProviderAsync);
            }

            if (_sessionProviderAsync != null)
            {
                Kernel
                    .Register(
                        Component
                            .For<ISessionProvider, ISessionProviderAsync>()
                            .ImplementedBy(_sessionProviderAsync)
                            .DependsOn(Dependency.OnValue<IsolationLevel>(isolationLevel))
                            .LifeStyle.Transient);
            }
            else
            {
                Kernel
                    .Register(
                        Component
                            .For<ISessionProvider>()
                            .ImplementedBy(_sessionProvider)
                            .DependsOn(Dependency.OnValue<IsolationLevel>(isolationLevel))
                            .LifeStyle.Transient);
            }

            if (_queryOverCustomExpressions != null)
            {
                Kernel
                    .Register(
                        Component
                            .For<IQueryOverCustomExpressions>()
                            .ImplementedBy(_queryOverCustomExpressions)
                            .LifeStyle.Singleton);
                IQueryOverCustomExpressions queryOverCustomExpressions = Kernel.Resolve<IQueryOverCustomExpressions>();
                queryOverCustomExpressions.Initialize();
            }

            if (_timeProvider != null)
            {
                Kernel
                    .Register(
                        Component
                            .For<ITimeProvider>()
                            .ImplementedBy(_timeProvider)
                            .LifeStyle.Singleton);
            }
            else if (!Kernel.HasComponent(typeof(ITimeProvider)))
            {
                Kernel
                    .Register(
                        Component
                            .For<ITimeProvider>()
                            .ImplementedBy<TimeProvider>()
                            .IsFallback()
                            .LifeStyle.Singleton);
            }

            if (_identityProvider != null)
            {
                Kernel
                    .Register(
                        Component
                            .For<IIdentityProvider>()
                            .ImplementedBy(_identityProvider)
                            .LifeStyle.Singleton);
            }
            else if (!Kernel.HasComponent(typeof(IIdentityProvider)))
            {
                Kernel
                    .Register(
                        Component
                            .For<IIdentityProvider>()
                            .ImplementedBy<IdentityProvider>()
                            .IsFallback()
                            .LifeStyle.Singleton);
            }
        }
    }
}


text:
import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'app-comp-1808',
  templateUrl: './comp-1808.component.html',
  styleUrls: ['./comp-1808.component.css']
})
export class Comp1808Component implements OnInit {

  constructor() { }

  ngOnInit() {
  }

}