prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>CardList.ts<|end_file_name|><|fim▁begin|>import { Stream } from "xstream";
import { div, DOMSource, p, VNode } from "@cycle/dom";
import { StateSource } from "cycle-onionify";
import Item, { State as ItemState } from "./CardItem";
export type State = Array<ItemState & { key: string }>;
export type... | |
<|file_name|>maxSafeInteger.d.ts<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | export = Number.MAX_SAFE_INTEGER; |
<|file_name|>progressbar.py<|end_file_name|><|fim▁begin|># Copyright 2013 OpenStack Foundation
# 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... | self._percent += size_read / self._totalsize
# Output something like this: [==========> ] 49% |
<|file_name|>supervisor_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://www.a... | logdir = _test_dir("restore_from_meta_graph")
with tf.Graph().as_default():
tf.Variable(1, name="v0") |
<|file_name|>bitcoin_tr.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="tr" version="2.0">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About Fishcoin</source>
... | <source>Wallet</source>
<translation>Cüzdan</translation>
</message>
<message> |
<|file_name|>NACKPacket.java<|end_file_name|><|fim▁begin|>/**
* JRakLibPlus is not affiliated with Jenkins Software LLC or RakNet.
* This software is an enhanced port of RakLib https://github.com/PocketMine/RakLib.
<|fim▁hole|> * the Free Software Foundation, either version 3 of the License, or
* (at your option) an... | * This file is part of JRakLibPlus.
*
* JRakLibPlus is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by |
<|file_name|>communicate.rs<|end_file_name|><|fim▁begin|>//! Defines the messages passed between client and server.
use cgmath::{Aabb3, Vector2, Vector3, Point3};
use std::default::Default;
use std::ops::Add;
use block_position::BlockPosition;
use entity::EntityId;
use lod::LODIndex;
use serialize::{Copyable, Flatten... |
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)] |
<|file_name|>common.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
"""
Copyright 2014 The Trustees of Princeton University
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
ht... | |
<|file_name|>responses.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
from moto.core.responses import BaseResponse
from .models import support_backends
import json
class SupportResponse(BaseResponse):
SERVICE_NAME = "support"
@property
def support_backend(self):
return su... | |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>'use strict';
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Any commits to this file should be reviewed with security in mind. *
* Changes to this file can potentially create security vulnerabilities. *
* An approval... | |
<|file_name|>main.ts<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | type MyArray = Array<string | number>; |
<|file_name|>vcs.rs<|end_file_name|><|fim▁begin|>use std::path::Path;
use git2;
use util::{CargoResult, process};
pub struct HgRepo;
pub struct GitRepo;
impl GitRepo {
pub fn init(path: &Path, _: &Path) -> CargoResult<GitRepo> {
git2::Repository::init(path)?;
Ok(GitRepo)
}
pub fn discove... | } |
<|file_name|>panic.rs<|end_file_name|><|fim▁begin|>use core::fmt::{self, Write};
use core::result;
use syscall::*;
pub struct DebugStream;
impl Write for DebugStream {
fn write_str(&mut self, s: &str) -> fmt::Result {
unsafe {
sys_debug(s.as_ptr(), s.len());
}
result::Result:... | } |
<|file_name|>CastingImpl.java<|end_file_name|><|fim▁begin|>/*
* Grakn - A Distributed Semantic Database
* Copyright (C) 2016 Grakn Labs Limited
*
* Grakn 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, ... | if(getGraknGraph().isBatchLoadingEnabled())
hash = "CastingBaseId_" + this.getBaseIdentifier() + UUID.randomUUID().toString();
else |
<|file_name|>__manifest__.py<|end_file_name|><|fim▁begin|># Copyright 2014-2015 Tecnativa S.L. - Jairo Llopis
# Copyright 2016 Tecnativa S.L. - Vicent Cubells
# Copyright 2017 Tecnativa S.L. - David Vidal
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Partner Contact Department",
... | "author": "Tecnativa, Odoo Community Association (OCA)", |
<|file_name|>state.go<|end_file_name|><|fim▁begin|>// parsex state 包参考了 golang 的内置包定义,部分代码模仿或来自 text/scanner ,其中有向
// https://github.com/sanyaade-buildtools/goparsec 学习一部分设计思路
package parsex
import (
"errors"
"fmt"
"io"
)
type ParsexError struct {
Pos int
Message string
}
func (err ParsexError) Error() stri... | if pos < 0 || pos > end {
message := fmt.Sprintf("%d out range [0, %d]", pos, end)
panic(errors.New(message))
} |
<|file_name|>usb.go<|end_file_name|><|fim▁begin|>package resources
import (
"io/ioutil"
"path/filepath"
"strconv"
"strings"
"github.com/pkg/errors"
"golang.org/x/sys/unix"
"github.com/lxc/lxd/shared/api"
"github.com/lxc/lxd/shared/usbid"
)
var sysBusUSB = "/sys/bus/usb/devices"
// GetUSB returns a filled a... | // Get driver
driverPath := filepath.Join(subDevicePath, "driver")
if sysfsExists(driverPath) {
linkTarget, err := filepath.EvalSymlinks(driverPath) |
<|file_name|>spanner_v1_generated_database_admin_create_database_async.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#<|fim▁hole|># 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 ... | |
<|file_name|>wait-for-element-to-be-removed.js<|end_file_name|><|fim▁begin|>import {waitFor} from './wait-for'
const isRemoved = result => !result || (Array.isArray(result) && !result.length)
// Check if the element is not present.
// As the name implies, waitForElementToBeRemoved should check `present` --> `removed`... | initialCheck(callback)
const elements = Array.isArray(callback) ? callback : [callback] |
<|file_name|>fields.py<|end_file_name|><|fim▁begin|>import json
from wtforms.fields import TextAreaField
from shapely.geometry import shape, mapping
from .widgets import LeafletWidget
from sqlalchemy import func
import geoalchemy2
#from types import NoneType
#from .. import db how do you get db.session in a Field?
cl... | super(GeoJSONField, self).process_formdata(valuelist)
if str(self.data) is '':
self.data = None |
<|file_name|>event.rs<|end_file_name|><|fim▁begin|>// Copyright 2015-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 glib::translate::*;
use gdk_ffi as ffi... | fn to_glib_none_mut(&'a mut self) -> StashMut<'a, *mut ::gdk_ffi::$ffi_name, Self> {
let ptr = ToGlibPtrMut::<*mut ::gdk_ffi::GdkEvent>::to_glib_none_mut(&mut self.0).0;
StashMut(ptr as *mut ::gdk_ffi::$ffi_name, self) |
<|file_name|>set_dir_command.go<|end_file_name|><|fim▁begin|>// Copyright 2015 The etcd 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
//
// http://www.apache.org/licenses/LI... | "go.etcd.io/etcd/client"
) |
<|file_name|>test_h5d.py<|end_file_name|><|fim▁begin|>from h5py import tests
from h5py import *
class TestCreate(tests.HTest):
def setUp(self):
self.fid, self.name = tests.gettemp()
def tearDown(self):
import os
self.fid.close()<|fim▁hole|>
@tests.require(api=18)
def test_crea... | os.unlink(self.name) |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
from setuptools import setup
setup(
name = "dhcpz",
version = "0.2.0",
author = [
"Nicholas VonHollen",
"Brian Lamar"
],
author_email = [
"nicholas.vonhollen@rackspace.c... | ],
license = "Apache License 2.0", |
<|file_name|>MessageInputType.js<|end_file_name|><|fim▁begin|>import {
GraphQLInputObjectType,
GraphQLID,
GraphQLList,
GraphQLBoolean,
} from 'graphql';
import RecipientTypeEnum from './RecipientTypeEnum';
import MessageTypeEnum from './MessageTypeEnum';
import NoteInputType from './NoteInputType';
import Tran... | }, |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>#![recursion_limit="256"]
#[macro_use]
extern crate helix;
extern crate fosslim;
use fosslim::index;
use fosslim::naive_tf;
use fosslim::finger_ngram;
use fosslim::document::Document;
ruby!{
class IndexBuilder {
def build_index(source_folder: String, tar... | Some(score) => {
let the_score: f64 = score.score as f64; |
<|file_name|>PrmGroup.hpp<|end_file_name|><|fim▁begin|>#ifndef PrmGroupH
#define PrmGroupH
// =============================================================================
// PrmFileLib - Parametr file parsing and manipulation library
// -----------------------------------------------------------------------------
// (... | class CPrmSection;
//------------------------------------------------------------------------------ |
<|file_name|>redox.rs<|end_file_name|><|fim▁begin|>use super::syscall;
pub const SYS_DEBUG: usize = 0;
pub const SYS_ALLOC: usize = 1000;
pub const SYS_REALLOC: usize = 1001;
pub const SYS_REALLOC_INPLACE: usize = 1002;
pub const SYS_UNALLOC: usize = 1003;
#[no_mangle]
pub unsafe fn sys_debug(ptr: *const u8, len: us... | |
<|file_name|>serializers.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from .models import CustomerWallet
class CustomerWalletSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = CustomerWallet
fields = ("wallet_id", "msisdn", "balance", "type", "status")<|fim▁end|> | from rest_framework import serializers
|
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>//! Traits, helpers, and type definitions for Card functionality.
//!
//! The `libterminal_cribbage::cards` module contains a number of common things you will need when
//! using cards during the game.
//!
//! ## Card, Rank, and Suit
//!
//! With all card games, using th... | //! Rank::Five => 5,
//! Rank::Six => 6, |
<|file_name|>VirtualTimeScheduler.js<|end_file_name|><|fim▁begin|>"use strict";
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototy... | |
<|file_name|>noise.hpp<|end_file_name|><|fim▁begin|>#pragma once
#include <glkernel/noise.h>
#include <glkernel/glm_compatability.h>
namespace
{
// From // JAVA REFERENCE IMPLEMENTATION OF IMPROVED NOISE - COPYRIGHT 2002 KEN PERLIN. (http://mrl.nyu.edu/~perlin/noise/)
// and (Improving Noise - Perlin - 2002) - ht... | kernel.template for_each<normal_operator<T>>(mean, stddev); |
<|file_name|>GCM.hpp<|end_file_name|><|fim▁begin|>//
// GCM.hpp<|fim▁hole|>// Copyright © 2017 FlyLab. All rights reserved.
//
#ifndef GCM_h
#define GCM_h
#include "GCMDefinitions.hpp"
#endif /* GCM_h */<|fim▁end|> | // OrbSlam
//
// Created by Manuel Deneu on 16/02/2017. |
<|file_name|>UserIndex.java<|end_file_name|><|fim▁begin|>package org.neo4j.extensions.spring.indexes;
import java.util.Map;
/**
* UserIndex indexed properties.
*
*
* @author bradnussbaum
* @version 0.1.0
*
* @since 0.1.0
*
*/
public enum UserIndex {
lastModifiedTime(IndexType.user_exact),
email... | this.type = type;
} |
<|file_name|>annotation.go<|end_file_name|><|fim▁begin|>package parser
import (
"context"
"encoding/json"
"log"
"strings"
"time"
"cloud.google.com/go/bigquery"
"cloud.google.com/go/civil"
"github.com/m-lab/annotation-service/api"
v2as "github.com/m-lab/annotation-service/api/v2"
"github.com/m-lab/etl/etl"
... | |
<|file_name|>immersedBoundaryCourantNo.H<|end_file_name|><|fim▁begin|>/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | foam-extend: Open Source CFD
\\ / O peration | Version: 3.2
\\ / A nd | Web:... |
CoNum = max(SfUfbyDelta/mesh.magSf())
.value()*runTime.deltaT().value();
|
<|file_name|>Entity.ts<|end_file_name|><|fim▁begin|>///<reference path="Math.ts"/>
class Entity {
get X(): number {
return this.Position.x;
}
get Y(): number {
return this.Position.y;
}
get Z(): number {<|fim▁hole|> return this.Position.z;
}
constructor(public Position: Vec3) {
}
}<|fim▁end|> | |
<|file_name|>binary-search.js<|end_file_name|><|fim▁begin|>function solve(args) {
function biSearch(array, searchedNumber, start, end) {
for (var i = start; i <= end; i += 1) {
if (+array[i] === searchedNumber) {
return i;
}
}
return -1;
}
var ... | numberX = +data.pop();
var firstIndex = 0;
var lastIndex = data.length - 1;
var resultIndex = 0; |
<|file_name|>osgearth_manip.cpp<|end_file_name|><|fim▁begin|>/* -*-c++-*- */
/* osgEarth - Dynamic map generation toolkit for OpenSceneGraph
* Copyright 2008-2014 Pelican Mapping
* http://osgearth.org
*
* osgEarth is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Pub... | {
ToggleThrowingHandler(char key, EarthManipulator* manip)
: _key(key), _manip(manip)
{ |
<|file_name|>radium.d.ts<|end_file_name|><|fim▁begin|>// Type definitions for radium 0.17.1
// Project: https://github.com/formidablelabs/radium
// Definitions by: Alex Gorbatchev <https://github.com/alexgorbatchev/>, Philipp Holzer <https://github.com/nupplaphil/>
// Definitions: https://github.com/DefinitelyTyped/Def... | declare module 'radium' {
import React = require('react');
|
<|file_name|>transforms.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
*/
<|fim▁hole|><|fim▁end|> | export type ExecutionTransformer<T> = (input: T) => T | Promise<T>; |
<|file_name|>normalization.py<|end_file_name|><|fim▁begin|>import numpy as np
import copy
from copy import deepcopy<|fim▁hole|>
#normalize the list into range [-1,1]
def linear_normalization(data):
normalization = deepcopy(data)
for index, datai in enumerate(normalization):
datai = float(datai)
... | |
<|file_name|>bitcoin_la.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="la" version="2.0">
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About COIN</source>
<translation>Informatio de COIN</... | <translation>Tessera pro conexionibus JSON-RPC</translation>
</message>
<message>
<location line="-68"/> |
<|file_name|>parseSTIX.py<|end_file_name|><|fim▁begin|>'''
* Copyright (C) 2015 Tripwire, 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/LICENSE-2.0
*... | if not os.path.exists(directory):
os.makedirs(directory)
if not os.path.exists(directory + '/' + sourceIP):
os.makedirs(directory + '/' + sourceIP) |
<|file_name|>placement-new-arena.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.a... | |
<|file_name|>FreeCADDriver.py<|end_file_name|><|fim▁begin|>from ..abstractdriver import AbstractDriver
import numpy as np
import os
class FreeCADDriver(AbstractDriver):
def __init__(self, debug=False):
super(FreeCADDriver, self).__init__()
self._debug = debug
self._program_name = "FreeCAD... | if self._debug: |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import *
from django.conf import settings
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# django-flags for internationalization
(r'^lang/', include('sa... | # FOR DEBUG AND TEST ONLY
(r'^.*switch/(?P<username>.*)/(?P<password>.*)/$', 'goflow.workflow.views.debug_switch_user'), |
<|file_name|>intrinsic_convolve5x5.rs<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2013 The Android Open Source Project
*
* 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... | float p1 = (float)(rsGetElementAt_uchar(gIn, x0, y1)) * gCoeffs[5]
+ (float)(rsGetElementAt_uchar(gIn, x1, y1)) * gCoeffs[6]
+ (float)(rsGetElementAt_uchar(gIn, x2, y1)) * gCoeffs[7] |
<|file_name|>objectLiteralBaseline.ts<|end_file_name|><|fim▁begin|>var x = {
foo: 1,
bar: "tt",
boo: 1 + 5
};
var x2 = {
foo: 1,
bar: "tt", boo: 1 + 5
};
function Foo() {
var typeICalc = {
clear: {
"()": [1, 2, 3]
}
}
}
// Rule for object lit... |
var x = {};
var y = {}; |
<|file_name|>ticketparser.py<|end_file_name|><|fim▁begin|>from onlineticket.generated.ticket import Ticket
from onlineticket.section import SectionParser
class TicketParser:
def parse(self, filename):
parsed = self._parse_kaitai(filename)
return self._map(parsed)
def _parse_kaitai(self, filena... | |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, unicode_literals
from datetime import datetime
import json
import random
import pytz
from smartmin.models import SmartModel
from temba import TembaClient
from django.conf import settings
from django.contrib.auth.models import ... | else: |
<|file_name|>theme.js<|end_file_name|><|fim▁begin|>(function () {
var modern = (function () {
'use strict';
var global = tinymce.util.Tools.resolve('tinymce.ThemeManager');
var global$1 = tinymce.util.Tools.resolve('tinymce.EditorManager');
var global$2 = tinymce.util.Tools.resolve('tinymce.util.Tools');
... | });
self._super();
return self;
}, |
<|file_name|>p5-play-button.js<|end_file_name|><|fim▁begin|>import Ember from 'ember';
export default Ember.Component.extend({
classNames: ['button-content'],
audio: Ember.inject.service(),
soundName: null,
rate: 1,<|fim▁hole|>
actions: {
play() {
this.get('audio').play(this.get('soundName'), this.... |
preloadSounds: function() {
this.get('audio');
}.on('init'), |
<|file_name|>config.go<|end_file_name|><|fim▁begin|>package tunnel
import (
"bytes"
stdcrypto "crypto"
"encoding/base64"
"errors"
"fmt"
"net"
"net/url"
"os"
"os/user"
"path/filepath"
"reflect"
"regexp"
"runtime"
"strconv"
"strings"
"github.com/Lafeng/deblocus/auth"
"github.com/Lafeng/deblocus/crypto"... | } else if !regexp.MustCompile("[A-Za-z]{2}").MatchString(d.DenyDest) {
return CONF_ERROR.Apply("DenyDest must be ISO3166-1 2-letter Country Code") |
<|file_name|>TrainingHallEquipment.java<|end_file_name|><|fim▁begin|>package com.company;
import java.util.Scanner;
public class TrainingHallEquipment {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
double budget = Double.parseDouble(scanner.nextLine());
... | |
<|file_name|>BitMask.java<|end_file_name|><|fim▁begin|>/*
* Copyright © 2015 Lable (info@lable.nl)
*
* 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/license... | return mask;
} |
<|file_name|>serde.rs<|end_file_name|><|fim▁begin|>extern crate serde;
use self::serde::json::{self, Value};
use types::test_type;
#[test]
fn test_json_params() {
test_type("JSON", &[(Some(json::from_str::<Value>("[10, 11, 12]").unwrap()),
"'[10, 11, 12]'"),
(Some(js... | |
<|file_name|>64_valgrind.py<|end_file_name|><|fim▁begin|>import os
MOZ_OBJDIR = 'obj-firefox'
config = {
'default_actions': [
'clobber',
'clone-tools',
'checkout-sources',
#'setup-mock',
'build',
#'upload-files',
#'sendchange',
'check-test',
... | releng.manifest", |
<|file_name|>huffman.py<|end_file_name|><|fim▁begin|>class ResizeError(Exception):
pass
def codelengths_from_frequencies(freqs):
freqs = sorted(freqs.items(),
key=lambda item: (item[1], -item[0]), reverse=True)
nodes = [Node(char=key, weight=value) for (key, value) in freqs]
while len(nodes) > ... | for car in self.text: |
<|file_name|>Gruntfile.js<|end_file_name|><|fim▁begin|>// Generated on 2014-07-03 using
// generator-webapp 0.5.0-rc.1
'use strict';
// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
// If you want to recursively match all subfolders, use:
// 'test/spec/**/*.js'
mod... | files: ['bower.json'], |
<|file_name|>HTMLButtonElement.py<|end_file_name|><|fim▁begin|>########################################################################
#
# File Name: HTMLButtonElement
#
# Documentation: http://docs.4suite.com/4DOM/HTMLButtonElement.html
#
### This file is automatically generated by GenerateH... | def _get_type(self):
|
<|file_name|>filters_ex01.py<|end_file_name|><|fim▁begin|># Aspect ratio
# create mesh
from SMESH_mechanic import *
# get faces with aspect ratio > 1.5
filter = smesh.GetFilter(SMESH.FACE, SMESH.FT_AspectRatio, SMESH.FT_MoreThan, 1.5)
ids = mesh.GetIdsFromFilter(filter)
print "Number of faces with aspect ratio > 1.5:... |
# copy the faces with aspect ratio > 1.5 to another mesh;
# this demostrates that a filter can be used where usually a group or submesh is acceptable
filter.SetMesh( mesh.GetMesh() ) |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// Copyright 2017 The Xyrosource Team.<|fim▁hole|>// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
extern crate slog;
extern crate slog_term;
use slog::{... | //
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license |
<|file_name|>workorder_views.py<|end_file_name|><|fim▁begin|>from django.template import RequestContext
from django.shortcuts import render_to_response, HttpResponse, HttpResponseRedirect
from django.contrib.auth.decorators import login_required
from django.views.decorators.csrf import csrf_exempt
from django.contrib i... | header_list.insert(3, 'Finish Date')
context_dict['count'] = finished_orders.count()
elif status == 'terminated': |
<|file_name|>NLBAdvancedSettings.tsx<|end_file_name|><|fim▁begin|>import React from 'react';
import { Field, FormikProps } from 'formik';
import { HelpField } from '@spinnaker/core';
import { IAmazonNetworkLoadBalancerUpsertCommand } from 'amazon/domain';<|fim▁hole|>
export class NLBAdvancedSettings extends React.Com... |
export interface INLBAdvancedSettingsProps {
formik: FormikProps<IAmazonNetworkLoadBalancerUpsertCommand>;
} |
<|file_name|>adminMenu.js<|end_file_name|><|fim▁begin|>/*
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.... | expect(page).toClick('[aria-label="Main dashboard navigation"] a', {
text: 'Explore Templates',
}),
]); |
<|file_name|>0026_auto_20170629_1342.py<|end_file_name|><|fim▁begin|><|fim▁hole|># Generated by Django 1.11.2 on 2017-06-29 05:42
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('blog', '0025_auto_20170626_0008'),
]
... | # -*- coding: utf-8 -*- |
<|file_name|>map-store.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | export { default } from 'ember-flexberry-gis/services/map-store'; |
<|file_name|>ClassInformationDeserializer.java<|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 owners... | import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
/**
* |
<|file_name|>fatorial-while.py<|end_file_name|><|fim▁begin|>def fat(n):
result = 1
while n > 0:
result = result * n
n = n - 1
return result<|fim▁hole|>print("Fatorial de 3: ", fat(3));<|fim▁end|> |
# testes |
<|file_name|>test_GffGeneParser.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import unittest
from SDDetector.Entities.Gene import Gene
from SDDetector.Entities.Transcript import Transcript
from SDDetector.Entities.CDS import CDS
from SDDetector.Parser.Gff.GffGeneParser import GffGeneParser
class TestGffGene... | |
<|file_name|>ln.rs<|end_file_name|><|fim▁begin|>#![crate_name = "uu_ln"]
/*
* This file is part of the uutils coreutils package.
*
* (c) Joseph Crail <jbcrail@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
extern crat... | |
<|file_name|>how_to_configure_an_expectation_store_in_gcs.py<|end_file_name|><|fim▁begin|>import os
import subprocess
from ruamel import yaml
import great_expectations as ge
context = ge.get_context()
# NOTE: The following code is only for testing and depends on an environment
# variable to set the gcp_project. You... | stdout=subprocess.PIPE,
)
stdout = result.stdout.decode("utf-8") |
<|file_name|>formfields.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
from netaddr import EUI, AddrFormatError
from django import forms
from django.core.exceptions import ValidationError
<|fim▁hole|>#
class MACAddressFormField(forms.Field):
default_error_messages = {
'invalid':... | #
# Form fields |
<|file_name|>0004_auto_20151223_1440.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('base', '0003_auto_20151109_2002'),
]
operations = [
mig... | field=models.CharField(max_length=200, null=True, blank=True), |
<|file_name|>nanopb_generator.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from __future__ import unicode_literals
'''Generate header file for nanopb from a ProtoBuf FileDescriptorSet.'''
nanopb_version = "nanopb-0.3.9.2"
import sys
import re
import codecs
from functools import reduce
try:
# Add some d... | for msg in self.messages: |
<|file_name|>compiler_host.ts<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright Google Inc. 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
*/
import {AotCompilerHost, EmitterVisitorContext, ExternalR... | return this.flatModuleIndexNames.has(normalFilePath) ||
this.flatModuleIndexRedirectNames.has(normalFilePath);
}
} |
<|file_name|>template-literals.js<|end_file_name|><|fim▁begin|>/**
* Template literals are a way to more easily achieve string concatenation.
* Template literals are defined using back ticks (``).
* Placeholders are indicated by using a ${variable}
* Function tags are used to reference functions. Tags are a very ha... | } |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>/*
* Copyright 2012-2015 MarkLogic 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 License at
*
* http://www.apache.org/li... | searchResult: searchResult, |
<|file_name|>spoke.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
for all "spoke" CASUs, they emit when reading one specific directional
IR sensor.
set the direction that is sensed by the -d flag, from NESW
this is borrowed from `examples/targeted_messaging`, with server setup
that... |
def send_msg(self):
|
<|file_name|>footer_tests.tsx<|end_file_name|><|fim▁begin|>import {ClientType} from "../../../scripts/clientType";
import {Constants} from "../../../scripts/constants";
import {StringUtils} from "../../../scripts/stringUtils";
import {Clipper} from "../../../scripts/clipperUI/frontEndGlobals";
import {Footer} from ".... |
let feedbackWindowRef = controllerInstance.getFeedbackWindowRef();
ok(!feedbackWindowRef || feedbackWindowRef.closed, |
<|file_name|>event.go<|end_file_name|><|fim▁begin|>/*
Copyright 2018 The Kubernetes Authors.
<|fim▁hole|>you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, so... | Licensed under the Apache License, Version 2.0 (the "License"); |
<|file_name|>Chip8Extension.java<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2014 Johannes Donath <johannesd@evil-co.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
<|fim▁hole|> *
* Unless required by applicable law or agreed to in writing, software
* distributed under 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
|
<|file_name|>TranscriptionAnalysesWizardIterator.java<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2014 Institute for Bioinformatics and Systems Biology, University Giessen, Germany
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as ... | |
<|file_name|>converter.py<|end_file_name|><|fim▁begin|>"""Funções de conversão usada pelo scraper do Itaú."""
import datetime
from dateutil.parser import parse
from dateutil.relativedelta import relativedelta
from decimal import Decimal
def date(s):
"""Converte strings 'DD/MM' em datetime.date.
Leva em consid... | """
return ((date(a), b, decimal(c)) for a, b, c in iterable if not is_balance(b))
|
<|file_name|>res_company.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*-
##############################################################################
#
# res_partner
# Copyright (c) 2013 Codeback Software S.L. (http://codeback.es)
# @author: Miguel García <miguel@codeback.es>
# @author: Javi... | from osv import fields, osv
from datetime import datetime, timedelta |
<|file_name|>block.py<|end_file_name|><|fim▁begin|>import numpy as np
import os
import time
from ..utils import *
def _costMAD(block1, block2):
block1 = block1.astype(np.float)
block2 = block2.astype(np.float)
return np.mean(np.abs(block1 - block2))
def _minCost(costs):
h, w = costs.shape
if co... | |
<|file_name|>settings.js<|end_file_name|><|fim▁begin|>import { RocketChat } from 'meteor/rocketchat:lib';<|fim▁hole|>RocketChat.settings.addGroup('Logs', function() {
this.add('Log_Exceptions_to_Channel', '', { type: 'string' });
});<|fim▁end|> | |
<|file_name|>leafspread.cpp<|end_file_name|><|fim▁begin|>/*
* Animation plugin for compiz/beryl
*
* animation.c
*
* Copyright : (C) 2006 Erkin Bahceci
* E-mail : erkinbah@gmail.com
*
* Based on Wobbly and Minimize plugins by
* : David Reveman
* E-mail : davidr@novell.com>
*
* Particle system... | |
<|file_name|>types.go<|end_file_name|><|fim▁begin|>/*
Copyright 2014 The Kubernetes Authors All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/L... | type HostPathVolumeSource struct { |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>import os
from setuptools import setup, find_packages
README = open(os.path.join(os.path.dirname(__file__), 'README.md')).read()
<|fim▁hole|>setup(
name='django-email-subscription',
url='https://github.com/MagicSolutions/django-email-subscription',
version... | os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
|
<|file_name|>set.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/licenses/LI... |
use super::{HashMap, Entries, MoveEntries, INITIAL_CAPACITY}; |
<|file_name|>specialist_pool.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/... | Required. The resource name of the
SpecialistPool.
display_name (str):
Required. The user-defined name of the |
<|file_name|>htmlescape.js<|end_file_name|><|fim▁begin|>/**
* For proper JSON escaping for use as JS object literal in a <script> tag
* For your education: http://timelessrepo.com/json-isnt-a-javascript-subset
*
* Javascript implementation of http://golang.org/pkg/encoding/json/#HTMLEscape
*/
'use strict';
var E... |
var ESCAPE_REGEX = /[&><\u2028\u2029]/g;
|
<|file_name|>application.js<|end_file_name|><|fim▁begin|>// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plu... | // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details |
<|file_name|>HTMLArea.js<|end_file_name|><|fim▁begin|>/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and lic... | */
define(['TYPO3/CMS/Rtehtmlarea/HTMLArea/UserAgent/UserAgent', |
<|file_name|>chrome_cache.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3<|fim▁hole|>
from plaso.parsers import chrome_cache
from tests.parsers import test_lib
class ChromeCacheParserTest(test_lib.ParserTestCase):
"""Tests for the Chrome Cache files parser."""
def testParse(self):
"""Tests the Parse ... | # -*- coding: utf-8 -*-
"""Tests for the Chrome Cache files parser."""
import unittest |
<|file_name|>lib.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/. */
#![feature(alloc)]
#![feature(box_syntax)]
#![feature(collections... | #![feature(io)]
#![feature(optin_builtin_traits)]
#![feature(path)] |
<|file_name|>plotDragCoefficient.py<|end_file_name|><|fim▁begin|>"""
Plots the instantaneous drag coefficient between 0 and 3 time-units of flow
simulation and compares with numerical results from
Koumoutsakos and Leonard (1995).
_References:_
* Koumoutsakos, P., & Leonard, A. (1995).
High-resolution simulations of ... | |
<|file_name|>git.rs<|end_file_name|><|fim▁begin|>// This file is released under the same terms as Rust itself.
use pipeline::{self, PipelineId};
use std;
use std::convert::From;
use std::fs::File;
use std::io::Read;
use std::path::Path;
use std::process::Command;
use std::sync::mpsc::{Sender, Receiver};
use vcs::{self... | )).expect("Pipeline gone merge to staging");
}
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.