gt
stringclasses
1 value
context
stringlengths
2.49k
119k
# -*- coding: utf-8 -*- from __future__ import print_function from south.v2 import DataMigration class Migration(DataMigration): def forwards(self, orm): from django.db.models import F from collections import defaultdict from sentry.db.models import create_or_update from sentry.u...
# This file is part of Indico. # Copyright (C) 2002 - 2021 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from sqlalchemy.dialects.postgresql import ARRAY from sqlalchemy.ext.hybrid import hybrid_property from i...
from __future__ import absolute_import, unicode_literals import itertools import django from django import template from django.conf import settings from django.contrib.humanize.templatetags.humanize import intcomma from django.contrib.messages.constants import DEFAULT_TAGS as MESSAGE_TAGS from django.template.defaul...
import math import sys from rpython.rlib.rarithmetic import LONG_BIT from rpython.rlib.rbigint import rbigint from ..base import BaseTopazTest class TestFixnumObject(BaseTopazTest): def test_addition(self, space): w_res = space.execute("return 1 + 2") assert space.int_w(w_res) == 3 w_re...
import base64 import os import shutil import string import sys import tempfile import unittest from datetime import timedelta from django.conf import settings from django.contrib.sessions.backends.cache import SessionStore as CacheSession from django.contrib.sessions.backends.cached_db import \ SessionStore as Cac...
# -*- coding: utf-8 -*- # # Copyright (C) 2012-2015 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # import gzip from io import BytesIO import json import logging import os import posixpath import re try: import threading except Impo...
# Copyright (c) 2009, Google Inc. All rights reserved. # Copyright (c) 2009 Apple Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the abov...
# Authors: Manoj Kumar mks542@nyu.edu # License: BSD 3 clause import numpy as np from scipy import optimize, sparse from sklearn.utils._testing import assert_almost_equal from sklearn.utils._testing import assert_array_equal from sklearn.utils._testing import assert_array_almost_equal from sklearn.datasets import ma...
""" Client classes for the GA4GH reference implementation. """ from __future__ import division from __future__ import print_function from __future__ import unicode_literals import json import requests import posixpath import logging import ga4gh.protocol as protocol import ga4gh.exceptions as exceptions class HttpC...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2011 Radim Rehurek <radimrehurek@seznam.cz> # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html # # Parts of the LDA inference code come from Dr. Hoffman's `onlineldavb.py` script, # (C) 2010 Matthew D. Hoffman, GNU GPL 3.0 """ La...
# coding=utf-8 r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from twilio.base import deserialize from twilio.base import values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base...
""" Copyright (c) 2016-2020 jackywathy Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute...
# 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...
# vim: ai ts=4 sts=4 et sw=4 #heatmap.py v1.1 20110402 from PIL import Image,ImageChops import os import random import math import sys import colorschemes KML_START = """<?xml version="1.0" encoding="UTF-8"?> <kml xmlns="http://www.opengis.net/kml/2.2"> <Folder> """ KML_OVERLAY = """ <GroundOverlay> <Icon> ...
# Copyright 2021 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
import os import types as pytypes from copy import deepcopy from superstring import string2val from numpy import fromstring,empty,array,float64,ones,pi,dot from numpy.linalg import inv from unit_converter import convert from generic import obj from structure import Structure,kmesh from physical_system import PhysicalSy...
""" Component to make instant statistics about your history. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.history_stats/ """ import datetime import logging import math import voluptuous as vol import homeassistant.components.history as history...
#!/usr/bin/python # # 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 later version. # # Ansible is distribut...
# -*- 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 2016 Blue Box, an IBM Company # # 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 applicab...
# coding=utf8 """ remind.py - Willie Reminder Module Copyright 2011, Sean B. Palmer, inamidst.com Licensed under the Eiffel Forum License 2. http://willie.dftba.net """ from __future__ import unicode_literals import os import re import time import threading import collections import codecs from datetime import dateti...
# # This file is part of pySMT. # # Copyright 2014 Andrea Micheli and Marco Gario # # 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 ...
# 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...
# Copyright (C) 2011, 2012 Nippon Telegraph and Telephone Corporation. # Copyright (C) 2011, 2012 Isaku Yamahata <yamahata at valinux co jp> # Copyright (C) 2012 Simon Horman <horms ad verge net au> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with...
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
#!/usr/bin/python import cStringIO, operator import subprocess as sp from datetime import datetime # The indent function is used to pretty print tables # Source of the function: http://code.activestate.com/recipes/267662-table-indentation/ def indent(rows, hasHeader=False, headerChar='-', delim=' | ', justify='left'...
# encoding: utf-8 """ This is the python code for the calculations. To build the workflow, I just copy & paste this code into Alfred. Supported Calculations: 1. Percent Change (increase/decrease): `% 3 6` -> 100% 2. Percentage of; 3 is what percent of 100: `% 3 of 100` -> 3% 3. Percent of: 5 percent of 100 is 5: `% 5...
#!/usr/bin/python """NewWeb model base classes.""" # Standard modules import datetime import simplejson import sys class Error(Exception): """Superclass used for inheritance and external exception handling.""" class DatabaseError(Error): """Superclass for errors returned by the database backend.""" class Bad...
from google.appengine.ext import webapp from tasks_data.users import get_dnzo_user from django.utils import simplejson as json import logging def dnzo_login_required(fn): """Decorator for a BaseAPIRequestHelper to make it require a DNZO login.""" def logged_in_wrapper(self, *args): from google.appengine.api.us...
#!/usr/bin/env python """ Convert all recipes into feedstocks. This script is to be run in a TravisCI context, with all secret environment variables defined (BINSTAR_TOKEN, GH_TOKEN) Such as: export GH_TOKEN=$(cat ~/.conda-smithy/github.token) """ from __future__ import print_function from conda_build.metadata...
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright 2013 Kitware 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 cop...
#!/usr/bin/env python3 import sys import subprocess import re import os import xml.etree.ElementTree as ET from email.utils import parseaddr import sh import logging import argparse #from check_identity import verify_signed_off if "ZEPHYR_BASE" not in os.environ: logging.error("$ZEPHYR_BASE environment variable un...
#!/usr/bin/env python # -*- coding: utf-8 -*- import unittest import platform from nose.plugins.attrib import attr from conans.client.build.compiler_flags import architecture_flag, libcxx_flag, libcxx_define, \ pic_flag, build_type_flags, build_type_define, adjust_path, sysroot_flag, format_defines, \ format_...
""" Protocol implementation for Tyrant <http://tokyocabinet.sourceforge.net/tyrantdoc/> """ import math import socket import struct class TyrantError(Exception): """ Tyrant error, socket and communication errors are not included here. """ # pyrant constants MAGIC_NUMBER = 0xc8 ENCODING = 'UTF-8' def _...
# -*- coding: utf-8 -*- import datetime, json, logging, os, pprint, itertools from dashboard_app.lib import misc from dashboard_app.lib.widget_processor import WidgetHelper from django.conf import settings as project_settings from django.core import serializers from django.core.urlresolvers import reverse from django...
# Copyright 2016 Intel 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 # # Unless required by applicable law or agreed to...
import os.path from pathlib import Path from subprocess import CalledProcessError import tempfile from unittest import mock import pytest from git import Repo, GitCommandError from github import GithubException from github.tests import Framework from azure_devtools.ci_tools.github_tools import ( exception_to_git...
# Copyright (c) 2018 Ansible by Red Hat # All Rights Reserved. import os import logging import signal import sys import redis import json import psycopg2 import time from uuid import UUID from queue import Empty as QueueEmpty from django import db from django.conf import settings from awx.main.dispatch.pool import W...
# Copyright 2013: Mirantis Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
# -*- coding: utf-8 -*- """ h2/connection ~~~~~~~~~~~~~ An implementation of a HTTP/2 connection. """ from enum import Enum from hyperframe.frame import ( GoAwayFrame, WindowUpdateFrame, HeadersFrame, DataFrame, PingFrame, PushPromiseFrame, SettingsFrame, RstStreamFrame, ) from hpack.hpack import Encoder, Dec...
# Copyright (c) LinkedIn Corporation. All rights reserved. Licensed under the BSD-2 Clause license. # See LICENSE in the project root for license information. # coding: utf-8 # pylint: disable=star-args from base64 import urlsafe_b64encode from email.mime.audio import MIMEAudio from email.mime.base import MIMEBase fr...
import datetime import uuid from django.test import TestCase from mock import patch from requests import ConnectionError from couchforms.analytics import ( app_has_been_submitted_to_in_last_30_days, domain_has_submission_in_last_30_days, get_all_xmlns_app_id_pairs_submitted_to_in_domain, get_exports_b...
import getopt # FIXME now we've dropped 2.2 we can use optparse import os import string import fractal # version of Gnofract 4D version = '3.14.1' class OptionError(Exception): pass class T: "Gathers command-line args, wraps crappy getOpt interface" longparams = [ "params=", "max...
import serpent import processblock as pb import blocks as b import transactions as t import utils as u import sys k = u.sha3('cow') v = u.privtoaddr(k) k2 = u.sha3('horse') v2 = u.privtoaddr(k2) print("Starting boring transfer test") blk = b.genesis({v: u.denoms.ether * 1}) assert blk.hex_hash() == \ b.Block.de...
# # 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...
from reg import ClassIndex, KeyIndex import morepath def test_dispatch_method_directive(): class App(morepath.App): @morepath.dispatch_method("obj") def f(self, obj): return "fallback" class Foo: pass class Bar: pass class Other: pass @App.me...
""" Support for Apple TV. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/apple_tv/ """ import os import asyncio import logging import voluptuous as vol from typing import Union, TypeVar, Sequence from homeassistant.const import (CONF_HOST, CONF_NAME, A...
# Copyright (c) 2013 Rackspace, 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 w...
# coding=utf-8 # Copyright 2020 The TF-Agents 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
import json import pymongo from bson import ObjectId from django.core.urlresolvers import reverse from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User from django.http import HttpResponseRedirect, HttpResponse from django.shortcuts import render_to_response, get_object...
# Copyright 2018 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 __future__ import unicode_literals from django.core.urlresolvers import reverse from django.db import models from django.utils import timezone try: # Django's new application loading system from django.apps import apps get_model = apps.get_model except ImportError: from django.db.models import get...
# -*- coding: utf-8 -*- import logging import httplib import httplib as http # TODO: Inconsistent usage of aliased import from dateutil.parser import parse as parse_date from flask import request from modularodm.exceptions import ValidationError, NoResultsFound, MultipleResultsFound from modularodm import Q from fr...
# -*- coding: utf-8 -*- r""" werkzeug.contrib.iterio ~~~~~~~~~~~~~~~~~~~~~~~ This module implements a :class:`IterIO` that converts an iterator into a stream object and the other way round. Converting streams into iterators requires the `greenlet`_ module. To convert an iterator into a stream...
# -*- coding: utf-8 -*- import json import datetime from flask.ext.babel import gettext from flask import Blueprint, request, jsonify, redirect from flask import url_for, g, abort, render_template from fedora_college.core.models import Media, UserProfile from fedora_college.core.models import Tags, TagsMap from fedora_...
# Copyright 2014 - Rackspace Hosting. # # 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...
XXXXXXXXX XXXXX XXXXXX XXXXXX XXXXX XXXXXXXXXXXXXXXX XXXXX XXXXXXXXXXXXX XXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXX XXXXXXX X XXXXX XXXXXXXXXXXXXXXXXXXXXX XXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXX...
import os import sys import re import shutil import imp import json import time import calendar import yaml from jinja2 import Environment, FileSystemLoader from bologna.models import Post, ValidationException from bologna.lib.util import search_path, delete_visible class BolognaException (Exception): pass clas...
# 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 sfepy.base.plotutils import pylab from sfepy.base.base import * from sfepy.base.la import eig from sfepy.fem.evaluate import eval_term_op from sfepy.base.progressbar import MyBar from sfepy.homogenization.utils import coor_to_sym class AcousticMassTensor( Struct ): def __init__( self, eigenmomenta, eigs, dv...
"""Test discovery helpers.""" from unittest.mock import patch import pytest from homeassistant import setup from homeassistant.core import callback from homeassistant.exceptions import HomeAssistantError from homeassistant.helpers import discovery from tests.common import ( get_test_home_assistant, MockModul...
"""KDDCUP 99 dataset. A classic dataset for anomaly detection. The dataset page is available from UCI Machine Learning Repository https://archive.ics.uci.edu/ml/machine-learning-databases/kddcup99-mld/kddcup.data.gz """ import sys import errno from gzip import GzipFile import logging import os from os.path import ...
from unittest import skip import unittest from operator import itemgetter from cryptos import * from cryptos import coins from cryptos import explorers class BaseCoinCase(unittest.TestCase): name = "" unspent_address = "" unspent_address_multiple = [] unspent = [] unspent_multiple = [] addresse...
import copy import datetime import os import re import time try: import decimal except ImportError: from django.utils import _decimal as decimal # for Python 2.3 from django.db import connection from django.db.models import signals from django.db.models.query_utils import QueryWrapper from django.dispatch i...
import logging as log import datetime as dt import time from google.appengine.ext import ndb from google.appengine.api import mail from models import Run, Q from rl import RL from binary import Binary from pprint import pprint class Main(): def __init__(self, auto_login=True): log.info('Main init started...
# -*- coding: utf-8 -*- """ werkzeug.utils ~~~~~~~~~~~~~~ This module implements various utilities for WSGI applications. Most of them are used by the request and response wrappers but especially for middleware development it makes sense to use them without the wrappers. :copyright: 2007 Pall...
""" This module contains Fab's `main` method plus related subroutines. `main` is executed as the command line ``fab`` program and takes care of parsing options and commands, loading the user settings file, loading a fabfile, and executing the commands given. The other callables defined in this module are internal onl...
from __future__ import absolute_import, division, unicode_literals import json import logging from cStringIO import StringIO from flask.ext.restful import reqparse from sqlalchemy.orm import joinedload, subqueryload_all from werkzeug.datastructures import FileStorage from changes.api.base import APIView from changes...
from __future__ import unicode_literals from PIL import Image, ImageSequence import sys import os # Python 2 and 3 support # TODO: Proper images2gif version that supports both Py 2 and Py 3 (mostly handling binary data) if sys.version_info < (3,): import legofy.images2gif_py2 as images2gif else: import legofy...
""" PLC 1 """ from minicps.devices import PLC from threading import Thread from utils import * from random import * import json from decimal import Decimal import select import socket import time Q101 = ('Q101', 1) Q102 = ('Q102', 1) LIT101 = ('LIT101', 1) LIT102 = ('LIT102', 1) LIT103 = ('LIT103', 1) SENSOR_ADDR...
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. from __future__ import unicode_literals import numpy as np import math import itertools import collections import warnings from pymatgen.core.periodic_table import get_el_sp from pymatgen.core.structure impor...
from django.http import HttpResponseRedirect from django.views.generic import DetailView, ListView from django.views.generic.edit import CreateView, UpdateView, DeleteView, ModelFormMixin from django.urls import reverse_lazy from django.shortcuts import render from django.contrib.auth.decorators import login_required, ...
# Copyright (C) 2014-2015 DNAnexus, Inc. # # This file is part of dx-toolkit (DNAnexus platform client libraries). # # 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.a...
"""test_transitfit.py - Luke Bouma (luke@astro.princeton.edu) - Aug 2019 License: MIT - see the LICENSE file for details. NOTE: the tests in this module take a very long time. To enable and actually run them, you must set the environmental variable RUN_LONG_TESTS=1 before running pytest, like so: ``RUN_LONG_TESTS=1 py...
#most of this file was taken from turbogears default template from hashlib import sha1 import os from datetime import datetime #from sqlalchemy.types import * from sqlalchemy import * from sqlalchemy.orm import relation, backref, synonym from sqlalchemy.ext.declarative import DeclarativeMeta, declarative_base, synonym...
import demistomock as demisto from CommonServerPython import * # noqa: E402 lgtm [py/polluting-import] from CommonServerUserPython import * # noqa: E402 lgtm [py/polluting-import] # Disable insecure warnings requests.packages.urllib3.disable_warnings() # CONSTANTS DATE_FORMAT = '%Y-%m-%dT%H:%M:%SZ' VENDOR_NAME = 'C...
# Copyright 2018, 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
"""graphing.py -- helper functions for graphing with matplotlib/pyplot This software is licensed under the terms of the MIT License as follows: Copyright (c) 2013 Jessica B. Hamrick Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "...
import cherrypy from cherrypy.lib import auth_digest from exceptions import * from anonymoususage import AnonymousUsageTracker class TrackableView(object): exposed = True tracker = None def __init__(self): self.trackable_class = self.__class__.__name__.replace('View', '') def decode_PUT_inp...
#!/usr/bin/env python # Software License Agreement (BSD License) # # Copyright (c) 2009, Willow Garage, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code...
# GUI Application automation and testing library # Copyright (C) 2006-2018 Mark Mc Mahon and Contributors # https://github.com/pywinauto/pywinauto/graphs/contributors # http://pywinauto.readthedocs.io/en/latest/credits.html # All rights reserved. # # Redistribution and use in source and binary forms, with or without # ...
from google.appengine.ext import db from ..API import response import functools import Hash import LatLon import channel from ShardCounter import Counter from google.appengine.api import memcache from google.appengine.api import taskqueue import time from google.appengine.ext import deferred class Host: @classmeth...
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# -*- coding: utf-8 -*- import copy import re import sqlite3 import types from malibu.database import dbtypeconv __doc__ = """ malibu.database.dbmapper ------------------------ This is a small, hackish ORM for SQLite3. Note from the author: (01 / 14 / 2016) -------------------------------------- I've got to be hon...
import csv import os import sys import numpy as np from fitelp.label_tools import line_label from fitelp.read_spectra import GalaxyRegion from fitelp.fit_line_profiles import FittingProfile, plot_profiles, vel_to_wave, wave_to_vel from fitelp.make_latex_tables import average_velocities_table_to_latex, halpha_regions_ta...
import numpy as np from menpo.image import Image from menpofit.base import name_of_callable from menpofit.aam.fitter import AAMFitter from menpofit.clm.fitter import CLMFitter from menpofit.fitter import MultilevelFitter class SDFitter(MultilevelFitter): r""" Abstract Supervised Descent Fitter. """ d...
from functools import partial import sys from time import sleep from kivy.clock import Clock, ClockBase, mainthread from kivy.lib import osc from kivy.utils import platform from syncjob import SyncJob import socket import fcntl import struct import re from io import StringIO from time import strftime # Conditional im...
from __future__ import absolute_import import collections import logging import time import weakref import itertools import numpy import re from mceditlib import cachefunc from mceditlib.block_copy import copyBlocksIter from mceditlib.blocktypes import BlockType from mceditlib.nbtattr import NBTListProxy from mceditl...
import numpy as np import pickle from malpi.layers import * from malpi.fast_layers import * from malpi.layer_utils import * from malpi.rnn_layers import * class MalpiModel(object): """ A multi-layer network for experimenting with the robots ML architecture. e.g.: conv - relu - 2x2 max pool - affine - relu...
# Test the functions and main class method of paragraph.py import unittest from idlelib import paragraph as fp from idlelib.editor import EditorWindow from tkinter import Tk, Text from test.support import requires class Is_Get_Test(unittest.TestCase): """Test the is_ and get_ functions""" test_comment = '# Th...
## 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 applic...
# -*- coding: utf-8 -*- from __future__ import with_statement, print_function, absolute_import import time import sys from trello import TrelloBase from trello.compat import force_str is_python3 = sys.version_info.major == 3 if is_python3: unicode = str class CustomFieldDefinition(TrelloBase): """ Class represen...
from __future__ import division import fable.cout file_names_disable_warnings = set("""\ add_reals.f add_real_integer.f logical_a_or_b.f add_dp_integer.f real_array_sum.f """.splitlines()) file_names_join_stdout_stderr = set("""\ stop_bare.f stop_integer.f stop_string.f """.splitlines()) top_procedures_by_file_name ...
from builtins import object import os import json from vulndb.constants.wasc import WASC_ID_TO_URL from vulndb.constants.cwe import CWE_URL_FMT from vulndb.constants.owasp import (OWASP_TOP10_2010_URL_FMT, OWASP_TOP10_2013_URL_FMT) class DBVuln(object): """ Wrapper around ...
# -*- coding: utf-8 -*- """ This module contains a collection of functions for analyzing diffusion data. Written by Vladislav Belyy (UCSF) """ import os import numpy as np import math from scipy import stats from scipy.optimize import curve_fit import matplotlib.pylab as plt ### Definitions of short useful functio...
# Copyright 2016 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
#Copyright 2017 Tim Wentlau. #Distributed under the MIT License. See LICENSE in root of project. import logging import time import threading import amqpstorm from amqpstorm import Connection from amqpstorm import UriConnection import json import requests logging.basicConfig(level=logging.CRITICAL) LOGGER = logging.ge...
import json __author__ = 'viglesias' import re from eucaops import Eucaops from eutester.eutestcase import EutesterTestCase class Install(EutesterTestCase): def __init__(self, download_creds=False, extra_args= None): self.setuptestcase() self.setup_parser() self.parser.add_argument("--euc...
import json class FormImageBrowser(Form): def __init__(self, data = None, items = None, post = None, **args): if data is None: data = {} if post is None: post = {} if 'id' not in data: data['id'] = 'FormImageBrowser' super().__init__(data, items, **args) tab = self.add('Ul', { 'id' : 'browse...
#Parse assembly code and generate the appropriate machine language for the program import sys #=============================================================================== DIC_COMMANDS = {#First, deal with normal instructions 'load': 0x44000000, 'loadi': 0x48000000, ...