text stringlengths 2 999k |
|---|
# -*- coding: utf-8 -*-
# Licensed to Elasticsearch B.V under one or more agreements.
# Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
# See the LICENSE file in the project root for more information
import mock
import time
import threading
import pytest
from elasticsearch import helpers, Ela... |
# -*- coding: utf-8 -*-
# Copyright (c) 2017 SoftBank Robotics Europe. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Sequencer features
"""
import os
import time
import pytest
from itertools import product
from wooqi.src import global_va... |
from django.contrib import messages
from django.core.exceptions import ValidationError
try:
from django.core.urlresolvers import reverse
except ImportError: # Django 1.11
from django.urls import reverse
from django.forms.formsets import formset_factory
from django.http import HttpResponseRedirect
from django.v... |
##########################################################################
#
# Copyright (c) 2013-2015, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redi... |
try:
import unittest2 as unittest
except:
import unittest
import numpy as np
from pyrr import plane
class test_plane(unittest.TestCase):
def test_import(self):
import pyrr
pyrr.plane
from pyrr import plane
def test_create(self):
result = plane.create()
self.asse... |
# coding=utf-8
from __future__ import with_statement
import sys
import os
from catsup.logger import logger
from catsup.options import g
from catsup.utils import call, ObjectDict
def read_theme(path):
"""
:param path: path for the theme.
:return: Theme theme read in path.
"""
if not os.path.exist... |
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... |
# -*- coding: utf-8 -*-
import os
import json
import difflib
dirname = os.path.dirname(__file__)
def get_character_json(character):
move_file_name = '/json/' + character.get('local_json')
filepath = dirname + move_file_name
with open(filepath) as move_file:
move_file_contents = move_file.read()
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
os.system('rm -r final_table')
os.mkdir('final_table')
infile = open(snakemake.params.in_table)
next(infile)
rates=[]
for line in infile :
columns = line.rstrip("\n").split("\t")
length = float(columns[5])
count = float(columns[11])
rate = coun... |
import logging
import random
from dataclasses import replace
from typing import Callable, Dict, List, Optional, Tuple
import blspy
from blspy import G1Element, G2Element
from chiabip158 import PyBIP158
from hddcoin.consensus.block_record import BlockRecord
from hddcoin.consensus.block_rewards import calculate_base_fa... |
import datetime
from django.contrib.auth.models import User, Group
from django.utils.translation import ugettext_lazy as _
from django.utils import timezone
from rest_framework import serializers
from . import models
from .utils import apiModel
class ApiField(serializers.Field):
default_error_messages = {
... |
from datetime import datetime, timedelta
import os
from airflow import DAG
from airflow.operators.dummy_operator import DummyOperator
from airflow.operators import (StageToRedshiftOperator, LoadFactOperator,
LoadDimensionOperator, DataQualityOperator)
from helpers import SqlQueries
# AW... |
#!/usr/bin/env python
#
# Copyright 2019 Rickard Armiento
#
# This file is part of a Python candidate reference implementation of
# the optimade API [https://www.optimade.org/]
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "... |
''' Dictionary
A dictionary is a collection of key value pairs.
The values can be changed (mutable)
The values have unique keys.
Using the constructor method # 29
Built-in dictionary Methods
Method Description
get() Returns the value of a specific key.
Update() Inserts a s... |
from main import make_update
from main import remove_update
def test_make_update():
assert make_update('test', '23:59', 'repeat', 'data', 'news')
def test_remove_update():
assert remove_update('test')
|
import argparse
import os,sys
import numpy as np
import datetime
from train import get_symbol, data_loader
import mxnet as mx
from mxnet import ndarray as nd
import ipdb
def softmax(x):
exp = np.exp(x)
partition = exp.sum(axis=1,keepdims=True)
return exp / partition
parser = argparse.ArgumentParser(desc... |
# -*- coding: utf-8 -*-
# Copyright (c) 2017, masonarmani38@gmail.com and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
class TestViolationAndFines(unittest.TestCase):
pass
|
from twitchTVApi import twitch_page
from flask import render_template
@twitch_page.route('/')
def twitch():
return render_template('index.html')
|
import logging
from pyvisdk.exceptions import InvalidArgumentError
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
def HostPlugStoreTopologyAdapter(vim, *args, **kwargs):
'''This data object type is an as... |
''' Define the Transformer model '''
import torch
import torch.nn as nn
import numpy as np
# Positional Encoding with sine table algo.
def get_sinusiod_encoding_table(n_position, d_model):
''' Sinusoid position encoding table '''
drop = nn.Dropout(p=0.1)
def get_postion_angle_vec(position):
... |
from corankco.dataset import Dataset
from corankco.scoringscheme import ScoringScheme
from corankco.partitioning.orderedPartition import OrderedPartition
from typing import Tuple, Set
from numpy import vdot, ndarray, count_nonzero, shape, array, zeros, asarray
from igraph import Graph
class ParFront:
def __init_... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import pytest
from hypothesis import strategies as st
from hypothesis import given, settings
from webob.multidict import MultiDict
from h.search import parser
@pytest.mark.parametrize(
"query_in,query_out",
[
# user field
("use... |
from django.contrib import admin
# Register your models here.
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from django.contrib.auth.models import User
from .models import Profile
class ProfileInline(admin.StackedInline):
model = Profile
can_delete = False
verbose_name_plural = "profil... |
# -*- coding: utf-8 -*-
"""command line tool
:mod:`pcapkit.__main__` was originally the module file of
|jspcapy|_, which is now deprecated and merged with :mod:`pcapkit`.
"""
import argparse
import sys
import warnings
import emoji
from pcapkit.foundation.extraction import Extractor
from pcapkit.interface import JSO... |
import numpy as np
cie_y = [
0.000003917000, 0.000004393581, 0.000004929604, 0.000005532136, 0.000006208245,
0.000006965000, 0.000007813219, 0.000008767336, 0.000009839844, 0.00001104323,
0.00001239000, 0.00001388641, 0.00001555728, 0.00001744296, 0.00001958375,
0.00002202000, 0.00002483965, 0.00002804... |
from django.contrib.auth import get_user_model
from django.urls import reverse
from django.test import TestCase
from rest_framework import status
from rest_framework.test import APIClient
from core.models import Tag, Recipe
from recipe.serializers import TagSerializer
TAGS_URL = reverse('recipe:tag-list')
class P... |
from datetime import datetime
import sqlalchemy as sa
from .exceptions import UnknownJSONPropertyError
DATETIME_FORMAT = "%Y-%m-%dT%H:%M:%S.%f"
NONE = object()
class Hook:
def __init__(self, parent):
self.parent = parent
self.method = None
def __call__(self, method):
self.method = ... |
import tensorflow as tf
import numpy as np
import baselines.common.tf_util as U
from baselines.a2c.utils import fc
from tensorflow.python.ops import math_ops
class Pd(object):
"""
A particular probability distribution
"""
def flatparam(self):
raise NotImplementedError
def mode(self):
... |
# coding=utf-8
# --------------------------------------------------------------------------
# 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 (R) AutoRest Code Generator.
# Changes ... |
# Generated by Django 3.0.7 on 2020-08-09 13:46
from django.db import migrations
import django_resized.forms
class Migration(migrations.Migration):
dependencies = [
('organisation', '0002_organisation_url'),
]
operations = [
migrations.AlterField(
model_name='organisation',
... |
from pyphysicssandbox import *
import random
window('Pinball', 600, 600)
gravity(0, 900)
lines = []
lines.append(static_line((450, 500), (550, 50), 3))
lines.append(static_line((150, 500), (50, 50), 3))
lines.append(static_line((550, 50), (300, 0), 3))
lines.append(static_line((300, 0), (50, 50), 3))
#lines.append(st... |
"""
Linear Discriminant Analysis and Quadratic Discriminant Analysis
"""
# Authors: Clemens Brunner
# Martin Billinger
# Matthieu Perrot
# Mathieu Blondel
# License: BSD 3-Clause
import warnings
import numpy as np
from scipy import linalg
from scipy.special import expit
from .base import ... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -------------------------------------------------------------------... |
# Copyright 2015 Hewlett Packard Enterprise Development Company LP
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unles... |
import _plotly_utils.basevalidators
class ReversescaleValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(
self,
plotly_name='reversescale',
parent_name='scatterpolar.marker',
**kwargs
):
super(ReversescaleValidator, self).__init__(
plotl... |
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import itertools
import torch
import functorch
from functorch import vmap
import torch.utils._pytree as pytree
fr... |
# Copyright (C) 2010-2011 Richard Lincoln
#
# 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
# rights to use, copy, modify, merge, publish... |
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import light, output
from esphome.const import CONF_OUTPUT_ID, CONF_OUTPUT
monochromatic_ns = cg.esphome_ns.namespace('monochromatic')
MonochromaticLightOutput = monochromatic_ns.class_('MonochromaticLightOutput', light.LightOu... |
""" Python Obit ImageMF class
This class contains an astronomical image and allows access.
An ObitImageMF is the front end to a persistent disk resident structure.
Magic value blanking is supported, blanked pixels have the value
OBIT_MAGIC (ObitImageDesc.h).
Pixel data are kept in an FArray structure which is how Pyth... |
import numpy
def dominant_frequency(x, sf):
# x: vector with data values
# sf: sample frequency
fourier = numpy.fft.fft(x)
frequencies = numpy.fft.fftfreq(len(x), 1/sf)
magnitudes = abs(fourier[numpy.where(frequencies > 0)])
peak_frequency = frequencies[numpy.argmax(magnitudes)]
return peak_frequency
|
import copy
import os.path as osp
_root_ = '../../../..'
_base_ = [osp.join(_root_, 'configs/base.py'),'../model_samplers/ar50to101v2.py']
#_base_ = [osp.join(_root_, 'configs/base.py')]
_data_root_ = '/data1/imagenet'
# model settings
model = dict(
type='DynamicMOCO',
queue_len=65536,
feat_dim=128,
m... |
# This file is responsible for setup up the executing environment of droidbox app
# Here the executing environment includes:
# 1. Static environments: contacts, call logs, SMS, pre-installed apps, etc
# 2. Dynamic environments: continuous GPS, Accelerometer, etc
# The environment should be determined before app start r... |
import pathlib
import PIL
from scripts import Warnings, Constants, Log, General, Parameters
from scripts.backend.database import Database
"""
All functions return the id of the dataset that was just created
"""
"""
Datasets
"""
def create_dataset_sensor_image_entry(dataset_id: int, sensor_num: int):
i... |
from test_password_reset import *
from test_change_password import * |
import bentoml
import pandas
from bentoml.frameworks.lightgbm import LightGBMModelArtifact
from bentoml.adapters import DataframeInput
# TODO : ver를 지정할 수 있는데, 버전 관리는 어떻게 할 것인가?
@bentoml.ver(major=1, minor=0)
@bentoml.artifacts([LightGBMModelArtifact('model')])
@bentoml.env(pip_packages=['lightgbm==2.3.1'])
class Tit... |
# expected: fail
"""
Test cases for the repr module
Nick Mathewson
"""
import sys
import os
import shutil
import unittest
from test.test_support import run_unittest, check_py3k_warnings
from repr import repr as r # Don't shadow builtin repr
from repr import Repr
def nestedTuple(nesting):
t = ()
for i in... |
import pytest
from cosmic_ray.work_item import WorkItem
from cosmic_ray.tools.filters.spor import _item_in_context, _line_and_col_to_offset
from spor.anchor import Context
@pytest.fixture
def lines():
return ['123\n', '456\n', '789']
class Test_line_and_col_to_offset:
def test_simple(self, lines):
... |
# -*- coding: utf-8 -*-
u"""
Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U.
This file is part of Toolium.
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.apach... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
import os
import cv2
import dlib
import torch
import torch.nn as nn
from classification.dataset.transform import xception_default_data_transforms
from PIL import Image as pil_image
from tqdm import tqdm
cuda = False
def get_boundingbox(face, width, height, scale=1.3, minsize=None):
"""
Expects a dlib face t... |
# import pytest
import os
import string
import random
import copy
import json
import pytest
import warnings
import jsonschema
import numpy as np
from ai2thor.controller import Controller
from ai2thor.tests.constants import TESTS_DATA_DIR
from ai2thor.wsgi_server import WsgiServer
from ai2thor.fifo_server import FifoSer... |
# coding=utf-8
# --------------------------------------------------------------------------
# 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 (R) AutoRest Code Generator.
# Changes may ... |
import datetime
import json
import os
import re
import requests
import time
from datetime import datetime
import csv
import praw
from flask import Blueprint, render_template, send_file
from flask import (
flash,
request,
)
from praw.models import MoreComments
from sqlalchemy.exc import InvalidRequestError
fro... |
#!/usr/bin/env python3
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "... |
import argparse
import json
import pymongo
from pymongo import MongoClient
parser = argparse.ArgumentParser()
parser.add_argument("-g", "--server_id", help="Server ID for which the playlist is to be removed")
parser.add_argument("-n", "--name", help="Name of the Playlist to be removed")
args = parser.parse_args()
cl... |
galera = []
pessoa = {}
soma = media = 0
while True:
pessoa.clear()
pessoa['nome'] = str(input('Nome: '))
while True:
pessoa['sexo'] = str(input('Sexo: [M/F] ')).upper()[0]
if pessoa['sexo'] in 'MF':
break
print('ERRO. Digite apenas "M" ou "F".')
pessoa['idade'] = int... |
# -*- coding: utf-8 -*-
"""
Otro solo RANSAC
"""
conversion.bytxt()
D = conversion.txt2array()
D = np.delete(D,0,axis=0)
DD = np.copy(D) # Creamos copia de datos para no afectar a los originales
abcd = np.array([[0,0,0,0]])
ldps = np.array([])
gplns = np.array([])
abcd,ldps,gplns = conversion.rnsc2(D... |
import numpy
def multi(*lista_):
total_multi = 1
for c in lista_:
total_multi *= numpy.prod(c)
return total_multi
def soma(*lista_):
total_soma = 0
for c in lista_:
total_soma = sum(c)
return total_soma
lista = list()
esc = 'S'
while esc == 'S':
esc = ''
num = int(i... |
"""
PointNet++ Model for point clouds classification
"""
import os
import sys
BASE_DIR = os.path.dirname(__file__)
sys.path.append(BASE_DIR)
sys.path.append(os.path.join(BASE_DIR, 'utils'))
import tensorflow as tf
import numpy as np
import models.Pointnet2.utils.tf_util as tf_util
from pointnet_util import pointnet... |
# coding: utf-8
import re
import six
from huaweicloudsdkcore.sdk_response import SdkResponse
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class DisassociateVaultPolicyResponse(SdkResponse):
"""
Attributes:
openapi_types (dict): The key is attribute name
... |
import nltk
from nltk.parse.generate import generate
productions = [
"ROOT -> WORD [1.0]",
"WORD -> P1 [0.25]",
"WORD -> P1 P2 [0.25]",
"WORD -> P1 P2 P3 [0.25]",
"WORD -> P1 P2 P3 P4 [0.25]",
"P1 -> 'A' [1.0]",
"P2 -> 'B' [0.5]",
"P2 -> 'C' [0.5]",
"P3 -> 'D' [0.3]",
"P3 -> 'E'... |
"""
Marker implementation.
"""
from pulse_lib.segments.segment_base import segment_base, last_edited
from pulse_lib.segments.segment_IQ import segment_IQ
from pulse_lib.segments.utility.data_handling_functions import loop_controller
from pulse_lib.segments.data_classes.data_markers import marker_data
from dataclasses ... |
from django.test import TestCase
from lrs.models import Agent
import hashlib
import json
import base64
from lrs import models, views
from lrs.objects.AgentManager import AgentManager
from django.core.urlresolvers import reverse
from django.conf import settings
class AgentManagerTests(TestCase):
@classmethod
de... |
import cv2
import numpy as np
from skimage.segmentation import slic
import logging
logger = logging.getLogger(__name__)
from ipapi.base.ip_common import DEFAULT_COLOR_MAP, ToolFamily
from ipapi.base.ipt_abstract_merger import IptBaseMerger
class IptSlic(IptBaseMerger):
def build_params(self):
... |
"""
Vorter XSPRESS3 class
Python class for Vortex using EPICS area detector IOC.
:platform: Unix
:synopsis: Python class for Vortex with xspress3
.. moduleauthor:: Douglas Araujo<douglas.araujo@lnls.br>
Luciano Carneiro Guedes<luciano.guedes@lnls.br>
"""
from py4syn.epics.StandardDevice import Sta... |
from django import forms
from multiupload.fields import MultiFileField
from django.forms import ModelForm, DateInput
from .models import *
import re
from django.forms.widgets import Widget, Select, MultiWidget
from django.forms.extras.widgets import SelectDateWidget
from django.utils.safestring import mark_safe
from dj... |
#!/bin/env python
#------------------------------------------------------------------------
# Copyright (c) 1997-2001 by Total Control Software
# All Rights Reserved
#------------------------------------------------------------------------
#
# Module Name: dbShelve.py
#
# Desc... |
"""
Main app/routing file for Twitoff.
The file that holds the function 'create_app'
to collect out modules and hold our flask app
"""
from os import getenv
from .twitter import add_or_update_user
from flask import Flask, render_template, request
from .models import DB, User, Tweet
from .predict import predict_user
... |
from django.shortcuts import render
from django.http import HttpResponse
# Include the `fusioncharts.py` file which has required functions to embed the charts in html page
from ..fusioncharts import FusionCharts
# Loading Data from a Static JSON String
# It is a example to show a selectscatter chart where data is pas... |
import numpy as np
from pommerman import agents
from pommerman import constants
from pommerman import characters
# we have to create a game state from the observations
# in this example we only use an approximation of the game state, this can be improved
# approximations are:
# - flames: initialized with 2 ticks (m... |
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
import os
import re
import sys
if os.environ.get('USER', '') == 'vagrant':
# Workaround for http://bugs.python.org/issue8876
del os.link
class PyTest(TestCommand):
user_options = [('pytest-args=', 'a', "A... |
from Level import Level
from ReaderFactory import ReaderFactory
class File(object):
file_factory = ReaderFactory()
file_content = {}
def __init__(self):
self.levels = []
self.filtered_list = []
def load(self, file):
file_type = self.get_file_type(file)
self.file_reade... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Author: illuz <iilluzen[at]gmail.com>
# File: AC_1_space_dp_n.py
# Create Date: 2015-03-13 10:49:50
# Usage: AC_1_space_dp_n.py
# Descripton:
class Solution:
# @param prices, a list of integer
# @return an integer
def maxProfit(self, prices)... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
import unittest.mock as mock
from itertools import product
from test.generic.config_utils import get_te... |
import re
from plexapi.server import PlexServer
baseurl = 'http://plex.example.com:32400'
token = 'abcdefghijklmnopqrstuvwxyz'
plex = PlexServer(baseurl, token)
playlist_title = 'Treehouse of Horror'
for playlist in plex.playlists():
if playlist.title == playlist_title:
playlist.delete()
print(... |
from __future__ import unicode_literals
import unittest
from datetime import date, datetime, time, timedelta
from decimal import Decimal
from operator import attrgetter, itemgetter
from uuid import UUID
from django.core.exceptions import FieldError
from django.db import connection, models
from django.db.models import... |
"""
Loads the universal tabulator schema
"""
from rcvformats.schemas.base import GenericJsonSchema, DataError
class SchemaV0(GenericJsonSchema):
""" Schema for the initial version of the Universal RCV Tabulator """
@property
def schema_filename(self):
return 'universaltabulator.schema.json'
... |
"""
WSGI config for cloud_deploy_system project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault(... |
from plotly.basedatatypes import BaseTraceHierarchyType
import copy
class Tickformatstop(BaseTraceHierarchyType):
# dtickrange
# ----------
@property
def dtickrange(self):
"""
range [*min*, *max*], where "min", "max" - dtick values which
describe some zoom level, it is possibl... |
"""
Django settings for order_form_app project.
Generated by 'django-admin startproject' using Django 2.2.5.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
impor... |
#!/usr/bin/env python3
# Copyright (c) 2017-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Tests NODE_NETWORK_LIMITED.
Tests that a node configured with -prune=550 signals NODE_NETWORK_LIMITED ... |
#import cms
#loader = cms.CaseLoader()
#print(dir(cms))
|
import json
import time
import datetime
from enum import Enum
from itertools import chain
from threading import Thread
from typing import List, Iterator, Optional
import telegram
from telegram import InlineKeyboardMarkup, InlineKeyboardButton
from telegram.ext import (CallbackQueryHandler, ConversationHandler,
Command... |
import ctypes
import numpy
import six
import warnings
from nidaqmx._lib import lib_importer, ctypes_byte_str, c_bool32
from nidaqmx._task_modules.channels.channel import Channel
from nidaqmx._task_modules.export_signals import ExportSignals
from nidaqmx._task_modules.in_stream import InStream
from nidaqmx._task_module... |
###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2020, John McNamara, jmcnamara@cpan.org
#
import unittest
from ...compatibility import StringIO
from ...worksheet import Worksheet
class TestWriteSheetViews(unittest.TestCase):
"""
... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
# GENERATED BY KOMAND SDK - DO NOT EDIT
import insightconnect_plugin_runtime
import json
class Component:
DESCRIPTION = "Search a email for malicious threats"
class Input:
EMAIL = "email"
class Output:
DOMAINS = "domains"
FOUND = "found"
PERMALINK = "permalink"
REFERENCES = "references... |
from scabbard import get_client
def test__v1_lists_supported_shop_themes_theme_get():
client = get_client()
travel_theme = \
client.Air_Utility\
.V1ListsSupportedShopThemesThemeGet(theme='BEACH')\
.result()
assert 'AAL' == travel_theme['Destinations'][0]['Destination']
|
#!/usr/bin/env python3
# Copyright (c) 2017-2018 The Imperium Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test debug logging."""
import os
from test_framework.test_framework import ImperiumTestFramework
fro... |
# Generated by Django 2.2.2 on 2020-08-20 13:27
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('management', '0014_auto_20200519_2043'),
]
operations = [
migrations.AddField(
model_name='school',
name='state',
... |
from flask import Flask, render_template, request
import requests
import folium
from geopy.geocoders import Nominatim
import time
from geopy.exc import GeocoderTimedOut
app = Flask(__name__)
@app.route("/")
def index():
return render_template("index.html")
@app.route("/register", methods=["POST"])
def register... |
from operator import itemgetter
import networkx as nx
from platypus import *
G = nx.read_adjlist("input/Ventresca/ForestFire_n2000.txt")
k = 200
num_of_tests = 10
class DfsGenerator(Generator):
def __init__(self):
super(DfsGenerator, self).__init__()
self.step_size = G.number_of_nodes() // k
... |
"""Tests for tools for constructing domains for expressions. """
from sympy.polys.constructor import construct_domain
from sympy.polys.domains import ZZ, QQ, ZZ_I, QQ_I, RR, CC, EX
from sympy.polys.domains.realfield import RealField
from sympy.polys.domains.complexfield import ComplexField
from sympy.core impo... |
# This is a Python comment. Lines that begin with a '#' are ignored by the
# Python interpreter. Comments are useful for documenting code or explaining
# quiz questions!
# Write a Python program that prints out the number of minutes in seven weeks.
# Click the "Run" button below to try running your code and see the ou... |
import mysql.connector
import os
from mysql.connector import errorcode
import pandas as pd
import sys
import config
import json
cnx = mysql.connector.connect(user = config.MYSQL_USERNAME, password = config.MYSQL_PASSWORD,
host = config.MYSQL_HOST, allow_local_infile=True,
... |
from . import doublearray
from . import keyset
from . import doublearraybuilder
from . import doublearraybuilderunit
from . import dawgbuilder
from . import bitvector
|
n = 178
for i in range(2, n):
if n % i == 0:
print('No')
print('Yes') |
# -----------------------------------------------------------------------------
# Copyright (c) 2014--, The Qiita Development Team.
#
# Distributed under the terms of the BSD 3-clause License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... |
__version__ = "v0.8.1"
|
# -*- mode: python; coding: utf-8; -*-
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.sites.models import Site
from django.contrib.syndication.feeds import Feed
from models import Post
import markdown
class LatestPosts(Feed):
def title(self):
return s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.