using System;
using System.Linq.Expressions;
using UnityEngine.PostProcessing;

namespace UnityEditor.PostProcessing
{
    [CustomEditor(typeof(PostProcessingBehaviour))]
    public class PostProcessingBehaviourEditor : Editor
    {
        SerializedProperty m_Profile;

        public void OnEnable()
        {
            m_Profile = FindSetting((PostProcessingBehaviour x) => x.profile);
        }

        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            EditorGUILayout.PropertyField(m_Profile);

            serializedObject.ApplyModifiedProperties();
        }

        SerializedProperty FindSetting<T, TValue>(Expression<Func<T, TValue>> expr)
        {
            return serializedObject.FindProperty(ReflectionUtils.GetFieldPath(expr));
        }
    }
}

{'repo_name': 'AdultLink/VerticalDissolve', 'stars': '394', 'repo_language': 'C#', 'file_name': 'AudioManager.asset', 'mime_type': 'text/plain', 'hash': 2291254966190659847, 'source_dataset': 'data'}


/*
 * Bach - Java Shell Builder
 * Copyright (C) 2020 Christian Stein
 *
 * 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
 *
 *     https://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.
 */

package de.sormuras.bach;

import java.io.PrintWriter;
import java.io.StringWriter;
import java.lang.System.Logger;
import java.lang.System.Logger.Level;
import java.time.Duration;
import java.time.Instant;
import java.util.ArrayDeque;
import java.util.Deque;
import java.util.EnumSet;
import java.util.NoSuchElementException;
import java.util.ServiceLoader;
import java.util.Set;
import java.util.TreeSet;
import java.util.concurrent.ConcurrentLinkedDeque;
import java.util.spi.ToolProvider;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;

/** A tool shell executes tool calls. */
public class ToolShell {

  /** A feature flag of the tool shell implementation. */
  public enum Flag {
    /** Store all tool call response objects. */
    RECORD_HISTORY,

    /** Verify that the last tool call returned {@code 0} as its exit code. */
    FAIL_FAST;

    /** The default set of feature flag that contains all feature flag constants. */
    public static final Set<Flag> DEFAULTS = EnumSet.allOf(Flag.class);
  }

  private final Logger logger;
  private final Set<Flag> flags;
  private final Deque<ToolResponse> history;

  /** Initializes a default tool shell instance. */
  public ToolShell() {
    this(System.getLogger(ToolShell.class.getName()), Flag.DEFAULTS);
  }

  /** Initializes a tool shell instance with the given components. */
  public ToolShell(Logger logger, Set<Flag> flags) {
    this.logger = logger;
    this.flags = flags.isEmpty() ? Set.of() : EnumSet.copyOf(flags);
    this.history = new ConcurrentLinkedDeque<>();
  }

  /**
   * Return the feature flag set.
   *
   * @return a set of feature flag constants
   */
  public Set<Flag> getFlags() {
    return new TreeSet<>(flags);
  }

  /**
   * Return the history of tool calls as recorded in response objects.
   *
   * @return an unmodifiable collection of tool response objects
   */
  public Deque<ToolResponse> getHistory() {
    return new ArrayDeque<>(history);
  }

  protected ToolProvider computeToolProvider(ToolCall call) {
    if (call instanceof ToolProvider) return (ToolProvider) call;
    return computeToolProvider(call.name());
  }

  protected ToolProvider computeToolProvider(String name) {
    var contextLoader = Thread.currentThread().getContextClassLoader();
    var serviceLoader = ServiceLoader.load(ToolProvider.class, contextLoader);
    return computeToolProvider(name, StreamSupport.stream(serviceLoader.spliterator(), false));
  }

  protected ToolProvider computeToolProvider(String name, Stream<ToolProvider> providers) {
    return providers
        .filter(provider -> provider.name().equals(name))
        .findFirst()
        .orElseThrow(() -> new NoSuchElementException("No provider for: " + name));
  }

  protected String computeMessageText(StringWriter writer) {
    if (writer.getBuffer().length() == 0) return "";
    return writer.toString().strip();
  }

  /**
   * Run the given tool call.
   *
   * @param name the name of the tool to call
   * @param args the arguments of this call
   */
  public void call(String name, String... args) {
    call(computeToolProvider(name), args);
  }

  /**
   * Run the given tool call.
   *
   * @param call the tool call to run
   */
  public void call(ToolCall call) {
    call(computeToolProvider(call), call.args());
  }

  /**
   * Run all given tool calls concurrently.
   *
   * @param call one tool call to run
   * @param more more tool calls to run in parallel
   */
  public void call(ToolCall call, ToolCall... more) {
    Stream.concat(Stream.of(call), Stream.of(more)).parallel().forEach(this::call);
  }

  /**
   * Run all given tool calls concurrently.
   *
   * @param calls tool calls to run in parallel
   */
  public void call(Iterable<ToolCall> calls) {
    StreamSupport.stream(calls.spliterator(), true).forEach(this::call);
  }

  /**
   * Run the given tool provider with the given arguments.
   *
   * @param provider the tool provider to run
   * @param args the arguments of this call
   */
  public ToolResponse call(ToolProvider provider, String... args) {
    var currentThread = Thread.currentThread();
    var currentLoader = currentThread.getContextClassLoader();
    currentThread.setContextClassLoader(provider.getClass().getClassLoader());
    try {
      return call(currentThread, provider, args);
    } finally {
      currentThread.setContextClassLoader(currentLoader);
    }
  }

  private ToolResponse call(Thread thread, ToolProvider provider, String... args) {
    var output = new StringWriter();
    var outputPrintWriter = new PrintWriter(output);
    var errors = new StringWriter();
    var errorsPrintWriter = new PrintWriter(errors);
    var name = provider.name();
    logger.log(Level.TRACE, "Calling " + name + " with " + args.length + " argument(s)");

    var start = Instant.now();
    var code = provider.run(outputPrintWriter, errorsPrintWriter, args);
    var duration = Duration.between(start, Instant.now());

    var out = computeMessageText(output);
    var err = computeMessageText(errors);
    var response = new ToolResponse(name, args, thread.getId(), duration, code, out, err);
    logger.log(Level.DEBUG, response.toString());

    var discardHistory = !flags.contains(Flag.RECORD_HISTORY);
    if (discardHistory) history.clear();
    history.add(response); // always store the "last" response

    if (flags.contains(Flag.FAIL_FAST)) response.checkSuccessful();
    return response;
  }

  public void checkHistoryForErrors() {
    var errors = history.stream().filter(ToolResponse::isError).collect(Collectors.toList());
    logger.log(Level.DEBUG, errors.size() + " error(s) found in " + history.size() + " responses");
    if (errors.isEmpty()) return;
    throw new RuntimeException("Response history contains at least one error: " + errors);
  }
}

{'repo_name': 'sormuras/bach', 'stars': '142', 'repo_language': 'Java', 'file_name': 'module-info.java', 'mime_type': 'text/plain', 'hash': -6464107659368602262, 'source_dataset': 'data'}


from odoo import models

class ThemeBootswatch(models.AbstractModel):
    _inherit = 'theme.utils'

    def _theme_bootswatch_post_copy(self, mod):
        self.disable_view('website_theme_install.customize_modal')

{'repo_name': 'odoo/odoo', 'stars': '18107', 'repo_language': 'JavaScript', 'file_name': 'format', 'mime_type': 'text/plain', 'hash': -6999872325804786622, 'source_dataset': 'data'}


緒方れいな最新番号
【IDB-029】Angel HYPER ナース編
【MX-014】パンストGirls 2
【ARD-018】美乳 GOLD
【HP-016】放課後美少女かたろぐ10 緒方れいな</a>2003-01-11アイデアポケット$$$HIGH-SCHO60分钟

{'repo_name': 'imfht/fanhaodaquan', 'stars': '2576', 'repo_language': 'None', 'file_name': 'file2cdn.js', 'mime_type': 'text/plain', 'hash': 1609746892541303813, 'source_dataset': 'data'}


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>LCOV - doc-coverage.info - Azure/Cqrs.Azure.Storage/DataStores/TableStorageDataStoreConnectionStringFactory.cs</title>
  <link rel="stylesheet" type="text/css" href="../../../gcov.css">

Documentation Coverage Report

            Current view:
            top level - Azure/Cqrs.Azure.Storage/DataStores - TableStorageDataStoreConnectionStringFactory.cs

            Hit
            Total
            Coverage

            Version:
            4.0

            Artefacts:
            4
            4
            100.0 %

            Date:
            2019-11-24 03:15:41

          Line data    Source code

       1             : #region Copyright
       2             : // // -----------------------------------------------------------------------
       3             : // // <copyright company="Chinchilla Software Limited">
       4             : // //   Copyright Chinchilla Software Limited. All rights reserved.
       5             : // // </copyright>
       6             : // // -----------------------------------------------------------------------
       7             : #endregion
       8             :
       9             : using System;
      10             : using Cqrs.Configuration;
      11             : using Chinchilla.Logging;
      12             : using Cqrs.Azure.BlobStorage.DataStores;
      13             : using Cqrs.DataStores;
      14             :
      15             : namespace Cqrs.Azure.Storage.DataStores
      16             : {
      17             :         /// <summary>
      18             :         /// A factory for getting connection strings and container names for <see cref="IDataStore{TData}"/> access.
      19             :         /// This factory supports reading and writing from separate storage accounts. Specifically you can have as many different storage accounts as you want to configure when writing.
      20             :         /// This allows for manual mirroring of data while reading from the fastest/closest location possible.
      21             :         /// </summary>
      22             :         public class TableStorageDataStoreConnectionStringFactory<TData> : TableStorageDataStoreConnectionStringFactory
      23           1 :         {
      24             :                 /// <summary>
      25             :                 /// Instantiates a new instance of <see cref="TableStorageDataStoreConnectionStringFactory{TData}"/>.
      26             :                 /// </summary>
      27           1 :                 public TableStorageDataStoreConnectionStringFactory(IConfigurationManager configurationManager, ILogger logger)
      28             :                         : base(configurationManager, logger)
      29             :                 {
      30             :                 }
      31             :
      32             :                 #region Overrides of TableStorageDataStoreConnectionStringFactory
      33             :
      34             :                 /// <summary>
      35             :                 /// Returns <see cref="GetTableName{TData1}"/>.
      36             :                 /// </summary>
      37             :                 /// <returns><see cref="GetTableName{TData1}"/></returns>
      38           1 :                 public override string GetContainerName()
      39             :                 {
      40             :                         return GetTableName<TData>();
      41             :                 }
      42             :
      43             :                 /// <summary>
      44             :                 /// Generates the name of the table for <typeparamref name="TData1"/> that matches naming rules for Azure Storage.
      45             :                 /// The value differs from <see cref="TableStorageDataStoreConnectionStringFactory.GetTableName{TData}"/> in that it appends "V2" to the end of the table name.
      46             :                 /// </summary>
      47             :                 /// <typeparam name="TData1">The <see cref="Type"/> of data to read or write.</typeparam>
      48             :                 /// <remarks>https://blogs.msdn.microsoft.com/jmstall/2014/06/12/azure-storage-naming-rules/</remarks>
      49           1 :                 public override string GetTableName<TData1>()
      50             :                 {
      51             :                         string tableName = base.GetTableName<TData>();
      52             :                         if (tableName.Length > 34)
      53             :                                 tableName = tableName.Substring(tableName.Length - 34);
      54             :                         return string.Format("{0}V2", tableName);
      55             :                 }
      56             :
      57             :                 #endregion
      58             :         }
      59             : }

