gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
import json
from pokemongo_bot.base_task import BaseTask
from pokemongo_bot.human_behaviour import sleep
from pokemongo_bot.inventory import pokemons, Pokemon, Attack
import re
DEFAULT_IGNORE_FAVORITES = False
DEFAULT_GOOD_ATTACK_THRESHOLD = ... | |
#
# 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... | |
import sys
import collections
import struct
import binascii
DEBUG = False
# py3
is_py3 = (sys.version_info.major >= 3)
if is_py3:
basestring = str
int_types = int
else:
int_types = (int, long)
class BitArray(object):
def __init__(self, size, bits):
self.size = size
if len(bits) > siz... | |
# 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
# d... | |
"""
Python binding to the Relayr-api.
"""
from __future__ import print_function
import json
import requests
import logging
import Pubnub
import threading
import time
BASE_URL = "https://api.relayr.io/"
class RelayrException(Exception):
""" Base exception for Relayr related errors. """
pass
class Unauthoriz... | |
# Copyright (c) 2010 Citrix Systems, 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 la... | |
# Eve W-Space
# Copyright 2014 Andrew Austin and 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 a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | |
# ******************************************************************************
# Copyright 2014-2018 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apa... | |
#!/usr/bin/python
# vpn.py: a top level interface to commands to run VPNs on a VM as
# different clients. The use case is allowing us to measure from more
# places.
import argparse
import logging
from random import shuffle
import os
import time
import sys
import signal
import dns.resolver
import json
import centinel.... | |
from _context import sparse
from sparse import util
from util import Lambda, Debug
from util import od, prod, logit
import time, os, math, sys, PIL
import torch, random
from torch.autograd import Variable
from torch import nn, optim
import torch.nn.functional as F
from torch.nn import Parameter
from tqdm import tran... | |
from typing import Dict, List, Union, cast
from asgiref.sync import async_to_sync
from django.apps import apps
from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.auth.models import AnonymousUser
from django.core.exceptions import ImproperlyConfigured
from django.db.mode... | |
from datetime import datetime
import mock
from django.test.testcases import TestCase
from casexml.apps.stock.models import StockTransaction, StockReport
from corehq.apps.accounting.tests import generator
from corehq.apps.locations.forms import LocationForm
from custom.ilsgateway.models import SupplyPointStatus, Sup... | |
from __future__ import print_function
import sys
import gdbremote_testcase
import lldbgdbserverutils
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class TestGdbRemoteProcessInfo(gdbremote_testcase.GdbRemoteTestCaseBase):
mydir = TestBase.comp... | |
# 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 ... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... | |
# encoding: utf-8
"""
Test suite for pptx.shapes.shapetree module
"""
from __future__ import absolute_import
import pytest
from pptx.chart.data import ChartData
from pptx.enum.base import EnumValue
from pptx.enum.shapes import PP_PLACEHOLDER
from pptx.oxml.shapes.autoshape import CT_Shape
from pptx.oxml.shapes.grap... | |
"""
Module with tests for files
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2013, the IPython 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: formatter.py
# author: Andrea Vedaldi
# description: Utility to format MATLAB comments.
# Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson.
# All rights reserved.
#
# This file is part of the VLFeat library and is made available under
# the terms of the BSD license (see th... | |
'''tzinfo timezone information for Portugal.'''
from pytz.tzinfo import DstTzInfo
from pytz.tzinfo import memorized_datetime as d
from pytz.tzinfo import memorized_ttinfo as i
class Portugal(DstTzInfo):
'''Portugal timezone definition. See datetime.tzinfo for details'''
zone = 'Portugal'
_utc_transition_... | |
"""
File: t_reshape.py
Purpose: Transform to reshape a melody to a curve.
"""
from function.function_pitch_range import FunctionPitchRange
from melody.constraints.contextual_note import ContextualNote
from melody.constraints.fit_pitch_to_function_constraint import FitPitchToFunctionConstraint
from melody.constraints... | |
import os
import logging
import time
from datetime import date, time as datetime_time
import itertools
from decimal import Decimal
import requests
import tabulator
from tableschema import Schema
from dataflows.helpers.resource_matcher import ResourceMatcher
from datapackage_pipelines.wrapper import ingest, spew
fro... | |
#!/usr/bin/env python
#_MIT License
#_
#_Copyright (c) 2017 Dan Persons (dpersonsdev@gmail.com)
#_
#_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 limi... | |
# Copyright 2011 Denali Systems, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | |
# 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 ... | |
# this is a simplification of the
# "Simultaneous Peripheral Operations OnLine"
# in future, may switch to "mmap"
from zPE.util.global_config import *
import zPE.util.spool
import zPE.base.core.IO_JES2 as IO_JES2, zPE.base.core.IO_SMS as IO_SMS
import sys # for sys.maxsize
import re
## Simult... | |
# ==========================================================================
#
# Copyright NumFOCUS
#
# 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/... | |
import bottleneck as bn
import numpy as np
from scipy import sparse
"""
All the data should be in the shape of (n_users, n_items)
All the latent factors should in the shape of (n_users/n_items, n_components)
1. train_data refers to the data that was used to train the model
2. heldout_data refers to the data that wa... | |
from django.conf import settings
from django.utils import translation
from elasticsearch_dsl import F, query
from elasticsearch_dsl.filter import Bool
from rest_framework.filters import BaseFilterBackend
import mkt
from mkt.api.base import form_errors, get_region_from_request
from mkt.constants.applications import ge... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__version__ = '1.1.3'
__author__ = 'Liao Xuefeng (askxuefeng@gmail.com)'
'''
Python client SDK for sina weibo API using OAuth 2.
'''
try:
import json
except ImportError:
import simplejson as json
try:
from cStringIO import StringIO
except ImportError:
fr... | |
#!/usr/bin/env python
from __future__ import unicode_literals
"""
@package status_handler
@file status_handler.py
@author Edna Donoughe (based on work of James Case)
@brief gunicorn service supporting request for all routes in OOI UI Flask App, then process each static route for execution status
"""
import multiproc... | |
class Matrix (object):
def __init__ (self, rows, cols, array=None):
super (Matrix, self).__init__ ()
length = rows * cols
self.rows = rows
self.cols = cols
if array:
if length != len (array):
raise RuntimeError ("Bad Dimensions")
self.a... | |
from PIL import Image, ImageDraw
from .utils import Rect
class PebbleGraphicsContext(object):
COLOR_BLACK = (0, 255)
COLOR_WHITE = (255, 255)
COLOR_CLEAR = (192, 0)
COMP_ASSIGN = 'assign'
COMP_ASSIGN_INVERTED = 'assign_inverted'
COMP_OR = 'or'
COMP_AND = 'and'
COMP_CLEAR = 'clear'
... | |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | |
#!/usr/bin/env python
"""
An unofficial API for pitchfork.com reviews.
author: Michal Czaplinski
email: mmczaplinski@gmail.com
"""
import json
import difflib
from bs4 import BeautifulSoup
from urllib.parse import urljoin, quote
from urllib.request import urlopen
from urllib.request import Request
def replace_brea... | |
'''
Created on 2013-4-21
@author: Xsank
'''
import os
import time
import itertools
import functools
import mimetypes
from json import dumps
from urlparse import urljoin
from traceback import format_exc
from types import StringType
from config import HTTP_CODES,DEBUG
from http import Request,Response
from exception i... | |
# Verify that gdb can pretty-print the various PyObject* types
#
# The code for testing gdb was adapted from similar work in Unladen Swallow's
# Lib/test/test_jit_gdb.py
import os
import re
import subprocess
import sys
import unittest
from test.test_support import run_unittest, findfile
try:
gdb_version, _ = sub... | |
#!/usr/bin/env python
#
# Copyright 2007 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 o... | |
#!/usr/bin/env python
# Copyright (c) 2013 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.
"""Tool for manipulating naclports packages in python.
This tool can be used to for working with naclports packages.
It can al... | |
''' Extractors that operate on AudioStim inputs. '''
from abc import ABCMeta
from os import path
import sys
import logging
import numpy as np
from scipy import fft
import pandas as pd
from pliers.stimuli.audio import AudioStim
from pliers.stimuli.text import ComplexTextStim
from pliers.extractors.base import Extract... | |
import os
import re
import tempfile
import shutil
from tqdm import tqdm
import shlex
from ._streams import AudioStream, VideoStream, SubtitleStream
from ._errors import FFmpegNormalizeError
from ._cmd_utils import NUL, CommandRunner, DUR_REGEX, to_ms
from ._logger import setup_custom_logger
logger = setup_custom_logg... | |
# 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 applicable ... | |
# 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 ... | |
# 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 ... | |
import collections
import configparser
import glob
import json
import logging
import os
import shutil
import socket
import tarfile
import threading
import time
import zipfile
import flask
import requests
from flask import Response, request
from splunk_eventgen.eventgen_api_server import eventgen_core_object
INTERNAL... | |
# !/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Extracts native methods from a Java file and generates the JNI bindings.
If you change this, please run and update the tests.""... | |
# Copyright 2015 Internap.
#
# 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, so... | |
from django.dispatch import receiver
from django.core.exceptions import ObjectDoesNotExist
from hs_core.hydroshare.hs_bagit import create_bag_metadata_files
from hs_core.signals import pre_metadata_element_create, pre_metadata_element_update, \
pre_create_resource, post_metadata_element_update, post_add_files_to_r... | |
#-*- coding: utf-8 -*-
# extractdatawidget.py
# Copyright (c) 2011, see AUTHORS
# All rights reserved.
# This file is part of ProfileExtractor.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# Redistributions of s... | |
from __future__ import print_function
__version__ = '1.0.1'
__author__ = 'tylin'
# Interface for accessing the Microsoft COCO dataset.
# Microsoft COCO is a large image dataset designed for object detection,
# segmentation, and caption generation. pycocotools is a Python API that
# assists in loading, parsing and visu... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from settings import LOCAL_DB_PASS, DB_CONN
import MySQLdb as mdb
import time
from datetime import datetime, timedelta
MAX_RESULTS = 1000 #the maximum number of results to return from a query.
######Simple Queries - including insert and update queries############
#inp... | |
# Copyright 2021 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
import errno
import json
import os
import cv2
import numpy as np
import pyproj
from opensfm import features
from opensfm import geo
from opensfm import types
from opensfm import context
def camera_from_json(key, obj):
"""
Read camera from a json object
"""
pt = obj.get('projection_type', 'perspectiv... | |
"""
The `compat` module provides support for backwards compatibility with older
versions of Django/Python, and compatibility wrappers around optional packages.
"""
from __future__ import unicode_literals
import sys
from django.conf import settings
from django.core import validators
from django.utils import six
from ... | |
#$Id$
from books.model.Address import Address
class CreditNote:
"""This class creates object for credit notes."""
def __init__(self):
"""This class is used to create object for credit notes."""
self.creditnote_id = ''
self.creditnote_number = ''
self.date = ''
self.stat... | |
# -*- coding: utf-8 -*-
from __future__ import with_statement
import copy
from django.contrib.auth.models import AnonymousUser
from django.contrib.sites.models import Site
from django.http import Http404, HttpResponseRedirect
from cms.api import create_page, create_title, publish_page, add_plugin
from cms.exceptions ... | |
# 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... | |
"""Test the cross_validation module"""
from __future__ import division
import warnings
import numpy as np
from scipy.sparse import coo_matrix
from scipy import stats
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_false
from sklearn.utils.testing import assert_equal
from sklearn... | |
#
# 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... | |
#!/usr/bin/env python
# -- Content-Encoding: UTF-8 --
"""
Pelix remote services implementation based on Herald messaging,
jsonrpclib-pelix, and using the Jabsorb format
:author: Thomas Calmant
:copyright: Copyright 2014, isandlaTech
:license: Apache License 2.0
:version: 0.0.4
:status: Alpha
..
Copyright 2014 is... | |
from __future__ import division, absolute_import, print_function
import os
import sys
import numpy as np
from numpy.testing import (
run_module_suite, TestCase, assert_, assert_equal, assert_array_equal,
assert_array_almost_equal, assert_raises
)
from numpy.testing.utils import _assert_valid_refcount
from... | |
# Copyright 2014 Hewlett-Packard Development Company, L.P.
# 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... | |
from __future__ import division
from collections import defaultdict
import numpy as np
from base_sample import BaseSample
#import time
class Minimization(BaseSample):
def __init__(self, data_frame, number_arms=2):
self.integrate = None
super(Minimization, self).__init__(data_frame, number_ar... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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 obtain
# a copy of the License at
#
# http://www.apach... | |
# 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.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file... | |
from __future__ import unicode_literals
from __future__ import absolute_import
from functools import reduce
import logging
from docker.errors import APIError
from .config import get_service_name_from_net, ConfigurationError
from .const import DEFAULT_TIMEOUT, LABEL_PROJECT, LABEL_SERVICE, LABEL_ONE_OFF
from .containe... | |
import pytest
from vivarium.framework.components.manager import (
ComponentConfigError,
ComponentManager,
OrderedComponentSet,
)
from vivarium.framework.configuration import build_simulation_configuration
from .mocks import (
MockComponentA,
MockComponentB,
MockGenericComponent,
NamelessCo... | |
# 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... | |
#!/usr/bin/env python
'''
Run automatic and manual matches together, interleaved.
'''
import datetime
import multiprocessing
import os
import random
import sys
import time
import dbcon
import matchstate as ms
import rungame
import tools
from rgkit.settings import settings
def try_create_matches(db):
E = 2.71828
... | |
import sys
import operator
import pytest
import ctypes
import gc
import numpy as np
from numpy.core._rational_tests import rational
from numpy.testing import (
assert_, assert_equal, assert_array_equal, assert_raises, HAS_REFCOUNT)
from numpy.compat import pickle
from itertools import permutations
def assert_dtyp... | |
import numpy as np
import nibabel as nib
from ctypes import *
import pyglet as pyglet
from pyglet.gl import *
from pyglet.window import key
#from fos.core.arrayimage import ArrayInterfaceImage
from fos.core.actor import Actor
from fos.core.utils import screen_to_model
import fos.core.collision as cll
from fos.actor.tex... | |
import numpy as np
import random
import tensorflow as tf
from collections import deque
class DiscreteDeepQ(object):
def __init__(self, observation_size,
num_actions,
observation_to_actions,
optimizer,
session,
... | |
# Licensed to the .NET Foundation under one or more agreements.
# The .NET Foundation licenses this file to you under the Apache 2.0 License.
# See the LICENSE file in the project root for more information.
#
# PART 2. how IronPython choose the overload methods
#
import unittest
from iptest import IronPythonTestCase... | |
# -*- 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
from django.core.management import call_command
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Setting'
d... | |
#! /usr/bin/python3
import os
import sys
import hashlib
import binascii
import time
import apsw
import decimal
D = decimal.Decimal
import difflib
import json
import inspect
import requests
from requests.auth import HTTPBasicAuth
import logging
import tempfile
import shutil
import locale
import re
# Set test environme... | |
# 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 rpython.rlib import jit, unroll, rweakref
from rpython.rlib.objectmodel import specialize
def make_map_type(getter, keyclass):
class Map(object):
""" A basic implementation of a map which assigns Racket values to an index
based on the identity of the Racket value. A Map consists ... | |
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | |
# -*- coding: utf-8 -*-
# Copyright 2013 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | |
'''
Entry point module (keep at root):
This module starts the debugger.
'''
from __future__ import nested_scopes # Jython 2.1 support
import atexit
import os
import sys
import traceback
from _pydevd_bundle.pydevd_constants import IS_JYTH_LESS25, IS_PY3K, IS_PY34_OLDER, get_thread_id, dict_keys, dict_pop, dict_conta... | |
#!/usr/bin/env python
from math import pi
import numpy as np
from numpy.linalg import norm
import openmc
import openmc.model
import pytest
import scipy.spatial
_RADIUS = 0.1
_PACKING_FRACTION = 0.35
_PARAMS = [
{'shape': 'rectangular_prism', 'volume': 1**3},
{'shape': 'x_cylinder', 'volume': 1*pi*1**2},
... | |
"""Support command."""
import sublime
import sublime_plugin
import textwrap
import webbrowser
import re
__version__ = "1.3.2"
__pc_name__ = 'FindCursor'
CSS = '''
div.find-cursor { padding: 10px; margin: 0; }
.find-cursor h1, .find-cursor h2, .find-cursor h3,
.find-cursor h4, .find-cursor h5, .find-cursor h6 {
{{... | |
import datetime
from flask import Blueprint, render_template, url_for, request, redirect, flash
from flask.ext.login import login_required, current_user
from flask.ext.babel import to_user_timezone, to_utc, gettext
from rfk import CONFIG
import rfk.database
from rfk.database.show import Show, Series
from rfk.helper i... | |
"""
module for generating C, C++, Fortran77, Fortran90 and python routines that
evaluate sympy expressions. This module is work in progress. Only the
milestones with a '+' character in the list below have been completed.
--- How is sympy.utilities.codegen different from sympy.printing.ccode? ---
We considered the id... | |
from __future__ import division, print_function, absolute_import
from itertools import groupby
from warnings import warn
import numpy as np
from scipy.sparse import find, coo_matrix
EPS = np.finfo(float).eps
def validate_first_step(first_step, t0, t_bound):
"""Assert that first_step is valid and return it."""
... | |
#!/usr/bin/python
#
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#
import sys
import argparse
import ConfigParser
from vnc_api.vnc_api import *
from vnc_api.gen.resource_xsd import RouteType
from vnc_api.gen.resource_xsd import RouteTableType
from vnc_api.gen.resource_client import InterfaceRouteT... | |
# Copyright (c) 2010 Witchspace <witchspace81@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify,... | |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | |
from pyramid.view import (
view_config,
view_defaults
)
from pyramid.httpexceptions import (
HTTPSeeOther,
HTTPNotAcceptable
)
import logging
log = logging.getLogger(__name__)
#from pyramid.security import authenticated_userid
#from bson import ObjectId
@view_config(route_name='rest_asset_... | |
"""
Generate a random sample of rows from a relational database that preserves
referential integrity - so long as constraints are defined, all parent rows
will exist for child rows.
Good for creating test/development databases from production. It's slow,
but how often do you need to generate a test/development databa... | |
__author__ = 'stamylew'
import os
import numpy as np
import vigra.graphs as vg
import vigra.filters as vf
from python_functions.handle_h5.handle_h5 import read_h5, save_h5
import matplotlib.pyplot as plt
import skneuro.learning._learning as skl
from src.watershed.wsdt import wsDtSegmentation
from sklearn.metrics impor... | |
"""
A simple implementation of the Kalman Filter, Kalman Smoother, and EM
algorithm for Linear-Gaussian state space models.
Primarily adapted from Daniel Duckworth's pykalman library.
"""
import warnings
import numpy as np
import numpy.random
from numpy import shape, zeros, outer, dot, array, all, asarray
from scipy ... | |
# encoding: utf-8
import 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 'UserDetail'
db.create_table('website_userdetail', (
('id', self.gf('django.db.... | |
# -*- test-case-name: mqtt.client.test.test_base -*-
# ----------------------------------------------------------------------
# Original Copyright (C) 2012 by Adam Rudd
# Modifications and redesign by Rafael Gonzalez
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software an... | |
################################################################################
# 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... | |
from __future__ import absolute_import, unicode_literals
import logging
import os
import threading
import pykka
from mopidy import exceptions
from mopidy.audio import tags as tags_lib, utils
from mopidy.audio.constants import PlaybackState
from mopidy.audio.listener import AudioListener
from mopidy.internal import d... | |
"""
Define views for Polls application.
"""
from django.contrib import messages
from django.shortcuts import redirect, render, reverse
from django.views.generic import TemplateView
from django.forms import formset_factory
from .models import Poll, PollAnswer, PollOption
from .forms import PollForm, PollOptionForm, Vo... | |
#!/usr/bin/env python
# -*- mode: python; coding: utf-8 -*-
##################################################################
# Documentation
"""Module for reading and outputting data.
Attributes:
"""
##################################################################
# Imports
from __future__ import absolute_impo... | |
#!/usr/bin/env python
#
# Copyright 2007 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 o... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from collections import OrderedDict
import numpy as np
from astropy import log
from astropy.table import Table, vstack
from astropy.io.fits imp... | |
from __future__ import print_function, division
from sympy.core import Basic, S, Function, diff, Tuple, Expr
from sympy.core.relational import Equality, Relational
from sympy.core.symbol import Dummy
from sympy.functions.elementary.miscellaneous import Max, Min
from sympy.logic.boolalg import (And, Boolean, distribute... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.