text stringlengths 2 999k |
|---|
"""
Usage:
tpch-fed.py --file=<file>
Options:
--file=<file> Query file.
-h --help Show this screen.
--version Show version.
"""
import os
import connectorx as cx
from contexttimer import Timer
from docopt import docopt
import pandas as pd
if __name__ == "__main__":
args = doco... |
import tensorflow as tf
import abc
from collections import OrderedDict
class StereoNet(object):
__metaclass__ = abc.ABCMeta
"""
Meta parent class for all the convnets
"""
#=======================Static Class Fields=============
_valid_args = [
("split_layer", "name of the layer where t... |
"""
AFI Optimizer API
Allow clients to fetch Analytics through APIs. # noqa: E501
The version of the OpenAPI document: v3
Contact: analytics.api.support@factset.com
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from fds.sdk.AxiomaFixedIncomeO... |
"""
Crypto Bot running based on a given strategy
"""
import logging
import mplfinance as mpf
from common.analyst import resample_candles
from common.logger import init_logging
from common.steps import (
SetupDatabase,
ReadConfiguration,
FetchDataFromExchange,
LoadDataInDataFrame,
TradeSignal,
... |
class AudioMediaInfoListQueryParams(object):
def __init__(self, offset=None, limit=None):
# type: (int, int) -> None
super(AudioMediaInfoListQueryParams, self).__init__()
self.offset = offset
self.limit = limit
@property
def openapi_types(self):
types = {
... |
# sample commmand-line instruction
# ensure that you install PyPDF2 with pip install PyPDF2
# python trimpdf.py <your_PDF_file_name> 0-0 5-9 13-13 23-28 29-29
import sys
import PyPDF2
# Collect the arguments
file_name = sys.argv[1]
pages_range = sys.argv[2:]
new_file_name = 'PDF_Trimmed.pdf'
# looping ... |
"""remove_aggs
Revision ID: 7467e77870e4
Revises: c829ff0b37d0
Create Date: 2018-07-22 08:50:01.078218
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "7467e77870e4"
down_revision = "c829ff0b37d0"
def upgrade():
with op.batch_alter_table("table_columns") a... |
"""
Given the path to a single test image, this function generates its corresponding segmentation map
"""
from __future__ import print_function
from __future__ import division
import os
import gdal
import time
import torch
import shutil
import random
import argparse
import numpy as np
import pickle as cPickle
from ... |
#!/usr/bin/env python
#
# modelsimp_test.py - test model reduction functions
# RMM, 30 Mar 2011 (based on TestModelSimp from v0.4a)
import unittest
import numpy as np
from control.modelsimp import *
from control.matlab import *
from control.exception import slycot_check
class TestModelsimp(unittest.TestCase):
@un... |
# coding: utf-8
# flake8: noqa
"""
Deal API
<span class=\"tablenote\"><b>Note:</b> This is a <a href=\"https://developer.ebay.com/api-docs/static/versioning.html#limited\" target=\"_blank\"> <img src=\"/cms/img/docs/partners-api.svg\" class=\"legend-icon partners-icon\" title=\"Limited Release\" alt=\"Limite... |
from unittest import TestCase
from basketball_reference_web_scraper.http_client import PLAY_BY_PLAY_TIMESTAMP_FORMAT
from basketball_reference_web_scraper.parsers import PeriodTimestampParser
class TestPeriodTimestampParser(TestCase):
def setUp(self):
self.parser = PeriodTimestampParser(timestamp_format=... |
#!/usr/bin/python
#coding=utf-8
'''This is test module
@author: sheng
@contact: sinotradition@gmail.com
@copyright: License according to the project license.
'''
import unittest
from sinoera.ganzhi import dingsi14
TestDingsi14Functions(unittest.TestCase):
def setUp(self):
pass
def test_XXX(self):
... |
from django.core.management.base import BaseCommand, CommandError
from tracking.harvest import save_dfes_avl
class Command(BaseCommand):
help = "Runs save_dfes_avl to harvest points from DFES API"
def handle(self, *args, **options):
self.stdout.write("Harvesting DFES tracking data feed")
try... |
"""
MIT License
Copyright (c) 2021 UltronRoBo
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, di... |
#Maior e menor valores em Tupla
from random import randint
numeros = (randint(1,10), randint(1,10), randint(1,10))
"""print(f'Eu sorteei os valores {n}') -- usar com n"""
print('os valores sorteados foram: ', end='')
for n in numeros:
print(f'{n} ', end='')
print(f'\nO maior valor sorteado foi {max(numeros)}')
prin... |
import os
os.system('color')
class Color:
W = '\033[0m'
R = '\033[31m'
G = '\033[32m'
O = '\033[33m'
B = '\033[34m'
P = '\033[35m'
|
"""Tests sopel.tools"""
from __future__ import generator_stop
import re
import pytest
from sopel import tools
TMP_CONFIG = """
[core]
owner = testnick
nick = TestBot
enable = coretasks
"""
@pytest.fixture
def nick():
return 'Sopel'
@pytest.fixture
def alias_nicks():
return ['Soap', 'Pie']
@pytest.fix... |
"""
Mongo QCDB Abstract basic Collection class
Helper
"""
import abc
import copy
import json
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Set, Union
import pandas as pd
from ..models import ProtoModel
if TYPE_CHECKING: # pragma: no cover
from .. import FractalClient
from ..models import Ob... |
# Author: OMKAR PATHAK
# Contributors: Mohamed Kiouaz
# Created On: 31st July 2017
# Best O(n); Average O(n*(n-1)/4); Worst O(n^2)
# Bubble Sorting algorithm
def sort(List):
for i in range(len(List)):
for j in range(len(List) - 1, i, -1):
if List[j] < List[j - 1]:
List[j], List... |
"""
Generalized linear models currently supports estimation using the one-parameter
exponential families
References
----------
Gill, Jeff. 2000. Generalized Linear Models: A Unified Approach.
SAGE QASS Series.
Green, PJ. 1984. "Iteratively reweighted least squares for maximum
likelihood estimation, and some ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc
import os
from .gen_utils import... |
from __future__ import absolute_import, division, print_function
import numpy as np
import os
import time
from .config import LOCAL_PATH
from .core import (
AdditionOperator, CompositionOperator, DiagonalOperator, HomothetyOperator,
Operator, _pool)
from .flags import aligned, contiguous, inplace, linear, rea... |
from rest_framework import serializers
from .models import (AclPermissions,SubMenus,SubSubMenus,
Roles,UserProfile,UserRoles, Users, UserAddress, ConfigDetail, ConfigHead)
from django.contrib.auth import get_user_model
from dashboard.image_upload import *
from shared.fileserializer import Base64ImageField
def cre... |
# Generated by Django 2.2.23 on 2021-10-02 15:48
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('dictionary', '0081_auto_20210925_1123'),
]
operations = [
migrations.AlterField(
model_name='entry',
name='template... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2009, 2010 Google Inc. All rights reserved.
# Copyright (C) 2009 Torch Mobile Inc.
# Copyright (C) 2009 Apple Inc. All rights reserved.
# Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
#
# Redistribution and use in source and binary forms, with or wi... |
import DistributedElevator
import DistributedBossElevator
from ElevatorConstants import *
from direct.directnotify import DirectNotifyGlobal
from toontown.toonbase import TTLocalizer
class DistributedBBElevator(DistributedBossElevator.DistributedBossElevator):
def __init__(self, cr):
DistributedBossElevat... |
import re
import subprocess
import filecmp
import os
import sys
class COLORS:
HEADER = '\033[95m'
OK_BLUE = '\033[94m'
OK_GREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
END = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
# list all files in . directory
onlyfiles = [f for ... |
import _plotly_utils.basevalidators
class StreamtubeValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="streamtube", parent_name="", **kwargs):
super(StreamtubeValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Users',
fields=[
('id', models.AutoField(verbos... |
import copy
import torch.nn as nn
from rlkit.launchers.launcher_util import setup_logger
import rlkit.torch.pytorch_util as ptu
from rlkit.core.ma_eval_util import get_generic_ma_path_information
def experiment(variant):
from cartpole import CartPoleEnv
expl_env = CartPoleEnv(mode=3)
eval_env = CartPoleEnv... |
import torch
from torch.autograd import Variable
import pdb
import visdom
import logging
from data_loader import ecg_dataset_complex
from cfg import all_vars
from pathlib import Path
import matplotlib.pyplot as plt
def loggerConfig(log_file, verbose=2):
logger = logging.getLogger()
formatter = logging.Formatt... |
""" WebSocket Client """
import json
import asyncio
import websockets
def project_request(project_id):
return json.dumps({"type": "project", "project_id": project_id})
async def request_project(project_id):
uri = "ws://localhost:8765"
async with websockets.connect(uri) as websocket:
await webso... |
""" The post and put tests require the app context and are found in api-client """
from datetime import datetime
from unittest.mock import patch
from rfidsecuritysvc.api import RECORD_COUNT_HEADER
from rfidsecuritysvc.api import sounds as api
from rfidsecuritysvc.model.sound import Sound as Model
@patch('rfidsecuri... |
#!/usr/bin/env python
from euler007 import eratosthenes
def quadratic(n, a, b):
return n**2 + a*n + b
limitN = 300
limitA = 1000
limitB = 1000
primes = set(eratosthenes(quadratic(limitN, limitA, limitB)))
max_consecutive_primes = 0
maxAB = (None,None)
consecutive_primes = [[None] * (2*limitA+1)] * (2*limitB+1)
d... |
# -*- coding: utf-8 -*-
###############################################################################
#
# DeleteRating
# Deletes a given video rating action.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this fi... |
#!/usr/bin/python
import sys
import random
class BacktrackingDominatingSet:
"""Find a minimum dominating set using backtracking (slow)."""
def __init__(self, graph):
"""The algorithm initialization."""
if graph.is_directed():
raise ValueError("the graph is directed")
self.... |
from visanalysis.analysis import imaging_data
import numpy as np
from scipy import stats
import nibabel as nib
class VolumetricDataObject(imaging_data.ImagingDataObject):
def __init__(self, file_path, series_number, quiet=False):
super().__init__(file_path, series_number, quiet=quiet)
def getTrialAli... |
#!/usr/bin/env python
"""pennies: a pythonic quantitative finance library for pricing and risk"""
from setuptools import setup, find_packages
import sys
if sys.version_info[:2] < (2,7):
raise RuntimeError("Currently requires Python version >= 2.7.")
MAJOR = 0
MINOR = 2
MICRO = 2
ISRELEASED = False
VERSION = '%d... |
# Copyright 2018 Michael DeHaan LLC, <michael@michaeldehaan.net>
#
# 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 app... |
from typing import Tuple, Dict, Optional
from overrides import overrides
import torch
from torch.nn import LSTMCell
from allennlp.modules import Attention
from allennlp.modules.seq2seq_decoders.decoder_net import DecoderNet
from allennlp.nn import util
@DecoderNet.register("lstm_cell")
class LstmCellDecoderNet(Deco... |
# coding=utf-8
# Copyright 2020 The HuggingFace Inc. 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... |
from flask import Blueprint, current_app, render_template
from flask.views import MethodView
from webargs import fields, validate
from webargs.flaskparser import use_kwargs
from apidoc.apis.v1.auth import generate_token
from apidoc.apis.v1.errors import api_abort
from apidoc.extensions import db
from apidoc.models imp... |
import os
def main(j, args, params, tags, tasklet):
page = args.page
page.addCSS(cssContent='''
.bigpicture{
margin: 10px 0 15px 0;
}
.bigpicture-container{
text-align: center;
}
.subtitle{
margin-bottom: 10px;
display: block;
}
.subtitle-paragraph{
margin-bottom: 5px;
}
.bigpicture-container h1.small{
font-s... |
from typing import Any, Dict, Optional, Sequence, Tuple, Union
import numpy as np
import torch
import torch.nn.functional as F
from torch import nn
from tianshou.data import Batch, to_torch
from tianshou.utils.net.common import MLP
class Actor(nn.Module):
"""Simple actor network.
Will create an actor opera... |
import pixelsort.util as util
def lightness(pixel):
return util.lightness(pixel)
def intensity(pixel):
return pixel[0] + pixel[1] + pixel[2]
def hue(pixel):
return util.hue(pixel)
def saturation(pixel):
return util.saturation(pixel)
def minimum(pixel):
return min(pixel[0], pixel[1], pixel[... |
# Ref: Intel® Low Pin Count (LPC) Interface Specification
# Document Number: 251289-001
# Transaction format summary. Derived from chapters 5-7 of the specification. Note that
# the specification has plenty of typos, which have been (hopefully) corrected here.
#
# Target cycles
# -------------
#
# Memory read (periphe... |
"""Inspiration from
https://github.com/fabric/fabric/blob/master/fabric/colors.py
"""
import re
def _wrap_with(code, bold=False):
def inner(text):
c = code
if bold:
c = "1;%s" % c
return "\033[%sm%s\033[0m" % (c, text)
return inner
red = _wrap_with('31')
green = _wrap_with... |
#!/usr/bin/env python
#
# 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.
"""Shutdown adb_logcat_monitor and print accumulated logs.
To test, call './adb_logcat_printer.py <base_dir>' where
<base_dir> c... |
"""
Tools for interop with other libraries.
Check if libraries available without importing them which can be slow.
"""
import importlib.util
from typing import Any, Callable
# pylint: disable=import-outside-toplevel
class _LibChecker:
@property
def rasterio(self) -> bool:
return self._check("rasteri... |
from enum import Enum
class WeatherCondition:
def __init__(self, severity, description, condition, condition_type):
self.severity = severity
self.description = description
self.condition = condition
self.condition_type = condition_type
def __eq__(self, other):
return s... |
# coding=utf-8
"""
**Module**: html2jirawiki
:platform: Linux
:synopsis: Python module to convert HTML to JIRA wiki format
"""
import re
import six
from bs4 import BeautifulSoup
from bs4.element import NavigableString
# regexes
CONVERT_HEADING_RE = re.compile(r'convert_h(\d+)')
LINE_BEGINNING_RE = re.co... |
import os
from .utils import echo
from .parser import split_arg_string
from .core import MultiCommand, Option
COMPLETION_SCRIPT = '''
%(complete_func)s() {
COMPREPLY=( $( COMP_WORDS="${COMP_WORDS[*]}" \\
COMP_CWORD=$COMP_CWORD \\
%(autocomplete_var)s=complete $1 ) )
retur... |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/ads/googleads_v5/proto/enums/asset_performance_label.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from... |
import pytest
import torch
from capreolus.reranker.POSITDRMM import POSITDRMM
from capreolus.reranker.KNRM import KNRM
def test_validate_params_for_knrm():
with pytest.raises(ValueError):
KNRM.validate_params({"foo": "bar"})
with pytest.raises(ValueError):
KNRM.validate_params({"pad_token": ... |
from fastapi import FastAPI
from fastapi.encoders import jsonable_encoder
from fishbase.fish_logger import set_log_stdout
from fishbase.fish_random import gen_random_str
from pydantic import ValidationError
from starlette import status
from starlette.middleware.cors import CORSMiddleware
from starlette.requests import ... |
"""
This file offers the methods to automatically retrieve the graph Piscirickettsia salmonis.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
title={STRING v11: protein--prote... |
# Copyright (c) Facebook, Inc. and its affiliates.
def evaluate(pr_pairs, gt_pairs):
gt_set = set([tuple(x) for x in gt_pairs])
pr_set = set([tuple(x) for x in pr_pairs])
prec = sum([1 if x in gt_set else 0 for x in pr_set]) \
/ float(len(pr_set)) if len(pr_set) > 0 else 0
rec = sum([1 if x in... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
from caffe2.python.modeling import initializers
from caffe2.python.modeling.parameter_info import ParameterTags
def conv_explicit_param_names(
model, blob_in, blob_out, weight_init=None, bias_init=None, **kwargs
):
... |
#!/usr/bin/python3
from __future__ import print_function
import configparser
import json
import os
import sys
import time
import logging
import classad
from elasticsearch import Elasticsearch
logger = logging.getLogger('process_completed_jobs.accounting_es')
CONFIG = configparser.ConfigParser()
CONFIG.read('/etc/prom... |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v1.15.11
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
f... |
# 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... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('asistencias', '0005_asistencia_turno'),
]
operations = [
migrations.RemoveField(
model_name='asistencia',
... |
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
import copy
from typing import Any
import torch
from torch_mli... |
########################################################################
#
# License: MIT
# Created: September 22, 2010
# Author: Francesc Alted - faltet@gmail.com
#
########################################################################
from blosc.version import __version__
# Blosc C symbols tha... |
import array
import time
import struct
import _bleio
import microcontroller
import usb_hid
import adafruit_ble
from adafruit_ble.advertising import Advertisement
from adafruit_ble.advertising.standard import ProvideServicesAdvertisement
from adafruit_ble.services.standard import BatteryService
from adafruit_ble.servi... |
from django.contrib import admin
from django.urls import path, include
from music.views import Song_player
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
path('admin/', admin.site.urls),
path('', Song_player, name='Home'),
... |
# -*- coding: utf-8 -*-
"""
Created on Thu Mar 3 06:25:18 2016
@author: jim
"""
import sys
print sys.version
print '\n'.join(sys.path)
#print os.environ["HOME"]
import pandas as pd
z = 3333
def test_func():
return "Hello World", "abc"
def add_func(a,b):
c = a + b
return(c)
def return_z():
... |
# https://www.codewars.com/kata/514b92a657cdc65150000006
def solution(max): return sum([n for n in range(0, max) if n % 3 == 0 or n % 5 == 0])
|
# Copyright (c) 2017, 2020 Pieter Wuille
#
# 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,... |
#存放参数
#******************************************************************************
#replace_word_lst 用于 replace_aline_lst函数,将aline["raw_text"]中的词语替换
#生成aline["text"]
#******************************************************************************
replace_word_lst =[
#correction_replace_lst
("mz" , "㎡"),
("m2... |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
# Generated by Django 3.2.4 on 2021-07-01 16:18
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("web", "0007_auto_20210622_1307"),
]
operations = [
migrations.CreateModel(
name="SiteSettings",
fields=[
... |
#!/usr/bin/env python
"""
Finds and prints the contents of chests (including minecart chests)
"""
import locale
import os
import sys
# local module
try:
import nbt
except ImportError:
# nbt not in search path. Let's see if it can be found in the parent folder
extrasearchpath = os.path.realpath(os.path.join(__file__... |
# 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://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license... |
import ares.util.Pickling
from ares.util.Pickling import read_pickle_file, write_pickle_file,\
delete_file, delete_file_if_clobber, overwrite_pickle_file
import ares.util.Photometry
from ares.util.GridND import GridND
from ares.util.Survey import Survey
from ares.util.Aesthetics import labels
from ares.util.WriteDa... |
from selenium.webdriver.common.by import By
class CommonPageLocators:
SEARCH_BAR = (By.ID, "id-search-field")
SEARCH_GO_BUTTON = (By.ID, "submit")
DOC = (By.ID, "documentation")
PY3_DOC_BUTTON = (By.CSS_SELECTOR, "#documentation > ul > li.tier-2.super-navigation > p.download-buttons > a:nth-child(1)")
... |
# -*- coding: utf-8 -*-
#
# test_cloud_storage.py
#
# Copyright 2016 Socos LLC
#
import datetime
import itertools
import os
import random
import unittest
from pprint import pprint
import dateutil.parser
import gae_stubs
gae_stubs.init()
import cloudstorage
import datastore_to_gcs.cloud_storage as gcs
from datastor... |
import math
import matplotlib.pyplot as plt
import os
import osmnx as ox
import pandas as pd
from shapely.geometry import Polygon
def retrieve_zones(G_walk, G_drive, place_name, save_dir, output_folder_base, BBx, BBy):
zones = []
zone_id = 0
save_dir_csv = os.path.join(save_dir, 'csv')
if not os.pat... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.parameter import Parameter
from torch import Tensor
import numpy as np
from... |
#
# Copyright (c) 2017 Joy Diamond. All rights reserved.
#
@gem('Sapphire.PrefixedDualStatement')
def gem():
require_gem('Sapphire.DualStatement')
require_gem('Sapphire.DumpToken')
prefixed_dual_twig_cache = create_cache('prefixed-dual-twig', conjure_nub)
lookup_prefixed_dual_twig = prefixed_dual_... |
from datahub.core.test.factories import to_many_field
from datahub.investment.project.test.factories import InvestmentProjectFactory
class ShallowInvestmentProjectFactory(InvestmentProjectFactory):
"""
Same as InvestmentProjectFactory but with reduced dependencies
so that we can test specific references w... |
"""
This file offers the methods to automatically retrieve the graph Dethiosulfatarculus sandiegensis.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
title={STRING v11: protei... |
# -*- coding: utf-8 -*-
import copy
import pickle
from datetime import datetime, timedelta
from pymongo import MongoClient, ReadPreference
from bson.objectid import ObjectId
from bson.timestamp import Timestamp
from werkzeug.contrib.sessions import SessionStore, Session
import db_util
SES_EXP = 14 * 24 * 60 * 60 #... |
#----------------------------------------------------------------------------------------------------------
#
# AUTOMATICALLY GENERATED FILE TO BE USED BY W_HOTBOX
#
# NAME: Toggle Split Path
#
#----------------------------------------------------------------------------------------------------------
ns = nuke.selecte... |
import json
import logging
import os
import ssl
import sys
import time
import smtplib
from datetime import datetime
from email.mime.text import MIMEText
from platform import system as pl_system
from subprocess import Popen
import httpx
class DDNS:
## 通过配置文件初始化
key = ''
# 配置中domain = host.domain,host为子域名前... |
import argparse
import datetime
import logging
import os
import sys
from tqdm import tqdm
from booking.api.booking_api import LIMIT_REQUESTS_PER_MINUTE
from booking.download_hotels import download
from booking.download_test_data import download_test_data
def process_options():
parser = argparse.ArgumentParser(d... |
from fosscord.ext import tasks
import fosscord
class MyClient(fosscord.Client):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
# an attribute we can access from our task
self.counter = 0
# start the task to run in the background
self.my_background... |
# Copyright 2020 Huawei Technologies Co., Ltd
#
# 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 flask import Flask, render_template
from Blueprints.Browser.route import BrowserBP
app = Flask(__name__)
app.secret_key = b'YOUR_SUPER_SECRET_KEY'
app.register_blueprint(BrowserBP)
@app.route('/')
def index():
return render_template('Homepage.html')
@app.route('/contact')
def contactme():
return rend... |
from spitfire.chemistry.flamelet2d import _Flamelet2D
from spitfire.chemistry.flamelet import Flamelet
from spitfire.chemistry.mechanism import ChemicalMechanismSpec
from spitfire.time.integrator import Governor, NumberOfTimeSteps, FinalTime, Steady, SaveAllDataToList
from spitfire.time.methods import AdaptiveERK54Cash... |
import sys
class MatrixChainMultiple(object):
def __init__(self, matrixs=None):
super(MatrixChainMultiple, self).__init__()
self.matrixs = matrixs if matrixs else []
def __get_matrix_row_col(self, matrix):
matrix_a_row = len(matrix)
if matrix_a_row == 0:
return 0, 0
... |
# 定义HTTP状态码常量,所有使用到HTTP状态码的代码都必须使用这里的常量
# =========================================
# old
# =========================================
# 请求成功
HTTP_OK = HTTP_200 = 200
HTTP_CREATED = HTTP_201 = 201
HTTP_ACCEPTED = HTTP_202 = 202
HTTP_NO_CONTENT = HTTP_204 = 204
# 客户端出错
HTTP_BAD_REQUEST = HTTP_400 = 400
HTTP_UNAUTHORIZ... |
from __future__ import unicode_literals
from datetime import datetime
from django.core.management.base import BaseCommand
from django.db.models import Q, F, Count
from postman.models import Message
class Command(BaseCommand):
help = "Can be run as a cron job or directly to check-up data consistency in the datab... |
# -*- coding: utf-8 -*-
import time
from core import colorconsole as cc
from core import utils
from core.context import *
from core.env import env
ctx = BuildContext()
PATH_EXTERNAL = os.path.join(env.root_path, 'external')
PATH_DOWNLOAD = os.path.join(PATH_EXTERNAL, '_download_')
class BuilderBa... |
# -*- coding: utf-8 -*-
'''Implementation for `Vows.async_topic` decorator. (See `core`
module).
'''
# pyVows testing engine
# https://github.com/heynemann/pyvows
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 Bernardo Heynemann heynemann@gmail.com
import sy... |
nome=input("digite um nome: ")
idade=input("qual a idade dele: ")
test=list()
test.append(nome)
test.append(idade)
print(test)
galera=list()
galera.append(test[:])
while True:
pergunta=(str(input("Voce quer Adicionar Algum Elemento? [S/N]")))
if pergunta in"Nn":
break
else:
test[0]=input("Qu... |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.11.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re... |
from crypten.mpc import MPCTensor
from syft.generic.frameworks.hook import hook_args
from syft.generic.tensor import AbstractTensor
from syft.workers.abstract import AbstractWorker
from functools import wraps
from syft.generic.frameworks.hook.trace import tracer
from syft.generic.frameworks.overload import overloaded... |
import json
from overrides import overrides
import torch
import random
from claf.config.factory.data_loader import make_data_loader
from claf.data.dataset.base import DatasetBase
class MultiTaskBertDataset(DatasetBase):
"""
Dataset for Multi-Task GLUE using BERT
* Args:
batch: Batch DTO (claf.d... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('hs_model_program', '0001_initial'),
]
operations = [
]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.