Generated by: LCOV version 1.13

{'repo_name': 'Chinchilla-Software-Com/CQRS', 'stars': '285', 'repo_language': 'C#', 'file_name': 'ConversationReportProcessManagerEventHandlers.cs.gcov.html', 'mime_type': 'text/html', 'hash': -4618372167996581380, 'source_dataset': 'data'}


using Nop.Web.Framework.Models;

namespace Nop.Web.Areas.Admin.Models.Settings
{
    /// <summary>
    /// Represents a sort option list model
    /// </summary>
    public partial class SortOptionListModel : BasePagedListModel<SortOptionModel>
    {
    }
}

{'repo_name': 'nopSolutions/nopCommerce', 'stars': '5060', 'repo_language': 'C#', 'file_name': 'Readme.txt', 'mime_type': 'text/plain', 'hash': -7631171355134872556, 'source_dataset': 'data'}


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace FastColoredTextBoxNS
{
    public partial class HotkeysEditorForm : Form
    {
        BindingList<HotkeyWrapper> wrappers = new BindingList<HotkeyWrapper>();

        public HotkeysEditorForm(HotkeysMapping hotkeys)
        {
            InitializeComponent();
            BuildWrappers(hotkeys);
            dgv.DataSource = wrappers;
        }

        int CompereKeys(Keys key1, Keys key2)
        {
            var res = ((int)key1 & 0xff).CompareTo((int)key2 & 0xff);
            if (res == 0)
                res = key1.CompareTo(key2);

            return res;
        }

        private void BuildWrappers(HotkeysMapping hotkeys)
        {
            var keys = new List<Keys>(hotkeys.Keys);
            keys.Sort(CompereKeys);

            wrappers.Clear();
            foreach (var k in keys)
                wrappers.Add(new HotkeyWrapper(k, hotkeys[k]));
        }

        /// <summary>
        /// Returns edited hotkey map
        /// </summary>
        /// <returns></returns>
        public HotkeysMapping GetHotkeys()
        {
            var result = new HotkeysMapping();
            foreach (var w in wrappers)
                result[w.ToKeyData()] = w.Action;

            return result;
        }

        private void btAdd_Click(object sender, EventArgs e)
        {
            wrappers.Add(new HotkeyWrapper(Keys.None, FCTBAction.None));
        }

        private void dgv_RowsAdded(object sender, DataGridViewRowsAddedEventArgs e)
        {
            var cell = (dgv[0, e.RowIndex] as DataGridViewComboBoxCell);
            if(cell.Items.Count == 0)
            foreach(var item in new string[]{"", "Ctrl", "Ctrl + Shift", "Ctrl + Alt", "Shift", "Shift + Alt", "Alt", "Ctrl + Shift + Alt"})
                cell.Items.Add(item);

            cell = (dgv[1, e.RowIndex] as DataGridViewComboBoxCell);
            if (cell.Items.Count == 0)
            foreach (var item in Enum.GetValues(typeof(Keys)))
                cell.Items.Add(item);

            cell = (dgv[2, e.RowIndex] as DataGridViewComboBoxCell);
            if (cell.Items.Count == 0)
            foreach (var item in Enum.GetValues(typeof(FCTBAction)))
                cell.Items.Add(item);
        }

        private void btResore_Click(object sender, EventArgs e)
        {
            HotkeysMapping h = new HotkeysMapping();
            h.InitDefault();
            BuildWrappers(h);
        }

        private void btRemove_Click(object sender, EventArgs e)
        {
            for (int i = dgv.RowCount - 1; i >= 0; i--)
                if (dgv.Rows[i].Selected) dgv.Rows.RemoveAt(i);
        }

        private void HotkeysEditorForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            if(DialogResult == System.Windows.Forms.DialogResult.OK)
            {
                var actions = GetUnAssignedActions();
                if (!string.IsNullOrEmpty(actions))
                {
                    if (MessageBox.Show("Some actions are not assigned!\r\nActions: " + actions + "\r\nPress Yes to save and exit, press No to continue editing", "Some actions is not assigned", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == System.Windows.Forms.DialogResult.No)
                        e.Cancel = true;
                }
            }
        }

        private string GetUnAssignedActions()
        {
            StringBuilder sb = new StringBuilder();
            var dic = new Dictionary<FCTBAction, FCTBAction>();

            foreach (var w in wrappers)
                dic[w.Action] = w.Action;

            foreach (var item in Enum.GetValues(typeof(FCTBAction)))
            if ((FCTBAction)item != FCTBAction.None)
            if(!((FCTBAction)item).ToString().StartsWith("CustomAction"))
            {
                if(!dic.ContainsKey((FCTBAction)item))
                    sb.Append(item+", ");
            }

            return sb.ToString().TrimEnd(' ', ',');
        }
    }

    internal class HotkeyWrapper
    {
        public HotkeyWrapper(Keys keyData, FCTBAction action)
        {
            KeyEventArgs a = new KeyEventArgs(keyData);
            Ctrl = a.Control;
            Shift = a.Shift;
            Alt = a.Alt;

            Key = a.KeyCode;
            Action = action;
        }

        public Keys ToKeyData()
        {
            var res = Key;
            if (Ctrl) res |= Keys.Control;
            if (Alt) res |= Keys.Alt;
            if (Shift) res |= Keys.Shift;

            return res;
        }

        bool Ctrl;
        bool Shift;
        bool Alt;

        public string Modifiers
        {
            get
            {
                var res = "";
                if (Ctrl) res += "Ctrl + ";
                if (Shift) res += "Shift + ";
                if (Alt) res += "Alt + ";

                return res.Trim(' ', '+');
            }
            set
            {
                if (value == null)
                {
                    Ctrl = Alt = Shift = false;
                }
                else
                {
                    Ctrl = value.Contains("Ctrl");
                    Shift = value.Contains("Shift");
                    Alt = value.Contains("Alt");
                }
            }
        }

        public Keys Key { get; set; }
        public FCTBAction Action { get; set; }
    }
}

{'repo_name': 'PavelTorgashov/FastColoredTextBox', 'stars': '875', 'repo_language': 'C#', 'file_name': 'Resources.Designer.vb', 'mime_type': 'text/plain', 'hash': -6049728213579733405, 'source_dataset': 'data'}


[Home](./index.md) > [gatsby-plugin-next-seo](./gatsby-plugin-next-seo.md) > [BaseSeoProps](./gatsby-plugin-next-seo.baseseoprops.md)

## BaseSeoProps interface

Signature:

```typescript
export interface BaseSeoProps
```

## Properties

|  Property | Type | Description |
|  --- | --- | --- |
|  [canonical](./gatsby-plugin-next-seo.baseseoprops.canonical.md) | string | Set the page canonical url. |
|  [description](./gatsby-plugin-next-seo.baseseoprops.description.md) | string | Set the page meta description. |
|  [facebook](./gatsby-plugin-next-seo.baseseoprops.facebook.md) | { appId: string; } | Used for Facebook Insights, you must add a facebook app ID to your page to for it. |
|  [language](./gatsby-plugin-next-seo.baseseoprops.language.md) | string | The language being used for the current page.This adds the lang attribute to the <html /> e.g. tag https://web.dev/html-has-lang/. |
|  [languageAlternates](./gatsby-plugin-next-seo.baseseoprops.languagealternates.md) | LanguageAlternate\[\] | Set the language of the alternate urls. |
|  [linkTags](./gatsby-plugin-next-seo.baseseoprops.linktags.md) | LinkProps\[\] | Allows you to add a link tag that is not documented here. |
|  [metaTags](./gatsby-plugin-next-seo.baseseoprops.metatags.md) | MetaProps\[\] | Allows you to add a meta tag that is not documented here. |
|  [mobileAlternate](./gatsby-plugin-next-seo.baseseoprops.mobilealternate.md) | MobileAlternate | Mobile configuration object. |
|  [nofollow](./gatsby-plugin-next-seo.baseseoprops.nofollow.md) | boolean | Sets whether page should be followed or not. |
|  [noindex](./gatsby-plugin-next-seo.baseseoprops.noindex.md) | boolean | Sets whether page should be indexed or not. |
|  [openGraph](./gatsby-plugin-next-seo.baseseoprops.opengraph.md) | [OpenGraph](./gatsby-plugin-next-seo.opengraph.md) | The open graph configuration object. |
|  [title](./gatsby-plugin-next-seo.baseseoprops.title.md) | string | Set the meta title of the page |
|  [titleTemplate](./gatsby-plugin-next-seo.baseseoprops.titletemplate.md) | string | Allows you to set default title template that will be added to your title. |
|  [twitter](./gatsby-plugin-next-seo.baseseoprops.twitter.md) | [Twitter](./gatsby-plugin-next-seo.twitter.md) | The twitter configuration object. |

{'repo_name': 'ifiokjr/gatsby-plugin-next-seo', 'stars': '108', 'repo_language': 'TypeScript', 'file_name': 'settings.json', 'mime_type': 'text/plain', 'hash': 320912138875754402, 'source_dataset': 'data'}


