prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>issue-3424.rs<|end_file_name|><|fim▁begin|>// xfail-fast
// 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.... | |
<|file_name|>ir.rs<|end_file_name|><|fim▁begin|>/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
use common::{Location, Named, WithLocation};
use graphql_syntax::{FloatValue, Opera... | } else { |
<|file_name|>stack.py<|end_file_name|><|fim▁begin|>from yowsup.stacks import YowStack
from .layer import EchoLayer
from yowsup.layers import YowLayerEvent
from yowsup.layers.auth import YowCryptLayer, YowAuthenticationProtocolLayer, AuthError
from yowsup.layers.coder import ... | def __init__(self, credentials, encryptionEnabled = False): |
<|file_name|>selectplace.py<|end_file_name|><|fim▁begin|>#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2003-2006 Donald N. Allingham
# Copyright (C) 2009-2010 Gary Burton
# Copyright (C) 2010 Nick Hall
#
# This program is free software; you can redistribute it and/or modify
# it under the ... | #------------------------------------------------------------------------- |
<|file_name|>test_tokenize.py<|end_file_name|><|fim▁begin|>import unittest
from broca.tokenize import keyword, util, LemmaTokenizer
class KeywordTokenizeTests(unittest.TestCase):
def setUp(self):
self.docs = [
'This cat dog is running happy.',
'This cat dog runs sad.'
]
... | ['cat', 'cat dog', 'happy', 'dog', 'dog'],
['cat', 'cat dog', 'sad']
] |
<|file_name|>04da9abf37e2_add_post_media.py<|end_file_name|><|fim▁begin|>"""add post media
Revision ID: 04da9abf37e2
Revises: 2e3a2882e5a4
Create Date: 2017-08-08 15:15:50.911420
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '04da9abf37e2'
down_revision = '2e... | |
<|file_name|>login.component.ts<|end_file_name|><|fim▁begin|>import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { UserService, LoginCallback, LoggedInCallback } from '../services/user.service';
@Component({
selector: 'login',
styleUrls: ['./login.component.css'],
... | |
<|file_name|>selectors.ts<|end_file_name|><|fim▁begin|>import { formValueSelector, getFormValues } from 'redux-form';
import { createSelector } from 'reselect';
import { BookingProps } from '@waldur/booking/types';
import { getOfferingComponentsFilter } from '@waldur/marketplace/common/registry';
import { OfferingComp... | }
const offering = offeringState.offering;
if ( |
<|file_name|>query04.rs<|end_file_name|><|fim▁begin|>use timely::order::TotalOrder;
use timely::dataflow::*;
use timely::dataflow::operators::probe::Handle as ProbeHandle;
use differential_dataflow::operators::*;
use differential_dataflow::lattice::Lattice;
use {Arrangements, Experiment, Collections};
// -- $ID$
// ... | } |
<|file_name|>gallery.routing.ts<|end_file_name|><|fim▁begin|>import {Routes} from '@angular/router';
import {GalleryCatsListComponent} from './list/galleryCatList.component';
import {SettingsResolver} from '../../core/SettingsResolver';<|fim▁hole|>import {GalleryCatFormComponent} from './form/galleryCatForm.component';... | |
<|file_name|>synch.py<|end_file_name|><|fim▁begin|>"""
mbed SDK
Copyright (c) 2011-2013 ARM Limited
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... | # The maintainer has to evaluate the changes first and explicitly accept them
self.run_and_print(['hg', 'addremove'], cwd=self.path) |
<|file_name|>test_api_check.py<|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.
#---------... | def test_resolve_api_provider_with_parent_backup(self):
""" Verifies provider (with parent) is used as backup if api-version not specified. """ |
<|file_name|>old-suffixes-are-really-forbidden.rs<|end_file_name|><|fim▁begin|>// Copyright 2015 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<|fim▁h... | // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <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. |
<|file_name|>layer_test.py<|end_file_name|><|fim▁begin|>import unittest
from .layer import *
class L(Layer):
L1 = LayerSpec("l1", "layer-1")
L2 = LayerSpec("l2", "layer-2", [L1])
class TestLayer(unittest.TestCase):
def testFromId(self):
self.assertEqual(L.FromId(L.L1.id_), L.L1)
self.assertEqual(L.Fr... | self.assertEqual(set(L.AllLayers()), set((L.L2, L.L1)))
|
<|file_name|>070_review_request_removed.ts<|end_file_name|><|fim▁begin|><|fim▁hole|> return Promise.resolve()
.then(() => sendGitHubRequest(requestReviewRequestRemoved, header))
.then(resp => resp.msg === 'ok' ? Promise.resolve() : Promise.reject(resp))
.catch(err => Promise.reject(err));
}<|fim▁end|> | import { requestReviewRequestRemoved, header } from '../../../webhooks/github/PullRequestEvent';
import { sendGitHubRequest } from '../../../utils/utils';
export default function() { |
<|file_name|>utfgrid_encode.cpp<|end_file_name|><|fim▁begin|>#include "utfgrid_encode.h"
#include <unordered_map>
#include <glog/logging.h>
#include <jsoncpp/json/value.h>
#include <mapnik/unicode.hpp>
struct value_to_json_visitor {
Json::Value operator() (const mapnik::value_null& val) {return Json::Value();}
... | jkeys = Json::Value(Json::arrayValue);
for (const auto& key_id : key_order) {
jkeys.append(key_id); |
<|file_name|>interactions.go<|end_file_name|><|fim▁begin|>package customerinsights
// 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 the... | // the interaction. localeCode is locale of interaction to retrieve, default is en-us.
func (client InteractionsClient) Get(ctx context.Context, resourceGroupName string, hubName string, interactionName string, localeCode string) (result InteractionResourceFormat, err error) {
req, err := client.GetPreparer(ctx, resou... |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>/* Copyright (C) 2017-2021 Open Information Security Foundation
*
* You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free
* Software Foundation.
*
* This program is distributed in th... | #![allow(clippy::len_zero)] |
<|file_name|>biopet.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Wrapper script for starting the Biopet JAR package
#
# This script is written for use with the Conda package manager and is copied
# from the peptide-shaker wrapper. Only the parameters are changed.
# (https://github.com/bioconda/bioconda-rec... | mem_opts = [] |
<|file_name|>extraction4.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
import xml.etree.ElementTree as etree
import re
import datetime
#set the output file name for the 'good' data
#needs to be to a structured format - but dump to text for now
#clean_output = 'clean_out.csv'
clean_output = 'clean.txt'
#set... | |
<|file_name|>audio.rs<|end_file_name|><|fim▁begin|>//! Audio Functions
//!
//! # Example
//! ```no_run
//! use sdl2::audio::{AudioCallback, AudioSpecDesired};
//! use std::time::Duration;
//!
//! struct SquareWave {
//! phase_inc: f32,
//! phase: f32,
//! volume: f32
//! }
//!
//! impl AudioCallback for Squ... |
fn from_u64(n: u64) -> Option<AudioStatus> { FromPrimitive::from_i64(n as i64) }
} |
<|file_name|>LxControlTrackerTest.java<|end_file_name|><|fim▁begin|>/**
* Copyright (c) 2010-2021 Contributors to the openHAB project<|fim▁hole|> * information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.... | *
* See the NOTICE file(s) distributed with this work for additional |
<|file_name|>common_usage_steps_fd.hpp<|end_file_name|><|fim▁begin|>namespace boost { namespace logging {
/**
@page common_usage_steps_fd Common steps when using Formatters and destinations
\n<|fim▁hole|>
First, the examples: @ref scenarios_code_mom "example 1", @ref scenarios_code_noo "example 2"
- Step 1: (opti... | <b>The easy way, use Named Formatters and Destinations</b>
You use a string to specify Formatters, and a string to specify Destinations. Thus, you use the @ref boost::logging::writer::named_write "writer::named_write". |
<|file_name|>conf.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# GObject-Introspection documentation build configuration file, created by
# sphinx-quickstart on Tue Apr 16 15:34:52 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible config... | # non-false value, then it is used:
#today = ''
# Else, today_fmt is used as the format for a strftime call.
#today_fmt = '%B %d, %Y' |
<|file_name|>environment.ts<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright 2020 Google LLC. 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... | type: 'image classification', |
<|file_name|>yahooWeatherForecast.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
def makeYqlQuery(req):
<|fim▁hole|> parameters = result.get("parameters")
city = parameters.get("geo-city")
if city is None:
return None
return "select * from weather.forecast where woeid in (select woei... | result = req.get("result")
|
<|file_name|>index.js<|end_file_name|><|fim▁begin|><|fim▁hole|>module.exports = require('./lib/goldwasher-aws-lambda.js');<|fim▁end|> | |
<|file_name|>index.tsx<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2021 Charles University, Faculty of Arts,
* Institute of the Czech National Corpus
* Copyright (c) 2021 Tomas Machalek <tomas.machalek@gmail.com>
* Copyright (c) 2021 Martin Zimandl <martin.zimandl@gmail.com>
*
* This progra... | <saveViews.SavePqueryForm onClose={_handleSaveFormClose} /> :
null
} |
<|file_name|>idl_diff.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Copyright (c) 2012 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.
from __future__ import print_function
import glob
import os
import subproces... | #
# IsInclude |
<|file_name|>fpeditor.py<|end_file_name|><|fim▁begin|># vim: set fileencoding=utf-8 :
# GNU Solfege - free ear training software
# Copyright (C) 2009, 2011 Tom Cato Amundsen
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
#... | for button, types in self.m_paste_buttons: |
<|file_name|>QualysAPI.py<|end_file_name|><|fim▁begin|>import requests
import xml.etree.ElementTree as ET
from time import sleep
class QualysAPI:
"""Class to simplify the making and handling of API calls to the Qualys platform
Class Members
=============
server : String : The FQDN of the AP... | waittime = 30
else:
print("QualysAPI.makeCall: Waiting 15 seconds") |
<|file_name|>db.py<|end_file_name|><|fim▁begin|>__author__ = 'fatihka'
from sqlalchemy import Column, Integer, String, Unicode, Float, Boolean, create_engine, Table
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
# db_name = 'ww.db'
db_name = ':memory:'
tanimlar = {'com... | lead_code = Column(String, nullable=True)
account = Column(String, nullable=True)
account_name = Column(String, nullable=True)
|
<|file_name|>SBTCVM-asm2.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import VMSYSTEM.libSBTCVM as libSBTCVM
import VMSYSTEM.libbaltcalc as libbaltcalc
import sys
import os
assmoverrun=19683
instcnt=0
txtblk=0
VMSYSROMS=os.path.join("VMSYSTEM", "ROMS")
critcomperr=0
compvers="v2.2.0"
outfile="assmout.trom"... | # instdat=("000" + instdat)
if instword=="textstop":
txtblk=0
complog("TEXTBLOCK END\n") |
<|file_name|>gtk_wrapper.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on Thu Mar 24 16:25:41 2016
@author: pavel
"""
from gi.repository import Gtk
import parameter_types as ptypes
from logger import Logger
logger = Logger.get_logger()
#
import gobject
gobject.threads_i... | |
<|file_name|>test_blas.rs<|end_file_name|><|fim▁begin|>/// OpenBLAS testing
#[macro_use]
extern crate rustsci;
use rustsci::array;
use rustsci::matrix;
use rustsci::openblas;
////////////////////////
// BLAS Level 1 Tests //
////////////////////////
#[test]
fn test_openblas_ddot()
{
let a1 = arr![1f64, 2f64, 3f6... | [123f32, -26f32, -162f32],
[-90f32, -64f32, -60f32]]; |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>import {grpc, Code, Metadata} from "grpc-web-client";
import {DummyService} from "../_proto/dummy/dummy_service_pb_service";
import {CreateGameRequest, CreateGameResponse} from "../_proto/dummy/dummy_service_pb";
<|fim▁hole|>
function createGame() {
const createGameR... | declare const USE_TLS: boolean;
const host = USE_TLS ? "https://web.ae.28k.ch:9091" : "http://web.ae.28k.ch:9090"; |
<|file_name|>provisioner.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright (c) 2017 Intel Corp.
#
"""
Interface for all resource control plugins.
"""
from abc import ABCMeta, abstractmethod
from ..plugin import DeclareFramework
@DeclareFramework('provisioner')
class Provisioner(object, metaclass=A... | |
<|file_name|>switch.py<|end_file_name|><|fim▁begin|>"""
Switches on Zigbee Home Automation networks.
For more details on this platform, please refer to the documentation
at https://home-assistant.io/components/switch.zha/
"""
import logging<|fim▁hole|>from homeassistant.helpers.dispatcher import async_dispatcher_conne... |
from homeassistant.components.switch import DOMAIN, SwitchDevice
from homeassistant.const import STATE_ON
from homeassistant.core import callback |
<|file_name|>missing.py<|end_file_name|><|fim▁begin|>class MethodMissing(object):
def __getattr__(self, name):
try:
return self.__getattribute__(name)
except AttributeError:
def method(*args, **kw):
return self.method_missing(name, *args, **kw)
ret... | raise AttributeError("%r object has no attribute %r" %
(self.__class__, name)) |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from . import advancetools<|fim▁hole|>from flask import render_template,redirect,Response,url_for
@advancetools.route('/')
def index():
return redirect(url_for('auto_decode_base'))
@advancetools.route('/auto_decode_base')
def auto_decode_base():
return render... | |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>mod system;
mod math;
mod renderer;
mod canvas;
use renderer::context::*;
use renderer::mesh;
use renderer::shader::{Program, Shader, ShaderType};
use renderer::texture;
use math::mat4::*;
use math::transform;
use math::vec3::*;
use canvas::Canvas;
extern crate rand;
... | |
<|file_name|>try-macro.rs<|end_file_name|><|fim▁begin|>// Test that `try!` macros are rewritten.
// run-rustfix
// compile-pass<|fim▁hole|>#![allow(unused_variables)]
#![allow(dead_code)]
fn foo() -> Result<usize, ()> {
let x: Result<usize, ()> = Ok(22);
try!(x);
Ok(44)
}
fn main() { }<|fim▁end|> |
#![warn(rust_2018_compatibility)] |
<|file_name|>echem_paperplots.py<|end_file_name|><|fim▁begin|>import time, copy
import os, os.path
import sys
import numpy
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from scipy import optimize
from echem_plate_ui import *
from echem_plate_math import *
import pickle
p1='C:/Users/Gregoire/Documents/CaltechWor... | cai0, cai1=(0, 6500) |
<|file_name|>convertito_2012_test.py<|end_file_name|><|fim▁begin|># The Hazard Library
# Copyright (C) 2014, GEM Foundation
#
# This program 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 versio... | ConvertitoEtAl2012Geysers
) |
<|file_name|>CombDiacritMarks.js<|end_file_name|><|fim▁begin|>version https://git-lfs.github.com/spec/v1
oid sha256:7191d4054034f882d0333e067f484abf20e9d176d5c0297c8824f5e0cafc8e12<|fim▁hole|><|fim▁end|> | size 2389 |
<|file_name|>app.js<|end_file_name|><|fim▁begin|>'use strict';
var msb = require('msb');
var app = exports;
app.config = require('./lib/config');
app.start = function(cb) {
if (app.config.channelMonitorEnabled) msb.channelMonitorAgent.start();
var RouterWrapper = require('./lib/routerWrapper').RouterWrapper;
a... | |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from distutils.core import setup
<|fim▁hole|> name = "nip",
version = "0.1a1",
py_modules = [
"nip",
],
scripts = [
"bin/nip",
],
author = "Brian Rosner",
author_email = "brosner@gmail.com",
description = "nip is envi... | setup( |
<|file_name|>global_settings.py<|end_file_name|><|fim▁begin|>"""
Global settings file.
Everything in here is imported *before* everything in settings.py.
This means that this file is used for default, fixed and global varibles, and
then settings.py is used to overwrite anything here as well as adding settings
... | 'pagination',
'compressor',
] + SCRAPERWIKI_APPS
|
<|file_name|>admin.py<|end_file_name|><|fim▁begin|># (c) Copyright 2017-2019 SUSE 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... | .. sourcecode:: http |
<|file_name|>storm_cluster_test.py<|end_file_name|><|fim▁begin|>import os
import pytest
from pyleus.cli.storm_cluster import _get_storm_cmd_env<|fim▁hole|>from pyleus.cli.storm_cluster import STORM_JAR_JVM_OPTS
from pyleus.cli.storm_cluster import StormCluster
from pyleus.cli.storm_cluster import TOPOLOGY_BUILDER_CLA... | |
<|file_name|>bug2175.js<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2012-2014 André Bargull
* Alle Rechte vorbehalten / All Rights Reserved. Use is subject to license terms.
*
* <https://github.com/anba/es6draft>
*/
<|fim▁hole|>const {
assertSame
} = Assert;
// 22.2.1.2 %TypedArray%: Different [[Prototype... | |
<|file_name|>SchemaUpdater.java<|end_file_name|><|fim▁begin|>package com.bagri.server.hazelcast.task.schema;
import static com.bagri.core.Constants.pn_schema_password;
import static com.bagri.server.hazelcast.serialize.TaskSerializationFactory.cli_UpdateSchemaTask;
import static com.bagri.support.security.Encrypto... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
pygments.filters
~~~~~~~~~~~~~~~~
Module containing filter lookup functions and default
filters.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
imp... | |
<|file_name|>tail_boom_flex.py<|end_file_name|><|fim▁begin|>" tail boom flexibility "
from numpy import pi
from gpkit import Model, parse_variables, SignomialsEnabled
class TailBoomFlexibility(Model):
""" Tail Boom Flexibility Model
Variables
---------
Fne [-] tail boom flexibility... | sph1 [-] flexibility helper variable 1
sph2 [-] flexibility helper variable 2
LaTex Strings |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>extern crate num;
use num::{BigInt, Signed};
// Dumbest iterative approach
fn big_pow(base: &BigInt, exp: BigInt) -> BigInt {
if exp.is_negative() {
panic!("Negative exponent won't compute!")
}
let mut tmp = base.clone();
for _ in num::range(Bi... | |
<|file_name|>api.py<|end_file_name|><|fim▁begin|>import mock
from django_images.models import Thumbnail
from taggit.models import Tag
from tastypie.exceptions import Unauthorized
from tastypie.test import ResourceTestCase
from .helpers import ImageFactory, PinFactory, UserFactory<|fim▁hole|>
__all__ = ['ImageResourc... | from ..models import Pin, Image
from ...users.models import User |
<|file_name|>CtSaving_ZBuffer.cpp<|end_file_name|><|fim▁begin|>//###########################################################################
// This file is part of LImA, a Library for Image Acquisition
//
// Copyright (C) : 2009-2017
// European Synchrotron Radiation Facility
// CS40220 38043 Grenoble Cedex 9
// FRAN... | //###########################################################################
#include "lima/CtSaving_ZBuffer.h" |
<|file_name|>ArrangeSwapCommand.js<|end_file_name|><|fim▁begin|>ArrangeSwapCommand = new Class({
Implements: ICommand,
beginDepths: [],
initialize: function(){},
// Move the target to the new depth.
execute: function() {
this.canvas.swapChildren(this.beginDepths[0], this.beginDepths[1]);
},
// Pl... | |
<|file_name|>Route.tsx<|end_file_name|><|fim▁begin|>/**
* Taken from @taion as per example of how they actually use found-relay and
* have default setup for each route.
*/
import { RouteSpinner } from "Artsy/Relay/renderWithLoadProgress"
import { HttpError } from "found"
import BaseRoute from "found/Route"
import R... | function createRender({
fetchIndicator = "overlay",
render, |
<|file_name|>google.py<|end_file_name|><|fim▁begin|># coding: utf-8
# pylint: disable=missing-docstring, invalid-name
from __future__ import absolute_import
from google.appengine.api import users
import flask
import auth
import model
import util
from main import app
<|fim▁hole|> google_url = users.create_login_u... |
@app.route('/signin/google/')
def signin_google():
auth.save_request_params() |
<|file_name|>index.spec.ts<|end_file_name|><|fim▁begin|>import { Subject } from "rxjs";
import { take, toArray } from "rxjs/operators";
import { v4 as uuid } from "uuid";
import {
createMainChannelFromSockets,
createSocket,
getUsername,
JupyterConnectionInfo,
verifiedConnect,
ZMQType
} from "../src";
impo... | msg_type: "random" as MessageType,
date: new Date().toISOString(),
msg_id: "XYZ",
|
<|file_name|>pdu.py<|end_file_name|><|fim▁begin|>"""DICOM Upper Layer Protocol Data Units (PDUs).
There are seven different PDUs:
- A_ASSOCIATE_RQ
- A_ASSOCIATE_AC
- A_ASSOCIATE_RJ
- P_DATA_TF
- A_RELEASE_RQ
- A_RELEASE_RP
- A_ABORT_RQ
::
from_primitive encode
+----------------+ -... | The Application Context Item's *Application Context Name* field value
(if available).
called_ae_title : bytes |
<|file_name|>securitycontextconstraints.go<|end_file_name|><|fim▁begin|>// Code generated by informer-gen. DO NOT EDIT.
package v1
import (
"context"
time "time"
securityv1 "github.com/openshift/api/security/v1"
versioned "github.com/openshift/client-go/security/clientset/versioned"
internalinterfaces "github.c... | return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil { |
<|file_name|>ampi_base.cpp<|end_file_name|><|fim▁begin|>#include "ampi_base.h"
#include <sstream>
#include <ostream>
#include "ampi.h"
#include "mpi.h"
/**
* @brief AMPI_base::AMPI_base Initilize the class
*/
AMPI_base::AMPI_base(){
rParam=false;
valid=true;
}
/**
* @brief AMPI_base::AMPI_typeName This fun... | * this function and MPI_Recv to recive the data more efficently
* @param source The source of the data |
<|file_name|>ImmutabilityTest.java<|end_file_name|><|fim▁begin|>/*
* ome.server.itests.ImmutabilityTest
*
* Copyright 2006 University of Dundee. All rights reserved.
* Use is subject to license terms supplied in LICENSE.txt
*/
package ome.server.itests;
// Java imports
// Third-party libraries
import org.tes... | new Filter().page(0, 1)).addId(oldEvent.getId())); |
<|file_name|>collection.js<|end_file_name|><|fim▁begin|>'use strict';
const Assert = require('chai').assert;
const request = require('../support/request');
const { Before, Given, Then, When, After } = require('cucumber');
// Timeout of 15 seconds
const TIMEOUT = 15 * 1000;
/**
* Helper function to create a collecti... | |
<|file_name|>ng_switch.d.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 { TemplateRef, ViewContainerRef } from '@angular/core... | * place a `[ngSwitchCase]` attribute per element. |
<|file_name|>startup.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
"""
product initialization stuff
"""
import os
import featuremonkey
from .composer import get_composer
from django_productline import compare_version
_product_selected = False
def select_product():
"""
binds the fr... |
featuremonkey.add_import_guard('django.conf')
featuremonkey.add_import_guard('django.db') |
<|file_name|>notification-center.ts<|end_file_name|><|fim▁begin|>import {CORE_DIRECTIVES} from 'angular2/common';
import {Component} from 'angular2/core';
import {OnInit} from 'angular2/core';
import {NotificationService} from '../../service/notification-service';
import {Alert} from 'ng2-bootstrap/ng2-bootstrap';
@... | |
<|file_name|>issue526.rs<|end_file_name|><|fim▁begin|>fn main() {<|fim▁hole|> foo::<i32> ();
foo.foo::<i32> ();
}<|fim▁end|> | |
<|file_name|>GroupQueryTreeRequest.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*-
from supriya.tools import osctools
from supriya.tools.requesttools.Request import Request
class GroupQueryTreeRequest(Request):
r'''A /g_queryTree request.
::
>>> from supriya.tools import requesttools
... | @property
def node_id(self):
return self._node_id |
<|file_name|>debugger.py<|end_file_name|><|fim▁begin|>"""Module to debug python programs"""
import sys
import traceback
def getAllStacks():
code = []
for threadId, stack in sys._current_frames().iteritems():
code.append("\n# ThreadID: %s" % threadId)
for filename, lineno, name, line in traceba... | if line:
code.append(" %s" % (line.strip()))
return code
|
<|file_name|>MeshAlgoTest.py<|end_file_name|><|fim▁begin|>##########################################################################
#
# Copyright (c) 2017, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that... | def testMeshUniformToFaceVarying( self ) :
p = self.mesh["c"]
MeshAlgo.resamplePrimitiveVariable( self.mesh, p, PrimitiveVariable.Interpolation.FaceVarying ) |
<|file_name|>ns3server.py<|end_file_name|><|fim▁begin|>#
# NEPI, a framework to manage network experiments
# Copyright (C) 2014 INRIA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundat... | import cPickle
import errno
import logging
import os |
<|file_name|>Category.js<|end_file_name|><|fim▁begin|>import * as API from '../utils/Api'
export const SET_CATEGORIES = "SET_CATEGORIES"
export function setCategories(categories) {
return {
type: SET_CATEGORIES,
categories
}<|fim▁hole|> dispatch(setCategories(data.categories))
})
);... | }
export const fetchGetCategories = () => dispatch => (
API.getCategories().then(data => { |
<|file_name|>qgshttptransaction.cpp<|end_file_name|><|fim▁begin|>/***************************************************************************
qgshttptransaction.cpp - Tracks a HTTP request with its response,
with particular attention to tracking
HTTP redirec... | // TODO detect any redirection loops
if ( !httpredirecturl.isEmpty() )
{ |
<|file_name|>main.go<|end_file_name|><|fim▁begin|>/*
Package memory is a storage manager that just keeps the games and storage in
memory, which means that when the program exits the storage evaporates.
Useful in cases where you don't want a persistent store (e.g. testing or
fast iteration). Implements both boardgame.S... | }
return record, nil |
<|file_name|>RoundJTextField.java<|end_file_name|><|fim▁begin|>package view.rendes;
import java.awt.Graphics;
import java.awt.Shape;
import java.awt.geom.RoundRectangle2D;
<|fim▁hole|>public class RoundJTextField extends JTextField {
private Shape shape;
public RoundJTextField(int size) {
supe... | import javax.swing.JTextField;
|
<|file_name|>integ_test.go<|end_file_name|><|fim▁begin|>// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
//go:build go1.16 && integration
// +build go1.16,integration
package codebuild_test
import (
"context"
"testing"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/aw... | |
<|file_name|>image_utils.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
#
# http://www.apache.o... | |
<|file_name|>rest.go<|end_file_name|><|fim▁begin|>/*
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
http://www.apache.org/licenses/LICENSE-2.0
... | |
<|file_name|>git.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# ... | required: false
default: None |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from django.urls import path, include
from .routers import router
from . import views
app_name = "milage"
urlpatterns = [
path("api/", include(router.urls), name="api_router"),
path("class-based/", views.ClassBasedView.as_view(), name="class_based_... | |
<|file_name|>emission.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Python module for generating fake total emission in a magnitude band along a sightline.
This uses the Arepo/Illustris output GFM_Photometrics to get photometric band data,
which may or may not be accurate.
"""
from __future__ import pri... | ind = self.particles_near_lines(pos, hh,self.axis,self.cofm)
#print np.size(ind)
#Do nothing if there aren't any, and return a suitably shaped zero array
if np.size(ind) == 0: |
<|file_name|>test_sample.py<|end_file_name|><|fim▁begin|><|fim▁hole|>raise Exception("tests where moved to emzed to avoid circular dependencies")<|fim▁end|> | |
<|file_name|>portfolioDirective.js<|end_file_name|><|fim▁begin|>app.directive("portfolio", function(socket, upload, ms, filterFilter) {
return {
restrict: 'E',
templateUrl: '/directives/templates/portfolioDirective.html',
scope: false,
link: function(scope, elements, attrs) {
scope.uploads = [];... | }); |
<|file_name|>test_recursive.py<|end_file_name|><|fim▁begin|>import py
from rpython.rlib.jit import JitDriver, hint, set_param
from rpython.rlib.jit import unroll_safe, dont_look_inside, promote
from rpython.rlib.objectmodel import we_are_translated
from rpython.rlib.debug import fatalerror
from rpython.jit.metainterp.t... | |
<|file_name|>Main.java<|end_file_name|><|fim▁begin|>package com.covoex.qarvox;<|fim▁hole|>
import com.covoex.qarvox.Application.BasicFunction;
/**
* @author Myeongjun Kim
*/
public class Main {
public static void main(String[] args) {
BasicFunction.programStart();
}
}<|fim▁end|> | |
<|file_name|>test_domain.py<|end_file_name|><|fim▁begin|>__author__ = 'frank'
# Setup our test environment
import os
os.environ['NETKI_ENV'] = 'test'
from unittest import TestCase
from netki.api.domain import *
from mock import patch, Mock
class TestWalletLookup(TestCase):
# This is the open wallet name looku... | self.mockWalletNameResolver.return_value.resolve_wallet_name.return_value = '1djskfaklasdjflkasdf'
api_wallet_lookup('wallet.frankcontreras.me', 'btc') |
<|file_name|>HttpPatch.java<|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://www.apache.org/... | public HttpPatch() {
super();
} |
<|file_name|>build.rs<|end_file_name|><|fim▁begin|>#[cfg(not(feature = "unstable"))]
mod inner {
extern crate syntex;
extern crate diesel_codegen;
extern crate dotenv_codegen;
use std::env;
use std::path::Path;
pub fn main() {
let out_dir = env::var_os("OUT_DIR").unwrap();
let ... | use diesel::*;
use dotenv::dotenv;
fn main() { |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>//! Tools for wrapping devices.
mod buffered;
mod buffered_output;<|fim▁hole|>#[doc(inline)]
pub use self::buffered_output::BufferedOutput;
#[doc(inline)]
pub use self::messaged::Messaged;<|fim▁end|> | mod messaged;
#[doc(inline)]
pub use self::buffered::Buffered; |
<|file_name|>ConnectivityService.java<|end_file_name|><|fim▁begin|>package main.habitivity.services;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
/**... | .getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo networkInfo = connectivityManager.getActiveNetworkInfo();
|
<|file_name|>list_assets.go<|end_file_name|><|fim▁begin|>package endpoint
import (<|fim▁hole|> "fmt"
"net/http"
"github.com/spolu/settle/lib/db"
"github.com/spolu/settle/lib/errors"
"github.com/spolu/settle/lib/format"
"github.com/spolu/settle/lib/ptr"
"github.com/spolu/settle/lib/svc"
"github.com/spolu/settle... | "context" |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models
from django.conf import settings
from django.contrib.auth.models import User, Group
from .endpoint import Endpoint
DEFAULT_STORE_SLUG = getattr(settings, 'DEFAULT_STORE_SLUG', 'public')
class Store(models.Model):
slug = models.SlugF... | |
<|file_name|>update-credential.7.x.py<|end_file_name|><|fim▁begin|># NOTE: This example uses the next generation Twilio helper library - for more
# information on how to download and install this version, visit
# https://www.twilio.com/docs/libraries/python<|fim▁hole|># Your Account Sid and Auth Token from twilio.com/u... | import os
from twilio.rest import Client
|
<|file_name|>receipt_print.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2012 Silvina Faner (<http://tiny.be>).
#
# This program is free software: you can redist... | 'trunk/receipt_pay/report/receipt_pay_print.rml',
parser=report_receipt_print,header="external"
) |
<|file_name|>outline.py<|end_file_name|><|fim▁begin|>import phidl.geometry as pg
import gdsfactory as gf
from gdsfactory.component import Component
@gf.cell
def outline(elements, **kwargs) -> Component:
"""
Returns Component containing the outlined polygon(s).
wraps phidl.geometry.outline
Creates a... | |
<|file_name|>wrapper.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/. */
#![allow(unsafe_code)]
//! Wrapper definitions on top of Gec... | // <th> elements get a default MozCenterOrInherit which may get overridden |
<|file_name|>foreman.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
#
# Copyright (C) 2016 Guido Günther <agx@sigxcpu.org>,
# Daniel Lobato Garcia <dlobatog@redhat.com>
#
# This script is free software: you can redistribute it and/or modify
# it under the terms ... | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.