gt
stringclasses
1 value
context
stringlengths
2.49k
119k
import logging import cffi import cle from sortedcontainers import SortedDict from ..analysis import Analysis _l = logging.getLogger('angr.analyses.cfg.cfb') class CFBlanketView(object): """ A view into the control-flow blanket. """ def __init__(self, cfb): self._cfb = cfb def __getite...
import numpy as np import tensorflow as tf from cnn_methods import * from cnn_class import CNN import cnn_eval import time, resource import os, sys #batching methods #randomly adds zero padding to some examples to increase minibatch variety def flex(input_list, params): for example in input_list: if exampl...
############################################################ # FlatCAM: 2D Post-processing for Manufacturing # # http://flatcam.org # # Author: Juan Pablo Caram (c) # # Date: 12/18/2015 # # MIT Licence ...
# -*- coding: utf-8 -*- """ flaskbb.message.views ~~~~~~~~~~~~~~~~~~~~~ The views for the conversations and messages are located in this module. :copyright: (c) 2014 by the FlaskBB Team. :license: BSD, see LICENSE for more details. """ import uuid from datetime import datetime from flask import B...
# External Dependencies from __future__ import division from numpy import isclose from svgpathtools import Path # Internal Dependencies from misc4rings import isNear class ClosedRingsOverlapError(Exception): def __init__(self,mes): self.mes = mes def __str__(self): return repr(self.mes) def ...
from eventlet.support import get_errno from eventlet.hubs import trampoline BUFFER_SIZE = 4096 import errno import os import socket from socket import socket as _original_socket import sys import time import warnings __all__ = ['GreenSocket', 'GreenPipe', 'shutdown_safe'] CONNECT_ERR = set((errno.EINPROGRESS, errno....
"""DDNS without TSIG""" # pylint: disable=invalid-name,line-too-long import pytest import srv_msg import srv_control import misc @pytest.mark.v4 @pytest.mark.ddns @pytest.mark.notsig @pytest.mark.forward_reverse_add def test_ddns4_notsig_forw_and_rev_add_success_hostname(): misc.test_setup() srv_control.c...
# Copyright 2009-2019 Rumma & Ko Ltd # License: GNU Affero General Public License v3 (see file COPYING for details) """ """ from __future__ import unicode_literals, print_function from builtins import str from django.conf import settings from lino.utils import curry from lino.core.frames import Frame from lino.co...
# Copyright 2012 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 agre...
# Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 OpenStack Foundation # Copyright 2012 Nebula, Inc. # Copyright (c) 2012 X.commerce, a business unit of eBay Inc. # # Licensed under the Apach...
#!/usr/bin/python # Copyright (c) 2011 The Native Client Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Software construction toolkit site_scons configuration. This module sets up SCons for use with this toolkit. This should cont...
# Copyright 2014 Violin Memory, 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 requi...
# This file helps to compute a version number in source trees obtained from # git-archive tarball (such as those provided by githubs download-from-tag # feature). Distribution tarballs (built by setup.py sdist) and build # directories (produced by setup.py build) will contain a much shorter file # that just contains t...
import json from unittest2 import TestCase from werkzeug.wrappers import Response from werkzeug.test import Client as TestClient from cosmic.api import API from cosmic.http import Server from cosmic.models import BaseModel from cosmic.globals import cosmos from cosmic.types import * cookbook_spec = { u'name': u...
""" sentry.testutils.cases ~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import __all__ = ('TestCase', 'TransactionTestCase', 'APITestCase', 'RuleTestCase', 'PermissionTest...
#!/usr/bin/env python '''Example of training a named entity recognition system from scratch using spaCy This example is written to be self-contained and reasonably transparent. To achieve that, it duplicates some of spaCy's internal functionality. Specifically, in this example, we don't use spaCy's built-in Language ...
"""Base class for sparse matrice with a .data attribute subclasses must provide a _with_data() method that creates a new matrix with the same sparsity pattern as self but with a different data array """ from __future__ import division, print_function, absolute_import import numpy as np from .base impor...
# Copyright 2012 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
from __future__ import division, absolute_import, print_function __all__ = ['matrix', 'bmat', 'mat', 'asmatrix'] import sys import warnings import ast import numpy.core.numeric as N from numpy.core.numeric import concatenate, isscalar # While not in __all__, matrix_power used to be defined here, so we import # it for...
__all__ = ['Counter', 'deque', 'defaultdict', 'namedtuple', 'OrderedDict'] # For bootstrapping reasons, the collection ABCs are defined in _abcoll.py. # They should however be considered an integral part of collections.py. from _abcoll import * import _abcoll __all__ += _abcoll.__all__ from _collections import deque, ...
#!/usr/bin/env python # # Copyright 2009 Facebook # # 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...
# encoding: utf8 from django.test import TestCase from django.db.migrations.autodetector import MigrationAutodetector from django.db.migrations.questioner import MigrationQuestioner from django.db.migrations.state import ProjectState, ModelState from django.db.migrations.graph import MigrationGraph from django.db impor...
#! /usr/bin/env phenix.python # Implementation of the EMRinger method, with plots, for use with the # EMRinger workflow. # References: # Lang PT, Ng HL, Fraser JS, Corn JE, Echols N, Sales M, Holton JM, Alber T. # Automated electron-density sampling reveals widespread conformational # polymorphism in proteins. Protei...
import os import struct from io import BytesIO from PIL import Image def resize(image, size, format=None): output = BytesIO() back = Image.new('RGBA', size, (0,0,0,0)) if image.size[0] < size[0] or image.size[1] < size[1]: if image.height > image.width: factor = size[0] / image.height...
# -*- coding: utf-8 -*- """ tipfy.i18n ~~~~~~~~~~ Internationalization extension. This extension provides internationalization utilities: a translations store, hooks to set locale for the current request, functions to manipulate dates according to timezones or translate and localize strings an...
############################################################################### ## ## Copyright (C) 2006-2011, University of Utah. ## All rights reserved. ## Contact: contact@vistrails.org ## ## This file is part of VisTrails. ## ## "Redistribution and use in source and binary forms, with or without ## modification, ...
# swift_build_support/toolchain.py ------------------------------*- python -*- # # This source file is part of the Swift.org open source project # # Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors # Licensed under Apache License v2.0 with Runtime Library Exception # # See https://swift.org/LICENSE.tx...
# Copyright (c) 2012 Rackspace Hosting # All Rights Reserved. # Copyright 2013 Red Hat, 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/license...
from __future__ import unicode_literals import re from django.core.exceptions import ValidationError from django.test import TestCase from localflavor.au import forms, models from localflavor.au.validators import AUBusinessNumberFieldValidator from .forms import AustralianPlaceForm from .models import AustralianPla...
#!/usr/bin/env python # -*- coding: UTF-8 -*- """ A list of commonly used multiple correction routines """ from __future__ import print_function from __future__ import absolute_import import sys import random import numpy as np import collections as cx __copyright__ = "Copyright (C) 2010-2018, H Tang et al., All righ...
#!/usr/bin/env python3 # # Copyright (c) 2016, The OpenThread Authors. # 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 # ...
# ============================================================================== # Copyright (c) Microsoft. All rights reserved. # Licensed under the MIT license. See LICENSE.md file in the project root # for full license information. # ============================================================================== fro...
# License for code in this file that was taken from Python 2.5. # PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2 # -------------------------------------------- # # 1. This LICENSE AGREEMENT is between the Python Software Foundation # ("PSF"), and the Individual or Organization ("Licensee") accessing and # otherwise usin...
"""Location for database handling codes.""" import glob import os import matplotlib.pyplot as plt import numpy as np import pandas as pd import sqlalchemy as sa from matplotlib import colors, ticker, cm from sqlalchemy import and_ import simulators from mingle.utilities import chi2_at_sigma from mingle.utilities.para...
#!/usr/bin/python # # Copyright 2008 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 app...
from __future__ import absolute_import, unicode_literals import collections import logging import pkg_resources from mopidy import config as config_lib, exceptions logger = logging.getLogger(__name__) _extension_data_fields = ['extension', 'entry_point', 'config_schema', 'config_default...
# Copyright 2012-2013 OpenStack Foundation # # 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 la...
# DatabaseStorage for django. # 2011 (c) Mike Mueller <mike@subfocal.net> # 2009 (c) GameKeeper Gambling Ltd, Ivanov E. from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist from django.core.files.storage import Storage from django.core.files import File from django.db import connection, transact...
import collections import itertools import json import click import numpy from .lattice import Atom from .lattice import Vertex from .lattice import Lattice from .lattice import NanoParticle from .lattice import DepletedLattice from .material import Material Geometry = collections.namedtuple( 'Geometry', ['site...
import json import math import pdb import random import numpy as np import sys import time sys.path.extend(['.', '..']) from itertools import chain, repeat, izip from collections import defaultdict from operator import mul, and_, or_ from scipy.optimize import fsolve from matplotlib import pyplot as plt from ..util i...
#!/usr/bin/env python """Generic script for processing large data sets in small batches. Reads events from one datasource and commits them into another one, either one by one or in batches. Config template:: [data_maintainer3] job_name = dm_remove_expired_services # if source is database, you ne...
import seldon.fileutil as fu import os.path import logging import shutil from sklearn.externals import joblib import logging import random from sklearn.base import BaseEstimator logger = logging.getLogger(__name__) class Recommender(BaseEstimator): """ General recommendation interface """ def recom...
import argparse import gym import numpy as np import os import tensorflow as tf import tempfile import time import json import baselines.common.tf_util as U from baselines import logger from baselines import deepq from baselines.deepq.replay_buffer import ReplayBuffer, PrioritizedReplayBuffer from baselines.common.mi...
# coding=utf-8 # Copyright 2022 The Google Research 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 applicab...
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
# Copyright The IETF Trust 2007, All Rights Reserved from email.Utils import make_msgid, formatdate, formataddr, parseaddr, getaddresses from email.MIMEText import MIMEText from email.MIMEMessage import MIMEMessage from email.MIMEMultipart import MIMEMultipart from email.header import Header from email import message_...
#! /usr/bin/env python """ Notes ----- Calculations are carried out with numpy.float64 precision. This Python implementation is not optimized for speed. Angles are in radians unless specified otherwise. Quaternions ix+jy+kz+w are represented as [x, y, z, w]. """ import rospy # Messages from std_msgs.msg import Float...
# 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...
from test.support import run_unittest import cgi import os import sys import tempfile import unittest from io import StringIO from warnings import catch_warnings, filterwarnings class HackedSysModule: # The regression test will have real values in sys.argv, which # will completely confuse the test of the cgi m...
#!/usr/bin/env python3 """ dbsync: Database Sync: Command Line Interface Python3.x was required for consist Unicode processing, stored in the DB This CLI tool allows scripting Database Syncing between Zones. dbsync_server.py will call into the same functions, but will be for interactive multi-stage, multi-user, ...
from django.core.urlresolvers import reverse from django.contrib.auth import get_user_model from rest_framework import status from core.tests.base import BaseTestCase class UserAPIViewTestCase(BaseTestCase): def test_user_change_email(self): test_user_email_url = reverse('api:user:email') test...
import requests from itertools import chain from time import sleep import datetime import calendar import requests.compat import six class StackAPIError(Exception): """ The Exception that is thrown when ever there is an API error. This utilizes the values returned by the API and described here: http:...
#!/usr/bin/python # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
#!/usr/bin/env python3 # Copyright (c) 2017 Massachusetts Institute of Technology # 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 rig...
import os import sys def is_active(): return True def get_name(): return "Windows" def can_build(): if (os.name=="nt"): #building natively on windows! if (os.getenv("VSINSTALLDIR")): return True else: print("MSVC Not detected, attempting mingw.") return True if...
import copy from typing import Optional import virtool.db.utils import virtool.history.db import virtool.otus.db import virtool.otus.utils import virtool.utils from virtool.types import App async def add( app, otu_id: str, data: dict, user_id: str, isolate_id: Optional[str] = None ) -> dict: """ Add an i...
"""Test the Google Maps Travel Time config flow.""" from homeassistant import config_entries, data_entry_flow from homeassistant.components.google_travel_time.const import ( ARRIVAL_TIME, CONF_ARRIVAL_TIME, CONF_AVOID, CONF_DEPARTURE_TIME, CONF_DESTINATION, CONF_LANGUAGE, CONF_ORIGIN, CO...
#!/usr/bin/env python # # Very simple serial terminal # # This file is part of pySerial. https://github.com/pyserial/pyserial # (C)2002-2020 Chris Liechti <cliechti@gmx.net> # # SPDX-License-Identifier: BSD-3-Clause from __future__ import absolute_import import codecs import os import sys import threading import ...
from django.http import Http404 from django.core.exceptions import ObjectDoesNotExist from django.template.defaultfilters import slugify from django.db import models from django.contrib.auth.models import Permission, Group from django.contrib.contenttypes.models import ContentType from Forum.settings import User from F...
## A script for finding every cox coefficient and pvalue for every mRNA in LIHC Tier 3 data downloaded Feb. 2015 ##load necessary modules from rpy2 import robjects as ro import numpy as np import os ro.r('library(survival)') ##This call will only work if you are running python from the command line. ##If you are not ...
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# coding=utf-8 r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from twilio.base import values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource f...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright(c) 2015 Nippon Telegraph and Telephone Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/lic...
import shutil import tempfile import time from ethereum import spv import ethereum import ethereum.db as db import ethereum.opcodes as opcodes import ethereum.abi as abi from ethereum.slogging import LogRecorder, configure_logging, set_level from ethereum.utils import to_string from ethereum.config import Env from ethe...
# Copyright (c) 2010 matt # Copyright (c) 2010-2011 Paul Colomiets # Copyright (c) 2011 Mounier Florian # Copyright (c) 2012 Craig Barnes # Copyright (c) 2012, 2014-2015 Tycho Andersen # Copyright (c) 2013 Tao Sauvage # Copyright (c) 2013 Julien Iguchi-Cartigny # Copyright (c) 2014 ramnes # Copyright (c) 2014 Sean Vig ...
from datetime import time from datetime import timedelta import pendulum from .constants import SECS_PER_HOUR from .constants import SECS_PER_MIN from .constants import USECS_PER_SEC from .duration import AbsoluteDuration from .duration import Duration from .mixins.default import FormattableMixin class Time(Formatt...
import numpy as np import pandas as pd import pandas.util.testing as tm import dask.dataframe as dd from dask.dataframe.utils import (shard_df_on_index, meta_nonempty, make_meta, raise_on_meta_error) import pytest def test_shard_df_on_index(): df = pd.DataFrame({'x': [1, 2, 3, 4...
"""Support for Zabbix.""" from contextlib import suppress import json import logging import math import queue import threading import time from urllib.error import HTTPError from urllib.parse import urljoin from pyzabbix import ZabbixAPI, ZabbixAPIException, ZabbixMetric, ZabbixSender import voluptuous as vol from ho...
""" mbed CMSIS-DAP debugger Copyright (c) 2006-2013 ARM 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 http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable ...
from django.contrib.auth import get_user_model from django.contrib.auth.models import Permission from django.core.urlresolvers import reverse from django.test import TestCase from django.test.client import Client from helpdesk.models import Queue, Ticket from helpdesk import settings class PerQueueStaffMembershipTes...
#!/usr/bin/env python # -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # ex: set expandtab softtabstop=4 shiftwidth=4: # # Copyright (C) 2008,2009,2010,2011,2012,2013,2014,2015,2016,2017 Contributor # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance...
import numpy as np from mpi4py import MPI from mpi4py_fft import PFFT from pySDC.core.Errors import ParameterError, ProblemError from pySDC.core.Problem import ptype from pySDC.implementations.datatype_classes.mesh import mesh, imex_mesh from mpi4py_fft import newDistArray class allencahn_imex(ptype): """ E...
# -*- coding: utf-8 -*- from rest_framework import status as http_status import logging from flask import request from django.db.models.expressions import F from framework.exceptions import HTTPError from framework.auth.utils import privacy_info_handle from framework.auth.decorators import must_be_logged_in from fra...
"""Tests formatting as writer-agnostic ExcelCells ExcelFormatter is tested implicitly in pandas/tests/io/test_excel.py """ import pytest import pandas.util.testing as tm from pandas.io.formats.css import CSSWarning from pandas.io.formats.excel import CSSToExcelConverter @pytest.mark.parametrize('css,expected', [ ...
''' HTML tag classes. ''' __license__ = ''' This file is part of Dominate. Dominate 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 the License, or (at your option) any later version. ...
# Copyright 2011 OpenStack Foundation # # 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 l...
import flask import pymysql.cursors from pymysql.constants import ER from pymysql.err import IntegrityError from donut.auth_utils import get_user_id TERMS = {'FA': 1, 'WI': 2, 'SP': 3} TERM_NAMES = {v: k for k, v in TERMS.items()} def try_int(x): """ Converts a float to an int if it is already an integral v...
#!/usr/bin/env python2 # -*- coding: utf-8-*- import os import wave import json import tempfile import logging import urllib import urlparse import re import subprocess from abc import ABCMeta, abstractmethod import requests import yaml import nikitapath import diagnose import vocabcompiler class AbstractSTTEngine(ob...
"""Classes:: FitData -- The FitData class is a collection of functions that fit a 3D function with a fourier series. """ import numpy as np from json import dump, load from scipy.linalg import lstsq from itertools import product from dftintegrate import customserializer as cs class FitData(object): """ ...
# -*- coding: utf-8 -*- from bank_account_validator.exceptions import ( BankNotImplemented, InvalidAccount, InvalidAccountlength, InvalidBranch, InvalidBranchAndAccountCombination, InvalidBranchlength, MissingAccountDigit, MissingBranchDigit, UnexpectedAccountDigit, UnexpectedBranchDigit ) from bank_account_val...
# Copyright 2010 Matt Chaput. 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 conditions and the...
#!/usr/bin/python # 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 # "Licens...
#!/usr/bin/env python """ client module for memcached (memory cache daemon) Overview ======== See U{the MemCached homepage<http://www.danga.com/memcached>} for more about memcached. Usage summary ============= This should give you a feel for how this module operates:: import memcache mc = memcache.Client(...
"""The tests for the pilight component.""" from datetime import timedelta import logging import socket import unittest import pytest from homeassistant import core as ha from homeassistant.components import pilight from homeassistant.setup import setup_component from homeassistant.util import dt as dt_util from test...
# encoding: utf-8 """The shape tree, the structure that holds a slide's shapes.""" import os from pptx.compat import BytesIO from pptx.enum.shapes import PP_PLACEHOLDER, PROG_ID from pptx.media import SPEAKER_IMAGE_BYTES, Video from pptx.opc.constants import CONTENT_TYPE as CT from pptx.oxml.ns import qn from pptx.o...
# -*- coding: utf-8 -*- """tests for app.utils""" from mock import MagicMock from tests.unit import UnitTestCase from app import utils class UtilsTestCase(UnitTestCase): def test_instance_folder_path(self): self.assertIsNotNone(utils.INSTANCE_FOLDER_PATH, 'utils.INSTANCE_FO...
# Licensed under a 3-clause BSD style license - see LICENSE.rst import functools import inspect import pickle import pytest from ..decorators import (deprecated_attribute, deprecated, wraps, sharedmethod, classproperty, format_doc, deprecated_renamed_argument) from...
# See https://zulip.readthedocs.io/en/latest/subsystems/events-system.html for # high-level documentation on how this system works. from typing import cast, AbstractSet, Any, Callable, Dict, List, \ Mapping, MutableMapping, Optional, Iterable, Sequence, Set, Union from typing_extensions import Deque, TypedDict fro...
from tkinter import * from tkinter import messagebox import sys import os.path sys.path.append(os.path.join(os.path.dirname(__file__), '..')) from search import * import utils import numpy as np distances = {} class TSP_problem(Problem): """ subclass of Problem to define various functions """ def two_opt(s...
########################################################################## # # Copyright (c) 2011-2012, John Haddon. All rights reserved. # Copyright (c) 2013, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provi...
from collections import defaultdict import hashlib import json import logging from pprint import pformat import random import sys from threading import Thread import traceback import xmlrpclib import gnupg import obelisk from bitcoin.main import privkey_to_pubkey, random_key from pysqlcipher.dbapi2 import OperationalE...
#!/usr/bin/env pypy import math perm = [151,160,137,91,90,15, 131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23, 190, 6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33, 88,237,149,56,87,174,20,125,136,171,168, 68,175,74,165,71,134,139,48,27,166, 77,146,158,231,83...
# :[diStorm64}: Python binding # Copyright (c) 2009, Mario Vilas # 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, # ...
#!/usr/bin/env python """AFF4 RDFValue implementations. This module contains all RDFValue implementations. NOTE: This module uses the class registry to contain all implementations of RDFValue class, regardless of where they are defined. To do this reliably, these implementations must be imported _before_ the relevant...
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt # util __init__.py from __future__ import unicode_literals, print_function from werkzeug.test import Client import os, re, sys, json, hashlib, requests, traceback from markdown2 import markdown as _markdown from .html_...
# Copyright 2015 SimpliVity 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 o...
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P. # Copyright (c) 2012 VMware, Inc. # Copyright (c) 2011 Citrix Systems, Inc. # Copyright 2011 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. Yo...
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Show' db.create_table(u'spa_show', ( (u'event...
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
# Sapy # Copyright (C) 2018 stefano prina <stefano-prina@outlook.it> <stethewwolf@gmail.com> # # This program 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 opt...