0(1) element: null (InstructionImpl)
1(2) element: Perl5 (InstructionImpl)
2(3) element: PsiPerlStringSqImpl(Perl5: STRING_SQ) (InstructionImpl)
3(4) element: PsiPerlPrintExprImpl(Perl5: PRINT_EXPR) (InstructionImpl)
4(5) element: PsiPerlHeredocOpenerImpl(Perl5: HEREDOC_OPENER) (InstructionImpl)
5(6) element: PerlHeredocElementImpl(Perl5: HEREDOC) (InstructionImpl)
6(7) element: PsiPerlStringSqImpl(Perl5: STRING_SQ) (InstructionImpl)
7(8) element: PsiPerlPrintExprImpl(Perl5: PRINT_EXPR) (InstructionImpl)
8(9) element: PsiPerlScalarVariableImpl(Perl5: SCALAR_VARIABLE) (InstructionImpl)
9(10) element: PsiPerlPrintExprImpl(Perl5: PRINT_EXPR) (InstructionImpl)
10() element: null (InstructionImpl)

{'repo_name': 'Camelcade/Perl5-IDEA', 'stars': '324', 'repo_language': 'Java', 'file_name': 'hurricup.xml', 'mime_type': 'text/plain', 'hash': 2062003604143400028, 'source_dataset': 'data'}


/*
Copyright 2015 The Kubernetes Authors.

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.
*/

package cache

import (
	"fmt"
	"sync"
	"time"

	"k8s.io/apimachinery/pkg/runtime"
	"k8s.io/apimachinery/pkg/util/clock"
	utilruntime "k8s.io/apimachinery/pkg/util/runtime"
	"k8s.io/apimachinery/pkg/util/wait"
	"k8s.io/client-go/util/retry"
	"k8s.io/utils/buffer"

	"k8s.io/klog"
)

// SharedInformer provides eventually consistent linkage of its
// clients to the authoritative state of a given collection of
// objects.  An object is identified by its API group, kind/resource,
// namespace, and name; the `ObjectMeta.UID` is not part of an
// object's ID as far as this contract is concerned.  One
// SharedInformer provides linkage to objects of a particular API
// group and kind/resource.  The linked object collection of a
// SharedInformer may be further restricted to one namespace and/or by
// label selector and/or field selector.
//
// The authoritative state of an object is what apiservers provide
// access to, and an object goes through a strict sequence of states.
// An object state is either "absent" or present with a
// ResourceVersion and other appropriate content.
//
// A SharedInformer gets object states from apiservers using a
// sequence of LIST and WATCH operations.  Through this sequence the
// apiservers provide a sequence of "collection states" to the
// informer, where each collection state defines the state of every
// object of the collection.  No promise --- beyond what is implied by
// other remarks here --- is made about how one informer's sequence of
// collection states relates to a different informer's sequence of
// collection states.
//
// A SharedInformer maintains a local cache, exposed by GetStore() and
// by GetIndexer() in the case of an indexed informer, of the state of
// each relevant object.  This cache is eventually consistent with the
// authoritative state.  This means that, unless prevented by
// persistent communication problems, if ever a particular object ID X
// is authoritatively associated with a state S then for every
// SharedInformer I whose collection includes (X, S) eventually either
// (1) I's cache associates X with S or a later state of X, (2) I is
// stopped, or (3) the authoritative state service for X terminates.
// To be formally complete, we say that the absent state meets any
// restriction by label selector or field selector.
//
// The local cache starts out empty, and gets populated and updated
// during `Run()`.
//
// As a simple example, if a collection of objects is henceforeth
// unchanging, a SharedInformer is created that links to that
// collection, and that SharedInformer is `Run()` then that
// SharedInformer's cache eventually holds an exact copy of that
// collection (unless it is stopped too soon, the authoritative state
// service ends, or communication problems between the two
// persistently thwart achievement).
//
// As another simple example, if the local cache ever holds a
// non-absent state for some object ID and the object is eventually
// removed from the authoritative state then eventually the object is
// removed from the local cache (unless the SharedInformer is stopped
// too soon, the authoritative state service ends, or communication
// problems persistently thwart the desired result).
//
// The keys in the Store are of the form namespace/name for namespaced
// objects, and are simply the name for non-namespaced objects.
// Clients can use `MetaNamespaceKeyFunc(obj)` to extract the key for
// a given object, and `SplitMetaNamespaceKey(key)` to split a key
// into its constituent parts.
//
// A client is identified here by a ResourceEventHandler.  For every
// update to the SharedInformer's local cache and for every client
// added before `Run()`, eventually either the SharedInformer is
// stopped or the client is notified of the update.  A client added
// after `Run()` starts gets a startup batch of notifications of
// additions of the object existing in the cache at the time that
// client was added; also, for every update to the SharedInformer's
// local cache after that client was added, eventually either the
// SharedInformer is stopped or that client is notified of that
// update.  Client notifications happen after the corresponding cache
// update and, in the case of a SharedIndexInformer, after the
// corresponding index updates.  It is possible that additional cache
// and index updates happen before such a prescribed notification.
// For a given SharedInformer and client, the notifications are
// delivered sequentially.  For a given SharedInformer, client, and
// object ID, the notifications are delivered in order.
//
// A client must process each notification promptly; a SharedInformer
// is not engineered to deal well with a large backlog of
// notifications to deliver.  Lengthy processing should be passed off
// to something else, for example through a
// `client-go/util/workqueue`.
//
// Each query to an informer's local cache --- whether a single-object
// lookup, a list operation, or a use of one of its indices --- is
// answered entirely from one of the collection states received by
// that informer.
//
// A delete notification exposes the last locally known non-absent
// state, except that its ResourceVersion is replaced with a
// ResourceVersion in which the object is actually absent.
type SharedInformer interface {
	// AddEventHandler adds an event handler to the shared informer using the shared informer's resync
	// period.  Events to a single handler are delivered sequentially, but there is no coordination
	// between different handlers.
	AddEventHandler(handler ResourceEventHandler)
	// AddEventHandlerWithResyncPeriod adds an event handler to the
	// shared informer using the specified resync period.  The resync
	// operation consists of delivering to the handler a create
	// notification for every object in the informer's local cache; it
	// does not add any interactions with the authoritative storage.
	AddEventHandlerWithResyncPeriod(handler ResourceEventHandler, resyncPeriod time.Duration)
	// GetStore returns the informer's local cache as a Store.
	GetStore() Store
	// GetController gives back a synthetic interface that "votes" to start the informer
	GetController() Controller
	// Run starts and runs the shared informer, returning after it stops.
	// The informer will be stopped when stopCh is closed.
	Run(stopCh <-chan struct{})
	// HasSynced returns true if the shared informer's store has been
	// informed by at least one full LIST of the authoritative state
	// of the informer's object collection.  This is unrelated to "resync".
	HasSynced() bool
	// LastSyncResourceVersion is the resource version observed when last synced with the underlying
	// store. The value returned is not synchronized with access to the underlying store and is not
	// thread-safe.
	LastSyncResourceVersion() string
}

// SharedIndexInformer provides add and get Indexers ability based on SharedInformer.
type SharedIndexInformer interface {
	SharedInformer
	// AddIndexers add indexers to the informer before it starts.
	AddIndexers(indexers Indexers) error
	GetIndexer() Indexer
}

// NewSharedInformer creates a new instance for the listwatcher.
func NewSharedInformer(lw ListerWatcher, objType runtime.Object, resyncPeriod time.Duration) SharedInformer {
	return NewSharedIndexInformer(lw, objType, resyncPeriod, Indexers{})
}

// NewSharedIndexInformer creates a new instance for the listwatcher.
func NewSharedIndexInformer(lw ListerWatcher, objType runtime.Object, defaultEventHandlerResyncPeriod time.Duration, indexers Indexers) SharedIndexInformer {
	realClock := &clock.RealClock{}
	sharedIndexInformer := &sharedIndexInformer{
		processor:                       &sharedProcessor{clock: realClock},
		indexer:                         NewIndexer(DeletionHandlingMetaNamespaceKeyFunc, indexers),
		listerWatcher:                   lw,
		objectType:                      objType,
		resyncCheckPeriod:               defaultEventHandlerResyncPeriod,
		defaultEventHandlerResyncPeriod: defaultEventHandlerResyncPeriod,
		cacheMutationDetector:           NewCacheMutationDetector(fmt.Sprintf("%T", objType)),
		clock:                           realClock,
	}
	return sharedIndexInformer
}

// InformerSynced is a function that can be used to determine if an informer has synced.  This is useful for determining if caches have synced.
type InformerSynced func() bool

const (
	// syncedPollPeriod controls how often you look at the status of your sync funcs
	syncedPollPeriod = 100 * time.Millisecond

	// initialBufferSize is the initial number of event notifications that can be buffered.
	initialBufferSize = 1024
)

// WaitForNamedCacheSync is a wrapper around WaitForCacheSync that generates log messages
// indicating that the caller identified by name is waiting for syncs, followed by
// either a successful or failed sync.
func WaitForNamedCacheSync(controllerName string, stopCh <-chan struct{}, cacheSyncs ...InformerSynced) bool {
	klog.Infof("Waiting for caches to sync for %s", controllerName)

	if !WaitForCacheSync(stopCh, cacheSyncs...) {
		utilruntime.HandleError(fmt.Errorf("unable to sync caches for %s", controllerName))
		return false
	}

	klog.Infof("Caches are synced for %s ", controllerName)
	return true
}

// WaitForCacheSync waits for caches to populate.  It returns true if it was successful, false
// if the controller should shutdown
// callers should prefer WaitForNamedCacheSync()
func WaitForCacheSync(stopCh <-chan struct{}, cacheSyncs ...InformerSynced) bool {
	err := wait.PollImmediateUntil(syncedPollPeriod,
		func() (bool, error) {
			for _, syncFunc := range cacheSyncs {
				if !syncFunc() {
					return false, nil
				}
			}
			return true, nil
		},
		stopCh)
	if err != nil {
		klog.V(2).Infof("stop requested")
		return false
	}

	klog.V(4).Infof("caches populated")
	return true
}

type sharedIndexInformer struct {
	indexer    Indexer
	controller Controller

	processor             *sharedProcessor
	cacheMutationDetector MutationDetector

	// This block is tracked to handle late initialization of the controller
	listerWatcher ListerWatcher
	objectType    runtime.Object

	// resyncCheckPeriod is how often we want the reflector's resync timer to fire so it can call
	// shouldResync to check if any of our listeners need a resync.
	resyncCheckPeriod time.Duration
	// defaultEventHandlerResyncPeriod is the default resync period for any handlers added via
	// AddEventHandler (i.e. they don't specify one and just want to use the shared informer's default
	// value).
	defaultEventHandlerResyncPeriod time.Duration
	// clock allows for testability
	clock clock.Clock

	started, stopped bool
	startedLock      sync.Mutex

	// blockDeltas gives a way to stop all event distribution so that a late event handler
	// can safely join the shared informer.
	blockDeltas sync.Mutex
}

