prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>permission.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # from rest_framework import serializers from django.utils.translation import ugettext_lazy as _ from orgs.mixins.serializers import BulkOrgResourceModelSerializer from perms.models import AssetPermission, Action __all__ = [ 'AssetPe...
'actions': {'label': _('Actions')}, 'users_amount': {'label': _('Users amount')},
<|file_name|>index.js<|end_file_name|><|fim▁begin|>/* * * apiView * */ import React, { PureComponent } from 'react' import PropTypes from 'prop-types' import { FormattedMessage } from 'react-intl' import { connect } from 'react-redux' import ReadMargin from 'components/ReadMargin' import View from 'components/View...
componentDidMount() {
<|file_name|>popup.js<|end_file_name|><|fim▁begin|>document.addEventListener("DOMContentLoaded", function (event) { 'use strict'; var paragraph, url, proxy; paragraph = document.querySelectorAll('p.error_text'); chrome.tabs.query({ currentWindow: true, active: true }, function (tabs) { url = tabs[0].url; if (ur...
});
<|file_name|>index.js<|end_file_name|><|fim▁begin|><|fim▁hole|>exports.CLI = require(__dirname + '/lib/cli'); exports.Events = require(__dirname + '/lib/events');<|fim▁end|>
<|file_name|>aptpreferences.py<|end_file_name|><|fim▁begin|>import os from twisted.python.compat import iteritems from landscape.lib.fs import read_text_file from landscape.constants import APT_PREFERENCES_SIZE_LIMIT from landscape.client.monitor.plugin import DataWatcher class AptPreferences(DataWatcher): """...
data = {} preferences_filename = os.path.join(self._etc_apt_directory, u"preferences")
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright 2016 Mycroft AI, Inc. # # This file is part of Mycroft Core. # # Mycroft Core 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 ...
from threading import Thread from time import sleep import random
<|file_name|>no_0021_merge_two_sorted_lists.rs<|end_file_name|><|fim▁begin|>// Definition for singly-linked list. #[derive(PartialEq, Eq, Clone, Debug)] pub struct ListNode { pub val: i32, pub next: Option<Box<ListNode>>, } impl ListNode { #[inline] fn new(val: i32) -> Self { ListNode { next: N...
next: Some(Box::new(ListNode { val: 3, next: Some(Box::new(ListNode { val: 4,
<|file_name|>scipy.py<|end_file_name|><|fim▁begin|>## # Copyright 2009-2021 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://...
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License
<|file_name|>vanilla_lstm.py<|end_file_name|><|fim▁begin|>''' Build a tweet sentiment analyzer ''' from __future__ import print_function import cPickle as pickle import sys import time from collections import OrderedDict import numpy import theano import theano.tensor as tensor from theano import config from theano....
<|file_name|>config.go<|end_file_name|><|fim▁begin|>/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless ...
// Setup OpenAPI security: all APIs will have the same authentication for now. c.OpenAPIConfig.DefaultSecurity = []map[string][]string{} keys := []string{} for k := range *c.OpenAPIConfig.SecurityDefinitions {
<|file_name|>registry_test.py<|end_file_name|><|fim▁begin|># coding=utf-8 # Copyright 2017 The DLT2T 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/lic...
pass @registry.register_ranged_hparams def rhp1(_):
<|file_name|>messages.js<|end_file_name|><|fim▁begin|>module.exports = {<|fim▁hole|> reminder_newscheduleSuccess: "A new mail has been successfully saved and scheduled", schedule_ShdlError: "The scheduleAt should be a timestamp (like : 1411820580000) and should be in the future", gbl_oops: "Oops something we...
schedule_inputError: "Not all required inputs are present in the request",
<|file_name|>HSSFName.hpp<|end_file_name|><|fim▁begin|>// Generated from /POI/java/org/apache/poi/hssf/usermodel/HSSFName.java #pragma once #include <fwd-POI.hpp> #include <java/lang/fwd-POI.hpp> #include <org/apache/poi/hssf/record/fwd-POI.hpp> #include <org/apache/poi/hssf/usermodel/fwd-POI.hpp> #include <org/apach...
} // ptg } // formula } // ss } // poi
<|file_name|>suntsu.py<|end_file_name|><|fim▁begin|># Natural Language Toolkit: Sun Tsu-Bot # # Copyright (C) 2001-2011 NLTK Project # Author: Sam Huston 2007 # URL: <http://www.nltk.org/> # For license information, see LICENSE.TXT from util import * """ Tsu bot responds to all queries with a Sun Tsu sayings Quoted ...
"Attack him where he is unprepared, appear where you are not expected.", "There is no instance of a country having benefited from prolonged warfare.")), (r'[D-Fd-f](.*)',
<|file_name|>mutates_in_test.py<|end_file_name|><|fim▁begin|>import mutable_attr import unittest class T(unittest.TestCase): def test_foo(self):<|fim▁hole|><|fim▁end|>
mutable_attr.y = 3
<|file_name|>SynchronizationTest.java<|end_file_name|><|fim▁begin|>/* * The MIT License * * Copyright 2019 Karus Labs. * * 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 restric...
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: *
<|file_name|>get_all_groups.rs<|end_file_name|><|fim▁begin|>extern crate philipshue; use std::env; use philipshue::bridge::Bridge; mod discover; use discover::discover; fn main() { let args: Vec<String> = env::args().collect(); if args.len() < 2 { println!("Usage : {:?} <username>", args[0]); ...
"name", name_len, "type", type_len);
<|file_name|>qscodemarker.cpp<|end_file_name|><|fim▁begin|>/**************************************************************************** ** ** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. ** ** This file is part of the tools applications of the Qt Toolkit. ** ** This file may be used under the terms of t...
<|file_name|>__main__.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import sys import argparse from .audio import create_tracks from .downloader import YouTube from .parser import parse_tracks_file from .prompt import wizard from .exceptions import WizardError def get_from_youtube(source): yt = YouTube(...
try: generate_album(**wizard()) except WizardError: sys.exit()
<|file_name|>novasetup.py<|end_file_name|><|fim▁begin|># Still some problems... import time import shutil<|fim▁hole|>from configobj import ConfigObj NOVA_API_CONF = "/etc/nova/api-paste.ini" OS_API_SEC = "composite:openstack_compute_api_v2" DR_FILTER_TARGET_KEY = "keystone_nolimit" DR_FILTER_TARGET_KEY_VALUE = "compu...
<|file_name|>0016_auto_20170411_0342.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-04-11 03:42 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ...
model_name='job',
<|file_name|>radiusd.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # coding=utf-8 import datetime import os import six import msgpack import toughradius from txzmq import ZmqEndpoint, ZmqFactory, ZmqPushConnection, ZmqPullConnection from twisted.internet import protocol from twisted.internet import reactor from...
logger.error('status_type <%s> not support' % status_type) except Exception as err:
<|file_name|>conf.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # Nikola documentation build configuration file, created by # sphinx-quickstart on Sun Sep 22 17:43:37 2013. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration value...
<|file_name|>QueuesPage.ts<|end_file_name|><|fim▁begin|>import { ChangeDetectionStrategy, Component, OnDestroy } from '@angular/core'; import { Title } from '@angular/platform-browser'; import { BehaviorSubject, Observable, Subscription } from 'rxjs'; import { CommandQueue, ConnectionInfo, QueueEventsSubscription, Queu...
private cqueueByName: { [key: string]: CommandQueue; } = {}; constructor(readonly yamcs: YamcsService, title: Title, messageService: MessageService) {
<|file_name|>trees-test.js<|end_file_name|><|fim▁begin|>import { moduleFor, test } from 'ember-qunit'; <|fim▁hole|> // Specify the other units that are required for this test. // needs: ['controller:foo'] }); // Replace this with your real tests. test('it exists', function(assert) { let controller = this.subject(...
moduleFor('controller:plants/trees', 'Unit | Controller | plants/trees', {
<|file_name|>utils.cc<|end_file_name|><|fim▁begin|><|fim▁hole|>you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is di...
/* Copyright 2017 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License");
<|file_name|>Version.cpp<|end_file_name|><|fim▁begin|>/* * Copyright (c) 2014-2015 Daniel Hrabovcak * * This file is part of Natural IDE. * * This program 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 Foun...
<|file_name|>openstack_cinder.py<|end_file_name|><|fim▁begin|># Copyright (C) 2009 Red Hat, Inc., Joey Boggs <jboggs@redhat.com> # Copyright (C) 2012 Rackspace US, Inc., # Justin Shepherd <jshepher@rackspace.com> # Copyright (C) 2013 Red Hat, Inc., Flavio Percoco <fpercoco@redhat.com> # Copyright (C)...
<|file_name|>framework.py<|end_file_name|><|fim▁begin|>import numpy as np<|fim▁hole|> _EPSILON = 1e-6 # avoid nan # local network for advantage actor-critic which are also know as A2C class Framework(object): def __init__(self, access, state_size, action_size, scope_name): self.Access = access se...
import tensorflow as tf from agent.forward import Forward from config import *
<|file_name|>test_mirna.py<|end_file_name|><|fim▁begin|>from resolwe.flow.models import Data from resolwe.test import tag_process, with_resolwe_host from resolwe_bio.utils.test import KBBioProcessTestCase class MicroRNATestCase(KBBioProcessTestCase): @with_resolwe_host @tag_process("workflow-mirna") def ...
"count_multi_mapping_reads": True,
<|file_name|>auto_suggest.js<|end_file_name|><|fim▁begin|>/** * Plugin Name: Autocomplete for Textarea * Author: Amir Harel * Copyright: amir harel (harel.amir1@gmail.com) * Twitter: @amir_harel * Version 1.4 * Published at : http://www.amirharel.com/2011/03/07/implementing-autocomplete-jquery-plugin-for-textarea...
'~':0,
<|file_name|>PlayerbotAI.cpp<|end_file_name|><|fim▁begin|>#include "Common.h" #include "Database/DatabaseEnv.h" #include "ItemPrototype.h" #include "World.h" #include "SpellMgr.h" #include "PlayerbotAI.h" #include "PlayerbotMgr.h" #include "PlayerbotDeathKnightAI.h" #include "PlayerbotDruidAI.h" #include "PlayerbotHunt...
<|file_name|>visualization_cellsystem.py<|end_file_name|><|fim▁begin|># Copyright (C) 2010-2019 The ESPResSo project # # This file is part of ESPResSo. # # ESPResSo 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 Foundati...
box = [40, 30, 20] system = espressomd.System(box_l=box) visualizer = espressomd.visualization_opengl.openGLLive(
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.shortcuts import render from django.shortcuts import render_to_response from django.template import RequestContext from django.shortcuts import redirect from main.models import Link from main.models import Tag<|fim▁hole|># Create your views here. def in...
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from distutils.core import setup setup( name="kafka-python", version="0.1-alpha",<|fim▁hole|> packages=["kafka"], license="Copyright 2012, David Arthur under Apache License, v2.0", description="Pure Python client for Apache Kafka", long_descript...
author="David Arthur", author_email="mumrah@gmail.com", url="https://github.com/mumrah/kafka-python",
<|file_name|>ConfigurationPanel.java<|end_file_name|><|fim▁begin|>package es.uvigo.esei.sing.bdbm.gui.configuration; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.File; import java.util.EventListener; import java.util.EventObject; import java.util.concurrent.Callable; import ...
<|file_name|>shader.cpp<|end_file_name|><|fim▁begin|>#include "shader.h" #include <iostream> Shader::Shader(GLuint shader_id) : shader_id(shader_id) {} void Shader::use() { glUseProgram(shader_id); } void Shader::send_cam_pos(glm::vec3 cam_pos) { this->cam_pos = cam_pos; }<|fim▁hole|>{ this->V = V; ...
void Shader::set_VP(glm::mat4 V, glm::mat4 P)
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""Charm Helpers saltstack - declare the state of your machines. This helper enables you to declare your machine state, rather than program it procedurally (and have to test each change to your procedures). Your install hook can be as simple as: {{{ from charmhelp...
<|file_name|>server.py<|end_file_name|><|fim▁begin|># Copyright 2018 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/L...
<|file_name|>alert.cpp<|end_file_name|><|fim▁begin|>/* * Copyright (c) 2011-2015 libbitcoin developers (see AUTHORS) * Copyright (c) 2016-2017 metaverse core developers (see MVS-AUTHORS) * * This file is part of metaverse. * * metaverse is free software: you can redistribute it and/or modify * it under the terms...
}
<|file_name|>FTPRemoteClient.java<|end_file_name|><|fim▁begin|>/* * Copyright 2005-2010 Ignis Software Tools Ltd. All rights reserved. */ package com.aqua.filetransfer.ftp; import java.io.File; import java.io.FileInputStream; import java.util.Properties; import jsystem.framework.JSystemProperties; import jsystem.fr...
* from the jsystem.properties file, if the property was set it will use it as server address * otherwise, the system object uses java API to get local machine host name and uses it as server address. */
<|file_name|>test_edit_video.py<|end_file_name|><|fim▁begin|>from django.test import TestCase from django.core.urlresolvers import reverse from working_waterfronts.working_waterfronts_api.models import Video from django.contrib.auth.models import User class EditVideoTestCase(TestCase): """ Test that the Edit...
self.assertEqual(fields[field], form[field].value()) def test_delete_video(self): """
<|file_name|>expr-match-unique.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.o...
// option. This file may not be copied, modified, or distributed // except according to those terms. // run-pass
<|file_name|>account_move_line.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can r...
part = partner_obj.browse(cr, uid, partner_id) tax_id = fiscal_pos_obj.map_tax(cr, uid, part and part.property_account_position or False, tax_ids)[0]
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""Support for Peewee ORM (https://github.com/coleifer/peewee).""" from __future__ import annotations import typing as t import marshmallow as ma import muffin import peewee as pw from apispec.ext.marshmallow import MarshmallowPlugin from marshmallow_peewee impor...
else:
<|file_name|>linked_tap.py<|end_file_name|><|fim▁begin|>from __future__ import print_function import numpy as np from bokeh.client import push_session from bokeh.io import curdoc from bokeh.models import (ColumnDataSource, DataRange1d, Plot, Circle, WidgetBox, Row, Button, TapTool) N = 9 ...
ydr2 = DataRange1d() plot2 = Plot(x_range=xdr2, y_range=ydr2, plot_width=400, plot_height=400) plot2.title.text = "Plot2" plot2.tools.append(TapTool(plot=plot2))
<|file_name|>favoritesPages_script.js<|end_file_name|><|fim▁begin|>Template.favoritesPages.onCreated(function () { var template = this; template.subscribe('FavoritesPages'); }); Template.favoritesPages.helpers({ favoritesPages: function () { if (Meteor.userId()) { return Pages.find( { $or: [{ i...
}); Template.favoritesPages.events({ });
<|file_name|>ItemIdKeyProvider.java<|end_file_name|><|fim▁begin|>package it.niedermann.owncloud.notes.main.items.selection; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.recyclerview.selection.ItemKeyProvider; import androidx.recyclerview.widget.RecyclerView; import static a...
public ItemIdKeyProvider(RecyclerView recyclerView) { super(SCOPE_MAPPED); this.recyclerView = recyclerView;
<|file_name|>dateandtime.py<|end_file_name|><|fim▁begin|># # This file is part of pyasn1 software. # # Copyright (c) 2005-2019, Ilya Etingof <etingof@gmail.com> # License: http://snmplabs.com/pyasn1/license.html # import time from datetime import datetime from sys import version_info __all__ = ['strptime'] if versio...
<|file_name|>wavesurfer.js<|end_file_name|><|fim▁begin|>(function (root, factory) { if (root === undefined && window !== undefined) root = window; if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module unless amdModuleId is set define('wavesurfer', [], function () { ...
<|file_name|>balancer_v1_wrapper.go<|end_file_name|><|fim▁begin|>/* * * Copyright 2017 gRPC 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/lice...
sc.Connect() }
<|file_name|>eventlet.py<|end_file_name|><|fim▁begin|># Copyright 2013 OpenStack Foundation # # 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|>jai_texture_object.cpp<|end_file_name|><|fim▁begin|>#include "jai_texture_object.h" #include "jai_shader_define.h" namespace jai { namespace drawable { TextureObject::TextureObject() { mColorEffect.setIdentity(); } void TextureObject::_prepareDraw(int sample, Mat4 const & tran...
draw::SetUniformInt(sct->mUSmp, sample);
<|file_name|>ground_station_base.py<|end_file_name|><|fim▁begin|>import os from optparse import OptionParser import io import time import random import thread import sys from smtp_stuff import sendMail from imap_stuff import checkMessages import datetime import string import array from time import gmtime, strftime fro...
global outgoing_server
<|file_name|>JQueryDroppable.java<|end_file_name|><|fim▁begin|>/* * Licensed to The Apereo Foundation under one or more contributor license * agreements. See the NOTICE file distributed with this work for additional * information regarding copyright ownership. * * The Apereo Foundation licenses this file to you un...
package com.tle.web.sections.jquery.libraries;
<|file_name|>compile.py<|end_file_name|><|fim▁begin|>import logging as log import sys import getopt import os import subprocess<|fim▁hole|> print "\n==================================================\n" returncode = 0 if platform == "windows": print "Running: vcvarsall.bat x86_amd64 && " + workspace...
import shutil def RunCMake(workspace, target, platform): # run CMake
<|file_name|>transifex.py<|end_file_name|><|fim▁begin|># Copyright (c) 2017, Matt Layman from ConfigParser import ConfigParser, NoOptionError, NoSectionError import os import sys import requests API_URL = 'https://www.transifex.com/api/2' LANGUAGES = [ 'ar', 'de', 'el', 'es', 'fr', 'it', ...
language) po_url = API_URL + po_api params = {'file': '1'}
<|file_name|>ZipCompress.java<|end_file_name|><|fim▁begin|>package org.javacore.io.zip; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; imp...
import java.util.zip.ZipEntry; import java.util.zip.ZipFile;
<|file_name|>upload.min.js<|end_file_name|><|fim▁begin|>version https://git-lfs.github.com/spec/v1 oid sha256:b519d8c53881da3ce32f92a5c9f583c67d563ea9d7c5cacd3bf2503726443654<|fim▁hole|><|fim▁end|>
size 3420
<|file_name|>async_client.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright 2022 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/lic...
)
<|file_name|>account_group.py<|end_file_name|><|fim▁begin|># Copyright 2021 Alfredo de la Fuente - AvanzOSC # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from odoo import models, fields, api class AccountGroup(models.Model): _inherit = 'account.group' length_account = fields.Integer( ...
store=True) without_headquarter = fields.Boolean( string='Without headquarter in invoices and accounting entries', default=True)
<|file_name|>rows.go<|end_file_name|><|fim▁begin|>package core import ( "database/sql" "errors" "reflect" "sync" ) type Rows struct { *sql.Rows Mapper IMapper } func (rs *Rows) ToMapString() ([]map[string]string, error) { cols, err := rs.Columns() if err != nil { return nil, err } var results = make([]m...
}
<|file_name|>message.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python<|fim▁hole|> Define some attributes and methods to form your message. I suggest you don't alter this class. You're are free to do so, of course. It's your own decision. Though, I suggest you create your own message type an...
class Message(object): """ Base type of a message sent through the pipeline.
<|file_name|>str_to_string.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use rustc::lint::{LateContext, LintPass, LintArray, Lat...
match expr.node { hir::ExprMethodCall(ref method, _, ref args)
<|file_name|>l476xx--can_txmailbox.go<|end_file_name|><|fim▁begin|>// +build l476xx // Peripheral: CAN_TxMailBox_Periph Controller Area Network TxMailBox. // Instances: // Registers:<|fim▁hole|>// 0x04 32 TDTR CAN mailbox data length control and time stamp register. // 0x08 32 TDLR CAN mailbox data low register. ...
// 0x00 32 TIR CAN TX mailbox identifier register.
<|file_name|>encoding_tests.py<|end_file_name|><|fim▁begin|># coding=utf-8 import sys, os.path sys.path.insert(1, os.path.abspath(os.path.join(os.path.dirname(__file__), '../lib'))) sys.path.insert(1, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) import locale import unittest import test_lib as tes...
print "STARTING - ENCODING TESTS" print "==================" print "######################################################################" suite = unittest.TestLoader().loadTestsFromTestCase(EncodingTests)
<|file_name|>index.js<|end_file_name|><|fim▁begin|>/** * Knook-mailer * https://github.com/knook/knook.git * Auhtors: Alexandre Lagrange-Cetto, Olivier Graziano, Olivier Marin * Created on 15/04/2016.<|fim▁hole|> */ 'use strict'; module.exports = { Accounts: require('./src/Accounts'), Email: require('./sr...
* version 0.1.0
<|file_name|>0753-Cracking the Safe.py<|end_file_name|><|fim▁begin|>class Solution:<|fim▁hole|> for i in range(k ** n): prev = result[len(result) - n + 1:] for j in range(k - 1, -1, -1): curr = ''.join(prev) + str(j) if curr not in visited: ...
def crackSafe(self, n: int, k: int) -> str: result = ['0'] * n visited = set([''.join(result)])
<|file_name|>interface.rs<|end_file_name|><|fim▁begin|>use ast::*; use span::Span; #[derive(Debug, Eq, PartialEq, Clone, Serialize, Deserialize)] pub struct Interface {<|fim▁hole|> pub functions: Vec<FunctionSignature>, pub typ: Type, pub span: Span, } pub fn interface(name: String, functions: Vec<Function...
pub name: String,
<|file_name|>EVLA_pipe_fluxgains.py<|end_file_name|><|fim▁begin|>###################################################################### # # Copyright (C) 2013 # Associated Universities, Inc. Washington DC, USA, # # This library is free software; you can redistribute it and/or modify it # under the terms of the GNU Libr...
<|file_name|>MutableIncrement.java<|end_file_name|><|fim▁begin|>/* * Copyright 2010 Henry Coles * * 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/LICEN...
* software distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
<|file_name|>params_windows.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...
dfs_ha_namemodes_ids_list = dfs_ha_namenode_ids.split(",") dfs_ha_namenode_ids_array_len = len(dfs_ha_namemodes_ids_list) if dfs_ha_namenode_ids_array_len > 1: dfs_ha_enabled = True
<|file_name|>detailSelector.js<|end_file_name|><|fim▁begin|>var detailSelector = function() { return { restrict: 'E', scope : { items: '=', selectedItem: '=' }, replace: true, templateUrl: 'js/directives/detailSelector.html', link: function (sc...
scope.updateCurrentItem = function(value) {
<|file_name|>mobi6.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2 # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2011, Kovid Goyal <kovid@kovidgoyal.net>' _...
<|file_name|>make_erpnext_demo.py<|end_file_name|><|fim▁begin|>if __name__=="__main__": import sys sys.path.extend([".", "lib", "app"]) import webnotes, os import utilities.demo.make_demo def make_demo_app(): webnotes.mute_emails = 1 webnotes.connect() utilities.demo.make_demo.make(reset=True, simulate=False) #...
website_settings = webnotes.bean("Website Settings", "Website Settings") website_settings.doc.home_page = "demo-login" website_settings.doc.disable_signup = 1
<|file_name|>foundation.d.ts<|end_file_name|><|fim▁begin|>/** * Copyright 2016 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.apac...
}
<|file_name|>bfl.rs<|end_file_name|><|fim▁begin|>#[doc = "Register `BFL` reader"] pub struct R(crate::R<BFL_SPEC>); impl core::ops::Deref for R { type Target = crate::R<BFL_SPEC>; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } impl From<crate::R<BFL_SPEC>> for R { #[inline(...
#[doc = "Field `BFA1` writer - Boundary Flag 1 Activation Select"]
<|file_name|>data.py<|end_file_name|><|fim▁begin|>""" Utility functions for atmospheric data wrangling / preparation. - ndarrays - netCDF files - Lat-lon geophysical data - Pressure level data and topography """ from __future__ import division import numpy as np import pandas as pd import collections import scipy.int...
flip = True lat_out = lat_out[::-1]
<|file_name|>WiimoteEmu.cpp<|end_file_name|><|fim▁begin|>// Copyright 2010 Dolphin Emulator Project // Licensed under GPLv2+ // Refer to the license.txt file included. #include <cassert> #include <cmath> #include <cstring> #include "Common/ChunkFile.h" #include "Common/CommonTypes.h" #include "Common/MathUtil.h" #inc...
<|file_name|>gulpfile.js<|end_file_name|><|fim▁begin|>// // Adapted from: // http://stackoverflow.com/questions/22330103/how-to-include-node-modules-in-a-separate-browserify-vendor-bundle // var gulp = require('gulp'); var browserify = require('browserify'); var source = require('vinyl-source-stream'...
gulp.task('html', function () { var busters = JSON.parse(fs.readFileSync('busters.json'));
<|file_name|>physical_function.py<|end_file_name|><|fim▁begin|># Copyright 2018 Huawei Technologies Co.,LTD. # 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 # ...
if self.type != 'pf':
<|file_name|>draw.js<|end_file_name|><|fim▁begin|>'use strict'; import {should as should_} from 'chai'; const should = should_(); import {spy, stub} from 'sinon'; import {setCanvas, canvas, context} from '../src/canvas'; import draw from '../src/draw'; // import {Sprite} from '../../../script/src/sprite'; describe('...
<|file_name|>ast_to_hir.rs<|end_file_name|><|fim▁begin|>use std::ops::Range; use std::sync::Arc; use super::ast::{self, Assignment, Ast, AstKind, Identifier, Int, Struct, Symbol, Text}; use super::cst::{self, CstDb}; use super::cst_to_ast::CstToAst; use super::error::CompilerError; use super::hir::{self, Body, Express...
<|file_name|>connection.py<|end_file_name|><|fim▁begin|># # ovirt-engine-setup -- ovirt engine setup # Copyright (C) 2013-2015 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at #<...
# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS,
<|file_name|>modules.rs<|end_file_name|><|fim▁begin|>use parking_lot::RwLock; use std::sync::Arc; use crate::language::ty::SourceType; use crate::size::InstanceSize; use crate::utils::GrowableVec; use crate::vm::{ namespace_path, replace_type_param, Candidate, FctDefinitionId, Field, FieldDef, FileId, Namespac...
pub struct ModuleInstance { pub id: ModuleDefId, pub mod_id: Option<ModuleId>, pub parent_id: Option<ModuleDefId>,
<|file_name|>issue-9951.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/lice...
let (c, d): (&Bar, &Bar) = (&5, &9); }
<|file_name|>scons.py<|end_file_name|><|fim▁begin|># Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import gyp import gyp.common import gyp.SCons as SCons import os.path import pprint import re # TODO: remove ...
fp.write('\nimport os\n') fp.write('\nImport("env")\n')
<|file_name|>A24alt.py<|end_file_name|><|fim▁begin|># # @BEGIN LICENSE # # Psi4: an open-source quantum chemistry software package # # Copyright (c) 2007-2021 The Psi4 Developers. # # The copyrights for code used from other parties are included in # the corresponding files. # # This file is part of Psi4. # # Psi4 is fr...
H -0.92393815 0.85124826 2.70694633 H 0.92393815 0.85124826 2.70694633 -- 0 1
<|file_name|>export-declarations.selector.ts<|end_file_name|><|fim▁begin|>import { Injectable } from "@angular/core"; import { InjectionFactory } from "../../L0/L0.injection-factory/injection-factory"; import { createSelector } from "../../L4/L4.ngrx/create-selector"; import { StatementsSelector } from "./statements.se...
import { ExportDeclaration, SyntaxKind } from "typescript"; @Injectable()
<|file_name|>package_commands.py<|end_file_name|><|fim▁begin|>import glob import os from qgis.core import QgsApplication from command import command, complete_with from PyQt4.QtCore import QUrl from PyQt4.QtGui import QDesktopServices folder = os.path.join(QgsApplication.qgisSettingsDirPath(), "python", ...
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// Copyright 2015 Corey Farwell // // 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 // // Unl...
return Err("Top element is not <rss>, most likely not an RSS feed"); } let channel_elem = match rss_elem.get_child("channel", None) {
<|file_name|>win_reboot.py<|end_file_name|><|fim▁begin|># (c) 2016, Matt Davis <mdavis@ansible.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type import time from datetime import dat...
<|file_name|>module-routing.module.ts<|end_file_name|><|fim▁begin|>import {{ NgModule }} from '@angular/core'; import {{ Routes, RouterModule }} from '@angular/router'; import {{ {Resource}EditComponent }} from './{resources}-edit.component'; const routes: Routes = [ {{ path: '', component: {Resource}EditC...
}}
<|file_name|>gc_util.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python #------------------------------------------------------------------------------ # Copyright (C) 2013 Albert Simenon # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License a...
""" Argument parser """
<|file_name|>test_rowdatacollection.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals import unittest from ship.datastructures import rowdatacollection as rdc from ship.datastructures import dataobject as do from ship.fmp.datunits import ROW_DATA_TYPES as rdt class RowDataCollectionTests(unitt...
obj2 = do.FloatData(rdt.ELEVATION, format_str='{:>10}', default=None, no_of_dps=3) obj3 = do.FloatData(rdt.ROUGHNESS, format_str='{:>10}', default=0.0, no_of_dps=3) localcol = rdc.RowDataCollection()
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|># # 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 https://www.sourcefabric.org/superdesk/license import ...
# -*- coding: utf-8; -*- # # This file is part of Superdesk.
<|file_name|>gene.py<|end_file_name|><|fim▁begin|>from snovault import upgrade_step @upgrade_step('gene', '1', '2') def gene_1_2(value, system): # https://encodedcc.atlassian.net/browse/ENCD-5005 # go_annotations are replaced by a link on UI to GO value.pop('go_annotations', None) @upgrade_step('gene', '...
value.pop('locations', None)
<|file_name|>bode.py<|end_file_name|><|fim▁begin|>import uncertainties from uncertainties import ufloat import math import numpy import numpy import pylab from scipy.optimize import curve_fit import math import scipy.stats #Misuro a mano con il tester i valori che poi vado a mettere nel file, posso anche lasciare lo s...
Vout_o, dVout_o, f_o, df_o = pylab.loadtxt('/home/federico/Laboratorio3/relazione2/datiPassaBasso.txt', unpack=True) #Trascuriamo la resistenza in in uscita del generatore di funzioni cosi che V_in sia circa costante.
<|file_name|>PersonOutlineRounded.js<|end_file_name|><|fim▁begin|>import React from 'react'; import createSvgIcon from './utils/createSvgIcon'; <|fim▁hole|><|fim▁end|>
export default createSvgIcon( <React.Fragment><path fill="none" d="M0 0h24v24H0V0z" /><g><path d="M12 5.9c1.16 0 2.1.94 2.1 2.1s-.94 2.1-2.1 2.1S9.9 9.16 9.9 8s.94-2.1 2.1-2.1m0 9c2.97 0 6.1 1.46 6.1 2.1v1.1H5.9V17c0-.64 3.13-2.1 6.1-2.1M12 4C9.79 4 8 5.79 8 8s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm0 9c-2.67 0-8 1.34-8 4v...
<|file_name|>pointcut.js<|end_file_name|><|fim▁begin|>module.exports = (name, node) => (<|fim▁hole|> node.callee.type === "Identifier");<|fim▁end|>
name === "apply" && node.type === "CallExpression" &&