gt
stringclasses
1 value
context
stringlengths
2.49k
119k
import os import time from ethereum import utils from ethereum import pruning_trie as trie from ethereum.refcount_db import RefcountDB import ethereum.db as db from ethereum.utils import to_string, is_string import rlp from rlp.utils import encode_hex from ethereum import blocks from ethereum import processblock from e...
# Software License Agreement (BSD License) # # Copyright (c) 2009-2011, Eucalyptus Systems, Inc. # All rights reserved. # # Redistribution and use of this software in source and binary forms, with or # without modification, are permitted provided that the following conditions # are met: # # Redistributions of source ...
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2013 The Plaso Project Authors. # Please see the AUTHORS file for details on individual 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 L...
from desispec.workflow.exptable import get_exposure_table_name,get_exposure_table_path, \ get_exposure_flags, get_last_step_options, get_exposure_table_column_defs, \ keyval_change_reporting, deconstruct_keyval_reporting from desispec.workfl...
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ Manage a single benchmark and, when run from the commandline, report its runtime to a file. """ # !!!!!!!!!!!!!!!!!!!! NOTE !!!!!!!!!!!!!!!!!!!! # This file, unlike most others, must be compatible with as many # versions of Py...
import os.path from datetime import datetime from django.contrib.auth.models import User from django.contrib.auth.views import logout as logout_view from django.core.urlresolvers import reverse from django.test.client import Client from django.test.utils import override_settings, override_script_prefix from mock impo...
""" Oracle database backend for Django. Requires cx_Oracle: https://oracle.github.io/python-cx_Oracle/ """ import datetime import decimal import os import platform from contextlib import contextmanager from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.db import Integ...
from optparse import OptionParser, make_option from dateutil.relativedelta import relativedelta from django.contrib.auth.models import User from django.core.management.base import BaseCommand, CommandError from django.db.models import Q from django.utils import timezone from timepiece import utils from timepiece.ent...
# Copyright 2012 IBM Corp. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
import argparse import time import collections import copy import math import torch import numpy as np import torch.nn as nn from torch.autograd import Variable import data import model parser = argparse.ArgumentParser(description='PyTorch PennTreeBank RNN/LSTM Language Model') parser.add_argument('--data', type=str,...
"""Jedi Language Server. Creates the language server constant and wraps "features" with it. Official language server spec: https://microsoft.github.io/language-server-protocol/specification """ import itertools from typing import Any, List, Optional, Union from jedi import Project from jedi.api.refactoring impo...
import requests import flask from flask import Flask, request, render_template, jsonify, redirect, url_for, make_response from flask.ext.sqlalchemy import SQLAlchemy import jwt from encoder import jwt_encode from logging import Formatter, FileHandler import controller from os import path import models import os from th...
#!/usr/bin/env python # ==================================== # Copyright (c) Microsoft Corporation. All rights reserved. # See license.txt for license information. # ==================================== import os import sys import pwd import shutil import grp import urllib2 import time import imp protocol = imp.load_so...
from future import standard_library standard_library.install_aliases() from builtins import object, str from copy import deepcopy from pickle import dumps import simplejson import os import getpass from socket import getfqdn from uuid import uuid1 import numpy as np try: from collections import OrderedDict except...
"""Test functions for 1D array set operations. """ from __future__ import division, absolute_import, print_function from numpy.testing import * import numpy as np from numpy.lib.arraysetops import * import warnings class TestSetOps(TestCase): def test_unique(self): def check_all(a, b, i1, i2, dt): ...
from functools import lru_cache import io import os from pathlib import Path import sys from typing import ( Any, Dict, Iterable, Iterator, List, Optional, Pattern, Sequence, Tuple, Union, TYPE_CHECKING, ) from mypy_extensions import mypyc_attr from pathspec import PathSpec ...
# # # ================================================================= # ================================================================= """LogicalPartition interface.""" from paxes_cinder.k2aclient import _ from paxes_cinder.k2aclient import base from paxes_cinder.k2aclient.v1 import k2uom from paxes_cinder.k2acl...
# 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 agreed to in writing, ...
""" SoftLayer.tests.CLI.modules.file_tests ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :license: MIT, see LICENSE for more details. """ from SoftLayer import testing import json import mock class FileTests(testing.TestCase): def test_access_list(self): result = self.run_command(['file', 'access...
#coding: UTF-8 """ Test file/dir operations. """ import random import re from urllib import urlencode, quote from tests.common.utils import randstring, urljoin from tests.api.urls import DEFAULT_REPO_URL, REPOS_URL from tests.api.apitestbase import ApiTestBase, USERNAME class FilesApiTest(ApiTestBase): def test_...
import datetime import struct __all__ = ( 'read_element_id', 'read_element_size', 'read_unsigned_integer', 'read_signed_integer', 'read_float', 'read_string', 'read_unicode_string', 'read_date', 'encode_element_id', 'encode_element_size', 'encode_unsigned_integer', 'encode_signed_integer', 'encode_float'...
"""Component to interface with an alarm control panel.""" from __future__ import annotations from dataclasses import dataclass from datetime import timedelta import logging from typing import Any, Final, final import voluptuous as vol from homeassistant.config_entries import ConfigEntry from homeassistant.const impo...
import cPickle as pickle import os, sys from sqlalchemy.types import BLOB from sqlalchemy import create_engine, Table, Column, Integer, String, MetaData, ForeignKey, UniqueConstraint from sqlalchemy.exc import OperationalError from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import relation,...
# This file is part of Buildbot. Buildbot 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, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
""" Utilities for fast persistence of big data, with optional compression. """ # Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org> # Copyright (c) 2009 Gael Varoquaux # License: BSD Style, 3 clauses. import pickle import traceback import sys import os import zlib import warnings from ._compat import ...
from __future__ import unicode_literals import codecs import os import re import warnings from django.conf import settings from django.core.management.base import CommandError from django.db import models, router def sql_create(app, style, connection): "Returns a list of the CREATE TABLE SQL statements for the ...
# Copyright 2013 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
from __future__ import absolute_import, print_function import logging from django.conf import settings from django.core.urlresolvers import reverse from django.contrib import messages from django.contrib.auth import login from django.db import transaction from django.http import HttpResponseRedirect from django.utils...
# 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 th...
import collections from supriya import CalculationRate, utils from supriya.synthdefs import PseudoUGen, UGen class Mix(PseudoUGen): """ A down-to-mono signal mixer. .. container:: example :: >>> with supriya.synthdefs.SynthDefBuilder() as builder: ... oscillators =...
#!/usr/bin/env python """ Download all the fic you've saved in Pinboard. This saves the ebook, PDF and HTML copies available through the "Download" button. See https://alexwlchan.net/2020/05/downloading-the-ao3-fics-that-i-ve-saved-in-pinboard/ Last updated 17 May 2020. """ from __future__ import print_function i...
from __future__ import unicode_literals, division, absolute_import import urllib import logging import re from flexget import plugin from flexget.config_schema import one_or_more from flexget.entry import Entry from flexget.event import event log = logging.getLogger('regexp') class FilterRegexp(object): """ ...
""" Unit tests for nonlinear solvers Author: Ondrej Certik May 2007 """ from numpy.testing import assert_ import pytest from scipy.optimize import nonlin, root from numpy import diag, dot from numpy.linalg import inv import numpy as np from .test_minpack import pressure_network SOLVERS = {'anderson': nonlin.anderson...
import re import sys import urllib import bs4 from .browser import Browser from .form import Form from .utils import LinkNotFoundError from requests.structures import CaseInsensitiveDict class _BrowserState: def __init__(self, page=None, url=None, form=None, request=None): self.page = page self...
# $Id$ # # Copyright (C) 2002-2008 greg Landrum and Rational Discovery LLC # # @@ All Rights Reserved @@ # This file is part of the RDKit. # The contents are covered by the terms of the BSD license # which is included in the file license.txt, found at the root # of the RDKit source tree. # """unit testing code ...
import hashlib import logging from lxml import etree from mock import Mock, patch import os import requests import unittest from six.moves.urllib.request import url2pathname from eulfedora.models import DigitalObject from eulfedora.server import Repository from eulfedora.syncutil import ArchiveExport, endswith_partial...
# Copyright 2013 Hewlett-Packard Development Company, L.P. # # 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 applicabl...
# Copyright 2017 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...
from direct.showbase.DirectObject import DirectObject from DirectGlobals import * from DirectUtil import * from DirectGeometry import * COA_ORIGIN = 0 COA_CENTER = 1 # MRM: To do: handle broken node paths in selected and deselected dicts class DirectNodePath(NodePath): # A node path augmented with info, bounding ...
"""Module to determine the pywikibot version (tag, revision and date).""" # # (C) Pywikibot team, 2007-2021 # # Distributed under the terms of the MIT license. # import datetime import json import os import pathlib import socket import subprocess import sys import sysconfig import time import xml.dom.minidom from conte...
# Suggest running as: WANDB_BASE_URL=http://api.wandb.test python artifact_object_reference_test.py timothysweeney@Timothys-MacBook-Pro import shutil import os import binascii import base64 import time from math import sin, cos, pi import numpy as np import...
import datetime import hashlib import heapq import math import os import random import re import sys import threading import zlib try: from collections import Counter except ImportError: Counter = None try: from urlparse import urlparse except ImportError: from urllib.parse import urlparse try: fro...
import ctypes import itertools import logging import multiprocessing import os import pickle import textwrap import unittest import warnings from importlib import import_module from io import StringIO from django.core.management import call_command from django.db import connections from django.test import SimpleTestCa...
# ***************************************************************************** # Copyright (c) 2020, Intel Corporation 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 sou...
import os import sys from bcbio.rnaseq import (featureCounts, cufflinks, oncofuse, count, dexseq, express, variation, stringtie, sailfish) from bcbio.ngsalign import bowtie2, alignprep from bcbio.variation import vardict import bcbio.pipeline.datadict as dd from bcbio.utils import filter_missi...
#!/usr/bin/env python # This work was created by participants in the DataONE project, and is # jointly copyrighted by participating institutions in DataONE. For # more information on DataONE, see our web site at http://dataone.org. # # Copyright 2009-2019 DataONE # # Licensed under the Apache License, Version 2.0 (t...
import six import signal import logging import warnings from twisted.internet import reactor, defer from zope.interface.verify import verifyClass, DoesNotImplement from scrapy.core.engine import ExecutionEngine from scrapy.resolver import CachingThreadedResolver from scrapy.interfaces import ISpiderLoader from scrapy...
#!/usr/bin/python # Standard Library import inspect import json import logging import os import sys import time import traceback import uuid from collections import defaultdict from Queue import Queue from cStringIO import StringIO from threading import Thread, Lock # Third Party import boto.s3 import mixingboard im...
import numpy as np import pytest import taichi as ti from tests import test_utils @test_utils.test() def test_1d(): x = ti.field(ti.f32, shape=(16)) @ti.kernel def func(): for i in ti.ndrange((4, 10)): x[i] = i func() for i in range(16): if 4 <= i < 10: ...
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2012 The Plaso Project Authors. # Please see the AUTHORS file for details on individual 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 L...
import http.client from unittest import mock import unittest import urllib.parse import responses from cumulusci.tasks.release_notes.exceptions import GithubIssuesError from cumulusci.tasks.release_notes.generator import GithubReleaseNotesGenerator from cumulusci.tasks.release_notes.parser import BaseChangeNotesParser...
#! /usr/bin/env python # # Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # https://developers.google.com/protocol-buffers/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions ...
# 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...
try: from StringIO import StringIO except ImportError: from io import StringIO # noqa: F401 import unittest from unittest import mock from tethys_cli.services_commands import ( services_create_persistent_command, services_remove_persistent_command, services_create_spatial_command, services_rem...
""" ExampleRawIO is a class of a fake example. This is to be used when coding a new RawIO. Rules for creating a new class: 1. Step 1: Create the main class * Create a file in **neo/rawio/** that endith with "rawio.py" * Create the class that inherits BaseRawIO * copy/paste all methods that need to be i...
#!/usr/bin/env python # Siconos is a program dedicated to modeling, simulation and control # of non smooth dynamical systems. # # Copyright 2016 INRIA. # # 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 L...
from __future__ import unicode_literals import django from django.db import models from django.shortcuts import get_object_or_404 from django.test import TestCase from django.utils import six from rest_framework import generics, renderers, serializers, status from rest_framework.test import APIRequestFactory from tes...
from __future__ import unicode_literals # Ensure 'assert_raises' context manager support for Python 2.6 import tests.backport_assert_raises from nose.tools import assert_raises from moto.ec2 import ec2_backends import boto from boto.exception import EC2ResponseError import sure # noqa from moto import mock_ec2 @mo...
#!/usr/bin/python # -*- coding: utf-8 -*- import unittest from external.wip import work_in_progress from rmgpy.molecule.group import ActionError, GroupAtom, GroupBond, Group from rmgpy.molecule.atomtype import atomTypes ################################################################################ class TestGroup...
""" Groundwork recipe pattern. Provides function to register, get and build recipes. Recipes are used create directories and files based on a given template and some user input. It is mostly used to speed up the set up of new python packages, groundwork applications or projects. Based on cookiecutter: https://github...
# 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...
#!/usr/bin/env python # Copyright 2010 The Closure Linter Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # #...
"""This module contains async actions used to interact with Google Pub/Sub. Note - this code should be structured so that it could be factored out into a seperate package at some point in the future. Key references - Google Cloud Pub/Sub RESTful API @ https://cloud.google.com/pubsub/docs/reference/rest/ - note use of...
import sys from decimal import Decimal import numpy as np from numpy.testing import * from numpy.testing.utils import WarningManager import warnings class TestEinSum(TestCase): def test_einsum_errors(self): # Need enough arguments assert_raises(ValueError, np.einsum) assert_raises(ValueErr...
#! /usr/bin/env python3 # encoding: utf-8 # # (C) 2015 Chris Liechti <cliechti@gmx.net> # # SPDX-License-Identifier: BSD-3-Clause """\ WiPy helper tool to access file via FTP. """ import configparser # https://docs.python.org/3/library/configparser.html import ftplib # https://docs.python.org/3/library/ftpli...
# Copyright (c) 2013 NEC Corporation # 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...
# -*- coding: utf-8 -*- # Copyright (c) 2015, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. from __future__ import division import numpy as np from ...util import transforms from ...geometry import Rect from ._util import arg_to_vec4, as_vec4 from .base_transform i...
# The Nexus software is licensed under the BSD 2-Clause license. # # You should have recieved a copy of this license with the software. # If you did not, you can find one at the following link. # # http://opensource.org/licenses/bsd-license.php from core.plugins import ProtocolPlugin from core.decorators import * fro...
import copy_reg import imp import os import re import sys import types from importlib import import_module from os.path import abspath, join, exists from seisflows.tools import msg from seisflows.tools.err import ParameterError from seisflows.tools import unix from seisflows.tools.tools import loadjson, loadobj, loa...
# -*- coding: utf-8 -*- """ celery.worker.autoreload ~~~~~~~~~~~~~~~~~~~~~~~~ This module implements automatic module reloading """ from __future__ import absolute_import import hashlib import os import select import sys import time from collections import defaultdict from threading import Event from ko...
# -*- coding: utf-8 -*- """ Written by Daniel M. Aukes and CONTRIBUTORS Email: danaukes<at>asu.edu. Please see LICENSE for full license. """ import popupcad import shapely.geometry import numpy import qt.QtCore as qc import qt.QtGui as qg import numpy.linalg try: #Hack to ensure Python 2 & 3 support import itert...
import datetime import hashlib from werkzeug.security import generate_password_hash, check_password_hash from itsdangerous import TimedJSONWebSignatureSerializer as Serializer from flask import current_app, request from flask.ext.login import UserMixin, AnonymousUserMixin from . import db, login_manager class Permi...
# Copyright (c) 2006 Allan Saddi <allan@saddi.com> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of c...
#!/usr/bin/env python """Process that loads the system policy""" __author__ = 'Stephen P. Henrie' """ Process that loads the system policy """ from pyon.core.governance import get_system_actor, get_system_actor_header from pyon.public import CFG, log, ImmediateProcess, iex, Container, IonObject, RT, OT from interfa...
#!/usr/bin/env python ############################################################################ # # Copyright (C) 2012, 2013 PX4 Development Team. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are m...
# vim: set ts=4 sw=4 expandtab sts=4 fileencoding=utf-8: # Copyright (c) 2013-2015 Christian Geier et al. # # 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 # wi...
#!/usr/bin/env python """ This script tests the steps of the promoter workflow. - Checks the dlrn API that the hash under test has been promoted to the promotion target - Checks that containers with that hash are pushed to repo 2 - Checks that images are uploaded with that hash and linked to promotion target ...
""" Tests for all shipped sniplates/django.html widgets. """ import datetime from django import forms from django.template.loader import get_template from django.test import SimpleTestCase from django.utils.encoding import python_2_unicode_compatible from django.utils.datastructures import MultiValueDict from .forms ...
# Copyright 2015 F5 Networks 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 writi...
"""Hash-table that uses open addressing where collisions are solved by storing the item to next free slot. """ from itertools import chain, islice # Sentinel object used to mark unused slots SENTINEL = object() # Default size INITIAL_SIZE = 7 # Max load factor, once this is reached table will be grown LOAD_FACTOR =...
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
from __future__ import print_function, division import matplotlib import logging from sys import stdout matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab! from neuralnilm import (Net, RealApplianceSource) from neuralnilm.source import (standardise, discretize, fdiff, power_and_fdiff, ...
#!/usr/bin/env python3 from argparse import ArgumentParser from io import StringIO from enum import Enum, auto import os.path import sys import re class Cell: def __init__(self, name, keep=False, port_attrs={}): self.name = name self.keep = keep self.port_attrs = port_attrs CELLS = [ ...
""" Linear Discriminant Analysis (LDA) """ # Authors: Clemens Brunner # Martin Billinger # Matthieu Perrot # Mathieu Blondel # License: BSD 3-Clause from __future__ import print_function import warnings import numpy as np from scipy import linalg from .externals.six import string_types f...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
# Copyright (c) 2015 FUJITSU LIMITED # Copyright (c) 2012 EMC Corporation, 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.o...
# 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 ...
''' * Copyright (c) 2011, University of Kent * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, this * list of condi...
# Copyright 2015 Tesora 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 a...
# -*- 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...
"""Test stepping through ObjC method dispatch in various forms.""" from __future__ import print_function import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil class TestObjCStepping(TestBase): mydir = TestBase.compute_mydir(__file__) ...
from __future__ import unicode_literals import base64 from datetime import datetime, timedelta import logging import string from django.conf import settings from django.core.exceptions import SuspiciousOperation from django.utils.crypto import constant_time_compare from django.utils.crypto import get_random_string fr...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from colorama import Fore from spotify_ripper.utils import * import os import time import spotify import requests import re class WebAPI(object): def __init__(self, args, ripper): self.args = args self.ripper = ripper self....
# -*- coding: utf-8 -*- """ Created on Wed Mar 16 15:40:29 2016 @author: okada $Id: signature.py 205 2017-08-08 06:25:59Z aokada $ """ ########### js template js_header = """(function() { sig_data = {}; """ js_footer = """ })(); Object.freeze(sig_data); """ js_dataset = """ sig_data.tooltip_format = {{ signatur...
''' @summary: Handles all notifications for api, including alerts from metron. Note: Ensure username and password needs hidden / parsed from encrypted file. @author: devopsec ''' import sys import traceback from api import app, time_funcs from api.parse_json import * from api.decorators import async from api.sql.model...
import pytest from jsonmodels import models, fields, errors def test_model1(): class Person(models.Base): name = fields.StringField() surname = fields.StringField() age = fields.IntField() alan = Person() alan.name = 'Alan' alan.surname = 'Wake' alan.age = 34 def tes...
# -*- coding: utf-8 -*- """ Tests for Fiscal Year and Fiscal Quarter offset classes """ from datetime import datetime from dateutil.relativedelta import relativedelta import pytest import pandas.util.testing as tm from pandas import Timestamp from pandas.tseries.frequencies import get_offset from pandas._libs.tslibs...
# -*- coding: utf-8 -*- # Copyright (C) 2010, 2011, 2012 Sebastian Wiesner <lunaryorn@gmail.com> # 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 (at...
from core.himesis import Himesis, HimesisPostConditionPattern import cPickle as pickle from uuid import UUID class HMoveOneInputRepeatedDirectMatchDiffRulesRHS(HimesisPostConditionPattern): def __init__(self): """ Creates the himesis graph representing the AToM3 model HMoveOneInputRepeatedDirectM...
import syntax_tree import symbol_table import code_library INTEGER_SIZE = 8 class Lazy_generator(object): def generate(self, tree, table): self.tree = tree self.table = table self.reset_library() self.handle = -1 self.in_procedure = False self.procedures = {} self.read_only_declarations...