// dummyController hides the fact that a SharedInformer is different from a dedicated one
// where a caller can `Run`.  The run method is disconnected in this case, because higher
// level logic will decide when to start the SharedInformer and related controller.
// Because returning information back is always asynchronous, the legacy callers shouldn't
// notice any change in behavior.
type dummyController struct {
	informer *sharedIndexInformer
}

func (v *dummyController) Run(stopCh <-chan struct{}) {
}

func (v *dummyController) HasSynced() bool {
	return v.informer.HasSynced()
}

func (v *dummyController) LastSyncResourceVersion() string {
	return ""
}

type updateNotification struct {
	oldObj interface{}
	newObj interface{}
}

type addNotification struct {
	newObj interface{}
}

type deleteNotification struct {
	oldObj interface{}
}

func (s *sharedIndexInformer) Run(stopCh <-chan struct{}) {
	defer utilruntime.HandleCrash()

	fifo := NewDeltaFIFO(MetaNamespaceKeyFunc, s.indexer)

	cfg := &Config{
		Queue:            fifo,
		ListerWatcher:    s.listerWatcher,
		ObjectType:       s.objectType,
		FullResyncPeriod: s.resyncCheckPeriod,
		RetryOnError:     false,
		ShouldResync:     s.processor.shouldResync,

		Process: s.HandleDeltas,
	}

	func() {
		s.startedLock.Lock()
		defer s.startedLock.Unlock()

		s.controller = New(cfg)
		s.controller.(*controller).clock = s.clock
		s.started = true
	}()

	// Separate stop channel because Processor should be stopped strictly after controller
	processorStopCh := make(chan struct{})
	var wg wait.Group
	defer wg.Wait()              // Wait for Processor to stop
	defer close(processorStopCh) // Tell Processor to stop
	wg.StartWithChannel(processorStopCh, s.cacheMutationDetector.Run)
	wg.StartWithChannel(processorStopCh, s.processor.run)

	defer func() {
		s.startedLock.Lock()
		defer s.startedLock.Unlock()
		s.stopped = true // Don't want any new listeners
	}()
	s.controller.Run(stopCh)
}

func (s *sharedIndexInformer) HasSynced() bool {
	s.startedLock.Lock()
	defer s.startedLock.Unlock()

	if s.controller == nil {
		return false
	}
	return s.controller.HasSynced()
}

func (s *sharedIndexInformer) LastSyncResourceVersion() string {
	s.startedLock.Lock()
	defer s.startedLock.Unlock()

	if s.controller == nil {
		return ""
	}
	return s.controller.LastSyncResourceVersion()
}

func (s *sharedIndexInformer) GetStore() Store {
	return s.indexer
}

func (s *sharedIndexInformer) GetIndexer() Indexer {
	return s.indexer
}

func (s *sharedIndexInformer) AddIndexers(indexers Indexers) error {
	s.startedLock.Lock()
	defer s.startedLock.Unlock()

	if s.started {
		return fmt.Errorf("informer has already started")
	}

	return s.indexer.AddIndexers(indexers)
}

func (s *sharedIndexInformer) GetController() Controller {
	return &dummyController{informer: s}
}

func (s *sharedIndexInformer) AddEventHandler(handler ResourceEventHandler) {
	s.AddEventHandlerWithResyncPeriod(handler, s.defaultEventHandlerResyncPeriod)
}

func determineResyncPeriod(desired, check time.Duration) time.Duration {
	if desired == 0 {
		return desired
	}
	if check == 0 {
		klog.Warningf("The specified resyncPeriod %v is invalid because this shared informer doesn't support resyncing", desired)
		return 0
	}
	if desired < check {
		klog.Warningf("The specified resyncPeriod %v is being increased to the minimum resyncCheckPeriod %v", desired, check)
		return check
	}
	return desired
}

const minimumResyncPeriod = 1 * time.Second

func (s *sharedIndexInformer) AddEventHandlerWithResyncPeriod(handler ResourceEventHandler, resyncPeriod time.Duration) {
	s.startedLock.Lock()
	defer s.startedLock.Unlock()

	if s.stopped {
		klog.V(2).Infof("Handler %v was not added to shared informer because it has stopped already", handler)
		return
	}

	if resyncPeriod > 0 {
		if resyncPeriod < minimumResyncPeriod {
			klog.Warningf("resyncPeriod %d is too small. Changing it to the minimum allowed value of %d", resyncPeriod, minimumResyncPeriod)
			resyncPeriod = minimumResyncPeriod
		}

		if resyncPeriod < s.resyncCheckPeriod {
			if s.started {
				klog.Warningf("resyncPeriod %d is smaller than resyncCheckPeriod %d and the informer has already started. Changing it to %d", resyncPeriod, s.resyncCheckPeriod, s.resyncCheckPeriod)
				resyncPeriod = s.resyncCheckPeriod
			} else {
				// if the event handler's resyncPeriod is smaller than the current resyncCheckPeriod, update
				// resyncCheckPeriod to match resyncPeriod and adjust the resync periods of all the listeners
				// accordingly
				s.resyncCheckPeriod = resyncPeriod
				s.processor.resyncCheckPeriodChanged(resyncPeriod)
			}
		}
	}

	listener := newProcessListener(handler, resyncPeriod, determineResyncPeriod(resyncPeriod, s.resyncCheckPeriod), s.clock.Now(), initialBufferSize)

	if !s.started {
		s.processor.addListener(listener)
		return
	}

	// in order to safely join, we have to
	// 1. stop sending add/update/delete notifications
	// 2. do a list against the store
	// 3. send synthetic "Add" events to the new handler
	// 4. unblock
	s.blockDeltas.Lock()
	defer s.blockDeltas.Unlock()

	s.processor.addListener(listener)
	for _, item := range s.indexer.List() {
		listener.add(addNotification{newObj: item})
	}
}

func (s *sharedIndexInformer) HandleDeltas(obj interface{}) error {
	s.blockDeltas.Lock()
	defer s.blockDeltas.Unlock()

	// from oldest to newest
	for _, d := range obj.(Deltas) {
		switch d.Type {
		case Sync, Added, Updated:
			isSync := d.Type == Sync
			s.cacheMutationDetector.AddObject(d.Object)
			if old, exists, err := s.indexer.Get(d.Object); err == nil && exists {
				if err := s.indexer.Update(d.Object); err != nil {
					return err
				}
				s.processor.distribute(updateNotification{oldObj: old, newObj: d.Object}, isSync)
			} else {
				if err := s.indexer.Add(d.Object); err != nil {
					return err
				}
				s.processor.distribute(addNotification{newObj: d.Object}, isSync)
			}
		case Deleted:
			if err := s.indexer.Delete(d.Object); err != nil {
				return err
			}
			s.processor.distribute(deleteNotification{oldObj: d.Object}, false)
		}
	}
	return nil
}

type sharedProcessor struct {
	listenersStarted bool
	listenersLock    sync.RWMutex
	listeners        []*processorListener
	syncingListeners []*processorListener
	clock            clock.Clock
	wg               wait.Group
}

func (p *sharedProcessor) addListener(listener *processorListener) {
	p.listenersLock.Lock()
	defer p.listenersLock.Unlock()

	p.addListenerLocked(listener)
	if p.listenersStarted {
		p.wg.Start(listener.run)
		p.wg.Start(listener.pop)
	}
}

func (p *sharedProcessor) addListenerLocked(listener *processorListener) {
	p.listeners = append(p.listeners, listener)
	p.syncingListeners = append(p.syncingListeners, listener)
}

func (p *sharedProcessor) distribute(obj interface{}, sync bool) {
	p.listenersLock.RLock()
	defer p.listenersLock.RUnlock()

	if sync {
		for _, listener := range p.syncingListeners {
			listener.add(obj)
		}
	} else {
		for _, listener := range p.listeners {
			listener.add(obj)
		}
	}
}

func (p *sharedProcessor) run(stopCh <-chan struct{}) {
	func() {
		p.listenersLock.RLock()
		defer p.listenersLock.RUnlock()
		for _, listener := range p.listeners {
			p.wg.Start(listener.run)
			p.wg.Start(listener.pop)
		}
		p.listenersStarted = true
	}()
	<-stopCh
	p.listenersLock.RLock()
	defer p.listenersLock.RUnlock()
	for _, listener := range p.listeners {
		close(listener.addCh) // Tell .pop() to stop. .pop() will tell .run() to stop
	}
	p.wg.Wait() // Wait for all .pop() and .run() to stop
}

// shouldResync queries every listener to determine if any of them need a resync, based on each
// listener's resyncPeriod.
func (p *sharedProcessor) shouldResync() bool {
	p.listenersLock.Lock()
	defer p.listenersLock.Unlock()

	p.syncingListeners = []*processorListener{}

	resyncNeeded := false
	now := p.clock.Now()
	for _, listener := range p.listeners {
		// need to loop through all the listeners to see if they need to resync so we can prepare any
		// listeners that are going to be resyncing.
		if listener.shouldResync(now) {
			resyncNeeded = true
			p.syncingListeners = append(p.syncingListeners, listener)
			listener.determineNextResync(now)
		}
	}
	return resyncNeeded
}

func (p *sharedProcessor) resyncCheckPeriodChanged(resyncCheckPeriod time.Duration) {
	p.listenersLock.RLock()
	defer p.listenersLock.RUnlock()

	for _, listener := range p.listeners {
		resyncPeriod := determineResyncPeriod(listener.requestedResyncPeriod, resyncCheckPeriod)
		listener.setResyncPeriod(resyncPeriod)
	}
}

