prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>edit.js<|end_file_name|><|fim▁begin|>'use strict'; var async = require('async'); var validator = require('validator'); var _ = require('underscore'); var db = require('../database'); var topics = require('../topics'); var user = require('../user'); var privileges = require('../privileges'); var plugins =...
function editMainPost(data, postData, callback) { var tid = postData.tid; var title = data.title ? data.title.trim() : '';
<|file_name|>errors.py<|end_file_name|><|fim▁begin|>__all__ = [ 'RedisError', 'ProtocolError', 'ReplyError', 'MaxClientsError', 'AuthError', 'PipelineError', 'MultiExecError', 'WatchVariableError', 'ChannelClosedError', 'ConnectionClosedError', 'ConnectionForcedCloseError', ...
class PoolClosedError(RedisError): """Raised if pool is closed."""
<|file_name|>sqlalchemy_utils.py<|end_file_name|><|fim▁begin|>from typing import Any, Optional import sqlalchemy from django.db import connection from zerver.lib.db import TimeTrackingConnection <|fim▁hole|># existing Django database connections. class NonClosingPool(sqlalchemy.pool.NullPool): def status(self) -...
# This is a Pool that doesn't close connections. Therefore it can be used with
<|file_name|>0078_auto__chg_field_alarm_last_checked.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'Alarm.last_c...
'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), 'alarm': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['ddsc_core.Alarm']"}), 'deactivated_on': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(1900, 1, 1, 0, 0...
<|file_name|>ReverseWords.py<|end_file_name|><|fim▁begin|>class Solution: def reverseWords(self, s) : print 1 / 0 tks = s.split(' '); tks = filter(None, tks) tks.reverse(); return ' '.join(tks).strip() <|fim▁hole|>test = ["the sky is blue", " a b "] sol = Solution(); for ...
<|file_name|>env.py<|end_file_name|><|fim▁begin|><|fim▁hole|>DVC_CHECKPOINT = "DVC_CHECKPOINT" DVC_DAEMON = "DVC_DAEMON" DVC_PAGER = "DVC_PAGER" DVC_ROOT = "DVC_ROOT" DVCLIVE_PATH = "DVCLIVE_PATH" DVCLIVE_SUMMARY = "DVCLIVE_SUMMARY" DVCLIVE_HTML = "DVCLIVE_HTML" DVCLIVE_RESUME = "DVCLIVE_RESUME" DVC_IGNORE_ISATTY = "DV...
<|file_name|>diagnostics.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import sys from collections import namedtuple import poppler import cairo from os.path import abspath Point = namedtuple('Point', ['x', 'y']) Line = namedtuple('Line', ['start', 'end']) Polygon = namedtuple('Polygon', 'points') Rectangle ...
for y in y_edges]
<|file_name|>MyComponentWiredTest.java<|end_file_name|><|fim▁begin|>// package it.at.oiml.bitbucket.lfs;<|fim▁hole|>// import com.atlassian.plugins.osgi.test.AtlassianPluginsTestRunner; // import at.oiml.bitbucket.lfs.MyPluginComponent; // import com.atlassian.sal.api.ApplicationProperties; // // import static org.juni...
// // import org.junit.Test; // import org.junit.runner.RunWith;
<|file_name|>cad2xls.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- ## @copyright # Software License Agreement (BSD License) # # Copyright (c) 2017, Jorge De La Cruz, Carmen Castano. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # ...
<|file_name|>check-kibana-settings.service.ts<|end_file_name|><|fim▁begin|>/* * Wazuh app - Check Kibana settings service * * Copyright (C) 2015-2021 Wazuh, Inc. * * 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 F...
await updateSetting(kibanaSettingName, defaultAppValue); checkLogger.action(`Updated [${kibanaSettingName}] setting to: ${stringifySetting(defaultAppValue)}`); callback && callback(checkLogger,{ defaultAppValue }); }
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
DEPS = [ 'recipe_engine/platform', ]
<|file_name|>test_context.py<|end_file_name|><|fim▁begin|>from testkit.context import * def test_context_user(): from contextlib import contextmanager test_dict = dict(value='before') @contextmanager def test_context(test_dict): test_dict['value'] = 'during' yield 'test' test_...
<|file_name|>rao.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2.7 # -*- mode: python; coding: utf-8; -*- """Module for generating lexicon using Rao and Ravichandran's method (2009). """ ################################################################## # Imports from __future__ import unicode_literals, print...
lex2lidx[iword] = len(ret) ret.append([iword, ipol, iscore]) return ret
<|file_name|>PathsVerifier.java<|end_file_name|><|fim▁begin|>// Copyright 2000-2018 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.diff.impl.patch.formove; import com.intellij.openapi.application.ApplicationManager; imp...
return new CheckDeleted(patch);
<|file_name|>assign_process.py<|end_file_name|><|fim▁begin|># IfcOpenShell - IFC toolkit and geometry engine # Copyright (C) 2021 Dion Moult <dion@thinkmoult.com> # # This file is part of IfcOpenShell. # # IfcOpenShell is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser Genera...
"related_object": None, }
<|file_name|>VerticalGlass.java<|end_file_name|><|fim▁begin|>/* * VerticalGlass.java * Copyright (C) 2010-2011 Jonas Eriksson * * 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 vers...
public void runMask(Image image) {
<|file_name|>member.rs<|end_file_name|><|fim▁begin|>//! Tracks membership. Contains both the `Member` struct and the `MemberList`. pub use crate::protocol::swim::Health; use crate::{error::{Error, Result}, protocol::{self, newscast, swim as ...
str::FromStr, sync::atomic::{AtomicUsize, Ordering}, time::{Duration,
<|file_name|>mapclassify.py<|end_file_name|><|fim▁begin|>""" A module of classification schemes for choropleth mapping. """ __author__ = "Sergio J. Rey" __all__ = ['Map_Classifier', 'quantile', 'Box_Plot', 'Equal_Interval', 'Fisher_Jenks', 'Fisher_Jenks_Sampled', 'Jenks_Caspall', 'Jenks_Caspall_F...
--------
<|file_name|>FBXLoader2.js<|end_file_name|><|fim▁begin|>/** * @author Kyle-Larson https://github.com/Kyle-Larson * * Loader loads FBX file and generates Group representing FBX scene. * Requires FBX file to be >= 7.0 and in ASCII format. * * Supports: * Mesh Generation (Positional Data) * Normal Data (Per Vert...
<|file_name|>eslint.js<|end_file_name|><|fim▁begin|>/** * DOCUMENTANTION * ---------------------------------------------------------------------------- * Each key in the .eslintrc corresponds to a page in the rules directory. * [Rules on eslint.org]{@link http://eslint.org/docs/rules/} * * The rest of the otpiosn...
Object.assign(config.rules, { /**
<|file_name|>calibration.py<|end_file_name|><|fim▁begin|>from __future__ import print_function import numpy as np import scipy.stats, scipy.optimize import acq4.pyqtgraph as pg class StageCalibration(object): def __init__(self, stage): self.stage = stage self.framedelay = None def calibrate(s...
# finish up if there are no more positions if finished:
<|file_name|>MerchantSideBar.tsx<|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/licenses/LI...
justify-content: space-between;
<|file_name|>session_persistence.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c)2012 Rackspace US, Inc. # All Rights Reserved. #<|fim▁hole|># http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, 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|>webrepl.py<|end_file_name|><|fim▁begin|># This module should be imported from REPL, not run from command line. import socket import uos import network import uwebsocket import websocket_helper import _webrepl listen_s = None client_s = None def setup_conn(port, accept_handler):<|fim▁hole|> ai = socke...
global listen_s listen_s = socket.socket() listen_s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
<|file_name|>navigator.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 dom::bindings::utils::{WrapperCache, BindingObject, Cac...
pub fn TaintEnabled(&self) -> bool { false }
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>import * as PaperUtil from './PaperUtil'; export { PaperUtil };<|fim▁hole|><|fim▁end|>
export { PivotType } from './PivotType'; export { SnapUtil } from './snap';
<|file_name|>project_plugins.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import from rest_framework.response import Response from sentry.plugins.base import plugins from sentry.api.bases.project import ProjectEndpoint from sentry.api.serializers import serialize<|fim▁hole|>class ProjectPluginsEndp...
from sentry.api.serializers.models.plugin import PluginSerializer
<|file_name|>uart.rs<|end_file_name|><|fim▁begin|>use core::fmt; use core::str::StrExt; use core::result::Result;<|fim▁hole|>pub trait Uart<W : HW> { fn put(&self, &mut W, ch : u8); } pub trait UartWriter : fmt::Write { } pub struct DummyUartWriter; impl UartWriter for DummyUartWriter { } impl fmt::Write for Du...
use hw::HW;
<|file_name|>plshadow.rs<|end_file_name|><|fim▁begin|>use winapi::*; use create_device; use dxsafe::*;<|fim▁hole|>use dxsafe::structwrappers::*; use dxsems::VertexFormat; use std::marker::PhantomData; // Point Light Shadow // The name isn't quite correct. This module just fills depth cubemap. pub struct PLShadow<T: Ve...
<|file_name|>Schuler.java<|end_file_name|><|fim▁begin|>public class Schuler {<|fim▁hole|> private int test2; private int test3; public Schuler() { name = ""; test1 = 0; test2 = 0; test3 = 0; } public void setName(String nm) { name = nm; } public String getName() { return name; } public void set...
private String name; private int test1;
<|file_name|>api.py<|end_file_name|><|fim▁begin|>import json import enum from urllib.parse import urlencode from urllib.request import urlopen from urllib import request class APINonSingle: def __init__(self, api_key, agent = "webnews-python", webnews_base = "https://webnews.csh.rit.edu/"): self.agent = a...
search = "search" compose = "compose"
<|file_name|>Sorveteria Tropical,py.py<|end_file_name|><|fim▁begin|>sabor = input() quantidade = int(input()) if sabor.lower() == "morango" or sabor.lower() == "cereja": total = quantidade*4.50 elif sabor.lower() == "damasco" or sabor.lower() == "siriguela":<|fim▁hole|> print("%.2f"%total) if quantidade > 2: p...
total = quantidade*3.80 else: total = quantidade*2.75
<|file_name|>win32_test.cpp<|end_file_name|><|fim▁begin|>// boost win32_test.cpp -----------------------------------------------------// // Copyright 2010 Vicente J. Botet Escriba // Distributed under the Boost Software License, Version 1.0. // See http://www.boost.org/LICENSE_1_0.txt // See http://www.boost.o...
#undef BOOST_USE_WINDOWS_H #include <boost/detail/win/basic_types.hpp>
<|file_name|>17.py<|end_file_name|><|fim▁begin|># Created by PyCharm Pro Edition # User: Kaushik Talukdar # Date: 30-03-17 # Time: 11:35 PM <|fim▁hole|> # tuple can't be modified but the variable holding a tuple can be assigned new values # basically changing the t...
<|file_name|>serializers.py<|end_file_name|><|fim▁begin|># topics.serializers # Serializers for the topic and voting models. # # Author: Benjamin Bengfort <bbengfort@districtdatalabs.com> # Created: Wed Sep 09 09:34:46 2015 -0400 # # Copyright (C) 2015 District Data Labs # For license information, see LICENSE.txt #<...
# ID: serializers.py [] benjamin@bengfort.com $ """
<|file_name|>daclips.py<|end_file_name|><|fim▁begin|>""" urlresolver XBMC Addon Copyright (C) 2011 t0mm0<|fim▁hole|> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3...
<|file_name|>DAOPerson.java<|end_file_name|><|fim▁begin|><|fim▁hole|>import java.util.List; import com.lms.jpa.Person; public interface DAOPerson { public boolean personExist(long personId); public void insertPerson(Person person); public void updatePerson(Person person); public void de...
package com.lms.dao;
<|file_name|>markers.py<|end_file_name|><|fim▁begin|>''' Display a variety of simple scatter marker shapes whose attributes can be associated with data columns from ``ColumnDataSources``. The full list of markers built into Bokeh is given below: * :class:`~bokeh.models.markers.Asterisk` * :class:`~bokeh.models.marker...
# functions derived from this class _args = ('x', 'y')
<|file_name|>row-harness.ts<|end_file_name|><|fim▁begin|>/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {ComponentHarness, HarnessPredicate} from '@angular/c...
<|file_name|>NullMemento.java<|end_file_name|><|fim▁begin|>/******************************************************************************* * Copyright (c) 2001, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Pub...
<|file_name|>cap.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ Sahana Eden Common Alerting Protocol (CAP) Model @copyright: 2009-2015 (c) Sahana Software Foundation @license: MIT Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated...
# --------------------------------------------------------------------- # List of Incident Categories -- copied from irs module <--
<|file_name|>serialize.js<|end_file_name|><|fim▁begin|>// eslint-disable-next-line import/prefer-default-export export const serializePlaylist = model => ({ _id: model.id, name: model.name,<|fim▁hole|> author: model.author, createdAt: model.createdAt, description: model.description, shared: model.shared, n...
<|file_name|>template-fun-ty.rs<|end_file_name|><|fim▁begin|>#![allow( dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals )]<|fim▁hole|>#[repr(C)] #[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)] pub struct Foo { pub _address: u8, } pub type Foo_FunctionPtr<T> = :...
<|file_name|>conv.rs<|end_file_name|><|fim▁begin|>use prelude::*; use kernels::activate::*; use densearray::prelude::*; use operator::prelude::*; use std::cell::{RefCell}; use std::cmp::{max}; use std::rc::{Rc}; #[derive(Clone, Copy, Debug)] pub struct Conv1dOperatorConfig { pub batch_sz: usize, pub in_dim: (u...
<|file_name|>test_validate_hash.py<|end_file_name|><|fim▁begin|>'''Tests for the ValidateHash object''' from __future__ import absolute_import import unittest from nose.tools import assert_true, assert_false from hashit.core.hash_data import HashData from hashit.core.hash_type import HashType from hashit.service.val...
<|file_name|>MpegDecoder.cpp<|end_file_name|><|fim▁begin|>//----------------------------------------------------------------------------- // Декодер Mpeg Layer 1,2,3 // Копонент звукового двигателя Шквал // команда : AntiTank // разработчик : Гилязетдинов Марат (Марыч) //-----------------------------------------------...
bx++;
<|file_name|>threatfox.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import requests import json misperrors = {'error': 'Error'} mispattributes = {'input': ['md5', 'sha1', 'sha256', 'domain', 'url', 'email-src', 'ip-dst|port', 'ip-src|port'], 'output': ['text']} moduleinfo = {'version': '0.1', 'author': 'Cor...
<|file_name|>FontsOverride.java<|end_file_name|><|fim▁begin|>package com.chandilsachin.diettracker.io; import android.app.Activity; import android.content.Context; import android.graphics.Typeface; import java.lang.reflect.Field; import java.util.HashMap; import java.util.Iterator; public final class FontsOverride {...
{ e.printStackTrace(); }
<|file_name|>index.js<|end_file_name|><|fim▁begin|>'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _assetloader = require('./assetloader'); var _assetloader2 = _interopRequireDefault(...
exports['default'] = { AssetLoader: _assetloader2['default'], Input: _input2['default'],
<|file_name|>Order.java<|end_file_name|><|fim▁begin|>package seborama.demo2.kafka.model; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; <|fim▁hole|>@JsonIgnoreProperties(ignoreUnknown = true) public class Order { private String id; private bo...
@JsonInclude(JsonInclude.Include.NON_EMPTY)
<|file_name|>macros4.rs<|end_file_name|><|fim▁begin|>// Make me compile! Scroll down for hints :) macro_rules! my_macro { () => { println!("Check out my macro!"); } ($val:expr) => { println!("Look at this other macro: {}", $val); } } fn main() { my_macro!(); my_macro!(7777); } ...
<|file_name|>378.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python from heapq import heapify, heapreplace class Solution(object): def kthSmallest(self, matrix, k): """ :type matrix: List[List[int]] :type k: int :rtype: int """ if len(matrix) is 1: retu...
while i < k - 1: val, nextval = h[0] if nextval: heapreplace(h, (nextval[0], nextval[1:]))
<|file_name|>EmptyIterator.java<|end_file_name|><|fim▁begin|>package com.github.saulis.enumerables; import java.util.Iterator; import java.util.NoSuchElementException; public class EmptyIterator<T> implements Iterator<T> { @Override public boolean hasNext() { return false;<|fim▁hole|> public T next...
} @Override
<|file_name|>UnsignedIntDecodingState.java<|end_file_name|><|fim▁begin|>package org.lastbamboo.common.util.mina.decode.binary; import org.littleshoot.mina.common.ByteBuffer; import org.littleshoot.mina.filter.codec.ProtocolDecoderOutput; import org.littleshoot.util.mina.DecodingState; /** * Decoding state for readin...
return this; }
<|file_name|>decorators.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, division, print_function, unicode_literals from django.contrib.auth.decorators import user_passes_test from django_otp import user_has_device from django_otp.conf import settings def otp_required(view=None, redirect_fiel...
:param if_configured: If ``True``, an authenticated user with no confirmed OTP devices will be allowed. Default is ``False``. :type if_configured: bool
<|file_name|>zigbeeoutputstep_test.py<|end_file_name|><|fim▁begin|>''' Created on Mar 8, 2013 @author: Gary ''' import unittest from housemonitor.outputs.zigbee.zigbeecontrol import ZigBeeControl from housemonitor.outputs.zigbee.zigbeeoutputstep import ZigBeeOutputStep from housemonitor.outputs.zigbee.zigbeeoutputthre...
self.assertEqual( Constants.TopicNames.ZigBeeOutput, zig.topic_name ) def test_step( self ):
<|file_name|>wireless_headset.py<|end_file_name|><|fim▁begin|>import time from headset import Headset from stream import Stream from common import Version, BytesStatus class WirelessHeadset(Headset): """This class represents the wireless version of the mindwave Args: dev: device link headse...
Headset.__init__(self, headset_id)
<|file_name|>cubic.py<|end_file_name|><|fim▁begin|>""" Function-like objects that creates cubic clusters. """ import numpy as np from ase.data import reference_states as _refstate from ase.cluster.factory import ClusterFactory class SimpleCubicFactory(ClusterFactory): spacegroup = 221 xtal_name = 'sc' ...
<|file_name|>dashboard.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """<|fim▁hole|> ⚡⚡⚡ Fast, Lightweight, Pluggable, TLS interception capable proxy server focused on Network monitoring, controls & Application development, testing, debugging. :copyright: (c) 2013-present by Abhinav Singh and cont...
proxy.py ~~~~~~~~
<|file_name|>users-rooms-list.js<|end_file_name|><|fim▁begin|>define('view/rooms/users-rooms-list', [<|fim▁hole|>], function ( View ) { function UsersRoomsListView() { View.apply(this, arguments); } View.extend({ constructor: UsersRoomsListView, template: { 'root':...
'view'
<|file_name|>Timex.java<|end_file_name|><|fim▁begin|>package edu.stanford.nlp.time; import java.io.Serializable; import java.util.Calendar; import java.util.Map; import java.util.regex.Pattern; import edu.stanford.nlp.util.Pair; import org.w3c.dom.Element; /** * Stores one TIMEX3 expression. This class is used for...
* tid ::= ID * {tid ::= TimeID * TimeID ::= t<integer>} * type ::= 'DATE' | 'TIME' | 'DURATION' | 'SET'
<|file_name|>style_properties.rs<|end_file_name|><|fim▁begin|>// This file was generated by gir (5c017c9) from gir-files (71d73f0) // DO NOT EDIT use StateFlags; use StyleProvider; use SymbolicColor; use ffi; use glib; use glib::object::IsA; use glib::translate::*; glib_wrapper! { pub struct StyleProperties(Objec...
<|file_name|>basic.py<|end_file_name|><|fim▁begin|>#encoding: utf8 class MemoryStorage(object): """ Simple(dummy) in-memory storage     In production better to use some database. Written to describe the api and testing """ def __init__(self, config): # configuration of channels and services prov...
return self.clients.pop(channel, None)
<|file_name|>main.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>}<|fim▁end|>
fn main() { let lucky_number = 7; // I’m feeling lucky today
<|file_name|>views.py<|end_file_name|><|fim▁begin|># coding=utf-8 from django_sae.contrib.tasks.cron import OperationView from django_sae.contrib.tasks.operations import TaskOperationMixin class OperationViewMock(OperationView): def get_operation(self, request):<|fim▁hole|><|fim▁end|>
return [TaskOperationMixin() for _ in range(0, 3)]
<|file_name|>application.py<|end_file_name|><|fim▁begin|>''' Created on 2013-7-21 @author: hujin '''<|fim▁hole|>import sys from PySide.QtGui import QApplication from mdeditor.ui.window import MainWindow class Application(QApplication): def __init__(self): ''' Constructor ''' s...
<|file_name|>plan.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from ..resource import Resource from collections import namedtuple class Plan(Resource): """ https://dev.chartmogul.com/v1.0/reference#plans """ _path = "/plans{/uuid}" _root_key = 'plans' _many = namedtuple('Plans', [_root_key, "cu...
from marshmallow import Schema, fields, post_load, EXCLUDE
<|file_name|>db.py<|end_file_name|><|fim▁begin|>import sqlite3 class Database: def __init__(self, dbfile, page_rows=100):<|fim▁hole|> self.dbfile = dbfile self.page_rows = page_rows self.conn = sqlite3.connect(self.dbfile) self.conn.row_factory = sqlite3.Row cursor = self.co...
<|file_name|>ForTestFakeSpout.java<|end_file_name|><|fim▁begin|>package com.feiyu.storm.streamingdatacollection.spout; /** * from https://github.com/apache/incubator-storm/blob/master/examples/storm-starter/src/jvm/storm/starter/spout/RandomSentenceSpout.java * modified by feiyu */ import java.util.Map; import java...
_collector.emit(new Values(tweet)); }
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.http import HttpResponse from django.views.generic import TemplateView, DetailView from django.views.generic.edit import FormView from .forms import DonationForm from .models import CardType import json class PagoView(FormView): form_class = DonationF...
template_name = 'done.html'
<|file_name|>benchmark.rs<|end_file_name|><|fim▁begin|>use std::mem; use mio::net::{AddressFamily, Inet, Inet6, SockAddr, InetAddr, IPv4Addr, SocketType, Dgram, Stream}; use std::io::net::ip::IpAddr; use native::NativeTaskBuilder; use std::task::TaskBuilder; use mio::os::{from_sockaddr}; use time::Instant; use std::vec...
pub use nix::sys::epoll::*;
<|file_name|>definitions.py<|end_file_name|><|fim▁begin|># Copyright (C) 2012-2020 Ben Kurtovic <ben.kurtovic@gmail.com> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction,...
"timeline", ]
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// ================================================================= // // * WARNING * // // This file is generated! // // Changes made to this file will be overwritten. If changes are // required to the generated code, the ...
pub use custom::*; pub use generated::*;
<|file_name|>2480.cc<|end_file_name|><|fim▁begin|>#include <cstdio> #include <vector> using namespace std; long long phi(long long n) { long long ans = n; for (long long i = 2LL; i*i <= n; i++) { if (n % i == 0LL) { ans -= ans / i; while (n % i == 0LL) { n /= i; } } } if (n > ...
}
<|file_name|>hex2dump.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # Copyright (c) 2008,2010,2011,2012,2013 Alexander Belchenko # All rights reserved. # # Redistribution and use in source and binary forms, # with or without modification, are permitted provided # that the following conditions are met: # # * Redist...
<|file_name|>sample_recognize_business_cards.py<|end_file_name|><|fim▁begin|># coding: utf-8 # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license inform...
if websites: for website in websites.value: print("Website: {} has confidence: {}".format(website.value, website.confidence)) addresses = business_card.fields.get("Addresses")
<|file_name|>LanScan.py<|end_file_name|><|fim▁begin|>import subprocess import time import sys import re class checkIfUp: __shellPings = [] __shell2Nbst = [] __ipsToCheck = [] checkedIps = 0 onlineIps = 0 unreachable = 0 timedOut = 0 upIpsAddress = [] computerName = [] ...
for ip in self.completeMacAddress: ips.append(ip) return ips
<|file_name|>tests.py<|end_file_name|><|fim▁begin|>from pysimplesoap.client import SoapClient def inspect(wsdl_url): client = SoapClient(wsdl=wsdl_url,trace=False) print("Target Namespace", client.namespace) for service in list(client.services.values()):<|fim▁hole|> for port in list(service['ports']...
<|file_name|>centos5.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # centos5.py - A webKickstart module to handle changes needed from # RHEL 5 to CentOS 5 Kickstart generation. # # Copyright 2007 NC State University # Written by Jack Neely <jjneely@ncsu.edu><|fim▁hole|># This program is free software...
# # SDG #
<|file_name|>simpleForLoop.py<|end_file_name|><|fim▁begin|>for x in undefined(): # ty<caret>pe: int<|fim▁hole|><|fim▁end|>
pass
<|file_name|>service_worker_micro_benchmark.py<|end_file_name|><|fim▁begin|># Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry.page import page as page from telemetry import story class Servi...
make_javascript_deterministic=False))
<|file_name|>base_function.py<|end_file_name|><|fim▁begin|>import numpy as np def data_concat(result_a): return np.concatenate(result_a, axis=0) def data_mean(result_a):<|fim▁hole|> return result_a def data_stack(result_a): return np.stack(result_a) def data_single(result_a): return result_a[0] ...
return np.mean(result_a) def data_identity(result_a):
<|file_name|>FirstFragment.java<|end_file_name|><|fim▁begin|>/* * The MIT License (MIT) *<|fim▁hole|>* * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including w...
* Copyright (c) 2015 Cleidimar Viana
<|file_name|>go90.py<|end_file_name|><|fim▁begin|># coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( determine_ext, ExtractorError, int_or_none, parse_age_limit, parse_iso8601,<|fim▁hole|> class Go90IE(InfoExtractor): _VAL...
)
<|file_name|>retrieve.py<|end_file_name|><|fim▁begin|>"""Retrieves the paths to the required schedule files.""" from datetime import datetime import logging import pytz from unipath import Path # Setup Logging LOG = logging.getLogger(__name__) def get_date(tz_string): """Generates todays date as string (in for...
<|file_name|>holme_kim.go<|end_file_name|><|fim▁begin|>// Copyright ©2015 The gonum Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package gen import ( "errors" "fmt" "math/rand" "github.com/gonum/graph" "github.com/gonum/gra...
return fmt.Errorf("gen: n <= m: n=%v m=%d", n, m)
<|file_name|>return_codes.py<|end_file_name|><|fim▁begin|># return_codes.py # # Copyright (C) 2018 Kano Computing Ltd. # License: http://www.gnu.org/licenses/gpl-2.0.txt GNU GPL v2 # # Return codes of binaries used throughout this project. class RC(object): """Return codes of binaries used throughout this project...
INCORRECT_ARGS = 1 NO_INTERNET = 2 NO_KANO_WORLD_ACC = 3
<|file_name|>patrol_smach_iterator.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """ patrol_smach_iterator.py - Version 1.0 2013-10-23 Control a robot using SMACH to patrol a square area a specified number of times Created for the Pi Robot Project: http://www.pirobot.org Copyright (c) 2013 Patric...
# Initialize the top level state machine
<|file_name|>training_dataset_test.py<|end_file_name|><|fim▁begin|># Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http:/...
dataset = dataset.repeat(100) dataset = dataset.batch(10)
<|file_name|>ResponsiveFontSizesChart.js<|end_file_name|><|fim▁begin|>import * as React from 'react'; // import of a small, pure module in a private demo // bundle size and module duplication is negligible /* eslint-disable-next-line no-restricted-imports */ import { convertLength } from '@mui/material/styles/cssUtils'...
<Box sx={{ height: 380, width: '100%', color: 'black' }}> <ResponsiveContainer> <LineChart margin={{
<|file_name|>geocode.js<|end_file_name|><|fim▁begin|>var config = require('./config'); var express = require('express'); var superagent = require('superagent'); /** * Auth Token */ var authToken = null; var expires = 0; var expires_in = 20160; // 14 days in minutes /** * Urls */ var OAUTH = 'https://www.arcgis....
neighborhood: addr.Neighborhood,
<|file_name|>enhancers.js<|end_file_name|><|fim▁begin|>import { applyMiddleware, compose } from 'redux'; import history from './history'; import { routerMiddleware } from 'react-router-redux'; import thunk from 'redux-thunk'; export default compose( applyMiddleware(thunk, routerMiddleware(history))<|fim▁hole|><|fi...
);
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import patterns, url<|fim▁hole|>from .views import FeedList, ImportView, AddView from .ajax import mark_as_read urlpatterns = patterns( '', url(r'^$', FeedList.as_view(), name="feedme-feed-list"), url(r'^by_category/(?P<category>[-\w]+...
<|file_name|>WebChangeCustomerPassword.java<|end_file_name|><|fim▁begin|>/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package elektra; import java.io.IOException; import java.io.PrintWriter; import java.io.FileInputStream; import java.io.InputStreamReader; import...
//leite auf die JSP Datei zum Anzeigen der Liste weiter dispatcher.forward(request, response);
<|file_name|>test_artifact.py<|end_file_name|><|fim▁begin|># ---------------------------------------------------------------------------- # Copyright (c) 2016-2017, QIIME 2 development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this s...
error_regex = ("Unrecognized.*foo.txt.*FourIntsDirectoryFormat") with self.assertRaisesRegex(ValueError, error_regex):
<|file_name|>MI_example.py<|end_file_name|><|fim▁begin|># Copyright (c) 2006-2007 The Regents of The University of Michigan # Copyright (c) 2009 Advanced Micro Devices, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the foll...
#
<|file_name|>App.js<|end_file_name|><|fim▁begin|>Kanboard.App = function() { this.controllers = {}; }; Kanboard.App.prototype.get = function(controller) { return this.controllers[controller]; }; Kanboard.App.prototype.execute = function() { for (var className in Kanboard) { if (className !== "App"...
} }
<|file_name|>HciCloudHwrHelper.java<|end_file_name|><|fim▁begin|>package com.sinovoice.pathfinder.hcicloud.hwr; import android.content.Context; import android.util.Log; <|fim▁hole|>import com.sinovoice.pathfinder.hcicloud.sys.SysConfig; public class HciCloudHwrHelper { private static final String TAG = HciCloudHw...
import com.sinovoice.hcicloudsdk.api.hwr.HciCloudHwr; import com.sinovoice.hcicloudsdk.common.hwr.HwrInitParam;
<|file_name|>studio_locale-bfd0c94141f74417a2ff3e69569591ae.js<|end_file_name|><|fim▁begin|>var studio_locale = {lc:{"ar":function(n){ if (n === 0) { return 'zero'; } if (n == 1) { return 'one'; } if (n == 2) { return 'two'; } if ((n % 100) >= 3 && (n % 100) <= 10 && n == Math.floor(n)) { ...
if ((n % 10) === 0 || ((n % 10) >= 5 && (n % 10) <= 9) || ((n % 100) >= 11 && (n % 100) <= 14) && n == Math.floor(n)) { return 'many'; }
<|file_name|>sunat_1_1_print.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2011 NUMA Extreme Systems (www.numaes.com) for Cubic ERP - Teradata SAC. (http://cubicerp....
})