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: TypeError
Message: Couldn't cast array of type
struct<content_hash: string, timestamp: string, source: string, line_count: int64, max_line_length: int64, avg_line_length: double, alnum_prop: double, repo_name: string, id: string, size: string, binary: bool, copies: string, ref: string, path: string, mode: string, license: string, language: list<item: struct<name: string, bytes: string>>, symlink_target: string>
to
{'content_hash': Value(dtype='string', id=None), 'timestamp': Value(dtype='string', id=None), 'source': Value(dtype='string', id=None), 'line_count': Value(dtype='int64', id=None), 'max_line_length': Value(dtype='int64', id=None), 'avg_line_length': Value(dtype='float64', id=None), 'alnum_prop': Value(dtype='float64', id=None), 'repo_name': Value(dtype='string', id=None), 'id': Value(dtype='string', id=None), 'size': Value(dtype='string', id=None), 'binary': Value(dtype='bool', id=None), 'copies': Value(dtype='string', id=None), 'ref': Value(dtype='string', id=None), 'path': Value(dtype='string', id=None), 'mode': Value(dtype='string', id=None), 'license': Value(dtype='string', id=None), 'language': [{'name': Value(dtype='string', id=None), 'bytes': Value(dtype='string', id=None)}]}
Traceback: Traceback (most recent call last):
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 2011, in _prepare_split_single
writer.write_table(table)
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/arrow_writer.py", line 585, in write_table
pa_table = table_cast(pa_table, self._schema)
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 2302, in table_cast
return cast_table_to_schema(table, schema)
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 2261, in cast_table_to_schema
arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 2261, in <listcomp>
arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 1802, in wrapper
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 1802, in <listcomp>
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 2122, in cast_array_to_feature
raise TypeError(f"Couldn't cast array of type\n{_short_str(array.type)}\nto\n{_short_str(feature)}")
TypeError: Couldn't cast array of type
struct<content_hash: string, timestamp: string, source: string, line_count: int64, max_line_length: int64, avg_line_length: double, alnum_prop: double, repo_name: string, id: string, size: string, binary: bool, copies: string, ref: string, path: string, mode: string, license: string, language: list<item: struct<name: string, bytes: string>>, symlink_target: string>
to
{'content_hash': Value(dtype='string', id=None), 'timestamp': Value(dtype='string', id=None), 'source': Value(dtype='string', id=None), 'line_count': Value(dtype='int64', id=None), 'max_line_length': Value(dtype='int64', id=None), 'avg_line_length': Value(dtype='float64', id=None), 'alnum_prop': Value(dtype='float64', id=None), 'repo_name': Value(dtype='string', id=None), 'id': Value(dtype='string', id=None), 'size': Value(dtype='string', id=None), 'binary': Value(dtype='bool', id=None), 'copies': Value(dtype='string', id=None), 'ref': Value(dtype='string', id=None), 'path': Value(dtype='string', id=None), 'mode': Value(dtype='string', id=None), 'license': Value(dtype='string', id=None), 'language': [{'name': Value(dtype='string', id=None), 'bytes': Value(dtype='string', id=None)}]}
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 |
|---|---|
layout: post
title: Jekyll Video
date: 2015-08-24 00:00:00
homepage: https://github.com/mushishi78/jekyll-video
download: https://github.com/mushishi78/jekyll-video/archive/gh-pages.zip
demo: http://mushishi78.github.io/jekyll-video/
author: Max White
thumbnail: jekyll-video.jpg
license: MIT License
license_link: https://github.com/mushishi78/jekyll-video/blob/gh-pages/LICENSE
---
A video blog.
|
{
"content_hash": "101bbfc7789886d8e157fd768f04ab8c",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 78,
"avg_line_length": 30.692307692307693,
"alnum_prop": 0.7819548872180451,
"repo_name": "lach76/lach76.github.io",
"id": "c5c992a1a6cc93fafa89831ef19c952873eb2e34",
"size": "403",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "_posts/2015-08-24-jekyll-video.markdown",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "187589"
},
{
"name": "HTML",
"bytes": "5911"
}
]
}
|
import {get} from "ember-metal/property_get";
import {set} from "ember-metal/property_set";
import run from "ember-metal/run_loop";
import EnumerableUtils from "ember-metal/enumerable_utils";
import jQuery from "ember-views/system/jquery";
import {View} from "ember-views/views/view";
import ContainerView from "ember-views/views/container_view";
var indexOf = EnumerableUtils.indexOf;
// .......................................................
// removeChild()
//
var parentView, child;
module("View#removeChild", {
setup: function() {
parentView = ContainerView.create({ childViews: [View] });
child = get(parentView, 'childViews').objectAt(0);
},
teardown: function() {
run(function() {
parentView.destroy();
child.destroy();
});
}
});
test("returns receiver", function() {
equal(parentView.removeChild(child), parentView, 'receiver');
});
test("removes child from parent.childViews array", function() {
ok(indexOf(get(parentView, 'childViews'), child)>=0, 'precond - has child in childViews array before remove');
parentView.removeChild(child);
ok(indexOf(get(parentView, 'childViews'), child)<0, 'removed child');
});
test("sets parentView property to null", function() {
ok(get(child, 'parentView'), 'precond - has parentView');
parentView.removeChild(child);
ok(!get(child, 'parentView'), 'parentView is now null');
});
// .......................................................
// removeAllChildren()
//
var view, childViews;
module("View#removeAllChildren", {
setup: function() {
view = ContainerView.create({
childViews: [View, View, View]
});
childViews = view.get('childViews');
},
teardown: function() {
run(function() {
childViews.forEach(function(v) { v.destroy(); });
view.destroy();
});
}
});
test("removes all child views", function() {
equal(get(view, 'childViews.length'), 3, 'precond - has child views');
view.removeAllChildren();
equal(get(view, 'childViews.length'), 0, 'removed all children');
});
test("returns receiver", function() {
equal(view.removeAllChildren(), view, 'receiver');
});
// .......................................................
// removeFromParent()
//
module("View#removeFromParent", {
teardown: function() {
run(function() {
if (parentView) { parentView.destroy(); }
if (child) { child.destroy(); }
if (view) { view.destroy(); }
});
}
});
test("removes view from parent view", function() {
parentView = ContainerView.create({ childViews: [View] });
child = get(parentView, 'childViews').objectAt(0);
ok(get(child, 'parentView'), 'precond - has parentView');
run(function() {
parentView.createElement();
});
ok(parentView.$('div').length, "precond - has a child DOM element");
run(function() {
child.removeFromParent();
});
ok(!get(child, 'parentView'), 'no longer has parentView');
ok(indexOf(get(parentView, 'childViews'), child)<0, 'no longer in parent childViews');
equal(parentView.$('div').length, 0, "removes DOM element from parent");
});
test("returns receiver", function() {
parentView = ContainerView.create({ childViews: [View] });
child = get(parentView, 'childViews').objectAt(0);
var removed = run(function() {
return child.removeFromParent();
});
equal(removed, child, 'receiver');
});
test("does nothing if not in parentView", function() {
var callCount = 0;
child = View.create();
// monkey patch for testing...
ok(!get(child, 'parentView'), 'precond - has no parent');
child.removeFromParent();
run(function() {
child.destroy();
});
});
test("the DOM element is gone after doing append and remove in two separate runloops", function() {
view = View.create();
run(function() {
view.append();
});
run(function() {
view.remove();
});
var viewElem = jQuery('#'+get(view, 'elementId'));
ok(viewElem.length === 0, "view's element doesn't exist in DOM");
});
test("the DOM element is gone after doing append and remove in a single runloop", function() {
view = View.create();
run(function() {
view.append();
view.remove();
});
var viewElem = jQuery('#'+get(view, 'elementId'));
ok(viewElem.length === 0, "view's element doesn't exist in DOM");
});
|
{
"content_hash": "9b38091a2eeda0b9ea2c923738572070",
"timestamp": "",
"source": "github",
"line_count": 156,
"max_line_length": 112,
"avg_line_length": 27.378205128205128,
"alnum_prop": 0.6272535705923671,
"repo_name": "tomdale/ember.js",
"id": "e8242a01aa2ef28b84374f7bc991b697fd115940",
"size": "4271",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "packages_es6/ember-views/tests/views/view/remove_test.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "2454767"
},
{
"name": "Ruby",
"bytes": "9686"
},
{
"name": "Shell",
"bytes": "3065"
}
]
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Print_a_Deck
{
class Program
{
static void Main(string[] args)
{
}
}
}
|
{
"content_hash": "f25b87224911d6831eac6a03ff7895a4",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 39,
"avg_line_length": 15.666666666666666,
"alnum_prop": 0.6382978723404256,
"repo_name": "tpulkov/CSharp-Part1",
"id": "f7e57bd4bb2beaed30e2ba8354781308d80442a7",
"size": "237",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "homework/06.Loops-Solution/Print-a-Deck/Program.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "75710"
}
]
}
|
package org.jasig.portal.events.aggr;
import org.joda.time.DateMidnight;
/**
* Details about a term of the year
*
* @author Eric Dalquist
* @version $Revision$
*/
public interface AcademicTermDetail extends DateRange<DateMidnight>, Comparable<AcademicTermDetail> {
/**
* @return The name of the term, cannot be null
*/
String getTermName();
/**
* Set the name of the term
*/
void setTermName(String termName);
/**
* Set the start of the term, inclusive
*/
void setStart(DateMidnight start);
/**
* Set the end of the term, exclusive
*/
void setEnd(DateMidnight end);
/**
* Compare to another {@link AcademicTermDetail}, must sort by {@link #getStart()}
*/
@Override
int compareTo(AcademicTermDetail o);
}
|
{
"content_hash": "a5a61eead2b74d40653f92a06c124db6",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 101,
"avg_line_length": 21.23076923076923,
"alnum_prop": 0.6231884057971014,
"repo_name": "vertein/uPortal",
"id": "c95aad8e6bf84dcf2aae80bd1e6fe656e446f591",
"size": "1598",
"binary": false,
"copies": "8",
"ref": "refs/heads/master",
"path": "uportal-war/src/main/java/org/jasig/portal/events/aggr/AcademicTermDetail.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "716593"
},
{
"name": "Groovy",
"bytes": "8658"
},
{
"name": "Java",
"bytes": "7836703"
},
{
"name": "JavaScript",
"bytes": "235793"
},
{
"name": "Perl",
"bytes": "1740"
},
{
"name": "Shell",
"bytes": "7996"
},
{
"name": "XSLT",
"bytes": "411306"
}
]
}
|
<phpunit bootstrap="./tests/bootstrap.php">
<php>
<env name="embed_resolver" value="Curl"/>
</php>
<testsuites>
<testsuite name="All tests">
<directory>./tests/</directory>
</testsuite>
</testsuites>
</phpunit>
|
{
"content_hash": "b897ab66657bacd6a109c41532f2c4d1",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 43,
"avg_line_length": 20.454545454545453,
"alnum_prop": 0.6577777777777778,
"repo_name": "thenextweb/Embed",
"id": "5116ceb27705e2e40f573355dcb4f789e96153e9",
"size": "225",
"binary": false,
"copies": "6",
"ref": "refs/heads/master",
"path": "phpunit.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1629"
},
{
"name": "PHP",
"bytes": "194822"
}
]
}
|
package weixin.popular.util;
import java.util.HashSet;
import java.util.Queue;
import java.util.Set;
import java.util.Timer;
import java.util.TimerTask;
import java.util.concurrent.ConcurrentLinkedQueue;
/**
* 会值过期的Set
* @author Administrator
*
* @param <K>
* @param <V>
*/
public class ExpireSet<K> extends HashSet<K>{
/**
*
*/
private static final long serialVersionUID = 3883547126660410769L;
{
Timer timer = new Timer(true);
timer.schedule(new TimerTask() {
@Override
public void run() {
KeyValue<K> kv = null;
long currentTime = System.currentTimeMillis();
while(true){
kv = queue.peek();
if(kv!=null && kv.value<currentTime){
set.remove(kv.key);
queue.poll();
}else{
break;
}
}
}
}, 1000*10, 1000*60);
}
private Queue<KeyValue<K>> queue = new ConcurrentLinkedQueue<ExpireSet<K>.KeyValue<K>>();
private int period = 60;
private Set<K> set = this;
public ExpireSet(){}
/**
*
* @param period 过期时间(秒)
*/
public ExpireSet(int period){
this.period = period;
}
@Override
public boolean add(K e) {
queue.offer(new KeyValue<K>(e,System.currentTimeMillis()+1000*period));
return super.add(e);
}
protected class KeyValue<KK>{
KK key;
long value;
public KeyValue(KK key,long value){
this.key = key;
this.value = value;
}
}
}
|
{
"content_hash": "6a230e24e62c0b1ece53641bd9d0d85a",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 90,
"avg_line_length": 18.240506329113924,
"alnum_prop": 0.6072172102706453,
"repo_name": "hesling/weixin-popular",
"id": "1a715dc7ed4b1ac19dee3ba6e19b1b4cc00a145a",
"size": "1461",
"binary": false,
"copies": "7",
"ref": "refs/heads/master",
"path": "src/main/java/weixin/popular/util/ExpireSet.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "320132"
}
]
}
|
import filterMappers from "./filterMappers.js";
describe("filterMappers", () => {
describe("getCommonValues", () => {
it("should return commonValues", () => {
const result = filterMappers.getCommonFilterValues(
{
keepNull: false,
},
Immutable.Map({ columnName: "age", transformType: "keeponly" })
);
expect(result).to.eql({
type: "filter",
sourceColumnName: "age",
keepNull: false,
exclude: false,
});
});
});
describe("mapFilterExcludeRange", () => {
it("should return correct values", () => {
const values = {
lowerBound: 2,
upperBound: 4,
keepNull: false,
lowerBoundInclusive: true,
upperBoundInclusive: false,
replacementType: "INTEGER",
replacementValue: "1",
};
expect(filterMappers.mapFilterExcludeRange(values, "INTEGER")).to.eql({
type: "Range",
lowerBound: 2,
upperBound: 4,
lowerBoundInclusive: true,
upperBoundInclusive: false,
dataType: "INTEGER",
});
});
});
describe("mapFilterExcludeValues", () => {
it("should return correct values", () => {
const values = {
replaceType: "VALUE",
replacementValue: "ss",
replaceValues: ["address1"],
};
expect(filterMappers.mapFilterExcludeValues(values, "TEXT")).to.eql({
type: "Value",
valuesList: ["address1"],
dataType: "TEXT",
});
});
});
});
|
{
"content_hash": "f175ec66f9362607e0b7c56b65f6cee2",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 77,
"avg_line_length": 26.362068965517242,
"alnum_prop": 0.5493786788750817,
"repo_name": "dremio/dremio-oss",
"id": "a323f7a3aa0b4c3ad4b6ed8f1de071f369c2439d",
"size": "2139",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "dac/ui/src/utils/mappers/ExplorePage/Transform/filterMappers-spec.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "47376"
},
{
"name": "Dockerfile",
"bytes": "1668"
},
{
"name": "FreeMarker",
"bytes": "132156"
},
{
"name": "GAP",
"bytes": "15936"
},
{
"name": "HTML",
"bytes": "6544"
},
{
"name": "Java",
"bytes": "39679012"
},
{
"name": "JavaScript",
"bytes": "5439822"
},
{
"name": "Less",
"bytes": "547002"
},
{
"name": "SCSS",
"bytes": "95688"
},
{
"name": "Shell",
"bytes": "16063"
},
{
"name": "TypeScript",
"bytes": "887739"
}
]
}
|
import ddt
import itertools
from manila.api.openstack import api_version_request as api_version
from manila.api.views import share_networks
from manila import test
from manila.tests.api import fakes
@ddt.ddt
class ViewBuilderTestCase(test.TestCase):
def setUp(self):
super(ViewBuilderTestCase, self).setUp()
self.builder = share_networks.ViewBuilder()
def test__collection_name(self):
self.assertEqual('share_networks', self.builder._collection_name)
@ddt.data(*itertools.product(
[
{'id': 'fake_sn_id', 'name': 'fake_sn_name',
'share_network_subnets': []},
{'id': 'fake_sn_id', 'name': 'fake_sn_name',
'share_network_subnets': [], 'fake_extra_key': 'foo'},
{'id': 'fake_sn_id', 'name': 'fake_sn_name',
'share_network_subnets': [
{'availability_zone_id': None,
'id': 'fake',
'availability_zone': None,
'is_default': False
}],
'fake_extra_key': 'foo'},
],
["1.0", "2.0", "2.18", "2.20", "2.25", "2.26",
"2.49", api_version._MAX_API_VERSION])
)
@ddt.unpack
def test_build_share_network(self, share_network_data, microversion):
gateway_support = (api_version.APIVersionRequest(microversion) >=
api_version.APIVersionRequest('2.18'))
mtu_support = (api_version.APIVersionRequest(microversion) >=
api_version.APIVersionRequest('2.20'))
nova_net_support = (api_version.APIVersionRequest(microversion) <
api_version.APIVersionRequest('2.26'))
default_net_info_support = (api_version.APIVersionRequest(microversion)
<= api_version.APIVersionRequest('2.49'))
subnets_support = (api_version.APIVersionRequest(microversion) >
api_version.APIVersionRequest('2.49'))
status_and_sec_serv_update = (
api_version.APIVersionRequest(microversion) >=
api_version.APIVersionRequest('2.63'))
network_allocation_update_support = (
api_version.APIVersionRequest(microversion) >=
api_version.APIVersionRequest('2.69'))
req = fakes.HTTPRequest.blank('/share-networks', version=microversion)
expected_keys = {
'id', 'name', 'project_id', 'created_at', 'updated_at',
'description'}
if subnets_support:
expected_keys.add('share_network_subnets')
else:
if default_net_info_support:
network_info = {
'neutron_net_id', 'neutron_subnet_id', 'network_type',
'segmentation_id', 'cidr', 'ip_version'}
expected_keys.update(network_info)
if gateway_support:
expected_keys.add('gateway')
if mtu_support:
expected_keys.add('mtu')
if nova_net_support:
expected_keys.add('nova_net_id')
if status_and_sec_serv_update:
expected_keys.update({'status', 'security_service_update_support'})
if network_allocation_update_support:
expected_keys.add('network_allocation_update_support')
result = self.builder.build_share_network(req, share_network_data)
self.assertEqual(1, len(result))
self.assertIn('share_network', result)
self.assertEqual(share_network_data['id'],
result['share_network']['id'])
self.assertEqual(share_network_data['name'],
result['share_network']['name'])
self.assertEqual(len(expected_keys),
len(result['share_network']))
for key in expected_keys:
self.assertIn(key, result['share_network'])
for key in result['share_network']:
self.assertIn(key, expected_keys)
@ddt.data(*itertools.product(
[
[],
[{'id': 'fake_id',
'name': 'fake_name',
'project_id': 'fake_project_id',
'created_at': 'fake_created_at',
'updated_at': 'fake_updated_at',
'neutron_net_id': 'fake_neutron_net_id',
'neutron_subnet_id': 'fake_neutron_subnet_id',
'network_type': 'fake_network_type',
'segmentation_id': 'fake_segmentation_id',
'cidr': 'fake_cidr',
'ip_version': 'fake_ip_version',
'description': 'fake_description'},
{'id': 'fake_id2',
'name': 'fake_name2'}],
],
set(["1.0", "2.0", "2.18", "2.20", "2.25", "2.26", "2.49",
api_version._MAX_API_VERSION]))
)
@ddt.unpack
def test_build_share_networks_with_details(self, share_networks,
microversion):
gateway_support = (api_version.APIVersionRequest(microversion) >=
api_version.APIVersionRequest('2.18'))
mtu_support = (api_version.APIVersionRequest(microversion) >=
api_version.APIVersionRequest('2.20'))
nova_net_support = (api_version.APIVersionRequest(microversion) <
api_version.APIVersionRequest('2.26'))
default_net_info_support = (api_version.APIVersionRequest(microversion)
<= api_version.APIVersionRequest('2.49'))
subnets_support = (api_version.APIVersionRequest(microversion) >
api_version.APIVersionRequest('2.49'))
status_and_sec_serv_update = (
api_version.APIVersionRequest(microversion) >=
api_version.APIVersionRequest('2.63'))
network_allocation_update_support = (
api_version.APIVersionRequest(microversion) >=
api_version.APIVersionRequest('2.69'))
req = fakes.HTTPRequest.blank('/share-networks', version=microversion)
expected_networks_list = []
for share_network in share_networks:
expected_data = {
'id': share_network.get('id'),
'name': share_network.get('name'),
'project_id': share_network.get('project_id'),
'created_at': share_network.get('created_at'),
'updated_at': share_network.get('updated_at'),
'description': share_network.get('description'),
}
if subnets_support:
share_network.update({'share_network_subnets': []})
expected_data.update({'share_network_subnets': []})
else:
if default_net_info_support:
network_data = {
'neutron_net_id': share_network.get('neutron_net_id'),
'neutron_subnet_id': share_network.get(
'neutron_subnet_id'),
'network_type': share_network.get('network_type'),
'segmentation_id': share_network.get(
'segmentation_id'),
'cidr': share_network.get('cidr'),
'ip_version': share_network.get('ip_version'),
}
expected_data.update(network_data)
if gateway_support:
share_network.update({'gateway': 'fake_gateway'})
expected_data.update({'gateway':
share_network.get('gateway')})
if mtu_support:
share_network.update({'mtu': 1509})
expected_data.update({'mtu': share_network.get('mtu')})
if nova_net_support:
share_network.update({'nova_net_id': 'fake_nova_net_id'})
expected_data.update({'nova_net_id': None})
if status_and_sec_serv_update:
share_network.update(
{'status': 'active',
'security_service_update_support': False})
expected_data.update(
{'status': 'active',
'security_service_update_support': False})
if network_allocation_update_support:
share_network.update(
{'network_allocation_update_support': None})
expected_data.update(
{'network_allocation_update_support': None})
expected_networks_list.append(expected_data)
expected = {'share_networks': expected_networks_list}
result = self.builder.build_share_networks(req, share_networks,
is_detail=True)
self.assertEqual(expected, result)
@ddt.data(*itertools.product(
[
[],
[{'id': 'foo', 'name': 'bar'}],
[{'id': 'id1', 'name': 'name1'}, {'id': 'id2', 'name': 'name2'}],
[{'id': 'id1', 'name': 'name1'},
{'id': 'id2', 'name': 'name2',
'fake': 'I should not be returned'}]
],
set(["1.0", "2.0", "2.18", "2.20", "2.25", "2.26", "2.49",
api_version._MAX_API_VERSION]))
)
@ddt.unpack
def test_build_share_networks_without_details(self, share_networks,
microversion):
req = fakes.HTTPRequest.blank('/share-networks', version=microversion)
expected = []
for share_network in share_networks:
expected.append({
'id': share_network.get('id'),
'name': share_network.get('name')
})
expected = {'share_networks': expected}
result = self.builder.build_share_networks(req, share_networks,
is_detail=False)
self.assertEqual(expected, result)
@ddt.data(('update_security_service', True),
('add_security_service', False))
@ddt.unpack
def test_build_security_service_update_check(self, operation, is_admin):
req = fakes.HTTPRequest.blank('/share-networks',
use_admin_context=is_admin)
params = {'new_service_id': 'new_id'}
if operation == 'update_security_service':
params['current_service_id'] = 'current_id'
hosts_result = {
'compatible': True,
'hosts_check_result': {'hostA': True}
}
expected = {
'compatible': True,
'requested_operation': {
'operation': operation,
'current_security_service': params.get('current_service_id'),
'new_security_service': params.get('new_service_id'),
},
}
if is_admin:
expected['hosts_check_result'] = hosts_result['hosts_check_result']
result = self.builder.build_security_service_update_check(req,
params,
hosts_result)
self.assertEqual(expected, result)
@ddt.data(True, False)
def test_build_share_network_subnet_create_check(self, is_admin):
req = fakes.HTTPRequest.blank('/share-networks',
use_admin_context=is_admin)
hosts_result = {
'compatible': True,
'hosts_check_result': {'hostA': True}
}
expected = {'compatible': True}
if is_admin:
expected['hosts_check_result'] = hosts_result['hosts_check_result']
result = self.builder.build_share_network_subnet_create_check(
req, hosts_result)
self.assertEqual(expected, result)
|
{
"content_hash": "534797007fa9048c39ae8632b5d3a419",
"timestamp": "",
"source": "github",
"line_count": 267,
"max_line_length": 79,
"avg_line_length": 44.39325842696629,
"alnum_prop": 0.5202058550577913,
"repo_name": "openstack/manila",
"id": "98e6583fbb49ce303007e56053b96db940f6cd9a",
"size": "12487",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "manila/tests/api/views/test_share_networks.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Mako",
"bytes": "953"
},
{
"name": "Python",
"bytes": "12728998"
},
{
"name": "Shell",
"bytes": "107601"
}
]
}
|
module TradeQueen
module Errors
class TooManyRequests < Base
def retry_after
@http_response['x-ratelimit-retry-after'].to_i
end
end
end
end
|
{
"content_hash": "8cb3c7fa9806d1b568abbb18326f2539",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 54,
"avg_line_length": 19.11111111111111,
"alnum_prop": 0.6511627906976745,
"repo_name": "nbrookie/trade_queen",
"id": "0a4698de9fd1e24de2285b3a74cfb33816853d7b",
"size": "172",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/trade_queen/errors/too_many_requests.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "16548"
},
{
"name": "Shell",
"bytes": "131"
}
]
}
|
============================
What's new in PyTables 1.4
============================
:Author: Francesc Altet
:Contact: faltet@carabos.com
:Author: Ivan Vilata i Balaguer
:Contact: ivilata@carabos.com
This document details the modifications to PyTables since version 1.3. Its
main purpose is help you ensure that your programs will be runnable when you
switch from PyTables 1.3 to PyTables 1.4.
API additions
=============
- The ``Table.getWhereList()`` method has got a new ``sort`` parameter. The
default now is to get the list of parameters unsorted. Set ``sort`` to True
to get the old behaviour. We've done this to avoid unnecessary ordering of
potentially large sets of coordinates.
- Node creation, copying and moving operations have received a new optional
`createparents` argument. When true, the necessary groups in the target
path that don't exist at the time of running the operation are automatically
created, so that the target group of the operation always exists.
Backward-incompatible changes
=============================
- None
Deprecated features
===================
- None
API refinements
===============
- ``Description._v_walk()`` has been renamed to ``_f_walk()``, since it is a
public method, not a value.
- ``Table.removeIndex()`` now accepts a column name in addition to an
``Index`` instance (the later is deprecated). This avoids the user having
to retrieve the needed ``Index`` object.
Bug fixes (affecting API)
=========================
- None
----
**Enjoy data!**
-- The PyTables Team
.. Local Variables:
.. mode: text
.. coding: utf-8
.. fill-column: 78
.. End:
|
{
"content_hash": "e320cf4c5a197a4e48ca6da96df2d57b",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 78,
"avg_line_length": 23.239436619718308,
"alnum_prop": 0.6575757575757576,
"repo_name": "joonro/PyTables",
"id": "e933cce6cfe262e62df79cb7e78a7a04d57d0508",
"size": "1650",
"binary": false,
"copies": "16",
"ref": "refs/heads/develop",
"path": "doc/source/release-notes/RELEASE_NOTES_v1.4.rst",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "896101"
},
{
"name": "C++",
"bytes": "97380"
},
{
"name": "CMake",
"bytes": "21598"
},
{
"name": "Gnuplot",
"bytes": "2104"
},
{
"name": "Makefile",
"bytes": "4159"
},
{
"name": "Objective-C",
"bytes": "1404"
},
{
"name": "Python",
"bytes": "3322852"
},
{
"name": "Shell",
"bytes": "16985"
}
]
}
|
<?php
namespace Symfony\Component\HttpKernel\DataCollector;
use Symfony\Component\HttpKernel\DataCollector\DataCollector;
use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
/**
* TimeDataCollector.
*
* @author Fabien Potencier <fabien@symfony.com>
*/
class TimeDataCollector extends DataCollector
{
protected $kernel;
public function __construct(KernelInterface $kernel = null)
{
$this->kernel = $kernel;
}
/**
* {@inheritdoc}
*/
public function collect(Request $request, Response $response, \Exception $exception = null)
{
$this->data = array(
'start_time' => (null !== $this->kernel ? $this->kernel->getStartTime() : $_SERVER['REQUEST_TIME']) * 1000,
'events' => array(),
);
}
/**
* Sets the request events.
*
* @param array $events The request events
*/
public function setEvents(array $events)
{
foreach ($events as $event) {
$event->ensureStopped();
}
$this->data['events'] = $events;
}
/**
* Gets the request events.
*
* @return array The request events
*/
public function getEvents()
{
return $this->data['events'];
}
/**
* Gets the request elapsed time.
*
* @return float The elapsed time
*/
public function getTotalTime()
{
$lastEvent = $this->data['events']['__section__'];
return $lastEvent->getOrigin() + $lastEvent->getTotalTime() - $this->data['start_time'];
}
/**
* Gets the initialization time.
*
* This is the time spent until the beginning of the request handling.
*
* @return float The elapsed time
*/
public function getInitTime()
{
return $this->data['events']['__section__']->getOrigin() - $this->getStartTime();
}
/**
* Gets the request time.
*
* @return integer The time
*/
public function getStartTime()
{
return $this->data['start_time'];
}
/**
* {@inheritdoc}
*/
public function getName()
{
return 'time';
}
}
|
{
"content_hash": "68aeeb2650c153e0f0beb9bafae57f15",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 119,
"avg_line_length": 21.980392156862745,
"alnum_prop": 0.5758251561106156,
"repo_name": "goetas/symfony",
"id": "a91e91c78c7992d732c5150d11fc07c767d8f35d",
"size": "2471",
"binary": false,
"copies": "19",
"ref": "refs/heads/master",
"path": "src/Symfony/Component/HttpKernel/DataCollector/TimeDataCollector.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "17153"
},
{
"name": "Graphviz (DOT)",
"bytes": "3215"
},
{
"name": "PHP",
"bytes": "6240326"
},
{
"name": "TypeScript",
"bytes": "195"
}
]
}
|
require 'timeout'
module WaitSteps
extend RSpec::Matchers::DSL
matcher :become_true do
match do |block|
begin
Timeout.timeout(10) do
loop do
value = block.call
break if value == true
end
end
true
rescue TimeoutError
false
end
end
end
end
|
{
"content_hash": "8bc95ab5e5490ce46c6592bb4210e6bf",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 34,
"avg_line_length": 16.571428571428573,
"alnum_prop": 0.5344827586206896,
"repo_name": "tristil/method-todo",
"id": "0bd9b21c41ebd0a96b463074ad4d3bcd97699c6e",
"size": "348",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "spec/support/wait_steps.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1675"
},
{
"name": "CoffeeScript",
"bytes": "35806"
},
{
"name": "JavaScript",
"bytes": "18020"
},
{
"name": "Ruby",
"bytes": "107032"
}
]
}
|
var THREEx = THREEx || {}
THREEx.ArPatternFile = {}
THREEx.ArPatternFile.toCanvas = function(patternFileString, onComplete){
console.assert(false, 'not yet implemented')
}
//////////////////////////////////////////////////////////////////////////////
// function to encode image
//////////////////////////////////////////////////////////////////////////////
THREEx.ArPatternFile.encodeImageURL = function(imageURL, onComplete){
var image = new Image;
image.onload = function(){
var patternFileString = THREEx.ArPatternFile.encodeImage(image)
onComplete(patternFileString)
}
image.src = imageURL;
}
THREEx.ArPatternFile.encodeImage = function(image){
// copy image on canvas
var canvas = document.createElement('canvas');
var context = canvas.getContext('2d')
canvas.width = 16;
canvas.height = 16;
// document.body.appendChild(canvas)
// canvas.style.width = '200px'
var patternFileString = ''
for(var orientation = 0; orientation > -2*Math.PI; orientation -= Math.PI/2){
// draw on canvas - honor orientation
context.save();
context.clearRect(0,0,canvas.width,canvas.height);
context.translate(canvas.width/2,canvas.height/2);
context.rotate(orientation);
context.drawImage(image, -canvas.width/2,-canvas.height/2, canvas.width, canvas.height);
context.restore();
// get imageData
var imageData = context.getImageData(0, 0, canvas.width, canvas.height)
// generate the patternFileString for this orientation
if( orientation !== 0 ) patternFileString += '\n'
// NOTE bgr order and not rgb!!! so from 2 to 0
for(var channelOffset = 2; channelOffset >= 0; channelOffset--){
// console.log('channelOffset', channelOffset)
for(var y = 0; y < imageData.height; y++){
for(var x = 0; x < imageData.width; x++){
if( x !== 0 ) patternFileString += ' '
var offset = (y*imageData.width*4) + (x * 4) + channelOffset
var value = imageData.data[offset]
patternFileString += String(value).padStart(3);
}
patternFileString += '\n'
}
}
}
return patternFileString
}
//////////////////////////////////////////////////////////////////////////////
// trigger download
//////////////////////////////////////////////////////////////////////////////
THREEx.ArPatternFile.triggerDownload = function(patternFileString){
// tech from https://stackoverflow.com/questions/3665115/create-a-file-in-memory-for-user-to-download-not-through-server
var domElement = window.document.createElement('a');
domElement.href = window.URL.createObjectURL(new Blob([patternFileString], {type: 'text/plain'}));
domElement.download = 'pattern-marker.patt';
document.body.appendChild(domElement)
domElement.click();
document.body.removeChild(domElement)
}
THREEx.ArPatternFile.buildFullMarker = function(innerImageURL, onComplete){
var whiteMargin = 0.1
var blackMargin = 0.2
var innerMargin = whiteMargin + blackMargin
var canvas = document.createElement('canvas');
var context = canvas.getContext('2d')
canvas.width = canvas.height = 512
context.fillStyle = 'white';
context.fillRect(0,0,canvas.width, canvas.height)
// copy image on canvas
context.fillStyle = 'black';
context.fillRect(
whiteMargin * canvas.width,
whiteMargin * canvas.height,
canvas.width * (1-2*whiteMargin),
canvas.height * (1-2*whiteMargin)
);
// clear the area for innerImage (in case of transparent image)
context.fillStyle = 'white';
context.fillRect(
innerMargin * canvas.width,
innerMargin * canvas.height,
canvas.width * (1-2*innerMargin),
canvas.height * (1-2*innerMargin)
);
// display innerImage in the middle
var innerImage = document.createElement('img')
innerImage.addEventListener('load', function(){
// draw innerImage
context.drawImage(innerImage,
innerMargin * canvas.width,
innerMargin * canvas.height,
canvas.width * (1-2*innerMargin),
canvas.height * (1-2*innerMargin)
);
var imageUrl = canvas.toDataURL()
onComplete(imageUrl)
})
innerImage.src = innerImageURL
}
|
{
"content_hash": "2b1dfb3220d7ff61605be95beedbce0c",
"timestamp": "",
"source": "github",
"line_count": 129,
"max_line_length": 121,
"avg_line_length": 31.031007751937985,
"alnum_prop": 0.6600049962528104,
"repo_name": "cousquer/AR",
"id": "c764f8c52f51e9fc6ec9ae803e345a077243aec3",
"size": "4003",
"binary": false,
"copies": "6",
"ref": "refs/heads/master",
"path": "three.js/examples/marker-training/threex-arpatternfile.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Brainfuck",
"bytes": "12484"
},
{
"name": "C",
"bytes": "12484"
},
{
"name": "CSS",
"bytes": "292"
},
{
"name": "Forth",
"bytes": "12484"
},
{
"name": "GAP",
"bytes": "12484"
},
{
"name": "HTML",
"bytes": "494383"
},
{
"name": "JavaScript",
"bytes": "2581986"
},
{
"name": "Makefile",
"bytes": "15652"
}
]
}
|
package com.reactmq.queue
import scala.collection.mutable
import java.util.UUID
import com.reactmq.util.NowProvider
/**
* Copied & simplified from ElasticMQ.
*/
trait QueueActorStorage {
def nowProvider: NowProvider
var messageQueue = mutable.PriorityQueue[InternalMessage]()
val messagesById = mutable.HashMap[String, InternalMessage]()
case class InternalMessage(
id: String,
var nextDelivery: Long,
content: String) extends Comparable[InternalMessage] {
// Priority queues have biggest elements first
def compareTo(other: InternalMessage) = - nextDelivery.compareTo(other.nextDelivery)
def toMessageData = MessageData(id, content)
def toMessageAdded = MessageAdded(id, nextDelivery, content)
def toMessageNextDeliveryUpdated = MessageNextDeliveryUpdated(id, nextDelivery)
}
object InternalMessage {
def from(content: String) = InternalMessage(
UUID.randomUUID().toString,
nowProvider.nowMillis,
content)
}
}
|
{
"content_hash": "d1e2f9b54eab24cf4f00e173287652f6",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 88,
"avg_line_length": 27.47222222222222,
"alnum_prop": 0.7492416582406471,
"repo_name": "haghard/reactmq",
"id": "0fc3ef30f5b5d4ac86fbc015525ff9b8624e4a03",
"size": "989",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/main/scala/com/reactmq/queue/QueueActorStorage.scala",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Scala",
"bytes": "21506"
}
]
}
|
<?xml version="1.0" encoding="UTF-8"?>
<module codename="org.netbeans.modules.profiler.selector.api/1">
<module_version install_time="1380188202882" last="true" origin="installer" specification_version="1.23.1">
<file crc="386975286" name="config/Modules/org-netbeans-modules-profiler-selector-api.xml"/>
<file crc="3842170574" name="modules/org-netbeans-modules-profiler-selector-api.jar"/>
</module_version>
</module>
|
{
"content_hash": "37c268bf7e5f3a1c1c2291708427a92e",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 111,
"avg_line_length": 63.42857142857143,
"alnum_prop": 0.7207207207207207,
"repo_name": "svanschalkwyk/datafari",
"id": "d1ee65d2e231cf0b5bf0b033844652482569b33a",
"size": "444",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "debian7/jvm/lib/visualvm/profiler/update_tracking/org-netbeans-modules-profiler-selector-api.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "AMPL",
"bytes": "291"
},
{
"name": "Batchfile",
"bytes": "166634"
},
{
"name": "C",
"bytes": "3950596"
},
{
"name": "C#",
"bytes": "8440"
},
{
"name": "C++",
"bytes": "1806622"
},
{
"name": "CSS",
"bytes": "996076"
},
{
"name": "F#",
"bytes": "2310"
},
{
"name": "Forth",
"bytes": "506"
},
{
"name": "GLSL",
"bytes": "1040"
},
{
"name": "Groff",
"bytes": "7328332"
},
{
"name": "HTML",
"bytes": "3845976"
},
{
"name": "Inno Setup",
"bytes": "15298"
},
{
"name": "Java",
"bytes": "4071199"
},
{
"name": "JavaScript",
"bytes": "11468742"
},
{
"name": "Makefile",
"bytes": "38845"
},
{
"name": "Mako",
"bytes": "13678"
},
{
"name": "Mask",
"bytes": "969"
},
{
"name": "Objective-C",
"bytes": "29733"
},
{
"name": "PLSQL",
"bytes": "115000"
},
{
"name": "PLpgSQL",
"bytes": "343922"
},
{
"name": "Perl",
"bytes": "92722"
},
{
"name": "Perl6",
"bytes": "206146"
},
{
"name": "PowerShell",
"bytes": "38303"
},
{
"name": "Python",
"bytes": "19597957"
},
{
"name": "R",
"bytes": "2528"
},
{
"name": "Ruby",
"bytes": "40275"
},
{
"name": "SQLPL",
"bytes": "81817"
},
{
"name": "Shell",
"bytes": "807009"
},
{
"name": "Tcl",
"bytes": "2150885"
},
{
"name": "Thrift",
"bytes": "40240"
},
{
"name": "Visual Basic",
"bytes": "481"
},
{
"name": "XS",
"bytes": "132994"
},
{
"name": "XSLT",
"bytes": "13301"
}
]
}
|
/**
* BinaryTreeNode represents a node in a binary tree with a left and
* right child.
*
* @author Dr. Lewis
* @author Dr. Chase
* @version 1.0, 8/19/08
*/
public class BinaryTreeNode<T>
{
private T element;
private BinaryTreeNode<T> left, right;
/**
* Creates a new tree node with the specified data.
*
* @param obj the element that will become a part of the new tree node
*/
BinaryTreeNode (T obj)
{
element = obj;
left = null;
right = null;
}
/**
* Returns the number of non-null children of this node.
* This method may be able to be written more efficiently.
*
* @return the integer number of non-null children of this node
*/
public int numChildren()
{
int children = 0;
if (left != null)
children = 1 + left.numChildren();
if (right != null)
children = children + 1 + right.numChildren();
return children;
}
/////////////////setters and getters
public void setElement(T newElement){
this.element = (T) newElement;
}
public T getElement(){
return this.element;
}
public void setLeft(BinaryTreeNode<T> newLeft){
this.left = newLeft;
}
public BinaryTreeNode<T> getLeft(){
return this.left;
}
public void setRight(BinaryTreeNode<T> newRight){
this.right = newRight;
}
public BinaryTreeNode<T> getRight(){
return this.right;
}
}
|
{
"content_hash": "390955aa18f0141ab757a25ff309ce26",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 74,
"avg_line_length": 20.36111111111111,
"alnum_prop": 0.597544338335607,
"repo_name": "V-Lam/School-Assignments-and-Labs-2014-2017",
"id": "43f491deb557ab8441d062f69e6d3fb8dbc947f3",
"size": "1466",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "CS 1027 - Java -- (Computer Science Fundamentals 2)/labs/lab10_by_vlam54/BinaryTreeNode.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "49938"
},
{
"name": "C",
"bytes": "44615"
},
{
"name": "C++",
"bytes": "52134"
},
{
"name": "CSS",
"bytes": "38424"
},
{
"name": "HTML",
"bytes": "213355"
},
{
"name": "Java",
"bytes": "491043"
},
{
"name": "JavaScript",
"bytes": "2481"
},
{
"name": "Makefile",
"bytes": "1298"
},
{
"name": "Prolog",
"bytes": "3256"
},
{
"name": "Python",
"bytes": "299476"
},
{
"name": "Shell",
"bytes": "10944"
}
]
}
|
package com.amazonaws.services.ec2.model.transform;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.amazonaws.AmazonClientException;
import com.amazonaws.Request;
import com.amazonaws.DefaultRequest;
import com.amazonaws.http.HttpMethodName;
import com.amazonaws.services.ec2.model.*;
import com.amazonaws.transform.Marshaller;
import com.amazonaws.util.StringUtils;
import com.amazonaws.util.IdempotentUtils;
/**
* DescribeRouteTablesRequest Marshaller
*/
public class DescribeRouteTablesRequestMarshaller
implements
Marshaller<Request<DescribeRouteTablesRequest>, DescribeRouteTablesRequest> {
public Request<DescribeRouteTablesRequest> marshall(
DescribeRouteTablesRequest describeRouteTablesRequest) {
if (describeRouteTablesRequest == null) {
throw new AmazonClientException(
"Invalid argument passed to marshall(...)");
}
Request<DescribeRouteTablesRequest> request = new DefaultRequest<DescribeRouteTablesRequest>(
describeRouteTablesRequest, "AmazonEC2");
request.addParameter("Action", "DescribeRouteTables");
request.addParameter("Version", "2015-10-01");
request.setHttpMethod(HttpMethodName.POST);
com.amazonaws.internal.SdkInternalList<String> routeTableIdsList = (com.amazonaws.internal.SdkInternalList<String>) describeRouteTablesRequest
.getRouteTableIds();
if (!routeTableIdsList.isEmpty()
|| !routeTableIdsList.isAutoConstruct()) {
int routeTableIdsListIndex = 1;
for (String routeTableIdsListValue : routeTableIdsList) {
if (routeTableIdsListValue != null) {
request.addParameter("RouteTableId."
+ routeTableIdsListIndex,
StringUtils.fromString(routeTableIdsListValue));
}
routeTableIdsListIndex++;
}
}
com.amazonaws.internal.SdkInternalList<Filter> filtersList = (com.amazonaws.internal.SdkInternalList<Filter>) describeRouteTablesRequest
.getFilters();
if (!filtersList.isEmpty() || !filtersList.isAutoConstruct()) {
int filtersListIndex = 1;
for (Filter filtersListValue : filtersList) {
if (filtersListValue.getName() != null) {
request.addParameter(
"Filter." + filtersListIndex + ".Name",
StringUtils.fromString(filtersListValue.getName()));
}
com.amazonaws.internal.SdkInternalList<String> valuesList = (com.amazonaws.internal.SdkInternalList<String>) filtersListValue
.getValues();
if (!valuesList.isEmpty() || !valuesList.isAutoConstruct()) {
int valuesListIndex = 1;
for (String valuesListValue : valuesList) {
if (valuesListValue != null) {
request.addParameter("Filter." + filtersListIndex
+ ".Value." + valuesListIndex,
StringUtils.fromString(valuesListValue));
}
valuesListIndex++;
}
}
filtersListIndex++;
}
}
return request;
}
}
|
{
"content_hash": "ad9a49151c59085cbeeaf8544d789bc6",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 150,
"avg_line_length": 38.63333333333333,
"alnum_prop": 0.6051193557664654,
"repo_name": "mhurne/aws-sdk-java",
"id": "b3378037afddccd6cb7ac810a5c5a7d8a3d72b4a",
"size": "4064",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/model/transform/DescribeRouteTablesRequestMarshaller.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "FreeMarker",
"bytes": "123790"
},
{
"name": "Java",
"bytes": "110875821"
},
{
"name": "Scilab",
"bytes": "3561"
}
]
}
|
'use strict';
/*global require, module, Buffer, ccs*/
/*
convertID(id);
getArticlesIndex(date, limit, callback);
getLatestId(callback);
getArticle(_id, callback);
setArticle(articleObj, callback);
setFavor(articleObj);
setOppose(articleObj);
setMark(articleObj);
setComment(articleObj, callback);
setNewArticle(articleObj, callback);
delArticle(_idArray, callback);
*/
var union = ccs.lib.tools.union,
intersect = ccs.lib.tools.intersect,
IDString = ccs.lib.json.IDString,
defautArticle = ccs.lib.json.Article,
globalConfig = ccs.lib.json.GlobalConfig,
callbackFn = ccs.lib.tools.callbackFn,
wrapCallback = ccs.lib.tools.wrapCallback,
converter = ccs.lib.converter;
var that = ccs.dao.db.bind('articles', {
convertID: function (id) {
switch (typeof id) {
case 'string':
id = id.substring(1);
return converter(id, 62, IDString);
case 'number':
id = converter(id, 62, IDString);
while (id.length < 3) {
id = '0' + id;
}
return 'A' + id;
default:
return null;
}
},
getLatestId: function (callback) {
callback = callback || callbackFn;
that.findOne({}, {
sort: {
_id: -1
},
hint: {
_id: 1
},
fields: {
_id: 1
}
}, callback);
},
getArticlesIndex: function (callback) {
callback = callback || callbackFn;
that.find({}, {
sort: {
_id: 1
},
hint: {
_id: 1
},
fields: {
_id: 1,
author: 1,
date: 1,
display: 1,
status: 1,
updateTime: 1,
hots: 1
}
}).each(callback);
},
getArticle: function (_id, callback) {
that.findOne({
_id: +_id
}, {
sort: {
_id: -1
},
fields: {
author: 1,
date: 1,
display: 1,
status: 1,
refer: 1,
title: 1,
cover: 1,
content: 1,
hots: 1,
visitors: 1,
updateTime: 1,
collection: 1,
tagsList: 1,
favorsList: 1,
opposesList: 1,
markList: 1,
comment: 1,
commentsList: 1
}
}, wrapCallback(callback));
},
setArticle: function (articleObj, callback) {
var setObj = {},
newObj = {
author: 0,
date: 0,
display: 0,
status: 0,
refer: '',
title: '',
cover: '',
content: '',
hots: 0,
visitors: 0,
updateTime: 0,
collection: 0,
tagsList: [0],
comment: true
};
intersect(newObj, articleObj);
setObj.$set = newObj;
if (callback) {
that.findAndModify({
_id: articleObj._id
}, [], setObj, {
w: 1,
new: true
}, wrapCallback(callback));
} else {
that.update({
_id: articleObj._id
}, setObj);
}
},
setFavor: function (articleObj) {
var setObj = {},
newObj = {
favorsList: 0
};
intersect(newObj, articleObj);
if (newObj.favorsList < 0) {
newObj.favorsList = -newObj.favorsList;
setObj.$pull = {
favorsList: newObj.favorsList
};
} else {
setObj.$push = {
favorsList: newObj.favorsList
};
}
that.update({
_id: articleObj._id
}, setObj);
},
setOppose: function (articleObj) {
var setObj = {},
newObj = {
opposesList: 0
};
intersect(newObj, articleObj);
if (newObj.opposesList < 0) {
newObj.opposesList = -newObj.opposesList;
setObj.$pull = {
opposesList: newObj.opposesList
};
} else {
setObj.$push = {
opposesList: newObj.opposesList
};
}
that.update({
_id: articleObj._id
}, setObj);
},
setMark: function (articleObj) {
var setObj = {},
newObj = {
markList: 0
};
intersect(newObj, articleObj);
if (newObj.markList < 0) {
newObj.markList = -newObj.markList;
setObj.$pull = {
markList: newObj.markList
};
} else {
setObj.$push = {
markList: newObj.markList
};
}
that.update({
_id: articleObj._id
}, setObj);
},
setComment: function (articleObj, callback) {
var setObj = {},
newObj = {
commentsList: 0
};
intersect(newObj, articleObj);
if (newObj.commentsList < 0) {
newObj.commentsList = -newObj.commentsList;
setObj.$pull = {
commentsList: newObj.commentsList
};
} else {
setObj.$push = {
commentsList: newObj.commentsList
};
}
that.update({
_id: articleObj._id
}, setObj, {
w: 1
}, wrapCallback(callback));
},
setNewArticle: function (articleObj, callback) {
var article = union(defautArticle),
newArticle = union(defautArticle);
callback = callback || callbackFn;
intersect(article, articleObj);
union(newArticle, article);
that.getLatestId(function (err, doc) {
if (err) {
return callback(err, null);
}
if (!doc) {
newArticle._id = 1;
} else {
newArticle._id = doc._id + 1;
}
that.findAndModify({
_id: newArticle._id
}, [], newArticle, {
w: 1,
upsert: true,
new: true
}, wrapCallback(callback));
});
},
delArticle: function (_id, callback) {
that.remove({
_id: +_id
}, {
w: 1
}, wrapCallback(callback));
}
});
module.exports = {
convertID: that.convertID,
getArticlesIndex: that.getArticlesIndex,
getLatestId: that.getLatestId,
getArticle: that.getArticle,
setArticle: that.setArticle,
setFavor: that.setFavor,
setOppose: that.setOppose,
setMark: that.setMark,
setComment: that.setComment,
setNewArticle: that.setNewArticle,
delArticle: that.delArticle
};
|
{
"content_hash": "be9025ef5b898c85326556bc000e05f9",
"timestamp": "",
"source": "github",
"line_count": 287,
"max_line_length": 55,
"avg_line_length": 25.24390243902439,
"alnum_prop": 0.4343685300207039,
"repo_name": "cj1240/mycrm",
"id": "d216deec09a7223dcd9ea2219dd7017d1c068e4e",
"size": "7245",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "dao/articleDao.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "36878"
},
{
"name": "JavaScript",
"bytes": "640898"
}
]
}
|
var TenantService = function(Restangular, messageModel) {
this.getTenants = function(queryParams) {
return Restangular.all('tenants').getList(queryParams);
};
this.getTenant = function(id) {
return Restangular.one("tenants", id).get();
};
this.createTenant = function(tenant) {
return Restangular.service('tenants').post(tenant)
.then(
function() {
messageModel.setMessages([ { level: 'success', text: 'Tenant created' } ], true);
},
function(fault) {
messageModel.setMessages(fault.data.alerts, true);
}
);
};
this.updateTenant = function(tenant) {
return tenant.put()
.then(
function() {
messageModel.setMessages([ { level: 'success', text: 'Tenant updated' } ], false);
},
function(fault) {
messageModel.setMessages(fault.data.alerts, false);
}
);
};
this.deleteTenant = function(id) {
return Restangular.one("tenants", id).remove()
.then(
function() {
messageModel.setMessages([ { level: 'success', text: 'Tenant deleted' } ], true);
},
function(fault) {
messageModel.setMessages(fault.data.alerts, true);
}
);
};
};
TenantService.$inject = ['Restangular', 'messageModel'];
module.exports = TenantService;
|
{
"content_hash": "e0f9b55d09c0d04a1913ccfc12300e53",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 102,
"avg_line_length": 30.365384615384617,
"alnum_prop": 0.5041165294490184,
"repo_name": "jeffmart/incubator-trafficcontrol",
"id": "80f6e889cb08421ad8ac0ab98dc03e0d6bc3674d",
"size": "2388",
"binary": false,
"copies": "13",
"ref": "refs/heads/master",
"path": "traffic_portal/app/src/common/api/TenantService.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "22423"
},
{
"name": "CSS",
"bytes": "189748"
},
{
"name": "Go",
"bytes": "1610079"
},
{
"name": "HTML",
"bytes": "746665"
},
{
"name": "Java",
"bytes": "1249282"
},
{
"name": "JavaScript",
"bytes": "1619291"
},
{
"name": "Makefile",
"bytes": "1047"
},
{
"name": "PLSQL",
"bytes": "4308"
},
{
"name": "PLpgSQL",
"bytes": "70798"
},
{
"name": "Perl",
"bytes": "3498542"
},
{
"name": "Perl 6",
"bytes": "25530"
},
{
"name": "Python",
"bytes": "93425"
},
{
"name": "Roff",
"bytes": "4011"
},
{
"name": "Ruby",
"bytes": "4090"
},
{
"name": "SQLPL",
"bytes": "66692"
},
{
"name": "Shell",
"bytes": "170470"
}
]
}
|
class ApplicationController < ActionController::Base
protect_from_forgery
end
|
{
"content_hash": "d693aeb3a051c112de69a8c0e5711bd7",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 52,
"avg_line_length": 26.333333333333332,
"alnum_prop": 0.8481012658227848,
"repo_name": "machiavellian/machiavelli",
"id": "0fa9eff1a9d9f7bd3efa4caa2f4e5264edb6eab7",
"size": "79",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "app/controllers/application_controller.rb",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "4764"
},
{
"name": "HTML",
"bytes": "29343"
},
{
"name": "JavaScript",
"bytes": "30424"
},
{
"name": "Ruby",
"bytes": "89108"
},
{
"name": "Shell",
"bytes": "2152"
}
]
}
|
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you 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.
-->
<entitymodel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/entitymodel.xsd">
<!-- ========================================================= -->
<!-- ======================== Defaults ======================= -->
<!-- ========================================================= -->
<title>Entity of an Apache OFBiz Component</title>
<description>None</description>
<version>1.0</version>
<!-- ========================================================= -->
<!-- ======================== Data Model ===================== -->
<!-- The modules in this file are as follows: -->
<!-- - org.apache.ofbiz.humanres.ability -->
<!-- - org.apache.ofbiz.humanres.employment -->
<!-- - org.apache.ofbiz.humanres.position -->
<!-- ========================================================= -->
<!-- ========================================================= -->
<!-- org.apache.ofbiz.humanres.ability -->
<!-- ========================================================= -->
<entity entity-name="PartyQual"
package-name="org.apache.ofbiz.humanres.ability"
title="Party Qualification Entity">
<field name="partyId" type="id-ne"></field>
<field name="partyQualTypeId" type="id-ne"></field>
<field name="qualificationDesc" type="id-long"></field>
<field name="title" type="id-long"><description>Title of degree or job</description></field>
<field name="statusId" type="id"><description>Status e.g. completed, part-time etc.</description></field>
<field name="verifStatusId" type="id"><description>Verification done for this entry if any</description></field>
<field name="fromDate" type="date-time"></field>
<field name="thruDate" type="date-time"></field>
<prim-key field="partyId"/>
<prim-key field="partyQualTypeId"/>
<prim-key field="fromDate"/>
<relation type="one" fk-name="PARTY_QUAL_PRTY" rel-entity-name="Party">
<key-map field-name="partyId"/>
</relation>
<relation type="one" fk-name="PARTY_QUAL_PQTYP" rel-entity-name="PartyQualType">
<key-map field-name="partyQualTypeId"/>
</relation>
<relation type="one" fk-name="PARTY_QUAL_STATUS" rel-entity-name="StatusItem">
<key-map field-name="statusId"/>
</relation>
<relation type="one" title="Verification" fk-name="PARTY_QUAL_VERIF" rel-entity-name="StatusItem">
<key-map field-name="verifStatusId" rel-field-name="statusId"/>
</relation>
</entity>
<entity entity-name="PartyQualType"
package-name="org.apache.ofbiz.humanres.ability"
title="Party Qualification Type Entity">
<field name="partyQualTypeId" type="id-ne"></field>
<field name="parentTypeId" type="id-ne"></field>
<field name="hasTable" type="indicator"></field>
<field name="description" type="description"></field>
<prim-key field="partyQualTypeId"/>
<relation type="one" fk-name="PARTY_QUAL_TPAR" title="Parent" rel-entity-name="PartyQualType">
<key-map field-name="parentTypeId" rel-field-name="partyQualTypeId"/>
</relation>
</entity>
<entity entity-name="PartyResume"
package-name="org.apache.ofbiz.humanres.ability"
title="Resume Entity">
<field name="resumeId" type="id-ne"></field>
<field name="partyId" type="id-ne"></field>
<field name="contentId" type="id"></field>
<field name="resumeDate" type="date-time"></field>
<field name="resumeText" type="long-varchar"></field>
<prim-key field="resumeId"/>
<relation type="one" fk-name="PARTY_RSME_PRTY" rel-entity-name="Party">
<key-map field-name="partyId"/>
</relation>
<relation type="one-nofk" fk-name="PARTY_RSME_CNT" rel-entity-name="Content">
<key-map field-name="contentId"/>
</relation>
</entity>
<entity entity-name="PartySkill"
package-name="org.apache.ofbiz.humanres.ability"
title="Party Skill Entity">
<field name="partyId" type="id-ne"></field>
<field name="skillTypeId" type="id-ne"></field>
<field name="yearsExperience" type="numeric"></field>
<field name="rating" type="numeric"></field>
<field name="skillLevel" type="numeric"></field>
<field name="startedUsingDate" type="date-time"></field>
<prim-key field="partyId"/>
<prim-key field="skillTypeId"/>
<relation type="one" fk-name="PARTY_SKLL_PRTY" rel-entity-name="Party">
<key-map field-name="partyId"/>
</relation>
<relation type="one" fk-name="PARTY_SKLL_SKTP" rel-entity-name="SkillType">
<key-map field-name="skillTypeId"/>
</relation>
</entity>
<entity entity-name="PerfRatingType"
package-name="org.apache.ofbiz.humanres.ability"
title="Performance Rating Type Entity">
<field name="perfRatingTypeId" type="id-ne"></field>
<field name="parentTypeId" type="id-ne"></field>
<field name="hasTable" type="indicator"></field>
<field name="description" type="description"></field>
<prim-key field="perfRatingTypeId"/>
<relation type="one" fk-name="PERF_RATNG_TYP" title="Parent" rel-entity-name="PerfRatingType">
<key-map field-name="parentTypeId" rel-field-name="perfRatingTypeId"/>
</relation>
</entity>
<entity entity-name="PerfReview"
package-name="org.apache.ofbiz.humanres.ability"
title="Employee Performance Review Entity">
<field name="employeePartyId" type="id-ne"></field>
<field name="employeeRoleTypeId" type="id-ne"></field>
<field name="perfReviewId" type="id-ne"></field>
<field name="managerPartyId" type="id"></field>
<field name="managerRoleTypeId" type="id"></field>
<field name="paymentId" type="id"></field>
<field name="emplPositionId" type="id"></field>
<field name="fromDate" type="date-time"></field>
<field name="thruDate" type="date-time"></field>
<field name="comments" type="comment"></field>
<prim-key field="employeePartyId"/>
<prim-key field="employeeRoleTypeId"/>
<prim-key field="perfReviewId"/>
<relation type="one" fk-name="PERF_REV_EPTY" title="Employee" rel-entity-name="Party">
<key-map field-name="employeePartyId" rel-field-name="partyId"/>
</relation>
<relation type="one" fk-name="PERF_REV_EPTRL" title="Employee" rel-entity-name="PartyRole">
<key-map field-name="employeePartyId" rel-field-name="partyId"/>
<key-map field-name="employeeRoleTypeId" rel-field-name="roleTypeId"/>
</relation>
<relation type="one" fk-name="PERF_REV_MPTY" title="Manager" rel-entity-name="Party">
<key-map field-name="managerPartyId" rel-field-name="partyId"/>
</relation>
<relation type="one-nofk" fk-name="PERF_REV_MPTRL" title="Manager" rel-entity-name="PartyRole">
<key-map field-name="managerPartyId" rel-field-name="partyId"/>
<key-map field-name="managerRoleTypeId" rel-field-name="roleTypeId"/>
</relation>
<relation type="one" fk-name="PERF_REV_PMNT" rel-entity-name="Payment">
<key-map field-name="paymentId"/>
</relation>
<relation type="one-nofk" fk-name="PERF_REV_PSTN" rel-entity-name="EmplPosition">
<key-map field-name="emplPositionId"/>
</relation>
</entity>
<entity entity-name="PerfReviewItem"
package-name="org.apache.ofbiz.humanres.ability"
title="Performance Review Item Entity">
<field name="employeePartyId" type="id-ne"></field>
<field name="employeeRoleTypeId" type="id"></field>
<field name="perfReviewId" type="id-ne"></field>
<field name="perfReviewItemSeqId" type="id-ne"></field>
<field name="perfReviewItemTypeId" type="id"></field>
<field name="perfRatingTypeId" type="id"></field>
<field name="comments" type="comment"></field>
<prim-key field="employeePartyId"/>
<prim-key field="employeeRoleTypeId"/>
<prim-key field="perfReviewId"/>
<prim-key field="perfReviewItemSeqId"/>
<relation type="one" fk-name="PERF_RVITM_PFRV" rel-entity-name="PerfReview">
<key-map field-name="employeePartyId"/>
<key-map field-name="employeeRoleTypeId"/>
<key-map field-name="perfReviewId"/>
</relation>
<relation type="one" fk-name="PERF_RVITM_EPTY" title="Employee" rel-entity-name="Party">
<key-map field-name="employeePartyId" rel-field-name="partyId"/>
</relation>
<relation type="one" fk-name="PERF_RVITM_EPTRL" title="Employee" rel-entity-name="PartyRole">
<key-map field-name="employeePartyId" rel-field-name="partyId"/>
<key-map field-name="employeeRoleTypeId" rel-field-name="roleTypeId"/>
</relation>
<relation type="one-nofk" fk-name="PERF_RVITM_PRTTP" rel-entity-name="PerfRatingType">
<key-map field-name="perfRatingTypeId"/>
</relation>
<relation type="one-nofk" fk-name="PERF_RVITM_PRITTP" rel-entity-name="PerfReviewItemType">
<key-map field-name="perfReviewItemTypeId"/>
</relation>
</entity>
<entity entity-name="PerfReviewItemType"
package-name="org.apache.ofbiz.humanres.ability"
title="Performance Review Item Type Entity">
<field name="perfReviewItemTypeId" type="id-ne"></field>
<field name="parentTypeId" type="id-ne"></field>
<field name="hasTable" type="indicator"></field>
<field name="description" type="description"></field>
<prim-key field="perfReviewItemTypeId"/>
<relation type="one" fk-name="PERF_REV_ITM_TYP" title="Parent" rel-entity-name="PerfReviewItemType">
<key-map field-name="parentTypeId" rel-field-name="perfReviewItemTypeId"/>
</relation>
</entity>
<entity entity-name="PerformanceNote"
package-name="org.apache.ofbiz.humanres.ability"
title="Performance Note Entity">
<field name="partyId" type="id-ne"></field>
<field name="roleTypeId" type="id-ne"></field>
<field name="fromDate" type="date-time"></field>
<field name="thruDate" type="date-time"></field>
<field name="communicationDate" type="date-time"></field>
<field name="comments" type="comment"></field>
<prim-key field="partyId"/>
<prim-key field="roleTypeId"/>
<prim-key field="fromDate"/>
<relation type="one" fk-name="PERF_NOTE_PRTY" rel-entity-name="Party">
<key-map field-name="partyId"/>
</relation>
<relation type="one" fk-name="PERF_NOTE_PRLE" rel-entity-name="PartyRole">
<key-map field-name="partyId"/>
<key-map field-name="roleTypeId"/>
</relation>
</entity>
<entity entity-name="PersonTraining"
package-name="org.apache.ofbiz.humanres.ability"
title="Person Training Entity">
<field name="partyId" type="id-ne"></field>
<field name="trainingRequestId" type="id-ne"></field>
<field name="trainingClassTypeId" type="id-ne"></field>
<field name="workEffortId" type="id-ne"></field>
<field name="fromDate" type="date-time"></field>
<field name="thruDate" type="date-time"></field>
<field name="approverId" type="id-ne"></field>
<field name="approvalStatus" type="short-varchar"></field>
<field name="reason" type="description"></field>
<prim-key field="partyId"/>
<prim-key field="trainingClassTypeId"/>
<prim-key field="fromDate"/>
<relation type="one" fk-name="PERS_TRNG_PRTY" rel-entity-name="Party">
<key-map field-name="partyId"/>
</relation>
<relation type="one" fk-name="PERS_TRNG_APPR" title="Approver" rel-entity-name="Person">
<key-map field-name="approverId" rel-field-name="partyId"/>
</relation>
<relation type="one" fk-name="PERS_TRNG_TCTP" rel-entity-name="TrainingClassType">
<key-map field-name="trainingClassTypeId"/>
</relation>
<relation type="one" fk-name="PERS_TRNG_WREF" rel-entity-name="WorkEffort">
<key-map field-name="workEffortId"/>
</relation>
<relation type="one" fk-name="PERS_TRNG_TRNRQ" rel-entity-name="TrainingRequest">
<key-map field-name="trainingRequestId"/>
</relation>
</entity>
<entity entity-name="ResponsibilityType"
package-name="org.apache.ofbiz.humanres.ability"
title="Responsibility Type Entity">
<field name="responsibilityTypeId" type="id-ne"></field>
<field name="parentTypeId" type="id"></field>
<field name="hasTable" type="indicator"></field>
<field name="description" type="description"></field>
<prim-key field="responsibilityTypeId"/>
<relation type="one" fk-name="RESPON_TYPE_PAR" title="Parent" rel-entity-name="ResponsibilityType">
<key-map field-name="parentTypeId" rel-field-name="responsibilityTypeId"/>
</relation>
</entity>
<entity entity-name="SkillType"
package-name="org.apache.ofbiz.humanres.ability"
title="Skill Type Entity">
<field name="skillTypeId" type="id-ne"></field>
<field name="parentTypeId" type="id-ne"></field>
<field name="hasTable" type="indicator"></field>
<field name="description" type="description"></field>
<prim-key field="skillTypeId"/>
<relation type="one" fk-name="PARNT_SKILL_TYPE" title="Parent" rel-entity-name="SkillType">
<key-map field-name="parentTypeId" rel-field-name="skillTypeId"/>
</relation>
</entity>
<entity entity-name="TrainingClassType"
package-name="org.apache.ofbiz.humanres.ability"
title="Training Class Type Entity">
<field name="trainingClassTypeId" type="id-ne"></field>
<field name="parentTypeId" type="id"></field>
<field name="hasTable" type="indicator"></field>
<field name="description" type="description"></field>
<prim-key field="trainingClassTypeId"/>
<relation type="one" fk-name="TRAIN_TYPE_PAR" title="Parent" rel-entity-name="TrainingClassType">
<key-map field-name="parentTypeId" rel-field-name="trainingClassTypeId"/>
</relation>
</entity>
<!-- ========================================================= -->
<!-- org.apache.ofbiz.humanres.employment -->
<!-- ========================================================= -->
<entity entity-name="BenefitType"
package-name="org.apache.ofbiz.humanres.employment"
title="Benefit Type Entity">
<field name="benefitTypeId" type="id-ne"></field>
<field name="benefitName" type="name"></field>
<field name="parentTypeId" type="id-ne"></field>
<field name="hasTable" type="indicator"></field>
<field name="description" type="description"></field>
<field name="employerPaidPercentage" type="floating-point"></field>
<prim-key field="benefitTypeId"/>
<relation type="one" fk-name="BEN_TYPE_PAR" title="Parent" rel-entity-name="BenefitType">
<key-map field-name="parentTypeId" rel-field-name="benefitTypeId"/>
</relation>
</entity>
<view-entity entity-name="BenefitTypeAndParty"
package-name="org.apache.ofbiz.humanres.employment"
title="Benefit Type Entity">
<member-entity entity-alias="BT" entity-name="BenefitType"/>
<member-entity entity-alias="PB" entity-name="PartyBenefit"/>
<alias-all entity-alias="BT"/>
<alias-all entity-alias="PB">
<exclude field="benefitTypeId"/>
</alias-all>
<view-link entity-alias="BT" rel-entity-alias="PB">
<key-map field-name="benefitTypeId"/>
</view-link>
</view-entity>
<entity entity-name="Employment"
package-name="org.apache.ofbiz.humanres.employment"
title="Employment Entity">
<field name="roleTypeIdFrom" type="id-ne"></field>
<field name="roleTypeIdTo" type="id-ne"></field>
<field name="partyIdFrom" type="id-ne"></field>
<field name="partyIdTo" type="id-ne"></field>
<field name="fromDate" type="date-time"></field>
<field name="thruDate" type="date-time"></field>
<field name="terminationReasonId" type="id"></field>
<field name="terminationTypeId" type="id"></field>
<prim-key field="roleTypeIdFrom"/>
<prim-key field="roleTypeIdTo"/>
<prim-key field="partyIdFrom"/>
<prim-key field="partyIdTo"/>
<prim-key field="fromDate"/>
<relation type="one" fk-name="EMPLMNT_TPTY" title="To" rel-entity-name="Party">
<key-map field-name="partyIdTo" rel-field-name="partyId"/>
</relation>
<relation type="one" fk-name="EMPLMNT_TPTRL" title="To" rel-entity-name="PartyRole">
<key-map field-name="partyIdTo" rel-field-name="partyId"/>
<key-map field-name="roleTypeIdTo" rel-field-name="roleTypeId"/>
</relation>
<relation type="one" fk-name="EMPLMNT_FPTY" title="From" rel-entity-name="Party">
<key-map field-name="partyIdFrom" rel-field-name="partyId"/>
</relation>
<relation type="one" fk-name="EMPLMNT_FPTRL" title="From" rel-entity-name="PartyRole">
<key-map field-name="partyIdFrom" rel-field-name="partyId"/>
<key-map field-name="roleTypeIdFrom" rel-field-name="roleTypeId"/>
</relation>
<relation type="one-nofk" fk-name="EMPLMNT_TNRN" rel-entity-name="TerminationReason">
<key-map field-name="terminationReasonId"/>
</relation>
<relation type="one-nofk" fk-name="EMPLMNT_TNTP" rel-entity-name="TerminationType">
<key-map field-name="terminationTypeId"/>
</relation>
<relation type="many" fk-name="EMPLMNT_AGR" rel-entity-name="Agreement">
<key-map field-name="partyIdTo" rel-field-name="agreementId"/>
<key-map field-name="partyIdFrom" rel-field-name="agreementId"/>
</relation>
</entity>
<view-entity entity-name="EmploymentAndPerson"
package-name="org.apache.ofbiz.humanres.employment"
title="Employment and Person Entity">
<member-entity entity-alias="EMPLMNT" entity-name="Employment"/>
<member-entity entity-alias="PERS" entity-name="Person"/>
<alias-all entity-alias="EMPLMNT"/>
<alias-all entity-alias="PERS"/>
<view-link entity-alias="EMPLMNT" rel-entity-alias="PERS">
<key-map field-name="partyIdTo" rel-field-name="partyId"/>
</view-link>
</view-entity>
<entity entity-name="EmploymentApp"
package-name="org.apache.ofbiz.humanres.employment"
title="Employment Application Entity">
<field name="applicationId" type="id-ne"></field>
<field name="emplPositionId" type="id"></field>
<field name="statusId" type="id"></field>
<field name="employmentAppSourceTypeId" type="id"></field>
<field name="applyingPartyId" type="id"></field>
<field name="referredByPartyId" type="id"></field>
<field name="applicationDate" type="date-time"></field>
<field name="approverPartyId" type="id"></field>
<field name="jobRequisitionId" type="id"></field>
<prim-key field="applicationId"/>
<relation type="one-nofk" fk-name="EMPLMNT_APP_POS" rel-entity-name="EmplPosition">
<key-map field-name="emplPositionId"/>
</relation>
<relation type="one-nofk" fk-name="EMPLMNT_APP_STTS" rel-entity-name="StatusItem">
<key-map field-name="statusId"/>
</relation>
<relation type="one-nofk" fk-name="EMPLMNT_APP_EAST" rel-entity-name="EmploymentAppSourceType">
<key-map field-name="employmentAppSourceTypeId"/>
</relation>
<relation type="one-nofk" fk-name="EMPLMNT_APP_APTY" title="Applying" rel-entity-name="Party">
<key-map field-name="applyingPartyId" rel-field-name="partyId"/>
</relation>
<relation type="one-nofk" fk-name="EMPLMNT_APP_RBPTY" title="ReferredBy" rel-entity-name="Party">
<key-map field-name="referredByPartyId" rel-field-name="partyId"/>
</relation>
<relation type="one" fk-name="EMPLMNT_APP_APER" title="Approver" rel-entity-name="Party">
<key-map field-name="approverPartyId" rel-field-name="partyId"/>
</relation>
<relation type="one" fk-name="EMPLMNT_APP_JBRQ" rel-entity-name="JobRequisition">
<key-map field-name="jobRequisitionId"/>
</relation>
</entity>
<entity entity-name="EmploymentAppSourceType"
package-name="org.apache.ofbiz.humanres.employment"
title="Employment Application Source Type Entity">
<field name="employmentAppSourceTypeId" type="id-ne"></field>
<field name="parentTypeId" type="id-ne"></field>
<field name="hasTable" type="indicator"></field>
<field name="description" type="description"></field>
<prim-key field="employmentAppSourceTypeId"/>
<relation type="one" fk-name="EMPL_APP_SRC_TYP" title="Parent" rel-entity-name="EmploymentAppSourceType">
<key-map field-name="parentTypeId" rel-field-name="employmentAppSourceTypeId"/>
</relation>
</entity>
<entity entity-name="EmplLeave"
package-name="org.apache.ofbiz.humanres.employment"
title="Employee Leave Entity">
<field name="partyId" type="id-ne"/>
<field name="leaveTypeId" type="id-ne"/>
<field name="emplLeaveReasonTypeId" type="id-ne"/>
<field name="fromDate" type="date-time"/>
<field name="thruDate" type="date-time"/>
<field name="approverPartyId" type="id-ne"/>
<field name="leaveStatus" type="id-ne"/>
<field name="description" type="description"/>
<prim-key field="partyId"/>
<prim-key field="leaveTypeId"/>
<prim-key field="fromDate"/>
<relation type="one" fk-name="EMPL_LEAVE_PRTY" rel-entity-name="Party">
<key-map field-name="partyId"/>
</relation>
<relation type="one" fk-name="EMPL_LEAVE_ELETP" rel-entity-name="EmplLeaveType">
<key-map field-name="leaveTypeId"/>
</relation>
<relation type="one" fk-name="EMP_LEAV_REAS_ELTP" rel-entity-name="EmplLeaveReasonType">
<key-map field-name="emplLeaveReasonTypeId"/>
</relation>
<relation type="one" fk-name="EMPL_LEAVE_APPR" title="Approver" rel-entity-name="Party">
<key-map field-name="approverPartyId" rel-field-name="partyId"/>
</relation>
<relation type="one" fk-name="EMPL_LEAVE_STS" rel-entity-name="StatusItem">
<key-map field-name="leaveStatus" rel-field-name="statusId"/>
</relation>
</entity>
<entity entity-name="EmplLeaveType"
package-name="org.apache.ofbiz.humanres.employment"
default-resource-name="HumanResEntityLabels"
title="Employee Leave Type Entity">
<field name="leaveTypeId" type="id-ne"/>
<field name="parentTypeId" type="id-ne"/>
<field name="hasTable" type="indicator"/>
<field name="description" type="description"/>
<prim-key field="leaveTypeId"/>
<relation type="one" fk-name="EMPL_LEAVE_TPAR" title="Parent" rel-entity-name="EmplLeaveType">
<key-map field-name="parentTypeId" rel-field-name="leaveTypeId"/>
</relation>
</entity>
<entity entity-name="PartyBenefit"
package-name="org.apache.ofbiz.humanres.employment"
title="Party Benefit Entity">
<field name="roleTypeIdFrom" type="id-ne"></field>
<field name="roleTypeIdTo" type="id-ne"></field>
<field name="partyIdFrom" type="id-ne"></field>
<field name="partyIdTo" type="id-ne"></field>
<field name="benefitTypeId" type="id-ne"></field>
<field name="fromDate" type="date-time"></field>
<field name="thruDate" type="date-time"></field>
<field name="periodTypeId" type="id"></field>
<field name="cost" type="currency-amount"></field>
<field name="actualEmployerPaidPercent" type="floating-point"></field>
<field name="availableTime" type="numeric"></field>
<prim-key field="roleTypeIdFrom"/>
<prim-key field="roleTypeIdTo"/>
<prim-key field="partyIdFrom"/>
<prim-key field="partyIdTo"/>
<prim-key field="benefitTypeId"/>
<prim-key field="fromDate"/>
<relation type="one" fk-name="PTY_BNFT_TPTY" title="To" rel-entity-name="Party">
<key-map field-name="partyIdTo" rel-field-name="partyId"/>
</relation>
<relation type="one" fk-name="PTY_BNFT_TPTRL" title="To" rel-entity-name="PartyRole">
<key-map field-name="partyIdTo" rel-field-name="partyId"/>
<key-map field-name="roleTypeIdTo" rel-field-name="roleTypeId"/>
</relation>
<relation type="one" fk-name="PTY_BNFT_FPTY" title="From" rel-entity-name="Party">
<key-map field-name="partyIdFrom" rel-field-name="partyId"/>
</relation>
<relation type="one" fk-name="PTY_BNFT_FPTRL" title="From" rel-entity-name="PartyRole">
<key-map field-name="partyIdFrom" rel-field-name="partyId"/>
<key-map field-name="roleTypeIdFrom" rel-field-name="roleTypeId"/>
</relation>
<relation type="one" fk-name="PTY_BNFT_BNFTTP" rel-entity-name="BenefitType">
<key-map field-name="benefitTypeId"/>
</relation>
<relation type="one-nofk" fk-name="PTY_BNFT_PRDTYP" rel-entity-name="PeriodType">
<key-map field-name="periodTypeId"/>
</relation>
</entity>
<entity entity-name="PayGrade"
package-name="org.apache.ofbiz.humanres.employment"
title="Pay Grade Entity">
<field name="payGradeId" type="id-ne"></field>
<field name="payGradeName" type="name"></field>
<field name="comments" type="comment"></field>
<prim-key field="payGradeId"/>
</entity>
<entity entity-name="PayHistory"
package-name="org.apache.ofbiz.humanres.employment"
title="Pay History Entity">
<field name="roleTypeIdFrom" type="id-ne"></field>
<field name="roleTypeIdTo" type="id-ne"></field>
<field name="partyIdFrom" type="id-ne"></field>
<field name="partyIdTo" type="id-ne"></field>
<field name="fromDate" type="date-time"></field>
<field name="thruDate" type="date-time"></field>
<field name="salaryStepSeqId" type="id"></field>
<field name="payGradeId" type="id"></field>
<field name="periodTypeId" type="id"></field>
<field name="amount" type="currency-amount"></field>
<field name="comments" type="comment"></field>
<prim-key field="roleTypeIdFrom"/>
<prim-key field="roleTypeIdTo"/>
<prim-key field="partyIdFrom"/>
<prim-key field="partyIdTo"/>
<prim-key field="fromDate"/>
<relation type="one" fk-name="PAY_HIST_EMPLMNT" rel-entity-name="Employment">
<key-map field-name="roleTypeIdFrom"/>
<key-map field-name="roleTypeIdTo"/>
<key-map field-name="partyIdFrom"/>
<key-map field-name="partyIdTo"/>
<key-map field-name="fromDate"/>
</relation>
<relation type="one" fk-name="PAY_HIST_PGRD" rel-entity-name="PayGrade">
<key-map field-name="payGradeId"/>
</relation>
<relation type="one-nofk" fk-name="PAY_HIST_SSTP" rel-entity-name="SalaryStep">
<key-map field-name="salaryStepSeqId"/>
<key-map field-name="payGradeId"/>
<key-map field-name="fromDate"/>
</relation>
<relation type="one" fk-name="PAY_HIST_PDTP" rel-entity-name="PeriodType">
<key-map field-name="periodTypeId"/>
</relation>
</entity>
<entity entity-name="PayrollPreference"
package-name="org.apache.ofbiz.humanres.employment"
title="Payroll Preference Entity">
<field name="partyId" type="id-ne"></field>
<field name="roleTypeId" type="id-ne"></field>
<field name="payrollPreferenceSeqId" type="id-ne"></field>
<field name="deductionTypeId" type="id-ne"></field>
<field name="paymentMethodTypeId" type="id"></field>
<field name="periodTypeId" type="id"></field>
<field name="fromDate" type="date-time"></field>
<field name="thruDate" type="date-time"></field>
<field name="percentage" type="floating-point"></field>
<field name="flatAmount" type="currency-amount"></field>
<field name="routingNumber" type="short-varchar"></field>
<field name="accountNumber" type="short-varchar"></field>
<field name="bankName" type="name"></field>
<prim-key field="partyId"/>
<prim-key field="roleTypeId"/>
<prim-key field="payrollPreferenceSeqId"/>
<relation type="one" fk-name="PRL_PREF_PRTY" rel-entity-name="Party">
<key-map field-name="partyId"/>
</relation>
<relation type="one" fk-name="PRL_PREF_PTRL" rel-entity-name="PartyRole">
<key-map field-name="partyId"/>
<key-map field-name="roleTypeId"/>
</relation>
<relation type="one-nofk" fk-name="PRL_PREF_DNTP" rel-entity-name="DeductionType">
<key-map field-name="deductionTypeId"/>
</relation>
<relation type="one-nofk" fk-name="PRL_PREF_PMTP" rel-entity-name="PaymentMethodType">
<key-map field-name="paymentMethodTypeId"/>
</relation>
<relation type="one-nofk" fk-name="PRL_PREF_PDTP" rel-entity-name="PeriodType">
<key-map field-name="periodTypeId"/>
</relation>
</entity>
<entity entity-name="SalaryStep" table-name="SALARY_STEP_NEW"
package-name="org.apache.ofbiz.humanres.employment"
title="Salary Step Entity">
<field name="salaryStepSeqId" type="id-ne"></field>
<field name="payGradeId" type="id-ne"></field>
<field name="fromDate" type="date-time"></field>
<field name="thruDate" type="date-time"></field>
<field name="dateModified" type="date-time"></field>
<field name="amount" type="currency-amount"></field>
<field name="createdByUserLogin" type="id-vlong"></field>
<field name="lastModifiedByUserLogin" type="id-vlong"></field>
<prim-key field="salaryStepSeqId"/>
<prim-key field="payGradeId"/>
<prim-key field="fromDate"/>
<relation type="one" fk-name="SLRY_STP_PGRD_NEW" rel-entity-name="PayGrade">
<key-map field-name="payGradeId"/>
</relation>
</entity>
<entity entity-name="TerminationReason"
package-name="org.apache.ofbiz.humanres.employment"
title="Termination Reason Entity">
<field name="terminationReasonId" type="id-ne"></field>
<field name="description" type="description"></field>
<prim-key field="terminationReasonId"/>
</entity>
<entity entity-name="TerminationType"
package-name="org.apache.ofbiz.humanres.employment"
title="Termination Type Entity">
<field name="terminationTypeId" type="id-ne"></field>
<field name="parentTypeId" type="id-ne"></field>
<field name="hasTable" type="indicator"></field>
<field name="description" type="description"></field>
<prim-key field="terminationTypeId"/>
<relation type="one" fk-name="TERM_TYP_PAR" title="Parent" rel-entity-name="TerminationType">
<key-map field-name="parentTypeId" rel-field-name="terminationTypeId"/>
</relation>
</entity>
<entity entity-name="UnemploymentClaim"
package-name="org.apache.ofbiz.humanres.employment"
title="Unemployment Claim Entity">
<field name="unemploymentClaimId" type="id-ne"></field>
<field name="unemploymentClaimDate" type="date-time"></field>
<field name="description" type="description"></field>
<field name="statusId" type="id"></field>
<field name="partyIdFrom" type="id"></field>
<field name="partyIdTo" type="id"></field>
<field name="roleTypeIdFrom" type="id"></field>
<field name="roleTypeIdTo" type="id"></field>
<field name="fromDate" type="date-time"></field>
<field name="thruDate" type="date-time"></field>
<prim-key field="unemploymentClaimId"/>
<relation type="one-nofk" fk-name="UNMPL_CLM_EMPLMNT" rel-entity-name="Employment">
<key-map field-name="roleTypeIdFrom"/>
<key-map field-name="roleTypeIdTo"/>
<key-map field-name="partyIdFrom"/>
<key-map field-name="partyIdTo"/>
<key-map field-name="fromDate"/>
</relation>
<relation type="one-nofk" fk-name="UNMPL_CLM_STTS" rel-entity-name="StatusItem">
<key-map field-name="statusId"/>
</relation>
</entity>
<!-- ========================================================= -->
<!-- org.apache.ofbiz.humanres.position -->
<!-- ========================================================= -->
<entity entity-name="EmplPosition"
package-name="org.apache.ofbiz.humanres.position"
title="EmplPosition Entity">
<field name="emplPositionId" type="id-ne"></field>
<field name="statusId" type="id"></field>
<field name="partyId" type="id"></field>
<field name="budgetId" type="id"></field>
<field name="budgetItemSeqId" type="id"></field>
<field name="emplPositionTypeId" type="id"></field>
<field name="estimatedFromDate" type="date-time"></field>
<field name="estimatedThruDate" type="date-time"></field>
<field name="salaryFlag" type="indicator"></field>
<field name="exemptFlag" type="indicator"></field>
<field name="fulltimeFlag" type="indicator"></field>
<field name="temporaryFlag" type="indicator"></field>
<field name="actualFromDate" type="date-time"></field>
<field name="actualThruDate" type="date-time"></field>
<prim-key field="emplPositionId"/>
<relation type="one" fk-name="EMPL_POS_STTS" rel-entity-name="StatusItem">
<key-map field-name="statusId"/>
</relation>
<relation type="one" fk-name="EMPL_POS_PRTY" rel-entity-name="Party">
<key-map field-name="partyId"/>
</relation>
<relation type="one-nofk" fk-name="EMPL_POS_BGTITM" rel-entity-name="BudgetItem">
<key-map field-name="budgetId"/>
<key-map field-name="budgetItemSeqId"/>
</relation>
<relation type="one-nofk" fk-name="EMPL_POS_EPSTP" rel-entity-name="EmplPositionType">
<key-map field-name="emplPositionTypeId"/>
</relation>
</entity>
<entity entity-name="EmplPositionClassType"
package-name="org.apache.ofbiz.humanres.position"
title="EmplPosition Classification Type Entity">
<field name="emplPositionClassTypeId" type="id-ne"></field>
<field name="parentTypeId" type="id-ne"></field>
<field name="hasTable" type="indicator"></field>
<field name="description" type="description"></field>
<prim-key field="emplPositionClassTypeId"/>
<relation type="one" fk-name="EMPL_CLS_TYP_PAR" title="Parent" rel-entity-name="EmplPositionClassType">
<key-map field-name="parentTypeId" rel-field-name="emplPositionClassTypeId"/>
</relation>
</entity>
<entity entity-name="EmplPositionFulfillment"
package-name="org.apache.ofbiz.humanres.position"
title="EmplPosition Fulfillment Entity">
<field name="emplPositionId" type="id-ne"></field>
<field name="partyId" type="id-ne"></field>
<field name="fromDate" type="date-time"></field>
<field name="thruDate" type="date-time"></field>
<field name="comments" type="comment"></field>
<prim-key field="emplPositionId"/>
<prim-key field="partyId"/>
<prim-key field="fromDate"/>
<relation type="one" fk-name="EMPL_PSFLMT_EMPS" rel-entity-name="EmplPosition">
<key-map field-name="emplPositionId"/>
</relation>
<relation type="one" fk-name="EMPL_PSFLMT_PRTY" rel-entity-name="Party">
<key-map field-name="partyId"/>
</relation>
</entity>
<view-entity entity-name="EmplPositionAndFulfillment"
package-name="org.apache.ofbiz.humanres.position"
title="EmplPosition Fulfillment Entity">
<member-entity entity-alias="EMPPOS" entity-name="EmplPosition"></member-entity>
<member-entity entity-alias="EPF" entity-name="EmplPositionFulfillment"></member-entity>
<alias-all entity-alias="EMPPOS"/>
<alias name="employeePartyId" entity-alias="EPF" field="partyId"/>
<alias name="fromDate" entity-alias="EPF"/>
<alias name="thruDate" entity-alias="EPF"/>
<view-link entity-alias="EMPPOS" rel-entity-alias="EPF">
<key-map field-name="emplPositionId"/>
</view-link>
<relation type="one" rel-entity-name="EmplPositionType">
<key-map field-name="emplPositionTypeId"/>
</relation>
</view-entity>
<entity entity-name="EmplPositionReportingStruct"
package-name="org.apache.ofbiz.humanres.position"
title="EmplPosition Reporting Structure Entity">
<field name="emplPositionIdReportingTo" type="id-ne"></field>
<field name="emplPositionIdManagedBy" type="id-ne"></field>
<field name="fromDate" type="date-time"></field>
<field name="thruDate" type="date-time"></field>
<field name="comments" type="comment"></field>
<field name="primaryFlag" type="indicator"></field>
<prim-key field="emplPositionIdReportingTo"/>
<prim-key field="emplPositionIdManagedBy"/>
<prim-key field="fromDate"/>
<relation type="one" fk-name="EMPL_PSRPS_EMPSR" title="ReportingTo" rel-entity-name="EmplPosition">
<key-map field-name="emplPositionIdReportingTo" rel-field-name="emplPositionId"/>
</relation>
<relation type="one" fk-name="EMPL_PSRPS_EMPSM" title="ManagedBy" rel-entity-name="EmplPosition">
<key-map field-name="emplPositionIdManagedBy" rel-field-name="emplPositionId"/>
</relation>
</entity>
<entity entity-name="EmplPositionResponsibility"
package-name="org.apache.ofbiz.humanres.position"
title="EmplPosition Responsibility Entity">
<field name="emplPositionId" type="id-ne"></field>
<field name="responsibilityTypeId" type="id-ne"></field>
<field name="fromDate" type="date-time"></field>
<field name="thruDate" type="date-time"></field>
<field name="comments" type="comment"></field>
<prim-key field="emplPositionId"/>
<prim-key field="responsibilityTypeId"/>
<prim-key field="fromDate"/>
<relation type="one" fk-name="EMPL_PSRTY_EMPS" rel-entity-name="EmplPosition">
<key-map field-name="emplPositionId"/>
</relation>
<relation type="one" fk-name="EMPL_PSRTY_RYTP" rel-entity-name="ResponsibilityType">
<key-map field-name="responsibilityTypeId"/>
</relation>
</entity>
<entity entity-name="EmplPositionType"
package-name="org.apache.ofbiz.humanres.position"
title="EmplPosition Type Entity">
<field name="emplPositionTypeId" type="id-ne"></field>
<field name="parentTypeId" type="id-ne"></field>
<field name="hasTable" type="indicator"></field>
<field name="description" type="description"></field>
<prim-key field="emplPositionTypeId"/>
<relation type="one" fk-name="EMPL_POSI_TYP_PAR" title="Parent" rel-entity-name="EmplPositionType">
<key-map field-name="parentTypeId" rel-field-name="emplPositionTypeId"/>
</relation>
</entity>
<entity entity-name="EmplPositionTypeClass"
package-name="org.apache.ofbiz.humanres.position"
title="EmplPosition Type Class Entity">
<field name="emplPositionTypeId" type="id-ne"></field>
<field name="emplPositionClassTypeId" type="id-ne"></field>
<field name="fromDate" type="date-time"></field>
<field name="thruDate" type="date-time"></field>
<field name="standardHoursPerWeek" type="floating-point"></field>
<prim-key field="emplPositionTypeId"/>
<prim-key field="emplPositionClassTypeId"/>
<prim-key field="fromDate"/>
<relation type="one" fk-name="EMPL_PSTPCS_EPTP" rel-entity-name="EmplPositionType">
<key-map field-name="emplPositionTypeId"/>
</relation>
<relation type="one" fk-name="EMPL_PSTPCS_EPCTP" rel-entity-name="EmplPositionClassType">
<key-map field-name="emplPositionClassTypeId"/>
</relation>
</entity>
<entity entity-name="ValidResponsibility"
package-name="org.apache.ofbiz.humanres.position"
title="Valid Responsibility Entity">
<field name="emplPositionTypeId" type="id-ne"></field>
<field name="responsibilityTypeId" type="id-ne"></field>
<field name="fromDate" type="date-time"></field>
<field name="thruDate" type="date-time"></field>
<field name="comments" type="comment"></field>
<prim-key field="emplPositionTypeId"/>
<prim-key field="responsibilityTypeId"/>
<prim-key field="fromDate"/>
<relation type="one" fk-name="VALID_RTY_EPSTP" rel-entity-name="EmplPositionType">
<key-map field-name="emplPositionTypeId"/>
</relation>
<relation type="one" fk-name="VALID_RTY_RYTP" rel-entity-name="ResponsibilityType">
<key-map field-name="responsibilityTypeId"/>
</relation>
</entity>
<entity entity-name="EmplPositionTypeRate" table-name="EMPL_POSITION_TYPE_RATE_NEW"
package-name="org.apache.ofbiz.humanres.position"
title="EmplPosition Type Rate Entity">
<field name="emplPositionTypeId" type="id-ne"/>
<field name="rateTypeId" type="id-ne"/>
<field name="payGradeId" type="id"/>
<field name="salaryStepSeqId" type="id"/>
<field name="fromDate" type="date-time"/>
<field name="thruDate" type="date-time"/>
<prim-key field="emplPositionTypeId"/>
<prim-key field="rateTypeId"/>
<prim-key field="fromDate"/>
<relation type="one" fk-name="EMPL_PTPRT_EPTP" rel-entity-name="EmplPositionType">
<key-map field-name="emplPositionTypeId"/>
</relation>
<relation type="one-nofk" fk-name="EMPL_PTPRT_SSTP" rel-entity-name="SalaryStep">
<key-map field-name="salaryStepSeqId"/>
<key-map field-name="payGradeId"/>
<key-map field-name="fromDate"/>
</relation>
<relation type="one-nofk" fk-name="EMPL_PTPRT_RTTYP" rel-entity-name="RateType">
<key-map field-name="rateTypeId"/>
</relation>
</entity>
<view-entity entity-name="EmplPositionTypeRateAndAmount"
package-name="org.apache.ofbiz.humanres.position"
title="EmplPosition Type Rate Entity and Rate Amount">
<member-entity entity-alias="EPTR" entity-name="EmplPositionTypeRate"/>
<member-entity entity-alias="RA" entity-name="RateAmount"/>
<alias-all entity-alias="EPTR"/>
<alias entity-alias="RA" name="rateAmount"/>
<alias entity-alias="RA" name="periodTypeId"/>
<alias entity-alias="RA" name="rateCurrencyUomId"/>
<alias entity-alias="RA" name="rateAmountFromDate" field="fromDate"/>
<alias entity-alias="RA" name="rateAmountThruDate" field="thruDate"/>
<view-link entity-alias="EPTR" rel-entity-alias="RA">
<key-map field-name="emplPositionTypeId"/>
<key-map field-name="rateTypeId"/>
</view-link>
</view-entity>
<!-- ========================================================= -->
<!-- org.apache.ofbiz.humanres.recruitment -->
<!-- ========================================================= -->
<entity entity-name="JobRequisition"
package-name="org.apache.ofbiz.humanres.recruitment"
title="Entity for storing data about recruitment">
<field name="jobRequisitionId" type="id-ne"></field>
<field name="durationMonths" type="numeric"></field>
<field name="age" type="numeric"></field>
<field name="gender" type="indicator"></field>
<field name="experienceMonths" type="numeric"></field>
<field name="experienceYears" type="numeric"></field>
<field name="qualification" type="id-long"></field>
<field name="jobLocation" type="id"></field>
<field name="skillTypeId" type="id"></field>
<field name="noOfResources" type="numeric"></field>
<field name="jobPostingTypeEnumId" type="id"></field>
<field name="jobRequisitionDate" type="date"></field>
<field name="examTypeEnumId" type="id"></field>
<field name="requiredOnDate" type="date"></field>
<prim-key field="jobRequisitionId"/>
<relation type="one" fk-name="JOB_REQ_SKTYP" rel-entity-name="SkillType">
<key-map field-name="skillTypeId"/>
</relation>
<relation type="one" fk-name="JOB_REQ_ENUMEXM" title="ExamType" rel-entity-name="Enumeration">
<key-map field-name="examTypeEnumId" rel-field-name="enumId"/>
</relation>
<relation type="one" fk-name="JOB_REQ_ENUMJBP" title="JobPostingType" rel-entity-name="Enumeration">
<key-map field-name="jobPostingTypeEnumId" rel-field-name="enumId"/>
</relation>
</entity>
<entity entity-name="JobInterview"
package-name="org.apache.ofbiz.humanres.recruitment"
title="Entity for storing data about Interviews conducted">
<field name="jobInterviewId" type="id-ne"></field>
<field name="jobIntervieweePartyId" type="id"></field>
<field name="jobRequisitionId" type="id"></field>
<field name="jobInterviewerPartyId" type="id"></field>
<field name="jobInterviewTypeId" type="id"></field>
<field name="gradeSecuredEnumId" type="id"></field>
<field name="jobInterviewResult" type="id"></field>
<field name="jobInterviewDate" type="date"></field>
<prim-key field="jobInterviewId"/>
<relation type="one" fk-name="JOB_INTW_IEPR" title="Interviewee" rel-entity-name="Party">
<key-map field-name="jobIntervieweePartyId" rel-field-name="partyId"/>
</relation>
<relation type="one" fk-name="JOB_INTW_IRPR" title="Interviewer" rel-entity-name="Party">
<key-map field-name="jobInterviewerPartyId" rel-field-name="partyId"/>
</relation>
<relation type="one" fk-name="JOB_INTW_INTYP" rel-entity-name="JobInterviewType">
<key-map field-name="jobInterviewTypeId"/>
</relation>
<relation type="one" fk-name="JOB_INTW_JBREQ" rel-entity-name="JobRequisition">
<key-map field-name="jobRequisitionId"/>
</relation>
<relation type="one" fk-name="JOB_INTW_ENUM" rel-entity-name="Enumeration">
<key-map field-name="gradeSecuredEnumId" rel-field-name="enumId"/>
</relation>
</entity>
<entity entity-name="JobInterviewType"
package-name="org.apache.ofbiz.humanres.recruitment"
title="Entity for storing data about Interview Types">
<field name="jobInterviewTypeId" type="id-ne"></field>
<field name="description" type="description"></field>
<prim-key field="jobInterviewTypeId"/>
</entity>
<view-entity entity-name="EmplPositionFulfillmentAndReportingStruct"
package-name="org.apache.ofbiz.humanres.recruitment"
title="To view the employment details of an employee">
<member-entity entity-alias="EMPPOS" entity-name="EmplPosition"/>
<member-entity entity-alias="EMPPOSFUL" entity-name="EmplPositionFulfillment"/>
<member-entity entity-alias="EMPPOSREPST" entity-name="EmplPositionReportingStruct"/>
<alias entity-alias="EMPPOSFUL" name="partyId"/>
<alias entity-alias="EMPPOSFUL" name="emplPositionId"/>
<alias entity-alias="EMPPOSREPST" name="emplPositionIdReportingTo"/>
<alias entity-alias="EMPPOS" name="internalOrganisation" field="partyId"/>
<alias entity-alias="EMPPOSREPST" name="reportingDate" field="fromDate"/>
<view-link entity-alias="EMPPOS" rel-entity-alias="EMPPOSFUL">
<key-map field-name="emplPositionId"/>
</view-link>
<view-link entity-alias="EMPPOSFUL" rel-entity-alias="EMPPOSREPST">
<key-map field-name="emplPositionId" rel-field-name="emplPositionIdManagedBy"/>
</view-link>
</view-entity>
<entity entity-name="TrainingRequest"
package-name="org.apache.ofbiz.humanres.trainings"
title="Training Request Entity">
<field name="trainingRequestId" type="id-ne"></field>
<prim-key field="trainingRequestId"/>
</entity>
<entity entity-name="EmplLeaveReasonType"
package-name="org.apache.ofbiz.humanres.employment"
default-resource-name="HumanResEntityLabels"
title="Leave Reason Type Entity">
<field name="emplLeaveReasonTypeId" type="id-ne"/>
<field name="parentTypeId" type="id-ne"/>
<field name="hasTable" type="indicator"/>
<field name="description" type="description"/>
<prim-key field="emplLeaveReasonTypeId"/>
<relation type="one" fk-name="EMPL_REASON_TPAR" title="Parent" rel-entity-name="EmplLeaveReasonType">
<key-map field-name="parentTypeId" rel-field-name="emplLeaveReasonTypeId"/>
</relation>
</entity>
</entitymodel>
|
{
"content_hash": "d8103dc2feb4017aaab4241073f35b7b",
"timestamp": "",
"source": "github",
"line_count": 970,
"max_line_length": 120,
"avg_line_length": 51.6319587628866,
"alnum_prop": 0.6330691052852265,
"repo_name": "yuri0x7c1/ofbiz-explorer",
"id": "39df07d669684dd5b5759f75f338e74e7d47bdb1",
"size": "50083",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/test/resources/apache-ofbiz-16.11.03/applications/datamodel/entitydef/humanres-entitymodel.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "17446"
},
{
"name": "CSS",
"bytes": "1890137"
},
{
"name": "FreeMarker",
"bytes": "4633734"
},
{
"name": "Groovy",
"bytes": "1724859"
},
{
"name": "HTML",
"bytes": "12835438"
},
{
"name": "Java",
"bytes": "16138651"
},
{
"name": "JavaScript",
"bytes": "4284839"
},
{
"name": "Makefile",
"bytes": "25802"
},
{
"name": "PHP",
"bytes": "150"
},
{
"name": "Perl",
"bytes": "2756"
},
{
"name": "Python",
"bytes": "19974"
},
{
"name": "Roff",
"bytes": "4118"
},
{
"name": "Ruby",
"bytes": "2533"
},
{
"name": "Shell",
"bytes": "44075"
},
{
"name": "XSLT",
"bytes": "8467700"
}
]
}
|
package stroom.datasource.api.v2;
import stroom.query.api.v2.ExpressionTerm.Condition;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
@JsonInclude(JsonInclude.Include.NON_NULL)
public class LongField extends AbstractNumericField {
private static final long serialVersionUID = 1272545271946712570L;
public LongField(final String name) {
super(name);
}
public LongField(final String name, final Boolean queryable) {
super(name, queryable);
}
@JsonCreator
public LongField(@JsonProperty("name") final String name,
@JsonProperty("queryable") final Boolean queryable,
@JsonProperty("conditions") final List<Condition> conditions) {
super(name, queryable, conditions);
}
@JsonIgnore
@Override
public String getType() {
return FieldTypes.LONG;
}
}
|
{
"content_hash": "9bdae81be89fca660c71cb20821156b6",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 84,
"avg_line_length": 27.23076923076923,
"alnum_prop": 0.7137476459510358,
"repo_name": "gchq/stroom",
"id": "332be41fc2dcf122d6551c40fca571fe7055f119",
"size": "1660",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "stroom-query/stroom-query-api/src/main/java/stroom/datasource/api/v2/LongField.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "272243"
},
{
"name": "Dockerfile",
"bytes": "21009"
},
{
"name": "HTML",
"bytes": "14114"
},
{
"name": "Java",
"bytes": "22782925"
},
{
"name": "JavaScript",
"bytes": "14516557"
},
{
"name": "Makefile",
"bytes": "661"
},
{
"name": "Python",
"bytes": "3176"
},
{
"name": "SCSS",
"bytes": "158667"
},
{
"name": "Shell",
"bytes": "166531"
},
{
"name": "TypeScript",
"bytes": "2009517"
},
{
"name": "XSLT",
"bytes": "174226"
}
]
}
|
title: Tiles powered by Flexbox
layout: documentation
doc-tab: layout
doc-subtab: tiles
---
{% include subnav/subnav-layout.html %}
<section class="section">
<div class="container">
<h1 class="title">Tiles</h1>
<h2 class="subtitle">A <strong>single tile</strong> element to build 2-dimensional Metro-like, Pinterest-like, or whatever-you-like grids</h2>
<hr>
<div class="content">
<p>To build intricate 2-dimensional layouts, you only need a <strong>single element</strong>: the <code>tile</code>:</p>
</div>
{% highlight html %}
<div class="tile">
<!-- The magical tile element! -->
</div>
{% endhighlight %}
{% include anchor.html name="Example" %}
<div class="tile is-ancestor">
<div class="tile is-vertical is-8">
<div class="tile">
<div class="tile is-parent is-vertical">
<article class="tile is-child notification is-primary">
<p class="title">Vertical...</p>
<p class="subtitle">Top tile</p>
</article>
<article class="tile is-child notification is-warning">
<p class="title">...tiles</p>
<p class="subtitle">Bottom tile</p>
</article>
</div>
<div class="tile is-parent">
<article class="tile is-child notification is-info">
<p class="title">Middle tile</p>
<p class="subtitle">With an image</p>
<figure class="image is-4by3">
<img src="{{site.url}}/images/placeholders/640x480.png">
</figure>
</article>
</div>
</div>
<div class="tile is-parent">
<article class="tile is-child notification is-danger">
<p class="title">Wide tile</p>
<p class="subtitle">Aligned with the right tile</p>
<div class="content">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin ornare magna eros, eu pellentesque tortor vestibulum ut. Maecenas non massa sem. Etiam finibus odio quis feugiat facilisis.</p>
</div>
</article>
</div>
</div>
<div class="tile is-parent">
<article class="tile is-child notification is-success">
<div class="content">
<p class="title">Tall tile</p>
<p class="subtitle">With even more content</p>
<div class="content">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam semper diam at erat pulvinar, at pulvinar felis blandit. Vestibulum volutpat tellus diam, consequat gravida libero rhoncus ut. Morbi maximus, leo sit amet vehicula eleifend, nunc dui porta orci, quis semper odio felis ut quam.</p>
<p>Suspendisse varius ligula in molestie lacinia. Maecenas varius eget ligula a sagittis. Pellentesque interdum, nisl nec interdum maximus, augue diam porttitor lorem, et sollicitudin felis neque sit amet erat. Maecenas imperdiet felis nisi, fringilla luctus felis hendrerit sit amet. Aenean vitae gravida diam, finibus dignissim turpis. Sed eget varius ligula, at volutpat tortor.</p>
<p>Integer sollicitudin, tortor a mattis commodo, velit urna rhoncus erat, vitae congue lectus dolor consequat libero. Donec leo ligula, maximus et pellentesque sed, gravida a metus. Cras ullamcorper a nunc ac porta. Aliquam ut aliquet lacus, quis faucibus libero. Quisque non semper leo.</p>
</div>
</div>
</article>
</div>
</div>
{% highlight html %}
<div class="tile is-ancestor">
<div class="tile is-vertical is-8">
<div class="tile">
<div class="tile is-parent is-vertical">
<article class="tile is-child notification is-primary">
<p class="title">Vertical...</p>
<p class="subtitle">Top tile</p>
</article>
<article class="tile is-child notification is-warning">
<p class="title">...tiles</p>
<p class="subtitle">Bottom tile</p>
</article>
</div>
<div class="tile is-parent">
<article class="tile is-child notification is-info">
<p class="title">Middle tile</p>
<p class="subtitle">With an image</p>
<figure class="image is-4by3">
<img src="{{site.url}}/images/placeholders/640x480.png">
</figure>
</article>
</div>
</div>
<div class="tile is-parent">
<article class="tile is-child notification is-danger">
<p class="title">Wide tile</p>
<p class="subtitle">Aligned with the right tile</p>
<div class="content">
<!-- Content -->
</div>
</article>
</div>
</div>
<div class="tile is-parent">
<article class="tile is-child notification is-success">
<div class="content">
<p class="title">Tall tile</p>
<p class="subtitle">With even more content</p>
<div class="content">
<!-- Content -->
</div>
</div>
</article>
</div>
</div>
{% endhighlight %}
{% include anchor.html name="Modifiers" %}
<div class="content">
<p>The <code>tile</code> element has <strong>16 modifiers</strong>:</p>
<ul>
<li>
<strong>3 contextual</strong> modifiers
<ul>
<li><code>is-ancestor</code></li>
<li><code>is-parent</code></li>
<li><code>is-child</code></li>
</ul>
</li>
<li>
<strong>1 directional</strong> modifier
<ul>
<li><code>is-vertical</code></li>
</ul>
</li>
<li>
<strong>12 horizontal size</strong> modifiers
<ul>
<li>from <code>is-1</code></li>
<li>to <code>is-12</code></li>
</ul>
</li>
</ul>
</div>
{% include anchor.html name="How it works: Nesting" %}
<div class="content">
<p>Everything is a tile! To create a grid of tiles, you only need to <strong>nest</strong> <code>tile</code> elements.</p>
</div>
<div class="columns">
<div class="column is-one-third">
<p>Start with an <strong>ancestor</strong> tile that will wrap all other tiles:</p>
</div>
<div class="column is-two-thirds">
{% highlight html %}
<div class="tile is-ancestor">
<!-- All other tile elemnts -->
</div>
{% endhighlight %}
</div>
</div>
<div class="columns">
<div class="column is-one-third">
<p>Add tile elements that will distribute themselves <strong>horizontally</strong>:</p>
</div>
<div class="column is-two-thirds">
{% highlight html %}
<div class="tile is-ancestor">
<div class="tile">
<!-- Add content or other tiles -->
</div>
<div class="tile">
<!-- Add content or other tiles -->
</div>
</div>
{% endhighlight %}
</div>
</div>
<div class="columns">
<div class="column is-one-third">
<p>
You can <strong>resize</strong> any tile according to a <strong>12 column</strong> grid.
<br>
For example, <code>is-4</code> will take up 1/3 of the horizontal space:
</p>
</div>
<div class="column is-two-thirds">
{% highlight html %}
<div class="tile is-ancestor">
<div class="tile is-4">
<!-- 1/3 -->
</div>
<div class="tile">
<!-- This tile will take the rest: 2/3 -->
</div>
</div>
{% endhighlight %}
</div>
</div>
<div class="columns">
<div class="column is-one-third">
<p>If you want to stack tiles <strong>vertically</strong>, add <code>is-vertical</code> on the parent tile:</p>
</div>
<div class="column is-two-thirds">
{% highlight html %}
<div class="tile is-ancestor">
<div class="tile is-4 is-vertical">
<div class="tile">
<!-- Top tile -->
</div>
<div class="tile">
<!-- Bottom tile -->
</div>
</div>
<div class="tile">
<!-- This tile will take up the whole vertical space -->
</div>
</div>
{% endhighlight %}
</div>
</div>
<div class="columns">
<div class="column is-one-third">
<div class="content">
<p>As soon as you want to add <strong>content</strong> to a tile, just:</p>
<ul>
<li>add <em>any</em> class you want, like <code>box</code></li>
<li>add the <code>is-child</code> modifier on the tile</li>
<li>add the <code>is-parent</code> modifier on the <em>parent</em> tile</li>
</ul>
</div>
</div>
<div class="column is-two-thirds">
{% highlight html %}
<div class="tile is-ancestor">
<div class="tile is-4 is-vertical is-parent">
<div class="tile is-child box">
<p class="title">One</p>
</div>
<div class="tile is-child box">
<p class="title">Two</p>
</div>
</div>
<div class="tile is-parent">
<div class="tile is-child box">
<p class="title">Three</p>
</div>
</div>
</div>
{% endhighlight %}
</div>
</div>
<div class="tile is-ancestor">
<div class="tile is-4 is-vertical is-parent">
<div class="tile is-child box">
<p class="title">One</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin ornare magna eros, eu pellentesque tortor vestibulum ut. Maecenas non massa sem. Etiam finibus odio quis feugiat facilisis.</p>
</div>
<div class="tile is-child box">
<p class="title">Two</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin ornare magna eros, eu pellentesque tortor vestibulum ut. Maecenas non massa sem. Etiam finibus odio quis feugiat facilisis.</p>
</div>
</div>
<div class="tile is-parent">
<div class="tile is-child box">
<p class="title">Three</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam semper diam at erat pulvinar, at pulvinar felis blandit. Vestibulum volutpat tellus diam, consequat gravida libero rhoncus ut. Morbi maximus, leo sit amet vehicula eleifend, nunc dui porta orci, quis semper odio felis ut quam.</p>
<p>Suspendisse varius ligula in molestie lacinia. Maecenas varius eget ligula a sagittis. Pellentesque interdum, nisl nec interdum maximus, augue diam porttitor lorem, et sollicitudin felis neque sit amet erat. Maecenas imperdiet felis nisi, fringilla luctus felis hendrerit sit amet. Aenean vitae gravida diam, finibus dignissim turpis. Sed eget varius ligula, at volutpat tortor.</p>
<p>Integer sollicitudin, tortor a mattis commodo, velit urna rhoncus erat, vitae congue lectus dolor consequat libero. Donec leo ligula, maximus et pellentesque sed, gravida a metus. Cras ullamcorper a nunc ac porta. Aliquam ut aliquet lacus, quis faucibus libero. Quisque non semper leo.</p>
</div>
</div>
</div>
{% highlight html %}
<div class="tile is-ancestor">
<div class="tile is-4 is-vertical is-parent">
<div class="tile is-child box">
<p class="title">One</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin ornare magna eros, eu pellentesque tortor vestibulum ut. Maecenas non massa sem. Etiam finibus odio quis feugiat facilisis.</p>
</div>
<div class="tile is-child box">
<p class="title">Two</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin ornare magna eros, eu pellentesque tortor vestibulum ut. Maecenas non massa sem. Etiam finibus odio quis feugiat facilisis.</p>
</div>
</div>
<div class="tile is-parent">
<div class="tile is-child box">
<p class="title">Three</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam semper diam at erat pulvinar, at pulvinar felis blandit. Vestibulum volutpat tellus diam, consequat gravida libero rhoncus ut. Morbi maximus, leo sit amet vehicula eleifend, nunc dui porta orci, quis semper odio felis ut quam.</p>
<p>Suspendisse varius ligula in molestie lacinia. Maecenas varius eget ligula a sagittis. Pellentesque interdum, nisl nec interdum maximus, augue diam porttitor lorem, et sollicitudin felis neque sit amet erat. Maecenas imperdiet felis nisi, fringilla luctus felis hendrerit sit amet. Aenean vitae gravida diam, finibus dignissim turpis. Sed eget varius ligula, at volutpat tortor.</p>
<p>Integer sollicitudin, tortor a mattis commodo, velit urna rhoncus erat, vitae congue lectus dolor consequat libero. Donec leo ligula, maximus et pellentesque sed, gravida a metus. Cras ullamcorper a nunc ac porta. Aliquam ut aliquet lacus, quis faucibus libero. Quisque non semper leo.</p>
</div>
</div>
</div>
{% endhighlight %}
{% include anchor.html name="Nesting requirements" %}
<article class="message is-danger">
<div class="message-header">
3 levels deep at least...
</div>
<div class="message-body">
<div class="content">
<p>You need at least <strong>3 levels</strong> of hierarchy:</p>
{% highlight markdown %}
tile is-ancestor
|
└───tile is-parent
|
└───tile is-child
{% endhighlight %}
</div>
</div>
</article>
<article class="message is-success">
<div class="message-header">
...but more levels if you want!
</div>
<div class="message-body">
<div class="content">
<p>You can, however, nest tiles deeper than that, and mix it up!</p>
{% highlight markdown %}
tile is-ancestor
|
├───tile is-vertical is-8
| |
| ├───tile
| | |
| | ├───tile is-parent is-vertical
| | | ├───tile is-child
| | | └───tile is-child
| | |
| | └───tile is-parent
| | └───tile is-child
| |
| └───tile is-parent
| └───tile is-child
|
└───tile is-parent
└───tile is-child
{% endhighlight %}
</div>
</div>
</article>
<div class="tile is-ancestor">
<div class="tile is-vertical is-8">
<div class="tile">
<div class="tile is-parent is-vertical">
<article class="tile is-child box">
<p class="title">Vertical tiles</p>
<p class="subtitle">Top box</p>
</article>
<article class="tile is-child box">
<p class="title">Vertical tiles</p>
<p class="subtitle">Bottom box</p>
</article>
</div>
<div class="tile is-parent">
<article class="tile is-child box">
<p class="title">Middle box</p>
<p class="subtitle">With an image</p>
<figure class="image is-4by3">
<img src="{{site.url}}/images/placeholders/640x480.png">
</figure>
</article>
</div>
</div>
<div class="tile is-parent">
<article class="tile is-child box">
<p class="title">Wide column</p>
<p class="subtitle">Aligned with the right column</p>
<div class="content">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin ornare magna eros, eu pellentesque tortor vestibulum ut. Maecenas non massa sem. Etiam finibus odio quis feugiat facilisis.</p>
</div>
</article>
</div>
</div>
<div class="tile is-parent">
<article class="tile is-child box">
<div class="content">
<p class="title">Tall column</p>
<p class="subtitle">With even more content</p>
<div class="content">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam semper diam at erat pulvinar, at pulvinar felis blandit. Vestibulum volutpat tellus diam, consequat gravida libero rhoncus ut. Morbi maximus, leo sit amet vehicula eleifend, nunc dui porta orci, quis semper odio felis ut quam.</p>
<p>Suspendisse varius ligula in molestie lacinia. Maecenas varius eget ligula a sagittis. Pellentesque interdum, nisl nec interdum maximus, augue diam porttitor lorem, et sollicitudin felis neque sit amet erat. Maecenas imperdiet felis nisi, fringilla luctus felis hendrerit sit amet. Aenean vitae gravida diam, finibus dignissim turpis. Sed eget varius ligula, at volutpat tortor.</p>
<p>Integer sollicitudin, tortor a mattis commodo, velit urna rhoncus erat, vitae congue lectus dolor consequat libero. Donec leo ligula, maximus et pellentesque sed, gravida a metus. Cras ullamcorper a nunc ac porta. Aliquam ut aliquet lacus, quis faucibus libero. Quisque non semper leo.</p>
</div>
</div>
</article>
</div>
</div>
{% highlight html %}
<div class="tile is-ancestor">
<div class="tile is-vertical is-8">
<div class="tile">
<div class="tile is-parent is-vertical">
<article class="tile is-child box">
<!-- Put any content you want -->
</article>
<article class="tile is-child box">
<!-- Put any content you want -->
</article>
</div>
<div class="tile is-parent">
<article class="tile is-child box">
<!-- Put any content you want -->
</article>
</div>
</div>
<div class="tile is-parent">
<article class="tile is-child box">
<!-- Put any content you want -->
</article>
</div>
</div>
<div class="tile is-parent">
<article class="tile is-child box">
<!-- Put any content you want -->
</article>
</div>
</div>
{% endhighlight %}
{% include anchor.html name="3 columns" %}
<div class="tile is-ancestor">
<div class="tile is-parent">
<article class="tile is-child box">
<p class="title">Hello World</p>
<p class="subtitle">What is up?</p>
</article>
</div>
<div class="tile is-parent">
<article class="tile is-child box">
<p class="title">Foo</p>
<p class="subtitle">Bar</p>
</article>
</div>
<div class="tile is-parent">
<article class="tile is-child box">
<p class="title">Third column</p>
<p class="subtitle">With some content</p>
<div class="content">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin ornare magna eros, eu pellentesque tortor vestibulum ut. Maecenas non massa sem. Etiam finibus odio quis feugiat facilisis.</p>
</div>
</article>
</div>
</div>
<div class="tile is-ancestor">
<div class="tile is-vertical is-8">
<div class="tile">
<div class="tile is-parent is-vertical">
<article class="tile is-child box">
<p class="title">Vertical tiles</p>
<p class="subtitle">Top box</p>
</article>
<article class="tile is-child box">
<p class="title">Vertical tiles</p>
<p class="subtitle">Bottom box</p>
</article>
</div>
<div class="tile is-parent">
<article class="tile is-child box">
<p class="title">Middle box</p>
<p class="subtitle">With an image</p>
<figure class="image is-4by3">
<img src="{{site.url}}/images/placeholders/640x480.png">
</figure>
</article>
</div>
</div>
<div class="tile is-parent">
<article class="tile is-child box">
<p class="title">Wide column</p>
<p class="subtitle">Aligned with the right column</p>
<div class="content">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin ornare magna eros, eu pellentesque tortor vestibulum ut. Maecenas non massa sem. Etiam finibus odio quis feugiat facilisis.</p>
</div>
</article>
</div>
</div>
<div class="tile is-parent">
<article class="tile is-child box">
<div class="content">
<p class="title">Tall column</p>
<p class="subtitle">With even more content</p>
<div class="content">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam semper diam at erat pulvinar, at pulvinar felis blandit. Vestibulum volutpat tellus diam, consequat gravida libero rhoncus ut. Morbi maximus, leo sit amet vehicula eleifend, nunc dui porta orci, quis semper odio felis ut quam.</p>
<p>Suspendisse varius ligula in molestie lacinia. Maecenas varius eget ligula a sagittis. Pellentesque interdum, nisl nec interdum maximus, augue diam porttitor lorem, et sollicitudin felis neque sit amet erat. Maecenas imperdiet felis nisi, fringilla luctus felis hendrerit sit amet. Aenean vitae gravida diam, finibus dignissim turpis. Sed eget varius ligula, at volutpat tortor.</p>
<p>Integer sollicitudin, tortor a mattis commodo, velit urna rhoncus erat, vitae congue lectus dolor consequat libero. Donec leo ligula, maximus et pellentesque sed, gravida a metus. Cras ullamcorper a nunc ac porta. Aliquam ut aliquet lacus, quis faucibus libero. Quisque non semper leo.</p>
</div>
</div>
</article>
</div>
</div>
<div class="tile is-ancestor">
<div class="tile is-parent">
<article class="tile is-child box">
<p class="title">Side column</p>
<p class="subtitle">With some content</p>
<div class="content">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin ornare magna eros, eu pellentesque tortor vestibulum ut. Maecenas non massa sem. Etiam finibus odio quis feugiat facilisis.</p>
</div>
</article>
</div>
<div class="tile is-parent is-8">
<article class="tile is-child box">
<p class="title">Main column</p>
<p class="subtitle">With some content</p>
<div class="content">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin ornare magna eros, eu pellentesque tortor vestibulum ut. Maecenas non massa sem. Etiam finibus odio quis feugiat facilisis.</p>
</div>
</article>
</div>
</div>
{% highlight html %}
<div class="tile is-ancestor">
<div class="tile is-parent">
<article class="tile is-child box">
<p class="title">Hello World</p>
<p class="subtitle">What is up?</p>
</article>
</div>
<div class="tile is-parent">
<article class="tile is-child box">
<p class="title">Foo</p>
<p class="subtitle">Bar</p>
</article>
</div>
<div class="tile is-parent">
<article class="tile is-child box">
<p class="title">Third column</p>
<p class="subtitle">With some content</p>
<div class="content">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin ornare magna eros, eu pellentesque tortor vestibulum ut. Maecenas non massa sem. Etiam finibus odio quis feugiat facilisis.</p>
</div>
</article>
</div>
</div>
<div class="tile is-ancestor">
<div class="tile is-vertical is-8">
<div class="tile">
<div class="tile is-parent is-vertical">
<article class="tile is-child box">
<p class="title">Vertical tiles</p>
<p class="subtitle">Top box</p>
</article>
<article class="tile is-child box">
<p class="title">Vertical tiles</p>
<p class="subtitle">Bottom box</p>
</article>
</div>
<div class="tile is-parent">
<article class="tile is-child box">
<p class="title">Middle box</p>
<p class="subtitle">With an image</p>
<figure class="image is-4by3">
<img src="{{site.url}}/images/placeholders/640x480.png">
</figure>
</article>
</div>
</div>
<div class="tile is-parent">
<article class="tile is-child box">
<p class="title">Wide column</p>
<p class="subtitle">Aligned with the right column</p>
<div class="content">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin ornare magna eros, eu pellentesque tortor vestibulum ut. Maecenas non massa sem. Etiam finibus odio quis feugiat facilisis.</p>
</div>
</article>
</div>
</div>
<div class="tile is-parent">
<article class="tile is-child box">
<div class="content">
<p class="title">Tall column</p>
<p class="subtitle">With even more content</p>
<div class="content">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam semper diam at erat pulvinar, at pulvinar felis blandit. Vestibulum volutpat tellus diam, consequat gravida libero rhoncus ut. Morbi maximus, leo sit amet vehicula eleifend, nunc dui porta orci, quis semper odio felis ut quam.</p>
<p>Suspendisse varius ligula in molestie lacinia. Maecenas varius eget ligula a sagittis. Pellentesque interdum, nisl nec interdum maximus, augue diam porttitor lorem, et sollicitudin felis neque sit amet erat. Maecenas imperdiet felis nisi, fringilla luctus felis hendrerit sit amet. Aenean vitae gravida diam, finibus dignissim turpis. Sed eget varius ligula, at volutpat tortor.</p>
<p>Integer sollicitudin, tortor a mattis commodo, velit urna rhoncus erat, vitae congue lectus dolor consequat libero. Donec leo ligula, maximus et pellentesque sed, gravida a metus. Cras ullamcorper a nunc ac porta. Aliquam ut aliquet lacus, quis faucibus libero. Quisque non semper leo.</p>
</div>
</div>
</article>
</div>
</div>
<div class="tile is-ancestor">
<div class="tile is-parent">
<article class="tile is-child box">
<p class="title">Side column</p>
<p class="subtitle">With some content</p>
<div class="content">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin ornare magna eros, eu pellentesque tortor vestibulum ut. Maecenas non massa sem. Etiam finibus odio quis feugiat facilisis.</p>
</div>
</article>
</div>
<div class="tile is-parent is-8">
<article class="tile is-child box">
<p class="title">Main column</p>
<p class="subtitle">With some content</p>
<div class="content">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin ornare magna eros, eu pellentesque tortor vestibulum ut. Maecenas non massa sem. Etiam finibus odio quis feugiat facilisis.</p>
</div>
</article>
</div>
</div>
{% endhighlight %}
{% include anchor.html name="4 columns" %}
<div class="tile is-ancestor">
<div class="tile is-parent">
<article class="tile is-child box">
<p class="title">One</p>
<p class="subtitle">Subtitle</p>
</article>
</div>
<div class="tile is-parent">
<article class="tile is-child box">
<p class="title">Two</p>
<p class="subtitle">Subtitle</p>
</article>
</div>
<div class="tile is-parent">
<article class="tile is-child box">
<p class="title">Three</p>
<p class="subtitle">Subtitle</p>
</article>
</div>
<div class="tile is-parent">
<article class="tile is-child box">
<p class="title">Four</p>
<p class="subtitle">Subtitle</p>
</article>
</div>
</div>
<div class="tile is-ancestor">
<div class="tile is-vertical is-9">
<div class="tile">
<div class="tile is-parent">
<article class="tile is-child box">
<p class="title">Five</p>
<p class="subtitle">Subtitle</p>
<div class="content">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam semper diam at erat pulvinar, at pulvinar felis blandit. Vestibulum volutpat tellus diam, consequat gravida libero rhoncus ut. Morbi maximus, leo sit amet vehicula eleifend, nunc dui porta orci, quis semper odio felis ut quam.</p>
</div>
</article>
</div>
<div class="tile is-8 is-vertical">
<div class="tile">
<div class="tile is-parent">
<article class="tile is-child box">
<p class="title">Six</p>
<p class="subtitle">Subtitle</p>
</article>
</div>
<div class="tile is-parent">
<article class="tile is-child box">
<p class="title">Seven</p>
<p class="subtitle">Subtitle</p>
</article>
</div>
</div>
<div class="tile is-parent">
<article class="tile is-child box">
<p class="title">Eight</p>
<p class="subtitle">Subtitle</p>
</article>
</div>
</div>
</div>
<div class="tile">
<div class="tile is-8 is-parent">
<article class="tile is-child box">
<p class="title">Nine</p>
<p class="subtitle">Subtitle</p>
<div class="content">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin ornare magna eros, eu pellentesque tortor vestibulum ut. Maecenas non massa sem. Etiam finibus odio quis feugiat facilisis.</p>
</div>
</article>
</div>
<div class="tile is-parent">
<article class="tile is-child box">
<p class="title">Ten</p>
<p class="subtitle">Subtitle</p>
<div class="content">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin ornare magna eros, eu pellentesque tortor vestibulum ut. Maecenas non massa sem. Etiam finibus odio quis feugiat facilisis.</p>
</div>
</article>
</div>
</div>
</div>
<div class="tile is-parent">
<article class="tile is-child box">
<div class="content">
<p class="title">Eleven</p>
<p class="subtitle">Subtitle</p>
<div class="content">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam semper diam at erat pulvinar, at pulvinar felis blandit. Vestibulum volutpat tellus diam, consequat gravida libero rhoncus ut. Morbi maximus, leo sit amet vehicula eleifend, nunc dui porta orci, quis semper odio felis ut quam.</p>
<p>Integer sollicitudin, tortor a mattis commodo, velit urna rhoncus erat, vitae congue lectus dolor consequat libero. Donec leo ligula, maximus et pellentesque sed, gravida a metus. Cras ullamcorper a nunc ac porta. Aliquam ut aliquet lacus, quis faucibus libero. Quisque non semper leo.</p>
</div>
</div>
</article>
</div>
</div>
<div class="tile is-ancestor">
<div class="tile is-parent">
<article class="tile is-child box">
<p class="title">Twelve</p>
<p class="subtitle">Subtitle</p>
<div class="content">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin ornare magna eros, eu pellentesque tortor vestibulum ut.</p>
</div>
</article>
</div>
<div class="tile is-parent is-6">
<article class="tile is-child box">
<p class="title">Thirteen</p>
<p class="subtitle">Subtitle</p>
<div class="content">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin ornare magna eros, eu pellentesque tortor vestibulum ut. Maecenas non massa sem. Etiam finibus odio quis feugiat facilisis.</p>
</div>
</article>
</div>
<div class="tile is-parent">
<article class="tile is-child box">
<p class="title">Fourteen</p>
<p class="subtitle">Subtitle</p>
<div class="content">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin ornare magna eros, eu pellentesque tortor vestibulum ut.</p>
</div>
</article>
</div>
</div>
{% highlight html %}
<div class="tile is-ancestor">
<div class="tile is-parent">
<article class="tile is-child box">
<p class="title">One</p>
<p class="subtitle">Subtitle</p>
</article>
</div>
<div class="tile is-parent">
<article class="tile is-child box">
<p class="title">Two</p>
<p class="subtitle">Subtitle</p>
</article>
</div>
<div class="tile is-parent">
<article class="tile is-child box">
<p class="title">Three</p>
<p class="subtitle">Subtitle</p>
</article>
</div>
<div class="tile is-parent">
<article class="tile is-child box">
<p class="title">Four</p>
<p class="subtitle">Subtitle</p>
</article>
</div>
</div>
<div class="tile is-ancestor">
<div class="tile is-vertical is-9">
<div class="tile">
<div class="tile is-parent">
<article class="tile is-child box">
<p class="title">Five</p>
<p class="subtitle">Subtitle</p>
<div class="content">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam semper diam at erat pulvinar, at pulvinar felis blandit. Vestibulum volutpat tellus diam, consequat gravida libero rhoncus ut. Morbi maximus, leo sit amet vehicula eleifend, nunc dui porta orci, quis semper odio felis ut quam.</p>
</div>
</article>
</div>
<div class="tile is-8 is-vertical">
<div class="tile">
<div class="tile is-parent">
<article class="tile is-child box">
<p class="title">Six</p>
<p class="subtitle">Subtitle</p>
</article>
</div>
<div class="tile is-parent">
<article class="tile is-child box">
<p class="title">Seven</p>
<p class="subtitle">Subtitle</p>
</article>
</div>
</div>
<div class="tile is-parent">
<article class="tile is-child box">
<p class="title">Eight</p>
<p class="subtitle">Subtitle</p>
</article>
</div>
</div>
</div>
<div class="tile">
<div class="tile is-8 is-parent">
<article class="tile is-child box">
<p class="title">Nine</p>
<p class="subtitle">Subtitle</p>
<div class="content">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin ornare magna eros, eu pellentesque tortor vestibulum ut. Maecenas non massa sem. Etiam finibus odio quis feugiat facilisis.</p>
</div>
</article>
</div>
<div class="tile is-parent">
<article class="tile is-child box">
<p class="title">Ten</p>
<p class="subtitle">Subtitle</p>
<div class="content">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin ornare magna eros, eu pellentesque tortor vestibulum ut. Maecenas non massa sem. Etiam finibus odio quis feugiat facilisis.</p>
</div>
</article>
</div>
</div>
</div>
<div class="tile is-parent">
<article class="tile is-child box">
<div class="content">
<p class="title">Eleven</p>
<p class="subtitle">Subtitle</p>
<div class="content">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam semper diam at erat pulvinar, at pulvinar felis blandit. Vestibulum volutpat tellus diam, consequat gravida libero rhoncus ut. Morbi maximus, leo sit amet vehicula eleifend, nunc dui porta orci, quis semper odio felis ut quam.</p>
<p>Integer sollicitudin, tortor a mattis commodo, velit urna rhoncus erat, vitae congue lectus dolor consequat libero. Donec leo ligula, maximus et pellentesque sed, gravida a metus. Cras ullamcorper a nunc ac porta. Aliquam ut aliquet lacus, quis faucibus libero. Quisque non semper leo.</p>
</div>
</div>
</article>
</div>
</div>
<div class="tile is-ancestor">
<div class="tile is-parent">
<article class="tile is-child box">
<p class="title">Twelve</p>
<p class="subtitle">Subtitle</p>
<div class="content">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin ornare magna eros, eu pellentesque tortor vestibulum ut.</p>
</div>
</article>
</div>
<div class="tile is-parent is-6">
<article class="tile is-child box">
<p class="title">Thirteen</p>
<p class="subtitle">Subtitle</p>
<div class="content">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin ornare magna eros, eu pellentesque tortor vestibulum ut. Maecenas non massa sem. Etiam finibus odio quis feugiat facilisis.</p>
</div>
</article>
</div>
<div class="tile is-parent">
<article class="tile is-child box">
<p class="title">Fourteen</p>
<p class="subtitle">Subtitle</p>
<div class="content">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin ornare magna eros, eu pellentesque tortor vestibulum ut.</p>
</div>
</article>
</div>
</div>
{% endhighlight %}
</div>
</section>
|
{
"content_hash": "abd08ef12cf0aec1a0062076172134f1",
"timestamp": "",
"source": "github",
"line_count": 890,
"max_line_length": 399,
"avg_line_length": 41.630337078651685,
"alnum_prop": 0.5998758468057542,
"repo_name": "cwonrails/bulma",
"id": "3a295c919db6f4e5bac56677ab077ff7580525ff",
"size": "37159",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "docs/documentation/layout/tiles.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "328815"
},
{
"name": "Shell",
"bytes": "1252"
}
]
}
|
import unittest
import numpy as np
import paddle
from paddle.distributed.fleet.utils import recompute
import random
from paddle.incubate.distributed.fleet import recompute_sequential
def get_fc_block(block_idx, input_size, is_last=False):
block_name = "block_" + str(block_idx)
block = paddle.nn.Sequential(
(
block_name + "_fc_0",
paddle.nn.Linear(input_size, input_size, bias_attr=False),
),
(block_name + "_dropout", paddle.nn.Dropout(p=0.5)),
(block_name + "_relu_1", paddle.nn.ReLU()),
(
block_name + "_fc_1",
paddle.nn.Linear(input_size, input_size, bias_attr=False),
),
(block_name + "_relu_2", paddle.nn.ReLU()),
)
if is_last:
block.add_sublayer(
block_name + "_fc_2",
paddle.nn.Linear(input_size, 1, bias_attr=False),
) # add sublayer
else:
block.add_sublayer(
block_name + "_fc_2",
paddle.nn.Linear(input_size, input_size, bias_attr=False),
) # add sublayer
return block
class Naive_fc_net(paddle.nn.Layer):
def __init__(
self,
input_size=10,
recompute_blocks=[1, 3],
use_fleet_sq=False,
segments=1,
use_raw_recompute=False,
recompute_kwargs={},
):
super().__init__()
self.recompute_blocks = recompute_blocks
self.recompute_kwargs = recompute_kwargs
self.use_fleet_sq = use_fleet_sq
self.use_raw_recompute = use_raw_recompute
self.segments = segments
self.runfunc0 = get_fc_block(0, input_size, is_last=False)
self.runfunc1 = get_fc_block(1, input_size, is_last=False)
self.runfunc2 = get_fc_block(2, input_size, is_last=False)
self.runfunc3 = get_fc_block(3, input_size, is_last=False)
self.runfunc4 = get_fc_block(4, input_size, is_last=True)
if self.use_fleet_sq and not use_raw_recompute:
self.runfuncs = paddle.nn.Sequential(
self.runfunc0,
self.runfunc1,
self.runfunc2,
self.runfunc3,
self.runfunc4,
)
self.layers = [
self.runfunc0,
self.runfunc1,
self.runfunc2,
self.runfunc3,
self.runfunc4,
]
# default segments = 2
if use_raw_recompute:
self.layers = [
paddle.nn.Sequential(self.runfunc0, self.runfunc1),
paddle.nn.Sequential(
self.runfunc2, self.runfunc3, self.runfunc4
),
]
def forward(self, inputs):
if self.use_fleet_sq and not self.use_raw_recompute:
return recompute_sequential(
{"segments": self.segments}, self.runfuncs, inputs
)
if self.use_raw_recompute:
inputs = recompute(self.layers[0], inputs)
return self.layers[1](inputs)
for i in range(len(self.layers)):
if i in self.recompute_blocks:
inputs = recompute(
self.layers[i], inputs, **self.recompute_kwargs
)
else:
inputs = self.layers[i](inputs)
return inputs
def run_model(
recompute_block=[],
recompute_kwargs={},
use_fleet_sq=False,
use_raw_recompute=False,
segments=1,
enable_autocast=False,
pure_fp16=False,
):
gen = paddle.seed(10)
gen.manual_seed(10)
np.random.seed(10)
random.seed(10)
batch_size, input_size = 1, 10
model = Naive_fc_net(
input_size,
recompute_blocks=recompute_block,
use_fleet_sq=use_fleet_sq,
use_raw_recompute=use_raw_recompute,
segments=segments,
recompute_kwargs=recompute_kwargs,
)
loss_fn = paddle.nn.MSELoss(reduction='mean')
optimizer = paddle.optimizer.SGD(
learning_rate=0.01, parameters=model.parameters()
)
if enable_autocast:
scaler = paddle.amp.GradScaler()
loss_ = []
param_ = []
grad_ = []
for step in range(10):
x_data = np.random.randn(batch_size, input_size).astype(np.float32)
x = paddle.to_tensor(x_data)
# x.stop_gradient = False
level = 'O2' if pure_fp16 else 'O1'
with paddle.amp.auto_cast(True, level=level):
y_pred = model(x)
loss = y_pred.mean()
if enable_autocast:
scaler.scale(loss).backward()
scaler.minimize(optimizer, loss)
else:
loss_.append(np.asarray(loss).tolist())
loss.backward()
optimizer.step()
param_.append(np.asarray(model.parameters()[9]).tolist())
grad_.append(np.asarray(model.parameters()[3]._grad_ivar()).tolist())
optimizer.clear_grad()
return loss_, param_, grad_
class TestPyLayer(unittest.TestCase):
def test_base_case(self, enable_autocast=False, pure_fp16=False):
def check_identical(loss_ref, param_ref, grad_ref, loss, param, grad):
self.assertEqual(loss_ref, loss)
self.assertEqual(param_ref, param)
self.assertEqual(grad_ref, grad)
# without recompute
loss_ref, param_ref, grad_ref = run_model(
recompute_block=[],
enable_autocast=enable_autocast,
pure_fp16=pure_fp16,
)
# recompute second block
loss, param, grad = run_model(
recompute_block=[1],
enable_autocast=enable_autocast,
pure_fp16=pure_fp16,
)
check_identical(loss_ref, param_ref, grad_ref, loss, param, grad)
# recompute fourth block
loss, param, grad = run_model(
recompute_block=[3],
enable_autocast=enable_autocast,
pure_fp16=pure_fp16,
)
check_identical(loss_ref, param_ref, grad_ref, loss, param, grad)
# recompute second to fourth block
loss, param, grad = run_model(
recompute_block=[1, 2, 3],
enable_autocast=enable_autocast,
pure_fp16=pure_fp16,
)
check_identical(loss_ref, param_ref, grad_ref, loss, param, grad)
# recompute second & fourth block
loss, param, grad = run_model(
recompute_block=[1, 3],
enable_autocast=enable_autocast,
pure_fp16=pure_fp16,
)
check_identical(loss_ref, param_ref, grad_ref, loss, param, grad)
# recompute second & fourth block using fleet
loss, param, grad = run_model(
recompute_block=[1, 3],
enable_autocast=enable_autocast,
pure_fp16=pure_fp16,
)
check_identical(loss_ref, param_ref, grad_ref, loss, param, grad)
# recompute using recompute_sequential, segments=1
loss, param, grad = run_model(
recompute_block=[],
use_fleet_sq=True,
enable_autocast=enable_autocast,
pure_fp16=pure_fp16,
)
check_identical(loss_ref, param_ref, grad_ref, loss, param, grad)
# with base recompute, and segments=2
loss_ref, param_ref, grad_ref = run_model(
recompute_block=[],
enable_autocast=enable_autocast,
use_raw_recompute=True,
pure_fp16=pure_fp16,
)
# recompute using recompute_sequential, segments=2
loss, param, grad = run_model(
recompute_block=[],
use_fleet_sq=True,
segments=2,
enable_autocast=enable_autocast,
pure_fp16=pure_fp16,
)
check_identical(loss_ref, param_ref, grad_ref, loss, param, grad)
def test_fc_net_with_dropout(self):
self.test_base_case()
def test_fc_net_with_amp(self):
self.test_base_case(enable_autocast=True)
def test_fc_net_with_fp16(self):
self.test_base_case(enable_autocast=True, pure_fp16=True)
def test_recompute_kwargs(self):
paddle.set_device("gpu")
kwargs = {"is_test": False}
with self.assertRaises(TypeError):
loss_ref, param_ref, grad_ref = run_model(
recompute_block=[2], recompute_kwargs=kwargs
)
def test_recompute_cpu_rng(self):
paddle.set_device("cpu")
with self.assertRaises(RuntimeError):
loss_ref, param_ref, grad_ref = run_model(recompute_block=[2])
if __name__ == '__main__':
unittest.main()
|
{
"content_hash": "b7f85092780b21e4cd77227b139ce5c6",
"timestamp": "",
"source": "github",
"line_count": 272,
"max_line_length": 78,
"avg_line_length": 31.408088235294116,
"alnum_prop": 0.5636193374692731,
"repo_name": "luotao1/Paddle",
"id": "a1751fb00aa2f52182a0553c5680e0f11b1c2a15",
"size": "9154",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "python/paddle/fluid/tests/unittests/collective/fleet/test_dygraph_recompute.py",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "58544"
},
{
"name": "C",
"bytes": "210300"
},
{
"name": "C++",
"bytes": "36771446"
},
{
"name": "CMake",
"bytes": "903079"
},
{
"name": "Cuda",
"bytes": "5200715"
},
{
"name": "Dockerfile",
"bytes": "4361"
},
{
"name": "Go",
"bytes": "49796"
},
{
"name": "Java",
"bytes": "16630"
},
{
"name": "Jinja",
"bytes": "23852"
},
{
"name": "MLIR",
"bytes": "39982"
},
{
"name": "Python",
"bytes": "36248258"
},
{
"name": "R",
"bytes": "1332"
},
{
"name": "Shell",
"bytes": "553175"
}
]
}
|
package org.lzim.model.service.Scatter;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.lzim.model.service.model.GuassPlumeModelService;
import org.lzim.model.utils.GaussAGeo;
import org.lzim.model.utils.ReadFile;
import java.math.BigDecimal;
import java.util.HashMap;
import static org.lzim.model.utils.Ppm24MgM3.ppm2mgm3;
/**
* Created by ManD on 2015/5/20.
* org.lzim.model.service of Model
*/
public class GuassPlumeScatterService {
private static Logger logger = LogManager.getLogger(GuassPlumeScatterService.class.getName());
private GuassPlumeModelService model = new GuassPlumeModelService();
// ten json file
private String strFile[] = {"gov.json", "dwelling.json", "scenic.json", "com.json", "market.json",
"country.json", "town.json", "leisure.json", "school.json", "medical.json"};
public JSONArray index(double longi, double lati, double u, double direct, double Q, int rank, int elmtype,
double dia, double H, double us, int type, double T) {
try {
model.setQ(Q);
if (elmtype < 0 || elmtype > 9) throw new Exception("elmType error");
if (type < 0 || type > 5) throw new Exception("type error");
return calc(longi, lati, u, direct, rank, elmtype, dia, H, us, type, T);
} catch (Exception e) {
logger.error("GuassPlumeScatter error\t" + e.getMessage());
JSONArray err = new JSONArray();
HashMap<String, String> elm = new HashMap<String, String>();
elm.put("error", "param");
err.add(elm);
return err;
}
}
public JSONArray calc(double x0, double y0, double u, double dir, int rank, int elmType,
double dia, double H, double us, int type, double T) {
// t1 : start time
long t1 = System.currentTimeMillis();
// load json files
String strFullFile = strFile[elmType];
// Dangerous limit
double[] dan = ppm2mgm3(type, T);
// type
String JsonContext = ReadFile.ReadJsonFile(strFullFile);
JSONArray jsonArray = JSONArray.parseArray(JsonContext);
int size = jsonArray.size();
double dat[] = new double[size];
double loc[];
JSONArray newJsonArr = new JSONArray();
// calc
for (int i = 0; i < size; i++) {
JSONObject jsonObject = jsonArray.getJSONObject(i);
JSONObject attr = jsonObject.getJSONObject("attributes");
JSONObject geo = jsonObject.getJSONObject("geometry");
// get double
BigDecimal x = (BigDecimal) geo.get("x");
double xx = x.doubleValue();
BigDecimal y = (BigDecimal) geo.get("y");
double yy = y.doubleValue();
//
loc = GaussAGeo.Gauss4Geo(x0, y0, xx, yy, dir);
// model calc
// set He
model.setHe(H, us, dia, u);
// model data calc
dat[i] = model.C(loc[0], loc[1], 2, u, rank);
attr.put("PolutionC", dat[i]);
double temC = 0;
if (dat[i] < dan[0])
temC = 0;
else if (dat[i] < dan[1])
temC = 1;
else if (dat[i] < dan[2])
temC = 2;
else
temC = 3;
attr.put("rank", temC);
if (dat[i] != 0.0) {
newJsonArr.add(jsonObject);
}
}
// t2 : end time
long t2 = System.currentTimeMillis();
System.out.println("GuassPlumeScatter\t" + (t2 - t1) + "ms");
// render
return (newJsonArr);
}
}
|
{
"content_hash": "53664e4b872de09d820fbc8683648a86",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 111,
"avg_line_length": 37.54455445544554,
"alnum_prop": 0.5659282700421941,
"repo_name": "LZQStd/ArcGis-Final",
"id": "7290d142790d49c1923e2e0385c6cbd287c954e1",
"size": "3792",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/org/lzim/model/service/Scatter/GuassPlumeScatterService.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "5003"
},
{
"name": "HTML",
"bytes": "40703"
},
{
"name": "Java",
"bytes": "64702"
},
{
"name": "JavaScript",
"bytes": "5853584"
}
]
}
|
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/**
* CmsMetadataKeyPage.java
*
* This file was auto-generated from WSDL
* by the Apache Axis 1.4 Mar 02, 2009 (07:08:06 PST) WSDL2Java emitter.
*/
package com.google.api.ads.admanager.axis.v202208;
/**
* Captures a page of CMS metadata key objects.
*/
public class CmsMetadataKeyPage implements java.io.Serializable , Iterable<com.google.api.ads.admanager.axis.v202208.CmsMetadataKey>{
private java.lang.Integer totalResultSetSize;
private java.lang.Integer startIndex;
private com.google.api.ads.admanager.axis.v202208.CmsMetadataKey[] results;
public CmsMetadataKeyPage() {
}
public CmsMetadataKeyPage(
java.lang.Integer totalResultSetSize,
java.lang.Integer startIndex,
com.google.api.ads.admanager.axis.v202208.CmsMetadataKey[] results) {
this.totalResultSetSize = totalResultSetSize;
this.startIndex = startIndex;
this.results = results;
}
@Override
public String toString() {
return com.google.common.base.MoreObjects.toStringHelper(this.getClass())
.omitNullValues()
// Only include length of results to avoid overly verbose output
.add("results.length", getResults() == null ? 0 : getResults().length)
.add("startIndex", getStartIndex())
.add("totalResultSetSize", getTotalResultSetSize())
.toString();
}
/**
* Gets the totalResultSetSize value for this CmsMetadataKeyPage.
*
* @return totalResultSetSize
*/
public java.lang.Integer getTotalResultSetSize() {
return totalResultSetSize;
}
/**
* Sets the totalResultSetSize value for this CmsMetadataKeyPage.
*
* @param totalResultSetSize
*/
public void setTotalResultSetSize(java.lang.Integer totalResultSetSize) {
this.totalResultSetSize = totalResultSetSize;
}
/**
* Gets the startIndex value for this CmsMetadataKeyPage.
*
* @return startIndex
*/
public java.lang.Integer getStartIndex() {
return startIndex;
}
/**
* Sets the startIndex value for this CmsMetadataKeyPage.
*
* @param startIndex
*/
public void setStartIndex(java.lang.Integer startIndex) {
this.startIndex = startIndex;
}
/**
* Gets the results value for this CmsMetadataKeyPage.
*
* @return results
*/
public com.google.api.ads.admanager.axis.v202208.CmsMetadataKey[] getResults() {
return results;
}
/**
* Sets the results value for this CmsMetadataKeyPage.
*
* @param results
*/
public void setResults(com.google.api.ads.admanager.axis.v202208.CmsMetadataKey[] results) {
this.results = results;
}
public com.google.api.ads.admanager.axis.v202208.CmsMetadataKey getResults(int i) {
return this.results[i];
}
public void setResults(int i, com.google.api.ads.admanager.axis.v202208.CmsMetadataKey _value) {
this.results[i] = _value;
}
/**
* Returns an iterator over this page's {@code results} that:
* <ul>
* <li>Will not be {@code null}.</li>
* <li>Will not support {@link java.util.Iterator#remove()}.</li>
* </ul>
*
* @return a non-null iterator.
*/
@Override
public java.util.Iterator<com.google.api.ads.admanager.axis.v202208.CmsMetadataKey> iterator() {
if (results == null) {
return java.util.Collections.<com.google.api.ads.admanager.axis.v202208.CmsMetadataKey>emptyIterator();
}
return java.util.Arrays.<com.google.api.ads.admanager.axis.v202208.CmsMetadataKey>asList(results).iterator();
}
private java.lang.Object __equalsCalc = null;
public synchronized boolean equals(java.lang.Object obj) {
if (!(obj instanceof CmsMetadataKeyPage)) return false;
CmsMetadataKeyPage other = (CmsMetadataKeyPage) obj;
if (obj == null) return false;
if (this == obj) return true;
if (__equalsCalc != null) {
return (__equalsCalc == obj);
}
__equalsCalc = obj;
boolean _equals;
_equals = true &&
((this.totalResultSetSize==null && other.getTotalResultSetSize()==null) ||
(this.totalResultSetSize!=null &&
this.totalResultSetSize.equals(other.getTotalResultSetSize()))) &&
((this.startIndex==null && other.getStartIndex()==null) ||
(this.startIndex!=null &&
this.startIndex.equals(other.getStartIndex()))) &&
((this.results==null && other.getResults()==null) ||
(this.results!=null &&
java.util.Arrays.equals(this.results, other.getResults())));
__equalsCalc = null;
return _equals;
}
private boolean __hashCodeCalc = false;
public synchronized int hashCode() {
if (__hashCodeCalc) {
return 0;
}
__hashCodeCalc = true;
int _hashCode = 1;
if (getTotalResultSetSize() != null) {
_hashCode += getTotalResultSetSize().hashCode();
}
if (getStartIndex() != null) {
_hashCode += getStartIndex().hashCode();
}
if (getResults() != null) {
for (int i=0;
i<java.lang.reflect.Array.getLength(getResults());
i++) {
java.lang.Object obj = java.lang.reflect.Array.get(getResults(), i);
if (obj != null &&
!obj.getClass().isArray()) {
_hashCode += obj.hashCode();
}
}
}
__hashCodeCalc = false;
return _hashCode;
}
// Type metadata
private static org.apache.axis.description.TypeDesc typeDesc =
new org.apache.axis.description.TypeDesc(CmsMetadataKeyPage.class, true);
static {
typeDesc.setXmlType(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "CmsMetadataKeyPage"));
org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("totalResultSetSize");
elemField.setXmlName(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "totalResultSetSize"));
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("startIndex");
elemField.setXmlName(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "startIndex"));
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("results");
elemField.setXmlName(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "results"));
elemField.setXmlType(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202208", "CmsMetadataKey"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
elemField.setMaxOccursUnbounded(true);
typeDesc.addFieldDesc(elemField);
}
/**
* Return type metadata object
*/
public static org.apache.axis.description.TypeDesc getTypeDesc() {
return typeDesc;
}
/**
* Get Custom Serializer
*/
public static org.apache.axis.encoding.Serializer getSerializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.BeanSerializer(
_javaType, _xmlType, typeDesc);
}
/**
* Get Custom Deserializer
*/
public static org.apache.axis.encoding.Deserializer getDeserializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.BeanDeserializer(
_javaType, _xmlType, typeDesc);
}
}
|
{
"content_hash": "208142ae50574aa272d014d3a3c70e75",
"timestamp": "",
"source": "github",
"line_count": 256,
"max_line_length": 135,
"avg_line_length": 35.34375,
"alnum_prop": 0.6331786030061892,
"repo_name": "googleads/googleads-java-lib",
"id": "5ea103a9924fb9303e9a9288d34f73056455ae58",
"size": "9048",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "modules/dfp_axis/src/main/java/com/google/api/ads/admanager/axis/v202208/CmsMetadataKeyPage.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "81068791"
}
]
}
|
<!-- JS -->
<script src="{{ site.url }}/assets/js/jquery-1.12.0.min.js"></script>
<script src="{{ site.url }}/assets/js/jquery.dlmenu.min.js"></script>
<script src="{{ site.url }}/assets/js/jquery.goup.min.js"></script>
<script src="{{ site.url }}/assets/js/jquery.magnific-popup.min.js"></script>
<script src="{{ site.url }}/assets/js/jquery.fitvid.min.js"></script>
<script src="{{ site.url }}/assets/js/scripts.js"></script>
{% if site.google_analytics %}
<!-- Asynchronous Google Analytics snippet -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', '{{ site.google_analytics }}', 'auto');
ga('send', 'pageview');
</script>
{% endif %}
{% if page.comments != false %}
{% include disqus_comments.html %}
{% endif %}
|
{
"content_hash": "2828e751ad69e204bc278f10b0f6dc5e",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 83,
"avg_line_length": 47,
"alnum_prop": 0.6114708603145236,
"repo_name": "Harmonicorps/Harmonicorps.github.io",
"id": "1460aac29c9c223b5f54595d14df33c7273eb668",
"size": "1081",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "_includes/scripts.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "29971"
},
{
"name": "HTML",
"bytes": "27017"
},
{
"name": "JavaScript",
"bytes": "1777"
},
{
"name": "Ruby",
"bytes": "163"
}
]
}
|
import { EventEmitter, ElementRef, SimpleChanges, OnChanges } from '@angular/core';
export declare class PieArcComponent implements OnChanges {
fill: any;
startAngle: number;
endAngle: number;
innerRadius: any;
outerRadius: any;
cornerRadius: number;
value: any;
max: any;
data: any;
explodeSlices: boolean;
gradient: boolean;
animate: boolean;
pointerEvents: boolean;
isActive: boolean;
select: EventEmitter<{}>;
activate: EventEmitter<{}>;
deactivate: EventEmitter<{}>;
dblclick: EventEmitter<{}>;
element: HTMLElement;
path: any;
startOpacity: number;
radialGradientId: string;
linearGradientId: string;
gradientFill: string;
initialized: boolean;
private _timeout;
constructor(element: ElementRef);
ngOnChanges(changes: SimpleChanges): void;
getGradient(): any;
getPointerEvents(): "auto" | "none";
update(): void;
calculateArc(): any;
loadAnimation(): void;
updateAnimation(): void;
onClick(): void;
onDblClick(event: MouseEvent): void;
}
|
{
"content_hash": "cc426197b9444a9aa357dd20653746fb",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 83,
"avg_line_length": 28.897435897435898,
"alnum_prop": 0.642413487133984,
"repo_name": "friendsofagape/mt2414ui",
"id": "18b8b9087cdae14c809a25c2eb1a17075d638c36",
"size": "1127",
"binary": false,
"copies": "1",
"ref": "refs/heads/AMTv2",
"path": "node_modules/@swimlane/ngx-charts/release/pie-chart/pie-arc.component.d.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "10242"
},
{
"name": "HTML",
"bytes": "142509"
},
{
"name": "JavaScript",
"bytes": "2159"
},
{
"name": "TypeScript",
"bytes": "331761"
}
]
}
|
package ca.concordia.cssanalyser.migration.topreprocessors;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import ca.concordia.cssanalyser.cssmodel.StyleSheet;
import ca.concordia.cssanalyser.parser.CSSParserFactory;
import ca.concordia.cssanalyser.parser.CSSParserFactory.CSSParserType;
import ca.concordia.cssanalyser.parser.ParseException;
public class PreprocessorHelper {
public static StyleSheet runProcessToCompilePreprocessorCode(String[] command) throws ParseException {
Runtime runtime = Runtime.getRuntime();
try {
Process process = runtime.exec(command);
BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
StringBuilder builder = new StringBuilder();
String line;
while ((line = reader.readLine()) != null) {
builder.append(line);
}
process.waitFor(); // wait for process to complete
StyleSheet resultingStyleSheet = CSSParserFactory.getCSSParser(CSSParserType.LESS).parseCSSString(builder.toString());
return resultingStyleSheet;
} catch(IOException | InterruptedException ex) {
ex.printStackTrace();
}
return null;
}
}
|
{
"content_hash": "6e0de16bfe094609be087dae915213fd",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 121,
"avg_line_length": 32.666666666666664,
"alnum_prop": 0.7840136054421769,
"repo_name": "dmazinanian/css-analyser",
"id": "fa82057f29cf3bcc90d01851a4fd09d2192ee5df",
"size": "1176",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/ca/concordia/cssanalyser/migration/topreprocessors/PreprocessorHelper.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "2144"
},
{
"name": "Java",
"bytes": "1170988"
}
]
}
|
import json
import os
from jsonschema import validate
from infra_buddy.deploy.ecs_deploy import ECSDeploy
from infra_buddy.deploy.s3_deploy import S3Deploy
from infra_buddy.utility import print_utility
_ARTIFACT_FILE = "artifact.json"
_CONTAINER_ARTIFACT_TYPE = "container"
_S3_ARTIFACT_TYPE = "s3"
_NOOP_ARTIFACT_TYPE = "noop"
_ARTIFACT_TYPE = "artifact-type"
_ARTIFACT_IDENTIFIER = "artifact-identifier"
_ARTIFACT_LOCATION = "artifact-path"
class ArtifactDefinition(object):
schema = {
"type": "object",
"properties": {
_ARTIFACT_TYPE: {"type": "string", "enum": [_CONTAINER_ARTIFACT_TYPE, _S3_ARTIFACT_TYPE]},
_ARTIFACT_IDENTIFIER: {"type": "string"},
_ARTIFACT_LOCATION: {"type": "string"}
},
"required": [
_ARTIFACT_TYPE,
_ARTIFACT_IDENTIFIER,
_ARTIFACT_LOCATION
]
}
@classmethod
def create(cls, artifact_type=None, artifact_location=None, artifact_identifier=None):
# type: (str, str, str) -> ArtifactDefinition
if artifact_type == _CONTAINER_ARTIFACT_TYPE:
return ECSArtifactDefinition(artifact_location=artifact_location,
artifact_identifier=artifact_identifier)
elif artifact_type == _S3_ARTIFACT_TYPE:
return S3ArtifactDefinition(artifact_location=artifact_location,
artifact_identifier=artifact_identifier)
elif artifact_type:
raise Exception("Unknown artifact type")
else:
return NOOPArtifactDefinition(None, None)
@classmethod
def create_from_directory(cls, artifact_directory):
# type: (str) -> ArtifactDefinition
definition = ArtifactDefinition._load_artifact_definition(artifact_directory)
if not definition:
definition = ArtifactDefinition._search_for_legacy_implementation(artifact_directory)
if definition:
validate(definition, ArtifactDefinition.schema)
return cls.create(definition[_ARTIFACT_TYPE], definition[_ARTIFACT_LOCATION],
definition[_ARTIFACT_IDENTIFIER])
else:
return cls.create()
def __init__(self, artifact_type, artifact_location, artifact_identifier):
super(ArtifactDefinition, self).__init__()
self.artifact_type = artifact_type
self.artifact_location = artifact_location
self.artifact_id = artifact_identifier
@staticmethod
def _search_for_legacy_implementation(artifact_directory):
image_definition = os.path.join(artifact_directory, "containerurl.txt")
ret = {_ARTIFACT_TYPE: _CONTAINER_ARTIFACT_TYPE}
if os.path.exists(image_definition):
print_utility.warn("Defining ECS service udpate with deprecated containerurl.txt artifact")
with open(image_definition, 'r') as image:
image_def = image.read().strip()
rfind = image_def.rfind(":")
ret[_ARTIFACT_LOCATION] = image_def[:rfind]
ret[_ARTIFACT_IDENTIFIER] = image_def[rfind + 1:]
return ret
return None
@staticmethod
def _load_artifact_definition(artifact_directory):
artifact_def_path = os.path.join(artifact_directory, _ARTIFACT_FILE)
if os.path.exists(artifact_def_path):
print_utility.info("Defining artifact definition with artifact.json - {}".format(artifact_def_path))
with open(artifact_def_path, 'r') as art_def:
return json.load(art_def)
else:
print_utility.warn("Artifact definition (artifact.json) did not exist in artifact directory."
" Continuing infrastructure update without artifact deploy.")
return None
def generate_execution_plan(self, deploy_ctx):
raise Exception("Well, this is unexpected")
def save_to_file(self, destination_dir=None):
if destination_dir:
path = os.path.join(destination_dir, _ARTIFACT_FILE)
else:
path = _ARTIFACT_FILE
print_utility.info("Persisting artifact manfiest - {}".format(path))
with open(path, 'w') as file:
json.dump({_ARTIFACT_TYPE: self.artifact_type,
_ARTIFACT_LOCATION: self.artifact_location,
_ARTIFACT_IDENTIFIER: self.artifact_id}, file)
return path
def register_env_variables(self, deploy_ctx):
if self.artifact_type == _CONTAINER_ARTIFACT_TYPE:
# For first time deploys of ECS services
deploy_ctx['IMAGE'] = "{location}:{tag}".format(location=self.artifact_location, tag=self.artifact_id)
class ECSArtifactDefinition(ArtifactDefinition):
def __init__(self, artifact_location, artifact_identifier):
super(ECSArtifactDefinition, self).__init__(_CONTAINER_ARTIFACT_TYPE, artifact_location, artifact_identifier)
def generate_execution_plan(self, deploy_ctx):
return [ECSDeploy(self.artifact_id, self.artifact_location, deploy_ctx)]
class S3ArtifactDefinition(ArtifactDefinition):
def __init__(self, artifact_location, artifact_identifier):
super(S3ArtifactDefinition, self).__init__(_S3_ARTIFACT_TYPE, artifact_location, artifact_identifier)
def generate_execution_plan(self, deploy_ctx):
return [S3Deploy(self.artifact_id, self.artifact_location, deploy_ctx)]
class NOOPArtifactDefinition(ArtifactDefinition):
def __init__(self, artifact_location, artifact_identifier):
super(NOOPArtifactDefinition, self).__init__(_NOOP_ARTIFACT_TYPE, artifact_location, artifact_identifier)
def generate_execution_plan(self, deploy_ctx):
return None
|
{
"content_hash": "ef170b8c4babf5b0200b790f3cfa9f52",
"timestamp": "",
"source": "github",
"line_count": 137,
"max_line_length": 117,
"avg_line_length": 42.14598540145985,
"alnum_prop": 0.6491167301697264,
"repo_name": "AlienVault-Engineering/infra-buddy",
"id": "4dc2e669ef3d793aaa5b75140ef0ac2096d7addf",
"size": "5774",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/python/infra_buddy/context/artifact_definition.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Python",
"bytes": "179549"
}
]
}
|
/*************************************************************************/
/* audio_driver_dummy.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef AUDIO_DRIVER_DUMMY_H
#define AUDIO_DRIVER_DUMMY_H
#include "core/os/mutex.h"
#include "core/os/thread.h"
#include "servers/audio_server.h"
class AudioDriverDummy : public AudioDriver {
public:
const char *get_name() const {
return "Dummy";
};
virtual Error init() { return OK; }
virtual void start(){};
virtual int get_mix_rate() const { return DEFAULT_MIX_RATE; };
virtual SpeakerMode get_speaker_mode() const { return SPEAKER_MODE_STEREO; };
virtual void lock(){};
virtual void unlock(){};
virtual void finish(){};
virtual float get_latency() { return 0; };
AudioDriverDummy(){};
~AudioDriverDummy(){};
};
#endif // AUDIO_DRIVER_DUMMY_H
|
{
"content_hash": "6e53b6c22babc466f41d58ffe03a32d5",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 78,
"avg_line_length": 49.51724137931034,
"alnum_prop": 0.5038300835654597,
"repo_name": "groud/godot",
"id": "4f4d7f9bc47bec1426d04c2387a05a1b771550b4",
"size": "2872",
"binary": false,
"copies": "7",
"ref": "refs/heads/master",
"path": "drivers/dummy/audio_driver_dummy.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "294170"
},
{
"name": "C++",
"bytes": "22531001"
},
{
"name": "Java",
"bytes": "438099"
},
{
"name": "JavaScript",
"bytes": "18828"
},
{
"name": "Makefile",
"bytes": "451"
},
{
"name": "Objective-C",
"bytes": "2645"
},
{
"name": "Objective-C++",
"bytes": "191797"
},
{
"name": "Python",
"bytes": "354482"
},
{
"name": "Shell",
"bytes": "27053"
}
]
}
|
End of preview.