type processorListener struct {
	nextCh chan interface{}
	addCh  chan interface{}

	handler ResourceEventHandler

	// pendingNotifications is an unbounded ring buffer that holds all notifications not yet distributed.
	// There is one per listener, but a failing/stalled listener will have infinite pendingNotifications
	// added until we OOM.
	// TODO: This is no worse than before, since reflectors were backed by unbounded DeltaFIFOs, but
	// we should try to do something better.
	pendingNotifications buffer.RingGrowing

	// requestedResyncPeriod is how frequently the listener wants a full resync from the shared informer
	requestedResyncPeriod time.Duration
	// resyncPeriod is how frequently the listener wants a full resync from the shared informer. This
	// value may differ from requestedResyncPeriod if the shared informer adjusts it to align with the
	// informer's overall resync check period.
	resyncPeriod time.Duration
	// nextResync is the earliest time the listener should get a full resync
	nextResync time.Time
	// resyncLock guards access to resyncPeriod and nextResync
	resyncLock sync.Mutex
}

func newProcessListener(handler ResourceEventHandler, requestedResyncPeriod, resyncPeriod time.Duration, now time.Time, bufferSize int) *processorListener {
	ret := &processorListener{
		nextCh:                make(chan interface{}),
		addCh:                 make(chan interface{}),
		handler:               handler,
		pendingNotifications:  *buffer.NewRingGrowing(bufferSize),
		requestedResyncPeriod: requestedResyncPeriod,
		resyncPeriod:          resyncPeriod,
	}

	ret.determineNextResync(now)

	return ret
}

func (p *processorListener) add(notification interface{}) {
	p.addCh <- notification
}

func (p *processorListener) pop() {
	defer utilruntime.HandleCrash()
	defer close(p.nextCh) // Tell .run() to stop

	var nextCh chan<- interface{}
	var notification interface{}
	for {
		select {
		case nextCh <- notification:
			// Notification dispatched
			var ok bool
			notification, ok = p.pendingNotifications.ReadOne()
			if !ok { // Nothing to pop
				nextCh = nil // Disable this select case
			}
		case notificationToAdd, ok := <-p.addCh:
			if !ok {
				return
			}
			if notification == nil { // No notification to pop (and pendingNotifications is empty)
				// Optimize the case - skip adding to pendingNotifications
				notification = notificationToAdd
				nextCh = p.nextCh
			} else { // There is already a notification waiting to be dispatched
				p.pendingNotifications.WriteOne(notificationToAdd)
			}
		}
	}
}

func (p *processorListener) run() {
	// this call blocks until the channel is closed.  When a panic happens during the notification
	// we will catch it, **the offending item will be skipped!**, and after a short delay (one second)
	// the next notification will be attempted.  This is usually better than the alternative of never
	// delivering again.
	stopCh := make(chan struct{})
	wait.Until(func() {
		// this gives us a few quick retries before a long pause and then a few more quick retries
		err := wait.ExponentialBackoff(retry.DefaultRetry, func() (bool, error) {
			for next := range p.nextCh {
				switch notification := next.(type) {
				case updateNotification:
					p.handler.OnUpdate(notification.oldObj, notification.newObj)
				case addNotification:
					p.handler.OnAdd(notification.newObj)
				case deleteNotification:
					p.handler.OnDelete(notification.oldObj)
				default:
					utilruntime.HandleError(fmt.Errorf("unrecognized notification: %T", next))
				}
			}
			// the only way to get here is if the p.nextCh is empty and closed
			return true, nil
		})

		// the only way to get here is if the p.nextCh is empty and closed
		if err == nil {
			close(stopCh)
		}
	}, 1*time.Minute, stopCh)
}

// shouldResync deterimines if the listener needs a resync. If the listener's resyncPeriod is 0,
// this always returns false.
func (p *processorListener) shouldResync(now time.Time) bool {
	p.resyncLock.Lock()
	defer p.resyncLock.Unlock()

	if p.resyncPeriod == 0 {
		return false
	}

	return now.After(p.nextResync) || now.Equal(p.nextResync)
}

func (p *processorListener) determineNextResync(now time.Time) {
	p.resyncLock.Lock()
	defer p.resyncLock.Unlock()

	p.nextResync = now.Add(p.resyncPeriod)
}

func (p *processorListener) setResyncPeriod(resyncPeriod time.Duration) {
	p.resyncLock.Lock()
	defer p.resyncLock.Unlock()

	p.resyncPeriod = resyncPeriod
}

{'repo_name': 'rancher/local-path-provisioner', 'stars': '485', 'repo_language': 'Go', 'file_name': 'config.yaml', 'mime_type': 'text/plain', 'hash': -3774173033150241168, 'source_dataset': 'data'}


/*******************************************************************************
 * Copyright (c) 2015-2018 Skymind, Inc.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Apache License, Version 2.0 which is available at
 * https://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.
 *
 * SPDX-License-Identifier: Apache-2.0
 ******************************************************************************/

package org.deeplearning4j.rl4j.network.dqn;

import org.deeplearning4j.nn.gradient.Gradient;
import org.deeplearning4j.rl4j.network.NeuralNet;
import org.nd4j.linalg.api.ndarray.INDArray;

/**
 * @author rubenfiszel (ruben.fiszel@epfl.ch) 7/12/16.
 *
 * This neural net quantify the value of each action given a state
 *
 */
@Deprecated
public interface IDQN<NN extends IDQN> extends NeuralNet<NN> {

    void fit(INDArray input, INDArray labels);

    Gradient[] gradient(INDArray input, INDArray label);

    Gradient[] gradient(INDArray input, INDArray[] label);
}

{'repo_name': 'eclipse/deeplearning4j', 'stars': '11712', 'repo_language': 'Java', 'file_name': 'plugins.sbt', 'mime_type': 'text/plain', 'hash': 1167874895314408660, 'source_dataset': 'data'}


using Android.Views;
using Android.Widget;
using Toggl.Droid.Extensions;

namespace Toggl.Droid.Fragments.Onboarding
{
    public partial class OnboardingFirstSlideFragment
    {
        private TextView onboardingMessage;
        private View slideHolder;

        protected override void InitializeViews(View view)
        {
            onboardingMessage = view.FindViewById<TextView>(Resource.Id.message);
            slideHolder = view.FindViewById(Resource.Id.slideHolder);

            slideHolder.FitBottomPaddingInset();
            onboardingMessage.Text = Shared.Resources.OnboardingMessagePage1;
        }
    }
}

{'repo_name': 'toggl/mobileapp', 'stars': '242', 'repo_language': 'C#', 'file_name': 'InaccessibleEntitiesOutOfSyncAreNotDeletedInCleanUpLoop.cs', 'mime_type': 'text/plain', 'hash': 5950192429578153710, 'source_dataset': 'data'}


opam-version: "2.0"
maintainer: "martin@mjambon.com"
authors: ["Martin Jambon"]
homepage: "http://mjambon.com/easy-format.html"
bug-reports: "https://github.com/mjambon/easy-format/issues"
dev-repo: "git+https://github.com/mjambon/easy-format.git"
build: [
  ["jbuilder" "build" "-p" name "-j" jobs]
  ["jbuilder" "runtest" "-p" name] {with-test}
]
depends: [
  "ocaml" {>= "4.02.3"}
  "jbuilder" {build}
]
synopsis:
  "High-level and functional interface to the Format module of the OCaml standard library"
url {
  src: "https://github.com/mjambon/easy-format/archive/v1.3.1.tar.gz"
  checksum: "md5=4e163700fb88fdcd6b8976c3a216c8ea"
}

{'repo_name': 'briskml/brisk', 'stars': '486', 'repo_language': 'OCaml', 'file_name': 'Color0.re', 'mime_type': 'text/plain', 'hash': -8703617577980827019, 'source_dataset': 'data'}


/*
 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 *
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. The rights granted to you under the License
 * may not be used to create, or enable the creation or redistribution of,
 * unlawful or unlicensed copies of an Apple operating system, or to
 * circumvent, violate, or enable the circumvention or violation of, any
 * terms of an Apple operating system software license agreement.
 *
 * Please obtain a copy of the License at
 * http://www.opensource.apple.com/apsl/ and read it before using this file.
 *
 * The Original Code and all software distributed under the License are
 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */
/* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */
/*-
 * Copyright (c) 1990, 1993
 *	The Regents of the University of California.  All rights reserved.
 * (c) UNIX System Laboratories, Inc.
 * All or some portions of this file are derived from material licensed
 * to the University of California by American Telephone and Telegraph
 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
 * the permission of UNIX System Laboratories, Inc.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *	This product includes software developed by the University of
 *	California, Berkeley and its contributors.
 * 4. Neither the name of the University nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 *	@(#)times.h	8.4 (Berkeley) 1/21/94
 */

#ifndef	_SYS_TIMES_H_
#define	_SYS_TIMES_H_

#include <sys/appleapiopts.h>
#include <sys/cdefs.h>
#include <sys/_types.h>

/* [XSI] The clock_t type shall be defined as described in <sys/types.h> */
#include <sys/_types/_clock_t.h>

/*
 * [XSI] Structure whose address is passed as the first parameter to times()
 */
struct tms {
	clock_t	tms_utime;	/* [XSI] User CPU time */
	clock_t	tms_stime;	/* [XSI] System CPU time */
	clock_t	tms_cutime;	/* [XSI] Terminated children user CPU time */
	clock_t	tms_cstime;	/* [XSI] Terminated children System CPU time */
};

#ifndef KERNEL
__BEGIN_DECLS
clock_t	times(struct tms *);
__END_DECLS
#endif
#endif /* !_SYS_TIMES_H_ */

{'repo_name': 'LGCooci/objc4_debug', 'stars': '223', 'repo_language': 'C', 'file_name': 'objcrt.vcproj', 'mime_type': 'text/xml', 'hash': 5683753605340680725, 'source_dataset': 'data'}


