gt
stringclasses
1 value
context
stringlengths
2.49k
119k
from zeroos.core0.client import Client from .Disk import Disks, DiskType from .Container import Containers from .StoragePool import StoragePools from .Network import Network from .healthcheck import HealthCheck from collections import namedtuple from datetime import datetime from io import BytesIO import netaddr import...
'''Author: Tyler Reddy The purpose of this Python module is to provide utility code for handling spherical Voronoi Diagrams.''' import scipy try: if int(scipy.__version__.split('.')[1]) < 13: raise ImportError('Module requires version of scipy module >= 0.13.0') except AttributeError: #handle this for sph...
# This file is part of Androguard. # # Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr> # All rights reserved. # # Androguard is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of th...
#!/usr/bin/env python #pylint: disable=W0312,C0111,C0330,R0913,C0326 import argparse import json import os import sys import random MIN_CRIMES = 4 SPECIAL_CONTEXT = 'notes' RULES_CONTEXTS = ['setup', 'ghost', 'psychics', SPECIAL_CONTEXT] FMT_KEY_SETUP = '%s_%d' REQUIRED_FIELDS_SET = ['id', 'setup', 'rules', 'cards...
from Tkinter import * import cv2 from PIL import Image, ImageTk import time import facial import os import threading import tkSimpleDialog import database as db global canvas ####################################### # Button Class ####################################### class Data(object): pass class Button(object): ...
import warnings from functools import partial from typing import Any, Callable, List, Optional, Sequence import torch from torch import nn, Tensor from .._internally_replaced_utils import load_state_dict_from_url from ..ops.misc import Conv2dNormActivation, SqueezeExcitation as SElayer from ..utils import _log_api_us...
import typing as t from . import nodes from .visitor import NodeVisitor VAR_LOAD_PARAMETER = "param" VAR_LOAD_RESOLVE = "resolve" VAR_LOAD_ALIAS = "alias" VAR_LOAD_UNDEFINED = "undefined" def find_symbols( nodes: t.Iterable[nodes.Node], parent_symbols: t.Optional["Symbols"] = None ) -> "Symbols": sym = Symb...
"""The tests for the Media group platform.""" from unittest.mock import patch import pytest from homeassistant.components.group import DOMAIN from homeassistant.components.media_player import ( ATTR_MEDIA_CONTENT_TYPE, ATTR_MEDIA_SEEK_POSITION, ATTR_MEDIA_SHUFFLE, ATTR_MEDIA_VOLUME_LEVEL, DOMAIN a...
""" The following file creates and executes models with SIR structure. It then graphs the results and presents the models" underlying compartmental structure. Although the structure of the model are simple and widely accepted, the specific parameter values are taken from the following text: "An Introduction to Infecti...
# Copyright 2017-present Adtran, 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 writ...
# # Copyright 2015 Quantopian, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
from logs import logDecorator as lD import jsonref, sqlite3 config = jsonref.load(open('../config/config.json')) logBase = config['logging']['logBase'] + '.databaseIO.sqLiteIO' @lD.log(logBase + '.getAllData') def getAllData(logger, query, values=None, dbName=None): '''query data from the database Query ...
# coding: utf-8 """ Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.8.2 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re ...
# This file is part of beets. # Copyright 2015, Adrian Sampson. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, ...
# -*- coding: utf-8 -*- from __future__ import print_function, absolute_import import sys import maya.cmds as cmds import maya.OpenMayaUI as OpenMayaUI import maya.OpenMaya as OpenMaya import maya.utils as utils from Qt import QtGui, QtCore, QtWidgets from .renderglobals import RenderGlobals from .utils import wait,...
import weakref import networkx as nx from openmdao.main.expreval import ConnectedExprEvaluator from openmdao.main.pseudocomp import PseudoComponent from openmdao.units import PhysicalQuantity class ExprMapper(object): """A mapping between source expressions and destination expressions""" def __init__(self, ...
"""Helper functions for the NAPALM base.""" import itertools import logging # std libs import os import re import sys from typing import Optional, Dict, Any, List, Union, Tuple, TypeVar, Callable from collections.abc import Iterable # third party libs import jinja2 import textfsm from lxml import etree from netaddr i...
#!/usr/bin/env python """Functional tests for tvnamer tests """ import os from functional_runner import run_tvnamer, verify_out_data from helpers import attr import pytest @attr("functional") def test_simple_single_file(): """Test most simple usage """ out_data = run_tvnamer( with_files = ['scr...
import datetime import decimal from importlib import import_module from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.db.backends import utils from django.utils import six, timezone from django.utils.dateparse import parse_duration from django.utils.encoding import for...
# -*- test-case-name: twisted.test.test_unix,twisted.internet.test.test_unix,twisted.internet.test.test_posixbase -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Various asynchronous TCP/IP classes. End users shouldn't use this module directly - use the reactor APIs instead. Maintain...
from collections import defaultdict from fcntl import LOCK_EX, LOCK_SH, LOCK_UN, flock from functools import wraps from math import floor from os import fsync, SEEK_SET, SEEK_END from time import time import json def accessor(f): @wraps(f) def wrapper(*args, **kwargs): args[0]._refresh() return...
import datetime import functools import json import operator import re import requests from django.conf import settings from django.contrib import auth from django.core import signing from django.db import transaction from django.db.models import Q, F from django.http import Http404, HttpResponseForbidden, HttpRespon...
""" Objects for dealing with polynomials. This module provides a number of objects (mostly functions) useful for dealing with polynomials, including a `Polynomial` class that encapsulates the usual arithmetic operations. (General information on how this module represents and works with polynomial objects is in the do...
#!/usr/bin/env python # # Copyright 2013, Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can # be found in the LICENSE file. import logging import os import subprocess import unittest import environment import utils import tablet # single shard / 2 tablets shard_0_...
# Copyright (c) 2014 GigaSpaces Technologies Ltd. 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 ...
#!/usr/bin/env python """ @package mi.dataset.parser @file marine-integrations/mi/dataset/parser/flort_dj_cspp.py @author Jeremy Amundson @brief Parser for the flort_dj_cspp dataset driver Release notes: initial release """ __author__ = 'Jeremy Amundson' __license__ = 'Apache 2.0' import numpy from mi.core.log imp...
"""A class for controling graph.""" import numpy as np import matplotlib.pyplot as plt from math import log10, ceil, sqrt from more_itertools import chunked import cPickle from .type import is_number, float_list class MGraph: """Control graphs and visualizaton.""" def __init__(self): self.dir_to_save ...
""" A workflow that contains cyclic graphs. Note that a special solver is required to converge this workflow in order to execute it. """ import networkx as nx from networkx.algorithms.components import strongly_connected_components from numpy import ndarray, hstack, array, empty, arange, ones from openmdao.main.array_h...
import io import os import re import string class Character(object): def __init__(self, left, right, bottom, top, text='', size=5.0, font='Courier'): self.text = text self.left = left self.right = right self.top = top self.bottom = bottom self.size = size se...
""" This module contains a class representing a Type 1 font. This version reads pfa and pfb files and splits them for embedding in pdf files. It also supports SlantFont and ExtendFont transformations, similarly to pdfTeX and friends. There is no support yet for subsetting. Usage:: >>> font = Type1Font(filename) ...
# 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 the Li...
# ----------------------------------------------------------------------------- # Copyright (c) 2014--, The Qiita Development Team. # # Distributed under the terms of the BSD 3-clause License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------------...
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. # MIT License. See license.txt from __future__ import unicode_literals import os, os.path, shutil # This code is original from jsmin by Douglas Crockford, it was translated to # Python by Baruch Even. The original code had the following copyright and # license...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compli...
from teafacto.core.base import Block, Var, Val, param, tensorops as T from IPython import embed # TODO: INPUT MASK !!!!!!!! and attention etc # TODO: what about memory mask? # TODO: MEMORY POSITION EMBEDDINGS/ENCODINGS # SYMBOLIC OUTPUT MEMORY ENABLED SEQ2SEQ # - can place attention over all of temporary created out...
#!/usr/bin/env python import os import sys # For coverage. if __package__ is None: sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/..") from unittest import main, TestCase import requests import requests_mock from iris_sdk.client import Client from iris_sdk.models.account import Account from iri...
# -*- coding: utf-8 -*- """ OSM Deviation Finder - Web Interface ~~~~~~~~~~~~~~~~~~~~ Implementation of a web interface for the OSM Deviation Finder library. It uses the flask microframework by Armin Ronacher For more information see https://github.com/mitsuhiko/flask/ To interact with the Ge...
import datetime import os import re import time from pprint import pformat from urllib import urlencode, quote from urlparse import urljoin try: from cStringIO import StringIO except ImportError: from StringIO import StringIO try: # The mod_python version is more efficient, so try importing it first. fr...
#!/usr/bin/env python # # Copyright 2017 Brocade Communications 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/...
'Creates two csv data files parsed from existing JSON data' from bs4 import BeautifulSoup import urllib2 import json import csv import time import requests import os import unicodedata import logging from urlparse import urlparse def load_data(file_name): ' Returns a list from csv data ' csv_data = [] wit...
# Copyright (c) 2003-2005 Jimmy Retzlaff, 2008 Konstantin Yegupov # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy...
# coding: utf-8 # # Copyright 2021 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 requi...
import __builtin__ import contextlib import os import unittest import shutil import tempfile import StringIO from pywatchman import bser from .buck import BuildFileProcessor, Diagnostic, add_rule, process_with_diagnostics def foo_rule(name, srcs=[], visibility=[], build_env=None): add_rule({ 'buck.type'...
#!/usr/bin/python # -*- coding: utf-8 -* # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = ''' --- module: aws_kms sho...
# Copyright (c) 2011 Florian Mounier # Copyright (c) 2012, 2014-2015 Tycho Andersen # Copyright (c) 2013 Mattias Svala # Copyright (c) 2013 Craig Barnes # Copyright (c) 2014 ramnes # Copyright (c) 2014 Sean Vig # Copyright (c) 2014 Adi Sieker # Copyright (c) 2014 Chris Wesseling # # Permission is hereby granted, free o...
############################################################################### # # The MIT License (MIT) # # Copyright (c) Tavendo GmbH # # 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 with...
from __future__ import division import math import json import itertools import cPickle as pickle from multiprocessing import Pool, cpu_count from collections import namedtuple from text_normalize import normalize_text, n_grams from similarity import jaccard_sim, cosine_sim, page_sim from ermdb import db_open, db_close...
# Add mouse controls # add half size paddle after hitting back wall import math, pygame, sys, shutil, getpass from pygame.locals import * pygame.init() fpsClock = pygame.time.Clock() screen = pygame.display.set_mode((640, 480)) # create screen - 640 pix by 480 pix pygame.display.set_caption('Breakout') # set title ...
# -*- coding: iso-8859-15 -*- # ================================================================= # # Authors: Tom Kralidis <tomkralidis@gmail.com> # # Copyright (c) 2015 Tom Kralidis # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation # files...
# -*- coding: utf-8 -*- # This file is part of beets. # Copyright 2015, Adrian Sampson. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation t...
# 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 agree...
# MySQL Connector/Python - MySQL driver written in Python. # Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. # MySQL Connector/Python is licensed under the terms of the GPLv2 # <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most # MySQL Connectors. There are special exceptio...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2012-2017 Snowflake Computing Inc. All right reserved. # import logging import re import signal import sys import uuid from logging import getLogger from threading import (Timer, Lock) from six import u from .chunk_downloader import (DEFAULT_CLIENT_RESUL...
# some methods should use 'put' instead of 'get' # some seem to require 'delete' now? # use the right (latest) version of this: # http://s3.amazonaws.com/h2o-release/h2o-dev/master/1019/docs-website/REST/endpoints/markdown/toc.md import os, sys, time, requests, zipfile, StringIO, re import h2o_args # from h2o_cmd imp...
"""Attempts to figure out what version of things we're using in playdoh-lib. This is made exceedingly difficult because of the following things: 1. We install with pip to lib/python/, but nix the .egg-info files so we have no clue what we installed unless the package also has the version information tucked away ...
import zlib import logging from .lzw import lzwdecode from .ascii85 import ascii85decode from .ascii85 import asciihexdecode from .runlength import rldecode from .ccitt import ccittfaxdecode from .psparser import PSException from .psparser import PSObject from .psparser import LIT from . import settings from .utils im...
""" Test various information theory inequalities. """ from hypothesis import given, settings import pytest import numpy as np from dit.utils.testing import distributions, markov_chains from dit import ScalarDistribution as SD from dit.divergences import (chernoff_information, hellinger...
# # 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 # ...
# -*- coding: utf-8 -*- """ Django settings for contmon project. For more information on this file, see https://docs.djangoproject.com/en/dev/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/dev/ref/settings/ """ from __future__ import absolute_import, unicode_lit...
#!/usr/bin/env python import numpy as np from dynamics import LinearDynamics from distance import EuclideanDist class FeatureBase(object): def __init__(self): pass def __call__(self, *args): return self.f(*args) def f(self, *args): raise Exception("method must be implemented by ...
# -*- coding: UTF-8 -*- ## Base modules import numpy as np import os, re import pandas as pd import zipfile zf = zipfile.ZipFile( './train.csv.zip' ) df = pd.read_csv( zf.open( 'train.csv' ) )#, nrows = 1000 ) ## Take a random small subsample of the train data from sklearn.cross_validation import train_test_split #...
#!/usr/bin/env python # This script is used to update the version of mbed-os used within a specified set of example # applications. The list of examples to be updated lives in the examples.json file and is # shared with the examples.py script. Logging is used to provide varying levels of output # during execution. # ...
from builtins import hex from builtins import object import json import os from random import SystemRandom import shutil from uuid import UUID from devp2p.service import BaseService from ethereum.tools import keys from ethereum.slogging import get_logger from ethereum.utils import privtopub # this is different than t...
""" Tests for `kolibri` module. """ from __future__ import absolute_import, print_function, unicode_literals import unittest import kolibri import mock from kolibri.utils import version #: Because we don't want to call the original (decorated function), it uses #: caching and will return the result of the first call...
# Copyright 2019 DeepMind Technologies Limited. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed...
# 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...
from django.db import models from django.conf import settings from django.db.models.signals import post_delete from django.template.loader import render_to_string import libvirt from insekta.common.virt import connections from insekta.network.models import Address RUN_STATE_CHOICES = ( ('disabled', 'VM is not cre...
#!/usr/bin/python3 """Statistics module """ from db_queries import query_stats_module, query_get_nature from experience import Experience class Statistics(Experience): """The Statistics Class. Parameters ---------- dex_no : integer, required The national dex number for the pokemon you are ca...
""":mod:`sass` --- Binding of ``libsass`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This simple C extension module provides a very simple binding of ``libsass``, which is written in C/C++. It contains only one function and one exception type. >>> import sass >>> sass.compile(string='a { b { color: blue; } }') 'a b {...
# -*- coding: utf-8 -*- """ Base settings file, common to all environments. These settings can be overridden in local.py. """ import datetime import os import json import hashlib from datetime import timedelta from collections import OrderedDict os_env = os.environ def parent_dir(path): '''Return the parent of ...
# Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
from __future__ import annotations from collections.abc import Callable # noqa: PDF001 import re import textwrap import unicodedata import numpy as np import pandas._libs.lib as lib import pandas._libs.missing as libmissing import pandas._libs.ops as libops from pandas._typing import ( Dtype, Scalar, ) fro...
import pdb import os #=============================================================================== # Application-Specific Utilities #=============================================================================== import ssa.globals as g def isverbose(verbose=False): if verbose: return True if g.arg...
# # Written by Maxim Khitrov (July 2011) # from gzip import GzipFile from . import conf from .util import * import functools import hashlib import logging import os import shutil import sqlite3 import time import traceback log = logging.getLogger('gmdb.db') # Signed <-> unsigned conversion for 64-bit INTEGER colu...
''' Author: Tobi and Gundram ''' from __future__ import print_function import tensorflow as tf from tensorflow.python.ops import ctc_ops as ctc from tensorflow.contrib.layers import batch_norm from tensorflow.python.ops import rnn_cell from tensorflow.python.ops import control_flow_ops from tensorflow.python.ops.rnn ...
#import urllib2 import urllib import subprocess import time import os.path import sys import getopt from Bio.PDB import * import openbabel import pybel import yaml from rdkit import Chem from rdkit.Chem import AllChem from rdkit.Chem import Draw import re import os from collections import Counter import numpy as n...
""" Copyright 2013 OpERA 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, softwar...
# -*- coding: utf-8 -*- from __future__ import division import inspect from decimal import ROUND_DOWN, Decimal from django.conf import settings from django.core.exceptions import ValidationError from django.db import models from django.db.models import F from django.db.models.signals import class_prepared from django...
"""Support for LCN covers.""" import pypck from homeassistant.components.cover import CoverEntity from homeassistant.const import CONF_ADDRESS from . import LcnEntity from .const import CONF_CONNECTIONS, CONF_MOTOR, CONF_REVERSE_TIME, DATA_LCN from .helpers import get_connection PARALLEL_UPDATES = 0 async def asyn...
# -*- encoding: utf-8 -*- import PointDefine_pb2 import ctypes import json from flask import abort, make_response import dicttoxml import string class LibConfig(ctypes.Structure): _fields_=[('kMatchRadius', ctypes.c_int), ('kMatchAngle', ctypes.c_int), ('kMinTimeInterval', ctypes.c_int...
# 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...
"""Compat module to handle files security on Windows and Linux""" from __future__ import absolute_import import errno import os # pylint: disable=os-module-forbidden import stat import sys from typing import Any from typing import Dict from typing import List from typing import Optional try: import ntsecuritycon...
# 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 required by applicable law or agreed t...
# Copyright 2014 Nervana 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 required by applicable ...
# coding: utf-8 """This module contains decorators for parallel vectorization of functions. The decorators vectorize the function over the first argument and return a list of the returned results of the functions. The main decorator is vectorize_parallel that supports parallelization via the multiprocessing module or ...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compli...
# Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
# !/usr/bin/python # -*- coding: utf-8 -*- # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # # The MIT License (MIT) # # Copyright (c) 2017 Jorge A. Gomes (jorgegomes83 at hotmail dot com) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this softwar...
""" Differential Equations in Action Lesson 1 - Houston We have a problem """ # Import import math # import math.cos(), math.sin(), math.pi import numpy # import distance import matplotlib.pyplot as plt # import plot """ ----------------------------------------------------------------------- - 1 - Exercices ----...
# coding=utf-8 # Copyright 2022 The Trax Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
# coding: utf-8 # ## Introduction # # I obtained this Fort Lauderdale Police Department data from the City of Fort Lauderdale via the [Fort Lauderdale Civic Hackathon](http://ftlcivichackathon.com/). # # See my blog post about [my participation in the hackathon]({filename}../hackathons/code-for-ftl-hackathon.rst). ...
## # @file weighted_average_wirelength_unitest.py # @author Yibo Lin # @date Mar 2019 # import os import sys import time import numpy as np import unittest #import pickle import gzip if sys.version_info[0] < 3: import cPickle as pickle else: import _pickle as pickle sys.path.append( os.path.dirname(os...
import csv import json import re from datetime import datetime, timedelta from django.http import Http404, JsonResponse, StreamingHttpResponse from django.urls import reverse from django.utils.decorators import method_decorator from django.utils.translation import ugettext_lazy as _ from django.views.decorators.http i...
from datetime import datetime import endpoints from protorpc import messages from protorpc import message_types from protorpc import remote from google.appengine.ext import ndb from google.appengine.api import memcache from google.appengine.api import taskqueue from models import BooleanMessage from models import C...
from threading import Thread import pytest from .common import * # NOQA from rancher import ApiError K8S_VERSION = os.environ.get('RANCHER_K8S_VERSION', "") K8S_VERSION_UPGRADE = os.environ.get('RANCHER_K8S_VERSION_UPGRADE', "") POD_SECURITY_POLICY_TEMPLATE = \ os.environ.get('RANCHER_POD_SECURITY_POLICY_TEMPLATE...
# 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 agree...
''' Created on Jan 1, 2014 @author: Chris TODO: Sanitize all GetValue inputs (to check that there's actual data there. ''' import wx from abc import ABCMeta from abc import abstractmethod from gooey.gui import styling EMPTY = '' class BuildException(RuntimeError): pass class AbstractGuiComponent(object):...
import torch import torch.nn as nn import numpy as np import pysurvival.utils.optimization as opt # --------------------------- Activation Functions --------------------------- # class Swish(nn.Module): def forward(self, x): return x * torch.sigmoid(x) class Gaussian(nn.Module): def forward(self, x):...
#!/usr/bin/env python2 # transpiled with BefunCompile v1.3.0 (c) 2017 import sys import zlib, base64 _g = ("Ah+LCAAAAAAABACT7+ZgAAEWhre3D+ZddhBguBBfOPeJkPnZXcfWbtISE38nU71hEtcKnYVKa7iKXh3fvM7LlU+TsVPqyvclFY+/VojOV9sslb/Z/XTqt3ffTi9/zR+/" + "efv9vHX5m48W/Pv37Fdx2FVJsPkbrrMwjIJRMAqGPKjYaAQkE0p8/xnWh55/vpGndu6+848zXzxX...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compli...