gt
stringclasses
1 value
context
stringlengths
2.49k
119k
# -*- coding: utf-8 -*- import mock import datetime as dt from nose.tools import * # noqa (PEP8 asserts) import pytest from osf_tests.factories import ( ProjectFactory, UserFactory, RegistrationFactory, NodeFactory, CollectionFactory, ) from osf.models import NodeRelation from tests.base import O...
"""Support for statistics for sensor values.""" from collections import deque import logging import statistics import voluptuous as vol from homeassistant.components.recorder.models import States from homeassistant.components.recorder.util import execute, session_scope from homeassistant.components.sensor import PLAT...
# coding=utf-8 # Copyright 2021 The Reach ML Authors. # # 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 ...
"""A Scheme interpreter and its read-eval-print loop.""" from scheme_primitives import * from scheme_reader import * from ucb import main, trace ############## # Eval/Apply # ############## def scheme_eval(expr, env, _=None): # Optional third argument is ignored """Evaluate Scheme expression EXPR in environment ...
########################################################################## # # Copyright (c) 2012, John Haddon. All rights reserved. # Copyright (c) 2013, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that ...
# -*- coding: utf-8 -*- """ Sahana Eden Security Model @copyright: 2012-14 (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 Software withou...
# -*- 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 class Migration(SchemaMigration): def forwards(self, orm): # Deleting field 'ProductImage.rating' db.delete_column(u'catalog_product...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Author Pradeep Jairamani; github.com/pradeepjairamani import socket import socks import time import json import threading import string import requests import random import os from core.alert import * from core.targets import target_type from core.targets import target_t...
import getpass, json, random, os, sys import h2o_args from h2o_objects import RemoteHost # some circular import issues, so go with the full import import h2o_bc # write_flatfile, get_base_port import h2o2 as h2o # build_cloud from h2o_test import verboseprint, clean_sandbox, find_file def find_config(base): f =...
# Copyright 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 required b...
# 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...
# coding=utf-8 # 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 # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # #...
# Copyright (c) 2012-2013 Mitch Garnaat http://garnaat.org/ # Copyright 2012-2014 Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http...
from __future__ import absolute_import, division, print_function import warnings import re import pytest from _pytest.recwarn import WarningsRecorder def test_recwarn_functional(testdir): testdir.makepyfile( """ import warnings def test_method(recwarn): warnings.warn("hello") ...
""" Cross Site Request Forgery Middleware. This module provides a middleware that implements protection against request forgeries from other sites. """ import itertools import re import random from django.conf import settings from django.core.urlresolvers import get_callable from django.utils.cache import patch_vary...
# This file is part of Androguard. # # Copyright (c) 2012 Geoffroy Gueguen <geoffroy.gueguen@gmail.com> # All Rights Reserved. # # Androguard is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either versi...
""" This version of nmrmath features speed-optimized hamiltonian, simsignals, and transition_matrix functions. Up to at least 8 spins, the new non-sparse Hamilton code is about 10x faster. The overall performance is dramatically better than the original code. """ import numpy as np from math import sqrt from scipy.li...
# Copyright (c) 2012 The Native Client Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import glob import optparse import re def ParseTest(lines): r"""Parses section-based test. Args: lines: list of \n-terminated strings. ...
# Copyright (c) 2017 The Johns Hopkins University/Applied Physics Laboratory # 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/LICEN...
# Copyright 2016 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 agreed to in writing, ...
import netaddr def rdns_domain(network): """Transform :py:class:`netaddr.IPNetwork` object to rDNS zone name""" if network.prefixlen == 0: return "ip6.arpa" if network.version == 6 else "in-addr.arpa" if network.version == 4: return ".".join(map(str, reversed( network.ip.words[...
import weakref from AppKit import NSView, NSSegmentStyleSmallSquare, NSSmallSquareBezelStyle import vanilla from defconAppKit.controls.glyphCellView import DefconAppKitGlyphCellNSView, GlyphInformationPopUpWindow, GlyphCellItem from defconAppKit.controls.fontInfoView import GradientButtonBar class DefconAppKitGlyphCo...
#!/usr/bin/env python # Copyright (c) 2011 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. """Extracts registration forms from the corresponding HTML files. Used for extracting forms within HTML files. This script is use...
""" Developed by niphlod@gmail.com """ import redis from redis.exceptions import ConnectionError from gluon import current from gluon.storage import Storage import cPickle as pickle import time import re import logging import thread logger = logging.getLogger("web2py.session.redis") locker = thread.allocate_lock() ...
import unittest try: from unittest.mock import patch, MagicMock # Python 3.4 and later getattr(MagicMock, 'assert_called_once') # Python 3.6 and later except (ImportError, AttributeError): from mock import patch, MagicMock from ncclient import manager from ncclient.devices.junos import JunosDeviceHandler ...
""" Display upcoming Google Calendar events. This module will display information about upcoming Google Calendar events in one of two formats which can be toggled with a button press. The event URL may also be opened in a web browser with a button press. Some events details can be retreived in the Google Calendar API...
from decimal import Decimal from django.contrib.auth.models import AnonymousUser from django.test import TestCase, RequestFactory import waffle from waffle.models import Switch, Flag, Sample from waffle.testutils import override_switch, override_flag, override_sample class OverrideSwitchTests(TestCase): def tes...
#!/usr/bin/env python #------------------------------------------------------------------------------ # Copyright 2014 Esri # 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.apac...
# # 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 -*- """ PyShop Pyramid configuration helpers. """ from pyramid.interfaces import IBeforeRender from pyramid.url import static_path, route_path from pyramid.httpexceptions import HTTPNotFound from pyramid_jinja2 import renderer_factory from pyramid_rpc.xmlrpc import XMLRPCRenderer from pyshop.helper...
import math import Sensors.mpu6050.i2cutils as I2CUtils class MPU6050(object): ''' Simple MPU-6050 implementation ''' PWR_MGMT_1 = 0x6b FS_SEL = 0x1b FS_250 = 0 FS_500 = 1 FS_1000 = 2 FS_2000 = 3 AFS_SEL = 0x1c AFS_2g = 0 AFS_4g = 1 AFS_8g = 2 AFS_16g = 3 ...
#!/usr/bin/env python # # Use the raw transactions API to spend bitcoins 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 bitcoind or Bit...
# Copyright (c) 2013 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Handle version information related to Visual Stuio.""" import errno import os import re import subprocess import sys import gyp import glob class VisualStudi...
# -*- coding: utf-8 -*- """ Module :mod:`config` holds the whole configuration mechanism. Configuration can be conducted either from a dictionary :func:`dict_config` or from a file :func:`file_config` holding directly the dictionary. Configuration may be done several times but overlaps will be overwritten, keeping t...
# Copyright (c) 2012 Rackspace Hosting # 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 req...
""" TOXCAST dataset loader. """ import os import deepchem as dc from deepchem.molnet.load_function.molnet_loader import TransformerGenerator, _MolnetLoader from deepchem.data import Dataset from typing import List, Optional, Tuple, Union TOXCAST_URL = "https://deepchemdata.s3-us-west-1.amazonaws.com/datasets/toxcast_d...
#!/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 "License")...
from teafacto.blocks.basic import Linear as Lin, Softmax from teafacto.blocks.basic import VectorEmbed, IdxToOneHot, MatDot from teafacto.blocks.memory import MemoryStack, MemoryBlock, DotMemAddr from teafacto.blocks.seq.rnn import MakeRNU from teafacto.blocks.seq.rnn import SeqDecoder, BiRNU, SeqEncoder, MaskSetMode, ...
import io import textwrap import pytest from .. import validate_docstrings class BadDocstrings: """Everything here has a bad docstring""" def private_classes(self): """ This mentions NDFrame, which is not correct. """ def prefix_pandas(self): """ Have `pandas` p...
# ---------------------------------------------------------------------------- # Copyright (c) 2016-2019, QIIME 2 development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------------...
#*********************************************************** #* Software License Agreement (BSD License) #* #* Copyright (c) 2010, CSIRO Autonomous Systems Laboratory #* All rights reserved. #* #* Redistribution and use in source and binary forms, with or without #* modification, are permitted provided that the fol...
import siconos.kernel as SK import siconos.numerics as SN import numpy as np import matplotlib.pyplot as plt ## \brief Constructor # # \param is a (optional) h = 1e-3 withPlot = True class ZI(object): def __init__(self, h, xk, theta, gamma, kappa, g): self.xk = xk self.h = h ...
"""Provide estimates of sample purity and subclonal copy number using THetA. Identifying cellularity and subclonal populations within somatic calling using tumor normal pairs. https://github.com/raphael-group/THetA """ import os import sys import subprocess import pybedtools import pysam import toolz as tz from bcb...
#!/usr/bin/python # __*__ coding: utf8 __*__ #import string #import copy #import math #import random from model_ngbr import model_ngbr #--- some functions -------------------------------------------------- # periodic boundary conditions def bound(x, y): if x > y/2.: return x-y if x < -y/2. : return x...
import os from os.path import realpath, dirname import struct import itertools import functools import ctypes from ctypes import byref, WINFUNCTYPE, HRESULT, WinError from simple_com import COMInterface, IDebugOutputCallbacksVtable import resource_emulation import driver_upgrade from driver_upgrade import DU_MEMALLOC_...
#!/usr/bin/env python from __future__ import print_function import argparse import json import sys import tabulate import pb4py import pb4py.exceptions def add_device_commands(parsers): device_parsers = parsers.add_subparsers() device_parsers.add_parser( 'list', help = 'List all devices.', ).set_defaults(...
# 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 law or agreed to in...
# -*- coding: utf-8 -*- from __future__ import absolute_import import datetime from contextlib import contextmanager import pytest import simplejson from pyramid.httpexceptions import exception_response from webtest.utils import NoDefault from pyramid_swagger import exceptions def build_test_app(swagger_versions, ...
# coding=utf-8 # Copyright (c) 2012 NTT DOCOMO, 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 # ...
#!/usr/bin/env python """ This module contains tests for djenerator app. """ import datetime import itertools import os import random import re import tempfile import uuid from decimal import Decimal from django.conf import settings from django.db import models from django.db.models import Model from django.db.models.f...
import os import re import json from collections import Iterable from charmhelpers.core import host from charmhelpers.core import hookenv __all__ = ['ServiceManager', 'ManagerCallback', 'PortManagerCallback', 'open_ports', 'close_ports', 'manage_ports', 'service_restart', 'service_stop'] clas...
# coding: utf-8 """ """ import ctypes import time import sys import argparse import re parser = argparse.ArgumentParser() parser.add_argument("--file", "-f", type=str, required=True) parser.add_argument("--title", "-t", type=str, required=True) LONG = ctypes.c_long DWORD = ctypes.c_ulong ULONG_PTR = ctypes.POINTER(...
# -*- coding: utf-8 -*- import asyncio import datetime from irc3.plugins.command import command from irc3.utils import IrcString from irc3 import event import irc3 MOTION_RESULT_LIST = 'Ayes: {ayes}; Nays: {nays}; Abstains: {abstains}' MOTION_RESULT_COUNT = 'Ayes: {ayes}; Nays: {nays}; Abstains: {abstains}; TOTAL: {t...
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (nested_scopes, generators, division, absolute_import, with_statement, print_function, unicode_literals) from abc import abst...
#!/usr/bin/env python from nose.tools import * import networkx from test_multigraph import BaseMultiGraphTester, TestMultiGraph class BaseMultiDiGraphTester(BaseMultiGraphTester): def test_edges(self): G=self.K3 assert_equal(sorted(G.edges()),[(0,1),(0,2),(1,0),(1,2),(2,0),(2,1)]) assert_eq...
import contextlib import re import socket import uuid from django.conf import settings from django.contrib.auth.middleware import AuthenticationMiddleware from django.contrib.auth.models import AnonymousUser from django.contrib.sessions.middleware import SessionMiddleware from django.db import transaction from django....
#!/usr/bin/env python # # Copyright 2012 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...
#!/usr/bin/env python # -*- coding: utf-8 -*- ########################################################### # WARNING: Generated code! # # ************************** # # Manual changes may get lost if file is generated again. # # Only code inside the [MANUAL] ta...
import requests import json import sys class airbnbScraper: def __init__(self, init_rooms): self.rooms = [] self.results = {} self.baseURL = 'https://www.airbnb.co.uk/rooms/' # required data with key and value for prettyprint self.requiredData = { 'name':'Proper...
# 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,...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 Ken Pepple # 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...
# Copyright 2022 The Magenta Authors. # # 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 ...
# coding=utf8 # Based on yibo's R script and JianXiao's Python script from scipy import sparse from sklearn.feature_selection import SelectPercentile, f_classif, chi2 import pandas as pd import numpy as np from scipy import sparse as ssp import pylab as plt from sklearn.preprocessing import LabelEncoder,LabelBinarizer,...
#!/usr/bin/python # Copyright (c) 2012 The Native Client Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Parse the report output of the llvm test suite or regression tests, filter out known failures, and check for new failures p...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012, Nachi Ueno, NTT MCL, 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:/...
# Copyright (C) 2019 Akamai Technologies, Inc. # Copyright (C) 2011-2017 Nominum, 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 #...
<<<<<<< HEAD <<<<<<< HEAD # Tests that work for both bytes and buffer objects. # See PEP 3137. import struct import sys class MixinBytesBufferCommonTests(object): """Tests that work for both bytes and buffer objects. See PEP 3137. """ def marshal(self, x): """Convert x into the appropriate ty...
"""Implementation of JSONDecoder """ import re import sys import struct from scanner import make_scanner def _import_c_scanstring(): try: from _speedups import scanstring return scanstring except ImportError: return None c_scanstring = _import_c_scanstring() __all__ = ['JSONDecoder'] ...
# Copyright 2015 gRPC authors. # # 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...
""" Network Users ============= Manage the users configuration on network devices via the NAPALM proxy. :codeauthor: Mircea Ulinic <ping@mirceaulinic.net> :maturity: new :depends: napalm :platform: unix Dependencies ------------ - :mod:`NAPALM proxy minion <salt.proxy.napalm>` - :mod:`Users configuration mana...
#!/usr/bin/env python # Copyright 2015 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. """MB - the Meta-Build wrapper around GYP and GN MB is a wrapper script for GYP and GN that can be used to generate build files for se...
# Python Profiler v3 # Copyright (c) 2015-2017 David R Walker # TODO: # [x] Record only functions in StackLines # [ ] Handle per-line hotspots as separate structure (not nested) - ? # [ ] Handle timeline as separate structure # [x] Use unique stack IDs to dedupe stack tuples # [ ] Merge profile data method #...
"""Support for Hass.io.""" from datetime import timedelta import logging import os import voluptuous as vol from homeassistant.auth.const import GROUP_ID_ADMIN from homeassistant.components.homeassistant import SERVICE_CHECK_CONFIG import homeassistant.config as conf_util from homeassistant.const import ( ATTR_NA...
# Copyright 2016 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...
# 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 (C) 2012 Hewlett-Packard Development Company, L.P. # 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/LICEN...
import matplotlib matplotlib.use('Agg') import os import sys import numpy as np import json import matplotlib.pyplot as plt import caffe from caffe import layers as L from caffe import params as P from vqa_data_provider_layer import VQADataProvider from visualize_tools import exec_validation, drawgraph import config ...
# Copyright 2017,2018,2019,2020,2021 Sony Corporation. # Copyright 2021 Sony Group Corporation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-...
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. import os import unittest import warnings from numbers import Number from pathlib import Path from collections import OrderedDict import numpy as np from pymatgen.analysis.phase_diagram import ( CompoundP...
from unittest.mock import ANY from uuid import uuid4 import graphene import pytest from graphene.utils.str_converters import to_camel_case from saleor.product.error_codes import ProductErrorCode from saleor.product.models import ProductVariant from saleor.product.utils.attributes import associate_attribute_values_to_...
"""Support for HomematicIP Cloud cover devices.""" from __future__ import annotations from homematicip.aio.device import ( AsyncBlindModule, AsyncDinRailBlind4, AsyncFullFlushBlind, AsyncFullFlushShutter, AsyncGarageDoorModuleTormatic, AsyncHoermannDrivesModule, ) from homematicip.aio.group imp...
# -*- coding: utf-8 -*- # # This file is part of PyBuilder # # Copyright 2011-2020 PyBuilder 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/l...
############################################################################### # ntplib - Python NTP library. # Copyright (C) 2009 Charles-Francois Natali <neologix@free.fr> # # ntplib is free software; you can redistribute it and/or modify it under the # terms of the GNU Lesser General Public License as published by ...
#!/usr/bin/env python2 import unittest from pyvap import Store, UnsolvableError, UndeterminedError, Maybe from pyvap.constraints import BitwiseAnd import pyvap.types class Common(unittest.TestCase): flip = False def setUp(self): self.store = Store() self._var1 = self.store.IntVar() self._var2 = self.store.In...
#!/usr/bin/env python2.7 # Copyright 2015, 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: # # * Redistributions of source code must retain the above copyright # notice, this lis...
import os import unittest from copy import deepcopy from gos.configuration import Configuration class ConfigurationTestCase(unittest.TestCase): def setUp(self): self.init_config = Configuration() def test_initialization_top_level(self): """ in simple initialization the top level section must ...
"""Colormaps.""" # --- import -------------------------------------------------------------------------------------- import copy import numpy as np from numpy import r_ import matplotlib import matplotlib.pyplot as plt import matplotlib.colors as mplcolors import matplotlib.gridspec as grd from ._turbo import tur...
#coding: utf-8 ''' # WKWebView - modern webview for Pythonista ''' from objc_util import * import ui, console, webbrowser import queue, weakref, ctypes, functools, time, os, json, re from types import SimpleNamespace # Helpers for invoking ObjC function blocks with no return value class _block_descriptor (Struct...
import enum from itertools import chain from typing import List, Set, Tuple, Type class Entity: def __init__(self, sent_id: int, start: int, end: int, tag: str): self.sent_id = sent_id self.start = start self.end = end self.tag = tag def __repr__(self): return '({}, {...
import pytest import datetime from api.base.settings.defaults import API_BASE from api.providers.workflows import Workflows from osf.utils.workflows import RequestTypes, RegistrationModerationTriggers, RegistrationModerationStates from osf_tests.factories import ( AuthUserFactory, RegistrationFactory, R...
# 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...
# -*- coding: utf-8 -*- """ simplegcm.gcm. This module implements the Google Cloud Service API. :copyright: (c) 2015 by Martin Alderete. :license: BSD License, see LICENSE for more details. """ import json import requests __all__ = ('GCMException', 'Message', 'Notification', 'Result', 'Options', 'Sen...
# -*- coding: utf-8 -*- ############################################################################# # SRWLIB Example: Virtual Beamline: a set of utilities and functions allowing to simulate # operation of an SR Beamline. # The standard use of this script is from command line, with some optional arguments, # e.g. for ...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013, Big Switch Networks, 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...
#!/usr/bin/python """ See for a good intro into debuggers: http://eli.thegreenplace.net/2011/01/23/how-debuggers-work-part-1 http://eli.thegreenplace.net/2011/01/27/how-debuggers-work-part-2-breakpoints Or take a look at: http://python-ptrace.readthedocs.org/en/latest/ """ import os import ctypes from ppci.binutil...
#!/usr/bin/env python # # FSF Client for sending information and generating a report # # Jason Batchelor # Emerson Corporation # 02/09/2016 """ Copyright 2016 Emerson Electric Co. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. ...
# -*- coding: utf-8 -*- import itertools import numpy as np import tensorflow as tf from tensorpack.models import Conv2D, FixedUnPooling, MaxPooling, layer_register from tensorpack.tfutils.argscope import argscope from tensorpack.tfutils.scope_utils import under_name_scope from tensorpack.tfutils.summary import add_m...
# TODO: Test robust skewness # TODO: Test robust kurtosis import numpy as np import pandas as pd from numpy.testing import (assert_almost_equal, assert_raises, TestCase) from statsmodels.stats.stattools import (omni_normtest, jarque_bera, durbin_watson, _medcouple_1d, medcouple,...
''' A few functions to plot stellar mass functions from SAM runs. :author: Sami-Matias Niemi :version: 0.1 :contact: niemi@stsci.edu ''' import matplotlib matplotlib.rc('text', usetex=True) matplotlib.rcParams['font.size'] = 15 matplotlib.rc('xtick', labelsize=14) matplotlib.rc('axes', linewidth=1.2) matplotlib.rcPar...
# Copyright (c) 2014 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 required by applic...