prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>test_rowcount.py<|end_file_name|><|fim▁begin|>from sqlalchemy import * from sqlalchemy.test import * class FoundRowsTest(TestBase, AssertsExecutionResults): """tests rowcount functionality""" __requires__ = ('sane_rowcount', ) @classmethod def setup_class(cls): global em...
r = s.execute().fetchall()
<|file_name|>defaults.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.<|fim▁hole|> http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law o...
You may obtain a copy of the License at
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models from .managers import CRUDManager, CRUDException class CRUDFilterModel(models.Model): class Meta: abstract = True @classmethod def verify_user_has_role(cls, user, role, request): """ Call user-define...
<|file_name|>creation.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import unicode_literals import wx import widgetUtils class audio_album(widgetUtils.BaseDialog): def __init__(self, *args, **kwargs): super(audio_album, self).__init__(title=_("Create a new album"), parent=None)<|...
<|file_name|>mix_wav.py<|end_file_name|><|fim▁begin|>__author__ = 'ray' import wave import numpy as np wav_1_path = "origin.wav" wav_2_path = "clap.wav" wav_out_path = "mixed.wav" wav_1 = wave.open(wav_1_path, 'rb') wav_2 = wave.open(wav_2_path, 'rb') wav_out = wave.open(wav_out_path, 'wb') len_1 = wav_1.getnframe...
wav_out.setparams(wav_2.getparams())
<|file_name|>func.go<|end_file_name|><|fim▁begin|>package main // #include <stdlib.h> // #include <locale.h> import "C" import ( "os" "path/filepath" "runtime" "unsafe" ) const LC_NUMERIC = int(C.LC_NUMERIC) // setLocale sets locale func setLocale(lc int, locale string) {<|fim▁hole|> defer C.free(unsafe.Pointer...
l := C.CString(locale)
<|file_name|>render.rs<|end_file_name|><|fim▁begin|>use glfw_ffi::*; use nanovg; use std::os::raw::c_int; use std::ptr; #[repr(usize)] #[derive(PartialEq, Eq)] pub enum Fonts { Inter = 0, Vga8, Moderno, NumFonts, } pub struct RenderContext<'a> { window: *mut GLFWwindow, nvg: &'a nanovg::Conte...
<|file_name|>barrier.rs<|end_file_name|><|fim▁begin|>#[cfg(test)] mod tests; use crate::fmt; use crate::sync::{Condvar, Mutex}; /// A barrier enables multiple threads to synchronize the beginning /// of some computation. /// /// # Examples /// /// ``` /// use std::sync::{Arc, Barrier}; /// use std::thread; /// /// le...
} }
<|file_name|>test_smoke.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python import io import os import unittest import logging import uuid from mediafire import MediaFireApi, MediaFireUploader, UploadSession from mediafire.uploader import UPLOAD_SIMPLE_LIMIT_BYTES<|fim▁hole|>APP_ID = '42511' MEDIAFIRE_EMAIL = os.enviro...
<|file_name|>curve.go<|end_file_name|><|fim▁begin|>// Copyright (c) 2015-2021 The btcsuite developers // Copyright (c) 2015-2021 The Decred developers package btcec import ( secp "github.com/decred/dcrd/dcrec/secp256k1/v4" ) // JacobianPoint is an element of the group formed by the secp256k1 curve in // Jacobian pr...
// // NOTE: The point must be normalized for this function to return the correct
<|file_name|>unclosed-braces.rs<|end_file_name|><|fim▁begin|>struct S { x: [usize; 3], } fn foo() { { { println!("hi"); } } } fn main() { //~^ NOTE unclosed delimiter { {<|fim▁hole|> //~^ NOTE this delimiter might not be properly closed... foo(); ...
<|file_name|>base.py<|end_file_name|><|fim▁begin|># Copyright (C) 2010 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above co...
<|file_name|>user_domain_test.py<|end_file_name|><|fim▁begin|># coding: utf-8 # # Copyright 2018 The Oppia 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 # # ...
# Overriding method to add a new attribute added names 'fake_field'.
<|file_name|>test_tlslite_utils_ecc.py<|end_file_name|><|fim▁begin|># Copyright (c) 2014, Hubert Kario # # See the LICENSE file for legal information regarding use of this file. # compatibility with Python 2.6, for that we need unittest2 package, # which is not available on 3.3 or 3.4 try: import unittest2 as unit...
b'\xa0\x77\xaa\xd9\x50\x4f\x16\xaa\x5d\x52' b'\x28\xfc\xd7\xc2\x77\x48\x85\xee\x21\x3f'
<|file_name|>qtmain.cpp<|end_file_name|><|fim▁begin|>#include <QApplication> #include "qtreversimenudialog.h" int main(int argc, char *argv[]) { QApplication a(argc, argv); ribi::reversi::QtReversiMenuDialog w; w.show();<|fim▁hole|> return a.exec(); }<|fim▁end|>
<|file_name|>post.js<|end_file_name|><|fim▁begin|>const mongoose = require('mongoose') const TABLE_NAME = 'Post' const Schema = mongoose.Schema const ObjectId = Schema.Types.ObjectId const escape = (require('../utils')).escape const PostSchema = new Schema({ //类型 type: { type: String, default: 'post' // po...
},
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LI...
<|file_name|>chassis_1_0_0_chassis_actions.py<|end_file_name|><|fim▁begin|># coding: utf-8 """ Copyright 2015 SmartBear Software 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 ...
"""
<|file_name|>forloop.py<|end_file_name|><|fim▁begin|>#! /usr/bin/python # Joe Deller 2014 # Using for loops # Level : Beginner # Uses : Libraries, variables, operators, loops # Loops are a very important part of programming # The for loop is a very common loop # It counts from a starting number to a finishing number...
# Setup the connection and clear a space
<|file_name|>bigip_iapp_service.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2017 F5 Networks Inc. # # 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 ...
).to_dict() result.pop('_meta_data', None)
<|file_name|>index.d.ts<|end_file_name|><|fim▁begin|>// Type definitions for sinon-chai 2.7.0 // Project: https://github.com/domenic/sinon-chai // Definitions by: Kazi Manzur Rashid <https://github.com/kazimanzurrashid/>, Jed Mao <https://github.com/jedmao/> // Definitions: https://github.com/DefinitelyTyped/Definitely...
calledAfter(anotherSpy: Sinon.SinonSpy): Assertion; /**
<|file_name|>peasypytest.py<|end_file_name|><|fim▁begin|>from __future__ import print_function<|fim▁hole|> import gettext import gi gi.require_version('Peas', '1.0') from gi.repository import GObject from gi.repository import Peas from gi.repository import Peasy from gi.repository import Geany gettext.bindtextdomain(...
<|file_name|>index_stories.py<|end_file_name|><|fim▁begin|>import re from django.core.management.base import BaseCommand from django.contrib.auth.models import User from apps.rss_feeds.models import Feed from apps.reader.models import UserSubscription from optparse import make_option class Command(BaseCommand): op...
sub.feed.index_stories_for_search() except Feed.DoesNotExist: print " ***> Couldn't find %s" % sub.feed_id
<|file_name|>swirl.py<|end_file_name|><|fim▁begin|>from bibliopixel.animation.circle import Circle from bibliopixel.colors import palettes class Swirl(Circle): COLOR_DEFAULTS = ('palette', palettes.get('three_sixty')), def __init__(self, layout, angle=12, **kwds): super().__init__(layout, **k...
def step(self, amt=1): for a in range(0, 360, self.angle):
<|file_name|>application.js<|end_file_name|><|fim▁begin|>// This is a manifest file that'll be compiled into application.js, which will include all the files // listed below. // // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,<|fim▁hole|>// It's not advisable to ad...
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. //
<|file_name|>pad.rs<|end_file_name|><|fim▁begin|>use ffi::*; use caps::Caps; use reference::Reference; use object::Object; use std::ptr; use std::mem; use std::ops::{Deref, DerefMut}; pub struct Pad{ pad: Object } #[derive(Debug)] #[repr(isize)] pub enum LinkReturn{ WrongHierarchy = GST_PAD_LINK_WRONG_HIERAR...
<|file_name|>post.ts<|end_file_name|><|fim▁begin|>// Imports import { BaseRepository } from './base'; // Imports models import { Post } from './../../entities/post'; export class PostRepository extends BaseRepository { constructor(host: string, username: string, password: string) { super(host, username, ...
} public async insert(post: Post): Promise<boolean> {
<|file_name|>db_migrate.py<|end_file_name|><|fim▁begin|><|fim▁hole|>#!hyphen-venv/bin/python import imp from migrate.versioning import api from app import db from config import SQLALCHEMY_DATABASE_URI from config import SQLALCHEMY_MIGRATE_REPO migration = SQLALCHEMY_MIGRATE_REPO + \ '/versions/%03d_mig...
<|file_name|>securitygroups_db.py<|end_file_name|><|fim▁begin|># Copyright 2012 VMware, 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://...
<|file_name|>struct_defs.rs<|end_file_name|><|fim▁begin|>// Copyright 2016 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...
#[rustc_clean(label="Hir", cfg="cfail2")] #[rustc_clean(label="HirBody", cfg="cfail2")] #[rustc_clean(label="TypeOfItem", cfg="cfail2")]
<|file_name|>pfsense-updateCRL.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import sys from pfsense_api import PfSenseAPI from datetime import datetime from pfsense_cmdline import PfSenseOptionParser from ConfigParser import ConfigParser from pfsense_logger import PfSenseLogger as logging import os.path pa...
configFile = ConfigParser()
<|file_name|>export_all_graphml.py<|end_file_name|><|fim▁begin|># Albert Cardona 2014-11-20 # This file is meant to be run from within ./manage.py shell in the environment, like: # [1] load export_all_graphml.py # [2] project_id = 12 # [2] export(project_id, "all.graphml") # # Will generate a gzip'ed file like "all.gra...
<|file_name|>joiner.rs<|end_file_name|><|fim▁begin|>// Exercise 2.3 // I were better to be eaten to death with a rust than to be scoured to nothing with perpetual motion. use std::os; use std::io::File; fn xor(a: &[u8], b: &[u8]) -> ~[u8] { let mut ret = ~[]; for i in range(0, a.len()) { ret.push(a[i] ...
<|file_name|>styles.js<|end_file_name|><|fim▁begin|>import { StyleSheet } from "react-native"; const styles = StyleSheet.create({ container: { flex: 1, justifyContent: "flex-start", alignItems: "center", backgroundColor: "#669999" }, buttons: { // flex: 0.15, ...
<|file_name|>Patches.cpp<|end_file_name|><|fim▁begin|>// This is an open source non-commercial project. Dear PVS-Studio, please check it. // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // ****************************************************************** // *********************************...
PATCH_ENTRY("D3D_SetCommonDebugRegisters", xbox::EMUPATCH(D3D_SetCommonDebugRegisters), PATCH_HLE_D3D),
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># flake8: noqa from .account import AccountViewSet from .allocation import AllocationViewSet from .allocation_source import AllocationSourceViewSet from .boot_script import BootScriptViewSet from .base import BaseRequestViewSet from .credential import CredentialView...
from .link import ExternalLinkViewSet from .machine_request import MachineRequestViewSet from .maintenance_record import MaintenanceRecordViewSet from .platform_type import PlatformTypeViewSet
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>import Router = require('koa-router');<|fim▁hole|> const router = new Router({ prefix: '/toolkit' }); router.get('/example', routes.example); router.post('/upload', validator(schema.upload), routes.upload); export default router;<|fim▁end|>
import * as schema from './schema'; import * as routes from './routes'; import validator from '../../utils/validator';
<|file_name|>VcsConsoleLine.java<|end_file_name|><|fim▁begin|>// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.openapi.vcs; import com.intellij.execution.ui.ConsoleView; import com.intellij.execution.ui.Con...
@Nullable
<|file_name|>destringify.js<|end_file_name|><|fim▁begin|>var __window = window; var destringify = function(date) { if (date != null && 'string' === typeof(date)) return new Date(date); return date;<|fim▁hole|> if (!date) return null; return dateFormat(date, "UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"); } var stringre...
} var stringify = function(date) {
<|file_name|>removeOldDellReports.py<|end_file_name|><|fim▁begin|>################################################################################ # # This program is part of the DellMon Zenpack for Zenoss. # Copyright (C) 2008, 2009, 2010 Egor Puzanov. # # This program can be used under the GNU General Public License ...
# ################################################################################ __doc__='''
<|file_name|>pickerController.js<|end_file_name|><|fim▁begin|>app.controller('PickerController', function ($scope, $modalInstance, itemColor) { $scope.showCarrierColors = true; $scope.brandColors = [ { name: 'Brand Blue', hex: '#276681' }, { name: 'Brand Green', hex: '#66b245' }, { name: ...
name: 'Lightest Yellow', hex: '#fdf6dd' }, {
<|file_name|>MenuOpenRounded.js<|end_file_name|><|fim▁begin|><|fim▁hole|>import * as React from 'react'; import createSvgIcon from './utils/createSvgIcon'; export default createSvgIcon( <path d="M4 18h11c.55 0 1-.45 1-1s-.45-1-1-1H4c-.55 0-1 .45-1 1s.45 1 1 1zm0-5h8c.55 0 1-.45 1-1s-.45-1-1-1H4c-.55 0-1 .45-1 1s.45 ...
<|file_name|>char.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licen...
<|file_name|>SystemStatusPage.java<|end_file_name|><|fim▁begin|>/* * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. ...
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// Copyright (C) 2019 Ruben Gonzalez <rgonzalez@fluendo.com> // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // optio...
use glib::prelude::*;
<|file_name|>LoadThumbnailTask.java<|end_file_name|><|fim▁begin|>package com.jasonsoft.softwarevideoplayer; import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory.Options; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; i...
<|file_name|>cpower1200_rss.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """<|fim▁hole|>it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that...
RSS Reader for C-Power 1200 Copyright 2010-2012 Michael Farrell <http://micolous.id.au/> This library is free software: you can redistribute it and/or modify
<|file_name|>views.py<|end_file_name|><|fim▁begin|><|fim▁hole|># -*- coding: utf-8 -*- from rest_framework import viewsets from . import serializers, models class FileViewSet(viewsets.ModelViewSet): queryset = models.File.objects.all() serializer_class = serializers.FileSerializer<|fim▁end|>
<|file_name|>tree.js<|end_file_name|><|fim▁begin|>module.exports = /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache /******...
this.root = this.store.root; } }; //
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// Copyright (c) The Diem Core Contributors // SPDX-License-Identifier: Apache-2.0 mod aliases; pub mod ast; mod byte_string; mod hex_string;<|fim▁hole|><|fim▁end|>
pub(crate) mod translate;
<|file_name|>index.ts<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
export * from './TestClass';
<|file_name|>test_patroni.py<|end_file_name|><|fim▁begin|>import etcd import logging import os import signal import time import unittest import patroni.config as config from mock import Mock, PropertyMock, patch from patroni.api import RestApiServer from patroni.async_executor import AsyncExecutor from patroni.dcs.etc...
def test_shutdown(self): self.p.api.shutdown = Mock(side_effect=Exception) self.p.ha.shutdown = Mock(side_effect=Exception) self.p.shutdown()
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>#![cfg(target_os = "android")] use crate::api::egl::{ Context as EglContext, NativeDisplay, SurfaceType as EglSurfaceType, }; use crate::CreationError::{self, OsError}; use crate::{ Api, ContextError, GlAttributes, PixelFormat, PixelFormatRequirements, Rect, }; ...
ctx.egl_context.on_surface_created(nwin as *const _); } } })));
<|file_name|>sender_test.go<|end_file_name|><|fim▁begin|>package loki_test import ( "bytes" "encoding/json" "fmt" "testing" "time" "github.com/andviro/goldie" "github.com/andviro/grayproxy/pkg/loki" "github.com/prometheus/common/model" ) type testHandler bytes.Buffer func (t *testHandler) Handle(ls model.La...
"full_message": "Backtrace here\n\nmore stuff",
<|file_name|>modbus_server.rs<|end_file_name|><|fim▁begin|>use crate::prelude::*; use libmodbus_sys as ffi; /// The server is waiting for request from clients and must answer when it is concerned by the request. The libmodbus /// offers the following functions to handle requests: /// /// * Receive /// - [`receive(...
) -> Result<i32, Error>;
<|file_name|>manaboy.py<|end_file_name|><|fim▁begin|>import time import net.mapserv as mapserv import net.charserv as charserv import commands import walkto import logicmanager import status import plugins from collections import deque from net.inventory import get_item_index, get_storage_index from utils import extend...
for cmd, action in manaboy_commands.items(): plugins.chatbot.add_command(cmd, action)
<|file_name|>manage_user.py<|end_file_name|><|fim▁begin|>""" Support tool for disabling user accounts. """ from django.contrib.auth import get_user_model from django.db.models import Q from django.urls import reverse from django.utils.decorators import method_decorator from django.utils.translation import ugettext as...
user.set_password(generate_password(length=25))
<|file_name|>test_suite_b.py<|end_file_name|><|fim▁begin|># Suite B tests # Copyright (c) 2014-2015, Jouni Malinen <j@w1.fi> # # This software may be distributed under the terms of the BSD license. # See README for more details. import time import logging logger = logging.getLogger() import hostapd from utils import ...
<|file_name|>newmessage.py<|end_file_name|><|fim▁begin|>import re from .base import EventBuilder from .._misc import utils from .. import _tl from ..types import _custom class NewMessage(EventBuilder, _custom.Message): """ Represents the event of a new message. This event can be treated to all effects as...
msg = _tl.Message( out=update.out,
<|file_name|>solution_util.py<|end_file_name|><|fim▁begin|>import numpy as np <|fim▁hole|> numBandits, numArms = estimates.shape explore = np.zeros(numBandits) explore[np.random.random(numBandits) <= epsilon] = 1 arm = np.argmax(estimates, axis=1) arm[explore == 1] = np.random.randint(0, numArms, np...
def e_greedy(estimates, epsilon):
<|file_name|>test-iframe-transport.js<|end_file_name|><|fim▁begin|>/** * Copyright 2017 The AMP HTML 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 * * ...
const {queue} = IframeTransport.getFrameData(iframeTransport.getType()); expect(queue.queueSize()).to.equal(1); iframeTransport.sendRequest('hello again, world!', config);
<|file_name|>AbstractView.java<|end_file_name|><|fim▁begin|>package org.turbogwt.mvp; import com.google.gwt.user.client.ui.Composite; /** * Abstract class for every View in the TurboGWT-MVP framework. * <p> * It provides access to its Presenter via the {@link #getPresenter} method. * * @param <P> the Presenter t...
* * @author Danilo Reinert */
<|file_name|>import-dialog.component.ts<|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 * * https://www.apache.org/lice...
this.projectId, this.layerId,
<|file_name|>test_phishing.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- """ Copyright 2017 Fedele Mantuano (https://www.linkedin.com/in/fmantuano/) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may ...
self.email_form = parser.mail
<|file_name|>absoluteLoad.ts<|end_file_name|><|fim▁begin|>/** * Copyright (c) 2015-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ export default () => [ { id: 1, name: '1' }, { id: 2, name: '2' },<|fim▁ho...
<|file_name|>log_manager.py<|end_file_name|><|fim▁begin|># Authors: John Dennis <jdennis@redhat.com> # # Copyright (C) 2011 Red Hat # see file 'COPYING' for use and warranty information # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as pu...
Global levels are supported via the verbose and debug flags
<|file_name|>g3Config.C<|end_file_name|><|fim▁begin|>//------------------------------------------------ // The Virtual Monte Carlo examples // Copyright (C) 2007 - 2014 Ivana Hrivnacova // All rights reserved. // // For the licensing terms see geant4_vmc/LICENSE. // Contact: root-vmc@cern.ch //-------------------------...
new TGeant3("C++ Interface to Geant3"); cout << "Geant3 has been created." << endl;
<|file_name|>hmm.py<|end_file_name|><|fim▁begin|>#author Matt Jacobsen ''' This program will learn and predict words and sentences using a Hierarchical Hidden Markov Model (HHMM). Implement a Baum-Welch algorithm (like EM?) to learn parameters Implement a Viterbi algorithm to learn structure. Implement a forward-backw...
#will be used to store alpha_t+1
<|file_name|>test_selenium.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals import time import pytest @pytest.mark.selenium def test_ui(selenium):<|fim▁hole|> selenium.browser.get(selenium.url('/download')) time.sleep(3)<|fim▁end|>
<|file_name|>app.po.ts<|end_file_name|><|fim▁begin|>import { browser, by, element } from 'protractor'; export class Angular2Page { navigateTo() { return browser.get('/'); } getParagraphText() {<|fim▁hole|> } }<|fim▁end|>
return element(by.css('app-root h1')).getText();
<|file_name|>cache.py<|end_file_name|><|fim▁begin|>import time import os import sys import hashlib import gc import shutil import platform import errno import logging try: import cPickle as pickle except: import pickle from parso._compatibility import FileNotFoundError LOG = logging.getLogger(__name__) _PI...
def save_module(hashed_grammar, path, module, lines, pickling=True, cache_path=None): try: p_time = None if path is None else os.path.getmtime(path)
<|file_name|>voting_variant.py<|end_file_name|><|fim▁begin|>from app import db from sqlalchemy import Column, String, Integer, ForeignKey<|fim▁hole|> class VotingVariant(db.Model): __tablename__ = 'voting_variants' id = Column(Integer, primary_key=True) voting_id = Column(Integer, ForeignKey('votings.id'))...
<|file_name|>borrowck-overloaded-index-autoderef.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // h...
p.use_ref(); }
<|file_name|>config.js<|end_file_name|><|fim▁begin|>System.config({ baseURL: "/", defaultJSExtensions: true, transpiler: "babel", babelOptions: { "optional": [ "runtime" ], "stage": 1 }, paths: { "github:*": "jspm_packages/github/*", "npm:*": "jspm_packages/npm/*" }, map: { ...
},
<|file_name|>test_probe_count.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # Copyright (c) Suchakra Sharma <suchakrapani.sharma@polymtl.ca> # Licensed under the Apache License, Version 2.0 (the "License") from bcc import BPF, _get_num_open_probes, TRACEFS import os import sys from unittest import main, TestCa...
<|file_name|>wsgi.py<|end_file_name|><|fim▁begin|>""" WSGI config for mongobacked project. <|fim▁hole|>https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/ """ import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mongobacked.settings") from django.core.wsgi import get_wsgi_application application = get_...
It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see
<|file_name|>server_errors.tsx<|end_file_name|><|fim▁begin|>/* * Copyright 2022 ThoughtWorks, 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/license...
} }
<|file_name|>gidhistograms.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2014 Michael Krause ( http://krause-software.com/ ). # You are free to use this code under the MIT license: # http://opensource.org/licenses/MIT """Show some histograms for a directory a Xcode pr...
parser.add_argument('--startyear', type=int, default=2006) parser.add_argument('--endyear', type=int, default=2014) parser.add_argument('-n', '--max-files', action='store', type=int, default=None, help='maximum number of files to process') parser.add_argument('--max-firstnames', action='store', type=int...
<|file_name|>ConfigCommandBase.java<|end_file_name|><|fim▁begin|><|fim▁hole|> public abstract class ConfigCommandBase<T extends VdcActionParametersBase> extends CommandBase<T> { protected ConfigCommandBase(T parameters) { super(parameters); } }<|fim▁end|>
package org.ovirt.engine.core.bll; import org.ovirt.engine.core.common.action.VdcActionParametersBase;
<|file_name|>main.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python ## globals primes_set = set() primes_list = [] def is_prime(n): limit = int(round(sqrt(n))) i = 2 while True: if i > limit: return True if n % i == 0: return False def find_prime_permutations(n): ...
def find_arith_seq(_set): l = sorted(list(_set)) if len(l) < 3:
<|file_name|>borrowck-univariant-enum.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.a...
enum newtype { newvar(int) }
<|file_name|>__SharedActionCreators.js<|end_file_name|><|fim▁begin|>"use strict"; import assert from "assert"; import sinon from "sinon"; import testPlease from "../helpers/testPlease"; import { genericDouble } from "../helpers/doubles"; import * as JobsActionCreators from "../../../src/js/actions/JobsActionCreators"; ...
desc: "a new job item" },
<|file_name|>build.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/. */<|fim▁hole|>#![feature(path, io, env)] use std::env; use std::ol...
<|file_name|>0_1_initial.py<|end_file_name|><|fim▁begin|># Copyright 2014 OpenStack Foundation. # Copyright 2014 Intel 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 cop...
<|file_name|>taskcluster-spark-dogfood.py<|end_file_name|><|fim▁begin|><|fim▁hole|>#!/usr/bin/env python import os.path config = { "default_vcs": "tc-vcs", "default_actions": [ 'checkout-sources', 'build', 'build-symbols', 'make-updates', 'prep-upload', 'submit-to...
<|file_name|>reducer.spec.js<|end_file_name|><|fim▁begin|>import reducer, { addFlag, fetchAll } from '../reducer' import fetchAllSuccess from './__fixtures__/fetch_all_success' const INITIAL_STATE = reducer(undefined, {}) test('has correct defaults', () => { snapshot(INITIAL_STATE) }) <|fim▁hole|>test('fetch all', ...
<|file_name|>TotalVelocity.py<|end_file_name|><|fim▁begin|># Copyright (C) 2014 Pierre de Buyl # Copyright (C) 2012,2013 # Max Planck Institute for Polymer Research # Copyright (C) 2008,2009,2010,2011 # Max-Planck-Institute for Polymer Research & Fraunhofer SCAI # # This file is part of ESPResSo++. # ...
""" from espressopp.esutil import cxxinit
<|file_name|>RasterizerTaskSVGConverterController.java<|end_file_name|><|fim▁begin|>/* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF license...
return true; }
<|file_name|>sleepy.py<|end_file_name|><|fim▁begin|># Speak.activity # A simple front end to the espeak text-to-speech engine on the XO laptop # http://wiki.laptop.org/go/Speak # # Copyright (C) 2008 Joshua Minor # Copyright (C) 2014 Walter Bender # This file is part of Speak.activity # # Parts of Speak.activity are ...
class Sleepy(Eye): def __init__(self, fill_color):
<|file_name|>Content_var_Choice110.java<|end_file_name|><|fim▁begin|>package tmp.generated_xhtml;<|fim▁hole|>import cide.gast.*; import cide.gparser.*; import cide.greferences.*; import java.util.*; public class Content_var_Choice110 extends Content_var_Choice1 { public Content_var_Choice110(Element_i element_i...
<|file_name|>membership.rs<|end_file_name|><|fim▁begin|>/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This software may be used and distributed according to the terms of the * GNU General Public License version 2. */ use anyhow::Result; use async_trait::async_trait; use std::panic::RefUnwindSafe; us...
#[async_trait]
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>mod fmt; mod key; mod strfmt; mod test_trait; use super::FmtError; #[test] fn test_error() {<|fim▁hole|> // just make sure this compiles mostly let err = FmtError::Invalid("fmt error".to_string()); let v = err.to_string(); println!("{}", v); }<|fim▁end|>
<|file_name|>cmd_whowas.py<|end_file_name|><|fim▁begin|>from twisted.plugin import IPlugin from twisted.words.protocols import irc from txircd.config import ConfigValidationError from txircd.module_interface import Command, ICommand, IModuleData, ModuleData from txircd.utils import durationToSeconds, ipAddressToShow, i...
<|file_name|>kociemba.js<|end_file_name|><|fim▁begin|>"use strict"; var utils = require('./utils.js'); var nChooseK = utils.nChooseK; var tic = utils.tic; var toc = utils.toc; var movesDef = { "U" : [[0,0,0,0, 0,0,0,0], [1,2,3,0, 4,5,6,7], [0,0,0,0, 0,0,0,0, 0,0,0,0], [1,2,3,0, 4,5,6,7, 8,9,10,11], [0,1,2,3,4,...
<|file_name|>fxch_ST0_ST2.java<|end_file_name|><|fim▁begin|>/*<|fim▁hole|> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it wil...
JPC: An x86 PC Hardware Emulator for a pure Java Virtual Machine Copyright (C) 2012-2013 Ian Preston
<|file_name|>storage.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>// Copyright 2020 TiKV Project Authors. Licensed under Apache-2.0. define_error_codes!( "KV:Storage:", TIMEOUT => ("Timeout", "", ""), EMPTY_REQUEST => ("EmptyRequest", "", ""), CLOSED => ("Closed", "", ""), IO => ("Io", "", ""), ...
<|file_name|>sortController.d.ts<|end_file_name|><|fim▁begin|>// Type definitions for ag-grid v4.0.5 // Project: http://www.ag-grid.com/ // Definitions by: Niall Crosby <https://github.com/ceolter/> // Definitions: https://github.com/borisyankov/DefinitelyTyped import { Column } from "./entities/column"; export declare...
private dispatchSortChangedEvents(); private clearSortBarThisColumn(columnToSkip); private getNextSortDirection(column);
<|file_name|>blender_sim.py<|end_file_name|><|fim▁begin|>"""Simulation of controlled dumbbell around Itokawa with simulated imagery using Blender This will generate the imagery of Itokawa from a spacecraft following a vertical descent onto the surface. 4 August 2017 - Shankar Kulumani """ from __future__ import abs...
<|file_name|>conf.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # M2Crypto documentation build configuration file, created by # sphinx-quickstart on Thu Apr 20 11:15:12 2017. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration value...
]
<|file_name|>TimeLineWidget.cpp<|end_file_name|><|fim▁begin|>/* * TimeLineWidget.cpp - class timeLine, representing a time-line with position marker * * Copyright (c) 2004-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net> * * This file is part of LMMS - https://lmms.io * * This program is free software; yo...