prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>minus.js<|end_file_name|><|fim▁begin|>"use strict";
Object.defineProperty(exports, "__esModule", {<|fim▁hole|> value: true
});
var minus = exports.minus = { "viewBox": "0 0 20 20", "children": [{ "name": "path", "attribs": { "d": "M16,10c0,0.553-0.048,1-0.601,1H4.601C4.049,11,4,10.553,4,10c0-0.553,0.049-... | |
<|file_name|>regex_matcherator_naturectr.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
patterns = [r'^.*?/bc_jpg_makerDrop/(crop_fullsize_pad_center)/?.*?/(\d{9}(.*?))\.(.*?)$',<|fim▁hole|>
strings = ["/mnt/Post_Complete/Complete_to_Load/nature_center/bc_jpg_makerDrop/crop_fullsize_pad_a... | r'^.*?/bc_jpg_makerDrop/(crop_fullsize_pad_anchor)/?.*?/(\d{9}(.*?))\.(.*?)$',
r'^.*?/bfly_jpg_makerDrop/(crop_fullsize_center)/?.*?/(\d{9}(.*?))\.(.*?)$',
r'^.*?/bfly_jpg_makerDrop/(crop_fullsize_anchor)/?.*?/(\d{9}(.*?))\.(.*?)$']*10 |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>pub struct WordProblem {
text: String,
}
impl WordProblem {
pub fn new(command: &str) -> Self {
WordProblem {
text: command.to_string(),
}
}
pub fn answer(&self) -> Result<i32,()> {
if !self.text.starts_with("What") {... | Ok(sum)
} |
<|file_name|>RandomGroupIdAdapter.java<|end_file_name|><|fim▁begin|>/*******************************************************************************
* Copyright 2012 Sevket Seref Arikan, David Ingram
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in complianc... | protected Object getValue() throws Exception {
ELContext elContext = FacesContext.getCurrentInstance().getELContext();
ConnectorBean connector = (ConnectorBean) FacesContext.getCurrentInstance().getApplication().getELResolver().getValue(elContext, null, "connectorBean");
return connector.getGroupGUID(targe... |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>/**
* React Static Boilerplate
* https://github.com/koistya/react-static-boilerplate
* Copyright (c) Konstantin Tarkus (@koistya) | MIT license
*/
import './index.scss'
import React, { Component } from 'react'
// import { Grid, Col, Row } from 'react-bootstrap';
... | >
here on GitHub
</a>
. |
<|file_name|>TeamDao.java<|end_file_name|><|fim▁begin|>/**********************************************************************
Copyright (c) 2009 Stefan Seelmann. 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... | }
|
<|file_name|>basic-information.js<|end_file_name|><|fim▁begin|>var xue =xue || {};
xue.formCheck = xue.formCheck || {};
var fCheck = xue.formCheck;
/* 提示信息的css样式 */
fCheck.setTips = function(select, tips){
$(select).css({
'display': 'block',
}).html(tips);
};
/* 输入正确时,清除提醒 */
fCheck.clearTips = function(s... | |
<|file_name|>main.py<|end_file_name|><|fim▁begin|>import os
import sys
# Import the Flask Framework
from flask import Flask, request, render_template
isDev = os.environ["SERVER_SOFTWARE"].find('Development') == 0
app = Flask( __name__ )
# Note: We don't need to call run() since our application is embedded within
# ... | |
<|file_name|>hostenv_spidermonkey.js<|end_file_name|><|fim▁begin|>version https://git-lfs.github.com/spec/v1
oid sha256:42fcecf8fdabe110af986ac81bb56b598f5a3fa59c6d0c4cc8b80daa2dca0473<|fim▁hole|><|fim▁end|> | size 1121 |
<|file_name|>test.py<|end_file_name|><|fim▁begin|>###
# Copyright (c) 2002-2005, Jeremiah Fincher
# Copyright (c) 2009, James McCoy
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistri... | self.irc.feedMsg(ircmsgs.op(self.channel, self.irc.nick)) |
<|file_name|>htmltablerowelement.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::codegen::HTMLTableRowElementBi... | |
<|file_name|>impl_method_type_after.rs<|end_file_name|><|fim▁begin|>pub struct FooBar;
<|fim▁hole|>trait T {
fn foo(self, f: &mut FooBar);
}
impl T for S {
fn foo(self, f: FooBar)
}<|fim▁end|> | struct S;
|
<|file_name|>test_nutnr_m_glider.py<|end_file_name|><|fim▁begin|>"""
@package mi.dataset.parser.test
@file mi/dataset/parser/test/test_nutnr_m_glider.py
@author Emily Hahn
@brief A test parser for the nutnr series m instrument through a glider
"""
import os
from nose.plugins.attrib import attr
from mi.core.exceptions ... |
parser.get_records(1) |
<|file_name|>settings.component.ts<|end_file_name|><|fim▁begin|>import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-settings',
templateUrl: './settings.component.html',
styleUrls: ['./settings.component.scss']
})
export class SettingsComponent implements OnInit {
<|fim▁hole|> ngOnInit() ... | constructor() {
}
|
<|file_name|>pyreringconfig.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#
# Copyright 2008 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://ww... | """Create a config file based on user config plus default config.
This method should create a new config file using some runtime information. |
<|file_name|>predict.rs<|end_file_name|><|fim▁begin|>#[macro_use]
extern crate log;
extern crate fern;
extern crate time;
extern crate gpredict;
use gpredict::{Predict, Location, Tle};
use std::thread;
fn conf_logger() {
let logger_config = fern::DispatchConfig {
format: Box::new(|msg: &str, level: &log:... | predict.update(None); |
<|file_name|>datastore.rs<|end_file_name|><|fim▁begin|>/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This software may be used and distributed according to the terms of the
* GNU General Public License version 2.
*/
use std::io::Cursor;
use std::io::Write;
use anyhow::format_err;
use anyhow::Result... |
pub fn read(cur: &mut Cursor<&[u8]>) -> Result<Metadata> {
let metadata_len = cur.read_u32::<BigEndian>()? as u64; |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>mod scene_renderable;
pub use self::scene_renderable::{
MeshRenderable,<|fim▁hole|>
mod scene_renderer;
pub use self::scene_renderer::{SceneRenderer};
mod primitives;
pub use self::primitives::{
icosahedron_renderable,
unit_sphere_renderable,
box_ren... | RenderData,
SceneRenderable,
SceneRenderableStore
}; |
<|file_name|>reward.py<|end_file_name|><|fim▁begin|>"""
Computes and stores a lookup table for a given environment and reward function.
A list of reward functions will be added here and refered to by the keyword "rType".
"""
class Reward:
def __init__(self,environment,rType):<|fim▁hole|><|fim▁end|> |
def exampleReward(self,environment):
return |
<|file_name|>decompile.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
import sys
from builtins import input
from builtins import map
# This file is part of Androguard.
#
# Copyright (c) 2012 Geoffroy Gueguen <geoffroy.gueguen@gmail.com>
# All Rights Reserved.
#
# Licensed under the Apache Licen... | self.access = util.get_access_method(method.get_access_flags())
desc = method.get_descriptor()
self.type = desc.split(')')[-1] |
<|file_name|>get_lines.py<|end_file_name|><|fim▁begin|># Copyright (C) 2013 - Oscar Campos <oscar.campos@member.fsf.org>
# This program is Free Software see LICENSE file for details
import sublime
import sublime_plugin
from ..anaconda_lib.helpers import get_settings
from ..anaconda_lib.helpers import valid_languages
... | harvester[line].append(error) |
<|file_name|>test.py<|end_file_name|><|fim▁begin|>from webtest import TestApp
import helloworld
import os
def test_index():<|fim▁hole|> assert 'Hello world!' in str(response)<|fim▁end|> | test_index.testbed.init_taskqueue_stub(task_retry_seconds=42, root_path=os.path.dirname(__file__))
app = TestApp(helloworld.app)
# fires off a task queue and should pass without exceptions
response = app.get('/') |
<|file_name|>geometry.test.js<|end_file_name|><|fim▁begin|>"use strict";
var mapnik = require('../');
var assert = require('assert');
var path = require('path');
mapnik.register_datasource(path.join(mapnik.settings.paths.input_plugins,'geojson.input'));
describe('mapnik.Geometry ', function() {
it('should throw ... | if (mapnik.versions.mapnik_number >= 300009) {
assert.throws(function() {
var transformed = mapnik.Feature.fromJSON(JSON.stringify(geometry)); |
<|file_name|>prc_aproximacao.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
--------------------------------------------------------------------------------------------------
prc_aproximacao
procedimento de aproximação de acordo com o aeródromo e pista estabelecidos
This program is ... | l_brk = f_atv.ptr_atv_brk = l_apx.lst_apx_brk[0]
|
<|file_name|>hamtask.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from ..provider.g5k import G5K
from constants import SYMLINK_NAME
from functools import wraps
import os
import yaml
import logging
def load_env():
env = {
'config' : {}, # The config
'resultdir': '', # Path to the... | kwargs['provider'] = G5K()
# Loads the environment & set the config |
<|file_name|>kinesis_stream.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# Copyright: Ansible Project
# 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 = {'metadata_v... |
stream_found, stream_msg, current_stream = (
find_stream(client, stream_name, check_mode=check_mode) |
<|file_name|>baidumap.js<|end_file_name|><|fim▁begin|>/*******************************************************************************
* KindEditor - WYSIWYG HTML Editor for Internet
* Copyright (C) 2006-2011 kindsoft.net
*
* @author Roddy <luolonghao@gmail.com>
* @site http://www.kindsoft.net/
* @licence http://... | |
<|file_name|>test_l3_agent.py<|end_file_name|><|fim▁begin|># Copyright (c) 2014 Red Hat, 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:... | SOCKET_MODE = 0o664
def setUp(self):
super(UnprivilegedUserMetadataL3AgentTestCase, self).setUp() |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# flake8: noqa
from setuptools import find_packages, setup
setup(
name = "acos-client",
version = "1.4.6",
packages = find_packages(),
author = "A10 Networks",
author_email = "mdurrant@a10networks.com",
description = "A1... | "Programming Language :: Python :: Implementation :: PyPy",
'Topic :: Internet',
'Topic :: Software Development :: Libraries :: Python Modules'
], |
<|file_name|>main.js<|end_file_name|><|fim▁begin|>// Fill in topbar details.
$('header .right').append(Handlebars.templates.userTopbar(user));
// Fill in sidebar details.
user.created_at = moment(user.created_at).format('MMM DD, YYYY');
var userStars = {user: user, stars: stars};
$('aside').prepend(Handlebars.template... | }); |
<|file_name|>TBinaryProtocol.py<|end_file_name|><|fim▁begin|>#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the... | ktype = self.readByte()
vtype = self.readByte() |
<|file_name|>IdentifiersMappingViewTest.java<|end_file_name|><|fim▁begin|>/*******************************************************************************
* Copyright 2008(c) The OBiBa Consortium. All rights reserved.
*
* This program and the accompanying materials
* are made available under the terms of the GNU Pu... | |
<|file_name|>listen_addr.go<|end_file_name|><|fim▁begin|>package cluster // import "github.com/docker/docker/daemon/cluster"
import (
"fmt"
"net"
"strings"
)
const (
errNoSuchInterface configError = "no such interface"
errNoIP configError = "could not find the system's IP address"
err... | }
// getDataPathPort validates vxlan udp port (data path port) number. |
<|file_name|>coords.hpp<|end_file_name|><|fim▁begin|>// Copyright 2015 Zhu.Jin Liang
#ifndef CAFFE_UTIL_COORDS_H_
#define CAFFE_UTIL_COORDS_H_
#include <algorithm>
#include <utility>
#include <vector>
#include "caffe/util/util_pre_define.hpp"
namespace caffe {
template <typename Dtype> class Net;
template <typen... | |
<|file_name|>controllers.js<|end_file_name|><|fim▁begin|>'use strict';
angular.module('Home').controller('ModalDeleteAssetCtrl',
function ($scope, $modalInstance, parentScope, HomeService,
asset, name, token, typeId, menuId) {
$scope.name = name;
$scope.message = "Are yo... | } else {
$scope.message = response.message;
}
} |
<|file_name|>glob.go<|end_file_name|><|fim▁begin|>// Copyright 2015 The Vanadium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package namespace
import (
"io"
"strings"
"sync"
"v.io/v23"
"v.io/v23/context"
"v.io/v23/glob"
... | x.Name = naming.Join(prefix, x.Name)
reply <- &naming.GlobReplyEntry{Value: x} |
<|file_name|>mocklogger.go<|end_file_name|><|fim▁begin|>package logger
import (
"io"
"sync"
"github.com/Clever/kayvee-go/v7/router"
)
// MockRouteCountLogger is a mock implementation of KayveeLogger that counts the router rules
// applied to each log call without actually formatting or writing the log line.
type ... |
// CounterD implements the method for the KayveeLogger interface.
func (ml *MockRouteCountLogger) CounterD(title string, value int, data map[string]interface{}) {
ml.logger.CounterD(title, value, data) |
<|file_name|>shuffle.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import random
from copy import copy
from cnfgen.formula.cnf import CNF
def Shuffle(F,
polarity_flips='shuffle',
variables_permutation='shuffle',
clauses_permutation='shuffle'):
"""Reshuffle the given f... | Specifies the permutation of the variables. |
<|file_name|>domain.cpp<|end_file_name|><|fim▁begin|>/**
* \file
* \brief Implementions of RL domains, Mountain Car (MC), HIV, and Bicycle.
*
* Copyright (c) 2008-2014 Robert D. Vincent.
*/
#include <vector>
#include <utility>
#include <cmath>
#include <string.h>
using namespace std;
#include "domain.h"
#include... | // Enforce bounds.
if (v1 < min_v) { |
<|file_name|>networkDrawer.py<|end_file_name|><|fim▁begin|>import sys
import collections as c
from scipy import special, stats
import numpy as n, pylab as p, networkx as x
class NetworkDrawer:
drawer_count=0
def __init__(self,metric="strength"):
self.drawer_count+=1
metric_=self.standardizeName... | self.poss=poss=[] |
<|file_name|>logging-separate-lines.rs<|end_file_name|><|fim▁begin|>// Copyright 2013-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://ww... |
// ignore-windows
// exec-env:RUST_LOG=debug
// compile-flags:-C debug-assertions=y |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""
``nanshe`` package, an image processing toolkit.
===============================================================================
Overview
===============================================================================
The ``nanshe`` package is an image process... | from nanshe import converter |
<|file_name|>archive.go<|end_file_name|><|fim▁begin|>package http
import (
"strconv"
"go-common/app/service/main/archive/api"
"go-common/library/ecode"
bm "go-common/library/net/http/blademaster"
)
func pageList(c *bm.Context) {
var (
aid int64
err error
pages []*api.Page
)
aidStr := c.Request.Form.... | |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// Copyright (c) 2020 DDN. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
use std::{collections::BTreeSet, env};
pub mod api;
pub mod api_utils;
pub mod display_utils;
pub mod error;
pub mod f... | |
<|file_name|>ChunkResponder.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2016, WSO2 Inc. (http://wso2.com) 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
*... | |
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>from msw.models import Page, RichText, MembersPostUser, MembersPostText
from django.contrib import admin
# could add more complicated stuff here consult:
# tutorial: https://docs.djangoproject.com/en/dev/intro/tutorial02/#enter-the-admin-site
# tutorial finished... | |
<|file_name|>ezRPConfig.py<|end_file_name|><|fim▁begin|># Copyright (C) 2013-2015 Computer Sciences 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.ap... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Yith Library Server is a password storage server.
# Copyright (C) 2012-2013 Yaco Sistemas
# Copyright (C) 2012-2013 Alejandro Blanco Escudero <alejandro.b.e@gmail.com>
# Copyright (C) 2012-2013 Lorenzo Gil Sanchez <lorenzo.gil.sanchez@gmail.com>
#
# This file is p... |
config.add_request_method(get_user, 'user', reify=True)
config.add_request_method(get_google_analytics, |
<|file_name|>backlog.py<|end_file_name|><|fim▁begin|><|fim▁hole|>taiga_ncurses.ui.views.backlog
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
import urwid
from taiga_ncurses.ui.widgets import generic, backlog
from . import base
class ProjectBacklogSubView(base.SubView):
help_popup_title = "Backlog Help Info"
help_pop... | # -*- coding: utf-8 -*-
""" |
<|file_name|>apt.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# vim:fenc=utf-8<|fim▁hole|>#
# Copyright (C) 2020 Freie Universität Berlin
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
... | |
<|file_name|>search.rs<|end_file_name|><|fim▁begin|>// Copyright (c) 2019, Ben Boeckel
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain th... | fn search_and_find_keyring_link_replace() { |
<|file_name|>frequency_status.rs<|end_file_name|><|fim▁begin|>use rosrust::Duration;
use rosrust_diagnostics::{FrequencyStatus, Level, Status, Task};
mod util;
#[test]
fn frequency_status_test() {
let _roscore = util::run_roscore_for(util::Feature::FrequencyStatusTest);
rosrust::init("frequency_status_test");... | let mut status0 = Status::default();
fs.run(&mut status0); |
<|file_name|>TaskManagerPlugin.py<|end_file_name|><|fim▁begin|>""" Container for TaskManager plug-ins, to handle the destination of the tasks
"""
import six
from DIRAC import gLogger
from DIRAC.Core.Utilities.List import fromChar
from DIRAC.Core.Utilities.SiteSEMapping import getSitesForSE
from DIRAC.DataManagementSys... | Exclude += Paris |
<|file_name|>bench.rs<|end_file_name|><|fim▁begin|>#![feature(test)]
extern crate "basic-hll" as hll;
extern crate test;
#[cfg(test)]
mod tests {
use hll::*;
use test::Bencher;
#[bench]
fn bench_string_addition(b: &mut Bencher) {
b.iter(|| {
let mut hll = HLL::ctor(0.0040625);
... | |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>#![cfg_attr(feature = "no_std", no_std)]
#[macro_use]
extern crate cfg_if;
cfg_if! (
if #[cfg(feature="no_std")] {
use core::str::FromStr;
} else {
use std::str::FromStr;
}
);
mod char;
mod int;
pub use char::TryFromIntToCharError;
pub use ... | |
<|file_name|>EmbedBuilder.java<|end_file_name|><|fim▁begin|>package discord.jar;
import java.awt.*;
import java.util.ArrayList;
import java.util.List;
public class EmbedBuilder {
private String title;
private String type;
private String description;
private String url;
private Color color;
pri... | this.thumbnail = thumbnail;
return this;
}
|
<|file_name|>httpsink.go<|end_file_name|><|fim▁begin|>package sfxclient
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"runtime"
"strings"
"sync/atomic"
"time"
"unicode"
"github.com/golang/protobuf/proto"
"github.com/signalfx/com_signalfx_metrics_protobuf"
"github.com/signalfx/golib/datapo... | |
<|file_name|>layout.js<|end_file_name|><|fim▁begin|>'use strict';
const path = require('path');
const
srcDir = path.join(__dirname, 'src/front'),
distDir = path.join(__dirname, 'front/dist');
module.exports = {<|fim▁hole|> jsEntry: path.join(srcDir, 'js/index.js'),
htmlEntry: path.join... | envFilePath: path.join(__dirname, '.env'),
src: {
front: { |
<|file_name|>observer_test.go<|end_file_name|><|fim▁begin|>/*
Copyright 2018 The Kubernetes 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/LICENSE-2.0
... | |
<|file_name|>test_ml.py<|end_file_name|><|fim▁begin|>"""
Predict labels using trained ML models. Use average probability ensemble.
"""
__author__ = 'bshang'
import numpy as np
import pandas as pd
from sklearn import preprocessing
from sklearn.externals import joblib<|fim▁hole|>
def convert_label_to_array(str_label)... | |
<|file_name|>user.ts<|end_file_name|><|fim▁begin|>/// <reference path="../apimanPlugin.ts"/>
/// <reference path="../services.ts"/>
module Apiman {
export var UserRedirectController = _module.controller("Apiman.UserRedirectController",
['$q', '$scope', '$location', 'PageLifecycle', '$routeParams',
... | PageLifecycle.forwardTo('/users/{0}/orgs', $routeParams.user);
});
}]) |
<|file_name|>bit_distributor.rs<|end_file_name|><|fim▁begin|>use num::basic::integers::PrimitiveInt;
use num::logic::traits::{BitConvertible, NotAssign};
use std::fmt::Debug;
const COUNTER_WIDTH: usize = u64::WIDTH as usize;
/// This struct is used to configure `BitDistributor`s.
///
/// See the `BitDistributor` docu... | |
<|file_name|>case207.py<|end_file_name|><|fim▁begin|>#
# Copyright (C) 2004 SIPfoundry Inc.
# Licensed by SIPfoundry under the GPL license.
#
# Copyright (C) 2004 SIP Forum
# Licensed to SIPfoundry under a Contributor Agreement.
#
#
# This file is part of SIP Forum User Agent Basic Test Suite which
# belongs to the SIP... | ack = self.createRequest("ACK", trans=message.transaction)
self.writeMessageToNetwork(self.neh, ack)
if message.code == 400:
self.addResult(TestCase.TC_PASSED, "INVITE rejected with 400") |
<|file_name|>test-treestate.py<|end_file_name|><|fim▁begin|># Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2.
from __future__ import absolute_import
import itertools
import os
import posixpath
import... | path = posixpath.join(path, randname())
|
<|file_name|>blueprint.go<|end_file_name|><|fim▁begin|>package server
import (
"context"
"github.com/antihax/goesi"
"github.com/motki/motkid/model"
"github.com/motki/motkid/proto"
"github.com/pkg/errors"
)
func (srv *GRPCServer) getAuthorizedContext(tok *proto.Token, role model.Role) (context.Context, int, erro... | }
user, err := srv.model.GetUserBySessionKey(tok.Identifier)
if err != nil { |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>/// The intermediate representation.
pub extern crate compiler_ir as ir;
/// The machine module.
pub extern crate compiler_machine as machine;
/// The machine level IR.
pub extern crate compiler_mir as mir;<|fim▁hole|>pub extern crate compiler_pass as pass;
/// The regis... | /// The pass infrastructure. |
<|file_name|>Repo.test.ts<|end_file_name|><|fim▁begin|>import { detectState, RepoState } from '../Repo'
import logger from '../../Logger'
import { spawnSync, SpawnSyncOptionsWithStringEncoding, SpawnSyncReturns } from 'child_process'
jest.mock('child_process')
jest.mock('../../Logger')
afterEach(() => jest.resetAllM... | test('detectState(): unknown error', async () => {
const spawnSyncMock = (spawnSync as unknown as jest.MockedFunction<spawnSyncFn>)
const error = new Error('fail')
spawnSyncMock.mockReturnValue({ |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>mod expand_repeats;
mod expand_tokens;
mod extract_default_aliases;
mod extract_tokens;
mod flatten_grammar;
mod intern_symbols;
mod process_inlines;
pub(crate) use self::expand_tokens::expand_tokens;
use self::expand_repeats::expand_repeats;
use self::extract_default_... | Rule::prec(Precedence::Name("c".to_string()), Rule::string("z")),
])),
},
], |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import patterns, url
<|fim▁hole|> '',
url(r'^$', 'whatify.views.index'),
url(r'^search/(.+)$', 'whatify.views.search'),
url(r'^torrent_groups/(\d+)$', 'whatify.views.get_torrent_group'),
url(r'^torrent_groups/(\d+)/download$', 'w... | urlpatterns = patterns( |
<|file_name|>oauth2_session.py<|end_file_name|><|fim▁begin|><|fim▁hole|>
from oauthlib.common import generate_token, urldecode
from oauthlib.oauth2 import WebApplicationClient, InsecureTransportError
from oauthlib.oauth2 import TokenExpiredError, is_secure_transport
import requests
log = logging.getLogger(__name__)
lo... | from __future__ import unicode_literals
import logging |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3
# -*- Coding : UTF-8 -*-
from os import path
import github_update_checker
from setuptools import setup, find_packages
file_path = path.abspath(path.dirname(__file__))
with open(path.join(file_path, "README.md"), encoding="UTF-8") as f:
long_de... |
setup(
name="github_update_checker",
version=github_update_checker.__version__, |
<|file_name|>PendingPurchasesInstallationDialog.java<|end_file_name|><|fim▁begin|>/*
* RapidMiner
*
* Copyright (C) 2001-2014 by RapidMiner and the contributors
*
* Complete list of developers available at our web site:
*
* http://rapidminer.com
*
* This program is free software: you can redistribute... | |
<|file_name|>request.all.rooms.event.ts<|end_file_name|><|fim▁begin|>import { Event } from "./event";
export class RequestAllRoomsEvent {<|fim▁hole|><|fim▁end|> | static readonly eventName: string = Event.RequestAllRooms;
} |
<|file_name|>course_quality.py<|end_file_name|><|fim▁begin|># pylint: disable=missing-docstring
import logging
import numpy as np
from scipy import stats
from rest_framework.generics import GenericAPIView
from rest_framework.response import Response
from edxval.api import get_videos_for_course
from openedx.core.django... | |
<|file_name|>OptionsMenuData.cpp<|end_file_name|><|fim▁begin|>/*
OptionsMenuData.cpp
Author : Cyrielle
File under GNU GPL v3.0 license
*/
#include "OptionsMenuData.hpp"
#include "ResourceLoader.hpp"
namespace OpMon {
namespace Model {
OptionsMenuData::OptionsMenuData(UiData *data)
: uidata(... | ResourceLoader::load(yesTx, "sprites/misc/yes.png");
ResourceLoader::load(creditsBg, "backgrounds/credits.png"); |
<|file_name|>htmlvideoelement.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 https://mozilla.org/MPL/2.0/. */
use crate::document_loader::{LoadBlocker, LoadType}... | |
<|file_name|>view_container_ref.ts<|end_file_name|><|fim▁begin|>import {ListWrapper, List} from 'angular2/src/core/facade/collection';
import {ResolvedBinding} from 'angular2/di';
import {isPresent, isBlank} from 'angular2/src/core/facade/lang';
import * as avmModule from './view_manager';
import * as viewModule from ... | /**
* Return a {@link ViewRef} at specific index. |
<|file_name|>jquery.equalHeight.js<|end_file_name|><|fim▁begin|>import debounce from 'debounce';
import $ from 'jquery';
const groupElementsByTop = (groups, element) => {
const top = $(element).offset().top;
groups[top] = groups[top] || [];
groups[top].push(element);
return groups;
};
const groupElementsByZer... | groupsAsArray.forEach(clearHeight);
groupsAsArray.forEach(applyMaxHeight); |
<|file_name|>ttree_lex.py<|end_file_name|><|fim▁begin|># -*- coding: iso-8859-1 -*-
# Author: Andrew Jewett (jewett.aij at g mail)
# http://www.chem.ucsb.edu/~sheagroup
# License: 3-clause BSD License (See LICENSE.TXT)
# Copyright (c) 2012, Regents of the University of California
# All rights reserved.
"""A ... | Andrew 2012-3-25 |
<|file_name|>复件 game_spider.py<|end_file_name|><|fim▁begin|>
<|fim▁hole|>
if __name__ == "__main__":
print u'开始爬取咨询信息...'
# 设置资讯的存储位置,必须以 \\ 结尾,分为绝对路径和相对路径
# c:\资讯\\ C:\咨询 目录下存放 txt,c:\资讯\图片 目录下存放图片
# 咨询\ 程序当前文件夹下的 资讯 目录存储 txt, 里面的 图片目录存放图片
news_path = u'c:\资讯\\'
# 设置视频目录,同上... |
from news_spider import news_spider
from video_spider import video_spider |
<|file_name|>test_name_id.py<|end_file_name|><|fim▁begin|># Copyright 2013 IBM Corp.
#
# 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... | db.volume_update(self.ctxt, vol_ref['id'], {'name_id': 'fake'})
snap_ref = testutils.create_snapshot(self.ctxt, vol_ref['id'])
expected_name = CONF.volume_name_template % 'fake' |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>var expect = require("chai").expect;
var MoodleExporter = require('../../MoodleExporter');
var xml2js = require('xml2js');
describe('MoodleExporter', function () {
var validSeed = 'abcd1234';
var validQD = {
"version": "0.1",
"questions": [{
... | xmlResult = result;
done();
}); |
<|file_name|>fmt.go<|end_file_name|><|fim▁begin|><|fim▁hole|>
import (
"bytes"
"github.com/influxdata/kapacitor/tick/ast"
)
// Formats a TICKscript according to the standard.
func Format(script string) (string, error) {
root, err := ast.Parse(script)
if err != nil {
return "", err
}
var buf bytes.Buffer
buf.... | package tick |
<|file_name|>ShapeGraphicAttribute.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 ... | g2.setStroke(oldStroke); |
<|file_name|>ledstart.py<|end_file_name|><|fim▁begin|>import RPi.GPIO as GPIO
import time
led = 11
GPIO.setmode(GPIO.BOARD)
GPIO.setup(led,GPIO.OUT)
#for x in range(0,100):
GPIO.output(led,True)
time.sleep(0.5)
GPIO.output(led,False)
time.sleep(0.5)
GPIO.output(led,True)
time.sleep(0.5)
GPIO.output(led,False)
time.sl... | time.sleep(0.2) |
<|file_name|>test_unicode.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from itertools import product
from itertools import permutations
from numba import njit
from numba.core import types, utils
import unittest
from numba.tests.support import (TestCase, no_pyobj_flags, MemoryLeakMixin)
from numba.core.error... | |
<|file_name|>x082.py<|end_file_name|><|fim▁begin|>data = (
'Yao ', # 0x00
'Yu ', # 0x01
'Chong ', # 0x02
'Xi ', # 0x03
'Xi ', # 0x04
'Jiu ', # 0x05
'Yu ', # 0x06
'Yu ', # 0x07
'Xing ', # 0x08
'Ju ', # 0x09
'Jiu ', # 0x0a
'Xin ', # 0x0b
'She ', # 0x0c
'She ', # 0x0d
'Yadoru ', ... | |
<|file_name|>manage.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":<|fim▁hole|> from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the
# issue is... | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "DjangoServer.settings")
try: |
<|file_name|>toHaveHTML--tests.js<|end_file_name|><|fim▁begin|>const { shallow, mount } = require('enzyme');
const React = require('react');
function Fixture() {
return (
<div id="root">
<span id="child">Test</span>
</div>
);
}
describe('toHaveHTML', () => {
it('works with `shallow` renders', () =... |
it('works with with jasmines negation', () => {
const wrapper = shallow(<Fixture />);
expect(wrapper.find('#child')).not.toHaveHTML('foo'); |
<|file_name|>message.py<|end_file_name|><|fim▁begin|>"""Extension argument processing code
"""
__all__ = ['Message', 'NamespaceMap', 'no_default', 'registerNamespaceAlias',
'OPENID_NS', 'BARE_NS', 'OPENID1_NS', 'OPENID2_NS', 'SREG_URI',
'IDENTIFIER_SELECT']
import copy
import warnings
import urll... | raise UndefinedOpenIDNamespace('OpenID namespace not set') |
<|file_name|>loaders.py<|end_file_name|><|fim▁begin|>"""
Test cases for the template loaders
Note: This test requires setuptools!
"""
from django.conf import settings
if __name__ == '__main__':
settings.configure()
import unittest
import sys
import pkg_resources
import imp
import StringIO
import os.path
from d... | "Loading an existent template from an egg not included in INSTALLED_APPS should fail"
settings.INSTALLED_APPS = []
self.assertRaises(TemplateDoesNotExist, lts_egg, "y.html") |
<|file_name|>test_oplog_manager.py<|end_file_name|><|fim▁begin|># Copyright 2013-2014 MongoDB, 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-... | primary_client=conn,
doc_managers=(DocManager(),),
oplog_progress_dict=LockingDict(), |
<|file_name|>managed_rom_archive_tests.py<|end_file_name|><|fim▁begin|>import json
from mockito import *
import os
import shutil
import tempfile
import unittest
from ice.history import ManagedROMArchive
class ManagedROMArchiveTests(unittest.TestCase):
def setUp(self):
self.tempdir = tempfile.mkdtemp()
self.... | archive = ManagedROMArchive(self.temppath)
|
<|file_name|>2d4882d39dbb_add_graphql_acl_to_users.py<|end_file_name|><|fim▁begin|>"""add graphql ACL to users
Revision ID: 2d4882d39dbb
Revises: c4d0e9ec46a9
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '2d4882d39dbb'
down_revision = 'dc2848563b53'
POLICY... | return conn.execute(query).scalar() |
<|file_name|>manager.py<|end_file_name|><|fim▁begin|># Copyright (c) 2008, Aldo Cortesi. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including ... | file_name = os.path.join(dir_path, module_name) + '.py'
f = importlib.machinery.SourceFileLoader(module_name, file_name)
module = f.load_module()
return module |
<|file_name|>program.cpp<|end_file_name|><|fim▁begin|>/*
-------------------------------------------------------------
Copyright (c) MMXIII Atle Solbakken
atle@goliathdns.no
-------------------------------------------------------------
This file is part of P* (P-star).
P* is free software: you can redistribute it ... | #include "value_array.h"
#include "value_string.h"
#include "value_int.h" |
<|file_name|>load_results_from_file.py<|end_file_name|><|fim▁begin|>import numpy
from srxraylib.plot.gol import plot_image, plot
import sys
from comsyl.scripts.CompactAFReader import CompactAFReader
def plot_stack(mystack,what="intensity",title0="X",title1="Y",title2="Z"):
from silx.gui.plot.StackView import ... | raise Exception("Undefined label "+what)
sv.setLabels([title0,title1,title2])
sv.show() |
<|file_name|>test_utils.py<|end_file_name|><|fim▁begin|># Licensed under a 3-clause BSD style license - see LICENSE.rst
<|fim▁hole|>import pytest
import numpy as np
from astropy.cosmology.utils import inf_like, vectorize_if_needed, vectorize_redshift_method
from astropy.utils.exceptions import AstropyDeprecationWarni... | from math import inf
|
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from setuptools import setup, find_packages
from orotangi import __version__ as version
install_requires = [
'Django==1.11.18',
'djangorestframework==3.6.2',
'django-cors-headers==2.0.2',
'django-filter==1.0.2',
'python-dateutil==2.6.0'
]
setup(
... | |
<|file_name|>scriptStage.ts<|end_file_name|><|fim▁begin|>import { module } from 'angular';
import { Registry } from 'core/registry';
import { AuthenticationService } from 'core/authentication';
import { ExecutionDetailsTasks } from '../common';
import { ScriptStageConfig, validate } from './ScriptStageConfig';
import... | }); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.