Dataset Preview
The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
The dataset generation failed
Error code: DatasetGenerationError
Exception: ArrowInvalid
Message: JSON parse error: Missing a closing quotation mark in string. in row 692
Traceback: Traceback (most recent call last):
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py", line 145, in _generate_tables
dataset = json.load(f)
File "/usr/local/lib/python3.9/json/__init__.py", line 293, in load
return loads(fp.read(),
File "/usr/local/lib/python3.9/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "/usr/local/lib/python3.9/json/decoder.py", line 340, in decode
raise JSONDecodeError("Extra data", s, end)
json.decoder.JSONDecodeError: Extra data: line 2 column 1 (char 2186)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1995, in _prepare_split_single
for _, table in generator:
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py", line 148, in _generate_tables
raise e
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py", line 122, in _generate_tables
pa_table = paj.read_json(
File "pyarrow/_json.pyx", line 308, in pyarrow._json.read_json
File "pyarrow/error.pxi", line 154, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 91, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: JSON parse error: Missing a closing quotation mark in string. in row 692
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1529, in compute_config_parquet_and_info_response
parquet_operations = convert_to_parquet(builder)
File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1154, in convert_to_parquet
builder.download_and_prepare(
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1027, in download_and_prepare
self._download_and_prepare(
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1122, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1882, in _prepare_split
for job_id, done, content in self._prepare_split_single(
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 2038, in _prepare_split_single
raise DatasetGenerationError("An error occurred while generating the dataset") from e
datasets.exceptions.DatasetGenerationError: An error occurred while generating the datasetNeed help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.
text
string | meta
dict |
|---|---|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_65) on Thu May 08 14:45:34 IST 2014 -->
<TITLE>
Overview List (FeedHenry Android SDK)
</TITLE>
<META NAME="date" CONTENT="2014-05-08">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
</HEAD>
<BODY BGCOLOR="white">
<TABLE BORDER="0" WIDTH="100%" SUMMARY="">
<TR>
<TH ALIGN="left" NOWRAP><FONT size="+1" CLASS="FrameTitleFont">
<B></B></FONT></TH>
</TR>
</TABLE>
<TABLE BORDER="0" WIDTH="100%" SUMMARY="">
<TR>
<TD NOWRAP><FONT CLASS="FrameItemFont"><A HREF="allclasses-frame.html" target="packageFrame">All Classes</A></FONT>
<P>
<FONT size="+1" CLASS="FrameHeadingFont">
Packages</FONT>
<BR>
<FONT CLASS="FrameItemFont"><A HREF="com/feedhenry/sdk/package-frame.html" target="packageFrame">com.feedhenry.sdk</A></FONT>
<BR>
<FONT CLASS="FrameItemFont"><A HREF="com/feedhenry/sdk/api/package-frame.html" target="packageFrame">com.feedhenry.sdk.api</A></FONT>
<BR>
<FONT CLASS="FrameItemFont"><A HREF="com/feedhenry/sdk/exceptions/package-frame.html" target="packageFrame">com.feedhenry.sdk.exceptions</A></FONT>
<BR>
<FONT CLASS="FrameItemFont"><A HREF="com/feedhenry/sdk/oauth/package-frame.html" target="packageFrame">com.feedhenry.sdk.oauth</A></FONT>
<BR>
<FONT CLASS="FrameItemFont"><A HREF="com/feedhenry/sdk/sync/package-frame.html" target="packageFrame">com.feedhenry.sdk.sync</A></FONT>
<BR>
</TD>
</TR>
</TABLE>
<P>
</BODY>
</HTML>
|
{
"content_hash": "774c307cf387483c272f29d2a2b0a1c8",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 147,
"avg_line_length": 31.1,
"alnum_prop": 0.6983922829581993,
"repo_name": "matzew/fh-android-sdk",
"id": "ed369686232894111bb8dc1ceb8648addc8de3e2",
"size": "1555",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "doc/overview-frame.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "416412"
}
]
}
|
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null
|
{
"content_hash": "deeaacba6104b21eed34e44c34353166",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.307692307692308,
"alnum_prop": 0.6940298507462687,
"repo_name": "mdoering/backbone",
"id": "4bae891974f046eab4480dac293dbfca4c8133b0",
"size": "184",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Lamiales/Gesneriaceae/Cyrtandra/Cyrtandra flavescens/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": []
}
|
// Copyright 2019-present the Material Components for iOS authors. All Rights Reserved.
//
// 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.
#import <XCTest/XCTest.h>
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wprivate-header"
#import "MDCRippleLayer.h"
#import "MDCRippleLayerDelegate.h"
#pragma clang diagnostic pop
NS_ASSUME_NONNULL_BEGIN
#pragma mark - Fake classes
@interface FakeMDCRippleLayer : MDCRippleLayer
@property(nonatomic, strong) NSMutableArray *addedAnimations;
@end
@implementation FakeMDCRippleLayer
- (void)addAnimation:(CAAnimation *)anim forKey:(nullable NSString *)key {
if (!self.addedAnimations) {
self.addedAnimations = [NSMutableArray array];
}
[self.addedAnimations addObject:anim];
[super addAnimation:anim forKey:key];
}
@end
@interface FakeMDCRippleLayerAnimationDelegate : NSObject <MDCRippleLayerDelegate>
@property(nonatomic, strong) MDCRippleLayer *rippleLayer;
@property(nonatomic, assign) BOOL rippleTouchDownDidBegin;
@property(nonatomic, assign) BOOL rippleTouchDownDidEnd;
@property(nonatomic, assign) BOOL rippleTouchUpDidBegin;
@property(nonatomic, assign) BOOL rippleTouchUpDidEnd;
@end
@implementation FakeMDCRippleLayerAnimationDelegate
- (void)rippleLayerTouchDownAnimationDidBegin:(nonnull MDCRippleLayer *)rippleLayer {
_rippleTouchDownDidBegin = YES;
}
- (void)rippleLayerTouchDownAnimationDidEnd:(nonnull MDCRippleLayer *)rippleLayer {
_rippleTouchDownDidEnd = YES;
}
- (void)rippleLayerTouchUpAnimationDidBegin:(nonnull MDCRippleLayer *)rippleLayer {
_rippleTouchUpDidBegin = YES;
}
- (void)rippleLayerTouchUpAnimationDidEnd:(nonnull MDCRippleLayer *)rippleLayer {
_rippleTouchUpDidEnd = YES;
}
@end
#pragma mark - Tests
@interface MDCRippleLayerTests : XCTestCase
@end
@implementation MDCRippleLayerTests
- (void)testInit {
// Given
MDCRippleLayer *rippleLayer = [[MDCRippleLayer alloc] init];
// Then
XCTAssertNil(rippleLayer.delegate);
XCTAssertEqual(rippleLayer.maximumRadius, 0);
XCTAssertFalse(rippleLayer.isStartAnimationActive);
XCTAssertEqualWithAccuracy(rippleLayer.rippleTouchDownStartTime, 0, 0.0001);
}
- (void)testLayerTouchDownDidBeginDelegate {
// Given
FakeMDCRippleLayerAnimationDelegate *delegate =
[[FakeMDCRippleLayerAnimationDelegate alloc] init];
MDCRippleLayer *rippleLayer = [[MDCRippleLayer alloc] init];
rippleLayer.rippleLayerDelegate = delegate;
delegate.rippleLayer = rippleLayer;
// When
[rippleLayer startRippleAtPoint:CGPointMake(0, 0) animated:YES completion:nil];
// Then
XCTAssertTrue(delegate.rippleTouchDownDidBegin);
}
- (void)testLayerTouchDownDidEndDelegate {
// Given
FakeMDCRippleLayerAnimationDelegate *delegate =
[[FakeMDCRippleLayerAnimationDelegate alloc] init];
MDCRippleLayer *rippleLayer = [[MDCRippleLayer alloc] init];
rippleLayer.rippleLayerDelegate = delegate;
delegate.rippleLayer = rippleLayer;
XCTestExpectation *expectation = [self expectationWithDescription:@"completed"];
// When
[rippleLayer startRippleAtPoint:CGPointMake(0, 0)
animated:YES
completion:^{
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:3 handler:nil];
// Then
XCTAssertTrue(delegate.rippleTouchDownDidEnd);
}
- (void)testLayerTouchUpDidBeginDelegate {
// Given
FakeMDCRippleLayerAnimationDelegate *delegate =
[[FakeMDCRippleLayerAnimationDelegate alloc] init];
MDCRippleLayer *rippleLayer = [[MDCRippleLayer alloc] init];
rippleLayer.rippleLayerDelegate = delegate;
delegate.rippleLayer = rippleLayer;
// When
[rippleLayer endRippleAnimated:YES completion:nil];
// Then
XCTAssertTrue(delegate.rippleTouchUpDidBegin);
}
- (void)testLayerTouchUpDidEndDelegate {
// Given
FakeMDCRippleLayerAnimationDelegate *delegate =
[[FakeMDCRippleLayerAnimationDelegate alloc] init];
MDCRippleLayer *rippleLayer = [[MDCRippleLayer alloc] init];
rippleLayer.rippleLayerDelegate = delegate;
delegate.rippleLayer = rippleLayer;
XCTestExpectation *expectation = [self expectationWithDescription:@"completed"];
// When
[rippleLayer endRippleAnimated:YES
completion:^{
[expectation fulfill];
}];
[self waitForExpectationsWithTimeout:3 handler:nil];
// Then
XCTAssertTrue(delegate.rippleTouchUpDidEnd);
}
- (void)testAnimationTimingInSpeedScaledLayer {
// Given
FakeMDCRippleLayer *rippleLayer = [[FakeMDCRippleLayer alloc] init];
rippleLayer.bounds = CGRectMake(0, 0, 10, 10);
rippleLayer.speed = (float)0.1;
CGFloat expectedRippleFadeoutDelay = (CGFloat)0.150;
// When
[rippleLayer startRippleAtPoint:CGPointMake(0, 0) animated:YES completion:nil];
NSTimeInterval startTime = rippleLayer.rippleTouchDownStartTime;
[rippleLayer endRippleAnimated:YES completion:nil];
// Then
XCTAssertEqual(rippleLayer.addedAnimations.count, 2U);
CAAnimation *animation = rippleLayer.addedAnimations.lastObject;
if (animation) {
startTime = [rippleLayer convertTime:startTime + expectedRippleFadeoutDelay fromLayer:nil];
XCTAssertEqualWithAccuracy(animation.beginTime, startTime, 0.010);
}
NSLog(@"\nA: %.12f\nE: %.12f\n", animation.beginTime, startTime);
}
- (void)testStartRippleAnimationCorrectness {
// Given
FakeMDCRippleLayer *rippleLayer = [[FakeMDCRippleLayer alloc] init];
rippleLayer.bounds = CGRectMake(0, 0, 100, 100);
CGPoint point = CGPointMake(10, 10);
// When
[rippleLayer startRippleAtPoint:point animated:YES completion:nil];
// Then
CAAnimationGroup *group = (CAAnimationGroup *)rippleLayer.addedAnimations.firstObject;
XCTAssertEqual(group.animations.count, 3U);
NSInteger animationsCount = 0;
for (CAAnimation *animation in group.animations) {
XCTAssertTrue(animation.removedOnCompletion);
if ([animation isKindOfClass:[CABasicAnimation class]]) {
CABasicAnimation *basicAnimation = (CABasicAnimation *)animation;
if ([basicAnimation.keyPath isEqualToString:@"opacity"]) {
animationsCount += 1;
XCTAssertEqualObjects(@1, basicAnimation.toValue);
XCTAssertEqualObjects(@0, basicAnimation.fromValue);
XCTAssertEqualObjects([CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear],
basicAnimation.timingFunction);
} else if ([basicAnimation.keyPath isEqualToString:@"transform.scale"]) {
animationsCount += 1;
XCTAssertEqualObjects(@1, basicAnimation.toValue);
XCTAssertEqualWithAccuracy(
(CGFloat)0.37169, (CGFloat)((NSNumber *)basicAnimation.fromValue).doubleValue, 0.01);
}
} else if ([animation isKindOfClass:[CAKeyframeAnimation class]]) {
animationsCount += 1;
CAKeyframeAnimation *keyFrameAnimation = (CAKeyframeAnimation *)animation;
XCTAssertTrue(CGPointEqualToPoint(point, CGPathGetCurrentPoint(keyFrameAnimation.path)));
}
}
XCTAssertEqual(animationsCount, 3);
}
- (void)testEndRippleAnimationCorrectness {
// Given
FakeMDCRippleLayer *rippleLayer = [[FakeMDCRippleLayer alloc] init];
// When
[rippleLayer endRippleAnimated:YES completion:nil];
// Then
XCTAssertTrue([rippleLayer.addedAnimations.firstObject isKindOfClass:[CABasicAnimation class]]);
CABasicAnimation *basicAnimation = (CABasicAnimation *)rippleLayer.addedAnimations.firstObject;
XCTAssertEqual(rippleLayer.addedAnimations.count, 1U);
XCTAssertEqualObjects(@"opacity", basicAnimation.keyPath);
XCTAssertEqualObjects(@0, basicAnimation.toValue);
XCTAssertEqualObjects(@1, basicAnimation.fromValue);
XCTAssertEqualObjects([CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear],
basicAnimation.timingFunction);
XCTAssertEqualWithAccuracy(basicAnimation.duration, (CGFloat)0.15, 0.0001);
}
- (void)testFadeInRippleAnimationCorrectness {
// Given
FakeMDCRippleLayer *rippleLayer = [[FakeMDCRippleLayer alloc] init];
// When
[rippleLayer fadeInRippleAnimated:YES completion:nil];
// Then
XCTAssertTrue([rippleLayer.addedAnimations.firstObject isKindOfClass:[CABasicAnimation class]]);
CABasicAnimation *basicAnimation = (CABasicAnimation *)rippleLayer.addedAnimations.firstObject;
XCTAssertEqual(rippleLayer.addedAnimations.count, 1U);
XCTAssertEqualObjects(@"opacity", basicAnimation.keyPath);
XCTAssertEqualObjects(@1, basicAnimation.toValue);
XCTAssertEqualObjects(@0, basicAnimation.fromValue);
XCTAssertEqualObjects([CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear],
basicAnimation.timingFunction);
XCTAssertEqualWithAccuracy(basicAnimation.duration, (CGFloat)0.075, 0.0001);
}
- (void)testFadeOutRippleAnimationCorrectness {
// Given
FakeMDCRippleLayer *rippleLayer = [[FakeMDCRippleLayer alloc] init];
// When
[rippleLayer fadeOutRippleAnimated:YES completion:nil];
// Then
XCTAssertTrue([rippleLayer.addedAnimations.firstObject isKindOfClass:[CABasicAnimation class]]);
CABasicAnimation *basicAnimation = (CABasicAnimation *)rippleLayer.addedAnimations.firstObject;
XCTAssertEqual(rippleLayer.addedAnimations.count, 1U);
XCTAssertEqualObjects(@"opacity", basicAnimation.keyPath);
XCTAssertEqualObjects(@0, basicAnimation.toValue);
XCTAssertEqualObjects(@1, basicAnimation.fromValue);
XCTAssertEqualObjects([CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear],
basicAnimation.timingFunction);
XCTAssertEqualWithAccuracy(basicAnimation.duration, (CGFloat)0.075, 0.0001);
}
/** Test that setting @c maximumRadius correctly sets the property on @c MDCRippleLayer. */
- (void)testRippleRadiusSetToCustomValue {
// Given
MDCRippleLayer *rippleLayer = [[MDCRippleLayer alloc] init];
CGFloat fakeRadius = 25;
// When
rippleLayer.maximumRadius = fakeRadius;
// Then
XCTAssertEqual(rippleLayer.maximumRadius, fakeRadius);
}
@end
NS_ASSUME_NONNULL_END
|
{
"content_hash": "f0e3249293fbeea7c256d27a4462e664",
"timestamp": "",
"source": "github",
"line_count": 293,
"max_line_length": 100,
"avg_line_length": 35.91467576791809,
"alnum_prop": 0.760239475434762,
"repo_name": "material-components/material-components-ios",
"id": "59520720c24b3629783b422479c155bb15918af7",
"size": "10523",
"binary": false,
"copies": "2",
"ref": "refs/heads/develop",
"path": "components/Ripple/tests/unit/MDCRippleLayerTests.m",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "15108"
},
{
"name": "Objective-C",
"bytes": "7907886"
},
{
"name": "Python",
"bytes": "22330"
},
{
"name": "Ruby",
"bytes": "108390"
},
{
"name": "Shell",
"bytes": "118227"
},
{
"name": "Swift",
"bytes": "896400"
}
]
}
|
ProcessGroup::ProcessGroup(Process* leader) : gid(leader->getPid()), listProc()
{
listProc.push_back(leader);
}
void ProcessGroup::addProcess(Process* proc)
{
listProc.push_back(proc);
proc->setpgid(gid);
}
ProcessGroup::~ProcessGroup()
{
}
void ProcessGroup::removeProcess(Process* proc)
{
for (auto it = listProc.begin(); it != listProc.end(); ++it) {
if (*it == proc) {
listProc.erase(it);
break;
}
}
}
bool ProcessGroup::empty()
{
return (listProc.size() == 0);
}
|
{
"content_hash": "1bfb75075c20b788e5893f29c5a5d961",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 79,
"avg_line_length": 15.806451612903226,
"alnum_prop": 0.6571428571428571,
"repo_name": "boulangg/phoenix",
"id": "1c4dac5eef185c18c0a8a215429219c14bf6be64",
"size": "519",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "kernel/src/proc/ProcessGroup.cpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "18563"
},
{
"name": "C",
"bytes": "379839"
},
{
"name": "C++",
"bytes": "373722"
},
{
"name": "CMake",
"bytes": "17103"
},
{
"name": "GDB",
"bytes": "92"
},
{
"name": "Python",
"bytes": "1381"
},
{
"name": "Shell",
"bytes": "5728"
}
]
}
|
<?php
/* knp_menu.html.twig */
class __TwigTemplate_7e968a9b449025bf5c075581baa5eda3be0b4acbcb3c2d6d0c9542be1f29e85c extends Twig_Template
{
public function __construct(Twig_Environment $env)
{
parent::__construct($env);
// line 1
try {
$this->parent = $this->env->loadTemplate("knp_menu_base.html.twig");
} catch (Twig_Error_Loader $e) {
$e->setTemplateFile($this->getTemplateName());
$e->setTemplateLine(1);
throw $e;
}
$this->blocks = array(
'compressed_root' => array($this, 'block_compressed_root'),
'root' => array($this, 'block_root'),
'list' => array($this, 'block_list'),
'children' => array($this, 'block_children'),
'item' => array($this, 'block_item'),
'linkElement' => array($this, 'block_linkElement'),
'spanElement' => array($this, 'block_spanElement'),
'label' => array($this, 'block_label'),
);
}
protected function doGetParent(array $context)
{
return "knp_menu_base.html.twig";
}
protected function doDisplay(array $context, array $blocks = array())
{
$this->parent->display($context, array_merge($this->blocks, $blocks));
}
// line 11
public function block_compressed_root($context, array $blocks = array())
{
// line 12
ob_start();
// line 13
$this->displayBlock("root", $context, $blocks);
echo "
";
echo trim(preg_replace('/>\s+</', '><', ob_get_clean()));
}
// line 17
public function block_root($context, array $blocks = array())
{
// line 18
$context["listAttributes"] = $this->getAttribute((isset($context["item"]) ? $context["item"] : $this->getContext($context, "item")), "childrenAttributes", array());
// line 19
$this->displayBlock("list", $context, $blocks);
}
// line 22
public function block_list($context, array $blocks = array())
{
// line 23
if ((($this->getAttribute((isset($context["item"]) ? $context["item"] : $this->getContext($context, "item")), "hasChildren", array()) && !($this->getAttribute((isset($context["options"]) ? $context["options"] : $this->getContext($context, "options")), "depth", array()) === 0)) && $this->getAttribute((isset($context["item"]) ? $context["item"] : $this->getContext($context, "item")), "displayChildren", array()))) {
// line 24
echo " ";
$context["knp_menu"] = $this;
// line 25
echo " <ul";
echo $context["knp_menu"]->getattributes((isset($context["listAttributes"]) ? $context["listAttributes"] : $this->getContext($context, "listAttributes")));
echo ">
";
// line 26
$this->displayBlock("children", $context, $blocks);
echo "
</ul>
";
}
}
// line 31
public function block_children($context, array $blocks = array())
{
// line 33
$context["currentOptions"] = (isset($context["options"]) ? $context["options"] : $this->getContext($context, "options"));
// line 34
$context["currentItem"] = (isset($context["item"]) ? $context["item"] : $this->getContext($context, "item"));
// line 36
if ( !(null === $this->getAttribute((isset($context["options"]) ? $context["options"] : $this->getContext($context, "options")), "depth", array()))) {
// line 37
$context["options"] = twig_array_merge((isset($context["options"]) ? $context["options"] : $this->getContext($context, "options")), array("depth" => ($this->getAttribute((isset($context["currentOptions"]) ? $context["currentOptions"] : $this->getContext($context, "currentOptions")), "depth", array()) - 1)));
}
// line 40
if (( !(null === $this->getAttribute((isset($context["options"]) ? $context["options"] : $this->getContext($context, "options")), "matchingDepth", array())) && ($this->getAttribute((isset($context["options"]) ? $context["options"] : $this->getContext($context, "options")), "matchingDepth", array()) > 0))) {
// line 41
$context["options"] = twig_array_merge((isset($context["options"]) ? $context["options"] : $this->getContext($context, "options")), array("matchingDepth" => ($this->getAttribute((isset($context["currentOptions"]) ? $context["currentOptions"] : $this->getContext($context, "currentOptions")), "matchingDepth", array()) - 1)));
}
// line 43
$context['_parent'] = (array) $context;
$context['_seq'] = twig_ensure_traversable($this->getAttribute((isset($context["currentItem"]) ? $context["currentItem"] : $this->getContext($context, "currentItem")), "children", array()));
$context['loop'] = array(
'parent' => $context['_parent'],
'index0' => 0,
'index' => 1,
'first' => true,
);
if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof Countable)) {
$length = count($context['_seq']);
$context['loop']['revindex0'] = $length - 1;
$context['loop']['revindex'] = $length;
$context['loop']['length'] = $length;
$context['loop']['last'] = 1 === $length;
}
foreach ($context['_seq'] as $context["_key"] => $context["item"]) {
// line 44
echo " ";
$this->displayBlock("item", $context, $blocks);
echo "
";
++$context['loop']['index0'];
++$context['loop']['index'];
$context['loop']['first'] = false;
if (isset($context['loop']['length'])) {
--$context['loop']['revindex0'];
--$context['loop']['revindex'];
$context['loop']['last'] = 0 === $context['loop']['revindex0'];
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['item'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 47
$context["item"] = (isset($context["currentItem"]) ? $context["currentItem"] : $this->getContext($context, "currentItem"));
// line 48
$context["options"] = (isset($context["currentOptions"]) ? $context["currentOptions"] : $this->getContext($context, "currentOptions"));
}
// line 51
public function block_item($context, array $blocks = array())
{
// line 52
if ($this->getAttribute((isset($context["item"]) ? $context["item"] : $this->getContext($context, "item")), "displayed", array())) {
// line 54
$context["classes"] = (( !twig_test_empty($this->getAttribute((isset($context["item"]) ? $context["item"] : $this->getContext($context, "item")), "attribute", array(0 => "class"), "method"))) ? (array(0 => $this->getAttribute((isset($context["item"]) ? $context["item"] : $this->getContext($context, "item")), "attribute", array(0 => "class"), "method"))) : (array()));
// line 55
if ($this->getAttribute((isset($context["matcher"]) ? $context["matcher"] : $this->getContext($context, "matcher")), "isCurrent", array(0 => (isset($context["item"]) ? $context["item"] : $this->getContext($context, "item"))), "method")) {
// line 56
$context["classes"] = twig_array_merge((isset($context["classes"]) ? $context["classes"] : $this->getContext($context, "classes")), array(0 => $this->getAttribute((isset($context["options"]) ? $context["options"] : $this->getContext($context, "options")), "currentClass", array())));
} elseif ($this->getAttribute( // line 57
(isset($context["matcher"]) ? $context["matcher"] : $this->getContext($context, "matcher")), "isAncestor", array(0 => (isset($context["item"]) ? $context["item"] : $this->getContext($context, "item")), 1 => $this->getAttribute((isset($context["options"]) ? $context["options"] : $this->getContext($context, "options")), "matchingDepth", array())), "method")) {
// line 58
$context["classes"] = twig_array_merge((isset($context["classes"]) ? $context["classes"] : $this->getContext($context, "classes")), array(0 => $this->getAttribute((isset($context["options"]) ? $context["options"] : $this->getContext($context, "options")), "ancestorClass", array())));
}
// line 60
if ($this->getAttribute((isset($context["item"]) ? $context["item"] : $this->getContext($context, "item")), "actsLikeFirst", array())) {
// line 61
$context["classes"] = twig_array_merge((isset($context["classes"]) ? $context["classes"] : $this->getContext($context, "classes")), array(0 => $this->getAttribute((isset($context["options"]) ? $context["options"] : $this->getContext($context, "options")), "firstClass", array())));
}
// line 63
if ($this->getAttribute((isset($context["item"]) ? $context["item"] : $this->getContext($context, "item")), "actsLikeLast", array())) {
// line 64
$context["classes"] = twig_array_merge((isset($context["classes"]) ? $context["classes"] : $this->getContext($context, "classes")), array(0 => $this->getAttribute((isset($context["options"]) ? $context["options"] : $this->getContext($context, "options")), "lastClass", array())));
}
// line 66
echo "
";
// line 68
echo " ";
if (($this->getAttribute((isset($context["item"]) ? $context["item"] : $this->getContext($context, "item")), "hasChildren", array()) && !($this->getAttribute((isset($context["options"]) ? $context["options"] : $this->getContext($context, "options")), "depth", array()) === 0))) {
// line 69
echo " ";
if (( !twig_test_empty($this->getAttribute((isset($context["options"]) ? $context["options"] : $this->getContext($context, "options")), "branch_class", array())) && $this->getAttribute((isset($context["item"]) ? $context["item"] : $this->getContext($context, "item")), "displayChildren", array()))) {
// line 70
$context["classes"] = twig_array_merge((isset($context["classes"]) ? $context["classes"] : $this->getContext($context, "classes")), array(0 => $this->getAttribute((isset($context["options"]) ? $context["options"] : $this->getContext($context, "options")), "branch_class", array())));
// line 71
echo " ";
}
// line 72
echo " ";
} elseif ( !twig_test_empty($this->getAttribute((isset($context["options"]) ? $context["options"] : $this->getContext($context, "options")), "leaf_class", array()))) {
// line 73
$context["classes"] = twig_array_merge((isset($context["classes"]) ? $context["classes"] : $this->getContext($context, "classes")), array(0 => $this->getAttribute((isset($context["options"]) ? $context["options"] : $this->getContext($context, "options")), "leaf_class", array())));
}
// line 76
$context["attributes"] = $this->getAttribute((isset($context["item"]) ? $context["item"] : $this->getContext($context, "item")), "attributes", array());
// line 77
if ( !twig_test_empty((isset($context["classes"]) ? $context["classes"] : $this->getContext($context, "classes")))) {
// line 78
$context["attributes"] = twig_array_merge((isset($context["attributes"]) ? $context["attributes"] : $this->getContext($context, "attributes")), array("class" => twig_join_filter((isset($context["classes"]) ? $context["classes"] : $this->getContext($context, "classes")), " ")));
}
// line 81
echo " ";
$context["knp_menu"] = $this;
// line 82
echo " <li";
echo $context["knp_menu"]->getattributes((isset($context["attributes"]) ? $context["attributes"] : $this->getContext($context, "attributes")));
echo ">";
// line 83
if (( !twig_test_empty($this->getAttribute((isset($context["item"]) ? $context["item"] : $this->getContext($context, "item")), "uri", array())) && ( !$this->getAttribute((isset($context["matcher"]) ? $context["matcher"] : $this->getContext($context, "matcher")), "isCurrent", array(0 => (isset($context["item"]) ? $context["item"] : $this->getContext($context, "item"))), "method") || $this->getAttribute((isset($context["options"]) ? $context["options"] : $this->getContext($context, "options")), "currentAsLink", array())))) {
// line 84
echo " ";
$this->displayBlock("linkElement", $context, $blocks);
} else {
// line 86
echo " ";
$this->displayBlock("spanElement", $context, $blocks);
}
// line 89
$context["childrenClasses"] = (( !twig_test_empty($this->getAttribute((isset($context["item"]) ? $context["item"] : $this->getContext($context, "item")), "childrenAttribute", array(0 => "class"), "method"))) ? (array(0 => $this->getAttribute((isset($context["item"]) ? $context["item"] : $this->getContext($context, "item")), "childrenAttribute", array(0 => "class"), "method"))) : (array()));
// line 90
$context["childrenClasses"] = twig_array_merge((isset($context["childrenClasses"]) ? $context["childrenClasses"] : $this->getContext($context, "childrenClasses")), array(0 => ("menu_level_" . $this->getAttribute((isset($context["item"]) ? $context["item"] : $this->getContext($context, "item")), "level", array()))));
// line 91
$context["listAttributes"] = twig_array_merge($this->getAttribute((isset($context["item"]) ? $context["item"] : $this->getContext($context, "item")), "childrenAttributes", array()), array("class" => twig_join_filter((isset($context["childrenClasses"]) ? $context["childrenClasses"] : $this->getContext($context, "childrenClasses")), " ")));
// line 92
echo " ";
$this->displayBlock("list", $context, $blocks);
echo "
</li>
";
}
}
// line 97
public function block_linkElement($context, array $blocks = array())
{
$context["knp_menu"] = $this;
echo "<a href=\"";
echo twig_escape_filter($this->env, $this->getAttribute((isset($context["item"]) ? $context["item"] : $this->getContext($context, "item")), "uri", array()), "html", null, true);
echo "\"";
echo $context["knp_menu"]->getattributes($this->getAttribute((isset($context["item"]) ? $context["item"] : $this->getContext($context, "item")), "linkAttributes", array()));
echo ">";
$this->displayBlock("label", $context, $blocks);
echo "</a>";
}
// line 99
public function block_spanElement($context, array $blocks = array())
{
$context["knp_menu"] = $this;
echo "<span";
echo $context["knp_menu"]->getattributes($this->getAttribute((isset($context["item"]) ? $context["item"] : $this->getContext($context, "item")), "labelAttributes", array()));
echo ">";
$this->displayBlock("label", $context, $blocks);
echo "</span>";
}
// line 101
public function block_label($context, array $blocks = array())
{
if (($this->getAttribute((isset($context["options"]) ? $context["options"] : $this->getContext($context, "options")), "allow_safe_labels", array()) && $this->getAttribute((isset($context["item"]) ? $context["item"] : $this->getContext($context, "item")), "getExtra", array(0 => "safe_label", 1 => false), "method"))) {
echo $this->getAttribute((isset($context["item"]) ? $context["item"] : $this->getContext($context, "item")), "label", array());
} else {
echo twig_escape_filter($this->env, $this->getAttribute((isset($context["item"]) ? $context["item"] : $this->getContext($context, "item")), "label", array()), "html", null, true);
}
}
// line 3
public function getattributes($__attributes__ = null)
{
$context = $this->env->mergeGlobals(array(
"attributes" => $__attributes__,
));
$blocks = array();
ob_start();
try {
// line 4
$context['_parent'] = (array) $context;
$context['_seq'] = twig_ensure_traversable((isset($context["attributes"]) ? $context["attributes"] : $this->getContext($context, "attributes")));
foreach ($context['_seq'] as $context["name"] => $context["value"]) {
// line 5
if (( !(null === $context["value"]) && !($context["value"] === false))) {
// line 6
echo sprintf(" %s=\"%s\"", $context["name"], ((($context["value"] === true)) ? (twig_escape_filter($this->env, $context["name"])) : (twig_escape_filter($this->env, $context["value"]))));
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['name'], $context['value'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
} catch (Exception $e) {
ob_end_clean();
throw $e;
}
return ('' === $tmp = ob_get_clean()) ? '' : new Twig_Markup($tmp, $this->env->getCharset());
}
public function getTemplateName()
{
return "knp_menu.html.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
return array ( 278 => 6, 276 => 5, 272 => 4, 261 => 3, 251 => 101, 240 => 99, 227 => 97, 218 => 92, 216 => 91, 214 => 90, 212 => 89, 208 => 86, 204 => 84, 202 => 83, 198 => 82, 195 => 81, 192 => 78, 190 => 77, 188 => 76, 185 => 73, 182 => 72, 179 => 71, 177 => 70, 174 => 69, 171 => 68, 168 => 66, 165 => 64, 163 => 63, 160 => 61, 158 => 60, 155 => 58, 153 => 57, 151 => 56, 149 => 55, 147 => 54, 145 => 52, 142 => 51, 138 => 48, 136 => 47, 119 => 44, 102 => 43, 99 => 41, 97 => 40, 94 => 37, 92 => 36, 90 => 34, 88 => 33, 85 => 31, 77 => 26, 72 => 25, 69 => 24, 67 => 23, 64 => 22, 60 => 19, 58 => 18, 55 => 17, 48 => 13, 46 => 12, 43 => 11, 11 => 1,);
}
}
|
{
"content_hash": "18c8ed0ab2e231651d5539fa34e2dae2",
"timestamp": "",
"source": "github",
"line_count": 307,
"max_line_length": 721,
"avg_line_length": 61.08794788273616,
"alnum_prop": 0.5386584195371654,
"repo_name": "orlk/hopitrepo",
"id": "b05497f1a304cf7d049957dc47b3d7f3276e0493",
"size": "18754",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/cache/dev/twig/7e/96/8a9b449025bf5c075581baa5eda3be0b4acbcb3c2d6d0c9542be1f29e85c.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "3073"
},
{
"name": "Batchfile",
"bytes": "373"
},
{
"name": "CSS",
"bytes": "102659"
},
{
"name": "HTML",
"bytes": "155478"
},
{
"name": "JavaScript",
"bytes": "130336"
},
{
"name": "PHP",
"bytes": "257295"
},
{
"name": "Shell",
"bytes": "593"
}
]
}
|
package org.apereo.cas.config;
import com.mongodb.MongoClientURI;
import com.warrenstrange.googleauth.IGoogleAuthenticator;
import org.apereo.cas.adaptors.gauth.MongoDbGoogleAuthenticatorTokenCredentialRepository;
import org.apereo.cas.adaptors.gauth.MongoDbGoogleAuthenticatorTokenRepository;
import org.apereo.cas.configuration.CasConfigurationProperties;
import org.apereo.cas.configuration.model.support.mfa.MultifactorAuthenticationProperties;
import org.apereo.cas.otp.repository.credentials.OneTimeTokenCredentialRepository;
import org.apereo.cas.otp.repository.token.OneTimeTokenRepository;
import org.springframework.beans.factory.BeanCreationException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor;
import org.springframework.data.mongodb.MongoDbFactory;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.SimpleMongoDbFactory;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;
/**
* This is {@link GoogleAuthentiacatorMongoDbConfiguration}.
*
* @author Misagh Moayyed
* @since 5.0.0
*/
@Configuration("googleAuthentiacatorMongoDbConfiguration")
@EnableConfigurationProperties(CasConfigurationProperties.class)
@EnableTransactionManagement(proxyTargetClass = true)
@EnableScheduling
public class GoogleAuthentiacatorMongoDbConfiguration {
@Autowired
@Qualifier("googleAuthenticatorInstance")
private IGoogleAuthenticator googleAuthenticatorInstance;
@Autowired
private CasConfigurationProperties casProperties;
@RefreshScope
@Bean
public PersistenceExceptionTranslationPostProcessor persistenceExceptionTranslationPostProcessor() {
return new PersistenceExceptionTranslationPostProcessor();
}
@RefreshScope
@Bean
public MongoTemplate mongoDbGoogleAuthenticatorTemplate() {
return new MongoTemplate(mongoDbGoogleAuthenticatorFactory());
}
@RefreshScope
@Bean
public MongoDbFactory mongoDbGoogleAuthenticatorFactory() {
try {
final MultifactorAuthenticationProperties.GAuth.Mongodb mongo = casProperties.getAuthn().getMfa().getGauth().getMongodb();
return new SimpleMongoDbFactory(new MongoClientURI(mongo.getClientUri()));
} catch (final Exception e) {
throw new BeanCreationException(e.getMessage(), e);
}
}
@Bean
public OneTimeTokenCredentialRepository googleAuthenticatorAccountRegistry() {
final MultifactorAuthenticationProperties.GAuth.Mongodb mongo = casProperties.getAuthn().getMfa().getGauth().getMongodb();
return new MongoDbGoogleAuthenticatorTokenCredentialRepository(
googleAuthenticatorInstance,
mongoDbGoogleAuthenticatorTemplate(),
mongo.getCollection(),
mongo.isDropCollection()
);
}
@Bean
public OneTimeTokenRepository oneTimeTokenAuthenticatorTokenRepository() {
final MultifactorAuthenticationProperties.GAuth.Mongodb mongo = casProperties.getAuthn().getMfa().getGauth().getMongodb();
return new MongoDbGoogleAuthenticatorTokenRepository(mongoDbGoogleAuthenticatorTemplate(),
mongo.getTokenCollection(),
mongo.isDropCollection(),
casProperties.getAuthn().getMfa().getGauth().getTimeStepSize());
}
}
|
{
"content_hash": "7d0a3003be8b8e0752229ff4ce94f861",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 134,
"avg_line_length": 44.7906976744186,
"alnum_prop": 0.789460020768432,
"repo_name": "gabedwrds/cas",
"id": "af34e2e6fe584e184f5a8f98a191c20d46fc0957",
"size": "3852",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "support/cas-server-support-gauth-mongo/src/main/java/org/apereo/cas/config/GoogleAuthentiacatorMongoDbConfiguration.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "341009"
},
{
"name": "Groovy",
"bytes": "4592"
},
{
"name": "HTML",
"bytes": "205588"
},
{
"name": "Java",
"bytes": "5420335"
},
{
"name": "JavaScript",
"bytes": "168785"
},
{
"name": "Shell",
"bytes": "5427"
}
]
}
|
/*
* <blockinfo type="IPFIXSource" invocation="async" thread_exclusive="True">
* <humandesc>
* Reads records from an IPFIX transport session and outputs messages
* according to the datatypes registered with the source block. May
* send out Messages of any type, depending on the data received from
* the remote IPFIX device and the the registered data types.
* </humandesc>
*
* <shortdesc>Receives messages from an IPFIX exporter</shortdesc>
*
* <gates>
* <gate type="output" name="source_out" msg_type="Any" m_start="0" m_end="0" />
* </gates>
*
* <paramsschema>
* element params {
* element collect {
* attribute transport {"udp"|"tcp"|"sctp"},
* attribute port {xsd:integer}?
* } |
* element file {
* attribute name {text}
* }
* element datatype {
* attribute name {text}
* }*
* }
* </paramsschema>
*
* <paramsexample>
* <params>
* <collect port="4739" transport="tcp"/>
* <datatype name="ipv4flow"/>
* or
* <file name="foo.ipfix"/>
* <datatype name="ipv4flow"/>
* </params>
* </paramsexample>
*
* <variables>
* </variables>
*
* </blockinfo>
*/
#include <boost/lexical_cast.hpp>
#include <Block.hpp>
#include <Collector.h>
#include <UDPCollector.h>
#include <TCPSingleCollector.h>
#include <FileReader.h>
#include <IPFIXTypeRegistry.hpp>
#include <IPFIXTypeBridge.hpp>
#include <IPFIXBootstrap.hpp>
#include <BlockFactory.hpp>
#include <Timer.hpp>
namespace blockmon
{
class IPFIXSource: public Block {
private:
std::list<std::shared_ptr<IPFIXTypeBridge> > m_bridges;
std::unique_ptr<IPFIX::Collector> m_collector;
IPFIX::MBuf m_mbuf;
int m_gate_id;
unsigned int m_eosdelay;
static const unsigned int kEOSTimer = 1;
void configUDPCollection(std::string& port) {
blocklog(std::string("will collect from udp ") + port, log_info);
IPFIX::NetAddress na(port, 17, AF_INET);
m_collector = std::unique_ptr<IPFIX::Collector>(
new IPFIX::UDPCollector(na));
}
void configTCPCollection(std::string& port) {
blocklog(std::string("will collect from tcp ") + port, log_info);
IPFIX::NetAddress na(port, 6, AF_INET);
m_collector = std::unique_ptr<IPFIX::Collector>(
new IPFIX::TCPSingleCollector(na));
}
void configFileImport(std::string& filename) {
blocklog(std::string("will read from file ") + filename, log_info);
m_collector = std::unique_ptr<IPFIX::Collector> (
new IPFIX::FileReader(filename));
}
public:
/**
* Configure the block given an XML element containing configuration.
* Called before the block will begin receiving messages.
*
* @param params_node the <params> XML element containing block parameters
*/
virtual void _configure(const pugi::xml_node& params_node) {
bootstrapIPFIX();
// Does not support reconfiguration yet.
if (m_collector) {
throw new std::logic_error("IPFIXSource not reconfigurable");
}
// create a collector
pugi::xml_node col_node;
if ((col_node = params_node.child("collect"))) {
std::string transport = col_node.attribute("transport").value();
std::string port = col_node.attribute("port").value();
if (transport.empty()) {
transport = "tcp";
}
if (port.empty()) {
port = std::string("4739");
}
if (transport == std::string("udp")) {
configUDPCollection(port);
} else if (transport == std::string("tcp")) {
configTCPCollection(port);
} else if (transport == std::string("sctp")) {
throw std::runtime_error("SCTP not yet supported");
} else {
throw std::runtime_error("Unsupported transport");
}
} else if ((col_node = params_node.child("file"))) {
std::string name = col_node.attribute("name").value();
if (name.empty()) {
throw std::runtime_error("File requires name");
}
configFileImport(name);
}
// Populate list of bridges (data types)
for (pugi::xml_node dt_node = params_node.child("datatype");
dt_node;
dt_node = dt_node.next_sibling("datatype"))
{
std::string dt_name = dt_node.attribute("name").value();
if (dt_name.empty()) {
throw std::runtime_error("Datatype missing name");
}
std::shared_ptr<IPFIXTypeBridge> bridge =
IPFIXTypeRegistry::instance().bridgeForTypeName(dt_name);
if (bridge.get() == NULL) {
throw std::runtime_error("Unknown datatype " + dt_name);
}
// prepare the collector (register receivers)
bridge->prepareCollector(*m_collector, get_output_gate(m_gate_id));
// store the bridge
m_bridges.push_back(bridge);
}
}
IPFIXSource(const std::string& name, invocation_type invocation):
Block(name, invocation),
m_collector(),
m_mbuf(),
m_gate_id(register_output_gate("source_out")),
m_eosdelay(10) {}
virtual ~IPFIXSource() {}
void _do_async() {
if (m_collector) {
if (!m_collector->receiveMessage(m_mbuf)) {
// null out collector -- causes close
// FIXME yeah sick hackery but g++ is tedious
m_collector = std::unique_ptr<IPFIX::Collector>(reinterpret_cast<IPFIX::Collector*>(0));
blocklog(std::string("Collector at end of stream, will wait ") +
boost::lexical_cast<std::string>(m_eosdelay) +
" seconds, then shut down", log_warning);
// set a timer to shut down after a delay
set_timer_at(get_BM_time() + m_eosdelay * 1000000, "end of stream", kEOSTimer);
}
} else {
// async without collector, do nothing.
}
}
void _handle_timer(std::shared_ptr<Timer>&& t) {
if (t->get_id() == kEOSTimer) {
blocklog(std::string("Collector shutdown"), log_warning);
exit(0);
}
}
};
REGISTER_BLOCK(IPFIXSource,"IPFIXSource")
}
|
{
"content_hash": "1b8dc39aa59f9caec52de4b2c4ee7af9",
"timestamp": "",
"source": "github",
"line_count": 202,
"max_line_length": 104,
"avg_line_length": 33.084158415841586,
"alnum_prop": 0.5491545713003142,
"repo_name": "cnplab/blockmon",
"id": "03b747eecd4e71cdd55ee26449122476218f29be",
"size": "8528",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "blocks/IPFIXSource.cpp",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "136416"
},
{
"name": "C++",
"bytes": "1147895"
},
{
"name": "CMake",
"bytes": "6197"
},
{
"name": "Makefile",
"bytes": "71"
},
{
"name": "Python",
"bytes": "156101"
},
{
"name": "VHDL",
"bytes": "1593300"
}
]
}
|
package io.searchbox.core.search.aggregation;
import com.google.gson.JsonObject;
import java.util.Objects;
/**
* Place holder class used to represent the root aggregation
* returned to the user for processing.
*
* @author cfstout
*/
public class RootAggregation extends MetricAggregation {
public RootAggregation(String name, JsonObject root) {
super(name, root);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), "root");
}
}
|
{
"content_hash": "92e7ad80c6c223bb9675f22b8fd5755a",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 60,
"avg_line_length": 20.75,
"alnum_prop": 0.6987951807228916,
"repo_name": "searchbox-io/Jest",
"id": "0efc313ff7ee27828bb2a2e5aa92d514858bb7d1",
"size": "498",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "jest-common/src/main/java/io/searchbox/core/search/aggregation/RootAggregation.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "1069790"
}
]
}
|
namespace chromeos {
class AccountMigrationWelcomeDialog : public SystemWebDialogDelegate {
public:
// Displays the migration dialog for the |email|.
static AccountMigrationWelcomeDialog* Show(const std::string& email);
protected:
AccountMigrationWelcomeDialog(const GURL gurl, const std::string& email);
~AccountMigrationWelcomeDialog() override;
// ui::SystemWebDialogDelegate overrides.
void AdjustWidgetInitParams(views::Widget::InitParams* params) override;
void GetDialogSize(gfx::Size* size) const override;
std::string GetDialogArgs() const override;
bool ShouldShowDialogTitle() const override;
bool ShouldShowCloseButton() const override;
const std::string& Id() override;
std::string GetUserEmail() const;
private:
const std::string email_;
const std::string id_;
DISALLOW_COPY_AND_ASSIGN(AccountMigrationWelcomeDialog);
};
} // namespace chromeos
#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_ACCOUNT_MIGRATION_WELCOME_DIALOG_H_
|
{
"content_hash": "4c154ddade0169459613fcd2fb8171cd",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 79,
"avg_line_length": 30.6875,
"alnum_prop": 0.7708757637474541,
"repo_name": "endlessm/chromium-browser",
"id": "96670974836b8dce627cb553f048c3e708a991a2",
"size": "1443",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "chrome/browser/ui/webui/chromeos/account_migration_welcome_dialog.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": []
}
|
set -e
# Additional arguments:
# --rebuild_docs: Just build the projects and docs, don't create nuget packages.
# Also, use the latest to pick up new docs changes rather than
# the commit of the tag.
# --skip_tests: Skip the integration tests
# --ssh: Use SSH to clone GitHub repos
rebuild_docs=false
run_tests=true
clone_path_prefix="https://github.com/"
commit=
while (( "$#" )); do
if [[ "$1" == "--rebuild_docs" ]]
then
rebuild_docs=true
elif [[ "$1" == "--skip_tests" ]]
then
run_tests=false
elif [[ "$1" == "--ssh" ]]
then
clone_path_prefix="git@github.com:"
else
commit=$1
fi
shift
done
if [ -z "$commit" ]
then
echo "Please specify a commit hash"
exit 1
fi
# Do everything from the repository root for sanity.
cd $(dirname $0)
rm -rf releasebuild
git clone ${clone_path_prefix}googleapis/dotnet-spanner-nhibernate.git releasebuild -c core.autocrlf=input --recursive
cd releasebuild
# Make sure the package is deterministic. We don't do this for local builds,
# but it makes debugging work more reliably for PDBs in packages.
export DeterministicSourcePaths=true
if [[ "$rebuild_docs" = true ]]
then
git checkout main
else
git checkout $commit
fi
# Turn the multi-line output of git tag --points-at into space-separated list of projects
projects="Google.Cloud.Spanner.NHibernate"
./build.sh $projects
# TODO: Figure out how to get the integration tests to run.
if [[ "$rebuild_docs" = false ]]
then
for project in $projects
do
# Don't pack the whole solution - just the project. (Avoids packing dependent
# projects such as Google.LongRunning.)
dotnet pack --no-build --no-restore -o $PWD/nuget -c Release $project
done
fi
# TODO: Use builddocs.sh to build docs.
echo "Release build and docs complete for the following projects:"
for project in $projects
do
echo "- ${project}"
done
if [[ "$rebuild_docs" = false ]]
then
echo "- Push packages to nuget:"
echo " - cd releasebuild/nuget"
echo " - Remove any packages you don't want to push"
echo " - for pkg in *.nupkg; do dotnet nuget push -s https://api.nuget.org/v3/index.json -k API_KEY_HERE \$pkg; done"
fi
|
{
"content_hash": "57101398627c818163d868ad4d23857f",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 120,
"avg_line_length": 26.313253012048193,
"alnum_prop": 0.6868131868131868,
"repo_name": "googleapis/dotnet-spanner-nhibernate",
"id": "4215ce38fe2a35fb55be04f950c152f50f2178f2",
"size": "2389",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "buildrelease.sh",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "216"
},
{
"name": "C#",
"bytes": "1065435"
},
{
"name": "Shell",
"bytes": "15739"
}
]
}
|
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null
|
{
"content_hash": "eb2128f5092fbbd20c55f8431a96dcee",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.23076923076923,
"alnum_prop": 0.6917293233082706,
"repo_name": "mdoering/backbone",
"id": "d1f3bd94b10fa139645b4f7196ec34ce963e60e2",
"size": "183",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Fagales/Fagaceae/Quercus/Quercus suber/ Syn. Quercus suber genuina/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": []
}
|
<?php
/**
* Detects for-loops that can be simplified to a while-loop.
*
* This rule is based on the PMD rule catalog. Detects for-loops that can be
* simplified as a while-loop.
*
* <code>
* class Foo
* {
* public function bar($x)
* {
* for (;true;) true; // No Init or Update part, may as well be: while (true)
* }
* }
* </code>
*
* @category PHP
* @package PHP_CodeSniffer
* @author Manuel Pichler <mapi@manuel-pichler.de>
* @copyright 2007-2014 Manuel Pichler. All rights reserved.
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
* @version Release: @package_version@
* @link http://pear.php.net/package/PHP_CodeSniffer
*/
class Generic_Sniffs_CodeAnalysis_ForLoopShouldBeWhileLoopSniff implements PHP_CodeSniffer_Sniff
{
/**
* Registers the tokens that this sniff wants to listen for.
*
* @return array(integer)
*/
public function register()
{
return array(T_FOR);
}//end register()
/**
* Processes this test, when one of its tokens is encountered.
*
* @param PHP_CodeSniffer_File $phpcsFile The file being scanned.
* @param int $stackPtr The position of the current token
* in the stack passed in $tokens.
*
* @return void
*/
public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
{
$tokens = $phpcsFile->getTokens();
$token = $tokens[$stackPtr];
// Skip invalid statement.
if (isset($token['parenthesis_opener']) === false) {
return;
}
$next = ++$token['parenthesis_opener'];
$end = --$token['parenthesis_closer'];
$parts = array(
0,
0,
0,
);
$index = 0;
for (; $next <= $end; ++$next) {
$code = $tokens[$next]['code'];
if ($code === T_SEMICOLON) {
++$index;
} else if (isset(PHP_CodeSniffer_Tokens::$emptyTokens[$code]) === false) {
++$parts[$index];
}
}
if ($parts[0] === 0 && $parts[2] === 0 && $parts[1] > 0) {
$error = 'This FOR loop can be simplified to a WHILE loop';
$phpcsFile->addWarning($error, $stackPtr, 'CanSimplify');
}
}//end process()
}//end class
|
{
"content_hash": "7ce05b211aece076a5e8f197bf0ce212",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 96,
"avg_line_length": 27.044444444444444,
"alnum_prop": 0.5349219391947412,
"repo_name": "hunyoboy/respository_list",
"id": "3fc1c80bd8f017caded6cb39c1338a8ef2469edb",
"size": "2881",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/CodeAnalysis/ForLoopShouldBeWhileLoopSniff.php",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "ApacheConf",
"bytes": "291"
},
{
"name": "CSS",
"bytes": "126731"
},
{
"name": "HTML",
"bytes": "40472"
},
{
"name": "JavaScript",
"bytes": "58965"
},
{
"name": "Makefile",
"bytes": "186"
},
{
"name": "PHP",
"bytes": "61952"
}
]
}
|
End of preview.
No dataset card yet
- Downloads last month
- 5