text stringlengths 2 999k |
|---|
from mollie.api.objects.issuer import Issuer
from .utils import assert_list_object
def test_get_issuers(client, response):
"""Get all the iDeal issuers via the include querystring parameter."""
response.get("https://api.mollie.com/v2/methods/ideal?include=issuers", "method_get_ideal_with_includes")
issu... |
rows, columns = [int(x) for x in input().split(", ")]
matrix = [[int(i) for i in input().split()] for _ in range(rows)]
for column in range(columns):
sum_column = 0
for row in range(rows):
sum_column += matrix[row][column]
print(sum_column)
|
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Copyright (c) "Neo4j"
# Neo4j Sweden AB [http://neo4j.com]
#
# This file is part of Neo4j.
#
# 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
#... |
import pytest
from qtpy.QtCore import QModelIndex, Qt
from napari._qt.containers import QtNodeTreeModel, QtNodeTreeView
from napari._qt.containers._base_item_view import index_of
from napari.utils.events._tests.test_evented_list import NESTED_POS_INDICES
from napari.utils.tree import Group, Node
@pytest.fixture
def ... |
class Solution:
def climbStairs(self, n: int) -> int:
if n == 1:
return 1
dp = [0, 1, 2]
for i in range(3, n + 1):
dp.append(dp[i - 1] + dp[i - 2])
return dp[n] |
# Copyright (c) 2014 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... |
from esphome.components import number
import esphome.config_validation as cv
import esphome.codegen as cg
from esphome.const import CONF_ID
from .. import monoprice_10761_ns, CONF_MONOPRICE_10761_ID, CONF_ZONE, CONF_COMMAND, Monoprice10761
DEPENDENCIES = ["monoprice_10761"]
CODEOWNERS = ["@jhenkens"]
Monoprice10761Nu... |
#!/usr/bin/env python
# Author: Zion Orent <zorent@ics.com>
# Copyright (c) 2015 Intel Corporation.
#
# 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 ... |
#
# 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... |
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
#
# 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
#
# Unless required by appli... |
import logging
from datetime import datetime
from multiprocessing import Condition, Array
from pathlib import Path
from PIL import Image
from birdthing import camera
def run(frame: Array, target_in_sight: Condition):
archive_path = Path("/mnt/nas/data/birdthings")
archive_path.mkdir(exist_ok=True, parents=T... |
"""Unit tests for the WaveNet that check that it can train on audio data."""
import json
import numpy as np
import tensorflow as tf
from wavenet import WaveNetModel, time_to_batch, batch_to_time, causal_conv
def MakeSineWaves():
"""Creates a time-series of audio amplitudes corresponding to 3
superimposed s... |
# -*- coding: utf-8 -*-
# python-holidays
# ---------------
# A fast, efficient Python library for generating country, province and state
# specific sets of holidays on the fly. It aims to make determining whether a
# specific date is a holiday as fast and flexible as possible.
#
# Authors: dr-prodigy <maurizio.... |
# -*- coding: utf-8 -*-
#
# michael a.g. aïvázis
# orthologue
# (c) 1998-2022 all rights reserved
#
# externals
import os
import pyre
# declaration
class User(pyre.component):
"""
Encapsulation of user specific information
"""
# configurable state
# administrative
name = pyre.properties.st... |
import numpy as np
import pandas as pd
from flask import Flask, render_template, request
# libraries for making count matrix and similarity matrix
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.metrics.pairwise import cosine_similarity
# define a function that creates similarity matrix
# if i... |
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import datetime
import logging
import urlparse
from google.appengine.api import taskqueue
from google.appengine.api import modules
from google.appengine.ext... |
import cv2
'''
1. Read image by path.
'''
im = cv2.imread("../rsrc/1.jpg", cv2.IMREAD_COLOR)
'''
2. Show image on the screen.
'''
cv2.imshow("my window name", im)
'''
3. Stop the program and wait the keyboard input.
key_code = cv2.waitKey( time )
--- time: 0 -> wait util key pressed.
1000 -> only wait ut... |
# Generated by Django 3.0.5 on 2020-05-17 09:35
import datetime
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = []
operations = [
migrations.CreateModel(
name="Ingredient",
fi... |
## 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
##
## Unless required by applicable law or agreed to in writing, software
## distributed un... |
# Generated by Django 2.0.4 on 2018-05-07 16:30
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('annotations', 'export_format_conversion_20180504'),
('images', '0010_imageset_public_collaboration'),
]
ope... |
from django.contrib.admin.views.decorators import staff_member_required
from django.urls import re_path
from django.views.decorators.cache import never_cache
from . import views
urlpatterns = [
re_path(r"^upload/", staff_member_required(views.upload), name="ckeditor_upload"),
re_path(
r"^browse/",
... |
# This file is part of Indico.
# Copyright (C) 2002 - 2021 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
"""
HTTP API - Handlers
"""
import hashlib
import hmac
import posixpath
import re
import time
from urllib... |
"""
WSGI config for DjangoCrudMongoDB 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.11/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("D... |
import tensorflow as tf
from tensorflow.keras.callbacks import Callback
import tensorflow.keras.backend as K
import numpy as np
from sklearn.metrics import precision_recall_fscore_support, roc_auc_score
class clf_metrics(Callback):
def __init__(self, xVal, yVal):
super(clf_metrics, self).__init__()
self.X = x... |
# Copyright (c) 2021, NVIDIA CORPORATION.
#
# 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
#
# Unless required by applicable law or agreed to... |
# from distutils.core import setup
# from distutils.extension import Extension
from setuptools import setup
from setuptools.extension import Extension
import subprocess
import os
import numpy
### For Cython build
# if False:
# try:
# from Cython.Build import cythonize
# USE_CYTHON = True
# ex... |
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Copyright (c) 2017-2019 The Raven Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test resurrection of mined transactions when the b... |
import torch
from torch import optim
import torch.nn.functional as F
from utils import hparams as hp
from utils.display import *
from utils.dataset import get_tts_datasets
from utils.text.symbols import symbols
from utils.paths import Paths
from models.tacotron import Tacotron
import argparse
from utils import data_par... |
from http import HTTPStatus
from unittest import mock
from unittest.mock import call
from assertpy import assert_that
import pytest
from src import app
from src.dtos.user import UserDto
from src.services.snake_to_pascal_serializer import JSONSerializer as PascalJson
@pytest.fixture
def client():
client = app.cr... |
from datetime import time, datetime
from time import time_ns
def parse_time(string: str) -> time:
return datetime.strptime(string, '%H:%M').time()
def timestamp_ms() -> int:
return time_ns() // 1_000_000
|
from django.apps import AppConfig
class DadJokeConfig(AppConfig):
name = 'django-dad'
|
import datetime
from TestScript import TestScript
class BuildAgent(TestScript):
"""
Base class for build agents that poll and clone repositories
"""
def __init__(self, number, args, cloner, poller):
super(BuildAgent, self).__init__(number, args)
self.clone = cloner(self.number, self.a... |
##########################################################################
#
# Copyright (c) 2011-2012, John Haddon. All rights reserved.
# Copyright (c) 2011-2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted prov... |
from rest_framework import generics
from .serializers import DeviceSerializer
from .models import Device
class CreateView(generics.ListCreateAPIView):
"""A class that handles what the creating a device page looks like."""
queryset = Device.objects.all()
serializer_class = DeviceSerializer
# override fo... |
import codecs
import logging
import os
from pathlib import Path
import regex
from curation_utils import file_helper
from indic_transliteration import sanscript
from bs4 import BeautifulSoup
from doc_curation import md_helper
from doc_curation.md_helper import MdFile
def get_text(src_file):
with codecs.open(src... |
# Code generated by lark_sdk_gen. DO NOT EDIT.
from pylark.lark_request import RawRequestReq, _new_method_option
from pylark import lark_type, lark_type_sheet, lark_type_approval
import attr
import typing
import io
@attr.s
class DeleteCalendarTimeoffEventReq(object):
timeoff_event_id: str = attr.ib(
defa... |
# -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import os
import re
from .console import console
from . import util
class Repo(object):
"""
Base class for re... |
# flake8: noqa
from cereal import car
from selfdrive.car import dbc_dict
Ecu = car.CarParams.Ecu
VisualAlert = car.CarControl.HUDControl.VisualAlert
class CarControllerParams():
def __init__(self, CP):
self.BRAKE_MAX = 1024//4
self.STEER_MAX = CP.lateralParams.torqueBP[-1]
# mirror of list (assum... |
import os
from collections import defaultdict
import numpy as np
import networkx as nx
import gensim
from joblib import Parallel, delayed
from tqdm import tqdm
from .parallel import parallel_generate_walks
class FairWalk:
FIRST_TRAVEL_KEY = 'first_travel_key'
PROBABILITIES_KEY = 'probabilities'
NEIGHBOR... |
# -*- coding: utf-8 -*-
# Copyright (c) 2019, VHRS and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
# import frappe
from frappe.model.document import Document
class CrackTest(Document):
pass
|
from rest_framework import serializers
from . import models
from dunqgram.users import serializers as user_serializer
from dunqgram.images import serializers as image_serializer
class NotifySerializers(serializers.ModelSerializer):
creator = user_serializer.ListUserSerializer()
image = image_serializer.SmallI... |
#!/usr/bin/env python
import json, sys
from random import randint
tl = json.loads(sys.stdin.read())
tilelayers = [ x for x in tl['layers'] if x["type"]=="tilelayer"]
objects = { z['name']:z for z in x['objects'] for x in tl['layers'] if x["type"]=="objectgroup"}
tileproperties = [ x for x in tl['tilesets'] if x["na... |
# Copyright 2019 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... |
from typing import List
from deeppavlov.core.common.registry import register
@register("sentseg_restore_sent")
def SentSegRestoreSent(batch_words: List[List[str]], batch_tags: List[List[str]]) -> List[str]:
ret = []
for words, tags in zip(batch_words, batch_tags):
if len(tags) == 0:
ret.a... |
import unittest
import socket
import time
from subprocess import Popen
from contextlib import closing
TIMEOUT = 30
host, port = '127.0.0.1', 9342
class TestCase(unittest.TestCase):
def setUp(self):
self._fake_robot = Popen(['python', '../tools/fake_robot.py'])
wait_for_server()
def tearDow... |
import os
import csv
import tempfile
from zipfile import ZipFile
import requests
# Settings
base_path = os.path.abspath(__file__ + "/../../")
# START - Paths for new February 2021 data available
# External website file url
source_url = "https://assets.datacamp.com/production/repositories/5899/datasets/66691278303f7... |
from pprint import pprint
graph = {}
graph['start'] = {'A': 6, 'B': 2}
graph['A'] = {'finish': 1}
graph['B'] = {'A': 3, 'finish': 5}
graph['finish'] = {}
infinity = float('inf')
costs = {}
costs['A'] = 6
costs['B'] = 2
costs['finish'] = infinity
parents = {}
parents['A'] = 'start'
parents['B'] = 'start'
parents['fi... |
from utils import CanadianScraper, CanadianPerson as Person
COUNCIL_PAGE = 'https://www.oshawa.ca/city-hall/city-council-members.asp'
class OshawaPersonScraper(CanadianScraper):
def scrape(self):
page = self.lxmlize(COUNCIL_PAGE)
councillors = page.xpath('//table//td[*]')
assert len(coun... |
from builtins import print
# Tuplas
tupla = (12, 2, 5, 8, 33, 22, 66, 99, 2)
print(tupla)
# Dictionary
dictionary = dict(newton=1643, marx=1818)
dictionary["mozart"] = 1756;
print(dictionary.keys())
|
#https://teratail.com/questions/98319
# 2d img --> 3d img by luminance
from PIL import Image, ImageOps
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
# 画像読み込み
org_img = Image.open('4388281942_resized.jpg')
# グレースケール化
img = ImageOps.grayscale(org_img)
# 配列化
data = np.asarray... |
import os,sys
def readFile(fn):
a = []
with open(fn,"rb") as f:
b = f.read(1)
while b!=b'':
a.append(ord(b))
b = f.read(1)
return a
arr = readFile("FDUMPDAT.8xv")[(55+17+2):-2]
lfont_arr = arr[:1197]
sfont_arr = arr[1344:]
sfont_len = 1024+sum([i>>7 for i in sfont_arr... |
import pytest
import json
import jsonpickle
import os.path
import importlib
from fixture.application import Application
from fixture.db import DbFixture
fixture = None
target = None
@pytest.fixture(scope="session")
def db(request):
db_config = load_config(request.config.getoption("--target"))["db"]
dbfixtur... |
# standard modules
import datetime
import logging
import os
import zipfile
# 3rd party modules
import matplotlib.pyplot as plt
from matplotlib.path import Path
import numpy
import pandas
#from scipy.misc.pilutil import imread
# PFP modules
import constants as c
import footprint_io
import footprint_utils
... |
"""Python Crypto Bot consuming Coinbase Pro or Binance APIs"""
import functools
import os
import sched
import sys
import time
import pandas as pd
from datetime import datetime
from models.PyCryptoBot import PyCryptoBot, truncate as _truncate
from models.AppState import AppState
from models.Trading import TechnicalAnal... |
#!/usr/bin/env python
import sys
import argparse
from elasticsearch import Elasticsearch
from annotator.reindexer import Reindexer
description = """
Reindex an elasticsearch index.
WARNING: Documents that are created while reindexing may be lost!
"""
def main(argv):
argparser = argparse.ArgumentParser(descript... |
# -*- coding: utf-8 -*-
"""
TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-节点管理(BlueKing-BK-NODEMAN) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in compliance ... |
import pytest
class WindowManager:
def __init__(self, logging_directory):
...
def close(self):
"""
Close the WindowManager and all associated resources.
"""
...
@pytest.fixture
def manager():
return WindowManager()
def test_windows_creation(manager):
... |
#----------------------------------------------------------------------
# Name: wxMimeTypesManager
# Purpose: Demonstrate use of wx.MimeTypesManager, wx.FileType
#
# Author: Jeff Grimmett (grimmtoo@softhome.net), adapted from original
# .wdr-derived demo
#
# Created: 12/31/03
# Copyrigh... |
from __future__ import absolute_import
import numpy as np
import warnings
from sklearn.metrics.pairwise import pairwise_distances
from ..mini_six import range
from .neighbors import nearest_neighbors
__all__ = [
'downsample_trajectories', 'epsilon_net', 'fuzzy_c_means'
]
def downsample_trajectories(trajectorie... |
# Copyright 2015 The Meson development team
#
# 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
#
# Unless required by applicable law or agreed ... |
# Copyright 2020 The HuggingFace Team. 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/licenses/LICENSE-2.0
#
# Unless required by applicabl... |
import unittest
from pyloco.test import TestSuite
from .test_ncread import test_classes as task_ncreads
from .test_ncdump import test_classes as task_ncdumps
from .test_nccalc import test_classes as task_nccalcs
from .test_ncplot import test_classes as task_ncplots
def nctools_unittest_suite():
loader = unittes... |
import os
from collections import defaultdict
from indra.sources import biopax
from indra.statements import *
import indra.sources.biopax.processor as bpc
from indra.util import unicode_strs
from nose.plugins.attrib import attr
model_path = os.path.join(os.path.dirname(os.path.abspath(__file__)),
... |
# Copyright 2022 @ReneFreingruber
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... |
# Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
from ..azure_common import BaseTest, arm_template
class LoadBalancerTest(BaseTest):
def setUp(self):
super(LoadBalancerTest, self).setUp()
def test_load_balancer_schema_validate(self):
with self.sign_out_patch():
... |
from django.contrib import admin
from posts.models import Post
# Register your models here.
@admin.register(Post)
class PostsAdmin(admin.ModelAdmin):
list_display = (
"pk",
"title",
"user",
"likes",
"photo",
"create_at",
"modified_at"
)
list_display... |
from http.server import BaseHTTPRequestHandler, HTTPServer
import broadlink, configparser
import sys, getopt
import time, binascii
import netaddr
import settings
import signal
import socket
import errno
import json
import shutil
from os import path
from Crypto.Cipher import AES
class Server(HTTPServer):
def get_re... |
import vtk
from urllib import request, parse
from pathlib import Path
from pyunpack import Archive, PatoolError
from zipfile import BadZipFile
import sys
import re
import os
from ctypes import *
import logging
import subprocess
import shutil
from . import readers
class VtkUtil:
# scratch_directory is a directory... |
""" Version information for InvenTree.
Provides information on the current InvenTree version
"""
import subprocess
import django
import re
import common.models
# InvenTree software version
INVENTREE_SW_VERSION = "0.6.0 dev"
# InvenTree API version
INVENTREE_API_VERSION = 22
"""
Increment this API version number wh... |
import os
from setuptools import setup
readme = os.path.join(os.path.dirname(__file__), 'README.rst')
setup(
name='zimports',
version="0.2.0",
description="yet another import fixing tool",
long_description=open(readme).read(),
classifiers=[
'Development Status :: 3 - Alpha',
'Lice... |
import random
from datetime import datetime, timedelta
from src.backup.datastore.Backup import Backup
from src.backup.datastore.Table import Table
def create_backup_daily_sequence(count, table=Table(),
start_date=datetime(2017, 2, 1, 16, 30)):
backups = []
for _ in range(coun... |
#!/usr/bin/env python
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# ---------------------------------------------... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2005 onwards University of Deusto
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
# This software consists of contributions made by many individuals,
# list... |
import FWCore.ParameterSet.Config as cms
OuterTrackerMonitorTTClusterClient = cms.EDAnalyzer('OuterTrackerMonitorTTClusterClient')
|
from mayan.apps.documents.permissions import (
permission_document_type_edit, permission_document_view
)
from mayan.apps.documents.tests.base import GenericDocumentViewTestCase
from mayan.apps.testing.tests.base import GenericViewTestCase
from ..events import event_smart_link_created, event_smart_link_edited
from ... |
"""
输入一个正整数判断它是不是素数
Version: 0.1
Author: 骆昊
Date: 2018-03-01
"""
from math import sqrt
num = int(input('请输入一个正整数: '))
end = int(sqrt(num))
is_prime = True
for x in range(2, end + 1):
if num % x == 0:
is_prime = False
break
if is_prime and num != 1:
print('%d是素数' % num)
else:
print('%d不是素数... |
import sys
import uuid
import psutil
import time
from datetime import datetime
# remove for production
from pprint import pprint
from functools import reduce
import function_lib as lib
class Invocation:
def __init__(self, exp_uuid: str, root: str, data: dict):
self.exp_id = exp_uuid
self.root_ide... |
import pyautogui
import time
time.sleep(3)
# imgQuality = resolução da captura de tela / resolução da tela
# por algum motivo as capturas de tela de um mac ficaram com 2x a resolução da tela
imgQuality = 2
def scroll_to_negodi_and_click():
negodi = None
while negodi is None:
time.sleep(0.05)
p... |
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup --------------------------------------------------------------
# If extensions (or module... |
import nipype.interfaces.io as nio
import nipype.interfaces.utility as niu
import nipype.algorithms.misc as misc
from nipype.interfaces.utility import Function
from nipype.interfaces.base import (TraitedSpec, File, traits, InputMultiPath,
BaseInterface, OutputMultiPath, BaseInterfac... |
"""Ray constants used in the Python code."""
import logging
import math
import os
logger = logging.getLogger(__name__)
def env_integer(key, default):
if key in os.environ:
return int(os.environ[key])
return default
def env_bool(key, default):
if key in os.environ:
return True if os.env... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import dateutil.parser
import hashlib
import hmac
import logging
import six
from django.db import IntegrityError, transaction
from django.http import HttpResponse
from django.utils.crypto import constant_time_compare
from django.utils.decorators import me... |
# Copyright 2016 the gpflow 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://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... |
#!/bin/python3
import sys
n,q = input().strip().split(' ')
n,q = [int(n),int(q)]
s = input().strip()
for a0 in range(q):
inp = [int(x) for x in input().strip().split(' ')]
if inp[0] == 1:
s = list(s)
for i in range(inp[1],inp[2]+1):
asc = ord(s[i]) + inp[3]
i... |
# Lint as: python3
# Copyright 2020 The TensorFlow Probability 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://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# ordered set documentation build configuration file, created by
# sphinx-quickstart on Fri Aug 14 11:39:14 2020.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
... |
# Copyright (c) 2020, Build-A-Cell. All rights reserved.
# See LICENSE file in the project root directory for details.
import copy
from typing import List, Union
from warnings import resetwarnings, warn
from .chemical_reaction_network import ChemicalReactionNetwork
from .component import Component
from .global_mecha... |
#cities.urls
from django.urls import path
from introduction_to_django.cities.views import index, list_phones, phones_data, transaction_done_index, create_person, \
forms
urlpatterns = [
path('', index),
path('phones/', list_phones),
path('phones_shop/', phones_data),
path('transaction_done/', tran... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on Sunday Feb 16 4:25pm 2020
Performing pulsation search techniques on incoming data beyond quicklook but before archival.
Don't need to search for burst candidates here - already have it in Lv3_TBOs.py!
Pretty similar to Lv3_quicklook.py, but takes as input ... |
# coding=utf-8
# Copyright 2019 The Google Research 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://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... |
# Generated by Django 3.2.3 on 2021-09-01 18:30
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('main', '0010_rename_vendor_name_purchase_order_vendor_id'),
]
operations = [
migrations.AddField(
... |
from flask_pymongo import PyMongo
mongo = PyMongo()
|
# Copyright 2017 Google LLC 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/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... |
# 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 ... |
#!/usr/bin/env python
import urllib2
from nagioscheck import NagiosCheck, UsageError
from nagioscheck import PerformanceMetric, Status
try:
import json
except ImportError:
import simplejson as json
HEALTH = {'red': 0,
'yellow': 1,
'green': 2}
RED = HEALTH['red']
YELLOW = HEALTH['yellow... |
# -*- coding:utf-8 -*-
import os
from setuptools import setup
f = open(os.path.join(os.path.dirname(__file__), 'README.md'))
readme = f.read()
f.close()
setup(
name='yacbv',
version='0.2.0',
description='Yet another class based views for Django',
long_description=readme,
author="Daniel Czuba",
... |
from awxkit.api.pages import Page
from awxkit.utils import random_title
class HasCopy(object):
def can_copy(self):
return self.get_related('copy').can_copy
def copy(self, name=''):
"""Return a copy of current page"""
payload = {"name": name or "Copy - " + random_title()}
endpo... |
from . import trackernetwork
import asyncio
import aiohttp
@asyncio.coroutine
def fetch(session, url):
response = yield from session.get(url)
return response
@asyncio.coroutine
def apiSession(apikey):
headers = {'TRN-Api-Key':apikey}
return aiohttp.ClientSession(headers=headers)
@asyncio.coroutine
de... |
"""Light-weight mapping between sqlite3 and python data structures."""
import logging
import sqlite3
from typing import Any, Callable, Dict
LOG = logging.getLogger(__name__)
class DatabaseRow:
"""Base class for sqlite Row schemas."""
TABLE_NAME: str
FIELDS: Dict[str, Callable[[Any], Any]]
def __ini... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.