gt
stringclasses
1 value
context
stringlengths
2.49k
119k
""" """ from __future__ import absolute_import, unicode_literals from __future__ import print_function from builtins import str from celery import shared_task from django.http import QueryDict from django.db.models import Q from isisdata.models import Citation, CRUDRule, Authority from isisdata.filters import Citation...
# -*- coding: utf-8 -*- """Elements that will constitute the parse tree of a query. You may use these items to build a tree representing a query, or get a tree as the result of parsing a query string. """ from decimal import Decimal _MARKER = object() class Item(object): """Base class for all items that compose...
#!/usr/bin/env python # Copyright 2019 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.0 # # Unless required by applicable law or...
""" A parser for the SEED biochemistry modules that are available on Github at https://github.com/ModelSEED/ModelSEEDDatabase. We have also included them in our repo as a submodule. We parse compounds from the compounds file in Biochemistry. Locations are currently hardcoded because the ModelSeedDirectory does not co...
#!/usr/bin/env python #coding:utf8 import argparse import os import sys import platform import commands import json import textwrap import xml.sax from bs4 import BeautifulSoup def load_translated_po_to_list(filename): msglist = [] file = open(filename, 'r') try: data = file.read() finally: ...
from __future__ import absolute_import from sentry.models import UserEmail, UserOption from sentry.testutils import APITestCase from django.core.urlresolvers import reverse class UserNotificationFineTuningTest(APITestCase): def setUp(self): self.user = self.create_user(email='a@example.com') sel...
# Copyright The PyTorch Lightning team. # # 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 i...
import logging import select from datetime import timedelta, datetime from dateutil.relativedelta import relativedelta from django.db import connections, DatabaseError from django.db import transaction from django.db import models from django.conf import settings from django.utils.timezone import now from six import s...
# -*- coding: utf-8 -*- """ Copyright (c) 2017-2017 Cisco 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.org/licenses/LICENSE-2.0 Unless required by applicable l...
from __future__ import print_function try: from collections.abc import Mapping except ImportError: from collections import Mapping from functools import partial, wraps from itertools import islice, takewhile, dropwhile import operator from pipetools.compat import map, filter, range, dict_items from pipetools....
#!/usr/local/bin/python from io import open import os from PIL import Image import sys # ========================= # The Icon class! class Icon(object): def __init__(self, w, h): self.width = w self.height = h self.image = [0] * (w * h) self.chars = Font("5x6.font") self...
import tkinter as tk from tkinter import filedialog from tkinter import * from tkinter import TOP, E import tkinter.messagebox from Client import menu, repoids, global_username, SHARED_REPO_ID class UploadPage(tk.Frame): def __init__(self, frame, gui): # parameter: frame # parameter: gui ...
from dark.utils import countPrint try: from itertools import zip_longest except ImportError: # zip_longest does not exist in Python 2.7 itertools. We should be able # to get it via from six.moves import zip_longest according to # https://pythonhosted.org/six/index.html?highlight=zip_longest but # th...
#!/usr/bin/env python from __future__ import absolute_import, division, print_function import requests import os import sys """ Purpose: Download dicoms from xnat and place them into a BIDs "like" directory structure. using the xnat rest API to download dicoms. see here for xnat REST API documentation: ...
# -*- coding: utf-8 -*- """The task-based multi-process processing engine.""" import os import shutil import tempfile import redis from plaso.lib import definitions from plaso.multi_process import engine from plaso.storage import factory as storage_factory from plaso.storage.redis import redis_store class TaskMult...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ DLFramework is a framework to consolidate methods used throughout all Indigo plugins with the com.fogbert.indigoPlugin.xxxx bundle identifier. . """ import ast import logging import operator as op import os import platform import sys # import traceback try: impor...
import numpy as np from ..helpers import * import tempfile import pytest from hail.utils.java import FatalError, HailUserError def assert_ndarrays(asserter, exprs_and_expecteds): exprs, expecteds = zip(*exprs_and_expecteds) expr_tuple = hl.tuple(exprs) evaled_exprs = hl.eval(expr_tuple) evaled_and_...
from datetime import date, datetime import calendar import unittest from google.appengine.api.search import GeoPoint from search import errors from search import fields from search import timezone class Base(object): def new_field(self, field_class, **kwargs): f = field_class(**kwargs) f.name =...
"""Support for MQTT JSON lights.""" from contextlib import suppress import json import logging import voluptuous as vol from homeassistant.components.light import ( ATTR_BRIGHTNESS, ATTR_COLOR_MODE, ATTR_COLOR_TEMP, ATTR_EFFECT, ATTR_FLASH, ATTR_HS_COLOR, ATTR_RGB_COLOR, ATTR_RGBW_COLO...
# This file is part of QuTiP: Quantum Toolbox in Python. # # Copyright (c) 2011 and later, Paul D. Nation and Robert J. Johansson. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: ...
"""Regresssion tests for urllib""" import urllib import httplib import unittest from test import test_support import os import mimetools import tempfile import StringIO def hexescape(char): """Escape char as RFC 2396 specifies""" hex_repr = hex(ord(char))[2:].upper() if len(hex_repr) == 1: hex_rep...
# -*- coding: utf-8 -*- # Copyright (c) 2013 Spotify AB # # 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...
# Copyright 2021 DeepMind Technologies Limited. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed...
# -*- coding: utf-8 -*- """ survey - Assessment Data Analysis Tool For more details see the blueprint at: http://eden.sahanafoundation.org/wiki/BluePrint/SurveyTool/ADAT @todo: open template from the dataTables into the section tab not update @todo: in the pages that add a link to a template make...
# Copyright 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 requ...
""" sentry.web.frontend.accounts ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2012 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import import six from django.conf import settings from django.contrib import messages from django.cont...
import subprocess import json import csv import shutil import sys import os import argparse """ This script collects CodeQL queries that are part of code scanning query packs and prints CSV data to stdout that describes which packs contain which queries. Errors are printed to stderr. This script requires that 'git' a...
#! /usr/bin/env python3 """ Utility for building a map using installed Source SDK tools. Call with -h or --help to see usage information. Examples: # Creates/installs/runs .bsp in same dir python buildbsp.py --game tf2 mymap.vmf # Creates/installs .bsp but does not run python buildbsp.py --game css --no-r...
from abc import ABCMeta, abstractmethod from collections import Counter from django.core.exceptions import ValidationError from django.core.validators import validate_email from django.utils.translation import ugettext as _ from corehq.apps.user_importer.helpers import spec_value_to_boolean_or_none from corehq.apps.u...
# -*- coding: utf-8 -*- from __future__ import with_statement from cms.tests.menu_page_viewperm import ViewPermissionTests from django.contrib.auth.models import User class ViewPermissionComplexMenuStaffNodeTests(ViewPermissionTests): """ Test CMS_PUBLIC_FOR=staff group access and menu nodes rendering ...
from direct.distributed.DistributedNodeAI import DistributedNodeAI from direct.distributed.ClockDelta import * from direct.fsm import ClassicFSM, State from direct.fsm import State from direct.fsm import StateData from direct.distributed.ClockDelta import * from direct.interval.IntervalGlobal import * class Distribute...
""" SQLite3 backend for the sqlite3 module in the standard library. """ import decimal import re import warnings from sqlite3 import dbapi2 as Database import pytz from django.core.exceptions import ImproperlyConfigured from django.db import utils from django.db.backends import utils as backend_utils from django.db.b...
"""Image utilities Some general image utilities using PIL. """ import Queue import collections import io import mimetypes import os import struct import threading from gi.repository import ( GLib, GObject, GdkPixbuf, Gtk, Gdk, ) from PIL import Image, ImageFilter mimetypes.init() # Generating a ...
import codecs import hashlib import json import os import re import tempfile import time from ..constants import SETTINGS_FILE, SYNTAX_FILE from ..http import CurlRequestThread from ..http import HttpClientRequestThread from ..message import Request from ..overrideable import OverrideableSettings from ..parse import R...
#!/usr/bin/python2.5 # Copyright 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.0 # # Unless required by applicable law or ...
from itertools import islice, cycle from mock import Mock import struct from threading import Thread import unittest from cassandra import ConsistencyLevel from cassandra.cluster import Cluster from cassandra.metadata import Metadata from cassandra.policies import (RoundRobinPolicy, DCAwareRoundRobinPolicy, ...
#!/usr/bin/env python import argparse import csv import os import shlex import shutil import subprocess import sys import numpy parser = argparse.ArgumentParser(description=''' Part II: Conducting the alignments to the psuedogenomes. Before\ doing this step you will require 1) a bamfile o...
""" mbed SDK Copyright (c) 2011-2013 ARM Limited 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 wr...
from __future__ import unicode_literals from django.contrib.auth.models import User from django.utils import six from djblets.testing.decorators import add_fixtures from djblets.webapi.errors import PERMISSION_DENIED from reviewboard.webapi.resources import resources from reviewboard.webapi.errors import INVALID_USER...
#!/usr/bin/env python """ "**Pycco**" is a Python port of [Docco](http://jashkenas.github.com/docco/): the original quick-and-dirty, hundred-line-long, literate-programming-style documentation generator. It produces HTML that displays your comments alongside your code. Comments are passed through [Markdown](http://dar...
#!/usr/bin/python # # DHT11 Sensor Library - Temperature and Humidity # # Jason A. Cox, @jasonacox # https://github.com/jasonacox/SentryPI import time import RPi.GPIO as GPIO class DHT11Result: 'DHT11 sensor result returned by DHT11.read() method' ERR_NO_ERROR = 0 ERR_MISSING_DATA = 1 ERR_CRC = ...
import xml.dom.minidom import logging import nltk.tag import nltk.tokenize from ternip.timex import add_timex_ids LOGGER = logging.getLogger(__name__) class XmlDocument(object): """ An abstract base class which all XML types can inherit from. This implements almost everything, apart from the conversion ...
import rope.base.pynames from rope.base import ast, utils from rope.refactor.importutils import importinfo from rope.refactor.importutils import actions class ModuleImports(object): def __init__(self, pycore, pymodule, import_filter=None): self.pycore = pycore self.pymodule = pymodule sel...
import os import ujson import shutil import subprocess import logging import random import requests from collections import defaultdict from django.conf import settings from django.utils.timezone import now as timezone_now from django.forms.models import model_to_dict from typing import Any, Dict, List, Optional, Tup...
# Copyright (c) 2008, Aldo Cortesi. All rights reserved. # # 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,...
#!/usr/bin/env python import os import shutil import glob import time import sys import subprocess import string from optparse import OptionParser, make_option SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) PKG_NAME = os.path.basename(SCRIPT_DIR) PARAMETERS = None #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=...
"""Helpers for components that manage entities.""" import asyncio from datetime import timedelta from itertools import chain import logging from homeassistant import config as conf_util from homeassistant.setup import async_prepare_setup_platform from homeassistant.const import ( ATTR_ENTITY_ID, CONF_SCAN_INTE...
try: import builtins builtin_module = builtins except ImportError: import __builtin__ builtin_module = __builtin__ try: from io import StringIO except ImportError: from StringIO import StringIO try: import unittest.mock as mock except ImportError: import mock import pytest import shle...
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Unit tests for rietveld.py.""" import logging import os import ssl import sys import time import traceback import unittest sys...
# -*- coding: utf-8 -*- """ sentry_openproject.plugin ~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2016 by HBEE, 2017 by Versada, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import, unicode_literals import urlparse import six from rest_...
import copy from threading import Event, RLock, Thread from pyflipdot.display import Driver, SegmentedDriverMixin, TextDriverMixin from pyflipdot.lawo import at91PIO, fonts DATATEMPLATE = [0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0,...
#!/usr/bin/env vpython # Copyright 2016 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Run a test. Sample usage: ./run.py \ -a src/xcodebuild/Release-iphoneos/base_unittests.app \ -o /tmp/out \ -p iPhone 5s \ ...
"""Shape Widgets ======================= Defines the GUI components used with :mod:`ceed.shape`. """ import math from typing import Type, List, Tuple, Dict, Optional, Union from kivy.uix.boxlayout import BoxLayout from kivy.uix.label import Label from kivy.properties import BooleanProperty, NumericProperty, StringPro...
#!/usr/bin/python3 """This script generates a family file from a given URL. This script must be invoked with the pwb wrapper script/code entry point. Usage:: pwb generate_family_file.py [<url>] [<name>] [<dointerwiki>] [<verify>] Parameters are optional. They must be given consecutively but may be omitted if th...
import pytest from math import isclose, ceil import numpy as np import pathlib from pytest_dependency import depends import ceed from .examples.shapes import CircleShapeP1, CircleShapeP2 from .examples import assert_image_same, create_test_image from .examples.experiment import create_basic_experiment, run_experiment,...
import os import random import time from io import BytesIO from tempfile import mkdtemp from shutil import rmtree from unittest import mock from urllib.parse import urlparse from twisted.trial import unittest from twisted.internet import defer from scrapy.pipelines.files import FilesPipeline, FSFilesStore, S3FilesSto...
""" Implementation of the overall simulation process, divided into steps. The simulation is split into phases or steps, and the sequence and actions of each step are implemented in the phases module. Each step is implemented as a class with a ``do'' method where the processing for that step takes place. They all in...
# # This file is part of pySMT. # # Copyright 2014 Andrea Micheli and Marco Gario # # 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 ...
#!/usr/bin/env python """This module has tests for the pvl lang functions.""" # Copyright 2019, Ross A. Beyer (rbeyer@seti.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:/...
# -*- coding: utf-8 -*- import logging import httplib as http import math from itertools import islice from flask import request from modularodm import Q from modularodm.exceptions import ModularOdmException, ValidationValueError from framework import status from framework.utils import iso8601format from framework.mo...
# Copyright (c) 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
#!/usr/bin/python # AdaptML import os import sys import pdb import time import random from scipy.io import write_array from scipy.io import read_array from numpy.linalg import * from numpy.core import * from numpy.lib import * from numpy import * import multitree import ML start_time = time.time() sys.setrecursionl...
# Predicting Continuous Target Variable with Regression Analysis # Explore the Housing Dataset import pandas as pd df = pd.read_csv('https://archive.ics.uci.edu/ml/machine-learning-databases/housing/housing.data', header=None, sep='\s+') df.columns = ['CRIM', 'ZN', 'INDUS', 'CHAS', 'NOX', 'RM', 'AGE', 'DIS', 'RAD', \ ...
# 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 applicab...
from __future__ import absolute_import from datetime import datetime from django.core.exceptions import ObjectDoesNotExist from django.db.models.fields import FieldDoesNotExist from django.test import TestCase, skipIfDBFeature, skipUnlessDBFeature from .models import Article class ModelTest(TestCase): def tes...
# Copyright (c) 2005 The Regents of The University of Michigan # Copyright (c) 2010 Advanced Micro Devices, 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 mu...
import asyncio import collections import logging import os import re import sys import time import warnings from contextlib import contextmanager from functools import wraps from io import StringIO from itertools import chain from types import SimpleNamespace from unittest import TestCase, skipIf, skipUnless from xml.d...
# Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University # Copyright (c) 2011, 2012 Open Networking Foundation # Copyright (c) 2012, 2013 Big Switch Networks, Inc. # See the file LICENSE.pyloxi which should have been included in the source distribution # Automatically generated by LOXI from ...
""" ltdexec.processor.validator =========================== Validator classes verify that the raw source code or abstract syntax tree is permissible before it is finally compiled to Python byte code. They signal errors through exceptions, which may be used to provide an error message. """ import ast import re from...
# Copyright (c) 2013 Mirantis, 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 requir...
# # Copyright 2013 Quantopian, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
import datetime import errno import json import os import shutil import stat import pytest import pytz import stix2 from stix2.datastore.filesystem import ( AuthSet, _find_search_optimizations, _get_matching_dir_entries, _timestamp2filename, ) from stix2.exceptions import STIXError from .constants import ( ...
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Shards a given test suite and runs the shards in parallel. ShardingSupervisor is called to process the command line options and...
from __future__ import division from math import sqrt, cos, sin, acos, degrees, radians, log from collections import MutableSequence # This file contains classes for the different types of SVG path segments as # well as a Path object that contains a sequence of path segments. MIN_DEPTH = 5 ERROR = 1e-12 def segmen...
from lxml import etree import mappers import re class LinkedInXMLParser(object): def __init__(self, content): self.routing = { 'network': self.__parse_network_updates, 'person': self.__parse_personal_profile, 'job-poster': self.__parse_personal_profile, 'upda...
import logging from collections import Counter from copy import copy from pathlib import Path from typing import Iterable, NamedTuple, Union from fs import path as fspath from fs.base import FS from fs.errors import NoSysPath from fs.walk import Walker from rich.console import Console from . import config, console fr...
#!/usr/bin/env python #----------------------------------------------------------------------------- # Copyright (c) 2013, The BiPy Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. #--------------------------...
import json import logging from django.conf import settings from django.contrib.auth.views import logout as auth_logout from django.contrib import messages from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User from django.core.paginator import Paginator, EmptyPage, PageN...
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. import os import re from monty.io import zopen from monty.dev import requires from monty.tempfile import ScratchDir from pymatgen.core.structure import Structure, Molecule from pymatgen.core.lattice import L...
from __future__ import absolute_import import time from django.core.exceptions import ImproperlyConfigured from django.http import HttpResponse from django.test import TestCase, RequestFactory from django.utils import unittest from django.views.generic import View, TemplateView, RedirectView from . import views cla...
#!/usr/bin/env python import roslib,rospy,sys,cv2,time import numpy as np roslib.load_manifest('lane_follower') # from __future__ import print_function from std_msgs.msg import Int32 from sensor_msgs.msg import Image from cv_bridge import CvBridge, CvBridgeError bridge = CvBridge() pub = rospy.Publisher('lane_detectio...
# -*- coding: utf-8 -*- import httplib as http from flask import request from modularodm.exceptions import ValidationError, ValidationValueError from framework import forms from framework import status from framework.auth import cas from framework.auth import User, get_user from framework.auth.core import generate_c...
from pydevd_comm import CMD_SET_BREAK, CMD_ADD_EXCEPTION_BREAK import inspect from pydevd_constants import STATE_SUSPEND, GetThreadId, DictContains, DictIterItems from pydevd_file_utils import NormFileToServer, GetFileNameAndBaseFromFile from pydevd_breakpoints import LineBreakpoint, get_exception_name import pydevd_va...
import logging from rest_framework import decorators, permissions, status from rest_framework.renderers import JSONPRenderer, JSONRenderer, BrowsableAPIRenderer from rest_framework.response import Response import requests from builds.constants import LATEST from builds.models import Version from djangome import views...
#!/usr/bin/env python # pylint: disable=too-many-lines ''' Ansible module ''' # ___ ___ _ _ ___ ___ _ _____ ___ ___ # / __| __| \| | __| _ \ /_\_ _| __| \ # | (_ | _|| .` | _|| / / _ \| | | _|| |) | # \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____ # | \ / _ \ | \| |/ _ \_ _| | __| \_ _...
# $Id: VTKBlender.py,v 1.19 2008-07-03 15:13:21 cwant Exp $ # # Copyright (c) 2005, Chris Want, Research Support Group, # AICT, University of Alberta. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met...
""" The DoInterestManager keeps track of which parent/zones that we currently have interest in. When you want to "look" into a zone you add an interest to that zone. When you want to get rid of, or ignore, the objects in that zone, remove interest in that zone. p.s. A great deal of this code is just code moved from ...
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. # # pylint: disable=no-member, chained-comparison, unnecessary-comprehension, not-callable """ This module provides objects to inspect the status of the Abinit tasks at run-time. by extracting information from t...
from __future__ import print_function from SimpleCV.base import * import scipy.signal as sps import scipy.optimize as spo import numpy as np import copy, operator class LineScan(list): """ **SUMMARY** A line scan is a one dimensional signal pulled from the intensity of a series of a pixels in an ima...
#!/usr/bin/env python # Copyright 2018-2019 The PySCF Developers. 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 # # U...
import re import pytest from django.http import HttpRequest, HttpResponse from django.test import Client from helusers.jwt import JWT from helusers.models import OIDCBackChannelLogoutEvent from .conftest import AUDIENCE, encoded_jwt_factory, ISSUER1, unix_timestamp_now from .keys import rsa_key2 _NOT_PROVIDED = ob...
# Wrapper module for _socket, providing some additional facilities # implemented in Python. """\ This module provides socket operations and some related functions. On Unix, it supports IP (Internet Protocol) and Unix domain sockets. On other systems, it only supports IP. Functions specific for a socket are available a...
"""Support for Waze travel time sensor.""" from datetime import timedelta import logging import re import WazeRouteCalculator import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import ( ATTR_ATTRIBUTION, ATTR_LATITUDE, ATTR_LONGITUDE, CONF_NAM...
# 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 # distributed under t...
""" Optimise the combination of profile and summation intensity values. """ from __future__ import annotations import logging import boost_adaptbx.boost.python from cctbx import crystal, miller from dials.algorithms.scaling.scaling_utilities import DialsMergingStatisticsError from dials.array_family import flex fro...
"""More comprehensive traceback formatting for Python scripts. To enable this module, do: import cgitb; cgitb.enable() at the top of your script. The optional arguments to enable() are: display - if true, tracebacks are displayed in the web browser logdir - if set, tracebacks are written to fi...
import unittest from bet_calculator.bet_calculator import Bet_Calculator from decimal import * class Bet_Test_Case(unittest.TestCase): """Test the Bet_Calculator class""" def setUp(self): self.bet_calculator = Bet_Calculator() def test_if_is_calculating_that_odds_will_profit(self): """ ...
import sys import libbtaps import time def get_line(): line = raw_input('> ') if line.lower() in ('quit', 'exit', 'kill'): exit() return line # Sort day dictionary in Monday-Sunday order def print_dic_sorted(dic): order = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] for key in sorte...
#!/usr/bin/env python # # Copyright 2015 MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
# 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 ...