/*
Bullet Continuous Collision Detection and Physics Library
Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org

This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:

1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/

#include "btConvexTriangleMeshShape.h"
#include "bullet/BulletCollision//CollisionShapes/btCollisionMargin.h"

#include "bullet/LinearMath/btQuaternion.h"
#include "bullet/BulletCollision//CollisionShapes/btStridingMeshInterface.h"

btConvexTriangleMeshShape ::btConvexTriangleMeshShape (btStridingMeshInterface* meshInterface, bool calcAabb)
: btPolyhedralConvexAabbCachingShape(), m_stridingMesh(meshInterface)
{
	m_shapeType = CONVEX_TRIANGLEMESH_SHAPE_PROXYTYPE;
	if ( calcAabb )
		recalcLocalAabb();
}

///It's not nice to have all this virtual function overhead, so perhaps we can also gather the points once
///but then we are duplicating
class LocalSupportVertexCallback: public btInternalTriangleIndexCallback
{

	btVector3 m_supportVertexLocal;
public:

	btScalar m_maxDot;
	btVector3 m_supportVecLocal;

	LocalSupportVertexCallback(const btVector3& supportVecLocal)
		: m_supportVertexLocal(btScalar(0.),btScalar(0.),btScalar(0.)),
		m_maxDot(btScalar(-BT_LARGE_FLOAT)),
                m_supportVecLocal(supportVecLocal)
	{
	}

	virtual void internalProcessTriangleIndex(btVector3* triangle,int partId,int  triangleIndex)
	{
		(void)triangleIndex;
		(void)partId;

		for (int i=0;i<3;i++)
		{
			btScalar dot = m_supportVecLocal.dot(triangle[i]);
			if (dot > m_maxDot)
			{
				m_maxDot = dot;
				m_supportVertexLocal = triangle[i];
			}
		}
	}

	btVector3	GetSupportVertexLocal()
	{
		return m_supportVertexLocal;
	}

};

btVector3	btConvexTriangleMeshShape::localGetSupportingVertexWithoutMargin(const btVector3& vec0)const
{
	btVector3 supVec(btScalar(0.),btScalar(0.),btScalar(0.));

	btVector3 vec = vec0;
	btScalar lenSqr = vec.length2();
	if (lenSqr < btScalar(0.0001))
	{
		vec.setValue(1,0,0);
	} else
	{
		btScalar rlen = btScalar(1.) / btSqrt(lenSqr );
		vec *= rlen;
	}

	LocalSupportVertexCallback	supportCallback(vec);
	btVector3 aabbMax(btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT));
	m_stridingMesh->InternalProcessAllTriangles(&supportCallback,-aabbMax,aabbMax);
	supVec = supportCallback.GetSupportVertexLocal();

	return supVec;
}

void	btConvexTriangleMeshShape::batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const
{
	//use 'w' component of supportVerticesOut?
	{
		for (int i=0;i<numVectors;i++)
		{
			supportVerticesOut[i][3] = btScalar(-BT_LARGE_FLOAT);
		}
	}

	///@todo: could do the batch inside the callback!

	for (int j=0;j<numVectors;j++)
	{
		const btVector3& vec = vectors[j];
		LocalSupportVertexCallback	supportCallback(vec);
		btVector3 aabbMax(btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT));
		m_stridingMesh->InternalProcessAllTriangles(&supportCallback,-aabbMax,aabbMax);
		supportVerticesOut[j] = supportCallback.GetSupportVertexLocal();
	}

}

btVector3	btConvexTriangleMeshShape::localGetSupportingVertex(const btVector3& vec)const
{
	btVector3 supVertex = localGetSupportingVertexWithoutMargin(vec);

	if ( getMargin()!=btScalar(0.) )
	{
		btVector3 vecnorm = vec;
		if (vecnorm .length2() < (SIMD_EPSILON*SIMD_EPSILON))
		{
			vecnorm.setValue(btScalar(-1.),btScalar(-1.),btScalar(-1.));
		}
		vecnorm.normalize();
		supVertex+= getMargin() * vecnorm;
	}
	return supVertex;
}

//currently just for debugging (drawing), perhaps future support for algebraic continuous collision detection
//Please note that you can debug-draw btConvexTriangleMeshShape with the Raytracer Demo
int	btConvexTriangleMeshShape::getNumVertices() const
{
	//cache this?
	return 0;

}

int btConvexTriangleMeshShape::getNumEdges() const
{
	return 0;
}

void btConvexTriangleMeshShape::getEdge(int ,btVector3& ,btVector3& ) const
{
	btAssert(0);
}

void btConvexTriangleMeshShape::getVertex(int ,btVector3& ) const
{
	btAssert(0);
}

int	btConvexTriangleMeshShape::getNumPlanes() const
{
	return 0;
}

void btConvexTriangleMeshShape::getPlane(btVector3& ,btVector3& ,int  ) const
{
	btAssert(0);
}

//not yet
bool btConvexTriangleMeshShape::isInside(const btVector3& ,btScalar ) const
{
	btAssert(0);
	return false;
}

void	btConvexTriangleMeshShape::setLocalScaling(const btVector3& scaling)
{
	m_stridingMesh->setScaling(scaling);

	recalcLocalAabb();

}

const btVector3& btConvexTriangleMeshShape::getLocalScaling() const
{
	return m_stridingMesh->getScaling();
}

void btConvexTriangleMeshShape::calculatePrincipalAxisTransform(btTransform& principal, btVector3& inertia, btScalar& volume) const
{
   class CenterCallback: public btInternalTriangleIndexCallback
   {
      bool first;
      btVector3 ref;
      btVector3 sum;
      btScalar volume;

   public:

      CenterCallback() : first(true), ref(0, 0, 0), sum(0, 0, 0), volume(0)
      {
      }

      virtual void internalProcessTriangleIndex(btVector3* triangle, int partId, int triangleIndex)
      {
         (void) triangleIndex;
         (void) partId;
         if (first)
         {
            ref = triangle[0];
            first = false;
         }
         else
         {
            btScalar vol = btFabs((triangle[0] - ref).triple(triangle[1] - ref, triangle[2] - ref));
            sum += (btScalar(0.25) * vol) * ((triangle[0] + triangle[1] + triangle[2] + ref));
            volume += vol;
         }
      }

      btVector3 getCenter()
      {
         return (volume > 0) ? sum / volume : ref;
      }

      btScalar getVolume()
      {
         return volume * btScalar(1. / 6);
      }

   };

   class InertiaCallback: public btInternalTriangleIndexCallback
   {
      btMatrix3x3 sum;
      btVector3 center;

   public:

      InertiaCallback(btVector3& center) : sum(0, 0, 0, 0, 0, 0, 0, 0, 0), center(center)
      {
      }

      virtual void internalProcessTriangleIndex(btVector3* triangle, int partId, int triangleIndex)
      {
         (void) triangleIndex;
         (void) partId;
         btMatrix3x3 i;
         btVector3 a = triangle[0] - center;
         btVector3 b = triangle[1] - center;
         btVector3 c = triangle[2] - center;
         btScalar volNeg = -btFabs(a.triple(b, c)) * btScalar(1. / 6);
         for (int j = 0; j < 3; j++)
         {
            for (int k = 0; k <= j; k++)
            {
               i[j][k] = i[k][j] = volNeg * (btScalar(0.1) * (a[j] * a[k] + b[j] * b[k] + c[j] * c[k])
                  + btScalar(0.05) * (a[j] * b[k] + a[k] * b[j] + a[j] * c[k] + a[k] * c[j] + b[j] * c[k] + b[k] * c[j]));
            }
         }
         btScalar i00 = -i[0][0];
         btScalar i11 = -i[1][1];
         btScalar i22 = -i[2][2];
         i[0][0] = i11 + i22;
         i[1][1] = i22 + i00;
         i[2][2] = i00 + i11;
         sum[0] += i[0];
         sum[1] += i[1];
         sum[2] += i[2];
      }

      btMatrix3x3& getInertia()
      {
         return sum;
      }

   };

   CenterCallback centerCallback;
   btVector3 aabbMax(btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT));
   m_stridingMesh->InternalProcessAllTriangles(&centerCallback, -aabbMax, aabbMax);
   btVector3 center = centerCallback.getCenter();
   principal.setOrigin(center);
   volume = centerCallback.getVolume();

   InertiaCallback inertiaCallback(center);
   m_stridingMesh->InternalProcessAllTriangles(&inertiaCallback, -aabbMax, aabbMax);

   btMatrix3x3& i = inertiaCallback.getInertia();
   i.diagonalize(principal.getBasis(), btScalar(0.00001), 20);
   inertia.setValue(i[0][0], i[1][1], i[2][2]);
   inertia /= volume;
}

{'repo_name': 'yuanfengyun/mj_client', 'stars': '182', 'repo_language': 'C++', 'file_name': 'version.json', 'mime_type': 'text/plain', 'hash': -4471731735917970776, 'source_dataset': 'data'}


// +build !ignore_autogenerated

/*
Copyright The Kubernetes Authors.

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.
*/

// Code generated by conversion-gen. DO NOT EDIT.

package v1alpha1

import (
	unsafe "unsafe"

	v1 "k8s.io/api/core/v1"
	conversion "k8s.io/apimachinery/pkg/conversion"
	runtime "k8s.io/apimachinery/pkg/runtime"
	resourcequota "k8s.io/kubernetes/plugin/pkg/admission/resourcequota/apis/resourcequota"
)

func init() {
	localSchemeBuilder.Register(RegisterConversions)
}

// RegisterConversions adds conversion functions to the given scheme.
// Public to allow building arbitrary schemes.
func RegisterConversions(s *runtime.Scheme) error {
	if err := s.AddGeneratedConversionFunc((*Configuration)(nil), (*resourcequota.Configuration)(nil), func(a, b interface{}, scope conversion.Scope) error {
		return Convert_v1alpha1_Configuration_To_resourcequota_Configuration(a.(*Configuration), b.(*resourcequota.Configuration), scope)
	}); err != nil {
		return err
	}
	if err := s.AddGeneratedConversionFunc((*resourcequota.Configuration)(nil), (*Configuration)(nil), func(a, b interface{}, scope conversion.Scope) error {
		return Convert_resourcequota_Configuration_To_v1alpha1_Configuration(a.(*resourcequota.Configuration), b.(*Configuration), scope)
	}); err != nil {
		return err
	}
	if err := s.AddGeneratedConversionFunc((*LimitedResource)(nil), (*resourcequota.LimitedResource)(nil), func(a, b interface{}, scope conversion.Scope) error {
		return Convert_v1alpha1_LimitedResource_To_resourcequota_LimitedResource(a.(*LimitedResource), b.(*resourcequota.LimitedResource), scope)
	}); err != nil {
		return err
	}
	if err := s.AddGeneratedConversionFunc((*resourcequota.LimitedResource)(nil), (*LimitedResource)(nil), func(a, b interface{}, scope conversion.Scope) error {
		return Convert_resourcequota_LimitedResource_To_v1alpha1_LimitedResource(a.(*resourcequota.LimitedResource), b.(*LimitedResource), scope)
	}); err != nil {
		return err
	}
	return nil
}

func autoConvert_v1alpha1_Configuration_To_resourcequota_Configuration(in *Configuration, out *resourcequota.Configuration, s conversion.Scope) error {
	out.LimitedResources = *(*[]resourcequota.LimitedResource)(unsafe.Pointer(&in.LimitedResources))
	return nil
}

