gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
import oelite.fetch
import oelite.git
import oelite.util
import os
import re
import warnings
import string
import sys
import hashlib
class GitFetcher():
SUPPORTED_SCHEMES = ("git")
SHA1_RE = re.compile("([0-9a-f]{1,40})$")
def __init__(self, uri, d):
if not uri.scheme in self.SUPPORTED_SCHEMES:
... | |
#!/usr/bin/env python3
import numpy as np
import matplotlib.pyplot as plt
from scipy.linalg import solve_banded # banded solver
import sys
''' Mixed Hybrid Finite Element solver for moment equations (drift diffusion) '''
class MHFEM:
def __init__(self, xe, Sigmaa, Sigmat, BCL=0, BCR=1, CENT=0):
''' Solves d... | |
"""Unittests for heapq."""
import random
import unittest
from test import support
import sys
# We do a bit of trickery here to be able to test both the C implementation
# and the Python implementation of the module.
import heapq as c_heapq
py_heapq = support.import_fresh_module('heapq', blocked=['_heapq'])
class Tes... | |
# -*- coding: utf-8 -*-
"""
Examples of plots and calculations using the tmm package.
"""
from __future__ import division, print_function, absolute_import
from tmm.tmm_core import (coh_tmm, unpolarized_RT, ellips,
position_resolved, find_in_structure_with_inf)
from numpy import pi, linspace, i... | |
"""
comments- not sure how to implement test_email_function
"""
import unittest
from django.contrib.auth.models import User, Group
from django.test import TestCase
from theme.models import UserProfile
from django.core.exceptions import ValidationError
from hs_core import hydroshare
from hs_dictionary.models import... | |
import unittest
import jsmin
import sys
class JsTests(unittest.TestCase):
def _minify(self, js):
return jsmin.jsmin(js)
def assertEqual(self, thing1, thing2):
if thing1 != thing2:
print(repr(thing1), repr(thing2))
raise AssertionError
return True
def as... | |
"""
Component to count within automations.
For more details about this component, please refer to the documentation
at https://home-assistant.io/components/counter/
"""
import asyncio
import logging
import os
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.config impo... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Methods to run plink commands on the 1000genomes phase 3 dataset.
"""
import os as _os
import re as _re
import sys as _sys
import pickle as _pickle
from tempfile import mkstemp as _temp
from . import _run
# Set data directories
DATA_DIR = "/godot/1000genomes/1000GP_Ph... | |
from math import floor
import os
from osgeo import ogr
from osgeo import osr
from core import gdalProperties, ShapeDataError
ogr.UseExceptions()
def getfieldindex(layer, fieldname):
index = None
layerdefn = layer.GetLayerDefn()
for i in xrange(layerdefn.GetFieldCount()):
if layerdefn.GetFieldDef... | |
from datetime import datetime
from django.urls import reverse
from django.test import RequestFactory
from mixer.backend.django import mixer
from members.views.ajax_views import *
import pytest
@pytest.fixture
def user_request(db):
user = mixer.blend(User)
request = RequestFactory().get("", {}, HTTP_X_REQUESTE... | |
import unittest
from exprail.classifier import Classifier
from exprail.grammar import Grammar
from exprail.parser import Parser
from exprail.source import SourceString
class NumberClassifier(Classifier):
"""Classify number symbol sets"""
@staticmethod
def is_in_class(token_class, token):
"""
... | |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2014, Nicolas P. Rougier. All rights reserved.
# Distributed under the terms of the new BSD License.
# -----------------------------------------------------------------------------
import re
import ma... | |
# -*- coding: utf-8 -*-
from os import path
from gluon import current
from gluon.html import *
from gluon.storage import Storage
# =============================================================================
class index():
""" Custom Home Page """
def __call__(self):
T = current.T
response... | |
import sys
import zmq
import pymongo
import os
import threading
import logging
from logging.handlers import RotatingFileHandler
#from logging.config import dictConfig
from bson import ObjectId
from m4ed.util.settings import parse_asset_settings
from m4ed.util.image import ImageProcessor
try:
import configparser
... | |
import bottom
import datetime
import asyncio
from .backend import Backend
from .models import Event, Channel, User, ChannelMessage, UserMessage
def parse_prefixnick(prefixnick):
possible_prefix = prefixnick[0]
if possible_prefix in "+@":
return possible_prefix, prefixnick[1:]
return "", prefixnic... | |
import os
import sys
import gzip
import fbt_format_pb2
import cairo
import math
from optparse import OptionParser
def parse_args():
parser = OptionParser()
parser.add_option("-i", "--input-file", dest="input_file", default="trace.fbt", help="Input FBT file.")
parser.add_option("-o", "--output-file", dest=... | |
"""Migrating IPython < 4.0 to Jupyter
This *copies* configuration and resources to their new locations in Jupyter
Migrations:
- .ipython/
- nbextensions -> JUPYTER_DATA_DIR/nbextensions
- kernels -> JUPYTER_DATA_DIR/kernels
- .ipython/profile_default/
- static/custom -> .jupyter/custom
- nbconfig -> .jupyte... | |
# coding: utf-8
"""
UsersApi.py
Copyright 2016 SmartBear Software
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 ... | |
from pandac.PandaModules import *
from otp.margins.WhisperPopup import WhisperPopup
from otp.nametag.NametagConstants import CFQuicktalker, CFPageButton, CFQuitButton, CFSpeech, CFThought, CFTimeout
from otp.chat import ChatGarbler
import string
from direct.task import Task
from otp.otpbase import OTPLocalizer
from otp... | |
# Copyright 2012 Nebula, 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 agree... | |
# -*- coding: utf-8 -*-
"""Mappings between the ordering of PyFR nodes, and those of external formats
"""
import numpy as np
class GmshNodeMaps(object):
"""Mappings between the node ordering of PyFR and that of Gmsh
Node mappings are contained within two dictionaries; one maps from
Gmsh node ordering t... | |
# -*- coding: utf-8 -*-
#Created on Sat Sep 20 11:23:30 2014
#@author: breedlu
import matplotlib as _mpl
import matplotlib.pyplot as _plt
import numpy as _np
from matplotlib.lines import Line2D as _mpl_Line2D
from matplotlib.patches import Polygon as _mpl_Polygon
import matplotlib.text as _mpl_text
import clearplot as... | |
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
# util __init__.py
from __future__ import unicode_literals
from werkzeug.test import Client
import os, sys, re, urllib
import frappe
# utility functions like cint, int, flt, etc.
from frappe.utils.data import *
de... | |
"""
This class is defined to override standard pickle functionality
The goals of it follow:
-Serialize lambdas and nested functions to compiled byte code
-Deal with main module correctly
-Deal with other non-serializable objects
It does not include an unpickler, as standard python unpickling suffices.
This module wa... | |
#!/usr/bin/env python
# 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
# "Li... | |
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack Foundation
# 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.apach... | |
#!/usr/bin/env python
'Classes and functions for handling XML files in pysilfont scripts'
__url__ = 'http://github.com/silnrsi/pysilfont'
__copyright__ = 'Copyright (c) 2015 SIL International (http://www.sil.org)'
__license__ = 'Released under the MIT License (http://opensource.org/licenses/MIT)'
__author__ = 'David Ra... | |
import configparser
import ast
import numbers
import numpy as np
from unipath import Path
from .utils import BASE_DIR, DATA_DIR, DEFAULT_SETTINGS
from .geometry import Geometry
from .mesh import Mesh
from .material import Material
from .initial import Initial
from .source import Source
from .boundary import Boundary
f... | |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | |
from __future__ import absolute_import, print_function
import logging
from django.conf import settings
from django.db import connections
from django.db.utils import OperationalError
from django.db.models.signals import post_syncdb, post_save
from functools import wraps
from pkg_resources import parse_version as Versi... | |
"""
The MIT License (MIT)
Copyright (c) 2015-present Rapptz
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, merg... | |
# -- coding: iso8859-1
"""Generic option parser class. This class can be used
to write code that will parse command line options for
an application by invoking one of the standard Python
library command argument parser modules optparse or
getopt.
The class first tries to use optparse. It it is not there
(< Python 2.3)... | |
"""prawcore.sessions: Provides prawcore.Session and prawcore.session."""
import logging
import random
import time
from copy import deepcopy
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Union
from urllib.parse import urljoin
from requests.exceptions import ChunkedEncodingError, ConnectionError, R... | |
##########################################################################
#
# Copyright 2010 Dr D Studios Pty Limited (ACN 127 184 954) (Dr. D Studios),
# its affiliates and/or its licensors.
#
# Copyright (c) 2010-2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary ... | |
"""Wrapper/Implementation of the GLU tessellator objects for PyOpenGL"""
from OpenGL.raw import GLU as simple
from OpenGL.platform import GLU,createBaseFunction
from OpenGL.GLU import glustruct
from OpenGL import arrays, constants
from OpenGL.platform import PLATFORM
from OpenGL.lazywrapper import lazy
import ctypes
c... | |
import logging
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.core.exceptions import ObjectDoesNotExist
from django.core.paginator import PageNotAnInteger, EmptyPage
from django.core.paginator import Paginator
from django.core.urlresolvers import reverse
from djan... | |
'''
Created on Dec 11, 2013
@author: gpratt
'''
from collections import defaultdict, Counter
from itertools import groupby, permutations
from functools import partial
from optparse import OptionParser
import os
import HTSeq
import pandas as pd
import pysam
import tempfile
import pysam
import pybedtools
from collecti... | |
# Copyright 2015 Lockheed Martin 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 agr... | |
from __pyjamas__ import JS
#from __future__ import division
#from warnings import warn as _warn
#from types import MethodType as _MethodType, BuiltinMethodType as _BuiltinMethodType
from math import log as _log, exp as _exp, pi as _pi, e as _e, ceil as _ceil
from math import sqrt as _sqrt, acos as _acos, cos as _cos, s... | |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Blog.has_artists'
db.add_column('blogs_blog', 'has_artists',
self.gf('... | |
#!/usr/bin/python3
# Copyright 2019 by Jeff Woods
#
# 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 applic... | |
# Copyright 2021 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 agreed to in writing, ... | |
from __future__ import absolute_import, unicode_literals
from django.contrib.contenttypes.models import ContentType
from django.test import TestCase
from wagtail.tests.testapp.models import EventPage, SimplePage, SingleEventPage
from wagtail.wagtailcore.models import Page, PageViewRestriction, Site
from wagtail.wagta... | |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | |
# -*- coding: UTF8
'''
Created on 02.10.2015
@author: mEDI
'''
from PySide import QtCore, QtGui
import PySide
import gui.guitools as guitools
from sqlite3_functions import calcDistance
__toolname__ = "Bookmarks"
__internalName__ = "Bo"
__statusTip__ = "Open A %s Window" % __toolname__
class tool(QtGui.QWidget):
... | |
####### dev hack flags ###############
verify_stack_after_op = False
# ######################################
import sys
sys.setrecursionlimit(10000)
import copy
from rlp.utils import encode_hex, ascii_chr
from ethereum import utils
from ethereum.abi import is_numeric
from ethereum import opcodes
from ethereum.slo... | |
import os
import sys
from functools import wraps
from getpass import getpass, getuser
from glob import glob
from contextlib import contextmanager
from fabric.api import env, cd, prefix, sudo as _sudo, run as _run, hide, task
from fabric.contrib.files import exists, upload_template
from fabric.colors import yellow, gr... | |
# -*- coding: utf-8 -*-
# Copyright (C) 2015-2018 by Brendt Wohlberg <brendt@ieee.org>
# All rights reserved. BSD 3-clause License.
# This file is part of the SPORCO package. Details of the copyright
# and user license can be found in the 'LICENSE.txt' file distributed
# with the package.
"""ADMM algorithms for the Co... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Invoke tasks. To run a task, run ``$ invoke <COMMAND>``. To see a list of
commands, run ``$ invoke --list``.
"""
import os
import sys
import json
import platform
import subprocess
import logging
import invoke
from invoke import Collection
from website import settings
f... | |
from __future__ import absolute_import, unicode_literals
######################
# MEZZANINE SETTINGS #
######################
# The following settings are already defined with default values in
# the ``defaults.py`` module within each of Mezzanine's apps, but are
# common enough to be put here, commented out, for con... | |
from JumpScale import j
import JumpScale as jumpscale
try:
from configparser import ConfigParser
except:
from configparser import ConfigParser
# TODO: UGLY, validation should not happen on object (file) where you read
# from but on file where you populate values (kds)
class InifileTool:
def __init__(se... | |
import json
import logging
import string
from sqlalchemy.sql import text
from marshmallow import validate
from rdr_service.code_constants import PPI_SYSTEM
from rdr_service.dao.resource_dao import ResourceDataDao
from rdr_service.resource import fields
# TODO: Rework these from BigQuery schemas to resource schemas.... | |
import json
import requests
import sys
import siftpartner
from . import version
from . import response
API_URL = "https://partner.siftscience.com/v%s" % version.API_VERSION
API_TIMEOUT = 2
class Client(object):
def __init__(self, api_key=None, partner_id=None):
""" Initialize the client
:param ... | |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | |
#!/usr/bin/env python3
import datetime
import os
import time
from collections import namedtuple
from typing import Dict, Optional, Tuple
import psutil
from smbus2 import SMBus
import cereal.messaging as messaging
from cereal import log
from common.filter_simple import FirstOrderFilter
from common.hardware import EON,... | |
__author__ = 'leif'
from django.shortcuts import render
from django.contrib.auth.models import User
from django.contrib.auth.decorators import login_required
from django.shortcuts import redirect
from django.core.urlresolvers import reverse
from treconomics.experiment_functions import get_experiment_context
from treco... | |
"""Host Reservation DHCPv6"""
# pylint: disable=invalid-name,line-too-long
import pytest
import srv_control
import srv_msg
import misc
@pytest.mark.v6
@pytest.mark.host_reservation
@pytest.mark.kea_only
def test_v6_host_reservation_all_values_mac():
misc.test_setup()
srv_control.config_srv_subnet('3000::/6... | |
"""
Mini commands - Provides a template for writing quick
command classes in Python using the subprocess module.
Author: Anand B Pillai <abpillai@gmail.com>
"""
import os
import time
from subprocess import *
class CmdProcessor(object):
""" Class providing useful functions to execute system
commands using su... | |
# Copyright 2017 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... | |
# Copyright 2012, Nachi Ueno, NTT MCL, 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 applic... | |
#############################################################################
# Documentation #
#############################################################################
# Author: Todd Whiteman
# Date: 16th March, 2009
# Version: 2.0.1
# License: Public Domain - free to do as you wish
# Homepage... | |
# -*- coding: utf-8 -*-
"""
Calculates rho(z) to maintain hydrostatic equilibrium in a thin disc.
Assumes uniform temperature in the disc, and an infinite disc where
rho can be treated (at least locally) as only a function of z.
Created on Mon Jan 20 12:30:06 2014
@author: ibackus
"""
import isaac
import numpy a... | |
from __future__ import absolute_import, print_function, division
import copy
import numpy
import logging
import pdb
from six.moves import xrange
import theano
from theano import tensor, scalar, gof, config
from theano.compile import optdb
from theano.compile.ops import shape_i
from theano.gof import (local_optimizer, ... | |
"""Convenient access to an SQLObject or SQLAlchemy managed database."""
import sys
import time
import logging
import cherrypy
from cherrypy import request
try:
import sqlobject
from sqlobject.dbconnection import ConnectionHub, Transaction, TheURIOpener
from sqlobject.util.threadinglocal import local as t... | |
import unittest, collections
import grf
class GrfTest(unittest.TestCase):
def testNodes(self):
self.assertEqual([], grf.nodes([]))
self.assertEqual(list("ABD"), grf.nodes(["AB", "AD"]))
self.assertEqual(list("ABCD"), grf.nodes(["AB", "CD"]))
def testIsConnected(self):
self.assertTrue(grf.is_connected([]))
... | |
#!/usr/bin/env python3
import argparse
import os
import sys
import random
debug_mode = False
def create_bram(dsc_f, sim_f, ref_f, tb_f, k1, k2, or_next):
while True:
init = 0 # random.randrange(2)
abits = random.randrange(1, 8)
dbits = random.randrange(1, 8)
groups = random.rand... | |
# coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from tests import IntegrationTestCase
from tests.holodeck import Request
from twilio.base.exceptions import TwilioException
from twilio.http.response import Response
class PhoneNumberTestCase(Integ... | |
#!/usr/bin/python
from __future__ import print_function
def c_compiler_rule(b, name, description, compiler, flags):
command = "%s -MMD -MF $out.d %s -c -o $out $in" % (compiler, flags)
b.rule(name, command, description + " $out", depfile="$out.d")
version_major = 0;
version_minor = 2;
version_patch = 0;
from opt... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import logging
import operator
import os
import re
import struct
import sys
import iso639
import misc
import opensubtitles
import tvsubtitles
class Movie(object):
MOVIE = "movie"
EPISODE = "episode"
TVSHOW = "tv series"
def __init__(self,... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import time
from . import conf
from .base import (
_key, Base, MixinSerializable, BaseHour, BaseDay, BaseWeek, BaseMonth,
BaseYear
)
from .timelines import _totimerange
__all__ = ['TIME_INDEX_KEY_NAMESAPCE', 'TimeIndexedKey', 'HourIndexedKey',
'DayInde... | |
# This file is kept only for backwards compatibility. Edit the one in ../mapgen
import re
import warnings
class NotImplementedWarning(UserWarning):
pass
pattern = re.compile(r'^([^(]+)\((.+?)\)?$', re.DOTALL)
def get_command(instruction):
match = pattern.match(instruction)
if match is None:
co... | |
"""This module adds a reST directive to sphinx that generates cyclus agent
documentation based on its annotations and schema. The user simply specifies
the normal cyclus agent spec for the agent that they wish to document.
For example,
.. cyclus-agent:: tests:TestFacility:TestFacility
"""
from __future__ impo... | |
from __future__ import absolute_import
import hashlib
import numpy as nm
import warnings
import scipy.sparse as sps
import six
from six.moves import range
warnings.simplefilter('ignore', sps.SparseEfficiencyWarning)
from sfepy.base.base import output, get_default, assert_, try_imports
from sfepy.base.timing import ... | |
# --------------------------------------------------------------------------
# Source file provided under Apache License, Version 2.0, January 2004,
# http://www.apache.org/licenses/
# (c) Copyright IBM Corp. 2015, 2016
# --------------------------------------------------------------------------
"""
Hitori is played w... | |
#
# Copyright (c) 2014, Arista Networks, 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 condit... | |
from sure import expect
from freezegun import freeze_time
from moto.swf.models import (
ActivityType,
Timeout,
WorkflowType,
WorkflowExecution,
)
from moto.swf.exceptions import (
SWFDefaultUndefinedFault,
)
from ..utils import (
auto_start_decision_tasks,
get_basic_domain,
get_basic_w... | |
# 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 ... | |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import ast
import it... | |
#!/usr/bin/python !/usr/bin/env python
# -*- coding: utf-8 -*
# Functions to extract knowledge from medical text. Everything related to
# extraction needed for the knowledge base. Also, some wrappers for SemRep,
# MetaMap and Reverb. Contains some enrichment routines for utilizing UTS
# services.
import json
import... | |
#!/usr/bin/env python3
import math
import unittest
import vectors
class TestVector(unittest.TestCase):
def setUp(self):
super().setUp()
self.v = vectors.Vector(4, -6, 7, 2.4, 10)
self.u = vectors.Vector(2, 3, -0.5, 4, 3)
def tearDown(self):
super().tearDown()
# methods
... | |
#!/usr/bin/env python
#
# changeip script for calendar server
#
# Copyright (c) 2005-2017 Apple Inc. All Rights Reserved.
#
# IMPORTANT NOTE: This file is licensed only for use on Apple-labeled
# computers and is subject to the terms and conditions of the Apple
# Software License Agreement accompanying the package th... | |
"""Backup methods and utilities"""
import couchdb
import logging
import os
import re
import sys
import shutil
import subprocess as sp
import time
from datetime import datetime
from taca.utils.config import CONFIG
from taca.utils import filesystem, misc
logger = logging.getLogger(__name__)
class run_vars(object):
... | |
# Lint as: python3
# 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 ... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""This file contains a unit test for the timelib in Plaso."""
import datetime
import unittest
from plaso.lib import errors
from plaso.lib import timelib
import pytz
class TimeLibTest(unittest.TestCase):
"""Tests for timestamp."""
def testCopyFromString(self):
"""... | |
import keyword
import re
from django.core.management.base import BaseCommand, CommandError
from django.db import DEFAULT_DB_ALIAS, connections
from django.db.models.constants import LOOKUP_SEP
class Command(BaseCommand):
help = "Introspects the database tables in the given database and outputs a Django model mod... | |
#!/usr/bin/env python
# convert expression data into expressed and not-expressed genes
import sys
import time
import optparse
import general
import numpy
import pickle
import pdb
import metrn
import modencode
import multiprocessing
import fasta
import os
from runner import *
print "Command:", " ".join(sys.argv)
prin... | |
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2017, Anaconda, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#---------------------------------------------------... | |
from django.contrib.auth import get_user_model
from django.test import override_settings
from django.urls import reverse
from django.utils import encoding
from example.tests import TestBase
class ModelViewSetTests(TestBase):
"""
Test usage with ModelViewSets, also tests pluralization, camelization,
and u... | |
import os
import math, random
from PIL import Image
import warnings
import json
from django.db import connection
# Disable the warnings for giant images
warnings.simplefilter('ignore', Image.DecompressionBombWarning)
class Last:
pass
def phorzvert_layout(project, frame=None):
# sort the images by size, large... | |
# Copyright 2007 Owen Taylor
#
# This file is part of Reinteract and distributed under the terms
# of the BSD license. See the file COPYING in the Reinteract
# distribution for full details.
#
########################################################################
import re
TOKEN_KEYWORD = 1
TOKEN_NAME ... | |
"""
Adds rasters identifed in a comma delimited text file to a gdal VRT
and build a mosaic raster. The text file is produced by running the
script "find_raster_path.py". The rasters can be reprojected, reclassed,
copied to a new directory and renamed based on a field in the text file.
"""
from __future__ import print... | |
# Copyright (c) 2015 Cloudbase Solutions SRL
# 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
#
# Unle... | |
#!/usr/bin/env python3
import h5py
import os
import logging
import re
import hashlib
import numpy as np
from PIL import Image
import pyglet
try:
from .errors import ConflictError
except:
from errors import ConflictError
try:
from .roi import ROI
except:
from roi import ROI
from . import lib
from .util... | |
#---------------------------------------------------------------------------
# predict.py
#
# Author : Felix Gonda
# Date : July 10, 2015
# School : Harvard University
#
# Project : Master Thesis
# An Interactive Deep Learning Toolkit for
# Automatic Segmentation of Images
#
# Summary : This fi... | |
# Authors : Alexandre Gramfort, alexandre.gramfort@telecom-paristech.fr (2011)
# Denis A. Engemann <denis.engemann@gmail.com>
# License : BSD 3-clause
import numpy as np
from ..parallel import parallel_func
from ..io.pick import _pick_data_channels
from ..utils import logger, verbose, deprecated, _time_mask... | |
# coding: utf-8
"""
Wavefront REST API Documentation
<p>The Wavefront REST API enables you to interact with Wavefront servers using standard REST API tools. You can use the REST API to automate commonly executed operations such as automatically tagging sources.</p><p>When you make REST API calls outside the W... | |
"""
gdalinfo tests/gis_tests/data/rasters/raster.tif:
Driver: GTiff/GeoTIFF
Files: tests/gis_tests/data/rasters/raster.tif
Size is 163, 174
Coordinate System is:
PROJCS["NAD83 / Florida GDL Albers",
GEOGCS["NAD83",
DATUM["North_American_Datum_1983",
SPHEROID["GRS 1980",6378137,298.2572221010002... | |
import sys
sys.path.append("..")
import unittest
from messageparser import *
class TestMessageParser(unittest.TestCase):
def test_beginTurnEncoding(self):
"""
Checks the Encoding of 11 Begin_Turn Message by MessageParser.
Format:
type:report;status:11;
"""
msg = MessageParser().encode("report",{"stat... | |
from common_fixtures import * # NOQA
logger = logging.getLogger(__name__)
def activate_environment_with_external_services(
admin_client, client, service_scale, port):
env, service, ext_service, con_list = create_env_with_ext_svc(
client, service_scale, port)
service.activate()
ext_servi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.