gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
import abc
import os
import time
import markupsafe
import requests
from django.db import models
from framework.auth import Auth
from framework.auth.decorators import must_be_logged_in
from framework.exceptions import HTTPError, PermissionsError
from mako.lookup import TemplateLookup
from osf.models.base import BaseMod... | |
#
# Explore
# - The Adventure Interpreter
#
# Copyright (C) 2006 Joe Peterson
#
import string
import zlib
import base64
import ExpIO
import ExpUtil
from Player import *
from Room import *
from Command import *
RESULT_NOTHING = 0
RESULT_NORMAL = 1
RESULT_DESCRIBE = 2
RESULT_WIN = 4
RESULT_DIE = 8
RESULT_END_GAME ... | |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
This test basically just plays around with image.rollimg.
It has three examples
* image_reduce: this takes an Image having, say, an axis 't' and returns another
Image having reduced over 't'
* nee... | |
__author__ = 'Dennis'
from copy import copy
class Entity(object):
"""
The basic component in the simulation.
An Entity can perform actions and be acted on itself, and it can observe
It can observe other Entities.
An Entity is a self-contained unit and should not have any references
directly... | |
# Copyright 2012 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | |
# 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 applicab... | |
from __init__ import *
def test_clas_lens(strgcnfgextnexec=None):
pathimag = os.environ["PCAT_DATA_PATH"] + '/imag/'
dictargs = {}
dictargs['elemtype'] = ['lens']
dictargs['exprtype'] = 'hubb'
dictargs['elemtype'] = ['lens']
dictargs['maxmnumbelempop0reg0'] = 0
dictargs['numbele... | |
#
# MODULE ADAPTED FROM DJANGO
#
# Original file in django.core.urlresolvers
#
#
#
import re
from inspect import isclass
from djpcms.core.exceptions import ImproperlyConfigured, ViewDoesNotExist
from djpcms.http import get_http
from djpcms.utils import force_str
_view_cache = {}
class Resolver404(Exception):
p... | |
from __future__ import absolute_import
from django.utils.translation import ugettext as _
from django.http import HttpResponseRedirect, HttpResponse
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.views.decorators.csrf import csrf_exempt
from django.http import QueryDict, HttpResponseNotAllowed, HttpRe... | |
from django.contrib.admin.forms import forms
from muddery.utils.localiztion_handler import localize_form_fields
from muddery.utils.attributes_info_handler import CHARACTER_ATTRIBUTES_INFO, EQUIPMENT_ATTRIBUTES_INFO, FOOD_ATTRIBUTES_INFO
from muddery.worlddata.data_sets import DATA_SETS
def get_all_pocketable_objects... | |
#!/usr/bin/env python
"""A keyword index of client machines.
An index of client machines, associating likely identifiers to client IDs.
"""
from grr.lib import aff4
from grr.lib import keyword_index
from grr.lib import rdfvalue
from grr.lib import utils
from grr.lib.rdfvalues import client as rdf_client
# The syste... | |
"""Common settings and globals."""
from os.path import abspath, basename, dirname, join, normpath
from sys import path
## PATH CONFIGURATION
# Absolute filesystem path to the Django project directory:
DJANGO_ROOT = dirname(dirname(abspath(__file__)))
# Absolute filesystem path to the top-level project folder:
SITE_... | |
"""
kombu.utils
===========
Internal utilities.
"""
from __future__ import absolute_import, print_function, unicode_literals
import importlib
import numbers
import random
import sys
from contextlib import contextmanager
from itertools import count, repeat
from functools import wraps
from time import sleep
from uuid... | |
# -*- coding: utf-8 -*-
import numpy as np
# import scipy.ndimage
from scipy.stats import rv_continuous
from ..types import transformationType
def makeGaussian(x, y, x0, y0, sx, sy, rho, A):
num = (
(x - x0) ** 2 / sx ** 2
- 2 * rho / (sx * sy) * (x - x0) * (y - y0)
+ (y - y0) ** 2 / sy... | |
from __future__ import print_function, division, absolute_import
from time import sleep, time
import pytest
from toolz import concat, valmap, partial
from dask import compute, get
from dask.bytes.local import read_bytes, open_files, getsize
from dask.bytes.core import open_text_files
from dask.compatibility import F... | |
def direct_f(size, p_, cos_coef, sin_coef, l_max_dir, diff=False):
from numpy import zeros, real, imag
from numpy.fft import fft
f = zeros((size + 1, size / 2 + 1))
func1 = 0.0
func2 = 0.0
fa = zeros(size)
fb = zeros(size)
if diff:
for j in xrange(1, size / 2):
... | |
import fnmatch
import os
from django.conf import settings
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.db import models
from django.core.exceptions import ObjectDoesNotExist
from django.template.defaultfilters import slugify
from django.template.loader import ren... | |
# Copyright (c) 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 required by applicable law or agreed to in writ... | |
# Copyright [2015] Hewlett-Packard Development Company, L.P.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | |
# Copyright (c) 2010-2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | |
# -*- coding: utf-8 -*-
from itertools import count
import os
import logging
import warnings
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from django.db import DEFAULT_DB_ALIAS
from django.db.backends.base.creation import TEST_DATABASE_PREFIX
from django_extension... | |
import json
from mitmproxy.test import tflow
import os
import shlex
from mitmproxy import options
from mitmproxy import contentviews
from mitmproxy import proxy
from mitmproxy.addons import script
from mitmproxy import master
from mitmproxy.test import tutils
from mitmproxy.net.http import Headers
from mitmproxy.net... | |
'''
nlp:part of the wordfish python package: extracting relationships of terms from corpus
functions for simple natural language processing
'''
from textblob import TextBlob, Word
from nltk.corpus import stopwords
from nltk.stem.porter import *
from nltk.stem import *
import nltk.data
import numpy
import pandas
impor... | |
#!/usr/bin/python
import re
class CameraFrame(object):
STX = ''
ETX = ''
_PCT_C_RE = re.compile(r'%(\d*)c')
_PCT_D_RE = re.compile(r'%(\d*)d')
_PCT_S_RE = re.compile(r'%s')
def __init__(self, desc, confirm_format, control_format, reply_format,
checksum=False):
self.desc = desc
se... | |
"""
The Flask frontend for the GA4GH API.
TODO Document properly.
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import datetime
import socket
import urlparse
import functools
import flask
import flask.ext.cors as cors
import humanize
impor... | |
import time, collections, uuid, struct, re, socket, weblist, twisted.web.server, twisted.web.static
from twisted.internet.protocol import Factory, ClientFactory, Protocol, DatagramProtocol
from twisted.internet import reactor
from expirationset import expirationset
class GameServer:
def __init__(self, server_id, l... | |
import urllib
import os
import uuid
import requests
import stripe
import json
import flask
from flask import Flask, render_template, request, redirect, session, url_for, g
from flask.ext.sqlalchemy import SQLAlchemy
from flask_socketio import SocketIO
from flask_failsafe import failsafe
import calendar
import time
impo... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Program to (re)categorize images at commons.
The program uses commonshelper for category suggestions.
It takes the suggestions and the current categories. Put the categories through
some filters and adds the result.
The following command line parameters are supported:
-o... | |
# -*- coding: utf-8 -*-
"""
Class and methods to handle Job submission.
"""
import os as _os
import sys as _sys
from uuid import uuid4 as _uuid
from time import sleep as _sleep
from datetime import datetime as _dt
from subprocess import CalledProcessError as _CalledProcessError
# Try to use dill, revert to pickle if ... | |
'''
MFEM example 11
See c++ version in the MFEM library for more detail
How to run:
mpirun -np 2 python <arguments>
Example of arguments:
ex11p.py -m square-disc.mesh
ex11p.py -m star.mesh
ex11p.py -m escher.mesh
ex11p.py -m fichera.mesh
ex11p.py -m square-disc-p2.v... | |
#!/usr/bin/env python
# Copyright 2016 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.
"""
V8 correctness fuzzer launcher script.
"""
# for py2/py3 compatibility
from __future__ import print_function
import argparse
im... | |
# $Id$
from dpkt import Packet
# header_type
QQ_HEADER_BASIC_FAMILY = 0x02
QQ_HEADER_P2P_FAMILY = 0x00
QQ_HEADER_03_FAMILY = 0x03
QQ_HEADER_04_FAMILY = 0x04
QQ_HEADER_05_FAMILY = 0x05
header_type_str = [
"QQ_HEADER_P2P_FAMILY",
"Unknown Type",
"QQ_HEADER_03_FAMILY",
"QQ_HEADER_04_FAMILY",
"QQ_HEA... | |
import base64
import cookielib
import re
import os
import traceback
import urllib
import sys
from urlparse import parse_qs
from saml2 import BINDING_HTTP_REDIRECT, class_name
from saml2 import BINDING_HTTP_POST
from saml2.request import SERVICE2REQUEST
from saml2.sigver import signed_instance_factory, pre_signature_pa... | |
from datetime import date, timedelta
import re
from corehq.apps.reports.standard.cases.data_sources import CaseDisplay
from casexml.apps.case.models import CommCareCase
from django.utils.translation import ugettext as _
import logging
from corehq.util.dates import iso_string_to_datetime
from custom.bihar.calculations.u... | |
"""Environment for training multi-agent experiments."""
from copy import deepcopy
import numpy as np
import random
import traceback
from gym.spaces import Box
from traci.exceptions import FatalTraCIError
from traci.exceptions import TraCIException
from ray.rllib.env import MultiAgentEnv
from flow.envs.base_env impo... | |
import bpy
import mathutils
from mathutils import Vector
import csv
#from dateutil.parser import parse
from datetime import datetime
from math import ceil
import os
# If true, we only create a subset of data points.
DEBUG=False
# If DEBUG is true, this is how frequently to take a sample from the dataset
# ie. 5 would... | |
'''
Allow simulating a typewriter using texture projection
Ed Swartz, Feb 2016
'''
from panda3d.core import ScissorEffect, ColorWriteAttrib, CullBinManager, AmbientLight, DirectionalLight, PointLight
from panda3d.core import Point3, Mat4, TransparencyAttrib # @UnusedImport
from direct.interval.LerpInterval import Le... | |
"""Utility functions for use in templates / controllers
*PLEASE NOTE*: Many of these functions expect an initialized RequestConfig
object. This is expected to have been initialized for EACH REQUEST by the web
framework.
"""
import os
import re
import urllib
from routes import request_config
def _screenargs(kargs):
... | |
from __future__ import unicode_literals
from datetime import datetime
from decimal import Decimal
from django import forms
from django.conf import settings
from django.contrib import admin
from django.contrib.admin import helpers
from django.contrib.admin.utils import (
NestedObjects, display_for_field, flatten, ... | |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
Factory functions producing ABINIT Works.
Works are packed together in a flow. A flow can be ran using abirun (abipy)
Entry points for client code (high-level interface)
"""
from __future__ import unicode_li... | |
from __future__ import print_function, unicode_literals
import logging
import re
import itertools
from prompt_toolkit.completion import Completer, Completion
from .packages.sqlcompletion import suggest_type
from .packages.parseutils import last_word
from .packages.vspecial.namedqueries import namedqueries
try:
fro... | |
#!/usr/bin/env python
import argparse
import os
import subprocess
import sys
from lib.config import LIBCHROMIUMCONTENT_COMMIT, BASE_URL, PLATFORM, \
enable_verbose_mode, is_verbose_mode, get_target_arch
from lib.util import execute_stdout, get_electron_version, scoped_cwd
SOURCE_ROOT = os.pat... | |
"""
Utilities for interprocess communication between Python and Storm.
"""
from __future__ import absolute_import, print_function, unicode_literals
try:
import simplejson as json
except ImportError:
import json
import logging
import logging.handlers
import os
import sys
from collections import deque
from threa... | |
# -*- coding: utf-8 -*-
"""
***
Labelling is T O M B S
It depends on the distance between the baseline and its above and below valid (S) cut
Cuts are SIO
Copyright Naver Labs Europe(C) 2018 JL Meunier
Developed for the EU project READ. The READ project has received fun... | |
import py, os
from testing.test_interpreter import BaseTestInterpreter, hippy_fail
class TestFileOps(BaseTestInterpreter):
@py.test.mark.skipif("config.option.runappdirect",
reason="we have <input> only on hippy")
def test___file__(self):
output = self.run('echo __FILE__;')
... | |
from config.api2_0_config import *
from config.settings import *
from modules.logger import Log
from on_http_api2_0 import ApiApi as Api
from on_http_api2_0.rest import ApiException
from proboscis.asserts import *
from proboscis import SkipTest
from proboscis import test
from json import dumps, loads
from on_http_api2_... | |
# -*- coding: utf-8 -*-
#
# This file is part of PyBuilder
#
# Copyright 2011-2015 PyBuilder Team
#
# 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/l... | |
# encoding: utf-8
# -*- test-case-name: IPython.kernel.tests.test_engineservice -*-
"""A Twisted Service Representation of the IPython core.
The IPython Core exposed to the network is called the Engine. Its
representation in Twisted in the EngineService. Interfaces and adapters
are used to abstract out the details ... | |
# Copyright (C) 2013 eNovance SAS <licensing@enovance.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/licenses/LICENSE-2.0
#
# Unless required by applicabl... | |
""" Represent and manipulate text collections as a list of documents."""
from collections import defaultdict
import multiprocessing
from cort.analysis import data_structures
from cort.core import documents
from cort.core import spans
__author__ = 'smartschat'
def from_string(string):
return documents.CoNLLDocu... | |
import numpy as np
from statsmodels.tools.testing import ParamsTableTestBunch
est = dict(
rank=8,
N=3629,
Q=4.59536484786e-20,
J=1.66765790329e-16,
J_df=0,
k_1=8,
converged=1,
has_xtinst=0,
type=1,
n_eq=1,
k=8,
n_moments=8,
k_aux=8,
k_eq_model=0,
k_eq=8,
... | |
#
# Module implementing synchronization primitives
#
# multiprocessing/synchronize.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
from __future__ import absolute_import
__all__ = [
'Lock', 'RLock', 'Semaphore', 'BoundedSemaphore', 'Condition', 'Event',
]
import errno
... | |
# -*- coding: utf-8 -*-
"""
This module implements the GenNetwork class, which implements generic network
logic. Also implements Population and GenConnection classes
@author: DanielM
"""
from neuron import h
import random
import numpy as np
import matplotlib.pyplot as plt
import math
import time
import os
import shel... | |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from .common import *
# NAMESPACES = {'xmlns': 'http://www.w3.org/1999/xhtml'}
# https://blockly-demo.appspot.com/static/demos/code/index.html
class BlocklyXmlBuilderConstantTest(TestCase):
def _constant_test(self, statement, block_type, field_na... | |
try:
from urllib.parse import urlparse, urlunparse
except ImportError: # Python 2
from urlparse import urlparse, urlunparse
from django.conf import settings
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect, QueryDict
from django.template.response import TemplateResp... | |
"""
A GUI to automatically create the twist structure for a forearm.
To use this tool, select one or more wrist joints and enter the desired data
into the option fields before pressing either the Create or Apply button.
To skin to the model, the forearm mesh should be skinned in segments for each
twist joint, plus on... | |
# Copyright (c) 2013 Marion Zepf
# Copyright (c) 2014 Walter Bender
# 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, cop... | |
# 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 cPickle
import random
import ToonInteriorColors
from direct.directnotify import DirectNotifyGlobal
from direct.distributed import DistributedObject
from direct.task.Task import Task
from pandac.PandaModules import *
from toontown.toonbase import TTLocalizer
from toontown.toonbase.ToonBaseGlobal import *
from too... | |
from common import *
from jsonrpc import DataSource
import deduplication
import boar_exceptions
from copy import copy
""" A recipe has the following format:
{
"method": "concat",
"md5sum": "9b97d0a697dc503fb4c53ea01bd23dc7",
"size": 8469,
"pieces": [
{"source": "82a6c69d071b6d84b18912a2fa6725a... | |
"""
Generate a C++ DICOM dictionary from a text file.
This program will read a text file generated from the DICOM data
element regsistry table (DICOM Chapter 6 part 6) and will generate
a hash table that can be used for dictionary lookups.
Usage: python makedict.py nemadict.txt > vtkDICOMDictHash.cxx
Usage: python ma... | |
import sys
import threading
import weakref
# from django.utils.six.moves import xrange
from six.moves import xrange
if sys.version_info < (3, 4):
from .weakref_backports import WeakMethod
else:
from weakref import WeakMethod
def _make_id(target):
if hasattr(target, '__func__'):
return (id(target... | |
# 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 sys
import numpy as np
import theano
import theano.tensor as T
from theano.sandbox.cuda import dnn
from theano.sandbox.cuda.basic_ops import gpu_contiguous
from pylearn2.sandbox.cuda_convnet.filter_acts import FilterActs
from pylearn2.sandbox.cuda_convnet.pool import MaxPool
from pylearn2.expr.normalize import ... | |
"""
Unit tests for the `ambient` module of ``TAMOC``
Provides testing of all of the functions, classes and methods in the `ambient`
module. These tests rely on data stored in the ``./data`` folder and will
write data to and read data from the ``./test/output`` folder.
"""
# S. Socolofsky, July 2013, Texas A&M Univers... | |
# Copyright (c) 2010-2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | |
# Copyright (C) 2015 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2015 YAMAMOTO Takashi <yamamoto at valinux co jp>
#
# 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:... | |
import pytest
from netaddr import cidr_abbrev_to_verbose
from netaddr.strategy.ipv4 import expand_partial_address
def test_cidr_abbrev_to_verbose():
octets = range(0, 256)
cidrs = [cidr_abbrev_to_verbose(octet) for octet in octets]
assert len(cidrs) == 256
assert cidrs == [
'0.0.0.0/8',
... | |
"""
Convention:
"attr" means the original attribute object.
"pattr" means class PrettyAttribute instance.
"""
from __future__ import print_function
import inspect
import platform
from sys import _getframe
from typing import Any
from typing import List
from typing import Optional
from typing import Tuple
from ._inter... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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 compli... | |
# 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 logging
import os
import re
import uuid
from django.core.urlresolvers import reverse
from django.db import models
from django.utils.translation import ugettext as _
from core.exceptions import ServiceUnavailable
from core.helpers import generate_ssh_keys, make_rest_post_call
from github.api import get_branch_d... | |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import decimal
import json
from django.contrib.auth import logout as auth_logout
from django.contrib import messages
from django.core.urlresolvers import reverse_lazy, reverse
from django.http import HttpResponse
from django.shortcuts import render, redir... | |
from functools import partial
import os
import warnings
import numpy as np
from scipy import sparse, linalg, stats
from numpy.testing import (assert_equal, assert_array_equal,
assert_array_almost_equal)
from nose.tools import assert_true, assert_raises
from mne.parallel import _force_serial... | |
#!/usr/bin/env python
"""
Project-wide application configuration.
DO NOT STORE SECRETS, PASSWORDS, ETC. IN THIS FILE.
They will be exposed to users. Use environment variables instead.
See get_secrets() below for a fast way to access them.
"""
import os
from authomatic.providers import oauth2
from authomatic import ... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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 compli... | |
# -*- coding: utf8 -*-
# Most of the test cases here are from isodate package from:
# - Homepage: http://cheeseshop.python.org/pypi/isodate
# - Author: Gerhard Weis <gerhard weis at proclos com>
# - License: BSD
import os
import unittest
from datetime import date, datetime, time
from isodate import parse_date... | |
'''using scipy signal and numpy correlate to calculate some time series
statistics
original developer notes
see also scikits.timeseries (movstat is partially inspired by it)
added 2009-08-29
timeseries moving stats are in c, autocorrelation similar to here
I thought I saw moving stats somewhere in python, maybe not)... | |
"""JOSE Web Signature."""
import argparse
import base64
import sys
import OpenSSL
import six
from acme.jose import b64
from acme.jose import errors
from acme.jose import json_util
from acme.jose import jwa
from acme.jose import jwk
from acme.jose import util
class MediaType(object):
"""MediaType field encoder/d... | |
class system_function(object):
""" Class for representing system functions (transfer funtions) on the form:
jw -jw -jwM
jw B(e ) b[0] + b[1]e + .... + b[M]e
H(e ) = ------ = -----------------------------------
jw -jw... | |
from __future__ import absolute_import
from copy import copy
from itertools import chain
import os
import re
import sys
import shlex
from tempfile import NamedTemporaryFile
from django.utils.encoding import smart_str
try:
from urllib.request import pathname2url
from urllib.parse import urljoin
except ImportE... | |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: mysqlctl.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _refl... | |
# Copyright (c) 2015 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | |
## Module statistics.py
##
## Copyright (c) 2013 Steven D'Aprano <steve+python@pearwood.info>.
##
## 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/li... | |
# 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... | |
# Copyright 2013 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file acc... | |
# ref ID: 7
config = {
"name": "Dungeon Arena", #plugin name
"type": "generator", #plugin type
"description": ["Dungeon Arena"] #description
}
import sys
from collections import defaultdict
if __name__ == "__main__":
sys.path.extend(["."])
import os
os.chdir("..")
del (os)
from pgu im... | |
from collections import namedtuple
debug = True
edge = namedtuple('edge',['src','dst','cost'])
class minimum_mean_cycle_states:
def __init__(self, number_of_nodes, edges):
self.time = 0
# This represents the time when the node is reached
self.start_time = [None] * number_of_nodes
... | |
import gc
from clang.cindex import CursorKind
from clang.cindex import TranslationUnit
from clang.cindex import TypeKind
from nose.tools import raises
from .util import get_cursor
from .util import get_tu
kInput = """\
typedef int I;
struct teststruct {
int a;
I b;
long c;
unsigned long d;
signed long e;
... | |
# Copyright 2013 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | |
import logging
import warnings
import sys
import os
from os import path as op
import inspect
from functools import wraps
import subprocess
import numpy as np
import nibabel as nib
from scipy import sparse
from scipy.spatial.distance import cdist
import matplotlib as mpl
from matplotlib import cm
logger = logging.getL... | |
## Automatically adapted for numpy.oldnumeric Jun 27, 2008 by -c
# $Id$
#
# Copyright (C) 2007 by Greg Landrum
# All rights reserved
#
from rdkit import Geometry
from rdkit.Chem.Subshape import SubshapeObjects
import math
import numpy
#-----------------------------------------------------------------------------
de... | |
import core.modules
import core.modules.module_registry
from core.modules.vistrails_module import Module, ModuleError
import numpy
class ArrayModule(object):
my_namespace = 'numpy|array'
class NDArray(Module, ArrayModule):
""" Container class for the numpy.ndarray class """
def __init__(self):
Mo... | |
from __main__ import vtk, qt, ctk, slicer
import numpy
import copy
from math import *
from slicer.ScriptedLoadableModule import *
import os
import pickle
import time
from slicer.util import VTKObservationMixin
class ModelAddedClass(VTKObservationMixin):
def __init__(self, anglePlanes):
VTKObservationM... | |
import datetime
import re
import random
import time
import redis
from utils import log as logging
from django.http import HttpResponse
from django.conf import settings
from django.db import connection
from django.template import Template, Context
from apps.profile.tasks import CleanupUser
from apps.statistics.rstats im... | |
# Copyright 2013 Red Hat, 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... | |
# -*- coding: utf-8 -*-
"""
Holds functions that compute implication covers for a given context
"""
import copy
import closure_operators
from fca.implication import Implication
import fca
def compute_implication_cover(cxt, close=closure_operators.closure):
"""
Compute an implication cover for a given *cxt* ... | |
import collections
import pandas as pd
import numpy as np
from openpathsampling.netcdfplus import StorableNamedObject
class ChannelAnalysis(StorableNamedObject):
"""Analyze path sampling simulation for multiple channels.
User defines several channels (e.g., mechanisms) as :class:`.Ensemble`
objects. This... | |
from __future__ import absolute_import, division, print_function
import locale
import re
import os
import sys
import stat
from glob import glob
from os.path import (basename, dirname, join, splitext, isdir, isfile, exists,
islink, realpath, relpath)
try:
from os import readlink
except ImportEr... | |
# -*- coding: utf-8 -*-
# Copyright (c) 2014 Baidu.com, 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 req... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.