gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
from kivy.tests.common import GraphicUnitTest
from kivy.lang import Builder
from kivy.base import EventLoop
from kivy.weakproxy import WeakProxy
from kivy.uix.dropdown import DropDown
from kivy.input.motionevent import MotionEvent
KV = '''
# +/- copied from ActionBar example + edited for the test
FloatLayout:
Ac... | |
from django.db import models
import ConfigParser
from datetime import datetime
import os
INVALID_CHARACTERS = ['>','<','&','$','!','\\','\/','\'','\"','(',')','[',']','{','}']
ERROR_MESSAGE_INVALID_TEXT = "Error: search query text cannot contain any of the characters: %s" % INVALID_CHARACTERS
ERROR_MESSAGE_INVALID_DA... | |
#
# Copyright (c) 2010 Mikhail Gusarov
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, d... | |
# Copyright 2015 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... | |
"""
This file contains the FactoryLoader class that is used to dynamically
create Runstat Table and View objects from a <dict> of data. The <dict> can
originate from any kind of source: YAML, JSON, program. For examples of YAML
refer to the .yml files in this jnpr.junos.op directory.
"""
# stdlib
from copy import dee... | |
'''
Test suite for pimento
'''
# [ Imports ]
# [ - Python ]
import inspect
import sys
# [ - Third Party ]
import pexpect
import pytest
# [ - Project ]
import pimento
# [ Helpers ]
def expect_color_menu_prompt(process):
# expect the following lines to be in the prompt, in this order.
process.expect_exact('wh... | |
# 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 ... | |
import sys
import datetime
from pprint import pprint, pformat
from django.core.management.base import BaseCommand, CommandError
from fo2.connections import db_cursor, db_cursor_so
import base.models
from utils.functions.models import rows_to_dict_list_lower
import lotes.models as models
class Command(BaseCommand)... | |
"""
.. todo::
WRITEME
"""
import logging
import warnings
from .general import is_iterable, contains_nan, contains_inf, isfinite
import theano
from theano.compat.six.moves import input, zip as izip
# Delay import of pylearn2.config.yaml_parse and pylearn2.datasets.control
# to avoid circular imports
yaml_parse = N... | |
import logging
from django.http import Http404, HttpResponseRedirect, HttpResponseBadRequest
from django.core.urlresolvers import reverse, reverse_lazy
from django.contrib import messages
from django.contrib.auth import login
from django.db.models import get_model
from django.utils.translation import ugettext as _
fr... | |
# coding: utf-8
# coding: utf-8
import numpy as np
from numpy.core.numeric import array
from sklearn.metrics import pairwise
from collections import OrderedDict
from scipy.linalg import eig
from scipy import interpolate as ip
from pyspark.ml.feature import PCA as pcaml
from pyspark.ml.linalg import Vectors as mlve... | |
import os
import itertools as it
import numpy as np
import inspect
threshold = 1.*10**-6
#Qhull communicator
def qhull_faces(vertices):
#open connection
child_in, child_out = os.popen2("qhull i")
#print dimensions and number of points
line = str(len(vertices[0]))+" "+str(len(vertices))
child_in.write(line+"\n")
... | |
#!/usr/bin/env python
"""
A terminal browser, similar to less(1) for testing printable width of unicode.
This displays the full range of unicode points for 1 or 2-character wide
ideograms, with pipes ('|') that should always align for any terminal that
supports utf-8.
Usage:
./bin/wcwidth-browser.py [--wide=<n>]
... | |
#!/usr/bin/python
# Copyright 2008-2010 WebDriver committers
# Copyright 2008-2010 Google 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... | |
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
#!/usr/bin/env python
# Corey Brune - Oct 2016
#This script starts or stops a VDB
#requirements
#pip install docopt delphixpy
#The below doc follows the POSIX compliant standards and allows us to use
#this doc to also define our arguments for the script.
"""List all VDBs or Start, stop, enable, disable a VDB
Usage:
... | |
from datetime import timedelta
from django.conf import settings
from django.db.models import Q, Count
from django.core.exceptions import ObjectDoesNotExist
from django.utils import timezone
from celery.decorators import task
from core.query import (
only_current, only_current_source,
source_in_range, inactiv... | |
import os
import unittest
from django.conf import settings
from django.test import TransactionTestCase
from django_digest.test import DigestAuth
from onadata.apps.api.tests.viewsets.test_abstract_viewset import\
TestAbstractViewSet
from onadata.apps.api.viewsets.xform_list_api import XFormListApi
from onadata.lib... | |
import os
import stat
from datetime import datetime, date
from collections import Mapping
from itertools import chain
from dateutil.parser import parse as parse_date
from pulsar.api import Unsupported
from pulsar.utils.slugify import slugify
from pulsar.utils.structures import mapping_iterator
from lux.utils.date im... | |
#:coding=utf-8:
"""
A kombu transport for App Engine's
Pull Task Queue API.
"""
import logging
import socket
import base64
from Queue import Empty
from collections import deque, defaultdict
import httplib2
import anyjson as json
from kombu.transport import virtual
from kombu.utils import cached_property
from kombu... | |
#!/usr/bin/env python
#
# Use the raw transactions API to spend monetas received on particular addresses,
# and send any change back to that same address.
#
# Example usage:
# spendfrom.py # Lists available funds
# spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00
#
# Assumes it will talk to a monetad or Monet... | |
# 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... | |
# Copyright 2011 James McCauley
#
# This file is part of POX.
#
# POX is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# POX is distri... | |
"""Test Mikrotik setup process."""
from datetime import timedelta
from unittest.mock import patch
import librouteros
import pytest
from homeassistant import data_entry_flow
from homeassistant.components import mikrotik
from homeassistant.const import (
CONF_HOST,
CONF_NAME,
CONF_PASSWORD,
CONF_PORT,
... | |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from oscar.core.compat import AUTH_USER_MODEL, AUTH_USER_MODEL_NAME
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding uni... | |
# -*- test-case-name: vumi.persist.tests.test_model -*-
"""Base classes for Vumi persistence models."""
from functools import wraps
import urllib
from vumi.errors import VumiError
from vumi.persist.fields import Field, FieldDescriptor, ValidationError
class ModelMigrationError(VumiError):
pass
class VumiRiak... | |
# Copyright (c) 2014 Clinton Knight. All rights reserved.
# Copyright (c) 2015 Tom Barron. All rights reserved.
# 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 ... | |
# Copyright 2014 the National Renewable Energy Laboratory
# 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... | |
"""Append module search paths for third-party packages to sys.path.
****************************************************************
* This module is automatically imported during initialization. *
****************************************************************
In earlier versions of Python (up to 1.5a3), scripts or... | |
#convert a centerlines object to one that can segmented into sections
#currently able to create lines, but not poly lines yet
import vtk
import networkx as nx
import sys
import copy
import os
from writeNodesEdges import writeObjects, writePolyLine
file_dir = "/home/sansomk/caseFiles/ultrasound/tcd/case_debaun/vmtk... | |
# 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 ... | |
# Copyright 2015 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 a... | |
"""
Django settings for unwashproject.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, .... | |
#!/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... | |
# -*- coding: utf-8 -*-
""" Sahana-Eden GUI Layouts (HTML Renderers)
@copyright: 2012 (c) Sahana Software Foundation
@license: MIT
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 Soft... | |
"""Utility classes and functions for the apps."""
import logging
import os
from struct import pack
from pydicom import dcmread
from pydicom.datadict import tag_for_keyword, repeater_has_keyword, get_entry
from pydicom.dataset import Dataset
from pydicom.filewriter import write_file_meta_info
from pydicom.tag import T... | |
#!/usr/bin/env python3
# Copyright (c) 2014 Pawel Rozlach, Brainly.com sp. z o.o.
#
# 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 re... | |
# ----------------------------------------------------------------------------
# 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... | |
import os
import random
import shutil
import zipfile
from datetime import datetime
from inspect import isclass
from django.db import models
from django.db.models.signals import post_init
from django.conf import settings
from django.contrib.auth.models import User
from django.core.files.base import ContentFile
from dj... | |
"""Trains upconvnet."""
import os
os.environ['CUDA_VISIBLE_DEVICES'] = '-1'
import argparse
import keras
from keras import backend as K
from gewittergefahr.gg_utils import time_conversion
from gewittergefahr.gg_utils import file_system_utils
from gewittergefahr.deep_learning import cnn
from gewittergefahr.deep_learnin... | |
# -*- coding: utf-8 -*-
# Copyright 2022 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... | |
# -*- coding: utf-8 -*-
#
# PyWindows documentation build configuration file, created by
# sphinx-quickstart on Tue Apr 07 11:39:41 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
#... | |
# -*- coding: utf-8 -*-
#
# Copyright 2018 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | |
# Copyright (c) 2012 NetApp, 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... | |
# definition theano.scalar op that have their python implementation taked from scipy
# as scipy is not always available, we treat them separatly
import numpy
import theano
from theano.scalar.basic import (UnaryScalarOp, BinaryScalarOp,
exp, upgrade_to_float,
... | |
"""Tests for the Home Assistant auth module."""
from datetime import timedelta
from unittest.mock import Mock, patch
import jwt
import pytest
import voluptuous as vol
from homeassistant import auth, data_entry_flow
from homeassistant.auth import (
InvalidAuthError,
auth_store,
const as auth_const,
mod... | |
# Copyright 2017-present Open Networking 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 law or agr... | |
"""
Run x12/x13-arima specs in a subprocess from Python and curry results back
into python.
Notes
-----
Many of the functions are called x12. However, they are also intended to work
for x13. If this is not the case, it's a bug.
"""
from __future__ import print_function
import os
import subprocess
import tempfile
impor... | |
import os
import shutil
import sys
import tempfile
import pytest
from mock import Mock, mock_open, patch
from pip._vendor import pkg_resources
from pip._vendor.packaging.markers import Marker
from pip._vendor.packaging.requirements import Requirement
from pip._internal.commands.install import InstallCommand
from pip.... | |
"""
This module contains QObjects that perform specific, long-running tasks that
are intended to be moved to a non-GUI thread.
The QObject implementations below are designed to be leveraged by a QThread
via the `moveToThread()` method:
>>> thread = QThread()
>>> worker = FooWorker()
>>>
>>> thread.started.connect(wor... | |
# -*- coding: utf-8 -*-
# Copyright 2022 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... | |
# Miscellaneous bits of experimental code.
# Copyright (c) 2011-2013 Mick Thomure
# All rights reserved.
#
# Please see the file LICENSE.txt in this distribution for usage terms.
# TODO: we should probably move ExtractHistogramFeatures() to .utils, and rename
# .misc to .analysis
import math
import numpy as np
from ... | |
import math
import warnings
from cryptography.exceptions import InvalidSignature, InvalidTag
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.bindings.openssl.binding import Binding
from cryptography.hazmat.primitives import hashes, hmac, serialization
from cryptography.hazmat.primitiv... | |
# -*- coding: utf-8 -*-
"""
Functionals tests for active tag-matcher (mod:`behave.tag_matcher`).
"""
from __future__ import absolute_import, print_function
import pytest
from behave.tag_matcher import ActiveTagMatcher
# =============================================================================
# TEST DATA:
# =====... | |
# -*- coding: utf-8 -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""The fix module provides classes for interfacing with the `FSL FIX
<http://fsl.fmrib.ox.ac.uk/fsl/fslwiki/FIX/index.html>` command line tools.
This was written to work with FSL ve... | |
import argparse
import glob
import itertools
import json
import os
import sys
assert sys.version_info >= (3, 3, 0), "Python version 3.3 or later required!"
import matplotlib.pyplot as plt
COLORS = ['b', 'g', 'r', 'c', 'm', 'y',
'gray', 'aquamarine', 'brown', 'gold', 'maroon', 'olive', 'orange', 'pink', 'p... | |
import os
import yaml
import rospy
from geometry_msgs.msg import Vector3, Quaternion, Transform, TransformStamped
class HandeyeCalibration(object):
"""
Stores parameters and transformation of a hand-eye calibration for publishing.
"""
DIRECTORY = os.path.expanduser('~/.ros/easy_handeye')
"""Defaul... | |
#$Id$
class EstimateSetting:
"""This class is used to create object for estimate settings."""
def __init__(self):
"""Initialize parameters for estimate settings."""
self.auto_generate = None
self.prefix_string = ""
self.start_at = 0
self.next_number = ""
self.qua... | |
import mock
from nose.tools import *
from framework.auth.core import Auth
from framework.exceptions import PermissionsError
from website import settings
from website.addons.base import AddonConfig
from website.addons.base import AddonOAuthNodeSettingsBase
from website.addons.base import AddonOAuthUserSettingsBase
fro... | |
"""Test Z-Wave lights."""
from unittest.mock import MagicMock, patch
from homeassistant.components import zwave
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_COLOR_TEMP,
ATTR_RGB_COLOR,
ATTR_RGBW_COLOR,
ATTR_TRANSITION,
COLOR_MODE_BRIGHTNESS,
COLOR_MODE_COLOR_TEMP,
... | |
from shapes import PolygonInterpolator, normals_offset, midpoints
import matplotlib.pyplot as plt
import shapely.geometry as geom
import numpy as np
import matplotlib.animation as animation
import scipy.spatial as spatial
from copy import copy
#p1s = geom.box(0, 0, 1, 1)
#p2s = geom.box(-1, -1, 2, 2)
p1s = geom.Pol... | |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2019 Edgewall Software
# 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 http://trac.edgewall.org/wiki/TracLicense.
#
# This software consi... | |
# -*- coding: utf-8 -*-
"""
Created on Thu Dec 17 11:50:47 2015
@author: teichman
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os.path
import time
import numpy as np
import gzip
import os
import re
import sys
import zipfile
import random
i... | |
#!/usr/bin/env python
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# ---------------------------------------------... | |
#!/usr/bin/env python
"""html2text: Turn HTML into equivalent Markdown-structured text."""
__version__ = "3.200.3"
__author__ = "Aaron Swartz (me@aaronsw.com)"
__copyright__ = "(C) 2004-2008 Aaron Swartz. GNU GPL 3."
__contributors__ = ["Martin 'Joey' Schulze", "Ricardo Reyes", "Kevin Jay North"]
# TODO:
# Support d... | |
"""
Created on Sun Apr 12 20:20:48 2015
@author: Ziang
"""
import time
import numpy as np
from math import exp, sqrt, pi
from numpy.random import normal, choice
from scipy import linalg
from matplotlib import pyplot as plt
from GPSVI.util.inverse import cho_inverse
from GPSVI.util.kernel import compute_kernel
from GPS... | |
# -*- coding: utf-8 -*-
from django.shortcuts import get_object_or_404, render, redirect
from django.template import RequestContext
from django.contrib.admin.views.decorators import staff_member_required
from django.contrib.auth.decorators import login_required
from django.http import HttpResponseRedirect
from django.... | |
import datetime
import pytest
from _pytest.monkeypatch import MonkeyPatch
import fiscalyear
from fiscalyear import (
FiscalDate,
FiscalDateTime,
FiscalDay,
FiscalMonth,
FiscalQuarter,
FiscalYear,
)
# Fiscal calendars to test
US_FEDERAL = ("previous", 10, 1)
UK_PERSONAL = ("same", 4, 6)
clas... | |
# Copyright 2014 Datera
# 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 applic... | |
# Copyright 2012 IBM Corp.
#
# 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 t... | |
# Copyright (c) 2013-2019 Philip Hane
# 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 conditions and... | |
# -*- coding: utf-8 -*-
'''
RPM Package builder system
.. versionadded:: 2015.8.0
This system allows for all of the components to build rpms safely in chrooted
environments. This also provides a function to generate yum repositories
This module impliments the pkgbuild interface
'''
# Import python libs
from __futur... | |
import argparse
import logging
import os
import stat
import threading
import time
from errno import EIO, ENOENT
from fuse import FUSE, FuseOSError, LoggingMixIn, Operations
from fsspec import __version__
from fsspec.core import url_to_fs
logger = logging.getLogger("fsspec.fuse")
class FUSEr(Operations):
def __... | |
from bpy.props import EnumProperty, StringProperty, IntProperty, FloatProperty
from ..rman_render import RmanRender
from .. import rman_bl_nodes
from .. import rfb_icons
from ..rfb_utils.prefs_utils import get_pref
from ..rfb_utils import display_utils
from bpy.types import Menu
import bpy
import math
import gpu
from ... | |
import six
from django.core.exceptions import ObjectDoesNotExist
from django.views import generic
from django.db.models import Q
from django.http import HttpResponseRedirect, Http404
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _... | |
# Copyright 2015 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 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 compliance with the License. You may obtain
# a ... | |
# Copyright 2015 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""EC-3PO EC Interpreter
interpreter provides the interpretation layer between the EC UART and the user.
It receives commands through its command pipe, f... | |
# -*- coding: utf-8 -*-
"""
Chipotle currently uses 5 3rd level domains: .com, .ca, .fr, .de and .co.uk
and we are crawling all 5
to exclude any, just comment out like this
#chipotle_urls.extend(build_links("ca", "ca", states_ca))
It appears the only way to get locations is to search by radius (in miles) and address(r... | |
#!/usr/bin/env python
"""
forcing.py
Functions for generating ROMS forcing files (atmosphere, tides,
rivers, etc.)
Written by Brian Powell on 02/09/16
Copyright (c)2010--2021 University of Hawaii under the MIT-License.
"""
import numpy as np
from datetime import datetime
import netCDF4
import seapy
from col... | |
#!/usr/bin/python3.6
import sys
import argparse
import numpy as np
from PIL import Image
import requests
from io import BytesIO
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import os
import time
import json
from keras.preprocessing import image
from keras.applications.inception_v3 import prep... | |
#
# 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... | |
import vtk
#import numpy as np
import os
#import matplotlib.pyplot as plt
# define the mesh to slice
mesh = vtk.vtkXMLPolyDataReader()
file_path_mesh = "/home/ksansom/caseFiles/mesh_test"
file_name = "DSI020CALb_vmtk_decimate_trim_ext2_remesh_test.vtp"
file_path = os.path.join(file_path_mesh, file_name)
split_ext = o... | |
#!/bin/env python
# Copyright (c) 2016 PaddlePaddle 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 ... | |
__author__ = 'maartenbreddels'
import os
import numpy as np
import logging
import vaex
import vaex.utils
import vaex.execution
import vaex.export
import vaex.hdf5.dataset
max_length = int(1e5)
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
try:
import h5py
except:
if not on_rtd:
raise
logger ... | |
# -----------------------------------------------------------------------------
#
# Copyright (C) 2021 CERN & University of Surrey for the benefit of the
# BioDynaMo collaboration. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance w... | |
import sys
import os
import threading
import socket
import time
import subprocess
import re
CHILDTIMEOUT = 60
class EOFException(Exception): pass
class LineReader:
buf = ''
def __init__(self, socket, CANCELAT):
self.s = socket
self.CANCELAT = CANCELAT
def readline(self):
while Tr... | |
# -*- coding: utf-8 -*-
import os
import json
import errno
import pickle
import gzip
import numpy as np
import networkx as nx
import yaml
import cv2
import io
class DataSet:
"""
Dataset representing directory with images, extracted , feature descriptors (SURF, SIFT), etc.
Methods to retrieve *base direc... | |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | |
"This module provides various low-level inter-Actor transport implementations."
from datetime import timedelta
from thespian.system.timing import ExpirationTimer, currentTime
from thespian.system.utilis import thesplog
import logging
DEFAULT_MAX_TRANSMIT_PERIOD = timedelta(minutes=5)
TRANSMIT_RETRY_PERIOD = ti... | |
# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2014 TrilioData, Inc
# Copyright (c) 2015 EMC 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
# ... | |
# encoding: utf-8
import mock
import unittest
from nose.tools import * # noqa
from tests.base import OsfTestCase
from tests.factories import ProjectFactory
from website.addons.osfstorage.tests import factories
from website.addons.osfstorage.tests.utils import StorageTestCase
import datetime
from modularodm import... | |
"""
This file is part of Python TripleSec - a Python implementation of TripleSec
Released under The BSD 3-Clause License
Copyright (c) 2013 Keybase
These are the definitions of the ciphers and the MACs.
"""
import binascii
import scrypt
import struct
import hmac
import hashlib
import sha3
import twofish
import salsa... | |
import random
import trigger
from animation import animate_point
import colors
from compositecore import Leaf
import gametime
from graphic import GraphicChar
import icon
import messenger
from statusflags import StatusFlags
# TODO: Idea replace effect types with spoofchildren and add time to live to spoof children.
... | |
"""DGX Remote Shell is a program that allows remote access to the DGX shell for
debugging and information gathering.
The MIT License (MIT)
Copyright (c) 2015 Jim Maciejewski
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software... | |
#
#
#
from BCDataStream import *
from enumeration import Enumeration
from base58 import public_key_to_bc_address, hash_160_to_bc_address
import logging
import socket
import time
from util import short_hex, long_hex
import struct
def parse_CAddress(vds):
d = {}
d['nVersion'] = vds.read_int32()
d['nTime'] = vds.r... | |
# 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 (t... | |
from __future__ import annotations
import sys
import typing
from typing import Any
from typing import Callable # noqa
from typing import cast
from typing import Dict
from typing import ForwardRef
from typing import Generic
from typing import overload
from typing import Type
from typing import TypeVar
from typing impo... | |
from ..errors import InvalidVersion
from ..utils import check_resource, minimum_version
from ..utils import version_lt
from .. import utils
class NetworkApiMixin(object):
@minimum_version('1.21')
def networks(self, names=None, ids=None, filters=None):
"""
List networks. Similar to the ``docker... | |
"""Core features of mapache."""
# -*- coding: utf-8 -*-
import numpy as np
import matplotlib.pylab as plt
import matplotlib
from sklearn.cluster import KMeans
from sklearn.utils import shuffle
from PIL import Image
import base64
from io import BytesIO
import urllib.request
import warnings
class Party:
"""Im... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.