text
stringlengths
12
6.59M
import numpy as np np.set_printoptions(threshold='nan') from sifra.modelling.structural import Element from sifra.modelling.component_graph import ComponentGraph from sifra.modelling.structural import Base from sifra.modelling.iodict import IODict class InfrastructureFactory(object): @staticmethod def creat...
class Score(object): """Represents total user score """ def __init__(self, points=0): self.points = points def __repr__(self): return "<Score '{0}' points at {1}>".format(self.points, hex(id(self))) def add(self, points): """Add points to the score :param points: i...
import sys import socket import argparse from collections import OrderedDict from twisted.internet import reactor, defer from twisted.names import client, dns, server, cache, hosts from twisted.internet.abstract import isIPAddress from twisted.python import log class DispatchResolver(client.Resolver): def __in...
""" Grid Extension for Python-Markdown ================================== A Python-Markdown extension for grid building. It provides minimal and straightforward syntax to create multicolumn text layouts. Usage: >>> import markdown >>> md = markdown.Markdown(extensions=['grid']) >>> md.convertFile('hello....
from django.views.generic import TemplateView class ListPollsView(TemplateView): template_name = "polls/list_polls.html" from datetime import datetime from django.shortcuts import render_to_response, get_object_or_404 from django.http import HttpResponse from django.contrib.auth.decorators import login_required...
# pylint: disable=redefined-builtin, too-many-arguments, invalid-name '''Provides an object model for JSON Schema''' import json # These are standard keys defined in the JSON Schema spec STANDARD_KEYS = [ 'selected', 'inclusion', 'description', 'minimum', 'maximum', 'exclusiveMinimum', 'ex...
# -*- coding: utf-8 -*- """ ================================================================== Custom NumPy Vector class (:mod:`sknano.core.math._vector`) ================================================================== .. currentmodule:: sknano.core.math._vector """ from __future__ import absolute_import, division...
# -*- coding: utf-8 -*- from __future__ import unicode_literals, absolute_import, division __version_info__ = (0, 2, 4) __version__ = '.'.join(map(str, __version_info__))
from django.views.generic.list import ListView from django.views.generic.detail import DetailView from django.views.generic.edit import CreateView, DeleteView, UpdateView from django.db.models import Q, F, ExpressionWrapper, IntegerField, Count from django.db.models import CharField, TextField, Value as V from django.d...
from threading import Lock from decimal import Decimal from django.contrib.auth.models import User from django.core.exceptions import ValidationError from django.db import models from django.db import connections, router, transaction, DEFAULT_DB_ALIAS from eav.models import Attribute, Value from eav import register fro...
import random import sys class Rectangle: def __init__(self, x0, y0, w, h): self.x0, self.y0 = x0, y0 self.w, self.h = w, h def area(self): return self.w * self.h def leastSide(self): return min( self.w, self.h ) def intersect(self, that): x1, y1 = self.x0 + self...
# -*- coding: utf-8 -*- u"""Flask routes :copyright: Copyright (c) 2015 RadiaSoft LLC. All Rights Reserved. :license: http://www.apache.org/licenses/LICENSE-2.0.html """ from __future__ import absolute_import, division, print_function import datetime import errno import json import os import random import re import ...
#!/usr/bin/env python # -*- coding: utf-8 -*- u""" =============================== Shimehari.crypt ~~~~~~~~~~~~~~~~~ セキュアアアア =============================== """ import uuid from hashlib import sha1 import datetime import time import hmac from werkzeug.exceptions import abort from werkzeug.routing import ...
import boto from boto.dynamodb2 import exceptions from boto.dynamodb2.fields import (HashKey, RangeKey, AllIndex, KeysOnlyIndex, IncludeIndex, GlobalAllIndex, GlobalKeysOnlyIndex, GlobalIncludeIndex) from boto.dynam...
import os, json from fabric.api import settings from tests import base from buildercore import bootstrap, cfngen, lifecycle, core, config import cfn import logging logging.disable(logging.NOTSET) # re-enables logging during integration testing LOG = logging.getLogger(__name__) # the intent here is: # * launch mult...
import logging import random from sqlalchemy.exc import IntegrityError, InvalidRequestError from community_share.models.search import Label, Search from community_share.models.user import User, UserReview from community_share.models.secret import Secret from community_share.models.survey import Question, SuggestedAns...
import os import os.path import sys import stat import glob import ConfigParser import subprocess import collections import difflib import filecmp import shlex import time from tarantool_silverbox_server import TarantoolSilverboxServer from tarantool_connection import AdminConnection, DataConnection import tarantool_pr...
import os import time from dtest import CASSANDRA_VERSION_FROM_BUILD, Tester, debug from sstable_generation_loading_test import BaseSStableLoaderTest from thrift_bindings.v22.Cassandra import (ConsistencyLevel, Deletion, Mutation, SlicePredicate, ...
#!/usr/bin/env python import os, sys, optparse, logging from pprint import pprint import yaml, urllib2, json, ntpath from lighter.hipchat import HipChat from lighter.util import * def parsebool(value): truevals = set(['true', '1']) falsevals = set(['false', '0']) stripped = str(value).lower().strip() i...
# -*- coding: utf-8 -*- import math from simpleai.machine_learning import ClassificationProblem, is_attribute from yalign.datatypes import ScoreFunction, SentencePair from yalign.sequencealigner import SequenceAligner from yalign.svm import SVMClassifier class SentencePairScore(ScoreFunction): def __init__(self...
#!/usr/bin/env python3 # pylint: disable=duplicate-code,too-many-locals,too-many-arguments import copy import datetime import pytz import tzlocal import singer from singer import metadata from singer import utils from singer.schema import Schema import pymysql.connections import pymysql.err import tap_mysql.sync_st...
import json import mock import os import pytest import sys import scriptworker.client from scriptworker.context import Context from scriptworker.exceptions import ScriptWorkerTaskException from signingscript.test import noop_async, noop_sync, read_file, tmpdir, tmpfile, BASE_DIR import signingscript.script as script f...
#!/usr/bin/env python # -*- coding: latin-1 -*- # # Copyright 2016 Blaise Frederick # # 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....
""" Geometry class to retain the atomic structure. """ from __future__ import print_function, division # To check for integers from numbers import Integral, Real from six import string_types from math import acos, pi import sys import warnings import numpy as np from ._help import _str from ._help import array_fill_...
# # Created as part of the StratusLab project (http://stratuslab.eu), # co-funded by the European Commission under the Grant Agreement # INFSO-RI-261552." # # Copyright (c) 2011, SixSq Sarl # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Lice...
#!/usr/bin/env python # Date located in: - from __future__ import print_function #import pysam, random, os, sys import random import pysam import math import os import glob import sys from utils.BedReader import BedIterator from utils.misc import shell, run projectPath = os.path.dirname(os.path.dirname(os.path.dirna...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.contrib.auth import get_user_model, authenticate, login, password_validation from django.contrib.sites.shortcuts import get_current_site from django.core.exceptions import ValidationError from django.forms import widgets, ModelForm from django...
# -*- coding: utf-8 -*- """Project metadata Information describing the project. """ # The package name, which is also the "UNIX name" for the project. package = 'boto3facade' project = "boto3facade" project_no_spaces = project.replace(' ', '') version = '0.2.3' description = 'A simple facade for boto3' authors = ['Ge...
import json from compiler.js import split_name, escape_id, get_package from compiler.js.component import component_generator root_type = 'core.CoreObject' class generator(object): def __init__(self, ns): self.ns = ns self.components = {} self.used_packages = set() self.used_components = set() self.imports ...
#! /usr/bin/env python # --*-- coding:utf-8 --*-- __author__ = 'jeff.yu' import pymongo import os from time import sleep import urllib2 import urllib import json def get_data(query_data): query_url = "http://172.20.0.69:8080/realquery/report?" para_data = {"report_param": query_data} post_data = urlli...
# -*- coding: utf-8 -*- from __future__ import print_function from __future__ import unicode_literals import json import random from rest_framework.response import Response from rest_framework import decorators, status from rest_framework.permissions import (AllowAny, IsAuthent...
from collections import defaultdict import logging import scipy.sparse import typing from typing import ( List, Optional, Text, Dict, Tuple, Union, Generator, Callable, Any, NamedTuple, ) import numpy as np from tqdm import tqdm from sklearn.model_selection import train_test_spli...
# -*- coding: utf-8 -*- # Copyright (c) 2015-2016 MIT Probabilistic Computing Project # 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 # Unles...
#!/usr/bin/env python2 # The MIT License (MIT) # # Copyright (c) 2015 Kyle A. Barlow, Shane O'Connor # # 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 ...
""" Geometry class to retain the atomic structure. """ from __future__ import print_function, division # To check for integers from numbers import Integral, Real from six import string_types from math import acos, pi import sys import warnings import numpy as np from ._help import _str, is_python3 from ._help import...
"""Event parser and human readable log generator.""" from __future__ import annotations import asyncio from collections.abc import Callable from dataclasses import dataclass from datetime import datetime as dt, timedelta import logging from typing import Any import voluptuous as vol from homeassistant.components imp...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from formtools.wizard.views import normalize_name from django.contrib.auth import get_user_model from django.core.exceptions import ValidationError from django.forms import fields from django.utils.encoding import force_text from django.utils.safestring ...
# Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2010 Google # Copyright (c) 2008 rPath, Inc. # Copyright (c) 2009 The Echo Nest Corporation # Copyright (c) 2010, Eucalyptus Systems, Inc. # Copyright (c) 2011, Nexenta Systems Inc. # All rights reserved. # # Permission is hereby granted, free ...
from abc import abstractmethod as abstract from contextlib import ExitStack from .. import lekvar from ..errors import InternalError from .state import State from .util import * from . import bindings as llvm # Abstract extensions lekvar.BoundObject.llvm_value = None # Extension abstract methods apparently don't w...
import os import sys import struct import ctypes import logging import threading import itertools l = logging.getLogger('simuvex.plugins.unicorn') try: import unicorn except ImportError: l.warning("Unicorn is not installed. Support disabled.") from .plugin import SimStatePlugin from ..s_errors import SimValue...
import numpy as np import math import random import sys import time from joblib import Parallel, delayed #Prints a progress bar which updates while running a computational loop def printProgress(iteration, total, prefix='', suffix='', decimals=1, barLength=100): """ Call in a loop to create terminal progress ...
# -*- test-case-name: vumi.tests.test_testutils -*- import re import json from datetime import datetime, timedelta from collections import namedtuple import warnings from functools import wraps import pytz from twisted.trial.unittest import TestCase, SkipTest from twisted.internet import defer, reactor from twisted.i...
""" Component to interface with various media players. For more details about this component, please refer to the documentation at https://home-assistant.io/components/media_player/ """ import asyncio from datetime import timedelta import functools as ft import hashlib import logging import os from aiohttp import web...
from django.http import HttpResponse,Http404 from django import forms from shortener.models import stumps from django.utils.encoding import smart_str from django.shortcuts import get_object_or_404,get_list_or_404,render_to_response,redirect import hashlib import urlparse from django.db.models import Sum,Count from djan...
import sys from copy import deepcopy class SokoMap: def __init__(self): self.sm = [] # Values of map pieces self.goal = '.' self.player = '@' self.block = '$' self.space = ' ' self.wall = '#' self.blockOnGoal = '*' self.playerOnGoal = '!' ...
"""" Overview ======== Implement functionalities to manage files. It is a filemanager-like plugin. Key-Commands ============ Mode: NORMAL Event: <Key-J> Description: List files in the actual AreaVi instance that has focus. Mode: NORMAL Event: <Key-L> Description: If the path under the cursor is a path for a folde...
from rctk.widgets.control import Control from rctk.layouts import GridLayout, LayoutException from rctk.task import Task class Container(Control): """ A container can contain controls. It uses a layout manager to position them. The default layoutmanager is a gridlayout (vertical). A conta...
"""Support for track controls on the Sisyphus Kinetic Art Table.""" import aiohttp from sisyphus_control import Track from homeassistant.components.media_player import MediaPlayerEntity from homeassistant.components.media_player.const import ( SUPPORT_NEXT_TRACK, SUPPORT_PAUSE, SUPPORT_PLAY, SUPPORT_PR...
# coding: utf-8 from __future__ import unicode_literals import itertools import random import re from .common import InfoExtractor from ..compat import compat_str from ..utils import ( determine_ext, ExtractorError, int_or_none, parse_duration, try_get, urljoin, url_or_none, ) class NRKB...
from rdflib.store import Store from rdflib.util import NodePickler from bsddb import db from base64 import b64encode from base64 import b64decode from os import mkdir from os.path import exists from threading import Thread from time import sleep, time # TODO: tool to convert old Sleepycat DBs to this version. class...
"""The Synology DSM component.""" from __future__ import annotations import asyncio from datetime import timedelta import logging import async_timeout from synology_dsm import SynologyDSM from synology_dsm.api.core.security import SynoCoreSecurity from synology_dsm.api.core.system import SynoCoreSystem from synology_...
# piddlePDF.py - a PDF backend for PIDDLE """This is the PIDDLE back end for PDF. It acts as a wrapper over the pdfgen.Canvas class, and translates between the PIDDLE graphics state and the PDF/PostScript one. It only exposes PIDDLE methods; however, it has an attribute self.pdf which offers numerous lower-level drawi...
"""The Synology DSM component.""" import asyncio from datetime import timedelta import logging from typing import Dict import async_timeout from synology_dsm import SynologyDSM from synology_dsm.api.core.security import SynoCoreSecurity from synology_dsm.api.core.system import SynoCoreSystem from synology_dsm.api.core...
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor class TF1IE(InfoExtractor): """TF1 uses the wat.tv player.""" _VALID_URL = r'http://(?:(?:videos|www|lci)\.tf1|www\.tfou)\.fr/(?:[^/]+/)*(?P<id>.+?)\.html' _TESTS = [{ 'url': 'http://videos.tf1.fr/auto-moto/...
from copy import deepcopy import datetime from operator import itemgetter import logging from django.core.files.uploadedfile import InMemoryUploadedFile from django.conf import settings from . import filestorage from .file_upload import FileUpload from .models import Registry from .mongo_client import construct_mongo_...
"""Support to send and receive Telegram messages.""" from functools import partial import importlib import io from ipaddress import ip_network import logging import requests from requests.auth import HTTPBasicAuth, HTTPDigestAuth from telegram import ( Bot, InlineKeyboardButton, InlineKeyboardMarkup, R...
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( float_or_none, smuggle_url, ) class TVAIE(InfoExtractor): _VALID_URL = r'https?://videos\.tva\.ca/details/_(?P<id>\d+)' _TEST = { 'url': 'https://videos.tva.ca/details/_559681147000...
# -*- coding: UTF-8 -*- """ rvt_journal_parser find specific messages in a given journal file to detect model corruption, missing links and the like. """ import os.path as op model_corrupt = 'orrupt' missing_links = 'TaskDialog "Revit could not find or read' circular_links = 'TaskDialog_Circular_Link_Conflict' key_phr...
#!/usr/bin/python # Copyright 2012 BrewPi # This file is part of BrewPi. # BrewPi is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # B...
from datetime import date from django.shortcuts import render_to_response, RequestContext, redirect from django.views.generic.base import View from django.views.generic import CreateView from django.core.urlresolvers import reverse from django.utils.datastructures import SortedDict from django.http import HttpResponse...
import hoomd import pytest from itertools import permutations _directions = list(permutations(['X', 'Y', 'Z'], 2)) @pytest.mark.parametrize("slab_direction, flow_direction", _directions) def test_before_attaching(slab_direction, flow_direction): filt = hoomd.filter.All() ramp = hoomd.variant.Ramp(0.0, 0.1e8,...
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( extract_attributes, float_or_none, get_element_by_class, strip_or_none, unified_timestamp, ) class VRTIE(InfoExtractor): IE_DESC = 'VRT NWS, Flanders News, Flandern Info ...
from sqlalchemy import Float from sqlalchemy.sql import cast from .record import RA, RB class Diff: # Columned statistics xp = (RA.xp - RB.xp).label("xp") time_played = (RA.time_played - RB.time_played).label("time_played") kills = (RA.kills - RB.kills).label("kills") deaths = (RA.deaths - RB.dea...
{ 'variables': { # The libraries brightray will be compiled to. 'linux_system_libraries': 'gtk+-2.0 libnotify dbus-1 x11 xrandr xext gconf-2.0' }, 'includes': [ 'filenames.gypi', ], 'targets': [ { 'target_name': 'brightray', 'type': 'static_library', 'include_dirs': [ ...
import os from django.utils.translation import ugettext_lazy as _ from openstack_dashboard import exceptions {%- from "horizon/map.jinja" import server with context %} {%- set app = salt['pillar.get']('horizon:server:app:'+app_name) %} {% include "horizon/files/horizon_settings/_local_settings.py" %} {% include "hori...
import re import threading from rx.core import AnonymousObservable, Observable from rx.core.blockingobservable import BlockingObservable from rx.concurrency import timeout_scheduler from rx.internal import extensionmethod, extensionclassmethod from .coldobservable import ColdObservable from .reactivetest import React...
import rethinkdb as r from brink.db import conn from brink.fields import ReferenceField class ObjectManager(object): def __init__(self, model_cls, table_name): self.model_cls = model_cls self.table_name = table_name def __getattr__(self, attr): qs = QuerySet(self.model_cls, self.tab...
import os import ujson import hashlib import sys import argparse import shutil import subprocess import re import logging import random import requests from collections import defaultdict from django.conf import settings from django.db import connection from django.utils.timezone import now as timezone_now from djang...
# Copyright (C) 2013,2014 Nippon Telegraph and Telephone Corporation. # Copyright (C) 2013,2014 YAMAMOTO Takashi <yamamoto at valinux co jp> # # 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 # ...
import os import sqlite3 from unittest import TestCase from contextlib2 import ExitStack from logbook import NullHandler, Logger from six import with_metaclass, iteritems from toolz import flip import pandas as pd import responses from .core import ( create_daily_bar_data, create_minute_bar_data, make_sim...
"""Core views, including the main homepage, post-commit build hook, documentation and header rendering, and server errors. """ from django.contrib.auth.models import User from django.core.urlresolvers import NoReverseMatch, reverse from django.conf import settings from django.http import HttpResponse, HttpResponseRed...
# Copyright 2009-2013 Reahl Software Services (Pty) Ltd. All rights reserved. # # This file is part of Reahl. # # Reahl is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation; version 3 of the Licen...
import math from datetime import timedelta as delta from glob import glob from os import path import numpy as np import pytest import dask from parcels import AdvectionRK4 from parcels import Field from parcels import FieldSet from parcels import JITParticle from parcels import ParticleFile from parcels import Partic...
"""Smart card insertion/removal monitoring classes. CardObserver is a base class for objects that are to be notified upon smart card insertion/removal. CardMonitor is a singleton object notifying registered CardObservers upon reader insertion/removal. __author__ = "http://www.gemalto.com" Copyright 2001-2012 gemalt...
from __future__ import absolute_import import six import sys from typing import Any, Dict, List, Optional, Union, Text if False: from mypy_extensions import NoReturn import jinja2 from django.test.signals import template_rendered from django.template.backends import jinja2 as django_jinja2 from django.template i...
#! /usr/bin/env python '''Simple Service Container -- use with wsdl2py generated modules. ''' import urlparse, types, os, sys, thread, cStringIO as StringIO from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer from ZSI import ParseException, FaultFromException, Fault from ZSI import _copyright, _seqtypes, ...
import datetime import graphene import operator from django.db.models import Q from graphene import relay from graphene_django import DjangoObjectType from graphene_django.debug import DjangoDebug from ..product.models import (AttributeChoiceValue, Category, Product, ProductAttribute, Pr...
############################################################################ # Monte M. Goode, LBNL # See LBNLCopyright for copyright notice! ########################################################################### # utility classes used by new generator - mostly 'sugar' classes # that are actually imported by the ...
# coding: utf-8 ''' A collection of mixins useful for the various *Client interfaces ''' from __future__ import print_function from __future__ import absolute_import import collections import logging import traceback import multiprocessing import weakref import salt.exceptions import salt.utils import salt.utils.event...
''' An execution module which can manipulate an f5 bigip via iControl REST :maintainer: Anthony Hawkins <anthonyhawkins917@gmail.com.com> :maturity: develop :depends: requests :platform: F5 BIGIP 11.6 iControl REST ''' # Import python libs import requests import requests.exceptions ...
#!/bin/env python """ News module for polybar that fetch news title from various websites and put them on polybar """ import random import time import os from pprint import pprint as p from threading import Thread import requests from bs4 import BeautifulSoup as soup def color_string(string, color_envron_var): """...
''' Manage the information in the hosts file ''' # Import python libs import os # Import salt libs import salt.utils import salt.utils.odict as odict # pylint: disable=C0103 def __get_hosts_filename(): ''' Return the path to the appropriate hosts file ''' # TODO: Investigate using "%SystemRoot%\sys...
# -*- coding: utf-8 -*- ''' Support for IFTTT .. versionadded:: Beryllium Requires an ``api_key`` in ``/etc/salt/minion``: .. code-block: yaml ifttt: secret_key: '280d4699-a817-4719-ba6f-ca56e573e44f' ''' # Import python libs from __future__ import absolute_import, print_function import json import loggi...
import os,sys,string,subprocess import argparse parser = argparse.ArgumentParser(description='snakemake and metacompass params') parser.add_argument("-t",'--threads', type=int,help='num threads',default=1, nargs='?') parser.add_argument("-i",'--iterations', type=int, help='num iterations',default=1, nargs='?') parser....
# -*- coding: utf-8 -*- ''' The match module allows for match routines to be run and determine target specs ''' from __future__ import absolute_import # Import python libs import inspect import logging import sys # Import salt libs import salt.minion import salt.utils from salt.defaults import DEFAULT_TARGET_DELIM fr...
# -*- coding: utf-8 -*- ''' The match module allows for match routines to be run and determine target specs ''' from __future__ import absolute_import # Import python libs import inspect import logging import sys # Import salt libs import salt.minion import salt.utils from salt.defaults import DEFAULT_TARGET_DELIM fr...
from django.db.models import signals as model_signals from django.db.models import FieldDoesNotExist, PositiveIntegerField from django.dispatch import dispatcher from django.utils.translation import ugettext as _ from mptt import models from mptt.signals import pre_delete, pre_save from mptt.managers import Tre...
# -*- coding: utf-8 -*- ''' Control the state system on the minion ''' # Import python libs import os import json import copy import shutil import time import logging import tarfile import datetime import tempfile # Import salt libs import salt.utils import salt.state import salt.payload from salt._compat import stri...
""" Created on 22.09.2009 @author: alen Inspired by: http://github.com/leah/python-oauth/blob/master/oauth/example/client.py http://github.com/facebook/tornado/blob/master/tornado/auth.py """ import time import base64 import urllib import urllib2 from oauth import oauth from openid.consumer import consumer as...
# -*- coding: utf-8 -*- ''' Special outputter for grains ============================ This outputter is a more condensed version of the :mod:`nested <salt.output.nested>` outputter, used by default to display grains when the following functions are invoked: * :mod:`grains.item <salt.modules.grains.item>` * :mod:`grai...
# -*- coding: utf-8 -*- r''' Execution of Salt modules from within states ============================================ With `module.run` these states allow individual execution module calls to be made via states. To call a single module function use a :mod:`module.run <salt.states.module.run>` state: .. code-block:: ...
from ngrams import jaccard, NGramSpace import numpy class SymmetricMatrix(object): def __init__(self, n): self.values = numpy.zeros((n, n)) self.mask = None def submatrix(self, ids): sub = SymmetricMatrix(0) sub.values = self sub.mask = ids return sub ...
from django.contrib.gis.geos import Point from busstops.models import Service from ...models import VehicleLocation, VehicleJourney from ..import_live_vehicles import ImportLiveVehiclesCommand class Command(ImportLiveVehiclesCommand): source_name = 'transdevblazefield' url = 'https://transdevblazefield.arctic...
import random,re from PIL import Image,ImageDraw from src.helpers.helpers import getArgsBy from src.helpers.getConfig import getConfigPart import multiprocessing as mp class DefaultImage(object): def __init__(self,width,height,theme,superSampling,fileName): self.width = width self.height = height ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Version: Fri 28 Mar 2014 # Initial build. # import os import time import numpy as np import pandas as pd import yaml # ... : ted # from ... import msg from ... import env # from ... import TEDError from ... import Namespace # . : ted.sdss.cutouts from . import load_...
import argparse import os from os import path import commands import sys import time # garbage collector import gc import numpy as np from scipy import signal from matplotlib import pyplot as plt import GPy import classes as cls import utilities as util from utilities import bcolors import rpy2.robjects as ro from...
from wandb import util, Image, Error, termwarn # assums X represents images and y_true/y_pred are logits for each class def image_categorizer_dataframe(x, y_true, y_pred, labels, example_ids=None): np = util.get_module('numpy', required='dataframes require numpy') pd = util.get_module('pandas', required='data...
# functions that implement analysis and synthesis of sounds using the Discrete Fourier Transform # (for example usage check dftModel_function.py in the models_interface directory) import numpy as np import math from scipy.fftpack import fft, ifft def dftModel(x, w, N): # Analysis/synthesis of a signal using the discr...
from __future__ import with_statement, unicode_literals import codecs import collections from cStringIO import StringIO from decimal import Decimal from fractions import Fraction, gcd import os try: from collections import OrderedDict except ImportError: # For Python versions < 2.7 from ordereddict import O...
# -*- coding: utf-8 -*- r''' Execution of Salt modules from within states ============================================ These states allow individual execution module calls to be made via states. To call a single module function use a :mod:`module.run <salt.states.module.run>` state: .. code-block:: yaml mine.sen...