prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>f10-read-timeout.rs<|end_file_name|><|fim▁begin|>/// Figure 10.10: Calling read with a timeout
///
/// Takeaway: First I tried with the regular `signal` function of libc
/// only to find out that the alarm signal does not interrupt the read
/// call. Digging into the C code it got obvious that the signal f... | fn sig_alrm(_: c_int) { |
<|file_name|>Definition.js<|end_file_name|><|fim▁begin|>export default class Definition {
get module() { return this._module; }
set module(value) { this._module = value; }<|fim▁hole|>
get classArguments() { return this._arguments || []; }
set classArguments(value) { this._arguments = value; }
get... | |
<|file_name|>OAuthJwtAccessTokenValidatorTest.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2020 Yahoo 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... | Mockito.doThrow(new CertificateEncodingException()).when(mock).getX509CertificateThumbprint(null);
assertThrows(OAuthJwtAccessTokenException.class, () -> mock.validateCertificateBinding(null, (X509Certificate) null)); |
<|file_name|>SparkArgsExtractor.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 ownership. The ASF licenses this file
* to... | |
<|file_name|>S12.10_A1.4_T4.js<|end_file_name|><|fim▁begin|>// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S12.10_A1.4_T4;
* @section: 12.10;
* @assertion: The with statement adds a computed object to the front of the
... | if(!(myObj.p4 === undefined)){ |
<|file_name|>build_docs.py<|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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unl... | doc_generator = generate_lib.DocGenerator( |
<|file_name|>download_floodlight_tag.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#
# Copyright 2014 Google Inc. 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
#
# ... | 'profile_id', type=int, |
<|file_name|>constraints3.rs<|end_file_name|><|fim▁begin|>extern crate nalgebra as na;
use na::{Point3, RealField, Vector3};
use ncollide3d::shape::{Cuboid, ShapeHandle};
use nphysics3d::force_generator::DefaultForceGeneratorSet;
use nphysics3d::joint::DefaultJointConstraintSet;
use nphysics3d::joint::{
BallConstr... | }
let rb = RigidBodyDesc::new() |
<|file_name|>safeEval.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# Copyright 2016 - 2021 Bas van Meerten and Wouter Franssen
# This file is part of ssNake.
#
# ssNake 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 S... | def safeEval(inp, length=None, Type='All', x=None):
"""
Creates a more restricted eval environment. |
<|file_name|>ParserTrigger.java<|end_file_name|><|fim▁begin|>package org.nnsoft.shs.core.http.parse;
/*
* Copyright (c) 2012 Simone Tripodi (simonetripodi@apache.org)
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Soft... |
/**
* Performs an parse action on the input token, adding data to the request, depending on the parser status.
* |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Test suite for django-staticshard.
"""
import uuid
from urlparse import urlparse
from django.conf import settings
from django.test import TestCase
from django.core.exceptions import ImproperlyConfigured
from ..settings import STATICSHAR... | def test_absolute_url(self): |
<|file_name|>mspimpl.go<|end_file_name|><|fim▁begin|>/*
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package msp
import (
"bytes"
"crypto/x509"
"crypto/x509/pkix"
"encoding/hex"
"encoding/pem"
"fmt"
"github.com/golang/protobuf/proto"
"github.com/hyperledger/fabric/bccsp"
... | // is regenerated to have a Low-S signature. |
<|file_name|>David Yuen Shades of Blue.py<|end_file_name|><|fim▁begin|>#David Yuen
#September 11, 2017
#This program draws different shades of blue.<|fim▁hole|>bob.shape("turtle")
bob.backward(100)
for i in range(0,255,10):
bob.forward(10)
bob.pensize(i)
bob.color(0,0,i)<|fim▁end|> |
import turtle
turtle.colormode(255)
bob = turtle.Turtle() |
<|file_name|>syntax-extension-fmt.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 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.apach... | // Plus overrides space
|
<|file_name|>sort_files_by_rcp.py<|end_file_name|><|fim▁begin|>import os, glob, shutil
from pathos import multiprocessing as mp
import pandas as pd
import numpy as np
base_path = '/Data/malindgren/cru_november_final/IEM/ar5'
output_base_path = '/Data/malindgren/cru_november_final/IEM/ar5'
models = [ 'IPSL-CM5A-LR', ... | pool.close() |
<|file_name|>MetaCycExtracter.java<|end_file_name|><|fim▁begin|>/*******************************************************************************
* Manchester Centre for Integrative Systems Biology
* University of Manchester
* Manchester M1 7ND
* United Kingdom
*
* Copyright (C) 2008 University of Manchester
*
... | XmlFormatter.getInstance().write( document, outFile );
SbmlFactory.getInstance().unregister();
} |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright (c) 2014 by pyramid_decoy authors and contributors
# <see AUTHORS file>
#
# This module is part of pyramid_decoy and is released under
# the MIT License (MIT): http://opensource.org/licenses/MIT
"""Main decoy module."""
__version__ = "0.2.0"
SETTINGS_P... | Extract decoy settings out of all.
|
<|file_name|>config.ts<|end_file_name|><|fim▁begin|>export const constObjConfig = {<|fim▁hole|>}<|fim▁end|> | "assets": "https://d1fyaep5g8hhgq.cloudfront.net/web/tmjsleeptherapycentre" |
<|file_name|>bind-shim.js<|end_file_name|><|fim▁begin|>// PhantomJS is missing Function.prototype.bind:
// http://code.google.com/p/phantomjs/issues/detail?id=522
if (!Function.prototype.bind) {
Function.prototype.bind = function (oThis) {
if (typeof this !== "function") {
// closest thing possible to the... | };
fNOP.prototype = this.prototype; |
<|file_name|>main.go<|end_file_name|><|fim▁begin|>package main
import (
"log"
"net/http"
"github.com/sirupsen/logrus"
"github.com/stripe/smokescreen/cmd"
"github.com/stripe/smokescreen/pkg/smokescreen"
)
// This default implementation of RoleFromRequest uses the CommonName of the
// client's certificate. If no... |
func main() {
conf, err := cmd.NewConfiguration(nil, nil) |
<|file_name|>account.rs<|end_file_name|><|fim▁begin|>extern crate meg;
use std::env;
use std::clone::Clone;
use turbo::util::{CliResult, Config};<|fim▁hole|>
#[derive(RustcDecodable, Clone)]
pub struct Options {
pub arg_email: String,
pub flag_show: bool,
}
pub const USAGE: &'static str = "
Usage:
meg account [... | use self::meg::ops::meg_account_create as Act;
use self::meg::ops::meg_account_show as Show;
|
<|file_name|>test_option_value_container.py<|end_file_name|><|fim▁begin|># coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
<|fim▁hole|>import unittest
from pants.option.option_value_container import OptionValueContainer
fro... | from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import copy |
<|file_name|>sensible-app.js<|end_file_name|><|fim▁begin|>// sensible server which advertises itself via Bonjour
// NODE INCLUDES
var dgram = require ("dgram");
var fs = require ("fs");
var http = require ("http");
var os = require ("os");
var url = require ("url");
// REGULAR JS INCLUDES
<|fim▁hole|>eval (code.toSt... | // assume that sensible.js lives in the same directory as our mainline
var code = fs.readFileSync (require ("path").dirname (process.argv [1]) + "/sensible.js"); |
<|file_name|>SirenFieldAttribute.cpp<|end_file_name|><|fim▁begin|>// Copyright (c) 2015 fjz13. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
#include "MedusaCorePreCompiled.h"
#include "SirenFieldAttribute.h"
#include "Core/IO/Stream/IStream... | |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>"""
This module instructs the setuptools to setpup this package properly
:copyright: (c) 2016 by Mehdy Khoshnoody.
:license: GPLv3, see LICENSE for more details.
"""
import os
from distutils.core import setup<|fim▁hole|> packages=['pyeez'],
classifi... |
setup(
name='pyeez',
version='0.1.0', |
<|file_name|>dice.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import random<|fim▁hole|>def roll(qty, sides):
return sum(random.randrange(1, sides + 1) for _ in range(qty))
def chances(qty, out_of):
"""'1 chance in 5' is chances(1, 5)"""
# Chance succeeds if roll is lower than max.
return roll(1... | |
<|file_name|>util.rs<|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 the Apach... | #[cfg(test)]
mod tests { |
<|file_name|>hparams_lib_test.py<|end_file_name|><|fim▁begin|># Copyright 2019 Verily Life Sciences 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... | |
<|file_name|>facility.py<|end_file_name|><|fim▁begin|>from chronotope.model.base import PublicationWorkflowBehavior
from chronotope.model.base import SQLBase
from chronotope.model.category import CategoryRecord
from chronotope.model.location import LocationRecord
from chronotope.utils import ensure_uuid
from chronotope... | from sqlalchemy.orm import relationship |
<|file_name|>commit_status.go<|end_file_name|><|fim▁begin|>// Copyright 2019 The Gitea Authors.
// All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package pull
import (
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/git"
"code.... | }
if pr.ProtectedBranch == nil || !pr.ProtectedBranch.EnableStatusCheck { |
<|file_name|>unboxed-closure-sugar-wrong-number-number-type-parameters.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<|fim▁hole|>// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. Thi... | // 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 |
<|file_name|>helper.py<|end_file_name|><|fim▁begin|>from __future__ import division
from __future__ import unicode_literals
from builtins import range
from past.utils import old_div
import hashlib
import os
import random
import string
import tempfile
import re
import time
import urllib
from datetime import datetime
fr... | return (61.013710, 99.196656, 'Siberia') |
<|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/. */
<%! from data import to_rust_ident %>
<%namespace name=... | allow_quirks=True,
servo_restyle_damage="reflow_out_of_flow",
logical_group="inset", |
<|file_name|>categories.py<|end_file_name|><|fim▁begin|>from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _
from olympia.constants.applications import (
ANDROID, FIREFOX, SEAMONKEY, THUNDERBIRD)
from olympia.constants.base import (
ADDON_DICT, ADDON_EXTENSION, A... | ADDON_SEARCH: {
'bookmarks': StaticCategory(id=79, name=_(u'Bookmarks')), |
<|file_name|>sql_translator.py<|end_file_name|><|fim▁begin|>from rapt.treebrd.attributes import AttributeList
from ...treebrd.node import Operator
from ..base_translator import BaseTranslator
class SQLQuery:
"""
Structure defining the building blocks of a SQL query.
"""
def __init__(self, select_block... | |
<|file_name|>onegbe.py<|end_file_name|><|fim▁begin|>import logging
import struct
from memory import Memory
from network import Mac, IpAddress
from gbe import Gbe
LOGGER = logging.getLogger(__name__)
# Offsets for fields in the memory map, in bytes
OFFSET_CORE_TYPE = 0x0
OFFSET_BUFFER_SIZE = 0x4
OFFSET_WORD_LEN ... |
# end |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
import os
from mopidy import config, exceptions, ext
__version__ = '0.2.2'
class GMusicExtension(ext.Extension):
dist_name = 'Mopidy-GMusic'<|fim▁hole|> conf_file = os.path.join(os.path.dirname(__file__), 'ex... | ext_name = 'gmusic'
version = __version__
def get_default_config(self): |
<|file_name|>no_libc.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/.
pub use cty_base::types::{c_int};
#[no_mangle]
pub unsafe exter... | // memcpy copies from the tail
return memcpy(dst, src, n);
} |
<|file_name|>base_counters.py<|end_file_name|><|fim▁begin|>import re
import time
class BaseCounters:<|fim▁hole|> def ping(self, key):
self.validate_key(key)
self.do_ping(key, int(time.time()))
def hit(self, key, n=1):
self.validate_key(key)
self.do_hit(key, n)
def validate_key(self, key):
if... | def __init__(self):
self.keyre = re.compile('\A[\w.]+\Z')
|
<|file_name|>panorama_js_panlet_icon_widgets_settings.js<|end_file_name|><|fim▁begin|>/* Shape Settings Tab */
TP.shapesStore = Ext.create('Ext.data.Store', {
fields: ['name', 'data'],
proxy: {
type: 'ajax',
url: 'panorama.cgi?task=userdata_shapes',
reader: {
type: 'json',
... | f.hide();
}
}
}); |
<|file_name|>lfu_item.go<|end_file_name|><|fim▁begin|>package lfu
type lfuItem struct {
data interface{}<|fim▁hole|>func newlfuItem(data interface{}, parent *freqNode) *lfuItem {
return &lfuItem{
data: data,
parent: parent,
}
}<|fim▁end|> | parent *freqNode
}
|
<|file_name|>processors.py<|end_file_name|><|fim▁begin|>try:
from calais import Calais
except ImportError: # pragma: no cover
Calais = None # NOQA
if Calais is not None:
def process_calais(content, key):
calais = Calais(key)<|fim▁hole|> people = [entity["name"] for entity in getattr(respo... | response = calais.analyze(content)
|
<|file_name|>test_mistral_v2_policy.py<|end_file_name|><|fim▁begin|># Licensed to the StackStorm, Inc ('StackStorm') 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 t... |
import copy
import uuid |
<|file_name|>_Cisco_IOS_XR_infra_objmgr_oper.py<|end_file_name|><|fim▁begin|>import re
import collections
from enum import Enum
from ydk._core._dm_meta_info import _MetaInfoClassMember, _MetaInfoClass, _MetaInfoEnum
from ydk.types import Empty, YList, YLeafList, DELETE, Decimal64, FixedBitsDict
from ydk._core._dm_met... | |
<|file_name|>sf_snapshot_schedule_manager.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# (c) 2017, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'m... | try: |
<|file_name|>p486.cpp<|end_file_name|><|fim▁begin|>//BE NAME DOOST
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <set>
#include <iostream>
using namespace std;
int main()
{
string a,b;
cin>>a>>b;
set <char> d;
for(int i=0;i<a.size();i++)
d.insert(a[i]);
... | {
set <char> tmp=d;
int s=tmp.size();
tmp.insert(b[i]); |
<|file_name|>webpack.test.config.js<|end_file_name|><|fim▁begin|>var path = require("path");
module.exports = {
watch: false,
module: {
loaders: [
{
test: /\.jsx?$/,
exclude: /node_modules/,
loader: 'babel-loader'
}
],
... | ]
},
resolve: {
// add bower components and main source to resolved |
<|file_name|>trade.component.ts<|end_file_name|><|fim▁begin|>import { Component } from "@angular/core";
import { Router } from "@angular/router";
import { Order } from "classes-common/order";
import { AccountService } from "services/account.service";
import { promiseError } from "utils/utils";
@Component({
module... | .catch(() => this.submitFailed = true);
}
}; |
<|file_name|>mips.rs<|end_file_name|><|fim▁begin|>//! Run-time feature detection for MIPS on Linux.
use crate::detect::{Feature, cache, bit};
use super::auxvec;
/// Performs run-time feature detection.
#[inline]
pub fn check_for(x: Feature) -> bool {
cache::test(x as u32, detect_features)
}
/// Try to read the f... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from .make_haploblocks import get_haploblocks
from .genetic_models import check_genetic_models
from .model_score import get_model_score
from .fix_variant import make_print_version
from .variant_annotator import VariantAnnotator<|fim▁end|> | from __future__ import absolute_import
|
<|file_name|>octopi_ro.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="ro" version="2.0">
<context>
<name>MainWindow</name>
<message>
<location filename="Projects/octopi/ui/mainwindow.ui" line="14"/>
<source>Octopi</source>
<translation>Octopi</translatio... | <translation>Ctrl+G</translation> |
<|file_name|>services.d.ts<|end_file_name|><|fim▁begin|>import { IInjectable } from "../common/common";
<|fim▁hole|>import * as angular from 'angular';
import IScope = angular.IScope;
/**
* Annotates a controller expression (may be a controller function(), a "controllername",
* or "controllername as name")
*
... | import { TypedMap } from "../common/common";
import { StateProvider } from "./stateProvider";
import { ResolveContext } from "../resolve/resolveContext";
|
<|file_name|>lumina-textedit_uz.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="uz_UZ">
<context>
<name>ColorDialog</name>
<message>
<location filename="../ColorDialog.ui" line="14"/>
<source>Customize Colors</source>
<tran... | <source>Find</source>
<translation type="unfinished"></translation>
</message> |
<|file_name|>datatypes.rs<|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 the ... | );
assert_eq!(
Some(VNumber(Number::from_f64(0.01f64).unwrap())),
0.01f64.into_json_value() |
<|file_name|>ZipOutputFileProvider.java<|end_file_name|><|fim▁begin|>// Copyright 2017 The Bazel 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
//
// htt... | |
<|file_name|>ti.py<|end_file_name|><|fim▁begin|>"""
Type Inference
"""
from .typevar import TypeVar
from .ast import Def, Var
from copy import copy
from itertools import product
try:
from typing import Dict, TYPE_CHECKING, Union, Tuple, Optional, Set # noqa
from typing import Iterable, List, Any, TypeVar as MT... |
if tv.is_derived:
tv = TypeVar.derived(self[tv.base], tv.derived_func)
return tv |
<|file_name|>ZoneControlState.java<|end_file_name|><|fim▁begin|>/**
* Copyright (c) 2010-2018 by the respective copyright holders.<|fim▁hole|> * http://www.eclipse.org/legal/epl-v10.html
*/
package org.openhab.binding.yamahareceiver.internal.state;
import static org.openhab.binding.yamahareceiver.YamahaReceiverBindi... | *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at |
<|file_name|>sequential_handler.go<|end_file_name|><|fim▁begin|>package dbus
import (
"sync"
)
// NewSequentialSignalHandler returns an instance of a new
// signal handler that guarantees sequential processing of signals. It is a
// guarantee of this signal handler that signals will be written to
// channels in the ... | |
<|file_name|>build.rs<|end_file_name|><|fim▁begin|>// Copyright © 2015, Peter Atashian<|fim▁hole|>extern crate build;
fn main() {
build::link("xinput9_1_0", true)
}<|fim▁end|> | // Licensed under the MIT License <LICENSE.md> |
<|file_name|>test_settings.py<|end_file_name|><|fim▁begin|>#-------------------------------------------------------------------------------
#
# This file is part of pylibgimpplugin.
#
# Copyright (C) 2014 khalim19 <khalim19@gmail.com>
#
# pylibgimpplugin is free software: you can redistribute it and/or modify
# it unde... | |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>import { combineReducers } from 'redux'
import userInfo from './userInfo'
import userFeed from './userFeed'
import popularFeed from './popularFeed'
<|fim▁hole|>})<|fim▁end|> | export default combineReducers({
userInfo,
userFeed,
popularFeed |
<|file_name|>django-admin.py<|end_file_name|><|fim▁begin|>#!/home/jojoriveraa/Dropbox/Capacitación/Platzi/Python-Django/NFCow/venv/bin/python3
from django.core import management<|fim▁hole|>if __name__ == "__main__":
management.execute_from_command_line()<|fim▁end|> | |
<|file_name|>sha-text.js<|end_file_name|><|fim▁begin|><|fim▁hole|>// generate a hash from string
var crypto = require('crypto'),
text = 'hello bob',
key = 'mysecret key'
// create hahs
var hash = crypto.createHmac('sha512', key)
hash.update(text)
var value = hash.digest('hex')
// print result
console.log(value);<... | |
<|file_name|>DataDownloadCqlBuilderSpec.js<|end_file_name|><|fim▁begin|>describe("Portal.filter.combiner.DataDownloadCqlBuilder", function() {
var builder;
beforeEach(function() {
var filters =[
{
constructor: Portal.filter.GeometryFilter, // Is Geometry filter
... |
builder = new Portal.filter.combiner.DataDownloadCqlBuilder({ |
<|file_name|>price_import.py<|end_file_name|><|fim▁begin|>from decimal import Decimal
from django.core.management.base import BaseCommand
from openpyxl import load_workbook
from contracts.models import PriceName, PriceCoast
from directory.models import Researches
class Command(BaseCommand):
def add_arguments(se... | parser.add_argument('path', type=str)
def handle(self, *args, **kwargs): |
<|file_name|>gcp_resourcemanager_project.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
#... | description: |
<|file_name|>ConnectionPoint.py<|end_file_name|><|fim▁begin|>import Sea
from Connection import Connection
class ConnectionPoint(Connection):
"""
Class for point connections.
"""
def __init__(self, obj, system, components):
Connection.__init__(self, obj, system, components)
... |
connections = Sea.actions.connection.ShapeConnection([item.Shape for item in obj.Components])
commons = connections.commons()
|
<|file_name|>cpp_code_generator.rs<|end_file_name|><|fim▁begin|>use cpp_ffi_data::{QtSlotWrapper, CppIndirectionChange, CppAndFfiMethod, CppFfiArgumentMeaning,
CppFfiHeaderData, CppFfiType, CppFieldAccessorType, CppFfiMethodKind};
use cpp_method::ReturnValueAllocationPlace;
use cpp_type::{CppTypeIndi... | let return_type = &method.c_signature.return_type.ffi_type; |
<|file_name|>HeadRequestArguments.java<|end_file_name|><|fim▁begin|>/**
* Copyright (c) 2010-2021 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Ecl... | if (null == scope) {
scope = "";
} |
<|file_name|>gtest_attribute.rs<|end_file_name|><|fim▁begin|>use proc_macro::TokenStream;
use quote::{format_ident, quote, quote_spanned};
use syn::spanned::Spanned;
/// The `gtest` macro can be placed on a function to make it into a Gtest unit test, when linked
/// into a C++ binary that invokes Gtest.
///
/// The `g... | let test_name_c_bytes = CStringLiteral(&test_name); |
<|file_name|>mysqlBaseTestCase.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
# -*- mode: python; indent-tabs-mode: nil; -*-
# vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
#
# Copyright (C) 2011 Patrick Crews
#
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of th... | may execute
""" |
<|file_name|>harddrive_enumerator.py<|end_file_name|><|fim▁begin|>import win32api
import os
import sys
import subprocess
import logging
from itertools import izip_longest
#itertools recipe
def grouper(n, iterable, fillvalue=None):
"grouper(3, 'ABCDEFG', 'x') --> ABC DEF Gxx"
args = [iter(iterable)] * n
ret... | raise NotImplementedError()
for name, volumeName in grouper(2, drivesDetailedList):
if "Name=" in name and "VolumeName" in volumeName:
name = name[len("Name="):].strip() |
<|file_name|>os_c.py<|end_file_name|><|fim▁begin|>import platform
class OSCollector(object):
def __init__(self, docker_client=None):<|fim▁hole|>
def _zip_fields_values(self, keys, values):
data = {}
for key, value in zip(keys, values):
if len(value) > 0:
data[key] =... | self.docker_client = docker_client
def key_name(self):
return "osInfo" |
<|file_name|>0002_populate_users.py<|end_file_name|><|fim▁begin|># encoding: utf-8
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
for user in orm['auth.user'].objects.all():
notifi... | 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'... |
<|file_name|>test_streams.py<|end_file_name|><|fim▁begin|>"""Tests for streams.py"""
import asyncio
import unittest
from unittest import mock
from aiohttp import streams
from aiohttp import test_utils
class TestStreamReader(unittest.TestCase):
DATA = b'line1\nline2\nline3\n'
def setUp(self):
self.... | with self.assertRaises(asyncio.IncompleteReadError) as cm:
self.loop.run_until_complete(read_task)
self.assertEqual(cm.exception.partial, self.DATA)
self.assertEqual(cm.exception.expected, n) |
<|file_name|>delete-version.rs<|end_file_name|><|fim▁begin|>// Purge all references to a crate's version from the database.
//
// Please be super sure you want to do this before running this.
//
// Usage:
// cargo run --bin delete-version crate-name version-number
#![deny(warnings)]
extern crate cargo_registry;
... | |
<|file_name|>courses.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from optparse import make_option
from django.core.management.base import BaseCommand
from messytables import XLSTableSet, headers_guess, headers_processor, offset_processor
from data.models import Source, Course, MerlotCategory
class Comman... | 'language': 'English',
'license': license,
'content_medium': 'text', |
<|file_name|>api.go<|end_file_name|><|fim▁begin|>// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package mturk
import (
"fmt"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awsutil"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/private/protocol"
... | return []string{
AssignmentStatusSubmitted, |
<|file_name|>0002_auto_20170314_1712.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-03-14 17:12
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('volunteers', '0001_initial'),
... | operations = [
migrations.RenameField(
model_name='volunteer',
old_name='picture', |
<|file_name|>test_parse.py<|end_file_name|><|fim▁begin|>import asterix
import unittest
class AsterixParseTest(unittest.TestCase):
def test_ParseCAT048(self):
sample_filename = asterix.get_sample_file('cat048.raw')
with open(sample_filename, "rb") as f:
data = f.read()
packe... | 'desc': 'Mode-3/A reply in octal representation'}})
self.assertEqual(packet[1]['I295']['MFL'], {'MFL': {'val': 0.0, 'desc': ''}}) |
<|file_name|>SimpleHttpRequest.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2015 LINE Corporation
*
* LINE Corporation licenses this file to you under the Apache License,
* version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at:
... | buf.append("<none>"); |
<|file_name|>debugger_panel.py<|end_file_name|><|fim▁begin|>from __future__ import annotations
from ..typecheck import *
from ..import ui
from ..import dap
from . import css
from .breakpoints_panel import BreakpointsPanel
from .input_list_view import InputListView
if TYPE_CHECKING:
from ..debugger import Debugger
... | else: |
<|file_name|>run_command_document_base.py<|end_file_name|><|fim▁begin|># coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
... | """Describes the properties of a Run Command metadata.
:param schema: The VM run command schema.
:type schema: str |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>//! General purpose combinators
#![allow(unused_imports)]
#[cfg(feature = "alloc")]
use crate::lib::std::boxed::Box;
use crate::error::{ErrorKind, FromExternalError, ParseError};
use crate::internal::*;
use crate::lib::std::borrow::Borrow;
use crate::lib::std::convert... | }
}
|
<|file_name|>test_get_config.py<|end_file_name|><|fim▁begin|>from ipctest import IpcTest
from gi.repository import i3ipc
import pytest
@pytest.mark.skip(reason='TODO')
class TestGetConfig(IpcTest):
def test_get_config(self, i3):
config = i3.get_config()<|fim▁hole|> assert config.config == f.rea... | assert isinstance(config, i3ipc.ConfigReply)
with open('test/i3.config') as f: |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|># Copyright (c) 2015 Scality SA
#
# 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|># Unless required by applicable law or agreed to ... | #
# http://www.apache.org/licenses/LICENSE-2.0
# |
<|file_name|>test_artificial_32_Anscombe_LinearTrend_7_12_0.py<|end_file_name|><|fim▁begin|>import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art<|fim▁hole|>art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "LinearTrend", cycle_length = 7, transform = "Anscombe", s... | |
<|file_name|>data.py<|end_file_name|><|fim▁begin|>import os
import sys
import numpy as np
import matplotlib.image as mpimg
from ..core.data import Data
from ..util import tryremove
URL = 'http://synthia-dataset.cvc.uab.cat/SYNTHIA_SEQS/'
SEQS = [ # SUMMER and WINTER from sequences `1 - 6`
'SYNTHIA-SEQS-01-SUMMER... | |
<|file_name|>User.js<|end_file_name|><|fim▁begin|>const TextBasedChannel = require('./interfaces/TextBasedChannel');
const Constants = require('../util/Constants');
const { Presence } = require('./Presence');
const UserProfile = require('./UserProfile');
const Snowflake = require('../util/Snowflake');
const { Error } =... | * The username of the user
* @type {string} |
<|file_name|>service.go<|end_file_name|><|fim▁begin|>package diagnostic
import (
"bytes"
"errors"
"io"
"os"
"path"
"strings"
"sync"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
)
type nopCloser struct {
f io.Writer
}
func (c *nopCloser) Write(b []byte) (int, error) { return c.f.Write(b) }
func (c *nopClose... | |
<|file_name|>explorerModel.test.ts<|end_file_name|><|fim▁begin|>/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
... | });
test('Validate File Name (For Rename)', function () { |
<|file_name|>torque-compiler.cc<|end_file_name|><|fim▁begin|>// Copyright 2019 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/torque/torque-compiler.h"
#include <fstream>
#include "src/torque/declarable... | result.messages = std::move(TorqueMessages::Get());
return result;
} |
<|file_name|>pluginregistry.cpp<|end_file_name|><|fim▁begin|>/* PostMonster, universal HTTP automation tool
* Copyright (C) 2015 by Paul Artsishevsky <polter.rnd@gmail.com>
*
* This file is part of PostMonster.
*
* PostMonster is free software: you can redistribute it and/or modify
* it under the terms of the GNU... | |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 Colin Sherratt
//
// 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/LICENS... | return Some((window, events)); |
<|file_name|>test.js<|end_file_name|><|fim▁begin|>const vboxm = require('./vboxm.js');
//vboxm.clone('8a07a800-4bef-4cc7-9581-6d03a2fab45f', 'vboxm.cloneテスト');
// vboxm.delete('db7cd51b-ac5b-4915-859e-20b88bcf68c2');
<|fim▁hole|>console.log(regResult);<|fim▁end|> |
let name = 'aiueo,kakikukeko???kdfajlsd';
let regResult = name.match(/^[a-zA-Z0-9!\(\)-=^~\\|@`\[{;+:*\]},<.>/?\_ ]+$/); |
<|file_name|>lexer.rs<|end_file_name|><|fim▁begin|>// Copyright (c) The Diem Core Contributors
// SPDX-License-Identifier: Apache-2.0
use crate::{errors::*, parser::syntax::make_loc, FileCommentMap, MatchedFileCommentMap};
use codespan::{ByteIndex, Span};
use move_ir_types::location::Loc;
use std::{collections::BTreeM... | |
<|file_name|>output_dependencies.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
import csv, sys, os.path
def error(message):
sys.stderr.write(message + '\n')
sys.exit(1)
def cygpath_from_winpath(winabspath):
return("/cygdrive/"+winabspath[0].lower()+winabspath[2:].replace('\\','/'))
def main(argv):
if... | |
<|file_name|>conf.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# partpy documentation build configuration file, created by
# sphinx-quickstart on Sat Feb 16 18:56:06 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values ... | |
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import logging
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext as... | if 'vkontakte_board' not in settings.INSTALLED_APPS:
raise ImproperlyConfigured("Application 'vkontakte_board' not in INSTALLED_APPS")
from vkontakte_board.models import Comment |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>module.exports = function(dataUri, maxDimension, callback){
var source = new Image();
source.addEventListener('load', function(){
var canvas = document.createElement('canvas'),
ratio = Math.max(source.width, source.height) / maxDimension;
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.