text stringlengths 2 999k |
|---|
from app_mask import app, config
app.run(host=config.HOST, port=config.PORT, debug=False)
|
import re
import json
from six.moves.urllib.parse import parse_qs
import pytest
from urlobject import URLObject
import responses
from nylas.client import APIClient
from nylas.client.errors import APIClientError
from nylas.client.restful_models import Contact
def urls_equal(url1, url2):
"""
Compare two URLObje... |
# -*- coding: utf-8 -*-
# Copyright (c) 2012-2020, Anima Istanbul
#
# This module is part of anima and is released under the MIT
# License: http://www.opensource.org/licenses/MIT
"""create deformer with::
deformer -type "randomizeUVDeformer"
"""
import sys
from maya import OpenMaya, OpenMayaMPx
node_type_name = ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import pygame
import random
SCREEN_WIDTH = 800
SCREEN_HEIGHT = 576
# Define some colors
BLACK = (0,0,0)
WHITE = (255,255,255)
BLUE = (0,0,255)
GREEN = (0,255,0)
RED = (255,0,0)
class Block(pygame.sprite.Sprite):
def __init__(self,x,y,color,width,hei... |
from __future__ import print_function, division
from copy import deepcopy
from os import listdir
from os.path import isdir, isfile, join, splitext
from sys import stderr
import pandas as pd
import yaml
from six import iteritems
from .object_concatenation import get_appliance_types
# from meta_info import feed_mappin... |
# 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/licenses/LICENSE-2.0
#
# Unless required by applica... |
""" A Plex Media Server agent for using album art as artist posters
"""
import os
import re
import hashlib
import unicodedata
import mutagen
# Settings lifted from localmedia agent
IMAGE_EXTS = ['jpg', 'png', 'jpeg', 'tbn']
ART_EXTS = ['jpg', 'jpeg', 'png', 'tbn']
POSTER_FILES = ['poster', 'default', 'cover', 'movie'... |
# coding: utf8
from django.contrib import admin
from .models import domain_class
@admin.register(domain_class)
class DomainAdmin(admin.ModelAdmin):
pass
|
#!/usr/bin/env python3
#
# _css.py
"""
Internal Sphinx extension to provide custom CSS.
.. versionadded:: 2.7.0
"""
#
# Copyright © 2020-2021 Dominic Davis-Foster <dominic@davis-foster.co.uk>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated document... |
# keyword.py - $Keyword$ expansion for Mercurial
#
# Copyright 2007-2010 Christian Ebert <blacktrash@gmx.net>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
#
# $Id$
#
# Keyword expansion hack against the grain of a DSCM
#
# There... |
#%%
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from torch import optim
import re
import time
import jieba
import random
import math
import string
#%%
# # 1.数据处理部分
USE_CUDA = False
path = 'data/cmn-eng/'
SOS_token = 0
EOS_token = 1
MAX_LENGTH = 10
def isChin... |
#!/bin/env python
# -*- coding: utf-8 -*-
##
# test_azure.py: Tests Azure Quantum functionality against a mock workspace.
##
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
##
## IMPORTS ##
import pytest
import qsharp
from qsharp.azure import AzureError, AzureJob, AzureTarget
from .utils impo... |
class Node():
def __init__(self,value):
self.value = value
self.left = None
self.right = None
def get_value(self):
return self.value
def set_value(self, value):
self.value = value
def set_right(self,right):
self.right = right
... |
#
# Page Cache maintains a collection of cached files on disk
#
# It has a concept of 'version'. If provided, it will store
# the data in a subdirectory.
#
# It is extracted from my scanner so it has functionality that
# doesn't apply in a web content.
#
import os
import shutil
import re
import datetime
impor... |
# 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 ... |
# -----------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# -----------------------------------------------------------------------------
im... |
"""
Matplotlib plots
"""
from sklearn.datasets import load_iris
from sklearn.datasets import load_boston
from matplotlib import pyplot as plt
iris = load_iris()
print(iris.DESCR)
data = iris.data
plt.plot(data[:, 0], data[:, 1], ".")
plt.show()
boston = load_boston()
print(boston.DESCR)
data = boston.data
plt.plot... |
from .__transfer import create, get, pdf, query, page, delete
from .log.__log import Log
from . import log
|
from discord.ext import commands
import discord
import traceback
import sys
import math
"""
If you are not using this inside a cog, add the event decorator e.g:
@bot.event
async def on_command_error(ctx, error)
For examples of cogs see:
Rewrite:
https://gist.github.com/EvieePy/d78c061a4798ae81be9825468fe... |
from __future__ import absolute_import, division, print_function
import gzip
from datashape import discover, dshape
from collections import Iterator
from toolz import partial, concat
import os
from ..compatibility import unicode
from ..chunks import chunks
from ..drop import drop
from ..append import append
from ..co... |
# Copyright 2020 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 atexit
import base64
import cgi
import json
import logging
import os
import requests
import sys
LOGGER = logging.getLogger(__name__)
# VALID_STATUSES... |
"""
NetworkLogPlotter visualizes NetworkLogReader objects to find relationships between
server send and receive errors on a network.
Created by: Tony Held tony.held@gmail.com
Created on: 2020/09/10
Copyright © 2020 Tony Held. All rights reserved.
"""
import numpy as np
import matplotlib.pyplot as plt
import plotly.g... |
"""Module containing class `AudioFileReader`."""
class AudioFileReader:
"""Abstract base class for audio file readers."""
def __init__(
self, file_path, file_type, num_channels, length, sample_rate,
dtype, mono_1d=False):
self._file_path = file_path
... |
# -*- coding: utf-8 -*-
__author__ = 'Dmitriy.Dakhnovskiy'
from .boolean_field import BooleanField
from .integer_field import IntegerField
from .text_field import TextField
from .base_field import BaseField
|
"""
#
#
#
#
# Model Selection Example (Classification)
# test_model_selection_flow.py
#
#
#
#
#
#
Model Selection Params:
def flow(self,
models_to_flow=[],
params=None,
test_size=0.2,
nfolds=3,
nrepeats=3,
pos_split=1,
... |
# (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible 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 later version.
#
# Ansible is dis... |
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Group
from mayan.apps.documents.tests.base import GenericDocumentViewTestCase
from mayan.apps.metadata.permissions import permission_document_metadata_edit
from mayan.apps.metadata.tests.mixins import MetadataTypeTestMixin
from mayan... |
import pulsar as psr
def load_ref_system():
""" Returns 2_2_2-trifluoroacetic_acid as found in the IQMol fragment library.
All credit to https://github.com/nutjunkie/IQmol
"""
return psr.make_system("""
C 0.5119 -0.1804 0.1034
C -0.8986 0.4734 -0.1579
... |
'''
This is a bunch of stuff to start a beam search using gen_model_train as a
baseline. I'll try to implement augmentation and structure_data as well.
I'll additionally try to see how feasible it is to do an extendable beam search,
where we remember certain vectors for later.
We'll additionally incorporate ensemblin... |
# Copyright (c) 2016-2020 Renata Hodovan, Akos Kiss.
#
# Licensed under the BSD 3-Clause License
# <LICENSE.rst or https://opensource.org/licenses/BSD-3-Clause>.
# This file may not be copied, modified, or distributed except
# according to those terms.
from .arg import add_arguments
def execute(arguments):
from ... |
import _plotly_utils.basevalidators
class YpadValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="ypad", parent_name="parcoords.line.colorbar", **kwargs
):
super(YpadValidator, self).__init__(
plotly_name=plotly_name,
parent_name=pa... |
# -*- coding: utf-8 -*-
# File: summary.py
import six
import tensorflow as tf
import re
from six.moves import range
from contextlib import contextmanager
from tensorflow.python.training import moving_averages
from ..utils import logger
from ..utils.argtools import graph_memoized
from ..utils.naming import MOVING_SU... |
#!/usr/bin/python
# encoding=utf-8
import sys
if sys.version_info[0] == 2:
# Python2
import core.AepSdkRequestSend as AepSdkRequestSend
else:
# Python3
from apis.core import AepSdkRequestSend
#参数MasterKey: 类型String, 参数可以为空
# 描述:
#参数body: 类型json, 参数不可以为空
# 描述:body,具体参考平台api说明
def CreateDeviceGroup(... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This module contains unit tests for the arc.scheduler module
"""
from __future__ import (absolute_import, division, print_function, unicode_literals)
import unittest
import os
import shutil
import arc.rmgdb as rmgdb
from arc.scheduler import Scheduler
from arc.job.jo... |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云(BlueKing) available.
Copyright (C) 2017 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 with the License.
You may obt... |
#
# 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... |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2020, the cclib development team
#
# This file is part of cclib (http://cclib.github.io) and is distributed under
# the terms of the BSD 3-Clause License.
"""Parser for Q-Chem output files"""
from __future__ import division
from __future__ import print_function
import iterto... |
flag = "flag{b3453333-9da9-49ae-b4ed-0017c392d58e}"
e1 = 65537
e2 = 368273 |
# Generated by Django 3.1.1 on 2020-12-14 14:53
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main_store', '0019_auto_20201214_1200'),
]
operations = [
migrations.AlterField(
model_name='prescription',
name='pd... |
# -*- coding: utf-8 -*-
# Global constant data / parameters
NBA_BASE_URL = 'http://stats.nba.com/stats/'
LEAGUE_ID_NBA = '00'
CURRENT_SEASON = '2016-17'
# EndPoints
# Teams EndPoints
COMMON_TEAM_YEARS_ENDPOINT = 'commonteamyears'
TEAM_INFO_COMMON_ENDPOINT = 'teaminfocommon'
COMMON_TEAM_ROSTER_ENDPOINT = 'commonteamr... |
###
# Copyright (c) 2004-2005, Jeremiah Fincher
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of co... |
from django.core.management.base import BaseCommand
from oscar.core.loading import get_classes
from blousebrothers.confs.models import Conference
from blousebrothers.confs.utils import get_or_create_product
from django.db.models import Q
ProductClass, Product, Category, ProductCategory, ProductImage = get_classes(
... |
# 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... |
# This script contains code for Linear SVMs
# Author: Sami Alperen Akgun
# Email: sami.alperen.akgun@gmail.com
import os
import numpy as np
from matplotlib import pyplot as plt
from sklearn import svm #svm library from sklearn Python module
def read_data(data_path, filename,feature_number):
"""
This func... |
# coding: utf-8
"""
Task Execution Service
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v1
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import... |
"""Lab 7 starter code by Purva Gawde, implementation by the CSCA20 student. """
def move_cursor(f):
'''Given an open file f, reads past its three-line header.
Args:
f: a freshly opened file in the format of the file alkaline_metals.txt
'''
def list_of_list(f):
'''Reads the contents of alka... |
# -*- coding: utf-8 -*-
from ._parser import parse, parser, parserinfo
from ._parser import DEFAULTPARSER, DEFAULTTZPARSER
from ._parser import UnknownTimezoneWarning
from ._parser import __doc__
from .isoparser import isoparser, isoparse
__all__ = ['parse', 'parser', 'parserinfo',
'isoparse', 'isoparser'... |
import _plotly_utils.basevalidators
class ValueValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name='value', parent_name='scattergl.error_x', **kwargs
):
super(ValueValidator, self).__init__(
plotly_name=plotly_name,
parent_name=pare... |
from parcels import FieldSet, ParticleSet, ScipyParticle, JITParticle, AdvectionRK4
from datetime import timedelta as delta
import pytest
from os import path
ptype = {'scipy': ScipyParticle, 'jit': JITParticle}
def set_ofam_fieldset(full_load=False):
filenames = {'U': path.join(path.dirname(__file__), 'OFAM_exa... |
import asyncio
from pyrogram import Client, idle
from . import anibot
from .utils.db import _close_db
async def main():
await asyncio.gather(anibot.start())
await idle()
await asyncio.gather(anibot.stop())
_close_db()
asyncio.get_event_loop().run_until_complete(main()) |
# Define here the models for your spider middleware
#
# See documentation in:
# https://docs.scrapy.org/en/latest/topics/spider-middleware.html
from scrapy import signals
# useful for handling different item types with a single interface
from itemadapter import is_item, ItemAdapter
class CiaSpiderMiddleware:
# ... |
from sklearn.datasets import load_iris
from sklearn.neighbors import KNeighborsClassifier
from sklearn.model_selection import cross_val_score
from sklearn.svm import SVR
from sklearn.tree import DecisionTreeRegressor
from sklearn.neural_network import MLPRegressor
from hyperactive import Hyperactive, EnsembleOptimize... |
"""TCPClient driver classes."""
import socket
from schema import Use, Or
from testplan.common.utils.timing import TimeoutException, TimeoutExceptionInfo
from testplan.common.config import ConfigOption
from testplan.common.utils.context import is_context, expand
from testplan.common.utils.sockets import Client
from ... |
# -*- coding: UTF-8 -*-
from nose.tools import assert_equal, assert_raises
from ckanapi import LocalCKAN, ValidationError
from ckan.tests.helpers import FunctionalTestBase
from ckan.tests.factories import Organization
from ckanext.recombinant.tables import get_chromo
class TestExperiment(FunctionalTestBase):
de... |
# Copyright 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 accompany... |
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Notes:
#
# This generates makefiles suitable for inclusion into the Android build system
# via an Android.mk file. It is based on make.py, the standard makefile
... |
import logging
import uuid
class Box:
def __init__(
self,
box_header,
box_contents,
top_left,
top_right,
bottom_right,
bottom_left,
input_data_flow_ports,
input_control_flow_ports,
output_data_flow_ports,
output_control_flow_p... |
import pytest
from ansys import dpf
from ansys.dpf.core import Model
@pytest.fixture()
def model(velocity_acceleration):
return dpf.core.Model(velocity_acceleration)
def test_get_resultinfo_no_model(velocity_acceleration):
dataSource = dpf.core.DataSources(velocity_acceleration)
dataSource.set_result_fi... |
# THIS FILE IS A PART OF GIMEL STUDIO AND IS LICENSED UNDER THE SAME TERMS:
# ----------------------------------------------------------------------------
# Gimel Studio Copyright 2019-2021 by Noah Rahm and contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file exce... |
import json
import os
import sys
from chalicelib import APP_NAME
if __package__:
current_path = os.path.abspath(os.path.dirname(__file__)).replace('/' + str(__package__), '', 1)
else:
current_path = os.path.abspath(os.path.dirname(__file__))
if not current_path[-1] == '/':
current_path += '/'
ROOT_DIR =... |
# pylint: disable=too-many-lines
# 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) AutoRe... |
# Slice is a way to get a copy of a portion of list/string/tuple.
# Slice is possible on any ordered collection where index with numbers are possible
my_list = list(range(10))
# First element
print(my_list[0])
# last element
print(my_list[-1])
# slice, start at 1 index, ends at 3-1 = 2 index
print(my_list[1:3])
# copy... |
#MIT License
#Copyright (c) 2020 Semih Aydın
#UTF-8
import logging
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
formatter = logging.Formatter("%(asctime)s:%(levelname)s:%(message)s")
file_handler = logging.FileHandler("./logs/fun.log")
file_handler.setFormatter(formatter)
logger.addHandler(fi... |
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="monk_pytorch_cuda101", # Replace with your own username
version="0.0.1",
author="Tessellate Imaging",
author_email="abhishek@tessellateimaging.com",
description="Monk Classification Librar... |
from .bot import SignalBot
from .command import Command, CommandError, triggered
from .message import Message, MessageType, UnknownMessageFormatError
from .api import SignalAPI, ReceiveMessagesError, SendMessageError
from .context import Context
__all__ = [
"SignalBot",
"Command",
"CommandError",
"trig... |
#!/usr/bin/env python
"""A module with filesystem-related utility functions and classes."""
import array
import os
import platform
import stat
from typing import Dict
from typing import NamedTuple
from typing import Optional
from typing import Text
from grr_response_core.lib.util import compatibility
from grr_respon... |
"""
Copyright (c) 2018-2019 Intel 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 i... |
#!/usr/bin/python3
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
fig = plt.figure(figsize=(8, 8), facecolor="lightgray")
ax = plt.subplot(111, frameon=False)
data = np.random.normal(.5, .5, (128, 150))
X = np.linspace(-1.2, 1.2, data.shape[-1])
G = 1.5 * np.exp(-4 * X *... |
# -*- 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 KRAParameter(Document):
pass
|
class Solution:
def busyStudent(self, startTime: List[int], endTime: List[int], queryTime: int) -> int:
arr = [0]*1002
for i in startTime:
arr[i] += 1
for i in endTime:
arr[i+1] -= 1
for i in range(1,1002):
arr[i] += arr[i-1]
return arr[qu... |
# Copyright 2021 TerminalWarlord under the terms of the MIT
# license found at https://github.com/TerminalWarlord/Subtitle-Downloader-Bot/blob/master/LICENSE
# Encoding = 'utf-8'
# Fork and Deploy, do not modify this repo and claim it yours
# For collaboration mail me at dev.jaybee@gmail.com
from pyrogram impo... |
# Copyright 2010-2021, Google 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:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and ... |
# -*- coding: utf-8 -*-
# pylint: disable=C0103,W0622
'''
Sphinx documentation for Salt
'''
import functools
import sys
import os
import types
import time
from sphinx.directives import TocTree
# pylint: disable=R0903
class Mock(object):
'''
Mock out specified imports.
This allows autodoc to do its thing... |
from jinja2 import Template
import json
class ReactTemplate(object):
"""Base React class.
This class handles the basic transformation of the React jsx code.
It takes a dictionary of options, renders the template, and
writes the transformed javascript file.
Args:
templa... |
# Copyright (c) 2021, VRAI Labs and/or its affiliates. All rights reserved.
#
# This software is licensed under the Apache License, Version 2.0 (the
# "License") as published by the Apache Software Foundation.
#
# You may not use this file except in compliance with the License. You may
# obtain a copy of the License at... |
import contextlib
import warnings
import sqlalchemy
import sqlalchemy.dialects.mysql as mysql
import ibis.expr.datatypes as dt
from ibis.backends.base.sql.alchemy import BaseAlchemyBackend
from .compiler import MySQLCompiler
class Backend(BaseAlchemyBackend):
name = 'mysql'
compiler = MySQLCompiler
de... |
from flask import jsonify
from flask_restful import Resource, request, current_app
from flask_swagger import swagger
from backend.services.settings_service import SettingsService
from backend.services.messaging.smtp_service import SMTPService
class SystemDocsAPI(Resource):
"""
This Resource provides a simple... |
import os
import sys
import copy
import platform
import pytest
import numpy as np
from numpy.core.multiarray import typeinfo
from . import util
wrap = None
def setup_module():
"""
Build the required testing extension module
"""
global wrap
# Check compiler availability first
if not util.h... |
#!/usr/bin/env python
import os
from setuptools import setup, find_packages
settings = dict()
# TODO: Load dependencies from requirements.txt file
long_description = open(os.path.join(os.path.dirname(__file__), 'README.md')).read()
settings.update(
name='docker-jinja',
version='1.0.1',
description='Exte... |
from ...shared.utils.restApi import RestResource
from ...shared.utils.api_utils import build_req_parser
from ..models.statistics import Statistic
from ..models.quota import ProjectQuota
class StatisticAPI(RestResource):
result_rules = (
dict(name="ts", type=int, location="json"),
dict(name="resul... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import os
import time
from time import time as now
import six
from cached_property import cached_property
from frozendict import frozendict
from py._path.local i... |
# Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
from openvino.tools.mo.utils.graph import Node
from openvino.tools.mo.utils.ir_reader.extender import Extender
from openvino.tools.mo.utils.ir_reader.extenders.conv_extender import Conv_extender
class BinaryConv_extender(Extender):
... |
import datetime
import factory
from ietf.ipr.models import (
IprDisclosureBase, HolderIprDisclosure, ThirdPartyIprDisclosure, NonDocSpecificIprDisclosure,
GenericIprDisclosure, IprDocRel, RelatedIpr
)
def _fake_patent_info():
return "Date: %s\nNotes: %s\nTitle: %s\nNumber: %s\nInventor: %s\n" % (
... |
from . import Expression
from ..utils import serialize_num
class Add(Expression):
def __init__(self, args, tpe):
self.args = args
self.tpe = tpe
def serialize(self, output):
output.write(b"add(")
self.args[0].serialize(output)
output.write(b", ")
self.args[1].s... |
from copy import deepcopy
from hashlib import sha256
from http import HTTPStatus
from io import BytesIO
from json import dumps, load, loads
from logging import INFO, basicConfig
from time import sleep
import smart_open
from mypy_boto3_lambda import LambdaClient
from mypy_boto3_s3 import S3Client
from mypy_boto3_s3cont... |
# src: https://github.com/facebookresearch/DrQA/blob/master/drqa/reader/data.py
import numpy as np
from torch.utils.data import Dataset
from torch.utils.data.sampler import Sampler
from .vector import vectorize
# ------------------------------------------------------------------------------
# PyTorch datase... |
# Standard library
from os import environ as env
from datetime import datetime
from uuid import uuid1, uuid4
# Third party
from google.cloud import datastore
# Application libraries
from almanak.constants import PERSISTENT_RESOURCES, TEMPORAL_RESOURCES
class DatastoreConnector:
"""Inventory and later: Entities,... |
# -*- coding: utf-8 -*-
# module pyparsing.py
#
# Copyright (c) 2003-2019 Paul T. McGuire
#
# 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... |
import json
from threading import Thread as T_
from itertools import permutations
import concurrent.futures
class jsonLoader:
def __init__(self, jsonFile:str):
self.writeList = []
self.allData = []
self.jsonFile = jsonFile
def load_data_threaded(self):
with open(self.jsonFile) ... |
#!/usr/bin/python
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Created by: Anderson Brito
#
# degapper.py -> This code removes gaps giving a maximum threshold (%)
# of gaps per site in a multiple sequence alignment.
#
# Usage: python degapper.py workingDirectory gapPerc... |
from contextlib import contextmanager
from itertools import islice, cycle
from django.conf import settings
from django.db import connection, connections, router
try:
from django.apps import apps, AppConfig
get_model = apps.get_model
except ImportError:
from django.db.models.loading import get_model
Ap... |
from __future__ import division
from cctbx import miller
from cctbx.examples.structure_factor_derivatives_3 \
import scatterer_as_list, scatterer_from_list, structure_factors
from cctbx.examples.exp_i_alpha_derivatives import least_squares
from cctbx.array_family import flex
from cctbx.development import random_struc... |
''' Inspired by https://github.com/ZipCPU/cordic'''
from pygears import gear
from pygears.typing import Int, Uint, code
from pygears.lib import ccat, when, field_sel
from pygears.lib import dreg
from pygears.lib import union_collapse
from pygears.lib import round_to_even
from pygears.lib.mux import mux
import math
de... |
#coding: utf-8
from collections import OrderedDict
import pandas as pd
import pytest
from pytdx.errors import TdxConnectionError, TdxFunctionCallError
from pytdx.hq import TdxHq_API, TDXParams
import socket
class Log(object):
def info(self, *args):
pass
log = Log()
# 测试任意组合的选项
@pytest.mark.parametri... |
from django.conf.urls import url, include
from rest_framework.routers import DefaultRouter
from apps.endpoints.views import EndpointViewSet
from apps.endpoints.views import MLAlgorithmViewSet
from apps.endpoints.views import MLAlgorithmStatusViewSet
from apps.endpoints.views import MLRequestViewSet
from apps.endpoints... |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: bpmn_process.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobu... |
# -*- coding: utf-8 -*-
"""Identity Services Engine getRepositories data model.
Copyright (c) 2021 Cisco and/or its affiliates.
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... |
import unittest
from pyalink.alink import *
import numpy as np
import pandas as pd
class TestUserCfUsersPerItemRecommender(unittest.TestCase):
def test_usercfusersperitemrecommender(self):
df_data = pd.DataFrame([
[1, 1, 0.6],
[2, 2, 0.8],
[2, 3, 0.6],
[4, 1,... |
import shutil
from docs_utils import add_all_code_examples, add_links
from keras_autodoc import DocumentationGenerator, get_methods
from python_on_whales.utils import PROJECT_ROOT
a = get_methods(
"python_on_whales.components.buildx.imagetools.cli_wrapper.ImagetoolsCLI"
)
print(a)
pages = {
"docker_client.md... |
"""
Helper tools to test the Kopf-based operators.
"""
from kopf.testing.runner import KopfRunner
__all__ = [
'KopfRunner',
]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.