file_name large_stringlengths 4 140 | prefix large_stringlengths 0 12.1k | suffix large_stringlengths 0 12k | middle large_stringlengths 0 7.51k | fim_type large_stringclasses 4
values |
|---|---|---|---|---|
system_model.rs | // This file is part of zinc64.
// Copyright (c) 2016-2019 Sebastian Jastrzebski. All rights reserved.
// Licensed under the GPLv3. See LICENSE file in the project root for full license text.
/*
| Video | # of | Visible | Cycles/ | Visible
Type | system | lines | lines | line | pixels/line
----... | (model: &str) -> SystemModel {
match model {
"ntsc" => SystemModel::c64_ntsc(),
"pal" => SystemModel::c64_pal(),
"c64-ntsc" => SystemModel::c64_ntsc(),
"c64-pal" => SystemModel::c64_pal(),
_ => panic!("invalid model {}", model),
}
}
pu... | from | identifier_name |
text_buffer.rs | // Copyright 2013-2016, The Gtk-rs Project Developers.
// See the COPYRIGHT file at the top-level directory of this distribution.
// Licensed under the MIT license, see the LICENSE file or <http://opensource.org/licenses/MIT>
use libc::{c_char, c_int};
use ffi;
use glib::translate::*;
use TextBuffer;
use TextIter;
im... |
pub fn insert_interactive_at_cursor(&self, text: &str, default_editable: bool) -> bool {
unsafe {
from_glib(ffi::gtk_text_buffer_insert_interactive_at_cursor(self.to_glib_none().0,
text.as_ptr() as *const c_char, text.len() as c_int, default_editable.to_glib()))
}
}... | {
unsafe {
from_glib(
ffi::gtk_text_buffer_insert_interactive(self.to_glib_none().0,
iter.to_glib_none_mut().0, text.as_ptr() as *const c_char, text.len() as c_int,
default_editable.to_glib()))
}
} | identifier_body |
text_buffer.rs | // Copyright 2013-2016, The Gtk-rs Project Developers.
// See the COPYRIGHT file at the top-level directory of this distribution.
// Licensed under the MIT license, see the LICENSE file or <http://opensource.org/licenses/MIT>
use libc::{c_char, c_int};
use ffi;
use glib::translate::*;
use TextBuffer;
use TextIter;
im... | (&self, iter: &mut TextIter, text: &str, default_editable: bool)
-> bool {
unsafe {
from_glib(
ffi::gtk_text_buffer_insert_interactive(self.to_glib_none().0,
iter.to_glib_none_mut().0, text.as_ptr() as *const c_char, text.len() as c_int,
... | insert_interactive | identifier_name |
text_buffer.rs | // Copyright 2013-2016, The Gtk-rs Project Developers.
// See the COPYRIGHT file at the top-level directory of this distribution.
// Licensed under the MIT license, see the LICENSE file or <http://opensource.org/licenses/MIT>
use libc::{c_char, c_int};
use ffi;
use glib::translate::*;
use TextBuffer;
use TextIter;
im... | text.as_ptr() as *const c_char, text.len() as c_int);
}
}
pub fn insert_interactive(&self, iter: &mut TextIter, text: &str, default_editable: bool)
-> bool {
unsafe {
from_glib(
ffi::gtk_text_buffer_insert_interactive(self.to_glib_none().0... |
pub fn insert_at_cursor(&self, text: &str) {
unsafe {
ffi::gtk_text_buffer_insert_at_cursor(self.to_glib_none().0, | random_line_split |
_user.model.ts | <%#
Copyright 2013-2018 the original author or authors from the JHipster project.
This file is part of the JHipster project, see http://www.jhipster.tech/
for more information.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You ma... | {
public id?: any;
public login?: string;
public firstName?: string;
public lastName?: string;
public email?: string;
public activated?: Boolean;
public langKey?: string;
public authorities?: any[];
public createdBy?: string;
public createdDate?: Date;
public lastModifiedBy?... | User | identifier_name |
_user.model.ts | <%#
Copyright 2013-2018 the original author or authors from the JHipster project.
This file is part of the JHipster project, see http://www.jhipster.tech/
for more information.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You ma... | 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.
-%>
export class User {
public id?: any;
public login?: string;
pu... | Unless required by applicable law or agreed to in writing, software | random_line_split |
hitter.py |
@classmethod
def read_hosts_file(cls, filename):
mapping = {}
for line in open(filename).readlines():
if line.strip() == '':
continue
elif line.strip().find('#') == 0:
continue
elif len(line.split()) < 2:
conti... | self.filename = filename
try:
os.stat(self.filename)
except:
raise
self.mapping = self.read_hosts_file(filename) | identifier_body | |
hitter.py | False
if not all([i.isdigit() for i in d]):
return False
if not all([int(i, 10) >= 0 for i in d]):
return False
if not all([int(i, 10) <= 255 for i in d]):
return False
return True
def resolve_host(self, ip_host):
if ip_host in self.mappi... | callback=self.process_and_report)
return msgs | random_line_split | |
hitter.py | raise
self.mapping = self.read_hosts_file(filename)
@classmethod
def read_hosts_file(cls, filename):
mapping = {}
for line in open(filename).readlines():
if line.strip() == '':
continue
elif line.strip().find('#') == 0:
continue
... | (cls, data):
t, msg = cls.split_alert_message(data)
if len(t) == 0:
return "UNKNOWN"
v = int(t, 10)
if v > 7:
v &= 0x7
return cls.SYSLOG_MSG_TYPE[v]
@classmethod
def format_timestamp(self, tstamp):
if self.TZ_INFO is not None:
... | calculate_msg_type | identifier_name |
hitter.py | raise
self.mapping = self.read_hosts_file(filename)
@classmethod
def read_hosts_file(cls, filename):
mapping = {}
for line in open(filename).readlines():
if line.strip() == '':
continue
elif line.strip().find('#') == 0:
continue
... |
return str(tstamp.strftime("%Y-%m-%dT%H:%M:%S") +\
".%03d" % (tstamp.microsecond / 1000))
@classmethod
def get_base_json(cls, syslog_msg, syslog_server_ip,
catcher_name, catcher_host, catcher_tz):
r = {'source': "syslog", 'raw': syslog_msg,
'type'... | local_tz = self.TZ_INFO.localize(tstamp, is_dst=None)
utc_tz = local_tz.astimezone(pytz.utc)
return str(utc_tz.strftime("%Y-%m-%dT%H:%M:%S") +\
".%03d" % (tstamp.microsecond / 1000) + "Z") | conditional_block |
main.rs | extern crate rsedis;
extern crate config;
extern crate logger;
extern crate networking;
extern crate compat;
use std::env::args;
use std::process::exit;
use std::thread;
use compat::getpid;
use config::Config;
use networking::Server;
use logger::{Logger, Level};
fn main() {
let mut config = Config::new(Logger::n... | }
let (port, daemonize) = (config.port, config.daemonize);
let mut server = Server::new(config);
if !daemonize {
println!("Port: {}", port);
println!("PID: {}", getpid());
}
server.run();
} | },
},
None => (), | random_line_split |
main.rs | extern crate rsedis;
extern crate config;
extern crate logger;
extern crate networking;
extern crate compat;
use std::env::args;
use std::process::exit;
use std::thread;
use compat::getpid;
use config::Config;
use networking::Server;
use logger::{Logger, Level};
fn main() | server.run();
}
| {
let mut config = Config::new(Logger::new(Level::Notice));
match args().nth(1) {
Some(f) => match config.parsefile(f) {
Ok(_) => (),
Err(_) => {
thread::sleep_ms(100);
// I'm not proud, but fatal errors are logged in a background thread
... | identifier_body |
main.rs | extern crate rsedis;
extern crate config;
extern crate logger;
extern crate networking;
extern crate compat;
use std::env::args;
use std::process::exit;
use std::thread;
use compat::getpid;
use config::Config;
use networking::Server;
use logger::{Logger, Level};
fn | () {
let mut config = Config::new(Logger::new(Level::Notice));
match args().nth(1) {
Some(f) => match config.parsefile(f) {
Ok(_) => (),
Err(_) => {
thread::sleep_ms(100);
// I'm not proud, but fatal errors are logged in a background thread
... | main | identifier_name |
methods.js | exports.definition = {
/**
* Add custom methods to your Model`s Records
* just define a function:
* ```js
* this.function_name = function(){
* //this == Record
* };
* ```
* This will automatically add the new method to your Record
*
* @class Definition
* @name Custom Record Me... |
this.use(function() {
// get all current property names
objKeys = Object.keys(this)
}, 90)
this.on('finished', function() {
// an now search for new ones ==> instance methods for our new model class
Object.keys(self).forEach(function(name) {
if (objKeys.indexOf(name) === -... | var objKeys = []
var self = this | random_line_split |
methods.js | exports.definition = {
/**
* Add custom methods to your Model`s Records
* just define a function:
* ```js
* this.function_name = function(){
* //this == Record
* };
* ```
* This will automatically add the new method to your Record
*
* @class Definition
* @name Custom Record Me... |
})
})
}
}
| {
self.instanceMethods[name] = self[name]
delete self[name]
} | conditional_block |
unicodecsv.py | # -*- coding: utf-8 -*-
import sys
import csv
from itertools import izip
# https://pypi.python.org/pypi/unicodecsv
# http://semver.org/
VERSION = (0, 9, 4)
__version__ = ".".join(map(str, VERSION))
pass_throughs = [
'register_dialect',
'unregister_dialect',
'get_dialect',
'list_dialects',
'field_... | f):
return self.writer.dialect
writer = UnicodeWriter
class UnicodeReader(object):
def __init__(self, f, dialect=None, encoding='utf-8', errors='strict',
**kwds):
format_params = ['delimiter', 'doublequote', 'escapechar',
'lineterminator', 'quotechar', 'q... | ect(sel | identifier_name |
unicodecsv.py | # -*- coding: utf-8 -*-
import sys
import csv
from itertools import izip
# https://pypi.python.org/pypi/unicodecsv
# http://semver.org/
VERSION = (0, 9, 4)
__version__ = ".".join(map(str, VERSION))
pass_throughs = [
'register_dialect',
'unregister_dialect',
'get_dialect',
'list_dialects',
'field_... | s = str(s)
return s
def _stringify_list(l, encoding, errors='strict'):
try:
return [_stringify(s, encoding, errors) for s in iter(l)]
except TypeError, e:
raise csv.Error(str(e))
def _unicodify(s, encoding):
if s is None:
return None
if isinstance(s, (unicode, int... | random_line_split | |
unicodecsv.py | # -*- coding: utf-8 -*-
import sys
import csv
from itertools import izip
# https://pypi.python.org/pypi/unicodecsv
# http://semver.org/
VERSION = (0, 9, 4)
__version__ = ".".join(map(str, VERSION))
pass_throughs = [
'register_dialect',
'unregister_dialect',
'get_dialect',
'list_dialects',
'field_... | except UnicodeDecodeError as e:
# attempt a different encoding...
encoding = 'ISO-8859-1'
val = [(value if isinstance(value, float_) else unicode_(value, encoding, encoding_errors))
for value in row]
return val
def __iter__(self):
retur... | __init__(self, f, dialect=None, encoding='utf-8', errors='strict',
**kwds):
format_params = ['delimiter', 'doublequote', 'escapechar',
'lineterminator', 'quotechar', 'quoting', 'skipinitialspace']
if dialect is None:
if not any([kwd_name in format_pa... | identifier_body |
unicodecsv.py | # -*- coding: utf-8 -*-
import sys
import csv
from itertools import izip
# https://pypi.python.org/pypi/unicodecsv
# http://semver.org/
VERSION = (0, 9, 4)
__version__ = ".".join(map(str, VERSION))
pass_throughs = [
'register_dialect',
'unregister_dialect',
'get_dialect',
'list_dialects',
'field_... |
def _stringify(s, encoding, errors):
if s is None:
return ''
if isinstance(s, unicode):
return s.encode(encoding, errors)
elif isinstance(s, (int, float)):
pass # let csv.QUOTE_NONNUMERIC do its thing.
elif not isinstance(s, str):
s = str(s)
return s
def _string... | globals()[prop] = getattr(csv, prop) | conditional_block |
versioninfo_cs.ts | import FS from "fs";
// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
const matcher = /\[assembly: AssemblyVersion\("([^"]+)"/;
export function readVersion(contents: string): string {
const arr = m... | export function writeVersion(): string {
throw new Error("Changing the version of the CS file is not supported.");
}
// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* istanbul ignore if */
if (req... | }
| random_line_split |
versioninfo_cs.ts | import FS from "fs";
// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
const matcher = /\[assembly: AssemblyVersion\("([^"]+)"/;
export function readVersion(contents: string): string |
export function writeVersion(): string {
throw new Error("Changing the version of the CS file is not supported.");
}
// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* istanbul ignore if */
if ... | {
const arr = matcher.exec(contents);
if (arr !== null && arr.length === 2) {
return arr[1];
}
return "";
} | identifier_body |
versioninfo_cs.ts | import FS from "fs";
// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
const matcher = /\[assembly: AssemblyVersion\("([^"]+)"/;
export function readVersion(contents: string): string {
const arr = m... | (): string {
throw new Error("Changing the version of the CS file is not supported.");
}
// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* istanbul ignore if */
if (require.main === module) {
... | writeVersion | identifier_name |
versioninfo_cs.ts | import FS from "fs";
// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
const matcher = /\[assembly: AssemblyVersion\("([^"]+)"/;
export function readVersion(contents: string): string {
const arr = m... | {
const args = process.argv.slice(2);
process.stdout.write(readVersion(FS.readFileSync(args[0], "utf8")) + "\n");
} | conditional_block | |
asdriver_nofil.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Driver for ecoli.py
import os, re, time, subprocess
iterModDiv = 1
dirPathList = ["/home/tomas/documenten/modelling/diatomas_symlink/results/as_low_bridging_seed2"]
for d in dirPathList:
print(time.strftime('%H:%M:%S ') + d)
dAbs = d + "/output"
fileList = [... |
###################
print(time.strftime('%H:%M:%S ') + "\t" + f)
if not int(re.match('g(\d{4})r(\d{4}).mat',f).group(2))%iterModDiv == 0:
# relaxation iteration (YYYY in filename gXXXXrYYYY.mat) % iterModulusDivider == 0
continue
fAbs = dAbs + "/" + f
c... | continue | conditional_block |
asdriver_nofil.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Driver for ecoli.py
import os, re, time, subprocess
iterModDiv = 1
dirPathList = ["/home/tomas/documenten/modelling/diatomas_symlink/results/as_low_bridging_seed2"]
for d in dirPathList:
print(time.strftime('%H:%M:%S ') + d)
dAbs = d + "/output"
fileList = [... | print("#####################################") | stdout = stdout.decode()
if 'Error' in stdout:
print("#####################################")
print(stdout) | random_line_split |
instruction_def.rs | use instruction::Reg;
use operand::OperandSize;
pub struct InstructionDefinition {
pub mnemonic: String,
pub allow_prefix: bool,
pub operand_size_prefix: OperandSizePrefixBehavior,
pub address_size_prefix: Option<bool>,
pub f2_prefix: PrefixBehavior,
pub f3_prefix: PrefixBehavior,
pub compo... | {
Reg(Reg),
Constant(u32)
}
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum VexOperandBehavior {
Nds,
Ndd,
Dds
}
| FixedOperand | identifier_name |
instruction_def.rs | use instruction::Reg;
use operand::OperandSize;
pub struct InstructionDefinition {
pub mnemonic: String,
pub allow_prefix: bool,
pub operand_size_prefix: OperandSizePrefixBehavior,
pub address_size_prefix: Option<bool>,
pub f2_prefix: PrefixBehavior,
pub f3_prefix: PrefixBehavior,
pub compo... |
#[derive(Clone, Copy, Debug)]
pub enum OperandAccess {
Read,
Write,
ReadWrite
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RegType {
General,
Mmx,
Avx,
Fpu,
Bound,
Mask,
Segment,
Control,
Debug
}
#[derive(Clone, Copy, Debug)]
pub enum FixedOperand {
Reg(... | } | random_line_split |
ipy.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
##
# ipy.py: Interaction with IPython and Jupyter.
##
# © 2016 Chris Ferrie (csferrie@gmail.com) and
# Christopher E. Granade (cgranade@gmail.com)
#
# This file is a part of the Qinfer project.
# Licensed under the AGPL version 3.
##
# This program is free software:... | self.widget = ipw.FloatProgress(
value=0.0, min=0.0, max=100.0, step=0.5,
description=""
)
@property
def description(self):
"""
Text description for the progress bar widget,
or ``None`` if the widget has been closed.
:type: `str`
... | aise ImportError("IPython support requires the ipywidgets package.")
| conditional_block |
ipy.py | #!/usr/bin/python | # © 2016 Chris Ferrie (csferrie@gmail.com) and
# Christopher E. Granade (cgranade@gmail.com)
#
# This file is a part of the Qinfer project.
# Licensed under the AGPL version 3.
##
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public Lic... | # -*- coding: utf-8 -*-
##
# ipy.py: Interaction with IPython and Jupyter.
## | random_line_split |
ipy.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
##
# ipy.py: Interaction with IPython and Jupyter.
##
# © 2016 Chris Ferrie (csferrie@gmail.com) and
# Christopher E. Granade (cgranade@gmail.com)
#
# This file is a part of the Qinfer project.
# Licensed under the AGPL version 3.
##
# This program is free software:... | self, n):
"""
Updates the progress bar to display a new value.
"""
try:
self.widget.value = n
except:
pass
def finished(self):
"""
Destroys the progress bar.
"""
try:
self.widget.close()
except:
... | pdate( | identifier_name |
ipy.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
##
# ipy.py: Interaction with IPython and Jupyter.
##
# © 2016 Chris Ferrie (csferrie@gmail.com) and
# Christopher E. Granade (cgranade@gmail.com)
#
# This file is a part of the Qinfer project.
# Licensed under the AGPL version 3.
##
# This program is free software:... | ""
Destroys the progress bar.
"""
try:
self.widget.close()
except:
pass
| identifier_body | |
healpix.py | import numpy as np
import exceptions
import healpy
from file import read
def read_map(filename, HDU=0, field=0, nest=False):
|
def read_mask(filename, HDU=0, field=0, nest=False):
m = read_map(filename, HDU, field, nest)
return np.logical_not(m.filled()).astype(np.bool)
| """Read Healpix map
all columns of the specified HDU are read into a compound numpy MASKED array
if nest is not None, the map is converted if need to NEST or RING ordering.
this function requires healpy"""
m, h = read(filename, HDU=HDU, return_header=True)
try:
m = m[field]
except except... | identifier_body |
healpix.py | import numpy as np
import exceptions
import healpy
from file import read
def read_map(filename, HDU=0, field=0, nest=False):
"""Read Healpix map
all columns of the specified HDU are read into a compound numpy MASKED array | m, h = read(filename, HDU=HDU, return_header=True)
try:
m = m[field]
except exceptions.KeyError:
m = m.values()[field]
nside = healpy.npix2nside(m.size)
if not nest is None:
if h.get('ORDERING', False):
if h['ORDERING'] == 'NESTED' and not nest:
id... | if nest is not None, the map is converted if need to NEST or RING ordering.
this function requires healpy""" | random_line_split |
healpix.py | import numpy as np
import exceptions
import healpy
from file import read
def read_map(filename, HDU=0, field=0, nest=False):
"""Read Healpix map
all columns of the specified HDU are read into a compound numpy MASKED array
if nest is not None, the map is converted if need to NEST or RING ordering.
thi... |
elif h['ORDERING'] == 'RING' and nest:
idx = healpy.nest2ring(nside,np.arange(m.size,dtype=np.int32))
m = m[idx]
return healpy.ma(m)
def read_mask(filename, HDU=0, field=0, nest=False):
m = read_map(filename, HDU, field, nest)
return np.logical_not(m.filled()).a... | idx = healpy.ring2nest(nside,np.arange(m.size,dtype=np.int32))
m = m[idx] | conditional_block |
healpix.py | import numpy as np
import exceptions
import healpy
from file import read
def | (filename, HDU=0, field=0, nest=False):
"""Read Healpix map
all columns of the specified HDU are read into a compound numpy MASKED array
if nest is not None, the map is converted if need to NEST or RING ordering.
this function requires healpy"""
m, h = read(filename, HDU=HDU, return_header=True)
... | read_map | identifier_name |
forms.py | import copy
from decimal import Decimal
import datetime
from celery_formtask.tasks import processform, PROGRESS_STATE
class FormTaskMixin:
def __init__(self, *args, task=None, ignored_kwargs=[], **kwargs):
self._task = task
self._args_bak = args
self._kwargs_bak = copy.copy(kwargs)
... | opts = {"shadow": name} if name else {}
async_result = processform.apply_async(
args=(self.__class__.__module__, self.__class__.__name__) + self._args_bak,
kwargs=self._kwargs_bak,
**opts
)
return async_result | identifier_body | |
forms.py | import copy
from decimal import Decimal
import datetime
from celery_formtask.tasks import processform, PROGRESS_STATE
class FormTaskMixin:
def __init__(self, *args, task=None, ignored_kwargs=[], **kwargs):
self._task = task
self._args_bak = args
self._kwargs_bak = copy.copy(kwargs)
... | meta={
"current": current,
"total": meta_total,
"percent": meta_percent,
"description": meta_description,
"time": datetime.datetime.utcnow(),
},
)
def enqueue(self, name=N... | state=PROGRESS_STATE, | random_line_split |
forms.py | import copy
from decimal import Decimal
import datetime
from celery_formtask.tasks import processform, PROGRESS_STATE
class FormTaskMixin:
def __init__(self, *args, task=None, ignored_kwargs=[], **kwargs):
self._task = task
self._args_bak = args
self._kwargs_bak = copy.copy(kwargs)
... | (self, current=None, total=None, description=""):
if self._task:
meta_total = total or getattr(self, "formtask_total_steps", None)
meta_description = description or getattr(
self, "formtask_description", None
)
if (
meta_total is no... | set_progress | identifier_name |
forms.py | import copy
from decimal import Decimal
import datetime
from celery_formtask.tasks import processform, PROGRESS_STATE
class FormTaskMixin:
def __init__(self, *args, task=None, ignored_kwargs=[], **kwargs):
self._task = task
self._args_bak = args
self._kwargs_bak = copy.copy(kwargs)
... |
super().__init__(*args, **kwargs)
def set_progress(self, current=None, total=None, description=""):
if self._task:
meta_total = total or getattr(self, "formtask_total_steps", None)
meta_description = description or getattr(
self, "formtask_description", None... | kwargs.pop(kwarg) | conditional_block |
index.js | var _ = require('../../util')
var handlers = {
text: require('./text'),
radio: require('./radio'),
select: require('./select'),
checkbox: require('./checkbox')
}
module.exports = {
priority: 800,
twoWay: true,
handlers: handlers,
/**
* Possible elements:
* <select>
* <textarea>
* <... | else if (tag === 'SELECT') {
handler = handlers.select
} else if (tag === 'TEXTAREA') {
handler = handlers.text
} else {
process.env.NODE_ENV !== 'production' && _.warn(
'v-model does not support element type: ' + tag
)
return
}
handler.bind.call(this)
this.upd... | {
handler = handlers[el.type] || handlers.text
} | conditional_block |
index.js | var _ = require('../../util')
var handlers = {
text: require('./text'),
radio: require('./radio'),
select: require('./select'),
checkbox: require('./checkbox')
}
module.exports = {
priority: 800,
twoWay: true,
handlers: handlers,
/**
* Possible elements:
* <select>
* <textarea>
* <... | handler = handlers[el.type] || handlers.text
} else if (tag === 'SELECT') {
handler = handlers.select
} else if (tag === 'TEXTAREA') {
handler = handlers.text
} else {
process.env.NODE_ENV !== 'production' && _.warn(
'v-model does not support element type: ' + tag
)
... | }
var el = this.el
var tag = el.tagName
var handler
if (tag === 'INPUT') { | random_line_split |
setup.py | # 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 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# bu... | # See LICENSE for more details.
#
# Copyright (c) 2013-2014 Red Hat
# Author: Cleber Rosa <cleber@redhat.com>
# pylint: disable=E0611
from distutils.core import setup
from sphinx.setup_command import BuildDoc
import arc.version
setup(name='arc',
version=arc.version.VERSION,
description='Autotest RPC Clie... | # | random_line_split |
animation.js | !../../amp-animation/0.1/web-animations.Builder
* >} webAnimationBuilderPromise
* @param {!../../../src/service/vsync-impl.Vsync} vsync
* @param {!../../../src/service/timer-impl.Timer} timer
* @param {!AnimationSequence} sequence
*/
constructor(
page, animationDef, webAnimationBuilderPromise, ... |
return this.getDims().then(keyframesArrayOrFn);
}
/**
* @return {!Promise<
* !../../amp-animation/0.1/web-animation-types.WebKeyframeAnimationDef>}
* @private
*/
getWebAnimationDef_() {
return this.keyframes_.then(keyframes => ({
keyframes,
target: this.target_,
duration:... | {
return Promise.resolve(keyframesArrayOrFn);
} | conditional_block |
animation.js | _());
}
/**
* @return {!Promise}
* @private
*/
getStartWaitPromise_() {
let promise = Promise.resolve();
if (this.animationDef_.startAfterId) {
const startAfterId = /** @type {string} */(
this.animationDef_.startAfterId);
promise = promise.then(() => this.sequence_.waitFor(s... | random_line_split | ||
animation.js | * !../../amp-animation/0.1/web-animations.Builder
* >} webAnimationBuilderPromise
* @param {!../../../src/service/vsync-impl.Vsync} vsync
* @param {!../../../src/service/timer-impl.Timer} timer
* @param {!AnimationSequence} sequence
*/
constructor(
page, animationDef, webAnimationBuilderPromise... | () {
let promise = Promise.resolve();
if (this.animationDef_.startAfterId) {
const startAfterId = /** @type {string} */(
this.animationDef_.startAfterId);
promise = promise.then(() => this.sequence_.waitFor(startAfterId));
}
if (this.delay_) {
promise = promise.then(() => thi... | getStartWaitPromise_ | identifier_name |
animation.js | !../../amp-animation/0.1/web-animations.Builder
* >} webAnimationBuilderPromise
* @param {!../../../src/service/vsync-impl.Vsync} vsync
* @param {!../../../src/service/timer-impl.Timer} timer
* @param {!AnimationSequence} sequence
*/
constructor(
page, animationDef, webAnimationBuilderPromise, ... |
/**
* @param {!PlaybackActivity} activity
* @param {!Promise=} opt_wait
* @private
*/
playback_(activity, opt_wait) {
const wait = opt_wait || null;
this.scheduledActivity_ = activity;
this.scheduledWait_ = wait;
if (this.runner_) {
this.playbackWhenReady_(activity, wait);
... | {
this.scheduledActivity_ = null;
this.scheduledWait_ = null;
if (this.runner_) {
dev().assert(this.runner_).cancel();
}
} | identifier_body |
wall.tsx | If the id sent in was null and there is no active highlight, do nothing.
if(rendered_id === null && !active) {
return;
}
/* If the id sent in was null, it is time to clear out the existing highlight by unmounting the car, removing
* the container from the dom and clearing out the acti... | {
return;
} | conditional_block | |
wall.tsx | import * as ReactDOM from "react-dom";
export type DataLoadedCallback = (items : Array<any>) => void;
export type HighlightAction = (rendered_id : string | null) => void;
export type TransitionAction = () => void;
export interface WallDelegate {
items : (callback : DataLoadedCallback) => void;
interval? : () ... | random_line_split | ||
wall.tsx | () {
this.current = null;
}
enqueue(handler : TransitionInstruction, context : any, delay = DEBOUNCEMENT) : void {
const { current } = this;
if(current !== null) {
clearTimeout(current);
}
// Do nothing if we were given nothing for our instruction.
if(handler === null) {
retur... | constructor | identifier_name | |
wall.tsx | );
}
render() : React.ReactElement<any> {
const { props } = this;
const { delegate, uuid } = props;
const events = {
onMouseOver() : void | ,
onMouseOut() : void { delegate.highlight(null); }
};
return (<div className={CLASSES["WALL_ITEM"]} {...events}><Transclusion item={delegate.item} /></div>);
}
}
return GridItem;
}
function WallFactory(Preview : PreviewClass, Card : CardClass) : ComposedWall {
const GridItem = GridIt... | { delegate.highlight(uuid); } | identifier_body |
pivot-query-sk_test.ts | import './index';
import { assert } from 'chai';
import { $$ } from 'common-sk/modules/dom';
import { PivotQueryChangedEventDetail, PivotQueryChangedEventName, PivotQuerySk } from './pivot-query-sk';
import { eventPromise, setUpElementUnderTest } from '../../../infra-sk/modules/test_util';
import { ParamSet, pivot } f... | };
el.pivotRequest = validPivotRequest;
el.paramset = paramSet;
});
});
describe('click group_by option', () => {
it('emits event with group_by option added', async () => {
const ep = eventPromise<CustomEvent<PivotQueryChangedEventDetail>>(PivotQueryChangedEventName);
// Clic... | config: ['8888', '565'],
arch: ['x86', 'risc-v'],
model: ['Pixel2', 'Pixel3'], | random_line_split |
AbstractEigenvectorModel.js | var clover = new Object();
// JSON: {classes : [{name, id, sl, el, methods : [{sl, el}, ...]}, ...]}
clover.pageData = {"classes":[{"el":46,"id":86762,"methods":[{"el":38,"sc":2,"sl":36}],"name":"AbstractEigenvectorModel","sl":32}]}
// JSON: {test_ID : {"methods": [ID1, ID2, ID3...], "name" : "testXXX() void"}, ...}... | // JSON: { lines : [{tests : [testid1, testid2, testid3, ...]}, ...]};
clover.srcFileLines = [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []] | random_line_split | |
l2t_csv.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2012 The Plaso Project Authors.
# Please see the AUTHORS file for details on individual authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the L... |
def WriteEvent(self, event_object):
"""Write a single event."""
try:
self.EventBody(event_object)
except errors.NoFormatterFound:
logging.error(u'Unable to output line, no formatter found.')
logging.error(event_object)
def EventBody(self, event_object):
"""Formats data as l2t_csv... | """CSV format used by log2timeline, with 17 fixed fields."""
FORMAT_ATTRIBUTE_RE = re.compile('{([^}]+)}')
def Start(self):
"""Returns a header for the output."""
# Build a hostname and username dict objects.
self._hostnames = {}
if self.store:
self._hostnames = helper.BuildHostDict(self.sto... | identifier_body |
l2t_csv.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2012 The Plaso Project Authors.
# Please see the AUTHORS file for details on individual authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the L... | """
if not hasattr(event_object, 'timestamp'):
return
event_formatter = eventdata.EventFormatterManager.GetFormatter(event_object)
if not event_formatter:
raise errors.NoFormatterFound(
u'Unable to find event formatter for: {0:s}.'.format(
event_object.DATA_TYPE))
... | errors.NoFormatterFound: If no formatter for that event is found. | random_line_split |
l2t_csv.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2012 The Plaso Project Authors.
# Please see the AUTHORS file for details on individual authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the L... | (self, event_object):
"""Formats data as l2t_csv and writes to the filehandle from OutputFormater.
Args:
event_object: The event object (EventObject).
Raises:
errors.NoFormatterFound: If no formatter for that event is found.
"""
if not hasattr(event_object, 'timestamp'):
return
... | EventBody | identifier_name |
l2t_csv.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2012 The Plaso Project Authors.
# Please see the AUTHORS file for details on individual authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the L... |
row = ('{0:02d}/{1:02d}/{2:04d}'.format(
date_use.month, date_use.day, date_use.year),
'{0:02d}:{1:02d}:{2:02d}'.format(
date_use.hour, date_use.minute, date_use.second),
self.zone,
helper.GetLegacy(event_object),
source_short,
s... | check_user = pre_obj.GetUsernameById(username)
if check_user != '-':
username = check_user | conditional_block |
actions.js | import Client from '../../../api';
import { AsyncActionStatus } from '../../../const/AsyncActionStatus';
import { getCurrency, getNobtName, getPersonNames } from './selectors';
export const UPDATE_CREATE_NOBT_STATUS = 'NewNobt.UPDATE_CREATE_NOBT_STATUS';
export const SELECT_CURRENCY = 'NewNobt.SELECT_CURRENCY';
expor... | response => {
dispatch(createNobtSucceeded(response));
},
error => dispatch(createNobtFailed(error))
);
};
}
export function selectCurrency(newCurrency) {
return {
type: SELECT_CURRENCY,
payload: {
newCurrency,
},
};
}
export function changeNobtName(newName) {
r... | Client.createNobt(nobtToCreate).then( | random_line_split |
actions.js | import Client from '../../../api';
import { AsyncActionStatus } from '../../../const/AsyncActionStatus';
import { getCurrency, getNobtName, getPersonNames } from './selectors';
export const UPDATE_CREATE_NOBT_STATUS = 'NewNobt.UPDATE_CREATE_NOBT_STATUS';
export const SELECT_CURRENCY = 'NewNobt.SELECT_CURRENCY';
expor... |
function createNobtSucceeded(response) {
return {
type: UPDATE_CREATE_NOBT_STATUS,
payload: {
id: response.data.id,
status: AsyncActionStatus.SUCCESSFUL,
},
};
}
function createNobtFailed(error) {
return {
type: UPDATE_CREATE_NOBT_STATUS,
payload: {
error,
status: As... | {
return {
type: UPDATE_CREATE_NOBT_STATUS,
payload: {
status: AsyncActionStatus.IN_PROGRESS,
},
};
} | identifier_body |
actions.js | import Client from '../../../api';
import { AsyncActionStatus } from '../../../const/AsyncActionStatus';
import { getCurrency, getNobtName, getPersonNames } from './selectors';
export const UPDATE_CREATE_NOBT_STATUS = 'NewNobt.UPDATE_CREATE_NOBT_STATUS';
export const SELECT_CURRENCY = 'NewNobt.SELECT_CURRENCY';
expor... | () {
return {
type: ADD_PERSON,
};
}
export function removePerson(name) {
return {
type: REMOVE_PERSON,
payload: {
name,
},
};
}
export function updateNameOfPersonToAdd(name) {
return {
type: UPDATE_NAME_OF_PERSON_TO_ADD,
payload: {
name,
},
};
}
| addCurrentNameAsPerson | identifier_name |
dialogs_lt.ts | <?xml version="1.0" ?><!DOCTYPE TS><TS version="2.1" language="lt">
<context>
<name>ReminderDialog</name>
<message> | <location filename="../src/reboot-reminder-dialog/reminderdialog.cpp" line="35"/>
<source>Restart the computer to use the system and the applications properly</source>
<translation>Norėdami tinkamai naudotis sistema ir programomis, paleiskite kompiuterį iš naujo</translation>
</message>
... | random_line_split | |
processes.py | # stdlib
from collections import namedtuple
# project | SnapshotDescriptor,
SnapshotField,
)
from utils.subprocess_output import get_subprocess_output
class Processes(ResourcePlugin):
RESOURCE_KEY = "processes"
FLUSH_INTERVAL = 1 # in minutes
def describe_snapshot(self):
return SnapshotDescriptor(
1,
SnapshotField("us... | from resources import (
agg,
ResourcePlugin, | random_line_split |
processes.py | # stdlib
from collections import namedtuple
# project
from resources import (
agg,
ResourcePlugin,
SnapshotDescriptor,
SnapshotField,
)
from utils.subprocess_output import get_subprocess_output
class Processes(ResourcePlugin):
RESOURCE_KEY = "processes"
FLUSH_INTERVAL = 1 # in minutes
... | (self):
# Get output from ps
try:
process_exclude_args = self.config.get('exclude_process_args', False)
if process_exclude_args:
ps_arg = 'aux'
else:
ps_arg = 'auxww'
output, _, _ = get_subprocess_output(['ps', ps_arg], self... | _get_proc_list | identifier_name |
processes.py | # stdlib
from collections import namedtuple
# project
from resources import (
agg,
ResourcePlugin,
SnapshotDescriptor,
SnapshotField,
)
from utils.subprocess_output import get_subprocess_output
class Processes(ResourcePlugin):
RESOURCE_KEY = "processes"
FLUSH_INTERVAL = 1 # in minutes
... |
PSLine = namedtuple("PSLine", "user,pid,pct_cpu,pct_mem,vsz,rss,tty,stat,started,time,command")
self.start_snapshot()
for line in processes:
try:
psl = PSLine(*line)
self.add_to_snapshot([psl.user,
float(psl.pct... | return (command.split()[0]).split('/')[-1] | conditional_block |
processes.py | # stdlib
from collections import namedtuple
# project
from resources import (
agg,
ResourcePlugin,
SnapshotDescriptor,
SnapshotField,
)
from utils.subprocess_output import get_subprocess_output
class Processes(ResourcePlugin):
RESOURCE_KEY = "processes"
FLUSH_INTERVAL = 1 # in minutes
... |
PSLine = namedtuple("PSLine", "user,pid,pct_cpu,pct_mem,vsz,rss,tty,stat,started,time,command")
self.start_snapshot()
for line in processes:
try:
psl = PSLine(*line)
self.add_to_snapshot([psl.user,
float(psl.pct... | if command.startswith('['):
return 'kernel'
else:
return (command.split()[0]).split('/')[-1] | identifier_body |
IQueryInfo.ts | /**
* An interface that defines an access information to be queried.
* When you start a method chain with `AccessControl#can` method, you're
* actually building this query object which will be used to check the access
* permissions.
* @interface
*/
interface IQueryInfo {
/**
* Indicates a single or... | * @property {String} possession
* Defines the possession of the resource for the specified action.
* See {@link ?api=ac#AccessControl.Possession|`AccessControl.Possession` enumeration}
* for possible values.
*/ | * See {@link ?api=ac#AccessControl.Action|`AccessControl.Action` enumeration}
* for possible values.
* | random_line_split |
read-scale.rs | // Copyright 2016 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or ... | for key in &[gdk_unscaled_dpi, gdk_xft_dpi, gdk_window_scaling_factor] {
let key_str = str::from_utf8(key).unwrap();
match client.get_setting(*key) {
Err(err) => println!("{}: {:?}", key_str, err),
Ok(setting) => println!("{}={:?}", key_str, setting),
}
}
}
| {
let display;
let client;
let xlib = Xlib::open().unwrap();
unsafe {
display = (xlib.XOpenDisplay)(ptr::null_mut());
// Enumerate all properties.
client = Client::new(display,
(xlib.XDefaultScreen)(display),
Box::new(|na... | identifier_body |
read-scale.rs | // Copyright 2016 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or ... | () {
let display;
let client;
let xlib = Xlib::open().unwrap();
unsafe {
display = (xlib.XOpenDisplay)(ptr::null_mut());
// Enumerate all properties.
client = Client::new(display,
(xlib.XDefaultScreen)(display),
Box::new(... | main | identifier_name |
read-scale.rs | // Copyright 2016 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or ... | let gdk_xft_dpi: &[u8] = b"Xft/DPI";
let gdk_window_scaling_factor: &[u8] = b"Gdk/WindowScalingFactor";
for key in &[gdk_unscaled_dpi, gdk_xft_dpi, gdk_window_scaling_factor] {
let key_str = str::from_utf8(key).unwrap();
match client.get_setting(*key) {
Err(err) => println!("{}: ... | Box::new(|_, _, _| {}));
}
// Print out a few well-known properties that describe the window scale.
let gdk_unscaled_dpi: &[u8] = b"Gdk/UnscaledDPI"; | random_line_split |
heapview.rs | use l2::ast::*;
use std::vec::Vec;
#[derive(Clone, Copy)]
pub enum HeapCellView<'a> {
Str(usize, &'a Atom),
Var(usize)
}
pub struct | <'a> {
heap: &'a Heap,
state_stack: Vec<(usize, &'a HeapCellValue)>
}
impl<'a> HeapCellViewer<'a> {
pub fn new(heap: &'a Heap, focus: usize) -> Self {
HeapCellViewer {
heap: heap,
state_stack: vec![(focus, &heap[focus])]
}
}
fn follow(&self, value: &'a HeapC... | HeapCellViewer | identifier_name |
heapview.rs | use l2::ast::*;
use std::vec::Vec;
#[derive(Clone, Copy)]
pub enum HeapCellView<'a> {
Str(usize, &'a Atom),
Var(usize)
}
pub struct HeapCellViewer<'a> {
heap: &'a Heap,
state_stack: Vec<(usize, &'a HeapCellValue)>
}
impl<'a> HeapCellViewer<'a> {
pub fn new(heap: &'a Heap, focus: usize) -> Self {... | return Some(HeapCellView::Str(arity, name));
},
(_, &HeapCellValue::Ref(cell_num)) => {
let new_hcv = self.follow(hcv.1);
if hcv.1 == new_hcv {
return Some(HeapCellView::Var(cell_num));
... | for i in (1 .. arity + 1).rev() {
self.state_stack.push((focus + i, &self.heap[focus + i]));
}
| random_line_split |
de-LU.js | en-US term, Value is the Key in the current language.
*/
Date.CultureStrings = Date.CultureStrings || {};
Date.CultureStrings["de-LU"] = {
"name": "de-LU",
"englishName": "German (Luxembourg)",
"nativeName": "Deutsch (Luxemburg)",
"Sunday": "Sonntag",
"Monday": "Montag",
... | random_line_split | ||
macros.rs | // Rust JSON-RPC Library
// Written in 2015 by
// Andrew Poelstra <apoelstra@wpsoftware.net>
//
// To the extent possible under law, the author(s) have dedicated all
// copyright and related and neighboring rights to this software to
// the public domain worldwide. This software is distributed without
// any warran... | struct $enum_visitor;
impl ::serde::de::Visitor for $enum_visitor {
type Value = $enum_ty;
fn visit_str<E>(&mut self, value: &str) -> Result<$enum_ty, E>
where E: ::serde::de::Error
{
... |
impl ::serde::Deserialize for $enum_ty {
fn deserialize<D>(deserializer: &mut D) -> Result<$enum_ty, D::Error>
where D: ::serde::de::Deserializer
{ | random_line_split |
mappingsPage.py | ## mappingsPage.py - show selinux mappings
## Copyright (C) 2006 Red Hat, Inc.
## 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 2 of the License, or
## (at your option) any lat... | :
def __init__(self, xml):
self.xml = xml
self.view = xml.get_widget("mappingsView")
self.store = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING)
self.store.set_sort_column_id(0, gtk.SORT_ASCENDING)
self.view.set_model(self.store)
self.lo... | loginsPage | identifier_name |
mappingsPage.py | ## mappingsPage.py - show selinux mappings
## Copyright (C) 2006 Red Hat, Inc.
## 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 2 of the License, or
## (at your option) any lat... | print("%-25s %-25s %-25s" % (k, dict[k][0], translate(dict[k][1]))) | conditional_block | |
mappingsPage.py | ## mappingsPage.py - show selinux mappings
## Copyright (C) 2006 Red Hat, Inc.
## 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 2 of the License, or
## (at your option) any lat... | __builtin__.__dict__['_'] = unicode
class loginsPage:
def __init__(self, xml):
self.xml = xml
self.view = xml.get_widget("mappingsView")
self.store = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING)
self.store.set_sort_column_id(0, gtk.SORT_ASCE... | random_line_split | |
mappingsPage.py | ## mappingsPage.py - show selinux mappings
## Copyright (C) 2006 Red Hat, Inc.
## 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 2 of the License, or
## (at your option) any lat... | def __init__(self, xml):
self.xml = xml
self.view = xml.get_widget("mappingsView")
self.store = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING)
self.store.set_sort_column_id(0, gtk.SORT_ASCENDING)
self.view.set_model(self.store)
self.login = l... | identifier_body | |
2016-12-16 tryout2.py | """
This script investigates how calculating phasic currents from voltage clamp
recordings may benefit from subtracting-out the "noise" determined from a
subset of the quietest pieces of the recording, rather than using smoothing
or curve fitting to guess a guassian-like RMS noise function.
"""
import os
import sys
s... | (data,Xs):
"""
given some data and a list of X posistions, return the normal
distribution curve as a Y point at each of those Xs.
"""
sigma=np.sqrt(np.var(data))
center=np.average(data)
curve=mlab.normpdf(Xs,center,sigma)
curve*=len(data)*HIST_RESOLUTION
return curve
if __... | ndist | identifier_name |
2016-12-16 tryout2.py | """
This script investigates how calculating phasic currents from voltage clamp
recordings may benefit from subtracting-out the "noise" determined from a
subset of the quietest pieces of the recording, rather than using smoothing
or curve fitting to guess a guassian-like RMS noise function.
"""
import os
import sys
s... | hist=hist.astype(np.float) # histogram of data values
hist[hist == 0] = np.nan
histValidIs=np.where(~np.isnan(hist))
histX,histY=bins[:-1][histValidIs],hist[histValidIs] # remove nans
histY/=np.percentile(histY,98) # percentile is needed for noisy data
# DETERMINE THE DIFFERENCE
diffX=b... | Y=Y-baseline
# predict what our histogram will look like
padding=50
histCenter=int(np.average(Y))
histRange=(histCenter-padding,histCenter+padding)
histBins=int(abs(histRange[0]-histRange[1])/HIST_RESOLUTION)
# FIRST CALCULATE THE 10-PERCENTILE CURVE
data=quietParts(Y,10) # ... | conditional_block |
2016-12-16 tryout2.py | """
This script investigates how calculating phasic currents from voltage clamp
recordings may benefit from subtracting-out the "noise" determined from a
subset of the quietest pieces of the recording, rather than using smoothing
or curve fitting to guess a guassian-like RMS noise function.
"""
import os
import sys
s... | histValidIs=np.where(~np.isnan(hist))
histX,histY=bins[:-1][histValidIs],hist[histValidIs] # remove nans
baselineCurve=curve/np.max(curve) # max is good for smooth curve
# THEN CALCULATE THE WHOLE-SWEEP HISTOGRAM
hist,bins=np.histogram(Y,bins=histBins,range=histRange,density=False)
hist... | hist,bins=np.histogram(data,bins=histBins,range=histRange,density=False)
hist=hist.astype(np.float) # histogram of data values
curve=ndist(data,bins[:-1]) # normal distribution curve
hist[hist == 0] = np.nan | random_line_split |
2016-12-16 tryout2.py | """
This script investigates how calculating phasic currents from voltage clamp
recordings may benefit from subtracting-out the "noise" determined from a
subset of the quietest pieces of the recording, rather than using smoothing
or curve fitting to guess a guassian-like RMS noise function.
"""
import os
import sys
s... |
def ndist(data,Xs):
"""
given some data and a list of X posistions, return the normal
distribution curve as a Y point at each of those Xs.
"""
sigma=np.sqrt(np.var(data))
center=np.average(data)
curve=mlab.normpdf(Xs,center,sigma)
curve*=len(data)*HIST_RESOLUTION
return curve
... | """
Given some data (Y) break it into chunks and return just the quiet ones.
Returns data where the variance for its chunk size is below the given percentile.
CHUNK_POINTS should be adjusted so it's about 10ms of data.
"""
nChunks=int(len(Y)/CHUNK_POINTS)
chunks=np.reshape(Y[:nChunks*CHUNK_POINT... | identifier_body |
programa.py | func int suma(int a, int b)
return a+b
endfunc
func int absdif(int a, int b)
if(a>b)
return a-b
else
return b-a
endif
endfunc
int i, a, b,B[200], aux, A[100]
int z=suma(2*5+a,aux*A[0])-absdif(10000, 500)
int w=10, C[a/b**aux]
double x=0, y, z, pi=3.141592
a=0
b=1
A[0]=10
A[a+b]=pi**x
for(i=0,i<10,i+=1)
... | endif
if(x!=0)
println(a)
elseif(x<0)
println(b)
elseif(1==1)
println(pi)
else
x+=1
endif
int MAX=1000
int lista[MAX]
int j
for(i=0, i<MAX, i+=1)
read(lista[i])
endfor
for(i=0, i<MAX, i+=1)
for(j=1, j<MAX, j+=1)
if(lista[j]<lista[j-1])
int temp=lista[j]
lista[j]=lista[j-1]
lista[j-1]=temp
endif
e... | println(b) | random_line_split |
activity_entry_index.component.ts | import {
Component,
AfterViewInit,
OnInit,
OnChanges,
} from '@angular/core';
import { Router } from '@angular/router';
import {
ActivityService,
AuthService,
ApiService,
LoadingService,
LoggerService,
ErrorService,
PopupService,
} from "./../../../services";
import {
Course,
Question,
Erro... |
ngAfterViewInit() {
}
}
| {
this._loading.setCurtain();
localStorage.setItem('CurrentActivity', entry_id);
this._router.navigate(['entry', 'training', {}]);
} | identifier_body |
activity_entry_index.component.ts | import {
Component,
AfterViewInit,
OnInit,
OnChanges,
} from '@angular/core';
import { Router } from '@angular/router';
import {
ActivityService,
AuthService,
ApiService,
LoadingService,
LoggerService,
ErrorService,
PopupService,
} from "./../../../services";
import {
Course,
Question,
Erro... | selector: 'courses-show',
templateUrl: './activity_entry_index.component.html',
styleUrls: ['./activity_entry_index.component.scss'],
providers: [
ApiService,
AuthService,
ActivityService,
LoggerService,
PopupService,
],
})
export class ActivityEntryIndexComponent implements OnInit, Afte... |
@Component({ | random_line_split |
activity_entry_index.component.ts | import {
Component,
AfterViewInit,
OnInit,
OnChanges,
} from '@angular/core';
import { Router } from '@angular/router';
import {
ActivityService,
AuthService,
ApiService,
LoadingService,
LoggerService,
ErrorService,
PopupService,
} from "./../../../services";
import {
Course,
Question,
Erro... | implements OnInit, AfterViewInit {
activitys: ActivityEntry[] = [];
constructor(
private _router: Router,
private _api: ApiService,
private _activity: ActivityService,
private _auth: AuthService,
private _logger: LoggerService,
private _error: ErrorService,
private _loading: LoadingSe... | ActivityEntryIndexComponent | identifier_name |
_password-reset-init.service.ts | <%#
Copyright 2013-2018 the original author or authors from the JHipster project.
This file is part of the JHipster project, see http://www.jhipster.tech/
for more information.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You ma... | } | random_line_split | |
_password-reset-init.service.ts | <%#
Copyright 2013-2018 the original author or authors from the JHipster project.
This file is part of the JHipster project, see http://www.jhipster.tech/
for more information.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You ma... | (private http: Http) {}
save(mail: string): Observable<any> {
return this.http.post(SERVER_API_URL + '<%- apiUaaPath %>api/account/reset-password/init', mail);
}
}
| constructor | identifier_name |
phonelink-off.js | /* */
'use strict';
Object.defineProperty(exports, "__esModule", {value: true});
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _reactAddonsPureRenderMixin = require('react-addons-pure-render-mixin');
var _reactAddonsPureRenderMixin2 = _interopRequireDefault(_reactAddonsPureRenderMixi... | (obj) {
return obj && obj.__esModule ? obj : {default: obj};
}
var HardwarePhonelinkOff = _react2.default.createClass({
displayName: 'HardwarePhonelinkOff',
mixins: [_reactAddonsPureRenderMixin2.default],
render: function render() {
return _react2.default.createElement(_svgIcon2.default, this.props, _react2... | _interopRequireDefault | identifier_name |
phonelink-off.js | /* */ | var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _reactAddonsPureRenderMixin = require('react-addons-pure-render-mixin');
var _reactAddonsPureRenderMixin2 = _interopRequireDefault(_reactAddonsPureRenderMixin);
var _svgIcon = require('../../svg-icon');
var _svgIcon2 = _interopRequireDefau... | 'use strict';
Object.defineProperty(exports, "__esModule", {value: true}); | random_line_split |
phonelink-off.js | /* */
'use strict';
Object.defineProperty(exports, "__esModule", {value: true});
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _reactAddonsPureRenderMixin = require('react-addons-pure-render-mixin');
var _reactAddonsPureRenderMixin2 = _interopRequireDefault(_reactAddonsPureRenderMixi... |
var HardwarePhonelinkOff = _react2.default.createClass({
displayName: 'HardwarePhonelinkOff',
mixins: [_reactAddonsPureRenderMixin2.default],
render: function render() {
return _react2.default.createElement(_svgIcon2.default, this.props, _react2.default.createElement('path', {d: 'M22 6V4H6.82l2 2H22zM1.92 1.... | {
return obj && obj.__esModule ? obj : {default: obj};
} | identifier_body |
kosovo_importer.py | from abstract_importer import AbstractImporter
from slugify import slugify
class KosovoImporter(AbstractImporter):
def __init__(self):
pass
def get_csv_filename(self):
return "importer/data/kosovo/kosovo-budget-expenditures-2014.csv"
def get_region(self):
return 'Kosovo'
def... | (self):
return 'Budget Expenditure (2014)'
def build_docs(self, row):
# In this case, it's because in the CSV doc there is a column for each year...
year = row[3]
# Clean expense string so that is is numerical (e.g. turn blank string to 0).
cost = row[2].replace(',', '')
... | get_dataset | identifier_name |
kosovo_importer.py | from abstract_importer import AbstractImporter
from slugify import slugify
class KosovoImporter(AbstractImporter):
def __init__(self):
pass
def get_csv_filename(self):
return "importer/data/kosovo/kosovo-budget-expenditures-2014.csv"
def get_region(self):
|
def get_dataset(self):
return 'Budget Expenditure (2014)'
def build_docs(self, row):
# In this case, it's because in the CSV doc there is a column for each year...
year = row[3]
# Clean expense string so that is is numerical (e.g. turn blank string to 0).
cost = row... | return 'Kosovo' | identifier_body |
kosovo_importer.py | from abstract_importer import AbstractImporter
from slugify import slugify
class KosovoImporter(AbstractImporter):
def __init__(self):
pass
def get_csv_filename(self):
return "importer/data/kosovo/kosovo-budget-expenditures-2014.csv"
def get_region(self):
return 'Kosovo'
def... |
# Create doc.
doc = {
'region': {
'name': self.get_region(),
'slug': slugify(self.get_region(), to_lower=True)
},
'dataset': {
'name': self.get_dataset(),
'slug': slugify(self.get_dataset(), to_lower=Tr... | cost = 0 | conditional_block |
kosovo_importer.py | from abstract_importer import AbstractImporter
from slugify import slugify
class KosovoImporter(AbstractImporter):
def __init__(self):
pass
def get_csv_filename(self):
return "importer/data/kosovo/kosovo-budget-expenditures-2014.csv"
def get_region(self):
return 'Kosovo'
def... | # Create doc.
doc = {
'region': {
'name': self.get_region(),
'slug': slugify(self.get_region(), to_lower=True)
},
'dataset': {
'name': self.get_dataset(),
'slug': slugify(self.get_dataset(), to_lower=True... | random_line_split | |
detailed-app.model.ts | import {App, ApplicationType} from './app.model';
export class Deprecation {
level: string;
reason: string;
replacement: string;
static parse(input: any): Deprecation {
const deprecation = new Deprecation();
deprecation.level = input.level ? input.level : undefined;
deprecation.reason = input.reas... | (input: any): Array<ValuedConfigurationMetadataProperty> {
if (input) {
return input.map(ValuedConfigurationMetadataProperty.parse);
}
return [];
}
}
export class DetailedApp extends App {
options: ConfigurationMetadataProperty[];
optionGroups?: {[prop: string]: string[]};
static parse(input... | parse | identifier_name |
detailed-app.model.ts | import {App, ApplicationType} from './app.model';
export class Deprecation {
level: string;
reason: string;
replacement: string;
static parse(input: any): Deprecation {
const deprecation = new Deprecation();
deprecation.level = input.level ? input.level : undefined;
deprecation.reason = input.reas... | options: ConfigurationMetadataProperty[];
optionGroups?: {[prop: string]: string[]};
static parse(input: any): DetailedApp {
const app: DetailedApp = new DetailedApp();
app.name = input.name;
app.type = input.type as ApplicationType;
app.uri = input.uri;
app.version = input.version;
app.v... | export class DetailedApp extends App { | random_line_split |
detailed-app.model.ts | import {App, ApplicationType} from './app.model';
export class Deprecation {
level: string;
reason: string;
replacement: string;
static parse(input: any): Deprecation {
const deprecation = new Deprecation();
deprecation.level = input.level ? input.level : undefined;
deprecation.reason = input.reas... |
return [];
}
}
export class DetailedApp extends App {
options: ConfigurationMetadataProperty[];
optionGroups?: {[prop: string]: string[]};
static parse(input: any): DetailedApp {
const app: DetailedApp = new DetailedApp();
app.name = input.name;
app.type = input.type as ApplicationType;
a... | {
return input.map(ValuedConfigurationMetadataProperty.parse);
} | conditional_block |
lib.rs | extern crate libc;
use std::os::raw;
use std::ffi::CString;
use std::mem::{transmute, size_of};
use std::default::Default;
#[link(name = "kleeRuntest")]
extern {
fn klee_make_symbolic(data: *mut raw::c_void, length: libc::size_t, name: *const raw::c_char);
fn klee_set_forking(state: bool);
}
pub unsafe fn an... | <T>(data: *mut T, name: &str) {
unsafe{ any(transmute(data), size_of::<T>(), name); }
}
| symbol | identifier_name |
lib.rs | extern crate libc;
use std::os::raw;
use std::ffi::CString;
use std::mem::{transmute, size_of};
use std::default::Default;
#[link(name = "kleeRuntest")]
extern {
fn klee_make_symbolic(data: *mut raw::c_void, length: libc::size_t, name: *const raw::c_char);
fn klee_set_forking(state: bool);
}
pub unsafe fn an... | return new_symbol;
}
pub fn symbol<T>(data: *mut T, name: &str) {
unsafe{ any(transmute(data), size_of::<T>(), name); }
} | symbol(&mut new_symbol, name); | random_line_split |
lib.rs | extern crate libc;
use std::os::raw;
use std::ffi::CString;
use std::mem::{transmute, size_of};
use std::default::Default;
#[link(name = "kleeRuntest")]
extern {
fn klee_make_symbolic(data: *mut raw::c_void, length: libc::size_t, name: *const raw::c_char);
fn klee_set_forking(state: bool);
}
pub unsafe fn an... |
pub fn some<T: Default>(name: &str) -> T {
let mut new_symbol = T::default();
symbol(&mut new_symbol, name);
return new_symbol;
}
pub fn symbol<T>(data: *mut T, name: &str) {
unsafe{ any(transmute(data), size_of::<T>(), name); }
}
| {
unsafe { klee_set_forking(state); }
} | identifier_body |
create-workbench-container.component.ts | import {AbstractPopupComponent} from '@common/component/abstract-popup.component';
import {Component, ElementRef, EventEmitter, Injector, OnDestroy, OnInit, Output} from '@angular/core';
import {WorkbenchConstant} from '../../../workbench.constant';
import {CreateWorkbenchModelService} from './service/create-workbench-... | tTableName(tableName: string): void {
this.tableName = tableName;
}
setConnectionInModel(connection): void {
this.createWorkbenchModelService.selectedConnection = connection;
}
changeStep(step: WorkbenchConstant.CreateStep): void {
this.createStep = step;
}
closePopup(): void {
this.close... | this.schemaName = schemaName;
}
se | identifier_body |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.