gt
stringclasses
1 value
context
stringlengths
2.49k
119k
import json from copy import deepcopy from typing import Any, Dict import bmds import pytest from bmds.bmds3.recommender import RecommenderSettings from django.core.exceptions import ValidationError from bmds_server.analysis import validators def _missing_field(err, missing_field: str): data = json.loads(err.va...
import re from unittest import mock from .. import * from bfg9000 import shell from bfg9000.languages import Languages from bfg9000.path import Root from bfg9000.tools import cc, common known_langs = Languages() with known_langs.make('c') as x: x.vars(compiler='CC', flags='CFLAGS') def mock_which(*args, **kwar...
# Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
""" blockfeed: sync with and process new blocks from paytokensd """ import re import os import sys import json import copy import logging import datetime import decimal import ConfigParser import time import pymongo import gevent from lib import config, util, events, blockchain, util_jetcoin from lib.components impor...
from datetime import date, datetime, time import math from dateutil.rrule import rrule, DAILY, MONTHLY import matplotlib.pyplot as plt import networkx as nx import nltk from scipy.stats import chisquare from message import Message import plot class EmptyConversationError(Exception): """ Raised when we try to...
import hashlib import logging import random import re import time from datetime import datetime, timedelta from django.conf import settings from django.contrib.auth.models import User, Group from django.contrib.sites.models import Site from django.db import models from celery.task import task from statsd import stats...
# --------------------------------------------------------------------------- # # BALLOONTIP wxPython IMPLEMENTATION # Python Code By: # # Andrea Gavana, @ 29 May 2005 # Latest Revision: 23 Nov 2009, 09.00 GMT # # # TODO List/Caveats # # 1. With wx.ListBox (And Probably Other Controls), The BalloonTip Sometimes # Fl...
from django.test import tag from rest_framework.test import APIRequestFactory from rest_framework.views import APIView from rest_framework.test import APITestCase, force_authenticate, APIClient from rest_framework.mixins import \ RetrieveModelMixin, ListModelMixin, CreateModelMixin, UpdateModelMixin from rest_frame...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Generated from FHIR 1.0.2.7202 on 2016-06-23. # 2016, SMART Health IT. import io import json import os import unittest from . import organization class OrganizationTests(unittest.TestCase): def instantiate_from(self, filename): datadir = os.environ.ge...
"""Support for HomematicIP Cloud lights.""" import logging from homeassistant.components.light import ( ATTR_BRIGHTNESS, ATTR_COLOR_NAME, ATTR_HS_COLOR, SUPPORT_BRIGHTNESS, SUPPORT_COLOR, Light) from . import DOMAIN as HMIPC_DOMAIN, HMIPC_HAPID, HomematicipGenericDevice _LOGGER = logging.getLogger(__name__) ...
# # Project: # glideinWMS # # File Version: # # Desscription: # This module contains the create_glidein params class # # Author: # Igor Sfiligoi # import os import copy import sys import os.path import string import socket import types import traceback from glideinwms.lib import xmlParse from glideinwms.lib imp...
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
# -*- coding: utf-8 -*- # pylint: disable-msg=W0612,E1101 import pytest from pandas import DataFrame, Series import pandas as pd from numpy import nan import numpy as np from pandas.util.testing import assert_frame_equal from pandas.core.reshape.reshape import ( melt, lreshape, get_dummies, wide_to_long) impor...
from mongrel2 import config from mongrel2.config import args import mongrel2.config.commands from uuid import uuid4 from mongrel2.config import model import getpass import sys import os import signal from sqlite3 import OperationalError def try_reading(reader): try: cmd = reader.readline() return ...
import random import string # iframe_locators - all iframes that need to be traversed # to get to this object # iframe_locator_ids - keys into the obj's owner's locatordict for iframes # current_framelevel - index of the current iframe in iframe_locators class IframeTracker(object): def ...
# -*- coding: utf-8 -*- # Copyright (C) 2017 Nippon Telegraph and Telephone 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-2.0 # #...
#!/usr/bin/env python3 import argparse import csv import cv2 import skvideo.io # pip3 install sk-video import json import math import numpy as np import os from tqdm import tqdm from props import PropertyNode import props_json import sys sys.path.append('../scripts') from lib import transformations im...
''' Provide base classes for the Bokeh property system. .. note:: These classes form part of the very low-level machinery that implements the Bokeh model and property system. It is unlikely that any of these classes or their methods will be applicable to any standard usage or to anyone who is not direc...
""" player.py Contains the definition of the Player class. Written by: Mohsin Rizvi Last edited: 09/28/17 """ import ability import item import bio import zone import random import damage # The Player character. class Player: # Purpose: Constructor for the Player class. # Parameters: A name for the Pla...
# Copyright 2009 The Closure Library 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 a...
# # 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...
""" Get ride details and liveboard details for NMBS (Belgian railway). For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.nmbs/ """ import logging import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistan...
# -*- test-case-name: twisted.test.test_failure -*- # See also test suite twisted.test.test_pbfailure # Copyright (c) 2001-2008 Twisted Matrix Laboratories. # See LICENSE for details. """ Asynchronous-friendly error mechanism. See L{Failure}. """ # System Imports import sys import linecache import inspect import o...
from datetime import datetime import hashlib # Library to read Blizzards MPYQ files import mpyq # Import the oldest protocol to read the replay header, which works with every # replay version from s2protocol import protocol15405 from heroprotocol import protocol29406 ## Evaluates blizzard based replays and provides ...
from datasets import dataset_factory import tensorflow as tf import matplotlib.pyplot as plt import tensorflow.contrib.slim as slim from nets import nets_factory from preprocessing import preprocessing_factory import numpy as np class SlimTrainMgr(): def __init__(self): self.dataset_name = 'flowers' ...
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import os from colle...
from django.http import Http404, HttpResponse, HttpResponseRedirect from django.core.exceptions import SuspiciousOperation from django.utils.decorators import classonlymethod from django.utils.decorators import method_decorator from django.utils.translation import ugettext_lazy as _ from django.shortcuts import render_...
# -*- coding: utf-8 -*- from itertools import product import numpy as np import pytest from pandas._libs import hashtable from pandas.compat import range, u from pandas import DatetimeIndex, MultiIndex import pandas.util.testing as tm @pytest.mark.parametrize('names', [None, ['first', 'second']]) def test_unique(...
import copy from collections import Iterable import numpy as np import pandas as pd import dask import dask.threaded from dask import delayed from dask.compatibility import reraise from dask.threaded import pack_exception from sklearn.preprocessing import Imputer from . import time_series from .time_series import Time...
# Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2013 NTT MCL Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the...
# 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...
# coding: utf-8 import re import logging import time import functools from . import httpbroker from . import exceptions logger = logging.getLogger(__name__) ITEMS_PER_REQUEST = 50 API_VERSIONS = ('v1',) RESOURCE_PATH_PATTERN = re.compile(r'/api/(\w+)/(\w+)/(\d+)/') class Connector(object): """ Encapsulate...
#!/usr/bin/env python # # Copyright (c) 2014 Juniper Networks, Inc. All rights reserved. # # # analytics_stattest.py # # System tests for analytics # import os import sys import threading threading._DummyThread._Thread__stop = lambda x: 42 import signal import gevent from gevent import monkey monkey.patch_all() impo...
from decimal import Decimal as D import zlib from django.db import models from django.db.models import Sum from django.conf import settings from django.utils.timezone import now from django.utils.translation import ugettext_lazy as _ from django.core.exceptions import ObjectDoesNotExist, PermissionDenied from oscar.a...
# Copyright 2016 PLUMgrid, 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 ...
from enum import Enum from uuid import uuid4, UUID from typing import Dict, Set, List, Type, ClassVar, Any, Optional, Tuple import semver from base64 import urlsafe_b64encode, urlsafe_b64decode from . import AccessRights, AccessRightsSet, Platform PlatformVersion = str PlatformRequirements = Dict[Platform, PlatformVer...
# Copyright 2013 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals, print_function from frappe.utils.minify import JavascriptMinify import warnings from six import iteritems, text_type import subprocess from distutils.spawn import find_executabl...
from __future__ import absolute_import, unicode_literals # unicode_literals ensures that any render / __str__ methods returning HTML via calls to mark_safe / format_html # return a SafeText, not SafeBytes; necessary so that it doesn't get re-encoded when the template engine # calls force_text, which would cause it to l...
# (c) 2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible 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 lat...
''' Copyright (c) 2017 Yogesh Khatri This file is part of mac_apt (macOS Artifact Parsing Tool). Usage or distribution of this software/code is subject to the terms of the MIT License. terminalstate.py --------------- This plugin reads Terminal Saved State information which includes full text ...
import ast import os from os.path import expanduser import shutil import time import yaml from kubernetes import client, config from googleapiclient import discovery from oauth2client.client import GoogleCredentials from server.common import constants from server.common import common_functions from server.common imp...
""" threadly a simple threadpool and scheduler for python. """ import threading import logging try: from Queue import Queue from Queue import Empty as EmptyException except: from queue import Queue, Empty as EmptyException from threadly.Structures import SortedLockingList from threadly.KeyedExecutor impor...
import boto3 accessanalyzer = boto3.client("accessanalyzer") """:type : pyboto3.accessanalyzer""" acm = boto3.client("acm") """:type : pyboto3.acm""" acm_pca = boto3.client("acm-pca") """:type : pyboto3.acm_pca""" alexaforbusiness = boto3.client("alexaforbusiness") """:type : pyboto3.alexaforbusiness""" amplify = boto3...
"""Implements a Nvim host for python plugins.""" import imp import inspect import logging import os import os.path import re from functools import partial from traceback import format_exc from pynvim.api import decode_if_bytes, walk from pynvim.compat import IS_PYTHON3, find_module from pynvim.msgpack_rpc import Error...
# -*- coding: utf-8 -*- ''' Scheduling routines are located here. To activate the scheduler make the schedule option available to the master or minion configurations (master config file or for the minion via config or pillar) code-block:: yaml schedule: job1: function: state.sls seconds: 360...
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import logging import os import numpy as np from fairseq.data import ( data_utils, Dictionary, AppendTokenDataset, ConcatDat...
"""Test for certbot_apache._internal.http_01.""" import unittest import errno from typing import List try: import mock except ImportError: # pragma: no cover from unittest import mock # type: ignore from acme import challenges from certbot import achallenges from certbot import errors from certbot.compat impo...
""" Parsing framework in Python, similar to pyparsing and boost::spirit Author: Markus Brueckner (dev@slash-me.net) License: This code is in the public domain FAQ: What's 'yeanpypa' anyway? YEt ANother PYthon PArser framework. Virtually perfectly creative acronym... """ import logging class InputReader(object): ...
from ggame import App, RectangleAsset, ImageAsset, Sprite, LineStyle, Color, Frame from random import randrange black = Color(0x000000, 1.0) blue = Color(0x2D9FC2,1.0) white = Color(0xFFFFFF, 1.0) red = Color(0xFC5D5D,1.0) grey = Color(0x858585,1.0) thinline = LineStyle(1, black) celld = 35 rectangle3 = RectangleAsset(...
# Copyright (c) 2010-2014 Turbulenz Limited """ Controller class for deploying a game """ from urllib3.exceptions import HTTPError, SSLError from simplejson import dump as json_dump, load as json_load, loads as json_loads, JSONDecodeError from os import stat, sep, error, rename, remove, makedirs, utime, access, R_OK, ...
# 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 ...
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
# Copyright 2015-2019 Capital One Services, 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 ...
#!/usr/bin/python # # Urwid raw display module # Copyright (C) 2004-2009 Ian Ward # # This library 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 # version 2.1 of the License, or...
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
#!/usr/bin/env python """ bakman.py is a generic Linux backup tool. Backups are defined in a Python-based configuration file as a set of parts that can be run invidually or in any seqeuence. Each part consists of one or more steps that typically include mount, running of a backup, and unmount actions. bakman.py can bo...
# Copyright (c) 2014 Cisco Systems, 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 r...
#!/usr/bin/env python ''' BackdoorFactory (BDF) v3 - FOUNTAINPATCH Many thanks to Ryan O'Neill --ryan 'at' codeslum <d ot> org-- Without him, I would still be trying to do stupid things with the elf format. Also thanks to Silvio Cesare with his 1998 paper (http://vxheaven.org/lib/vsc01.html) which these ELF patching ...
import copy as cp import logging from pySDC import Stats as statclass class level(): """ Level class containing all management functionality for a single level A level contains all data structures, types and objects to perform sweeps on this particular level. It does not know about other levels. ...
# Copyright (c) 2012, GPy authors (see AUTHORS.txt). # Licensed under the BSD 3-clause license (see LICENSE.txt) import numpy as np import itertools from paramz.caching import Cache_this from .kern import CombinationKernel, Kern from functools import reduce class Add(CombinationKernel): """ Add given list of ...
"""Tests for import.""" import unittest from pytype import utils from pytype.tests import test_inference class ImportTest(test_inference.InferenceTest): """Tests for import.""" def testBasicImport(self): with self.Infer("""\ import sys """, deep=True, solve_unknowns=True) as ty: self.asse...
''' Basic definition of the elements available for building CloudFormation stack templates @author: David Losada Carballo <david@tuxpiper.com> ''' import copy class CfnSimpleExpr(object): """ A static CloudFormation expression (i.e { "Ref" : "AWS::StackName" }) """ def __init__(self, definition): ...
# -*- coding: utf-8 -*- # pylint: disable=no-member, line-too-long from builtins import str # pylint: disable=redefined-builtin import datetime import json import os import time import arrow from requests_oauthlib import OAuth1Session from django.conf import settings from django.core.management.base import BaseCom...
import json from contextlib import contextmanager from tempfile import NamedTemporaryFile import pytest from nose.tools import eq_ import amo import amo.tests from addons.models import Addon from applications.models import AppVersion from files.models import File from files.utils import find_jetpacks, is_beta, Packag...
# -*- coding: utf-8 -*- # Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
# Copyright 2012 Nebula, 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 agree...
""" This module defines Scripts, out-of-character entities that can store data both on themselves and on other objects while also having the ability to run timers. """ from twisted.internet.defer import Deferred, maybeDeferred from twisted.internet.task import LoopingCall from django.core.exceptions import ObjectDoes...
''' 1. brute force: check every single combo of placements, 64C8 (4 bil) 2. brute force: constrain each queen to a column, 8^8 (16 mil) 3. permutations: constrain each queen to a column and row, 8! (40 k) 4. backtracking, from brute force: (15 k) 5. backtracking, with permutations (5 k) # TODO # 2. backtracking all n^...
#!/usr/bin/python # This file is part of python-evtx. # # Copyright 2012, 2013 Willi Ballenthin <william.ballenthin@mandiant.com> # while at Mandiant <http://www.mandiant.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance...
from __future__ import unicode_literals import re from decimal import Decimal from django.contrib.gis.db.models import functions from django.contrib.gis.geos import LineString, Point, Polygon, fromstr from django.db import connection from django.test import TestCase, skipUnlessDBFeature from django.utils import six ...
# No shebang line, this module is meant to be imported # # Copyright 2013 Oliver Palmer # # 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...
#!/usr/bin/python # Copyright 2014 Google Inc. All Rights Reserved. """License checking utility. Utility for checking and processing licensing information in third_party directories. Usage: steel_licenses.py <command> <build_dir> [<output_file>] build_dir is the directory where build products are generated. Comman...
#!/usr/bin/python # -*- coding:utf-8 -*- #dependence: paho-mqtt (pip install paho-mqtt) # XBee (pip install XBee) # PyYAML (pip install PyYaml) # pyserial (pip install pyserial) import os import sys import time import logging import yaml from serial import Serial from factory import *...
import os import random import datetime from hashlib import md5 import redis import simplejson import celery import magic from googleapiclient.http import MediaFileUpload from celery.utils.log import get_task_logger from celery import Celery, current_task from sqlalchemy.exc import IntegrityError from sqlalchemy impor...
"""Code to auto-download images. Note: instantiate only one of these per instrument, regardless of how many copies of ExposeStatusWdg there are, to avoid downloading duplicate images. 2009-05-05 ROwen Extracted from ExposeModel.py and improved to support various modes 2009-05-06 ROwen Modified to use getEvery d...
#!/usr/bin/env python2 """ Generate demo test-results data. This program is used to create fake results from daily runs against a hypothetical user database called "Westwind". This hypothetical database has the following tables within it: - cust_type - a small, non-partitioned lookup table with 5 r...
# Copyright 2017 Balazs Nemeth # # 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, s...
# # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # ...
# Copyright 2014 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Classes of failure types.""" import collections import sys import traceback from chromite.cbuildbot import portage_utilities from chromite.lib import...
# Licensed to Elasticsearch under one or more contributor # license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright # ownership. Elasticsearch licenses this file to you under # the Apache License, Version 2.0 (the "License"); you may # not use this file except...
# -*- coding: utf-8 -*- import re import logging import urlparse import itertools import datetime as dt import bson import pytz import itsdangerous from modularodm import fields, Q from modularodm.validators import URLValidator from modularodm.exceptions import NoResultsFound from modularodm.exceptions import Validat...
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2012 OpenStack Foundation. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www....
import datetime import decimal import re import random from cStringIO import StringIO from string import letters from hashlib import md5 # LIBRARIES from django.core.files.uploadhandler import StopFutureHandlers from django.core.cache import cache from django.core.exceptions import ValidationError from django.db impo...
# # # Shadow3 python script to scan a variable # # # It uses the currently defined Shadow system (files start.00...start.03) # # It scans a list of variables, e.g., the distances T_SOURCE and T_IMAGE of # the first and second o.e., respectively. # It also sets the o.e.2 radius accordingly. # # Output: a file ex18b.sp...
from __future__ import absolute_import, unicode_literals from django.core.urlresolvers import reverse from django.db.models.functions import Lower from django.utils.http import urlencode from tracpro.charts.formatters import format_series, format_x_axis from tracpro.groups.models import Region from .models import An...
from __future__ import absolute_import, division, print_function, with_statement import datetime import os import sys from tornado.options import OptionParser, Error from tornado.util import basestring_type from tornado.test.util import unittest try: from cStringIO import StringIO # python 2 except ImportError:...
"""Visualize a neural network as a (dot) graph. This module provides functions and classes to generate dot graphs for a given lasagne model or a list of layers. It provides e.g. the ability to "draw" a model "to_notebook", pretty much exactly like `nolearn <https://github.com/dnouri/nolearn>`_ via: >>> from utils.vis...
"""README, Author - Anurag Kumar(mailto:anuragkumarak95@gmail.com) Requirements: - sklearn - numpy - matplotlib Python: - 3.5 Inputs: - X , a 2D numpy array of features. - k , number of clusters to create. - initial_centroids , initial centroid values generated by utility function(mentioned in usage)....
import argparse import csv, os, time import psycopg2 # psycopg2 v2.5.1 import sys sys.path.append('../modules') from result import Result # Get command line arguments parser = argparse.ArgumentParser(description='Load SNP and locus data') parser.add_argument('--dev', action='store_true', help='Only load chromosome 2...
''' LICENSING ------------------------------------------------- loopa: Arduino-esque event loop app framework, and other utilities. Copyright (C) 2016 Muterra, Inc. Contributors ------------ Nick Badger badg@muterra.io | badg@nickbadger.com | nickbadger.com This library is free softwa...
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import six from builtins import str import tempfile, time, os, re, sys, filecmp, shutil, requests, json import uuid, random, base64 from datetime ...
# -*- coding: utf-8 -*- # Copyright 2013 Takeshi KOMIYA # # 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...
from pathlib import Path import subprocess import re import sys import urllib.request import urllib.error import json from django.core.management.base import BaseCommand from django.conf import settings from django.db import connections from django.db.utils import OperationalError ELASTICSEARCH_MIN_VERSION = (2, 0, 0)...
from typing import Dict, List, Optional, Union, cast from django.db.models.query import QuerySet from django.utils.translation import ugettext as _ from django.conf import settings from zerver.lib.cache import generic_bulk_cached_fetch, user_profile_cache_key_id, \ user_profile_by_id_cache_key from zerver.lib.req...
import sublime import sublime_plugin import re def find_in_range(view, term, start, end, flags=0): found = view.find(term, start, flags) if found and found.b <= end: return found def find_all_in_range(view, term, start, end, flags=0): matches = [] while True: m = find_in_range(view,...
from chainer.functions.array import concat from chainer.functions.loss import softmax_cross_entropy as S from chainer.functions.noise import dropout from chainer.functions.pooling import average_pooling_2d as A from chainer.functions.pooling import max_pooling_2d as M from chainer import link from chainer.links.connect...
""" GeometryElement describes the geometric entities of a finite element mesh. Notes ----- * geometry_data: surface facets are assumed to be of the same kind for each geometry element - wedges or pyramides are not supported. * the orientation is a tuple: (root1, vertices of direction vectors, swap from, swap to, r...