prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>mq_change_qnum.py<|end_file_name|><|fim▁begin|>import logging<|fim▁hole|>
import aexpect
from autotest.client import utils
from autotest.client.shared import error
from virttest import utils_net
from virttest import utils_test
from virttest import utils_misc
@error.context_aware
def run(test, params, e... | import re |
<|file_name|>dht22.rs<|end_file_name|><|fim▁begin|>// Zinc, the bare metal stack for rust.
// Copyright 2014 Vladimir "farcaller" Pouzanov <farcaller@gmail.com>
//
// 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 c... | DHT22 {
gpio: gpio,
timer: timer,
} |
<|file_name|>snippetedMessages.js<|end_file_name|><|fim▁begin|>/* global SnippetedMessages */
Template.snippetedMessages.helpers({
hasMessages() {
return SnippetedMessages.find({ snippeted:true, rid: this.rid }, { sort: { ts: -1 } }).count() > 0;
},
messages() {
return SnippetedMessages.find({ snippeted: true, r... | this.autorun(function() {
const data = Template.currentData();
self.subscribe('snippetedMessages', data.rid, self.limit.get(), function() {
if (SnippetedMessages.find({ snippeted: true, rid: data.rid }).count() < self.limit.get()) { |
<|file_name|>test-emit-init.js<|end_file_name|><|fim▁begin|>'use strict';
const common = require('../common');
const assert = require('assert');
const async_hooks = require('async_hooks');
const initHooks = require('./init-hooks');
// Verify that if there is no registered hook, then those invalid parameters
// won't ... | assert.strictEqual(resource.key, expectedResource.key);
})
}); |
<|file_name|>List.tsx<|end_file_name|><|fim▁begin|>import React, { MouseEvent, PureComponent, ReactElement } from 'react';
import { IProject } from 'Projects';
import Tile from '../Tile';
export default class List extends PureComponent<{
projects: IProject[],
olderCommercial: boolean,
olderNoncommercial: ... | <div className="controls aligned-center">
<button
className="button button-clear" |
<|file_name|>sensor.py<|end_file_name|><|fim▁begin|>"""Support for Freedompro sensor."""
from homeassistant.components.sensor import (
SensorDeviceClass,
SensorEntity,
SensorStateClass,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import LIGHT_LUX, PERCENTAGE, TEMP_CELSIUS... | DEVICE_CLASS_MAP = {
"temperatureSensor": SensorDeviceClass.TEMPERATURE,
"humiditySensor": SensorDeviceClass.HUMIDITY,
"lightSensor": SensorDeviceClass.ILLUMINANCE, |
<|file_name|>banning_queue.rs<|end_file_name|><|fim▁begin|>// Copyright 2015, 2016 Ethcore (UK) Ltd.
// This file is part of Parity.
// Parity 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 ... | }
// Check recipient
if let Action::Call(recipient) = transaction.action { |
<|file_name|>comm.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/L... | error!("{:?}", y);
assert_eq!(y, 10);
}
|
<|file_name|>bitcoin_af_ZA.ts<|end_file_name|><|fim▁begin|><TS language="af_ZA" version="2.0">
<context>
<name>AddressBookPage</name>
<message>
<source>Create a new address</source>
<translation>Skep 'n nuwe adres</translation>
</message>
<message>
<source>Copy the currently sele... | <source>Wallet passphrase was successfully changed.</source> |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>//lol jsut initalize with `cargo new "./repo_name" --bin`!
fn main() {<|fim▁hole|><|fim▁end|> | println!("Hello, world!");
} |
<|file_name|>Silver.java<|end_file_name|><|fim▁begin|>public class Silver extends Piece {
public Silver(int owner) {
super(owner);
setSymbol("S");
setType("Silver");
}
public boolean canMove(Square from, Square to, Board b) {
if(promoted) {
//Gold movement code
if((Math.abs(from.getR() - to.getR... | if(to.getPiece() != null) {
if(from.getPiece().getOwner() == to.getPiece().getOwner()) {
return false;
} |
<|file_name|>PeriodicTable.py<|end_file_name|><|fim▁begin|># $Id$
#
# Copyright (C) 2001-2006 greg Landrum and Rational Discovery LLC
#
# @@ All Rights Reserved @@
# This file is part of the RDKit.
# The contents are covered by the terms of the BSD license
# which is included in the file license.txt, found at the ... | # where values are not known, None has been inserted
hallKierAlphas = {
'H': [0.0, 0.0, 0.0], # removes explicit H's from consideration in the shape |
<|file_name|>async1.js<|end_file_name|><|fim▁begin|>var fs = require('fs');
fs.readFile('data/file1.txt', function (err, data) {
console.log('Second');
});
<|fim▁hole|><|fim▁end|> | console.log('First'); |
<|file_name|>DBManager.java<|end_file_name|><|fim▁begin|>package com.zaaach.citypicker.db;
import android.content.Context;<|fim▁hole|>import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.Environment;
import com.zaaach.citypicker.model.City;
import java.io.File;
import java... | |
<|file_name|>bundle.py<|end_file_name|><|fim▁begin|># SPDX-License-Identifier: Apache-2.0
# Copyright Contributors to the Rez Project
'''
Bundle a context and its packages into a relocatable dir.
'''
from __future__ import print_function
import os
import os.path
import sys
def setup_parser(parser, completions=Fals... | |
<|file_name|>test_verifytree.py<|end_file_name|><|fim▁begin|>import verifytree.VerifyTree as P
import pytest
import os
import logging
import smtplib
from mock import Mock
from mock import patch, call<|fim▁hole|>from mock import PropertyMock
class Testverifytree:
def setup(self):
self.p = P.VerifyTree()<... | from mock import MagicMock |
<|file_name|>ipc_lista4.01.py<|end_file_name|><|fim▁begin|>#
#Programa Lista 4, questão 1;
#Felipe Henrique Bastos Costa - 1615310032;<|fim▁hole|>
lista = []#lista vazia;
cont1 = 0#contador do indice;
cont2 = 1#contador da posição do numero, se é o primeiro, segundo etc;
v = 5#representaria o len da lista;
while(cont... | #
#
#
# |
<|file_name|>Device.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2013 Anton Tananaev (anton.tananaev@gmail.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.a... |
public long getDeviceModelId() {
return deviceModelId;
} |
<|file_name|>builder_test.py<|end_file_name|><|fim▁begin|># coding=utf-8
# Copyright 2022 The Deeplab2 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
#<|fim▁hole|># http://www.a... | |
<|file_name|>FileStoreUtils.java<|end_file_name|><|fim▁begin|>package net.minecartrapidtransit.path.launcher;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
public class FileStoreUtils {
private String version;
public FileStoreUtils(String versionFile)... | |
<|file_name|>tabset-config.ts<|end_file_name|><|fim▁begin|>import {Injectable} from '@angular/core';
/**
* Configuration service for the NgbTabset component.
* You can inject this service, typically in your root component, and customize the values of its properties in
* order to provide default values for all the t... | } |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>extern crate stopwatch;
use stopwatch::{Stopwatch};
fn main() {
let timer = Stopwatch::start_new();
//digits are stored in reverse order (least significant first) as an optimization
match expand(196, 100000) {
Ok(iter) => println!("converged after {... | |
<|file_name|>sunset.js<|end_file_name|><|fim▁begin|>/*
Highcharts JS v5.0.13 (2017-07-27)
(c) 2009-2017 Highsoft AS
<|fim▁hole|>(function(a){"object"===typeof module&&module.exports?module.exports=a:a(Highcharts)})(function(a){a.theme={colors:["#FDD089","#FF7F79","#A0446E","#251535"],colorAxis:{maxColor:"#60042E",mi... | License: www.highcharts.com/license
*/ |
<|file_name|>match_hospitals.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python3
# -*- coding: utf-8 -*-
from pprint import pprint
import re
from fileinput import input
import csv
from fuzzywuzzy import fuzz
from fuzzywuzzy import process
articles = ['the', 'a']
prepositions = ['at', 'of']
hospital_words = ['ho... | words = line.split()
return Hospital(" ".join(words[1:-2]), " ".join(words[-2:])) |
<|file_name|>trust.py<|end_file_name|><|fim▁begin|>#
# Copyright 2014 eNovance
#
# 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 r... | from ceilometer.alarm.notifier import rest |
<|file_name|>filter.rs<|end_file_name|><|fim▁begin|>use htslib::bam::record::Record;
pub trait RecordCheck {
fn valid(&self, rec: &Record) -> bool;
fn vir_pos(&self, rec: &Record) -> i32;
}
pub struct SingleChecker {
pub tail_edge: bool,
pub exact_length: bool,
pub read_length: usize,
pub min_... | |
<|file_name|>forms.py<|end_file_name|><|fim▁begin|>from django import forms
from . import models
class GroupForm(forms.ModelForm):<|fim▁hole|> class Meta:
model = models.Group
fields = '__all__'<|fim▁end|> | |
<|file_name|>test_connect_app.py<|end_file_name|><|fim▁begin|># coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from tests import IntegrationTestCase
from tests.holodeck import Request
from twilio.base.exceptions import TwilioException
from twilio.h... | self.holodeck.assert_has_request(Request( |
<|file_name|>network.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from frame import DStatFrame
from shee.util import get_result_dir_name
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
class DStatNetwork(DStatFrame):
def __init__(self, filename, frame=None, et... |
hours = mdates.HourLocator() # every year |
<|file_name|>pickle.py<|end_file_name|><|fim▁begin|># (c) 2017, Brian Coca
# (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCU... | type: list
env:
- name: ANSIBLE_CACHE_PLUGIN_CONNECTION
ini: |
<|file_name|>AcousticModel.py<|end_file_name|><|fim▁begin|># coding=utf-8
"""
Based on the paper:
http://arxiv.org/pdf/1601.06581v2.pdf
And some improvements from :
https://arxiv.org/pdf/1609.05935v2.pdf
This model is:
Acoustic RNN trained with ctc loss
"""
import tensorflow as tf
from tensorflow.python.client im... |
# Label tensor must be provided as a sparse tensor. |
<|file_name|>test_default_bytes.rs<|end_file_name|><|fim▁begin|>// Copyright 2014-2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.ap... |
macro_rules! regex_new {
($re:expr) => {{
use regex::bytes::Regex; |
<|file_name|>puzzles.js<|end_file_name|><|fim▁begin|>team1 = {"name" : "Iron Patriot",
"key": "MURICA",
"puzzles" :
[{"idPz": 0}, // Breakfast
{"idPz": 1}, // Blueprints, all
{"idPz": 2}, // Morning Rotation # 1
// {"idPz": 14}, // Morning Rotation # 1 Item! (to alieviat... | |
<|file_name|>MappingWindow.cpp<|end_file_name|><|fim▁begin|>// Copyright 2017 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.
#include <QComboBox>
#include <QDialogButtonBox>
#include <QGroupBox>
#include <QHBoxLayout>
#include <QMessageBox>
#include <QPushButton>
#include ... | |
<|file_name|>test_email.py<|end_file_name|><|fim▁begin|><|fim▁hole|>#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this software.
#----------------------------------------------------------... | #-----------------------------------------------------------------------------
# Copyright (c) 2013, PyInstaller Development Team. |
<|file_name|>gui_renderer.rs<|end_file_name|><|fim▁begin|>use ::resources::{Texture, Font};
use ::rendering::{DrawBatch, SpriteVertex};
#[derive(Clone)]
pub struct Image {
texture: Texture,
x: f32,
y: f32,
width: f32,
height: f32,
}
impl Image {
pub fn new(texture: Texture, x: f32, y: f32, wid... | let indices: [u32; 6] = [0, 2, 1, 1, 2, 3];
batch.add_font_triangles(self.font.atlas.clone(), &vertices, &indices);
} |
<|file_name|>jwt_hmac.pb.go<|end_file_name|><|fim▁begin|>// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0... | }
|
<|file_name|>ElementaryFluxVectors.py<|end_file_name|><|fim▁begin|>import pandas as pd
import numpy as np
import cobra
from pyefm.ElementaryFluxModes import EFMToolWrapper
from tqdm import tqdm
class EFVWrapper(EFMToolWrapper):
def create_matrices(self, extra_g=None, extra_h=None):
""" Initialize the aug... | if val.issuperset(set_dict[key]):
break
else:
is_support_minimal.append(this_key) |
<|file_name|>work_title_v30_rc2.py<|end_file_name|><|fim▁begin|># coding: utf-8
"""
ORCID Member
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: Latest
Generated by: https://github.com/swagger-api/swagger-c... | self._translated_title = translated_title
|
<|file_name|>test-connections.js<|end_file_name|><|fim▁begin|>/*global describe, beforeEach, it*/
'use strict';
var assert = require('yeoman-generator').assert;
var helper = require('./helper');
describe('mcap:connections', function () {
beforeEach(function (done) {
var answers = {
name: 'MyApp'
};
... | password: 'root'
}
}; |
<|file_name|>update-check.js<|end_file_name|><|fim▁begin|>// # Update Checking Service
//
// Makes a request to Ghost.org to check if there is a new version of Ghost available.
// The service is provided in return for users opting in to anonymous usage data collection.
//
// Blog owners can opt-out of update checks by ... | }).catch(updateCheckError);
}
}
|
<|file_name|>ServerResource.java<|end_file_name|><|fim▁begin|>/*******************************************************************************
* Copyright 2013-2015 alladin-IT GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.... | throws JsonParseException
{ |
<|file_name|>hypervisor_client.py<|end_file_name|><|fim▁begin|># Copyright 2013 IBM Corporation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# htt... | tenant_name)
self.service = self.config.compute.catalog_type |
<|file_name|>time_start.rs<|end_file_name|><|fim▁begin|>use std::sync::mpsc::{sync_channel, SyncSender};
use std::thread;
use timer::TimeOut;
use state::State;
use types::Cmd;
pub fn time_start(state: &mut State, cmd_tx: SyncSender<Cmd>) {
let c = state.search_state.as_ref()
.expect("invalid sear... | if recv_res.is_ok() {
cmd_tx.send(Cmd::Stop).unwrap(); |
<|file_name|>CreateLargeModelExample.java<|end_file_name|><|fim▁begin|>package org.mastodon.tracking.mamut.trackmate.wizard;
import org.mastodon.mamut.model.Link;
import org.mastodon.mamut.model.Model;
import org.mastodon.mamut.model.Spot;
import org.mastodon.model.AbstractModelImporter;
public class CreateLargeModel... | model.getGraph().addVertex( daughter ).init( frame, pos, cov );
model.getGraph().addEdge( previousSpot, daughter, link ).init(); |
<|file_name|>ShowsFragment_OnQueryTextChangeTest.java<|end_file_name|><|fim▁begin|>package com.mgaetan89.showsrage.fragment;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import java.util.Arrays;
import java.util.Collec... | {""}, |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>import uuid
from django.db import models
from django.conf import settings
from django.contrib.auth.models import AbstractUser
from django.contrib.auth.models import BaseUserManager
from django.utils import timezone
from accelerator_abstract.models import BaseUserRol... | }
self._get_member()
title = self.team_member.title if self.team_member else ""
company = self.startup.name if self._get_startup() else None |
<|file_name|>service_control.go<|end_file_name|><|fim▁begin|>// Copyright 2018 The Kubeflow 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/licens... | func (r RealServiceControl) CreateServices(namespace string, service *v1.Service, object runtime.Object) error {
return r.createServices(namespace, service, object, nil) |
<|file_name|>gevent_scheduler.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from gevent import Greenlet
from gevent import sleep
from .base import SchedulerMixin
class Scheduler(SchedulerMixin, Greenlet):
"""
Gevent scheduler. Only replaces the sleep method for correct<|fim▁hole|> context switc... | |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>module.exports = {
selector: '.lift-status',
parse: {
name: '1/0',
status: {
child: 0,
attribute: 'class',<|fim▁hole|><|fim▁end|> | fn: s => s.split(' ').pop()
}
}
}; |
<|file_name|>create_project_cmd.go<|end_file_name|><|fim▁begin|>package mccli
import (
"fmt"
"os"
"path/filepath"
"github.com/codegangsta/cli"
"github.com/materials-commons/mcstore/cmd/pkg/mc"
)
var (
createProjectCommand = cli.Command{
Name: "project",
Aliases: []string{"proj", "p"},
Usage: "Creat... | |
<|file_name|>issue-75982.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>const _: () = {
#[macro_export]
macro_rules! first_macro {
() => {}
}
mod foo {
#[macro_export]
macro_rules! second_macro {
() => {}
}
}
};<|fim▁end|> | |
<|file_name|>workloadItemResourceList.js<|end_file_name|><|fim▁begin|>/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause inc... | /**
* Defines the metadata of WorkloadItemResourceList
*
* @returns {object} metadata of WorkloadItemResourceList |
<|file_name|>server.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, division, print_function
from collections import Iterator
from flask import Flask, request, jsonify, json
from functools import partial, wraps
from .index import parse_index
class Server(object):
__slots__ = 'app', 'datas... | |
<|file_name|>doc.go<|end_file_name|><|fim▁begin|>//
// go-rencode v0.1.8 - Go implementation of rencode - fast (basic)
// object serialization similar to bencode
// Copyright (C) 2015~2019 gdm85 - https://github.com/gdm85/go-rencode/
// This program is free software; you can redistribute it and/or
// ... | Usage |
<|file_name|>paragraph.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division, print_function, unicode_literals
import re
<|fim▁hole|>
HEADINGS_PATTERN = re.compile(r"\bh\d\b")
class Paragraph(object):
"""Object representing one block of t... | from .utils import normalize_whitespace |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
//! SPDM protocol messages.
use crate::io::Read;
use crate::io::ReadInt as _;
use crate::io::Write;
use crate::protoco... | |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import patterns, include, url<|fim▁hole|>from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
url(r'^$', 'core.views.empresta_list_view', name='home'),
# url(r'^blog/', include('blog.urls')),
... | |
<|file_name|>test.ts<|end_file_name|><|fim▁begin|>/// <reference path="typings/tsd.d.ts" />
var plugins = {
beautylog: require("beautylog")("os"),
gulp: require("gulp"),
jade: require("gulp-jade"),
util: require("gulp-util"),
vinylFile: require("vinyl-file"),
jsonjade: require("./index.js"),
... |
var jadeTemplate = plugins.vinylFile.readSync("./test/test.jade");
var noJadeTemplate = {} |
<|file_name|>radio-change.ts<|end_file_name|><|fim▁begin|>export {<|fim▁hole|><|fim▁end|> | SkyRadioChange
} from '@skyux/forms/modules/radio/types/radio-change'; |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>#[macro_use]
extern crate serde_derive;
extern crate chrono;
extern crate hyper;
extern crate hyper_native_tls;
extern crate serde_json;
pub mod types;
pub use types::*;
use std::io::Read;
use hyper::Client;
use hyper::client::RequestBuilder;
use hyper::net::HttpsCon... | println!(
"{0:<50} | {1:<10} | {2:<10} | {3:<10} | {4:<10}", |
<|file_name|>molt_app.py<|end_file_name|><|fim▁begin|>"""Molt Web API with Interface."""
import re
import redis
import docker
import subprocess
import os
import shlex
import requests
import sys
import argparse
from flask import Flask, Response, render_template, abort, request
from molt import Molt, MoltError
app = Fl... | if event != "pull_request":
return "ok", 200
elif req["action"] not in {"opened", "synchronize"}:
return "ok", 200 |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|># Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.<|fim▁hole|>#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | # You may obtain a copy of the License at |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>###################################################################
#
# Copyright (c) 2011 Canonical Ltd.
# Copyright (c) 2013 Miing.org <samuel.miing@gmail.com>
#
# This software is licensed under the GNU Affero General Public
# License version 3 (AGP... | |
<|file_name|>industry.js<|end_file_name|><|fim▁begin|>const industry = [
{
"name": "金融",
"children": [
{ "name": "银行" },
{ "name": "保险" },
{ "name": "证券公司" },
{ "name": "会计/审计" },
{ "name": "其它金融服务" }
]
},
{
"name": "专业服务",
"children": [
... | ];
export default industry; |
<|file_name|>Menu-test.js<|end_file_name|><|fim▁begin|>import React from 'react';
import ReactDOMServer from 'react-dom/server';
import Menu from '../Menu';
describe('Pure', () => {
describe('Menu.ItemLabel', () => {
it('should be: <span>OK</span>', () => {
const h = ReactDOMServer.renderToStaticMarkup(<... | '<ul class="pure-menu-list">',
'<li class="pure-menu-item"><span>Sub1</span></li>', |
<|file_name|>endpoint.go<|end_file_name|><|fim▁begin|>package connectivity
import (
"encoding/xml"
"fmt"
"io/ioutil"
"os"
"strings"
)
// Load endpoints from endpoints.xml or environment variables to meet specified application scenario, like private cloud.
type ServiceCode string
const (<|fim▁hole|> VPCCode ... | ECSCode = ServiceCode("ECS")
ESSCode = ServiceCode("ESS")
RAMCode = ServiceCode("RAM") |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import os
from collections import defaultdict
from django.conf import settings
from django.contrib import messages
from django.core.paginator import Paginator, InvalidPage, EmptyPage
from django.core.urlresolvers import reverse
from django.db.models import Count, Q
fr... | resource.study_time_unit = form.cleaned_data.get(
"study_time_unit")
resource.attribution = form.cleaned_data.get("attribution") |
<|file_name|>sigref_util.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright 2015 Formal Methods and Tools, University of Twente
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* htt... | /* Calculate random height */
DECLARE_THREAD_LOCAL(thread_rng, uint64_t);
|
<|file_name|>cell.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
This module defines how cells are stored as tunacell's objects
"""
from __future__ import print_function
import numpy as np
import warnings
import treelib as tlib
from tunacell.base.observable import Observable, Func... | 2. when data has been used from one daughter cell, concatenate
the current cell's evaluated data to it.
|
<|file_name|>ConvertingPresentationWithNotesToTiff.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved.
*
* This file is part of Aspose.Slides. The source code in this file<|fim▁hole|>
package programmersguide.workingwithpresentation.convertingpresentationwithnotestotiff.... | * is only intended as a supplement to the documentation, and is provided
* "as is", without warranty of any kind, either expressed or implied.
*/ |
<|file_name|>paging_schema.py<|end_file_name|><|fim▁begin|>from marshmallow import Schema, fields, post_dump
class BasePaging(Schema):
has_next = fields.Boolean()
has_prev = fields.Boolean()
next_num = fields.Integer()
prev_num = fields.Integer()
page = fields.Integer()
pages = fields.Integer(... | return type("{}Paging".format(itemsCls.__class__.__name__),
(BasePaging, ), dict(items=field_cls(itemsCls, many=True))) |
<|file_name|>mapper1.py<|end_file_name|><|fim▁begin|><|fim▁hole|> data = line.strip().split(" ")
if len(data) == 10:
page = data[6]
ip_address = data[0]
print "{0}\t{1}".format(page, ip_address)<|fim▁end|> | import sys
for line in sys.stdin: |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>extern crate natural_constants;
#[test]
fn test_math() {
use natural_constants::math::*;
println!("{}", golden_ratio)
}
<|fim▁hole|>fn test_conversion() {
use natural_constants::conversion::*;
let mass_in_g = 50_000.0; // 50 kg
assert_eq!(to_kilo(m... | #[test] |
<|file_name|>app.js<|end_file_name|><|fim▁begin|>angular.module('EggApp', ['ngRoute'], function($routeProvider) {
$routeProvider
.when('/', {<|fim▁hole|> templateUrl: '/app/view/show.html',
controller: 'ShowController'
})
.otherwise({
redirectTo: '/'
... | templateUrl: '/app/view/search.html',
controller: 'SearchController'
})
.when('/show/:id', { |
<|file_name|>best-time-to-buy-and-sell-stock-ii.py<|end_file_name|><|fim▁begin|># Time: O(n)
# Space: O(1)
#
# Say you have an array for which the ith element is
# the price of a given stock on day i.
#
# Design an algorithm to find the maximum profit.
# You may complete as many transactions as you like
# (ie, buy ... | class Solution:
# @param prices, a list of integer
# @return an integer
def maxProfit(self, prices): |
<|file_name|>vec-must-not-hide-type-from-dropck.rs<|end_file_name|><|fim▁begin|>// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// ht... | self.count = 0;
}
} |
<|file_name|>Matricula.java<|end_file_name|><|fim▁begin|>package br.ufrj.g2matricula.domain;
import org.springframework.data.elasticsearch.annotations.Document;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.io.Serializable;
import java.util.Objects;
import br.ufrj.g2matricula.domain.... | public void setStatus(MatriculaStatus status) {
this.status = status;
}
|
<|file_name|>actual.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | fn() => x |
<|file_name|>ImageQuestion.java<|end_file_name|><|fim▁begin|>package model.question;
import model.enums.QuestionTypes;
public class ImageQuestion implements QuestionIF {
private String imagePath;
private char[] answer;
private QuestionTypes type;
public ImageQuestion(String imagePath, char[] answer,... | @Override
|
<|file_name|>statics.rs<|end_file_name|><|fim▁begin|>// This test case tests the incremental compilation hash (ICH) implementation
// for statics.
// The general pattern followed here is: Change one thing between rev1 and rev2
// and make sure that the hash has changed, then change nothing between rev2 and
// rev3 and... | |
<|file_name|>out-of-stack-managed-box.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.<|fim▁hole|>// option. This file may not be copied, modified, or distributed
// except a... | //
// 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 |
<|file_name|>testExpressionsApi.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
/*******************************************************************************
* Copyright (c) cortical.io GmbH. All rights reserved.
*
* This software is confidential and proprietary information.
* You shall use it only... | self.assertGreater(len(c0.fingerprint.positions), 100) |
<|file_name|>CmdFormat.py<|end_file_name|><|fim▁begin|>import ctypes
import os
STD_INPUT_HANDLE = -10
STD_OUTPUT_HANDLE= -11
STD_ERROR_HANDLE = -12
<|fim▁hole|>FOREGROUND_GREEN= 0x02 # text color contains green.
FOREGROUND_RED = 0x04 # text color contains red.
FOREGROUND_INTENSITY = 0x08 # text color is intensi... | FOREGROUND_BLACK = 0x0
FOREGROUND_BLUE = 0x01 # text color contains blue.
|
<|file_name|>mgcwork.go<|end_file_name|><|fim▁begin|>// Copyright 2009 The Go 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 runtime
import "unsafe"
const (
_Debugwbufs = true // if true check wbufs consistency
_Work... | wbuf.checknonempty()
w.wbuf = wbufptrOf(wbuf)
} |
<|file_name|>endpoint-service-replace.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from optparse import OptionParser
import getpass
import os
import sys
import yaml
possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
os.pardir,
... | |
<|file_name|>issue-21202.rs<|end_file_name|><|fim▁begin|>// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/lic... | |
<|file_name|>in_flight_requests.rs<|end_file_name|><|fim▁begin|>use crate::{
context,
util::{Compact, TimeUntil},
PollIo, Response, ServerError,
};
use fnv::FnvHashMap;
use futures::ready;
use log::{debug, trace};
use std::{
collections::hash_map,
io,
task::{Context, Poll},
};
use tokio::sync::o... | }
#[derive(Debug)] |
<|file_name|>MapsActivity.java<|end_file_name|><|fim▁begin|>/*
* MapsActivity
*
* Version 1.0
*
* November 12, 2017
*
* Copyright (c) 2017 Team NOTcmput301, CMPUT301, University of Alberta - All Rights Reserved
* You may use, distribute, or modify this code under terms and conditions of the Code of Student Beha... | import com.google.gson.reflect.TypeToken;
|
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
import os
from os import listdir
from os.path import isfile, join
import random
import datetime
def files_in_dir(directory):
"""
:param directory: The directory
... |
app = Flask(__name__)
#app.config['CSRF_ENABLED'] = True |
<|file_name|>integration_common.ts<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {NgLocalization} from '@angular/common';
impo... | import {ComponentFixture} from '@angular/core/testing'; |
<|file_name|>inquiry.py<|end_file_name|><|fim▁begin|>import gtk
import highgtk.entity
import highgtk.present.default.layout
def add (inquiry):
window = getattr (inquiry, "present_window", None)
if window is None:
inquiry.present_window = gtk.Dialog()
title = getattr (inquiry, "title", None)
... | inquiry.present_window.set_title (title)
inquiry.present_window.set_position (gtk.WIN_POS_CENTER)
inquiry.present_layout = highgtk.present.default.layout.get_layout (inquiry.data) |
<|file_name|>vcstagger.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# Copyright 2015-2016 The Meson development team
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.<|fim▁hole|># Unless required by applicable law or agreed t... | # You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
|
<|file_name|>dashboard.config.js<|end_file_name|><|fim▁begin|>config.$inject = [ '$stateProvider' ];
<|fim▁hole|> .state('main.admin-dashboard', {
url: '/inicio',
templateUrl: 'templates/components/main/dashboard/admin-dashboard.html',
controller: 'AdminDashboardController as vm',
onEnter: onStateEnter
}... | function config ($stateProvider) {
$stateProvider
|
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>from django.core.cache import cache
from django.conf import settings
from django.template.loader import render_to_string
from tendenci.apps.navs.cache import NAV_PRE_KEY
def cache_nav(nav, show_title=False):
"""
Caches a nav's rendered html code
"""
... | """ |
<|file_name|>conftest.py<|end_file_name|><|fim▁begin|>import pytest
import httpretty
import logging
class callcounted(object):
"""Decorator to determine number of calls for a method"""
def __init__(self,method):
self.method=method
self.counter=0
def __call__(self,*args,**kwargs):
... | |
<|file_name|>taskexp.py<|end_file_name|><|fim▁begin|>#
# BitBake Graphical GTK based Dependency Explorer
#
# Copyright (C) 2007 Ross Burton
# Copyright (C) 2007 - 2008 Richard Purdie
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License ve... | flags=Gtk.DialogFlags.MODAL|Gtk.DialogFlags.DESTROY_WITH_PARENT)
bardialog.set_default_size(400, 50)
box = bardialog.get_content_area() |
<|file_name|>pyunit_vec_show.py<|end_file_name|><|fim▁begin|>import sys
sys.path.insert(1, "../../")
import h2o
def vec_show(ip,port):
# Connect to h2o
h2o.init(ip,port)
iris = h2o.import_frame(path=h2o.locate("smalldata/iris/iris_wheader.csv"))
print "iris:"
iris.show()
#####################... | res3.show()
iris[2].show() |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>macro_rules! u8_enum {
{
$name: ident {
$($field_name: ident = $value: expr),+,
}
} => {
#[derive(PartialEq, Eq, Clone, Copy, Debug)]
pub enum $name {
$(
$field_name = $value,
)+
... | match v {
$(
$value => $name::$field_name
),+, |
<|file_name|>value.rs<|end_file_name|><|fim▁begin|>/* This module collects value functions. */
use std::str::FromStr;
use game;
use game::{LineState, Position3, Position2};
#[derive(Clone, Copy, Debug)]
pub enum Simple {
Subsets,
WinOnly,
}
impl Simple {
pub fn value_of(self, state: &game::State, my_col... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.