file_name large_stringlengths 4 140 | prefix large_stringlengths 0 39k | suffix large_stringlengths 0 36.1k | middle large_stringlengths 0 29.4k | fim_type large_stringclasses 4
values |
|---|---|---|---|---|
editalgorithmcategory.component.ts | import { Component } from "@angular/core";
import {Router, ActivatedRoute} from "@angular/router";
import {Response} from "@angular/http";
import {SecureComponent} from "../../../../services/secure.component";
import {APIService} from "../../../../services/api.service";
@Component({
selector: 'editalgorithmcategory'... | } | } | random_line_split |
editalgorithmcategory.component.ts | import { Component } from "@angular/core";
import {Router, ActivatedRoute} from "@angular/router";
import {Response} from "@angular/http";
import {SecureComponent} from "../../../../services/secure.component";
import {APIService} from "../../../../services/api.service";
@Component({
selector: 'editalgorithmcategory'... | extends SecureComponent {
private category: any;
private id: number;
constructor(router:Router, protected client: APIService, private route: ActivatedRoute){
super(router, client);
this.authorities = ["ROLE_ADMIN"];
}
ngOnInit():void{
super.ngOnInit();
this.route.params.subscribe(params =>... | EditAlgorithmCategoryComponent | identifier_name |
views.py | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 ... | # per-layer links
# for link in Link.objects.filter(link_type__in=LINK_TYPES): # .distinct('url'):
# data.append({'url': link.url, 'type': link.link_type})
data.append({'url': ows._wcs_get_capabilities(), 'type': 'OGC:WCS'})
data.append({'url': ows._wfs_get_capabilities(), '... |
def get(self, request):
out = {'success': True}
data = []
out['data'] = data | random_line_split |
views.py | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 ... |
# main site url
data.append({'url': settings.SITEURL, 'type': 'WWW:LINK'})
return json_response(out)
ows_endpoints = OWSListView.as_view()
| data.append({'url': catconf['URL'], 'type': 'OGC:CSW'}) | conditional_block |
views.py | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 ... | (self, request):
out = {'success': True}
data = []
out['data'] = data
# per-layer links
# for link in Link.objects.filter(link_type__in=LINK_TYPES): # .distinct('url'):
# data.append({'url': link.url, 'type': link.link_type})
data.append({'url': ows._wcs_get_... | get | identifier_name |
views.py | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 ... |
ows_endpoints = OWSListView.as_view()
| out = {'success': True}
data = []
out['data'] = data
# per-layer links
# for link in Link.objects.filter(link_type__in=LINK_TYPES): # .distinct('url'):
# data.append({'url': link.url, 'type': link.link_type})
data.append({'url': ows._wcs_get_capabilities(), 'type': '... | identifier_body |
WidgetLayout.compat.styles.ts | /**
* @author Adam Charron <adam.c@vanillaforums.com>
* @copyright 2009-2021 Vanilla Forums Inc.
* @license gpl-2.0-only
*/
import { injectGlobal } from "@emotion/css";
import { twoColumnClasses } from "@library/layout/types/layout.twoColumns";
import { EMPTY_WIDGET_SECTION } from "@library/layout/WidgetLayout.con... | () {
const classes = widgetLayoutClasses();
const panelLayoutClasses = twoColumnClasses();
const mainBodySelectors = `
.Content .${EMPTY_WIDGET_SECTION.widgetClass},
.Content .DataList,
.Content .Empty,
.Content .DataTable,
.Content .DataListWrap,
.Trace,
... | widgetLayoutCompactCSS | identifier_name |
WidgetLayout.compat.styles.ts | /**
* @author Adam Charron <adam.c@vanillaforums.com>
* @copyright 2009-2021 Vanilla Forums Inc.
* @license gpl-2.0-only
*/
import { injectGlobal } from "@emotion/css";
import { twoColumnClasses } from "@library/layout/types/layout.twoColumns";
import { EMPTY_WIDGET_SECTION } from "@library/layout/WidgetLayout.con... | {
const classes = widgetLayoutClasses();
const panelLayoutClasses = twoColumnClasses();
const mainBodySelectors = `
.Content .${EMPTY_WIDGET_SECTION.widgetClass},
.Content .DataList,
.Content .Empty,
.Content .DataTable,
.Content .DataListWrap,
.Trace,
... | identifier_body | |
WidgetLayout.compat.styles.ts | /**
* @author Adam Charron <adam.c@vanillaforums.com>
* @copyright 2009-2021 Vanilla Forums Inc.
* @license gpl-2.0-only
*/
import { injectGlobal } from "@emotion/css";
import { twoColumnClasses } from "@library/layout/types/layout.twoColumns";
import { EMPTY_WIDGET_SECTION } from "@library/layout/WidgetLayout.con... |
[`.Panel .${EMPTY_WIDGET_SECTION.widgetClass}, .Panel .Box`]: panelLayoutClasses.secondaryPanelWidgetMixin,
[`.Panel .BoxButtons`]: {
...Mixins.margin({
bottom: globalVariables().spacer.panelComponent * 1.5,
}),
},
[`.Frame-row .${EMPTY_WIDGET_SEC... | .Content h2 + .Empty,
.Content h2 + .DataTable`]: {
marginTop: 0,
}, | random_line_split |
0001_initial.py | # Generated by Django 2.2.6 on 2019-10-31 08:31
from django.db import migrations, models
import multiselectfield.db.fields
class Migration(migrations.Migration):
| initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Book',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(max_length=200)),
... | identifier_body | |
0001_initial.py | # Generated by Django 2.2.6 on 2019-10-31 08:31
from django.db import migrations, models
import multiselectfield.db.fields
class Migration(migrations.Migration):
initial = True
dependencies = [ | fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(max_length=200)),
('categories', multiselectfield.db.fields.MultiSelectField(choices=[(1, 'Handbooks and manuals by disciplin... | ]
operations = [
migrations.CreateModel(
name='Book', | random_line_split |
0001_initial.py | # Generated by Django 2.2.6 on 2019-10-31 08:31
from django.db import migrations, models
import multiselectfield.db.fields
class | (migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Book',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.Ch... | Migration | identifier_name |
typehead.js | /* =============================================================
* bootstrap-typeahead.js v2.3.2
* http://getbootstrap.com/2.3.2/javascript.html#typeahead
* =============================================================
* Copyright 2013 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License... | return item
}
, show: function () {
var pos = $.extend({}, this.$element.position(), {
height: this.$element[0].offsetHeight
})
this.$menu
.insertAfter(this.$element)
.css({
top: pos.top + pos.height
, left: pos.left
})
.show()
... | .change()
return this.hide()
}
, updater: function (item) { | random_line_split |
liquidball.js | import React, {Component, PropTypes} from 'react';
import ReactEcharts from 'echarts-for-react';
import 'echarts-liquidfill';
// 用于统计当日金额的组件
class LiquidBall extends Component {
constructor(props) {
super(props);
}
// 初次渲染后执行此方法
componentDidMount() {
setTimeout(() => {
this... | harts ref='liquidBall'
option={this.getOption()}
style={{height: '100%', width: '100%'}}/>
);
}
getOption() {
let {name, value, unit, borderColor, rippleColor = []} = this.props;
var option = {
series: [{
t... | eactEc | identifier_name |
liquidball.js | import React, {Component, PropTypes} from 'react';
import ReactEcharts from 'echarts-for-react';
import 'echarts-liquidfill';
// 用于统计当日金额的组件
class LiquidBall extends Component {
constructor(props) {
super(props);
}
// 初次渲染后执行此方法
componentDidMount() {
setTimeout(() => {
this... | lor, rippleColor = []} = this.props;
var option = {
series: [{
type: 'liquidFill',
name: name,
radius: '90%',
backgroundStyle: {
color: '#0e1e37'
},
data: [{
name:... | identifier_body | |
liquidball.js | import React, {Component, PropTypes} from 'react';
import ReactEcharts from 'echarts-for-react';
import 'echarts-liquidfill';
// 用于统计当日金额的组件
class LiquidBall extends Component {
constructor(props) {
super(props);
}
// 初次渲染后执行此方法
componentDidMount() {
setTimeout(() => {
this... | export default LiquidBall; | random_line_split | |
main.rs | extern crate crypto;
extern crate itertools;
use std::env;
use crypto::md5::Md5;
use crypto::digest::Digest;
use std::collections::HashMap;
fn main() {
let raw_input = env::args().nth(1).unwrap_or("".to_string());
let input = raw_input.as_bytes();
let mut index : i64 = -1;
let mut hash = Md5::new();
... |
if pos < 8 && !output2.contains_key(&pos) {
output2.insert(pos, out2);
}
}
println!("P1 {}", output);
let empty = " ".to_string();
let temp = (0..8)
.map(|i| output2.get(&(i as i32)).unwrap_or(&empty))
.cloned()
.collect::<Vec<_>>()
.concat... | {
output.push_str(&out);
} | conditional_block |
main.rs | extern crate crypto;
extern crate itertools;
use std::env;
use crypto::md5::Md5;
use crypto::digest::Digest;
use std::collections::HashMap;
fn | () {
let raw_input = env::args().nth(1).unwrap_or("".to_string());
let input = raw_input.as_bytes();
let mut index : i64 = -1;
let mut hash = Md5::new();
let mut output = String::new();
let mut output2 = HashMap::new();
while {output.len() < 8 || output2.len() < 8} {
let mut temp =... | main | identifier_name |
main.rs | extern crate crypto;
extern crate itertools;
use std::env;
use crypto::md5::Md5;
use crypto::digest::Digest;
use std::collections::HashMap;
fn main() | {
let raw_input = env::args().nth(1).unwrap_or("".to_string());
let input = raw_input.as_bytes();
let mut index : i64 = -1;
let mut hash = Md5::new();
let mut output = String::new();
let mut output2 = HashMap::new();
while {output.len() < 8 || output2.len() < 8} {
let mut temp = [0... | identifier_body | |
main.rs | extern crate crypto;
extern crate itertools;
use std::env;
use crypto::md5::Md5;
use crypto::digest::Digest;
use std::collections::HashMap;
fn main() {
let raw_input = env::args().nth(1).unwrap_or("".to_string());
let input = raw_input.as_bytes();
let mut index : i64 = -1;
let mut hash = Md5::new();
... |
hash.input(input);
hash.input(index.to_string().as_bytes());
hash.result(&mut temp);
(temp[0] as i32 + temp[1] as i32 + (temp[2] >> 4) as i32) != 0
} {}
let out = format!("{:x}", temp[2] & 0xf);
let out2 = format!("{:x}", temp[3] >> 4);
... | random_line_split | |
2018-09-19_09:49:05__251447ab2060.py | """empty message
Revision ID: 251447ab2060
Revises: 53ac0b4e8891
Create Date: 2018-09-19 09:49:05.552597
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '251447ab2060'
down_revision = '53ac0b4e8891'
branch_labels = None
depends_on = None
def | ():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('transactions', sa.Column('lot_number', sa.String(length=64), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('transactions',... | upgrade | identifier_name |
2018-09-19_09:49:05__251447ab2060.py | """empty message
Revision ID: 251447ab2060
Revises: 53ac0b4e8891
Create Date: 2018-09-19 09:49:05.552597
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '251447ab2060' | depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('transactions', sa.Column('lot_number', sa.String(length=64), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
... | down_revision = '53ac0b4e8891'
branch_labels = None | random_line_split |
2018-09-19_09:49:05__251447ab2060.py | """empty message
Revision ID: 251447ab2060
Revises: 53ac0b4e8891
Create Date: 2018-09-19 09:49:05.552597
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '251447ab2060'
down_revision = '53ac0b4e8891'
branch_labels = None
depends_on = None
def upgrade():
# ... |
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('transactions', 'lot_number')
# ### end Alembic commands ###
| op.add_column('transactions', sa.Column('lot_number', sa.String(length=64), nullable=True))
# ### end Alembic commands ### | identifier_body |
index.ts | export const PROPERTY_BASED_DESCRIPTORS = !!'3.2.0';
export const EMBER_EXTEND_PROTOTYPES = !!'3.2.0-beta.5';
export const DEPRECATE_OPTIONS_MISSING = !!'2.1.0-beta.1';
export const DEPRECATE_ID_MISSING = !!'2.1.0-beta.1';
export const DEPRECATE_UNTIL_MISSING = !!'2.1.0-beta.1';
export const RUN_SYNC = !!'3.0.0-beta.4'... | export const ARRAY_AT_EACH = !!'3.1.0-beta.1';
export const TARGET_OBJECT = !!'2.18.0-beta.1';
export const RENDER_HELPER = !!'2.11.0-beta.1';
export const BINDING_SUPPORT = !!'2.7.0-beta.1'; | export const PROPERTY_WILL_CHANGE = !!'3.1.0-beta.1';
export const PROPERTY_DID_CHANGE = !!'3.1.0-beta.1';
export const ROUTER_ROUTER = !!'3.2.0-beta.1';
export const ORPHAN_OUTLET_RENDER = !!'2.11.0-beta.1'; | random_line_split |
set.js | require('ember-runtime/core');
require('ember-runtime/system/core_object');
require('ember-runtime/mixins/mutable_enumerable');
require('ember-runtime/mixins/copyable');
require('ember-runtime/mixins/freezable');
/**
@module ember
@submodule ember-runtime
*/
var get = Ember.get, set = Ember.set, guidFor = Ember.guidF... |
// optimized version
contains: function(obj) {
return this[guidFor(obj)]>=0;
},
copy: function() {
var C = this.constructor, ret = new C(), loc = get(this, 'length');
set(ret, 'length', loc);
while(--loc>=0) {
ret[loc] = this[loc];
ret[guidFor(this[loc])] = loc;
}
return re... |
return this;
}, | random_line_split |
set.js | require('ember-runtime/core');
require('ember-runtime/system/core_object');
require('ember-runtime/mixins/mutable_enumerable');
require('ember-runtime/mixins/copyable');
require('ember-runtime/mixins/freezable');
/**
@module ember
@submodule ember-runtime
*/
var get = Ember.get, set = Ember.set, guidFor = Ember.guidF... |
if (isLast) { Ember.propertyWillChange(this, 'lastObject'); }
// swap items - basically move the item to the end so it can be removed
if (idx < len-1) {
last = this[len-1];
this[idx] = last;
this[guidFor(last)] = idx;
}
delete this[guid];
delete this[len-1... | { Ember.propertyWillChange(this, 'firstObject'); } | conditional_block |
parsers.py | import re
from markdown import Markdown, TextPreprocessor
from smartypants import smartyPants
from pygments import highlight
from pygments.formatters import HtmlFormatter
from pygments.lexers import get_lexer_by_name, TextLexer
class CodeBlockPreprocessor(TextPreprocessor):
"""
The Pygments Markdown Pre... | def run(self, lines):
def repl(m):
return smartyPants(m.group(1)) + m.group(2)
return self.pattern.sub(repl, lines)
def parse_markdown(value):
"""
Parses a value into markdown syntax, using the pygments preprocessor and smartypants
"""
md = Markdown()
... | """
pattern = re.compile(r'(.+?)(@@.+?@@ end|$)', re.S)
| random_line_split |
parsers.py | import re
from markdown import Markdown, TextPreprocessor
from smartypants import smartyPants
from pygments import highlight
from pygments.formatters import HtmlFormatter
from pygments.lexers import get_lexer_by_name, TextLexer
class CodeBlockPreprocessor(TextPreprocessor):
"""
The Pygments Markdown Pre... |
def parse_markdown(value):
"""
Parses a value into markdown syntax, using the pygments preprocessor and smartypants
"""
md = Markdown()
md.textPreprocessors.insert(0, SmartyPantsPreprocessor())
md.textPreprocessors.insert(1, CodeBlockPreprocessor())
return md.convert(value)
| def repl(m):
return smartyPants(m.group(1)) + m.group(2)
return self.pattern.sub(repl, lines) | identifier_body |
parsers.py | import re
from markdown import Markdown, TextPreprocessor
from smartypants import smartyPants
from pygments import highlight
from pygments.formatters import HtmlFormatter
from pygments.lexers import get_lexer_by_name, TextLexer
class CodeBlockPreprocessor(TextPreprocessor):
"""
The Pygments Markdown Pre... | (value):
"""
Parses a value into markdown syntax, using the pygments preprocessor and smartypants
"""
md = Markdown()
md.textPreprocessors.insert(0, SmartyPantsPreprocessor())
md.textPreprocessors.insert(1, CodeBlockPreprocessor())
return md.convert(value)
| parse_markdown | identifier_name |
dependency.rs | use std::fmt;
use std::rc::Rc;
use std::str::FromStr;
use semver::VersionReq;
use semver::ReqParseError;
use serde::ser;
use core::{PackageId, SourceId, Summary};
use core::interning::InternedString;
use util::{Cfg, CfgExpr, Config};
use util::errors::{CargoError, CargoResult, CargoResultExt};
/// Information about ... | (&self) -> Option<&str> {
self.inner.rename.as_ref().map(|s| &**s)
}
pub fn set_kind(&mut self, kind: Kind) -> &mut Dependency {
Rc::make_mut(&mut self.inner).kind = kind;
self
}
/// Sets the list of features requested for the package.
pub fn set_features(&mut self, feature... | rename | identifier_name |
dependency.rs | use std::fmt;
use std::rc::Rc;
use std::str::FromStr;
use semver::VersionReq;
use semver::ReqParseError;
use serde::ser;
use core::{PackageId, SourceId, Summary};
use core::interning::InternedString;
use util::{Cfg, CfgExpr, Config};
use util::errors::{CargoError, CargoResult, CargoResultExt};
/// Information about ... | } | random_line_split | |
dependency.rs | use std::fmt;
use std::rc::Rc;
use std::str::FromStr;
use semver::VersionReq;
use semver::ReqParseError;
use serde::ser;
use core::{PackageId, SourceId, Summary};
use core::interning::InternedString;
use util::{Cfg, CfgExpr, Config};
use util::errors::{CargoError, CargoResult, CargoResultExt};
/// Information about ... |
/// Returns true if the default features of the dependency are requested.
pub fn uses_default_features(&self) -> bool {
self.inner.default_features
}
/// Returns the list of features that are requested by the dependency.
pub fn features(&self) -> &[InternedString] {
&self.inner.fea... | {
self.inner.optional
} | identifier_body |
recipe-137551.py | RegObj.dll is an ActiveX server--and, hence, has an automation interface--that is available with documentation in
the distribution file known as RegObji.exe, from the following page:
http://msdn.microsoft.com/vbasic/downloads/addins.asp
To provide early binding for RegObj use
>>> from win32com.client impo... | >>> HKCR = regobj.RegKeyFromHKey ( HKEY_CLASSES_ROOT )
>>> PythonFileKey = HKCR.ParseKeyName('Python.File\Shell\Open\command')
>>> PythonFileKey.Value
u'J:\\Python22\\pythonw.exe "%1" %*' | random_line_split | |
index.js | var map;
window.onload = function() {
var mm = com.modestmaps;
var dmap = document.getElementById('map');
wax.tilejson('https://a.tiles.mapbox.com/v3/examples.map-i86l3621.jsonp',
function(tj) {
map = new com.modestmaps.Map(dmap,
new wax.mm.connector(tj), null, [
... | () {
var pos = scrolly.scrollTop / 200;
ea.from(positions[Math.floor(pos)])
.to(positions[Math.ceil(pos)])
.t(pos - Math.floor(pos));
}
scrolly.addEventListener('scroll', update, false);
});
};
| update | identifier_name |
index.js | var map;
window.onload = function() {
var mm = com.modestmaps;
var dmap = document.getElementById('map');
wax.tilejson('https://a.tiles.mapbox.com/v3/examples.map-i86l3621.jsonp',
function(tj) {
map = new com.modestmaps.Map(dmap, | ]);
map.setCenterZoom(new com.modestmaps.Location(-10, 50), 3);
map.addCallback('zoomed', function() {
// console.log(map.getZoom());
});
var pres = document.getElementsByTagName('pre');
for (var i = 0; i < pres.length; i++) {
pres[i].onclick ... | new wax.mm.connector(tj), null, [
easey_handlers.DragHandler(),
easey_handlers.TouchHandler(),
easey_handlers.MouseWheelHandler(),
easey_handlers.DoubleClickHandler() | random_line_split |
index.js | var map;
window.onload = function() {
var mm = com.modestmaps;
var dmap = document.getElementById('map');
wax.tilejson('https://a.tiles.mapbox.com/v3/examples.map-i86l3621.jsonp',
function(tj) {
map = new com.modestmaps.Map(dmap,
new wax.mm.connector(tj), null, [
... |
scrolly.addEventListener('scroll', update, false);
});
};
| {
var pos = scrolly.scrollTop / 200;
ea.from(positions[Math.floor(pos)])
.to(positions[Math.ceil(pos)])
.t(pos - Math.floor(pos));
} | identifier_body |
index.js | var map;
window.onload = function() {
var mm = com.modestmaps;
var dmap = document.getElementById('map');
wax.tilejson('https://a.tiles.mapbox.com/v3/examples.map-i86l3621.jsonp',
function(tj) {
map = new com.modestmaps.Map(dmap,
new wax.mm.connector(tj), null, [
... |
var scrolly = document.getElementById('scrolly');
var positions = [
map.locationCoordinate({ lat: 33.5, lon: 65.6 }).zoomTo(6),
map.locationCoordinate({ lat: 33.1, lon: 44.6 }).zoomTo(6),
map.locationCoordinate({ lat: 28.7, lon: 69.2 }).zoomTo(6)];
var ea = ease... | {
pres[i].onclick = function() {
eval(this.innerHTML);
};
} | conditional_block |
tata.py | # -*- coding: UTF-8 -*-
# ..#######.########.#######.##....#..######..######.########....###...########.#######.########..######.
# .##.....#.##.....#.##......###...#.##....#.##....#.##.....#...##.##..##.....#.##......##.....#.##....##
# .##.....#.##.....#.##......####..#.##......##......##.....#..##...##.##.....#.... | (self, imdb, year):
try:
query = urlparse.urljoin(self.base_link, self.search_link % imdb)
y = ['%s' % str(year), '%s' % str(int(year) + 1), '%s' % str(int(year) - 1), '0']
r = client.request(query)
r = dom_parser.parse_dom(r, 'div', attrs={'class': 'container'... | __search_movie | identifier_name |
tata.py | # -*- coding: UTF-8 -*-
# ..#######.########.#######.##....#..######..######.########....###...########.#######.########..######.
# .##.....#.##.....#.##......###...#.##....#.##....#.##.....#...##.##..##.....#.##......##.....#.##....##
# .##.....#.##.....#.##......####..#.##......##......##.....#..##...##.##.....#.... | _url = dom_parser.parse_dom(i, 'a', attrs={'class': 'ml-image'}, req='href')[0].attrs['href']
_title = re.sub('<.+?>|</.+?>', '', dom_parser.parse_dom(i, 'h6')[0].content).strip()
try:
_title = re.search('(.*?)\s(?:staf+el|s)\s*(\d+)', _title, re.I).g... | r = dom_parser.parse_dom(r, 'div', attrs={'class': 'ml-item-content'})
f = []
for i in r: | random_line_split |
tata.py | # -*- coding: UTF-8 -*-
# ..#######.########.#######.##....#..######..######.########....###...########.#######.########..######.
# .##.....#.##.....#.##......###...#.##....#.##....#.##.....#...##.##..##.....#.##......##.....#.##....##
# .##.....#.##.....#.##......####..#.##......##......##.....#..##...##.##.....#.... |
def __search_movie(self, imdb, year):
try:
query = urlparse.urljoin(self.base_link, self.search_link % imdb)
y = ['%s' % str(year), '%s' % str(int(year) + 1), '%s' % str(int(year) - 1), '0']
r = client.request(query)
r = dom_parser.parse_dom(r, 'div', att... | return url | identifier_body |
tata.py | # -*- coding: UTF-8 -*-
# ..#######.########.#######.##....#..######..######.########....###...########.#######.########..######.
# .##.....#.##.....#.##......###...#.##....#.##....#.##.....#...##.##..##.....#.##......##.....#.##....##
# .##.....#.##.....#.##......####..#.##......##......##.....#..##...##.##.....#.... |
elif result:
result = [i.get('link_mp4') for i in result]
result = [i for i in result if i]
for i in result:
try:
sources.append(
{'source': 'gvideo', 'quality': directstream.googletag(i)... | sources.append(
{'source': 'CDN', 'quality': i['quality'], 'language': 'de', 'url': i['url'], 'direct': True,
'debridonly': False}) | conditional_block |
fh_comment.py | # -*- coding: utf-8 -*-
from browser_interface.field.FieldFactory import FieldFactory
from browser_interface.queue.QueueFactory import QueueFactory
from browser_interface.browser.BrowserFactory import BrowserFactory
from browser_interface.log.Logging import Logging
from common import config
import urllib
import json
... | 9/50071321_0.shtml', 1) | __main__':
# con = Comment()
# con.getcomment('http://news.ifeng.com/a/2016100 | conditional_block |
fh_comment.py | # -*- coding: utf-8 -*-
from browser_interface.field.FieldFactory import FieldFactory
from browser_interface.queue.QueueFactory import QueueFactory
from browser_interface.browser.BrowserFactory import BrowserFactory
from browser_interface.log.Logging import Logging
from common import config
import urllib
import json
... | 9/50071321_0.shtml', 1) | p?&orderby=&docUrl=%s&job=1&p=%d&pageSize=20' % (urllib.quote(news_url), page)
html = self.browser.visit(url, timeout=10, retry=5)
message = json.loads(html)['comments']
field = self.field_factory.create('ping_lun')
for item in message:
# 评论文章url
field.set('news_u... | identifier_body |
fh_comment.py | # -*- coding: utf-8 -*-
from browser_interface.field.FieldFactory import FieldFactory
from browser_interface.queue.QueueFactory import QueueFactory
from browser_interface.browser.BrowserFactory import BrowserFactory
from browser_interface.log.Logging import Logging
from common import config
import urllib
import json
... | for item in message:
# 评论文章url
field.set('news_url', news_url)
# 评论内容
field.set('ping_lun_nei_rong', item["comment_contents"])
# 评论时间
field.set('ping_lun_shi_jian', item["create_time"])
# 回复数
# 点赞数
field... | html = self.browser.visit(url, timeout=10, retry=5)
message = json.loads(html)['comments']
field = self.field_factory.create('ping_lun') | random_line_split |
fh_comment.py | # -*- coding: utf-8 -*-
from browser_interface.field.FieldFactory import FieldFactory
from browser_interface.queue.QueueFactory import QueueFactory
from browser_interface.browser.BrowserFactory import BrowserFactory
from browser_interface.log.Logging import Logging
from common import config
import urllib
import json
... | 'http://comment.ifeng.com/get.php?&orderby=&docUrl=%s&job=1&p=%d&pageSize=20' % (urllib.quote(news_url), page)
html = self.browser.visit(url, timeout=10, retry=5)
message = json.loads(html)['comments']
field = self.field_factory.create('ping_lun')
for item in message:
# 评论文章u... | url = | identifier_name |
edit_detail.py | # -*- coding: utf-8 -*-
# This file is part of Shoop.
#
# Copyright (c) 2012-2015, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import unicode_literals
import six
from django.utils.transl... |
if isinstance(module.admin_detail_view_class, six.text_type):
view_class = load(module.admin_detail_view_class)
else:
view_class = module.admin_detail_view_class
kwargs["object"] = object
return view_class(model=self.model).dispatch(request, *args, **kwargs)
cl... | raise Problem("Module %s has no admin detail view" % module.name) | conditional_block |
edit_detail.py | # -*- coding: utf-8 -*-
# This file is part of Shoop.
#
# Copyright (c) 2012-2015, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree. | import six
from django.utils.translation import ugettext_lazy as _
from django.views.generic.detail import DetailView
from shoop.core.models import PaymentMethod, ShippingMethod
from shoop.utils.excs import Problem
from shoop.utils.importing import load
class _BaseMethodDetailView(DetailView):
model = None # Ov... | from __future__ import unicode_literals
| random_line_split |
edit_detail.py | # -*- coding: utf-8 -*-
# This file is part of Shoop.
#
# Copyright (c) 2012-2015, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import unicode_literals
import six
from django.utils.transl... |
class ShippingMethodEditDetailView(_BaseMethodDetailView):
model = ShippingMethod
class PaymentMethodEditDetailView(_BaseMethodDetailView):
model = PaymentMethod
| model = None # Overridden below
title = _(u"Edit Details")
def dispatch(self, request, *args, **kwargs):
# This view only dispatches further to the method module's own detail view class
object = self.get_object()
module = object.module
if not module.admin_detail_view_class:
... | identifier_body |
edit_detail.py | # -*- coding: utf-8 -*-
# This file is part of Shoop.
#
# Copyright (c) 2012-2015, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import unicode_literals
import six
from django.utils.transl... | (_BaseMethodDetailView):
model = PaymentMethod
| PaymentMethodEditDetailView | identifier_name |
myapp.ts | /* eslint-env browser */
import {IStore, Store} from "../../..";
type ViewpointJson = {
position: string;
};
class Viewpoint {
public position: string;
public constructor(position: string = "0 0 0") {
this.position = position;
}
public toJson(): ViewpointJson |
}
type MapOf<T> = {
[id: string]: T;
};
type ViewpointsState = MapOf<Viewpoint>;
type ViewpointsProps = MapOf<ViewpointJson>;
type SetMessage = Readonly<{
action: "set";
key: string;
value: Viewpoint;
}>;
export function actionSet<ViewpointsState>(message: SetMessage, store: IStore<ViewpointsState, never>): voi... | {
return {
position: this.position
};
} | identifier_body |
myapp.ts | /* eslint-env browser */
import {IStore, Store} from "../../..";
type ViewpointJson = {
position: string;
};
class Viewpoint {
public position: string;
public constructor(position: string = "0 0 0") {
this.position = position;
}
public toJson(): ViewpointJson {
return {
position: this.position
};
}
}
t... | else {
console.log("[PROPS]", props);
}
};
// Initial state
collection.state = {
initial1: new Viewpoint("1 0 0"),
initial2: new Viewpoint("2 0 0"),
initial3: new Viewpoint("3 0 0")
};
// Send actions
collection.schedule({
action: "set",
key: "new1",
value: new Viewpoint("4 0 0")
});
collection.schedule({
... | {
//@ts-ignore
window.MOCHA_ON_STORE_PROPS(JSON.stringify(props)); // eslint-disable-line
} | conditional_block |
myapp.ts | /* eslint-env browser */
import {IStore, Store} from "../../..";
type ViewpointJson = {
position: string;
};
class Viewpoint {
public position: string;
public constructor(position: string = "0 0 0") {
this.position = position;
}
public toJson(): ViewpointJson {
return {
position: this.position
};
}
}
t... | <ViewpointsState>(message: SetMessage, store: IStore<ViewpointsState, never>): void {
const newItems: any = {};
newItems[message.key] = message.value;
const newState = Object.assign({}, store.state, newItems);
Object.freeze(newState);
store.state = newState;
}
const collection = new Store<ViewpointsState, Viewpoi... | actionSet | identifier_name |
myapp.ts | /* eslint-env browser */
import {IStore, Store} from "../../..";
type ViewpointJson = {
position: string;
};
class Viewpoint {
public position: string;
public constructor(position: string = "0 0 0") {
this.position = position;
}
public toJson(): ViewpointJson {
return {
position: this.position
};
}
}
t... | action: "set",
key: "new2",
value: new Viewpoint("5 0 0")
}); | random_line_split | |
quick_setup_headless.py | #!/usr/bin/python
# 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
# "... | # 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 Lice... | # http://www.apache.org/licenses/LICENSE-2.0
# | random_line_split |
quick_setup_headless.py | #!/usr/bin/python
# 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
# "... |
if __name__ == '__main__':
try:
from cairis.core.ARM import ARMException
main()
except ARMException as e:
print('Fatal setup error: ' + str(e))
sys.exit(-1)
| parser = argparse.ArgumentParser(description='CAIRIS quick setup script - headless')
parser.add_argument('--dbHost',dest='dbHost',help='Database host name', default='localhost')
parser.add_argument('--dbPort',dest='dbPort',help='Database port number',default='3306')
parser.add_argument('--dbRootPassword',dest='db... | identifier_body |
quick_setup_headless.py | #!/usr/bin/python
# 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
# "... | try:
from cairis.core.ARM import ARMException
main()
except ARMException as e:
print('Fatal setup error: ' + str(e))
sys.exit(-1) | conditional_block | |
quick_setup_headless.py | #!/usr/bin/python
# 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
# "... | (args=None):
parser = argparse.ArgumentParser(description='CAIRIS quick setup script - headless')
parser.add_argument('--dbHost',dest='dbHost',help='Database host name', default='localhost')
parser.add_argument('--dbPort',dest='dbPort',help='Database port number',default='3306')
parser.add_argument('--dbRootPas... | main | identifier_name |
tcp_client.rs | use std::{fmt, io};
use std::sync::Arc;
use std::net::SocketAddr;
use std::marker::PhantomData;
use BindClient;
use tokio_core::reactor::Handle;
use tokio_core::net::{TcpStream, TcpStreamNew};
use futures::{Future, Poll, Async};
// TODO: add configuration, e.g.:
// - connection timeout
// - multiple addresses
// - re... | #[derive(Debug)]
pub struct TcpClient<Kind, P> {
_kind: PhantomData<Kind>,
proto: Arc<P>,
}
/// A future for establishing a client connection.
///
/// Yields a service for interacting with the server.
pub struct Connect<Kind, P> {
_kind: PhantomData<Kind>,
proto: Arc<P>,
socket: TcpStreamNew,
h... | ///
/// At the moment, this builder offers minimal configuration, but more will be
/// added over time. | random_line_split |
tcp_client.rs | use std::{fmt, io};
use std::sync::Arc;
use std::net::SocketAddr;
use std::marker::PhantomData;
use BindClient;
use tokio_core::reactor::Handle;
use tokio_core::net::{TcpStream, TcpStreamNew};
use futures::{Future, Poll, Async};
// TODO: add configuration, e.g.:
// - connection timeout
// - multiple addresses
// - re... | (&self, addr: &SocketAddr, handle: &Handle) -> Connect<Kind, P> {
Connect {
_kind: PhantomData,
proto: self.proto.clone(),
socket: TcpStream::connect(addr, handle),
handle: handle.clone(),
}
}
}
impl<Kind, P> fmt::Debug for Connect<Kind, P> {
fn f... | connect | identifier_name |
tcp_client.rs | use std::{fmt, io};
use std::sync::Arc;
use std::net::SocketAddr;
use std::marker::PhantomData;
use BindClient;
use tokio_core::reactor::Handle;
use tokio_core::net::{TcpStream, TcpStreamNew};
use futures::{Future, Poll, Async};
// TODO: add configuration, e.g.:
// - connection timeout
// - multiple addresses
// - re... |
}
| {
write!(f, "Connect {{ ... }}")
} | identifier_body |
index.native.scroll.js | 'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends2 = require('babel-runtime/helpers/extends');
var _extends3 = _interopRequireDefault(_extends2);
var _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');
var _objectWithoutProperties3 = _inte... |
}, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret);
}
(0, _createClass3.default)(SwipeableViews, [{
key: 'componentWillMount',
value: function componentWillMount() {
if (process.env.NODE_ENV !== 'production') {
(0, _checkIndexBounds2.default)(this.props);
}
var... | {
_this.setState({
viewWidth: width,
offset: {
x: _this.state.indexLatest * width
}
});
} | conditional_block |
index.native.scroll.js | 'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends2 = require('babel-runtime/helpers/extends');
var _extends3 = _interopRequireDefault(_extends2);
var _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');
var _objectWithoutProperties3 = _inte... |
// weak
/**
* This is an alternative version that use `ScrollView` and `ViewPagerAndroid`.
* I'm not sure what version give the best UX experience.
* I'm keeping the two versions here until we figured out.
*/
var _Dimensions$get = _reactNative.Dimensions.get('window');
var windowWidth = _Dimensions$get.width;
... | { return obj && obj.__esModule ? obj : { default: obj }; } | identifier_body |
index.native.scroll.js | 'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends2 = require('babel-runtime/helpers/extends');
var _extends3 = _interopRequireDefault(_extends2);
var _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');
var _objectWithoutProperties3 = _inte... | var viewWidth = _state.viewWidth;
var indexLatest = _state.indexLatest;
var offset = _state.offset;
var slideStyleObj = [styles.slide, {
width: viewWidth
}, slideStyle];
var childrenToRender = _react.Children.map(children, function (element, index) {
if (disabled &... | var _state = this.state; | random_line_split |
index.native.scroll.js | 'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends2 = require('babel-runtime/helpers/extends');
var _extends3 = _interopRequireDefault(_extends2);
var _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');
var _objectWithoutProperties3 = _inte... | () {
var _ref;
var _temp, _this, _ret;
(0, _classCallCheck3.default)(this, SwipeableViews);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(th... | SwipeableViews | identifier_name |
Atmosphere.py | from scipy import *
from Reference import *
################################################################################
# DATA
################################################################################
# EARTH FACTS
R = 287.058 # ideal gas constant for earth air, in J/kg*K
r = 6356766 # radius of the eart... | (hg):
return (r * hg) / (r + hg)
def temperatureAtHeight(h):
i = layerIndexForheight(h)
return baseTemperatures[i] + tempGradients[i] * (h - baseHeights[i])
def isothermalLayerPressureAtHeight(h, basePressure, baseHeight, layerTemperature):
return basePressure * exp(-(g * (h - baseHeight) / (R * layer... | geopotentialAltitudeForHeight | identifier_name |
Atmosphere.py | from scipy import *
from Reference import *
################################################################################
# DATA
################################################################################
# EARTH FACTS
R = 287.058 # ideal gas constant for earth air, in J/kg*K
r = 6356766 # radius of the eart... |
else: # gradient layer
p = gradientLayerPressureAtHeight(h, basePressure, t, baseTemperature, layerGradient)
d = gradientLayerDensityAtHeight(h, baseDensity, t, baseTemperature, layerGradient)
return hg, h, t, p, d
##########################################################################... | p = isothermalLayerPressureAtHeight(h, basePressure, baseHeight, baseTemperature)
d = isothermalLayerDensityAtHeight(h, baseDensity, basePressure, p) | conditional_block |
Atmosphere.py | from scipy import *
from Reference import *
################################################################################
# DATA
################################################################################
# EARTH FACTS
R = 287.058 # ideal gas constant for earth air, in J/kg*K
r = 6356766 # radius of the eart... |
def baseInformation(h):
i = layerIndexForheight(h)
return baseHeights[i], baseTemperatures[i], tempGradients[i], basePressures[i], baseDensities[i]
def informationAtHeight(hg):
"""Takes a Geometric Altitude and Returns the Geometric Altitude, Geopotential
Altitude, Temperature, Pressure and Density a... | def gradientLayerDensityAtHeight(h, baseDensity, temperatureAtHeight, baseTemperature, layerTemperatureGradient):
return baseDensity * (temperatureAtHeight / baseTemperature)**-(g/(R * layerTemperatureGradient) + 1) | random_line_split |
Atmosphere.py | from scipy import *
from Reference import *
################################################################################
# DATA
################################################################################
# EARTH FACTS
R = 287.058 # ideal gas constant for earth air, in J/kg*K
r = 6356766 # radius of the eart... |
def isothermalLayerPressureAtHeight(h, basePressure, baseHeight, layerTemperature):
return basePressure * exp(-(g * (h - baseHeight) / (R * layerTemperature)))
def isothermalLayerDensityAtHeight(h, baseDensity, basePressure, pressureAtHeight):
return baseDensity * (pressureAtHeight / basePressure)
def gradi... | i = layerIndexForheight(h)
return baseTemperatures[i] + tempGradients[i] * (h - baseHeights[i]) | identifier_body |
isScrollable.js | const overflowRegex = /(auto|scroll|hidden)/
function needScroll(el, dir) {
let { scrollTop, scrollLeft, scrollHeight, scrollWidth, clientHeight, clientWidth } = el;
switch (dir) {
case "left":
return scrollLeft > 0
break;
case "right":
return scrollLeft + clientWidth < scrollWidth
... | (el) {
let style = el.currentStyle || window.getComputedStyle(el, null);
if (el === document.scrollingElement) {
return true;
}
if (el === document.body) {
return true;
}
if (el === document.documentElement) {
return true;
}
return overflowRegex.test(style.overflow + style.overflowY + style.... | canScroll | identifier_name |
isScrollable.js | const overflowRegex = /(auto|scroll|hidden)/
function needScroll(el, dir) {
let { scrollTop, scrollLeft, scrollHeight, scrollWidth, clientHeight, clientWidth } = el;
switch (dir) {
case "left":
return scrollLeft > 0
break;
case "right":
return scrollLeft + clientWidth < scrollWidth
... | let style = el.currentStyle || window.getComputedStyle(el, null);
if (el === document.scrollingElement) {
return true;
}
if (el === document.body) {
return true;
}
if (el === document.documentElement) {
return true;
}
return overflowRegex.test(style.overflow + style.overflowY + style.overflo... | return false;
}
function canScroll(el) { | random_line_split |
isScrollable.js | const overflowRegex = /(auto|scroll|hidden)/
function needScroll(el, dir) {
let { scrollTop, scrollLeft, scrollHeight, scrollWidth, clientHeight, clientWidth } = el;
switch (dir) {
case "left":
return scrollLeft > 0
break;
case "right":
return scrollLeft + clientWidth < scrollWidth
... |
if (el === document.body) {
return true;
}
if (el === document.documentElement) {
return true;
}
return overflowRegex.test(style.overflow + style.overflowY + style.overflowX);
}
function isScrollable(el, dir) { // dir: left, right, up, down
return canScroll(el) && needScroll(el, dir);
}
export de... | {
return true;
} | conditional_block |
isScrollable.js | const overflowRegex = /(auto|scroll|hidden)/
function needScroll(el, dir) {
let { scrollTop, scrollLeft, scrollHeight, scrollWidth, clientHeight, clientWidth } = el;
switch (dir) {
case "left":
return scrollLeft > 0
break;
case "right":
return scrollLeft + clientWidth < scrollWidth
... |
function isScrollable(el, dir) { // dir: left, right, up, down
return canScroll(el) && needScroll(el, dir);
}
export default isScrollable; | {
let style = el.currentStyle || window.getComputedStyle(el, null);
if (el === document.scrollingElement) {
return true;
}
if (el === document.body) {
return true;
}
if (el === document.documentElement) {
return true;
}
return overflowRegex.test(style.overflow + style.overflowY + style.overf... | identifier_body |
structure.rs | // Copyright 2016 Dario Domizioli
//
// 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... | pub fn get_title(&self) -> &str { &self.title }
}
#[derive(Clone, PartialEq)]
pub struct Content {
pub chunks: Vec<String>
}
impl Content {
fn build_title_page(st: &Structure) -> Result<String, String> {
let book_header =
r#"<div class="book_cover">"#.to_string() +
r#"<div... | random_line_split | |
structure.rs | // Copyright 2016 Dario Domizioli
//
// 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... |
fn build_toc(st: &Structure) -> Result<String, String> {
let mut toc = String::new();
toc = toc + r#"<div class="toc">"# + "\n\n";
let mut part_index = 1;
for part in st.parts.iter() {
let part_link = format!(
"- **[{0} {1}](#kos_ref_part_{0})**\n\n", pa... | {
let book_header =
r#"<div class="book_cover">"#.to_string() +
r#"<div class="book_author">"# +
&st.author +
r#"</div>"# +
r#"<div class="book_title">"# +
r#"<a id="kos_book_title">"# +
&st.title +
"</a></div>" +
... | identifier_body |
structure.rs | // Copyright 2016 Dario Domizioli
//
// 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... | {
title: String,
author: String,
license: String,
parts: Vec<Part>
}
impl Structure {
pub fn from_json(js: &str) -> Result<Structure, json::DecoderError> {
json::decode::<Structure>(js)
}
pub fn get_title(&self) -> &str { &self.title }
}
#[derive(Clone, PartialEq)]
pub struct Con... | Structure | identifier_name |
cgnv6_nat64_fragmentation_df_bit_transparency.py | from a10sdk.common.A10BaseClass import A10BaseClass
class DfBitTransparency(A10BaseClass):
"""Class Description::
Add an empty IPv6 fragmentation header if IPv4 DF bit is zero (default:disabled).
Class df-bit-transparency supports CRUD Operations and inherits from `common/A10BaseClass`.
This cla... | self.ERROR_MSG = ""
self.required=[]
self.b_key = "df-bit-transparency"
self.a10_url="/axapi/v3/cgnv6/nat64/fragmentation/df-bit-transparency"
self.DeviceProxy = ""
self.df_bit_value = ""
self.uuid = ""
for keys, value in kwargs.items():
setattr(self,... | identifier_body | |
cgnv6_nat64_fragmentation_df_bit_transparency.py | from a10sdk.common.A10BaseClass import A10BaseClass
class DfBitTransparency(A10BaseClass):
"""Class Description::
Add an empty IPv6 fragmentation header if IPv4 DF bit is zero (default:disabled).
Class df-bit-transparency supports CRUD Operations and inherits from `common/A10BaseClass`.
This cla... | (self, **kwargs):
self.ERROR_MSG = ""
self.required=[]
self.b_key = "df-bit-transparency"
self.a10_url="/axapi/v3/cgnv6/nat64/fragmentation/df-bit-transparency"
self.DeviceProxy = ""
self.df_bit_value = ""
self.uuid = ""
for keys, value in kwargs.items():... | __init__ | identifier_name |
cgnv6_nat64_fragmentation_df_bit_transparency.py | from a10sdk.common.A10BaseClass import A10BaseClass
class DfBitTransparency(A10BaseClass):
"""Class Description::
Add an empty IPv6 fragmentation header if IPv4 DF bit is zero (default:disabled).
Class df-bit-transparency supports CRUD Operations and inherits from `common/A10BaseClass`.
This cla... | setattr(self,keys, value) | conditional_block | |
cgnv6_nat64_fragmentation_df_bit_transparency.py | from a10sdk.common.A10BaseClass import A10BaseClass
class DfBitTransparency(A10BaseClass):
"""Class Description::
Add an empty IPv6 fragmentation header if IPv4 DF bit is zero (default:disabled).
Class df-bit-transparency supports CRUD Operations and inherits from `common/A10BaseClass`.
This cla... | self.DeviceProxy = ""
self.df_bit_value = ""
self.uuid = ""
for keys, value in kwargs.items():
setattr(self,keys, value) | self.required=[]
self.b_key = "df-bit-transparency"
self.a10_url="/axapi/v3/cgnv6/nat64/fragmentation/df-bit-transparency" | random_line_split |
CXXII.py | #!/usr/bin/env python3
#----------------------------------------------------------------------------
#
# Copyright (C) 2015 José Flávio de Souza Dias Júnior
#
# This file is part of CXXII - http://www.joseflavio.com/cxxii/
#
# CXXII is free software: you can redistribute it and/or modify
# it under the terms of the... | global CXXII_XML_Arquivos
CXXII_XML_Arquivos.append( CXXII_XML_Arquivo(endereco) )
def CXXII_Separadores( endereco ):
"""Substitui os separadores "/" pelo separador real do sistema operacional."""
return endereco.replace('/', os.sep)
def CXXII_Python_Formato( arquivo ):
"""Retorna o valor de "# co... | ] == '/' : url = url[0:-1]
if destino is None :
global CXXII_Diretorio
destino = CXXII_Diretorio
if destino[-1] == os.sep : destino = destino[0:-1]
if nome is None : nome = url.replace('/', '_').replace(':', '_')
endereco = destino + os.sep + nome
existe ... | identifier_body |
CXXII.py | #!/usr/bin/env python3
#----------------------------------------------------------------------------
#
# Copyright (C) 2015 José Flávio de Souza Dias Júnior
#
# This file is part of CXXII - http://www.joseflavio.com/cxxii/
#
# CXXII is free software: you can redistribute it and/or modify
# it under the terms of the... | elif gerpy or gerzip:
argumento_g = CXXII_Texto(os.path.abspath(argumento_g))
else:
gerurl = True
gernome += '.zip'
gerzip = True
argumento_g = CXXII_Baixar(url=CXXII_Repositorio + gernome, destino=CXXII_Geradores, forcar=CXXII_Gerador_Baixar)
... | gerpy = gernome.endswith('.py')
gerzip = gernome.endswith('.zip')
if gerurl:
argumento_g = CXXII_Baixar(url=argumento_g, destino=CXXII_Geradores, forcar=CXXII_Gerador_Baixar) | random_line_split |
CXXII.py | #!/usr/bin/env python3
#----------------------------------------------------------------------------
#
# Copyright (C) 2015 José Flávio de Souza Dias Júnior
#
# This file is part of CXXII - http://www.joseflavio.com/cxxii/
#
# CXXII is free software: you can redistribute it and/or modify
# it under the terms of the... |
import unicodedata
import urllib.request
import tempfile
import zipfile
import re
from xml.etree.ElementTree import ElementTree as CXXII_XML_Arvore
#----------------------------------------------------------------------------
class CXXII_XML_Arquivo:
"""Classe que representa um arquivo XML."""
def __init_... | nte.')
sys.exit(1)
import os
import time
import datetime | conditional_block |
CXXII.py | #!/usr/bin/env python3
#----------------------------------------------------------------------------
#
# Copyright (C) 2015 José Flávio de Souza Dias Júnior
#
# This file is part of CXXII - http://www.joseflavio.com/cxxii/
#
# CXXII is free software: you can redistribute it and/or modify
# it under the terms of the... | alse ):
"""Download de arquivo."""
if url[-1] == '/' : url = url[0:-1]
if destino is None :
global CXXII_Diretorio
destino = CXXII_Diretorio
if destino[-1] == os.sep : destino = destino[0:-1]
if nome is None : nome = url.replace('/', '_').replace(':', '_'... | ne, forcar=F | identifier_name |
TextContent.ts | /*
* This file is part of *** M y C o R e ***
* See http://www.mycore.de/ for details.
*
* MyCoRe is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option)... | *
* You should have received a copy of the GNU General Public License
* along with MyCoRe. If not, see <http://www.gnu.org/licenses/>.
*/
/// <reference path="../../Utils.ts" />
namespace mycore.viewer.model {
export interface TextContentModel {
content : Array<TextElement>;
links: Link[];
... | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. | random_line_split |
htmltablecolelement.rs | /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::inheritance::Castable;
use crate::dom::bindings::root::DomRoot;
use crate::dom::documen... | )),
document,
);
n.upcast::<Node>().set_weird_parser_insertion_mode();
n
}
} | ) -> DomRoot<HTMLTableColElement> {
let n = Node::reflect_node(
Box::new(HTMLTableColElement::new_inherited(
local_name, prefix, document, | random_line_split |
htmltablecolelement.rs | /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::inheritance::Castable;
use crate::dom::bindings::root::DomRoot;
use crate::dom::documen... |
}
| {
let n = Node::reflect_node(
Box::new(HTMLTableColElement::new_inherited(
local_name, prefix, document,
)),
document,
);
n.upcast::<Node>().set_weird_parser_insertion_mode();
n
} | identifier_body |
htmltablecolelement.rs | /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::inheritance::Castable;
use crate::dom::bindings::root::DomRoot;
use crate::dom::documen... | (
local_name: LocalName,
prefix: Option<Prefix>,
document: &Document,
) -> DomRoot<HTMLTableColElement> {
let n = Node::reflect_node(
Box::new(HTMLTableColElement::new_inherited(
local_name, prefix, document,
)),
document,
)... | new | identifier_name |
error.rs | use rustc_serialize::json;
use rustc_serialize::Decoder;
use rustc_serialize::Decodable;
use std::str;
use std::fmt;
/// Documentation References:
/// https://developer.github.com/v3/#client-errors
/// `ErrorCode` represents the type of error that was reported
/// as a response on a request to th Github API.
#[deriv... | (code: u32) -> bool {
code == STATUS_OK
}
| check_status_code | identifier_name |
error.rs | use rustc_serialize::json;
use rustc_serialize::Decoder;
use rustc_serialize::Decodable;
use std::str;
use std::fmt;
/// Documentation References:
/// https://developer.github.com/v3/#client-errors
/// `ErrorCode` represents the type of error that was reported
/// as a response on a request to th Github API.
#[deriv... | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let msg: &str = match *self {
ErrorCode::Missing => "resource does not exist",
ErrorCode::MissingField => "required field on the resource has not been set",
ErrorCode::Invalid => "the formatting of the field is invali... | Unknown(String),
}
/// Allowing `ErrorCode` to be printed via `{}`.
impl fmt::Display for ErrorCode { | random_line_split |
check_internal.rs | /*
Copyright 2013 Jesse 'Jeaye' Wilkerson
See licensing in LICENSE file, or at:
http://www.opensource.org/licenses/BSD-3-Clause
File: client/gfx/check_internal.rs
Author: Jesse 'Jeaye' Wilkerson
Description:
Provides a handy macro to check the outcome
of an OpenGL call for error... | {
use gl2 = opengles::gl2;
use log::Log;
let err = gl2::get_error();
if err != gl2::NO_ERROR
{
log_error!(func);
log_fail!(util::get_err_str(err));
}
}
#[cfg(not(check_gl))]
pub fn check_gl(_func: &str)
{ }
macro_rules! check
(
($func:expr) =>
({
let ret = $func;
check::check_gl(st... | #[path = "../log/macros.rs"]
mod macros;
#[cfg(check_gl)]
pub fn check_gl(func: &str) | random_line_split |
check_internal.rs | /*
Copyright 2013 Jesse 'Jeaye' Wilkerson
See licensing in LICENSE file, or at:
http://www.opensource.org/licenses/BSD-3-Clause
File: client/gfx/check_internal.rs
Author: Jesse 'Jeaye' Wilkerson
Description:
Provides a handy macro to check the outcome
of an OpenGL call for error... | (_func: &str)
{ }
macro_rules! check
(
($func:expr) =>
({
let ret = $func;
check::check_gl(stringify!($func));
ret
});
)
macro_rules! check_unsafe
(
($func:expr) =>
({
unsafe { check!($func) }
});
)
| check_gl | identifier_name |
check_internal.rs | /*
Copyright 2013 Jesse 'Jeaye' Wilkerson
See licensing in LICENSE file, or at:
http://www.opensource.org/licenses/BSD-3-Clause
File: client/gfx/check_internal.rs
Author: Jesse 'Jeaye' Wilkerson
Description:
Provides a handy macro to check the outcome
of an OpenGL call for error... |
macro_rules! check
(
($func:expr) =>
({
let ret = $func;
check::check_gl(stringify!($func));
ret
});
)
macro_rules! check_unsafe
(
($func:expr) =>
({
unsafe { check!($func) }
});
)
| { } | identifier_body |
check_internal.rs | /*
Copyright 2013 Jesse 'Jeaye' Wilkerson
See licensing in LICENSE file, or at:
http://www.opensource.org/licenses/BSD-3-Clause
File: client/gfx/check_internal.rs
Author: Jesse 'Jeaye' Wilkerson
Description:
Provides a handy macro to check the outcome
of an OpenGL call for error... |
}
#[cfg(not(check_gl))]
pub fn check_gl(_func: &str)
{ }
macro_rules! check
(
($func:expr) =>
({
let ret = $func;
check::check_gl(stringify!($func));
ret
});
)
macro_rules! check_unsafe
(
($func:expr) =>
({
unsafe { check!($func) }
});
)
| {
log_error!(func);
log_fail!(util::get_err_str(err));
} | conditional_block |
brief_forms.py | from wtforms import IntegerField, SelectMultipleField
from wtforms.validators import NumberRange
from dmutils.forms import DmForm
import flask_featureflags
class BriefSearchForm(DmForm):
| page = IntegerField(default=1, validators=(NumberRange(min=1),))
status = SelectMultipleField("Status", choices=(
("live", "Open",),
("closed", "Closed",)
))
# lot choices expected to be set at runtime
lot = SelectMultipleField("Category")
def __init__(self, *args, **kwargs):
... | identifier_body | |
brief_forms.py | from wtforms import IntegerField, SelectMultipleField
from wtforms.validators import NumberRange
from dmutils.forms import DmForm
import flask_featureflags
class BriefSearchForm(DmForm):
page = IntegerField(default=1, validators=(NumberRange(min=1),))
status = SelectMultipleField("Status", choices=(
(... | (self):
if not self.validate():
raise ValueError("Invalid form")
statuses = self.status.data or tuple(id for id, label in self.status.choices)
lots = self.lot.data or tuple(id for id, label in self.lot.choices)
# disable framework filtering when digital marketplace framewor... | get_briefs | identifier_name |
brief_forms.py | from wtforms import IntegerField, SelectMultipleField
from wtforms.validators import NumberRange
from dmutils.forms import DmForm
import flask_featureflags
class BriefSearchForm(DmForm):
page = IntegerField(default=1, validators=(NumberRange(min=1),))
status = SelectMultipleField("Status", choices=(
(... | return self._data_api_client.find_briefs(
status=",".join(statuses),
lot=",".join(lots),
page=self.page.data,
per_page=75,
human=True,
**kwargs
)
def get_filters(self):
"""
generate the same "filters" struct... | lots = self.lot.data or tuple(id for id, label in self.lot.choices)
# disable framework filtering when digital marketplace framework is live
kwargs = {} if flask_featureflags.is_active('DM_FRAMEWORK') else {"framework": self._framework_slug}
| random_line_split |
brief_forms.py | from wtforms import IntegerField, SelectMultipleField
from wtforms.validators import NumberRange
from dmutils.forms import DmForm
import flask_featureflags
class BriefSearchForm(DmForm):
page = IntegerField(default=1, validators=(NumberRange(min=1),))
status = SelectMultipleField("Status", choices=(
(... |
return [
{
"label": field.label,
"filters": [
{
"label": choice_label,
"name": field.name,
"id": "{}-{}".format(field.id, choice_id),
"value": choice_... | raise ValueError("Invalid form") | conditional_block |
accessibilityHelp.ts | /*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*---------------------------------------------------------------... | (): void {
this._widget.show();
}
public hide(): void {
this._widget.hide();
}
}
const nlsNoSelection = nls.localize("noSelection", "No selection");
const nlsSingleSelectionRange = nls.localize("singleSelectionRange", "Line {0}, Column {1} ({2} selected)");
const nlsSingleSelection = nls.localize("singleSelect... | show | identifier_name |
accessibilityHelp.ts | /*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*---------------------------------------------------------------... |
if (e.equals(KeyMod.CtrlCmd | KeyCode.KEY_E)) {
alert(nls.localize("emergencyConfOn", "Now changing the setting `accessibilitySupport` to 'on'."));
this._editor.updateOptions({
accessibilitySupport: 'on'
});
dom.clearNode(this._contentDomNode.domNode);
this._buildContent();
this._con... | {
return;
} | conditional_block |
accessibilityHelp.ts | /*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*---------------------------------------------------------------... |
public run(accessor: ServicesAccessor, editor: ICommonCodeEditor): void {
let controller = AccessibilityHelpController.get(editor);
if (controller) {
controller.show();
}
}
}
const AccessibilityHelpCommand = EditorCommand.bindToContribution<AccessibilityHelpController>(AccessibilityHelpController.get);
C... | {
super({
id: 'editor.action.showAccessibilityHelp',
label: nls.localize("ShowAccessibilityHelpAction", "Show Accessibility Help"),
alias: 'Show Accessibility Help',
precondition: null,
kbOpts: {
kbExpr: EditorContextKeys.focus,
primary: (browser.isIE ? KeyMod.CtrlCmd | KeyCode.F1 : KeyMod.Alt ... | identifier_body |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.