prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>JavaObjectOutput.java<|end_file_name|><|fim▁begin|>/* * Copyright 2014-2015 itas group * * 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...
* See the License for the specific language governing permissions and
<|file_name|>type_.rs<|end_file_name|><|fim▁begin|>// Copyright 2013 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/...
}
<|file_name|>TomKitten48.xaml.cpp<|end_file_name|><|fim▁begin|>// // TomKitten48.xaml.cpp // Implementation of the TomKitten48 class // #include "pch.h" #include "TomKitten48.xaml.h" using namespace PrintableTomKitten; using namespace Platform; using namespace Windows::Foundation; <|fim▁hole|>using namesp...
<|file_name|>01-add-email-only-column-to-posts-meta-table.js<|end_file_name|><|fim▁begin|>const {createAddColumnMigration} = require('../../utils');<|fim▁hole|> defaultTo: false });<|fim▁end|>
module.exports = createAddColumnMigration('posts_meta', 'email_only', { type: 'bool', nullable: false,
<|file_name|>project_setup.py<|end_file_name|><|fim▁begin|>""" Load this into a Python Script widget (does not have to be connected to any other widgets), and set the project directory to the location of the git repo. Hit execute and enjoy! """ PROJECT_DIR = '/home/mahmoud/work/qualityvis' import sys sys.path.append...
sys.path.append(PROJECT_DIR+'/orange_scripts')
<|file_name|>test_init.py<|end_file_name|><|fim▁begin|>""" Tests for waffle utils features. """ import crum import ddt from django.test import TestCase from django.test.client import RequestFactory from edx_django_utils.cache import RequestCache from mock import patch from opaque_keys.edx.keys import CourseKey from waf...
<|file_name|>input_examples.py<|end_file_name|><|fim▁begin|>"""Deals with input examples for deep learning. One "input example" is one storm object. --- NOTATION --- The following letters will be used throughout this module. E = number of examples (storm objects) M = number of rows in each radar image N = number of...
:param sounding_file_name: Path to sounding file (will be read by
<|file_name|>debug_node.ts<|end_file_name|><|fim▁begin|>/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {Injector} from '../di'; import {DebugContext} from '...
export class DebugElement extends DebugNode { name !: string; properties: {[key: string]: any} = {}; attributes: {[key: string]: string | null} = {};
<|file_name|>base.py<|end_file_name|><|fim▁begin|>from requests import request, ConnectionError from social.utils import module_member, parse_qs from social.exceptions import AuthFailed class BaseAuth(object): """A django.contrib.auth backend that authenticates the user based on a authentication provider res...
if key in self.data) return extra_arguments
<|file_name|>max-test.js<|end_file_name|><|fim▁begin|>var vows = require("vows"), _ = require("../../"), load = require("../load"), assert = require("../assert"); var suite = vows.describe("d3.max"); suite.addBatch({ "max": { topic: load("arrays/max").expression("d3.max"), "returns the greatest ...
<|file_name|>queue.ts<|end_file_name|><|fim▁begin|>import { createPool } from '../index'; const pool = createPool( { create: function () { return Promise.resolve('test'); }, destroy: function (resource) { } }, { max: 10, idleTimeoutMillis: 30000, priorityRange: 3 } ); pool.ac...
pool.acquire(0).then(function (client) { pool.release(client);
<|file_name|>token.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: utf-8 -*- import mysql.connector #from token find userId #return 0 for error def findUser(userToken, cnx): userQuery = 'SELECT user_id FROM user_token WHERE user_token = %s' try: userCursor = cnx.cursor() userCur...
cnx.commit() return '1' except mysql.connector.Error as err: print('Something went wrong: {}'.format(err))
<|file_name|>GetInvoiceInfoFromUploadedFile.py<|end_file_name|><|fim▁begin|>import os import requests # pip install requests # The authentication key (API Key). # Get your own by registering at https://app.pdf.co API_KEY = "******************************************" # Base URL for PDF.co Web API requests BASE_URL = ...
# Prepare URL for 'invoice info' API request url = "{}/pdf/invoiceparser".format(BASE_URL)
<|file_name|>index.js<|end_file_name|><|fim▁begin|>import Botkit from 'botkit'; import os from 'os'; import Wit from 'botkit-middleware-witai';<|fim▁hole|> import storageCreator from '../lib/storage'; import setupReceiveMiddleware from '../middleware/receiveMiddleware'; import notWitController from './notWit'; import ...
import moment from 'moment-timezone'; import models from '../../app/models';
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from decimal import Decimal import random import hashlib from django.conf import settings from django.core.cache import cache from django.db.models.signals import post_save, post_delete, m2m_changed from waffle.models import Flag, Sample, Switch VERSION = (0, 9,...
if not hasattr(request, 'waffles'): request.waffles = {} elif flag_name in request.waffles:
<|file_name|>production.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ Production Configurations - Use djangosecure - Use Amazon's S3 for storing static files and uploaded media - Use mailgun to send emails - Use Redis on Heroku """ from __future__ import absolute_import, unicode_literals from boto.s3....
# CACHING # ------------------------------------------------------------------------------ # Heroku URL does not pass the DB number, so we parse it in
<|file_name|>muldiv.rs<|end_file_name|><|fim▁begin|>use {Style, Sign, Float, add_overflow, sub_overflow}; use std::i64; use std::ops::{Mul, MulAssign, Div, DivAssign}; use ramp::ll::limb::Limb; impl<'a> MulAssign<&'a Float> for Float { fn mul_assign(&mut self, other: &'a Float) { self.debug_assert_valid()...
let shift = bits - prec; let (raw_mult_exp, o1) = add_overflow(self.exp, other.exp);
<|file_name|>MaybeIgnoreElement.java<|end_file_name|><|fim▁begin|>/** * Copyright 2016 Netflix, 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/LIC...
d.dispose(); d = DisposableHelper.DISPOSED;
<|file_name|>criteo.js<|end_file_name|><|fim▁begin|>/** * @overview If this code is included on a page with wbads it will add the criteo data as global * targeting params to all ad slots rendered on the page. * * Set the globals window.CRTG_* prior to including this script * so the criteo tags are properly added. ...
url += '&cookieName=' + encodeURIComponent(w.CRTG_COOKIE_NAME); url += '&rnd=' + rnd;
<|file_name|>parameters.spec.ts<|end_file_name|><|fim▁begin|>import 'reflect-metadata'; import { SchemaObject, XParameterObject } from '@ts-stack/openapi-spec'; import { Parameters } from './parameters'; import { Column } from '../decorators/column'; describe('Parameters', () => { describe('without data model', () ...
<|file_name|>util.ts<|end_file_name|><|fim▁begin|>import * as Long from "long"; import * as loader from "../lib/loader/src";<|fim▁hole|>export const arrayHeaderSize = 12; // capacity:i32 + length:i32 + base:i32 export function hexdump(memory: WebAssembly.Memory, offset: number, length: number): string { var buffer =...
export { Long, loader };
<|file_name|>test_customer.py<|end_file_name|><|fim▁begin|>from unittest import mock import pytest import stripe from model_mommy import mommy from rest_framework.reverse import reverse from restframework_stripe import models from restframework_stripe.test import get_mock_resource @mock.patch("stripe.Customer.save...
customer_retrieve.return_value = get_mock_resource("Customer")
<|file_name|>zz_generated_certificateregistrationprovider_client.go<|end_file_name|><|fim▁begin|>//go:build go1.16 // +build go1.16 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft...
<|file_name|>SomeInterface.java<|end_file_name|><|fim▁begin|><|fim▁hole|>package eas.com; public interface SomeInterface { String someMethod(String param1, String param2, String param3, String param4); }<|fim▁end|>
<|file_name|>CircularLayout.py<|end_file_name|><|fim▁begin|># CircularLayout.py # Copyright (C) 2009 Matthias Treder # # 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 Li...
Provide the number of elements (nr_elements) and the radius (radius) when creating an intance of this layout. You can also provide the angular position of the first element (start)
<|file_name|>trader.py<|end_file_name|><|fim▁begin|><|fim▁hole|># -*- coding: utf-8 -*- import os import time import yaml import logging import threading from ybk.lighttrade.sysframe import Client as SysframeClient log = logging.getLogger('trader') configfile = open(os.path.join(os.path.dirname(__file__), 'trading.y...
#!/usr/bin/env python
<|file_name|>i18n.py<|end_file_name|><|fim▁begin|>import re from django.template import Node, Variable, VariableNode from django.template import TemplateSyntaxError, TokenParser, Library from django.template import TOKEN_TEXT, TOKEN_VAR from django.template.base import _render_value_in_context from django.utils import...
<|file_name|>XAxis.tsx<|end_file_name|><|fim▁begin|>import { extent } from 'd3-array'; import { ScaleBand } from 'd3-scale'; import React, { FC } from 'react'; import { buildTicks } from '../utils/axis'; import { isOfType } from '../utils/isOfType'; import textWrap from '../utils/svgTextWrap'; import { defaultPadding ...
domain, padding = defaultPadding, tickFormat = defaultTickFormat, labelOrientation = ELabelOrientation.HORIZONTAL,
<|file_name|>markstress.py<|end_file_name|><|fim▁begin|>### This program intends to combine same GSHF in citation tree, and sort them according to the first letter of title; ### Author: Ye Gao ### Date: 2017-11-7 import csv file = open('NodeCheckList.csv', 'rb') reader = csv.reader(file) NodeCheckList = list(reader)...
if element[2] != "": element[2] = int(element[2])
<|file_name|>file.go<|end_file_name|><|fim▁begin|>// Copyright 2013 Beego Authors // Copyright 2014 The Macaron Authors // // Licensed under the Apache License, Version 2.0 (the "License"): you may // not use this file except in compliance with the License. You may obtain // a copy of the License at // // http://ww...
item, err := c.read(key)
<|file_name|>list.module.ts<|end_file_name|><|fim▁begin|>// (C) Copyright 2015 Martin Dougiamas // // 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/LI...
AddonNotesComponentsModule,
<|file_name|>fixed_bug_11.rs<|end_file_name|><|fim▁begin|>/*! * # Expected behaviour: * The top cube will fall asleep while the bottom cube goes right at constant speed. * * # Symptoms: * Bothe cube fall asleep at some point. * * # Cause: * There was no way of customizing the deactivation threshold. * * # Sol...
use nphysics::world::World;
<|file_name|>env.go<|end_file_name|><|fim▁begin|>package app import ( "os" "strings" ) type Environment struct { Env string Port string } func (this *App) defaultEnv() Environment { return Environment{ Env: "development", Port: "5000",<|fim▁hole|>} func envMap() map[string]string { environ := os.Environ...
}
<|file_name|>subscription_log.py<|end_file_name|><|fim▁begin|><|fim▁hole|> _name = 'saas_portal.subscription_log' _order = 'id desc' client_id = fields.Many2one('saas_portal.client', 'Client') expiration = fields.Datetime('Previous expiration') expiration_new = fields.Datetime('New expiration') ...
from odoo import fields, models class SaasSubscriptionLog(models.Model):
<|file_name|>interest.py<|end_file_name|><|fim▁begin|>import os.path, sys sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir)) import json import falcon import urllib import uuid import settings import requests from geopy.geocoders import Nominatim import geopy.distance from geopy.dista...
start = geopy.Point(my_coordinates[0], my_coordinates[1]) d = geopy.distance.VincentyDistance(kilometers = 1) for x in range(0,360, 10):
<|file_name|>find_median.py<|end_file_name|><|fim▁begin|>''' Find the median element in an unsorted array '''<|fim▁hole|>import heapq def find_median(arr): # O(n) heapq.heapify(arr) num_elements = len(arr) if num_elements % 2 != 0: return arr[(num_elements + 1)/2 - 1] else: return (...
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models # Create your models here.<|fim▁hole|> ('Pertama', 'Perekayasa Pertama'), ('Muda', 'Perekayasa Muda'), ('Madya', 'Perekayasa Madya'), ('Utama', 'Perekayasa Utama'), ) nip = models.CharField(max_len...
class Profil(models.Model): awal = '' PILIHAN_JENJANG = ( (awal, '----'),
<|file_name|>syslog_json.py<|end_file_name|><|fim▁begin|># (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = ''' ...
<|file_name|>widgets.py<|end_file_name|><|fim▁begin|>from decimal import Decimal from django import forms from django.template.loader import render_to_string from django.template.defaultfilters import slugify class BaseWidget(forms.TextInput): """ Base widget. Do not use this directly. """ template = ...
if key:
<|file_name|>index.js<|end_file_name|><|fim▁begin|>'use strict'; const { messages, ruleName } = require('..'); testRule({ ruleName, config: [ { border: 2, '/^margin/': 1, }, ], accept: [ { code: 'a { margin: 0; }', }, { code: 'a { margin: 1px; }', }, { code: 'a { margin: var(--foo);...
<|file_name|>unwind.rs<|end_file_name|><|fim▁begin|>// taken from https://github.com/thepowersgang/rust-barebones-kernel <|fim▁hole|> // 'args' will print to the formatted string passed to panic! log!("file='{}', line={} :: {}", file, line, args); loop {} } #[lang="stack_exhausted"] #[no_mangle] pub extern ...
#[lang="panic_fmt"] #[no_mangle] pub extern "C" fn rust_begin_unwind(args: ::core::fmt::Arguments, file: &str, line: usize) -> ! {
<|file_name|>test_annotation.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...
# KIND, either express or implied. See the License for the
<|file_name|>test_example_app.py<|end_file_name|><|fim▁begin|>import tornado.testing from testexample import ExampleApp class TestExampleApp(tornado.testing.AsyncHTTPTestCase, tornado.testing.LogTrapTestCase): def get_app(self): return ExampleApp() def test_home(self): re...
def test_ticker(self):
<|file_name|>twitch.d.ts<|end_file_name|><|fim▁begin|>declare module "twitch" { export interface Links { next?: string; self: string; last?: string; channel?: string; } export interface FollowsResponse { _links: Links; _total: number; follo...
display_name: string, game: string, delay: number; language: string,
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from .fetch import FetchParser from .json_ld import JsonLdParser from .lom import LomParser from .lrmi import LrmiParser<|fim▁hole|>from .nsdl_dc import NsdlDcParser __all__ = [ 'FetchParser', 'JsonLdParser', 'LomParser', 'LrmiParser', 'NsdlDcPa...
<|file_name|>test_educollections.py<|end_file_name|><|fim▁begin|>from educollections import ArrayList def print_list_state(lst): print('Size is', lst.size()) print('Contents are', lst)<|fim▁hole|>print('Capacity is', arr.capacity()) print_list_state(arr) for i in range(10): print('Prepend', i) arr.p...
print() arr = ArrayList(10)
<|file_name|>PasswordValidator.js<|end_file_name|><|fim▁begin|>define( ({ nomatchMessage: "Lozinke se ne podudaraju.", badPasswordMessage: "Neispravna lozinka."<|fim▁hole|>}) );<|fim▁end|>
<|file_name|>base_renderer.py<|end_file_name|><|fim▁begin|>""" Copyright (c) 2013 Timon Wong 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 without limitation the r...
def get_executable(self): if not PY3K and os.name == 'nt':
<|file_name|>reader.rs<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
extern crate webservices;
<|file_name|>boss_lorekeeper_polkelt.cpp<|end_file_name|><|fim▁begin|>/* * Copyright (C) 2010-2013 Project SkyFire <http://www.projectskyfire.org/> * Copyright (C) 2010-2013 Oregon <http://www.oregoncore.com/> * Copyright (C) 2006-2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * Copyright (C) 2008-2013 T...
}; CreatureAI* GetAI_boss_lorekeeperpolkelt(Creature* creature) { return new boss_lorekeeperpolkeltAI (creature);
<|file_name|>mod.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/licens...
return; }
<|file_name|>UserTest.java<|end_file_name|><|fim▁begin|><|fim▁hole|> public void testGetUserId() throws Exception { } public void testSetUserId() throws Exception { } public void testGetPassword() throws Exception { } public void testSetPassword() throws Exception { } }<|fim▁end|>
package org.craftercms.studio.api.dto; public class UserTest {
<|file_name|>cmd_server_suite_test.go<|end_file_name|><|fim▁begin|>package cmdserver_test import ( "testing" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" )<|fim▁hole|>func TestCmdServer(t *testing.T) { RegisterFailHandler(Fail) RunSpecs(t, "CmdServer Suite") }<|fim▁end|>
<|file_name|>connectors_local.py<|end_file_name|><|fim▁begin|>import time from threading import Thread import threading from wtfj_ids import * from wtfj_utils import * class Printer: ''' Opens a new output window and prints messages sent to it ''' def __init__(self,header=''): self._header = header def send(self...
<|file_name|>apns_sender.go<|end_file_name|><|fim▁begin|>package apns import ( "errors" "github.com/cosminrentea/gobbler/server/connector" "github.com/jpillora/backoff" "github.com/sideshow/apns2" "net" "time" ) const ( // deviceIDKey is the key name set on the route params to identify the application deviceI...
func NewSender(config Config) (connector.Sender, error) { pusher, err := newPusher(config) if err != nil {
<|file_name|>0025_auto_20160616_1637.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Generated by Django 1.9.7 on 2016-06-16 16:37 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('pushkin', '0024_authparam...
model_name='command',
<|file_name|>webpack.config.js<|end_file_name|><|fim▁begin|><|fim▁hole|> module.exports = { entry: "./public/App.js", output: { filename: "bundle.js", path: path.resolve(__dirname, "public") } };<|fim▁end|>
var path = require("path");
<|file_name|>Link.js<|end_file_name|><|fim▁begin|>'use strict'; exports.__esModule = true; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Sy...
// we should probably use LocationUtils.createLocationDescriptor
<|file_name|>analyticsdata_v1beta_generated_beta_analytics_data_batch_run_pivot_reports_async.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 m...
<|file_name|>tileinfo.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """Print out a report about whats in a vectortile Usage: tileinfo.py [options] [SOURCE] Options: --srcformat=SRC_FORMAT Source file format: (tile | json) --indent=INT|None JSON indentation level. Defaults to 4. Use 'None' ...
else: indent = 4 with sys.stdin if src_name in ('-', None) else open(src_name, 'rb') as f:
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from rest_framework.decorators import api_view from django.shortcuts import get_object_or_404 from rest_framework.response import Response from rest_framework import status from .models import Person from .serializers import PersonSerializer @api_view(['GET', 'DELETE...
<|file_name|>brief.js<|end_file_name|><|fim▁begin|>finApp.directive('brief', function () {<|fim▁hole|> controllerAs: 'bfc' }; });<|fim▁end|>
return { restrict: 'E', templateUrl: 'views/directives/brief.html', controller: 'BriefController',
<|file_name|>091 image parent alpha.js<|end_file_name|><|fim▁begin|>var config = { type: Phaser.WEBGL, parent: 'phaser-example', scene: { preload: preload, create: create } }; var game = new Phaser.Game(config); function preload() { <|fim▁hole|> this.load.image('bunny', 'assets/spri...
<|file_name|>fetch.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # Copyright 2021 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. # This is generated, do not edit. Update BuildConfigGenerator.groovy and # 3ppFetch....
latest = sub.add_parser("latest") latest.set_defaults(func=lambda _opts: do_latest())
<|file_name|>functions.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Pluma External Tools plugin # Copyright (C) 2005-2006 Steve Frécinaux <steve@istique.net> # Copyright (C) 2012-2021 MATE Developers # # This program is free software; you can redistribute it and/or modify # it under the ter...
MultipleDocumentsSaver(window, panel, [window.get_active_document()], node) return elif node.save_files == 'all':
<|file_name|>htmlselectelement.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::attr::Attr; use dom::bindings::codegen::Bi...
} for opt in node.traverse_preorder().filter_map(Root::downcast::<HTMLOptionElement>) {
<|file_name|>compare_crud_spec.ts<|end_file_name|><|fim▁begin|>/* * Copyright 2019 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/lice...
<|file_name|>sep.py<|end_file_name|><|fim▁begin|>from outsourcer import Code from . import utils from .base import Expression from .constants import BREAK, POS, RESULT, STATUS class Sep(Expression): num_blocks = 2 def __init__( self,<|fim▁hole|> expr, separator, ...
<|file_name|>test_mysqldb.py<|end_file_name|><|fim▁begin|>import sys import pytest from opentracing.ext import tags from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker from opentracing_instrumentation.client_hooks import mysqldb as mysqldb_hooks from opentracing_instrumentation.request_conte...
def is_mysql_running(): try: import MySQLdb with MySQLdb.connect(host='127.0.0.1', user='root'):
<|file_name|>InspectorClientGtk.cpp<|end_file_name|><|fim▁begin|>/* * Copyright (C) 2008, 2012 Gustavo Noronha Silva * Copyright (C) 2010 Collabora Ltd. * * This library 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 F...
<|file_name|>cloudmailru.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- ''' Specto Add-on Copyright (C) 2015 lambda <|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 Founda...
<|file_name|>Robot.py<|end_file_name|><|fim▁begin|>import constants as c from gui.windows import VideoStream import socket import cv2 import urllib import numpy as np class Robot(object): def __init__(self, connection): self.connection = connection """ @type : Connections.ConnectionProcessEnd.Rob...
def start(self):
<|file_name|>login.js<|end_file_name|><|fim▁begin|>var userData = [ {'fName':'Justin', 'lName' : 'Gil', 'age': 70, 'gender': 'M', 'phone': '949-111-1111', 'profilePic': '../pix/justin.jpeg', 'city' : 'San Diego', 'add' : '55 Serenity' , 'Bio': 'I like soccer and long walks on the beach.', 'userIndex' : 1, 'user...
<|file_name|>difference.py<|end_file_name|><|fim▁begin|>""" Boolean geometry difference of solids. """ from __future__ import absolute_import #Init has to be imported first because it has code to workaround the python bug where relative imports don't work if the module is imported as a main module. import __init__ ...
def processElementNode(elementNode):
<|file_name|>try_except3.py<|end_file_name|><|fim▁begin|>##################################################################################### #<|fim▁hole|># copy of the license can be found in the License.html file at the root of this distribution. If # you cannot locate the Apache License, Version 2.0, please send ...
# Copyright (c) Microsoft Corporation. All rights reserved. # # This source code is subject to terms and conditions of the Apache License, Version 2.0. A
<|file_name|>twitter_client.rs<|end_file_name|><|fim▁begin|>use std::io::Read; use oauthcli::SignatureMethod::HmacSha1; use oauthcli::OAuthAuthorizationHeaderBuilder; use serde_json; use serde_json::Value; use reqwest::{Client, Url, StatusCode, Response}; use reqwest::header::{HeaderValue, AUTHORIZATION}; const API_U...
let json: Value = serde_json::from_str(&body).map_err(|_| TwitterError::InvalidResponse)?;
<|file_name|>order.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import unicode_literals from six import with_metaclass from decimal import Decimal from django.core.exceptions import ImproperlyConfigured, PermissionDenied from django.db import models, transaction from django.db.models.aggrega...
if set(TRANSITION_TARGETS.keys()).intersection(attrs['_transition_targets']): msg = "Mixin class {} already contains a transition named '{}'"
<|file_name|>ForceTorqueSensorHandle.java<|end_file_name|><|fim▁begin|>package us.ihmc.rosControl.wholeRobot; public interface ForceTorqueSensorHandle { double getTz(); double getTy(); double getTx(); double getFz(); double getFy(); double getFx();<|fim▁hole|>}<|fim▁end|>
String getName();
<|file_name|>sensor.rs<|end_file_name|><|fim▁begin|>extern crate libbeaglebone; <|fim▁hole|>use std::thread; use std::time::Duration; fn main() { // Create a new ADC object using AIN-0 and a scaling factor of 0. let sensor = ADC::new(AIN_0, 0.0); // Read from the ADC object every 50ms 100 times, and print out t...
use libbeaglebone::prelude::*;
<|file_name|>keyframes_rule.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/. */ //! Keyframes: https://drafts.csswg.org/css-animations...
/// The keyframes specified for this CSS rule. pub keyframes: Vec<Arc<Locked<Keyframe>>>,
<|file_name|>fastica_lz.py<|end_file_name|><|fim▁begin|># coding: utf-8 # In[ ]: import numpy as np import numexpr as ne def sym_decorrelation_ne(W): """ Symmetric decorrelation """ K = np.dot(W, W.T) s, u = np.linalg.eigh(K) return (u @ np.diag(1.0/np.sqrt(s)) @ u.T) @ W # logcosh def g_logcosh_ne(w...
W1 = sym_decorrelation_ne(W1) it = it +1
<|file_name|>textpad.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- #Ege Öz from PyQt4 import QtCore, QtGui import sys,os try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: def _fromUtf8(s): return s try: _encoding = QtGui.QApplication.UnicodeUTF8 def _translate(context, text, disambig): ...
if __name__ == "__main__":
<|file_name|>Client.cpp<|end_file_name|><|fim▁begin|>// ********************************************************************** // // Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved. // // ********************************************************************** #include <Ice/Ice.h> #include <IceGrid/IceGrid.h> #i...
//
<|file_name|>expr-if-unique.rs<|end_file_name|><|fim▁begin|>// run-pass // Tests for if as expressions returning boxed types<|fim▁hole|>fn test_box() { let rs: Box<_> = if true { Box::new(100) } else { Box::new(101) }; assert_eq!(*rs, 100); } pub fn main() { test_box(); }<|fim▁end|>
<|file_name|>l-calc_ja.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" encoding="utf-8"?> <!DOCTYPE TS> <TS version="2.1" language="ja_JP"> <context> <name>XDGDesktopList</name> <message> <location filename="../../../core/libLumina/LuminaXDG.cpp" line="608"/> <source>Multimedia</source> ...
<translation type="unfinished"></translation> </message> <message>
<|file_name|>Nederlands.nl.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" encoding="utf-8"?> <!DOCTYPE TS> <TS version="2.1" language="nl_NL"> <context> <name>CMS50Serial</name> <message> <location filename="../sleepyhead/oximetry.cpp" line="471"/> <source>Processing...</source> <tr...
<|file_name|>processlock.py<|end_file_name|><|fim▁begin|># Copyright (c) 2012 Hesky Fisher # See LICENSE.txt for details. # # processlock.py - Cross platform global lock to ensure plover only runs once. """Global lock to ensure plover only runs once.""" import sys class LockNotAcquiredException(Exception): pass...
<|file_name|>schema.py<|end_file_name|><|fim▁begin|>import graphene from graphene_django.types import DjangoObjectType from django.contrib.auth import (get_user_model, authenticate, login as auth_login, logout as auth_logout, update_session_auth_hash) fr...
password2 = graphene.String()
<|file_name|>gulpfile.js<|end_file_name|><|fim▁begin|>var gulp = require('gulp'); var browserify = require('gulp-browserify'); var uglify = require('gulp-uglify'); var minify = require('gulp-minify'); var rename = require('gulp-rename'); var concat = require('gulp-concat'); var notify = require("gulp-notify"); gulp.ta...
.pipe(gulp.dest('./public/css')) .pipe(notify("Vendors css bundle has been successfully compiled!")); });
<|file_name|>kendo-ui-tests.ts<|end_file_name|><|fim▁begin|>var is = { string: (msg: string) => { return true; }<|fim▁hole|>} // TreeView $(() => { var treeview = <kendo.ui.TreeView>$("#treeview").data("kendoTreeView"); is.string(treeview.text("#foo")); treeview.text("#foo", "bar"); }); ...
<|file_name|>wl_buffer.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 Jonathan Eyolfson use libc::{c_int, c_void, uint32_t}; use raw; use raw::types::listeners; use raw::types::objects; pub const WL_BUFFER_DESTROY: uint32_t = 0; #[inline(always)] pub unsafe fn wl_buffer_add_listener( wl_buffer: *mut objects:...
<|file_name|>remove_input_state.py<|end_file_name|><|fim▁begin|>''' This is a one-off command aimed at fixing a temporary problem encountered where input_state was added to the same dict object in capa problems, so was accumulating. The fix is simply to remove input_state entry from state for all problems in the affec...
dest='save_changes', default=False, help='Persist the changes that were encountered. If not set, no changes are saved.'),
<|file_name|>vision.py<|end_file_name|><|fim▁begin|>""" Vision-specific analysis functions. $Id: featureresponses.py 7714 2008-01-24 16:42:21Z antolikjan $ """ __version__='$Revision: 7714 $' from math import fmod,floor,pi,sin,cos,sqrt import numpy from numpy.oldnumeric import Float from numpy import zeros, array, s...
#this is taking away the DC component #complex_matrix[x,y] -= numpy.min(complex_matrix[x,y]) if x==15 and y==15:
<|file_name|>rules.py<|end_file_name|><|fim▁begin|>class Rule: ''' 规则父类 ''' def action(self,block,handler): ''' 加标记 ''' handler.start(self.type) handler.feed(block) handler.end(self.type) return True class HeadingRule(Rule): ''' 一号标题规则 ''' type='heading' def condition(self,block): ''' 判断文本块是...
type='title' first=True def condintion(self,block):
<|file_name|>GetClientDocumentsResponse.java<|end_file_name|><|fim▁begin|>package ru.lanbilling.webservice.wsdl; import java.util.ArrayList; import java.util.List; import javax.annotation.Generated; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind...
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import itertools as it from operator import attrgetter from flask import Markup, render_template, Blueprint, redirect, url_for, flash, abort, request from sqlalchemy import desc from .. import Execution, Stage, Task, TaskStatus from ..job.JobManager import JobManager...
return redirect(url_for('cosmos.index'))
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from braces.views import LoginRequiredMixin from django.views.generic import UpdateView from oauth2_provider.exceptions import OAuthToolkitError from oauth2_provider.http import HttpResponseUriRedirect from oauth2_provider.models import get_application_model as get_oau...
client_id = form.cleaned_data.get('client_id', '') application = get_oauth2_application_model().objects.get(client_id=client_id) scopes = form.cleaned_data.get('scope', '')
<|file_name|>dart_dependency_catcher.cc<|end_file_name|><|fim▁begin|>// Copyright 2015 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. #include "sky/engine/tonic/dart_dependency_catcher.h" #include "sky/engine/tonic/dar...
DartDependencyCatcher::DartDependencyCatcher(DartLibraryLoader& loader) : loader_(loader) { loader_.set_dependency_catcher(this);
<|file_name|>buf4_mat_irrep_rd_block.cc<|end_file_name|><|fim▁begin|>/* * @BEGIN LICENSE * * Psi4: an open-source quantum chemistry software package * * Copyright (c) 2007-2017 The Psi4 Developers. * * The copyrights for code used from other parties are included in * the corresponding files. * * This file is ...
/* Assign the value */
<|file_name|>authorize-steps.js<|end_file_name|><|fim▁begin|>/** * Created by moshensky on 6/17/15. */ import {inject} from 'aurelia-dependency-injection'; import {Session} from './session'; import {Logger} from './logger'; import {Locale} from './locale'; import {Config} from './config'; import {Redirect} from 'aure...
run(navigationInstruction, next) { if (!this.session.isUserLoggedIn() && navigationInstruction.config.route !== this.loginRoute) { this.logger.warn(this.locale.translate('pleaseLogin'));