prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>equals.test.ts<|end_file_name|><|fim▁begin|>import { Seq, Set as ISet } from 'immutable';
import { atom, unwrap } from '../derivable';
import { equals } from './equals';
describe('util/equals', () => {
it('should check equality of primitives', () => {
expect(equals(NaN, NaN)).toBe(true);
... | });
it('should check the equality of derivables', () => { |
<|file_name|>chomp_task.py<|end_file_name|><|fim▁begin|>from staffjoy.resource import Resource
class ChompTask(Resource):<|fim▁hole|><|fim▁end|> | PATH = "internal/tasking/chomp/{schedule_id}"
ENVELOPE = None
ID_NAME = "schedule_id" |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>pub mod problems;
pub mod functions;
pub mod constraints;
pub mod solvers;
#[cfg(test)]
mod tests {
use math::variables::{AbstVar, new_var, new_const};
use math::relationships::Relationship;
use math::expressions::Expression;
use objective::problems::Pro... | assert_eq!(Relationship::EQ, *exp1.rel()); |
<|file_name|>submaker_updatezip.py<|end_file_name|><|fim▁begin|>from .submaker import Submaker
from inception.tools.signapk import SignApk<|fim▁hole|>import os
from inception.constants import InceptionConstants
class UpdatezipSubmaker(Submaker):
def make(self, updatePkgDir):
keys_name = self.getValue("keys... | import shutil |
<|file_name|>GitTag.py<|end_file_name|><|fim▁begin|># Copyright 2012 Vincent Jacques
# vincent@vincent-jacques.net
# This file is part of PyGithub. http://vincent-jacques.net/PyGithub
# PyGithub is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
# as pu... | assert attributes[ "sha" ] is None or isinstance( attributes[ "sha" ], ( str, unicode ) ), attributes[ "sha" ]
self._sha = attributes[ "sha" ]
if "tag" in attributes: # pragma no branch |
<|file_name|>six.py<|end_file_name|><|fim▁begin|>"""Utilities for writing code that runs on Python 2 and 3"""
# Copyright (c) 2010-2015 Benjamin Peterson
#
# 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... | |
<|file_name|>NoSuch_sites_countryException.java<|end_file_name|><|fim▁begin|>/**
* Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Fo... | super(msg, cause); |
<|file_name|>OneStatementPerLineCheck.java<|end_file_name|><|fim▁begin|>////////////////////////////////////////////////////////////////////////////////
// checkstyle: Checks Java source code for adherence to a set of rules.
// Copyright (C) 2001-2015 the original author or authors.
//<|fim▁hole|>// This library is fre... | |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// Copyright (C) 2020 Sebastian Dröge <sebastian@centricular.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 your<|fi... | // option. This file may not be copied, modified, or distributed |
<|file_name|>SMIME_Messaging_test.py<|end_file_name|><|fim▁begin|>import pytest
from SMIME_Messaging import Client, sign_email, encrypt_email_body, verify, decrypt_email_body, sign_and_encrypt,\
decode_str
import demistomock as demisto
with open('./test_data/signer_key.pem') as f:
private_key = f.read()
with... | message_body = 'text to check'
|
<|file_name|>OCamlParenthesesTypeParametersImpl.java<|end_file_name|><|fim▁begin|>/*
* OCaml Support For IntelliJ Platform.
* Copyright (C) 2010 Maxim Manuylov
*
* 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
* th... | import manuylov.maxim.ocaml.lang.parser.psi.OCamlElementVisitor;
|
<|file_name|>feed_parse_extractNotsogoodtranslatorWordpressCom.py<|end_file_name|><|fim▁begin|>def extractNotsogoodtranslatorWordpressCom(item):
'''
Parser for 'notsogoodtranslator.wordpress.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item... | for tagname, name, tl_type in tagmap: |
<|file_name|>1-code.rs<|end_file_name|><|fim▁begin|>fn main() {<|fim▁hole|> z = 1000;
{
let x = 10;
println!("In a block");
println!("x is {}, y is {}, z is {}", x, y, z);
}
let y = 100;
println!("x is {}, y is {}, z is {}", x, y, z);
}<|fim▁end|> | let x = 5;
let y: i32 = 10;
let mut z = 100;
println!("x is {}, y is {}, z is {}", x, y, z); |
<|file_name|>testtag.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
from future.builtins import int
from collections import defaultdict
from django.core.urlresolvers import reverse
from django.template.defaultfilters import linebreaksbr, urlize
from mezzanine import template
from mezzanine.c... | for fld in page_fields:
temp[fld] = getattr(item, fld) |
<|file_name|>unixclient.py<|end_file_name|><|fim▁begin|># Echo client demo using Unix sockets
# Piet van Oostrum
from socket import *
FILE = 'unix-socket'
s = socket(AF_UNIX, SOCK_STREAM)
s.connect(FILE)
<|fim▁hole|>data = s.recv(1024)
s.close()
print 'Received', repr(data)<|fim▁end|> | s.send('Hello, world')
|
<|file_name|>r4300.js<|end_file_name|><|fim▁begin|>/*jshint jquery:true, devel:true */
(function (n64js) {'use strict';
var kDebugTLB = 0;
var kDebugDynarec = 0;
var kEnableDynarec = true;
var hitCounts = {};
var fragmentMap = {};
var fragmentInvalidationEvents = [];
var kHotFragmentThreshold = 500;
... | |
<|file_name|>routes.js<|end_file_name|><|fim▁begin|>// app/routes.js
// grab the country model we just created
var Country = require('./models/country');
module.exports = function (app) {
//----------------------------------------------------------------------<|fim▁hole|> // authentication routes
// sample api... | // server routes
// handle things like api calls |
<|file_name|>audioPage.js<|end_file_name|><|fim▁begin|>/*global define, $, console, window, history, tizen*/
/**
* Init page module
*/
define({
name: 'views/audioPage',
def: function viewsAudioPage() {
'use strict';
var appControl = null,
appControlReplyCallback = null;
... | );
} else { |
<|file_name|>6.py<|end_file_name|><|fim▁begin|># Nov 22, 2014
# This patch is to create all the prep/sample template files and link them in
# the database so they are present for download
from os.path import join
from time import strftime
from qiita_db.util import get_mountpoint
from qiita_db.sql_connection import SQ... |
fp = join(fp_base, '%d_prep_%d_%s.txt' % (pt.study_id, prep_template_id,
strftime("%Y%m%d-%H%M%S")))
pt.to_file(fp) |
<|file_name|>multi_worker_util_test.py<|end_file_name|><|fim▁begin|># Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http:... | job.tasks[0] = "127.0.0.1:1234"
|
<|file_name|>AbstractServicesManagerMBean.java<|end_file_name|><|fim▁begin|>/*
* Licensed to Jasig under one or more contributor license
* agreements. See the NOTICE file distributed with this work
* for additional information regarding copyright ownership.
* Jasig licenses this file to you under the Apache License... |
import org.jasig.cas.services.RegisteredService;
import org.jasig.cas.services.RegisteredServiceImpl;
import org.jasig.cas.services.ServicesManager; |
<|file_name|>dashboard.routes.ts<|end_file_name|><|fim▁begin|>import { Routes } from '@angular/router';
import { LoggedInGuard } from '../common/session/logged-in.guard';
import { DashboardPage } from './dashboard.page';
import { DashboardListPage } from './dashboard-list.page';
import { DashletSettingsPage } from '.... | }
} |
<|file_name|>test_assert_interval_array_equal.py<|end_file_name|><|fim▁begin|>import pytest
from pandas import interval_range
import pandas._testing as tm
@pytest.mark.parametrize(
"kwargs",
[
{"start": 0, "periods": 4},
{"start": 1, "periods": 5},
{"start": 5, "end": 10, "closed": "l... | |
<|file_name|>constants.py<|end_file_name|><|fim▁begin|># $Filename$
# $Authors$
# Last Changed: $Date$ $Committer$ $Revision-Id$
#
# Copyright (c) 2003-2011, German Aerospace Center (DLR)
# All rights reserved.
#
#
#Redistribution and use in source and binary forms, with or without
#modification, are permitte... | # * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
|
<|file_name|>HtmlFieldMigrationTest.java<|end_file_name|><|fim▁begin|>package com.gentics.mesh.core.schema.field;
import static com.gentics.mesh.assertj.MeshAssertions.assertThat;
import static com.gentics.mesh.core.field.FieldSchemaCreator.CREATEBINARY;
import static com.gentics.mesh.core.field.FieldSchemaCreator.CRE... | public void testChangeToDate() throws Exception {
changeType(CREATEHTML, FILL0, FETCH, CREATEDATE, (container, name) -> {
assertThat(container.getDate(name)).as(NEWFIELD).isNotNull(); |
<|file_name|>DatasetValidatorTest.java<|end_file_name|><|fim▁begin|>import com.google.common.collect.MapDifference;
import com.google.common.collect.Maps;
import com.google.common.reflect.TypeToken;
import com.google.gson.*;
import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.io.xml.DomDriver;
impo... |
XStream xstream = new XStream(new DomDriver()); // does not require XPP3 library
String xmlCleansed = xstream.toXML(dataset);
String xmlOriginal = xstream.toXML(datasetOriginal); |
<|file_name|>updatestageresponse.cpp<|end_file_name|><|fim▁begin|>/*
Copyright 2013-2021 Paul Colby
This file is part of QtAws.
QtAws is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, ei... | |
<|file_name|>mux.go<|end_file_name|><|fim▁begin|>/*
* Copyright 2015 Fabrício Godoy
*
* 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
... | rest.cors.CreatePreflight(rest.routes)...)
}
rest.router = mux.NewRouter().StrictSlash(true) |
<|file_name|>somnMesh.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3.3
import somnTCP
import somnUDP
import somnPkt
import somnRouteTable
from somnLib import *
import struct
import queue
import threading
import socket
import time
import random
PING_TIMEOUT = 5
class somnData():
def __init__(self, ID, data):
... | self.pingTimer = threading.Timer(random.randrange(45,90), self._pingRouteTable) |
<|file_name|>fortran_parser_test.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# ParameterWeaver: a code generator to handle command line parameters
# and configuration files for C/C++/Fortran/R/Octave
# Copyright (C) 2013 Geert Jan Bex <geertjan.bex@uhasselt.be>
#
# This program is free software: you can re... | #
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# |
<|file_name|>event.rs<|end_file_name|><|fim▁begin|>use events::VirtualKeyCode;
use winapi;
pub fn vkeycode_to_element(code: winapi::WPARAM) -> Option<VirtualKeyCode> {
match code {
//winapi::VK_LBUTTON => Some(VirtualKeyCode::Lbutton),
//winapi::VK_RBUTTON => Some(VirtualKeyCode::Rbutton),
... | |
<|file_name|>OHLCSeries.js<|end_file_name|><|fim▁begin|><|fim▁hole|> *
* License: www.highcharts.com/license
*
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
*
* */
'use strict';
import H from './Globals.js';
import Point from './Point.js';
import U from './Utilities.js';
var seriesTy... | /* *
*
* (c) 2010-2020 Torstein Honsi |
<|file_name|>character-test.js<|end_file_name|><|fim▁begin|>import Ember from 'ember';
import {
module,
test
} from 'qunit';
import startApp from 'superhero/tests/helpers/start-app';
import characterData from '../fixtures/character';
var application, server;
module('Acceptance: Character', {
beforeEach: functio... |
test('visiting /characters/1009609 shows key events for the character', function(assert) {
assert.expect(2); |
<|file_name|>file.rs<|end_file_name|><|fim▁begin|>//! File struct
/// A file
//TODO: Close on exec
#[derive(Copy, Clone, Debug)]
pub struct File {
/// The scheme that this file refers to<|fim▁hole|> /// If events are on, this is the event ID
pub event: Option<usize>,
}<|fim▁end|> | pub scheme: usize,
/// The number the scheme uses to refer to this file
pub number: usize, |
<|file_name|>sessions.py<|end_file_name|><|fim▁begin|>from core import messages<|fim▁hole|>from core.weexceptions import FatalException
from mako import template
from core.config import sessions_path, sessions_ext
from core.loggers import log, stream_handler
from core.module import Status
import os
import yaml
import g... | |
<|file_name|>index.js<|end_file_name|><|fim▁begin|><|fim▁hole|>module.exports = require('react-native').NativeModules.SuperIDRN;<|fim▁end|> | |
<|file_name|>csvHandler.py<|end_file_name|><|fim▁begin|>import csv
import json
import random
import os
import re
import itertools
import shutil
currentDatabase = ''
def showDatabases():
return (next(os.walk('./db'))[1])
def createDatabase(databaseName):
newDatabaseDirectory = (r'./db/') + databaseName
if not os.p... | if (tableHash[columnToUpdate][str(rowSplitted[i])] == None) or len(tableHash[columnToUpdate][str(rowSplitted[i])]) == 0:
# print("Removed all, proceeding to pop key "+str(rowSplitted[i])) |
<|file_name|>models.py<|end_file_name|><|fim▁begin|># Copyright (c) 2019, CRS4
#
# 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 limitation the righ... | return (self.action_complete_time-self.action_start_time).total_seconds() |
<|file_name|>BinaryPreferencesEditor.java<|end_file_name|><|fim▁begin|>package com.ironz.binaryprefs;
import com.ironz.binaryprefs.cache.candidates.CacheCandidateProvider;
import com.ironz.binaryprefs.cache.provider.CacheProvider;
import com.ironz.binaryprefs.event.EventBridge;
import com.ironz.binaryprefs.exception.T... |
@Override |
<|file_name|>withSignOut.d.ts<|end_file_name|><|fim▁begin|>import * as React from 'react';
interface withSignOutProps {
signOut(): boolean;
}
declare function withSignOut<P extends withSignOutProps>(Component: React.ComponentType<P>): React.FC<P>;<|fim▁hole|><|fim▁end|> | export default withSignOut; |
<|file_name|>abs_indicators.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at ... | |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>use std::io::prelude::*;
use std::net::TcpListener;
use std::net::TcpStream;
fn main() {
let listener = TcpListener::bind("127.0.0.1:7878").unwrap();
for stream in listener.incoming() {
let stream = stream.unwrap();
handle_connection(stream);
... |
stream.read(&mut buffer).unwrap();
|
<|file_name|>setupFormatters.ts<|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 ... | // Add shims for format strings that are deprecated or common typos.
// Temporary solution until performing a db migration to fix this.
.registerValue(',0', getNumberFormatter(',.4~f')) |
<|file_name|>yaml.js<|end_file_name|><|fim▁begin|>"use strict";
const { ParserError } = require("../util/errors");
const yaml = require("js-yaml");
module.exports = {
/**
* The order that this parser will run, in relation to other parsers.
*
* @type {number}
*/
order: 200,
/**
* Whether to allow... | // data is already a JavaScript value (object, array, number, null, NaN, etc.)
return data;
}
} |
<|file_name|>PreKeyUtil.java<|end_file_name|><|fim▁begin|>/**
* Copyright (C) 2013 Open Whisper Systems
*
* 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 version 3 of the License, or... | SignedPreKeyIndex index = JsonUtils.fromJson(reader, SignedPreKeyIndex.class); |
<|file_name|>test_vmops.py<|end_file_name|><|fim▁begin|># Copyright 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http:... | self.image = 'fake_image_id'
@mock.patch.object(volumeops.VolumeOps, "connect_volume",
return_value=("sr", "vdi_uuid")) |
<|file_name|>Footer.js<|end_file_name|><|fim▁begin|>/** @jsx React.DOM */
var Footer =
React.createClass({
shouldComponentUpdate: function() {
return false;
},
render:function(){
return (
<div className="footer">
<p>© Company</p>
</div><|fim▁hole|> });<|fim▁end|... | )
} |
<|file_name|>ParameterisedProcedural.py<|end_file_name|><|fim▁begin|>##########################################################################
#
# Copyright (c) 2009-2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitt... | # notice, this list of conditions and the following disclaimer. |
<|file_name|>Projectile.cpp<|end_file_name|><|fim▁begin|>// Fill out your copyright notice in the Description page of Project Settings.
#include "Projectile.h"
// Sets default values
AProjectile::AProjectile()
{
// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't... | void AProjectile::BeginPlay()
{
Super::BeginPlay();
|
<|file_name|>url_mappings.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
class URLMappings(object):
def __init__(self, src_root, build_dir):
self.map... | |
<|file_name|>PimInterfacesListCommand.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2016-present Open Networking Laboratory
*
* 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
*
* h... | private static final String ROUTE_FORMAT = " %s"; |
<|file_name|>My4FileSystem.java<|end_file_name|><|fim▁begin|>package ftp.v4;
import java.io.IOException;
import java.nio.file.attribute.UserPrincipalLookupService;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import org.apache.sshd.common.file.util.BaseFileSys... | return Collections.unmodifiableSet(new HashSet<String>(Arrays.asList("posix")));
}
@Override |
<|file_name|>bus.js<|end_file_name|><|fim▁begin|>"use strict";
<|fim▁hole|>var EventEmitter = require ('events');
module.exports = new EventEmitter ();<|fim▁end|> | |
<|file_name|>test_validation.py<|end_file_name|><|fim▁begin|>import hashlib
from unittest import TestCase
import uuid
from falcon import request
from stoplight import validate
from stoplight.exceptions import ValidationFailed
from deuce.transport import validation as v
from deuce.transport.wsgi import errors
class ... | |
<|file_name|>user.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
This module implements users.
"""
import os
from persistent import Persistent
import src.core.db as db
import src.core.exc as exc
import src.core.utils as utils
import src.core.security as security
import random
import time
class User(ob... | def login(self, _id, password):
"""
Shorthand function for load, verify_password and load_user_db. |
<|file_name|>float_macros.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/li... | Ok(sig * exp)
}
}
} |
<|file_name|>index.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Radim Rehurek <me@radimrehurek.com>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
import os
from smart_open import smart_open
try:
import cPickle as _pickle
except Im... | else: |
<|file_name|>kinesis.rs<|end_file_name|><|fim▁begin|>#![cfg(feature = "kinesis")]
extern crate rusoto_core;
extern crate rusoto_kinesis;
use rusoto_kinesis::{Kinesis, KinesisClient, ListStreamsInput};
use rusoto_core::{DefaultCredentialsProvider, Region};
use rusoto_core::default_tls_client;
#[test]
fn should_list_s... | client.list_streams(&request).unwrap();
} |
<|file_name|>Asmera.py<|end_file_name|><|fim▁begin|>'''tzinfo timezone information for Africa/Asmera.'''
from pytz.tzinfo import DstTzInfo
from pytz.tzinfo import memorized_datetime as d
from pytz.tzinfo import memorized_ttinfo as i
class Asmera(DstTzInfo):
'''Africa/Asmera timezone definition. See datetime.tzinfo... |
_utc_transition_times = [
d(1,1,1,0,0,0), |
<|file_name|>read_texts.rs<|end_file_name|><|fim▁begin|>extern crate quick_xml;
fn main() {
use quick_xml::events::Event;
use quick_xml::Reader;
let xml = "<tag1>text1</tag1><tag1>text2</tag1>\
<tag1>text3</tag1><tag1><tag2>text4</tag2></tag1>";
let mut reader = Reader::from_str(xml);
... | let mut txt = Vec::new();
let mut buf = Vec::new();
|
<|file_name|>resources.js<|end_file_name|><|fim▁begin|>'use strict';
angular.module('openshiftConsole')
.directive('overviewDeployment', function($location, $timeout, LabelFilter) {
return {
restrict: 'E',
scope: {
// Replication controller / deployment fields
rc: '=',
deployme... | // sub-directive used by the pods directive
return {
restrict: 'E', |
<|file_name|>MyArrayList.java<|end_file_name|><|fim▁begin|>package nl.HAN.ASD.APP.dataStructures;
import com.google.gag.annotation.disclaimer.WrittenWhile;
import java.util.*;
/**
* Created by Pim van Gurp, 9/9/2015.
*/
@SuppressWarnings({"NullableProblems", "ConstantConditions"})
public class MyArrayList<T> imple... | System.arraycopy(old, 0, array, 0, old.length); |
<|file_name|>dep.ts<|end_file_name|><|fim▁begin|>export const fn = (x: number) => { <|fim▁hole|><|fim▁end|> | return 'v1'
} |
<|file_name|>keypair.js<|end_file_name|><|fim▁begin|>/*
* Copyright 2016 Joyent, Inc., 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, includi... | 'unlocked before use.')); |
<|file_name|>qmimetypedata.cpp<|end_file_name|><|fim▁begin|>/****************************************************************************
**
** This file is part of the Qtopia Opensource Edition Package.
**
** Copyright (C) 2008 Trolltech ASA.
**
** Contact: Qt Extended Information (info@qtextended.org)
**
** This file... | {
stream << d->id;
stream << d->defaultApplication.id(); |
<|file_name|>driver_listener.py<|end_file_name|><|fim▁begin|># Copyright 2018 Rackspace, US Inc.
# Copyright 2019 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 Licen... | def handle(self):
# Get the update data |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// Copyright © 2015, Peter Atashian
// Licensed under the MIT License <LICENSE.md>
//! FFI bindings to bcrypt.
#![cfg(windows)]
extern crate winapi;
use winapi::*;
extern "system" {
pub fn BCryptAddContextFunction(
dwTable: ULONG, pszContext: LPCWSTR, dwInter... | hKey: BCRYPT_KEY_HANDLE, phNewKey: *mut BCRYPT_KEY_HANDLE, pbKeyObject: PUCHAR, |
<|file_name|>kana.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: UTF-8 -*-
from __future__ import unicode_literals
from jcconv import kata2hira, hira2kata
from itertools import chain
from printable import PrintableDict, PrintableList
__by_vowels = PrintableDict(**{
u'ア': u'ワラヤャマハナタサカアァ',
... | return True
def __is_kana(char):
return char in KANA |
<|file_name|>filesystem.py<|end_file_name|><|fim▁begin|>"""
This module implement a filesystem storage adapter.
"""
from __future__ import unicode_literals
import errno
import logging
import os
from flask import current_app
from .interface import ImagineAdapterInterface
from PIL import Image
LOGGER = logging.getLogger... | |
<|file_name|>allele.py<|end_file_name|><|fim▁begin|>from collections import defaultdict
from matplotlib import pyplot as plt
from matplotlib.ticker import MultipleLocator
import numpy as np
from msaf.models import Marker
def summarize_alleles2( analytical_sets, temp_dir = None ):
""" return a tuple of (report, pl... | |
<|file_name|>ExplanationDialog.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2005-2011 Sixth and Red River Software, Bas Leijdekkers
*
* 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... | final URL resourceURL = metric.getClass().getResource(resourceName);
textPane.setPage(resourceURL); |
<|file_name|>OutlierTracker.java<|end_file_name|><|fim▁begin|>package edu.colostate.cs.storm.util;
import java.util.HashSet;
import java.util.Set;
/**
* Author: Thilina
* Date: 12/6/14
*/
public class OutlierTracker {
private Set<String> completeSet = new HashSet<String>();
private Set<String> outlierSet =... |
public boolean isMember(String key){
return completeSet.contains(key); |
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
<|fim▁hole|>
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Usuarios',
fields=[
... | from django.db import models, migrations
|
<|file_name|>manni.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
pygments.styles.manni
~~~~~~~~~~~~~~~~~~~~~
A colorful style, inspired by the terminal highlighting style.
This is a port of the style used in the `php port`_ of pygments
by Manni. The style is called 'default' there.
... | |
<|file_name|>cache_generate_metadata.rs<|end_file_name|><|fim▁begin|>use anyhow::Result;
use clap::{App, Arg};
use std::path::Path;
use std::process;
use std::sync::Arc;
use crate::cache::metadata_generator::*;
use crate::io_engine::{AsyncIoEngine, IoEngine, SyncIoEngine};
//------------------------------------------... | |
<|file_name|>LiveTemplateLookupActionProvider.java<|end_file_name|><|fim▁begin|>// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.codeInsight.template.impl;
import com.intellij.codeInsight.CodeInsightBundle;... |
if (templateFromSettings != null) { |
<|file_name|>embedding_in_gtk3.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""
demonstrate adding a FigureCanvasGTK3Agg widget to a Gtk.ScrolledWindow
using GTK3 accessed via pygobject<|fim▁hole|>
from matplotlib.figure import Figure
from numpy import arange, sin, pi
from matplotlib.backends.backend_gtk3agg i... | """
from gi.repository import Gtk |
<|file_name|>bzip2.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# coding: utf-8
from __future__ import division
import sys, os, time, platform, math
from struct import unpack, pack
"""
生成测试数据:
rm test.txt test.txt.bz2
echo 'hello, world(世界)!!!!' > test.txt
bzip2 -z test.txt
解压数据:
python ... | ERROR: type should be large_string, got " https://en.wikipedia.org/wiki/Bzip2\n\n注:" |
<|file_name|>pageobject.js<|end_file_name|><|fim▁begin|>export default (collection, clickable, text) => () => {
return collection('.consul-auth-method-list [data-test-list-row]', {
authMethod: clickable('a'),
name: text('[data-test-auth-method]'),
displayName: text('[data-test-display-name]'),
type: t... | }; |
<|file_name|>context.rs<|end_file_name|><|fim▁begin|>use ::handle::{Handle,HandleMut};
/// A `libgphoto2` library context.
pub struct Context {
context: *mut ::gphoto2::GPContext,
}
impl Context {
/// Creates a new context.
pub fn new() -> ::Result<Context> {
let ptr = unsafe { ::gphoto2::gp_conte... | } |
<|file_name|>empty.ts<|end_file_name|><|fim▁begin|>/*-----------------------------------------------------------------------------
| Copyright (c) 2014-2015, S. Chris Colbert
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|------... | |
<|file_name|>mobilenet_v2_with_lstm.py<|end_file_name|><|fim▁begin|># Explains/tests Issues:
# https://github.com/ray-project/ray/issues/6928
# https://github.com/ray-project/ray/issues/6732
import argparse
from gym.spaces import Discrete, Box
import numpy as np
from ray.rllib.agents.ppo import PPOTrainer
from ray.rl... | # The torch version of MobileNetV2 does channels first.
cnn_shape_torch = (3, 224, 224) |
<|file_name|>loadtransferfunction.py<|end_file_name|><|fim▁begin|># Inviwo Python script
import inviwo <|fim▁hole|><|fim▁end|> |
inviwo.loadTransferFunction("SimpleRaycaster.transferFunction",inviwo.getDataPath() + "transferfunction.itf") |
<|file_name|>iconTag.tsx<|end_file_name|><|fim▁begin|>import React from 'react';
import SvgIcon from './svgIcon';
type Props = React.ComponentProps<typeof SvgIcon>;
const IconTag = React.forwardRef(function IconTag(
props: Props,<|fim▁hole|> <path d="M3.87,5.7A1.81,1.81,0,1,1,5.69,3.89,1.82,1.82,0,0,1,3.87,5.... | ref: React.Ref<SVGSVGElement>
) {
return (
<SvgIcon {...props} ref={ref}> |
<|file_name|>CloudClusterPrinterConfigurationMaterial.py<|end_file_name|><|fim▁begin|>from typing import Optional
from UM.Logger import Logger
from cura.CuraApplication import CuraApplication
from cura.PrinterOutput.Models.MaterialOutputModel import MaterialOutputModel
from .BaseCloudModel import BaseCloudModel
## ... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>import os
import sys
import warnings
import opcode # opcode is not a virtualenv module, so we can use it to find the stdlib
# Important! To work on pypy, this must be a module that resides in the
# lib-python/modified-x.y.z directory
di... | lib_dir = os.path.join(sys.real_prefix, "libs")
if isinstance(real_vars, dict) and 'LIBDIR' not in real_vars: |
<|file_name|>ITCreateDuplicateBucket.java<|end_file_name|><|fim▁begin|>/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to... | // confirm actions drop down menu exists |
<|file_name|>base.py<|end_file_name|><|fim▁begin|># This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will ... | return hashlib.sha1(b'\0'.join(map(encode, args))).hexdigest() |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | default_app_config = 'botManager.apps.BotmanagerConfig' |
<|file_name|>ScoreElementalDef.java<|end_file_name|><|fim▁begin|>package pttravis;
import java.util.List;
public class ScoreElementalDef implements ScoreItems {
public ScoreElementalDef() {
}
@Override
public String getName() {<|fim▁hole|>
@Override
public float score(List<Item> items) {
if( items == null... | return "Elemental Def";
} |
<|file_name|>pipe.d.ts<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | export declare const pipe: (...transformers: Function[]) => Function; |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | """Injection control subpackage.""" |
<|file_name|>GitView.py<|end_file_name|><|fim▁begin|>"""Subclass of GitView, which is generated by wxFormBuilder."""
import wx
from beatle import tran, model, localpath
from beatle.model import git
from beatle.lib import wxx
from beatle.lib.decorators import classproperty
from beatle.lib.handlers import Identifiers
... | self.BindSpecial(wx.EVT_UPDATE_UI, self.OnUpdateAddRemote, id=self._addRemote)
self.BindSpecial(wx.EVT_MENU, self.OnAddRemote, id=self._addRemote) |
<|file_name|>topLevelLambda.js<|end_file_name|><|fim▁begin|>//// [topLevelLambda.ts]
module M {
var f = () => {this.window;}
}
<|fim▁hole|> var _this = this;
var f = function () {
_this.window;
};
})(M || (M = {}));<|fim▁end|> |
//// [topLevelLambda.js]
var M;
(function (M) {
|
<|file_name|>test_view.py<|end_file_name|><|fim▁begin|>from unittest import skip
from django.shortcuts import resolve_url as r
from django.test import TestCase
@skip
class BotViewTest(TestCase):
def setUp(self):<|fim▁hole|> fake_message = {
'data': [{
'entry': [
... | |
<|file_name|>pr86159.C<|end_file_name|><|fim▁begin|>// { dg-do compile }<|fim▁hole|>{
vec x, zero{};
vec one = zero + 1;
return x < zero ? one : zero;
}<|fim▁end|> | // { dg-options "-O -w -Wno-psabi" }
typedef int vec __attribute__((vector_size(32)));
vec fn1() |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>$context.section('Простое связывание', 'Иерархическое связывание с данными с использованием простых и составных ключей');
//= require data-basic
$context.section('Форматирование', 'Механизм одностороннего связывания (one-way-binding)');
//= require data-format
$context... | //= require data-binding
$context.section('Динамическое связывание', 'Управление коллекцией элементов виджета через источник данных');
//= require data-dynamic
$context.section('Общие данные'); |
<|file_name|>publish.js<|end_file_name|><|fim▁begin|>/* */
"use strict";
var Subject_1 = require('../Subject');
var multicast_1 = require('./multicast');
function publish(selector) {
return selector ? multicast_1.multicast.call(this, function() {<|fim▁hole|><|fim▁end|> | return new Subject_1.Subject();
}, selector) : multicast_1.multicast.call(this, new Subject_1.Subject());
}
exports.publish = publish; |
<|file_name|>drop-order.rs<|end_file_name|><|fim▁begin|>// run-pass
//! Test that let bindings and destructuring assignments have consistent drop orders
#![feature(destructuring_assignment)]
#![allow(unused_variables, unused_assignments)]
use std::cell::RefCell;
thread_local! {
static DROP_ORDER: RefCell<Vec<us... | _ = DropRecorder(1);
_val = DropRecorder(2);
(x, _) = (DropRecorder(3), DropRecorder(4));
drop(DropRecorder(5)); |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | from .fcn import FCN |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.