prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>SignalCellular2BarTwoTone.js<|end_file_name|><|fim▁begin|>import React from 'react'; import createSvgIcon from './utils/createSvgIcon'; <|fim▁hole|>, 'SignalCellular2BarTwoTone');<|fim▁end|>
export default createSvgIcon( <React.Fragment><path fill="none" d="M0 0h24v24H0V0z" /><g><path fillOpacity=".3" d="M2 22h20V2L2 22z" /><path d="M14 10L2 22h12V10z" /></g></React.Fragment>
<|file_name|>vm-to-zones.test.js<|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/. * * Copyright (c) 2015, Joyent, Inc. */ var test ...
nics: [
<|file_name|>miscdefs.py<|end_file_name|><|fim▁begin|># # ## # ## # ## # ## # ## # ## # ## # ## # ## # ## # ## # ## # ## # ## # #~ This file is part of NZBmegasearch by pillone. #~ #~ NZBmegasearch is free software: you can redistribute it and/or modify #~ it under the terms of the GNU General Public License as pu...
return decorated
<|file_name|>gen_parser.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python import datetime import sys import textwrap import common from xml.dom import pulldom PARSER = """\ /** * Copyright 2009 Joe LaPenna */ package com.joelapenna.foursquare.parsers; import com.joelapenna.foursquare.Foursquare; import com.joel...
* @param <T>
<|file_name|>bigrig_tests.js<|end_file_name|><|fim▁begin|>'use strict'; /* global describe, it */ var fs = require('fs'); var expect = require('chai').expect; var bigrig = require('../'); describe('Big Rig', function () { it ('throws if no processes are found', function () { expect(function () { bigrig...
var jsonData = bigrig.analyze(data);
<|file_name|>Body.cpp<|end_file_name|><|fim▁begin|>#include "Body.h" vec_f CalculateCenterOfMass(nz::BodyPart* polygon) { switch (polygon->Type) { case nz::ShapeType::Polygon: { vec_f com; auto poly = polygon->Polygon; int count = poly->Count(); for (int i = 0; i < count; ++i) { vec_f vertex = poly->A...
<|file_name|>0002_dispensed.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('stats', '0001_initial'), ] operations = [ migrations.CreateModel...
}, bases=(models.Model,), ), ]
<|file_name|>create_nested_task.py<|end_file_name|><|fim▁begin|>#!/bin/env python import libsedml def create_nested_task(file_name): doc = libsedml.SedDocument(1, 4) # create simulation sim = doc.createSteadyState() sim.setId("steady1") # need to set the correct KISAO Term alg = sim.crea...
<|file_name|>ofp_flow_action_pop_mpls.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*- # Copyright 2015 NEC Corporation. # # # # Licensed under the Apache License, Version 2.0 (the "License"); ...
# http://www.apache.org/licenses/LICENSE-2.0 # # #
<|file_name|>fxaa.rs<|end_file_name|><|fim▁begin|>#[macro_use] extern crate glium; #[allow(unused_imports)] use glium::{glutin, Surface}; mod support; mod fxaa { use glium::{self, Surface}; use glium::backend::Facade; use glium::backend::Context; use glium::framebuffer::SimpleFrameBuffer; use st...
let mut target = display.draw();
<|file_name|>prePublishThaliCordovaPlugin.js<|end_file_name|><|fim▁begin|>'use strict';<|fim▁hole|>var path = require('path'); var fs = require('fs'); var rootDirectory = path.join(__dirname, "../../"); if (path.basename(rootDirectory) != "Thali_CordovaPlugin") { process.exit(0); } var readMeFileName = "readme.md"...
// prePublish gets run on 'npm install' (e.g. even if you aren't actually publishing) // so we have to check to make sure that we are in our own directory and this isn't // some poor user trying to install our package.
<|file_name|>mpi_esm.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ This file is part of pyCMBS. (c) 2012- Alexander Loew For COPYING and LICENSE details, please refer to the LICENSE file """ from cdo import Cdo from pycmbs.data import Data import tempfile as tempfile import copy import glob import os imp...
cdo.monmean(options='-f nc', output=outfile, input=tmp) # monmean needed here, as otherwise interface does not work os.remove(tmp) self.files.update({'surf': outfile})
<|file_name|>io-hook.ts<|end_file_name|><|fim▁begin|>export abstract class IoHook { abstract enableClickPropagation();<|fim▁hole|><|fim▁end|>
abstract disableClickPropagation(); }
<|file_name|>test_job_posting.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*- import unittest import mock from ..models import JobPosting class JobPostingTestCase(unittest.TestCase):<|fim▁hole|> model.position_name = 'Position Name' # action email = unicode(model) # assert ...
def test_unicode_should_return_position_name(self): # setup model = JobPosting()
<|file_name|>checked_neg.rs<|end_file_name|><|fim▁begin|>use malachite_base::num::basic::signeds::PrimitiveSigned; fn checked_neg_helper<T: PrimitiveSigned>() { let test = |n: T, out| { assert_eq!(n.checked_neg(), out); }; test(T::ZERO, Some(T::ZERO)); test(T::ONE, Some(T::NEGATIVE_ONE)); t...
<|file_name|>sum.py<|end_file_name|><|fim▁begin|>from chainer import cuda from chainer import function from chainer.utils import type_check class Sum(function.Function): """Sum of array elements over a given axis.""" keepdims = False def __init__(self, axis=None, keepdims=False): if axis is None...
# NumPy 1.9 does not support broadcast_to. dummy_x = xp.empty(self._in_shape, 'b') gx, _ = xp.broadcast_arrays(gy, dummy_x)
<|file_name|>changes.go<|end_file_name|><|fim▁begin|>package tmdb import ( "fmt" ) // Changes struct type Changes struct { Results []struct { ID int Adult bool } } var changeOptions = map[string]struct{}{ "page": {}, "start_date": {}, "end_date": {}} // GetChangesMovie gets a list of movie ids ...
optionsString := getOptionsString(options, changeOptions) uri := fmt.Sprintf("%s/tv/changes?api_key=%s%s", baseURL, tmdb.apiKey, optionsString) result, err := getTmdb(uri, &tvChanges) return result.(*Changes), err
<|file_name|>utils_test.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright (c) 2014, OneLogin, Inc. # All rights reserved. from base64 import b64decode import json from lxml import etree from os.path import dirname, join, exists import unittest from xml.dom.minidom import parseString from onelogin.s...
<|file_name|>lun.go<|end_file_name|><|fim▁begin|>/* Copyright 2016 The GoStor 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://www.apache.org/licenses/LICENSE...
lu.DeviceProtocol.InitLu(lu) lu.Attrs.Online = false lu.Attrs.Lbppbe = 3 return lu
<|file_name|>openerp_utils.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 2013-11-25 @author: Martin H. Bramwell ''' import oerplib import sys import socket <|fim▁hole|>class OpenERP(object): def __init__(self, credentials): db = credentials['db_name'] ...
from models.OErpModel import OErpModel
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/...
<|file_name|>notebook_exporter.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ @file @brief Customer notebook exporters. """ import os from textwrap import indent from traitlets import default from traitlets.config import Config from jinja2 import DictLoader from nbconvert.exporters import RSTExporter from ...
return c
<|file_name|>config.py<|end_file_name|><|fim▁begin|>from network import WLAN<|fim▁hole|> ############################################################################### # Settings for WLAN STA mode ############################################################################### WLAN_MODE = 'off' #WLAN_SSID ...
<|file_name|>app.module.ts<|end_file_name|><|fim▁begin|>import { NgModule } from '@angular/core' import { RouterModule } from '@angular/router'; import { rootRouterConfig } from './app.routes'; import { AppComponent } from './app.component'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { Br...
BrowserModule,
<|file_name|>sonos.py<|end_file_name|><|fim▁begin|>""" Support to interface with Sonos players (via SoCo). For more details about this platform, please refer to the documentation at https://home-assistant.io/components/media_player.sonos/ """ import datetime import logging from os import path import socket import urll...
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models from django.core.urlresolvers import reverse from jsonfield import JSONField import collections # Create your models here. class YelpvisState(models.Model): title=models.CharField(max_length=255) slug=models.SlugField(unique=True,max_l...
<|file_name|>simultaneous.py<|end_file_name|><|fim▁begin|>import numpy as np from scipy.linalg import norm from .base import AppearanceLucasKanade class SimultaneousForwardAdditive(AppearanceLucasKanade): @property def algorithm(self): return 'Simultaneous-FA' def _fit(self, lk_fitting, max_ite...
# Compute gradient descent parameter updates delta_p = np.real(self._calculate_delta_p(sd_delta_p)) # Update warp weights
<|file_name|>test_ind_wmaenvelope.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8; py-indent-offset:4 -*- ############################################################################### # # Copyright (C) 2015 Daniel Rodriguez # # This program is free software: you can redistribute it and/or mo...
# # 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|>models.py<|end_file_name|><|fim▁begin|>""" Database models for the badges app """ from importlib import import_module from django.conf import settings from django.contrib.auth.models import User from django.core.exceptions import ValidationError from django.db import models from django.utils.translation i...
mode=self.mode, default=u" (default)" if self.default else u''
<|file_name|>glusterfs.go<|end_file_name|><|fim▁begin|>/* Copyright 2015 The Kubernetes 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://www.apache.org/licens...
return spec.Volume.Glusterfs, spec.Volume.Glusterfs.ReadOnly
<|file_name|>snippets.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 ...
return '; '.join(['%s' % name, '%s' % ','.join(filtered_emails),
<|file_name|>indextree.cpp<|end_file_name|><|fim▁begin|>#include "indextree.h" #include <queue> namespace zl { bool IndexTreeNodeCompare::operator()(IndexTreeNode* first, IndexTreeNode* sencond) const { if(first == sencond) return true; return first->compare(sencond); } In...
{ IndexTreeNode* temp = q.front(); if(!temp->m_next.empty())
<|file_name|>batch_token_test.go<|end_file_name|><|fim▁begin|>package token import ( "strings" "testing" "time" "github.com/hashicorp/vault/api" "github.com/hashicorp/vault/builtin/credential/approle" vaulthttp "github.com/hashicorp/vault/http" "github.com/hashicorp/vault/sdk/helper/consts" "github.com/hashic...
<|file_name|>HabitListAdapter.java<|end_file_name|><|fim▁begin|>package com.example.habitup.View; <|fim▁hole|>import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.CheckBox; import android.widget.Li...
import android.content.Context; import android.content.res.Resources; import android.graphics.Color; import android.support.v4.content.ContextCompat;
<|file_name|>model-approval.service.ts<|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. // * You may obtain a copy of the License at // * // * http://www.apache.org/licenses/LICENSE-2.0...
// import {Injectable, Injector} from '@angular/core'; // import {AbstractService} from '@common/service/abstract.service';
<|file_name|>AlipayTradeVendorpayDevicedataUploadResponse.java<|end_file_name|><|fim▁begin|>package com.alipay.api.response; import com.alipay.api.AlipayResponse; /** * ALIPAY API: alipay.trade.vendorpay.devicedata.upload response.<|fim▁hole|> * @author auto create * @since 1.0, 2016-12-08 00:51:39 */ public clas...
*
<|file_name|>ngexception.hpp<|end_file_name|><|fim▁begin|>#ifndef FILE_NGEXCEPTION #define FILE_NGEXCEPTION /**************************************************************************/ /* File: ngexception.hpp */ /* Author: Joachim Schoeberl ...
DLL_HEADER virtual ~NgException ();
<|file_name|>interface.go<|end_file_name|><|fim▁begin|>// /* // Copyright The Kubernetes Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/...
retry "sigs.k8s.io/cloud-provider-azure/pkg/retry" ) // MockInterface is a mock of Interface interface.
<|file_name|>model_get_corporations_corporation_id_fw_stats_kills.go<|end_file_name|><|fim▁begin|>package esilatest /*<|fim▁hole|>type GetCorporationsCorporationIdFwStatsKills struct { /* Last week's total number of kills by members of the given corporation against enemy factions */ LastWeek int32 `json:"last_week...
Summary of kills done by the given corporation against enemy factions */
<|file_name|>createRegistry.js<|end_file_name|><|fim▁begin|>export default function createRegistry(repositories) { const storage = { ...repositories }; const registry = { register(repositoryName, repository) { storage[repositoryName] = repository; return registry; }, ...
), initialValue); },
<|file_name|>FormSelectField.js<|end_file_name|><|fim▁begin|>import React, { Component } from 'react'; import { SelectField, MenuItem } from 'fusionui-shared-components-react'; import PropTypes from 'prop-types'; import '../../FormField.scss'; import './FormSelectField.scss'; const style = { width: '100%', height:...
> <MenuItem value="" primaryText="Select..." /> { options.map(option => <MenuItem value={ option.value } key={ option.value } primaryText={ option.text } />) }
<|file_name|>bbr_leader.cpp<|end_file_name|><|fim▁begin|>/* * Copyright (c) 2019, The OpenThread Authors. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * 1. Redistributions of source ...
while (Get<NetworkData::Leader>().GetNextOnMeshPrefix(iterator, config) == OT_ERROR_NONE) { if (config.mDp) {
<|file_name|>UpdateMethodResponseRequestMarshaller.java<|end_file_name|><|fim▁begin|>/* * Copyright 2014-2019 Amazon.com, Inc. or its affiliates. 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. A copy of the...
import com.amazonaws.protocol.*; import com.amazonaws.annotation.SdkInternalApi;
<|file_name|>reacher.py<|end_file_name|><|fim▁begin|># Copyright 2017 The dm_control Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0...
import collections from dm_control import mujoco
<|file_name|>v1.py<|end_file_name|><|fim▁begin|>from .base import * class OpStash(object): cache = {} @classmethod def Add(cls, object): t = object.type cls.cache[t] = object @classmethod def Lookup(cls, type): return cls.cache[type] @classmethod def Define(cls, pt...
class picSize(pstruct.type):
<|file_name|>docker_image.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python #<|fim▁hole|># Copyright 2016 Red Hat | Ansible # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foun...
<|file_name|>auth.go<|end_file_name|><|fim▁begin|>package gitnotify import ( "errors" "fmt" "html/template" "net/http" "os" "sort" "github.com/gorilla/mux" "github.com/markbates/goth" "github.com/markbates/goth/gothic" "github.com/markbates/goth/providers/github" "github.com/markbates/goth/providers/gitlab...
Email: user.Email,
<|file_name|>GeometryFactory.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python import Colors import Shapes from abc import ABCMeta, abstractmethod class AbstractFactory(object): __metaclass__ = ABCMeta @abstractmethod def get_color(self, color): pass @abstractmethod def get_shape(self, ...
class ColorFactory(AbstractFactory): def get_color(self, color): color = color.lower() if color == 'red':
<|file_name|>h5f.rs<|end_file_name|><|fim▁begin|>pub use self::H5F_scope_t::*; pub use self::H5F_close_degree_t::*; pub use self::H5F_mem_t::*; pub use self::H5F_libver_t::*; use libc::{c_int, c_uint, c_void, c_char, c_double, size_t, ssize_t}; use h5::{herr_t, hsize_t, htri_t, hssize_t, H5_ih_info_t}; use h5i::hid_t...
herr_t; pub fn H5Freset_mdc_hit_rate_stats(file_id: hid_t) -> herr_t; pub fn H5Fget_name(obj_id: hid_t, name: *mut c_char, size: size_t) -> ssize_t;
<|file_name|>warehouse.go<|end_file_name|><|fim▁begin|>package def /*<|fim▁hole|> FIXME this is really ambiguous vs `rio.SiloURI`, should probably try to refactor to only be one. */ type WarehouseCoords []WarehouseCoord type WarehouseCoord string<|fim▁end|>
A list of warehouse coordinates, as simple strings (they're serialized as such).
<|file_name|>BlockBuilder.ts<|end_file_name|><|fim▁begin|>module Block { export interface BlockBuilderInterface { buildRandomBlocks(numberOfBlocks: number); buildCustomBlocks(blocks: BlockDimensionModel[]); } export class BlockBuilder implements BlockBuilderInterface { private _inp...
buildRandomBlocks(numberOfBlocks: number) { this.generateBlockSet(numberOfBlocks);
<|file_name|>builder.rs<|end_file_name|><|fim▁begin|>/* * Copyright (c) Facebook, Inc. and its affiliates. * * This software may be used and distributed according to the terms of the * GNU General Public License version 2. */ use std::collections::HashMap; use std::path::{Path, PathBuf}; use std::time::Duration; ...
/// Build the client.
<|file_name|>mailer.js<|end_file_name|><|fim▁begin|>/* UTILIZZO DEL MODULO: var mailer = require('percorso/per/questoFile.js'); mailer.inviaEmail(nome, cognome, emailDestinatario, oggetto, corpoInHtml); OPPURE mailer.inviaEmail(opzioniEmail); dove opzioniEmail è un oggetto JSON formato così: { from: '"Nome Visua...
<|file_name|>pyodbc_runner.py<|end_file_name|><|fim▁begin|>import pyodbc import config def main(): # formatで`{`を使うため、`{`を重ねることでエスケープ<|fim▁hole|> conn = pyodbc.connect(con_str) cur = conn.cursor() cur.execute("select item_name from item") for c in cur.fetchall(): print(c[0]) #=> `ringo`,...
con_str = 'Driver={{Microsoft Access Driver (*.mdb, *.accdb)}};Dbq={0};'.format(config.PATH_ACCDB)
<|file_name|>twoneurons.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # twoneurons.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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 S...
delay=1.0 stim=1000.0 neuron1 = nest.Create("iaf_neuron")
<|file_name|>GsonConverter.java<|end_file_name|><|fim▁begin|>/* * Copyright (C) 2015 P100 OG, 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/licens...
out.write(jsonBytes); } } }
<|file_name|>rx-stream-pacing.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 ''' Make a stream emit at the pace of a slower stream Pros: Introduce a delay between events in an otherwise rapid stream (like range) Cons: When the stream being delayed runs out of events to push, the zipped st...
# Zip two streams together so it emits at the pace of the slowest stream source = Observable.zip( interval,
<|file_name|>ItemListFragment.java<|end_file_name|><|fim▁begin|>package com.kimkha.finanvita.ui; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.database.Cursor; import android.os.Bundle; import android.support.v4.app.LoaderManager; import android.support.v4.c...
@Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState);
<|file_name|>Welcome.py<|end_file_name|><|fim▁begin|>from flask.ext import restful from . import api <|fim▁hole|> return api.send_static_file('index.html')<|fim▁end|>
class Welcome(restful.Resource): def get(self):
<|file_name|>landmarks_file.py<|end_file_name|><|fim▁begin|># ID-Fits # Copyright (c) 2015 Institut National de l'Audiovisuel, INA, All rights reserved. # <|fim▁hole|># License as published by the Free Software Foundation; either # version 3.0 of the License, or (at your option) any later version. # # This library is ...
# This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public
<|file_name|>field_html_tests.js<|end_file_name|><|fim▁begin|>odoo.define('web_editor.field_html_tests', function (require) { "use strict"; var ajax = require('web.ajax'); var FormView = require('web.FormView'); var testUtils = require('web.test_utils'); var weTestUtils = require('web_editor.test_utils'); var core = r...
if (ev.data.service === 'notification') { assert.deepEqual(ev.data.args[0], { "className": undefined, "message": "<ul><li>Header</li></ul>",
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import django.utils.timezone import model_utils.fields from django.db import migrations, models from opaque_keys.edx.django.models import CourseKeyField, UsageKeyField from lms.dj...
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Generated by Django 1.11.3 on 2017-07-06 20:01 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] <|fim▁hole|> ...
operations = [
<|file_name|>p01_remove_doctype_mappers.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. # License: GNU General Public License v3. See license.txt import webnotes def execute(): webnotes.conn.sql("""drop table if exists `tabDocType Mapper`""") webnotes.conn.sql("""drop table if ...
<|file_name|>universe.rs<|end_file_name|><|fim▁begin|>extern crate rand; use std::vec::Vec; use celestial::bodies::{Star, Planet}; use celestial::starsystem::{OrbitData, StarSystem}; pub struct Universe { systems: Vec<StarSystem> } impl Universe { pub fn generate() -> Universe { let mut u = Universe{...
// return Universe u }
<|file_name|>ExtensionType.py<|end_file_name|><|fim▁begin|># Copyright 2016 Casey Jaymes # This file is part of PySCAP. # # PySCAP 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 Licen...
MODEL_MAP = { 'elements': [ {'tag_name': 'group', 'list': 'tags', 'class': 'GroupType', 'min': 0},
<|file_name|>test_queue_worker.py<|end_file_name|><|fim▁begin|>import os import time import ujson <|fim▁hole|>from django.test import TestCase from mock import patch from typing import Any, Callable, Dict, List, Mapping, Tuple from zerver.lib.test_helpers import simulated_queue_client from zerver.lib.test_classes impo...
from django.conf import settings from django.http import HttpResponse
<|file_name|>datacite.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2013, 2015 CERN. # # Invenio 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; eith...
if 'descriptions' in self.xml: if isinstance(self.xml['descriptions']['description'], list):
<|file_name|>cleanup_addon_premium.py<|end_file_name|><|fim▁begin|>from django.core.management.base import BaseCommand import amo from mkt.webapps.models import AddonPremium class Command(BaseCommand): help = 'Clean up existing AddonPremium objects for free apps.' def handle(self, *args, **options): ...
.delete())
<|file_name|>aixc++.py<|end_file_name|><|fim▁begin|>"""SCons.Tool.aixc++ Tool-specific initialization for IBM xlC / Visual Age C++ compiler. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) ...
# The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
<|file_name|>RepoUserHeatmap.js<|end_file_name|><|fim▁begin|>import React, {PropTypes} from 'react'; import L from 'leaflet'; import gh from '../api/GitHubApi'; import RaisedButton from 'material-ui/RaisedButton'; const REPO_TIMESPAN = { ALLTIME: 0, THIRTYDAYS: 1, SIXTYDAYS: 2, ONEYEAR: 3 }; const de...
render() { return ( <div className="map-container"> <div className="os-map" ref={(div) => { this.mapDiv = div; }}></div>
<|file_name|>editprefixers.js<|end_file_name|><|fim▁begin|><|fim▁hole|>describe('Controller: EditprefixersCtrl', function () { // load the controller's module beforeEach(module('grafterizerApp')); var EditprefixersCtrl, scope; // Initialize the controller and a mock scope beforeEach(inject(function ($c...
'use strict';
<|file_name|>overviewpage.cpp<|end_file_name|><|fim▁begin|>// Copyright (c) 2011-2014 The Bitcoin developers // Copyright (c) 2014-2015 The Gamblr developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "overview...
<|file_name|>NodeBackedModelSet.java<|end_file_name|><|fim▁begin|>/* * Copyright 2015 the original author or 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://ww...
@Override public boolean retainAll(Collection<?> c) { throw new UnsupportedOperationException();
<|file_name|>Instructions.js<|end_file_name|><|fim▁begin|>var NN = NN || {}; NN.InstructionsState = NN.InstructionsState || {}; NN.InstructionsState.init = function(levelnum) { this.game.stage.backgroundColor = '#00f'; this.levelnum = levelnum; this.GAMEX = this.game.world.width; this.GAMEY = this.gam...
if ( this.levelnum == 2 ) { words1.text = 'The answers are'; words2.text = 'multiples of the';
<|file_name|>zlib.cpp<|end_file_name|><|fim▁begin|>/* * The Mana Server * Copyright (C) 2006-2010 The Mana World Development Team * * This file is part of The Mana Server. * * The Mana Server is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as p...
switch (ret) {
<|file_name|>ProjOpen.js<|end_file_name|><|fim▁begin|>/** * File: app/project/ProjOpen.js * Author: liusha */ Ext.define('xdfn.project.ProjOpen', { extend: 'xdfn.project.ui.ProjOpen', grid: null, initComponent: function() { var me = this; me.openStore = Ext.create('xdfn.p...
<|file_name|>config_test.go<|end_file_name|><|fim▁begin|>// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License.<|fim▁hole|>// You may obtain a copy of the License at // // http://www.apache.org/licen...
<|file_name|>beta_answer_the_students_questions.py<|end_file_name|><|fim▁begin|>from collections import Counter def answer(q,inf): s = Counter(q.split(' ')); r = [-1,-1] for i,j in enumerate(inf): check = sum(s.get(w,0) for w in j.split(' '))<|fim▁hole|> return None if r == [-1,-1] else inf[r[0...
if check != 0 and check > r[1]: r = [i,check]
<|file_name|>forms.py<|end_file_name|><|fim▁begin|>from django.forms import ModelForm from bug_reporting.models import Feedback from CoralNet.forms import FormHelper class FeedbackForm(ModelForm): class Meta: model = Feedback fields = ('type', 'comment') # Other fields are auto-set #error_c...
data = FormHelper.stripSpacesFromFields(
<|file_name|>moderator.py<|end_file_name|><|fim▁begin|>#from moderation import moderation #from .models import SuccessCase <|fim▁hole|> #moderation.register(SuccessCase)<|fim▁end|>
<|file_name|>test_arp_lib.py<|end_file_name|><|fim▁begin|># Copyright (C) 2014 VA Linux Systems Japan K.K. # # 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.apac...
def test_packet_in_handler(self): self._test_packet_in_handler()
<|file_name|>handler.py<|end_file_name|><|fim▁begin|># 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.0 (the "License"); you may # not use this file except i...
return req.response
<|file_name|>robotFactory.py<|end_file_name|><|fim▁begin|>from .stt import ApiRobot from .stt import BingRobot from .stt import WatsonRobot from .stt import WitaiRobot from .stt import GoogleRobot<|fim▁hole|> configSTT = config['stt'] if configSTT == 'bing': return BingRobot(config['bing'], sp...
class RobotFactory: @staticmethod def produce(config, speaker, actions):
<|file_name|>gl_interface.cpp<|end_file_name|><|fim▁begin|>// //--------------------------------------------------------------------------- // // Copyright(C) 2005-2016 Christoph Oelckers // All rights reserved. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU...
gl.maxuniforms = v; glGetIntegerv(GL_MAX_UNIFORM_BLOCK_SIZE, &v); gl.maxuniformblock = v; glGetIntegerv(GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT, &v);
<|file_name|>tableBodyClasses.js<|end_file_name|><|fim▁begin|>"use strict"; <|fim▁hole|>exports.default = void 0; var _unstyled = require("@material-ui/unstyled"); function getTableBodyUtilityClass(slot) { return (0, _unstyled.generateUtilityClass)('MuiTableBody', slot); } const tableBodyClasses = (0, _unstyled.ge...
Object.defineProperty(exports, "__esModule", { value: true }); exports.getTableBodyUtilityClass = getTableBodyUtilityClass;
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- encoding: utf-8 -*-<|fim▁hole|># Copyright 2011-2014, Nigel Small # # 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 Licens...
<|file_name|>build.rs<|end_file_name|><|fim▁begin|>extern crate serde_codegen; extern crate serde_json; extern crate glob; use std::env; use std::fs; use std::path::Path; /// generate an enum of Events fn main() { for entry in glob::glob("src/**/*.rs.in").expect("Failed to read glob pattern") { println!("...
dst.set_extension("rs"); // Make sure our target directory exists. We only need // this if there are extra nested sudirectories under src/.
<|file_name|>check_data.py<|end_file_name|><|fim▁begin|>from data import * from draw import * img, hiden_x = get_img_class() print img.shape print img d_idx = np.random.randint(0, 50) <|fim▁hole|>x_x, obs_x, obs_y, obs_tfs, new_ob_x, new_ob_y, new_ob_tf, imgs = gen_data() print show_dim(x_x) print show_dim(obs_x) p...
<|file_name|>unsized-bare-typaram.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.apach...
// option. This file may not be copied, modified, or distributed // except according to those terms. fn bar<T: Sized>() { }
<|file_name|>CopyShader.js<|end_file_name|><|fim▁begin|>/** * @author alteredq / http://alteredqualia.com/ * * Full-screen textured quad shader */ var THREE = window.THREE || require('three'); THREE.CopyShader = { uniforms: { "tDiffuse": { type: "t", value: null }, "opacity": { type: "f", value: 1.0 } },...
<|file_name|>test_graph.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- import unittest import graph class TestGraph(unittest.TestCase): ''' Unit test for graph.py ''' def setUp(self): '''<|fim▁hole|> ''' test_graph_data = {'1': [], '2': ['1'], '3':...
This method sets up the test graph data
<|file_name|>run.go<|end_file_name|><|fim▁begin|>// Copyright 2013 Canonical Ltd. // Licensed under the AGPLv3, see LICENCE file for details. package main import ( "fmt" "net/rpc" "os" "path/filepath" "launchpad.net/gnuflag" "github.com/wallyworld/core/cmd" "github.com/wallyworld/core/names" "github.com/wal...
<|file_name|>postgres_to_s3_transfer.py<|end_file_name|><|fim▁begin|>from urllib.parse import urlparse import subprocess import logging import boto3 import airflow.hooks.base_hook from airflow.models import BaseOperator from airflow.utils.decorators import apply_defaults import utils.helpers as helpers class Postgre...
def _parse_s3_url(s3_url): parsed_url = urlparse(s3_url)
<|file_name|>fake_lcd.go<|end_file_name|><|fim▁begin|><|fim▁hole|> import "github.com/augustoroman/serial_lcd" type FakeLcd struct{} func (f FakeLcd) SetBG(r, g, b uint8) error { return nil } func (f FakeLcd) SetOn(On bool) error { return nil } func (f FakeLcd) SetBrightness(b uint8) error { return...
package main
<|file_name|>feed_parse_extractEmergencyExitsReleaseBlog.py<|end_file_name|><|fim▁begin|><|fim▁hole|> vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol or frag) or 'preview' in item['title'].lower(): return None return False<|fim▁end|>
def extractEmergencyExitsReleaseBlog(item): """ """
<|file_name|>PaiCard.tsx<|end_file_name|><|fim▁begin|>import { useBackend, useLocalState } from '../backend'; import { Box, Button, LabeledList, NoticeBox, Section, Stack, Tabs } from '../components'; import { Window } from '../layouts'; type PaiCardData = { candidates: Candidate[]; pai: Pai; }; type Candidate = ...
<|file_name|>BuiltIn.py<|end_file_name|><|fim▁begin|># Copyright 2008-2015 Nokia Solutions and Networks # # 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/lice...
| from robotide.lib.robot.libraries.BuiltIn import BuiltIn
<|file_name|>base.py<|end_file_name|><|fim▁begin|>import datetime import logging from functools import reduce from flask_babelpkg import lazy_gettext from .filters import Filters log = logging.getLogger(__name__) class BaseInterface(object): """ Base class for all data model interfaces. Sub class...
return -1 def get_min_length(self, col_name): return -1
<|file_name|>builder.rs<|end_file_name|><|fim▁begin|>use anyhow::Context; #[derive(Debug, Clone, PartialEq, Eq, Hash, serde::Deserialize)] #[allow(non_camel_case_types)] pub enum Arch { #[serde(rename = "i686")] I686, #[serde(rename = "x86_64")] X86_64, #[serde(rename = "arm")] ARM, #[serde...
AARCH64, }