// Convert_v1alpha1_Configuration_To_resourcequota_Configuration is an autogenerated conversion function.
func Convert_v1alpha1_Configuration_To_resourcequota_Configuration(in *Configuration, out *resourcequota.Configuration, s conversion.Scope) error {
	return autoConvert_v1alpha1_Configuration_To_resourcequota_Configuration(in, out, s)
}

func autoConvert_resourcequota_Configuration_To_v1alpha1_Configuration(in *resourcequota.Configuration, out *Configuration, s conversion.Scope) error {
	out.LimitedResources = *(*[]LimitedResource)(unsafe.Pointer(&in.LimitedResources))
	return nil
}

// Convert_resourcequota_Configuration_To_v1alpha1_Configuration is an autogenerated conversion function.
func Convert_resourcequota_Configuration_To_v1alpha1_Configuration(in *resourcequota.Configuration, out *Configuration, s conversion.Scope) error {
	return autoConvert_resourcequota_Configuration_To_v1alpha1_Configuration(in, out, s)
}

func autoConvert_v1alpha1_LimitedResource_To_resourcequota_LimitedResource(in *LimitedResource, out *resourcequota.LimitedResource, s conversion.Scope) error {
	out.APIGroup = in.APIGroup
	out.Resource = in.Resource
	out.MatchContains = *(*[]string)(unsafe.Pointer(&in.MatchContains))
	out.MatchScopes = *(*[]v1.ScopedResourceSelectorRequirement)(unsafe.Pointer(&in.MatchScopes))
	return nil
}

// Convert_v1alpha1_LimitedResource_To_resourcequota_LimitedResource is an autogenerated conversion function.
func Convert_v1alpha1_LimitedResource_To_resourcequota_LimitedResource(in *LimitedResource, out *resourcequota.LimitedResource, s conversion.Scope) error {
	return autoConvert_v1alpha1_LimitedResource_To_resourcequota_LimitedResource(in, out, s)
}

func autoConvert_resourcequota_LimitedResource_To_v1alpha1_LimitedResource(in *resourcequota.LimitedResource, out *LimitedResource, s conversion.Scope) error {
	out.APIGroup = in.APIGroup
	out.Resource = in.Resource
	out.MatchContains = *(*[]string)(unsafe.Pointer(&in.MatchContains))
	out.MatchScopes = *(*[]v1.ScopedResourceSelectorRequirement)(unsafe.Pointer(&in.MatchScopes))
	return nil
}

// Convert_resourcequota_LimitedResource_To_v1alpha1_LimitedResource is an autogenerated conversion function.
func Convert_resourcequota_LimitedResource_To_v1alpha1_LimitedResource(in *resourcequota.LimitedResource, out *LimitedResource, s conversion.Scope) error {
	return autoConvert_resourcequota_LimitedResource_To_v1alpha1_LimitedResource(in, out, s)
}

{'repo_name': 'intel/userspace-cni-network-plugin', 'stars': '107', 'repo_language': 'Go', 'file_name': 'zz_generated.deepcopy.go', 'mime_type': 'text/plain', 'hash': -254960713601895503, 'source_dataset': 'data'}


# tone and voice
How you write something is more important than what you write. What good is
having all the knowledge in the world if it cannot be shared? Having a good
tone and voice is key to becoming likable. Companies like Slack do a
magnificent job at conveying _likability_.

## Frames
Tone and voice is an abstract concept; talking about it mostly hits the
superficial level, the _how_ of things. Framing is more integral to the message
in that it is the actual message itself. When you convey information, there's a
certain frame attached to it. What is the goal you're trying to achieve with
the information you're sending; what is the feeling you're trying to invoke?
Framing is staple to language, and recognizing the frame someone is using can
lead to a sharper understanding of someone's message.

