gt
stringclasses
1 value
context
stringlengths
2.49k
119k
# # 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 us...
""" @package mi.dataset.parser @file marine-integrations/mi/dataset/parser/dosta_abcdjm_cspp.py @author Mark Worden @brief Parser for the dosta_abcdjm_cspp dataset driver Release notes: initial release """ import numpy from mi.core.log import get_logger from mi.core.common import BaseEnum from mi.core.instrument.da...
#!/usr/bin/python """This script BLASTs the preprocessed input agains the Taxonomy databases""" try: import optparse, sys, re, csv, traceback from os import path import logging.handlers from libs.python_modules.utils.sysutil import pathDelim from libs.python_modules.utils.metapathways_utils import fpr...
"""GATK variant calling -- HaplotypeCaller and UnifiedGenotyper. """ import os from distutils.version import LooseVersion import shutil import subprocess import toolz as tz from bcbio import bam, broad, utils from bcbio.distributed.transaction import file_transaction from bcbio.pipeline import config_utils from bcbio...
import json from audio import audio import logging import os from threading import Thread from time import sleep from Queue import Queue import sys import inspect import re INTERVAL = 0.1 EFFECT_LENGTH = 2 logging.basicConfig() logger = logging.getLogger(__name__) path = os.path.realpath(__file__) dir_path = os.pat...
# The clearinghouse testlib must be imported first. from clearinghouse.tests import testlib from clearinghouse.tests import mocklib from clearinghouse.common.api import maindb from clearinghouse.common.exceptions import * from clearinghouse.common.util import validations from clearinghouse.website.control import ...
# -------------------------------------------------------- # Fully Convolutional Instance-aware Semantic Segmentation # Copyright (c) 2017 Microsoft # Licensed under The Apache-2.0 License [see LICENSE for details] # Modified by Haozhi Qi, Guodong Zhang # -------------------------------------------------------- """ Pa...
import matplotlib if matplotlib.get_backend() != 'Qt4Agg': matplotlib.use('Qt4Agg', warn=True, force=True) matplotlib.rcParams['toolbar'] = 'None' import hotspotter.draw_func2 as df2 import hotspotter.helpers as helpers import matplotlib.pyplot as plt import numpy as np import scipy import matplotlib import m...
# -*- coding: utf-8 -*- from __future__ import print_function from collections import OrderedDict from acq4.util import Qt from .CanvasItem import CanvasItem import numpy as np import scipy.ndimage as ndimage import pyqtgraph as pg import pyqtgraph.flowchart import acq4.util.DataManager as DataManager import acq4.util....
""" Example of how to use byte-code execution technique to trace accesses to numpy arrays. This file demonstrates two applications of this technique: * optimize numpy computations for repeated calling * provide automatic differentiation of procedural code """ import __builtin__ import ctypes import inspect import lo...
''' If this is running then python is obviously installed, but we need to make sure that python3 is installed. What we need to do: 0. (optional) Check disk space 0.1: The same env checks in run.py? 1: Make sure this is python 3.5+ 1.1: If we installed python 3.5, restart using that 2. Check ...
#!/usr/bin/env python3 # Copyright (c) 2017-2019 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """An example functional test The module-level docstring should include a high-level description of what ...
#!/usr/bin/env python ''' Main AVClass class ''' import sys import re import string import logging from collections import OrderedDict as OrdDict from collections import namedtuple from operator import itemgetter, attrgetter # Set logging log = logging.getLogger(__name__) # Prefix to identify platform tags platform_...
# Copyright (c) 2012 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.apache.org/licenses/LICENSE-2.0 # # Unless...
#!/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 # "L...
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe, json, sys from frappe import _ from frappe.utils import cint, flt, now, cstr, strip_html from frappe.model import default_fields from frappe.model.naming import ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """This module is for communicating with im.kayac.com. """ from __future__ import absolute_import from __future__ import unicode_literals from . import exceptions from . import constants import future.standard_library future.standard_library.install_aliases() import buil...
#!/usr/bin/env python # This script uses the following Unicode tables: # - UnicodeData.txt from collections import namedtuple import csv import os import subprocess NUM_CODEPOINTS=0x110000 def to_ranges(iter): current = None for i in iter: if current is None or i != current[1] or i in (0x10000, 0x2...
from abc import ABC, abstractmethod import cvxpy as cvx import numpy as np from cvxpy import SolverError class Relevance_CVXProblem(ABC): def __repr__(self) -> str: if self.isLowerBound: lower = "Lower" else: lower = "Upper" name = f"{lower}_{self.current_feature}_...
#!/usr/bin/env python ''' ooiservices/app/main/data.py Support for generating sample data ''' __author__ = 'Andy Bird' from flask import jsonify, request, current_app, url_for, Flask, make_response from ooiservices.app.uframe import uframe as api import numpy as np import calendar import time from dateutil.parser i...
# ---------------------------------------------------------------------------- # Copyright 2015 Nervana Systems 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.o...
# -*- coding: utf-8 -*- from __future__ import print_function import os import glob import json import weakref from collections import OrderedDict import numpy as np import scipy import scipy.stats from six import iteritems import pyqtgraph as pg from acq4.modules.Module import Module from acq4.analysis.AnalysisModu...
import uuid from cassandra import ConsistencyLevel, WriteFailure, WriteTimeout from distutils.version import LooseVersion from dtest import Tester from thrift_bindings.v22 import ttypes as thrift_types from thrift_tests import get_thrift_client from tools.decorators import since KEYSPACE = "foo" # These tests use ...
import random import re import sys import time from reusables.string_manipulation import int_to_words from app.common_functions import formatted_items, comma_separated, parse_inventory_action, odds, remove_little_words, \ are_is, find_specifics, the_name from app.main_classes import MapSquare, Player from app.bat...
# Copyright 2021 Google LLC # # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file or at # https://developers.google.com/open-source/licenses/bsd from .models import Author from django.db import NotSupportedError from django.db.models import Index from django.db.models....
# Copyright 2016 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...
# urllib3/connection.py # Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt) # # This module is part of urllib3 and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php import sys import socket from socket import timeout as SocketTimeout try: # Python 3 fr...
"""Provides device automations for Cover.""" from typing import Any, Dict, List import voluptuous as vol from homeassistant.const import ( ATTR_ENTITY_ID, ATTR_SUPPORTED_FEATURES, CONF_ABOVE, CONF_BELOW, CONF_CONDITION, CONF_DEVICE_ID, CONF_DOMAIN, CONF_ENTITY_ID, CONF_TYPE, ST...
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2018, Simon Dodsley (simon@purestorage.com) # GNU General Public License v3.0+ (see COPYING or # https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1...
import django import logging import yaml import os import datetime import re from itertools import chain from django.core.exceptions import ValidationError from django.db import models from django.apps import apps from django.conf import settings from djangae import environment from djangae.db.utils import get_top_co...
# -*- coding: utf-8 -*- """ Created on Sun Nov 12 16:50:15 2017 @author: Damien """ import random import math import numpy as np from deap import base from deap import creator from deap import tools import recognizer as rc import template_patterns as tp import matplotlib.pyplot as plt POPULATION_SIZE = 50 MAX_GENE...
# Copyright (c) 2006-2013 Regents of the University of Minnesota. # For licensing terms, see the file LICENSE. import copy import os import sys import conf import g from grax.access_level import Access_Level from grax.user import User from gwis.query_filters import Query_Filters from gwis.query_viewport import Query...
from contextlib import ContextDecorator, contextmanager from django.db import ( DEFAULT_DB_ALIAS, DatabaseError, Error, ProgrammingError, connections, ) class TransactionManagementError(ProgrammingError): """Transaction management is used improperly.""" pass def get_connection(using=None): """ ...
#!/usr/bin/env python # encoding: utf-8 # opc.py # # Command-line interface for operations on one or more Open Packaging # Convention (OPC) files, such as .docx, .pptx, and .xlsx files. import argparse import os import sys from opcdiag.controller import OpcController class CommandController(object): """ O...
import Live from _Generic.Devices import * from ableton.v2.control_surface.component import Component as ControlSurfaceComponent from ableton.v2.control_surface.elements import EncoderElement, ButtonElement, DisplayDataSource class Live8DeviceComponent(ControlSurfaceComponent): __doc__ = ' Class representing a de...
# -*- coding: utf-8 -*- from copy import copy from classytags.utils import flatten_context from django.template import Template, Context from django.template.loader import render_to_string from django.utils import six from django.utils.safestring import mark_safe from cms.cache.placeholder import get_placeholder_cach...
""" pynipap - a Python NIPAP client library ======================================= pynipap is a Python client library for the NIPAP IP address planning system. It is structured as a simple ORM. To make it easy to maintain it's quite "thin", passing many arguments straight through to the backen...
import uuid from django.conf import settings from django.db.backends.base.operations import BaseDatabaseOperations from django.utils import timezone from django.utils.encoding import force_text class DatabaseOperations(BaseDatabaseOperations): compiler_module = "django.db.backends.mysql.compiler" # MySQL st...
#!/usr/bin/env python # coding=utf-8 # Author: YAO Matrix (yaoweifeng0301@126.com) from __future__ import absolute_import from __future__ import division from __future__ import print_function import gzip import os import sys import time import datetime import logging import numpy as np from six.moves import urllib ...
import pydotplus import os import math import numpy as np from collections import OrderedDict from itertools import islice from . import util, diagnostics from .distributions import Empirical class Node(): def __init__(self, address_id, variable, weight): self.address_id = address_id self.variabl...
import time as timer import cvxopt as co import numpy as np import pylab as pl import sklearn.metrics as metric import matplotlib.pyplot as plt import scipy.io as io from kernel import Kernel from ocsvm import OCSVM from latent_ocsvm import LatentOCSVM from toydata import ToyData from so_hmm import SOHMM def get_mo...
# encoding: utf-8 """ Tests basic things that generator3 consists of. NOTE: does not work in Jython 2.2 or IronPython 1.x, because pyparsing does not. """ import unittest from generator3 import * M = ModuleRedeclarator import sys IS_CLI = sys.platform == 'cli' VERSION = sys.version_info[:2] # only (major, minor) c...
import datetime import json from psycopg2.extras import DateRange, DateTimeTZRange, NumericRange, Range from django.contrib.postgres import forms, lookups from django.db import models from django.db.models.lookups import PostgresOperatorLookup from .utils import AttributeSetter __all__ = [ 'RangeField', 'Intege...
# Copyright 2018 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...
from __future__ import division, print_function, absolute_import import warnings import numpy as np from numpy import array from numpy.testing import (assert_array_almost_equal, assert_array_equal, run_module_suite, assert_raises, assert_allclose, assert_equal, ass...
from handlers.base import BaseHandler from tornado import gen import momoko import tornado.web import logging logger = logging.getLogger('kisspy.' + __name__) MAX_ADMIN_UID=2 from models import A,B,C,User, Link, Visit, Config from settings import MEDIA_ROOT import os import time import forms class BaseAdminMixin(o...
from django.db import connection from django.db.migrations.executor import MigrationExecutor from django.test import modify_settings, override_settings from .test_base import MigrationTestBase @modify_settings(INSTALLED_APPS={'append': 'migrations2'}) class ExecutorTests(MigrationTestBase): """ Tests the mig...
# =============================================================================== # Copyright 2016 ross # # 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/LICE...
# This file is part of MANTIS OS, Operating System # See http://mantis.cs.colorado.edu/ # # Copyright (C) 2003-2005 University of Colorado, Boulder # # This program is free software; you can redistribute it and/or # modify it under the terms of the mos license (see file LICENSE) import wx, thread import net_model cla...
#!/usr/bin/env python # This code will check the folder and some subfolder assigned by the user to see if the mp-*** listed in a text file are available or not # If available, the selected property at selected concentration and temperature will be reported # If not, N.A would be typed in front of the list # By: Alireza...
#!/usr/bin/env python """ A language-agnostic configuration parser. Currently supports YAML, JSON, INI and TOML serialization formats. """ import collections import contextlib import functools import inspect import json import logging import multiprocessing import os import re import sys import threading import warni...
# Copyright (c) 2014-present PlatformIO <contact@platformio.org> # # 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...
# Copyright 2014 Open Source Robotics Foundation, 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 ...
#!/usr/bin/env python import roslib import rospy import smach import smach_ros import actionlib import time import threading from smach_ros import SimpleActionState from std_msgs.msg import String from std_msgs.msg import Float32MultiArray RECOGNIZER_CALLBACK = None RECOGNIZER_CALLBACK2 = None def handleRecognizerMe...
from __future__ import print_function import codecs import os import fileinput import sys # Import XML parser import xml.etree.ElementTree as ET # Import Postgres connector import psycopg2 as pgsql # Portability try: register_namespace = ET.register_namespace except AttributeError: def register_namespace(prefi...
# # # Copyright (C) 2011, 2012 Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of condition...
"""Tests for the Input slider component.""" # pylint: disable=protected-access import datetime import pytest import voluptuous as vol from homeassistant.components.input_datetime import ( ATTR_DATE, ATTR_DATETIME, ATTR_EDITABLE, ATTR_TIME, ATTR_TIMESTAMP, CONF_HAS_DATE, CONF_HAS_TIME, ...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (C) 2008-2017, Luis Pedro Coelho <luis@luispedro.org> # vim: set ts=4 sts=4 sw=4 expandtab smartindent: # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal ...
import functools import numpy as np import pytest import tensorflow as tf from mock import mock from tests.helper import assert_variables from tests.layers.convolutional.helper import * from tests.layers.core.test_gated import safe_sigmoid from tests.layers.helper import l2_normalize from tfsnippet.layers import * fr...
# coding: utf-8 from __future__ import absolute_import import six from unittest import expectedFailure from django.test import TransactionTestCase from celery_rpc.exceptions import remote_exception_registry from celery_rpc.tests import factories from ..client import Pipe, Client from .utils import SimpleModelTestMixi...
import re import Qualysv2 import pytest import requests from Qualysv2 import is_empty_result, format_and_validate_response, \ parse_two_keys_dict, create_ip_list_dicts, build_args_dict, handle_general_result, \ change_dict_keys, COMMANDS_ARGS_DATA, limit_ip_results, Client, build_host_list_detection_outputs, \...
""" Install a Custom Terraform Version for CloudBolt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Install a user-specified version of Terraform on CloudBolt. This can be set as the Global Default in Admin Miscellaneous Settings. Version Requirements ~~~~~~~~~~~~~~~~~~~~ CloudBolt 9.0 """ import requests import ...
import sys sys.path.append('.') import lxmls.sequences.crf_online as crfo import lxmls.sequences.structured_perceptron as spc import lxmls.readers.pos_corpus as pcc import lxmls.sequences.id_feature as idfc import lxmls.sequences.extended_feature as exfc print "CRF Exercise" corpus = pcc.PostagCorpus() train_seq = c...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright (C) 2017-2020 The Project X-Ray Authors. # # Use of this source code is governed by a ISC-style # license that can be found in the LICENSE file or at # https://opensource.org/licenses/ISC # # SPDX-License-Identifier: ISC """ This script allows to find missin...
import django import warnings from django.conf import settings from django.core.exceptions import FieldError from django.db import models from django.db.models.constants import LOOKUP_SEP from django.db.models.expressions import Expression from django.db.models.fields import FieldDoesNotExist from django.db.models.fie...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2012 Intel Corporation. # 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.apa...
# Copyright 2012 OpenStack Foundation # # 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 l...
#!/usr/bin/env python # # Copyright 2009 Facebook # # 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 a...
"""Handles the instrospection of REST Framework Views and ViewSets.""" from abc import ABCMeta, abstractmethod import re from django.contrib.admindocs.utils import trim_docstring from rest_framework.views import get_view_name, get_view_description def get_resolved_value(obj, attr, default=None): value = getattr...
import logging from six import add_metaclass from abc import ABCMeta, abstractmethod from agentml.parser import Element from agentml.common import attribute from agentml.parser.trigger.response import Response @add_metaclass(ABCMeta) class BaseCondition(object): """ AgentML Base Condition class """ de...
# -*- coding: utf-8 -*- # batteries included import os from copy import deepcopy # thirdparty import requests import xmltodict # this package from utils import normalize_url from exceptions import ConfigFetchError, InvalidAPICallError, InvalidCredentialsError, UnknownArtifactoryRestError ART_REPO_TYPES = ["ALL", "LO...
# coding=utf-8 import math import hashlib import base64 from tornado import web from tornado.web import authenticated from vanellope.handlers import BaseHandler from vanellope import config from vanellope.handlers import Days class WelcomePage(BaseHandler): def get(self): admin = self.user.get_admin_use...
# -*- coding: utf-8 -*- from datetime import date from pathlib import Path from allauth.account.models import EmailAddress from django import forms from django.contrib import messages from djspace.core.models import DISABILITY_CHOICES from djspace.core.models import EMPLOYMENT_CHOICES from djspace.core.models import ...
import numpy as np import sys import sklearn.tree import Context, Argmax, Metrics from Policy import * import string import ContextIterators import Metrics class BanditSim(object): def __init__(self, X, N, K, eps, one_pass=False, reward_noise=0.0): """ Simulate a K-armed contextual bandit game with...
import datetime import re from flask import abort from flask import current_app as app from flask import redirect, request, session, url_for from CTFd.cache import cache from CTFd.constants.teams import TeamAttrs from CTFd.constants.users import UserAttrs from CTFd.models import Fails, Teams, Tracking, Users, db from...
import numpy as np import openmc import pytest def assert_infinite_bb(s): ll, ur = (-s).bounding_box assert np.all(np.isinf(ll)) assert np.all(np.isinf(ur)) ll, ur = (+s).bounding_box assert np.all(np.isinf(ll)) assert np.all(np.isinf(ur)) def test_plane(): s = openmc.Plane(A=1, B=2, C=-...
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import re from dataclasses import dataclass from typing import Any, Dict, Iterable, Optional, Tuple, Union, cast from pants.base.exceptions import DuplicateNameError, MappingError, Unaddr...
#!/usr/bin/env python """ @package mi.dataset.parser.test @file marine-integrations/mi/dataset/parser/test/test_dosta_ln_wfp_sio.py @author Christopher Fortin @brief Test code for a dosta_ln_wfp_sio data parser """ import os import struct import ntplib from nose.plugins.attrib import attr from mi.core.exceptions im...
# coding: utf-8 from __future__ import division, unicode_literals, print_function """ This module implements plotter for DOS and band structure. """ __author__ = "Shyue Ping Ong, Geoffroy Hautier" __copyright__ = "Copyright 2012, The Materials Project" __version__ = "0.1" __maintainer__ = "Shyue Ping Ong" __email__ ...
#!/usr/bin/env python """ Calculate the angular distribution function (ADF) from files. Take an average over atoms in a file or files. Usage: adf.py [options] INFILE [INFILE...] Options: -h, --help Show this help message and exit. -w DEG Width of the angular degree. [default: 1.0] -r RCUT Cutoff rad...
# 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...
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
# -- coding: utf-8 -- from __future__ import absolute_import from bs4 import BeautifulSoup from urlparse import urlparse, urljoin from re import search from chime import repo_functions class ChimeTestClient: ''' Stateful client for Chime Flask test client. ''' def __init__(self, client, test): '''...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # This file is subject to the terms and conditions defined in # file 'LICENSE.md', which is part of this source code package. # import time from kubernetes_py import K8sConfig from kubernetes_py.K8sContainer import K8sContainer from kubernetes_py.K8sExceptions import N...
# Copyright (c) 2009-2012, Geoffrey Biggs # 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...
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe import unittest, json import importlib from frappe.modules import load_doctype_module, get_module_name from frappe.utils import cstr def main(app=None, module=...
import base64 import importlib import json import random import re import string import unicodedata from collections import OrderedDict from django.contrib.auth import get_user_model from django.contrib.sites.models import Site from django.core.exceptions import ImproperlyConfigured from django.core.serializers.json i...
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import absolute_import, division, print_function, unicode_literals import inspect import re import textwrap from builtins import object, range from collecti...
#!/usr/bin/python2.4 # encoding: utf-8 """ scop.py Functions for interacting with the SCOPe database. Created by Shane O'Connor 2015. """ import sys, os import pprint import traceback if __name__ == "__main__": sys.path.insert(0, "../../") from klab.db.mysql import DatabaseInterface from klab import colortext fr...
#!/usr/bin/env python # create a color map based on an image. # vaguely octree-inspired import sys sys.path.append("..") from fract4d import gradient from PIL import ImageFile import gtk class Node: def __init__(self,r,g,b,count): self.branches = [None] * 8 self.r = r self.g = g ...
""" This module contains the 'base' GEOSGeometry object -- all GEOS Geometries inherit from this object. """ # Python, ctypes and types dependencies. import re from ctypes import addressof, byref, c_double, c_size_t # super-class for mutable list behavior from django.contrib.gis.geos.mutable_list import ListMixin #...
import csv import pickle import requests import os import re from elasticsearch import Elasticsearch class MOD(): INDEX_NAME = 'searchable_items_blue' DOC_TYPE = 'searchable_item' go_blacklist = ("GO:0008150", "GO:0003674", "GO:0005575") gene_bkp_filename = "genes_bkp.pickle" go_bkp_filename = "...
import json import pytest from werkzeug.exceptions import NotFound from arrested import ( Endpoint, GetListMixin, GetObjectMixin, ResponseHandler, RequestHandler, ObjectMixin ) from mock import patch from tests.endpoints import CharactersEndpoint, CharacterEndpoint GET = pytest.mark.GET POST = pytest.mark....
# -*-*- encoding: utf-8 -*-*- # # gateway4labs is free software: you can redistribute it and/or modify # it under the terms of the BSD 2-Clause License # gateway4labs is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PA...
import collections try: # pragma: no cover import unittest2 as unittest except ImportError: # pragma: no cover import unittest try: # pragma: no cover from unittest import mock except ImportError: # pragma: no cover import mock import irc.client import nirc.core import nirc.errors def _privmsg...
# coding=utf-8 import logging from django.conf import settings from django.conf.urls import url, include from django.core.exceptions import PermissionDenied from django.http import HttpResponse, Http404 from django.utils.functional import cached_property from django.views.decorators.csrf import csrf_exempt import sys f...
""" Functions for interacting with single game pgn files. """ import os import time from os.path import isfile, join import random as rnd import numpy as np import chess.pgn from pkg_resources import resource_filename import guerilla.data_handler as dh def read_pgn(filename, max_skip=80): """ Given a pgn f...
#from __future__ import print_function from __future__ import division import matplotlib.pyplot as plt import numpy as np import random import math import itertools import pylab from scipy import spatial from matplotlib.path import Path # user defined options disk = False # this parameter defines if we ...
from graphql.core.language.parser import parse from graphql.core.type import GraphQLObjectType, GraphQLField, GraphQLString, GraphQLNonNull, GraphQLSchema from graphql.core.execution import execute sync_error = Exception('sync') non_null_sync_error = Exception('nonNullSync') class ThrowingData(object): def sync(...
# Copyright 2012 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 or ...