gt
stringclasses
1 value
context
stringlengths
2.49k
119k
"""`PhotovoltaicPixel`, `PRIMA`, `PRIMA75`, `PRIMA55`, `PRIMA40`""" from matplotlib.patches import Circle, RegularPolygon import numpy as np # Using or importing the ABCs from 'collections' instead of from # 'collections.abc' is deprecated, and in 3.8 it will stop working: from collections.abc import Sequence from ....
import logging import Queue import time from threading import Thread, current_thread, Lock import zmq from binder.binderd.client import BinderClient from binder.settings import LogSettings class LoggerClient(Thread): _singleton = None @staticmethod def getInstance(): if not LoggerClient._singl...
# Create your views here. from django.http import HttpResponse from rango.models import Category from rango.models import Page from django.template import RequestContext from django.shortcuts import render_to_response from rango.forms import CategoryForm from rango.forms import PageForm from rango.forms import UserForm...
import weakref import pytest from pytestqt import qt_compat from pytestqt.qt_compat import qt_api def test_basics(qtbot): """ Basic test that works more like a sanity check to ensure we are setting up a QApplication properly and are able to display a simple event_recorder. """ assert qt_api.QtWi...
# Copyright (C) 2013 Deutsche Telekom AG # 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 r...
# Copyright (c) 2012 Denis Bilenko. See LICENSE for details. """A simple UDP server. For every message received, it sends a reply back. You can use udp_client.py to send a message. """ from gevent.greenlet import Greenlet from gevent.server import DatagramServer from object import Resend from binascii import hexlify f...
# -*- coding: utf-8 -*- """Field classes for various types of data.""" from __future__ import absolute_import, unicode_literals import collections import datetime as dt import uuid import warnings import decimal from operator import attrgetter from marshmallow import validate, utils, class_registry from marshmallow....
from pprint import pprint import hashlib import datetime from dartsense import db, List_C import dartsense.event import dartsense.player class Match: def __init__( self, id=None, player_1=None, player_2=None, event=None, date=datetime.date.today() ): s...
############################################################################## # # Copyright (c) 2003 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SO...
# 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...
# plugin/plugin_base.py # Copyright (C) 2005-2015 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Testing extensions. this module is designed to work as a testing-framework...
import unittest from mock import MagicMock from hazelcast.cp import LOCK_SERVICE from hazelcast.errors import ( HazelcastRuntimeError, LockOwnershipLostError, LockAcquireLimitReachedError, SessionExpiredError, WaitKeyCancelledError, IllegalMonitorStateError, ) from hazelcast.future import Imme...
from __future__ import absolute_import import six from bson import DBRef, SON from .base import (BaseDict, BaseList, TopLevelDocumentMetaclass, get_document) from .fields import (ReferenceField, ListField, DictField, MapField) from .connection import get_db from .queryset import QuerySet from .document import Documen...
#!/usr/bin/env python # # Copyright 2008 The Closure Linter 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 #...
# -*- coding: utf-8 -*- # Copyright 2015 Mirantis, 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 requi...
#!/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");...
# http://djangosnippets.org/snippets/773/ import math from django.core.paginator import \ Paginator, QuerySetPaginator, Page, InvalidPage __all__ = ( 'InvalidPage', 'ExPaginator', 'DiggPaginator', 'QuerySetDiggPaginator', ) class ExPaginator(Paginator): """Adds a ``softlimit`` option to ``pag...
""" Module. Includes classes for all PTC elements. Built on the back of TEAPOT by J. Holmes. """ import sys import os import math # import teapot base functions from wrapper around C++ functions from orbit.teapot_base import TPB # import the function that creates multidimensional arrays from orbit.utils import orbit...
# 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...
# 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...
import os import warnings from django.core.exceptions import ImproperlyConfigured from django.core.urlresolvers import reverse, clear_url_caches from django.test import TestCase from django.test.utils import override_settings from django.template import Template, Context from django.utils import translation @overrid...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file '/Users/bibsian/Desktop/git/database-development/Views/ui_dialog_site.ui' # # Created by: PyQt4 UI code generator 4.11.4 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QS...
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright 2002 Ben Escoto <ben@emerose.org> # Copyright 2007 Kenneth Loafman <kenneth@loafman.com> # # This file is part of duplicity. # # Duplicity is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License...
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
# 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 (c) 2021 Arm Limited and Contributors. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # """Base class for targets.""" import json import os from time import sleep from .. import host_tests_plugins as ht_plugins from mbed_lstools.main import create from .. import DEFAULT_BAUD_RATE from ..host_...
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org # import unittest from datetime import date, time from ...compatibility import StringIO from ...worksheet import Worksheet from ..helperfunctions imp...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import pprint from model_mommy import mommy import mock import responses import re from django.conf import settings from django.core.urlresolvers import reverse from django.test import override_settings from rest_framework import status from rest_framewo...
# # Copyright (C) 2001-2004 greg Landrum and Rational Discovery LLC # All Rights Reserved # """ The "parser" for compound descriptors. I almost hesitate to document this, because it's not the prettiest thing the world has ever seen... but it does work (for at least some definitions of the word). Rather than getti...
#################################################################### # Class CONTROLLER: contral scan # #################################################################### # External modules import os import random import time from math import log10 import math # Internal modules imp...
""" Contains the querying interface. Starting with :class:`~tinydb.queries.Query` you can construct complex queries: >>> ((where('f1') == 5) & (where('f2') != 2)) | where('s').matches(r'^\w+$') (('f1' == 5) and ('f2' != 2)) or ('s' ~= ^\w+$ ) Queries are executed by using the ``__call__``: >>> q = where('val') == 5...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from collections import defaultdict as dd from omw.common_sql import ( qs, connect_omw, connect_admin, query_omw, query_omw_direct, write_omw, blk_write_omw ) import sys from omw import app #ntsense=namedtuple('Sense', ['lemma', 'y'], verbose...
# coding: utf-8 import dataset import csv import os from default_settings import DB_RESULTS_URL db = None dir = os.path.dirname(__file__) REL_POLLING_PATH = os.path.join(dir, '../data/maestras') REL_RESULTS_PATH = os.path.join(dir, '../data/resultados') POLLING_STATIONS_DATA_FILE = 'caba_est_2015.csv' POLLING_TABLES_D...
""" python generate_sparsetools.py Generate manual wrappers for C++ sparsetools code. Type codes used: 'i': integer scalar 'I': integer array 'T': data array 'B': boolean array 'V': std::vector<integer>* 'W': std::vector<data>* '*': indicates that the next argument is an output arg...
# 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 ...
# 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...
""" For compatibility with numpy libraries, pandas functions or methods have to accept '*args' and '**kwargs' parameters to accommodate numpy arguments that are not actually used or respected in the pandas implementation. To ensure that users do not abuse these parameters, validation is performed in 'validators.py' to...
from django.conf import settings from django.core import mail from django.core.mail import EmailMessage from django.utils import translation import mock from nose.tools import eq_ import mkt.users.notifications from amo.tests import TestCase from mkt.site.mail import send_mail, send_html_mail_jinja from mkt.site.mode...
# 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 -*- """ celery.worker.buckets ~~~~~~~~~~~~~~~~~~~~~ This module implements the rate limiting of tasks, by having a token bucket queue for each task type. When a task is allowed to be processed it's moved over the the ``ready_queue`` The :mod:`celery.worker.mediator` is ...
# Copyright (c) 2019 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 required by app...
# Copyright (c) 2012, GPy authors (see AUTHORS.txt). # Licensed under the BSD 3-clause license (see LICENSE.txt) import sys import numpy as np from ...core.parameterization.parameterized import Parameterized from paramz.caching import Cache_this from .kernel_slice_operations import KernCallsViaSlicerMeta from functools...
# logisticpredict.py # # Based on logisticleave1out.py which was based on # parallel_crossvalidate.py from the paceofchange repo. # # Reads all volumes meeting a given set of criteria, # and uses a leave-one-out strategy to distinguish # reviewed volumes (class 1) from random # (class 0). In cases where an author occur...
#!/bin/bash import base64 import os import struct from itertools import groupby from pprint import pprint split_list = lambda l, n: [l[x: x+n] for x in xrange(0, len(l), n)] def get_image_info(data): # http://stackoverflow.com/questions/8032642/how-to-obtain-image-size if is_png(data): w, h = struct...
''' models for the puzzleboard concept ''' import json import random import string from .puzzle import Puzzle, puzzle_from_dict from .redis import redis_client config = { 'retries': 2048, 'diagonal_ratio': 0.095, 'random_factor': 32, 'word_density': 0.6 } class Point: '''Represents a cell on th...
#!/usr/bin/python # # Copyright 2020 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 ag...
""" This script is used to write `sqf/dababase.py`, that contains all valid SQF expressions. It reads a file from here: https://raw.githubusercontent.com/intercept/intercept/master/src/client/headers/client/sqf_pointers_declaration.hpp """ import urllib.request from sqf.interpreter_types import ForType, IfType, Switc...
from fabric.api import task, local, env, settings from fabric.operations import put import cuisine from cuisine import run, sudo, package_ensure import re import socket from server.config import get_settings_prod import paramiko from fabric.contrib.files import sed, append PACKAGES_TO_INSTALL = [ 'libpq-dev', ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # The MIT License (MIT) # Copyright (c) 2017 Juan Cabral # 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 withou...
#!/usr/bin/env python # encoding: utf-8 """ Copyright (c) 2010 The Echo Nest. All rights reserved. Created by Tyler Williams on 2010-04-25. Utility functions to support the Echo Nest web API interface. """ import urllib import urllib2 import httplib import config import logging import socket import re import time imp...
# Copyright 2019 The Oppia 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 applicable ...
# encoding: utf-8 from django.shortcuts import render_to_response, get_object_or_404, redirect from django.http import HttpResponseRedirect, Http404, HttpResponse from django.core.urlresolvers import reverse from django.template import RequestContext from django.views.generic import ListView from django.utils.datastruc...
# 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...
# sqlalchemy/pool.py # Copyright (C) 2005-2014 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Connection pooling for DB-API connections. Provides a number of connection p...
import discord from discord.ext import commands import json import os import sys from modules import utilities from utilities import checks sys.path.insert(0, "..") from units.files import create_folder sys.path.pop(0) def setup(bot): bot.add_cog(Battlerite(bot)) class Battlerite(commands.Cog): ''' Deprecate...
# 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...
import numpy as np import pandas as pd import json from tl_algs import tl_alg from sklearn.cluster import KMeans from sklearn.metrics.pairwise import euclidean_distances def _kmeans_cluster(test_set_X, train_pool_X, train_pool_y, cluster_factor, rand_seed): """ Partition dataset into clust...
# -*- coding: utf-8 -*- """ <DefineSource> @Date : Fri Nov 14 13:20:38 2014 \n @Author : Erwan Ledoux \n\n </DefineSource> A Commander gather Variables to set them with an UpdateList. The command process can be AllSetsForEach (ie a map of the update succesively for each) or a EachSetForAll (ie each set is a map of ...
from fontTools.misc.py23 import byteord, tostr import re from bisect import bisect_right try: # use unicodedata backport compatible with python2: # https://github.com/mikekap/unicodedata2 from unicodedata2 import * except ImportError: # pragma: no cover # fall back to built-in unicodedata (possibly o...
"Test posix functions" from test import support # Skip these tests if there is no posix module. posix = support.import_module('posix') import errno import sys import time import os import platform import pwd import stat import tempfile import unittest import warnings _DUMMY_SYMLINK = os.path.join(tempfile.gettempdi...
#!/usr/bin/python import sys import os import time import ConfigParser import tempfile import codecs from StringIO import StringIO from vt_manager_kvm.communication.sfa.util.xml import XML default_config = \ """ """ def isbool(v): return v.lower() in ("true", "false") def str2bool(v): return v.lower() in ("tr...
import os import sys import json import types import shutil import logging import inspect import tempfile import contextlib from pyblish import api from . import lib, schema from . import ( _registered_families, _registered_data, _registered_formats, _registered_loaders_paths, _registered_host, ...
# # DrawingMixin.py -- enable drawing capabilities. # # This is open-source software licensed under a BSD license. # Please see the file LICENSE.txt for details. # import time from ginga import trcalc from ginga.misc.Bunch import Bunch from .CanvasMixin import CanvasMixin __all__ = ['DrawingMixin'] class DrawingMi...
"""Simple HTTP Server. This module builds on BaseHTTPServer by implementing the standard GET and HEAD requests in a fairly straightforward manner. """ __version__ = "0.6" __all__ = ["SimpleMsHTTPRequestHandler"] import os import posixpath import BaseHTTPServer import urllib import cgi import shutil import mimetyp...
# Copyright (c) 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...
import os import pytest from .common import * # NOQA namespace = {"p_client": None, "ns": None, "cluster": None, "project": None} CLUSTER_NAME = os.environ.get("CLUSTER_NAME", "") RANCHER_CLEANUP_PROJECT = os.environ.get("RANCHER_CLEANUP_PROJECT", "True") @pytest.fixture def ns_default_quota(): return {"limit"...
# # Copyright (c) 2016, SUSE LLC # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list of conditions and the foll...
""" HTML forms. """ import re import collections from werkzeug.datastructures import OrderedMultiDict from robobrowser.compat import iteritems, encode_if_py2 from . import fields from .. import helpers from .. import exceptions _tags = ['input', 'textarea', 'select'] _tag_ptn = re.compile( '|'.join(_tags), ...
import datetime from django.test import TestCase # Create your tests here. from py_yr.config.settings import FORECAST_TYPE_STANDARD, FORECAST_TYPE_HOURLY from api.helper import is_valid_location, is_valid_language, is_valid_forecast_type, time_is_less_then_x_minutes_ago from api.models import TimeZone, Location, Sun...
from __future__ import print_function from typing import cast, Any, Dict, Iterable, List, Mapping, Optional, Sequence, Tuple, Text from confirmation.models import Confirmation, create_confirmation_link from django.conf import settings from django.template import loader from django.utils.timezone import now as timezon...
from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType from django.test import SimpleTestCase, TestCase from django_dynamic_fixture import G from mock import patch, Mock from restraint import core, constants from restraint.models import PermSet, Perm, PermLevel, PermAcce...
import json import os import re import uuid from json import JSONEncoder import parser import yaml DEFAULT_REGIONATOR_NAME = '{0} - Generated by Regionator' ORIENTATION_TO_ID = { 'FACE_WEST': 0, 'FACE_NORTH': 1, 'FACE_EAST': 2, 'FACE_SOUTH': 3, } def _default(self, obj): return getattr(obj.__class__, "...
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
import re import socket import base64 import hashlib import os import sys try: # Python 3 from http.client import HTTPS_PORT from urllib.request import parse_keqv_list, parse_http_list except (ImportError): # Python 2 from httplib import HTTPS_PORT from urllib2 import parse_keqv_list, parse_htt...
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Project.status' db.add_column('storybase_user_project', 'status', self...
import itertools from eth_utils import ( encode_hex, to_tuple, is_list_like, coerce_return_to_text, event_abi_to_log_topic, ) from eth_abi import ( decode_abi, decode_single, encode_single, ) from eth_abi.abi import ( process_type, ) from .abi import ( exclude_indexed_event_in...
__all__ = ['fixed_quad','quadrature','romberg','trapz','simps','romb', 'cumtrapz','newton_cotes','composite'] from scipy.special.orthogonal import p_roots from scipy.special import gammaln from numpy import sum, ones, add, diff, isinf, isscalar, \ asarray, real, trapz, arange, empty import numpy as np...
# Copyright 2011 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,...
from datetime import datetime import decimal import random from faker import data from faker import Faker from faker.utils import uk_postcode, bothify from anonymizer import replacers randrange = random.SystemRandom().randrange alphanumeric = "" for i in range(ord('A'), ord('Z')+1): alphanumeric += chr(i) for i...
# Copyright (c) 2010-2012 OpenStack, 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 ...
# Copyright (C) 2003-2005 Peter J. Verveer # # 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 the following d...
#!/usr/bin/env python # # Copyright 2007 The Closure Linter 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 #...
# Copyright (c) 2013 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 torch from torch_geometric.loader import DataLoader import torch.optim as optim import torch.nn.functional as F from torchvision import transforms from gnn import GNN from tqdm import tqdm import argparse import time import numpy as np import pandas as pd import os ### importing OGB from ogb.graphproppred impo...
"""Support for HomeMatic devices.""" from datetime import timedelta, datetime from functools import partial import logging import voluptuous as vol from homeassistant.const import ( ATTR_ENTITY_ID, ATTR_MODE, ATTR_NAME, CONF_HOST, CONF_HOSTS, CONF_PASSWORD, CONF_PLATFORM, CONF_SSL, ...
from __future__ import annotations import os import heapq import bisect import shutil import asyncio import logging import contextlib import regex import synapse.exc as s_exc import synapse.common as s_common import synapse.lib.base as s_base import synapse.lib.coro as s_coro import synapse.lib.slabseqn as s_slabse...
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
# 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 ...
# Copyright 2010 OpenStack Foundation # Copyright 2012 University Of Minho # Copyright 2014-2015 Red Hat, 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 # # htt...
#!/usr/bin/python # @lint-avoid-python-3-compatibility-imports # # compactsnoop Trace compact zone and print details including issuing PID. # For Linux, uses BCC, eBPF. # # This uses in-kernel eBPF maps to cache process details (PID and comm) by # compact zone begin, as well as a starting timestamp for calculati...
""".""" from copy import deepcopy as _dcopy import multiprocessing as mp_ import numpy as _np from mathphys.functions import save_pickle as _save_pickle, \ load_pickle as _load_pickle import pyaccel as _pyaccel class LOCOUtils: """LOCO utils.""" @staticmethod def save_data(fname, jlocodict, overwr...
import asyncio import os import traceback from functools import partial from inspect import isawaitable from multiprocessing import Process from signal import ( SIGTERM, SIGINT, signal as signal_func, Signals ) from socket import ( socket, SOL_SOCKET, SO_REUSEADDR, ) from time import time from ...
''' a wrapper to google cloud sql. the MySQLdb module is thread safe but the connections to the database are not. so the recommendation is that each thread have an independent connection. currently, each database access will use its own connection and at the end of the method, close it. if this becomes expensive, ti...
#!/usr/bin/python try: real_types = (int, long, float) except NameError: # Python 3 real_types = (int, float) xrange = range import math class Quat: """The class defining a quaternion.""" def __init__(self, x=0, y=0, z=0, t=0): """Create a Quat instance.""" self.q = [float(x),...
''' Mutation Strategies @author: Michael Eddington @version: $Id$ ''' # # Copyright (c) Michael Eddington # # 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 w...
#!/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. # Enable 'with' statements in Python 2.5 from __future__ import with_statement import optparse import os.path import shutil impor...
from JumpScale import j import ujson class system_contentmanager(j.code.classGetBase()): """ this actor manages all content on the wiki can e.g. notify wiki/appserver of updates of content """ def __init__(self): self._te = {} self.actorname = "contentmanager" self.a...
""" Models for representing top-level plot objects. """ from __future__ import absolute_import from six import string_types import warnings from ..core.query import find from ..core import validation from ..core.validation.warnings import (MISSING_RENDERERS, NO_DATA_RENDERERS, EMPTY_LAYOUT, MALFORMED_CATEGORY_LA...
# -*- coding: utf-8 -*- # # 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 #...