## Error messages
- [error style guide](http://www.postgresql.org/docs/devel/static/error-style-guide.html)

## See also
- [Buffer Voice / Tone Guide](https://bufferapp.com/tone-guide)
- [taalstrategie (Dutch)](http://taalstrategie.nl/framing/)

{'repo_name': 'yoshuawuyts/notes', 'stars': '815', 'repo_language': 'None', 'file_name': 'design.md', 'mime_type': 'text/plain', 'hash': 5846681445648473403, 'source_dataset': 'data'}


# Copyright 2019 Google LLC
#
# 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.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AdSense.V14.Api.Urlchannels do
  @moduledoc """
  API calls for all endpoints tagged `Urlchannels`.
  """

  alias GoogleApi.AdSense.V14.Connection
  alias GoogleApi.Gax.{Request, Response}

  @library_version Mix.Project.config() |> Keyword.get(:version, "")

  @doc """
  List all URL channels in the specified ad client for this AdSense account.

  ## Parameters

  *   `connection` (*type:* `GoogleApi.AdSense.V14.Connection.t`) - Connection to server
  *   `ad_client_id` (*type:* `String.t`) - Ad client for which to list URL channels.
  *   `optional_params` (*type:* `keyword()`) - Optional parameters
      *   `:alt` (*type:* `String.t`) - Data format for the response.
      *   `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response.
      *   `:key` (*type:* `String.t`) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
      *   `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user.
      *   `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks.
      *   `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters.
      *   `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead.
      *   `:maxResults` (*type:* `integer()`) - The maximum number of URL channels to include in the response, used for paging.
      *   `:pageToken` (*type:* `String.t`) - A continuation token, used to page through URL channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response.
  *   `opts` (*type:* `keyword()`) - Call options

  ## Returns

  *   `{:ok, %GoogleApi.AdSense.V14.Model.UrlChannels{}}` on success
  *   `{:error, info}` on failure
  """
  @spec adsense_urlchannels_list(Tesla.Env.client(), String.t(), keyword(), keyword()) ::
          {:ok, GoogleApi.AdSense.V14.Model.UrlChannels.t()}
          | {:ok, Tesla.Env.t()}
          | {:error, any()}
  def adsense_urlchannels_list(connection, ad_client_id, optional_params \\ [], opts \\ []) do
    optional_params_config = %{
      :alt => :query,
      :fields => :query,
      :key => :query,
      :oauth_token => :query,
      :prettyPrint => :query,
      :quotaUser => :query,
      :userIp => :query,
      :maxResults => :query,
      :pageToken => :query
    }

    request =
      Request.new()
      |> Request.method(:get)
      |> Request.url("/adclients/{adClientId}/urlchannels", %{
        "adClientId" => URI.encode(ad_client_id, &URI.char_unreserved?/1)
      })
      |> Request.add_optional_params(optional_params_config, optional_params)
      |> Request.library_version(@library_version)

    connection
    |> Connection.execute(request)
    |> Response.decode(opts ++ [struct: %GoogleApi.AdSense.V14.Model.UrlChannels{}])
  end
end

{'repo_name': 'googleapis/elixir-google-api', 'stars': '483', 'repo_language': 'Elixir', 'file_name': 'connection.ex.eex', 'mime_type': 'text/plain', 'hash': 6654491874271554296, 'source_dataset': 'data'}


{'repo_name': 'vz-risk/VCDB', 'stars': '346', 'repo_language': 'Jupyter Notebook', 'file_name': 'NOTE.txt', 'mime_type': 'text/plain', 'hash': 2260004131586483819, 'source_dataset': 'data'}


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title>Flot Examples: Adding Annotations</title>
	<link href="../examples.css" rel="stylesheet" type="text/css">

Adding Annotations

Flot has support for simple background decorations such as lines and rectangles. They can be useful for marking up certain areas. You can easily add any HTML you need with standard DOM manipulation, e.g. for labels. For drawing custom shapes there is also direct access to the canvas.

		Copyright © 2007 - 2013 IOLA and Ole Laursen

{'repo_name': 'asmaps/hopper.pw', 'stars': '139', 'repo_language': 'HTML', 'file_name': 'bs-lessdoc-parser.js', 'mime_type': 'text/html', 'hash': -180199039044226772, 'source_dataset': 'data'}


Changes from 4.2.0beta1 to 4.2.0rc1

*Kernel:

*Design:

*eZTemplate:

*eZLocale:

*Package system:

*Scripts:
- Added script update/common/scripts/4.2/fixorphanimages.php
  Cleans up the image alias files that weren't removed due to issue #15155

*Translations:

*Bugfixes:
- Fixed bug #15454: Make eZSession::getUserSessionHash() to return default hash instead of empty string
- Fixed bug #15484: Fatal error when installing plain and choosing "Map to language"
- Fixed bug #15388: Warning in eznotificationtransport.php when $transportImpl is null

{'repo_name': 'ezsystems/ezpublish-legacy', 'stars': '253', 'repo_language': 'JavaScript', 'file_name': 'yui_container.css', 'mime_type': 'text/plain', 'hash': -5182370871366905210, 'source_dataset': 'data'}


var jsTag = angular.module('jsTag');

// This service handles everything related to input (when to focus input, key pressing, breakcodeHit).
jsTag.factory('InputService', ['$filter', function($filter) {

  // Constructor
  function InputService(options) {
    this.input = "";
    this.isWaitingForInput = options.autoFocus || false;
    this.options = options;
  }

  // *** Events *** //

  // Handles an input of a new tag keydown
  InputService.prototype.onKeydown = function(inputService, tagsCollection, options) {
    var e = options.$event;
    var $element = angular.element(e.currentTarget);
    var keycode = e.which;
    // In order to know how to handle a breakCode or a backspace, we must know if the typeahead
    // input value is empty or not. e.g. if user hits backspace and typeahead input is not empty
    // then we have nothing to do as user si not trying to remove a tag but simply tries to
    // delete some character in typeahead's input.
    // To know the value in the typeahead input, we can't use `this.input` because when
    // typeahead is in uneditable mode, the model (i.e. `this.input`) is not updated and is set
    // to undefined. So we have to fetch the value directly from the typeahead input element.
    //
    // We have to test this.input first, because $element.typeahead is a function and can be set
    // even if we are not in the typeahead mode.
    // So in this case, the value is always null and the preventDefault is never fired
    // This cause the form to always submit after hitting the Enter key.
    //var value = ($element.typeahead !== undefined) ? $element.typeahead('val') : this.input;
    var value = this.input || (($element.typeahead !== undefined) ? $element.typeahead('val') : undefined) ;
    var valueIsEmpty = (value === null || value === undefined || value === "");

    // Check if should break by breakcodes
    if ($filter("inArray")(keycode, this.options.breakCodes) !== false) {

      inputService.breakCodeHit(tagsCollection, this.options);

      // Trigger breakcodeHit event allowing extensions (used in twitter's typeahead directive)
      $element.triggerHandler('jsTag:breakcodeHit');

      // Do not trigger form submit if value is not empty.
      if (!valueIsEmpty) {
        e.preventDefault();
      }

    } else {
      switch (keycode) {
        case 9:	// Tab

          break;
        case 37: // Left arrow
        case 8: // Backspace
          if (valueIsEmpty) {
            // TODO: Call removing tag event instead of calling a method, easier to customize
            tagsCollection.setLastTagActive();
          }

          break;
      }
    }
  };

  // Handles an input of an edited tag keydown
  InputService.prototype.tagInputKeydown = function(tagsCollection, options) {
    var e = options.$event;
    var keycode = e.which;

    // Check if should break by breakcodes
    if ($filter("inArray")(keycode, this.options.breakCodes) !== false) {
      this.breakCodeHitOnEdit(tagsCollection, options);
    }
  };

  InputService.prototype.onBlur = function(tagsCollection) {
    this.breakCodeHit(tagsCollection, this.options);
  };

  // *** Methods *** //

  InputService.prototype.resetInput = function() {
    var value = this.input;
    this.input = "";
    return value;
  };

  // Sets focus on input
  InputService.prototype.focusInput = function() {
    this.isWaitingForInput = true;
  };

  // breakCodeHit is called when finished creating tag
  InputService.prototype.breakCodeHit = function(tagsCollection, options) {
    if (this.input !== "") {
      if(tagsCollection._valueFormatter) {
        this.input = tagsCollection._valueFormatter(this.input);
      }
      if(tagsCollection._valueValidator) {
        if(!tagsCollection._valueValidator(this.input)) {
          return;
        };
      }

      var originalValue = this.resetInput();

      // Input is an object when using typeahead (the key is chosen by the user)
      if (originalValue instanceof Object)
      {
        originalValue = originalValue[options.tagDisplayKey || Object.keys(originalValue)[0]];
      }

      // Split value by spliter (usually ,)
      var values = originalValue.split(options.splitter);
      // Remove empty string objects from the values
      for (var i = 0; i < values.length; i++) {
        if (!values[i]) {
          values.splice(i, 1);
          i--;
        }
      }

      // Add tags to collection
      for (var key in values) {
        if ( ! values.hasOwnProperty(key)) continue;  // for IE 8
        var value = values[key];
        tagsCollection.addTag(value);
      }
    }
  };

  // breakCodeHit is called when finished editing tag
  InputService.prototype.breakCodeHitOnEdit = function(tagsCollection, options) {
    // Input is an object when using typeahead (the key is chosen by the user)
    var editedTag = tagsCollection.getEditedTag();
    if (editedTag.value instanceof Object) {
      editedTag.value = editedTag.value[options.tagDisplayKey || Object.keys(editedTag.value)[0]];
    }

    tagsCollection.unsetEditedTag();
    this.isWaitingForInput = true;
  };

  return InputService;
}]);

{'repo_name': 'eranhirs/jsTag', 'stars': '140', 'repo_language': 'JavaScript', 'file_name': 'jsTag.debug.js', 'mime_type': 'text/plain', 'hash': -5117775205079183757, 'source_dataset': 'data'}


/*
 * Created by Angel Leon (@gubatron), Alden Torres (aldenml), Erich Pleny (erichpleny)
 * Copyright (c) 2012, FrostWire(R). All rights reserved.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package com.frostwire.gui.mplayer;

interface AlphaTarget {
    void setAlpha(final float alpha);
}

{'repo_name': 'frostwire/frostwire', 'stars': '234', 'repo_language': 'Java', 'file_name': 'SystemUtilities.hpp', 'mime_type': 'text/x-c', 'hash': 497489625839187149, 'source_dataset': 'data'}


<?php
/*
 * Copyright 2014 Google Inc.
 *
 * 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.
 */

class Google_Service_Dfareporting_PlacementTag extends Google_Collection
{
  protected $collection_key = 'tagDatas';
  public $placementId;
  protected $tagDatasType = 'Google_Service_Dfareporting_TagData';
  protected $tagDatasDataType = 'array';

  public function setPlacementId($placementId)
  {
    $this->placementId = $placementId;
  }
  public function getPlacementId()
  {
    return $this->placementId;
  }
  /**
   * @param Google_Service_Dfareporting_TagData
   */
  public function setTagDatas($tagDatas)
  {
    $this->tagDatas = $tagDatas;
  }
  /**
   * @return Google_Service_Dfareporting_TagData
   */
  public function getTagDatas()
  {
    return $this->tagDatas;
  }
}

{'repo_name': 'owncloud/core', 'stars': '7121', 'repo_language': 'PHP', 'file_name': 'index.php', 'mime_type': 'text/x-php', 'hash': 6791495793187668115, 'source_dataset': 'data'}


$NetBSD: patch-ae,v 1.4 2012/07/30 02:53:57 dholland Exp $

Configure paths for pkgsrc.

--- lib/Imakefile.orig	2002-12-25 10:05:09.000000000 -0800
+++ lib/Imakefile	2002-12-25 10:05:37.000000000 -0800
@@ -128,7 +128,7 @@
 		  -Ifd

 DEPEND_DEFINES	= \
-		  -I/usr/local/include
+		  -I${LOCALBASE}/include

 #if !BuildGL
 NO_GL		= -DNO_GL

{'repo_name': 'jsonn/pkgsrc', 'stars': '122', 'repo_language': 'Makefile', 'file_name': 'patch-ad', 'mime_type': 'text/x-diff', 'hash': 2467723263261184714, 'source_dataset': 'data'}


import { applyPatch, encode, decode } from '../'
import { getNewPlain } from '../src/util/get'
import { isPlainObject } from '../src/util/is'

function newDate(d = new Date().getDate()) {
    const date = new Date(d)
    date.toISOString = () => date
    date.replace = () => date
    return date
}

function isInteger(number) {
    return (
        typeof number === 'number' &&
        isFinite(number) &&
        Math.floor(number) === number
    )
}

function encodeDecode(patch, encodedecode = true, serialize = true) {
    return encodedecode
        ? decode(serializeDeserialize(encode(patch), serialize))
        : patch
}

function serializeDeserialize(patch, serialize = true) {
    return serialize ? JSON.parse(JSON.stringify(patch)) : patch
}

function testEncodeDecode(
    t,
    patch,
    expected,
    reverse = true,
    serialize = true
) {
    const encoded = serializeDeserialize(encode(patch), serialize)
    t.deepEqual(expected, encoded)
    t.not(patch, encoded)
    const decoded = decode(serializeDeserialize(encoded, serialize))
    if (reverse) {
        t.deepEqual(patch, decoded)
        t.not(encoded, decoded)
    }
    return { encoded, decoded }
}

function testPatchUnpatch(
    t,
    target,
    patch,
    expected,
    reverse = true,
    encodedecode = true,
    serialize = true
) {
    const cloned = getNewPlain(target)
    const output = applyPatch(
        target,
        encodeDecode(patch, encodedecode, serialize)
    )
    const { unpatch, mutations, result } = output
    if (isPlainObject(result) && isPlainObject(target)) {
        t.is(target, result)
    }
    target = result
    t.deepEqual(target, expected)
    if (reverse) {
        const output2 = applyPatch(
            target,
            encodeDecode(unpatch, encodedecode, serialize)
        )
        t.deepEqual(output2.result, cloned, '(Unpatching)')
    }
    return { unpatch, mutations, result }
}

module.exports = { newDate, isInteger, testEncodeDecode, testPatchUnpatch }

{'repo_name': 'DistributedObjectProtocol/dop', 'stars': '158', 'repo_language': 'JavaScript', 'file_name': 'launch.json', 'mime_type': 'text/plain', 'hash': 4975649805000489971, 'source_dataset': 'data'}


    <title>Nancy File Posting Demo</title>

You uploaded: @Model.Posted

      <form action="@Path['~/fileupload']" method="POST" enctype="multipart/form-data">
        <input name="upload" type="file" size="40"/>
        <input type="submit" value="Post!"/>
      </form>

{'repo_name': 'NancyFx/Nancy', 'stars': '7136', 'repo_language': 'C#', 'file_name': 'Nancy.Owin.Tests.csproj', 'mime_type': 'text/plain', 'hash': -8990974384592058202, 'source_dataset': 'data'}


<?xml version="1.0" encoding="utf-8"?>
<com.mobeta.android.dslv.DragSortListView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:dslv="http://schemas.android.com/apk/res/com.example.PebbleKitExample"
    android:id="@android:id/list"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_margin="3dp"
    android:choiceMode="multipleChoice"
    android:dividerHeight="1px"
    android:padding="3dp"
    dslv:click_remove_id="@id/click_remove"
    dslv:collapsed_height="1px"
    dslv:drag_enabled="true"
    dslv:drag_handle_id="@id/drag_handle"
    dslv:drag_scroll_start="0.33"
    dslv:drag_start_mode="onDown"
    dslv:float_alpha="0.6"
    dslv:remove_enabled="true"
    dslv:remove_mode="clickRemove"
    dslv:slide_shuffle_speed="0.3" />

{'repo_name': 'pebble/pebble-sdk-examples', 'stars': '374', 'repo_language': 'Objective-C', 'file_name': 'org.eclipse.jdt.core.prefs', 'mime_type': 'text/plain', 'hash': 8968633184802418042, 'source_dataset': 'data'}


--TEST--
SPL: Bug #48493 spl_autoload_unregister() can't handle prepended functions
--FILE--
<?php
function autoload1() {}

function autoload2() {}

spl_autoload_register('autoload2');
spl_autoload_register('autoload1', true, true);
var_dump(spl_autoload_functions());

spl_autoload_unregister('autoload2');
var_dump(spl_autoload_functions());
?>
--EXPECT--
array(2) {
  [0]=>
  string(9) "autoload1"
  [1]=>
  string(9) "autoload2"
}
array(1) {
  [0]=>
  string(9) "autoload1"
}

{'repo_name': 'hippyvm/hippyvm', 'stars': '870', 'repo_language': 'PHP', 'file_name': 'jithip.py', 'mime_type': 'text/x-python', 'hash': -3930026967873763282, 'source_dataset': 'data'}