gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
from jsonrpc import ServiceProxy
import sys
import string
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:8332")
else:
access = Ser... | |
import os
import unittest
from meshparser.exceptions import ParseError
from meshparser.vrmlparser.parser import VRMLParser
from meshparser.nodepare.pare import NodePare
file_path = os.path.dirname(os.path.realpath(__file__))
class ParserTestCase(unittest.TestCase):
def testExistence(self):
v = VRMLPar... | |
"""
Long/Short Cross-Sectional Momentum
Author: Gilbert Wassermann
This algorithm creates traditional value factors and standardizes
them using a synthetic S&P500. It then uses a 130/30 strategy to trade.
https://www.math.nyu.edu/faculty/avellane/Lo13030.pdf
Please direct any questions, feedback, or correct... | |
# ----------------------------------------------------------------------------
# Copyright (c) 2013--, scikit-bio development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# --------------------------------------------... | |
#!/usr/bin/python
'''
File defining a python class for snowpit data
November 2016, Simon Filhol
'''
import numpy as np
import pandas as pd
import os
import snowpyt.CAAMLv6_xml as cxv6
from snowpyt.snowflake.sf_dict import snowflake_symbol_dict
import snowpyt.snowflake.sf_dict as sfd
from matplotlib import pyplot ... | |
# 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... | |
# 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... | |
"""
Support for Z-Wave lights.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/light.zwave/
"""
import logging
# Because we do not compile openzwave on CI
# pylint: disable=import-error
from threading import Timer
from homeassistant.components.light impo... | |
# Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
import copy
import mock
import os
import yaml
from c7n.testing import TestUtils
from click.testing import CliRunner
from c7n_org import cli as org
ACCOUNTS_AWS_DEFAULT = yaml.safe_dump({
'accounts': [
{'name': 'dev',
... | |
# Copyright 2014, Rackspace, US, 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 ... | |
#
#Copyright (c) 2012-2021, NVIDIA CORPORATION.
#SPDX-License-Identifier: Apache-2.0
import gevent
import gevent.pool
import gevent.monkey
gevent.monkey.patch_socket()
gevent.monkey.patch_ssl()
gevent.monkey.patch_time()
import os
import re
import sys
import time
import signal
import logging
import msgpack
import zmq... | |
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright 2013 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");... | |
# 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... | |
# Copyright 2018,2019,2020,2021 Sony Corporation.
# Copyright 2021 Sony Group 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
#... | |
#
# 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... | |
"""
Tests for the Parsing Library
"""
import json
from datetime import datetime
import parsing_lib
def _test_case_parser(test_case):
""" Parses test case JSON.
Corrects some of the default parsing functionality to work better with the
given test cases
Args:
test_case: the test case to parse... | |
# The absolute import feature is required so that we get the root celery
# module rather than `amo.celery`.
from __future__ import absolute_import
from inspect import isclass
from celery.datastructures import AttributeDict
from django.utils.translation import ugettext_lazy as _
__all__ = ('LOG', 'LOG_BY_ID', 'LOG_K... | |
# Copyright 2015 The Bazel 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 applicable la... | |
import time
import collections
import traceback
import os
import sys
import types
from hotspotter.other.AbstractPrintable import AbstractPrintable
from PyQt4.Qt import QObject
from PyQt4.QtGui import QMessageBox
from PyQt4.QtCore import Qt
#import os
#os.spawnl(os.P_DETACH, 'some_log_running_command')
# Have this hap... | |
"""
Unified interfaces to minimization algorithms.
Functions
---------
- minimize : minimization of a function of several variables.
- minimize_scalar : minimization of a function of one variable.
"""
__all__ = ['minimize', 'minimize_scalar']
from warnings import warn
import numpy as np
# unconstrained minimizati... | |
import pytest
def _type_length():
# Not a fixture as we need to parameterize tests on this
from encoded.loadxl import ORDER
from pkg_resources import resource_stream
import codecs
import json
utf8 = codecs.getreader("utf-8")
return {
name: len(json.load(utf8(resource_stream('encode... | |
#!/usr/bin/env python3
"""
RDS Functions
"""
import sys
from datetime import datetime, timedelta
from operator import itemgetter
from exclusions import EXCLUDED_INSTANCES
import boto3
import botocore
## Session/client setup operations
def get_session(access_key_id, secret_access_key):
" Establishes a session with... | |
from unittest.mock import patch, Mock
from django.conf import settings
from django.contrib.auth.models import Permission
from django.test import TestCase
from django.urls import reverse
from django.utils.translation import ugettext_lazy as _
from bulk_sms.models import Broadcast, Batch
from bulk_sms.tests.factories i... | |
from __future__ import unicode_literals
import logging
import uuid
from django.apps import apps
from django.conf import settings
from django.contrib.contenttypes import fields as ct_fields
from django.contrib.contenttypes import models as ct_models
from django.core import validators
from django.core.mail import send_... | |
# -*- coding: utf-8 -*-
import cPickle
import json
import logging
from rest_framework_gis import serializers as geo_serializers
from django.contrib.gis.geos import GEOSGeometry
from django.utils import timezone
from django.utils.translation import ugettext as _
from rest_framework import serializers
import validato... | |
# Copyright 2011 OpenStack Foundation
# Copyright 2012 RedHat Inc.
# Copyright 2018 Verizon Wireless
# 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
#
# ... | |
import logging
import sys
import unittest
try:
from urllib.parse import urlencode
except:
from urllib import urlencode
from urllib3 import encode_multipart_formdata, HTTPConnectionPool
from urllib3.exceptions import (
EmptyPoolError,
DecodeError,
MaxRetryError,
TimeoutError,
)
from urllib3.pac... | |
#!/usr/bin/env python
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2010,2012,2013,2014,2015,2016 Contributor
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
#... | |
# -*- encoding: utf-8 -*-
# Copyright (c) 2015 b<>com
#
# Authors: Jean-Emile DARTOIS <jean-emile.dartois@b-com.com>
#
# 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/... | |
from collections import OrderedDict
import contextlib
import gym
import numpy as np
from typing import Dict, List, Any, Union
from ray.rllib.models.preprocessors import get_preprocessor, \
RepeatedValuesPreprocessor
from ray.rllib.models.repeated_values import RepeatedValues
from ray.rllib.policy.sample_batch impo... | |
import autosar
import apx
import os
from copy import deepcopy
from apx.parser import apx_split_line, Parser
class Node:
"""
Represents an APX node
Example:
>>> import sys
>>> import apx
>>> node = apx.Node()
>>> node.append(apx.ProvidePort('TestSignal1','C'))
0
>>> node.append(a... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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.apach... | |
#!/usr/bin/env python
# Copyright 2014 Hewlett-Packard Development Company, L.P.
# Copyright 2014 Samsung Electronics
# 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
#... | |
"""
readligo.py
Version 0.2
April 21, 2016
Jonah Kanner, Roy Williams, and Alan Weinstein
Updates in this version:
* Should now work with both Python 2 and Python 3
This module provides tools for reading LIGO data
files. Data along with supporting documentation
can be downloaded from the losc web site:
https://losc... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for `file_read_backwards` module."""
import itertools
import os
import tempfile
import unittest
from collections import deque
from file_read_backwards.file_read_backwards import FileReadBackwards
from file_read_backwards.file_read_backwards import supported_enco... | |
# -*- coding: utf-8 -*-
"""
common.py
~~~~~~~~~~~~
This module implements the common and helper functions for the OneView REST API
"""
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
from builtins import range
from fu... | |
# 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... | |
"""Support for the DirecTV receivers."""
import logging
import requests
import voluptuous as vol
from homeassistant.components.media_player import (
MediaPlayerDevice, PLATFORM_SCHEMA)
from homeassistant.components.media_player.const import (
MEDIA_TYPE_CHANNEL, MEDIA_TYPE_MOVIE, MEDIA_TYPE_TVSHOW,
SUPPORT... | |
import re
import collections
from enum import Enum
from ydk._core._dm_meta_info import _MetaInfoClassMember, _MetaInfoClass, _MetaInfoEnum
from ydk.types import Empty, YList, YLeafList, DELETE, Decimal64, FixedBitsDict
from ydk._core._dm_meta_info import ATTRIBUTE, REFERENCE_CLASS, REFERENCE_LIST, REFERENCE_LEAFLI... | |
# 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... | |
# -*- coding: utf-8 -*-
# Copyright 2020 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... | |
import re
from rpython.rlib.objectmodel import compute_hash, specialize, always_inline
from rpython.rlib import jit, rgc
import space, weakref
class Object:
_immutable_fields_ = ['interface', 'custom_interface', 'flag', 'number', 'value', 'contents', 'data', 'string', 'iterator', 'arity', 'methods', 'default', 'ce... | |
# 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... | |
from io import BytesIO
from fleet.client import fleet_base
from fabric.api import run, settings, put, hide
import logging
import time
import random
__author__ = 'sukrit'
DEFAULT_FAB_SETTINGS = {
'timeout': 30,
'command_timeout': 180,
'connection_attempts': 3,
'disable_known_hosts': True,
'abort... | |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import paddle.fluid as fluid
from paddle.fluid.initializer import MSRA
from paddle.fluid.param_attr import ParamAttr
__all__ = [
'ShuffleNetV2', 'ShuffleNetV2_x0_5', 'ShuffleNetV2_x1_0',
'ShuffleNetV2_x... | |
"""
SoftLayer.tests.CLI.modules.ticket_tests
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:license: MIT, see LICENSE for more details.
"""
import json
import mock
from SoftLayer.CLI import exceptions
from SoftLayer import testing
class TicketTests(testing.TestCase):
def test_list(self):
result ... | |
"""
2D inversion for the basement relief of sedimentary basins.
There are different parametrizations available.
The simplest are meant more as an exercise and initiation in inverse problems:
* :func:`~fatiando.gravmag.basin2d.Triangular`: assumes a basin with a
triangular cross-section (think "foreland").
* :func:... | |
from datetime import datetime, time, timedelta
from time import sleep
import unittest
from airflow import configuration
configuration.test_mode()
from airflow import jobs, models, DAG, executors, utils, operators
from airflow.www.app import app
from airflow import utils
NUM_EXAMPLE_DAGS = 5
DEV_NULL = '/dev/null'
LOCA... | |
import time
from decimal import Decimal
import hashlib
import logging
from django.utils import six
from six.moves.urllib.request import Request, urlopen
from six.moves.urllib.parse import urlencode
from django.core.exceptions import ImproperlyConfigured
from django.utils.translation import ugettext_lazy as _
from get... | |
# Copyright 2014 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 writin... | |
#!/usr/bin/env python3
# -*- encoding: utf-8 -*-
# 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 Apach... | |
# Copyright (C) 2013 Google 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 above copyright
# notice, this list of conditions and the ... | |
from relay.warnings.models import *
import re
import time
from django.db.models.query import Q
# Search for certain kinds of races
#------------------------------------------------------------
# UI :: Search forms, etc.
#------------------------------------------------------------
from django import newforms as form... | |
from django.contrib.auth.models import User
from djblets.webapi.errors import PERMISSION_DENIED
from djblets.webapi.testing.decorators import webapi_test_template
from reviewboard.reviews.models import GeneralComment
from reviewboard.webapi.resources import resources
from reviewboard.webapi.tests.base import BaseWebAP... | |
# coding: utf-8
"""
Onshape REST API
The Onshape REST API consumed by all clients. # noqa: E501
The version of the OpenAPI document: 1.113
Contact: api-support@onshape.zendesk.com
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import re # noqa: F401
im... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2011 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 obt... | |
# -*- coding: utf-8 -*-
"""
tests.testing
~~~~~~~~~~~~~
Test client and more.
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import pytest
import flask
import werkzeug
from flask._compat import text_type
def test_environ_defaults_from_config(app, clien... | |
"""Support for Automation Device Specification (ADS)."""
import threading
import struct
import logging
import ctypes
from collections import namedtuple
import asyncio
import async_timeout
import voluptuous as vol
from homeassistant.const import (
CONF_DEVICE,
CONF_IP_ADDRESS,
CONF_PORT,
EVENT_HOMEASSI... | |
#!/usr/bin/env python
# Copyright 2011 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... | |
import os
import tempfile
from django.core.management import call_command
from django.test import TestCase
from django.test.utils import override_settings
from mock import call, patch
from kolibri.content.models import LocalFile
CONTENT_STORAGE_DIR_TEMP = tempfile.mkdtemp()
CONTENT_STORAGE_SOURCE_DIR = tempfile.mkdte... | |
from __future__ import unicode_literals
from functools import reduce, wraps
import operator
import threading
from django.db import models
from django.db.models.base import ModelBase
from django.db.models.query import Q
from django.db.models.query_utils import DeferredAttribute
from django.utils import six
from django... | |
#title :image_class.py
#description :This code will batch classify multiple images using a .csv file containing tags using a Convolustional Neural Network.
#author :Harry F Bullough
#date :10/05/2017
#version :3.1
#usage :python image_class.py /my/image/directory/
#no... | |
import time
from coloredcoinlib.store import PersistentDictStore
from asset import AdditiveAssetValue, AssetTarget
from txcons import RawTxSpec
from ngcccbase.address import AddressRecord
def asset_value_to_data(av):
return (av.get_asset().get_id(),
av.get_value())
class TxHistoryEntry(object):
de... | |
# coding: utf-8
"""
DocuSign REST API
The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign. # noqa: E501
OpenAPI spec version: v2.1
Contact: devcenter@docusign.com
Generated by: https://github.com/swagger-api/swagger-codegen.gi... | |
from __future__ import absolute_import, division, print_function
import os
import _pytest._code
import py
import pytest
from _pytest.main import Node, Item, FSCollector
from _pytest.resultlog import generic_path, ResultLog, \
pytest_configure, pytest_unconfigure
def test_generic_path(testdir):
from _pyte... | |
# Copyright (c) 2016 The Johns Hopkins University/Applied Physics Laboratory
# 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/LICEN... | |
"""Switch platform for UniFi integration.
Support for controlling power supply of clients which are powered over Ethernet (POE).
Support for controlling network access of clients selected in option flow.
Support for controlling deep packet inspection (DPI) restriction groups.
"""
import logging
from typing import Any
... | |
# -*- mode: python; coding: utf-8 -*-
# Copyright 2015 Peter Williams <peter@newton.cx> and collaborators
# Licensed under the MIT License.
"""pwkit.slurp - run a program and capture its output."""
from __future__ import absolute_import, division, print_function, unicode_literals
__all__ = str ('Event Redirection Sl... | |
# -*- encoding: utf-8 -*-
import logging
import tempfile
import sh
import os
import shutil
import time
import hashlib
import json
from StringIO import StringIO
from gzip import GzipFile
from beefish import encrypt, decrypt
from boto.s3.key import Key
import bakthat
from bakthat.conf import DEFAULT_DESTINATION
from ba... | |
import numpy as np
from mpi4py import MPI
from pmesh.pm import ParticleMesh
from pySDC.core.Errors import ParameterError, ProblemError
from pySDC.core.Problem import ptype
from pySDC.playgrounds.pmesh.PMESH_datatype import pmesh_datatype, rhs_imex_pmesh
class allencahn_imex(ptype):
"""
Example implementing A... | |
#
# Copyright (c) 2015 Red Hat
# Licensed under The MIT License (MIT)
# http://opensource.org/licenses/MIT
#
from rest_framework import serializers
from django.core.exceptions import FieldError
from django.core.validators import RegexValidator
from pdc.apps.common.fields import ChoiceSlugField
from pdc.apps.common imp... | |
from .models import (Message, METHOD_SMS, METHOD_SMS_CALLBACK,
METHOD_SMS_SURVEY, METHOD_IVR_SURVEY,
CaseReminderHandler)
from corehq.apps.smsforms.app import submit_unfinished_form
from corehq.apps.smsforms.models import get_session_by_session_id, SQLXFormsSession
from corehq.apps.sms.mixin import (VerifiedNu... | |
# Copyright 2014 Open Source Robotics Foundation, 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... | |
import ctypes, random, unittest, sys
from django.contrib.gis.geos import *
from django.contrib.gis.geos.base import gdal, numpy, GEOSBase
from django.contrib.gis.tests.geometries import *
class GEOSTest(unittest.TestCase):
@property
def null_srid(self):
"""
Returns the proper null SRID dependi... | |
import tables
import numpy as np
import math
import png
import sys
import time
sys.path.insert(0, '/home/brad/rayTracer/Objects')
from object import Sphere, Plane, Cylinder, Cube
str_time = time.time()
cur_sec = 0
'''---------------------------------------------------------'''
''' Setup Image ... | |
#!/usr/local/bin/python
# encoding: utf-8
"""
*Import ned_d catalogue into sherlock-catalogues database*
:Author:
David Young
"""
from __future__ import print_function
from __future__ import division
from builtins import zip
from past.utils import old_div
import sys
import os
os.environ['TERM'] = 'vt100'
import re... | |
"""
.. See the NOTICE file distributed with this work for additional information
regarding copyright ownership.
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.... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
try:
from xml.etree import cElementTree as etree
except ImportError:
from xml.etree import ElementTree as etree
import svgplotlib.VG as vg
from svgplotlib.SVG.VGParser import Parser, Box
class Renderer(Parser):
LINK = 'xlink:href'
SVG_NS = '{http://www.w... | |
# Copyright 2020 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,... | |
# Defining the goal state
goal_items = [1, 2, 3, 8, 0, 4, 7, 6, 5]
visited_vertices = []
# Defining imput states with increasing levels of difficulty
easy_initial_state = [1, 3, 4, 8, 6, 2, 7, 0, 5]
medium_initial_state = [2, 8, 1, 0, 4, 3, 7, 6, 5]
hard_initial_state = [5, 6, 7, 4, 0, 8, 3, 2, 1]
max = 0
import sys
... | |
# Copyright (c) 2016 EMC 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 required by applica... | |
"""Library for interacting with InfluxDB."""
# Copyright (C) 2015 Research and Education Advanced Network New Zealand Ltd.
# Copyright (C) 2015--2018 The Contributors
#
# 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 ... | |
from __future__ import print_function
from pyfasta import Fasta
import operator
import collections
import string
import sys
import optparse
from cStringIO import StringIO
def newnames(oldname, n, kmers=None, overlap=None, header=None):
"""
>>> newnames('some.fasta', 1)
['some.split.fasta']
>>> newnam... | |
#
# Banana banana banana
#
# ~ ABorgna
#
import constants as const
import encoderSrc.encoder as encoder
import threading
import numpy as np
from sys import stderr
from time import sleep, time
if const.PY3:
import queue
else:
import Queue as queue
class Transmitter ( threading.Thread ):
""""
The asyn... | |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
from parlai.core.opt import Opt
from parlai.tasks.empathetic_dialogues.agents import (
EmotionClass... | |
from vanilla import *
from defconAppKit.windows.baseWindow import BaseWindowController
from mojo.UI import MultiLineView
from mojo.events import addObserver, removeObserver
from mojo.roboFont import AllFonts, CurrentFont
from mojo.drawingTools import *
from defconAppKit.tools.textSplitter import splitText
from lib.UI.... | |
from contextlib import contextmanager
import itertools
from docutils import parsers, nodes
from CommonMark import DocParser, HTMLRenderer
from warnings import warn
__all__ = ['CommonMarkParser']
def flatten(iterator):
return itertools.chain.from_iterable(iterator)
class _SectionHandler(object):
def __ini... | |
# Copyright 2014 0xc0170
#
# 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, soft... | |
"""Provide the functionality to group entities."""
from __future__ import annotations
from abc import abstractmethod
import asyncio
from collections.abc import Iterable
from contextvars import ContextVar
import logging
from typing import Any, List, cast
import voluptuous as vol
from homeassistant import core as ha
f... | |
#!/usr/bin/python
import sys
if len (sys.argv) != 4:
print >>sys.stderr, "usage: ./gen-indic-table.py IndicSyllabicCategory.txt IndicMatraCategory.txt Blocks.txt"
sys.exit (1)
BLACKLISTED_BLOCKS = ["Thai", "Lao", "Tibetan"]
files = [file (x) for x in sys.argv[1:]]
headers = [[f.readline () for i in range (2)] fo... | |
"""Utilities to work with Jedi.
Translates pygls types back and forth with Jedi
"""
from inspect import Parameter
from typing import Dict, List, Optional
import docstring_to_markdown
import jedi.api.errors
import jedi.inference.references
import jedi.settings
from jedi import Project, Script
from jedi.api.classes im... | |
#
# Tables describing slots in the CPython type object
# and associated know-how.
#
import Naming
import PyrexTypes
import StringEncoding
invisible = ['__cinit__', '__dealloc__', '__richcmp__',
'__nonzero__', '__bool__']
class Signature(object):
# Method slot signature descriptor.
#
# ... | |
# 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... | |
#
# Protein Engineering Analysis Tool Structure Analysis (PEATSA)
# Copyright (C) 2010 Michael Johnston & Jens Erik Nielsen
#
# Author: Michael Johnston
#
# 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 Fou... | |
########
# Copyright (c) 2014 GigaSpaces Technologies Ltd. All rights reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | |
# Copyright 2011 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... | |
# 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 enum import Enum
class LaserPathType(Enum):
hit = "hit"
bounce = "bounce"
through = "pass"
# destroy = "destroy"
class MoveType(Enum):
rotate = "ROTATE"
move = "MOVE"
swap = "SWAP"
class TeamColor(Enum):
red = "red"
silver = "silver"
blank = "blank"
@staticmethod
... | |
###
# Copyright (c) 2002-2004, Jeremiah Fincher
# 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 co... | |
# 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.