text stringlengths 17 737k |
|---|
from bson.json_util import loads, dumps
from mongows.mws.db import get_db
from mongows.mws.views import get_internal_collection_name
from tests import MongoWSTestCase
class ViewsSetUpUnitTestCase(MongoWSTestCase):
def test_create_mws_resource(self):
url = '/mws/'
rv = self.app.post(url)
r... |
# This file is part of Maker Keeper Framework.
#
# Copyright (C) 2017-2018 reverendus
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your opti... |
#
# Titanium API Coverage Generator
#
# Initial Author: Jeff Haynie, 3/30/09
#
import glob, re, os.path as path
import fnmatch, os, sys
import simplejson as json
import traceback
class GlobDirectoryWalker:
# a forward iterator that traverses a directory tree
def __init__(self, directory, patterns=['*']):
self.sta... |
import os
import os.path
import contextlib
import tempfile
import subprocess
import shutil
from nose.tools import istest, assert_equal
from whack.builder import Builders
@istest
def can_build_simple_application_with_install_dir_used_in_install_script():
_TEST_BUILDER_BUILD = r"""#!/bin/sh
INSTALL_DIR=$1
cat > he... |
# Author: Wei Xue <xuewei4d@gmail.com>
# Thierry Guillemot <thierry.guillemot.work@gmail.com>
# License: BSD 3 clause
import sys
import copy
import warnings
import pytest
import numpy as np
from scipy import stats, linalg
from sklearn.covariance import EmpiricalCovariance
from sklearn.datasets.samples_gener... |
#
# localDocker.py - Implements the Tango VMMS interface to run Tango jobs in
# docker containers. In this context, VMs are docker containers.
#
import random, subprocess, re, time, logging, threading, os, sys, shutil
import config
from tangoObjects import TangoMachine
def timeout(command, time_out=1):... |
#!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2006-2010 (ita)
"""
Tool Description
================
This tool helps with finding Qt4 tools and libraries,
and also provides syntactic sugar for using Qt4 tools.
The following snippet illustrates the tool usage::
def options(opt):
opt.load('compiler_cxx qt... |
import hashlib
import logging
import time
import uuid
from collections import namedtuple
import googleapiclient
from retrying import retry
import cloudbridge as cb
from cloudbridge.cloud.base.resources import ClientPagedResultList
from cloudbridge.cloud.base.resources import ServerPagedResultList
from cloudbridge.cl... |
import os
import cmd
import signal
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
from blackwidow import BlackWidow
from blackwidow import parser
from blackwidow.network import *
import spider
import json
from cStringIO import StringIO
class BlackWidowInteractive(cmd.Cmd):
def create_netwo... |
"""
Django settings for server project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
imp... |
"""
=====================
Resampling Strategies
=====================
In *auto-sklearn* it is possible to use different resampling strategies
by specifying the arguments ``resampling_strategy`` and
``resampling_strategy_arguments``. The following example shows common
settings for the ``AutoSklearnClassifier``.
"""
im... |
import os
from FWCore.ParameterSet.VarParsing import VarParsing
options =VarParsing('analysis')
options.register('config', default = '', mult = VarParsing.multiplicity.singleton, mytype = VarParsing.varType.string, info = 'Single-switch config. Values: 03Feb2017, 23Sep2016, Spring16, Summer16')
options.register('globa... |
# Copyright 2018 Northern.tech AS
#
# 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 a... |
#
# Copyright (c) 2008 Daniel Truemper truemped@googlemail.com
#
# __init__.py 07-Jan-2011
#
# 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 licen... |
##############################################################################
# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... |
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Heffte(CMakePackage, CudaPackage, ROCmPackage):
"""Highly Efficient FFT for Exascale"""
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import os
import shutil
import string
import math
import random
from os.path import (
abspath,
join,
)
from argparse import ArgumentParser
from collections import namedtuple
from subprocess import (
check_call,
CalledProcessError,
)
import shle... |
from lib.settings_base import *
from mkt.settings import *
from settings_base import *
import private_mkt
SERVER_EMAIL = 'zmarketplacedev@addons.mozilla.org'
DOMAIN = "marketplace-dev.allizom.org"
SITE_URL = 'https://marketplace-dev.allizom.org'
SERVICES_URL = SITE_URL
STATIC_URL = 'https://marketplace-dev-cdn.alliz... |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Heffte(CMakePackage):
"""Highly Efficient FFT for Exascale"""
homepage = "https://bit... |
#
# factory.py: Automatically generate a (near-)complete new cmdline test
# from a series of shell commands.
#
# Subversion is a tool for revision control.
# See http://subversion.tigris.org for more information.
#
# ====================================================================
# Copyright (c) ... |
"""Module containing tools to assist in building of WSGI routers.
This routing system works by tracking the UNrouted part of the request, and
watching how it changes as it passes through various routers.
"""
from pprint import pprint
import collections
import logging
from webtest import TestApp as WebTester
fro... |
import idaapi
from idc import *
class SMC:
GlobalCounter = 0
def make_unknown(self):
for seg in Segments():
if idc.SegName(seg) == '.text':
start = idc.SegStart(seg)
end = idc.SegEnd(seg)
while start < end:
i=idautils.DecodeInstruction(start)
... |
from weatbag import words
from weatbag.utils import transfer
class Tile:
def __init__(self):
self.contents = {'match': 42}
def describe(self):
print("You are standing in the mouth of a cave. The air "
"feels cool and is filled with the stench of rotting flesh. "
"A ... |
from math import isclose
from random import choice, random, uniform
import numpy as np
from scipy.spatial import Delaunay, distance
from sqlalchemy import text
from sqlalchemy.orm.session import make_transient
from htsohm import db
from htsohm.db import Material, Structure, LennardJones, AtomSites
from htsohm.pseudom... |
from random import randint
from Crypto.Hash import SHA256
from zlib import crc32
from htsohm.db import Material
from htsohm.structure import Structure, LatticeConstants, AtomSite, AtomType
def get_n_digit_seed(n):
range_start = 10 ** (n - 1)
range_end = (10 ** n) - 1
return randint(range_start, range_end... |
##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... |
from ethereum import tester
from ethereum import utils
from hydrachain import native_contracts as nc
from ethereum import abi, slogging
from ethereum.utils import zpad
import pytest
import logging
import random, string
logging.NOTSET = logging.INFO
slogging.configure_logging(':info')
"""
test registration
test calli... |
import datetime
import logging
from decimal import Decimal
from django.conf import settings
from django.db import models
from django.db.models import Q, Avg, Sum, Max, Min
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError, NON_FIELD_ERRORS
from timepiece import utils
from... |
import pandas as pd
from pyne import nucname, material
from astropy import units as u
class IsotopeAbundances(pd.DataFrame):
@property
def _constructor(self):
return IsotopeAbundances
def _update_material(self):
self.comp_dicts = [{}] * len(self.columns)
for (atomic_number, mass_n... |
import requests
from workflow.models import Country, TolaUser, TolaSites, Organization, WorkflowLevel1, WorkflowLevel2
import json
def get_headers():
"""
Authentication for Tables
Get the header information to send to tables in the request
:return: headers
"""
tables = TolaSites.objects.get(si... |
import logging
from datetime import datetime, timedelta
from celery import shared_task
from django.conf import settings
from django.core.management import call_command
from bluebottle.utils.utils import get_class
from .exception import AnalyticsException
logger = logging.getLogger(__name__)
@shared_task
def queue_... |
from enum import IntEnum
from pydantic import BaseModel, Schema
class FooBar(BaseModel):
count: int
size: float = None
class Gender(IntEnum):
male = 1
female = 2
other = 3
not_given = 4
class MainModel(BaseModel):
"""
This is the description of the main model
"""
foo_bar: FooB... |
#
# range.py
#
# statbot - Store Discord records for later analysis
# Copyright (c) 2017 Ammon Smith
#
# statbot is available free of charge under the terms of the MIT
# License. You are free to redistribute and/or modify it under those
# terms. It is distributed in the hopes that it will be useful, but
# WITHOUT ANY W... |
#!/usr/bin/env python
#
# Copyright (c) 2017, DjaoDjin 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:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this ... |
import nosqlite
from fields import Field
from exceptions import ValidationError
try:
import config as base_config
except ImportError:
base_config = None
class Schema:
@staticmethod
def get_config():
config = dict()
if base_config:
config = vars(base_config)
if 'D... |
#!/usr/bin/python
#
# 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... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... |
from flask import Flask, render_template, json, request,session,redirect,url_for
from flask.ext.mysql import MySQL
from werkzeug import generate_password_hash, check_password_hash
from tools.MysqlBase import *
import hashlib
mysql = MysqlBase('python')
app = Flask(__name__)
app.secret_key = 'F12Zr47j\3yX R~X@H!jmM]L... |
"""Test radix sorting algorithm sorts properly."""
def test_radix_sort_empty():
"""Sort an empty list."""
from src.radix_sort import radix_sort
assert radix_sort([]) == []
def test_radix_sort_one_number():
"""Sort a list containing a single number."""
from src.radix_sort import radix_sort
as... |
############################################################################
##
## Copyright (C) 2006-2010 University of Utah. All rights reserved.
##
## This file is part of VisTrails.
##
## This file may be used under the terms of the GNU General Public
## License version 2.0 as published by the Free Software Foundat... |
'''
Copyright 2017, Fujitsu Network Communications, 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 w... |
# Copyright 2015 Mirantis, 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 ... |
#! /usr/bin/env python
# Contributors:
# Zach Rowinski <zach@eecs.berkeley.edu> (2015)
from collections import defaultdict
from math import ceil
from time import sleep
import argparse
import getpass
import glob
import json
import os
import subprocess
import sys
import time
import urllib2
network_if = 'eth0'
DEFAULT... |
""" Widget wrapper code for the various elements that can be displayed.
Widgets need to provide a render function, accepting a surface to
render to, a time, and a function that generates the correct position to
render at.
Dynamically sized widgets (size == None) will be given an area to render
... |
__author__ = 'Florian'
import pygame
from pygame import Rect
from pygame.font import Font
from config import *
from constants import *
import sys
from collections import deque
from copy import deepcopy
from math import floor
dirty_rects = []
widgets = {}
pages = []
def getit(key, h):
"""Return h[key]. If key ha... |
from ..node import OP_ADD, OP_MUL, OP_DIV, OP_POW, OP_NEG, OP_SIN, OP_COS, \
OP_TAN, OP_DER, OP_LOG, OP_INT, OP_INT_INDEF, OP_EQ, OP_ABS
from .groups import match_combine_groups
from .factors import match_expand
from .powers import match_add_exponents, match_subtract_exponents, \
match_multiply_exponent... |
"""
A consent module for the satosa proxy
"""
import hashlib
import json
import logging
from base64 import urlsafe_b64encode
import requests
from requests.exceptions import ConnectionError
from jwkest.jws import JWS
from jwkest.jwk import rsa_load
from jwkest.jwk import RSAKey
from satosa.logging import satosa_logg... |
#!/usr/bin/env python2
import sys, os, json, errno, subprocess, yum
class yumoter:
def __init__(self, configFile, repobasepath):
self.urlbasepath = "http://yumoter.gnmedia.net"
self.repobasepath = repobasepath
self.changedRepos = []
self.reloadConfig(configFile)
self.yb = yu... |
#!/usr/bin/env python
import sys
import argparse
import client_wrap
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument("-t", "--type", help="type of the cached data", default="double")
parser.add_argument("-c", "--connection", help="connection string", default="ipc:///var/run/zero-ca... |
# Copyright 2014-2016 PUNCH Cyber Analytics Group
#
# 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... |
"""
Map is a generic Map class from which all other Map classes inherit from.
"""
from __future__ import absolute_import
#pylint: disable=E1101,E1121,W0404,W0613
__authors__ = ["Keith Hughitt, Steven Christe"]
__email__ = "keith.hughitt@nasa.gov"
import os
import pyfits
import numpy as np
import matplotlib.pyplot as ... |
import sys
import os
from workflow import Workflow
def main(wf):
user_input = wf.args[0]
if user_input != '':
try:
if int(user_input) <= 100 and int(user_input) >= 0:
wf.add_item('%s%%' % user_input, arg='%s' % (int(user_input) / 100.0), valid=True)
else:
... |
# -*- coding: utf-8 -*-
""" License
Copyright (C) 2013 YunoHost
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any l... |
import os
import sys
import re
import socket
import struct
import subprocess as ssubprocess
from fcntl import ioctl
from ctypes import c_char, c_uint8, c_uint16, c_uint32, Union, Structure, \
sizeof, addressof, memmove
from sshuttle.helpers import debug1, debug2, Fatal, family_to_string
from sshuttle.methods import... |
from __future__ import print_function
import sys
import re
import datetime
import os, hashlib, base64
import logzero
from logzero import logger
DEFAULT_FORMAT = '%(color)s[%(levelname)1.1s %(asctime)s %(module)s:%(lineno)d]%(end_color)s %(message)s'
logfmt = logzero.LogFormatter(fmt=DEFAULT_FORMAT, datefmt="%Y-%m-%d ... |
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes.generic import GenericForeignKey
from django.db import models, router, transaction, IntegrityError
from django.db.models.query import QuerySet
from django.template.defaultfilters import slugify as default_slugify
from django.uti... |
# pool.py
#
# spread requests among connections to multiple nodes in a Cassandra cluster
"""
Quick start:
>>> my_seed_nodes = ['192.168.2.14', '192.168.2.15', '192.168.2.16']
>>> mypool = CassandraClusterPool(my_seed_nodes, keyspace='MyKeyspace', pool_size=10)
>>> mypool.startService()
>>> mypool.get('Key12345', 'Som... |
# Copyright (c) 2008 The Regents of The University of Michigan
# 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 ... |
"""IPython terminal interface using prompt_toolkit"""
import asyncio
import os
import sys
import warnings
from warnings import warn
from IPython.core.async_helpers import get_asyncio_loop
from IPython.core.interactiveshell import InteractiveShell, InteractiveShellABC
from IPython.utils import io
from IPython.utils.py... |
# Copyright 2013 Huawei Technologies Co.,LTD.
# 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
#
# Unl... |
import os
import re
import csv
import sys
import json
import pickle
import pprint
import urllib
import hashlib
import logging
import optparse
import requests
import subprocess
import webbrowser
import oauthlib.oauth1
from money import Money
from pprint import pprint
from datetime import datetime
LOGGING_DISABELED = 10... |
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 18 09:11:38 2016
@author: Admin
"""
from __future__ import division
import numpy as np
import matplotlib.pyplot as plt
N = 2
t = 3.1556e7; dt = t/360
n = int(t/dt)
G = 6.67e-11
Ms = 1.989e30
Me = 5.972e24
M = np.array([Ms,Me])
AU = 149597871000
e = 0.05*AU
ip = np.a... |
"""Production settings and globals."""
from os import environ
from base import *
# Normally you should not import ANYTHING from Django directly
# into your settings, but ImproperlyConfigured is an exception.
from django.core.exceptions import ImproperlyConfigured
def get_env_setting(setting):
""" Get the envi... |
from .location_schema import Location
from marshmallow import Schema, fields, post_dump
from .location_api_url import LocationUrl
class LocationByPointQueryString(Schema):
point = fields.Str()
includeEntityTypes = fields.Str()
includeNeighborhood = fields.Int(
default=0
)
include = fields.... |
#!/usr/bin/env python
"""
This module implements the main Custodian class, which manages a list of jobs
given a set of error handlers, and the abstract base classes for the
ErrorHandlers and Jobs.
"""
from __future__ import division
__author__ = "Shyue Ping Ong"
__copyright__ = "Copyright 2012, The Materials Project... |
import networkx as nx
import pandas as pd
def load_seventh_grader_network():
# Read the edge list
df = pd.read_csv('datasets/moreno_seventh/out.moreno_seventh_seventh',
skiprows=2, header=None, sep=' ')
df.columns = ['student1', 'student2', 'count']
# Read the node metadata
m... |
import copy
import logging
import os
import random
import time
from . import errors
from . import cloudbase
try:
from pyvsphere.vim25 import Vim, ManagedObject
pyvsphere_available = True
except ImportError:
pyvsphere_available = False
class VSphereProvider(cloudbase.Provider):
def __init__(self, cloud... |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
"""gameobjects.py: game objects"""
import util
class GameObject:
"""Superclass of all game objects, has id and bb... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import simple_audit
import logging
import datetime
from datetime import date, timedelta
from django.db import models, transaction, Error
from django.db.models.signals import pre_save, post_save, pre_delete
from django.contrib.auth.models i... |
import datetime
from dateutil.relativedelta import relativedelta
from doctor_schedule.models import ScheduleResource
from laboratory.utils import current_time
from doctor_schedule.sql_func import get_resource_by_research_hospital, get_slot_plan_by_hosp_resource, get_hospital_resource_by_research, get_slot_fact
from do... |
from functools import partial
from typing import List
import e3nn_jax as e3nn
import haiku as hk
import jax
import jax.numpy as jnp
class Convolution(hk.Module):
r"""Equivariant Point Convolution
Args:
irreps_node_output : `e3nn_jax.Irreps`
representation of the output node features
... |
# -*- coding: utf-8 -*-
import unittest
import bst
class TestInit(unittest.TestCase):
"""Tests creation of a new binary search tree."""
def test_empty_by_default(self):
"""By default, a new binary search tree should be created empty."""
tree = bst.BinarySearchTree()
with self.assertRaises(ValueErr... |
# Disable fatoptimizer on this module
__fatoptimizer__ = {'enabled': False}
import builtins
import fat
import os.path
import sys
import textwrap
import unittest
class BaseTestCase(unittest.TestCase):
def setUp(self):
transformers = sys.get_code_transformers()
self.addCleanup(sys.set_code_transfor... |
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 23 15:23:58 2015
@author: jensv
"""
import skin_core_scanner_simple as scss
reload(scss)
import equil_solver as es
reload(es)
import newcomb_simple as new
reload(new)
(lambda_a_mesh, k_a_mesh,
stability_maps) = scss.scan_lambda_k_space([0.01, 3.0, 25.], [0.01, 1.5, 25]... |
'''
Bigmetadata tasks
tasks to download and create metadata
'''
import os
import requests
from collections import OrderedDict
from datetime import datetime
from luigi import (Task, IntParameter, LocalTarget, BooleanParameter, Parameter,
WrapperTask)
from tasks.util import (TableTarget, shell, clas... |
# MIT License
#
# Copyright (c) 2017 Matt Boyer
#
# 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, p... |
from __future__ import unicode_literals
import datetime
from dateutil.parser import parse
import decimal
from decimal import Decimal
import importlib
from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned
from django.db import models
try:
from django.db.models.fields.related import\
... |
# 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.
# libcloud.org licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not... |
"""
Django settings for contentcuration project.
Generated by 'django-admin startproject' using Django 1.8.1.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Bui... |
#!/usr/bin/env python
#
# $Id$
#
import os
import unittest
import platform
import subprocess
import signal
import time
import warnings
import atexit
import psutil
from test_psutil import reap_children, get_test_subprocess, wait_for_pid
try:
import wmi
except ImportError, err:
atexit.register(warnings.warn, "... |
import os.path as op
import sys
import getopt
from retrieval.flickrwrapper import FlickrWrapper
from analysis import process
from analysis import kmeans
from display import plothelper
from features import sift, extract
from runmode import RunMode
from dataset.dataset import DataSet
class RsBundler:
def __init__... |
import json
import requests
import datetime
from optparse import make_option
from django.utils import timezone
from django.db import transaction
from django.core import serializers
from django.core.management.base import BaseCommand
from schools.models import School
from common.utils import post_to_slack
from storie... |
"""
The "methods" object holds the list of functions that can be called by remote calls.
Add as many methods as needed.
Methods can take either positional or named arguments (but not both, this is a
limitation of JSON-RPC).
"""
from typing import Any, Callable, Optional
from inspect import signature
from .errors im... |
"""JTS type casting. Patterned on okfn/messy-tables"""
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import re
import decimal
import datetime
import time
import json
import operator
... |
import os
import pytest
import tempfile
import shutil
from snakemake.shell import shell
from lcdblib.snakemake import aligners
@pytest.fixture(scope='session')
def sample1_se_fq(tmpdir_factory):
fn = 'samples/sample1/sample1_R1.fastq.gz'
d = str(tmpdir_factory.mktemp('sample1_se_fq'))
url = 'https://github... |
"""PyTest based testing of the FERC & PUDL Database initializations.
This module also contains fixtures for returning connections to the databases.
These connections can be either to the live databases (for post-ETL testing)
or to the test databases, which are created from scratch and dropped after the
tests have comp... |
# This is an auto-generated Django model module.
# You'll have to do the following manually to clean this up:
# * Rearrange models' order
# * Make sure each model has one field with primary_key=True
# Feel free to rename the models, but don't rename db_table values or field names.
#
# Also note: You'll have to ... |
#!/usr/bin/env python
# Licensed to the StackStorm, Inc ('StackStorm') 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 "Licens... |
# Orca
#
# Copyright 2010 Joanmarie Diggs.
# Copyright 2014-2015 Igalia, S.L.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) an... |
# coding=utf-8
"""
"""
from __future__ import absolute_import, division, print_function, \
unicode_literals
from flask import g
from six import text_type
from sqlalchemy.ext.declarative import declared_attr
from sqlalchemy.orm import relationship
from sqlalchemy.schema import Column, ForeignKey
from whoosh.fields ... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import copy
import inspect
from ..engine import Layer
from ..engine import InputSpec
from .. import backend as K
class Wrapper(Layer):
"""Abstract wrapper base class.
Wrappers take another layer and augment it in various ways.
Do not use thi... |
__author__ = 'Daniel Kapellusch'
# Necessary imports. Note: this is written in python 2.
import sys
import findr_lib
import astropy.io.fits as fits
import os
import multiprocessing as mp
from ConfigParser import ConfigParser
import json
def main(argv):
if not argv:
print "run_findr.py fits_path config_fi... |
#!/usr/bin/env python
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this... |
#!/usr/bin/env python
# coding=utf-8
import sys
import os
import django
from django.conf import settings
ROOT = os.path.join(os.path.dirname(__file__), 'viewlet/tests')
def main():
conf = {
'DEBUG': True,
'TEMPLATE_DEBUG': True,
'INSTALLED_APPS': [
'django.contrib.auth',
... |
# BOJ-tier
# Copyright (C) 2017 Jeehak Yoon
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program i... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2003-2009 Edgewall Software
# Copyright (C) 2003-2007 Jonas Borgström <jonas@edgewall.com>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at htt... |
# -*- coding: utf-8 -*-
"""
@file
@brief Contains the main function to generate the documentation
for a module designed the same way as this one, @see fn generate_help_sphinx.
"""
import os
import sys
import shutil
import importlib
import warnings
from docutils.parsers.rst import directives
from ..loghelper.flog impo... |
#!/usr/bin/env python3
"""
SacréBLEU provides hassle-free computation of shareable, comparable, and reproducible BLEU scores.
Inspired by Rico Sennrich's `multi-bleu-detok.perl`, it produces the official WMT scores but works with plain text.
It also knows all the standard test sets and handles downloading, processing, ... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2013 Jean Ventura (<http://venturasystems.net>).
#
# This program is free software: you can redistribute it and/or modify
# it under... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.