prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>0005_auto_20160918_0221.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-09-18 06:21
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
<|fim▁hole|> operations = [
migrations.RenameField(
... | dependencies = [
('CareerTinder', '0004_auto_20160918_0152'),
]
|
<|file_name|>parser-postfix-exp-assign.js<|end_file_name|><|fim▁begin|>/* Copyright JS Foundation and other contributors, http://js.foundation
*
* 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... | 'var a = {"foo" : 5}; a-- = 42',
'var a = {5 : 5}; a-- = 42',
'var a = {a : 5}; a-- = 42',
'var a = {[key] : 5}; a-- = 42', |
<|file_name|>userauth.py<|end_file_name|><|fim▁begin|># -*- test-case-name: twisted.conch.test.test_userauth -*-
# Copyright (c) 2001-2009 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Implementation of the ssh-userauth service.
Currently implemented authentication types are public-key and password.
Mai... |
@param kind: the authentication method
@type kind: C{str} |
<|file_name|>binder.py<|end_file_name|><|fim▁begin|>'''
Copyright 2013 George Caley
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
U... | print "Exclusions list:", exclusions_list
else:
#exclusions = None
#exclusions_list = [] |
<|file_name|>handler.py<|end_file_name|><|fim▁begin|>__author__ = 'Marco Maio'
import time
class Handler():
def __init__(self, stocks_today=None, investments_by_name=None, investments_by_availability=None):
# input data assessment
if stocks_today is None:
raise ValueError('Stoc... | |
<|file_name|>virtualnetworkpeerings.go<|end_file_name|><|fim▁begin|>package network
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of th... | |
<|file_name|>issue-3991.rs<|end_file_name|><|fim▁begin|>// Copyright 2013 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/lice... | nest: Vec<Vec<int> > ,
}
impl HasNested { |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django import http
from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.models import Site
from django.core.exceptions import ObjectDoesNotExist
def shortcut(request, content_type_id, object_id):
"Redirect to an object's page b... | # relation to the Site object
object_domain = None
opts = obj._meta |
<|file_name|>gaia_auth.py<|end_file_name|><|fim▁begin|># Copyright (c) 2010 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import getpass
import os
import urllib
DEFAULT_GAIA_URL = "https://www.google.com:443/accounts/Cl... | params = urllib.urlencode({'Email': email, 'Passwd': passwd,
'source': 'chromoting',
'service': self._service, |
<|file_name|>zoom-normalSpec.js<|end_file_name|><|fim▁begin|>describe('zoom normal animation', function() {
var prefixes = {
'-webkit-transform': true,
'-moz-transform': true,
'-o-transform': true,
'transform': true
};
var transform;
beforeEach(module('ngAnimate'));
beforeEach(module('ngAnimat... | done();
},500); |
<|file_name|>wae.ts<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
// THIS CODE IS GENERATED - DO NOT MODIFY
// See angular/tools/gulp-... | function plural(n: number): number {
if (n === 1) return 1; |
<|file_name|>tree-view.e2e-spec.ts<|end_file_name|><|fim▁begin|>/// <reference path="../../matchers/custom-matchers.d.ts"/>
/**
* 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
* regard... | beforeAll(() => {
loadTestData(); |
<|file_name|>replicationControllersMock.js<|end_file_name|><|fim▁begin|>(function() {
'use strict';
angular.module('replicationControllers', [])
.service('replicationControllerService', ['$q', ReplicationControllerDataService]);
/**
* Replication Controller DataService
* Mock async data service.
... | }
},
"status": { |
<|file_name|>unbind_client_cluster.py<|end_file_name|><|fim▁begin|># -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2011,2012,2013,2014,2015,2016 Contributor
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you ma... | |
<|file_name|>cache.rs<|end_file_name|><|fim▁begin|>use api::{ErrorCode, CommandHandle, WalletHandle, PoolHandle};
use commands::{Command, CommandExecutor};
use commands::cache::CacheCommand;
use errors::prelude::*;
use utils::ctypes;
use domain::cache::{GetCacheOptions, PurgeOptions};
use domain::anoncreds::schema::Sch... | #[no_mangle]
pub extern fn indy_purge_schema_cache(command_handle: CommandHandle,
wallet_handle: WalletHandle, |
<|file_name|>validation-messages.ts<|end_file_name|><|fim▁begin|>import { Expression } from 'aurelia-binding';
import { ValidationMessageParser } from './validation-message-parser';
export interface ValidationMessages {
[key: string]: string;
}
/**
* Dictionary of validation messages. [messageKey]: message... | minLength: `\${$displayName} must be at least \${$config.length} character\${$config.length === 1 ? '' : 's'}.`,
maxLength: `\${$displayName} cannot be longer than \${$config.length} character\${$config.length === 1 ? '' : 's'}.`,
|
<|file_name|>ns3_module_nix_vector_routing.py<|end_file_name|><|fim▁begin|>from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
def register_types(module):
root_module = module.get_root()
## ipv4-nix-vector-routing.h: ns3::Ipv4NixVectorRouting [class]
module.add_class('Ipv... | visibility='private', is_virtual=True)
## ipv4-nix-vector-routing.h: void ns3::Ipv4NixVectorRouting::SetIpv4(ns3::Ptr<ns3::Ipv4> ipv4) [member function]
cls.add_method('SetIpv4',
'void', |
<|file_name|>common.py<|end_file_name|><|fim▁begin|>import inspect
import json
import os
import random
import subprocess
import time
import requests
import ast
import paramiko
import rancher
from rancher import ApiError
from lib.aws import AmazonWebServices
DEFAULT_TIMEOUT = 120
DEFAULT_MULTI_CLUSTER_APP_TIMEOUT = 300... | if time.time() - start > timeout:
raise AssertionError( |
<|file_name|>ExampleGuiceServletModule.java<|end_file_name|><|fim▁begin|>package org.vaadin.addons.guice.server;
import org.vaadin.addons.guice.servlet.VGuiceApplicationServlet;
import com.google.inject.servlet.ServletModule;
/**
*
* @author Will Temperley
*
*/
public class ExampleGuiceServletModule extends Ser... | |
<|file_name|>cast.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2014 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/licen... | */
#[inline] |
<|file_name|>Board.cpp<|end_file_name|><|fim▁begin|>#include "Board.h"
#include <iostream>
using namespace std;
void Board::enumExts( )
{
if(ptester->hasUnboundedHorizAttacks())
{
for( int i = 1; i <= nrows; i++ )
if( PiecesInRow[i] > 1 )
{
cout << 0 << endl;
return;
}
}
_enumExts()... | --piece king\n\
--piece rook or others added" << endl; |
<|file_name|>efflist.ts<|end_file_name|><|fim▁begin|>class effWord {
id: number;
word: string;
}
function getWords(): Array<effWord> {
return [
{ id: 11111, word: "abacus" },
{ id: 11112, word: "abdomen" },
{ id: 11113, word: "abdominal" },
{ id: 11114, word: "a... | { id: 61141, word: "subscript" },
{ id: 61142, word: "subsector" },
{ id: 61143, word: "subside" },
|
<|file_name|>auth_config.go<|end_file_name|><|fim▁begin|>package origin
import (
"crypto/md5"
"crypto/x509"
"fmt"
"net/url"
"code.google.com/p/go-uuid/uuid"
"github.com/GoogleCloudPlatform/kubernetes/pkg/tools"
"github.com/projectatomic/atomic-enterprise/pkg/auth/server/session"
configapi "github.com/projec... | |
<|file_name|>AbstractInboundPatientDiscoveryDeferredRequest.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2012, United States Government, as represented by the Secretary of Health and Human Services.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification... | |
<|file_name|>auth.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8; tab-width: 4; indent-tabs-mode: t -*-
#
# NetProfile: Authentication routines
# © Copyright 2013-2014 Alex 'Unik' Unigovsky
#
# This file is part of NetProfile.
# NetProfile is free software: you can redistribute it and/or
# mo... | self.secret = secret
self.callback = callback
self.realm = realm |
<|file_name|>face-detection-rectangle.js<|end_file_name|><|fim▁begin|>var cv = require('../lib/opencv');
var COLOR = [0, 255, 0]; // default red<|fim▁hole|> if (err) throw err;
if (im.width() < 1 || im.height() < 1) throw new Error('Image has no size');
im.detectObject('../data/haarcascade_frontalface_alt2.xml',... | var thickness = 2; // default 1
cv.readImage('./files/mona.png', function(err, im) { |
<|file_name|>plugin_class.rs<|end_file_name|><|fim▁begin|>use node::inner_node::node_from_ptr;
use node::{String, Uri};
use world::World;
#[derive(Clone)]
pub struct PluginClass<'w> {
pub(crate) ptr: *const ::lilv_sys::LilvPluginClass,
pub(crate) world: &'w World,
}
impl<'w> PluginClass<'w> {
pub(crate) f... | PluginClass { ptr, world }
} |
<|file_name|>test_realizer_arbitrary_reordering.py<|end_file_name|><|fim▁begin|>import unittest
import tagging
class TestRealizerArbitraryReordering(unittest.TestCase):
"""<|fim▁hole|> """
def test_realize_output_in_order(self):
"""
Test for when source tokens occur
in the s... | Tests for the realizer with arbitrary reordering
enabled. |
<|file_name|>pipe_unix.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 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/licen... | use std::sync::arc::UnsafeArc;
use std::intrinsics; |
<|file_name|>config_client.hpp<|end_file_name|><|fim▁begin|>// Copyright 2010-2014 RethinkDB, all rights reserved.
#ifndef CLUSTERING_ADMINISTRATION_SERVERS_CONFIG_CLIENT_HPP_
#define CLUSTERING_ADMINISTRATION_SERVERS_CONFIG_CLIENT_HPP_
#include <map>
#include <set>
#include <string>
#include "containers/incremental_... |
#endif /* CLUSTERING_ADMINISTRATION_SERVERS_CONFIG_CLIENT_HPP_ */ |
<|file_name|>ExecutableStatement.java<|end_file_name|><|fim▁begin|>/**
* Copyright 2014 Nortal AS
*
* 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.or... |
import org.springframework.util.CollectionUtils;
/** |
<|file_name|>ImAdd.py<|end_file_name|><|fim▁begin|>__author__ = 'Mayur M'
import ImgIO
def add(image1, image2): # add two images together
if image1.width == image2.width and image1.height == image2.height:
return_red = []
return_green = []
return_blue = []
for i in range(0, len(im... | if __name__ == '__main__':
main() |
<|file_name|>server.js<|end_file_name|><|fim▁begin|>import express from 'express';
import path from 'path';
let app = express();
/*** Webpack imports ***/
import webpack from 'webpack';
import WebpackDevServer from 'webpack-dev-server';
import config from './webpack.config.js';
const webpackOpt... |
module.exports = app; |
<|file_name|>test_cp_mgmt_host.py<|end_file_name|><|fim▁begin|># Ansible module to manage CheckPoint Firewall (c) 2019
#
# Ansible 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 Licens... | "name": "New Host 1",
"state": "absent"
}
|
<|file_name|>config.py<|end_file_name|><|fim▁begin|># Details used to log into Reddit.
reddit_client_id = ""
reddit_client_secret = ""
reddit_user = ""
reddit_pass = ""
# Auth key used to log into Discord.
discord_key = ""
# Command/feature modules.
module_names = (
"default",
)<|fim▁hole|><|fim▁end|> |
# Do not change this value!
config_version = 2 |
<|file_name|>vardict.py<|end_file_name|><|fim▁begin|>"""Sensitive variant calling using VarDict.
Defaults to using the faster, equally sensitive Java port:
https://github.com/AstraZeneca-NGS/VarDictJava
if 'vardict' or 'vardict-java' is specified in the configuration. To use the
VarDict perl version:
https://github... | do.run(cmd.format(**locals()), "Genotyping with VarDict: Inference", {}) |
<|file_name|>main.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Modulos
import sys
import pygame
from pygame.locals import *
# Constantes
venx = 640
veny = 448
# Clases
class Pieza(pygame.sprite.Sprite): # 64x64 px tamaño
def __init__(self, tipo):
pygame.sprite.Spr... | elif tipo == 8:
self.image = load_image("bloqueo_g.png", True)
elif tipo == 9:
self.image = load_image("portal.png", True) |
<|file_name|>PigasusPlayerListener.java<|end_file_name|><|fim▁begin|>package redsgreens.Pigasus;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerI... | public class PigasusPlayerListener implements Listener {
private final Pigasus plugin;
public PigasusPlayerListener(Pigasus instance) {
|
<|file_name|>iXmlFactory.d.ts<|end_file_name|><|fim▁begin|>// Type definitions for @ag-grid-community/core v25.0.1
// Project: http://www.ag-grid.com/
// Definitions by: Niall Crosby <https://github.com/ag-grid/>
export interface XmlElement {
name: string;
properties?: XmlAttributes;<|fim▁hole|>export interface... | children?: XmlElement[];
textNode?: string | null;
} |
<|file_name|>base64.js<|end_file_name|><|fim▁begin|>/*
* author: Lisa
* Info: Base64 / UTF8
* 编码 & 解码
*/
function base64Encode(input) {
var keyStr = "ABCDEFGHIJKLMNOP" + "QRSTUVWXYZabcdef" + "ghijklmnopqrstuv" + "wxyz0123456789+/" + "=";
var output = "";
var chr1, chr2, chr3 = "";
var enc1, enc2, enc3, enc4 = ... | }
exports.base64Encode = base64Encode;
exports.base64Decode = base64Decode; |
<|file_name|>cmp_utils.rs<|end_file_name|><|fim▁begin|>use regex::Regex;
use std::cmp::Ordering;
use crate::types::*;
lazy_static! {
static ref MODIFICATION_RE: Regex = Regex::new(r"^(?P<aa>[A-Z])(?P<pos>\d+)$").unwrap();<|fim▁hole|> if let Some(ref res1) = *residue1 {
if let Some(ref res2) = *residue2... | }
pub fn cmp_residues(residue1: &Option<Residue>, residue2: &Option<Residue>) -> Ordering { |
<|file_name|>docs.ts<|end_file_name|><|fim▁begin|>/**
* Enumeration of documentation topics<|fim▁hole|> * @internal
*/
export enum DocsId {
Transformations,
FieldConfig,
FieldConfigOverrides,
}<|fim▁end|> | |
<|file_name|>0002_segment_additional_miles.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-<|fim▁hole|>
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('attracker_app', '0001_initial'),
]
operations = [
migrations.AddField(
... | from __future__ import unicode_literals |
<|file_name|>main.js<|end_file_name|><|fim▁begin|>/*jshint unused: vars */
require.config({
paths: {
angular: '../../bower_components/angular/angular',
'angular-animate': '../../bower_components/angular-animate/angular-animate',
'angular-aria': '../../bower_components/angular-aria/angular-aria',
'angu... | var $html = angular.element(document.getElementsByTagName('html')[0]); |
<|file_name|>test_io_csv.py<|end_file_name|><|fim▁begin|>import pytest
import os
from polyglotdb import CorpusContext
acoustic = pytest.mark.skipif(
pytest.config.getoption("--skipacoustics"),
reason="remove --skipacoustics option to run"
)
def test_to_csv(acoustic_utt_config, export_test_dir):
export_p... | if i != 0:
line = [line[0], float(line[1]), float(line[2])] |
<|file_name|>column.rs<|end_file_name|><|fim▁begin|>// Copyright 2018 TiKV Project Authors. Licensed under Apache-2.0.
use super::*;
use tidb_query_datatype::codec::{datum, Datum};
use tidb_query_datatype::expr::EvalContext;
use tipb::{ColumnInfo, FieldType};
pub const TYPE_VAR_CHAR: i32 = 1;
pub const TYPE_LONG: i3... | c_info.set_column_id(self.id);
c_info.set_tp(self.col_field_type());
c_info.set_pk_handle(self.index == 0); |
<|file_name|>types.rs<|end_file_name|><|fim▁begin|>extern crate indy_crypto;
extern crate rmp_serde;
extern crate serde;
extern crate serde_json;
extern crate time;
use std::cmp::Eq;
use std::collections::HashMap;
use std::hash::{Hash, Hasher};
use errors::prelude::*;
use utils::crypto::verkey_builder::build_full_ver... | pub ledgerId: usize, |
<|file_name|>position.mako.rs<|end_file_name|><|fim▁begin|>/* 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 http://mozilla.org/MPL/2.0/. */
<%namespace name="helpers" file="/helpers.mako.rs" />
... | } else { // only grid-row-start is given
let line = line_with_ident_from(&row_start);
(line.clone(), line.clone(), line)
}; |
<|file_name|>full_factorial.py<|end_file_name|><|fim▁begin|>"""
Author: Dr. John T. Hwang <hwangjt@umich.edu>
This package is distributed under New BSD license.
Full-factorial sampling.
"""
import numpy as np
from smt.sampling_methods.sampling_method import SamplingMethod
class FullFactorial(SamplingMethod):
d... | def _compute(self, nt): |
<|file_name|>mat4.js<|end_file_name|><|fim▁begin|>/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without l... | yy = y * y2, |
<|file_name|>tutorial_etl_dag.py<|end_file_name|><|fim▁begin|>#
# 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 ... | from airflow import DAG
|
<|file_name|>dershowitz.rs<|end_file_name|><|fim▁begin|>K : F (G x) <= G (G (F (F x)))
h : forall p x . p (F (F (G x)))
h = K (K h)
e : F (F (G x))<|fim▁hole|><|fim▁end|> | e = h |
<|file_name|>port.go<|end_file_name|><|fim▁begin|>package models
import "github.com/nvellon/hal"<|fim▁hole|> CurrentState int
DefaultState int
Name string
}
func (a Port) GetMap() hal.Entry {
return hal.Entry{
"id": a.Id,
"current_state": a.CurrentState,
"default_state": a.DefaultState,
... |
type Port struct {
Id int |
<|file_name|>config.py<|end_file_name|><|fim▁begin|>"""Helper module for parsing AWS ini config files."""
import os
try:
import configparser
except ImportError:
import ConfigParser as configparser
AWS_CLI_CREDENTIALS_PATH = "~/.aws/credentials"
AWS_CLI_CONFIG_PATH = "~/.aws/config"
DEFAULT_PROFILE_NAME = o... | """ |
<|file_name|>lumina-fileinfo_sv.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="sv_SE">
<context>
<name>Dialog</name>
<message>
<location filename="../dialog.ui" line="14"/>
<source>File Information</source>
<translation ty... | |
<|file_name|>paginate.js<|end_file_name|><|fim▁begin|>var URL = require('url');
var Pagination = function(request, model){
this.request = request;
this.model = model;
<|fim▁hole|> var url = URL.parse(this.request.url).pathname;
var page = this.request.param('page');
page = page === undefined ? 0 : page;
this... | this.paginate = function(query, limit, sort, selected, onDataReception){
|
<|file_name|>regions-close-associated-type-into-object.rs<|end_file_name|><|fim▁begin|>trait X {}
trait Iter {
type Item: X;
fn into_item(self) -> Self::Item;
fn as_item(&self) -> &Self::Item;
}
fn bad1<T: Iter>(v: T) -> Box<dyn X + 'static>
{
let item = v.into_item();
Box::new(item) //~ ERROR ... | let item = Clone::clone(w);
Box::new(item) // OK, T::Item : 'a is implied
}
|
<|file_name|>Attribute.java<|end_file_name|><|fim▁begin|>/**
*
*/
package agentRefactoringStrand;
/**
* @author Daavid
*
*/
public class Attribute {
<|fim▁hole|><|fim▁end|> | private String name;
} |
<|file_name|>SourceProcessor.java<|end_file_name|><|fim▁begin|>package io.ray.streaming.runtime.core.processor;<|fim▁hole|>
import io.ray.streaming.message.Record;
import io.ray.streaming.operator.SourceOperator;
/**
* The processor for the stream sources, containing a SourceOperator.
*
* @param <T> The type of sou... | |
<|file_name|>cli.js<|end_file_name|><|fim▁begin|>module.exports = function (process, manifest, actionCallback) {<|fim▁hole|> .option('-v, --verbose', 'Enable verbose output')
.command('*')
.action(function (args) {
actionCallback(process, args);
});
program.parse(process.... | var program = require('commander');
program
.version(manifest.version) |
<|file_name|>test.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright(C) 2010-2011 Romain Bignon
#<|fim▁hole|># weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 o... | # This file is part of weboob.
# |
<|file_name|>ShadowNode.js<|end_file_name|><|fim▁begin|>var UTIL = require('./util');
var ShadowNode;
module.exports = ShadowNode = function(patch,options){
this.shadow = options.shadow;
this.native = options.native;
this.elem = new patch.type(this);
this.elem.props = patch.props;
this.elem.props.children =... | // component will update
this.figure.setPatch(newPatch);
|
<|file_name|>LLVMMOPMain.java<|end_file_name|><|fim▁begin|>/**
* @author fengchen, Dongyun Jin, Patrick Meredith, Michael Ilseman
*
* To change the template for this generated type comment go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
package llvmmop;
import jav... | // PM
protected static void writePluginOutputFile(String pluginOutput, String location) throws MOPException {
int i = location.lastIndexOf(File.separator);
|
<|file_name|>Arbol_Sintactico_Abstracto.py<|end_file_name|><|fim▁begin|>from Estructura import espaceado<|fim▁hole|> self.alcance = alcance
self.cont = 1
def imprimir(self,tabulacion):
if (len(self.hijos) > 1):
print tabulacion + "SECUENCIA"
for hijo in self.hijos:
hijo.nivel = 1
hijo.imprimir(espacea... |
class Arbol_Sintactico_Abstracto:
def __init__(self,alcance,hijos):
self.hijos = hijos |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | from .sizedist import *
from .WD01 import make_WD01_DustSpectrum |
<|file_name|>cell.rs<|end_file_name|><|fim▁begin|>/* 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 http://mozilla.org/MPL/2.0/. */
use dom::bindings::trace::JSTraceable;
use js::jsapi::{JSTracer}... | /// so you have to be careful in trace code!
pub unsafe fn borrow_for_gc_trace<'a>(&'a self) -> &'a T {
debug_assert!(task_state::get().contains(SCRIPT | IN_GC)); |
<|file_name|>minSubArrayLen.py<|end_file_name|><|fim▁begin|>class Solution:
# @param {integer} s
# @param {integer[]} nums
# @return {integer}
def minSubArrayLen(self, s, nums):
i = 0
j = -1
n = len(nums)
t = 0
min_len = sys.maxint
while(i<n and j <n):
... | else:
return min_len |
<|file_name|>jinja2tags.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
# import jinja2
from jinja2.ext import Extension
from .templatetags.promotions_tags import promo_ballance
class PromotionsExtension(Extension):
def __init__(self, environment):
super(PromotionsExtension, self)... | environment.filters["promo_ballance"] = promo_ballance
|
<|file_name|>cppcheck.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
# -*- encoding: utf-8 -*-
# Michel Mooij, michel.mooij7@gmail.com
"""
Tool Description
================
This module provides a waf wrapper (i.e. waftool) around the C/C++ source code
checking tool 'cppcheck'.
See http://cppcheck.sourceforge... | border-bottom-style: solid;
border-bottom-color: #aaaaaa; |
<|file_name|>0002_auto_20160301_1154.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals<|fim▁hole|>
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('bookmarks', '0001_initial'),
... | |
<|file_name|>UnmountOldrootState.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# VM Backup extension
#
# Copyright 2015 Microsoft Corporation
#
# 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 Li... |
self.context.logger.log("Restarting systemd-udevd")
self.command_executor.Execute('systemctl restart systemd-udevd')
self.context.logger.log("Restarting systemd-timesyncd") |
<|file_name|>zkserver.go<|end_file_name|><|fim▁begin|>package main
import (
"flag"
"github.com/koofr/go-zkutils"
"log"
)
func main() {
var port = flag.Int("port", 2181, "ZooKeeper port for listening")
flag.Parse()
server, err := zkutils.NewTestServer(*port)
if err != nil {
log.Fatal(err)
}
defer server... | |
<|file_name|>Pin.java<|end_file_name|><|fim▁begin|>/**
*
* Copyright 2014-2017 Florian Schmaus
*
* 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/L... | |
<|file_name|>test_mnist.py<|end_file_name|><|fim▁begin|>"""
This file tests some of the YAML files in the maxout paper
"""
import os
import pylearn2
from pylearn2.datasets import control
from pylearn2.datasets.mnist import MNIST
from pylearn2.termination_criteria import EpochCounter
from pylearn2.testing.skip import s... | train.dataset = MNIST(which_set='train', start=0, stop=100)
train.algorithm._set_monitoring_dataset(train.dataset)
control.load_data = init_value |
<|file_name|>discount.server.model.test.js<|end_file_name|><|fim▁begin|>'use strict';
/**
* Module dependencies.
*/
var should = require('should'),
mongoose = require('mongoose'),
User = mongoose.model('User'),
Discount = mongoose.model('Discount');
/**
* Globals
*/
var user, discount;
/**
* Unit tests
*/
d... | return discount.save(function(err) { |
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># Generated by Django 2.0.13 on 2019-06-22 18:48
import django.db.models.deletion
import django.utils.timezone
import django_fsm
from django.conf import settings
from django.db import migrations, models
import apps.core.models
class Migration(migrations.Migr... | apps.core.models.DateTimeCreatedField( |
<|file_name|>paraphrase_ms_coco_test.py<|end_file_name|><|fim▁begin|># coding=utf-8
# Copyright 2022 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#<|fim▁hole|># ... | # http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software |
<|file_name|>dao_test.go<|end_file_name|><|fim▁begin|>package dao
import (
"context"
"flag"
"log"
"math/rand"
"os"
"strconv"
"testing"
"time"
. "github.com/smartystreets/goconvey/convey"
"go-common/app/service/main/dapper/conf"
"go-common/app/service/main/dapper/model"
)
func init() {
rand.Seed(time.Now... | },
&model.SpanPoint{
ServiceName: "service_c",
OperationName: "opt3", |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
#
#
#
# This file is part of librix-thinclient.
#
# librix-thinclient 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... | #
# librix-thinclient is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
<|file_name|>paragraph_viz.js<|end_file_name|><|fim▁begin|>"use strict";
module.exports = {
tagName: "div",
className: "",
defaults: {
content: "default content"
},
render: function() {
},
client: function(options) {
var result = options.client_options.result;
var session = result.data.sessi... | var cell_count;
var cells = $("<div/>");
var index; |
<|file_name|>XmidComparator.java<|end_file_name|><|fim▁begin|>package com.tamirhassan.pdfxtk.comparators;
/**
* pdfXtk - PDF Extraction Toolkit
* Copyright (c) by the authors/contributors. All rights reserved.
* This project includes code from PDFBox and TouchGraph.
*
* Redistribution and use in source and binary... | else if (x2 == x1) return 0;
else return 1; |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | # Major, Minor
VERSION = (1, 4) |
<|file_name|>socketio-area.client.routes.js<|end_file_name|><|fim▁begin|><|fim▁hole|>angular.module('socketio-area').config(['$stateProvider',
function($stateProvider) {
// Socketio area state routing
$stateProvider.
state('socketio-area', {
url: '/socketio',
templateUrl: 'modules/socketio-area/views/socke... | 'use strict';
//Setting up route |
<|file_name|>RubyConstant.java<|end_file_name|><|fim▁begin|>package com.xruby.runtime.lang;
public abstract class RubyConstant extends RubyBasic {
public static RubyConstant QFALSE = new RubyConstant(RubyRuntime.FalseClassClass) {
public boolean isTrue() {
return false;
}<|fim▁hole|> ... | };
|
<|file_name|>graph_actions_test.py<|end_file_name|><|fim▁begin|># Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://ww... | feeder = _Feeder(in0, 3)
results = learn.graph_actions.evaluate(
g, |
<|file_name|>models.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | (function($) {
}) (JQuery); |
<|file_name|>process.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
__author__ = 'Adam R. Smith, Michael Meisinger, Dave Foster <dfoster@asascience.com>'
import threading
import traceback
import gevent
from gevent import greenlet, Timeout
from gevent.event import Event, AsyncResult
from gevent.queue import Que... | """ |
<|file_name|>owcreateclass.py<|end_file_name|><|fim▁begin|>"""Widget for creating classes from non-numeric attribute by substrings"""
import re
from itertools import count
import numpy as np
from AnyQt.QtWidgets import QGridLayout, QLabel, QLineEdit, QSizePolicy
from AnyQt.QtCore import QSize, Qt
from Orange.data im... | |
<|file_name|>useragent_test.go<|end_file_name|><|fim▁begin|>// Copyright (C) 2017 Google Inc.
//
// 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/LIC... | // See the License for the specific language governing permissions and
// limitations under the License.
package net |
<|file_name|>conftest.py<|end_file_name|><|fim▁begin|># encoding: utf-8
# pylint: disable=redefined-outer-name,missing-docstring
import pytest
from tests import utils
from app import create_app
@pytest.yield_fixture(scope='session')
def flask_app():
app = create_app(flask_config_name='testing')
from app.ext... | username='readonly_user',
is_regular_user=False
) |
<|file_name|>macros.rs<|end_file_name|><|fim▁begin|>macro_rules! consume_spaces {
($lexer:expr) => (
loop {
match $lexer.peek_next() {
Some(lexer::Token::Space) => (),
_ => break,
}
// Consume the actual space.
$lexer.next();
... | )
} |
<|file_name|>h1.rs<|end_file_name|><|fim▁begin|>//! Adapts the HTTP/1.1 implementation into the `HttpMessage` API.
use std::borrow::Cow;
use std::cmp::min;
use std::fmt;
use std::io::{self, Write, BufWriter, BufRead, Read};
use std::net::Shutdown;
#[cfg(feature = "timeouts")]
use std::time::Duration;
use httparse;
us... | use mock::MockStream;
|
<|file_name|>DefaultSnmpControllerTest.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2016-present Open Networking Foundation
*
* 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
*
* ... | Alarm.SeverityLevel.CRITICAL,
time).build(); |
<|file_name|>after_signup.py<|end_file_name|><|fim▁begin|>import urllib
from canvas import util
def make_cookie_key(key):
return 'after_signup_' + str(key)<|fim▁hole|>
def _get(request, key):
key = make_cookie_key(key)
val = request.COOKIES.get(key)
if val is not None:
val = util.loads(urllib... | |
<|file_name|>hier_block.py<|end_file_name|><|fim▁begin|>import collections
import os
import codecs
from .top_block import TopBlockGenerator
from .. import Constants
from ..io import yaml
class HierBlockGenerator(TopBlockGenerator):
"""Extends the top block generator to also generate a block YML file"""
de... |
class QtHierBlockGenerator(HierBlockGenerator):
|
<|file_name|>kekule.chemEditor.baseEditors.js<|end_file_name|><|fim▁begin|>/**
* @fileoverview
* Base types and classes used by chem editor.
* @author Partridge Jiang
*/
/*
* requires /lan/classes.js
* requires /chemDoc/issueCheckers/kekule.issueCheckers.js
* requires /widgets/operation/kekule.operations.js
* ... | if (endDistance < threshold)
{
angle = 0; // do not rotate |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>use std::fmt;
use std::iter;
use std::f64;
use adivon::bag::Bag;
use adivon::stack::Stack;
use adivon::queue::Queue;
use adivon::priority_queue::IndexMinPQ;
/// Weighted directed edge
#[derive(Clone, Copy)]
pub struct DirectedEdge {
v: usize,
w: usize,
weig... | fn check(&self) -> bool { |
<|file_name|>CodeGeneratorInspector.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Copyright (c) 2011 Google Inc. All rights reserved.
# Copyright (c) 2012 Intel Corporation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that ... | else:
code = (" %s in_%s = get%s(paramsContainerPtr, \"%s\", 0, protocolErrorsPtr);\n" % |
<|file_name|>test_conf.py<|end_file_name|><|fim▁begin|>import sys
import os
from django.test import TestCase, override_settings, Client
from django.conf import settings<|fim▁hole|>from ..conf import (DatabaseUndefined, validate_database,
InaccessibleSettings, _load_py_file, load_py_settings,
... | |
<|file_name|>exceptions.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import absolute_import
<|fim▁hole|>
class BadOption(Exception):
""" Incorrect HTTP API arguments """
pass
class RenderError(Exception):
""" Error rendering page """
pass
class InternalError(Exception):
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.