prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>import os from setuptools import setup, find_packages <|fim▁hole|> os.path.dirname(__file__), filename)).read() entry_points = """ [zc.buildout] default = svetlyak40wt.recipe.symlinks:Symlinks [zc.buildout.uninstall] default = svetlyak40wt.recipe.symli...
def read(filename): return open(os.path.join(
<|file_name|>create.js<|end_file_name|><|fim▁begin|>#!/usr/bin/env node // requires var webcredits = require('../lib/webcredits.js'); var program = require('commander'); /** * version as a command */ function bin(argv) { // setup config var config = require('../config/dbconfig.js'); program .option('-c...
var defaultWallet = 'https://localhost/wallet/test#this'; config.currency = program.currency || config.currency || defaultCurrency; config.database = program.database || config.database || defaultDatabase;
<|file_name|>game.js<|end_file_name|><|fim▁begin|>import React from 'react' import { useSelector } from 'react-redux' import Container from 'react-bootstrap/Container' import Row from 'react-bootstrap/Row' import Col from 'react-bootstrap/Col' import MoveSelector from '../containers/move-selector' import Footer from '...
<|file_name|>validator.schema.test.ts<|end_file_name|><|fim▁begin|>import * as fs from 'fs'; import * as mocha from 'mocha' import {expect} from 'chai' import {Validator} from '../src/validator/validator' describe('Validate Schemas', () => { var validator: Validator; var _self = this; before((done) => { ...
<|file_name|>InputAdornment.js<|end_file_name|><|fim▁begin|>import _extends from "@babel/runtime/helpers/esm/extends"; import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties"; import * as React from 'react'; import PropTypes from 'prop-types'; import clsx from 'clsx'; import Typography...
disablePointerEvents = _props$disablePointer === void 0 ? false : _props$disablePointer, _props$disableTypogra = props.disableTypography,
<|file_name|>metering_agent.py<|end_file_name|><|fim▁begin|># Copyright (C) 2013 eNovance SAS <licensing@enovance.com> # # Author: Sylvain Afchain <sylvain.afchain@enovance.com> # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may...
ts = int(time.time()) delta = ts - self.last_report
<|file_name|>beam_job_domain_test.py<|end_file_name|><|fim▁begin|># coding: utf-8 # # Copyright 2021 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 # ...
<|file_name|>Agent.cpp<|end_file_name|><|fim▁begin|>#include "Agent.h" #include <algorithm> Agent::Agent() { } Agent::Agent(float _speed, float _health, const glm::vec2 & _startPos, const GameEngine::GLTexture & _texture, GameEngine::ColorRGBA8 & _color, std::weak_ptr<World> _world) : m_movementSpeed(_sp...
return true; }
<|file_name|>hu.py<|end_file_name|><|fim▁begin|># coding: utf8 { '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN', '%Y-%m-%d': '%Y.%m.%d.'...
'Group ID': 'Group ID', 'Hello World': 'Hello Vil\xc3\xa1g',
<|file_name|>host-template.component.ts<|end_file_name|><|fim▁begin|>import { Component, Input } from '@angular/core'; import { Config } from '../../config'; @Component({ selector: 'host-template', styles: [` textarea { width: 400px; height: 100px; } `], template: ` <div *ngIf="hostfile"><|fim▁hole|> ...
<|file_name|>transit.rs<|end_file_name|><|fim▁begin|>/* Copyright (c) 2015, 2016 Saurav Sachidanand 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 limitatio...
<|file_name|>lean.ts<|end_file_name|><|fim▁begin|>/* * This file is part of CoCalc: Copyright © 2020 Sagemath, Inc. * License: AGPLv3 s.t. "Commons Clause" – see LICENSE.md for details */ import * as CodeMirror from "codemirror"; /* This is just a first tiny quick step. To finish this: - Look at https://codemi...
(CodeMirror as any).defineSimpleMode("lean", {
<|file_name|>no-eq-branch-fail.rs<|end_file_name|><|fim▁begin|>#![warn(indirect_structural_match)] struct NoEq; enum Foo { Bar, Baz, Qux(NoEq), } // Even though any of these values can be compared structurally, we still disallow it in a pattern // because `Foo` does not impl `PartialEq`.<|fim▁hole|>const...
<|file_name|>task_02.py<|end_file_name|><|fim▁begin|><|fim▁hole|>#!/usr/bin/env python # -*- coding: utf-8 -*- """ Performing mathematical calculations """ WEEKS = (((19 % 10) + 100) + (2 ** 8)) / 7<|fim▁end|>
<|file_name|>setup.py<|end_file_name|><|fim▁begin|># Copyright 2015 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://www.apache.org/...
<|file_name|>player.py<|end_file_name|><|fim▁begin|>from . import Event class PlayerEvent(Event): def setup(s): s.username = s.username.encode('ascii') #Raised in manager class PlayerJoin(PlayerEvent): username = Event.Arg(required=True) ip = Event.Arg(required=True) class PlayerQuit(Pla...
<|file_name|>DeviceActivity.java<|end_file_name|><|fim▁begin|>package cn.edu.siso.rlxapf; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; public class DeviceActivity extends AppCompatActivity { priva...
devicePrefOk = (Button) findViewById(R.id.device_pref_ok); devicePrefOk.setOnClickListener(new View.OnClickListener() {
<|file_name|>test_wait4.py<|end_file_name|><|fim▁begin|>"""This test checks for correct wait4() behavior. """ import os import time from test.fork_wait import ForkWait from test.test_support import run_unittest, reap_children, get_attribute # If either of these do not exist, skip this test. get_attribute(os, 'fork') ...
if __name__ == "__main__": test_main()
<|file_name|>UserController.js<|end_file_name|><|fim▁begin|>(function(){ angular .module('users') .controller('UserController', [ 'userService', '$mdSidenav', '$mdBottomSheet', '$log', '$q', UserController ]);<|fim▁hole|> * Main Controller for the Angular Material Starter A...
/**
<|file_name|>CGRTTI.cpp<|end_file_name|><|fim▁begin|>//===--- CGCXXRTTI.cpp - Emit LLVM Code for C++ RTTI descriptors ----------===// // // The LLVM Compiler Infrastructure<|fim▁hole|>// // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details....
<|file_name|>PrimitiveLongIntVisitor.java<|end_file_name|><|fim▁begin|>/*<|fim▁hole|> * * Neo4j is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any la...
* Copyright (c) 2002-2018 "Neo Technology," * Network Engine for Objects in Lund AB [http://neotechnology.com] * * This file is part of Neo4j.
<|file_name|>_KeyNavMixin.js<|end_file_name|><|fim▁begin|>//>>built define("dijit/_KeyNavMixin",["dojo/_base/array","dojo/_base/declare","dojo/dom-attr","dojo/keys","dojo/_base/lang","dojo/on","dijit/registry","dijit/_FocusMixin"],function(_1,_2,_3,_4,_5,on,_6,_7){ return _2("dijit._KeyNavMixin",_7,{tabIndex:"0",chil...
_19(evt,this.focusedChild);
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>pub mod file;<|fim▁hole|>pub mod hash_map;<|fim▁end|>
<|file_name|>0006_auto__add_contact.py<|end_file_name|><|fim▁begin|># encoding: 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): # Adding model 'Contact' db.create_tab...
'translation_id': ('uuidfield.fields.UUIDField', [], {'unique': 'True', 'max_length': '32', 'blank': 'True'}) }, 'storybase_user.project': { 'Meta': {'object_name': 'Project'},
<|file_name|>LicenseHeaderBearTest.py<|end_file_name|><|fim▁begin|>import os from queue import Queue from bears.general.LicenseHeaderBear import LicenseHeaderBear from coalib.testing.LocalBearTestHelper import LocalBearTestHelper from coalib.results.Result import Result from coalib.settings.Section import Section from...
<|file_name|>time.py<|end_file_name|><|fim▁begin|>from yapsy.IPlugin import IPlugin from manager.message import Message import protocol.control as control import schedule class Time(IPlugin, Message): def __init__(self): IPlugin.__init__(self) Message.__init__(self) self.text = control.S...
self.schedule = schedule.every(3).hours
<|file_name|>transifex.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import os, sys from polib import pofile from config import CONFIGURATION from extract import SOURCE_WARN from execute import execute <|fim▁hole|>def push(): execute('tx push -s') def pull(): for locale in CONFIGURATION.locales: ...
TRANSIFEX_HEADER = 'Translations in this file have been downloaded from %s' TRANSIFEX_URL = 'https://www.transifex.com/projects/p/edx-studio/'
<|file_name|>2_6_attraction.rs<|end_file_name|><|fim▁begin|>// The Nature of Code // Daniel Shiffman // http://natureofcode.com // // Example 2-6: Attraction use nannou::prelude::*; fn main() { nannou::app(model).update(update).run(); } struct Model { mover: Mover, attractor: Attractor, } struct Mover { ...
m.attractor.display(&draw); m.mover.display(&draw); // Write the result of our drawing to the window's frame.
<|file_name|>util.rs<|end_file_name|><|fim▁begin|>use super::engine::{Action, Round}; use super::state::GameState; use crate::cards::BasicCard; pub fn format_hand(hand: &[BasicCard], gs: &GameState) -> String { let mut cards: Vec<_> = hand.iter().collect(); cards.sort_by(|a, b| gs.display_order(a, b)); le...
gs.trump ) }
<|file_name|>schedule_events.js<|end_file_name|><|fim▁begin|>'use strict' class ScheduleEvents { constructor (aws) { // Authenticated `aws` object in `lib/main.js` this.lambda = new aws.Lambda({ apiVersion: '2015-03-31' }) this.cloudwatchevents = new aws.CloudWatchEvents({ apiVersion: '20...
return this._putTargets(params)
<|file_name|>tasks.py<|end_file_name|><|fim▁begin|>from invoke import task, run #from fabric.api import local, lcd, get, env #from fabric.operations import require, prompt #from fabric.utils import abort import requests import rdflib import getpass import os.path import os import setlr from os import listdir from rdfl...
if not filename.endswith('.ttl') or filename.startswith('#'): continue print('Adding fragment', filename)
<|file_name|>inline.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/. */ #![deny(unsafe_code)] use app_units::Au; use block::AbsoluteA...
}
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>use std::fmt; use std::cmp::{max, min}; use termion; use app::word::Bucket; pub mod brush; //--- #[allow(dead_code)] #[derive(Debug)] pub enum HAlignment { AlignLeft, AlignMiddle, AlignRight } #[allow(dead_code)] #[derive(Debug)] pub enum VAlignment { ...
height: Measurement::Value(enough_height_for_all as u16), width: Measurement::Value(5 as u16) }, align: Alignment::top_left()
<|file_name|>util.js<|end_file_name|><|fim▁begin|>export const ATTR_ID = 'data-referid' export let info = { component: { amount: 0, mounts: 0, unmounts: 0 } } export let getId = () => Math.random().toString(36).substr(2) export let pipe = (fn1, fn2) => function(...args) { fn1.apply(this, args) return fn2.a...
if (!source.hasOwnProperty(key)) { continue
<|file_name|>leetcode_problems.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding=utf-8 -*- <|fim▁hole|>import argparse import requests from lxml import html as lxml_html try: import html except ImportError: import HTMLParser html = HTMLParser.HTMLParser() try: import cPickle as pk exc...
import sys import re import os
<|file_name|>RegisteredServicesReloadDisablingBeanFactoryPostProcessor.java<|end_file_name|><|fim▁begin|>package net.unicon.cas.addons.serviceregistry; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.BeansException; import org.springframework.beans.factory.config.BeanFactoryPo...
<|file_name|>conftest.py<|end_file_name|><|fim▁begin|>import pytest from tests.functional.services.api.images import ( add_image, delete_image_by_id, get_image_id, wait_for_image_to_analyze, ) from tests.functional.services.utils.http_utils import get_api_conf @pytest.fixture(scope="package") def add...
return add_resp
<|file_name|>match-tag.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licen...
fn process(c: color) -> isize { let mut x: isize;
<|file_name|>Repairpply.js<|end_file_name|><|fim▁begin|>// JavaScript Document var flag1=true; var flag2=true; $(function () { /*********************/ $.ajax({ type : 'POST', dataType : 'json', url : 'baseNeiName.do', async : true, cache : false, error : function(request) { b...
var name=$("#name").val(); var address=$("#address").val(); var budget=$("#budget").val(); budget=budget.trim();
<|file_name|>_VF.py<|end_file_name|><|fim▁begin|>import torch import sys import types class VFModule(types.ModuleType): def __init__(self, name): super(VFModule, self).__init__(name)<|fim▁hole|> def __getattr__(self, attr): return getattr(self.vf, attr) sys.modules[__name__] = VFModule(__name...
self.vf = torch._C._VariableFunctions
<|file_name|>pub-ident-fn-or-struct.rs<|end_file_name|><|fim▁begin|>// Copyright 2017 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.apa...
<|file_name|>message_widget.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, division, print_function import os from time import ctime from qtpy import QtWidgets from glue import core from glue.utils.qt import load_ui class MessageWidget(QtWidgets.QWidget, core.hub.HubListener): """ This ...
self.ui = load_ui('message_widget.ui', self, directory=os.path.dirname(__file__))
<|file_name|>IPipelineStep.ts<|end_file_name|><|fim▁begin|>/** * Interface for pipeline steps. */<|fim▁hole|> export interface IPipelineStep { mainCondition(uniteConfiguration: UniteConfiguration, engineVariables: EngineVariables): boolean | undefined; initialise(logger: ILogger, fileSystem: I...
import { IFileSystem } from "unitejs-framework/dist/interfaces/IFileSystem"; import { ILogger } from "unitejs-framework/dist/interfaces/ILogger"; import { UniteConfiguration } from "../configuration/models/unite/uniteConfiguration"; import { EngineVariables } from "../engine/engineVariables";
<|file_name|>room_test.go<|end_file_name|><|fim▁begin|>package hipchat import ( "encoding/json" "fmt" "io/ioutil" "net/http" "os" "reflect" "testing" ) func TestRoomGet(t *testing.T) { setup() defer teardown() mux.HandleFunc("/room/1", func(w http.ResponseWriter, r *http.Request) { if m := "GET"; m != r....
<|file_name|>utils.py<|end_file_name|><|fim▁begin|># # Licensed under the Apache License, Version 2.0 (the "License"); you may<|fim▁hole|># not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless req...
<|file_name|>xmlToJson.js<|end_file_name|><|fim▁begin|>// Changes XML to JSON exports.xml2json = function(xml){ return xmlToJson(xml); }; <|fim▁hole|> var obj = {}; if (xml.nodeType == 1) { // element // do attributes if (xml.attributes.length > 0) { obj["@attributes"] = {}; for (var j = 0; j < xml.attribu...
function xmlToJson(xml) { // Create the return object
<|file_name|>cache_tests.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """API Request cache tests.""" # # (C) Pywikibot team, 2012-2014 # # Distributed under the terms of the MIT license. # from __future__ import unicode_literals __version__ = '$Id$'<|fim▁hole|> from tests import _cache_dir from tests.aspec...
# from pywikibot.site import BaseSite import scripts.maintenance.cache as cache
<|file_name|>snippet.py<|end_file_name|><|fim▁begin|>import vim def func_header_snippet(row): cmt = "//!" cb = vim.current.buffer start = row while start >= 0: line = cb[start-1].strip() if not line.startswith(cmt): break start -= 1 print("HDR") def select_sn...
def main(): row, col = vim.current.window.cursor
<|file_name|>p200_048.py<|end_file_name|><|fim▁begin|>''' mode | desc r 또는 rt | 텍스트 모드로 읽기 w 또는 wt | 텍스트 모드로 쓰기 a 또는 at | 텍스트 모드로 파일 마지막에 추가하기 rb | 바이너리 모드로 읽기 wb | 바이너리 모드로 쓰기 ab | 바이너리 모드로 파일 마지막에 추가하기 <|fim▁hole|> f.write("abcd") f.close() r = open("./py200_sample.txt"...
''' f = open("./py200_sample.txt", "w")
<|file_name|>testParser.py<|end_file_name|><|fim▁begin|># testParser.py # ------------- # Licensing Information: You are free to use or extend these projects for # educational purposes provided that (1) you do not distribute or publish # solutions, (2) you retain this notice, and (3) you provide clear # attribut...
continue print 'error parsing test file: %s' % self.path
<|file_name|>manticore_protocol_cerberus_DeviceId__resp_from_wire.rs<|end_file_name|><|fim▁begin|>// Copyright lowRISC contributors. // Licensed under the Apache License, Version 2.0, see LICENSE for details. // SPDX-License-Identifier: Apache-2.0 // !! DO NOT EDIT !! // To regenerate this file, run `fuzz/generate_pro...
<|file_name|>stream_component.js<|end_file_name|><|fim▁begin|>//copy codes from d3.js, add 4 functions: tickAttr, tickTextAttr, minorTickAttr and domainAttr; //axis() changes, need a raphael paper object param, return raphael set object. //examples in ../examples/axis/ to know the usage. //a basic part for other data v...
type: "string", required: true, index: 0 };
<|file_name|>goprocfilter.go<|end_file_name|><|fim▁begin|>// goprocfilter project goprocfilter.go package goprocfilter import ( "C" "fmt" "syscall" "unsafe" ) const ( FILTER_NAME = "SimpleProcFilter" KN_MAX_PATH = 512 ) // KN_PROCESS_INFO structure type KnProcessInfo struct { parentProcessId uint32 processId...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>""" BitBake 'Fetch' implementations Classes for obtaining upstream sources for the BitBake build tools. """ # Copyright (C) 2003, 2004 Chris Larson # Copyright (C) 2012 Intel Corporation # # SPDX-License-Identifier: GPL-2.0-only # # Based on functions from the b...
md5data = precomputed[_MD5_KEY] else: md5data = bb.utils.md5_file(ud.localpath)
<|file_name|>main.js<|end_file_name|><|fim▁begin|>var should = require('should'); var sinon = require('sinon'); var Chintz = require('../lib/main'); var atomName = 'test-atom'; var moleculeName = 'test-molecule'; var invalidName = 'invalid-element-name'; var called; describe('prepare', function() { describe('w...
};
<|file_name|>photo_grid.js<|end_file_name|><|fim▁begin|>// app.photoGrid var Backbone = require("backbone"); // var _ = require("underscore"); var $ = require("jquery"); var ImageGridFuncs = require("./photo_grid_functions"); var ImageCollection = require("../models/photo_grid_image_collection"); var ImageView = requ...
<|file_name|>test_udpipe.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # vim:fileencoding=utf8 from __future__ import unicode_literals <|fim▁hole|>import unittest class TestUDPipe(unittest.TestCase): def test_model(self): import ufal.udpipe model = ufal.udpipe.Model.load('test/data/test.model'...
<|file_name|>periodictable.py<|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 program is free software; you...
202.973390521, 203.973043589, 204.974481755, 205.974465278, 206.975896887, 207.976652071, 208.98109012, 209.984188527, 210.988736964, 211.991897543, 212.996581499, 213.999805408, 215.004807, 208.980398734, 184.001124, 184.997625, 185.996597625, 186.993157835, 187.992265154, 188.989199012,
<|file_name|>chrome_content_rules_registry.cc<|end_file_name|><|fim▁begin|>// Copyright (c) 2012 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 "chrome/browser/extensions/api/declarative_content/chrome_content_...
// evaluators that they have new predicates to manage. for (const scoped_ptr<const ContentCondition>& condition : rule->conditions) { for (const scoped_ptr<const ContentPredicate>& predicate :
<|file_name|>when-module-option-changes.js<|end_file_name|><|fim▁begin|>//// [/lib/initial-buildOutput.txt] /lib/tsc --b /src/core --verbose 12:01:00 AM - Projects in this build: * src/core/tsconfig.json 12:01:00 AM - Project 'src/core/tsconfig.json' is out of date because output file 'src/core/anotherModule....
} }
<|file_name|>code_from_book.py<|end_file_name|><|fim▁begin|># Python Code From Book # This file consists of code snippets only # It is not intended to be run as a script raise SystemExit #################################################################### # 3. Thinking in Binary #####################################...
print seq
<|file_name|>viewchecker.py<|end_file_name|><|fim▁begin|>import os import argparse from logger import HoneyHornetLogger from threading import BoundedSemaphore import threading import logging from datetime import date, datetime from termcolor import colored import http.client import re import time class ViewChecker(Ho...
try: for vulnerable_host in hosts_to_check: if self.verbose:
<|file_name|>TransformPatternDlg.cpp<|end_file_name|><|fim▁begin|>// TransformPatternDlg.cpp : implementation file #include <psycle/host/detail/project.private.hpp> #include "TransformPatternDlg.hpp" #include "Song.hpp" #include "ChildView.hpp" #include "MainFrm.hpp" namespace psycle { namespace host { static const ...
return true; // return true unless you set the focus to a control // EXCEPTION: OCX Property Pages should return false
<|file_name|>webpack.vendor.js<|end_file_name|><|fim▁begin|>module.exports = [ 'babel-polyfill', 'react', 'react-redux', 'react-router', 'react-dom', 'redux', 'redux-thunk', 'seamless-immutable', 'react-router-redux',<|fim▁hole|> 'styled-components', 'prop-types', ];<|fim▁end|>
'history', 'lodash',
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup setup( name="Ente",<|fim▁hole|> license='LICENSE', url='https://github.com/rizsotto/Ente', long_description=open('README.md').read(), scripts=['bin/ente'] )<|fim▁end|>
version="0.1", description="place finder on commoncrawl dataset", author="László Nagy", author_email="rizsotto@gmail.com",
<|file_name|>whoispy.py<|end_file_name|><|fim▁begin|>import re import sys import whoisSrvDict import whoispy_sock import parser_branch OK = '\033[92m' FAIL = '\033[91m' ENDC = '\033[0m' def query(domainName): rawMsg = "" tldName = "" whoisSrvAddr = "" regex = re.compile('.+\..+') match = regex.se...
if not match: # Invalid domain _display_fail("Invalid domain format") return None
<|file_name|>_pad.py<|end_file_name|><|fim▁begin|>import _plotly_utils.basevalidators class PadValidator(_plotly_utils.basevalidators.CompoundValidator):<|fim▁hole|> plotly_name=plotly_name, parent_name=parent_name, data_class_str=kwargs.pop("data_class_str", "Pad"), dat...
def __init__(self, plotly_name="pad", parent_name="layout.title", **kwargs): super(PadValidator, self).__init__(
<|file_name|>interface.ts<|end_file_name|><|fim▁begin|>/** @module transition */ /** for typedoc */ import {StateDeclaration} from "../state/interface"; import {Predicate} from "../common/common"; import {Transition} from "./transition"; import {State} from "../state/stateObject"; import {PathNode} from "../path/node"...
* @returns a function which deregisters the hook. */ onBefore(matchCriteria: HookMatchCriteria, callback: TransitionHookFn, options?: HookRegOptions): Function;
<|file_name|>exportgpstracks.py<|end_file_name|><|fim▁begin|>from django.core.management.base import BaseCommand, CommandError from ship_data.models import GpggaGpsFix import datetime from main import utils import csv import os from django.db.models import Q import glob from main.management.commands import findgpsgaps ...
file_path = os.path.join(output_directory, filename)
<|file_name|>XMLHttpRequest.cpp<|end_file_name|><|fim▁begin|>/* * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved. * Copyright (C) 2005-2007 Alexey Proskuryakov <ap@webkit.org> * Copyright (C) 2007, 2008 Julien Chaffraix <jchaffraix@webkit.org> * Copyright (C) 2008, 2011 Google Inc. All rights res...
}
<|file_name|>f32.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...
#[test]
<|file_name|>SyncDialog.js<|end_file_name|><|fim▁begin|>dojo.provide("plugins.dijit.SyncDialog"); // HAS A dojo.require("dijit.Dialog"); dojo.require("dijit.form.Button"); dojo.require("dijit.form.ValidationTextBox"); // INHERITS dojo.require("plugins.core.Common"); dojo.declare( "plugins.dijit.SyncDialog", [ dijit...
this.isValid = false; return null; } else {
<|file_name|>forms.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from django import forms <|fim▁hole|> outputfile = forms.FileField(label='Select the survery output file (output.txt) if available', required=False) ctsoutputfile = forms.FileField(label='Select the continuous file (ctsout.txt) if availab...
class DocumentForm(forms.Form): xmlfile = forms.FileField(label='Select the input xml file (scenario.xml)')
<|file_name|>AddOptionsDialog.cpp<|end_file_name|><|fim▁begin|>#include "AddOptionsDialog.h" #include <wx/tokenzr.h> #include "ColoursAndFontsManager.h" #include <wx/sstream.h> #include <wx/txtstrm.h><|fim▁hole|> AddOptionsDialog::AddOptionsDialog(wxWindow* parent, const wxString& value) : AddOptionsDialogBase(pare...
<|file_name|>fixture1.js<|end_file_name|><|fim▁begin|>var xmas = {}; (function() { <|fim▁hole|> xmas.present = { box: {} }; }()); (function(global) { global.xmas.present.box.color = 'Red'; }(this));<|fim▁end|>
<|file_name|>UploadContext.java<|end_file_name|><|fim▁begin|>/* * Copyright 2017 Seven Bridges Genomics, 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 * * ...
* This object allows user to take control of upload submitted to internal transfer manager via the * {@link com.sevenbridges.apiclient.user.UserActions#submitUpload(com.sevenbridges.apiclient.upload.CreateUploadRequest)}
<|file_name|>Limbgrower.js<|end_file_name|><|fim▁begin|>import { useBackend, useSharedState } from '../backend'; import { Box, Button, Dimmer, Icon, LabeledList, Section, Tabs } from '../components'; import { Window } from '../layouts'; export const Limbgrower = (props, context) => { const { act, data } = useBackend...
content="Remove Reagent" color="bad" onClick={() => act('empty_reagent', { reagent_type: reagent.reagent_type,
<|file_name|>main.py<|end_file_name|><|fim▁begin|>__author__ = 'beau' import serial ser = serial.Serial('/dev/tty.usbmodem1422',9600, timeout=1) import time import sys def get_angle(): print "requesting angle" start = time.time() ser.write('nofddfp\n') print "..." reply = ser.readline() deltaT...
<|file_name|>az_circle_counter.js<|end_file_name|><|fim▁begin|>{ base: 'az_circle_counter', name: Drupal.t('Circle counter'), icon: 'et et-icon-speedometer', // description: Drupal.t('Infographic Counter'), params: [{ type: 'colorpicker', heading: Drupal.t('Foreground color'), ...
}, {
<|file_name|>thss_generation_errors.rs<|end_file_name|><|fim▁begin|>#![cfg(feature = "dss")] extern crate rusty_secrets; use rusty_secrets::dss::thss; #[test] #[should_panic(expected = "ThresholdTooBig")] fn test_generate_invalid_k() { let secret = b"These programs were never about terrorism: they're about econo...
}
<|file_name|>test_byteswap.py<|end_file_name|><|fim▁begin|>import sys, unittest, struct, math, ctypes from binascii import hexlify from ctypes import * def bin(s): return hexlify(memoryview(s)).decode().upper() # Each *simple* type that supports different byte orders has an # __ctype_be__ attribute that...
# these fields do not support different byte order: for typ in c_wchar, c_void_p, POINTER(c_int):
<|file_name|>utils.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import os import httplib import logging import functools from modularodm.exceptions import ValidationValueError from framework.exceptions import HTTPError from framework.analytics import update_counter from website.addons.osfstorage import s...
<|file_name|>network.py<|end_file_name|><|fim▁begin|># -*- coding: UTF-8 -*- import requests from bs4 import BeautifulSoup, UnicodeDammit import time import os import re import log import tools class Get(object): # timeout, retry_interval -> seconds def __init__(self, url='', timeout=5, retry=5, retry_interv...
self.url = url self.timeout = timeout
<|file_name|>gce_instance_template.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'met...
hosts: localhost vars: service_account_email: "your-sa@your-project-name.iam.gserviceaccount.com" credentials_file: "/path/to/your-key.json"
<|file_name|>tactic.py<|end_file_name|><|fim▁begin|>"""ThreatConnect TI Email""" # standard library from typing import TYPE_CHECKING # first-party from tcex.api.tc.v2.threat_intelligence.mappings.group.group import Group if TYPE_CHECKING: # first-party from tcex.api.tc.v2.threat_intelligence.threat_intelligen...
ti (ThreatIntelligence): An instance of the ThreatIntelligence Class. name (str, kwargs): [Required for Create] The name for this Group. owner (str, kwargs): The name for this Group. Default to default Org when not provided
<|file_name|>optimize.go<|end_file_name|><|fim▁begin|>// Copyright 2012-2015 Oliver Eilhard. All rights reserved. // Use of this source code is governed by a MIT-license. // See http://olivere.mit-license.org/license.txt for details. package elastic import ( "encoding/json" "fmt" "net/url" "strings" "bosun.org/...
<|file_name|>apps.py<|end_file_name|><|fim▁begin|>""" Discounts application configuration """ # -*- coding: utf-8 -*- from __future__ import absolute_import from django.apps import AppConfig <|fim▁hole|>class DiscountsConfig(AppConfig): name = 'openedx.features.discounts'<|fim▁end|>
<|file_name|>acl.go<|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/. // // Contributor: Julien Vehent jvehent@mozilla.com [:ulfr] package...
} seenFp = append(seenFp, fp)
<|file_name|>CRLList.tsx<|end_file_name|><|fim▁begin|>import PropTypes from "prop-types"; import React from "react"; import { connect } from "react-redux"; import { loadAllCertificates } from "../../AC"; import accordion from "../../decorators/accordion"; import { filteredCrlsSelector } from "../../selectors/crlsSelect...
operation={operation} selectedCert={() => selectedCert(crl)} isOpen={isItemOpened(crl.id.toString())} toggleOpen={toggleOpenItem(crl.id.toString())} />);
<|file_name|>json.py<|end_file_name|><|fim▁begin|>try: import simplejson as json except ImportError: import json import functools from cgi import parse_header def wrap_json(func=None, *, encoder=json.JSONEncoder, preserve_raw_body=False): """ A middleware that parses the body of json requests and ...
if func is None: return functools.partial(wrap_json_response, encoder=encoder)
<|file_name|>operator.py<|end_file_name|><|fim▁begin|>def keysetter(key): if not isinstance(key, str): raise TypeError('key name must be a string') resolve = key.split('.') head, last = tuple(resolve[:-1]), resolve[-1] def g(obj,value): for key in head : obj = obj[key] ...
for name in key.split('.'): obj = obj[name]
<|file_name|>kt_main.js<|end_file_name|><|fim▁begin|>/* Initialize */ var isMobile = { Android: function() { return navigator.userAgent.match(/Android/i); }, BlackBerry: function() { return navigator.userAgent.match(/BlackBerry/i); }, iOS: function() { return navigator.userAg...
<|file_name|>map-queries-spec.js<|end_file_name|><|fim▁begin|>'use babel'; import MapQueries from '../lib/map-queries'; // Use the command `window:run-package-specs` (cmd-alt-ctrl-p) to run specs. // // To run a specific `it` or `describe` block add an `f` to the front (e.g. `fit` // or `fdescribe`). Remove the `f` t...
// Before the activation event the view is not on the DOM, and no panel // has been created
<|file_name|>views.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from django.shortcuts import render_to_response, get_object_or_404, redirect def in_place(request, slug): place = get_object_or_404( pombola.core.models.Place, slug=slug) projects = place.project_set return render_to_response( 'proj...
import models import pombola.core.models from django.template import RequestContext
<|file_name|>gc_get_referents.py<|end_file_name|><|fim▁begin|>import gc import pprint class Graph: def __init__(self, name): self.name = name self.next = None def set_next(self, next): print('Linking nodes {}.next = {}'.format(self, next)) self.next = next def __repr__(s...
<|file_name|>pay_period_details.py<|end_file_name|><|fim▁begin|>""" The Plaid API The Plaid REST API. Please see https://plaid.com/docs/api for more details. # noqa: E501 Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 from plaid.model_utils import ( #...
composed schema that is
<|file_name|>enc-utf16-test.js<|end_file_name|><|fim▁begin|>YUI.add('enc-utf16-test', function (Y) { var C = CryptoJS; Y.CryptoJSTestSuite.add(new Y.Test.Case({ name: 'Utf16', testStringify1: function () { Y.Assert.areEqual('z', C.enc.Utf16.stringify(C.lib.WordArray.create([...
testParse4: function () {
<|file_name|>portal_modules.js<|end_file_name|><|fim▁begin|>$('#section').on('click', '[id$="Empty"]', function(event) { event.preventDefault(); var match = /(.+)Empty/.exec($(event.target).closest('.unwell').attr('id')); var id = match[1]; var emptyId = match[0]; $('#'+id).trigger('addrow'); $('#'+emptyId)...
e.preventDefault(); $(e.target).hide(function(){ $($(e.target).attr('data-expand')).slideDown(); });
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User from django.http import Http404, JsonResponse, HttpResponseForbidden from django.shortcuts import render, redirect, get_object_or_404 from .forms import PlaylistForm ...
'owner': user, 'playlists': Playlist.objects.filter(user=user),
<|file_name|>exceptions.py<|end_file_name|><|fim▁begin|>class StretchException(Exception): """Common base class for all exceptions raised explicitly by stretch. Exceptions which are subclasses of this type will be handled nicely by stretch and will not cause the program to exit. Any exceptions raised w...
self.kwargs = kwargs def format_message(self):