prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>version_helpers.py<|end_file_name|><|fim▁begin|># Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Utilities for generating the version string for Astropy (or an affiliated
package) and the version.py module, which contains version info for the
package.
Within the generated astropy.versi... | break
git_helpers_py = '\n'.join(source_lines[idx + 1:])
if PY3: |
<|file_name|>nativeService.ts<|end_file_name|><|fim▁begin|>import {Injectable} from '@angular/core';
import {ToastController, LoadingController, Platform, Loading, AlertController} from 'ionic-angular';
import {StatusBar} from '@ionic-native/status-bar';
import {AppVersion} from '@ionic-native/app-version';
import {Toa... | } |
<|file_name|>pic.rs<|end_file_name|><|fim▁begin|>/*
* 8259A PIC interface
*
* TODO: some code here is common with PIC implementation in xvm
* make some common definition crate if possible
*/
use arch;
use pio::{inb, outb};<|fim▁hole|>const PIC_SLAVE_CMD: u16 = 0xA0;
const PIC_SLAVE_DATA: u16 = 0xA1;
const ... |
const PIC_MASTER_CMD: u16 = 0x20;
const PIC_MASTER_DATA: u16 = 0x21; |
<|file_name|>error.rs<|end_file_name|><|fim▁begin|>use crate::asm::Token;
use std::fmt;
#[derive(Debug, Clone)]
pub enum Error {
ParseError { error: String },
NoSectionDecl,
MissingSection,
StringConstantWithoutLabel { instr: String },
SymbolAlreadyDeclared { name: String },
InvalidDirectiveNam... |
impl fmt::Display for Error { |
<|file_name|>es5-asyncFunctionPropertyAccess.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>// @lib: es5,es2015.promise
// @noEmitHelpers: true
// @target: ES5
declare var x, y, z, a, b, c;
async function propertyAccess0() {
y = await x.a;
}
async function propertyAccess1() {
y = (await x).a;
}
asy... | |
<|file_name|>semantic_simi.py<|end_file_name|><|fim▁begin|>import spacy
nlp = spacy.load('en')
text = open('customer_feedback_627.txt').read()
doc = nlp(text)
for entity in doc.ents:
print(entity.text, entity.label_)<|fim▁hole|>doc1.similarity(doc2)
# Hook in your own deep learning models
nlp.add_pipe(load_my_mo... |
# Determine semantic similarities
doc1 = nlp(u'the fries were gross')
doc2 = nlp(u'worst fries ever') |
<|file_name|>TagUtils.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2015 Textocat
*
* 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/licens... |
private static final Set<String> closedPosSet = ImmutableSet.of(NPRO, Apro, PREP, CONJ, PRCL);
|
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#![feature(int_uint)]
extern crate devtools_traits;
extern crate... | pub layout_chan: Box<Any+Send>, // opaque reference to a LayoutChannel |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>""" Users API URI specification """
from django.conf import settings
from django.conf.urls import url
from django.db import transaction
from edx_solutions_api_integration.users import views as users_views
from rest_framework.urlpatterns import format_suffix_patterns
CO... | url(r'^(?P<user_id>[a-zA-Z0-9]+)/groups/*$', users_views.UsersGroupsList.as_view(), name='users-groups-list'), |
<|file_name|>tests.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 quickcheck::quickcheck;
use crate::Bytes;
use crate::Text;
quickcheck! {
fn te... | |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>pub use self::arch::{basename};
#[cfg(target_arch = "x86_64")]
#[path = "x86_64.rs"]<|fim▁hole|>mod arch;
#[cfg(target_arch = "x86")]
#[path = "x86.rs"]
mod arch;<|fim▁end|> | |
<|file_name|>test_inject.py<|end_file_name|><|fim▁begin|># Copyright (C) 2012 Red Hat, 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/licen... | #
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
<|file_name|>sisview.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Carmelo Mordini
#
# 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 Foundation, either v... | |
<|file_name|>jquery.highlightText.js<|end_file_name|><|fim▁begin|>/**
* Plugin that highlights matched word partials in a given element.
* TODO: Add a function for restoring the previous text.
* TODO: Accept mappings for converting shortcuts like WP: to Wikipedia:.
*/
( function ( $ ) {
$.highlightText = {
// ... | var $el = $( this );
$el.data( 'highlightText', { originalText: $el.text() } );
$.highlightText.splitAndHighlight( this, matchString );
} ); |
<|file_name|>display-during-signup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
from participantCollection import ParticipantCollection
import string
import re
import datetime
import pyperclip
# Edit Me!
# Remember, this is during signup, so current month is not June, it's May.
currentMonthTotalDays = 31
currentM... | answer = re.sub('NEXT_MONTH_INDEX', str(nextMonthIndex), answer)
answer = re.sub('NEXT_MONTH_NAME', nextMonthName, answer)
answer = re.sub('CURRENT_DAY_OF_MONTH_INDEX', str(currentDayOfMonthIndex), answer)
answer = re.sub('CURRENT_DAY_OF_MONTH_NAME', currentDayOfMonthName, answer) |
<|file_name|>UiManager.java<|end_file_name|><|fim▁begin|>package seedu.tache.ui;
import java.util.logging.Logger;
//import org.controlsfx.control.Notifications;
import com.google.common.eventbus.Subscribe;
import javafx.application.Platform;
//import javafx.geometry.Pos;
import javafx.scene.control.Alert;
import ja... | |
<|file_name|>batch_wise_balance_history.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import flt
def execute(... | def get_stock_ledger_entries(filters):
conditions = get_conditions(filters)
return frappe.db.sql("""select item_code, batch_no, warehouse, |
<|file_name|>Menu.js<|end_file_name|><|fim▁begin|>/*jslint node: true, vars: true, plusplus: true, devel: true, nomen: true, regexp: true, indent: 2, maxerr: 50*/
/*global define, $, brackets, Mustache, window, appshell*/
define(function (require, exports, module) {
"use strict";
// HEADER >>
var NodeConnection ... | |
<|file_name|>issue-7268.rs<|end_file_name|><|fim▁begin|>// check-pass
#![allow(dead_code)]<|fim▁hole|>fn foo<T: 'static>(_: T) {}
fn bar<T>(x: &'static T) {
foo(x);
}
fn main() {}<|fim▁end|> | // pretty-expanded FIXME #23616
|
<|file_name|>nickserv.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2004-2011 See the AUTHORS file for details.
*
* This program is free software; you can redistribute it and/or modify it<|fim▁hole|> * under the terms of the GNU General Public License version 2 as published
* by the Free Software Foundation.... | |
<|file_name|>e966a3afd100_separate_patreon_user_table.py<|end_file_name|><|fim▁begin|>revision = 'e966a3afd100'
down_revision = '954c3c4caf32'
branch_labels = None
depends_on = None
import alembic
import sqlalchemy
import requests
import pytz
import dateutil.parser
import datetime
def upgrade():
patreon_users = alem... | .where(users.c.patreon_access_token.isnot(None))) |
<|file_name|>image.ts<|end_file_name|><|fim▁begin|>export interface Image {<|fim▁hole|> createdAt: number;
filename: string;
size: string;
location: string;
date: string;
}<|fim▁end|> | _id: number | string; |
<|file_name|>Problem015.java<|end_file_name|><|fim▁begin|>package fr.mvanbesien.projecteuler.from001to020;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Callable;
public class Problem015 implements Callable<Long> {
public static void main(String[] args) throws Exception {
long nan... | |
<|file_name|>input_cells.py<|end_file_name|><|fim▁begin|># Copyright 2019 The Cirq Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2... | ), |
<|file_name|>0002_auto__add_field_userprofile_is_mysqldba_oncall__add_field_userprofile_.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
... | 'contract_number': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// Copyright (c) 2014, 2015 Robert Clipsham <robert@octarineparrot.com>
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at yo... | //! * Layer 4, transport layer
//!
//! Unless otherwise stated, all interactions with libpnet are in host-byte order - any platform |
<|file_name|>bts_publish_market.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2
# coding=utf8 sw=1 expandtab ft=python
from __future__ import print_function
from twisted.internet import reactor
from twisted.internet.defer import inlineCallbacks
from autobahn.twisted.wamp import ApplicationSession
from autobahn... | |
<|file_name|>playlist_track.rs<|end_file_name|><|fim▁begin|>use std::collections::BTreeMap;
use uuid::Uuid;
use chrono::{NaiveDateTime, Utc};
use postgres;
use error::Error;
use super::{conn, Model};
use model::track::{Track, PROPS as TRACK_PROPS};
use model::playlist::Playlist;
#[derive(Serialize, Deserialize, Debug,... | impl PlaylistTrack {
fn props_str(prefix: &str) -> String { |
<|file_name|>scikitbase.py<|end_file_name|><|fim▁begin|>from abc import ABC
import configargparse
from sklearn.externals import joblib
from termcolor import colored
class ScikitBase(ABC):
"""
Base class for AI strategies
"""
arg_parser = configargparse.get_argument_parser()
arg_parser.add('-p', '-... | Returns predictions based on the model/pipeline
"""
try: |
<|file_name|>mk_lib_hash_md5.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>use sha1::{Sha1, Digest};
use std::fs;
let mut file = fs::File::open(&path)?;
let hash = Sha1::digest_reader(&mut file)?;<|fim▁end|> | |
<|file_name|>comment.ts<|end_file_name|><|fim▁begin|>import { debug } from '../utils/debug'
import {
GET_COMMENT_LIST_ERROR,
GET_COMMENT_LIST_PENDING,
GET_COMMENT_LIST_SUCCESS,
POST_COMMENT_ERROR,
POST_COMMENT_SUCCESS,
POST_COMMENT_PENDING,
} from '../constants/comment.action.types'
import { fromJS, List... | |
<|file_name|>stockListGen.py<|end_file_name|><|fim▁begin|># (c) 2011, 2012 Georgia Tech Research Corporation
# This source code is released under the New BSD license. Please see
# http://wiki.quantsoftware.org/index.php?title=QSTK_License
# for license details.
#
# Created on October <day>, 2011<|fim▁hole|># @author: ... | # |
<|file_name|>proxy.py<|end_file_name|><|fim▁begin|>from urllib.parse import urlparse
class Proxy(object):
def __init__(self, proxy_type, proxy_address, proxy_port, proxy_login, proxy_password):
self.proxyType = proxy_type
self.proxyAddress = proxy_address
self.proxyPort = proxy_port
... | |
<|file_name|>SearchClientLinksRequest.java<|end_file_name|><|fim▁begin|>package com.microsoft.bingads.v12.customermanagement;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
i... | * <element name="PageInfo" type="{https://bingads.microsoft.com/Customer/v12/Entities}Paging" minOccurs="0"/>
* </sequence> |
<|file_name|>for_each_n.hpp<|end_file_name|><|fim▁begin|>/// \file
// Range v3 library
//
// Copyright Eric Niebler 2014-present
// Copyright Rostislav Khlebnikov 2017
//
// Use, modification and distribution is subject to the
// Boost Software License, Version 1.0. (See accompanying
// file LICENSE.txt or copy at... | MoveIndirectInvocable<F, projected<I, P>>())>
I operator()(I begin, difference_type_t<I> n, F fun, P proj = P{}) const |
<|file_name|>pie-size.ts<|end_file_name|><|fim▁begin|>import { Chart, registerShape } from '@antv/g2';
const data = [
{ type: '分类一', value: 27 },
{ type: '分类二', value: 25 },
{ type: '分类三', value: 18 },
{ type: '分类四', value: 15 },
{ type: '分类五', value: 10 },
{ type: 'Other', value: 5 },
];
let max = 0;
dat... | // 自定义 other 的图形,增加两条线 |
<|file_name|>frameBarComponent.tsx<|end_file_name|><|fim▁begin|>import { Nullable } from "babylonjs/types";
import * as React from "react";
<|fim▁hole|>// x distance between consecutive ticks on the frame
const baseTickDistance = 25;
const minTickDistance = 35;
interface IFrameBarComponentProps {
globalState... | import { GlobalState } from "../../../../../../globalState";
import { Context, IActiveAnimationChangedOptions } from "../context";
import { Observer } from "babylonjs/Misc/observable";
|
<|file_name|>PrefsHelper.java<|end_file_name|><|fim▁begin|>package com.gaiagps.iburn;
import android.content.Context;
import android.content.SharedPreferences;
/**
* Created by davidbrodsky on 7/1/15.
*/
public class PrefsHelper {
private static final String SHOWED_WELCOME = "welcomed_2018"; // boole... | |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>import React, { Component, PropTypes } from 'react';
import Select from 'react-select';
import { omit } from 'lodash';
import classNames from 'classnames';
import styles from './styles.scss';
import chevronIcon from '../../../assets/images/icons/chevron-down.svg';
exp... | return (
<div className={selectStyles}>
{this.renderLabel()}
{this.renderSelectField()} |
<|file_name|>AutoStereoDisplay.py<|end_file_name|><|fim▁begin|># -*- Mode:Python -*-
##########################################################################
# #
# This file is part of AVANGO. #
# ... | user = avango.display.nodes.User() |
<|file_name|>skip_unittest.py<|end_file_name|><|fim▁begin|># Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import unittest
from telemetry import story
from telemetry import page as page_module
f... | v = skip.SkipValue(self.pages[0], 'page skipped for testing reason')
self.assertIsNone(v.GetBuildbotValue()) |
<|file_name|>dataform.ts<|end_file_name|><|fim▁begin|>/** The MIT License (MIT) Copyright(c) 2016 Maxim V.Tsapov */
import {
Utils, IBaseObject, IEditable, IErrorNotification,
IValidationInfo, IVoidPromise, BaseObject, LocaleERRS as ERRS,
LocaleSTRS as STRS, Debounce
} from "jriapp_shared";
import { IField... | return; |
<|file_name|>azure_file.go<|end_file_name|><|fim▁begin|>// +build !providerless
/*
Copyright 2016 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/... | klog.Warningf("azureFile - ReadDir %s failed with %v, unmount this directory", dir, err)
if err := b.mounter.Unmount(dir); err != nil { |
<|file_name|>test_xliff2po.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from translate.convert import xliff2po
from translate.misc import wStringIO
from translate.storage.test_base import headerless_len, first_translatable
class TestXLIFF2PO:
xliffskeleton = '''<?xml version="1.0" ?>
<xliff version="1.1"... | assert pofile.translate("red") == "rooi"
assert pofile.translate("bla") is None |
<|file_name|>0014_auto_20161102_2154.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-11-02 21:54
from __future__ import unicode_literals
from decimal import Decimal<|fim▁hole|>class Migration(migrations.Migration):
dependencies = [
('round', '0013_plot_batch'),... | from django.db import migrations, models
|
<|file_name|>SmokeParticle.java<|end_file_name|><|fim▁begin|>/*
* Pixel Dungeon
* Copyright (C) 2012-2015 Oleg Dolya
*
* Shattered Pixel Dungeon
* Copyright (C) 2014-2015 Evan Debenham
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License... | |
<|file_name|>bracket.py<|end_file_name|><|fim▁begin|># Copyright 2011 Nicholas Bray
#
# 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
#
# Unle... | self.root.insertAfter(bracket)
self.__size += 1 |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>var express = require('express'),
Weapon = require('../models/Weapon'),
router = express.Router();
// HOMEPAGE
router.get('/', function(req, res) {
res.render('index', {
title:'Weapons Guide | Fire Emblem | Awakening',
credit: 'Matt.Dodson.... | });
}); |
<|file_name|>api.py<|end_file_name|><|fim▁begin|># Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.... | |
<|file_name|>sys.py<|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/.
"""
Rudimentary system stats collection using ``psutil``.
"""<|fim▁hole|... | |
<|file_name|>mie_contrib.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
from mstm_studio.contributions import MieLognormSpheres
from mstm_studio.alloy_AuAg import AlloyAuAg
import numpy as np
mie = MieLognormSpheres(name='mie', wavelengths=np.linspace(300,800,51))
mie.set_material(AlloyAuAg(... |
values = [1, 1.5, 0.5] # scale, mu, sigma
fig, _ = mie.plot(values)
fig.savefig('mie_contrib.png', bbox_inches='tight') |
<|file_name|>json2.js<|end_file_name|><|fim▁begin|>version https://git-lfs.github.com/spec/v1
oid sha256:356614d2260c69b92680d59e99601dcd5e068f761756f22fb959b5562b9a7d62<|fim▁hole|><|fim▁end|> | size 17413 |
<|file_name|>stock.py<|end_file_name|><|fim▁begin|>import datetime
import httplib
import urllib
import os.path
import csv
import time
from datetime import timedelta
import pandas as pd
import numpy as np
def isfloat(value):
try:
float(value)
return True
except ValueError:
return False
... | date_str = f.readline()
#default set to 4 PM |
<|file_name|>kdTree.js<|end_file_name|><|fim▁begin|>/**
* k-d Tree JavaScript - V 1.01
*
* https://github.com/ubilabs/kd-tree-javascript
*
* @author Mircea Pricop <pricop@ubilabs.net>, 2012
* @author Martin Kleppe <kleppe@ubilabs.net>, 2012
* @author Ubilabs http://ubilabs.net, 2012
* @license MIT Licen... | var swap = null;
// If the first child exists (is inside the array)...
if (child1N < length) {
// Look it up and compute its score.
|
<|file_name|>sim.rs<|end_file_name|><|fim▁begin|>use col::CappedList;
use num::traits::Float;
use std::cmp::Ordering;
use strsim;
/// Gets the best jaro match for the input word.
pub fn best_match<'a>(dict: &'a [String], target: &'a str) -> Option<&'a str> {
let (_, word) = dict.iter()
.map(|word| (strsim:... | let (_, word) = dict.iter()
.map(|word| (strsim::levenshtein(word, target), word))
.fold((usize::max_value(), ""), |(ar, aw), (br, bw)| if br < ar { (br, bw) } else { (ar, aw) });
|
<|file_name|>WhereSqlListener.java<|end_file_name|><|fim▁begin|>package de.mhu.com.morse.channel.sql;
import java.lang.reflect.InvocationTargetException;
import java.sql.SQLException;
import java.util.Iterator;
import java.util.LinkedList;
import de.mhu.lib.ASql;
import de.mhu.lib.dtb.Sth;
import de.mhu.com.... | if ( ! ( function instanceof IQueryWhereFunction ) )
throw new MorseException( MorseException.FUNCTION_NOT_COMPATIBLE );
|
<|file_name|>user.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-<|fim▁hole|>from wtforms import HiddenField, SubmitField
from wtforms.fields import FormField
from wtforms_alchemy import ModelFormField
from wtforms.widgets import ListWidget
from wtforms.ext.sqlalchemy.fields import QuerySelectField
from flask_w... | from ..utils.model_form import ModelForm
from ..models import security |
<|file_name|>tensorflow_prac.py<|end_file_name|><|fim▁begin|>##### 텐서 딥러닝 1장
import tensorflow as tf
hello = tf.constant('Hello, Tensorflow')
sess = tf.Session()
print(sess.run(hello))
# 'b'는 bytes literals라는 뜻이다.
node1 = tf.constant(3.0, tf.float32) # 숫자, 데이터타입
node2 = tf.constant(4.0) # 숫자, 데이터타입
node3 = tf.add(no... | tf.argmax(hypothesis, 1), feed_dict={X: mnist.test.images[r:r + 1]})) |
<|file_name|>todo.js<|end_file_name|><|fim▁begin|>/**
* todo service
*/
class Todo {
// id = 0;
// text = '';
// checked = false;
constructor(id, text, checked) {
this.id = id;
this.text = text;
this.checked = checked;<|fim▁hole|> }
}<|fim▁end|> | |
<|file_name|>CodeFragmentEvaluator.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2000-2016 JetBrains s.r.o.
*
* 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... | } |
<|file_name|>Row.tsx<|end_file_name|><|fim▁begin|>import React from 'react';
import { toJunction } from 'brookjs';
import { Observable } from 'kefir';
import { i18n, link } from '../../../helpers';
import { jobDispatchClick } from '../../../actions';
import { Job } from './types';
type Props = Job & { onClick: (slug: ... | </tr>
); |
<|file_name|>test_AnnotatorCore.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import pytest
from AnnotatorCore import *
def test_getgenesfromfusion():
AB_EXAMPLE = ('A', 'B')
assert getgenesfromfusion('A-B') == AB_EXAMPLE
assert getgenesfromfusion('A-B ') == AB_EXAMPLE
assert getgenesfromfusion('... | assert getgenesfromfusion('MLL2-intragenic') == ('MLL2', 'MLL2')
def test_conversion(): |
<|file_name|>instance_sunwell_plateau.cpp<|end_file_name|><|fim▁begin|>/* This file is part of the ScriptDev2 Project. See AUTHORS file for Copyright information
* 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 So... | { |
<|file_name|>dat.py<|end_file_name|><|fim▁begin|>import os.path
import gwt
from ...weights import W
from warnings import warn
__author__ = "Myunghwa Hwang <mhwang4@gmail.com>"
__all__ = ["DatIO"]
class DatIO(gwt.GwtIO):
"""
Opens, reads, and writes file objects in DAT format.
Spatial weights objects in ... | |
<|file_name|>LcdShield.java<|end_file_name|><|fim▁begin|>package com.integreight.onesheeld.shields.controller;
import android.app.Activity;
import com.integreight.firmatabluetooth.ShieldFrame;
import com.integreight.onesheeld.enums.UIShield;
import com.integreight.onesheeld.shields.ControllerParent;
import com.integr... |
public void changeCursor(int indx) {
if (!isAutoScroll && indx > -1 && indx < rows * columns) { |
<|file_name|>vm.rs<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2018, Nils Asmussen <nils@os.inf.tu-dresden.de>
* Economic rights: Technische Universitaet Dresden (Germany)
*
* This file is part of M3 (Microkernel-based SysteM for Heterogeneous Manycores).
*
* M3 is free software: you can redistribute it and/o... | pub fn new(_pe: &PEDesc) -> Result<Self, Error> { |
<|file_name|>account_bank_statement.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
#
# Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved.
#
# This program is... | from openerp.osv import fields, osv
import openerp.addons.decimal_precision as dp |
<|file_name|>userinfo.js<|end_file_name|><|fim▁begin|>const { Command } = require("klasa");
const { MessageEmbed } = require("discord.js");
const statusList = {
online: "online",
idle: "idle",
dnd: "in do not disturb"
};
module.exports = class extends Command {
constructor(...args) {
super(...... | runIn: ["text"],
aliases: ["user"],
description: "Get a user's information",
usage: "<user:usersearch>", |
<|file_name|>SwapManager.py<|end_file_name|><|fim▁begin|># for localized messages
from . import _
from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Screens.ChoiceBox import ChoiceBox
from Components.config import config, configfile, ConfigYesNo, ConfigSubsection
from Components.ActionMap... | |
<|file_name|>ProgressBarTimer.java<|end_file_name|><|fim▁begin|><|fim▁hole|>
import android.os.Handler;
import android.os.Message;
public class ProgressBarTimer implements Runnable{
private Object v=null;
private Handler handler=null;
private int what=-1;
private Object b=null;
public ProgressBarTimer(Handler... | package com.example.kickfor;
import com.example.kickfor.team.ChangingRoomEntity; |
<|file_name|>update_request.go<|end_file_name|><|fim▁begin|>// Copyright 2016-2022 The Libsacloud 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/... | |
<|file_name|>qbspropertylineedit.cpp<|end_file_name|><|fim▁begin|>/****************************************************************************<|fim▁hole|>**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensee... | |
<|file_name|>test.ts<|end_file_name|><|fim▁begin|>/*
* Copyright 2019, TeamDev. All rights reserved.
*
* Redistribution and use in source and/or binary forms, with or without
* modification, must retain the above copyright notice and the following
* disclaimer.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLD... | // First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
BrowserDynamicTestingModule, |
<|file_name|>graph_handling.py<|end_file_name|><|fim▁begin|>import networkx as nx
import networkx.algorithms as alg
import numpy as np
import matplotlib.pyplot as plt
<|fim▁hole|># add users
twitter.add_node('Tom', {'age': 34})
twitter.add_node('Rachel', {'age': 33})
twitter.add_node('Skye', {'age': 29})
twitter.add_no... | # create graph object
twitter = nx.Graph()
|
<|file_name|>get-queue-acknowledged.handler.ts<|end_file_name|><|fim▁begin|>import { TRouteControllerActionHandler } from '../../../../../../lib/routing';
import { GetQueueAcknowledgedRequestDTO } from './get-queue-acknowledged.request.DTO';
import { GetQueueAcknowledgedResponseDTO } from './get-queue-acknowledged.resp... | }; |
<|file_name|>package-info.java<|end_file_name|><|fim▁begin|>/**<|fim▁hole|>* @since 0.1
*/
package ru.job4j.max;<|fim▁end|> | *
* @author Alex Karpov (mailto:karpov_aleksey@mail.ru)
* @version $Id$ |
<|file_name|>test_hpcp.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Copyright (C) 2006-2016 Music Technology Group - Universitat Pompeu Fabra
#
# This file is part of Essentia
#
# Essentia is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public L... | # details.
|
<|file_name|>key.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
'''
Wheel system wrapper for key system
'''
from __future__ import absolute_import
# Import python libs
import os
import hashlib
# Import salt libs
import salt.key
import salt.crypt
__func_alias__ = {
'list_': 'list'
}
def list_(match):
... | |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|><|fim▁hole|>
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', ... | """is_teklif_sistemi URL Configuration |
<|file_name|>RtRenderer.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2006-2016 The MZmine 3 Development Team
*
* This file is part of MZmine 3.
*
* MZmine 3 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 Founda... |
package io.github.mzmine.modules.featuretable.renderers;
import java.text.NumberFormat; |
<|file_name|>new_file_syntax.py<|end_file_name|><|fim▁begin|>'''
Stores syntax file from last activated view and reuses this for a new view.
@author: Oktay Acikalin <ok@ryotic.de>
@license: MIT (http://www.opensource.org/licenses/mit-license.php)
@since: 2011-03-05
@todo: Remove odd workaround below when/if "on_dea... | class NewFileSyntaxListener(sublime_plugin.EventListener):
def __init__(self, *args, **kwargs):
super(NewFileSyntaxListener, self).__init__(*args, **kwargs) |
<|file_name|>test_cli.py<|end_file_name|><|fim▁begin|>import boto
import mock
import moto
import tempfile
import unittest
from click.testing import CliRunner
from rubberjackcli.click import rubberjack
class CLITests(unittest.TestCase):
@moto.mock_s3_deprecated
@mock.patch('boto.beanstalk.layer1.Layer1.crea... | |
<|file_name|>metric.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 Apache L... | output_names=None, label_names=None):
super(MAE, self).__init__(
name, output_names=output_names, label_names=label_names)
|
<|file_name|>dump_worksheet.py<|end_file_name|><|fim▁begin|># file openpyxl/writer/straight_worksheet.py
# Copyright (c) 2010-2011 openpyxl
#
# 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 ... | |
<|file_name|>Specifics.java<|end_file_name|><|fim▁begin|>/* ==========================================
* JGraphT : a free Java graph-theory library
* ==========================================
*
* Project Info: http://jgrapht.sourceforge.net/
* Project Creator: Barak Naveh (http://sourceforge.net/users/barak_nav... | public abstract Set<E> incomingEdgesOf(V vertex);
/**
* . |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>pub mod greetings;
<|fim▁hole|>pub mod farewells;<|fim▁end|> | |
<|file_name|>subject_Choose.java<|end_file_name|><|fim▁begin|>package armored.g12matrickapp.Activities;
import android.content.ComponentName;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.ResolveInfo;
import android.graphics.Bitmap;
import android.graphics.draw... | @Override
public void run() {
|
<|file_name|>revert-file.tsx<|end_file_name|><|fim▁begin|>/*
* This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.
* License: AGPLv3 s.t. "Commons Clause" – see LICENSE.md for details
*/
import { Rendered, Component } from "../../app-framework";
import { Button } from "react-bootstrap";
import { TimeTrav... | import { Icon } from "../../components";
|
<|file_name|>utils.rs<|end_file_name|><|fim▁begin|>// Copyright 2018 Mozilla
//
// 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
// Unless required ... | /// - If `result` is `Err(e)`, returns a null pointer and stores a string representing the error
/// message (which was allocated on the heap and should eventually be freed) into
/// `error.message` |
<|file_name|>github-label-manager.js<|end_file_name|><|fim▁begin|>// ==UserScript==
// @name GitHub Label Manager
// @namespace http://github.com/senritsu
// @version 0.1
// @description Enables importing/exporting of repository labels
// @author senritsu
// @require https://cdnjs.cloudflare... | }
function updateLabel(label, element) {
find('.js-edit-label', element).click() |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from .m1 import f
from p1.m1 import f<|fim▁hole|>
__all__ = ['f', 'g']<|fim▁end|> | from m1 import f
from a import g
<warning descr="Unused import statement 'from a import h'">from a import h</warning> |
<|file_name|>range.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::Bindings::CharacterDataBinding::Cha... | |
<|file_name|>main.go<|end_file_name|><|fim▁begin|>package main
import (
"errors"
"fmt"
"io/ioutil"
"os"
)
type Graph struct {
nodes map[int]Node
}
type Node struct {
payload byte
adj map[int]struct{}
}
func NewGraph() Graph {
return Graph{make(map[int]Node)}
}
func (g *Graph) addNode(key int, data byte... | } |
<|file_name|>reporter.js<|end_file_name|><|fim▁begin|>var log = require('./logger')('reporter', 'yellow');
var colors = require('colors');
/* eslint no-console: 0 */
module.exports = function(diff) {
var keys = Object.keys(diff);
var count = 0;
var timer = log.timer('reporting');
if (keys.length === 0) {
lo... | });
});
}
console.log(''); |
<|file_name|>functions.rs<|end_file_name|><|fim▁begin|>use crate::*;
#[test]
fn function_no_args() {
expect("Ten: 10; Ten()").to_yield(10)
}
#[test]
fn function_single_arg_space() {
expect("Square: :x*x; Square 10").to_yield(100)
}
#[test]
fn function_single_arg_trailing_comma() {
expect("Square: :x*x; Squ... | }
#[test] |
<|file_name|>connection.py<|end_file_name|><|fim▁begin|>from stormed.util import add_method, AmqpError, logger
from stormed.serialization import table2str
from stormed.heartbeat import HeartbeatMonitor
from stormed.frame import status
from stormed.method.codegen import id2class
from stormed.method.constant import id2co... | capabilities = '',
insist = 0) |
<|file_name|>bucket.go<|end_file_name|><|fim▁begin|>package main
import (
"github.com/Terry-Mao/goim/define"
"sync"
"time"
)
type Bucket struct {
bLock sync.RWMutex // protect the session map
sessions map[int64]*Session // map[user_id] -> map[sub_id] -> server_id
counter map[int32]int32 // map[roo... | counter = make(map[int32]int32, len(b.counter)) |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>// Licensed under the MIT License:
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without l... | // Copyright (c) 2013-2015 Sandstorm Development Group, Inc. and contributors |
<|file_name|>test_ndarray_elementwise_op.py<|end_file_name|><|fim▁begin|>import operator
import unittest
import numpy
import six
from cupy import testing
@testing.gpu
class TestArrayElementwiseOp(unittest.TestCase):
_multiprocess_can_split_ = True
@testing.for_all_dtypes()
@testing.numpy_cupy_allclose... | def check_array_scalar_op(self, op, xp, dtype, swap=False):
a = testing.shaped_arange((2, 3), xp, dtype)
if swap:
return op(dtype(2), a) |
<|file_name|>app.js<|end_file_name|><|fim▁begin|>var app = app || {};
$(function(){
"use-strict";
var ShiftGridApplication = Backbone.Marionette.Application.extend({
initialize: function(options) {
this.shiftData = new app.GridRows(options.rows);
this.shiftLayout = this.initial... | cellView.listenToOnce(cellModal, "dismiss", cellView.render); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.