text stringlengths 2 999k |
|---|
import gym
import keras as k
from keras.models import Sequential
from keras.layers import Conv2D, Activation, MaxPooling2D, Flatten, Dense, Dropout
from keras.optimizers import Adam
import numpy as np
from datetime import datetime
from matplotlib import pyplot as PLT
import time
import csv
import os
# You can adjust t... |
import torch.nn as nn
import torch.nn.functional as F
from ssd.layers import L2Norm
from ssd.modeling import registry
from ssd.utils.model_zoo import load_state_dict_from_url
model_urls = {
'vgg': 'https://s3.amazonaws.com/amdegroot-models/vgg16_reducedfc.pth',
}
# borrowed from https://github.com/amdegroot/ssd... |
from __future__ import unicode_literals
import frappe
def set_default_address(doc,method):
if doc.is_primary_address:
for row in doc.links:
if row.link_doctype=="Customer":
cust = frappe.get_doc("Customer",row.link_name)
cust.default_address=doc.name
cust.save()
def set_default_contact(doc,method):
... |
class MenuItem(object):
TEXT_NAME = 'name'
TEXT_URL = 'url_name'
TEXT_SUBMENU = 'submenu'
def __init__(self, name, url=None, *args):
super(MenuItem, self).__init__()
self.name = name
self.url = url
self.url_args = args
self.sub_menu = []
def add_sub_menu_ite... |
import os
import time
import traceback
# import functools
def getobj(s):
return open(s, "r", encoding='utf-8').read()
def getobjs(s):
objs = []
fs = os.listdir(s)
for f in fs:
absf = os.path.join(s, f)
if os.path.isfile(absf) and os.path.splitext(f)[1] == '.py':
objs.append(absf)
elif ... |
import os
import tensorflow as tf
import numpy as np
import pandas as pd
from sklearn.utils import check_random_state
from skbio.stats.composition import clr_inv as softmax
from biom import Table
from patsy import dmatrix
def random_multinomial_model(num_samples, num_features,
reps=1,
... |
"""Let's Encrypt client API."""
import logging
import os
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.asymmetric import rsa
import OpenSSL
import zope.component
from acme import client as acme_client
from acme import jose
from acme import messages
import letsencrypt
f... |
# This file is part of spot_motion_monitor.
#
# Developed for LSST System Integration, Test and Commissioning.
#
# See the LICENSE file at the top-level directory of this distribution
# for details of code ownership.
#
# Use of this source code is governed by a 3-clause BSD-style
# license that can be found in the LICE... |
# Copyright (C) 2016-Today: Odoo Community Association (OCA)
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import _, api, fields, models
from odoo.tools import html_sanitize
class OdooModule(models.Model):
_inherit = "a... |
import sys
import math
import os
import torch
import torchvision
import numpy as np
from pkg_resources import resource_stream
def interpolate1d(x, values, tangents):
'''
Returns:
Returns the interpolated or extrapolated values for each query point,
depending on whether or not the query lies w... |
# 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... |
"""Tests for py. for S2201"""
import csv
import json
import os
import tempfile
import sys
import unittest
_CODEDIR = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(1, os.path.join(_CODEDIR, '.'))
from .process import *
_FEATURES = os.path.join(_CODEDIR, 'features.json')
_STAT_VAR_LIST = os.path.join(_C... |
from utils.utils import validate_parameters
get_news_query_schema = {
"from": {
"type": "integer",
'coerce': int,
"min": 0,
"max": 10000,
"required": False,
"default": 0
},
"limit": {
"type": "integer",
'coerce': int,
"min": 0,
... |
import hp
from pathlib import Path
import numpy as np
from tqdm import tqdm
import librosa
import torch
import librosa.filters
import numpy as np
import scipy
from random import randint
from os import makedirs
def load_wav(path, sample_rate):
return librosa.core.load(path, sr=sample_rate)[0]
def save_wav(wav, p... |
# Copyright Contributors to the Open Shading Language project.
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
#!/usr/bin/python
outputs = [ "out.exr" ]
command = testrender("-r 320 240 -aa 4 material-layer.xml out.exr")
|
### $Id: admin.py,v 1.5 2017/12/18 09:12:51 muntaza Exp $
from django.contrib import admin
from umum.models import Provinsi, Kabupaten, LokasiBidang, SKPD, SUBSKPD, KodeBarang, HakTanah, SatuanBarang, KeadaanBarang, SKPenghapusan, MutasiBerkurang, JenisPemanfaatan, AsalUsul, Tahun, GolonganBarang, Tanah, KontrakTanah,... |
import cv2
import sys
import os
import numpy as np
import time
# Initialize the parameters
confThreshold = 0.5 # Confidence threshold
nmsThreshold = 0.4 # Non-maximum suppression threshold
inpWidth = 416 # Width of network's input image
inpHeight = 416 # Height of network's input image
startin... |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: ClientMessageDtos.proto
"""Generated protocol buffer code."""
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from goo... |
from mmdet.datasets.pipelines import Compose
from .dbsampler import DataBaseSampler
from .formating import Collect3D, DefaultFormatBundle, DefaultFormatBundle3D
from .loading import (LoadAnnotations3D, LoadImageFromFileMono3D,
LoadMultiViewImageFromFiles, LoadPointsFromFile,
... |
import pytest
from django.core.exceptions import PermissionDenied
from django.urls import reverse
from wagtail.core.models import Page
from wagtail_personalisation.models import Segment
from wagtail_personalisation.rules import VisitCountRule
from wagtail_personalisation.views import (
SegmentModelAdmin, SegmentMo... |
# -*- coding: utf-8 -*-
# ---------------------------------------------------------------------
# HP.1910.get_chassis_id
# ---------------------------------------------------------------------
# Copyright (C) 2007-2018 The NOC Project
# See LICENSE for details
# ---------------------------------------------------------... |
import collections
import functools
from typing import Dict, List, Tuple, Counter
from tool.runners.python import SubmissionPy
def parse(s: str) -> Tuple[List[str], Dict[Tuple[str, str], str]]:
lines = s.splitlines()
initial = list(lines[0].strip())
mapping = {}
for line in lines[2:]:
if strip... |
"""add username to LoadTbl
Revision ID: 7fb7364b821a
Revises: 090128c02529
Create Date: 2018-10-24 17:10:03.781293
"""
# revision identifiers, used by Alembic.
revision = '7fb7364b821a'
down_revision = '090128c02529'
import sqlalchemy as sa
from alembic import op
def upgrade():
op.add_column('LoadTbl', sa.Col... |
l = ['h','e','l','l','o']
print (l.index('l'))
print (l.index('l', 2))
print (l.index('l', 3))
print (l.index('l', 2, 3))
print (l.index('l', 3, 4))
print (l.index('l', 2, -1))
print (l.index('l', 2, -2))
print (l.index('l', 3, -1))
try:
print (l.index('l', 4))
except ValueError as e:
print (repr(e))
try:
... |
expected_output = {
'slot': {
'1': {
'lc': {
'card_type': 'CEF720 48 port 10/100/1000mb Ethernet',
'fw_ver': '12.2(14r)S',
'hw_ver': '2.7',
'mac_address_from': '001e.4aff.ee89',
'mac_a... |
import unittest
import importlib
from pbutils.streams import warn
# Try to import flask settings module:
settings = None
try:
pkg_root = __name__.split('.')[0]
settings_modname = '{}.settings'.format(pkg_root)
settings = importlib.import_module(settings_modname)
except ImportError as e:
warn('Unable t... |
# 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.
#----------------------------------------------------------------------... |
"""Test timestamp."""
# --- import -------------------------------------------------------------------------------------
import WrightTools as wt
# --- test ---------------------------------------------------------------------------------------
def test_now():
wt.kit.TimeStamp() # exception will be raised ... |
#!/usr/bin/env python3
#
# vim: softtabstop=2 shiftwidth=2 expandtab
#
# Python port of poll-mirrors.pl
#
# This script is designed to poll download sites after posting a release
# and print out notice as each becomes available. The RM can use this
# script to delay the release announcement until the release can be
# ... |
#!/usr/bin/env python3
"""
USAGE:
yb_sysprocs_column_stats.py [options]
PURPOSE:
Table column metdata including estimates from statistics.
OPTIONS:
See the command line help message for all options.
(yb_sysprocs_column_stats.py --help)
Output:
The report as a formatted table, pipe seper... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... |
import os
import re
import pipelinewise.cli as cli
import pytest
VIRTUALENVS_DIR = './virtualenvs-dummy'
# pylint: disable=no-self-use,fixme
class TestUtils:
"""
Unit Tests for PipelineWise CLI utility functions
"""
def test_json_detectors(self):
"""Testing JSON detector functions"""
... |
# -*- coding: utf-8 -*-
'''
Manage Kinesis Streams
======================
.. versionadded:: Nitrogen
Create and destroy Kinesis streams. Be aware that this interacts with Amazon's
services, and so may incur charges.
This module uses ``boto3``, which can be installed via package, or pip.
This module accepts explicit... |
# Copyright 2019, 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 appli... |
import os, sys
import time
import warnings
import argparse
import configparser
import ast
import numpy as np
from math import log
from rdkit import Chem
from rdkit import rdBase
rdBase.DisableLog('rdApp.*')
from rdkit.Chem import Draw
from keras.models import load_model
sys.path.append('../src/')
from python import h... |
# coding=utf8
# Copyright 2018 JDCLOUD.COM
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... |
import torch, torchvision
import torch.nn as nn
import torch.nn.functional as F
from torchvision.models.resnet import Bottleneck
import numpy as np
from itertools import product
from math import sqrt
from typing import List
from collections import defaultdict
from data.config import cfg, mask_type
from layers import D... |
import json
from jupyterlab.labapp import LabApp
from notebook.base.handlers import APIHandler
from notebook.utils import url_path_join
import tornado
from .api import group_info, submit_job, get_env, check_function_set
from .utils import get_group_volume_path
import os.path
from shutil import copyfile
from datetime i... |
import setuptools
with open("README.md", "r") as f:
long_description = f.read()
setuptools.setup(
name="runai",
version="0.1.2",
author="Run:AI",
author_email="pypi@run.ai",
description="Run:AI Python library",
long_description=long_description,
long_description_content_type="text/mark... |
from django.urls import path
from .views import (
UserSelfView,
)
urlpatterns = [
path("users/self/profile/", UserSelfView.as_view(), name="user_self"),
]
|
if __name__ == "__main__":
import numpy as np
import beluga.Beluga as Beluga
import beluga.bvpsol as bvpsol
import beluga.bvpsol.algorithms as algorithms
import beluga.optim.Problem
from beluga.optim.problem import *
from beluga.continuation import *
import logging
# Import Librari... |
from airbnb_priceforecaster.models import train_model
from airbnb_priceforecaster.models import build_model
from airbnb_priceforecaster.data import AirBnBDataset
import click
@click.group()
def cli():
pass
@cli.command()
@click.option("-y", "--year", default=2020, type=int)
@click.option("-m", "--month", defaul... |
from sympy import (symbols, Symbol, nan, oo, zoo, I, sinh, sin, pi, atan,
acos, Rational, sqrt, asin, acot, coth, E, S, tan, tanh, cos,
cosh, atan2, exp, log, asinh, acoth, atanh, O, cancel, Matrix, re, im,
Float, Pow, gcd, sec, csc, cot, diff, simplify, Heaviside, arg,
conjugate, series... |
# coding=utf-8
#########################################################################################
# This code provides SCT integration into FSLeyes for the following tools:
#
# - sct_propseg
# - sct_deepseg_gm
# - sct_deepseg_sc
# - sct_label_vertebrae
# - sct_register_to_template
# - sct_proce... |
# coding: utf-8
import re
import six
from huaweicloudsdkcore.sdk_response import SdkResponse
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class UpdateTaskStatusResponse(SdkResponse):
"""
Attributes:
openapi_types (dict): The key is attribute name
... |
# -*- coding: utf-8 -*-
# Copyright (c) 2017 Red Hat, Inc.
#
# 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, modi... |
import datetime
import time
import pytz
PACIFIC_TZ = pytz.timezone('America/Vancouver')
def today_pacific():
now_pacific = datetime.datetime.fromtimestamp(time.time(), PACIFIC_TZ)
return now_pacific.date()
|
__author__ = 'Tom Schaul, tom@idsia.ch'
from scipy import array, exp, tanh, clip, log, dot, sqrt, power, pi, tan, diag, rand, real_if_close
from scipy.linalg import inv, det, svd, logm, expm2
def semilinear(x):
""" This function ensures that the values of the array are always positive. It is
x+1 for x=>0... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import os
import sys
import unittest
import torch
import torch.distributed as dist
import torch.multiprocessing as mp
import torch.nn as nn
import torch.optim as optim
from opacus import PrivacyEngine
from opacus.distributed ... |
# -*- coding: utf-8 -*-
"""
Created on Sat Dec 16 19:55:29 2017
@author: Arko Chatterjee
"""
import datetime
import imutils
import time
import cv2
camera = cv2.VideoCapture(0)
time.sleep(0.50)
print("Hello!")
firstFrame = None
# loop over the frames of the video
while True:
# grab the current fr... |
#
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
# its licensors.
#
# For complete copyright and license terms please see the LICENSE at the root of this
# distribution (the "License"). All use of this software is governed by the License,
# or, if provided, by the license below or th... |
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "aspc.settings")
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
|
from datetime import datetime
import cv2
import re
import base64
from flask import Flask, render_template, request, jsonify
from flask_cors import CORS
import numpy as np
from io import BytesIO
from PIL import Image, ImageOps
import os,sys
import requests
from graphpipe import remote
from matplotlib import pylab as pl... |
import json
import pytest
from buildtrigger.test.githubmock import get_github_trigger
from buildtrigger.triggerutil import (SkipRequestException, ValidationRequestException,
InvalidPayloadException)
from endpoints.building import PreparedBuild
from util.morecollections import Attr... |
from QInstrument.lib import QInstrumentInterface
from QInstrument.instruments.Opus.Opus import Opus
from PyQt5.QtCore import (pyqtSlot, QTimer)
import logging
logging.basicConfig()
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
class QOpusWidget(QInstrumentInterface):
def __init__(self, *ar... |
import FWCore.ParameterSet.Config as cms
from DQM.EcalPreshowerMonitorModule.ESRawDataTask_cfi import *
from DQM.EcalPreshowerMonitorModule.ESIntegrityTask_cfi import *
ecalPreshowerIntegrityTask.DoLumiAnalysis = True
from DQM.EcalPreshowerMonitorModule.ESFEDIntegrityTask_cfi import *
from DQM.EcalPreshowerMonitorModu... |
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/16_callback.progress.ipynb (unless otherwise specified).
__all__ = ['ProgressCallback', 'no_bar', 'ShowGraphCallback', 'CSVLogger']
# Cell
from ..basics import *
# Cell
@docs
class ProgressCallback(Callback):
"A `Callback` to handle the display of progress bars"
... |
import simplejson
import binascii
import sys
import pdb
from pprint import pprint
import sys
import os
sys.path.append(os.path.normpath(os.path.join(os.path.dirname(__file__), '../lib')))
import gentariumlib
# ============================================================================
usage = "%s <hex>" % sys.argv[0]
... |
from bouncingball import BouncingBall, BouncingBox
balls = []
boxes = []
def setup():
size(600, 600)
for _ in range(60):
if random(10) < 5:
balls.append(BouncingBall())
else:
boxes.append(BouncingBox())
def draw():
background("#2b3e50")
for ball in balls:
... |
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# Copyright (c) 2008-2020 pyglet contributors
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the follo... |
# -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.base.exchange import Exchange
import json
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import PermissionDenie... |
import abc
from backend.model.SentenceTokenise import SentenceTokenise
from backend.service.ExtractSentences import extract_sentences
from backend.service.ReadCorpus import read_corpus
class Corpus:
def __init__(self):
self.receive_text = ""
self.input_file = "t1_biology_0_0.txt"
self.bas... |
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains t... |
sys.stdout = open("6-num.txt", "w")
data = "1234567890"
for a in data:
for b in data:
for c in data:
for d in data:
for e in data:
for f in data:
print(a+b+c+d+e+f)
sys.stdout.close()
|
import os
from dotenv import load_dotenv
# Load environment variables
load_dotenv()
# Set hosting environment, if not set, default to production for security
HOSTING_ENV = os.getenv("HOSTING_ENV", "production")
if HOSTING_ENV == "dev":
from .dev import *
else:
from .production import *
|
import abc
import enum
import itertools
import logging
import uuid
from copy import deepcopy
from typing import Any, Dict, List, MutableMapping, Optional, Union
from ruamel.yaml import YAML
from ruamel.yaml.comments import CommentedMap
from ruamel.yaml.compat import StringIO
import great_expectations.exceptions as ge... |
# -*- coding: utf-8 -*-
"""
This is initialization module of openwarp.
"""
__author__ = "caoweiquan322"
__copyright__ = "Copyright (C) 2014 TopCoder Inc. All rights reserved."
__version__ = "1.0"
#import logging
# Create a base logger for the whole module.
#logger = logging.getLogger(__name__)
#logger.s... |
# https://github.com/albermax/innvestigate
# http://heatmapping.org/ |
import tensorflow as tf
import common
def inference(x, num_output, wd, dropout_rate, is_training, transfer_mode= False, model_type= 'A'):
# Create tables describing VGG configurations A, B, D, E
if model_type == 'A':
config = [64, 'M', 128, 'M', 256, 256, 'M', 512, 512, 'M', 512, 512, 'M']
elif model_ty... |
#!/usr/bin/env python3
import argparse
import io
import sys
PY2 = sys.version_info[0] == 2
if PY2:
from itertools import izip_longest as zip_longest
else:
from itertools import zip_longest
def get_parser():
parser = argparse.ArgumentParser(
formatter_class=argparse.ArgumentDefaultsHelpFormatter,... |
import numpy as np
import random
import matplotlib.pyplot as plt
points=np.loadtxt('points.txt')
herring_r = np.loadtxt('distribution.txt')
herring=np.zeros((802,350))
for i in range(350):
for j in range(802):
herring[j,349-i]=herring_r[i,j]
# s=np.zeros(10)
#
# for i in range(10):
# x=int(round(point... |
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from builtins import * # NOQA
from future import standard_library
standard_library.install_aliases() # NOQA
from cached_property import cached_property
from chainer imp... |
from vlasisku.utils import compound2affixes
class Entry(object):
"""Container for jbovlaste entry data."""
#: The word (or compound) this entry describes.
word = None
#: The type of the word, such as ``'gismu'``.
type = None
#: A list of three-letter affix forms for the word.
affixes = ... |
from data import DataHandler
from models import ACRegNet
import tensorflow as tf
from utils import get_random_batch, read_config_file, create_dir
RUN_IN_GPU = False
def train_acregnet_model(config):
tf.reset_default_graph()
tf_config = tf.ConfigProto()
if RUN_IN_GPU:
tf_config.gpu_options.allow... |
import unittest
from gr_nlp_toolkit.labels.dp_labels import dp_labels
from gr_nlp_toolkit.labels.ner_labels import ner_labels
from gr_nlp_toolkit.labels.pos_labels import pos_labels, pos_properties
from gr_nlp_toolkit.pipeline.pipeline import Pipeline
class TestPipeline(unittest.TestCase):
def test_using_all_pro... |
"""This module contains the general information for InitiatorFcInitiatorEp ManagedObject."""
from ...ucsmo import ManagedObject
from ...ucscoremeta import MoPropertyMeta, MoMeta
from ...ucsmeta import VersionMeta
class InitiatorFcInitiatorEpConsts:
PREF_ALTERNATE = "alternate"
PREF_PREFERRED = "preferred"
... |
# Copyright (c) 2020 NVIDIA CORPORATION.
# Copyright (c) 2018-2020 Chris Choy (chrischoy@ai.stanford.edu).
#
# 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 wit... |
def computescore(s):
if s >= 0.9 and s <= 1.0:
print 'grade is A'
elif s >= 0.8 and s<=1.0 :
print 'grade is B'
elif s >= 0.7 and s<=1.0 :
print 'grade is C'
elif s >= 0.6 and s <= 1.0 :
print 'grade is D'
elif s >= 0.0 and s <= 0.6 :
print 'grade is F'
else :
... |
#
# Copyright 2014 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 ... |
from typing import Any
from tortoise import fields
from tortoise.models import Model
from crimsobot.models import DiscordUser
from crimsobot.models.user import User
class WordleResults(Model):
uuid = fields.UUIDField(pk=True)
name = fields.TextField(default='wordle result')
user = fields.ForeignKeyFiel... |
import csv
import json
import os
import random
import shutil
import string
import tempfile
import warnings
from io import BytesIO
from logging import getLogger
from pathlib import Path
from string import ascii_letters, digits
from unittest import mock
from urllib.parse import urljoin, urlparse, quote
from urllib.reques... |
# -*- coding: utf-8 -*-
# Copyright (c) 2020, Youssef Restom and Contributors
# See license.txt
from __future__ import unicode_literals
# import frappe
import unittest
class TestExtraesiaSettings(unittest.TestCase):
pass
|
#!/usr/bin/env python
import setuptools
def get_version(filename):
with open(filename) as in_fh:
for line in in_fh:
if line.startswith('__version__'):
return line.split('=')[1].strip()[1:-1]
raise ValueError("Cannot extract version from %s" % filename)
setuptools.setup(
... |
"""The following code should emit a raising-non-exception.
Previously, it didn't, due to a bug in the check for bad-exception-context,
which prevented further checking on the Raise node.
"""
# pylint: disable=import-error, too-few-public-methods
from missing_module import missing
class Exc(object):
"""Not an act... |
from django.conf.urls import url, include
from . import views
test_patterns = [
url(r'^$', views.index, name='django_daraja_index'),
url(r'^oauth/success', views.oauth_success, name='test_oauth_success'),
url(r'^stk-push/success', views.stk_push_success, name='test_stk_push_success'),
url(r'^business-payment/succe... |
"""
This module tests the build API. These are high-level integration tests.
"""
import base64
from collections import OrderedDict
from glob import glob
import logging
import os
import re
import subprocess
import sys
import json
import uuid
# for version
import conda
from conda_build.conda_interface import PY3, url... |
"""Tests for the backend"""
from .tools import logprint, AppTestCase, load_file_to_dict, load_json
class GetConstructsAsGenbankTests(AppTestCase):
endpoint = 'get_constructs_as_genbanks'
defaults = dict(
database_token='',
constructsData={}
)
def test_emma_2_constructs_with_one_combin... |
################################################################################
# Module: schedule.py
# Description: Functions for handling conversion of EnergyPlus schedule objects
# License: MIT, see full license in LICENSE.txt
# Web: https://github.com/samuelduchesne/archetypal
#####################################... |
__version__ = '0.10.2' # pragma: no cover
|
from reports import suite as reports_suite
from orders import suite as orders_suite
|
# Copyright 2020 The Magenta 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 ... |
"""
This is an end to end release test automation script used to kick off periodic
release tests, running on Anyscale.
The tool leverages app configs and compute templates.
Calling this script will run a single release test.
Example:
python e2e.py --test-config ~/ray/release/xgboost_tests/xgboost_tests.yaml --test-... |
import argparse
import pysam
# parse the read group strings from a bam/sam header
# return array of read group strings
def read_groups_from_bam(bam_filename, use_libraries=False):
bam = pysam.AlignmentFile(bam_filename, "rb")
header = bam.header
results = {}
if 'RG' in header:
read_groups = header['RG']
if... |
"""add initial models
Revision ID: 18b9d421fbde
Revises:
Create Date: 2022-03-19 12:36:16.067795
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "18b9d421fbde"
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto... |
# -*- coding: utf-8 -*-
from common.base_test import BaseTest
import lemoncheesecake.api as lcc
from lemoncheesecake.matching import check_that, has_length
SUITE = {
"description": "Creating many contracts in a single transaction"
}
@lcc.prop("main", "type")
@lcc.tags("scenarios", "many_contracts_in_one_trx")
@... |
from sbaas.analysis.analysis_base import *
class stage00_query(base_analysis):
def get_structureFile_standards(self,met_id_I):
'''Querry structure file and extension from metabolomics standards'''
try:
structure = self.session.query(standards.structure_file,
standard... |
import io
import os
import re
import pwd
import grp
import sys
import json
import uuid
import time
import glob
import base64
import socket
import hashlib
import decimal
import logging
import tarfile
import zipfile
import binascii
import calendar
import tempfile
import threading
import subprocess
import six
import shuti... |
# Copyright 2017 MongoDB, Inc.
#
# 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, so... |
#ARC027f
def main():
import sys
input=sys.stdin.readline
sys.setrecursionlimit(10**6)
if __name__ == '__main__':
main() |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import json
import sys
import bigram
# usage: ./parseJson.py "corpus.json path" "output directory"
def concatString(path):
corpus = ""
with open(path, 'r', encoding='UTF-8') as f:
for line in f.readlines():
corpus += line
return corpus
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.